Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

vim: Improve function matching when functions contain ')'

This fixes #3017 (VIM syntax highlight for regsubst fails) by converting
puppetFunction from a simple keyword to a region.

Signed-off-by: Todd Zullinger <>
  • Loading branch information...
commit 530184dd5d15a7471adab73b525bdaabba9036ad 1 parent bb95f25
@tmzullinger tmzullinger authored jamtur01 committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 syntax/puppet.vim
6 syntax/puppet.vim
@@ -51,8 +51,10 @@ syn match puppetParamDigits "[0-9]\+"
" match 'template' in 'content => template("...")'
syn match puppetParam "\w\+\s*[=+]>\s*\w\+\s*(" contains=puppetFunction,puppetParamName
-syn keyword puppetFunction debug info notice warning err alert emerg crit
-syn keyword puppetFunction sprintf template fail tagged include generate search file tag versioncmp fqdn_rand realize split defined regsubst sha1 inline_template contained
+" statements
+syn region puppetFunction start="^\s*\(alert\|crit\|debug\|emerg\|err\|fail\|include\|info\|notice\|realize\|require\|search\|tag\|warning\)\s*(" end=")" contained contains=puppetString
+" rvalues
+syn region puppetFunction start="^\s*\(defined\|file\|fqdn_rand\|generate\|inline_template\|regsubst\|sha1\|shellquote\|split\|sprintf\|tagged\|template\|versioncmp\)\s*(" end=")" contained contains=puppetString
syn match puppetVariable "$\w\+"
syn match puppetVariable "${\w\+}"

0 comments on commit 530184d

Please sign in to comment.
Something went wrong with that request. Please try again.