Nano – Shortcuts, syntax highlight and nanorc config file – pt1
I have been using nano as my favorite console editor (i use emacs/kate for the rest) for some time now. It’s simplicity, the speed and usefulness of it made it what it is. But recently, i’ve been trying to find out more features that i might been missing. One of those were the shortcuts. The other was syntax highlighting! Meanwhile, the things i discovered!
Before we start, here’s some useful links:
Nano homepage
Online Manual
the fine Man Page
So let’s start with the basic shortcuts!
“Special functions use the Control (Ctrl) key, displayed in the help and shortcut lists as ^; the Meta key, displayed as M; or the Escape (Esc) key.”
The help system in nano is available by pressing ^G.
Where is
^W : allows to search for an expression
^W expr Meta+w : find the next match
^W ^T numline or Meta+g numline, numcol : will jump to that line number
^W Meta+R expr1 RET expr2 : will replace expr1 with expr2. It asks for the confirmation
Replace this instance? Y Yes A All N No ^C Cancel
^K : cut text (if nothing is selected, it cuts a line
^U : paste the cut text, or undo the justification
^J : Justify the paragraph
Meta+j : justify the whole buffer
Meta+} : indent
Meta+{ : unindent
Meta+a : set/unset the mark ( similar to ^space in emacs)
^space : move forward one word
Meta+space : move backward one word
Page up/down : scroll up/down half(?) buffer
^W ^Y : jump to the first line
^W ^V : jump to the last line
^Y : jump to the Previous Page (up almost “one” buffer”)
^V : jump to the Next Page (down almost “one” buffer”)
^W ^Y : jump to the first line
^W ^V : jump to the last line
M-< or (M-,) Switch to the previous file buffer
M-> or (M-.) Switch to the next file buffer
So, that might be enough for your daily tasks. See the next part for more nano’s details.
Part 2: nanorc and syntax hightlight

[...] config file, try to explain parts of it and set the syntax highlight on. See the first part forshortcuts . You can use the sample nanorc from /usr/share/nano/ , a copy from /etc/nanorc, or even from the [...]
Nano - Shortcuts, syntax highlight and .nanorc config file - pt2 « The GNU of Life, the Universe and Everything
June 23, 2007
I also use nano, it is really great.And its console based so extremely portable. Long live ncurses
All the best to you and your blog
Rui
June 23, 2007
very interesting, but I don’t agree with you
Idetrorce
Idetrorce
December 15, 2007
Thanks for this list, very useful.
Nicolas
November 14, 2008
[...] I found this VERY insightful blog post on nano’s advanced features. Random PostsSubversion: checkout a [...]
nano editor keyboard shortcuts | Zen of Linux
March 2, 2009