Skip to content

Commit 6c8fc7c

Browse files
committed
Default to shallow clone/fall back to regular, don't plug vim-plug:
vim-plug repo is pretty big (8.8M at the time of this commit), so it makes sense to only fetch the HEAD of master (or cURL using raw.githubusercontent.com if available). If however shallow clone is not supported due to proxying/mirroring, regular git clone will be used. Maintaining vim-plug as a plugin can be a bad idea for several reasons, please see the vim-plug FAQ: https://github.com/junegunn/vim-plug/wiki/faq#shouldnt-vim-plug-update-itself-on-plugupdate-like-vundle
1 parent bc3df27 commit 6c8fc7c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

.vimrc

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
" Automatic installation
1616
" https://github.com/junegunn/vim-plug/wiki/faq#automatic-installation
1717
if empty(glob('~/.vim/autoload/plug.vim'))
18-
silent !git clone https://github.com/junegunn/vim-plug.git $HOME/.vim/bundle/vim-plug
18+
let clone_details = "https://github.com/junegunn/vim-plug.git $HOME/.vim/bundle/vim-plug"
19+
silent call system("git clone --depth 1 ". clone_details)
20+
if v:shell_error | silent call system("git clone " . clone_details) | endif
1921
silent !ln -s $HOME/.vim/bundle/vim-plug/plug.vim $HOME/.vim/autoload/plug.vim
2022
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
2123
endif
@@ -42,9 +44,6 @@
4244
" Default to same plugin directory as vundle etc
4345
call plug#begin('~/.vim/bundle')
4446

45-
" Maintain vim-plug as a plugin as well
46-
Plug 'junegunn/vim-plug'
47-
4847
" <Tab> everything!
4948
Plug 'ervandew/supertab'
5049

0 commit comments

Comments
 (0)