I was refactoring my Neovim config but I do not want to overwrite the current config yet. So I’m looking for the solution to load config from a custom directory which I found here.
- Create a new directory for the new Neovim config, for example,
~/neovim-config
.The config structure must be like this,new-config └── nvim └── init.lua
init.lua
file undernvim
directory, similar to~/.config/nvim/init.lua
: - Run neovim by set
XDG_CONFIG_HOME
pointing to the new config location:XDG_CONFIG_HOME=~/neovim-config nvim
- Done, now Neovim new config loaded from
~/neovim-config