I frequently need to correct files that have numerous spelling errors. Spellcheck tags all these words, but is there a command or function within vim that will dump all these tagged words to a file?
My SpellCheck plugin provides a command that populates Vim's quickfix list with all spelling errors. This is even better than dumping to a file in that you can quickly locate each spelling error. It also sets up mappings in the quickfix list to "remotely" correct / add to spell dict the mistakes.
-
Karkat Thank you for your response. Afraid I decided there was no such command, so I wrote this mapping to do so
code
map <F10> qzq:w y<CR>:setlocal spell spelllang=en<CR>:let wds=""<CR>:while line('.')>=@z<CR>:let @z=line('.')<CR>:norm ]syw<CR>:let wds=wds.@".' '<CR>:endwhile<CR>:e y.vim<CR>ggdG:exe setline(1, wds)<CR>gg:s/ \+/\r/ge<CR>:sort u<CR>code
I need it as a file, y.vim, because I semi-automatically turn this into a vimscript of substitute commands – user985675 May 2 '15 at 16:38