feat(nvim): add more mappings

Add key mappings for easily moving text and some small behaviour tweaks.
This commit is contained in:
Oliver Davies 2021-10-13 23:51:09 +01:00
parent b64abbfacb
commit 1fa5e57b9b

View file

@ -47,6 +47,19 @@ call s:SourceConfigFilesIn('plugins')
nnoremap <Leader>so :so ~/.config/nvim/init.vim<CR>
nnoremap <Leader>x :!chmod +x %<CR>
" Yank from the current column to the end of the line
nnoremap Y yg$
" Move lines up and down
inoremap <M-j> <Esc>:m .+1<CR>==gi
inoremap <M-k> <Esc>:m .-2<CR>==gi
vnoremap <M-k> :m '<-2<CR>gv=gv
vnoremap <M-j> :m '>+1<CR>gv=gv
" Keep things centred
nnoremap n nzzzv
nnoremap N Nzzzv
" Remove arrow keys
noremap <up> <nop>
noremap <down> <nop>