summaryrefslogtreecommitdiffstats
path: root/syntax/nginx.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2017-05-17 11:07:28 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2017-05-17 11:07:28 +0200
commitaf870100716f20ee4daef9cc527a9ecf41b54114 (patch)
tree0859464c3145682cbfc29ad08de4527dd661abf7 /syntax/nginx.vim
parentef369d45a505403587ea0bae30ce6768ba51398c (diff)
downloadvim-polyglot-af870100716f20ee4daef9cc527a9ecf41b54114.tar.gz
vim-polyglot-af870100716f20ee4daef9cc527a9ecf41b54114.zip
Update
Diffstat (limited to 'syntax/nginx.vim')
-rw-r--r--syntax/nginx.vim41
1 files changed, 28 insertions, 13 deletions
diff --git a/syntax/nginx.vim b/syntax/nginx.vim
index e20d49ef..1c55bd41 100644
--- a/syntax/nginx.vim
+++ b/syntax/nginx.vim
@@ -10,9 +10,9 @@ end
" Patch 7.4.1142
if has("patch-7.4-1142")
if has("win32")
- syn iskeyword @,48-57,_,128-167,224-235,.,/,:
+ syn iskeyword @,48-57,_,128-167,224-235,.,/,:,-
else
- syn iskeyword @,48-57,_,192-255,.,/,:
+ syn iskeyword @,48-57,_,192-255,.,/,:,-
endif
endif
@@ -25,6 +25,11 @@ syn region ngxString start=+[^:a-zA-Z>!\\@]\z(["']\)+lc=1 end=+\z1+ skip=+\\\\\|
syn keyword ngxBoolean on
syn keyword ngxBoolean off
+" Number and Measures http://nginx.org/en/docs/syntax.html
+syn match ngxNumber '\<\d\+\>'
+syn match ngxMeasure '\<\d\+ms\>'
+syn match ngxMeasure '\<\d\+[smhdwMy]\>'
+syn match ngxMeasure '\<\d\+[kKmMgG]\>'
syn keyword ngxDirectiveBlock http
syn keyword ngxDirectiveBlock mail
@@ -48,7 +53,7 @@ syn keyword ngxDirectiveImportant root
syn keyword ngxDirectiveImportant server
syn keyword ngxDirectiveImportant server_name
syn keyword ngxDirectiveImportant listen contained
-syn region ngxDirectiveImportantListen matchgroup=ngxDirectiveImportant start=+listen+ skip=+\\\\\|\\\;+ end=+;+he=e-1 contains=ngxListenOptions,ngxString
+syn region ngxDirectiveImportantListen matchgroup=ngxDirectiveImportant start=+listen+ skip=+\\\\\|\\\;+ end=+;+he=e-1 contains=ngxListenOptions,ngxNumber,ngxString
syn keyword ngxDirectiveImportant internal
syn keyword ngxDirectiveImportant proxy_pass
syn keyword ngxDirectiveImportant memcached_pass
@@ -84,9 +89,9 @@ syn match ngxStatusCode /\d\d\d/ contained
syn match ngxStatusCodes /\d\d\d/ contained contains=ngxStatusCode nextgroup=ngxStatusCode skipwhite skipempty
syn match ngxRewriteURI /\S\+/ contained contains=ngxVariableString nextgroup=ngxRewritedURI skipwhite skipempty
-syn region ngxRewriteURI start=+[^:a-zA-Z>!\\@]\z(["']\)+lc=1 end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString nextgroup=ngxRewritedURI skipwhite skipempty
+syn region ngxRewriteURI start=+[^:a-zA-Z>!\\@]\z(["']\)+lc=1 end=+\z1+ skip=+\\\\\|\\\z1+ contained contains=ngxVariableString nextgroup=ngxRewritedURI skipwhite skipempty
syn match ngxRewritedURI /\S\+/ contained contains=ngxVariableString nextgroup=ngxRewriteFlag skipwhite skipempty
-syn region ngxRewritedURI start=+[^:a-zA-Z>!\\@]\z(["']\)+lc=1 end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString nextgroup=ngxRewriteFlag skipwhite skipempty
+syn region ngxRewritedURI start=+[^:a-zA-Z>!\\@]\z(["']\)+lc=1 end=+\z1+ skip=+\\\\\|\\\z1+ contained contains=ngxVariableString nextgroup=ngxRewriteFlag skipwhite skipempty
syn keyword ngxRewriteFlag last contained
syn keyword ngxRewriteFlag break contained
@@ -137,7 +142,10 @@ syn keyword ngxDirective autoindex
syn keyword ngxDirective autoindex_exact_size
syn keyword ngxDirective autoindex_format
syn keyword ngxDirective autoindex_localtime
-syn keyword ngxDirective charset
+syn keyword ngxDirective charset nextgroup=ngxCharset skipwhite skipempty
+
+syn keyword ngxCharset utf-8 UTF-8
+
syn keyword ngxDirective charset_map
syn keyword ngxDirective charset_types
syn keyword ngxDirective chunked_transfer_encoding
@@ -2189,27 +2197,34 @@ syn keyword ngxDirectiveThirdParty xss_input_types
" highlight
hi link ngxComment Comment
-hi link ngxVariable Identifier
+hi link ngxVariable PreProc
hi link ngxVariableString PreProc
hi link ngxString String
hi link ngxLocationPath String
-hi link ngxLocationNamedLoc Identifier
+hi link ngxLocationNamedLoc PreProc
-hi link ngxBoolean Boolean
-hi link ngxStatusCode Number
-hi link ngxRewriteFlag Boolean
+hi link ngxDirective Identifier
hi link ngxDirectiveBlock Statement
hi link ngxDirectiveImportant Type
hi link ngxDirectiveControl Keyword
hi link ngxDirectiveError Constant
+hi link ngxDirectiveThirdParty Identifier
hi link ngxDirectiveDeprecated Error
-hi link ngxDirective Identifier
-hi link ngxDirectiveThirdParty Special
+hi link ngxBoolean Boolean
+hi link ngxNumber Number
+hi link ngxMeasure Number
+hi link ngxStatusCode Number
+hi link ngxRewriteFlag Boolean
+
+hi link ngxCharset keyword
hi link ngxListenOptions Keyword
hi link ngxMailProtocol Keyword
hi link ngxSSLProtocol Keyword
+hi link ngxRewriteURI Special
+hi link ngxRewritedURI StorageClass
+
hi link ngxThirdPartyKeyword keyword
let b:current_syntax = "nginx"