
Tuesday, 26th February 2008 at 12:05am
I haven't really mentioned anything about nano, except for the short paragraph I wrote about it in that command quick sheet I wrote, which is odd since it's the default editor for Debian; you'd think I'd wanna learn how to use it effectively.
nano is actually really quite easy for a fairly basic piece of software. You can just type normally from in the app, and it'll be stored as text. The most common functions are in the two bars at the bottom of your window. In case you didn't know, the caret (^) means "press control key and...", so ^C would be control and C.
Why they can't use Windows terminology though, is beyond me.
|
What nano says |
What it means |
|
WriteOut |
Save |
|
Read File |
Open |
|
Cut text |
Cut the entire line |
|
Uncut text |
Paste the line |
You can see a lot of other commands by doing ^G for the help.
There's also a few cool things that you can do when starting nano, with switches.
|
Switch |
Affect |
|
-A |
Makes the home key act like it does in Notepad++, where the cursor jumps to the first non-whitespace character, instead of right at the beginning of the line. This is helpful if you're indenting a lot. |
|
-B |
Once you've saved the file you're editing, it'll first back up the original file and it'll suffix it with a tilde; so apache.conf would become apache.conf~, and your edited one will replace the original. |
|
-C backupdirectory |
Use this with -B, if you don't want the file saved in the same directory. |
|
-S |
By default, when you go down to the bottom of a file it'll act like you've just pressed page down and show you all new stuff. With this option, you'll just go down line by line. |
|
-W |
Working command line is sometimes annoying. If you get the end of a sentence at the end of the line, the full stop will drop to the next line, since it's not the same word. It'll be treated properly with this switch though. |
|
-i |
Another Notepad++ like behaviour. If you're already indented, and drop to the next line, you stay indented. |
You can see the command manual at the official nano site.