From 54863f2e1bcd8d15e4003aa00de5afa079bde9a6 Mon Sep 17 00:00:00 2001 From: Fabio Gallonetto Date: Sun, 17 Mar 2013 17:12:07 +0000 Subject: [PATCH] Add yadr command line tools to remove/list plugins Two new command line tools: yadr-vim-remove-plugin and yadr-vim-list-plugin do what they're supposed to. --- bin/yadr/yadr-vim-delete-plugin | 30 ++++++++++++++++++++++++++++++ bin/yadr/yadr-vim-list-plugin | 21 +++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100755 bin/yadr/yadr-vim-delete-plugin create mode 100755 bin/yadr/yadr-vim-list-plugin diff --git a/bin/yadr/yadr-vim-delete-plugin b/bin/yadr/yadr-vim-delete-plugin new file mode 100755 index 00000000..81237e0b --- /dev/null +++ b/bin/yadr/yadr-vim-delete-plugin @@ -0,0 +1,30 @@ +#!/usr/bin/env ruby +require File.join(File.dirname(__FILE__), 'default_libs') +require File.join(File.dirname(__FILE__), 'vundle') + +GitStyleBinary.command do + version "yadr-delete-vim-plugin 1.0" + + short_desc "Removes a vim plugin" + opt :url, "Repository URL (see usage)", :required => true, :type => String + + banner <<-'EOS' + Usage: yadr-delete-vim-plugin --url [URL] + Specify a plugin repository URL in one of the following forms: + - Custom repository URL (full URL): git://git.wincent.com/command-t.git + - Github repository (username/repo_name): robgleesson/hammer.vim.git + - Vim script repository (plugin_name): FuzzyFinder + EOS + run do |command| + 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 + if removed + Vundle::update_vundle + puts "Successfully removed\"#{repo}\"" + else + puts "Unable to find \"#{repo}\" among the installed plugins" + end + end +end diff --git a/bin/yadr/yadr-vim-list-plugin b/bin/yadr/yadr-vim-list-plugin new file mode 100755 index 00000000..fc3c376d --- /dev/null +++ b/bin/yadr/yadr-vim-list-plugin @@ -0,0 +1,21 @@ +#!/usr/bin/env ruby +require File.join(File.dirname(__FILE__), 'default_libs') +require File.join(File.dirname(__FILE__), 'vundle') + +GitStyleBinary.command do + version "yadr-list-vim-plugin 1.0" + + short_desc "List installed vim plugins" + + banner <<-'EOS' + Usage: yadr-list-vim-plugin + EOS + run do |command| + puts "Currently configured plugins:" + i=1 + Vundle::vundle_list.each do |plugin| + puts "#{i}. #{plugin}" + i=i+1 + end + end +end