Vim provides many ways of moving around documents as well as jumping between buffers. In this article, we are going to focus on some useful tricks to improve your speed even further.
Operate with Search Motion
E.g. in the below sentence if we want to delete the words in bold. Other than using f{char} or t{char} another easier option is to use the search motion.
The task takes a lot of time but at the end is still completed on time. ^ - cursor here
Type d/is<CR> and it becomes
The task is still completed on time.
^ - cursor here
To expand on this further, you can use vim-sneak which lets you jump to or operates on any location with 2 characters.
E.g.
This qt is qt qt is a test.
^ - cursor here
Type 2dzis and it becomes
This is a test.
^ - cursor here
You can also use this with other modifiers, e.g. “v” for selection or “c” to change the words.
Performing Operations with Text Objects
This should sound familiar to any Vim users.
print("hello world")
^ - cursor
Type ci” then you can change the words inside the double quotes even though your cursor position is not within “”