Create
Learn
Share

Linux 103 vi

rename
verickle's version from 2017-11-14 20:45

Arrow Keys

Question Answer
hleft
jdown
kup
lright
memorize

Search

Question Answer
/search forwards in your file
?search backwards in your file
nrepeats the last search you performed
memorize

Save/Quit

Question Answer
:xExit, saving changes
:qExit as long as there have been no changes
ZZExit and save changes if any have been made
:q!Exit and ignore any changes
:wSave without exiting
memorize

Insert Text

Question Answer
iInsert before cursor
IInsert before line
aAppend after cursor
AAppend after line
oOpen a new line after current line
OOpen a new line before current line
rReplace one character
RReplace many characters
memorize

Motion

Question Answer
hMove left
jMove down
kMove up
lMove right
wMove to next word
WMove to next blank delimited word
bMove to the beginning of the word
BMove to the beginning of blank delimted word
eMove to the end of the word
EMove to the end of Blank delimited word
(Move a sentence back
)Move a sentence forward
{Move a paragraph back
}Move a paragraph forward
0Move to the begining of the line
$Move to the end of the line
1GMove to the first line of the file
GMove to the last line of the file
nGMove to nth line of the file
:nMove to nth line of the file
fcMove forward to c
FcMove back to c
HMove to top of screen
MMove to middle of screen
LMove to botton of screen
%Move to associated ( ), { }, [ ]
Ctrl+UMove up half a screen
Ctrl+DMove down half a screen
Ctrl+FMove down almost a full screen
Ctrl+BMove up almost a full screen
Ctrl+EScroll down one line at a time
Ctrl+YScroll up one line at a time
memorize

Deleting Text

Question Answer
xDelete character to the right of cursor
XDelete character to the left of cursor
DDelete to the end of the line
ddDelete current line
:dDelete current line
memorize