I am using vim as a note-taking app.
Following an earlier answer here , I have the following mappings which allow me to quickly correct earlier spelling mistakes:
" spelling
imap <C-l> <c-g>u<Esc>[s1z=`]a<c-g>u
nmap <C-l> [s1z=<c-o>
This works really well, however sometimes my notes contains acronyms etc which are marked as spelling mistakes but are not, and would ideally be skipped
Is there a way of modifying the command to tell vim : "skip the first n spelling mistakes , counting backwards from here" , eg by typing something like 2<C-L>
to correct only from the 2nd spelling mistake backwards (ie skipping the first one). I would then hope to be able to repeat that command to continue correcting from there on.
Currently I move the cursor to just before where I want the correction to apply, but maybe there is a better way.
<C-L>
mapping is a nice shortcut to quickly fix the last one as you notice it... But beyond that, doesn't that justify actually going back to Normal mode, moving to the one you want to fix, fixing it and then going back to insertion? Yeah that's quite a few keystrokes, but it should be rare enough that you don't need to resort to it that often...inoremap <C-L> <C-g>u<Esc>:execute 'normal!' v:count1."[s"<CR>1z=`]a<C-g>u
, maybe? EDIT that won't work becuase insert-mode maps can't get counts…count."[s"
part... Not only it's pretty complicated to do right, it's also a somewhat clunky user interface. Which begs the question: Is it worth it? If you're doing this often, maybe you should update your dictionary? If you're not, then maybe switching to Normal mode isn't too bad?