-
Notifications
You must be signed in to change notification settings - Fork 1
/
ruby_vim_bundle.rb
54 lines (42 loc) · 1.36 KB
/
ruby_vim_bundle.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env ruby
git_bundles = [
'[email protected]:rking/ag.vim.git',
'[email protected]:ctrlpvim/ctrlp.vim.git',
'[email protected]:preservim/nerdtree.git',
'[email protected]:tomtom/tlib_vim.git',
'[email protected]:tpope/vim-commentary.git',
'[email protected]:tpope/vim-fugitive.git',
'[email protected]:tpope/vim-rails.git',
'[email protected]:tpope/vim-rhubarb.git',
'[email protected]:vim-ruby/vim-ruby.git',
'[email protected]:tpope/vim-surround.git',
'[email protected]:flazz/vim-colorschemes.git'
].freeze
require 'fileutils'
require 'open-uri'
bundles_dir = File.join(File.expand_path('~'), ".vim/pack/bundle/start")
unless File.directory?(bundles_dir)
FileUtils.mkdir_p(bundles_dir)
end
FileUtils.cd(bundles_dir) do
puts "REMOVING EVERYTHING INSIDE (#{bundles_dir})"
Dir["*"].each {|d| FileUtils.rm_rf d }
git_bundles.each do |url|
dir = url.split('/').last.sub(/\.git$/, '')
puts " Unpacking #{url} into #{dir}"
`git clone #{url} #{dir}`
FileUtils.rm_rf(File.join(dir, ".git"))
end
end
# Install tmux-themepack
tmux_themepack = File.join(File.expand_path('~'), ".tmux-themepack")
if File.directory?(tmux_themepack)
FileUtils.rm_rf(tmux_themepack)
end
`git clone https://github.com/jimeh/tmux-themepack.git #{tmux_themepack}`
# Copy .tmux.conf
`cp .tmux.conf ~/.tmux.conf`
# Copy .vimrc
`cp .vimrc ~/.vimrc`
# Copy .gemrc
`cp .gemrc ~/.gemrc`