Skip to content

Commit

Permalink
Finished setting up vundle install
Browse files Browse the repository at this point in the history
  • Loading branch information
metasoarous committed Jun 29, 2015
1 parent 8ba46d8 commit 3132c94
Showing 1 changed file with 7 additions and 27 deletions.
34 changes: 7 additions & 27 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ desc "install the dot files into user's home directory - use replace_all=true to
task :install do
install_oh_my_zsh
switch_to_zsh
install_pathogen
pathogen_plugins do |plugin|
install_pathogen_plugin plugin
end
install_vundle
replace_all = ENV['replace_all'] == 'true'
dotfiles.each do |file|
system %Q{mkdir -p "$HOME/.#{File.dirname(file)}"} if file =~ /\//
Expand Down Expand Up @@ -89,30 +86,13 @@ def link_file(file)
end
end

def install_pathogen
if File.exist?(File.join(ENV['HOME'], '.vim/bundle'))
puts "Already using pathogen"
else
puts "Installing pathogen"
system %Q{mkdir -p ~/.vim ~/.vim/tmp ~/.vim/autoload ~/.vim/bundle}
system %Q{curl -Sso ~/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim}
end
end

def install_pathogen_plugin repo
name = repo.split('/')[1]
path = File.join(ENV['HOME'], '.vim/bundle', name)
if File.exist?(File.join(ENV['HOME'], '.vim/bundle', name))
puts " Already using #{name}"
def install_vundle
if File.exist?(File.join(ENV['HOME'], '.vim/bundle/Vundle.vim'))
puts "Already using vundle"
else
puts "Installing pathogen plugin #{name}"
system %Q{git clone git://github.com/#{repo}.git "$HOME/.vim/bundle/#{name}"}
end
end

def pathogen_plugins
File.open('pathogen_plugins').each_line do |line|
yield line.chomp
puts "Installing Vundle"
system %Q{mkdir -p ~/.vim ~/.vim/bundle}
system %Q{git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim}
end
end

Expand Down

0 comments on commit 3132c94

Please sign in to comment.