Operator + Motion/Text Object

Prefer to operator + motion/object over v{motion}{operator}!

operators and motion/text object are orthogonal, so:

Motion Reference

t: jump up to a character

f: jump onto a character

;: go to the next instance when you’ve jumped to a character

,: go to the previous instance when you’ve jumped to a character

}: go to next paragraph

{: go to previous paragraph

Text Objects References

Below:

words: iw and aw

sentences: is and as

paragraphs: ip and ap

single quotes: i' and a' (NOTE: these objects don’t request cursor to be inside ')

double quotes: i" and a" (NOTE: these objects don’t request cursor to be inside ")

back ticks: i\ and a``

parenthesis: i( and a(

brackets: i[ and a[

braces: i{ and a{

tags: it and at

Repeating Actions

”.” (dot) Operator

Many tasks you do will make a lot of sense to repeat. Going into insert mode and adding some text, for example. You can do it once and then just move around and add it again with just the .. Here are a couple of other examples:

# delete a word

dw

# delete five more words

5.

Note about Visual Mode: If you want to perform . operator in Visual Mode, you need to execute: :normal. on a visual selection, which will temporarily switch you into Normal Mode. Another way is to add following line in .vimrc:

vnoremap . :normal.<CR>

Macro

Note about Visual Mode: If you want to perform macro(e.g. @a) in Visual Mode, you have to execute :norm@a on a visual selection, which will temporarily switch you into Normal Mode.