I have been using vim and various IDEs with vim-like bindings for a good long
while now, ever since college.
Lately, I have been curious to try NeoVim and its more powerful features. I am
hoping to power up my homekey usage.
Installing NeoVim
On Mac OS, with Homebrew, that’s trivial.
brew install neovim
My muscle memory compels me to type vim and view when opening text files.
To give NeoVim a fair shake at making it into my core personal toolkit, I
created aliases.
In my ~/.zshrc file:
if which nvim >/dev/null;then
function use-nvim {alias vim="nvim"alias vi="nvim"alias view="nvim -R"}
use-nvim
fi
User Config
Vim reads from ~/.vimrc and its plugin, etc lives in ~/.vim/, while
NeoVim canonically reads its vimrc file from ~/.config/nvim/init.vim (or
.lua) and ~/.config/nvim/, respectively.
I want to keep things as compatible between the two, for now. In case I decide
later to return to Vim–or if I find myself in a system without the facilities
for NeoVim–I want most of what I use to customize NeoVim to also apply to Vim.
More to the point: I want my Vim and NeoVim installations to share the same
config file.
mkdir ~/.vim/
ln-s ../.vim ~/.config/nvim # this redirects nvim's config dir to vim'sln-s$HOME/.vimrc ~/.vim/init.vim # redirects init.vim to ~/.vimrc
The vimrc file ~/.vimrc now becomes our master vimrc file. It should work
for both NeoVim and Vim.
Its content, at the moment (I’m currently in the middle of trying out three
new plugins: vim-commentary, vim-easymotion, and vim-sneak):
Next: Mastering LSPs
For quick edits and one-offs, Vim is great. It lets me live and stay in the
Terminal without too much context switching. For more extensive coding, though,
I still rely on language features and the bells and whistles delivered by an
IDE like VSCode.
Next up, I want to explore LSP servers and understand how NeoVim, as a client,
interacts with them. My goal is to set one up that lets me work comfortably
in some programming languages of choice, wholly in NeoVim.
I liked vim-easymotion in plain Vim. hop.nvim is the NeoVim equivalent.
I had to script the keybindings (with which-keys so that they can be
displayed as key...
LazyVim also comes with the “ibl”
(indent-blankline.nvim)
plugin that renders vertical lines (by default, with the | character)
as indent guidelines. I don’t...