Nano and Vim Shortcuts
Description:
There is probably a thousand of these on the intertubes, but here’s mine.
To Resolve:
-
Nano shortcuts
ctrl+g
= helpctrl+o
= save file-
ctrl+x
= exit file alt+\
= move to beginningalt+/
= move to endctrl+y
= up a pagectrl+v
= down a pagectrl+a
= beginning of linectrl+e
= end of line-
ctrl+_
= enter a line number, a comma, and a column number ctrl+w
= search for a string, ctrl+c cancels italt+m+a
= select area to copyalt+6
= copy => highlight with cursor firstctrl+k
= cut => cuts an entire line if you don’t highlight anythingctrl+m
= inserts a blank linectrl+u
= paste-
alt+r
= replace expr1 with expr2. y for one occurance and a for all alt+x
= remove the help menu at the bottom
-
Vim shortcuts
- Basic Nav:
gg
= Moves to beginning of filenameG
= Moves to the end of filecntrl+b
= Page up. Think of it as ‘b’ack.cntrl+f
= Page up. Think of it as ‘f’orward.- Insert text:
a
= Insert text after the cursorA
= Insert text at the end of the linei
= Insert text before the cursoro
= Begin a new line below the cursorO
= Begin a new line above the cursor- Delete Text:
dd
= Delete current linedgg
= Delete to the beginning of the file.dG
= Delete to end of file- Copy/Paste:
yy
= copy current linep
= paste storage buffer after current lineP
= paste storage buffer before current line- Searching:
vim filename
- press
/
- type
word
which you want to search - press
Enter
/pattern
= search forward for pattern?pattern
= search backwardn
= repeat forward searchN
= repeat backward/\<word\>
= Full word- Search and replace:
:%s/original/replacement
= Search for the first occurrence of the string “original” and replace it with “replacement”:%s/original/replacement/g
= Search and replace all occurrences of the string “original” with “replacement”
-
Less shortcuts (added because it’s similar)
b
= Moves back one page. Insert a number before to move that many pages back.f
= Moves forward one page. Insert a number before to move that many pages forward./query
= Search somethingq
= Quit
Comments