LV4AD/Ch/01 Intro and Install
Properties
Chapter 1: Introduction and Installation - LazyVim for Ambitious Developers
1.1 Why Vim
About Ed and sed and ex
Interestingly,
edis somehow still available on modern Unix systems, and if you use a MacOS or Linux environment, you can probably access it by typingedin any terminal. (If you made the mistake of trying it,Control-Dwill get you out again). You now know as much as I do abouted, and trust me, you don’t want to know more.You may also be familiar with another iteration of
edcalled sed, the "stream editor." To this day it is still used for modifying text in a shell pipeline.The
edcommand was also extended to create another line editor calledex, which isn’t really used anymore, except (extensively) as a submode of Vim. In fact, if you install Neovim and typeexon your command line, you will get a very crippled instance of Neovim that only supportsexcommands.- My Note I love the historical roots of vim. Reminds me of that experimental Rust rewrite of vim that let you replace the ex substrate with any typescript implementation
This is the big one for me. I used Vim a lot through my early career, though, like many developers, I switched to VS Code when it came out in 2015. I spend a lot of time at my keyboard, and by 2020, I was so crippled by RSI that I spent six months exclusively coding by voice (a blog article on the topic has made me more famous than I expected). A friend suggested I switch back to modal editing, and it made a huge difference. The vast majority of Vim keystrokes do not require holding multiple keys with the same hand, something that really aggravates carpal tunnel syndrome.
- My Note I never thought about modal editing as a way to prevent RSI before, but I have to say I've kind of felt the "left hand claw" in many programs that require too many keyshorts that rely on that position.
1.3 Introducing LazyVim
To be clear, LazyVim is Vim. The editing experience is identical. It’s not a new iteration or version of Vim in the way that Neovim is. Instead, LazyVim is a mindset; it starts with an agreement on what constitutes the best plugin configurations for modern development, and a configuration that makes them work well together (keeping different plugins' keybindings from conflicting with each other is one of the major pain-points when managing editor configurations manually).
But if you go into using LazyVim with the mindset that this experience will be better than any other editing experience you’ve worked with before, and accept that you will be retraining some keyboard muscle memory, you will find that it is extremely well thought out. In my experience, it is exactly what a 2020s-era modal editing experience should be.
- My Note I'm heartened to hear this pain-point acknowledged, as the main drawback of customization - particularly customization that involves plugins made by others - is having a hard time knowing everything is going to work together harmoniously.
you will find that it's extremely well thought-out
- My Note Yes, this is exactly what I want to hear.
1.6 Install Neovim
Neovim development happens at a super fast pace compared to their release cycle, so it is not uncommon for folks to run the latest nightly build. I have only rarely encountered bugs in builds cut from the master branch on Github, so it’s generally safe. I usually run off the latest stable release when it comes out, and then when some new plugin update says “here’s a cool feature if you use Neovim nightly,” I’ll install the latest Neovim build instead.
If you want to live on the edge,
brew install --HEAD neovimwill install the latest nightly version of Neovim, which is probably, but not guaranteed to be, stable.If you want to, you can run the command vim/:/Tutor
<Escape>:Tutor<Enter>to open an interactive text file that you can read through and edit while learning the basics of Neovim. I do recommend doing this at some point, but now may not be the right time. A lot of things that are “normal” in the Vim tutor are different (better!) using LazyVim. The rest of this book does not assume you have gone through the tutor.1.8.2. Install Other Recommended Dependencies
You may see it compile and install a bunch of treesitter grammars; if you see a message to “Show More” use
G(i.e.Shift+g) to skip to the end.- My Note This is discussing the LazyVim menu
You can access this UI from the dashboard simply by pressing the
lkey, which is labelled in the dashboard asLazy. The label should probably beLazy Plugin Managerto make it a bit clearer, but now you know whatLazymeans so you won’t forget.Typically, the only lazy.nvim keybinding I use is
S, forSync. This is equivalent to running install, clean, and update in a single action. It guarantees that the versions of plugins that are actually installed are exactly consistent with the ones specified in the LazyVim configuration.you can find my own dot files on GitHub in the Person/Dusty Phillips/GitHub/dotfiles repository.