Managing User Configuration
One of the best parts of separating the user configuration of AstroNvim away from modifying the system files is the ability to manage and track your own user configuration while maintaining the ability to still get AstroNvim updates. The easiest process to do this would be as follows:
Setting up a user configuration
- Create a new repository using whatever version control system you would like. For these steps we will assume you are using
git
with the repousername/astronvim_config
- Clone AstroNvim (normal installation instructions)
git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim
- Clone your empty new repository to your
~/.config/nvim/lua
folder
git clone https://github.com/username/astronvim_config.git ~/.config/nvim/lua/user
tip
If you want to keep your user configuration completely separate from the cloned repository, you can also put this folder in $XDG_CONFIG_HOME/astronvim/lua/user
. AstroNvim adds the folder $XDG_CONFIG_HOME/astronvim
to the runtimepath
so any vimscript
or lua
files in there can be sourced.
- Copy the example
init.lua
file provided with AstroNvim to your user directory:
cp -r ~/.config/nvim/lua/user_example/ ~/.config/nvim/lua/user/
- Initlialize AstroNvim (this example is using the unattended installation as described above)
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
- Modify the
~/.config/nvim/lua/user
folder anduser/init.lua
file to your liking and push the changes you make to your repository
Installing from an existing User Configuration
If you have already created your user configuration and have it tracked in a repository, then the process of getting your system up and running is very easy:
- Clone AstroNvim (normal installation instructions)
git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim
- Clone your empty new repository to your
~/.config/nvim/lua
folder
git clone https://github.com/username/astronvim_config.git ~/.config/nvim/lua/user
- Initialize AstroNvim
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'