Notes - doctorfree/nvim-lazyman GitHub Wiki
The first time nvim
is executed Mason will install several packages required
by the new Neovim configuration. Please be patient. If you exit Neovim prior
to completion of the Mason installs, it will resume the next session.
After installing and initializing the Neovim configuration, perform a health
check while in Neovim with :checkhealth
. Examine any warnings or errors and
perform any necessary remedial actions such as installing missing packages
or resolving keymap conflicts.
The NVIM_APPNAME
procedure described above allows you to keep any existing
~/.config/nvim
and install multiple Neovim configurations, each in its own
separate ~/.config/$NVIM_APPNAME
folder. Note, however, that if you create
a symbolic link from ~/.config/$NVIM_APPNAME
to ~/.config/nvim
with the
intention of using the nvim-lazyman
configuration without need of NVIM_APPNAME
then you will also need to symlink ~/.local/share/$NVIM_APPNAME
and
~/.local/state/$NVIM_APPNAME
.
[Important Note:] If nvim-lazyman
is installed and initialized using the
NVIM_APPNAME
environment variable as described above then it is
important to add the setting and export of this variable to your shell's
initialization file (e.g. .bashrc
for Bash users, .zshrc
for Zsh users).
Add the line export NVIM_APPNAME="nvim-lazyman"
to your shell initialization
and re-login or source the initialization file. If this is not done then
subsequent invocations of nvim
will attempt to use ~/.config/nvim
rather
than ~/.config/nvim-lazyman
.
In addition to exporting NVIM_APPNAME in your shell initialization file, you
may wish to create aliases to execute with the various Neovim configurations
you have installed. For example, aliases could be created to use Neovim
configurations installed in ~/.config/nvim-python
and ~/.config/nvim-work
as follows:
alias vip='function _vip(){ export NVIM_APPNAME="nvim-python"; nvim $* };_vip'
alias viw='function _viw(){ export NVIM_APPNAME="nvim-work"; nvim $* };_viw'
After sourcing these aliases in your shell, to invoke Neovim with the Python
configuration run vip filename.py
and to invoke Neovim with your Work config
run viw proposal.md
.
An example ~/.aliases
file might include:
command -v nvim > /dev/null && {
alias vi='nvim'
[ -d $HOME/.config/nvim-lazyman ] && {
alias lmvim='function _lmvim(){ export NVIM_APPNAME="nvim-lazyman"; nvim $* };_lmvim'
}
[ -d $HOME/.config/nvim-AstroNvim ] && {
alias avim='function _avim(){ export NVIM_APPNAME="nvim-AstroNvim"; nvim $* };_avim'
}
[ -d $HOME/.config/nvim-LazyVim ] && {
alias lvim='function _lvim(){ export NVIM_APPNAME="nvim-LazyVim"; nvim $* };_lvim'
}
[ -d $HOME/.config/nvim-Kickstart ] && {
alias kvim='function _kvim(){ export NVIM_APPNAME="nvim-Kickstart"; nvim $* };_kvim'
}
}
Another alternative to setting NVIM_APPNAME in the environment or with an
alias is to use the lazyman
command to specify which Neovim configuration
to use with this invocation. This is done using the -e config
option to
lazyman
. When invoking lazyman
with the -e config
argument, the Neovim
configuration can be specified by setting config
to one of allaman
,
astronvim
, kickstart
, lazyman
, lazyvim
, lunarvim
, nvchad
, or any
Neovim configuration directory in ~/.config
. For example, to edit the file
foo.lua
using the LazyVim Neovim configuration:
lazyman -e lazyvim foo.lua
Now you're using the LazyVim Neovim configuration to edit foo.lua
, all of the
LazyVim key bindings, plugins, options, and configuration will be used.
To instead use the LunarVim Neovim configuration to edit foo.lua
:
lazyman -e lunarvim foo.lua
Before using lazyman -e <config> ...
to explore a Neovim configuration,
first install and initialize the <config>
configuration with lazyman
.
When invoked with the -e config
option, lazyman
sets the NVIM_APPNAME
environment variable to the specified config
and executes nvim
with
all following arguments. This is a pretty easy way to explore all the
lazyman
installed and initialized Neovim configurations.