2019-08-16 20:03:38 +03:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2019-12-05 13:52:17 +03:00
|
|
|
<html lang="en">
|
2019-08-16 20:03:38 +03:00
|
|
|
|
|
|
|
<head>
|
2021-10-11 10:27:56 +03:00
|
|
|
<title>Cheatsheet for GNU nano</title>
|
2019-12-05 14:06:24 +03:00
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
2021-10-11 10:27:56 +03:00
|
|
|
<meta name="description" content="A concise overview of the command shortcuts for nano, the editor, grouped by category.">
|
2019-12-05 19:01:55 +03:00
|
|
|
<meta name="keywords" content="cheatsheet, nano, editor, shortcuts, keystrokes, functions, operations, commands">
|
|
|
|
<meta name="author" content="Benno Schulenberg">
|
2019-08-16 20:03:38 +03:00
|
|
|
</head>
|
|
|
|
|
2019-12-05 13:52:17 +03:00
|
|
|
<body>
|
2019-08-16 20:03:38 +03:00
|
|
|
|
|
|
|
<br>
|
2024-01-15 13:18:29 +03:00
|
|
|
<h1 align="center">Overview of nano's shortcuts </h1>
|
|
|
|
<h3 align="center">The editor's keystrokes and their functions </h3>
|
2019-08-16 20:03:38 +03:00
|
|
|
<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 19:01:55 +03: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 20:03:38 +03: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>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>
|
2024-06-16 09:15:49 +03:00
|
|
|
<tr><td>Ctrl+B </td><td>Start backward search</td></tr>
|
2024-01-13 13:22:14 +03:00
|
|
|
<tr><td>Ctrl+F</td><td>Start forward search</td></tr>
|
|
|
|
<tr><td>Alt+B</td><td>Find next occurrence backward</td></tr>
|
|
|
|
<tr><td>Alt+F</td><td>Find next occurrence forward</td></tr>
|
2019-08-16 20:03:38 +03:00
|
|
|
<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>
|
2020-08-13 08:15:36 +03:00
|
|
|
<tr><td>Alt+Bsp</td><td>Delete word to the left</td></tr>
|
|
|
|
<tr><td>Ctrl+Del </td><td>Delete word to the right</td></tr>
|
2019-08-16 20:03:38 +03:00
|
|
|
<tr><td>Alt+Del</td><td>Delete current line</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<b>Operations</b>
|
|
|
|
<table><tbody>
|
2020-08-13 08:15:36 +03:00
|
|
|
<tr><td>Ctrl+T </td><td>Execute some command</td></tr>
|
2024-01-15 13:18:29 +03:00
|
|
|
<tr><td>Ctrl+T Ctrl+S</td><td>Run a spell check</td></tr>
|
2024-01-13 13:22:14 +03:00
|
|
|
<tr><td>Ctrl+T Ctrl+Y</td><td>Run a syntax check</td></tr>
|
|
|
|
<tr><td>Ctrl+T Ctrl+O </td><td>Run a formatter</td></tr>
|
2024-01-13 13:27:28 +03:00
|
|
|
<tr><td>Tab</td><td>Indent marked region</td></tr>
|
|
|
|
<tr><td>Shift+Tab </td><td>Unindent marked region</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>
|
2024-06-16 09:15:49 +03:00
|
|
|
<tr><td>Alt+T</td><td>Cut until end of buffer</td></tr>
|
2024-01-13 13:27:28 +03:00
|
|
|
<tr><td>Alt+:</td><td>Start/stop recording of macro </td></tr>
|
2019-08-16 20:03:38 +03:00
|
|
|
<tr><td>Alt+;</td><td>Replay macro</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
</td><td>
|
|
|
|
|
|
|
|
<b>Moving around</b>
|
|
|
|
<table><tbody>
|
2024-01-13 13:22:14 +03:00
|
|
|
<tr><td><b>←</b></td><td>One character backward</td></tr>
|
|
|
|
<tr><td><b>→</b></td><td>One character forward</td></tr>
|
2020-10-11 16:58:40 +03:00
|
|
|
<tr><td>Ctrl+<b>←</b></td><td>One word backward</td></tr>
|
|
|
|
<tr><td>Ctrl+<b>→</b></td><td>One word forward</td></tr>
|
2024-06-16 09:15:49 +03:00
|
|
|
<tr><td>Ctrl+A</td><td>To start of line</td></tr>
|
2019-08-16 20:03:38 +03:00
|
|
|
<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>
|
2020-10-11 16:58:40 +03:00
|
|
|
<tr><td>Ctrl+<b>↑</b></td><td>To previous block</td></tr>
|
|
|
|
<tr><td>Ctrl+<b>↓</b></td><td>To next block</td></tr>
|
2024-06-16 09:15:49 +03:00
|
|
|
<tr><td>Alt+Home </td><td>To first row in viewport</td></tr>
|
|
|
|
<tr><td>Alt+End</td><td>To last row in viewport</td></tr>
|
2019-08-16 20:03:38 +03:00
|
|
|
<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>
|
2024-06-16 09:15:49 +03:00
|
|
|
<tr><td>Alt+G </td><td>Go to specified line</td></tr>
|
2019-08-16 20:03:38 +03:00
|
|
|
<tr><td>Alt+]</td><td>Go to complementary bracket</td></tr>
|
2020-10-11 16:58:40 +03:00
|
|
|
<tr><td>Alt+<b>↑</b></td><td>Scroll viewport up</td></tr>
|
|
|
|
<tr><td>Alt+<b>↓</b></td><td>Scroll viewport down</td></tr>
|
2019-08-16 20:03:38 +03:00
|
|
|
<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>
|
2024-01-15 13:18:29 +03:00
|
|
|
<tr><td>Alt+D</td><td>Report line/word/character counts</td></tr>
|
2019-08-16 20:03:38 +03:00
|
|
|
<tr><td>Ctrl+G</td><td>Display help text</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
<b>Various</b>
|
|
|
|
<table><tbody>
|
2024-06-16 09:15:49 +03:00
|
|
|
<tr><td>Alt+A </td><td>Set or unset the mark</td></tr>
|
2021-12-23 17:39:49 +03:00
|
|
|
<tr><td>Alt+V</td><td>Enter next keystroke verbatim</td></tr>
|
2024-01-13 13:27:28 +03:00
|
|
|
<tr><td>Alt+C</td><td>Turn constant position info on/off</td></tr>
|
2019-10-14 18:14:07 +03:00
|
|
|
<tr><td>Alt+N</td><td>Turn line numbers on/off</td></tr>
|
2019-08-16 20:03:38 +03:00
|
|
|
<tr><td>Alt+P</td><td>Turn visible whitespace on/off</td></tr>
|
2024-01-15 13:18:29 +03:00
|
|
|
<tr><td>Alt+S</td><td>Turn softwrapping on/off</td></tr>
|
2024-01-13 13:27:28 +03:00
|
|
|
<tr><td>Alt+X</td><td>Hide/unhide the help lines</td></tr>
|
|
|
|
<tr><td>Alt+Z</td><td>Hide/unhide the info bars</td></tr>
|
2019-08-16 20:03:38 +03:00
|
|
|
<tr><td>Ctrl+L</td><td>Refresh the screen</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
<br>
|
|
|
|
|
|
|
|
</td></tr>
|
|
|
|
</tbody></table>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|