Puppet Class: vim

Defined in:
manifests/init.pp

Overview

Parameters:

  • user (Any)
  • home_dir (Any)


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
# File 'manifests/init.pp', line 1

class vim($user, $home_dir) {
  include wget 

  case $operatingsystem {
    CentOS,RedHat: { $vim_package = 'vim-enhanced' }
    default: { $vim_package = 'vim' }
  }

  package { 'vim':
    name   => $vim_package,
    ensure => installed,
  }

  file { ["${home_dir}/.vim","${home_dir}/.vim/autoload","${home_dir}/.vim/bundle"] : 
    ensure => "directory",
    owner  => $user
  }

  wget::fetch { "DownloadPathogen":
    source      => "https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim",
    destination => "${home_dir}/.vim/autoload/pathogen.vim",
    verbose     => true
  }

  file { "${home_dir}/.vim/autoload/pathogen.vim":
    owner => $user
  }

  file { "${home_dir}/.vimrc": 
    owner   => $user,
    content => "execute pathogen#infect()\nsyntax on\ncall pathogen#helptags()\nfiletype plugin indent on\nhighlight comment ctermfg=darkgray\n:set bg=dark"
  }

  Package['vim'] 
  -> File["${home_dir}/.vim", "${home_dir}/.vim/autoload","${home_dir}/.vim/bundle"] 
  -> Wget::Fetch["DownloadPathogen"] 
  -> File["${home_dir}/.vim/autoload/pathogen.vim"] 
  -> File["${home_dir}/.vimrc"]

}