Show Menu
Cheatography

Nano Editor Keyboard Shortcuts by

Nano Editor keyboard shortcuts

File Management

Key
Action
Ctrl+G
Display help text
Ctrl+X
Close the current file buffer / Exit from nano
Ctrl+O
Write the current file to disk
Ctrl+R
Insert another file into the current one
Alt+>
Switch to the next file buffer
Alt+<
Switch to the previous file buffer

Search and Replace

Key
Action
Ctrl+W
Search for a string or a regular expression
Ctrl+\
Replace a string or a regular expression
Alt+W
Repeat the last search

Navigation

Key
Action
Ctrl+_
Go to line and column number
Ctrl+Y
Go one screenful up
Ctrl+V
Go one screenful down
Alt+\
Go to the first line of the file
Alt+/
Go to the last line of the file
Ctrl+B
Go back one character
Ctrl+F
Go forward one character
Alt+Space
Go back one word
Ctrl+Space
Go forward one word
Ctrl+A
Go to beginning of current line
Ctrl+E
Go to end of current line
Ctrl+P
Go to previous line
Ctrl+N
Go to next line
Alt+(
Go to beginning of paragraph; then of previous paragraph
Alt+)
Go just beyond end of paragraph; then of next paragraph
Alt+-
Scroll up one line without scrolling the cursor
Alt++
Scroll down one line without scrolling the cursor
Alt+<
Switch to the previous file buffer
Alt+>
Switch to the next file buffer
Ctrl+C
Display the position of the cursor
Alt+]
Go to the matching bracket
 

Editing

Key
Action
Alt+U
Undo the last operation
Alt+E
Redo the last undone operation
Alt+}
Indent the current line
Alt+{
Unindent the current line
Alt+^
Copy the current line and store it in the cutbuffer
Ctrl+K
Cut the current line and store it in the cutbuffer
Ctrl+U
Uncut from the cutbuffer into the current line
Ctrl+J
Justify the current paragraph
Ctrl+T
Invoke the spell checker, if available
Alt+V
Insert the next keystroke verbatim
Ctrl+I
Insert a tab at the cursor position
Ctrl+M
Insert a newline at the cursor position
Ctrl+D
Delete the character under the cursor
Ctrl+H
Delete the character to the left of the cursor
Alt+T
Cut from the cursor position to the end of the file
Alt+J
Justify the entire file
Alt+D
Count the number of words, lines, and characters
Ctrl+^
Mark text starting from the cursor position

Settings

Key
Action
Alt+X
Help mode enable­/di­sable
Alt+C
Constant cursor position display enable­/di­sable
Alt+O
Use of one more line for editing enable­/di­sable
Alt+S
Smooth scrolling enable­/di­sable
Alt+$
Soft wrapping of overlong lines enable­/di­sable
Alt+P
Whitespace display enable­/di­sable
Alt+Y
Color syntax highli­ghting enable­/di­sable
Alt+H
Smart home key enable­/di­sable
Alt+I
Auto indent enable­/di­sable
Alt+K
Cut to end enable­/di­sable
Alt+L
Hard wrapping of overlong lines enable­/di­sable
Alt+Q
Conversion of typed tabs to spaces enable­/di­sable
Alt+B
Backup files enable­/di­sable
Alt+F
Reading file into separate buffer enable­/di­sable
                   
 

Comments

Note that some keyboard set ups, on e.g. Macbooks, cannot utilise the "Alt" key sequences. Instead, use the Esc key.

Per the nano in-app help: "Escape-key sequences are notated
with the Meta (M-) symbol and can be entered using either the Esc, Alt, or
Meta key depending on your keyboard setup." M- here, refers to Alt- in the instructions above.

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Sublime Text 2 (Linux) Cheat Sheet
          Ubuntu Compose Key Combinations Cheat Sheet
          Ubuntu Unity 16.04 Keyboard Shortcuts

          More Cheat Sheets by bipinthite

          Ace Editor Keyboard Shortcuts