-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.rb
More file actions
34 lines (26 loc) · 803 Bytes
/
Copy pathinstall.rb
File metadata and controls
34 lines (26 loc) · 803 Bytes
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
#!/usr/bin/ruby
VIMRC = File.expand_path "~/.vimrc"
VIMRUNTIME = File.expand_path "~/.vim"
class Array
def shell_s
cp = dup
first = cp.shift
cp.map{ |arg| arg.gsub " ", "\\ " }.unshift(first) * " "
end
end
def system *args
abort "Failed during: #{args.shell_s}" unless Kernel.system *args
end
abort "~/.vimrc already exists" if File.exist? VIMRC
abort "#{VIMRUNTIME}/vimrc already exists" if File.exist? VIMRUNTIME
if File.exist?(VIMRUNTIME)
abort "#{VIMRUNTIME} already exists" unless Dir["#{VIMRUNTIME}/*"].empty?
end
system "git clone https://github.com/pankajkumar229/vimrc.git #{VIMRUNTIME}"
Dir.chdir VIMRUNTIME
system "git submodule update --init"
Dir.mkdir "undodir"
Dir.mkdir "view"
Dir.chdir ".."
system "ln -s .vim/vimrc .vimrc"
system "ln -s .vim/gvimrc .gvimrc"