Skip to main content

Live Spellchecking Inside Vim

Did you ever want the capability of live spell-checking inside vi? Well, I did and I googled the subject and found this simple solution.

Assuming you have some sort of spell-checking software like ispell and agrep installed on your machine, you can use the "Engspchk" set of scripts for "multi-language", "on-the-fly spell checking." While the package documentation is pretty good, I will go ahead and narrow it down to a clean procedure.

1) Download the scripts, Unzip/untar them into your .vim directory.
cp engspchk.tar.gz $HOME/.vim/
cd $HOME/.vim/

tar zoxvf engspchk.tar.gz
2) Open your ~/.vimrc file and add this piece
" This piece enables live spellchecking inside Vim"
set nocp
if version >= 600
filetype plugin indent on
endif

set mouse=a
let g:spchkmouse = 1
let g:spchkautonext= 1
let g:spchkdialect = "usa"

3) Open a file using vi and enter ':helptags $HOME/.vim/doc'
4) To invoke the English spell-checker for a particular file, simply type '\ec'.
5) You can navigate through the spell-checking process using the following instructions:
* use leftmouse in text window to go to the next spelling error
irrespective of where the mouse was (allows one to skip over
spelling errors)
* use
leftmouse in the alternative spelling window to choose
the correct spelling and fix the word
* use
middlemouse in text window to go to next spelling error
based on where the mouse is
* use
rightmouse in text window to back up to the preceding
spelling error
* use
rightmouse in the alternative spelling window to fix all
such misspelled words
The three most relevant commands are:
\ec (engspchk's startup map)
\en (jump to next spelling error)
\ee (end engspchk)
The nice thing about this spellchecker is that it does not constantly hound you like others, it acts only when you invoke it.

Comments

BT08 said…
I noticed that 'set mouse=n' and 'set mouse=a' disable highlighting any piece of text using your mouse. One way to fix that is to change the command in your ~/.vimrc to 'set mouse=v'.

Popular posts from this blog

Correlation Between Taxes and Social/Economic Programs

I have always wondered if the taxes people pay correlate with the availability of social and economic programs and safety nets, not to mention the military programs that protect them. This idea comes in light of the notion that Europeans are highly taxed compared to their American counterparts, but they seem to have access to free (or almost free) education and health care while the US provides neither. The Europeans live and work at a more leisurely pace than Americans and they have the comfort of knowing that their government has put safety nets in case a disaster. The Europeans do a lot to ensure that all their citizens have comparable opportunities, and thus you are less likely to see a huge gap between the poor and the rich. Perhaps the lack of incentive to excel has stifled entrepreneurship and innovation in Europe to some extent. In fact, Europe has historically high unemployment rates than the US and the size of government there is significantly larger than that of the US....

Plea to Barack on Foreign Aid

Barack Obama has been my candidate of choice from the beginning. I have outlined a few of the reasons I support him . One I didn't mention is the issue of foreign aid. As I discussed earlier, US government's foreign aid as a % of its GDP is one of the lowest for any developed nation. Economic Aid to Developing Countries - The Stats To make it worse, much of the aid is given to two sources: Military and economic aid to Israel and Egypt to keep some peace in the Middle East Colombia, Peru and Bolivia to fight drug The tiny bit that is left goes to countries where the US has foreign policy interests. The aid is used for political leverage. Here is where Barack Obama comes into the picture. He has said that diplomacy and restoration of American image in the world would be the pillars of his foreign policy. One way to improve America's image in the world is to provide more foreign aid, particularly one that is not directly used for political leveraging. Obama promised ...

Obama, McCain and Campaign Financing

Obama and McCain had at one point both agreed to take public financing in September 2007 if they were their respective party's nominee. At the time, they were both long shots to get their party's nomination, but oddly enough they have both made it to the general election. As for their promise to take public financing, McCain decided to keep his promise while Obama opted to finance his campaign through his own fundraising. In doing so, he became the first ever presidential candidate to forego public financing during the general election. In February 2008, McCain started criticizing Obama for not keeping his promise to take public financing. How legitimate are McCain's accusations? That's what I wanted to discuss. According to The New York Times campaign finance page , Obama and McCain raised $401m and ~$150m, respectively, prior to earning their party's nomination. The public financing package is $84m over two months (Sept-Nov). For McCain, whose averaged $7....