🗓️ 26 Dec 2023·🕑 6 min read
How I learned to use Vim as my primary text editor
Original Photo by Kari Shea
”Vim”, one of the most challenging text editor for me. I’ve remembered when I tried Vim for the first time, its feels so terrible. At least for me who wrote code for the first using Notepad++.
Coding is all about thinking and logic. Writing code sometimes can be frustrating. If we need to think harder about how to use a text editor, it’s so silly.
This is how its feels like to use Vim for the first time:
vim
or
vim file-name.js
i
key first.:wq
.
Years after that, I always see someone use Vim in the Internet or in the JogjaJS Community offline event. I also found that Vim ecosystem in the Github is very active.
This made me thinking:
It’s make no sense people keep using Vim if it’s very hard to use and decreasing productivity.
With that in mind, I made my commitment to always use Vim when there’s no deadline on my work or on my spare time, like when working on my Pet Projects for instance. The reasons are:
In this first phase, I tried to find out how exactly to use Vim. I learnt about Vim basic commands via openvim.com. I really recommend this site for all of you who want to learn on how to use Vim.
Even though I don’t remember all the things, at least now I know how to insert text, save file, and know a bit about what Command Mode, Visual Mode, and Insert Mode actually is.
After knowing how to use Vim a bit, I don’t use the real Vim in the Terminal, but I use VSCodeVim Plugin instead. I’ve been using it for 6 months and I think this plugin is perfect for someone like me who use VScode in the daily basis but also want the Vim experience on it.
I found out that this plugin is also useful on my Terminal.
With zsh-vi-mode, we can have Vim experience when I need to put some commands on our Terminal. Let’s say we have a really long command, navigating the text command using Vim shortcut is really easy with this plugin:
I really recommend this to be installed on your Terminal 👍
NvChad is one of the most popular Vim Distribution in the Internet. “Distribution” means Vim with full package. There’s several Vim built-in plugins installed, so we can expect it’ll has similar features compared to other popular text editors like VSCode.
There are some other popular Vim Distribution, like LunarVim and AstroVim.
The reason why I choose NvChad is simply because when this article was written, NvChad has more Github stars than the others. I don’t know anything about Vim plugins, I hope NvChad is good for me 😅
You might be thinking, why do I use NvChad if I can just use VSCodeVim? It’s because I want to know how’s the real Vim experience on the Terminal because VSCodeVim is just an Vim emulator that runs on top of VSCode.
After I dedicating my self using NvChad, I felt my brain hurt. There’s a lot of things that unfamiliar to me and I need a dedicated time to learn about configuring it so it’ll match with my prefernce.
Currently, I’m on Phase 4 for the next few months. If everythings goes well, maybe in the next phase I want to install fresh Vim and configuring it from scratch instead of using popular Vim Distribution.
There’s some keypoints from what I learnt using Vim so far:
From the Pros & Cons above, I think Vim can be the good productivity tools for us only if we know how to use it. In fact, now I fall in love with the keyboard mechanism and its shortcut 😆.
I also don’t recommend you to learn on how to use Vim in your worktime or when you’re on a deadline because you’ll regret it.
If you have your own experience or effective tips on how to use Vim properly you can share yours in the comment box below.
Thank you for reading 👋.
Komentar