Fixed an error in vim setup.

This commit is contained in:
Christian Baer 2020-10-11 20:56:08 +02:00
parent d2feaecae1
commit 1330f08cbb
3 changed files with 13 additions and 10 deletions

View File

@ -1,21 +1,21 @@
set undodir=$XDG_DATA_HOME/vim/undo
set directory=$XDG_DATA_HOME/vim/swap
set backupdir=$XDG_DATA_HOME/vim/backup
set viewdir=$XDG_DATA_HOME/vim/view
set viminfo+='1000,n$XDG_DATA_HOME/vim/viminfo
set undodir=${VIMDOTDIR}/undo
set directory=${VIMDOTDIR}/swap
set backupdir=${VIMDOTDIR}/backup
set viewdir=${VIMDOTDIR}/view
set viminfo+='1000,n${VIMDOTDIR}/viminfo
set runtimepath=$XDG_CONFIG_HOME/vim,$VIMRUNTIME,$XDG_CONFIG_HOME/vim/after
" Install vim-plug
if empty(glob('$XDG_DATA_HOME/vim/autoload/plug.vim'))
silent !curl -fLo $XDG_DATA_HOME/vim/autoload/plug.vim --create-dirs
if empty(glob('${VIMDOTDIR}/autoload/plug.vim'))
silent !curl -fLo ${VIMDOTDIR}/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
autocmd VimEnter * PlugInstall --sync | source $VIMRC
endif
" Specify a directory for plugins
" Install plugins
call plug#begin('$XDG_DATA_HOME/vim/plugged')
call plug#begin('$VIMDOTDIR/plugged')
Plug 'elzr/vim-json'
Plug 'arcticicestudio/nord-vim'

View File

@ -18,4 +18,5 @@ NPM_PACKAGES="${HOME}/.npm-packages"
export MANPATH="${MANPATH-$(manpath)}:$NPM_PACKAGES/share/man"
## Use vimrc fom XDG config home
export VIMINIT='source "$XDG_CONFIG_HOME/vim/vimrc"'
export VIMDOTDIR="$XDG_CONFIG_HOME/vim"
export VIMINIT='let $VIMRC="$VIMDOTDIR/vimrc" | source $VIMRC'

View File

@ -2,6 +2,8 @@
# Set up XDG environment
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:=${HOME}/.config}
export XDG_CACHE_HOME=${XDG_CACHE_HOME:=${HOME}/.cache}
export XDG_DATA_HOME=${XDG_DATA_HOME:=${HOME}/.local/share}
# Where to look for zsh config
export ZDOTDIR=${ZDOTDIR:=${XDG_CONFIG_HOME}/zsh}