Tuesday, December 6, 2011

Using spell check in vim

Vim is my text editor of choice. It is flexible, efficient, and .... well, I could specify much more features, but honestly, using vim makes you feel geek. And that's enough form me. :)) Yeah, of course Emacs is cool also. :)) Anyway, having spell check in vim (just as in any text editors) is a minimal requirement in 2011. Of course, Vim 7 has built in spell checking. In order to switch it on, add the following lines to your .vimrc file:

syn spell toplevel
set spell spelllang=en_us
(or whatever language you speaks)

Then, mispelled words will be underlined in red in Gvim, and highlighted in Vim.

Some useful commands:

  • ]s  move to the next mispelled word
  • [s   move to the previous mispelled word
  • zg   add a word to the dictionary
  • zug   undo the addition of a word to the dictionary
  • z=   view spelling suggestions for a mispelled word
For more information, type :help spell in Vim/Gvim.

No comments:

Post a Comment