Get faster at everything, the Vim way | | Resource Centre by Reliance Digital
Home > HOW-TOs > Computing Solutions > Get faster at everything, the Vim way

Get faster at everything, the Vim way




Share This Post

Most of us spend countless hours working on all kinds of tasks. We use tools and our own ways to complete our work, but can we always be these are the fastest ways. Most of us think we’re working as fast as we can, but there are things we might not have yet discovered that could help speed things up, by a little bit or by several fold. We have spoken some in the past, such as Colemak, the keyboard layout that has the potential of doubling your typing speed. Vim, the topic for this article is not a keyboard layout, but it is related. It is a text editor but it’s much more than that; it is a way of interacting with software.

Vim is a newer version of vi, a text editor from 1976, nearly 44 years ago. In recent times, nearly everyone who uses Linux or any *nix base operating system has used Vi or Vim. You might wonder, why a text editor should hold so much importance today. It has been used to type in a lot of code, for operating systems and software we have been using over the decades, no doubt, but it’s the way you navigate through lines of code of any text for that matter, that makes Vim so impressive. It’s just not for programmers. It can be used by writers, those who want to write journal and take notes, those who need to clean up data before posting it into a mail, a presentation or a spreadsheet. Vim (Vi) can speed it up.

We spend a lot of time and energy with keystrokes to type in information, to edit it, and to get from one point of the screen to another. This means several down, left, right key presses. All of it adds up through the day into a lot of time and energy. Vim is all about being able to replace words and characters without having to jump across to backspace, delete and space bar. It needs the least number of key presses and movements to get work done. You can try out Vim for yourself today, on any operating system. Most Linux distributions ship with one and if you are a Windows user, there are releases such as gVim and Neovim that you can download for free. If you happen to install them, you might find them to be quite bland, and they look like something out of the 80s. Don’t be surprised though. There are a lot of customisations for Vim. You will find a lot of information online if you look for the vimrc configuration file. Vim has a world of customisations available to the user.

Vim has a few modes in it. Most text editors let you type right away but Vim does not. You are always set in a navigation mode, where pressing a key doesn’t print anything on the screen. By default, the keys, hjkl are used for navigation, instead of the direction keys. The idea is to keep your fingers on these keys and not switch to your mouse or your direction keys. e and b for example, are used for going ahead a word at a time, or behind. y completes the copy  function, while p pastes. There are different upper and lower-case commands too. There are quite a few of these keys one needs to remember and get used to. The i key enables the Insert mode, letting you type. When you are done, simply press the Esc key to return to the navigation mode.
The v key enables the Visual mode that lets you select a word or lines, then copy, paste or delete them. The . key repeats the last step you performed, which is particularly great if you want to paste a specific set of text into different places or replace specific text in different paragraphs. As complicated as it seems, these keyboard shortcuts are quite intuitive and they come naturally to you, after a few days of using them. Vim also supports plugins too, that you can download. There are plugins managers such as Vundle and Vim-Plug that can be installed on your PC or laptop. Plugins can add features ranging from colour schemes, code formatting, language tools, quick reference tools, even media playback controls and more.
Vim isn’t limited to text editors, there are even extensions for browsers that let you navigate using only the keyboard. One of the most popular ones is called Vimium and it is available for Firefox and Chrome. You can switch between tabs, scroll, jump to the nearest text box, even pin tabs using nothing more than a key or two. Most of the key bindings are like the ones you might have used on Vim. While it seems pointless, you will be surprised by how useful the shortcuts help when you’re researching information or trying to navigate across 100 tabs. Head over to the Firefox (Vimium-FF) or the Chrome Web Store to download the extension. Once installed, simply press the ? key to get the list of all the shortcuts. You can customize them by clicking the Vimium icon in the toolbar, then on Options. Make changes as needed but try using the default ones since they are common across other software.

We also spoke about VS Code, a great software development tool for Windows, Linux and Mac OS. There are even extensions for it, that set the Vim key binds into VS Code. You can navigate pages using the Vim convention. You can find many other software that offer the Vim way of doing things.

While Vim is by no means, unheard of, it isn’t all too popular either. We hope you give it a try and you see the benefits of it in your work. This was only a quick introduction to Vim. To learn more new exciting things about Vim and everything around technology, keep visiting RelianceDigital.in.