Forge Home

vim

Manage VIM via puppet.

12,709 downloads

9,373 latest version

4.6 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

  • 3.0.4 (latest)
  • 3.0.3
  • 3.0.2
  • 3.0.1
  • 3.0.0
  • 2.3.7
  • 2.3.6
  • 2.3.5
  • 2.3.4
  • 2.3.3
released Jun 26th 2015
This version is compatible with:
  • ArchLinux, CentOS, Debian, FreeBSD, Gentoo, OracleLinux, RedHat, Suse, Ubuntu

Start using this module

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

Add this module to your Puppetfile:

mod 'zanloy-vim', '3.0.4'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install zanloy-vim --version 3.0.4

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

Documentation

zanloy/vim — version 3.0.4 Jun 26th 2015

puppet-vim

Build Status

Manage VIM via puppet.

Vim is an advanced text editor that seeks to provide the power of the de-facto Unix editor 'Vi', with a more complete feature set.

Sample Usage

Install VIM and use the provided configuration defaults

class { 'vim': }

Turn on line numbering

class { 'vim':
  opt_misc => ['number'],
}

Set F5 key to save and execute current file

class { 'vim':
  opt_maps => { '<F5>': '<Esc>:w<CR>:!%:p<CR>' },
}

Install pathogen for user 'johndoe'

vim::pathogen { 'johndoe': }

Install a plugin for user 'johndoe'. Using vim-commentary as an example. Be sure to install pathogen or the plugins won't load in vim for that user.

vim::plugin { 'vim-commentary': url => 'https://github.com/tpope/vim-commentary.git' }

Install a bundle of plugins recommended by this module's author. This will install pathogen for the user so defining it will not be necessary.

vim::bundle { 'johndoe': }

Note: The bundle installs vim-airline which is a statusline replacement. By default it tries to use some special characters to make it pretty. I initially had issues with getting these to work. Read this wiki for answers on why you don't have colors or special symbols.

Change colorscheme for user johndoe to grb256 (installed with bundle)

vim::config { 'colorscheme':
  user    => 'johndoe',
  content => 'colorscheme grb256',
}

Uninstall vim

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

Class parameters

  • set_as_default

    • Accepted values: true or false
    • Default: true
    • Description: Set VIM as default editor.
  • ensure

    • Accepted values: present or absent
    • Default: present
    • Description: Whether or not VIM will be installed
  • autoupgrade

    • Accepted values: true or false
    • Default: false
    • Description: Whether or not the VIM package should be automatically kept up-to-date using the distribution's packaging system
  • set_editor_cmd

    • Accepted values: string
    • Default: update-alternatives --set editor /usr/bin/${editor_name} (Debian)
    • Description: The command used to set VIM as the default editor. Be careful if you're setting this parameter.
  • test_editor_set

    • Accepted values: string
    • Default: test /etc/alternatives/editor -ef /usr/bin/${editor_name} (Debian)
    • Description: Command used to verify that VIM is the default editor. Be careful if you're setting this parameter.
  • conf_file

    • Accepted values: string
    • Default: /etc/vim/vimrc (Debian), /etc/vimrc (RedHat)
    • Description: Path to VIM's main configuration file.
  • opt_bg_shading

    • Accepted values: dark or light
    • Default: dark
    • Description: Terminal background colour. This affects the colour scheme used by VIM to do syntax highlighting.
  • opt_indent

    • Accepted values: true or false
    • Default: true
    • Description: If true, Vim loads indentation rules and plugins according to the detected filetype.
  • opt_lastposition

    • Accepted values: true or false
    • Default: true
    • Description: If true, Vim jumps to the last known position when reopening a file.
  • opt_powersave

    • Accepted values: true or false
    • Default: true
    • Description: If set to 'true' avoids cursor blinking that might wake up the processor.
  • opt_syntax

    • Accepted values: true or false
    • Default: true
    • Description: Turns on syntax highlighting if supported by the terminal.
  • opt_misc

    • Accepted values: array
    • Default: []
    • Description: Array containing options that will be set on VIM. Anything contained here will show as a "set option" line in your vimrc.
  • opt_maps

    • Accepted values: hash
    • Default: {}
    • Description: Hash containing keybinds for use in "map " lines in your vimrc.

Acknowlegments

This module was forked from the one originally written by Saz. It adds enterprise linux support and configuration file management, which were not present.