How to Make a vimrc

As many of you know, this year we will be using C++ to program our robot. Along with that comes a standard dev environment, and therefore, a standard text editor: vim. Vim has been around for the longest time (1991), and it has stood the test of time, even as other more advanced graphical text editors have come and gone. Even though most seasoned users can use any version of vim without complaint, most will agree that the use of a vimrc file will not only boost the productivity of the user, but keep the user coding for much longer.

For most, the vimrc supplied in the dev environment should be fine, but for the curious, they can go about making their own. Alongside efficiency, one of the many ways I changed my vim usage was by adjusting the keybinds. For example, ‘:wq’ saves the current buffer and exits vim. To be precise, that’s exactly 5 keystrokes to exit vim. In my vimrc, I have that same command mapped to ‘ wq’. That’s 3 keystrokes. Seeing how many times I quit vim in any given day, that will save a lot of time, and also prevent certain injuries that come with needlessly stretching your hand across a keyboard. This goes for many other commands as well. Opening a new tab generally is done with ‘:tabnew’. That’s 8 keystrokes. By doing ‘ tn’, that’s now shortened to 3. Along with the rest of the tab commands, these new keybinds save a lot of time, and also, my hands.

After worrying about avoiding carpal tunnel, we can move on to customization. I for one prefer having the numbers show in the gutter at all times, so I have set that in my vimrc. I also like to have a slew of plugins installed. Most of the plugins in the provided vimrc are more than adequate, so I really shouldn’t have to elaborate on that.

You might have noticed that I haven’t told you how to explicitly do anything. I personally advocate for figuring things out and researching, and this is no different. There are a ton of GitHub pages and blogs and videos on getting a proper vimrc set up. This is simply a starting point.