Skip to main content
Version: 1.9.0

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

  1. Create a new repository using whatever version control system you would like. For these steps we will assume you are using git with the repo username/astronvim_config
  2. Clone AstroNvim (normal installation instructions)
git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim
  1. 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.

  1. Copy the example init.lua file provided with AstroNvim to your user directory:
cp -r ~/.config/nvim/lua/user_example/ ~/.config/nvim/lua/user/
  1. Initlialize AstroNvim (this example is using the unattended installation as described above)
nvim  --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
  1. Modify the ~/.config/nvim/lua/user folder and user/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:

  1. Clone AstroNvim (normal installation instructions)
git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim
  1. Clone your empty new repository to your ~/.config/nvim/lua folder
git clone https://github.com/username/astronvim_config.git ~/.config/nvim/lua/user
  1. Initialize AstroNvim
nvim  --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'