Besides taking notes with my
notebook, I sometimes use
vi to save whatever inspiration struck me. (No, I won't get into the emacs/vi discussion here!)
Writing with
vi is fast and efficient, but, due to its heritage, there is no built-in spellchecker. Most well-groomed *NIX/Linux Systems have a spellchecker installed by default. Chances are that there is either
aspell or
ispell available. I will concentrate on
ispell because that is the program I use, but I won't go into the details of its usage here (maybe in another entry, though). To use
ispell from inside
vi the following chain of commands can be used:
:w:!ispell %Saving the file is necessary since
ispell cannot operate on the in-memory buffer, to the best of my knowledge. The next command launches
ispell on the current filename. After the spellchecking is done, and there were actual modifications to the file,
vi will complain about the fact that the file it is working on changed. Answer the resulting question with
L
(means load the changed file) and you are able to continue working with the spellchecked file.
There will be another file with the same name and a
~ character added to the filename in your current working directory, this is the version of the file before it was spellchecked; a backup if something should go wrong. You can safely delete this file if you don't need its contents any more. Pretty much like the auto-save files created by
emacs or other editors.