Yenya's World

Fri, 01 Feb 2008

Spell-Checking in VIM

Mirek has asked me how do I spell-check my (preferably TeX) documents. Well, I don't, but his question made me wonder how spell-checking in Vim is done.

screenshot of spell-checking

Deny has suggested this howto by Pavel Satrapa. It is basically correct, but the details are outdated. Moreover, I need something more: I usually write in three modes: English, Czech, and Czech in US-ASCII (without diacritics). So I need a Czech dictionary in ASCII.

Firstly, here is the Czech dictionary for Vim. Put it into ~/.vim/spell/ (or to a system-wide $VIMRUNTIME/spell/ - see :echo $VIMRUNTIME for the exact location).

For Czech ASCII spell-checking, I have downloaded the data (you need the file). Unpack it, convert cs_CZ.dic and cs_CZ.aff into ASCII (iconv -f iso-8859-2 -t us-ascii//TRANSLIT), rename them to (say) csa.dic and csa.aff, run the :mkspell csa command in vim, and move the resulting csa.utf-8.spl file to the same directory as the original cs.utf-8.spl.

Now set Vim to use these dictionaries using "set spelllang=cs,en,csa" and "set spell" commands in your ~/.vimrc, and you should be able to test it. Remember to disable the "csa" language when writing a document which should be strictly with diacritics. Further reading: Vim documentation: spell.

Section: /computers (RSS feed) | Permanent link | 2 writebacks

2 replies for this story:

petr_p wrote:

I dream of the day when all applications will use one dictionary… BTW, "spell check" as a verb should be written with hyphen. I read "Mirek has asked me how do I spell `check my documents'" and I wonderd how you could write an article about "C H E C K…" :)

Yenya wrote: Re: petr_p

Fixed, thanks.

Reply to this story:

URL/Email: [http://... or mailto:you@wherever] (optional)
Title: (optional)
Key image: key image (valid for an hour only)
Key value: (to verify you are not a bot)


Yenya's World: Linux and beyond - Yenya's blog.


RSS feed

Jan "Yenya" Kasprzak

The main page of this blog



Blog roll:

alphabetically :-)