[PATCH 4 of 4] Contrib: vim syntax, remove unecessary ngxBlock

othree othree at gmail.com
Fri Mar 3 10:56:59 UTC 2017


# HG changeset patch
# User othree <othree at gmail.com>
# Date 1488538568 -28800
#      Fri Mar 03 18:56:08 2017 +0800
# Node ID 433844daf574dbf89390e574201b3db417337cdd
# Parent  b88ed85b7b4f3ea5a586f4f58251481348c502f1
Contrib: vim syntax, remove unecessary ngxBlock.

ngxBlock breaks highlighting for the following conf:

    rewrite "^/[0-9a-z]{40}/(.*)" /$1/ last;

diff --git a/contrib/vim/syntax/nginx.vim b/contrib/vim/syntax/nginx.vim
--- a/contrib/vim/syntax/nginx.vim
+++ b/contrib/vim/syntax/nginx.vim
@@ -7,36 +7,35 @@ end
 
 setlocal iskeyword+=.
 setlocal iskeyword+=/
 setlocal iskeyword+=:
 
 syn match ngxVariable '\$\(\w\+\|{\w\+}\)'
 syn match ngxVariableBlock '\$\(\w\+\|{\w\+}\)' contained
 syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained
-syn region ngxBlock start=+^+ end=+{+ skip=+\${+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline
 syn region ngxString start=+[^:a-zA-Z>!\\@]\z(["']\)+lc=1 end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString
 syn match ngxComment ' *#.*$'
 
 syn keyword ngxBoolean on
 syn keyword ngxBoolean off
 
-syn keyword ngxDirectiveBlock http         contained
-syn keyword ngxDirectiveBlock mail         contained
-syn keyword ngxDirectiveBlock events       contained
-syn keyword ngxDirectiveBlock server       contained
-syn keyword ngxDirectiveBlock types        contained
-syn keyword ngxDirectiveBlock location     contained
-syn keyword ngxDirectiveBlock upstream     contained
-syn keyword ngxDirectiveBlock charset_map  contained
-syn keyword ngxDirectiveBlock limit_except contained
-syn keyword ngxDirectiveBlock if           contained
-syn keyword ngxDirectiveBlock geo          contained
-syn keyword ngxDirectiveBlock map          contained
-syn keyword ngxDirectiveBlock split_clients contained
+syn keyword ngxDirectiveBlock http
+syn keyword ngxDirectiveBlock mail
+syn keyword ngxDirectiveBlock events
+syn keyword ngxDirectiveBlock server
+syn keyword ngxDirectiveBlock types
+syn keyword ngxDirectiveBlock location
+syn keyword ngxDirectiveBlock upstream
+syn keyword ngxDirectiveBlock charset_map
+syn keyword ngxDirectiveBlock limit_except
+syn keyword ngxDirectiveBlock if
+syn keyword ngxDirectiveBlock geo
+syn keyword ngxDirectiveBlock map
+syn keyword ngxDirectiveBlock split_clients
 
 syn keyword ngxDirectiveImportant include
 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 keyword ngxDirectiveImportant internal
@@ -2134,17 +2133,16 @@ syn keyword ngxDirectiveThirdParty xss_i
 
 
 " highlight
 
 hi link ngxComment Comment
 hi link ngxVariable Identifier
 hi link ngxVariableBlock Identifier
 hi link ngxVariableString PreProc
-hi link ngxBlock Normal
 hi link ngxString String
 
 hi link ngxBoolean Boolean
 hi link ngxStatusCode Number
 hi link ngxRewriteFlag Boolean
 hi link ngxDirectiveBlock Statement
 hi link ngxDirectiveImportant Type
 hi link ngxDirectiveControl Keyword


More information about the nginx-devel mailing list