Hey everyone!
For the last month and a half or so, I have been using Neovim. For the last month, I have exclusively used it when doing development, including modifying my Neovim configuration.
If you are unaware what Neovim is, it is a fork of Vim, but a lot of code in Vim has been refactored or redacted. The end result is a very fast modal text editor that allows for the use of fast and effective plugins. I have quite a few plugins added to my own configuration, although I don’t think I will be going over them in this post.
The first thing people might notice when using Neovim/Vim is either “how the hell do I get out of here?” or “why isn’t any text being written to the screen?” That is because when opening up a file, you are placed into Normal mode. Normal mode is used almost completely for navigating in the file or switching to another mode. You can do basic navigation with either with the arrow keys or with h, j, k or l. You might have noticed that I only mentioned keys. This is because with Neovim/Vim, you aren’t supposed to use your mouse at all, and in fact keep your fingers on the home row for fast typing as much as possible.
Typing “i” (or other commands) while in Normal mode will enter you into Insert mode. Insert mode works just as you would expect any text editor to work. When you type on the keys, those symbols appear at the location of your cursor.
There are apparently around a dozen different modes in Neovim/Vim, although so far I have really only used three or four of them. Visual mode (started by typing v while in Normal mode) which allows you to highlight text character by character the same as if you where to drag your cursor over it. The last one I have used is Visual Block mode, which is the same as Visual mode except you select text line by line. You can access Visual Block mode by typing V in Normal mode.
Aside from using the basic commands, you can also change any of the defaults to suit your liking. You can also come up with other, unique commands for your own workflows.
Neovim can feel overwhelming at first. I stated out just learning the h,j,k,l at first. Then I did VimTutor (open Neovim, and then in Normal mode type :Tutor. This will start a small series of lessons to teach you how to use Vim commands and movements).
I have done the VimTutor twice, the first time was in the middle of last year. I used the Neovim extension in VS Code for a long time to just get used to the basic movement and commands I have shared below. It was only recently that I watched some videos by ThePrimeagen and learned more commands and decided to fully immerse myself in it.
To get started I recommend you do the following:
- Do VimTutor at least once
- Look into using a Neovim Distro (basically an already set up version of Neovim with defaults). I did not do this because I wasn’t aware of them, but you should absolutely start here instead of making your own config. It takes too long to make a config to be worth it to a beginner because you don’t know how much it will speed you up.
- When you feel satisfied with VimTutor, take those commands and try to do some basic development. When you reach a situation where you feel like it is taking too long to do something, then try to see if there are commands that will better help you complete what you want to do.
Remember, the purpose of Neovim/Vim is that it should improve your speed of development. When you are first learning, you will go slower. But if you commit to really learn it then your speed should be faster than when using a traditional GUI integrated development environment. Of course, you can decide that the time to take to learn it is not worth it, or that you don’t like it. That is up to you.