dotfiles/.config/nvim/init.vim
hoellen 4d261ef46e Update Neovim config
- cursorline
  - splitbelow and splitright
  - reorganize lua config and mapleader
2023-08-17 13:53:07 +02:00

54 lines
980 B
VimL

let mapleader = "\<space>"
" General editor config
language en_US
set number
set scrolloff=3
set sidescroll=3
set tabstop=4
set shiftwidth=4
set cursorline
set nowrap
set ignorecase
set smartcase
set smartindent
set mouse=a
set showmatch
set undofile
set shortmess=I "disable intro message
set splitbelow
set splitright
" Key mapping
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()
" Load lua config
lua require('config')