helm/rake/vim.rake

41 lines
1 KiB
Ruby
Raw Normal View History

2014-04-11 00:31:44 -07:00
require_relative "lib/output"
require_relative "lib/homebrew"
2014-06-27 12:48:02 -07:00
require_relative "lib/sh"
2014-04-11 00:31:44 -07:00
desc "Ensure vim/macvim is installed and up to date"
task :vim => "vim:update"
2014-04-11 00:31:44 -07:00
namespace :vim do
2014-04-13 08:46:20 -07:00
task :install do
2014-04-11 00:31:44 -07:00
%w{lua luajit}.each { |pkg| Homebrew.install pkg }
%w{vim macvim}.each { |pkg| Homebrew.install(pkg, '--with-lua --with-luajit') }
2014-06-21 01:20:23 -07:00
unless Dir.exists? (File.expand_path("~/.vim"))
github('hlissner/vim', '~/.vim')
github('Shougo/neobundle.vim', '~/.vim/bundle/neobundle.vim')
end
end
task :update => 'vim:install' do
path = File.expand_path("~/.vim")
2014-06-27 12:48:02 -07:00
echo "Updating vim"
sh "cd #{path} && git pull"
2014-06-27 12:48:02 -07:00
echo "Updating vim plugins"
Dir.glob("#{path}/bundle/*") do |f|
echo ":: Updating #{File.basename(f)}:"
sh_safe "cd #{f} && git pull"
end
2014-04-11 00:31:44 -07:00
end
2014-04-13 08:46:20 -07:00
desc "Remove vim"
2014-04-11 00:31:44 -07:00
task :remove do
echo "Uninstalling vim"
2014-04-13 08:46:20 -07:00
%w{vim macvim}.each { |pkg| Homebrew.remove pkg }
2014-04-11 00:31:44 -07:00
end
end