Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >=7.0.0 <9.0.0
- OracleLinux, Scientific, , , Gentoo, FreeBSD, Solaris , ,
Start using this module
Add this module to your Puppetfile:
mod 'saz-vim', '3.1.0'
Learn more about managing modules with a PuppetfileDocumentation
puppet-vim
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.
This module aims to enable easy installation and configuration of VIM through class parameters on different platforms, in a way that the administrator can easily set it up differently according to need and/or personal taste.
Usage
class { 'vim': }
Class parameters
set_as_default
- Set VIM as default editor (default:true
).ensure
- Whether or not VIM will be installed (default:present
).autoupgrade
- Whether or not the VIM package should be automatically kept up-to-date using the distribution's packaging system (default:false
).set_editor_cmd
- The command used to set VIM as the default editor. Be careful if you're setting this parameter (default:update-alternatives --set editor /usr/bin/${editor_name}
for Debian)test_editor_set
- Command used to verify that VIM is the default editor. Be careful if you're setting this parameter (default:test /etc/alternatives/editor -ef /usr/bin/${editor_name
for Debian)conf_file
- Path to VIM's main configuration file (default:/etc/vim/vimrc
(Debian),/etc/vimrc
(RedHat))opt_nocompatible
- Iftrue
,"set nocompatible"
is added to the top of the vimrc.opt_backspace
- Set the behavior of the backspace key in insert mode (default:2
).opt_bg_shading
- Terminal background colour. This affects the colour scheme used by VIM to do syntax highlighting. Accepted values: dark or light (default:dark
)opt_indent
- If true, Vim loads indentation rules and plugins according to the detected filetype (default:true
).opt_lastposition
Iftrue
, Vim jumps to the last known position when reopening a file (default:true
).opt_matchparen
- Iftrue
and syntax is on, putting your cursor on a paren/brace/bracket will highlight its pair (default:true
).opt_powersave
- If set to 'true' avoids cursor blinking that might wake up the processor (default:true
).opt_ruler
- Turns on the ruler (default:false
).opt_syntax
- Turns on syntax highlighting if supported by the terminal (default:false
).opt_misc
- Array containing options that will be set on VIM. Anything contained here will show as a "set option" line in your vimrc (default:['hlsearch','showcmd','showmatch','ignorecase','smartcase','incsearch','autowrite','hidden']
).opt_maps
- Hash containing keybinds for use in "map " lines in your vimrc (default:{}
).opt_code
- Array containing custom lines in your vimrc (default:[]
).
Sample Usage
Install VIM and use the provided configuration defaults
node default {
class { 'vim': }
}
Turn on line numbering while keeping the default opt_misc values
node default {
class { 'vim':
opt_misc => ['hlsearch','showcmd','showmatch','ignorecase','smartcase','incsearch','autowrite','hidden','number'],
}
}
Set F5 key to save and execute current file
node default {
class { 'vim':
opt_maps => { '<F5>': '<Esc>:w<CR>:!%:p<CR>' },
}
}
Uninstall vim
node default {
class { 'vim':
ensure => absent,
}
}
Acknowlegments
This module was forked from the one originally written by Saz (https://github.com/saz/puppet-vim). It adds enterprise linux support and configuration file management, which were not present on the original at the time of the first release.
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[3.1.0]
Fixed
- Replace legacy facts with structured facts, thanks @maxadamo! (#34)
[3.0.0]
Added
- Add Ubuntu 24.04 as supported OS (#28)
- Add Debian 12 as supported OS (#28)
Changed
- Allow stdlib < 10 (#27)
Removed
- BREAKING CHANGE: drop Puppet 6 support (#26)
- BREAKING CHANGE: drop Ubuntu 18.04 and Debian 9 support (#28)
[2.8.0]
Added
- Added tests (#21)
- Support Puppet 7
- Puppet types added (#22)
- Archlinux support added (#18)
- Added CHANGELOG
Changed
- Improved README for readability (#23)
Fixed
- Config file must require Package (#20)
- Renamed FreeBSD package (#17)
Removed
- Support for Puppet < 6
Dependencies
- puppetlabs/stdlib (>= 4.13.0 < 10.0.0)