Ruddra.com

Journey to Vim

Journey to Vim

If you are comfortable with your current IDE but still want to try something interesting which might increase your ✌️ productivity ✌️, then you can look into Vim. This article is not setting up your Vim, you will find thousands of articles on Google. Rather, I want to share my thoughts which might motivate(or demotivate) you to use Vim. I will be adding some video links which might be useful for you to set up Vim.

The promise of productivity…

When you are using Vim, you need to remember a lot of key bindings which may not look natural, but you will be forced to use them anyway. Eventually these key bindings or shortcuts will save you a lot of time, although it requires a lot of practice to master them. But the productivity increase does not lie on the shortcuts only, rather how Vim forces you to code. In real life, we do more refactoring than writing new codes. It is kind of the core philosophy of Vim. It is more efficient to traverse around the code and make edits using Vim. Hence it makes you more productive.

But again, if you are comfortable with your current IDE and can be productive enough, then why would you choose Vim? Well, it’s up to you. I am not suggesting you use Vim to be productive. Because there is a huge learning curve in Vim. You could invest that time in other things like learning a new language, improving your programming thinking etc. But if you have time to invest in Vim, it will be worth the while. All you need to do is take a leap of faith 😄.

Don’t use Vim plugin in other IDE

You will find Vim plugins in almost all IDE/text editors. Don’t use them. Main reason is you are adding extra constraints on those IDE, which is not meant to be. Like those IDE has nice mouse support(Vim has it too, but it makes things more confusing), using Vim will restrict you to not use that properly, instead enforce you to use specific key bindings which won’t make much sense. Also, with that plugin, it will make those IDEs slow and sluggish. Will make you hate Vim more. If you want to try Vim, then use Vim.

Its a text editor, not IDE

Vim is a text editor. It is not a full fledged IDE like Intellij IDEA or Visual Studio. But with thousands and thousands of open source plugins, you can make it very smart. Still I don’t think it is a replacement for Idea or VS, but it does not complement them either.

For me, I am very much used to VS Code. I love it. It works very well with JS and Python, same is for Vim. I am very happy with the support I get from open source plugins to write codes in Python or JS in Vim. But if I were to write Java, I might need IDE support as I am not very fluent in Java. Using Vim will not be easy in this case, because I might need a lot of boilerplate codes, intellisense support etc, which I would always get in an IDE.

Start with the basics

Mastering movement keys hjkl should come as the first step. Then you can go along with more key bindings like, edit mode, quit, write etc. There are some fantastic tutorials which you can check out. Like this one from Kalle Hallden:

Or there are two parts series on Vim basics by DistroTube:

The internet is full of initial setup guides which might be useful for you as well.

Initial setup

When you a file open a newly installed Vim, it looks like this:

from air

Not pretty, right!! So you need some basic setup to make Vim a bit more useful. Basically you need to write some configurations in .vimrc file which will make Vim more useful, like adding line numbers, coloring, plugin installation, theme etc. You can follow this video series for initial Vim setup by ThePrimeagen:

So many options…

Vim is so highly configurable, sometimes it feels frustrating. There are multiple plugins for doing the same thing, and there are no central regulations like VS Marketplace for that. So you might spend a lot of time searching repositories to find which plugin suits you most.

Also, everyone has their own setup, so yours will never match with others. Write your own configuration rather than copy pasting someone else’s. It will give you a better sense of what is going on. Then reduce some plugins because it may bloat your Vim setup, and you can recycle some plugins to do other stuff instead of a new plugin.

Sometimes not all plugins are necessary. Like for example, you need a terminal from time to time. You can install voldikss/vim-floaterm plugin, which is very fantastic for floating terminal. Alternatively, you can split the vim, convert one of the splitted windows to a terminal. So you might want think before looking for plugins, because you can build some shortcuts yourself to solve the issue.

Can’t expect everything from other IDE

As I said before, I love VS Code. Like it has such a nice file tree, a terminal, awesome themes, italic fonts etc. I can’t expect them in Vim. So, I don’t try to bring them in Vim either. I try to use Vim as Vim is suppose to be used 😄. It keeps things simple and optimized.

Vim or Neo Vim

If you have spent some time with Vim, you will come to a debate, using Vim or Neo Vim. It is up to you. Setting up Neo Vim is easy if you have a Vim configured. I think you should start from Vim, then decide later if you want to move to Neo Vim or not. With Neo Vim, you can add plugins like coc-list which use Lua language instead of Vim syntax.

In conclusion

Even after a couple of month’s usage, you might not feel fluent in Vim. And that is okay. It takes time to learn new things, along with building muscle memory. So bare with it, and in the end Vim will become a very powerful tool at your disposal.

I hope this article helps you with your journey to Vim. If you have any questions, please share in comment section below

Last updated: Mar 18, 2024


← Previous
Run Github Actions Within Monthly Limit

Make the best use of free action minutes in Github by limiting the number of workflow runs.

Next →
Create Workflow using Alacritty, Fish Shell, tmux, and Vim

With the power of Alacritty, Fish Shell, tmux, and Vim, take your coding experience to the next level.

Share Your Thoughts
M↓ Markdown