Skip to content

Commit

Permalink
Moving the vim-plugins module to vim
Browse files Browse the repository at this point in the history
  • Loading branch information
roman committed Aug 2, 2012
1 parent 79eaf32 commit 87e21b6
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 122 deletions.
7 changes: 0 additions & 7 deletions vim-plugins/manifests/init.pp

This file was deleted.

54 changes: 0 additions & 54 deletions vim-plugins/manifests/install.pp

This file was deleted.

58 changes: 0 additions & 58 deletions vim/manifests/compile.pp

This file was deleted.

9 changes: 6 additions & 3 deletions vim/manifests/init.pp
@@ -1,5 +1,8 @@
class vim($compile=false) {
class { "vim::install":
compile => $compile
class vim($user="vagrant",
$config_repo_url="https://github.com/roman/vimconfig.git") {
class { "vim::plugins":
config_repo_url => $config_repo_url,
user => $user
}
include vim:install
}
52 changes: 52 additions & 0 deletions vim/manifests/plugins.pp
@@ -0,0 +1,52 @@
class vim::plugins($user,
$config_repo_url) {

include git::install, vim::install

Exec {
path => ["/bin", "/usr/bin", "/usr/local/bin"],
user => $user,
group => $user,
require => Class["git::install", "vim::install"]
}

exec { "vim::plugins/clone-vim-config-repo":
cwd => "/home/$user",
command => "git clone ${config_repo_url} .vim --recursive",
creates => "/home/${user}/.vim",
# give it a lot of time (20 min), sometimes github is sloow
timeout => 1200,
}

exec { "vim::plugins/update-vim-config":
cwd => "/home/$user/.vim",
command => "git pull origin master",
onlyif => "[ -s /home/$user/.vim ]"
}

exec { "vim::plugins/update-vim-plugins":
cwd => "/home/$user/.vim",
command => "git submode update --init",
require => Exec["vim::plugins/update-vim-config"]
}

exec { "vim::plugins/create-vimproc-binary":
cwd => "/home/$user/.vim/bundle/vimproc",
command => $operatingsystem ? {
"Ubuntu" => "make -f make_unix.mak",
"Darwin" => "make -f make_mac.mak"
},
creates => "/home/$user/.vim/bundle/vimproc/autoload/proc.so",
require => Exec["vim::plugins/update-vim-config",
"vim::plugins/update-vim-plugins"],
}

file { "/home/$user/.vimrc":
owner => $user,
group => $user,
ensure => link,
target => "/home/$user/.vim/vimrc",
require => Exec["vim::plugins/clone-vim-config-repo"],
}

}

0 comments on commit 87e21b6

Please sign in to comment.