I have been using Neovim for personal projects for over a year. Recently, I want to set up Neovim system wide so that other users in the server can also use my config if they want. In this post, I will summarize the necessary configurations.
First, you need to install Neovim in a system location, for example, under
Then edit the system profile
/etc/profile and add the path of Neovim:
According to the documentation of Neovim, Neovim will look for
(the default is
So for global configuration, we need to put all configuration under
Take my configuration for an example:
mkdir /etc/xdg/nvim && cd /etc/xdg/nvim && git clone --depth 1 https://github.com/jdhao/nvim-config.git .
We also need to create a symlink
sysinit.vim and link it to
ln -s init.vim sysinit.vim
Change the value of
g:nvim_system_wide in init.vim to 1 to install the plugins system-wide.
Since I use vim-plug to manage plugins, I have set up vim-plug to install the system wide plugin under
(see code here).
Now, as root user, open neovim and use
:PlugInstall to install plugins.
The system configuration is finished.
Usually, each user may want to change the default configuration set by the root.
The user’s personal config should be put in
It will override the global configurations.
There is currently one gotcha: the users can not install local plugins using vim-plug easily.
If the user want to install a custom plugin, they should first clone the plugin repo to a location and add the plugin path to
For example, if we install
we should add the following setting to
Another way of adding your personal plugins to runtimepath is by using vim-plug:
You have to manually update the plugin though.
- Neovim doc,
- Neovim doc,
- system wide nvim config.
See neovim documentation
:h sysinit.vim. ↩︎
License CC BY-NC-ND 4.0