Linux

Nano Text Editor Keyboard Commands

nano editorNano text editor is the advanced version of the Pico editor for Linux and UNIX like systems. Let us see the keyboard commands for the Nano editor in details.

NOTE: Any command prefixed with a caret symbol (^) means to use the Ctrl key (e.g., ^G means to press the Ctrl+G keys at the same time). Any command prefixed with the letter M means to press the Alt key (e.g., M-R means to press the Alt+R keys together).

Most Helpful!Ctrl Key CombinationFunction KeyAlt Key CombinationDescription
***^GF1Display the help text
***^XF2Close the current file buffer / Exit from nano
***^OF3Write the current file to disk
^JF4Justify the current paragraph
^RF5Insert another file into the current one
***^WF6Search for a string or a regular expression
***^YF7Move to the previous screen
***^VF8Move to the next screen
***^KF9Cut the current line and store it in the cutbuffer
***^UF10Uncut from the cutbuffer into the current line
***^CF11Display the position of the cursor
^TF12Invoke the spell checker, if available
***^_F13M-GGo to line and column number
***^\F14M-RReplace a string or a regular expression
^^F15M-AMark text at the cursor position
***F16M-WRepeat last search
***M-^ or M-6Copy the current line and store it in the cutbuffer
M-}Indent the current line
M-{Unindent the current line
^FMove forward one character
^BMove back one character
^SpaceMove forward one word
M-SpaceMove back one word
***^PMove to the previous line
***^NMove to the next line
***^AMove to the beginning of the current line
***^EMove to the end of the current line
M-( or M-9Move to the beginning of the current paragraph
M-) or M-0Move to the end of the current paragraph
M-\ or M-|Move to the first line of the file
M-/ or M-?Move to the last line of the file
***M-]Move to the matching bracket
M-- or M-_Scroll up one line without scrolling the cursor
M-+ or M-=Scroll down one line without scrolling the cursor
***M-< or M-,Switch to the previous file buffer
***M-> or M-.Switch to the next file buffer
M-VInsert the next keystroke verbatim
^IInsert a tab at the cursor position
^MInsert a newline at the cursor position
^DDelete the character under the cursor
^HDelete the character to the left of the cursor
M-TCut from the cursor position to the end of the file
M-JJustify the entire file
M-DCount the number of words, lines, and characters
***^LRefresh (redraw) the current screen
M-XHelp mode enable/disable
***M-CConstant cursor position display enable/disable
M-OUse of one more line for editing enable/disable
M-SSmooth scrolling enable/disable
M-PWhitespace display enable/disable
M-YColor syntax highlighting enable/disable
M-HSmart home key enable/disable
***M-IAuto indent enable/disable
M-KCut to end enable/disable
M-LLong line wrapping enable/disable
M-QConversion of typed tabs to spaces enable/disable
M-BBackup files enable/disable
M-FMultiple file buffers enable/disable
M-MMouse support enable/disable
M-NNo conversion from DOS/Mac format enable/disable
M-ZSuspension enable/disable

 

If any feedback, queries are always welcome!

Abhijit Sandhan

Love to Automate, Blog, Travel, Hike & spread Knowledge!

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button