My journey with Vim

I have been rocking Vim/Neovim for over seven years. Back then, I was all about Sublime Text and Atom (Yes, Atom was very popular).

My initial Vim configuration
My initial Vim configuration

Discovering Vim

Then, during my second college year's internship, I noticed my colleague (also my mentor, Doni) using Emacs. He threw shade at me for constantly pressing the arrow keys in Atom to move lines. So, I shot Emacs, but it wasn't my jam. I discovered Vim after countless hours of searching and experimenting with various text editors and never looked back.

In the beginning, I created a basic Vim configuration by following a tutorial online. I mapped H/L to ^/$, used Space as the leader key, and followed other similar instructions.

However, I now question whether mapping H/L/J/K to ^/$/G/gg was a wise decision. This mapping often confuses me when I switch to using vi on a server and realize that the default keys differ. Nevertheless, these mappings work seamlessly on my laptop, so I have kept them in my configuration. My setup only consists of a simple .vimrc file.

Configuring Vim

I have been searching other user’s setups through GitHub for inspiration and tweaking my own. Soon, I have multiple files instead of a single .vimrc file. I have divided it into sections such as mappings for key shortcuts, options for basic editor options, and plugins for managing plugins through vim-plug. I even pushed them to GitHub for easier installation and setup on different machines. Additionally, I have written a simple script to automate the process.

Some plugins have been used frequently in the past:

Plug 'mbbill/undotree
Plug 'scrooloose/nerdtree'
Plug 'w0rp/ale'
Plug 'junegunn/fzf.vim'
Plug 'Yggdroot/indentLine
Plug 'scrooloose/nerdcommenter'
Plug 'mattn/emmet-vim'
Plug 'Valloric/YouCompleteMe'
Plug 'ternjs/tern_for_vim'

I use plugins for file search/lookup and code autocompletion the most, and that's still the case now. But I hardly use most of the plugins in this list anymore. Either there are newer and better alternatives, or I don't need them anymore.

When I started using Vim, someone recommended trying YouCompleteMe for code completion. It worked well for the completion code, but the installation was a hassle, and it was slow. So, after about six months, I switched to deoplete.nvim, which was lighter and more user-friendly. I stuck with it for quite a while, a year or two, before jumping ship to coc.nvim.

coc.nvim is built on Node.js and has an excellent extension system like VS Code. The folks behind coc.nvim and the community have created numerous plugins that cover all I need. Even without plugins, coc.nvim rocks with LSP, which supports most programming languages and offers definition and code completion.

The plugins what I created
The plugins what I created

During my adventures in tweaking and playing with plugins, I start creating some Vim plugins myself. Though I'm not actively maintaining or using them, crafting plugins brought me much joy. Initially, I wanted to avoid resizing Vim windows using a mouse, so I developed a plugin called resize.vim to handle that task. It was a simple implementation that mainly involved fetching window sizes, assembling commands, and binding keys. While working on this, I felt the pain of the Vim script being not so user-friendly, which dampened my enthusiasm.

At the same time, I was also cooking up another plugin, vim-fileheader. This little plugin automatically adds and updates file header comments. Looking back, it seems silly now. It's been ages since I bothered to slap my name, and the last updated time on the file headers doesn't feel all that meaningful anymore.

In my early years, I used to tweaking my configuration, constantly trying out new plugins, and experimenting with fresh commands I learned from the official docs. After a few years of tweaking, my configuration gradually stabilized, and the frequency of changes decreased.

Embracing Neovim

Along the Vim journey, I dabbled in related stuff like tmux, zsh, and fish. My GitHub repo slowly morphed into a collection of my dotfiles, which were managed and installed using shell scripts. It came in handy once when my computer crashed. I swiftly set up my dev environment on a new machine using those scripts.

After using Vim for a long time, I came across Neovim. I can't pinpoint exactly when I made the switch, but Neovim's new features are cool, like float windows, built-in LSP support, and more. The latest biggest change for me was getting rid of my Vim script configuration that I have been using for years and refactoring it with a lua-based configuration. This means that I have fully embraced Neovim.

My configuration is fully lua-based for now
My configuration is fully lua-based for now

Now, my Vim configuration is feeling like a whole new beast. I've got lazy.nvim handling my plugins, although I did switch to another plugin manager at some point, but I can't remember its name now. lazy.nvim is a gem - true to its name. It lets me lazyload plugins by file types, commands, and more. This has really juiced up my editor's startup speed. Plus, it's got an excellent lock file feature, so even if something goes haywire after an upgrade, I can roll back to the old version and keep things working.

My usual plugins have totally changed. I use telescope.nvim for searching and jumping to files, neo-tree.nvim for the file tree, nvim-treesitter for code syntax highlighting, nvim-cmp with LSP for code completion/jumping/diagnostics. Basically, when I'm coding, all I need are LSP and these plugins.

And yes, I've got plenty of little plugins to enhance all aspects of the programming experience, but I won't list them all here. If you're interested, you can check out my dotfiles repository on GitHub.

At the latest

At the latest, even though using the Vim/Neovim editor might not actually boost my programming efficiency that much, the process of using it and tinkering around is just pure joy. The tinkering itself is meaningful. I guess I'm just someone who enjoys tinkering and finds all sorts of niche stuff fascinating.

My journey with Vim/Neovim is far from over. I used it every day for coding. I might completely revamp my configuration again in the near future. The most important is the joy of tinkering. Try something new and enjoy it.