From 28680398626c4776d130c9d22fe75efa8129eee2 Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Sun, 28 Feb 2016 14:45:38 -0600 Subject: [PATCH] upgrade vim-plug --- config/nvim/autoload/plug.vim | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/config/nvim/autoload/plug.vim b/config/nvim/autoload/plug.vim index 3357de5..3131ba1 100644 --- a/config/nvim/autoload/plug.vim +++ b/config/nvim/autoload/plug.vim @@ -128,7 +128,7 @@ function! plug#begin(...) endfunction function! s:define_commands() - command! -nargs=+ -bar Plug call s:add() + command! -nargs=+ -bar Plug call s:Plug() if !executable('git') return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.') endif @@ -248,7 +248,9 @@ function! plug#end() call s:reorg_rtp() filetype plugin indent on if has('vim_starting') - syntax enable + if has('syntax') && !exists('g:syntax_on') + syntax enable + end else call s:reload() endif @@ -411,7 +413,7 @@ function! s:remove_triggers(name) call remove(s:triggers, a:name) endfunction -function! s:lod(names, types) +function! s:lod(names, types, ...) for name in a:names call s:remove_triggers(name) let s:loaded[name] = 1 @@ -423,6 +425,9 @@ function! s:lod(names, types) for dir in a:types call s:source(rtp, dir.'/**/*.vim') endfor + for file in a:000 + call s:source(rtp, file) + endfor if exists('#User#'.name) execute 'doautocmd User' name endif @@ -430,7 +435,8 @@ function! s:lod(names, types) endfunction function! s:lod_ft(pat, names) - call s:lod(a:names, ['plugin', 'after/plugin', 'syntax', 'after/syntax']) + let syn = 'syntax/'.a:pat.'.vim' + call s:lod(a:names, ['plugin', 'after/plugin'], syn, 'after/'.syn) execute 'autocmd! PlugLOD FileType' a:pat if exists('#filetypeplugin#FileType') doautocmd filetypeplugin FileType @@ -458,7 +464,7 @@ function! s:lod_map(map, names, prefix) call feedkeys(a:prefix . substitute(a:map, '^', "\", '') . extra) endfunction -function! s:add(repo, ...) +function! s:Plug(repo, ...) if a:0 > 1 return s:err('Invalid number of arguments (1..2)') endif