VIM: Adds check around clipboard mappings and auto correct spelling

master
Jonathan Hodgson 4 years ago
parent fa9e7ef249
commit 2ab9b7a9b4
  1. 3
      nvim/.config/nvim/.netrwhist
  2. 13
      nvim/.config/nvim/plugin/mappings.vim

@ -0,0 +1,3 @@
let g:netrw_dirhistmax =10
let g:netrw_dirhistcnt =1
let g:netrw_dirhist_1='/home/jonathan/.dotfiles/nvim/.config/nvim/plugin'

@ -15,7 +15,20 @@ nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-l> <c-w>l
if has('clipboard')
" Make Ctrl C and Ctrl V work on system clipboard
" if in visual or insert mode respectively
vnoremap <C-c> "+y
inoremap <C-v> <Esc>"+pa
endif
" Fix previous spelling mistake in insert mode
" Shamelessly taken from https://castel.dev/post/lecture-notes-1/
" <c-g>u - break undo sequence (new change)
" <Esc> - go into normal mode
" [s - go to previous spelling mistake
" 1z= - change to the top spelling suggestion
" `] - go to the end of the last changed word
" a - enter insert mode
" <c-g>u - break undo sequence (new change)
inoremap <C-l> <c-g>u<Esc>[s1z=`]a<c-g>u

Loading…
Cancel
Save