My current nvim is in ~/AppData/Local/ and I want to drag it out just one directory below $HOME. How can I set $XDG_CONFIG_HOME, and can it be done via Neovim?

1 Answer 1


Setting environment variables is done via the OS or the shell.

On Windows, you can use the GUI

Right click on Computer, Advanced system settings, select Advanced tab and click Environment variables.

or use the shell (cmd.exe):

setx XDG_CONFIG_HOME C:\Users\foo\bar
  • Note: $XDG_CONFIG_HOME is generic to all XDG-compliant applications, so don't set it to an Nvim-specific path. If you set XDG_CONFIG_HOME=C:\Users\foo, then Nvim will put its config in C:\Users\foo\nvim, and other apps will put their configs in C:\Users\foo\<app>.
    • :help xdg attempts to explain this clearly.
  • Thanks! If $XDG_CONFIG_HOME is set, would it cause problems or changes to other applications?
    – Paul Kim
    Feb 16, 2019 at 14:16
  • No, its entire purpose is to tell XDG-compliant applications where to put their configs. Note that $XDG_CONFIG_HOME should not be Nvim-specific. If you set XDG_CONFIG_HOME=foo, then Nvim puts its config in foo/nvim, and other apps will put their configs in foo/<app>. Feb 17, 2019 at 3:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.