Adding 'yadr' command for managing plugins (wip)

This commit is contained in:
yan
2011-12-07 20:34:25 -08:00
parent 0741bb0a71
commit acb81bb874
36 changed files with 3874 additions and 15 deletions

23
bin/yadr/yadr-vim-add-plugin Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env ruby
require File.join(File.dirname(__FILE__), 'default_libs')
GitStyleBinary.command do
version "yadr-add-vim-plugin 1.0"
short_desc "Add a vim plugin from a github repo"
opt :url, "Github url (http:// or git://)", :type => String
run do |command|
unless ARGV.size==1
puts "Example: #{$0} https://github.com/robgleeson/hammer.vim.git"
else
begin
repo=command[:url]
bundle_path=repo.gsub("https://github.com/","").gsub(".git","").gsub("/","-").gsub(".vim","")
system("cd ~/.dotfiles && git submodule add #{repo} vim/bundle/#{bundle_path}")
rescue
puts "Sorry, couldn't parse your path: #{$!}"
end
end
end
end