Tips on learning Vim as I moved my primary toolchain to Ubuntu 20.04 on WSL2
Getting started
-
Josean Martinez has:
- a very helpful video The Ultimate Beginner’s Guide to Learn and Master Vim
- a Vim essentials cheatsheet
-
Enable Vim keybindings in your current editor (VSCode, Obsidian)
-
Start with the video Effective Neovim: Instant IDE which uses the kickstart.nvim code
-
The popular YouTuber and Twitch streamer “The Primeagen” has lots of good content on Vim, but I’d start with his 7-part tutorial on Vim As Your Editor
-
I started with this t
-
Pick a theme.
Tips and tricks
- Improving Vim’s startup time, particularly the one-liner
vim --startuptime vim.log
Going deeper
- Book and video https://www.barbarianmeetscoding.com/boost-your-coding-fu-with-vscode-and-vim/foreword/
- Marcus Kazmierczak’s excellent Working with Vim series
- Improving Vim Speed, with Santi Younger’s very helpful notes:
1:00 vim has a mythology of being impossibly hard.
2:30 Stay out of insert mode.
3:30 Disable arrows, to work on getting used tohjkl
movement.
4:20 As you get more advanced let go ofhjkl
5:00 learn advanced shortcuts:
w
to move onew
ord at a time
b
(back)
e
(ends of words)
ge
(back end of words)
f
(find)
5:50 advanced functions to delete chunks of phrasest
ct
7:12 delete finddf
(d
elete until itf
inds a specific symbol you are looking for)
8:40 relative numbers (example-16
,-1co
.) this copy pastes a chunk above the line where you are (or below)
9:20H
M
L
(high medium low)
- Greg Hurrell’s Vim screencasts
- Thoughtbot’s How to Do 90% of What Plugins Do (With Just Vim)
- Brodie Robertson’s YouTube videos on Vim and Linux - for example FZF Vim Is Hands Down The Best Vim Fuzzy Finder
- Look at the Vim plugins from Tim Pope
History
- Bill Joy’s invention of vi
- Why vim uses hjkl keys as arrow keys.
- Wikipedia has a page with a keyboard layout of the ADM-3A terminal
Muscle memory
- VimGolf
- Vim Adventures - chargeable for a 6-month licence
- Rescue Sleeping Beauty using Vim keys.
Re-mapping Esc key
- Long discussion on ycombinator of options for alternate keys, particularly
- Mapping
jk
toEsc
- Making CapsLock be
Esc
on a single press, and CapsLock when pressed in combination with another key
- Mapping
Ultimate Vim .rc: https://github.com/amix/vimrc