nvim: Add fix last spelling mistake mapping

Added a quick way to fix the last spelling mistake: Use <c-s> while
writing (in insert mode) or localleader-s while in normal mode.
It will fix the mistake and keep your cursor at the current position.
This commit is contained in:
Marty Oehme 2023-01-12 22:56:51 +01:00
parent 369345880d
commit 0a867ee992
Signed by: Marty
GPG Key ID: 73BA40D5AFAF49C9
1 changed files with 6 additions and 5 deletions

View File

@ -198,13 +198,14 @@ map.i.nore.silent['@@'] = '<c-g>u<c-o>:CiteRef<cr>'
-- map <leader>cc to insert a complete citation at cursor
-- SPELL CHECKING
-- Spell check set to <leader>O, 'o' for 'orthography':
-- Move to the prev/next spelling error with [S ]S
-- Move to the prev/next spelling error or suggestion with [s ]s
map.n.nore['<leader>ZZ'] = ':setlocal spell! spelllang=en_us,de_de<cr>'
map.n.nore['<leader>ZE'] = ':setlocal spell! spelllang=en_us<cr>'
map.n.nore['<leader>ZG'] = ':setlocal spell! spelllang=en_us<cr>'
map.n.nore['<leader>zz'] = '1z='
map.n.nore['<localleader>ZZ'] = ':setlocal spell! spelllang=en_us,de_de<cr>'
map.n.nore['<localleader>ZE'] = ':setlocal spell! spelllang=en_us<cr>'
map.n.nore['<localleader>ZG'] = ':setlocal spell! spelllang=de_de<cr>'
-- undo last spelling mistake from insert and normal mode
map.i.nore['<c-s>'] = '<C-G>u<Esc>[s1z=`]a<C-G>u'
map.n.nore['<localleader>s'] = 'ms[s1z=`s'
-- pp to comPile a document (or file, works for some languages like go/python/c)
-- o to open the resulting document (mostly for pdfs)