Unix Vi crib sheet

Still using Vi? I know I still do, and have relied on a saved crib sheet to help me remember.
So I have posted it below:


STANDARD COMMANDS -- Movement

Command
Action 
h
space left 
l
space right 
k
line up 
j
line down 
w
word forward 
b
word backward 
)
sentence forward 
(
sentence backward 
H
top of screen 
L
bottom of screen 
G
last line 
nG
go to line n 
^E
scrolls down by a line 
^D
scrolls down by half screen 
^F
scrolls down by full screen 
^Y
scrolls up by a line 
^U
scrolls up by half screen 
^B
scrolls up by full screen


STANDARD COMMANDS -- Changing Text

Command
Action 
C
changes rest of line 
cc
changes line 
cw
change word 
rx
change character at cursor with character x 
D
delete rest of line 
dd
delete current line 
dw
delete word at cursor 
x
delete character at cursor 
u
undo last change 
yy
yank current line into buffer 
p
insert buffer after cursor 
P
insert buffer before cursor


COLON COMMANDS

Command
Action 
:w [file]
writes to file specified 
:w
writes to file (useful if startup was like vi .plan since the program knows what file to write to) 
:wq
write to file and quit 
:q
quit
:q!
quit without saving


INPUT COMMANDS -- these are entered from command mode

Command
Action 
a
inserts text after cursor until Esc is pressed to return to command mode 
A
inserts text at end of line until Esc is pressed to return to command mode 
i
inserts text before cursor until Esc is pressed to return to command mode 
I
inserts text at beginning of line until Esc is pressed to return to command mode 
o
insert text on line below current line until Esc is pressed to return to command mode
O
insert text one line above current line until Esc is pressed to return to command mode

Comments

Popular posts from this blog

Why Datacentre Operators Are Prioritising Regions with Lower Energy Costs Over Traditional Locations

Data Sovereignty and AI

The Rise of the 25GE interface ?