From d37ec372ea992552c22586da61e34d8e8ef6333f Mon Sep 17 00:00:00 2001 From: David Yew Date: Sun, 27 Aug 2017 00:23:40 +0800 Subject: [PATCH 01/14] Change from Vundle to Vim-Plug --- .vimrc.bundles | 231 +++++++++++++++++++++++-------------------------- bootstrap.sh | 26 +++--- 2 files changed, 121 insertions(+), 136 deletions(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index 997ae9623..4ffa978b6 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -52,39 +52,22 @@ endif " } - " Setup Bundle Support { - " The next three lines ensure that the ~/.vim/bundle/ system works - filetype off - set rtp+=~/.vim/bundle/vundle - call vundle#rc() - " } - - " Add an UnBundle command { - function! UnBundle(arg, ...) - let bundle = vundle#config#init_bundle(a:arg, a:000) - call filter(g:vundle#bundles, 'v:val["name_spec"] != "' . a:arg . '"') - endfunction - - com! -nargs=+ UnBundle - \ call UnBundle() - " } - " } +call plug#begin('~/.vim/bundle') " Bundles { " Deps { - Bundle 'gmarik/vundle' - Bundle 'MarcWeber/vim-addon-mw-utils' - Bundle 'tomtom/tlib_vim' + Plug 'MarcWeber/vim-addon-mw-utils' + Plug 'tomtom/tlib_vim' if executable('ag') - Bundle 'mileszs/ack.vim' + Plug 'mileszs/ack.vim' let g:ackprg = 'ag --nogroup --nocolor --column --smart-case' elseif executable('ack-grep') let g:ackprg="ack-grep -H --nocolor --nogroup --column" - Bundle 'mileszs/ack.vim' + Plug 'mileszs/ack.vim' elseif executable('ack') - Bundle 'mileszs/ack.vim' + Plug 'mileszs/ack.vim' endif " } @@ -101,160 +84,160 @@ " General { if count(g:spf13_bundle_groups, 'general') - Bundle 'scrooloose/nerdtree' - Bundle 'altercation/vim-colors-solarized' - Bundle 'spf13/vim-colors' - Bundle 'tpope/vim-surround' - Bundle 'tpope/vim-repeat' - Bundle 'rhysd/conflict-marker.vim' - Bundle 'jiangmiao/auto-pairs' - Bundle 'ctrlpvim/ctrlp.vim' - Bundle 'tacahiroy/ctrlp-funky' - Bundle 'terryma/vim-multiple-cursors' - Bundle 'vim-scripts/sessionman.vim' - Bundle 'matchit.zip' + Plug 'scrooloose/nerdtree' + Plug 'altercation/vim-colors-solarized' + Plug 'spf13/vim-colors' + Plug 'tpope/vim-surround' + Plug 'tpope/vim-repeat' + Plug 'rhysd/conflict-marker.vim' + Plug 'jiangmiao/auto-pairs' + Plug 'ctrlpvim/ctrlp.vim' + Plug 'tacahiroy/ctrlp-funky' + Plug 'terryma/vim-multiple-cursors' + Plug 'vim-scripts/sessionman.vim' + Plug 'matchit.zip' if (has("python") || has("python3")) && exists('g:spf13_use_powerline') && !exists('g:spf13_use_old_powerline') - Bundle 'Lokaltog/powerline', {'rtp':'/powerline/bindings/vim'} + Plug 'Lokaltog/powerline', {'rtp':'/powerline/bindings/vim'} elseif exists('g:spf13_use_powerline') && exists('g:spf13_use_old_powerline') - Bundle 'Lokaltog/vim-powerline' + Plug 'Lokaltog/vim-powerline' else - Bundle 'vim-airline/vim-airline' - Bundle 'vim-airline/vim-airline-themes' + Plug 'vim-airline/vim-airline' + Plug 'vim-airline/vim-airline-themes' endif - Bundle 'powerline/fonts' - Bundle 'bling/vim-bufferline' - Bundle 'easymotion/vim-easymotion' - Bundle 'jistr/vim-nerdtree-tabs' - Bundle 'flazz/vim-colorschemes' - Bundle 'mbbill/undotree' - Bundle 'nathanaelkane/vim-indent-guides' + Plug 'powerline/fonts' + Plug 'bling/vim-bufferline' + Plug 'easymotion/vim-easymotion' + Plug 'jistr/vim-nerdtree-tabs' + Plug 'flazz/vim-colorschemes' + Plug 'mbbill/undotree' + Plug 'nathanaelkane/vim-indent-guides' if !exists('g:spf13_no_views') - Bundle 'vim-scripts/restore_view.vim' + Plug 'vim-scripts/restore_view.vim' endif - Bundle 'mhinz/vim-signify' - Bundle 'tpope/vim-abolish.git' - Bundle 'osyo-manga/vim-over' - Bundle 'kana/vim-textobj-user' - Bundle 'kana/vim-textobj-indent' - Bundle 'gcmt/wildfire.vim' + Plug 'mhinz/vim-signify' + Plug 'tpope/vim-abolish.git' + Plug 'osyo-manga/vim-over' + Plug 'kana/vim-textobj-user' + Plug 'kana/vim-textobj-indent' + Plug 'gcmt/wildfire.vim' endif " } " Writing { if count(g:spf13_bundle_groups, 'writing') - Bundle 'reedes/vim-litecorrect' - Bundle 'reedes/vim-textobj-sentence' - Bundle 'reedes/vim-textobj-quote' - Bundle 'reedes/vim-wordy' + Plug 'reedes/vim-litecorrect' + Plug 'reedes/vim-textobj-sentence' + Plug 'reedes/vim-textobj-quote' + Plug 'reedes/vim-wordy' endif " } " General Programming { if count(g:spf13_bundle_groups, 'programming') " Pick one of the checksyntax, jslint, or syntastic - Bundle 'scrooloose/syntastic' - Bundle 'tpope/vim-fugitive' - Bundle 'mattn/webapi-vim' - Bundle 'mattn/gist-vim' - Bundle 'scrooloose/nerdcommenter' - Bundle 'tpope/vim-commentary' - Bundle 'godlygeek/tabular' - Bundle 'luochen1990/rainbow' + Plug 'scrooloose/syntastic' + Plug 'tpope/vim-fugitive' + Plug 'mattn/webapi-vim' + Plug 'mattn/gist-vim' + Plug 'scrooloose/nerdcommenter' + Plug 'tpope/vim-commentary' + Plug 'godlygeek/tabular' + Plug 'luochen1990/rainbow' if executable('ctags') - Bundle 'majutsushi/tagbar' + Plug 'majutsushi/tagbar' endif endif " } " Snippets & AutoComplete { if count(g:spf13_bundle_groups, 'snipmate') - Bundle 'garbas/vim-snipmate' - Bundle 'honza/vim-snippets' + Plug 'garbas/vim-snipmate' + Plug 'honza/vim-snippets' " Source support_function.vim to support vim-snippets. if filereadable(expand("~/.vim/bundle/vim-snippets/snippets/support_functions.vim")) source ~/.vim/bundle/vim-snippets/snippets/support_functions.vim endif elseif count(g:spf13_bundle_groups, 'youcompleteme') - Bundle 'Valloric/YouCompleteMe' - Bundle 'SirVer/ultisnips' - Bundle 'honza/vim-snippets' + Plug 'Valloric/YouCompleteMe' + Plug 'SirVer/ultisnips' + Plug 'honza/vim-snippets' elseif count(g:spf13_bundle_groups, 'neocomplcache') - Bundle 'Shougo/neocomplcache' - Bundle 'Shougo/neosnippet' - Bundle 'Shougo/neosnippet-snippets' - Bundle 'honza/vim-snippets' + Plug 'Shougo/neocomplcache' + Plug 'Shougo/neosnippet' + Plug 'Shougo/neosnippet-snippets' + Plug 'honza/vim-snippets' elseif count(g:spf13_bundle_groups, 'neocomplete') - Bundle 'Shougo/neocomplete.vim.git' - Bundle 'Shougo/neosnippet' - Bundle 'Shougo/neosnippet-snippets' - Bundle 'honza/vim-snippets' + Plug 'Shougo/neocomplete.vim.git' + Plug 'Shougo/neosnippet' + Plug 'Shougo/neosnippet-snippets' + Plug 'honza/vim-snippets' endif " } " PHP { if count(g:spf13_bundle_groups, 'php') - Bundle 'spf13/PIV' - Bundle 'arnaud-lb/vim-php-namespace' - Bundle 'beyondwords/vim-twig' + Plug 'spf13/PIV' + Plug 'arnaud-lb/vim-php-namespace' + Plug 'beyondwords/vim-twig' endif " } " Python { if count(g:spf13_bundle_groups, 'python') " Pick either python-mode or pyflakes & pydoc - Bundle 'klen/python-mode' - Bundle 'yssource/python.vim' - Bundle 'python_match.vim' - Bundle 'pythoncomplete' + Plug 'klen/python-mode' + Plug 'yssource/python.vim' + Plug 'python_match.vim' + Plug 'pythoncomplete' endif " } " Javascript { if count(g:spf13_bundle_groups, 'javascript') - Bundle 'elzr/vim-json' - Bundle 'groenewege/vim-less' - Bundle 'pangloss/vim-javascript' - Bundle 'briancollins/vim-jst' - Bundle 'kchmck/vim-coffee-script' + Plug 'elzr/vim-json' + Plug 'groenewege/vim-less' + Plug 'pangloss/vim-javascript' + Plug 'briancollins/vim-jst' + Plug 'kchmck/vim-coffee-script' endif " } " Scala { if count(g:spf13_bundle_groups, 'scala') - Bundle 'derekwyatt/vim-scala' - Bundle 'derekwyatt/vim-sbt' - Bundle 'xptemplate' + Plug 'derekwyatt/vim-scala' + Plug 'derekwyatt/vim-sbt' + Plug 'xptemplate' endif " } " Haskell { if count(g:spf13_bundle_groups, 'haskell') - Bundle 'travitch/hasksyn' - Bundle 'dag/vim2hs' - Bundle 'Twinside/vim-haskellConceal' - Bundle 'Twinside/vim-haskellFold' - Bundle 'lukerandall/haskellmode-vim' - Bundle 'eagletmt/neco-ghc' - Bundle 'eagletmt/ghcmod-vim' - Bundle 'Shougo/vimproc.vim' - Bundle 'adinapoli/cumino' - Bundle 'bitc/vim-hdevtools' + Plug 'travitch/hasksyn' + Plug 'dag/vim2hs' + Plug 'Twinside/vim-haskellConceal' + Plug 'Twinside/vim-haskellFold' + Plug 'lukerandall/haskellmode-vim' + Plug 'eagletmt/neco-ghc' + Plug 'eagletmt/ghcmod-vim' + Plug 'Shougo/vimproc.vim' + Plug 'adinapoli/cumino' + Plug 'bitc/vim-hdevtools' endif " } " HTML { if count(g:spf13_bundle_groups, 'html') - Bundle 'amirh/HTML-AutoCloseTag' - Bundle 'hail2u/vim-css3-syntax' - Bundle 'gorodinskiy/vim-coloresque' - Bundle 'tpope/vim-haml' - Bundle 'mattn/emmet-vim' + Plug 'amirh/HTML-AutoCloseTag' + Plug 'hail2u/vim-css3-syntax' + Plug 'gorodinskiy/vim-coloresque' + Plug 'tpope/vim-haml' + Plug 'mattn/emmet-vim' endif " } " Ruby { if count(g:spf13_bundle_groups, 'ruby') - Bundle 'tpope/vim-rails' + Plug 'tpope/vim-rails' let g:rubycomplete_buffer_loading = 1 "let g:rubycomplete_classes_in_global = 1 "let g:rubycomplete_rails = 1 @@ -263,34 +246,34 @@ " Puppet { if count(g:spf13_bundle_groups, 'puppet') - Bundle 'rodjek/vim-puppet' + Plug 'rodjek/vim-puppet' endif " } " Go Lang { if count(g:spf13_bundle_groups, 'go') - "Bundle 'Blackrush/vim-gocode' - Bundle 'fatih/vim-go' + "Plug 'Blackrush/vim-gocode' + Plug 'fatih/vim-go' endif " } " Elixir { if count(g:spf13_bundle_groups, 'elixir') - Bundle 'elixir-lang/vim-elixir' - Bundle 'carlosgaldino/elixir-snippets' - Bundle 'mattreduce/vim-mix' + Plug 'elixir-lang/vim-elixir' + Plug 'carlosgaldino/elixir-snippets' + Plug 'mattreduce/vim-mix' endif " } " Misc { if count(g:spf13_bundle_groups, 'misc') - Bundle 'rust-lang/rust.vim' - Bundle 'tpope/vim-markdown' - Bundle 'spf13/vim-preview' - Bundle 'tpope/vim-cucumber' - Bundle 'cespare/vim-toml' - Bundle 'quentindecock/vim-cucumber-align-pipes' - Bundle 'saltstack/salt-vim' + Plug 'rust-lang/rust.vim' + Plug 'tpope/vim-markdown' + Plug 'spf13/vim-preview' + Plug 'tpope/vim-cucumber' + Plug 'cespare/vim-toml' + Plug 'quentindecock/vim-cucumber-align-pipes' + Plug 'saltstack/salt-vim' endif " } @@ -309,3 +292,5 @@ source ~/.vimrc.bundles.local endif " } + +call plug#end() diff --git a/bootstrap.sh b/bootstrap.sh index 680e3c7fa..49570fc60 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -17,11 +17,11 @@ ############################ SETUP PARAMETERS app_name='spf13-vim' [ -z "$APP_PATH" ] && APP_PATH="$HOME/.spf13-vim-3" -[ -z "$REPO_URI" ] && REPO_URI='https://github.com/spf13/spf13-vim.git' -[ -z "$REPO_BRANCH" ] && REPO_BRANCH='3.0' -debug_mode='0' -fork_maintainer='0' -[ -z "$VUNDLE_URI" ] && VUNDLE_URI="https://github.com/gmarik/vundle.git" +[ -z "$REPO_URI" ] && REPO_URI='https://github.com/compleatguru/spf13-vim.git' +[ -z "$REPO_BRANCH" ] && REPO_BRANCH='feature/vim-plug' +debug_mode='1' +fork_maintainer='1' +[ -z "$VIM_PLUG_URI" ] && VIM_PLUG_URI="https://github.com/junegunn/vim-plug.git" ############################ BASIC SETUP TOOLS msg() { @@ -157,20 +157,20 @@ setup_fork_mode() { fi } -setup_vundle() { +setup_vim_plug() { local system_shell="$SHELL" export SHELL='/bin/sh' vim \ -u "$1" \ "+set nomore" \ - "+BundleInstall!" \ - "+BundleClean" \ + "+PlugInstall!" \ + "+PlugClean" \ "+qall" export SHELL="$system_shell" - success "Now updating/installing plugins using Vundle" + success "Now updating/installing plugins using Vim-Plug" debug } @@ -195,12 +195,12 @@ setup_fork_mode "$fork_maintainer" \ "$APP_PATH" \ "$HOME" -sync_repo "$HOME/.vim/bundle/vundle" \ - "$VUNDLE_URI" \ +sync_repo "$HOME/.vim/autoload" \ + "$VIM_PLUG_URI" \ "master" \ - "vundle" + "vim-plug" -setup_vundle "$APP_PATH/.vimrc.bundles.default" +setup_vim_plug "$APP_PATH/.vimrc.bundles.default" msg "\nThanks for installing $app_name." msg "© `date +%Y` http://vim.spf13.com/" From 79f415b396982e80479ba0bfd07f19d68f5b2287 Mon Sep 17 00:00:00 2001 From: David Yew Date: Sun, 27 Aug 2017 00:39:56 +0800 Subject: [PATCH 02/14] fix error on implicit vim-scripts expansion is deprecated --- .vimrc.bundles | 6 +++--- uninstall.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index 4ffa978b6..7affdc30a 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -95,7 +95,7 @@ call plug#begin('~/.vim/bundle') Plug 'tacahiroy/ctrlp-funky' Plug 'terryma/vim-multiple-cursors' Plug 'vim-scripts/sessionman.vim' - Plug 'matchit.zip' + Plug 'vim-scripts/matchit.zip' if (has("python") || has("python3")) && exists('g:spf13_use_powerline') && !exists('g:spf13_use_old_powerline') Plug 'Lokaltog/powerline', {'rtp':'/powerline/bindings/vim'} elseif exists('g:spf13_use_powerline') && exists('g:spf13_use_old_powerline') @@ -187,8 +187,8 @@ call plug#begin('~/.vim/bundle') " Pick either python-mode or pyflakes & pydoc Plug 'klen/python-mode' Plug 'yssource/python.vim' - Plug 'python_match.vim' - Plug 'pythoncomplete' + Plug 'vim-scripts/python_match.vim' + Plug 'vim-scripts/pythoncomplete' endif " } diff --git a/uninstall.sh b/uninstall.sh index 5fd9a6d8a..35437bcf1 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -13,6 +13,6 @@ die() { rm $HOME/.vimrc rm $HOME/.vimrc.bundles -rm $HOME/.vim +rm -rf $HOME/.vim rm -rf $app_dir From ce47368a95cf84fee1a449deb2d617bd04618246 Mon Sep 17 00:00:00 2001 From: David Yew Date: Sun, 27 Aug 2017 00:47:25 +0800 Subject: [PATCH 03/14] improve uninstall.sh --- uninstall.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/uninstall.sh b/uninstall.sh index 35437bcf1..0af317a50 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -11,8 +11,21 @@ die() { exit 1 } +cd $HOME + rm $HOME/.vimrc rm $HOME/.vimrc.bundles +rm $HOME/.vimrc.before + +# Remove fork folder +rm $HOME/.vimrc.before.fork +rm $HOME/.vimrc.bundles.fork +rm $HOME/.vimrc.fork + +cd $HOME +rm -rf .vimbackup .vimswap .vimundo .vimviews + rm -rf $HOME/.vim rm -rf $app_dir +cd $HOME From f72bd4866727318fa2773ec58cf9a8312b9daf67 Mon Sep 17 00:00:00 2001 From: David Yew Date: Sun, 27 Aug 2017 00:55:08 +0800 Subject: [PATCH 04/14] remove .git to avoid prompt 'could not read Username from 'https://github.com' --- .vimrc.bundles | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index 7affdc30a..aeaa1ce45 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -115,7 +115,7 @@ call plug#begin('~/.vim/bundle') Plug 'vim-scripts/restore_view.vim' endif Plug 'mhinz/vim-signify' - Plug 'tpope/vim-abolish.git' + Plug 'tpope/vim-abolish' Plug 'osyo-manga/vim-over' Plug 'kana/vim-textobj-user' Plug 'kana/vim-textobj-indent' @@ -167,7 +167,7 @@ call plug#begin('~/.vim/bundle') Plug 'Shougo/neosnippet-snippets' Plug 'honza/vim-snippets' elseif count(g:spf13_bundle_groups, 'neocomplete') - Plug 'Shougo/neocomplete.vim.git' + Plug 'Shougo/neocomplete.vim' Plug 'Shougo/neosnippet' Plug 'Shougo/neosnippet-snippets' Plug 'honza/vim-snippets' From e8e4197110696521657344ad8190cdd53f5089c3 Mon Sep 17 00:00:00 2001 From: David Yew Date: Sun, 27 Aug 2017 01:07:48 +0800 Subject: [PATCH 05/14] replace missing amirh/HTML-AutoCloseTag with vim-scripts/HTML-AutoCloseTag --- .vimrc.bundles | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index aeaa1ce45..c13f0d1c0 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -227,7 +227,7 @@ call plug#begin('~/.vim/bundle') " HTML { if count(g:spf13_bundle_groups, 'html') - Plug 'amirh/HTML-AutoCloseTag' + Plug 'vim-scripts/HTML-AutoCloseTag' Plug 'hail2u/vim-css3-syntax' Plug 'gorodinskiy/vim-coloresque' Plug 'tpope/vim-haml' From d96ae972bbe9168ae6595c035fb1536aa27f823e Mon Sep 17 00:00:00 2001 From: David Yew Date: Sun, 27 Aug 2017 01:09:54 +0800 Subject: [PATCH 06/14] disable debug mode --- bootstrap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 49570fc60..ba7b3768b 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -19,8 +19,8 @@ app_name='spf13-vim' [ -z "$APP_PATH" ] && APP_PATH="$HOME/.spf13-vim-3" [ -z "$REPO_URI" ] && REPO_URI='https://github.com/compleatguru/spf13-vim.git' [ -z "$REPO_BRANCH" ] && REPO_BRANCH='feature/vim-plug' -debug_mode='1' -fork_maintainer='1' +debug_mode='0' +fork_maintainer='0' [ -z "$VIM_PLUG_URI" ] && VIM_PLUG_URI="https://github.com/junegunn/vim-plug.git" ############################ BASIC SETUP TOOLS From fab16fecd7e030b59f7aa338f3ce928c7797d1e0 Mon Sep 17 00:00:00 2001 From: compleatguru <2252313+compleatguru@users.noreply.github.com> Date: Sun, 1 Oct 2017 15:37:29 +0800 Subject: [PATCH 07/14] Added UnPlug function --- .vim_plug.unplug | 8 ++++++++ .vimrc | 10 +++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .vim_plug.unplug diff --git a/.vim_plug.unplug b/.vim_plug.unplug new file mode 100644 index 000000000..ee2ae0030 --- /dev/null +++ b/.vim_plug.unplug @@ -0,0 +1,8 @@ +function! s:deregister(repo) + let repo = substitute(a:repo, '[\/]\+$', '', '') + let name = fnamemodify(repo, ':t:s?\.git$??') + call remove(g:plugs, name) + call remove(g:plugs_order, index(g:plugs_order, name)) +endfunction + +command! -nargs=1 -bar UnPlug call s:deregister() diff --git a/.vimrc b/.vimrc index 8ee23227e..c438d9110 100644 --- a/.vimrc +++ b/.vimrc @@ -67,6 +67,13 @@ " } +" Load Vim Plug - UnPlug Function { + if filereadable(expand("~/.spf13-vim-3/.vim_plug.unplug")) + source ~/.spf13-vim-3/.vim_plug.unplug" + endif +" } + + " Use before config if available { if filereadable(expand("~/.vimrc.before")) source ~/.vimrc.before @@ -1061,9 +1068,6 @@ endif endif " } - - - " } " GUI Settings { From fcd94c935e5135be73094b881255edbc0408b0d1 Mon Sep 17 00:00:00 2001 From: compleatguru <2252313+compleatguru@users.noreply.github.com> Date: Sun, 1 Oct 2017 16:00:04 +0800 Subject: [PATCH 08/14] Added documentation --- README.vim_plug.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 README.vim_plug.md diff --git a/README.vim_plug.md b/README.vim_plug.md new file mode 100644 index 000000000..e6e237db3 --- /dev/null +++ b/README.vim_plug.md @@ -0,0 +1,21 @@ +# Background +This branch feature/vim-plug is an attempt to replace [Vundle](https://github.com/VundleVim/Vundle.vim) with [Vim Plug](https://github.com/junegunn/vim-plug) +The main reason being able to install/update/remove of the plugins asynchronously + +.vimrc has included .vim_plug.unplug which has the UnPlug command +so that the user can remove unwanted plugins based from the default list, just like Vundle + +For example, to replace [Syntastic](https://github.com/vim-syntastic/syntastic) with [ALE](https://github.com/w0rp/ale) + +In $HOME/.vimrc.bundles.local +```` +Plug 'w0rp/ALE' +UnPlug 'syntastic' +```` + +The user is to run +```` +vim +PlugInstall +PlugClean! +```` + +Contributions are welcome! From 06cdf2fd59a58619150483d16aae802651ff833c Mon Sep 17 00:00:00 2001 From: compleatguru <2252313+compleatguru@users.noreply.github.com> Date: Sat, 21 Oct 2017 21:57:18 +0800 Subject: [PATCH 09/14] Fix Error #716 when a plugin is already removed --- .vim_plug.unplug | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.vim_plug.unplug b/.vim_plug.unplug index ee2ae0030..c905023a3 100644 --- a/.vim_plug.unplug +++ b/.vim_plug.unplug @@ -1,8 +1,14 @@ function! s:deregister(repo) let repo = substitute(a:repo, '[\/]\+$', '', '') let name = fnamemodify(repo, ':t:s?\.git$??') - call remove(g:plugs, name) - call remove(g:plugs_order, index(g:plugs_order, name)) + + try + call remove(g:plugs, name) + call remove(g:plugs_order, index(g:plugs_order, name)) + catch /^Vim\%((\a\+)\)\=:E716/ " Key Not present in Dictionary + "echom name . ' already removed' + endtry + endfunction command! -nargs=1 -bar UnPlug call s:deregister() From cd13499ff3bcbb5cb7dfdfc22926036c76c56214 Mon Sep 17 00:00:00 2001 From: compleatguru <2252313+compleatguru@users.noreply.github.com> Date: Sat, 21 Oct 2017 22:05:24 +0800 Subject: [PATCH 10/14] Rearrange of plugins --- .vimrc.bundles | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index c13f0d1c0..6993b3d1f 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -74,7 +74,7 @@ call plug#begin('~/.vim/bundle') " In your .vimrc.before.local file " list only the plugin groups you will use if !exists('g:spf13_bundle_groups') - let g:spf13_bundle_groups=['general', 'writing', 'neocomplete', 'programming', 'php', 'ruby', 'python', 'javascript', 'html', 'misc',] + let g:spf13_bundle_groups=['general', 'writing', 'neocomplete', 'programming', 'php', 'ruby', 'python', 'javascript', 'html', 'misc', 'rust',] endif " To override all the included bundles, add the following to your @@ -129,6 +129,8 @@ call plug#begin('~/.vim/bundle') Plug 'reedes/vim-textobj-sentence' Plug 'reedes/vim-textobj-quote' Plug 'reedes/vim-wordy' + Plug 'tpope/vim-markdown' + Plug 'greyblake/vim-preview' endif " } @@ -238,6 +240,8 @@ call plug#begin('~/.vim/bundle') " Ruby { if count(g:spf13_bundle_groups, 'ruby') Plug 'tpope/vim-rails' + Plug 'tpope/vim-cucumber' + Plug 'quentindecock/vim-cucumber-align-pipes' let g:rubycomplete_buffer_loading = 1 "let g:rubycomplete_classes_in_global = 1 "let g:rubycomplete_rails = 1 @@ -265,14 +269,15 @@ call plug#begin('~/.vim/bundle') endif " } + " Rust { + if count(g:spf13_bundle_groups, 'rust') + Plug 'rust-lang/rust.vim' + endif + " } + " Misc { if count(g:spf13_bundle_groups, 'misc') - Plug 'rust-lang/rust.vim' - Plug 'tpope/vim-markdown' - Plug 'spf13/vim-preview' - Plug 'tpope/vim-cucumber' Plug 'cespare/vim-toml' - Plug 'quentindecock/vim-cucumber-align-pipes' Plug 'saltstack/salt-vim' endif " } From 6ac61d9d59f5f438ebacaf34a792dc63dd06c897 Mon Sep 17 00:00:00 2001 From: compleatguru <2252313+compleatguru@users.noreply.github.com> Date: Sun, 22 Oct 2017 04:22:48 +0800 Subject: [PATCH 11/14] Fix error when running vim -u NONE or vim --noplugin --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index c438d9110..dda1d4cd2 100644 --- a/.vimrc +++ b/.vimrc @@ -214,7 +214,7 @@ " Broken down into easily includeable segments set statusline=%<%f\ " Filename set statusline+=%w%h%m%r " Options - if !exists('g:override_spf13_bundles') + if !exists('g:override_spf13_bundles') && exists('*fugitive#statusline') set statusline+=%{fugitive#statusline()} " Git Hotness endif set statusline+=\ [%{&ff}/%Y] " Filetype From 8560c746178d07763c1581afb3075af42b339542 Mon Sep 17 00:00:00 2001 From: compleatguru <2252313+compleatguru@users.noreply.github.com> Date: Sat, 13 Jan 2018 19:06:05 +0800 Subject: [PATCH 12/14] Replace syntastic with ALE, neocomplete with deoplete for performance --- .vimrc | 61 +++++++++++++++++++++++++++----------------------- .vimrc.before | 2 +- .vimrc.bundles | 19 +++++++++++----- bootstrap.sh | 1 + 4 files changed, 48 insertions(+), 35 deletions(-) diff --git a/.vimrc b/.vimrc index dda1d4cd2..07184895e 100644 --- a/.vimrc +++ b/.vimrc @@ -596,6 +596,11 @@ endif " } + " NerdCommenter { + " Add space when comment + let NERDSpaceDelims=1 + " } + " Tabularize { if isdirectory(expand("~/.vim/bundle/tabular")) nmap a& :Tabularize /& @@ -758,28 +763,28 @@ endif " } - " neocomplete { - if count(g:spf13_bundle_groups, 'neocomplete') + " deoplete { + if count(g:spf13_bundle_groups, 'deoplete') let g:acp_enableAtStartup = 0 - let g:neocomplete#enable_at_startup = 1 - let g:neocomplete#enable_smart_case = 1 - let g:neocomplete#enable_auto_delimiter = 1 - let g:neocomplete#max_list = 15 - let g:neocomplete#force_overwrite_completefunc = 1 + let g:deoplete#enable_at_startup = 1 + let g:deoplete#enable_smart_case = 1 + let g:deoplete#enable_auto_delimiter = 1 + let g:deoplete#max_list = 15 + let g:deoplete#force_overwrite_completefunc = 1 " Define dictionary. - let g:neocomplete#sources#dictionary#dictionaries = { + let g:deoplete#sources#dictionary#dictionaries = { \ 'default' : '', \ 'vimshell' : $HOME.'/.vimshell_hist', \ 'scheme' : $HOME.'/.gosh_completions' \ } " Define keyword. - if !exists('g:neocomplete#keyword_patterns') - let g:neocomplete#keyword_patterns = {} + if !exists('g:deoplete#keyword_patterns') + let g:deoplete#keyword_patterns = {} endif - let g:neocomplete#keyword_patterns['default'] = '\h\w*' + let g:deoplete#keyword_patterns['default'] = '\h\w*' " Plugin key-mappings { " These two lines conflict with the default digraph mapping of @@ -807,21 +812,21 @@ \ "\" : "\(neosnippet_expand_or_jump)") smap (neosnippet_jump_or_expand) - inoremap neocomplete#undo_completion() - inoremap neocomplete#complete_common_string() - "inoremap neocomplete#complete_common_string() + inoremap deoplete#undo_completion() + inoremap deoplete#complete_common_string() + "inoremap deoplete#complete_common_string() " : close popup " : close popup and save indent. - inoremap pumvisible() ? neocomplete#smart_close_popup()."\" : "\" + inoremap pumvisible() ? deoplete#smart_close_popup()."\" : "\" function! CleverCr() if pumvisible() if neosnippet#expandable() let exp = "\(neosnippet_expand)" - return exp . neocomplete#smart_close_popup() + return exp . deoplete#smart_close_popup() else - return neocomplete#smart_close_popup() + return deoplete#smart_close_popup() endif else return "\" @@ -831,8 +836,8 @@ " close popup and save indent or expand snippet imap CleverCr() " , : close popup and delete backword char. - inoremap neocomplete#smart_close_popup()."\" - inoremap neocomplete#smart_close_popup() + inoremap deoplete#smart_close_popup()."\" + inoremap deoplete#smart_close_popup() endif " : completion. inoremap pumvisible() ? "\" : "\" @@ -854,7 +859,7 @@ if neosnippet#expandable_or_jumpable() return "\(neosnippet_expand_or_jump)" else - return neocomplete#start_manual_complete() + return deoplete#start_manual_complete() endif endif endfunction @@ -863,14 +868,14 @@ " } " Enable heavy omni completion. - if !exists('g:neocomplete#sources#omni#input_patterns') - let g:neocomplete#sources#omni#input_patterns = {} + if !exists('g:deoplete#sources#omni#input_patterns') + let g:deoplete#sources#omni#input_patterns = {} endif - let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::' - let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::' - let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)' - let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' - let g:neocomplete#sources#omni#input_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::' + let g:deoplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::' + let g:deoplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::' + let g:deoplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)' + let g:deoplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' + let g:deoplete#sources#omni#input_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::' " } " neocomplcache { elseif count(g:spf13_bundle_groups, 'neocomplcache') @@ -990,7 +995,7 @@ " Snippets { if count(g:spf13_bundle_groups, 'neocomplcache') || - \ count(g:spf13_bundle_groups, 'neocomplete') + \ count(g:spf13_bundle_groups, 'deoplete') " Use honza's snippets. let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets' diff --git a/.vimrc.before b/.vimrc.before index 80785c449..6ae94a6b4 100644 --- a/.vimrc.before +++ b/.vimrc.before @@ -95,7 +95,7 @@ " Mappings for editing/applying spf13 config " let g:spf13_edit_config_mapping='ev' " let g:spf13_apply_config_mapping='sv' - + " } " Use fork before if available { diff --git a/.vimrc.bundles b/.vimrc.bundles index 6993b3d1f..6e20ba822 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -60,9 +60,13 @@ call plug#begin('~/.vim/bundle') " Deps { Plug 'MarcWeber/vim-addon-mw-utils' Plug 'tomtom/tlib_vim' - if executable('ag') + if executable('ag') || executable('rg') Plug 'mileszs/ack.vim' - let g:ackprg = 'ag --nogroup --nocolor --column --smart-case' + if executable('ag') + let g:ackprg = 'ag --nogroup --nocolor --column --smart-case' + elseif executable('rg') + let g:ackprg = 'rg --vimgrep --no-heading' + endif elseif executable('ack-grep') let g:ackprg="ack-grep -H --nocolor --nogroup --column" Plug 'mileszs/ack.vim' @@ -74,7 +78,7 @@ call plug#begin('~/.vim/bundle') " In your .vimrc.before.local file " list only the plugin groups you will use if !exists('g:spf13_bundle_groups') - let g:spf13_bundle_groups=['general', 'writing', 'neocomplete', 'programming', 'php', 'ruby', 'python', 'javascript', 'html', 'misc', 'rust',] + let g:spf13_bundle_groups=['general', 'writing', 'deoplete', 'programming', 'php', 'ruby', 'python', 'javascript', 'html', 'misc', 'rust', 'markdown'] endif " To override all the included bundles, add the following to your @@ -137,7 +141,7 @@ call plug#begin('~/.vim/bundle') " General Programming { if count(g:spf13_bundle_groups, 'programming') " Pick one of the checksyntax, jslint, or syntastic - Plug 'scrooloose/syntastic' + Plug 'w0rp/ALE' Plug 'tpope/vim-fugitive' Plug 'mattn/webapi-vim' Plug 'mattn/gist-vim' @@ -168,8 +172,11 @@ call plug#begin('~/.vim/bundle') Plug 'Shougo/neosnippet' Plug 'Shougo/neosnippet-snippets' Plug 'honza/vim-snippets' - elseif count(g:spf13_bundle_groups, 'neocomplete') - Plug 'Shougo/neocomplete.vim' + elseif count(g:spf13_bundle_groups, 'deoplete') && has('python3') == 1 + " See https://github.com/Shougo/deoplete.nvim + Plug 'Shougo/deoplete.nvim' + Plug 'roxma/nvim-yarp' + Plug 'roxma/vim-hug-neovim-rpc' Plug 'Shougo/neosnippet' Plug 'Shougo/neosnippet-snippets' Plug 'honza/vim-snippets' diff --git a/bootstrap.sh b/bootstrap.sh index ba7b3768b..1cc01976a 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -202,5 +202,6 @@ sync_repo "$HOME/.vim/autoload" \ setup_vim_plug "$APP_PATH/.vimrc.bundles.default" +msg "\nPlease run pip3 install --upgrade neovim to enjoy deoplete - asynchronous keyword completion system" msg "\nThanks for installing $app_name." msg "© `date +%Y` http://vim.spf13.com/" From 7fc6fce1e1737b6d8fa31ca0d23f263aa593eacb Mon Sep 17 00:00:00 2001 From: David <2252313+compleatguru@users.noreply.github.com> Date: Thu, 5 Mar 2020 10:37:29 +0800 Subject: [PATCH 13/14] Fix Windows Installation --- .vimrc.bundles | 3 +++ spf13-vim-windows-install.cmd | 26 ++++++++++++++------------ spf13-vim-windows-xp-install.cmd | 4 ++-- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index 6e20ba822..abd974ae2 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -54,6 +54,9 @@ " } +" Initialize Vim-Plug +source ~/.vim/bundle/vim-plug/plug.vim + call plug#begin('~/.vim/bundle') " Bundles { diff --git a/spf13-vim-windows-install.cmd b/spf13-vim-windows-install.cmd index 2d6b8e274..ad25171b4 100644 --- a/spf13-vim-windows-install.cmd +++ b/spf13-vim-windows-install.cmd @@ -1,3 +1,4 @@ +@echo off REM Copyright 2014 Steve Francia REM REM Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +19,7 @@ REM limitations under the License. @set APP_PATH=%HOME%\.spf13-vim-3 IF NOT EXIST "%APP_PATH%" ( - call git clone -b 3.0 https://github.com/spf13/spf13-vim.git "%APP_PATH%" + call git clone -b feature/vim-plug https://github.com/compleatguru/spf13-vim.git "%APP_PATH%" ) ELSE ( @set ORIGINAL_DIR=%CD% echo updating spf13-vim @@ -28,25 +29,26 @@ IF NOT EXIST "%APP_PATH%" ( call cd "%APP_PATH%" ) -call mklink "%HOME%\.vimrc" "%APP_PATH%\.vimrc" -call mklink "%HOME%\_vimrc" "%APP_PATH%\.vimrc" -call mklink "%HOME%\.vimrc.fork" "%APP_PATH%\.vimrc.fork" -call mklink "%HOME%\.vimrc.bundles" "%APP_PATH%\.vimrc.bundles" -call mklink "%HOME%\.vimrc.bundles.fork" "%APP_PATH%\.vimrc.bundles.fork" -call mklink "%HOME%\.vimrc.before" "%APP_PATH%\.vimrc.before" -call mklink "%HOME%\.vimrc.before.fork" "%APP_PATH%\.vimrc.before.fork" +cp "%APP_PATH%\.vimrc" "%HOME%\.vimrc" +cp "%APP_PATH%\.vimrc" "%HOME%\_vimrc" +cp "%APP_PATH%\.vimrc.fork" "%HOME%\.vimrc.fork" +cp "%APP_PATH%\.vimrc.bundles" "%HOME%\.vimrc.bundles" +cp "%APP_PATH%\.vimrc.bundles.fork" "%HOME%\.vimrc.bundles.fork" +cp "%APP_PATH%\.vimrc.before" "%HOME%\.vimrc.before" +cp "%APP_PATH%\.vimrc.before.fork" "%HOME%\.vimrc.before.fork" call mklink /J "%HOME%\.vim" "%APP_PATH%\.vim" IF NOT EXIST "%APP_PATH%\.vim\bundle" ( call mkdir "%APP_PATH%\.vim\bundle" ) -IF NOT EXIST "%HOME%/.vim/bundle/vundle" ( - call git clone https://github.com/gmarik/vundle.git "%HOME%/.vim/bundle/vundle" +IF NOT EXIST "%HOME%/.vim/bundle/vim-plug" ( + call git clone https://github.com/junegunn/vim-plug.git "%HOME%/.vim/bundle/vim-plug" ) ELSE ( - call cd "%HOME%/.vim/bundle/vundle" + REM Update Vim-Plug + call cd "%HOME%/.vim/bundle/vim-plug" call git pull call cd %HOME% ) -call vim -u "%APP_PATH%/.vimrc.bundles" +BundleInstall! +BundleClean +qall +call vim -u "%APP_PATH%/.vimrc.bundles" +PlugInstall! +PlugClean +qall diff --git a/spf13-vim-windows-xp-install.cmd b/spf13-vim-windows-xp-install.cmd index 6b7a3b5cc..8517446de 100644 --- a/spf13-vim-windows-xp-install.cmd +++ b/spf13-vim-windows-xp-install.cmd @@ -46,5 +46,5 @@ call copy "%APP_PATH%\.vimrc.bundles.fork" "%HOME%\.vimrc.bundles.fork" call copy "%APP_PATH%\.vimrc.before" "%HOME%\.vimrc.before" call copy "%APP_PATH%\.vimrc.before.fork" "%HOME%\.vimrc.before.fork" -@if not exist "%HOME%/.vim/bundle/vundle" call git clone https://github.com/gmarik/vundle.git "%HOME%/.vim/bundle/vundle" -call vim -u "%APP_PATH%/.vimrc.bundles" - +BundleInstall! +BundleClean +qall +@if not exist "%HOME%/.vim/bundle/vim-plug" call git clone https://github.com/junegunn/vim-plug.git "%HOME%/.vim/bundle/vim-plug" +call vim -u "%APP_PATH%/.vimrc.bundles" - +PlugInstall! +PlugClean +qall From 22e4d3ab1da86e4be020eaee4cc3a187c132dcdf Mon Sep 17 00:00:00 2001 From: tradesage <56466768+tradesage@users.noreply.github.com> Date: Thu, 6 Aug 2020 20:28:17 +0800 Subject: [PATCH 14/14] chore: update vimplug path --- .vimrc.bundles | 2 +- bootstrap.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index abd974ae2..400d2e1e3 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -55,7 +55,7 @@ " } " Initialize Vim-Plug -source ~/.vim/bundle/vim-plug/plug.vim +source ~/.vim/autoload/vim-plug/plug.vim call plug#begin('~/.vim/bundle') " Bundles { diff --git a/bootstrap.sh b/bootstrap.sh index 1cc01976a..f3b336c93 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -195,7 +195,7 @@ setup_fork_mode "$fork_maintainer" \ "$APP_PATH" \ "$HOME" -sync_repo "$HOME/.vim/autoload" \ +sync_repo "$HOME/.vim/autoload/vim-plug" \ "$VIM_PLUG_URI" \ "master" \ "vim-plug"