Welcome! Log In Create A New Profile

Advanced

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

othree
March 03, 2017 05:58AM
# HG changeset patch
# User othree <othree@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
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH 1 of 4] Contrib: vim syntax, allow multiline config by skipempty

othree 706 March 03, 2017 05:58AM

[PATCH 3 of 4] Contrib: vim syntax, highlight HTTP status code

othree 345 March 03, 2017 05:58AM

[PATCH 2 of 4] Contrib: vim syntax, highlight rewrite flag

othree 321 March 03, 2017 05:58AM

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

othree 294 March 03, 2017 05:58AM

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

Maxim Dounin 288 March 03, 2017 09:06AM

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

OOO 339 March 03, 2017 10:40AM

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

Maxim Dounin 337 March 03, 2017 12:26PM

[PATCH] Contrib: vim syntax, support block region

othree 348 March 04, 2017 07:00AM

Re: [PATCH] Contrib: vim syntax, support block region

OOO 345 March 10, 2017 11:46AM

Re: [PATCH] Contrib: vim syntax, support block region

Maxim Dounin 320 March 10, 2017 11:54AM

Re: [PATCH] Contrib: vim syntax, support block region

OOO 293 March 10, 2017 11:58AM

Re: [PATCH] Contrib: vim syntax, support block region

OOO 290 April 19, 2017 05:54AM

Re: [PATCH] Contrib: vim syntax, support block region

Maxim Dounin 252 April 19, 2017 11:12AM

Re: [PATCH] Contrib: vim syntax, support block region

OOO 261 April 21, 2017 04:40AM

Re: [PATCH] Contrib: vim syntax, support block region

Maxim Dounin 329 April 21, 2017 09:48AM

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

OOO 354 March 04, 2017 07:20AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 207
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready