From cfc1235e081ffe75f143f0f345bbb34b3c396701 Mon Sep 17 00:00:00 2001 From: Nanda Lopes Date: Sun, 4 Jul 2021 21:29:55 -0300 Subject: [PATCH 1/6] VimPlug migration Rename Vundle module to VimPlug --- Rakefile | 20 ++++++------- bin/yadr/vimplug.rb | 50 +++++++++++++++++++++++++++++++++ bin/yadr/vundle.rb | 50 --------------------------------- bin/yadr/yadr-vim-add-plugin | 8 +++--- bin/yadr/yadr-vim-delete-plugin | 6 ++-- bin/yadr/yadr-vim-list-plugin | 6 ++-- 6 files changed, 70 insertions(+), 70 deletions(-) create mode 100644 bin/yadr/vimplug.rb delete mode 100644 bin/yadr/vundle.rb diff --git a/Rakefile b/Rakefile index f23a90509e..f9d7a3acc2 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,6 @@ require 'rake' require 'fileutils' -require File.join(File.dirname(__FILE__), 'bin', 'yadr', 'vundle') +require File.join(File.dirname(__FILE__), 'bin', 'yadr', 'vimplug') desc "Hook our dotfiles into system-standard positions." task :install => [:submodule_init, :submodules] do @@ -22,7 +22,7 @@ task :install => [:submodule_init, :submodules] do install_files(Dir.glob('vimify/*')) if want_to_install?('vimification of command line tools') if want_to_install?('vim configuration (highly recommended)') install_files(Dir.glob('{vim,vimrc}')) - Rake::Task["install_vundle"].execute + Rake::Task["install_plugins"].execute end Rake::Task["install_prezto"].execute @@ -91,24 +91,24 @@ task :vundle_migration do FileUtils.mv(File.join('vim','bundle'), File.join('vim', 'bundle.old')) end -desc "Runs Vundle installer in a clean vim environment" -task :install_vundle do +desc "Runs Vim-Plug installer in a clean vim environment" +task :install_plugins do puts "======================================================" - puts "Installing and updating vundles." - puts "The installer will now proceed to run PluginInstall to install vundles." + puts "Installing and updating bundles." + puts "The installer will now proceed to run PlugInstall to install bundles." puts "======================================================" puts "" - vundle_path = File.join('vim','bundle', 'vundle') - unless File.exists?(vundle_path) + plug_path = File.join('vim','autoload', 'plug.vim') + unless File.exists?(plug_path) run %{ cd $HOME/.yadr - git clone https://github.com/gmarik/vundle.git #{vundle_path} + curl -fLo #{plug_path} --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim } end - Vundle::update_vundle + VimPlug::update_bundles end task :default => 'install' diff --git a/bin/yadr/vimplug.rb b/bin/yadr/vimplug.rb new file mode 100644 index 0000000000..f0aa89d7c8 --- /dev/null +++ b/bin/yadr/vimplug.rb @@ -0,0 +1,50 @@ +require 'fileutils' + +module VimPlug + @bundles_path = File.expand_path File.join(ENV['HOME'], '.vim', '.local.bundles') + def self.add_plugin_to_bundles(plugin_repo) + return if contains_bundle? plugin_repo + + bundles = bundles_from_file + last_bundle_dir = bundles.rindex{ |line| line =~ /^Plug / } + last_bundle_dir = last_bundle_dir ? last_bundle_dir+1 : 0 + bundles.insert last_bundle_dir, "Plug '#{plugin_repo}'" + write_bundles_to_file bundles + end + + def self.remove_plugin_from_bundles(plugin_repo) + bundles = bundles_from_file + deleted_value = bundles.reject!{ |line| line =~ /Plug '#{plugin_repo}'/ } + + write_bundles_to_file bundles + + !deleted_value.nil? + end + + def self.bundle_list + bundles_from_file.select{ |line| line =~ /^Plug .*/ }.map{ |line| line.gsub(/Plug "(.*)"/, '\1')} + end + + def self.update_bundles + system "vim --noplugin -u #{ENV['HOME']}/.vim/plugins.d/main.vim -N \"+set hidden\" \"+syntax on\" \"+let g:session_autosave = 'no'\" +PlugClean +PlugInstall! +qall" + end + + + private + def self.contains_bundle?(bundle_name) + FileUtils.touch(@bundles_path) unless File.exists? @bundles_path + File.read(@bundles_path).include?(bundle_name) + end + + def self.bundles_from_file + FileUtils.touch(@bundles_path) unless File.exists? @bundles_path + File.read(@bundles_path).split("\n") + end + + def self.write_bundles_to_file(bundles) + FileUtils.cp(@bundles_path, "#{@bundles_path}.bak") + bundle_file = File.open(@bundles_path, "w") + bundle_file.write(bundles.join("\n")) + bundle_file.close + end +end diff --git a/bin/yadr/vundle.rb b/bin/yadr/vundle.rb deleted file mode 100644 index 45e31c9eda..0000000000 --- a/bin/yadr/vundle.rb +++ /dev/null @@ -1,50 +0,0 @@ -require 'fileutils' - -module Vundle - @vundles_path = File.expand_path File.join(ENV['HOME'], '.vim', '.vundles.local') - def self.add_plugin_to_vundle(plugin_repo) - return if contains_vundle? plugin_repo - - vundles = vundles_from_file - last_bundle_dir = vundles.rindex{ |line| line =~ /^Bundle / } - last_bundle_dir = last_bundle_dir ? last_bundle_dir+1 : 0 - vundles.insert last_bundle_dir, "Bundle \"#{plugin_repo}\"" - write_vundles_to_file vundles - end - - def self.remove_plugin_from_vundle(plugin_repo) - vundles = vundles_from_file - deleted_value = vundles.reject!{ |line| line =~ /Bundle "#{plugin_repo}"/ } - - write_vundles_to_file vundles - - !deleted_value.nil? - end - - def self.vundle_list - vundles_from_file.select{ |line| line =~ /^Bundle .*/ }.map{ |line| line.gsub(/Bundle "(.*)"/, '\1')} - end - - def self.update_vundle - system "vim --noplugin -u #{ENV['HOME']}/.vim/vundles.vim -N \"+set hidden\" \"+syntax on\" \"+let g:session_autosave = 'no'\" +BundleClean +BundleInstall! +qall" - end - - - private - def self.contains_vundle?(vundle_name) - FileUtils.touch(@vundles_path) unless File.exists? @vundles_path - File.read(@vundles_path).include?(vundle_name) - end - - def self.vundles_from_file - FileUtils.touch(@vundles_path) unless File.exists? @vundles_path - File.read(@vundles_path).split("\n") - end - - def self.write_vundles_to_file(vundles) - FileUtils.cp(@vundles_path, "#{@vundles_path}.bak") - vundle_file = File.open(@vundles_path, "w") - vundle_file.write(vundles.join("\n")) - vundle_file.close - end -end diff --git a/bin/yadr/yadr-vim-add-plugin b/bin/yadr/yadr-vim-add-plugin index 3a7c50b498..2e6d2567ac 100755 --- a/bin/yadr/yadr-vim-add-plugin +++ b/bin/yadr/yadr-vim-add-plugin @@ -1,7 +1,7 @@ #!/usr/bin/env ruby -# +# require File.join(File.dirname(__FILE__), 'default_libs') -require File.join(File.dirname(__FILE__), 'vundle') +require File.join(File.dirname(__FILE__), 'vimplug') GitStyleBinary.command do version "yadr-add-vim-plugin 1.0" @@ -22,7 +22,7 @@ GitStyleBinary.command do repo=command.opts[:url] puts "Adding \"#{repo}\" to the plugin list" bundle_path=repo.gsub(/http.?:\/\/github\.com\//, "") - Vundle::add_plugin_to_vundle repo - Vundle::update_vundle + VimPlug::add_plugin_to_bundles repo + VimPlug::update_bundles end end diff --git a/bin/yadr/yadr-vim-delete-plugin b/bin/yadr/yadr-vim-delete-plugin index 81237e0b2f..276ebb0254 100755 --- a/bin/yadr/yadr-vim-delete-plugin +++ b/bin/yadr/yadr-vim-delete-plugin @@ -1,6 +1,6 @@ #!/usr/bin/env ruby require File.join(File.dirname(__FILE__), 'default_libs') -require File.join(File.dirname(__FILE__), 'vundle') +require File.join(File.dirname(__FILE__), 'vimplug') GitStyleBinary.command do version "yadr-delete-vim-plugin 1.0" @@ -19,9 +19,9 @@ GitStyleBinary.command do repo=command.opts[:url] puts "Removing \"#{repo}\" from the plugin list" bundle_path=repo.gsub("https://github.com/", "") - removed=Vundle::remove_plugin_from_vundle repo + removed=VimPlug::remove_plugin_from_bundles repo if removed - Vundle::update_vundle + VimPlug::update_bundles puts "Successfully removed\"#{repo}\"" else puts "Unable to find \"#{repo}\" among the installed plugins" diff --git a/bin/yadr/yadr-vim-list-plugin b/bin/yadr/yadr-vim-list-plugin index fc3c376d79..eb09767307 100755 --- a/bin/yadr/yadr-vim-list-plugin +++ b/bin/yadr/yadr-vim-list-plugin @@ -1,6 +1,6 @@ #!/usr/bin/env ruby require File.join(File.dirname(__FILE__), 'default_libs') -require File.join(File.dirname(__FILE__), 'vundle') +require File.join(File.dirname(__FILE__), 'vimplug') GitStyleBinary.command do version "yadr-list-vim-plugin 1.0" @@ -11,9 +11,9 @@ GitStyleBinary.command do Usage: yadr-list-vim-plugin EOS run do |command| - puts "Currently configured plugins:" + puts "Currently configured plugins:" i=1 - Vundle::vundle_list.each do |plugin| + VimPlug::bundle_list.each do |plugin| puts "#{i}. #{plugin}" i=i+1 end From 2943c00b449371402987f7a1ba550d2a7489e2ce Mon Sep 17 00:00:00 2001 From: Nanda Lopes Date: Sun, 4 Jul 2021 21:35:10 -0300 Subject: [PATCH 2/6] feat(vim): migrate to vim-plug --- .gitignore | 7 ++++--- vim/plugins.d/main.vim | 40 ++++++++++++++++++++++++++++++++++++++++ vim/vundles.vim | 39 --------------------------------------- vimrc | 12 ++++++------ 4 files changed, 50 insertions(+), 48 deletions(-) create mode 100644 vim/plugins.d/main.vim delete mode 100644 vim/vundles.vim diff --git a/.gitignore b/.gitignore index 4a4cb2bef8..84eca55ff8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,10 @@ vim/.netrwhist vim/tmp vim/spell vim/after/.vimrc.after -vim/.vundles.local -vim/.vundles.local.bak -vim/bundle +vim/.local.bundles +vim/.local.bundles.bak +vim/plugged +vim/autoload/plug.vim vim/sessions .netrwhist bin/subl diff --git a/vim/plugins.d/main.vim b/vim/plugins.d/main.vim new file mode 100644 index 0000000000..c18446af82 --- /dev/null +++ b/vim/plugins.d/main.vim @@ -0,0 +1,40 @@ +" ======================================== +" Vim plugin configuration +" ======================================== +" +" This file contains the list of plugin installed using vim-plug plugin manager. +" Once you've updated the list of plugin, you can run plugin update by issuing +" the command :PlugInstall from within vim or directly invoking it from the +" command line with the following syntax: +" vim --noplugin -u vim/plugged.vim -N "+set hidden" "+syntax on" +PlugClean! +PlugInstall +qall + +if empty(glob('~/.vim' . '/autoload/plug.vim')) + silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' + autocmd VimEnter * PlugInstall --sync | source % +endif + +set rtp+=~/.vim/plugins.d/ "Submodules + +" Directory for plugins +call plug#begin('~/.vim/plugged') + +" YADR's plugins are split up by category into smaller files +" This reduces churn and makes it easier to fork. See +" ~/.vim/plugged/ to edit them: +runtime ruby.bundles +runtime languages.bundles +runtime git.bundles +runtime appearance.bundles +runtime textobjects.bundles +runtime search.bundles +runtime project.bundles +runtime vim-improvements.bundles + +" The plugins listed in ~/.vim/.local.bundles will be added here to +" allow the user to add vim plugins to yadr without the need for a fork. +if filereadable(expand("~/.yadr/vim/.local.bundles")) + source ~/.yadr/vim/.local.bundles +endif + +" All of your Plugins must be added before the following line +call plug#end() " required diff --git a/vim/vundles.vim b/vim/vundles.vim deleted file mode 100644 index c402973079..0000000000 --- a/vim/vundles.vim +++ /dev/null @@ -1,39 +0,0 @@ -" ======================================== -" Vim plugin configuration -" ======================================== -" -" This file contains the list of plugin installed using vundle plugin manager. -" Once you've updated the list of plugin, you can run vundle update by issuing -" the command :BundleInstall from within vim or directly invoking it from the -" command line with the following syntax: -" vim --noplugin -u vim/vundles.vim -N "+set hidden" "+syntax on" +BundleClean! +BundleInstall +qall -" Filetype off is required by vundle -filetype off - -set rtp+=~/.vim/bundle/vundle/ -set rtp+=~/.vim/vundles/ "Submodules -call vundle#rc() - -" let Vundle manage Vundle (required) -Bundle "gmarik/vundle" - -" YADR's vundles are split up by category into smaller files -" This reduces churn and makes it easier to fork. See -" ~/.vim/vundles/ to edit them: -runtime ruby.vundle -runtime languages.vundle -runtime git.vundle -runtime appearance.vundle -runtime textobjects.vundle -runtime search.vundle -runtime project.vundle -runtime vim-improvements.vundle - -" The plugins listed in ~/.vim/.vundles.local will be added here to -" allow the user to add vim plugins to yadr without the need for a fork. -if filereadable(expand("~/.yadr/vim/.vundles.local")) - source ~/.yadr/vim/.vundles.local -endif - -"Filetype plugin indent on is required by vundle -filetype plugin indent on diff --git a/vimrc b/vimrc index 9f3e37f818..3d2f8c5c5a 100644 --- a/vimrc +++ b/vimrc @@ -33,13 +33,13 @@ syntax on " the plugins. let mapleader="," -" =============== Vundle Initialization =============== -" This loads all the plugins specified in ~/.vim/vundles.vim -" Use Vundle plugin to manage all other plugins -if filereadable(expand("~/.vim/vundles.vim")) - source ~/.vim/vundles.vim +" =============== Plug Initialization =============== +" This loads all the plugins specified in ~/.vim/plug.vim +" Use vim-plug plugin to manage all other plugins +if filereadable(expand("~/.vim/plugins.d/main.vim")) + source ~/.vim/plugins.d/main.vim endif -au BufNewFile,BufRead *.vundle set filetype=vim +au BufNewFile,BufRead *.bundles set filetype=vim " ================ Turn Off Swap Files ============== From a7a9bd6a78b96da8a28cc9fc1686ccedc862d88e Mon Sep 17 00:00:00 2001 From: Nanda Lopes Date: Sun, 4 Jul 2021 21:37:08 -0300 Subject: [PATCH 3/6] chore(vim): migrate to vim-plug - Rename files - Change plugin action Bundle -> Plug Signed-off-by: Nanda Lopes --- vim/plugins.d/appearance.bundles | 10 +++++++++ vim/plugins.d/git.bundles | 4 ++++ vim/plugins.d/languages.bundles | 10 +++++++++ vim/plugins.d/project.bundles | 7 ++++++ vim/plugins.d/ruby.bundles | 10 +++++++++ vim/plugins.d/search.bundles | 6 +++++ vim/plugins.d/textobjects.bundles | 15 +++++++++++++ vim/plugins.d/vim-improvements.bundles | 31 ++++++++++++++++++++++++++ vim/vundles/appearance.vundle | 10 --------- vim/vundles/git.vundle | 4 ---- vim/vundles/languages.vundle | 9 -------- vim/vundles/project.vundle | 7 ------ vim/vundles/ruby.vundle | 10 --------- vim/vundles/search.vundle | 6 ----- vim/vundles/textobjects.vundle | 15 ------------- vim/vundles/vim-improvements.vundle | 31 -------------------------- 16 files changed, 93 insertions(+), 92 deletions(-) create mode 100644 vim/plugins.d/appearance.bundles create mode 100644 vim/plugins.d/git.bundles create mode 100644 vim/plugins.d/languages.bundles create mode 100644 vim/plugins.d/project.bundles create mode 100644 vim/plugins.d/ruby.bundles create mode 100644 vim/plugins.d/search.bundles create mode 100644 vim/plugins.d/textobjects.bundles create mode 100644 vim/plugins.d/vim-improvements.bundles delete mode 100644 vim/vundles/appearance.vundle delete mode 100644 vim/vundles/git.vundle delete mode 100644 vim/vundles/languages.vundle delete mode 100644 vim/vundles/project.vundle delete mode 100644 vim/vundles/ruby.vundle delete mode 100644 vim/vundles/search.vundle delete mode 100644 vim/vundles/textobjects.vundle delete mode 100644 vim/vundles/vim-improvements.vundle diff --git a/vim/plugins.d/appearance.bundles b/vim/plugins.d/appearance.bundles new file mode 100644 index 0000000000..6abb82a28a --- /dev/null +++ b/vim/plugins.d/appearance.bundles @@ -0,0 +1,10 @@ +Plug 'chrisbra/color_highlight' +Plug 'skwp/vim-colors-solarized' +Plug 'itchyny/lightline.vim' +Plug 'jby/tmux.vim' +Plug 'morhetz/gruvbox' +Plug 'xsunsmile/showmarks' +Plug 'chriskempson/base16-vim' + +" Required for Gblame in terminal vim +Plug 'godlygeek/csapprox' diff --git a/vim/plugins.d/git.bundles b/vim/plugins.d/git.bundles new file mode 100644 index 0000000000..8c9a994185 --- /dev/null +++ b/vim/plugins.d/git.bundles @@ -0,0 +1,4 @@ +Plug 'gregsexton/gitv', { 'on': 'Gitv' } +Plug 'mattn/gist-vim' +Plug 'tpope/vim-fugitive' +Plug 'tpope/vim-git' diff --git a/vim/plugins.d/languages.bundles b/vim/plugins.d/languages.bundles new file mode 100644 index 0000000000..1672908e2c --- /dev/null +++ b/vim/plugins.d/languages.bundles @@ -0,0 +1,10 @@ +Plug 'sheerun/vim-polyglot' +Plug 'garbas/vim-snipmate' +Plug 'honza/vim-snippets' +Plug 'jtratner/vim-flavored-markdown' +Plug 'vim-syntastic/syntastic' +Plug 'nelstrom/vim-markdown-preview' +Plug 'skwp/vim-html-escape' +Plug 'mxw/vim-jsx' +Plug 'jparise/vim-graphql' + diff --git a/vim/plugins.d/project.bundles b/vim/plugins.d/project.bundles new file mode 100644 index 0000000000..fe43cb03e6 --- /dev/null +++ b/vim/plugins.d/project.bundles @@ -0,0 +1,7 @@ +Plug 'jistr/vim-nerdtree-tabs' +Plug 'preservim/nerdtree' +Plug 'ctrlpvim/ctrlp.vim' +Plug 'JazzCore/ctrlp-cmatcher' +Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' } +Plug 'xolox/vim-misc' +Plug 'xolox/vim-session' diff --git a/vim/plugins.d/ruby.bundles b/vim/plugins.d/ruby.bundles new file mode 100644 index 0000000000..7d416a9941 --- /dev/null +++ b/vim/plugins.d/ruby.bundles @@ -0,0 +1,10 @@ +Plug 'ecomba/vim-ruby-refactoring' +Plug 'tpope/vim-rails' +Plug 'tpope/vim-rake' +Plug 'tpope/vim-rvm' +Plug 'vim-ruby/vim-ruby' +Plug 'keith/rspec.vim' +Plug 'skwp/vim-iterm-rspec' +Plug 'skwp/vim-spec-finder' +Plug 'ck3g/vim-change-hash-syntax' +Plug 'tpope/vim-bundler' diff --git a/vim/plugins.d/search.bundles b/vim/plugins.d/search.bundles new file mode 100644 index 0000000000..a198602b79 --- /dev/null +++ b/vim/plugins.d/search.bundles @@ -0,0 +1,6 @@ +Plug 'justinmk/vim-sneak' +Plug 'rking/ag.vim' +Plug 'henrik/vim-indexed-search' +Plug 'nelstrom/vim-visual-star-search' +Plug 'skwp/greplace.vim' +Plug 'Lokaltog/vim-easymotion' diff --git a/vim/plugins.d/textobjects.bundles b/vim/plugins.d/textobjects.bundles new file mode 100644 index 0000000000..adae3b30f8 --- /dev/null +++ b/vim/plugins.d/textobjects.bundles @@ -0,0 +1,15 @@ +" These bundles introduce new textobjects into vim, +" For example the Ruby one introduces the 'r' text object +" such that 'var' gives you Visual Around Ruby +Plug 'austintaylor/vim-indentobject' +Plug 'bootleq/vim-textobj-rubysymbol' +Plug 'coderifous/textobj-word-column.vim' +Plug 'kana/vim-textobj-datetime' +Plug 'kana/vim-textobj-entire' +Plug 'kana/vim-textobj-function' +Plug 'kana/vim-textobj-user' +Plug 'lucapette/vim-textobj-underscore' +Plug 'nathanaelkane/vim-indent-guides' +Plug 'nelstrom/vim-textobj-rubyblock' +Plug 'thinca/vim-textobj-function-javascript' +Plug 'wellle/targets.vim' diff --git a/vim/plugins.d/vim-improvements.bundles b/vim/plugins.d/vim-improvements.bundles new file mode 100644 index 0000000000..40a38bab78 --- /dev/null +++ b/vim/plugins.d/vim-improvements.bundles @@ -0,0 +1,31 @@ +Plug 'AndrewRadev/splitjoin.vim' +Plug 'Raimondi/delimitMate' +Plug 'Shougo/neocomplete' +Plug 'briandoll/change-inside-surroundings.vim' +Plug 'godlygeek/tabular' +Plug 'tomtom/tcomment_vim' +Plug 'vim-scripts/camelcasemotion' +Plug 'vim-scripts/matchit.zip' +Plug 'kristijanhusak/vim-multiple-cursors' +Plug 'Keithbsmiley/investigate.vim' +Plug 'chrisbra/NrrwRgn' +Plug 'christoomey/vim-tmux-navigator' +Plug 'MarcWeber/vim-addon-mw-utils' +Plug 'bogado/file-line' +Plug 'mattn/webapi-vim' +Plug 'sjl/gundo.vim' +Plug 'skwp/YankRing.vim' +Plug 'tomtom/tlib_vim' +Plug 'tpope/vim-abolish' +Plug 'tpope/vim-endwise' +Plug 'tpope/vim-ragtag' +Plug 'tpope/vim-repeat' +Plug 'tpope/vim-surround' +Plug 'tpope/vim-unimpaired' +Plug 'vim-scripts/AnsiEsc.vim' +Plug 'vim-scripts/AutoTag' +Plug 'vim-scripts/lastpos.vim' +Plug 'vim-scripts/sudo.vim' +Plug 'goldfeld/ctrlr.vim' +Plug 'editorconfig/editorconfig-vim' + diff --git a/vim/vundles/appearance.vundle b/vim/vundles/appearance.vundle deleted file mode 100644 index b18a59fa37..0000000000 --- a/vim/vundles/appearance.vundle +++ /dev/null @@ -1,10 +0,0 @@ -Bundle "chrisbra/color_highlight.git" -Bundle "skwp/vim-colors-solarized" -Bundle "itchyny/lightline.vim" -Bundle "jby/tmux.vim.git" -Bundle "morhetz/gruvbox" -Bundle "xsunsmile/showmarks.git" -Bundle "chriskempson/base16-vim" - -" Required for Gblame in terminal vim -Bundle "godlygeek/csapprox.git" diff --git a/vim/vundles/git.vundle b/vim/vundles/git.vundle deleted file mode 100644 index 80b44225b3..0000000000 --- a/vim/vundles/git.vundle +++ /dev/null @@ -1,4 +0,0 @@ -Bundle "gregsexton/gitv" -Bundle "mattn/gist-vim" -Bundle "tpope/vim-fugitive" -Bundle "tpope/vim-git" diff --git a/vim/vundles/languages.vundle b/vim/vundles/languages.vundle deleted file mode 100644 index ccd327a941..0000000000 --- a/vim/vundles/languages.vundle +++ /dev/null @@ -1,9 +0,0 @@ -Bundle 'sheerun/vim-polyglot' -Bundle 'garbas/vim-snipmate.git' -Bundle 'honza/vim-snippets' -Bundle 'jtratner/vim-flavored-markdown.git' -Bundle 'vim-syntastic/syntastic.git' -Bundle 'nelstrom/vim-markdown-preview' -Bundle 'skwp/vim-html-escape' -Bundle 'mxw/vim-jsx' -Bundle 'jparise/vim-graphql' diff --git a/vim/vundles/project.vundle b/vim/vundles/project.vundle deleted file mode 100644 index 6e3c0d0f78..0000000000 --- a/vim/vundles/project.vundle +++ /dev/null @@ -1,7 +0,0 @@ -Bundle "jistr/vim-nerdtree-tabs.git" -Bundle "preservim/nerdtree.git" -Bundle "ctrlpvim/ctrlp.vim" -Bundle 'JazzCore/ctrlp-cmatcher' -Bundle 'junegunn/fzf' -Bundle "xolox/vim-misc" -Bundle "xolox/vim-session" diff --git a/vim/vundles/ruby.vundle b/vim/vundles/ruby.vundle deleted file mode 100644 index f0c7bc81e6..0000000000 --- a/vim/vundles/ruby.vundle +++ /dev/null @@ -1,10 +0,0 @@ -Bundle "ecomba/vim-ruby-refactoring" -Bundle "tpope/vim-rails.git" -Bundle "tpope/vim-rake.git" -Bundle "tpope/vim-rvm.git" -Bundle "vim-ruby/vim-ruby.git" -Bundle "keith/rspec.vim" -Bundle "skwp/vim-iterm-rspec" -Bundle "skwp/vim-spec-finder" -Bundle "ck3g/vim-change-hash-syntax" -Bundle "tpope/vim-bundler" diff --git a/vim/vundles/search.vundle b/vim/vundles/search.vundle deleted file mode 100644 index 2635f88d30..0000000000 --- a/vim/vundles/search.vundle +++ /dev/null @@ -1,6 +0,0 @@ -Bundle "justinmk/vim-sneak" -Bundle "rking/ag.vim" -Bundle "henrik/vim-indexed-search" -Bundle "nelstrom/vim-visual-star-search" -Bundle "skwp/greplace.vim" -Bundle "Lokaltog/vim-easymotion" diff --git a/vim/vundles/textobjects.vundle b/vim/vundles/textobjects.vundle deleted file mode 100644 index 749bf1bfb9..0000000000 --- a/vim/vundles/textobjects.vundle +++ /dev/null @@ -1,15 +0,0 @@ -" These bundles introduce new textobjects into vim, -" For example the Ruby one introduces the 'r' text object -" such that 'var' gives you Visual Around Ruby -Bundle "austintaylor/vim-indentobject" -Bundle "bootleq/vim-textobj-rubysymbol" -Bundle "coderifous/textobj-word-column.vim" -Bundle "kana/vim-textobj-datetime" -Bundle "kana/vim-textobj-entire" -Bundle "kana/vim-textobj-function" -Bundle "kana/vim-textobj-user" -Bundle "lucapette/vim-textobj-underscore" -Bundle "nathanaelkane/vim-indent-guides" -Bundle "nelstrom/vim-textobj-rubyblock" -Bundle "thinca/vim-textobj-function-javascript" -Bundle "wellle/targets.vim" diff --git a/vim/vundles/vim-improvements.vundle b/vim/vundles/vim-improvements.vundle deleted file mode 100644 index 21fdd09ef4..0000000000 --- a/vim/vundles/vim-improvements.vundle +++ /dev/null @@ -1,31 +0,0 @@ -Bundle "AndrewRadev/splitjoin.vim" -Bundle "Raimondi/delimitMate" -Bundle "Shougo/neocomplete.git" -Bundle "briandoll/change-inside-surroundings.vim.git" -Bundle "godlygeek/tabular" -Bundle "tomtom/tcomment_vim.git" -Bundle "vim-scripts/camelcasemotion.git" -Bundle "vim-scripts/matchit.zip.git" -Bundle "kristijanhusak/vim-multiple-cursors" -Bundle "Keithbsmiley/investigate.vim" -Bundle "chrisbra/NrrwRgn" -Bundle "christoomey/vim-tmux-navigator" -Bundle "MarcWeber/vim-addon-mw-utils.git" -Bundle "bogado/file-line.git" -Bundle "mattn/webapi-vim.git" -Bundle "sjl/gundo.vim" -Bundle "skwp/YankRing.vim" -Bundle "tomtom/tlib_vim.git" -Bundle "tpope/vim-abolish" -Bundle "tpope/vim-endwise.git" -Bundle "tpope/vim-ragtag" -Bundle "tpope/vim-repeat.git" -Bundle "tpope/vim-surround.git" -Bundle "tpope/vim-unimpaired" -Bundle "vim-scripts/AnsiEsc.vim.git" -Bundle "vim-scripts/AutoTag.git" -Bundle "vim-scripts/lastpos.vim" -Bundle "vim-scripts/sudo.vim" -Bundle "goldfeld/ctrlr.vim" -Bundle "editorconfig/editorconfig-vim" - From 0406f4baf4887e4bd04e3b57b8f030286cfd4e3d Mon Sep 17 00:00:00 2001 From: Nanda Lopes Date: Sun, 4 Jul 2021 22:41:12 -0300 Subject: [PATCH 4/6] feat: save previous plugin set on migration --- Rakefile | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/Rakefile b/Rakefile index f9d7a3acc2..c2c57935df 100644 --- a/Rakefile +++ b/Rakefile @@ -44,7 +44,7 @@ end desc 'Updates the installation' task :update do - Rake::Task["vundle_migration"].execute if needs_migration_to_vundle? + Rake::Task["plug_migration"].execute if needs_migration_to_plug? Rake::Task["install"].execute #TODO: for now, we do the same as install. But it would be nice #not to clobber zsh files @@ -72,23 +72,29 @@ task :submodules do end end -desc "Performs migration from pathogen to vundle" -task :vundle_migration do +desc "Performs migration from vundle to vim-plug" +task :plug_migration do puts "======================================================" - puts "Migrating from pathogen to vundle vim plugin manager. " - puts "This will move the old .vim/bundle directory to" + puts "Migrating from vundle to vim-plug plugin manager. " + puts "This will move the old .vim/bundle directory to " puts ".vim/bundle.old and replacing all your vim plugins with" puts "the standard set of plugins. You will then be able to " puts "manage your vim's plugin configuration by editing the " - puts "file .vim/vundles.vim" + puts "file .vim/plugins.d/main.vim" puts "======================================================" - Dir.glob(File.join('vim', 'bundle','**')) do |sub_path| - run %{git config -f #{File.join('.git', 'config')} --remove-section submodule.#{sub_path}} - # `git rm --cached #{sub_path}` - FileUtils.rm_rf(File.join('.git', 'modules', sub_path)) - end FileUtils.mv(File.join('vim','bundle'), File.join('vim', 'bundle.old')) + # Rename local vundles file + vundle_path = File.join('vim','.vundles.local') + if File.exists?(vundle_path) + FileUtils.mv(vundle_path, File.join('vim', '.local.bundles')) + puts "Replace all Bundle started lines with Plug" + run %q{ ruby -pi.bak -e "gsub(/^Bundle/, 'Plug')" .local.bundles } + end + vundle_path_bak = File.join('vim','.vundles.local.bak') + if File.exists?(vundle_path_bak) + FileUtils.mv(vundle_path_bak, File.join('vim', '.local.bundles.bak')) + end end desc "Runs Vim-Plug installer in a clean vim environment" @@ -326,8 +332,8 @@ def install_files(files, method = :symlink) end end -def needs_migration_to_vundle? - File.exists? File.join('vim', 'bundle', 'tpope-vim-pathogen') +def needs_migration_to_plug? + File.exists?(File.join('vim', 'bundle', 'vundle')) || File.exists?(File.join('vim', 'bundle', 'Vundle.vim')) end From 9399089fd14156ff313202f9edaf8c31fcd0fa25 Mon Sep 17 00:00:00 2001 From: Nanda Lopes Date: Mon, 5 Jul 2021 12:02:43 -0300 Subject: [PATCH 5/6] chore(vim): update fzf post install hook --- vim/plugins.d/project.bundles | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/plugins.d/project.bundles b/vim/plugins.d/project.bundles index fe43cb03e6..78324d3ed8 100644 --- a/vim/plugins.d/project.bundles +++ b/vim/plugins.d/project.bundles @@ -2,6 +2,6 @@ Plug 'jistr/vim-nerdtree-tabs' Plug 'preservim/nerdtree' Plug 'ctrlpvim/ctrlp.vim' Plug 'JazzCore/ctrlp-cmatcher' -Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' } +Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': { -> fzf#install() } } Plug 'xolox/vim-misc' Plug 'xolox/vim-session' From fb793566687ef8c831f56826bdc3dc8f5bce89b5 Mon Sep 17 00:00:00 2001 From: Nanda Lopes Date: Mon, 5 Jul 2021 12:08:44 -0300 Subject: [PATCH 6/6] chore(vim): fix typo in comments - plugged.vim -> plugins.d/main.vim - plug.vim -> plugins.d/main.vim Signed-off-by: Nanda Lopes --- vim/plugins.d/main.vim | 2 +- vimrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vim/plugins.d/main.vim b/vim/plugins.d/main.vim index c18446af82..8a7d3b97fd 100644 --- a/vim/plugins.d/main.vim +++ b/vim/plugins.d/main.vim @@ -6,7 +6,7 @@ " Once you've updated the list of plugin, you can run plugin update by issuing " the command :PlugInstall from within vim or directly invoking it from the " command line with the following syntax: -" vim --noplugin -u vim/plugged.vim -N "+set hidden" "+syntax on" +PlugClean! +PlugInstall +qall +" vim --noplugin -u vim/plugins.d/main.vim -N "+set hidden" "+syntax on" +PlugClean! +PlugInstall +qall if empty(glob('~/.vim' . '/autoload/plug.vim')) silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' diff --git a/vimrc b/vimrc index 3d2f8c5c5a..77051ba3a4 100644 --- a/vimrc +++ b/vimrc @@ -34,7 +34,7 @@ syntax on let mapleader="," " =============== Plug Initialization =============== -" This loads all the plugins specified in ~/.vim/plug.vim +" This loads all the plugins specified in ~/.vim/plugins.d/main.vim " Use vim-plug plugin to manage all other plugins if filereadable(expand("~/.vim/plugins.d/main.vim")) source ~/.vim/plugins.d/main.vim