Skip to content

Instantly share code, notes, and snippets.

@tclh123
Forked from trlinkin/ctags
Last active August 29, 2015 14:09
Show Gist options
  • Save tclh123/538e74512784caf892a2 to your computer and use it in GitHub Desktop.
Save tclh123/538e74512784caf892a2 to your computer and use it in GitHub Desktop.
--- In your ~/.ctags
--langdef=puppet
--langmap=puppet:.pp
--regex-puppet=/^import[ \t]*[\'\"]?([\.a-zA-Z0-9_\-]+)[\'\"]?[ \t]*/\1/i,import/
--regex-puppet=/^class[ \t]*([:a-zA-Z0-9_\-]+)[ \t]*/\1/c,class/
--regex-puppet=/^site[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/s,site/
--regex-puppet=/^node[ \t]*[\'\"]?([\.a-zA-Z0-9_\-]+)[\'\"]?[ \t]*/\1/n,node/
--regex-puppet=/^define[ \t]*([:a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
--regex-puppet=/^[ \t]*\$([\.a-zA-Z0-9_\-]+)[ \t]*=.*/\1/v,variable/
--regex-puppet=/^ *([a-zA-Zi:_]+) *{ *(.*) *:/\1[\2]/r,resource/
--regex-puppet=/^ *([A-Z][a-zA-Z0-9_:]+) *{/\1/f,default/
--- In your ~/.vimrc
let g:tagbar_type_puppet = {
\ 'ctagstype': 'puppet',
\ 'kinds': [
\'i:import',
\'c:class',
\'s:site',
\'n:node',
\'d:definition',
\'v:variable',
\'r:resource',
\'f:default'
\]
\}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment