Migrate plugins.vim to Vim9 script
This syntax is only supported in Vim 8.2 or higher, so this means older Vims won't work properly, but I don't really have much of a reason to use older Vims than that anyway. Note that because plugins.vim now requires Vim 8.2+, it doesn't need to bother providing special support for Vims that don't have the packages feature, since packages were added before Vim9 script anyway.
This commit is contained in:
parent
8668ee16d0
commit
fc59f3cf4c
1 changed files with 65 additions and 94 deletions
|
@ -1,116 +1,87 @@
|
||||||
if exists('+packpath')
|
vim9script
|
||||||
silent! packadd minpac
|
silent! packadd minpac
|
||||||
if !exists('g:loaded_minpac')
|
if !exists('g:loaded_minpac')
|
||||||
silent !git clone https://github.com/k-takata/minpac.git $XDG_CACHE_HOME/vim/pack/minpac/opt/minpac
|
silent !git clone https://github.com/k-takata/minpac.git $XDG_CACHE_HOME/vim/pack/minpac/opt/minpac
|
||||||
augroup minpac
|
augroup minpac {
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd VimEnter * call minpac#update()
|
autocmd VimEnter * call minpac#update()
|
||||||
augroup END
|
}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! Plug(...)
|
|
||||||
call call('minpac#add', a:000)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! PlugEnd()
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
packadd minpac
|
packadd minpac
|
||||||
|
|
||||||
call minpac#init({'dir': $XDG_CACHE_HOME . '/vim'})
|
minpac#init({dir: $XDG_CACHE_HOME .. '/vim'})
|
||||||
else
|
minpac#add('k-takata/minpac', {type: 'opt'})
|
||||||
if !filereadable($XDG_CACHE_HOME . '/vim/autoload/plug.vim')
|
minpac#add('tpope/vim-sensible')
|
||||||
silent !curl -fLo $XDG_CACHE_HOME/vim/autoload/plug.vim --create-dirs 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
minpac#add('prabirshrestha/async.vim')
|
||||||
augroup vimplug
|
|
||||||
autocmd VimEnter * PlugInstall
|
|
||||||
augroup END
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! Plug(name, ...)
|
minpac#add('ciaranm/inkpot', {type: 'opt', do: 'colorscheme inkpot'})
|
||||||
call plug#(a:name)
|
minpac#add('morhetz/gruvbox', {type: 'opt'})
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! PlugEnd()
|
minpac#add('direnv/direnv.vim')
|
||||||
call plug#end()
|
minpac#add('editorconfig/editorconfig-vim')
|
||||||
endfunction
|
minpac#add('godlygeek/tabular')
|
||||||
|
minpac#add('jamessan/vim-gnupg')
|
||||||
|
minpac#add('junegunn/vim-easy-align')
|
||||||
|
minpac#add('lifepillar/vim-mucomplete')
|
||||||
|
minpac#add('lotabout/skim')
|
||||||
|
minpac#add('lotabout/skim.vim')
|
||||||
|
minpac#add('mhinz/vim-signify')
|
||||||
|
minpac#add('scrooloose/nerdtree')
|
||||||
|
minpac#add('sjl/vitality.vim')
|
||||||
|
minpac#add('tpope/vim-apathy')
|
||||||
|
minpac#add('tpope/vim-commentary')
|
||||||
|
minpac#add('tpope/vim-dadbod')
|
||||||
|
minpac#add('tpope/vim-endwise')
|
||||||
|
minpac#add('tpope/vim-eunuch')
|
||||||
|
minpac#add('tpope/vim-fugitive')
|
||||||
|
minpac#add('tpope/vim-repeat')
|
||||||
|
minpac#add('tpope/vim-rhubarb')
|
||||||
|
minpac#add('tpope/vim-sleuth')
|
||||||
|
minpac#add('tpope/vim-surround')
|
||||||
|
minpac#add('tpope/vim-unimpaired')
|
||||||
|
|
||||||
call plug#begin($XDG_CACHE_HOME . '/vim/plugged')
|
minpac#add('wincent/loupe')
|
||||||
endif
|
minpac#add('wincent/terminus')
|
||||||
|
minpac#add('w0rp/ale')
|
||||||
|
|
||||||
call Plug('k-takata/minpac', {'type': 'opt'})
|
minpac#add('neoclide/coc.nvim', {branch: 'release'})
|
||||||
call Plug('tpope/vim-sensible')
|
|
||||||
call Plug('prabirshrestha/async.vim')
|
|
||||||
|
|
||||||
call Plug('ciaranm/inkpot', {'type': 'opt', 'do': 'colorscheme inkpot'})
|
minpac#add('vim-airline/vim-airline')
|
||||||
call Plug('morhetz/gruvbox', {'type': 'opt'})
|
minpac#add('vim-airline/vim-airline-themes')
|
||||||
|
minpac#add('lambdalisue/battery.vim')
|
||||||
|
|
||||||
call Plug('direnv/direnv.vim')
|
minpac#add('alvan/vim-closetag')
|
||||||
call Plug('editorconfig/editorconfig-vim')
|
minpac#add('LaTeX-Box-Team/LaTeX-Box')
|
||||||
call Plug('godlygeek/tabular')
|
minpac#add('vhda/verilog_systemverilog.vim')
|
||||||
call Plug('jamessan/vim-gnupg')
|
minpac#add('sheerun/vim-polyglot')
|
||||||
call Plug('junegunn/vim-easy-align')
|
|
||||||
call Plug('lifepillar/vim-mucomplete')
|
|
||||||
call Plug('lotabout/skim')
|
|
||||||
call Plug('lotabout/skim.vim')
|
|
||||||
call Plug('mhinz/vim-signify')
|
|
||||||
call Plug('scrooloose/nerdtree')
|
|
||||||
call Plug('sjl/vitality.vim')
|
|
||||||
call Plug('tpope/vim-apathy')
|
|
||||||
call Plug('tpope/vim-commentary')
|
|
||||||
call Plug('tpope/vim-dadbod')
|
|
||||||
call Plug('tpope/vim-endwise')
|
|
||||||
call Plug('tpope/vim-eunuch')
|
|
||||||
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('wincent/loupe')
|
minpac#add('eipipuz/factor.vim')
|
||||||
call Plug('wincent/terminus')
|
|
||||||
call Plug('w0rp/ale')
|
|
||||||
|
|
||||||
call Plug('neoclide/coc.nvim', {'branch': 'release'})
|
minpac#add('ehamberg/vim-cute-python')
|
||||||
|
minpac#add('Glench/Vim-Jinja2-Syntax')
|
||||||
|
minpac#add('tweekmonster/braceless.vim')
|
||||||
|
|
||||||
call Plug('vim-airline/vim-airline')
|
minpac#add('ternjs/tern_for_vim', {do: () => async#job#start(['npm', 'install'], {})})
|
||||||
call Plug('vim-airline/vim-airline-themes')
|
minpac#add('vito-c/jq.vim')
|
||||||
call Plug('lambdalisue/battery.vim')
|
|
||||||
|
|
||||||
call Plug('alvan/vim-closetag')
|
minpac#add('fladson/vim-kitty')
|
||||||
call Plug('LaTeX-Box-Team/LaTeX-Box')
|
|
||||||
call Plug('vhda/verilog_systemverilog.vim')
|
|
||||||
call Plug('sheerun/vim-polyglot')
|
|
||||||
|
|
||||||
call Plug('eipipuz/factor.vim')
|
minpac#add('fpob/nette.vim')
|
||||||
|
|
||||||
call Plug('ehamberg/vim-cute-python')
|
minpac#add('leafOfTree/vim-svelte-plugin')
|
||||||
call Plug('Glench/Vim-Jinja2-Syntax')
|
|
||||||
call Plug('tweekmonster/braceless.vim')
|
|
||||||
|
|
||||||
call Plug('ternjs/tern_for_vim', {'do': {-> async#job#start(['npm', 'install'], {})}})
|
|
||||||
call Plug('vito-c/jq.vim')
|
|
||||||
|
|
||||||
call Plug('fladson/vim-kitty')
|
|
||||||
|
|
||||||
call Plug('fpob/nette.vim')
|
|
||||||
|
|
||||||
call Plug('leafOfTree/vim-svelte-plugin')
|
|
||||||
|
|
||||||
if executable('task')
|
if executable('task')
|
||||||
call Plug('farseer90718/vim-taskwarrior')
|
minpac#add('farseer90718/vim-taskwarrior')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call Plug('pedrohdz/vim-yaml-folds')
|
minpac#add('pedrohdz/vim-yaml-folds')
|
||||||
|
|
||||||
call Plug('alx741/yesod.vim')
|
minpac#add('alx741/yesod.vim')
|
||||||
call Plug('pbrisbin/vim-syntax-shakespeare')
|
minpac#add('pbrisbin/vim-syntax-shakespeare')
|
||||||
|
|
||||||
if has('macunix')
|
if has('macunix')
|
||||||
call Plug('rizzatti/dash.vim')
|
minpac#add('rizzatti/dash.vim')
|
||||||
" We rename this plugin to make sure it loads AFTER vim-polyglot,
|
# We rename this plugin to make sure it loads AFTER vim-polyglot,
|
||||||
" since it won't work properly if it's loaded first.
|
# since it won't work properly if it's loaded first.
|
||||||
call Plug('itspriddle/vim-marked', {'name': 'zzvim-marked'})
|
minpac#add('itspriddle/vim-marked', {name: 'zzvim-marked'})
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call PlugEnd()
|
|
||||||
|
|
Loading…
Reference in a new issue