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.
This commit is contained in:
30
bin/yadr/yadr-vim-delete-plugin
Executable file
30
bin/yadr/yadr-vim-delete-plugin
Executable file
@@ -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
|
||||||
21
bin/yadr/yadr-vim-list-plugin
Executable file
21
bin/yadr/yadr-vim-list-plugin
Executable file
@@ -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
|
||||||
Reference in New Issue
Block a user