Code Faster with Vim Shortcuts!
Abdul Rahman / July 18, 2022
2 min read • 5686 views
What is Vim?
Vim is a text editor that runs in the Terminal on systems like Linux. You can use Vim with the command
vim (filename) in Linux, or you can also use WSL in the Windows Terminal. But in this article, we will discuss Vim as a shortcut rather than as a text editor as a whole, because we can also use Vim shortcuts in Visual Studio Code. We will learn the basics of Vim shortcuts and how you as a programmer can navigate
through code and become faster and more productive.
Reasons why people use Vim:
- Its very useful shortcuts
- Reduces movement of hands from keyboard to mouse
- Faster navigation in code
The above image is a summary of the shortcuts available in Vim, it looks like a lot, but one of the cool things about Vim is that you can start thinking inside Vim.
Vim is set up to function like a language, consisting of verbs, adjectives, and nouns.
For example, we can change the contents of an HTML tag by "changing inside tag" or
c i t.
Starting to Use Vim
One of the reasons people don't use Vim is because they don't get the features in VScode. We can get the benefits of VSCode & Vim Shortcuts with the Vim extension in Visual Studio Code.
To learn Vim shortcuts, we can use vimtutor. If we use Linux we can use the
vimtutor command to open it. Or we can just copy the text from here and open it in Visual Studio Code.
Above is the image of the contents of vimtutor, it's just a text file that contains the basics of Vim shortcuts, we can navigate through this vimtutor file until the end in about 25-30 minutes.
It takes a little practice to feel confident in using Vim shortcuts, but later on, you will be able to code faster and more accurately than before, go and try it!