ok

12/12/10

Add spell check to Nano

 Nano is simple to use, efficient, and extensible. Nano can be used for many things: Writing, programming, editing configuration files, and more. Depending upon your needs, you might need to check the spelling of what you are writing or editing within Nano. Let’s take a look at how you can add spell checking to this handy editor.

Out of the box, one thing that Nano is missing is spell checking. Nano does include the option for spell checking (you can even invoke spell checking from within Nano, but it won’t work). Why is this? Simple – Nano makes use of a specific spell checker that is not installed on most distributions by default. So even though Nano has the keyboard shortcut available for spell checking, you have to make it work. Let’s see how.
Installing the spell checker
Nano depends upon the package spell for spell checking. This is simple to install, from the command line, if you follow these steps:

  1. Open up a terminal window.
  2. Issue the command sudo apt-get install spell.
  3. Type your sudo password and hit Enter.
  4. Accept any dependencies (if necessary).
  5. Let the installation complete.
Once complete you are ready to use spell checking.
Check your spelling
Figure 1
Open up a document for editing within Nano. When you do this you should see the list of keyboard shortcuts along the bottom of the screen. Of those shortcuts the ^T shortcut should be listed. That will invoke spell checking.
With your document open hit Ctrl-t to begin the check. Figure 1 shows the Nano spell checking in action. Spell will begin at the top of your document and continue on until it comes across a word it does not recognize. When it lands on a mis-spelled (or unrecognizable) word it will stop and ask you to correct the spelling of the misspelled word. Spell will not offer suggestions for replacements. Instead Spell will simply allow you to edit the misspelled word. Once you’ve edited the word you will have the chance to change all instances of the misspelled word. To replace a single instance just retype the word and hit enter. You will be asked if you want to replace that instance. If you want to only replace that instance hit Y (for yes) or, if you want to replace all instances hit A (for all) and all instances of the misspelled word will be replaced. If you have misspelled your correction just hit Ctrl-c to cancel the replacement.
Once Nano is finished with the spell checking it will inform you by saying so. Since there is nothing automated or fancy about Nano you will need to remember to save your changes made to your document when you exit (using Ctrl-x) the editor.
Final thoughts
Most users have grown accustomed to auto-spell checks that make spelling suggestions to the users. That’s not Nano. Nano wants you to think for yourself. It’s not perfect, but it’s as close to spell check as you will find with Nano.

0 comments: