Handle older Vims that don't have native package support by falling back on junegunn/vim-plug
This commit is contained in:
parent
0a105241d5
commit
1b532523c5
2 changed files with 88 additions and 54 deletions
|
@ -7,6 +7,7 @@ function! s:ensure_dir(dir)
|
|||
endif
|
||||
endfunction
|
||||
|
||||
if exists('+packpath')
|
||||
" These are really clever - minpac will actually be loaded on the fly only
|
||||
" when you need to update or clean your packages, rather than all the time.
|
||||
command! PackUpdate source $XDG_CONFIG_HOME/vim/plugins.vim | call minpac#update()
|
||||
|
@ -17,6 +18,11 @@ command! PackClean source $XDG_CONFIG_HOME/vim/plugins.vim | call minpac#clean(
|
|||
if !isdirectory($XDG_CACHE_HOME . '/vim/pack')
|
||||
PackUpdate
|
||||
endif
|
||||
else
|
||||
" If we're on a version of Vim that doesn't have packages, we have to load a
|
||||
" plugin manager (vim-plug) on every boot.
|
||||
source $XDG_CONFIG_HOME/vim/plugins.vim
|
||||
endif
|
||||
|
||||
augroup transparent_term
|
||||
autocmd!
|
||||
|
@ -31,7 +37,7 @@ let g:gruvbox_improved_warnings=1
|
|||
" transparent background colours. It works totally fine in Neovim though.
|
||||
if has('gui_running') || has('nvim')
|
||||
set termguicolors
|
||||
packadd gruvbox
|
||||
silent! packadd gruvbox
|
||||
let g:airline_theme = 'gruvbox'
|
||||
colorscheme gruvbox
|
||||
else
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
if exists('+packpath')
|
||||
silent! packadd minpac
|
||||
if !exists('*minpac#init')
|
||||
silent !git clone https://github.com/k-takata/minpac.git $XDG_CACHE_HOME/vim/pack/minpac/opt/minpac
|
||||
|
@ -7,49 +8,76 @@ if !exists('*minpac#init')
|
|||
augroup END
|
||||
endif
|
||||
|
||||
function! Plug(...)
|
||||
call call('minpac#add', a:000)
|
||||
endfunction
|
||||
|
||||
function! PlugEnd()
|
||||
endfunction
|
||||
|
||||
packadd minpac
|
||||
|
||||
call minpac#init({'dir': $XDG_CACHE_HOME . '/vim'})
|
||||
call minpac#add('k-takata/minpac', {'type': 'opt'})
|
||||
call minpac#add('tpope/vim-sensible')
|
||||
else
|
||||
if !filereadable($XDG_CACHE_HOME . '/vim/autoload/plug.vim')
|
||||
silent !curl -fLo $XDG_CACHE_HOME/vim/autoload/plug.vim --create-dirs 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
augroup vimplug
|
||||
autocmd VimEnter * PlugInstall
|
||||
augroup END
|
||||
endif
|
||||
|
||||
call minpac#add('ciaranm/inkpot', {'type': 'opt', 'do': 'colorscheme inkpot'})
|
||||
call minpac#add('morhetz/gruvbox', {'type': 'opt'})
|
||||
function! Plug(name, ...)
|
||||
call plug#(name)
|
||||
endfunction
|
||||
|
||||
call minpac#add('editorconfig/editorconfig-vim')
|
||||
call minpac#add('jamessan/vim-gnupg')
|
||||
call minpac#add('junegunn/fzf')
|
||||
call minpac#add('junegunn/fzf.vim')
|
||||
call minpac#add('junegunn/vim-easy-align')
|
||||
call minpac#add('lifepillar/vim-mucomplete')
|
||||
call minpac#add('mhinz/vim-signify')
|
||||
call minpac#add('scrooloose/nerdtree')
|
||||
call minpac#add('sjl/vitality.vim')
|
||||
call minpac#add('tpope/vim-commentary')
|
||||
call minpac#add('tpope/vim-endwise')
|
||||
call minpac#add('tpope/vim-fugitive')
|
||||
call minpac#add('tpope/vim-repeat')
|
||||
call minpac#add('tpope/vim-rhubarb')
|
||||
call minpac#add('tpope/vim-sleuth')
|
||||
call minpac#add('tpope/vim-surround')
|
||||
call minpac#add('tpope/vim-unimpaired')
|
||||
call minpac#add('vim-airline/vim-airline')
|
||||
call minpac#add('vim-airline/vim-airline-themes')
|
||||
call minpac#add('wincent/loupe')
|
||||
call minpac#add('wincent/terminus')
|
||||
call minpac#add('w0rp/ale')
|
||||
function! PlugEnd()
|
||||
call plug#end()
|
||||
endfunction
|
||||
|
||||
call minpac#add('LaTeX-Box-Team/LaTeX-Box')
|
||||
call minpac#add('vhda/verilog_systemverilog.vim')
|
||||
call minpac#add('sheerun/vim-polyglot')
|
||||
call minpac#add('sukima/xmledit')
|
||||
call plug#begin($XDG_CACHE_HOME . '/vim/plugged')
|
||||
endif
|
||||
|
||||
call minpac#add('lepture/vim-jinja')
|
||||
call Plug('k-takata/minpac', {'type': 'opt'})
|
||||
call Plug('tpope/vim-sensible')
|
||||
|
||||
call minpac#add('alx741/yesod.vim')
|
||||
call minpac#add('pbrisbin/vim-syntax-shakespeare')
|
||||
call Plug('ciaranm/inkpot', {'type': 'opt', 'do': 'colorscheme inkpot'})
|
||||
call Plug('morhetz/gruvbox', {'type': 'opt'})
|
||||
|
||||
call Plug('editorconfig/editorconfig-vim')
|
||||
call Plug('jamessan/vim-gnupg')
|
||||
call Plug('junegunn/fzf')
|
||||
call Plug('junegunn/fzf.vim')
|
||||
call Plug('junegunn/vim-easy-align')
|
||||
call Plug('lifepillar/vim-mucomplete')
|
||||
call Plug('mhinz/vim-signify')
|
||||
call Plug('scrooloose/nerdtree')
|
||||
call Plug('sjl/vitality.vim')
|
||||
call Plug('tpope/vim-commentary')
|
||||
call Plug('tpope/vim-endwise')
|
||||
call Plug('tpope/vim-fugitive')
|
||||
call Plug('tpope/vim-repeat')
|
||||
call Plug('tpope/vim-rhubarb')
|
||||
call Plug('tpope/vim-sleuth')
|
||||
call Plug('tpope/vim-surround')
|
||||
call Plug('tpope/vim-unimpaired')
|
||||
call Plug('vim-airline/vim-airline')
|
||||
call Plug('vim-airline/vim-airline-themes')
|
||||
call Plug('wincent/loupe')
|
||||
call Plug('wincent/terminus')
|
||||
call Plug('w0rp/ale')
|
||||
|
||||
call Plug('LaTeX-Box-Team/LaTeX-Box')
|
||||
call Plug('vhda/verilog_systemverilog.vim')
|
||||
call Plug('sheerun/vim-polyglot')
|
||||
call Plug('sukima/xmledit')
|
||||
|
||||
call Plug('lepture/vim-jinja')
|
||||
|
||||
call Plug('alx741/yesod.vim')
|
||||
call Plug('pbrisbin/vim-syntax-shakespeare')
|
||||
|
||||
if has('macunix')
|
||||
call minpac#add('itspriddle/vim-marked')
|
||||
call Plug('itspriddle/vim-marked')
|
||||
endif
|
||||
|
||||
call PlugEnd()
|
||||
|
|
Loading…
Reference in a new issue