I used to be an ardent fan of Sublime Text. It was one of the first modern editors that was fast, feature-rich and extensible. However, as I started working with remote machines and Raspberry Pis over SSH the sublime text setup became cumbersome. The whole cycle of saving, re-uploading files for every small change didn’t scale well and running sublime on RPi used up precious resources. So I tried exploring Vim and ended up loving it.
Once you get past the initial learning curve you will have at your disposal a super-fast, ultra-light and highly extensible editor. Personally, what I find amazing about Vim is its minimal footprint. Not to mention the associated cool geek factor.
Some numbers & graphs
Let’s pull up a quick comparison between Sublime Text, Vim and Visual Studio Code (seems to be the current popular choice). The charts show the time and memory for find and replace operations on 2 files.
For the smaller file, Vim and Sublime are really fast. Code is relatively slow but is consistent across file size with ~20 secs. Sublime slows down 10x on the larger file.
The memory usage on the other hand shows a crazy story. Vim uses a mere 4MB while Visual Studio takes 2GB ! Sublime Text comes up in the middle between 400MB - 900MB. Both Sublime and Studio crashed multiple times before I could get them to finish.
Text editors consuming the RAM equivalent of Chrome for performing such simple text operations is ridiculous.
Lesser known features
Split Panes & Tabs
:split or :vsplit <filename>to split the pane horizontally or vertically. Entering “:tabedit filename” opens up the file as a newtab. You can switch between the tabs using <# of tab>gt.
Did you know that Vim has built in auto complete ? Hit “Ctrl + n” It’s pretty basic and provides results only from libraries or headers included. However, there are plenty of plugins available which give you full functionality.
For people who work on remote systems a lot like me, vim has a killer feature. You can edit the file on remote systems using the following:
Choosing an editor is a matter of personal taste. If you’re like me and prefer not to keep moving your hands between the keyboard and mouse you will love Vim. Give it a chance and you will find the time you invested learning is worth it.