~/articles/first-time-setting-up-nvim

How I discovered Vim

I used to use Linux on a daily baisis - Micro$oft's Windows is too error prone and unstable. Heck, once I even have my task bar disappeared. I really should write an article going over all the ways Windows had screwed me over.

While Linux offered an uncompromising versatility and customizability, I wasn't nearly as good as I am now. I wasn't able to set up some crucial utilities, i.e., the Zhuyin Input Method were just missing or badly implemented. That's when I switched to macOS. Unix based and hassle free, I finally started learning - otherwise I can't even type in my mother tongue.

I still remember those days when I couldn't compile a software and spent hours sitting in front of my desktop computer, trying to decrypt the error message.

It was during the beginning of my Linux days that I discovered Vim. It stayed with me when I made the switch to macOS, even though 99% of the time I used Atom. I don't remember at all if the "how do I quit Vim" has happened to me or not, all of this was at least 7 years ago. I knew what I needed, that is to say going into insert mode and exiting it, write and quit Vim :wq, or search /.

Which editors have I used

During all this time, I used / tried Atom, Sublime Text, Brackets, and then VS Codium1. Atom and VS Codium are my favorites for their extensibility and versatility. The reason I chose VS Codium over Atom is because Atom is really slow to start. I hate Micro$oft, that's how you know that Atom is really, painfully slow.

After using a full-blown IDE like IntelliJ and PyCharm later in high school, I realized that there's so much an editor can do: displace line up or down, swap parameter in a function call, incremental selection, multicursor, the list goes on. I then went back to VS Codium to write some simple standalone Python script, I ported the same shortcuts that I'm used to with JetBrains' IDEs and got good at it, really good at it.

And then I discovered The Primeagen.

What about NeoVim

I heard about NeoVim via the one and only Primeagen2. He's a Rust / Type Script developer and a NeoVim preacher, I don't know him that much, however I highly recommend his videos and I find a lot his values resonating with mine. He thinks it's important to know your editor so that you can leverage its power to do exactly what you want to do, without being held back by a tool. This has been my philosophy of programming that dates before knowing The Primeagen: I need to make my tools work for me, not the other way around3.

Learning NeoVim

Back and forth

I started with a "roadwarrior" init.lua configuration file to guide me through. I thought I could just read the inin.lua to understand the setup and hence do a better, more personalized config for myself.

I thought doing so would make the learning process slightly painful, but it wasn't exactly the case.

I find the scripting experience for NeoVim hard to comprehend in the beginning. Maybe it's because I have never customized an editor to this extent, I couldn't wrap my head around its internal logic. I have never used the Lua scripting lanugage before either. There was so much to learn, so much thing that we take for granted in today's modern editor like VS Cod(e|ium).

I gave up for an entire month after installing the roadwarrior setup, because I couldn't figure out what's the job of mason and lsp, and for that, snippets and other powerful IDE-like functionalities were missing.

I went back to use VS Codium for a while. Because I have a Vim plugin in VS Code, it was quite awkward to use and I start to feel that I have to bite the bullet to actually drop the need to use a mouse constantly.

What helped me learn

Photos

I wrote this article in NeoVim

Footnotes

1

VS Codium is the true open source version of VS Code. Get it? Chrome, Chromium; Code, Codium...

2

Primeagen uses Dvorak too. I couldn't help but laugh out loud when his keysmash looked like "aoeuaoeuaoeu".

3

That's also why I dislike piano manufactures. It's absurd that people with different sized hands play on exactly the same sized piano. Sure, it's for compatibility, but isn't that going too far? DS Foundation.

Zola, the beloved program (written in rust) I use to generate this website has a bug and wouldn't do its job properly, I had to downgrade it. I'm glad that I didn't spent too much time debugging because it wasn't my fault.

<newer   earlier>