Saturday, May 17. 2008

gvim spell correction popup menu

I gvim, if you set

:setlocal spell spelllang=en_us

gvim will spell-check your file and underline wrongly spelled words with a red line much like you know it from OpenOffice. If you

:set mousemodel=popup

you can even right click on any misspelled word to get a list of suggested corrections.

However, this sometimes did not work for me. I could not figure out a reason, until I read the help docs again, which clearly say:

Note for GTK: don't release the right mouse button until the menu appears, 
otherwise it won't work.

They actually mean what they say: if I release the right mouse button too fast, the menu appears, but it does not replace the misspelled word with the corrected word. Only if keep the right mouse pressed until the menu appears, it works, for whatever reason. RTFM!