[PATCH] Contrib: vim syntax, listen option and SSL/Mail protocol keywords

othree othree at gmail.com
Tue Feb 21 03:11:20 UTC 2017


# HG changeset patch
# User othree <othree at gmail.com>
# Date 1487646550 -28800
#      Tue Feb 21 11:09:10 2017 +0800
# Node ID 41224bb087061a246fe67aa4c0e123a1107ae4cf
# Parent  87cf6ddb41c216876d13cffa5e637a61b159362c
Contrib: vim syntax, listen option and SSL/Mail protocol keywords.

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
@@ -32,25 +32,44 @@ syn keyword ngxDirectiveBlock if        
 syn keyword ngxDirectiveBlock geo          contained
 syn keyword ngxDirectiveBlock map          contained
 syn keyword ngxDirectiveBlock split_clients contained
 
 syn keyword ngxDirectiveImportant include
 syn keyword ngxDirectiveImportant root
 syn keyword ngxDirectiveImportant server
 syn keyword ngxDirectiveImportant server_name
-syn keyword ngxDirectiveImportant listen
+syn keyword ngxDirectiveImportant listen contained
+syn region  ngxDirectiveImportantListen matchgroup=ngxDirectiveImportant start=/listen/ skip=/\\\;/ end=/;\zs/ contains=ngxListenOptions,ngxString
 syn keyword ngxDirectiveImportant internal
 syn keyword ngxDirectiveImportant proxy_pass
 syn keyword ngxDirectiveImportant memcached_pass
 syn keyword ngxDirectiveImportant fastcgi_pass
 syn keyword ngxDirectiveImportant scgi_pass
 syn keyword ngxDirectiveImportant uwsgi_pass
 syn keyword ngxDirectiveImportant try_files
 
+syn keyword ngxListenOptions default_server contained
+syn keyword ngxListenOptions ssl            contained
+syn keyword ngxListenOptions http2          contained
+syn keyword ngxListenOptions spdy           contained
+syn keyword ngxListenOptions proxy_protocol contained
+syn keyword ngxListenOptions setfib         contained
+syn keyword ngxListenOptions fastopen       contained
+syn keyword ngxListenOptions backlog        contained
+syn keyword ngxListenOptions rcvbuf         contained
+syn keyword ngxListenOptions sndbuf         contained
+syn keyword ngxListenOptions accept_filter  contained
+syn keyword ngxListenOptions deferred       contained
+syn keyword ngxListenOptions bind           contained
+syn keyword ngxListenOptions ipv6only       contained
+syn keyword ngxListenOptions reuseport      contained
+syn keyword ngxListenOptions so_keepalive   contained
+syn keyword ngxListenOptions keepidle       contained
+
 syn keyword ngxDirectiveControl break
 syn keyword ngxDirectiveControl return
 syn keyword ngxDirectiveControl rewrite
 syn keyword ngxDirectiveControl set
 
 syn keyword ngxDirectiveError error_page
 syn keyword ngxDirectiveError post_action
 
@@ -262,17 +281,18 @@ syn keyword ngxDirective perl_require
 syn keyword ngxDirective perl_set
 syn keyword ngxDirective pid
 syn keyword ngxDirective pop3_auth
 syn keyword ngxDirective pop3_capabilities
 syn keyword ngxDirective port_in_redirect
 syn keyword ngxDirective post_acceptex
 syn keyword ngxDirective postpone_gzipping
 syn keyword ngxDirective postpone_output
-syn keyword ngxDirective protocol
+syn keyword ngxDirective protocol nextgroup=ngxMailProtocol skipwhite
+syn keyword ngxMailProtocol imap pop3 smtp contained
 syn keyword ngxDirective proxy
 syn keyword ngxDirective proxy_bind
 syn keyword ngxDirective proxy_buffer
 syn keyword ngxDirective proxy_buffer_size
 syn keyword ngxDirective proxy_buffering
 syn keyword ngxDirective proxy_buffers
 syn keyword ngxDirective proxy_busy_buffers_size
 syn keyword ngxDirective proxy_cache
