Cheatography
https://cheatography.com
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/disable |
Alt+C |
Constant cursor position display enable/disable |
Alt+O |
Use of one more line for editing enable/disable |
Alt+S |
Smooth scrolling enable/disable |
Alt+$ |
Soft wrapping of overlong lines enable/disable |
Alt+P |
Whitespace display enable/disable |
Alt+Y |
Color syntax highlighting enable/disable |
Alt+H |
Smart home key enable/disable |
Alt+I |
Auto indent enable/disable |
Alt+K |
Cut to end enable/disable |
Alt+L |
Hard wrapping of overlong lines enable/disable |
Alt+Q |
Conversion of typed tabs to spaces enable/disable |
Alt+B |
Backup files enable/disable |
Alt+F |
Reading file into separate buffer enable/disable |
|
Created By
Metadata
Favourited By
Comments
memfail, 04:43 4 Jan 19
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
Related Cheat Sheets
More Cheat Sheets by bipinthite