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

Maxim Dounin mdounin at mdounin.ru
Mon Feb 20 16:59:10 UTC 2017


Hello!

On Tue, Feb 21, 2017 at 12:10:22AM +0800, othree wrote:

> # HG changeset patch
> # User othree <othree at gmail.com>
> # Date 1487606986 -28800
> #      Tue Feb 21 00:09:46 2017 +0800
> # Node ID 86edcdd053d07055b4773d144ddf78edea60af79
> # Parent  87cf6ddb41c216876d13cffa5e637a61b159362c
> [PATCH] Contrib: vim-syntax, add listen option and SSL/Mail protocol keywords

The '[PATCH]' here is certainly not needed.
More minor nits: summary line too long, and doesn't end with dot.
Suggested variant:

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,43 @@ 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/ end=/;\zs/ contains=ngxListenOptions 

Note that this breaks on the following valid listen directives:

listen "unix:/tmp/foo;bar";
listen 'unix:/tmp/foo;bar';
listen unix:/tmp/foo\;bar;

>  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 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

The "default_server" parameter missing.

-- 
Maxim Dounin
http://nginx.org/


More information about the nginx-devel mailing list