Andy's Cafe

Notes on Vim

Page created :
Last updated :

Honing your tools

It’s pretty common to see craftpeople creating tools for themselves for a variety of reasons. Maybe it’s because the exact tool they need doesn’t exist; perhaps a slight modification to a tool would help fit their style more.

Whatever the case, I want to assert that this happens often. This is why I like to take time to learn about text editors from the ’70s. I take no stance on the whole Emacs v. Vim thing; it’s a pretty silly thing to argue about. Plus, my setup is running Spacemacs, a version of Emacs focused on Vim keybindings, so I am not even sure how to categorize that one.

I’m not particularly new to the app actually. I’ve been slowly configuring it to my liking as I learn about new features. As someone who spends a lot of time editing text files, I don’t mind honing my knowledge of this tool.

The Vim way?

So on that note, I watched Mastering the Vim Language by ThoughtBot on YouTube and took some notes.

If you think of Vim as a language, then the commands can be thought of as a “verb” + “noun” couple. It also helps that the keybindings are more or less abbrieviations of the action or phrase they represent.

Some Keybindings

KeyAction
cDelete and enter Insert mode
>Indent
<Outdent
yYank (copy)
wMove forward a word
bMove backward a word
iw“Inner Word”: Targets the word you are in
it“Inner Tag”: Targets the HTML tag you are in
ip“Inner Paragraph”
as“A Sentence”
fFind the character you type, puts cursor on the character
tFind the character you type, puts cursor before the character
Ff, but going backwards
Tt, but going backwards
/Search forwards
?Search backwards

Reply via email