I got pretty proficient at vim using basically the defaults (I added tabs to spaces and tab width to 4 spaces, and auto/smart indent in the .vimrc). These are the keys I use regularly. If you can memorize these, you can use vim proficiently:<p><pre><code> h/j/k/l (movement keys)
i (insert mode)
esc (leave current mode/go to default state)
u (undo)
>> / << (indent, unindent)
dd (delete line)
yy (copy line)
p (paste)
v (visual mode, used to highlight stuff)
gg (go to beginning of file)
G (go to end of file)
r (replace the char under the cursor with the next char entered)
% (jump to next paren/bracket, or if on a paren/bracket, jump to matching paren/bracket)
w (go to next word)
dw (delete word)
cw (change word (deletes the word then goes into insert mode))
A (append (goes to the end of the line and into insert mode)
0 (go to beginning of line)
$ (go to end of line)
/some_word (searches for some_word, hit n to jump to the next occurrence)
?some_word (searches for some_word, in reverse direction)
</code></pre>
Common commands:<p><pre><code> :%s/regex/replacement/g (replace regex matches with replacement)
:q (quit)
:q! (quit without saving)
:w (save)
:wq (save then quit)
:x (save then quit)
:set blah (turns on setting blah)
:set noblah (turns off setting blah)
</code></pre>
Most vim commands you can stick a number N before to execute N times.<p>e.g. 5d deletes 5 lines. 5y copies 5 lines. 5> indents 5 lines. 5j jumps down 5 lines. Some common command combinations:<p><pre><code> %v%> (jump to next bracket, go into visual mode, jump to next bracket (highlighting everything in between), then indent it all)
ggdG (jump to top, then delete everything to the end of file, (clears a file))
ddp (deletes a line of text and then pastes it (below where it currently it), thus this transposes two lines)
</code></pre>
You can see how you quickly develop strings of commands you rattle off by chaining basic commands together.<p>EDIT (joke):<p>Q. How do you algorithmically generate a cryptographically strong random string?<p>A. Put a newbie in front of vim.