How can I check spelling in gVim?

What is the best way to spell check in gVim? Is there an add-on or something else? I would also suggest corrections.

+49
vim spell-checking
Mar 12 '09 at 20:28
source share
4 answers

Use :set spell to enable spell checking. If it's source code, gvim is smart enough to only spell check comments and string literals.

:help spell will give you all the details. Here are a few excerpts:

  To search for the next misspelled word:

 ] s Move to next misspelled word after the cursor.
              A count before the command can be used to repeat.
              'wrapscan' applies.

 [s Like "] s" but search backwards, find the misspelled
              word before the cursor.  
  Finding suggestions for bad words:

 z = For the word under / after the cursor, suggest correctly
              spelled words.
  To add words to your own word list:

 zg Add word under the cursor as a good word

Also see :help set spelllang information on changing your vocabulary to include other regions, languages, or word sets (e.g. medical jargon).

gvim must be compiled with | + syntax |.

I don't put :set spell in my .vimrc, because when I code, there are too many variable names in my comments that are tagged. If there is a specific type of file that you want to check, use the auto command in your .vimrc. Or just turn it on manually when you need it.

+96
Mar 12 '09 at 20:31
source share

Do :set spell to enable spell checking. See :h spell for help and information on how spell checking works and how to use different languages ​​and dictionaries, etc.

+4
Mar 12 '09 at 20:37
source share
 :setlocal spell spelllang=en_us :set spell 

To check spelling and activate the right mouse button:

 :set mousemodel=popup 

When you place your cursor over a word and press the right button, gvim will assign different correct words.

You can put it on your ~/.vimrc

+4
Jul 19 '12 at 12:05
source share

I started using

Aspell

which comes with Cygwin ( http://www.cygwin.com/ ). (This is a package, but the default installation plus the manually added aspell is quite tiny and fast to load.)

When I want to check the current file, I use the function defined in my .vimrc (or _vimrc), which saves the file, runs aspell on it, and then reloads the file:

 :function! SpellCheck() : w! : !c:\prog\cygwin\bin\aspell.exe --dont-backup check "%" : e! % :endfunction 

to use this function, I just do:

 :call SpellCheck() 

It goes through the file, like Microsoft Word, I exit, and then the file is reloaded with corrections.

Running aspell from the outside without having to move the mouse is integrated enough for me. I never liked spelling on the fly. I find this, and things like IntelliSense are distracting.

+2
Aug 14 '09 at 23:21
source share



All Articles