An opinionated article about vim
Tags: vim, productivity, career, beginners
Published: 2023-06-30 09:10:29

## Introduction
I have now been using vim and neovim for almost a year. In that time I built a lot of experience with the IDE, which I wanted to share with people thinking about making the switch.
This article will mostly just go over why I **like** vim, but I'll also be talking about some disadvantages.
When showing code to use as an example of editing, I'll be taking code from my own Redmine plugin: [gnosis](https://github.com/aneshodza/gnosis).

## Super fast code navigation

The most obvious and most talked about point is how fast you can navigate code with vim. There are a lot of keybindings used for jumping around code. One example would be following:
```ruby
protect_from_forgery except: %i[github_webhook_catcher semaphore_webhook_catcher]
```
Now if I want to remove the `github_webhook_catcher` from the `protect_from_forgery` statement, I would go following steps (assuming my cursor is somewhere completely random): `:4 WWW db` does the job. Here is a video of how that might look:

![Video of text being deleted, vim style](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zb0uwrbxmc1c6em3v1bv.gif)

There are a lot more keybindings and tricks that improve your speed. If you have trouble memorizing them all, [this cheat sheet was A-tier](https://www.reddit.com/r/vim/comments/32r85c/this_is_my_favorite_vim_cheat_sheet_does_anyone/).

## Extreme configuration

A personal favorite is how much you can personalize vim. Everything is customizable, from your background color to very specific keybindings. One example of that would be [my own `.vimrc`](https://github.com/aneshodza/.dotfiles/blob/main/.vimrc).
As someone who gets irritated as soon as something tiny is wrong with their code editor, the ability to customize everything was a very big bonus.
Currently I am using [nvchad](https://github.com/NvChad/NvChad) with my [own nvchad config](https://github.com/aneshodza/nvchad_config), which makes for a beautiful code editor:
![Screenshot of my nvchad dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xplkrn53mv37ubx83sii.png)
![Screenshot of nvchad with open code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/43uv2ks56amymugrqqxf.png)

## Very good plugin system

(Neo)vim supports plugins, which make your code editor much better. You need a faster way to comment stuff? Sure, here is [nvim-comment](https://github.com/terrortylor/nvim-comment). Now you need a better tool to surround text by certain characters? Alright, we also have [nvim-surround](https://github.com/kylechui/nvim-surround). And this goes on for almost everything you ever needed.
And in the rare case that you **can't** find a plugin for what you need: Write it yourself! It's very easy to write plugins, as vim and neovim both have a lot of functions that help with writing those.

## The steep learning curve

The biggest problem to vim is its steep learning curve. If you're someone who is already in a commercial setting and need to produce at a certain speed, learning vim will be pretty hard. As someone who is still in education I had the option of killing my coding speed for a few months, just so I could learn vim.

## Alright, I'm convinced. Should I use vim or neovim?

That choice everybody should make for himself, but I use **neovim**.

### What's the difference between vim and neovim?
The major difference is that neovim uses lua for its plugins, which vim is still on vimscript.
Most people prefer lua, as it's more intuitive to write and has loads of uses outside of writing neovim plugins, making lua a much more useful language than vimscript.

### Which one has better plugins?
From personal experience, neovim has much better plugins, while not more.
The fact that they're written in lua makes them more performant than vimscript, which already is a big benefit. On top of that: The fact that learning lua is much more useful than vimscript means that more people are willing to spend time learning it, making neovim plugins feel much more refined.

#### Example comparison: fzf-vim vs. telescope
As someone that has been using fzf for most of the time, changing to telescope opened up so much more options. Telescope has integrated git diffs, commit histories, language server settings, and much more.
This is an example of how the commit history check looks like
![Commit history of telescope](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t7nlbu5glqzf3q6hqreh.png)

## Conclusion

I think learning vim is something everyone that is still in education should do, independent of if you actually stick with it or not.
The great amount of configuration and useful keybindings makes using vim a great experience.