Extracted Logic for vim in seperate class
[vagrant-dotfiles.git] / lib / copy_my_conf / vim.rb
1 module Vagrant
2 module Provisioners
3 class CopyMyConf < Base
4 class Vim
5 def prepare vm, tmp_root
6 `mkdir -p #{tmp_root}/vim`
7 ["~/.vimrc", "~/.vim"].each do |file|
8 `cp -r #{file} #{tmp_root}/vim`
9 end
10 vm.share_folder("vim", "#{tmp_root}/vim", "#{tmp_root}/vim")
11 end
12
13 def provision channel, user_home, tmp_root
14 puts "Copying your vim configuratios"
15 channel.execute("rm -rf #{user_home}/.vim*")
16 channel.execute("cp -r #{tmp_root}/vim/.??* ~/")
17 end
18 end
19 end
20 end
21 end