Overview of nano’s shortcuts
The editor’s keystrokes and their functions
File handling
| Ctrl+S | Save current file |
| Ctrl+O | Offer to write file (“Save as”) |
| Ctrl+R | Insert a file into the current file |
| Ctrl+X | Close buffer and exit nano |
Editing
| Ctrl+K | Cut current line into the cut buffer |
| Alt+6 | Copy current line into the cut buffer |
| Ctrl+U | Paste contents of the cut buffer |
| Alt+T | Cut until the end of the buffer |
| Ctrl+] | Complete current word |
| Alt+3 | Comment or uncomment line or region |
| Alt+U | Undo last action |
| Alt+E | Redo last undone action |
Search and replace
| Ctrl+Q | Start backward search |
| Ctrl+W | Start forward search |
| Alt+Q | Find next occurrence backward |
| Alt+W | Find next occurrence forward |
| Alt+R | Start a replace session |
Deletion
| Ctrl+H | Delete character before the cursor |
| Ctrl+D | Delete character under the cursor |
| Ctrl+Shift+Del | Delete word to the left |
| Ctrl+Del | Delete word to the right |
| Alt+Del | Delete current line |
Operations
| Ctrl+T | Run a spell check |
| Ctrl+J | Justify paragraph or region |
| Alt+J | Justify the entire buffer |
| Alt+B | Run a syntax check |
| Alt+F | Run a formatter, fixer or arranger |
| Alt+: | Start or stop recording a macro |
| Alt+; | Replay macro |
Source: https://www.nano-editor.org/dist/latest/cheatsheet.html