From 11eac2294fa090cfbd891c538e6ce34fac8da88e Mon Sep 17 00:00:00 2001 From: Jackson Law <178053+jlaw@users.noreply.github.com> Date: Wed, 8 Apr 2020 17:15:21 -0700 Subject: [PATCH] fix: Use default if $XDG_CONFIG_HOME is not set (#546) --- .config/nvim/init.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index d8b0ba2..1e4d23c 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -1,13 +1,13 @@ 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..." - 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 -call plug#begin('~/.config/nvim/plugged') +call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"')) Plug 'tpope/vim-surround' Plug 'scrooloose/nerdtree' Plug 'junegunn/goyo.vim'