No modes, no modal editing — just a two-line shortcut bar and just enough power once you dig past it.
installation via terminal
sudo apt update sudo apt install nano -y
nano --version | | shows the installed nano version (the exact set of keybindings below assumes a reasonably recent nano, 6.x/7.x) |'nc1'
nano <file> | | opens (or creates) a file for editing |'nc2'
interface & notation
nano has no modes: whatever you type is inserted at the cursor immediately, there's no separate insert/normal split like vim. The screen has four parts: a title bar (filename, and whether it's modified), the editing area, a status line for messages, and a two-line shortcut bar at the bottom showing the most common commands.
Keys are written as ^ for Ctrl and M- for Meta (Alt, or Esc pressed once then the key). A sequence like ^W means hold Ctrl and press w.
^G | | displays the full help text — a scrollable list of every keystroke nano understands, more complete than what fits in the shortcut bar |'nc3'
cursor movement
arrow keys (or ^F/^B) | | move the cursor one character at a time |'nc4'
^Left / ^Right | | move one word backward/forward |'nc5'
^A (Home) | | move to the beginning of the current line |'nc6'
^E (End) | | move to the end of the current line |'nc7'
^P / ^N | | move to the previous/next line |'nc8'
^Y (PgUp) | | scroll up one screenful (page up) |'nc9'
^V (PgDn) | | scroll down one screenful (page down) |'nc10'
M-\ (^Home) | | jump to the first line of the file |'nc11'
M-/ (^End) | | jump to the last line of the file |'nc12'
^/ (M-G) | | go to a specific line and column number |'nc13'
^Up / ^Down | | jump to the previous/next block of text (blocks are separated by blank lines) |'nc14'
M-] | | jump to the bracket/brace/parenthesis matching the one under the cursor |'nc15'
^L | | recenters the screen on the cursor's line, and redraws the display |'nc16'
cut, copy & paste
nano keeps a single cutbuffer (its equivalent of a clipboard). Text can be selected first by setting the mark, or ^K/M-6 fall back to acting on the whole current line when nothing is selected.
M-A (or ^6) | | sets (or unsets) the mark at the cursor to start a selection; move the cursor to extend it |'nc17'
^K | | cuts the current line (or the marked selection) into the cutbuffer. Repeated ^K presses in a row keep appending to the same cutbuffer; any other keystroke in between starts a fresh one |'nc18'
M-6 | | copies the current line (or the marked selection) into the cutbuffer, without deleting it |'nc19'
^U | | pastes the cutbuffer's contents at the cursor |'nc20'
M-T | | cuts everything from the cursor position to the end of the file |'nc21'
M-Del | | throws away the current line (or marked selection) entirely, without touching the cutbuffer — use this instead of ^K when you don't want to overwrite what's already cut |'nc22'
search & replace
^W | | searches forward for a string or (when regex mode is toggled at the prompt) a regular expression |'nc23'
^Q | | searches backward |'nc24'
M-W | | repeats the last search, forward |'nc25'
M-Q | | repeats the last search, backward |'nc26'
^\ (M-R) | | interactive replace — unlike a blind global substitution, nano pauses at every match and asks Yes / No / All / Cancel |'nc27'
| | The search and replace prompts have their own mini shortcut bar with Meta-key toggles for case sensitivity, regular-expression mode, and search direction — shown live at the bottom of the screen once you're in the prompt. |'nc28'
editing
^H (Backspace) | | deletes the character to the left of the cursor |'nc29'
^D (Delete) | | deletes the character under the cursor |'nc30'
M-Backspace | | deletes the word to the left of the cursor |'nc31'
^Delete | | deletes the word to the right of the cursor |'nc32'
^I (Tab) | | inserts a tab, or indents every marked line |'nc33'
M-} | | indents the current line (or every marked line) one step to the right |'nc34'
M-{ (Shift+Tab) | | unindents the current line (or every marked line) one step to the left |'nc35'
M-U | | undoes the last action |'nc36'
M-E | | redoes the last undone action |'nc37'
M-3 | | comments or uncomments the current line (or every marked line), using the comment style of the detected syntax |'nc38'
^] | | tries to complete the word before the cursor, using other words already in the buffer |'nc39'
M-V | | inserts the next keystroke verbatim — use this to type a literal control character instead of triggering its command |'nc40'
save & exit
^O | | writes the buffer out to disk ("Write Out"), prompting for a filename that defaults to the current one |'nc41'
^X | | closes the current buffer / exits nano, prompting to save first if it's been modified |'nc42'
^R | | inserts another file into the current buffer at the cursor position — or into a brand-new buffer, when multibuffer mode is on |'nc43'
multiple buffers, macros & tooling
nano -F <file1> <file2> | | opens several files at once, each as its own buffer, in one nano session |'nc44'
M-< / M-> | | switches to the previous/next open buffer |'nc45'
M-Ins | | places (or removes) an anchor — a temporary bookmark — on the current line |'nc48'
M-PgUp / M-PgDn | | jumps to the previous/next anchor |'nc49'
^T | | opens the Execute menu: run an external command against the buffer, or reach the spell checker, a linter, or a formatter from there (also bound directly to F12, M-B, and M-F respectively, where available) |'nc50'
feature toggles
These Meta-key combinations flip a setting on or off immediately, without restarting nano — the same options you can also set permanently in .nanorc below.
M-C | | toggles constant display of the cursor's line/column position |'nc51'
M-H | | toggles the "smart" Home key (first press goes to the first non-blank character, second press to column 0) |'nc52'
M-I | | toggles auto-indent for newly created lines |'nc53'
M-K | | toggles whether ^K cuts the whole line or just from the cursor to the end of the line |'nc54'
M-L | | toggles hard-wrapping of long lines as you type |'nc55'
M-M | | toggles mouse support |'nc56'
M-N | | toggles line numbers in the margin |'nc57'
M-O | | toggles converting typed tabs into spaces |'nc58'
M-P | | toggles a visible marker for whitespace characters |'nc59'
M-S | | toggles soft-wrapping (overlong lines displayed across multiple screen lines instead of scrolling sideways) |'nc60'
M-X | | toggles the two-line shortcut bar at the bottom of the screen ("expert mode" hides it) |'nc61'
M-Y | | toggles syntax coloring |'nc62'
M-Z | | toggles the title bar and status bar |'nc63'
.nanorc configuration
nano reads a system-wide /etc/nanorc and then a per-user ~/.nanorc at startup. Anything settable with a command-line flag or a Meta-key toggle above can also be made permanent with a set line, and keys can be remapped with bind.
set linenumbers | | always show line numbers |'nc64'
set mouse | | always enable mouse support |'nc65'
set autoindent | | always auto-indent new lines |'nc66'
set tabsize 4 | | sets the display width of a tab character |'nc67'
set tabstospaces | | always convert typed tabs into spaces |'nc68'
include "/usr/share/nano/*.nanorc" | | loads the distro-provided syntax-highlighting rules bundled for many languages (this path is Debian/Ubuntu's default install location) |'nc69'
bind ^S savefile main | | example key remap: makes Ctrl+S save immediately without prompting for a filename |'nc70'
related topics
vim Cheat Sheet — the modal, more powerful terminal editor once you outgrow nano. Emacs Cheat Sheet — the other end of the terminal-editor power spectrum. tmux Cheat Sheet — the terminal multiplexer nano is commonly run inside over SSH. VS Code Cheat Sheet — the mouse-driven alternative, if keyboard-only editing isn't your style.