Baby Steps
change Caps Lock to ctrl key in windows
hjkl, ctrl+c
Motions
w: beginning of a word
e: to jump to the end of a word
b: jump to the beginning of a word backwards
ge: to jump to the end of a word backwards.
There are word and WORD.
Use W, B, E, gE to jump by WORD. This is useful in case:
function helloVimWorld() {
console.log("Hello vim world");
}
f{character}: character not string on one line
F{character}: behind the cursor (Left)
t{character}: character before occurrence of a {character}
T{character}: character before occurrence of a {character} (Left)
0: Moves to first character of a line
$: Move to end of a line
^: Move to the first none-blank character of a line
g_: Move to the non-blank character at the end of a line.
}: down
{: up
ctrl+d: move down half a page
ctrl+u: move up half a page
/{pattern} + enter: find
n: next
N: previous one
/<Enter>: find one last search
?<Enter>: find on last search(before cursor)
Change setting to relative line in vscode
Jump to definition of function: gd
Jump to file: gf
gg: Go to the top of the file
{line}gg: Go to a specific line.
G: Go to the end of the file.
%: Go to ]})({[
Operators
{operator}{count}{motion} combition
I study using a markdown from the Operator chapter.
dw: Delete word.
u: undo
ctrl+r: redo
/{word}: find word
ctrl+o: And back (???? Is same as 'B' ???)
Practice #1
Practice #2
Practice #3
Ing The Dot operator
\