Home > Puppet > Vim and Puppet

Vim and Puppet

The dreamer and the wine
Poet without a rhyme
A widow writer torn apart by chains of Hell
(Nightwish – The poet and the pendulum)

One nice thing about vim is ability to extend it with additional plugins. So I’ve stumbled across nice plugin for syntax and code styling checking tools. As I know I’ll be doing lots of my time editing puppet code, I guess I really need this.
For this magic to work, workstation has to have some tools installed:

# yum install puppet rubygem-puppet-lint

Now let’s do some vim magic:

$ mkdir -p ~/.vim/bundle ~/.vim/autoload
$ cd /tmp
$ git clone https://github.com/tpope/vim-pathogen
$ mv vim-pathogen/autoload/pathogen.vim ~/.vim/autoload/
$ cd ~/.vim/bundle
$ git clone https://github.com/scrooloose/syntastic.git

Also you have to have this lines in your .vimrc:

call pathogen#infect()
filetype indent on

And that’s about it!

Now, when you make a code style error for example, vim will detect it and inform you of it!

Vim reporting synthax violations

Advertisements
Categories: Puppet Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: