VIM: Adds check around clipboard mappings and auto correct spelling

Jonathan Hodgson 4 years ago
parent 7943ce0359
commit 2a41c795bd
  1. 3
      nvim/.config/nvim/.netrwhist
  2. 21
      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
" 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
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