refactor(nvim): split mappings into their own file

This commit is contained in:
Oliver Davies 2021-10-14 00:06:23 +01:00
parent 1fa5e57b9b
commit 00ffae0590
2 changed files with 26 additions and 25 deletions

View file

@ -43,29 +43,6 @@ set termguicolors
call s:SourceConfigFilesIn('plugins')
" Remaps
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>
noremap <left> <nop>
noremap <right> <nop>
autocmd FileType gitcommit highlight ColorColumn ctermbg=8
autocmd FileType gitcommit setlocal colorcolumn=50,72
autocmd FileType gitcommit setlocal textwidth=72
@ -74,6 +51,4 @@ autocmd FileType gitcommit setlocal spell
" Display extra whitespace
set list listchars=tab:»·,trail
nnoremap <silent> <C-f> :silent !tmux neww tmux-sessioniser<CR>
lua require("opdavies")

View file

@ -0,0 +1,26 @@
" Source the current file
nnoremap <Leader>so :so ~/.config/nvim/init.vim<CR>
" Make the current file executable
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>
noremap <left> <nop>
noremap <right> <nop>
nnoremap <silent> <C-f> :silent !tmux neww tmux-sessioniser<CR>