2013-09-11 04:19:48 +02:00
|
|
|
# File management
|
|
|
|
|
|
|
|
:e reload file
|
|
|
|
:q quit
|
|
|
|
:q! quit without saving changes
|
|
|
|
:w write file
|
|
|
|
:w {file} write new file
|
|
|
|
:x write file and exit
|
|
|
|
|
2013-10-29 22:11:23 +01:00
|
|
|
# Commandline Options
|
|
|
|
|
|
|
|
-x Use [weak] encryption when writing files. Will prompt for a crypt key.
|
|
|
|
|
|
|
|
|
2013-09-11 04:19:48 +02:00
|
|
|
# Movement
|
|
|
|
|
|
|
|
k
|
|
|
|
h l basic motion
|
|
|
|
j
|
|
|
|
|
|
|
|
w next start of word
|
2013-10-21 08:26:35 +02:00
|
|
|
W next start of whitespace-delimited word
|
2013-09-11 04:19:48 +02:00
|
|
|
e next end of word
|
|
|
|
E next end of whitespace-delimited word
|
|
|
|
b previous start of word
|
|
|
|
B previous start of whitespace-delimited word
|
|
|
|
0 start of line
|
|
|
|
$ end of line
|
|
|
|
|
2013-09-02 16:04:10 +02:00
|
|
|
# Insertion
|
2013-09-11 04:19:48 +02:00
|
|
|
# To exit from insert mode use Esc or Ctrl-C
|
|
|
|
# Enter insertion mode and:
|
2013-08-28 19:05:46 +02:00
|
|
|
|
2013-09-11 04:19:48 +02:00
|
|
|
a append after the cursor
|
|
|
|
A append at the end of the line
|
|
|
|
i insert before the cursor
|
|
|
|
I insert at the beginning of the line
|
|
|
|
o create a new line under the cursor
|
|
|
|
O create a new line above the cursor
|
|
|
|
R enter insert mode but replace instead of inserting chars
|
|
|
|
:r {file} insert from file
|
|
|
|
|
|
|
|
# Editing
|
|
|
|
|
|
|
|
u undo
|
|
|
|
yy yank (copy) a line
|
|
|
|
y{motion} yank text that {motion} moves over
|
|
|
|
p paste after cursor
|
|
|
|
P paste before cursor
|
|
|
|
<Del> or x delete a character
|
|
|
|
dd delete a line
|
|
|
|
d{motion} delete text that {motion} moves over
|
|
|
|
|
|
|
|
|
|
|
|
# Preceding a motion or edition with a number repeats it n times
|
|
|
|
# Examples:
|
|
|
|
|
|
|
|
50k moves 50 lines up
|
|
|
|
2dw deletes 2 words
|
|
|
|
5yy copies 5 lines
|