Stjepan Groš

vi tips & tricks

Stuff collected from different places. Majority of this came from the one Slashdot discussion. I don't know if there is something like Did you know... welcome screens (fortune might be, I'll have to check) but from this stuff I would like to write it at some point.

All your comments, criticisms and a like please send me on my e-mail address!

Spelling checking

Enabling spell checking

To enable spell checking in vi just execute the following command:

:setlocal spell

This will enable spell checking of English language. You can also ask for suggestions. Just place cursor on misspelled word and press z=. You'll be provided with a list of suggestions you can select from.

Installing spell files

vi, at least in Fedora, comes without any spell checking dictionary except for English. In order to be able to spell check Croatian and other languages you have to run vi as a root and then try to enable spell checking in a language you need, e.g. for Croatian:

:setlocal spell spelllang=hr_HR

vi will then ask you if you wish to download dictionaries for hr language and guide you through the installation process, which is very simple.

Links to other similar sites

[20120610] Best of Vim Tips
VI wiki with tips
Scripting the Vim editor, Part 1: Variables, values, and expressions
Best of Vim Tips
Vim anti-patterns