I was taking notes while watching the following video.
Mouseless Development with IdeaVim - Miguel Beltran - Berlindroid
I recommend visiting The repo Miguel Beltran has made for the talk.
The order and structure of the gist is a 1-to-1 mapping of the video flow.
-
Modes
- Normal => default mode
- Insert => activate it using 'i'
- Visual => activate it using 'v'
-
Commands
- /string => search 'string' in current file
- ci) => change in parentheses
-
Recommendation
- Map CapsLock to ESC
- Make vim your git editor =>
git config --global core.editor "vim"
- Put your .vimrc file in a source control platform and share it with people
- Learning
- Start training using VimGolf
- Try vimtutor cli
- Try vim adventures game
-
Navigation
- Simple movement
- h => left
- j => down
- k => up
- l => right
- w => jump beginning of the next word
- b => jump previous word
- e => jump end of the next word
- :lineNumber => jumps to lineNumber
- Simple movement
-
Editing
- $ => end of the line
- A => append to the end of the line as same as $a
- Simple command
- x => delete a character
- d => delete command
- dj => delete current and below lines
- dw => delete word
- dd => delete the line
- D => delete up to the end of the line
- u => undo as same as CTRL+z
-
Visual mode
- V => select current line then you can extend selection using navigation commands e.g. hjkl
- vip => select lines between empty lines i.e. visual selection paragraph
-
Searching
- /string => search for string
- * => search the word under cursor
- n => repeat search
- N => repeat search backwards
-
More advance
- :%s/foo/bar/g => replace all foo with bar, you can also use CTRL+R to have the same effect
- :sort => select some lines using visual mode then type this command to sort the lines
- Macro
- qa => starts recording a macro with label 'a', do your stuff the press q again to stop recording the macro
- @a => applies macro 'a' to the selected characters/lines