Modify the "automatic installation" so it uses $XDG_CONFIG_HOME
- Dominant language
- Vim Script
- Stars
- 35.8k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
I suggest replacing the following snippet in the [Automatic Installation section on the Tips page](https://github.com/junegunn/vim-plug/wiki/tips#automatic-installation):
```vim
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
```
With the following:
```vim
if !empty($VIM_CONFIG_DIR)
let data_dir = $VIM_CONFIG_DIR
elseif has('nvim')
let data_dir = stdpath('data') . '/site'
elseif !empty($XDG_CONFIG_HOME)
let data_dir = $XDG_CONFIG_HOME
else
let data_dir = $HOME . '/.config/vim'
endif
```
It's not only easier to read, it is now compliant with [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir/latest/), but allowing override by setting the `VIM_CONFIG_DIR` env var.
Contributor guide
No contributing guide indexed for this repository
Research direction
Open the vim-plug wiki's Tips page and locate the Automatic Installation section. Replace the existing data_dir snippet with the proposed VIM_CONFIG_DIR, Neovim, XDG_CONFIG_HOME, and fallback logic; done means the page shows the requested snippet and its links and formatting remain intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vim
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100