Only $2.99/month

Terms in this set (15)

Use... To... Mode
vi Start vim. Type the command at the shell prompt. N/A
vi filename Start vim and immediately begin working on the named file (either a new, non-existent file or an existing file). Type the vi command at the shell prompt. N/A
Insert key
i
s Enter insert mode from command mode Command
Esc key Enter the command mode from the edit mode. Insert/Replace
Delete key Delete text Insert/Replace
Insert key Change between insert and replace mode while in edit mode. Insert/Replace
# (line number) Go to a specific line in the document while in command mode. For example 94, moves the cursor to line 94. Command
dw Cut a whole word and trailing space. Command
de Cut a whole word but omit the trailing space. Command
d$ or D Cut all text following the cursor to the end of the line. Command
dd Cut a line from the text. Command
p Place text in memory into the document. Command
u Undo the last action. Command
o Open a new line above the current line. Command
Ctrl+g Display file name, total number of lines in the file and the cursor position. Command
/term Search forward for all instances of a term. Press n to go to the next term and N to go to the previous term. Command
?term Search backward for all instances of a term. Press n to go to the previous term and N to go to the next term. Command
yy Copy a line of text into memory. Command
a Append text after the cursor Command
A Append text after the current line Command
C Change text from current cursor position to the end of the line. Command
cc Change text of the entire line. Command
ZZ Save current file and exit vim. Command
h Move the cursor one space to the left. Command
j Move the cursor down a line. Command
k Move the cursor up a line. Command
l Move the cursor one space to the right. Command
z Exit without saving Command
: Enter command line mode from command mode Command
w Save the current document. Command line
w filename Name and save the file. Command line
w! filename Overwrite the file Command line
q Exit vim. This produces an error if the text was modified. Command line
q! Exit vim without saving. Command line
wq or exit Save the document and exit vim. Command line
e! Reload the file from the last saved version. This discards all edits and reloads the last saved version of the file into vim. Command line