...
I asked for advice to find a 3-minute Vim command training circuit here.
Motions in normal mode:
hjkl
for one-off movement. Use sparingly.Word-wise motions.
w
[g]e
b
and their uppercase cousinsW
[g]E
B
.Learn to use the Numbers.
5w
jumps five words ahead./
to find stuff.n
to jump to the next (partial) hit.N
to jump to the previous one.*
and#
to jump to the next/previous occurence of the word under the cursor.
Edits:
I
nsert at beginning,A
ppend at the end of line,ciw
Change in wordd]}
delete until next sentence, or paragraphS
ubstitute line with your Input....
repeat last actionu
ndo and<C-r>
redo
Ex-Commands:
:s/find/replace
find the word "find" and replace it with the word "replace", in the current Line:%s//newword/gi
- replaces the last search (with/
) with "newword" for the whole file. The /gi - options make it that you replace all occurences (g
lobal) and that the replacements are case-i
nsensitive.:w
write/save changes:wq!
the meme. Save and quit. AlsoZZ
.q:
what have I done? Ex-command History Mode.:q
to leave again.:buffers
:registers
:marks
to See what you edit, what you yanked, and where you Markes stuff. (Also searches and last Ex-Commands)
Visual Mode:
v
V
and<C-V>
in visual Mode:
o
ther end of selection
There are too many things to list here. See
:helphelp
.
Apparently the official docs are good: “nothing, absolutely nothing, beats the documentation itself”
:vimtutor
is the official tutorial“Just play nethack.” (source) (Apparently it teaches you the movement keys hjkl.)
“hjkl are almost worthless compared to other means of navigation” (source)
https://www.amazon.com/Practical-Vim-Edit-Speed-Thought/dp/1680501275
“As a long time Vim user, I also found the book Practical Vim very instructive. Not really suitable for beginners though.” (source)
http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html
Vimium
Vimium is a Chrome extension that lets you control Google Chrome with vim-like keyboard commands. It was used by some devs at Infer.
...