- Everyone says vim is really hard, that's a myth.
- Think of it like learning a card game or a computer game. You have
to learn the hands if you want to play poker, but it's still fun to
play as a beginner. The more you play the more you learn.
- It's OK to use the mouse and the arrow keys … at first.
- If you're a Mac user, install
MacVim for familiar
keyboard shortcuts and interface conventions.
You've got to start somewhere
- Focus on learning a few things at a time.
- Try to learn what all of the letter keys do (both lower and
- Using a cut-down cheatsheet with just the commands you're learning
now can help.
- Vim is a modal editor.
- Issue commands in normal mode and type text in
- Live in normal mode, and dive into insert mode to make small,
- Commands that move the cursor are called motions.
- Prefix motions with a number to repeat them.
- Often easy to remember mnemonics, e.g. w moves by
- It's also common to move by searching.
- Operators take a motion as an argument.
- d2w will delete 2
- This is where we start to see the real power of Vim: You can build
up functional sentences from multiple commands, and the more you learn
the more complex commands you can build.
- Used with operators, in place of a motion.
- Aware of the structure of the text (to some degree).
- For example, dib will delete
Repeat the last edit
- The . command repeats the last edit.
- Once you get used to this it's amazingly powerful.
- Think of your edits as little functions you can apply again and again.