Why use Vim ?
Introduction
So, Why would one use Vim? As Vim being the most complicated Text editor when it comes to closing it!! Also, people think it’s not worth the time or it’s just not their type of Text Editor. Well, that’s true, I am not forcing anyone to use Vim, just to tell the reasons why people use Vim. Again, it’s not to show off to anyone that I use Vim, just to appreciate the power of Vim and its community, it’s just amazing!!
Vim is not a text editor just for anyone, it can be daunting initially but the more you use it, the more you love it. There is nothing called a time-wastage in learning Vim, if you think learning something is waste of time, just don’t learn it! To have understood and got good at something you need to dedicate time and effort to it, there’s no shortcut. When it comes to shortcuts, Vim is the fairyland of it, just use one or create your own. That’s how cool Vim can be when used properly.
Some of the most important and crucial reasons why people use Vim are:
Vim is Speed!
Vim can be opened from the terminal, and that itself can speak that it is lightweight and uses lower system resources and hence causing minimal lag. This might not be an issue for high-end computers but when it comes to low-end machines, Vim behaves as a life-saver. Using certain commands feels so wicked fast and intuitive. Certain commands such as t
or f
, u
, and many others are really powerful when it comes to editing in Vim. When you don’t have to think about what keys you should type, you are really getting faster in Vim.
The above screencast is from my article Vim: Set up for Python, which uses some key mappings to run python code directly from Vim itself by executing the shell commands from Vim’s Command mode. A simple map can save a lot of time.
nnoremap py :!python %
Number of Commands/shortcuts
When it comes to using key-bindings and shortcuts, there is no shortage of them. You can spend days, weeks, months, years but still, there will be some or the other thing to learn in Vim. That can be very intimidating to some people but that’s how life is. You cannot get perfect at anything but surely better is the word to focus on. There is a good little cheatsheet at devhints for beginners to quickly get started. Also, you can follow with the Youtuber- ThePrimeagen, who focuses on switching and using Vim. Vim is has a robust set of command and key-bindings by far compared to other tex-editors. Here are some of my daily used editing commands and navigation commands.
Power to use it as an IDE
Vim provides some awesome features such as terminal integration, Key-mappings, Window Splits, etc to take text-editing and developer environment to a next-level. You can literally use Vim as an IDE for many of the programming languages like C/C++, Python, Java, Javascript, GO, etc. Though it can’t replace entire IDE-like features, it is indeed powerful enough to add features in making a custom IDE experience. It might require some time and research to configure it to use it as a full-blown IDE, but it might be a very useful and self-motivating experience. There are definitely many articles, tutorials out to guide you in configuring the editor to an IDE. People might not use Vim for the features it has but also for the lightweights as compared to other IDEs such as Visual Studio, Android Studio, Eclipse, IntelliJ IDEA, etc.
From, the above screenshot, we can see that I have configured Vim almost like VSCode, Ok! Just the look of it is similar but ya we have the file manager as NERDTree, integrated Terminal, and the buffer opened as the editor. You can even add more functionality like autocomplete, keymaps to compile/run/build the code. There is are infinite possibilities when it comes to customization in Vim and to make it a full-blown IDE. OH! And by the way my Vim look changes from time to time XD
Available almost everywhere
As said, Vim can be opened via the terminal, and hence it is quite viable when it comes to accessibility. It is pre-installed in almost every Linux-distributions, macOS, FreeBSD, etc. Hence it is quite reliable when it comes to compatibility and cross-platform support. You can start editing in any environment in Vim, so it becomes a good reason to learn to use Vim at least basic editing and opening, closing, etc. Vim being minimal and lightweight, it just becomes easy to work with servers. Production-environment, etc. It also isn’t that complicated once you make your head around it. Being available in almost every Operating System has some value to it like it is the most dependable editor out there. Even after 30 years, yes Vim was released in 1991, it is still maintained by its producer Brain Moolenaar. That is mind-boggling, Vim is truly a vintage text editor silently but widely dominated in terms of its reach in Computing.
The Level of Customization/Configuration
It’s kind of a double-sided sword for some people as it can be daunting to customize from scratch and also, it could be a rewarding and pleasurable experience of having the personalized experience. With the number of plugins, custom vimrc and color schemes, etc Vim is very prone to personalization. It is Open Source, so we also have it’s distributions such as SpaceVim, SPF-13, etc. Some more distribution can be found here. Some Distribution is pref-configured with some basic stuff and is ready to use, so they are quite beginner-friendly and introduce them to Vim in a better way. NeoVim which is an evolution of Vim written in Lua is much more powerful and provides even more customization keeping the basic key-bindings in mind. Editing Vimrc is quite an amazing and intuitive experience as it allows to add functionality or enhance the existing features in Vim.
Conclusion
Text Editors don’t matter, what matters are the problem-solving skills
Vim is a simple and minimal text editor, everyone can use it but not everyone finds the need to use it, that’s fine. It might be ideal for me to use Vim than other editors but it might not be for you. But there is nothing to lose in knowing some basics of Vim. It might be useful somewhere, you never know! And if your favorite editor is not available, Vim might prove to be a great quick solution. Thanks for reading. Happing Coding :)