From 41de3c713c0b82700bfcb50a45e9d7756a2cce96 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 22 Apr 2016 02:26:11 +0900 Subject: [PATCH] Export Plug command as plug# function https://github.com/junegunn/vim-plug/issues/477#issuecomment-212746298 One can directly use it to redefine Plug command: function! s:plug_with_default(...) call plug#(a:1, extend(get(g:, 'plug_opts', {}), get(a:000, 1, {}))) endfunction command! -nargs=+ Plug call s:plug_with_default() --- plug.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plug.vim b/plug.vim index adaaf45..6096740 100644 --- a/plug.vim +++ b/plug.vim @@ -131,7 +131,7 @@ function! plug#begin(...) endfunction function! s:define_commands() - command! -nargs=+ -bar Plug call s:Plug() + command! -nargs=+ -bar Plug call 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 @@ -489,7 +489,7 @@ function! s:lod_map(map, names, prefix) call feedkeys(a:prefix . substitute(a:map, '^', "\", '') . extra) endfunction -function! s:Plug(repo, ...) +function! plug#(repo, ...) if a:0 > 1 return s:err('Invalid number of arguments (1..2)') endif