« Back to Index

Vim: beginner notes

View original Gist on GitHub

Tags: #vim #beginner

Vim for beginners.md

There are many ‘motions’ and things you can do but I would probably say there are some essential motions you’ll use a lot…

The typical structure for doing something like “delete the text inside parentheses” is… “operation, placement, pattern” (not sure if that’s the correct terminology to use, I’ve not had to think about that sort of stuff in a long time 😅) but an example would be di( where d is the operation (i.e. delete), i is the placement (i.e. inside), ( is the pattern (i.e. the parenthesis).

For the “operation”: you have d for delete, v for select, c for change.

For the “placement”: you have i for inside, a for around.

Example: if I have the text myFunction(something) and my cursor is inside the parentheses then I can do…

Of course there’s a lifetime of motions/movement/modal stuff you can learn but I’d definitely say the above is my “bread and butter” of things I use a lot (outside of features from plugins).

Good luck!

EDIT: the following Neovim plugins can help you https://github.com/jinh0/eyeliner.nvim + https://github.com/folke/which-key.nvim