Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env ruby
# Original: http://tammersaleh.com/posts/the-modern-vim-config-with-pathogen
git_bundles = [
"git://github.com/vim-bundles/fuzzyfinder.git",
"git://github.com/scrooloose/nerdcommenter.git",
"git://github.com/msanders/snipmate.vim.git",
"git://github.com/tpope/vim-cucumber.git",
"git://github.com/tpope/vim-haml.git",
"git://github.com/tpope/vim-rails.git",
"git://github.com/tpope/vim-surround.git"
]
vim_org_scripts = []
require 'fileutils'
require 'open-uri'
bundles_dir = File.join(File.dirname(__FILE__), "bundle")
FileUtils.cd(bundles_dir)
trash = ARGV.include?('--trash')
if trash
puts "Trashing everything (lookout!)"
Dir["*"].each {|d| FileUtils.rm_rf d }
end
git_bundles.each do |url|
dir = url.split('/').last.sub(/\.git$/, '')
if !trash && File.exists?(dir)
puts " Skipping #{dir}"
next
end
puts " Unpacking #{url} into #{dir}"
`git clone #{url} #{dir}`
FileUtils.rm_rf(File.join(dir, ".git"))
end
vim_org_scripts.each do |name, script_id, script_type|
local_file = File.join(name, script_type, "#{name}.#{script_type == 'zip' ? 'zip' : 'vim'}")
if !trash && File.exists?(local_file)
puts " Skipping #{local_file}"
next
end
puts " Downloading #{name}"
FileUtils.mkdir_p(File.dirname(local_file))
File.open(local_file, "w") do |file|
file << open("http://www.vim.org/scripts/download_script.php?src_id=#{script_id}").read
end
if script_type == 'zip'
%x(unzip -d #{name} #{local_file})
end
end
# vim:ft=ruby:
@theosp

This comment has been minimized.

Copy link
Owner Author

@theosp theosp commented Sep 23, 2010

  • 5b174cd1dd5037954992788c451683a92d9ef79a Add a reference to the original blog post
  • c76fc3f6294dda7957e319423633bb3402bb2395 Add a reference to the original blog post
  • 73b6da5cfb66a8f9c33aee87391bd55f17e9b310 Add modeline with ft=ruby (My vim didn't recognised the ft automatically)
  • b6259c09df26f90e11cf9951129d76e7f539ef8c Make --notrash the default behavior, add --trash flag
@wikimatze

This comment has been minimized.

Copy link

@wikimatze wikimatze commented Aug 10, 2011

Is there maybe the possibilitie to also automatically install *.vba (I mean for example the commanf-t plugin http://s3.wincent.com/command-t/releases/command-t-1.2.1.vba).
Thanks for your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.