💾 Archived View for squid.flounder.online › cheatsheet › nano.gmi captured on 2024-08-31 at 11:40:44. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-06-04)
-=-=-=-=-=-=-
Return to Squid's Cheat Sheets
ALT + N
CTRL + 3 then SHIFT 3
Both options work but ALT + N is easier <.<
ALT + SHIFT + 4
ALT + P
ALT + X
CTRL + S
CTRL + O
CTRL + X
CTRL + W (forward)
CTRL + Q (backward)
(helpful mnemonic: "CTRL + Where..?")
ALT + W (forward)
ALT + Q (backward)
ALT + R
UP, DOWN, LEFT, RIGHT
HOME, END, PAGE UP, PAGE DOWN
CTRL + RIGHT
CTRL + LEFT
CTRL + UP
CTRL + DOWN
A "block" is a series of non-empty lines.
ALT + ]
This is useful for coding - if you have an open or close bracket, you can place the cursor on that bracket and then use this keyboard shortcut to find the corresponding bracket.
ALT + G
CTRL + _
ALT + G is easier <.<
CTRL + C
ALT + UP
ALT + DOWN
ALT + \
ALT + /
ALT + A
This toggles the selection. Now you can use the standard navigation keys to move the cursor. The text between the beginning location of the cursor and the current location of the cursor will be highlighted (selected)
If you hold "Shift" while moving the cursor, it will highlight the text you are moving over.
SHIFT + LEFT
SHIFT + RIGHT
CTRL + SHIFT + RIGHT
CTRL + SHIFT + LEFT
CTRL + SHIFT + UP
CTRL + SHIFT + DOWN
When you mark/select text in nano, it doesn't select the first character of the block or word when you are moving by block/word. I've developed a habit of holding SHIFT but releasing CTRL, then move one more character to get it just right.
ALT + 6
CTRL + K
CTRL + U
If you use the copy or cut keybind, then the current line will be copied or cut. If you have text selected, then the selected text will be cut. Pasting will take place at the current cursor position.
create the file ~/.nanorc
To use any of the rules below, just add the line to the .nanorc file
set tabsize 4
The above example is a 4 space tab suitable for python
set tabstospaces
this line is necessary to make nano treat tabs as spaces instead of tabs. This is also necessary for python
set linenumbers
This line helps with coding and debugging.