It seems to be a common opinion among experienced Unixers that Nano is a low-featured text editor meant for newbies and not suitable for advanced users. Vim and Emacs are the usual alternatives advocated. I don't know enough about Vim or Emacs to criticize them, but I do know that Nano is much powerful than a lot of its critics think.
One of the biggest points I want to make is that even though Vim has some features I'd certainly like to have in Nano (number + navigation key to move a number of units), I think Nano makes up for it by having the most common functions be significantly faster to access than in Vim. (Of course, this part of the comparison is somewhat moot because in either editor these can be customized, but having good defaults still matters.)
- Example: how do you save your file?
Nano: ctrl-s. Two keypresses that don't even have to be strictly in sequence. One just needs to start before the other. It's barely slower than one keypress.
Vim: esc, shift-colon, w, enter. Five keypresses. And the first one is an out-of-the-way key that you don't already have your finger next to! (At least on a qwerty keyboard.) And you also better not still be holding down shift when your finger hits w or it won't work.
This one may have more value to me than it does in general since I've developed a habit of impulsively saving the buffer every time I've made a change and aren't immediately sure what to type next, but I don't imagine I'm the only one with some degree of save-happiness.
- Example: how do you open a new file in the current editor instance?
Nano: ctrl-r. (With the default configuration you'll have to follow it with alt-f or it'll get read into the current buffer, but really what are you doing with your life if you didn't set the config option to fix that.)
Vim: esc, shift-colon, o, space.
You see where I'm going. My biggest gripe with Vim in general is the separation of "insert mode" which equates to having to press Esc and
i all the time to switch between command mode and insert mode instead of putting to use the modifier keys all over your keyboard.
I'd probably sooner be persuaded to join the Church of Emacs, so I admit it's a bit unfair for me to be basing my case for Nano on a critique of Vim when I know even less about Emacs than I do about Vim. (I did try Emacs for a while and had some bad experiences with it, though I don't remember enough to explain.)
Notable features Nano has that you might not know about (besides the help enabled by default which is wonderful for letting you learn the most useful hotkeys while working) include
Search and replace history
The cursor position statusbar in addition to normal line numbers
This is actually wonderful. If you enable
constantshowin the config, you see on the bottom your current line number, the number of lines in the file, the percent ratio of the two, and the same for columns in the current line and characters in the file.
Efficient navigation hotkeys: ^A (= Home), ^E (= End), ^Y (= Page Up), ^V (= Page Down), ^W+^Y/V (top/bottom of file), M-G (goto line/column number), M-] (goto matching bracket), word-oriented move/delete (ctrl-left/right, ctrl-del, ctrl-shift-del); Smart home; alt-up/down to scroll the window without moving the cursor.
Selection (M-A) and almost everything (cutting, justifying, indenting) will automatically apply to just the selection if you have one
Excellent facilities for multiple buffers; opening a new one is easy (you get tab autocompletion and tilde expansion when entering the filename), switching between them is easy, you can even execute an external command and read in the output, etc
Regex-based syntax highlighting which works by having a nice, concise, plaintext file for each language it supports, and it's super easy to modify or add languages. I've made several contributions to the syntax highlighting myself.
Optional mouse support
Of course, Nano is missing some features I'd like to have, besides Vim's number-movement shortcuts.
Bracket highlighting (though it does have the goto bracket hotkey I mentioned above)
Many config options are available but can't be changed from inside the editor
PCRE. We're limited to POSIX ERE's.
But none of those features are all that important (besides, I guess, bracket highlighting).
It also brings me to another great thing about Nano: its active development! Nano gets a new release every few months tops, and each one has great new features to bring to the table. The developer is mostly one guy by the looks of things but he's very responsive; he's never been slower than 48 hours. I remember when I first became a hardcore fan of Nano it was version 2.9 and some of the features I mentioned up there didn't exist. So I expect the few inadequacies of Nano to be improved in the next year or so, and if I have time I intend to help make it happen.