summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2016-05-02 10:48:28 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2016-05-02 10:48:28 +0200
commit5529a5e8e21e4577e4cd3551f2cbad59b5b406e8 (patch)
tree6bcc43dba19fc5e68abc8831ae778ba076e5004b
parent905031eb9536adb38d793c1ced6d61057d3ca456 (diff)
downloadvim-polyglot-5529a5e8e21e4577e4cd3551f2cbad59b5b406e8.tar.gz
vim-polyglot-5529a5e8e21e4577e4cd3551f2cbad59b5b406e8.zip
Update vim-puppet source to voxpupuli/vim-puppet, closes #115
-rw-r--r--README.md2
-rwxr-xr-xbuild2
-rw-r--r--ftplugin/puppet.vim1
-rw-r--r--indent/puppet.vim6
-rw-r--r--syntax/puppet.vim17
5 files changed, 13 insertions, 15 deletions
diff --git a/README.md b/README.md
index 1d4ba3f4..7203d13e 100644
--- a/README.md
+++ b/README.md
@@ -78,7 +78,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
- [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect)
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect)
-- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, ftplugin, ftdetect)
+- [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin, ftdetect)
- [python](https://github.com/mitsuhiko/vim-python-combined) (syntax, indent)
- [qml](https://github.com/peterhoeg/vim-qml) (syntax, indent, ftplugin, ftdetect)
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
diff --git a/build b/build
index 83019237..3865927a 100755
--- a/build
+++ b/build
@@ -149,7 +149,7 @@ PACKS="
php:StanAngeloff/php.vim
powershell:Persistent13/vim-ps1
protobuf:uarun/vim-protobuf
- puppet:rodjek/vim-puppet
+ puppet:voxpupuli/vim-puppet
python:mitsuhiko/vim-python-combined
qml:peterhoeg/vim-qml
r-lang:vim-scripts/R.vim
diff --git a/ftplugin/puppet.vim b/ftplugin/puppet.vim
index ff0de3dc..d52f6b2d 100644
--- a/ftplugin/puppet.vim
+++ b/ftplugin/puppet.vim
@@ -6,5 +6,6 @@ setl sw=2
setl et
setl keywordprg=puppet\ describe\ --providers
setl iskeyword=-,:,@,48-57,_,192-255
+setl cms=#\ %s
endif
diff --git a/indent/puppet.vim b/indent/puppet.vim
index e9b08447..d947b7f6 100644
--- a/indent/puppet.vim
+++ b/indent/puppet.vim
@@ -53,11 +53,7 @@ function! GetPuppetIndent()
let pline = getline(pnum)
let ind = indent(pnum)
- if pline =~ '^\s*#'
- return ind
- endif
-
- if pline =~ '\({\|\[\|(\|:\)$'
+ if pline =~ '\({\|\[\|(\|:\)\s*\(#.*\)\?$'
let ind += &sw
elseif pline =~ ';$' && pline !~ '[^:]\+:.*[=+]>.*'
let ind -= &sw
diff --git a/syntax/puppet.vim b/syntax/puppet.vim
index d38e297e..b7ce2d9d 100644
--- a/syntax/puppet.vim
+++ b/syntax/puppet.vim
@@ -18,16 +18,17 @@ elseif exists("b:current_syntax")
finish
endif
-" match class/definition/node declarations
-syn region puppetDefine start="^\s*\(class\|define\|node\)\s" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments,puppetNodeRe,@NoSpell
-syn keyword puppetDefType class define node inherits contained
-syn region puppetDefArguments start="(" end=")" contained contains=puppetArgument,puppetString,puppetComment,puppetMultilineComment
+" match class/definition/node declarations/application
+syn region puppetDefine start="^\s*\(class\|define\|node\|application\)\s" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments,puppetNodeRe,@NoSpell
+syn keyword puppetDefType class define node inherits application contained
+syn region puppetDefArguments start="(" end=")" contained contains=puppetArgument,puppetString,puppetComment,puppetMultilineComment,puppetDataTypes
syn match puppetArgument "\w\+" contained
syn match puppetArgument "\$\w\+" contained
syn match puppetArgument "'[^']+'" contained
syn match puppetArgument '"[^"]+"' contained
syn match puppetDefName "\w\+" contained
syn match puppetNodeRe "/.*/" contained
+syn keyword puppetDataTypes String Integer Float Numeric Boolean Array Hash Regexp Undef Default Resource Class Scalar Collection Variant Data Pattern Enum Tuple Struct Optional Catalogentry Type Any Callable
" match 'foo' in 'class foo { ...'
" match 'foo::bar' in 'class foo::bar { ...'
@@ -42,7 +43,7 @@ syn match puppetTypeDefault "[A-Z]\w*" contained
syn match puppetParam "\w\+\s*\(=\|+\)>" contains=puppetTypeRArrow,puppetParamName
syn match puppetParamRArrow "\(=\|+\)>" contained
syn match puppetParamName "\w\+" contained contains=@NoSpell
-syn match puppetVariable "$\(\(\(::\)\?\w\+\)\+\|{\(\(::\)\?\w\+\)\+}\)"
+syn match puppetVariable "$\(\(::\)\?\w\+\|{\(::\)\?\w\+}\)"
syn match puppetParen "("
syn match puppetParen ")"
syn match puppetBrace "{"
@@ -57,7 +58,7 @@ syn match puppetBrack "|>"
" don't match 'bar' in 'foo => bar'
syn match puppetParam "\w\+\s*[=+]>\s*[a-z0-9]\+" contains=puppetParamString,puppetParamName
syn match puppetParamString "[=+]>\s*\w\+" contains=puppetParamKeyword,puppetParamSpecial,puppetParamDigits contained
-syn keyword puppetParamKeyword present absent purged latest installed running stopped mounted unmounted role configured file directory link contained
+syn keyword puppetParamKeyword present absent purged latest installed running stopped mounted unmounted role configured file directory link on_failure contained
syn keyword puppetParamSpecial true false undef contained
syn match puppetParamDigits "[0-9]\+"
@@ -78,8 +79,8 @@ syn region puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=pupp
syn match puppetNotVariable "\\$\w\+" contained
syn match puppetNotVariable "\\${\w\+}" contained
-syn keyword puppetKeyword import inherits include require contains
-syn keyword puppetControl case default if else elsif
+syn keyword puppetKeyword import inherits include require contain produces
+syn keyword puppetControl case default if else elsif unless
syn keyword puppetSpecial true false undef
syn match puppetClass "[A-Za-z0-9_-]\+\(::[A-Za-z0-9_-]\+\)\+" contains=@NoSpell