From 9bbc339cadb82b3f054cb9e4c0916867acfe09d5 Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 14:16:22 +0200 Subject: [PATCH 01/16] Change from Vundle to Vim-Plug --- .vimrc | 34 +++---- .vimrc.bundles | 236 +++++++++++++++++++++++-------------------------- bootstrap.sh | 26 +++--- 3 files changed, 141 insertions(+), 155 deletions(-) diff --git a/.vimrc b/.vimrc index 8ee23227e..8fa8957da 100644 --- a/.vimrc +++ b/.vimrc @@ -177,7 +177,7 @@ " Vim UI { - if !exists('g:override_spf13_bundles') && filereadable(expand("~/.vim/bundle/vim-colors-solarized/colors/solarized.vim")) + if !exists('g:override_spf13_bundles') && filereadable(expand("~/.vim/plugged/vim-colors-solarized/colors/solarized.vim")) let g:solarized_termcolors=256 let g:solarized_termtrans=1 let g:solarized_contrast="normal" @@ -504,17 +504,17 @@ " } " PIV { - if isdirectory(expand("~/.vim/bundle/PIV")) + if isdirectory(expand("~/.vim/plugged/PIV")) let g:DisableAutoPHPFolding = 0 let g:PIVAutoClose = 0 endif " } " Misc { - if isdirectory(expand("~/.vim/bundle/nerdtree")) + if isdirectory(expand("~/.vim/plugged/nerdtree")) let g:NERDShutUp=1 endif - if isdirectory(expand("~/.vim/bundle/matchit.zip")) + if isdirectory(expand("~/.vim/plugged/matchit.zip")) let b:match_ignorecase = 1 endif " } @@ -573,7 +573,7 @@ " } " NerdTree { - if isdirectory(expand("~/.vim/bundle/nerdtree")) + if isdirectory(expand("~/.vim/plugged/nerdtree")) map NERDTreeTabsToggle map e :NERDTreeFind nmap nt :NERDTreeFind @@ -590,7 +590,7 @@ " } " Tabularize { - if isdirectory(expand("~/.vim/bundle/tabular")) + if isdirectory(expand("~/.vim/plugged/tabular")) nmap a& :Tabularize /& vmap a& :Tabularize /& nmap a= :Tabularize /^[^=]*\zs= @@ -612,7 +612,7 @@ " Session List { set sessionoptions=blank,buffers,curdir,folds,tabpages,winsize - if isdirectory(expand("~/.vim/bundle/sessionman.vim/")) + if isdirectory(expand("~/.vim/plugged/sessionman.vim/")) nmap sl :SessionList nmap ss :SessionSave nmap sc :SessionClose @@ -630,7 +630,7 @@ let g:pymode = 0 endif - if isdirectory(expand("~/.vim/bundle/python-mode")) + if isdirectory(expand("~/.vim/plugged/python-mode")) let g:pymode_lint_checkers = ['pyflakes'] let g:pymode_trim_whitespaces = 0 let g:pymode_options = 0 @@ -639,7 +639,7 @@ " } " ctrlp { - if isdirectory(expand("~/.vim/bundle/ctrlp.vim/")) + if isdirectory(expand("~/.vim/plugged/ctrlp.vim/")) let g:ctrlp_working_path_mode = 'ra' nnoremap :CtrlP nnoremap :CtrlPMRU @@ -670,7 +670,7 @@ \ 'fallback': s:ctrlp_fallback \ } - if isdirectory(expand("~/.vim/bundle/ctrlp-funky/")) + if isdirectory(expand("~/.vim/plugged/ctrlp-funky/")) " CtrlP extensions let g:ctrlp_extensions = ['funky'] @@ -681,19 +681,19 @@ "} " TagBar { - if isdirectory(expand("~/.vim/bundle/tagbar/")) + if isdirectory(expand("~/.vim/plugged/tagbar/")) nnoremap tt :TagbarToggle endif "} " Rainbow { - if isdirectory(expand("~/.vim/bundle/rainbow/")) + if isdirectory(expand("~/.vim/plugged/rainbow/")) let g:rainbow_active = 1 "0 if you want to enable it later via :RainbowToggle endif "} " Fugitive { - if isdirectory(expand("~/.vim/bundle/vim-fugitive/")) + if isdirectory(expand("~/.vim/plugged/vim-fugitive/")) nnoremap gs :Gstatus nnoremap gd :Gdiff nnoremap gc :Gcommit @@ -986,7 +986,7 @@ \ count(g:spf13_bundle_groups, 'neocomplete') " Use honza's snippets. - let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets' + let g:neosnippet#snippets_directory='~/.vim/plugged/vim-snippets/snippets' " Enable neosnippet snipmate compatibility mode let g:neosnippet#enable_snipmate_compatibility = 1 @@ -1017,7 +1017,7 @@ endif " UndoTree { - if isdirectory(expand("~/.vim/bundle/undotree/")) + if isdirectory(expand("~/.vim/plugged/undotree/")) nnoremap u :UndotreeToggle " If undotree is opened, it is likely one wants to interact with it. let g:undotree_SetFocusWhenToggle=1 @@ -1025,7 +1025,7 @@ " } " indent_guides { - if isdirectory(expand("~/.vim/bundle/vim-indent-guides/")) + if isdirectory(expand("~/.vim/plugged/vim-indent-guides/")) let g:indent_guides_start_level = 2 let g:indent_guides_guide_size = 1 let g:indent_guides_enable_on_vim_startup = 1 @@ -1050,7 +1050,7 @@ " See `:echo g:airline_theme_map` for some more choices " Default in terminal vim is 'dark' - if isdirectory(expand("~/.vim/bundle/vim-airline-themes/")) + if isdirectory(expand("~/.vim/plugged/vim-airline-themes/")) if !exists('g:airline_theme') let g:airline_theme = 'solarized' endif diff --git a/.vimrc.bundles b/.vimrc.bundles index 997ae9623..a9ec54850 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -52,39 +52,23 @@ 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/plugged') " Bundles { " Deps { - Bundle 'gmarik/vundle' - Bundle 'MarcWeber/vim-addon-mw-utils' - Bundle 'tomtom/tlib_vim' + Plug 'gmarik/vundle' + 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 +85,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 + if filereadable(expand("~/.vim/plugged/vim-snippets/snippets/support_functions.vim")) + source ~/.vim/plugged/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 +247,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 +293,5 @@ source ~/.vimrc.bundles.local endif " } + +call plug#end() \ No newline at end of file diff --git a/bootstrap.sh b/bootstrap.sh index 680e3c7fa..2a273daf7 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -15,13 +15,13 @@ # limitations under the License. ############################ 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' +app_name='vimConfig' +[ -z "$APP_PATH" ] && APP_PATH="$(pwd)" +[ -z "$REPO_URI" ] && REPO_URI='https://github.com/abdalrohman/vimConfig.git' +[ -z "$REPO_BRANCH" ] && REPO_BRANCH='vimConfig' debug_mode='0' fork_maintainer='0' -[ -z "$VUNDLE_URI" ] && VUNDLE_URI="https://github.com/gmarik/vundle.git" +[ -z "$PLUG_URI" ] && PLUG_URI="https://github.com/junegunn/vim-plug.git" ############################ BASIC SETUP TOOLS msg() { @@ -157,20 +157,20 @@ setup_fork_mode() { fi } -setup_vundle() { +setup_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 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" \ + "$PLUG_URI" \ "master" \ - "vundle" + "plug" -setup_vundle "$APP_PATH/.vimrc.bundles.default" +setup_plug "$APP_PATH/.vimrc.bundles.default" msg "\nThanks for installing $app_name." msg "© `date +%Y` http://vim.spf13.com/" From 84b981c75723fbb463a05411e6db0e7f6cfc4374 Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 14:20:02 +0200 Subject: [PATCH 02/16] Fix remove .vim folder --- bootstrap.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 2a273daf7..1d5a21acc 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -179,8 +179,7 @@ variable_set "$HOME" program_must_exist "vim" program_must_exist "git" -do_backup "$HOME/.vim" \ - "$HOME/.vimrc" \ +do_backup "$HOME/.vimrc" \ "$HOME/.gvimrc" sync_repo "$APP_PATH" \ From b9ee7ee1d2a98ad0b169361027174aba2266015b Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 14:42:20 +0200 Subject: [PATCH 03/16] improve uninstall.sh --- uninstall.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/uninstall.sh b/uninstall.sh index 5fd9a6d8a..4a9d01357 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,7 +1,5 @@ #!/usr/bin/env sh -app_dir="$HOME/.spf13-vim-3" - warn() { echo "$1" >&2 } @@ -13,6 +11,15 @@ die() { rm $HOME/.vimrc rm $HOME/.vimrc.bundles -rm $HOME/.vim -rm -rf $app_dir +rm $HOME/.vimrc.before + +# Remove fork folder +rm $HOME/.vimrc.before.fork +rm $HOME/.vimrc.bundles.fork +rm $HOME/.vimrc.fork + +rm -rf $HOME/.vimbackup +rm -rf $HOME/.vimswap +rm -rf $HOME/.vimundo +rm -rf $HOME/.vimviews From d02249114c84e3a3aa7e19de59dfce10262bf6ff Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 14:44:26 +0200 Subject: [PATCH 04/16] =?UTF-8?q?emove=20.git=20to=20avoid=20prompt=20'cou?= =?UTF-8?q?ld=20not=20read=20Username=20from=20'https://gi=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vimrc.bundles | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index a9ec54850..a54feaa17 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -116,7 +116,7 @@ call plug#begin('~/.vim/plugged') 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' @@ -168,7 +168,7 @@ call plug#begin('~/.vim/plugged') 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 387e711447885abfd0adb9593a9b267015af69fb Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 14:45:53 +0200 Subject: [PATCH 05/16] Fix missing amirh/HTML-AutoCloseTag --- .vimrc.bundles | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index a54feaa17..905b1cdf1 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -228,7 +228,7 @@ call plug#begin('~/.vim/plugged') " 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 c5136a5694b17693451620a7a0f5bf0f03bdacdd Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 14:47:37 +0200 Subject: [PATCH 06/16] fix error on implicit vim-scripts expansion is deprecated --- .vimrc.bundles | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index 905b1cdf1..25801563a 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -96,7 +96,7 @@ call plug#begin('~/.vim/plugged') 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') @@ -188,8 +188,8 @@ call plug#begin('~/.vim/plugged') " 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 " } From 3894437ae42fedb53654ace97dc96c6009532d51 Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 15:02:48 +0200 Subject: [PATCH 07/16] Replace syntastic with ALE, neocomplete with deoplete --- .vimrc | 244 ++++++++++++++----------------------------------- .vimrc.bundles | 27 +++--- bootstrap.sh | 1 + 3 files changed, 84 insertions(+), 188 deletions(-) diff --git a/.vimrc b/.vimrc index 8fa8957da..b05713967 100644 --- a/.vimrc +++ b/.vimrc @@ -709,71 +709,21 @@ endif "} - " YouCompleteMe { - if count(g:spf13_bundle_groups, 'youcompleteme') - let g:acp_enableAtStartup = 0 - - " enable completion from tags - let g:ycm_collect_identifiers_from_tags_files = 1 - - " remap Ultisnips for compatibility for YCM - let g:UltiSnipsExpandTrigger = '' - let g:UltiSnipsJumpForwardTrigger = '' - let g:UltiSnipsJumpBackwardTrigger = '' - - " Enable omni completion. - autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS - autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags - autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS - autocmd FileType python setlocal omnifunc=pythoncomplete#Complete - autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags - autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete - autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc - - " Haskell post write lint and check with ghcmod - " $ `cabal install ghcmod` if missing and ensure - " ~/.cabal/bin is in your $PATH. - if !executable("ghcmod") - autocmd BufWritePost *.hs GhcModCheckAndLintAsync - endif - - " For snippet_complete marker. - if !exists("g:spf13_no_conceal") - if has('conceal') - set conceallevel=2 concealcursor=i - endif - endif - - " Disable the neosnippet preview candidate window - " When enabled, there can be too much visual noise - " especially when splits are used. - set completeopt-=preview - endif + " NerdCommenter { + " Add space when comment + let NERDSpaceDelims=1 " } - " neocomplete { - if count(g:spf13_bundle_groups, 'neocomplete') + " deoplete { + if count(g:spf13_bundle_groups, 'deoplete') + let g:deoplete#enable_at_startup = 1 + let g:python_host_prog = '/usr/bin/python' + let g:python3_host_prog = '/usr/bin/python' 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 - - - " Define dictionary. - let g:neocomplete#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 = {} - endif - let g:neocomplete#keyword_patterns['default'] = '\h\w*' + let g:deoplete#enable_auto_delimiter = 1 + let g:deoplete#force_overwrite_completefunc = 1 + " Plugin key-mappings { " These two lines conflict with the default digraph mapping of if !exists('g:spf13_no_neosnippet_expand') @@ -800,21 +750,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 "\" @@ -824,8 +774,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() ? "\" : "\" @@ -847,7 +797,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 @@ -855,116 +805,64 @@ imap CleverTab() " } + call deoplete#custom#option('camel_case', v:true) + call deoplete#custom#option('auto_complete_delay', 0) + call deoplete#custom#option('smart_case', v:true) + call deoplete#custom#option('min_pattern_length', 1) + call deoplete#custom#source('_', 'max_menu_width', 80) + call deoplete#custom#option('sources', { + \ '_': ['ale'], + \}) " 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') - let g:acp_enableAtStartup = 0 - let g:neocomplcache_enable_at_startup = 1 - let g:neocomplcache_enable_camel_case_completion = 1 - let g:neocomplcache_enable_smart_case = 1 - let g:neocomplcache_enable_underbar_completion = 1 - let g:neocomplcache_enable_auto_delimiter = 1 - let g:neocomplcache_max_list = 15 - let g:neocomplcache_force_overwrite_completefunc = 1 - - " Define dictionary. - let g:neocomplcache_dictionary_filetype_lists = { - \ 'default' : '', - \ 'vimshell' : $HOME.'/.vimshell_hist', - \ 'scheme' : $HOME.'/.gosh_completions' - \ } - - " Define keyword. - if !exists('g:neocomplcache_keyword_patterns') - let g:neocomplcache_keyword_patterns = {} - endif - let g:neocomplcache_keyword_patterns._ = '\h\w*' - " Plugin key-mappings { - " These two lines conflict with the default digraph mapping of - imap (neosnippet_expand_or_jump) - smap (neosnippet_expand_or_jump) - if exists('g:spf13_noninvasive_completion') - inoremap - " takes you out of insert mode - inoremap pumvisible() ? "\\" : "\" - " accepts first, then sends the - inoremap pumvisible() ? "\\" : "\" - " and cycle like and - inoremap pumvisible() ? "\" : "\" - inoremap pumvisible() ? "\" : "\" - " Jump up and down the list - inoremap pumvisible() ? "\\\" : "\" - inoremap pumvisible() ? "\\\" : "\" - else - imap neosnippet#expandable() ? - \ "\(neosnippet_expand_or_jump)" : (pumvisible() ? - \ "\" : "\(neosnippet_expand_or_jump)") - smap (neosnippet_jump_or_expand) - - inoremap neocomplcache#undo_completion() - inoremap neocomplcache#complete_common_string() - "inoremap neocomplcache#complete_common_string() - - function! CleverCr() - if pumvisible() - if neosnippet#expandable() - let exp = "\(neosnippet_expand)" - return exp . neocomplcache#close_popup() - else - return neocomplcache#close_popup() - endif - else - return "\" - endif - endfunction - - " close popup and save indent or expand snippet - imap CleverCr() - - " : close popup - " : close popup and save indent. - inoremap pumvisible() ? neocomplcache#close_popup()."\" : "\" - "inoremap pumvisible() ? neocomplcache#close_popup() : "\" + " ALE { + let g:airline#extensions#ale#enabled = 1 + function! LinterStatus() abort + let l:counts = ale#statusline#Count(bufnr('')) - " , : close popup and delete backword char. - inoremap neocomplcache#smart_close_popup()."\" - inoremap neocomplcache#close_popup() - endif - " : completion. - inoremap pumvisible() ? "\" : "\" - inoremap pumvisible() ? "\" : "\" - " } + let l:all_errors = l:counts.error + l:counts.style_error + let l:all_non_errors = l:counts.total - l:all_errors - " Enable omni completion. - autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS - autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags - autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS - autocmd FileType python setlocal omnifunc=pythoncomplete#Complete - autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags - autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete - autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc + return l:counts.total == 0 ? 'OK' : printf( + \ '%dW %dE', + \ all_non_errors, + \ all_errors + \) + endfunction - " Enable heavy omni completion. - if !exists('g:neocomplcache_omni_patterns') - let g:neocomplcache_omni_patterns = {} - endif - let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::' - let g:neocomplcache_omni_patterns.perl = '\h\w*->\h\w*\|\h\w*::' - let g:neocomplcache_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)' - let g:neocomplcache_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' - let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::' - let g:neocomplcache_omni_patterns.go = '\h\w*\.\?' - " } + set statusline=%{LinterStatus()} + " let g:ale_open_list = 1 + let g:ale_list_window_size = 5 + + " let g:ale_lint_on_text_changed = 'never' + " let g:ale_lint_on_insert_leave = 0 + " " You can disable this option too + " " if you don't want linters to run on opening a file + " let g:ale_lint_on_enter = 0 + let g:ale_echo_msg_error_str = 'Error' + let g:ale_echo_msg_warning_str = 'Warning' + let g:ale_set_highlights = 0 + " highlight ALEErrorSign ctermbg=red + " highlight ALEWarningSign ctermbg=yellow + let g:ale_echo_msg_format = '[%linter%] %s [%severity%]' + let g:ale_sign_error = '💣' + let g:ale_sign_warning = '⚠' + " let g:ale_sign_error = '●' + " let g:ale_sign_warning = '.' + "nmap (ale_next_wrap) + nmap (ale_previous_wrap) + nmap (ale_next_wrap) + "} + " Normal Vim omni-completion { " To disable omni complete, add the following to your .vimrc.before.local file: " let g:spf13_no_omni_complete = 1 diff --git a/.vimrc.bundles b/.vimrc.bundles index 25801563a..66b2f51e7 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -61,9 +61,13 @@ call plug#begin('~/.vim/plugged') Plug 'gmarik/vundle' 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' @@ -75,7 +79,7 @@ call plug#begin('~/.vim/plugged') " 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', 'deoplete', 'programming', 'php', 'ruby', 'python', 'javascript', 'html', 'misc',] endif " To override all the included bundles, add the following to your @@ -136,7 +140,7 @@ call plug#begin('~/.vim/plugged') " 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' @@ -158,17 +162,10 @@ call plug#begin('~/.vim/plugged') if filereadable(expand("~/.vim/plugged/vim-snippets/snippets/support_functions.vim")) source ~/.vim/plugged/vim-snippets/snippets/support_functions.vim endif - elseif count(g:spf13_bundle_groups, 'youcompleteme') - Plug'Valloric/YouCompleteMe' - Plug 'SirVer/ultisnips' - Plug 'honza/vim-snippets' - elseif count(g:spf13_bundle_groups, 'neocomplcache') - Plug 'Shougo/neocomplcache' - 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 + 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 1d5a21acc..8650e1abc 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -202,4 +202,5 @@ sync_repo "$HOME/.vim/autoload" \ setup_plug "$APP_PATH/.vimrc.bundles.default" msg "\nThanks for installing $app_name." +msg "\nPlease run pip3 install --upgrade neovim to enjoy deoplete - asynchronous keyword completion system" msg "© `date +%Y` http://vim.spf13.com/" From b94f913056dc0975f8d11dbcbcff2f0c836ec49a Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 15:21:57 +0200 Subject: [PATCH 08/16] 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 b05713967..e61d56f1c 100644 --- a/.vimrc +++ b/.vimrc @@ -207,7 +207,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 b990f548091ede31f1e5ff05f4f5afc5f0eae087 Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 19:45:11 +0200 Subject: [PATCH 09/16] Plugin arrangement --- .vimrc.bundles | 18 +++++++++++------- bootstrap.sh | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index 66b2f51e7..56cb8e525 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -58,7 +58,6 @@ call plug#begin('~/.vim/plugged') " Bundles { " Deps { - Plug 'gmarik/vundle' Plug 'MarcWeber/vim-addon-mw-utils' Plug 'tomtom/tlib_vim' if executable('ag') || executable('rg') @@ -79,7 +78,7 @@ call plug#begin('~/.vim/plugged') " 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', 'deoplete', 'programming', 'php', 'ruby', 'python', 'javascript', 'html', 'misc',] + 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 @@ -134,6 +133,8 @@ call plug#begin('~/.vim/plugged') Plug 'reedes/vim-textobj-sentence' Plug 'reedes/vim-textobj-quote' Plug 'reedes/vim-wordy' + Plug 'tpope/vim-markdown' + Plug 'greyblake/vim-preview' endif " } @@ -236,6 +237,8 @@ call plug#begin('~/.vim/plugged') " 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 @@ -260,17 +263,18 @@ call plug#begin('~/.vim/plugged') Plug 'elixir-lang/vim-elixir' Plug 'carlosgaldino/elixir-snippets' Plug 'mattreduce/vim-mix' + 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 " } diff --git a/bootstrap.sh b/bootstrap.sh index 8650e1abc..374d79aa2 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -19,7 +19,7 @@ app_name='vimConfig' [ -z "$APP_PATH" ] && APP_PATH="$(pwd)" [ -z "$REPO_URI" ] && REPO_URI='https://github.com/abdalrohman/vimConfig.git' [ -z "$REPO_BRANCH" ] && REPO_BRANCH='vimConfig' -debug_mode='0' +debug_mode='1' fork_maintainer='0' [ -z "$PLUG_URI" ] && PLUG_URI="https://github.com/junegunn/vim-plug.git" From 1ea54c70b48c1346ad2082552c935c382ce17130 Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 20:22:25 +0200 Subject: [PATCH 10/16] Change colorschemes to space-vim-dark --- .vimrc | 51 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/.vimrc b/.vimrc index e61d56f1c..68f316e82 100644 --- a/.vimrc +++ b/.vimrc @@ -100,7 +100,7 @@ " endif filetype plugin indent on " Automatically detect file types. syntax on " Syntax highlighting - set mouse=a " Automatically enable mouse usage + set mouse+=a " Automatically enable mouse usage set mousehide " Hide the mouse cursor while typing scriptencoding utf-8 @@ -177,13 +177,9 @@ " Vim UI { - if !exists('g:override_spf13_bundles') && filereadable(expand("~/.vim/plugged/vim-colors-solarized/colors/solarized.vim")) - let g:solarized_termcolors=256 - let g:solarized_termtrans=1 - let g:solarized_contrast="normal" - let g:solarized_visibility="normal" - color solarized " Load a colorscheme - endif + color space-vim-dark + set termguicolors + hi LineNr ctermbg=NONE guibg=NONE set tabpagemax=15 " Only show 15 tabs set showmode " Display the current mode @@ -880,7 +876,7 @@ " } " Snippets { - if count(g:spf13_bundle_groups, 'neocomplcache') || + if count(g:spf13_bundle_groups, 'deoplete') || \ count(g:spf13_bundle_groups, 'neocomplete') " Use honza's snippets. @@ -949,13 +945,42 @@ " See `:echo g:airline_theme_map` for some more choices " Default in terminal vim is 'dark' if isdirectory(expand("~/.vim/plugged/vim-airline-themes/")) + let g:airline_powerline_fonts = 1 + let g:airline#extensions#hunks#enabled=0 + let g:airline#extensions#branch#enabled=1 + let g:airline#extensions#tabline#enabled = 1 + let g:airline#extensions#tabline#show_close_button = 0 if !exists('g:airline_theme') - let g:airline_theme = 'solarized' + let g:airline_theme = 'violet' endif if !exists('g:airline_powerline_fonts') - " Use the default set of separators with a few customizations - let g:airline_left_sep='›' " Slightly fancier than '>' - let g:airline_right_sep='‹' " Slightly fancier than '<' + if !exists('g:airline_symbols') + let g:airline_symbols = {} + endif + " unicode symbols + let g:airline_left_sep = '»' + let g:airline_left_sep = '▶' + let g:airline_right_sep = '«' + let g:airline_right_sep = '◀' + let g:airline_symbols.crypt = '🔒' + let g:airline_symbols.linenr = '␊' + let g:airline_symbols.linenr = '␤' + let g:airline_symbols.linenr = '¶' + let g:airline_symbols.maxlinenr = '☰' + let g:airline_symbols.maxlinenr = '' + let g:airline_symbols.branch = '⎇' + let g:airline_symbols.paste = 'ρ' + let g:airline_symbols.paste = 'Þ' + let g:airline_symbols.paste = '∥' + let g:airline_symbols.spell = 'Ꞩ' + let g:airline_symbols.notexists = '∄' + let g:airline_symbols.whitespace = 'Ξ' + " airline symbols + let g:airline_left_alt_sep = '' + let g:airline_right_alt_sep = '' + let g:airline_symbols.branch = '' + let g:airline_symbols.readonly = '' + let g:airline_symbols.linenr = '' endif endif " } From 9ca8ae9e90aeea0cb9993bd18e5ffe790ed143bd Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 20:26:17 +0200 Subject: [PATCH 11/16] Change snippets to deoplete --- .vimrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index 68f316e82..ebef5f328 100644 --- a/.vimrc +++ b/.vimrc @@ -876,8 +876,7 @@ " } " Snippets { - if count(g:spf13_bundle_groups, 'deoplete') || - \ count(g:spf13_bundle_groups, 'neocomplete') + if count(g:spf13_bundle_groups, 'deoplete') " Use honza's snippets. let g:neosnippet#snippets_directory='~/.vim/plugged/vim-snippets/snippets' From d712a13a877c7f9ced70b506913f0ef286630af3 Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 20:35:16 +0200 Subject: [PATCH 12/16] Add fzf plugin --- .vimrc | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++ .vimrc.bundles | 3 ++ 2 files changed, 78 insertions(+) diff --git a/.vimrc b/.vimrc index ebef5f328..69b7b1823 100644 --- a/.vimrc +++ b/.vimrc @@ -634,6 +634,81 @@ endif " } + " FZF { + if isdirectory(expand("~/.vim/bundle/fzf.vim")) + " This is the default extra key bindings + let g:fzf_action = { + \ 'ctrl-t': 'tab split', + \ 'ctrl-x': 'split', + \ 'ctrl-v': 'vsplit' } + + " Enable per-command history. + " CTRL-N and CTRL-P will be automatically bound to next-history and + " previous-history instead of down and up. If you don't like the change, + " explicitly bind the keys to down and up in your $FZF_DEFAULT_OPTS. + let g:fzf_history_dir = '~/.local/share/fzf-history' + + map :Files + map b :Buffers + nnoremap g :Rg + nnoremap t :Tags + nnoremap m :Marks + + + let g:fzf_tags_command = 'ctags -R' + " Border color + let g:fzf_layout = {'up':'~90%', 'window': { 'width': 0.8, 'height': 0.8,'yoffset':0.5,'xoffset': 0.5, 'highlight': 'Todo', 'border': 'sharp' } } + + let $FZF_DEFAULT_OPTS = '--layout=reverse --info=inline' + let $FZF_DEFAULT_COMMAND="rg --files --hidden" + + + " Customize fzf colors to match your color scheme + let g:fzf_colors = + \ { 'fg': ['fg', 'Normal'], + \ 'bg': ['bg', 'Normal'], + \ 'hl': ['fg', 'Comment'], + \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'], + \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'], + \ 'hl+': ['fg', 'Statement'], + \ 'info': ['fg', 'PreProc'], + \ 'border': ['fg', 'Ignore'], + \ 'prompt': ['fg', 'Conditional'], + \ 'pointer': ['fg', 'Exception'], + \ 'marker': ['fg', 'Keyword'], + \ 'spinner': ['fg', 'Label'], + \ 'header': ['fg', 'Comment'] } + + "Get Files + command! -bang -nargs=? -complete=dir Files + \ call fzf#vim#files(, fzf#vim#with_preview({'options': ['--layout=reverse', '--info=inline']}), 0) + + + " Get text in files with Rg + command! -bang -nargs=* Rg + \ call fzf#vim#grep( + \ 'rg --column --line-number --no-heading --color=always --smart-case '.shellescape(), 1, + \ fzf#vim#with_preview(), 0) + + " Ripgrep advanced + function! RipgrepFzf(query, fullscreen) + let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case %s || true' + let initial_command = printf(command_fmt, shellescape(a:query)) + let reload_command = printf(command_fmt, '{q}') + let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]} + call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), a:fullscreen) + endfunction + + command! -nargs=* -bang RG call RipgrepFzf(, 0) + + " Git grep + command! -bang -nargs=* GGrep + \ call fzf#vim#grep( + \ 'git grep --line-number '.shellescape(), 0, + \ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), 0) + endif + "} + " ctrlp { if isdirectory(expand("~/.vim/plugged/ctrlp.vim/")) let g:ctrlp_working_path_mode = 'ra' diff --git a/.vimrc.bundles b/.vimrc.bundles index 56cb8e525..e6ba5737c 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -97,6 +97,9 @@ call plug#begin('~/.vim/plugged') Plug 'jiangmiao/auto-pairs' Plug 'ctrlpvim/ctrlp.vim' Plug 'tacahiroy/ctrlp-funky' + Plug 'junegunn/fzf',{ 'dir': '~/.fzf', 'do': './install --all' } + Plug 'junegunn/fzf.vim' + Plug 'airblade/vim-rooter' Plug 'terryma/vim-multiple-cursors' Plug 'vim-scripts/sessionman.vim' Plug 'vim-scripts/matchit.zip' From 385acdd323da28be3bf47d1a5c94d118691d23bd Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 20:42:03 +0200 Subject: [PATCH 13/16] Add space-vim-dark theme plugin --- .vimrc.bundles | 1 + 1 file changed, 1 insertion(+) diff --git a/.vimrc.bundles b/.vimrc.bundles index e6ba5737c..895b3eae4 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -89,6 +89,7 @@ call plug#begin('~/.vim/plugged') " General { if count(g:spf13_bundle_groups, 'general') Plug 'scrooloose/nerdtree' + Plug 'liuchengxu/space-vim-dark' Plug 'altercation/vim-colors-solarized' Plug 'spf13/vim-colors' Plug 'tpope/vim-surround' From 3c9f59231ebd6c4847bb85837b5d1c71ae69846a Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 21:24:17 +0200 Subject: [PATCH 14/16] Fix fzf location --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 69b7b1823..8fcf9e0e0 100644 --- a/.vimrc +++ b/.vimrc @@ -635,7 +635,7 @@ " } " FZF { - if isdirectory(expand("~/.vim/bundle/fzf.vim")) + if isdirectory(expand("~/.vim/plugged/fzf.vim")) " This is the default extra key bindings let g:fzf_action = { \ 'ctrl-t': 'tab split', From 6778820749deefc3fd9c09428449487c3b1bd2f8 Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Sat, 5 Sep 2020 21:27:54 +0200 Subject: [PATCH 15/16] Make NERDTree plugin awesome --- .vimrc.bundles | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.vimrc.bundles b/.vimrc.bundles index 895b3eae4..2ff589a81 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -89,6 +89,8 @@ call plug#begin('~/.vim/plugged') " General { if count(g:spf13_bundle_groups, 'general') Plug 'scrooloose/nerdtree' + Plug 'ryanoasis/vim-devicons' + Plug 'tiagofumo/vim-nerdtree-syntax-highlight' Plug 'liuchengxu/space-vim-dark' Plug 'altercation/vim-colors-solarized' Plug 'spf13/vim-colors' From 10d486aed5bba70adb34c8cbbf5a550900459019 Mon Sep 17 00:00:00 2001 From: abdalrohman Date: Mon, 7 Sep 2020 15:04:35 +0200 Subject: [PATCH 16/16] Rename bootstrap.sh to install.sh, improve install and uninstall app --- bootstrap.sh => install.sh | 2 +- uninstall.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) rename bootstrap.sh => install.sh (99%) mode change 100755 => 100644 diff --git a/bootstrap.sh b/install.sh old mode 100755 new mode 100644 similarity index 99% rename from bootstrap.sh rename to install.sh index 374d79aa2..9d2e0f382 --- a/bootstrap.sh +++ b/install.sh @@ -16,7 +16,7 @@ ############################ SETUP PARAMETERS app_name='vimConfig' -[ -z "$APP_PATH" ] && APP_PATH="$(pwd)" +[ -z "$APP_PATH" ] && APP_PATH="$HOME/.vimConfig" [ -z "$REPO_URI" ] && REPO_URI='https://github.com/abdalrohman/vimConfig.git' [ -z "$REPO_BRANCH" ] && REPO_BRANCH='vimConfig' debug_mode='1' diff --git a/uninstall.sh b/uninstall.sh index 4a9d01357..74eb00056 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -23,3 +23,4 @@ rm -rf $HOME/.vimbackup rm -rf $HOME/.vimswap rm -rf $HOME/.vimundo rm -rf $HOME/.vimviews +rm -rf $HOME/.vim/autoload