Fix package load init order bugs
* Move calls to `minpac#init()` into commands which use minpac * Check if optional package directories exist before using `packadd`
This commit is contained in:
7
vimrc
7
vimrc
@@ -12,8 +12,7 @@ if has('syntax') && !exists('g:syntax_on')
|
||||
endif
|
||||
|
||||
if exists('*minpac#init')
|
||||
" When minpac is loaded initialize and define the Pack command.
|
||||
call minpac#init()
|
||||
" When minpac is loaded define the Pack command to add packages.
|
||||
command! -nargs=+ Pack call minpac#add(<args>)
|
||||
else
|
||||
" Otherwise define the Pack command to do nothing.
|
||||
@@ -203,11 +202,11 @@ Pack 'jrozner/vim-antlr'
|
||||
Pack 'greymd/oscyank.vim', {'type': 'opt'}
|
||||
let g:use_osc52 = $TMUX !=# '' &&
|
||||
\ trim(system('tmux show-options -g set-clipboard')) ==# 'set-clipboard on'
|
||||
if g:use_osc52
|
||||
if g:use_osc52 && isdirectory('pack/minpac/opt/oscyank.vim')
|
||||
packadd oscyank.vim
|
||||
endif
|
||||
|
||||
" Load YouComplteMe if termdebug plugin is not loaded.
|
||||
if !exists(':Termdebug')
|
||||
if !exists(':Termdebug') && isdirectory('pack/minpac/opt/YouCompleteMe')
|
||||
packadd YouCompleteMe
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user