There is a new version of Vim that will do spell checking. We used version 7.0131 available here. Grab the source, extract, compile, and install:
[root@www src]# cd vim7 [root@www vim7]# ls vim-7.0131.zip [root@www vim7]# unzip *.zip Archive: vim-7.0131.zip Vim 7 snapshot version 7.0131 inflating: src/README.txt inflating: src/arabic.c inflating: src/arabic.h inflating: src/ascii.h inflating: src/buffer.c . . . inflating: src/po/zh_TW.UTF-8.po inflating: src/po/zh_TW.po inflating: src/auto/config.mk [root@www vim7]# cd src [root@www src]# ls arabic.c gui_kde.cc INSTALLpc.txt . . . gui.h installml.sh os_amiga.h structs.h [root@www src]# vim -c make rm -f auto/config.status auto/config.cache config.log auto/config.log rm -f auto/config.h auto/link.log auto/link.sed auto/config.mk touch auto/config.h cp config.mk.dist auto/config.mk GUI_INC_LOC="" GUI_LIB_LOC="" \ CC="" CPPFLAGS="" CFLAGS="" \ LDFLAGS="" srcdir="." \ ./configure \ \ \ \ . . . OLD_PO_FILE_INPUT=yes msgfmt -v -o uk.cp1251.mo uk.cp1251.po 1289 translated messages. OLD_PO_FILE_INPUT=yes msgfmt -v -o zh_CN.cp936.mo zh_CN.cp936.po 1283 translated messages. make[2]: Leaving directory `/usr/local/src/vim7/src/po' make[1]: Leaving directory `/usr/local/src/vim7/src' Hit ENTER or type command to continue [root@www src]# [root@www src]# make install if test -f /usr/local/bin/vim; then \ mv -f /usr/local/bin/vim /usr/local/bin/vim.rm; \ rm -f /usr/local/bin/vim.rm; \ fi cp vim /usr/local/bin strip /usr/local/bin/vim chmod 755 /usr/local/bin/vim . . . s/locolor/16x16/apps \ -a ! -f /usr/local/share/icons/locolor/16x16/apps/gvim.png; then \ cp ../runtime/vim16x16.png /usr/local/share/icons/locolor/16x16/apps/gvim.png; \ fi |
The spell files are located here:
[root@www src]# ls /usr/local/share/vim/vim70aa/spell -l total 1680 -rw-r--r-- 1 root root 566603 Aug 19 06:40 en.ascii.spl -rw-r--r-- 1 root root 568698 Aug 19 06:40 en.latin1.spl -rw-r--r-- 1 root root 569129 Aug 19 06:40 en.utf-8.spl |
Let’s start up vi:
$ vi ~ Vi IMproved ~ ~ version 7.0aa ALPHA ~ by Bram Moolenaar et al. ~ Vim is open source and freely distributable ~ ~ Help poor children in Uganda! ~ type :help iccf<Enter> for information ~ ~ type :q<Enter> to exit ~ type :help<Enter> or <F1> for on-line help ~ type :help version7<Enter> for version info |
To turn on spelling for English/US:
:setlocal spell spelllang=en_us |
Put map commands in your .vimrc file to associate function keys with turning on and off the spell checking:
map <F10> <Esc>:setlocal spell spelllang=en_us<CR> map <F11> <Esc>:setlocal nospell<CR> |
With this mapping, F10 turns on spell checking, and F11 turns it off. Here is what the spell check highlighting looks like: