Use XDG locations with fallback

This commit is contained in:
ItsDrike 2021-05-11 17:31:05 +02:00
parent 713ad7301e
commit fd85f2ccff
No known key found for this signature in database
GPG key ID: B5F6B41F708C3ADD

View file

@ -1,8 +1,8 @@
" Install plugins automatically
if ! filereadable(system('echo -n "${HOME}/.config/nvim/autoload/plug.vim"'))
if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"'))
echo "Downloading junegunn/vim-plug to manage plugins..."
silent !mkdir -p ~/.config/nvim/autoload
silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim
silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/
silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim
autocmd VimEnter * PlugInstall
endif