Add Neovim config
This commit is contained in:
47
.config/nvim/init.vim
Normal file
47
.config/nvim/init.vim
Normal file
@ -0,0 +1,47 @@
|
||||
" Load lua config
|
||||
lua require('config')
|
||||
|
||||
" General editor config
|
||||
set number
|
||||
set scrolloff=3
|
||||
set sidescroll=3
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set nowrap
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set smartindent
|
||||
set mouse=a
|
||||
set showmatch
|
||||
set undofile
|
||||
set shortmess=I "disable intro message
|
||||
|
||||
" Key mapping
|
||||
let mapleader = "\<space>"
|
||||
nnoremap \\ :noh<cr> " Clear higlighting
|
||||
|
||||
set listchars=tab:▸\ ,eol:↵,space:.
|
||||
nnoremap <leader>l :set list!<CR>
|
||||
|
||||
" enable copy to clipboard
|
||||
map <Leader>y "+y
|
||||
map <Leader>p "*p
|
||||
|
||||
" Align block of text and keep them selected
|
||||
vmap < <gv
|
||||
vmap > >gv
|
||||
|
||||
" jk is escape
|
||||
inoremap jk <ESC>
|
||||
|
||||
" Jump to the last position when reopening a file
|
||||
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
||||
|
||||
" Trim Whitespaces
|
||||
fun! TrimWhitespace()
|
||||
let l:save = winsaveview()
|
||||
keeppatterns %s/\s\+$//e
|
||||
call winrestview(l:save)
|
||||
endfun
|
||||
command! TrimWhitespace call TrimWhitespace()
|
||||
|
19
.config/nvim/lua/config.lua
Normal file
19
.config/nvim/lua/config.lua
Normal file
@ -0,0 +1,19 @@
|
||||
-- lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Plugins
|
||||
require("lazy").setup({
|
||||
--"lukas-reineke/indent-blankline.nvim", --Indent guides for Neovim
|
||||
})
|
||||
|
Reference in New Issue
Block a user