i
→ Insert mode. Type ESC
to return to Normal mode.
x
→ Delete the char under the cursor
:wq
→ Save and Quit (:w
save, :q
quit)
dd
→ Delete (and copy) the current line
p
→ Paste
hjkl
(highly recommended but not mandatory) → basic cursor move (←↓↑→).
Hint: j
looks like a down arrow.
:help <command>
→ Show help about <command>
. You can use :help
without a <command>
to get general help.
a
→ insert after the cursor
o
→ insert a new line after the current one
O
→ insert a new line before the current one
cw
→ replace from the cursor to the end of the word
0
→ go to the first column
^
→ go to the first non-blank character of the line
$
→ go to the end of line
g_
→ go to the last non-blank character of line
/pattern
→ search for pattern
You need to select first what you need to copy. Make this by pressing v
.
P
→ paste before, remember p
is paste after current position.
yy
→ copy the current line, easier but equivalent to ddP
u
→ undo
<C-r>
→ redo