[Gllug] inwoke aspell from within vim

tet at accucard.com tet at accucard.com
Wed Sep 5 17:25:02 UTC 2001


>How can I inwoke aspell from within vim? I have tried several different
>ways, but I have not managed it yet. Something like you would inwoke
>`par' or `fmt' maybe? But how?

After a few seconds playing, I came up with the following. Add it to your
.exrc (or .vimrc):

	map qe :w! /tmp/zzz^M:!aspell -c /tmp/zzz^M^M1GdG:r /tmp/zzz^Mkdd

Remember that the "^M" sequences in the above should be entered by
typing <ctrl-v><ctrl-m>. Once you have that in place, just type "qe"
in vim, and it'll run aspell on the file you're editing. It's very
crude, and there are almost certainly more elegant ways of doing it,
but it appears to work...

Further improvements could involve writing to a unique filename (which
would be deleted afterwards), the ability to spell check a given part
of the file, rather than the whole thing, or even modifying aspell to
accept input on stdin rather than from a file. But I'll leave those as
an excercise for the reader :-)

Tet

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list