Learning Philosophy
There is no super method to learn vim but just deliberate practice and repetition. Remember by usage instead of memorization, so it is necessary to integrate it into normal coding workflow.
Suggestions from a vim user since 2000s:
- Make it your primary note taker, diary and IDE
- It’s all about muscle memory - the key bindings
- Stick on 1&2 for about a month and you will be a champ
- Read the Man and
:hwhile stuck (after internet search); it may be overwhelming but pays well
Basic Commands
- Use
Ato append text in normal mode → it quickly jumps to the end of the line and changes mode to insert, so we are free to write anything - Delete characters with
x - Visual line navigation:
jandknavigate visual lines rather than logical ones
Quick Comment Multiple Lines
- Press
vto enter visual mode - Go down to the end of the part you want to comment
- Press
Shift + I, which puts you in insert mode, then press# - Press
Esc

Macros and Incrementing Numbers
Recording and Using Macros
Macros are incredibly useful for repetitive tasks. Here’s how they work:
Recording a macro:
- Press
qwto start recording a macro in thewregister - Perform the actions you want to repeat
- Press
qto stop recording
Playing back a macro:
@w- repeat the macro once10@w- repeat the macro 10 times@@- repeat the last played macro
Example use case: If you need to paste text at the beginning of multiple lines:
- Yank the text you want to paste
- Record macro:
qw→j0P→q - Play it:
10@wto repeat 10 times
Incrementing Numbers
When working with sequences of numbers, you can use visual block mode:
- Select numbers in a column using
Ctrl-V - Press
g Ctrl-Ato increment all numbers sequentially Ctrl-Aincrements,Ctrl-Xdecrements- The
gprefix makes each line increment by an increasing amount (0, 1, 2, 3…)
This is perfect for creating numbered lists or IDs!
Reference: Macros and Incrementing Numbers in Vim | Josh Morony
Vim in Obsidian
See Vim - In Obsidian.