Using LazyVim: 1 year after
The story
4 years ago I watched a Youtube video Flappy bird game coding with ReactJS of a famous Vietnamese software engineer. He was using Vim inside a terminal and after a few Google searches I knew there is such a thing on Earth. "Wow, this is cool. Will try it some day."
Just about last 2 years, I was having a team building vacation with my company ZaloPay and I happened to see Codeaholicguy, the above guy, in Hoi An (a beautiful old city, you guys have to visit it). I took a picture with him, that image is not shown here.
And last year, one of my colleagues dropped a decent presentation about Vim. At that time, I was someone who always praised VSCode, as if awakened by how this editor applied to work. I started to learn about it.
The start
Vim is not very beginner-friendly, in my opinion, and its learning curve is quite steep. From opening a project and saving a file to exitting vim, I had to learn and memorize everything. Also, to take advantage of vim navigation and motion, I used Vimtutor - a program that comes along vim installation. I was able to using Vim editing some files that don't require LSP (Language Server Protocol, A thing to know) such as json, yaml or txt files. I installed Vim plugin for the beloved VSCode too.
While searching for Vim plugins, I discovered Neovim, a so-called enhanced Vim (New-Vim?), uses Lua (yes, another language) for configuration. I dived into Neovim must-have plugins like Nvim-tree, Telescope and learned to configure Language servers for my work. Whuff, it was a lot, to learn.
Moving on
I realized the Neovim community was incredibly active and vibrant! There are many prebuilt starter packs (distributions) out there and I decided to use one.
My first try was with NvChad, a feature-rich distribution comes with beautiful themes. I found it quite easy to use and get used to with keymaps, especially NvChad has a keymap cheatsheet.
"The first love is hard to forget" - said someone? Though, the only problem for me was the Diffview plugin's colors. NvChad customized the colors somehow and I barely saw code diffs (Sorry NvChad if you are happened to read this post, I don't have any screenshots here and don't know it has been "fixed" or not. Never mind, let's just consider it a bug).
After trying out more distributions like AstroNvim, LunarVim, and some others' dotfiles (nicknisi, ayamir), I finally settled on LazyVim distribution from the father of lazy.nvim.
LazyVim Install and setup
Trust me, it is ridiculously easy to get started with Nvim starter packs once you have some basic knowledge about vim/nvim. For LazyVim, it was grabbing the repository and nvim
.
The documentation seems to be quite friendly and informative at https://www.lazyvim.org/installation.
I recommend checking the framework's plugins and keymaps section.
Getting used to
Until then, I have some experiences using Neovim essential plugins including Nvim-tree, Telescope and formatting/linting plugins. Moreover, LazyVim comes with its "extras", extremely useful plugins/configurations for programming languages,
However, I got deadlines too. I only coded with Nvim or Vim in VSCode whenever I could (call me a part-time Vim user), just to train my short term memory for the One True Editor.
Tmux and Nvim inside Alacritty: The beast
I always use a separate terminal windows for the dev server. It's a shame if we accidentally "reload" the IDE that's having a server running.
iTerm2 was always my go-to terminal application. However, using tmux with nvim on it gave me some bad experience that I don't clearly remember now.
While finding for alternatives, I discovered Kitty and Alacritty. They were both hyped at that time for their bbbbblazingly fast performance but I chose Alacritty for the dead simple looking on MacOS (see how) though seemed not-so-easy to configured.
My workflow was became somewhat simpler, I used my mouse less. An Alacritty window run tmux containing a Nvim pane and a dev server pane.
If I accidentally "Cmd-Q" at Alacritty window? No problem, reopen it and tmux a
!
More customizations
In my journey with "new" workflow, I have tried some plugins and tools. Here are "the list"
Tmux sessions with tmux-resurrect - a plugin for quickly open and jump between multiple projects at work.
tmux.nvim - tmux integration for nvim
nvim-ufo - better folding in nvim
Aerospace - i3 like tilling window managing
catppuccin: gorgous theme family for apps
LazyGit: simple terminal UI for git commands
Verdict
I'm so lazy right now and below paragraph is generated by AI. Hope you enjoy
In this article, I recount my journey from discovering Vim to mastering Neovim and integrating it into my workflow using tools like LazyVim, Tmux, and Alacritty. Starting with a fascination sparked by a YouTube video, I navigated through the steep learning curve of Vim, explored various Neovim distributions like NvChad and LazyVim, and eventually optimized my setup for efficient coding. Along the way, I share insights into useful plugins and configurations that enhanced my productivity.
Subscribe to my newsletter
Read articles from Thao Tang directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Thao Tang
Thao Tang
A (very) shy developer. Using Lily58 split keyboard.