Multiple Configurationsλ︎
Many different Neovim configurations can be used at the same time, by instaling each config in $HOME/.config/
using unique directory names
Community Configuration Projects
- Kickstart.nvim a highly documented starter to effectively build your own configuration
- LazyVim lazy & mason configuration
- Magit Kit fennel configuration from the author of Conjure
- cajus-nfnl fennel-based config
- AstroNvim rich Neovim experience
Always have a working config
Create a separate configuration when making major changes to your configuration or starting a new configuration from scratch.
NVIM_APPNAME environment variableλ︎
Set NVIM_APPNAME
to a configuration directory name (relative to $HOME/.config/
) to run Neovim with that specific config.
The configuration directory name is used to save local share
, state
and cache
files for that specific configuration.
Configure shell aliasλ︎
Create a Shell alias for each configuration that will be used, to avoid setting the NVIM_APPNAME
variable each time.
Add alias to .bashrc
for Bash shell, .zshrc
for Zsh or use a common shell-aliases file.
Define Shell Aliases to run each configuration
shell-aliasesλ︎
Create a .config/shell-aliases
file containing all shell aliases which can be used with any shell.
A common shell-aliases file is very useful when switching between different shells, avoiding the need to define aliases twice.
Source the .config/shell-aliases
file from within .bashrc
or .zshrc
Neovim config selectorλ︎
Create a shell function to popup a menu with the list of available Neovim configurations, defined in ~/.config
where the configuration directories are prefixed with nvim-
, e.g. ~/.config/nvim-astro5/
Neovim Config Fuzzy Finder
List every neovim configuration in $HOME/.config
, any directory starting with nvim-
name.
nvim-fuzy-find() {
# All config paths are prefixed with ~/.config/nvim-
local config=$(fdfind --max-depth 1 --glob 'nvim-*' ~/.config | fzf --prompt="Neovim Configs > " --height=15% --layout=reverse --border --exit-0)
[[ -z $config ]] && echo "No config selected, Neovim not starting" && return
# Open Neovim with selected config
NVIM_APPNAME=$(basename $config) nvim $@
}