Browse files

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.
  • Loading branch information...
1 parent 1836070 commit 54863f2e1bcd8d15e4003aa00de5afa079bde9a6 Fabio Gallonetto committed Mar 17, 2013
Showing with 51 additions and 0 deletions.
  1. +30 −0 bin/yadr/yadr-vim-delete-plugin
  2. +21 −0 bin/yadr/yadr-vim-list-plugin
View
30 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
View
21 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

0 comments on commit 54863f2

Please sign in to comment.