The plugin is based on the recent vim-plugin distributed with nginx-1.12.0
and additionally features the following syntax improvements:
- Highlight IPv4 and IPv6 addresses
- Mark insecure
ssl_protocols
as errors - Inline template syntax highlight for ERB and Jinja
- Inline syntax highlight for LUA
- Improve integer matching
- Syntax highlighting for
proxy_next_upstream
options - Syntax highlighting for
sticky
options - Syntax highlighting for
upstream
server
options - More to come!
Furthermore:
- Remove annoying delimiters, resulting in strange word-boundaries
A server
block with highlighting of insecure ssl_protocol
options:
An upstream
block with highlighted options:
Embedded highlighting for ERB and Jinja templates:
Embedded LUA syntax highlighting:
The plugin comes with useful snippets which can be accessed using e.g. vim-snipmate.
Select a decent cipher for your requirements (all of them can provide SSLLabs A+ ratings)
ciphers-high<tab>
: High-security ciphers (elliptic curves), not compatible with IE < 11, OpenSSL-0.9.8, Safari < 7, Android < 4.4ciphers-medium<tab>
: Medium-security ciphers with good compatibility (No IE6, IE8) but TLSv1 and SHA requiredciphers-low<tab>
: Low-security ciphers (using weak 3DES cipher and TLSv1), but compatible with everything but IE6 and Java6ssl-options<tab>
: Bootstrap secure SSL options
Example:
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS';
Or add a robots.txt file with robots.txt<tab>
:
# Tell bots to not index this site
location /robots.txt {
default_type text/plain;
return 200 'User-agent: *\nDisallow: /\n';
}
It also has auto-completion for location and server blocks with location<tab>
resp. server<tab>
, and many more!
- Add useful snippets
- Based on the original
nginx-1.12.0/contrib/vim
- IPv4 and IPv6 address highlighting, based on expressions found in this forum post
- Blog post introducing this plugin including some more examples
NeoBundle 'chr4/nginx.vim'
" Optionally, if you like Jinja template syntax highlighting
NeoBundle 'lepture/vim-jinja'
Plugin 'chr4/nginx.vim'
" Optionally, if you like Jinja template syntax highlighting
Plugin 'lepture/vim-jinja'
git clone https://github.com/chr4/nginx.vim.git bundle/nginx.vim
# Optionally, if you like Jinja template syntax highlighting
git clone https://github.com/lepture/vim-jinja.git bundle/vim-jinja
Copyright (c) Chris Aumann. Distributed under the same terms as Vim itself. See :help license.