refactor(nvim): split mappings into their own file
This commit is contained in:
parent
1fa5e57b9b
commit
00ffae0590
|
@ -43,29 +43,6 @@ set termguicolors
|
||||||
|
|
||||||
call s:SourceConfigFilesIn('plugins')
|
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 highlight ColorColumn ctermbg=8
|
||||||
autocmd FileType gitcommit setlocal colorcolumn=50,72
|
autocmd FileType gitcommit setlocal colorcolumn=50,72
|
||||||
autocmd FileType gitcommit setlocal textwidth=72
|
autocmd FileType gitcommit setlocal textwidth=72
|
||||||
|
@ -74,6 +51,4 @@ autocmd FileType gitcommit setlocal spell
|
||||||
" Display extra whitespace
|
" Display extra whitespace
|
||||||
set list listchars=tab:»·,trail:·
|
set list listchars=tab:»·,trail:·
|
||||||
|
|
||||||
nnoremap <silent> <C-f> :silent !tmux neww tmux-sessioniser<CR>
|
|
||||||
|
|
||||||
lua require("opdavies")
|
lua require("opdavies")
|
||||||
|
|
26
nvim/.config/nvim/plugins/mappings.vim
Normal file
26
nvim/.config/nvim/plugins/mappings.vim
Normal 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>
|
Loading…
Reference in a new issue