@@ -311,17 +331,17 @@ syn keyword ngxDirective proxy_read_time
 syn keyword ngxDirective proxy_redirect
 syn keyword ngxDirective proxy_send_lowat
 syn keyword ngxDirective proxy_send_timeout
 syn keyword ngxDirective proxy_set_body
 syn keyword ngxDirective proxy_set_header
 syn keyword ngxDirective proxy_ssl_ciphers
 syn keyword ngxDirective proxy_ssl_crl
 syn keyword ngxDirective proxy_ssl_name
-syn keyword ngxDirective proxy_ssl_protocols
+syn keyword ngxDirective proxy_ssl_protocols nextgroup=ngxSSLProtocol skipwhite
 syn keyword ngxDirective proxy_ssl_server_name
 syn keyword ngxDirective proxy_ssl_session_reuse
 syn keyword ngxDirective proxy_ssl_trusted_certificate
 syn keyword ngxDirective proxy_ssl_verify
 syn keyword ngxDirective proxy_ssl_verify_depth
 syn keyword ngxDirective proxy_store
 syn keyword ngxDirective proxy_store_access
 syn keyword ngxDirective proxy_temp_file_write_size
@@ -420,17 +440,18 @@ syn keyword ngxDirective ssl_certificate
 syn keyword ngxDirective ssl_ciphers
 syn keyword ngxDirective ssl_client_certificate
 syn keyword ngxDirective ssl_crl
 syn keyword ngxDirective ssl_dhparam
 syn keyword ngxDirective ssl_ecdh_curve
 syn keyword ngxDirective ssl_engine
 syn keyword ngxDirective ssl_password_file
 syn keyword ngxDirective ssl_prefer_server_ciphers
-syn keyword ngxDirective ssl_protocols
+syn keyword ngxDirective ssl_protocols nextgroup=ngxSSLProtocol skipwhite
+syn keyword ngxSSLProtocol SSLv2 SSLv3 TLSv1 TLSv1.1 TLSv1.2 contained nextgroup=ngxSSLProtocol skipwhite
 syn keyword ngxDirective ssl_session_cache
 syn keyword ngxDirective ssl_session_ticket_key
 syn keyword ngxDirective ssl_session_tickets
 syn keyword ngxDirective ssl_session_timeout
 syn keyword ngxDirective ssl_stapling
 syn keyword ngxDirective ssl_stapling_file
 syn keyword ngxDirective ssl_stapling_responder
 syn keyword ngxDirective ssl_stapling_verify
@@ -495,17 +516,17 @@ syn keyword ngxDirective uwsgi_param
 syn keyword ngxDirective uwsgi_pass_header
 syn keyword ngxDirective uwsgi_pass_request_body
 syn keyword ngxDirective uwsgi_pass_request_headers
 syn keyword ngxDirective uwsgi_read_timeout
 syn keyword ngxDirective uwsgi_send_timeout
 syn keyword ngxDirective uwsgi_ssl_ciphers
 syn keyword ngxDirective uwsgi_ssl_crl
 syn keyword ngxDirective uwsgi_ssl_name
-syn keyword ngxDirective uwsgi_ssl_protocols
+syn keyword ngxDirective uwsgi_ssl_protocols nextgroup=ngxSSLProtocol skipwhite
 syn keyword ngxDirective uwsgi_ssl_server_name
 syn keyword ngxDirective uwsgi_ssl_session_reuse
 syn keyword ngxDirective uwsgi_ssl_trusted_certificate
 syn keyword ngxDirective uwsgi_ssl_verify
 syn keyword ngxDirective uwsgi_ssl_verify_depth
 syn keyword ngxDirective uwsgi_store
 syn keyword ngxDirective uwsgi_store_access
 syn keyword ngxDirective uwsgi_string
@@ -828,9 +849,13 @@ hi link ngxBoolean Boolean
 hi link ngxDirectiveBlock Statement
 hi link ngxDirectiveImportant Type
 hi link ngxDirectiveControl Keyword
 hi link ngxDirectiveError Constant
 hi link ngxDirectiveDeprecated Error
 hi link ngxDirective Identifier
 hi link ngxDirectiveThirdParty Special
 
+hi link ngxListenOptions Keyword
+hi link ngxMailProtocol Keyword
+hi link ngxSSLProtocol Keyword
+
 let b:current_syntax = "nginx"


More information about the nginx-devel mailing list