2019-08-16 17:03:38 +00:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2019-12-05 10:52:17 +00:00
|
|
|
<html lang="en">
|
2019-08-16 17:03:38 +00:00
|
|
|
|
|
|
|
<head>
|
|
|
|
<title>Cheatsheet for nano</title>
|
2019-12-05 11:06:24 +00:00
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
|
|
<meta name="description" content="A concise overview of the command shortcuts of the GNU nano editor, grouped by category.">
|
2019-12-05 16:01:55 +00:00
|
|
|
<meta name="keywords" content="cheatsheet, nano, editor, shortcuts, keystrokes, functions, operations, commands">
|
|
|
|
<meta name="author" content="Benno Schulenberg">
|
2019-08-16 17:03:38 +00:00
|
|
|
</head>
|
|
|
|
|
2019-12-05 10:52:17 +00:00
|
|
|
<body>
|
2019-08-16 17:03:38 +00:00
|
|
|
|
|
|
|
<br>
|
|
|
|
<h1 align="center">Overview of nano's shortcuts </h1>
|
|
|
|
<h3 align="center">The editor's keystrokes and their functions </h3>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<table align="center"><tbody>
|
|
|
|
<tr><td>
|
|
|
|
|
|
|
|
<b>File handling</b>
|
|
|
|
<table><tbody>
|
|
|
|
<tr><td>Ctrl+S </td><td>Save current file</td></tr>
|
2019-12-05 16:01:55 +00:00
|
|
|
<tr><td>Ctrl+O</td><td>Offer to write file ("Save as")</td></tr>
|
|
|
|
<tr><td>Ctrl+R</td><td>Insert a file into current one</td></tr>
|
|
|
|
<tr><td>Ctrl+X</td><td>Close buffer, exit from nano</td></tr>
|
2019-08-16 17:03:38 +00:00
|
|
|
</tbody></table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<b>Editing</b>
|
|
|
|
<table><tbody>
|
|
|
|
<tr><td>Ctrl+K </td><td>Cut current line into cutbuffer</td></tr>
|
|
|
|
<tr><td>Alt+6</td><td>Copy current line into cutbuffer</td></tr>
|
|
|
|
<tr><td>Ctrl+U</td><td>Paste contents of cutbuffer</td></tr>
|
|
|
|
<tr><td>Alt+T</td><td>Cut until end of buffer</td></tr>
|
|
|
|
<tr><td>Ctrl+]</td><td>Complete current word</td></tr>
|
|
|
|
<tr><td>Alt+3</td><td>Comment/uncomment line/region</td></tr>
|
|
|
|
<tr><td>Alt+U</td><td>Undo last action</td></tr>
|
|
|
|
<tr><td>Alt+E</td><td>Redo last undone action</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<b>Search and replace</b>
|
|
|
|
<table><tbody>
|
|
|
|
<tr><td>Ctrl+Q </td><td>Start backward search</td></tr>
|
|
|
|
<tr><td>Ctrl+W</td><td>Start forward search</td></tr>
|
|
|
|
<tr><td>Alt+Q</td><td>Find next occurrence backward</td></tr>
|
|
|
|
<tr><td>Alt+W</td><td>Find next occurrence forward</td></tr>
|
|
|
|
<tr><td>Alt+R</td><td>Start a replacing session</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<b>Deletion</b>
|
|
|
|
<table><tbody>
|
|
|
|
<tr><td>Ctrl+H</td><td>Delete character before cursor </td></tr>
|
|
|
|
<tr><td>Ctrl+D</td><td>Delete character under cursor</td></tr>
|
|
|
|
<tr><td>Ctrl+Shift+Del </td><td>Delete word to the left</td></tr>
|
|
|
|
<tr><td>Ctrl+Del</td><td>Delete word to the right</td></tr>
|
|
|
|
<tr><td>Alt+Del</td><td>Delete current line</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<b>Operations</b>
|
|
|
|
<table><tbody>
|
|
|
|
<tr><td>Ctrl+T </td><td>Run a spell check</td></tr>
|
|
|
|
<tr><td>Ctrl+J</td><td>Justify paragraph or region</td></tr>
|
|
|
|
<tr><td>Alt+J</td><td>Justify entire buffer</td></tr>
|
|
|
|
<tr><td>Alt+B</td><td>Run a syntax check</td></tr>
|
2019-10-25 15:17:48 +00:00
|
|
|
<tr><td>Alt+F</td><td>Run a formatter/fixer/arranger</td></tr>
|
2019-08-16 17:03:38 +00:00
|
|
|
<tr><td>Alt+:</td><td>Start/stop recording of macro</td></tr>
|
|
|
|
<tr><td>Alt+;</td><td>Replay macro</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
</td><td>
|
|
|
|
|
|
|
|
<b>Moving around</b>
|
|
|
|
<table><tbody>
|
|
|
|
<tr><td>Ctrl+B </td><td>One character backward</td></tr>
|
|
|
|
<tr><td>Ctrl+F</td><td>One character forward</td></tr>
|
|
|
|
<tr><td>Ctrl+⯇</td><td>One word backward</td></tr>
|
|
|
|
<tr><td>Ctrl+⯈</td><td>One word forward</td></tr>
|
|
|
|
<tr><td>Ctrl+A</td><td>To start of line</td></tr>
|
|
|
|
<tr><td>Ctrl+E</td><td>To end of line</td></tr>
|
|
|
|
<tr><td>Ctrl+P</td><td>One line up</td></tr>
|
|
|
|
<tr><td>Ctrl+N</td><td>One line down</td></tr>
|
|
|
|
<tr><td>Ctrl+⯅</td><td>To previous block</td></tr>
|
|
|
|
<tr><td>Ctrl+⯆</td><td>To next block</td></tr>
|
|
|
|
<tr><td>Ctrl+Y</td><td>One page up</td></tr>
|
|
|
|
<tr><td>Ctrl+V</td><td>One page down</td></tr>
|
|
|
|
<tr><td>Alt+\</td><td>To top of buffer</td></tr>
|
|
|
|
<tr><td>Alt+/</td><td>To end of buffer</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<b>Special movement</b>
|
|
|
|
<table><tbody>
|
2019-12-05 16:01:55 +00:00
|
|
|
<tr><td>Alt+G </td><td>Go to specified line</td></tr>
|
2019-08-16 17:03:38 +00:00
|
|
|
<tr><td>Alt+]</td><td>Go to complementary bracket</td></tr>
|
|
|
|
<tr><td>Alt+⯅</td><td>Scroll viewport up</td></tr>
|
|
|
|
<tr><td>Alt+⯆</td><td>Scroll viewport down</td></tr>
|
|
|
|
<tr><td>Alt+<</td><td>Switch to preceding buffer</td></tr>
|
|
|
|
<tr><td>Alt+></td><td>Switch to succeeding buffer</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<b>Information</b>
|
|
|
|
<table><tbody>
|
|
|
|
<tr><td>Ctrl+C </td><td>Report cursor position</td></tr>
|
|
|
|
<tr><td>Alt+D</td><td>Report word/line/char count</td></tr>
|
|
|
|
<tr><td>Ctrl+G</td><td>Display help text</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<b>Various</b>
|
|
|
|
<table><tbody>
|
|
|
|
<tr><td>Alt+A</td><td>Turn the mark on/off</td></tr>
|
|
|
|
<tr><td>Tab</td><td>Indent marked region</td></tr>
|
|
|
|
<tr><td>Shift+Tab </td><td>Unindent marked region</td></tr>
|
2019-10-14 15:14:07 +00:00
|
|
|
<tr><td>Alt+N</td><td>Turn line numbers on/off</td></tr>
|
2019-08-16 17:03:38 +00:00
|
|
|
<tr><td>Alt+P</td><td>Turn visible whitespace on/off</td></tr>
|
|
|
|
<tr><td>Alt+V</td><td>Enter next keystroke verbatim</td></tr>
|
|
|
|
<tr><td>Ctrl+L</td><td>Refresh the screen</td></tr>
|
|
|
|
<tr><td>Ctrl+Z</td><td>Suspend nano</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|