Forge Home

vim

This module installs and configures the Vim package.

82,491 downloads

14,551 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.4.1 (latest)
  • 1.4.0
  • 1.3.1
  • 1.3.0
  • 1.2.1
  • 1.2.0
  • 1.1.3
  • 1.1.2
  • 1.1.0
  • 1.0.1
  • 1.0.0
  • 0.0.11
  • 0.0.9
  • 0.0.8
  • 0.0.7
  • 0.0.6
  • 0.0.5
  • 0.0.3
  • 0.0.2
  • 0.0.1
released Nov 30th 2016
This version is compatible with:
  • Puppet Enterprise >= 3.2.0
  • Puppet >= 3.2.0
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'dhoppe-vim', '1.4.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add dhoppe-vim
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install dhoppe-vim --version 1.4.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: vim

Documentation

dhoppe/vim — version 1.4.1 Nov 30th 2016

vim

Build Status Code Coverage Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with vim
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

Overview

This module installs and configures the Vim package.

Module Description

This module handles installing and configuring Vim across a range of operating systems and distributions.

Setup

What vim affects

  • vim package.
  • vim configuration file.

Setup Requirements

Beginning with vim

Install vim with the default parameters (No configuration files will be changed).

    class { 'vim': }

Install vim with the recommended parameters.

    class { 'vim':
      config_file_template => "vim/${::lsbdistcodename}/etc/vim/vimrc.erb",
      config_file_hash     => {
        'vimrc.local' => {
          config_file_path   => '/etc/vim/vimrc.local',
          config_file_source => 'puppet:///modules/vim/common/etc/vim/vimrc.local',
        },
      },
    }

Usage

Update the vim package.

    class { 'vim':
      package_ensure => 'latest',
    }

Remove the vim package.

    class { 'vim':
      package_ensure => 'absent',
    }

Purge the vim package (All configuration files will be removed).

    class { 'vim':
      package_ensure => 'purged',
    }

Deploy the configuration files from source directory.

    class { 'vim':
      config_dir_source => "puppet:///modules/vim/${::lsbdistcodename}/etc/vim",
    }

Deploy the configuration files from source directory (Unmanaged configuration files will be removed).

    class { 'vim':
      config_dir_purge  => true,
      config_dir_source => "puppet:///modules/vim/${::lsbdistcodename}/etc/vim",
    }

Deploy the configuration file from source.

    class { 'vim':
      config_file_source => "puppet:///modules/vim/${::lsbdistcodename}/etc/vim/vimrc",
    }

Deploy the configuration file from string.

    class { 'vim':
      config_file_string => '# THIS FILE IS MANAGED BY PUPPET',
    }

Deploy the configuration file from template.

    class { 'vim':
      config_file_template => "vim/${::lsbdistcodename}/etc/vim/vimrc.erb",
    }

Deploy the configuration file from custom template (Additional parameters can be defined).

    class { 'vim':
      config_file_template     => "vim/${::lsbdistcodename}/etc/vim/vimrc.erb",
      config_file_options_hash => {
        'key' => 'value',
      },
    }

Deploy additional configuration files from source, string or template.

    class { 'vim':
      config_file_hash => {
        'vim.2nd.conf' => {
          config_file_path   => '/etc/vim/vim.2nd.conf',
          config_file_source => "puppet:///modules/vim/${::lsbdistcodename}/etc/vim/vim.2nd.conf",
        },
        'vim.3rd.conf' => {
          config_file_path   => '/etc/vim/vim.3rd.conf',
          config_file_string => '# THIS FILE IS MANAGED BY PUPPET',
        },
        'vim.4th.conf' => {
          config_file_path     => '/etc/vim/vim.4th.conf',
          config_file_template => "vim/${::lsbdistcodename}/etc/vim/vim.4th.conf.erb",
        },
      },
    }

Reference

Classes

Public Classes

  • vim: Main class, includes all other classes.

Private Classes

  • vim::install: Handles the packages.
  • vim::config: Handles the configuration file.

Parameters

package_ensure

Determines if the package should be installed. Valid values are 'present', 'latest', 'absent' and 'purged'. Defaults to 'present'.

package_name

Determines the name of package to manage. Defaults to 'vim'.

package_list

Determines if additional packages should be managed. Defaults to 'undef'.

config_dir_ensure

Determines if the configuration directory should be present. Valid values are 'absent' and 'directory'. Defaults to 'directory'.

config_dir_path

Determines if the configuration directory should be managed. Defaults to '/etc/vim'

config_dir_purge

Determines if unmanaged configuration files should be removed. Valid values are 'true' and 'false'. Defaults to 'false'.

config_dir_recurse

Determines if the configuration directory should be recursively managed. Valid values are 'true' and 'false'. Defaults to 'true'.

config_dir_source

Determines the source of a configuration directory. Defaults to 'undef'.

config_file_ensure

Determines if the configuration file should be present. Valid values are 'absent' and 'present'. Defaults to 'present'.

config_file_path

Determines if the configuration file should be managed. Defaults to '/etc/vim/vimrc'

config_file_owner

Determines which user should own the configuration file. Defaults to 'root'.

config_file_group

Determines which group should own the configuration file. Defaults to 'root'.

config_file_mode

Determines the desired permissions mode of the configuration file. Defaults to '0644'.

config_file_source

Determines the source of a configuration file. Defaults to 'undef'.

config_file_string

Determines the content of a configuration file. Defaults to 'undef'.

config_file_template

Determines the content of a configuration file. Defaults to 'undef'.

config_file_require

Determines which package a configuration file depends on. Defaults to 'Package[vim]'.

config_file_hash

Determines which configuration files should be managed via vim::define. Defaults to '{}'.

config_file_options_hash

Determines which parameters should be passed to an ERB template. Defaults to '{}'.

background

Determines which color scheme for syntax highlighting should be used. Valid values are 'dark' and 'light'. Defaults to 'dark'.

default_editor

Determines if vim should be used as default editor. Valid values are 'true' and 'false'. Defaults to 'true'.

Limitations

This module has been tested on:

  • Debian 6/7/8
  • Ubuntu 12.04/14.04/16.04

Development

Bug Report

If you find a bug, have trouble following the documentation or have a question about this module - please create an issue.

Pull Request

If you are able to patch the bug or add the feature yourself - please make a pull request.

Contributors

The list of contributors can be found at: https://github.com/dhoppe/puppet-vim/graphs/contributors