History of editor config file locations
vim and neovim are conceptually evolutions of much earlier editors ed, the standard editor, ex, ed extended, and vi the "visual" editor. Since ex added a number of options which are configurable by the user, it uses a configuration file called
~/.exrc. This file consists of ex commands (
map, etc) which are executed at startup of the program. vi, initially being a visual mode for ex also uses
~/.exrc with the same syntax.
Naturally, vim chose the logical next step,
~/.vimrc. Initially this also allowed a sequence of ex commands for setting simple options like
set autoindent, but over time, this grew into a whole scripting langauge. To allow for better organization of complex
vimrcs, vim allowed the use of a directory
~/.vim/ (the user's runtime path) which can contain custom plugins and scripts. Additionally,
~/.vim/vimrc is allowed as an alternative to
In the 1976 unix environment where ex was developed (and even up to today) it was very common for a utility to store its configuration in a "dot-file" in the user's home directory (e.g.,
~/.profile). When there were only a few programs which were configurable, this was not a problem. However, when there are many complex programs, management of them all becomes difficult.
In the 2000s, the freedesktop.org project (originally the X Desktop Group, or XDG) developed a set of desktop standards, among these are the XDG user directories. Under this scheme, applications should store their configuration files in (or in a subdirectory of)
XDG_CONFIG_HOME, which defaults to
~/.config/. This prevents applications from writing directly to the home directory. One of the early modernization efforts which neovim took is to move its configuration location to
~/.config/nvim/init.vim and user's runtime path to
The specific question
vim-plug allows you to choose whatever directory you want. If you use
call plug#begin('~/.vim/plugged'), the files will be installed there. If you want them in
~/.config/nvim/plugged along with other neovim config files, you can just change the path.