fix: Use default if $XDG_CONFIG_HOME is not set (#546)

This commit is contained in:
Jackson Law 2020-04-08 17:15:21 -07:00 committed by GitHub
parent 5e61e53772
commit 11eac2294f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,13 +1,13 @@
let mapleader ="," let mapleader =","
if ! filereadable(expand('~/.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..." echo "Downloading junegunn/vim-plug to manage plugins..."
silent !mkdir -p ~/.config/nvim/autoload/ silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/
silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim
autocmd VimEnter * PlugInstall autocmd VimEnter * PlugInstall
endif endif
call plug#begin('~/.config/nvim/plugged') call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"'))
Plug 'tpope/vim-surround' Plug 'tpope/vim-surround'
Plug 'scrooloose/nerdtree' Plug 'scrooloose/nerdtree'
Plug 'junegunn/goyo.vim' Plug 'junegunn/goyo.vim'