| Puppet and ctags |
[Feb. 11th, 2008|09:01 pm] |
Whilst finding my way around puppet, I realised that some of the tools I'm used to when developing in other languages weren't quite there.
A quick read through the ctags documentation and I knocked up a couple of simple regular expressions that enable me to quick navigate through a large, split out puppet configuration using vim. Adding the following to ~/.ctags will enable you to run ctags -R at the top of your puppet manifests and navigate through tags. I'll probably need to actually go through the language definition and ctags docs some more to provide more comprehensive functionality but this works for me right now so I wanted to share it.
--langdef=puppet
--langmap=puppet:.pp
--regex-puppet=/^class[ \t]*([:a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
--regex-puppet=/^site[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
--regex-puppet=/^node[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
--regex-puppet=/^define[ \t]*([:a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
|
|
|