Skip to content

Commit

Permalink
Fix empty XDG_CONFIG_HOME confusing /vim directory
Browse files Browse the repository at this point in the history
  • Loading branch information
rafi committed May 28, 2016
1 parent 8c37085 commit b8d6544
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ endif

" }}}
" Respect XDG specification {{{
if isdirectory($XDG_CONFIG_HOME.'/vim')
if ! empty($XDG_CONFIG_HOME) && isdirectory($XDG_CONFIG_HOME.'/vim')
let $MYVIMRC=expand('$XDG_CONFIG_HOME/vim/config/vimrc')
if has('nvim')
" For Neovim, use .config/vim instead of .config/nvim
Expand Down
2 changes: 1 addition & 1 deletion config/plugins/unite.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
" External Tools {{{
"
" The silver searcher settings
let g:my_ag_opts = get(g:, 'g:my_ag_opts', []) + [
let g:my_ag_opts = get(g:, 'my_ag_opts', []) + [
\ '--vimgrep', '--smart-case', '--skip-vcs-ignores', '--hidden',
\ '--ignore', '.git', '--ignore', '.idea', '--ignore', '.stversions',
\ '--ignore', 'bower_modules', '--ignore', 'node_modules', '--ignore', '.tmp'
Expand Down
2 changes: 1 addition & 1 deletion config/vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if &compatible
endif

" Respect XDG
if isdirectory($XDG_CONFIG_HOME.'/vim')
if ! empty($XDG_CONFIG_HOME) && isdirectory($XDG_CONFIG_HOME.'/vim')
let $VIMPATH=expand('$XDG_CONFIG_HOME/vim')
let $VARPATH=expand('$XDG_CACHE_HOME/vim')
else
Expand Down
1 change: 1 addition & 0 deletions filetype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ augroup filetypedetect " {{{

autocmd BufNewFile,BufRead */inventory/* setf ansible
autocmd BufNewFile,BufRead */playbooks/*/*.yml setf ansible

autocmd BufNewFile,BufRead *.j2 setf jinja
autocmd BufNewFile,BufRead Tmuxfile,tmux/config setf tmux

Expand Down
2 changes: 1 addition & 1 deletion ftplugin/vim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ setlocal formatoptions-=o
setlocal formatoptions-=r

" For gf
let &l:path = expand('$VIMPATH').','.join(map(split(&runtimepath, ','), 'v:val."/autoload"'), ',')
let &l:path = join(map(split(&runtimepath, ','), 'v:val."/autoload"'), ',')
setlocal suffixesadd=.vim
setlocal includeexpr=fnamemodify(substitute(v:fname,'#','/','g'),':h')

Expand Down

0 comments on commit b8d6544

Please sign in to comment.