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

LaTeX Greeting Cards

No, no, not that kind of latex. You are pretty sick for thinking that. I am talking about LaTeX, the typesetting program. Back to greeting cards. Anybody else hate greeting cards? The type that you buy at the store, sign and deliver even though the message is very impersonal and superficial? Yeah, those kind. I hate them very much. Not only do I hate spending time trying to find something that's mildly personal, but I hate paying for them too. $3-5 on that garbage is a travesty. Jerry Seinfeld captures my feelings towards Hallmark cards perfectly in this clip: or this one http://www.youtube.com/v/7tq-RE_6yVo This problem has become significant enough for me to start working on solutions. I am going to make my own cards using LaTeX. So, I googled "LaTeX greeting cards" and came across the the gcards package. It requires that you also install the textpos and graphicx packages, if you don't have them installed already. I am working with a Linux system

Economic Aid to Developing Countries - The Stats

World economics has been an interest of mine for a long time and I will start blogging about it here. Questions like how and if the US can continue its dominance and prosperity, what role China and India will play in the world and what the future holds for the likes of Ethiopia and Eritrea fascinate and worry me quite a bit. To the best of my non-economist abilities, I will address these questions in the future. My first entry derives some general conclusions from statistics on economic aid from developed countries to developing and third-world countries that I found on BBC . It is no surprise the US leads in this category and a better measure of generosity would be one where the amount of aid is given as a percentage of the country's GDP or revenues. Considering this aid is coming from governments as opposed to NGO's, it would be more informative to calculate this aid as a percentage of a government's revenue. Unfortunately, what BBC reports is the amount of aid as a

Victim of Asylum Roulette

Not too many stories resonate with me as much as the plight of legitimate asylum seekers whose desperate plea to find refuge in the US is ultimately decided by the questionable preference, judgment and mood of a single asylum officer (with some oversight from a regional asylum director) on one fateful day. That decision, according to numerous credible and through studies, depends largely on the location of the regional asylum center, the legal representation of the the applicant, the gender of the asylum officer just as much as the merit of the asylum case, while in fact the legitimacy of the asylum case should be the only relevant factor. This phenomenon has become so real that researchers at the Georgetown University law school have dubbed it the Refugee Roulette . Why am I so sensitive about this subject? My most devastating tragedy of late has been the denial of my legitimate and honest application for political asylum at the Chicago Asylum Office. When I applied believing the