How to start Neovim with minimal configuration
In the past, I would install vim alongside nvim in my system as a backup, so I have a terminal editor to fix the configuration of Neovim whenever I broke it and some annoying errors are populated through an autocmd after every keystroke. Since the errors always come from my configuration(init.lua) or the plugins I installed, I wonder if I could start nvim without any configuration, then I can use the vanilla Neovim to fix the issue.
Disable all configuration and plugins with --clean
Going through the documentation of Neovim, I notice a --clean option is added in 0.8.0, that would prevent loading configuration files and user’s plugins when starting Neovim. At the same time, built-in plugins for Neovim would be loaded as usual.
nvim --cleanUse an alternative configuration file with -u
If you do not like to work with a vanilla Neovim, you can also start it with an alternative configuration file with -u.
nvim -u "$XDG_CONFIG_HOME/nvim/minimal.lua"I found this much more useful than simply running --clean, as I can run some essential plugins such as nvim-treesitter and nvim-lspconfig in this alternative configuration.
The obvious drawback for this approach is you have to manage another configuration, and you have to make sure it is working.