summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--README.md2
-rw-r--r--after/syntax/cpp.vim1475
-rw-r--r--autoload/dart.vim24
-rw-r--r--autoload/elixir/indent.vim212
-rw-r--r--autoload/elixir/util.vim56
-rw-r--r--autoload/htmlcomplete.vim1404
-rw-r--r--autoload/rubycomplete.vim2
-rw-r--r--autoload/rustfmt.vim43
-rw-r--r--autoload/xml/html5.vim22
-rw-r--r--compiler/cargo.vim53
-rw-r--r--compiler/rustc.vim12
-rw-r--r--extras/flow.vim3
-rw-r--r--extras/jsdoc.vim2
-rw-r--r--ftdetect/polyglot.vim7
-rw-r--r--ftplugin/ansible.vim1
-rw-r--r--ftplugin/eelixir.vim17
-rw-r--r--ftplugin/rust.vim26
-rw-r--r--indent/clojure.vim4
-rw-r--r--indent/dart.vim26
-rw-r--r--indent/elixir.vim224
-rw-r--r--indent/gohtmltmpl.vim4
-rw-r--r--indent/haskell.vim24
-rw-r--r--indent/html.vim41
-rw-r--r--indent/javascript.vim338
-rw-r--r--indent/plantuml.vim59
-rw-r--r--indent/ruby.vim6
-rw-r--r--syntax/blade.vim11
-rw-r--r--syntax/c.vim53
-rw-r--r--syntax/coffee.vim4
-rw-r--r--syntax/cpp.vim64
-rw-r--r--syntax/elixir.vim111
-rw-r--r--syntax/glsl.vim2
-rw-r--r--syntax/go.vim19
-rw-r--r--syntax/haskell.vim16
-rw-r--r--syntax/html.vim60
-rw-r--r--syntax/jasmine.vim7
-rw-r--r--syntax/javascript.vim121
-rw-r--r--syntax/layout/footer.vim25
-rw-r--r--syntax/layout/header.vim566
-rw-r--r--syntax/lua.vim155
-rw-r--r--syntax/modules/accept-language.vim8
-rw-r--r--syntax/modules/access-key.vim11
-rw-r--r--syntax/modules/afcgi.vim42
-rw-r--r--syntax/modules/akamai-g2o.vim10
-rw-r--r--syntax/modules/alacner-lua.vim8
-rw-r--r--syntax/modules/array-var.vim11
-rw-r--r--syntax/modules/audio-track-for-hls.vim11
-rw-r--r--syntax/modules/aws-auth.vim13
-rw-r--r--syntax/modules/backtrace.vim9
-rw-r--r--syntax/modules/brotli.vim14
-rw-r--r--syntax/modules/cache-purge.vim9
-rw-r--r--syntax/modules/chunkin.vim11
-rw-r--r--syntax/modules/circle-gif.vim11
-rw-r--r--syntax/modules/clojure.vim39
-rw-r--r--syntax/modules/consistent-hash.vim8
-rw-r--r--syntax/modules/devel-kit.vim10
-rw-r--r--syntax/modules/drizzle.vim17
-rw-r--r--syntax/modules/dynamic-etags.vim8
-rw-r--r--syntax/modules/echo.vim24
-rw-r--r--syntax/modules/encrypted-session.vim13
-rw-r--r--syntax/modules/enhanced-memcached.vim19
-rw-r--r--syntax/modules/events.vim9
-rw-r--r--syntax/modules/ey-balancer.vim10
-rw-r--r--syntax/modules/fair-balancer.vim9
-rw-r--r--syntax/modules/fancyindex.vim14
-rw-r--r--syntax/modules/form-auth.vim12
-rw-r--r--syntax/modules/form-input.vim9
-rw-r--r--syntax/modules/geoip.vim8
-rw-r--r--syntax/modules/gridfs.vim8
-rw-r--r--syntax/modules/headers-more.vim11
-rw-r--r--syntax/modules/healthcheck-upstream.vim15
-rw-r--r--syntax/modules/http-accounting.vim12
-rw-r--r--syntax/modules/http-auth-digest.vim13
-rw-r--r--syntax/modules/http-auth-pam.vim9
-rw-r--r--syntax/modules/http-auth-request.vim9
-rw-r--r--syntax/modules/http-concat.vim13
-rw-r--r--syntax/modules/http-dyups.vim12
-rw-r--r--syntax/modules/http-footer-filter-if.vim8
-rw-r--r--syntax/modules/http-footer-filter.vim9
-rw-r--r--syntax/modules/http-internal-redirect.vim9
-rw-r--r--syntax/modules/http-js.vim15
-rw-r--r--syntax/modules/http-push.vim12
-rw-r--r--syntax/modules/http-redis.vim14
-rw-r--r--syntax/modules/iconv.vim10
-rw-r--r--syntax/modules/ip-blocker.vim8
-rw-r--r--syntax/modules/ip2location.vim8
-rw-r--r--syntax/modules/limit-upload-rate.vim9
-rw-r--r--syntax/modules/limit-upstream.vim10
-rw-r--r--syntax/modules/log-if.vim8
-rw-r--r--syntax/modules/log-request-speed.vim9
-rw-r--r--syntax/modules/log-zmq.vim11
-rw-r--r--syntax/modules/lower-upper-case.vim9
-rw-r--r--syntax/modules/lua-upstream.vim7
-rw-r--r--syntax/modules/lua.vim66
-rw-r--r--syntax/modules/md5-filter.vim8
-rw-r--r--syntax/modules/memc.vim17
-rw-r--r--syntax/modules/mod-security.vim11
-rw-r--r--syntax/modules/mogilefs.vim15
-rw-r--r--syntax/modules/mongo.vim20
-rw-r--r--syntax/modules/mp4-streaming.vim8
-rw-r--r--syntax/modules/naxsi.vim16
-rw-r--r--syntax/modules/notice.vim9
-rw-r--r--syntax/modules/ocsp-proxy.vim9
-rw-r--r--syntax/modules/openresty-eval.vim12
-rw-r--r--syntax/modules/openssl-version.vim9
-rw-r--r--syntax/modules/owner-match.vim9
-rw-r--r--syntax/modules/pagespeed.vim8
-rw-r--r--syntax/modules/php-memcache-standard-balancer.vim8
-rw-r--r--syntax/modules/php-session.vim9
-rw-r--r--syntax/modules/phusion-passenger.vim23
-rw-r--r--syntax/modules/postgres.vim17
-rw-r--r--syntax/modules/pubcookie.vim34
-rw-r--r--syntax/modules/push-stream.vim43
-rw-r--r--syntax/modules/rdns.vim10
-rw-r--r--syntax/modules/rds-csv.vim13
-rw-r--r--syntax/modules/rds-json.vim11
-rw-r--r--syntax/modules/redis2.vim17
-rw-r--r--syntax/modules/replace-filter.vim12
-rw-r--r--syntax/modules/roboo.vim7
-rw-r--r--syntax/modules/rrd-graph.vim9
-rw-r--r--syntax/modules/rtmp.vim108
-rw-r--r--syntax/modules/rtmpt-proxy.vim12
-rw-r--r--syntax/modules/sass.vim17
-rw-r--r--syntax/modules/secure-download.vim11
-rw-r--r--syntax/modules/selective-cache-purge.vim12
-rw-r--r--syntax/modules/set-cconv.vim10
-rw-r--r--syntax/modules/set-hash.vim13
-rw-r--r--syntax/modules/set-lang.vim15
-rw-r--r--syntax/modules/set-misc.vim33
-rw-r--r--syntax/modules/sflow.vim8
-rw-r--r--syntax/modules/shibboleth.vim10
-rw-r--r--syntax/modules/slice.vim14
-rw-r--r--syntax/modules/slowfs.vim15
-rw-r--r--syntax/modules/small-light.vim15
-rw-r--r--syntax/modules/sorted-querystring-filter.vim8
-rw-r--r--syntax/modules/sphinx2.vim14
-rw-r--r--syntax/modules/spnego-auth.vim13
-rw-r--r--syntax/modules/srcache.vim26
-rw-r--r--syntax/modules/sssd-info.vim15
-rw-r--r--syntax/modules/static-etags.vim8
-rw-r--r--syntax/modules/statsd.vim11
-rw-r--r--syntax/modules/sticky.vim8
-rw-r--r--syntax/modules/stream-echo.vim22
-rw-r--r--syntax/modules/stream-lua.vim12
-rw-r--r--syntax/modules/stream-upsync.vim11
-rw-r--r--syntax/modules/strip.vim8
-rw-r--r--syntax/modules/subrange.vim8
-rw-r--r--syntax/modules/substitutions.vim9
-rw-r--r--syntax/modules/summarizer.vim9
-rw-r--r--syntax/modules/supervisord.vim12
-rw-r--r--syntax/modules/tarantool-upstream.vim22
-rw-r--r--syntax/modules/tcp-proxy.vim33
-rw-r--r--syntax/modules/testcookie.vim32
-rw-r--r--syntax/modules/types-filter.vim9
-rw-r--r--syntax/modules/unzip.vim10
-rw-r--r--syntax/modules/upload-progress.vim14
-rw-r--r--syntax/modules/upload.vim20
-rw-r--r--syntax/modules/upstream-fair.vim9
-rw-r--r--syntax/modules/upstream-hash.vim9
-rw-r--r--syntax/modules/upstream-jdomain.vim8
-rw-r--r--syntax/modules/upsync.vim11
-rw-r--r--syntax/modules/url.vim10
-rw-r--r--syntax/modules/user-agent.vim8
-rw-r--r--syntax/modules/usptream-ketama-chash.vim8
-rw-r--r--syntax/modules/video-thumbextractor.vim24
-rw-r--r--syntax/modules/vkholodkov-eval.vim10
-rw-r--r--syntax/modules/vts.vim20
-rw-r--r--syntax/modules/xss.vim11
-rw-r--r--syntax/modules/zip.vim7
-rw-r--r--syntax/nginx.vim185
-rw-r--r--syntax/pug.vim8
-rw-r--r--syntax/puppet.vim581
-rw-r--r--syntax/python.vim2
-rw-r--r--syntax/rust.vim2
-rw-r--r--syntax/swift.vim4
-rw-r--r--syntax/tmux.vim1
176 files changed, 5872 insertions, 2039 deletions
diff --git a/README.md b/README.md
index 17fabe26..dfe470d1 100644
--- a/README.md
+++ b/README.md
@@ -45,7 +45,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect)
- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin, ftdetect)
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect)
-- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect)
+- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
- [elm](https://github.com/lambdatoast/elm.vim) (syntax, indent, autoload, ftplugin, ftdetect)
- [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
- [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin, ftdetect)
diff --git a/after/syntax/cpp.vim b/after/syntax/cpp.vim
index 4560b0ca..99d9f18e 100644
--- a/after/syntax/cpp.vim
+++ b/after/syntax/cpp.vim
@@ -4,16 +4,17 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c++11') == -1
" Language: C++ Additions
" Maintainer: Jon Haggblad <jon@haeggblad.com>
" URL: http://www.haeggblad.com
-" Last Change: 21 Sep 2014
-" Version: 0.5
+" Last Change: 12 Oct 2016
+" Version: 0.6
" Changelog:
" 0.1 - initial version.
" 0.2 - C++14
" 0.3 - Incorporate lastest changes from Mizuchi/STL-Syntax
" 0.4 - Add template function highlight
" 0.5 - Redo template function highlight to be more robust. Add options.
+" 0.6 - more C++14, C++17, library concepts
"
-" Additional Vim syntax highlighting for C++ (including C++11/14)
+" Additional Vim syntax highlighting for C++ (including C++11/14/17)
"
" This file contains additional syntax highlighting that I use for C++11/14
" development in Vim. Compared to the standard syntax highlighting for C++ it
@@ -21,17 +22,17 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c++11') == -1
" in the standard library / boost.
"
" Based on:
-" http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim
+" http://stackoverflow.com/q/736701
" http://www.vim.org/scripts/script.php?script_id=4293
" http://www.vim.org/scripts/script.php?script_id=2224
" http://www.vim.org/scripts/script.php?script_id=1640
" http://www.vim.org/scripts/script.php?script_id=3064
+
" -----------------------------------------------------------------------------
" Highlight Class and Function names.
"
-" Based on the discussion in:
-" http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim
+" Based on the discussion in: http://stackoverflow.com/q/736701
" -----------------------------------------------------------------------------
" Functions
@@ -41,51 +42,62 @@ hi def link cCustomFunc Function
" Class and namespace scope
if exists('g:cpp_class_scope_highlight') && g:cpp_class_scope_highlight
- syn match cCustomScope "::"
- syn match cCustomClass "\w\+\s*::"
- \contains=cCustomScope
- " hi def link cCustomClass Function " disabled for now
- syn match cCustomClass "\<\u\w*\s*\>"
+ syn match cCustomScope "::"
+ syn match cCustomClass "\w\+\s*::"
+ \ contains=cCustomScope
+ hi def link cCustomClass Function
endif
-" Template functions
-if exists('g:cpp_experimental_template_highlight') && g:cpp_experimental_template_highlight
-
- syn match cCustomAngleBracketStart "<\_[^;()]\{-}>" contained
- \contains=cCustomAngleBracketStart, cCustomAngleBracketEnd
+" Template functions.
+" Naive implementation that sorta works in most cases. Should correctly
+" highlight everything in test/color2.cpp
+if exists('g:cpp_experimental_simple_template_highlight') && g:cpp_experimental_simple_template_highlight
+ syn region cCustomAngleBrackets matchgroup=AngleBracketContents start="\v%(<operator\_s*)@<!%(%(\_i|template\_s*)@<=\<[<=]@!|\<@<!\<[[:space:]<=]@!)" end='>' contains=@cppSTLgroup,cppStructure,cType,cCustomClass,cCustomAngleBrackets,cNumbers
+ syn match cCustomBrack "<\|>" contains=cCustomAngleBrackets
+ syn match cCustomTemplateFunc "\w\+\s*<.*>(\@=" contains=cCustomBrack,cCustomAngleBrackets
+ hi def link cCustomTemplateFunc Function
+
+" Template functions (alternative faster parsing).
+" More sophisticated implementation that should be faster but doesn't always
+" correctly highlight inside template arguments. Should correctly
+" highlight everything in test/color.cpp
+elseif exists('g:cpp_experimental_template_highlight') && g:cpp_experimental_template_highlight
+
+ syn match cCustomAngleBracketStart "<\_[^;()]\{-}>" contained
+ \ contains=cCustomAngleBracketStart,cCustomAngleBracketEnd
hi def link cCustomAngleBracketStart cCustomAngleBracketContent
- syn match cCustomAngleBracketEnd ">\_[^<>;()]\{-}>" contained
- \contains=cCustomAngleBracketEnd
+ syn match cCustomAngleBracketEnd ">\_[^<>;()]\{-}>" contained
+ \ contains=cCustomAngleBracketEnd
hi def link cCustomAngleBracketEnd cCustomAngleBracketContent
- syn match cCustomTemplateFunc "\<\l\w*\s*<\_[^;()]\{-}>(\@="hs=s,he=e-1
- \contains=cCustomAngleBracketStart
+ syn match cCustomTemplateFunc "\<\l\w*\s*<\_[^;()]\{-}>(\@="hs=s,he=e-1
+ \ contains=cCustomAngleBracketStart
hi def link cCustomTemplateFunc cCustomFunc
- syn match cCustomTemplateClass "\<\w\+\s*<\_[^;()]\{-}>"
- \contains=cCustomAngleBracketStart,cCustomTemplateFunc
+ syn match cCustomTemplateClass "\<\w\+\s*<\_[^;()]\{-}>"
+ \ contains=cCustomAngleBracketStart,cCustomTemplateFunc
hi def link cCustomTemplateClass cCustomClass
" Remove 'template' from cppStructure and use a custom match
- syn clear cppStructure
+ syn clear cppStructure
syn keyword cppStructure class typename namespace
- syn match cCustomTemplate "\<template\>"
+ syn match cCustomTemplate "\<template\>"
hi def link cCustomTemplate cppStructure
- syn match cTemplateDeclare "\<template\_s*<\_[^;()]\{-}>"
- \contains=cppStructure,cCustomTemplate,cCustomAngleBracketStart
+ syn match cTemplateDeclare "\<template\_s*<\_[^;()]\{-}>"
+ \ contains=cppStructure,cCustomTemplate,cCustomAngleBracketStart
" Remove 'operator' from cppStructure and use a custom match
- syn clear cppOperator
+ syn clear cppOperator
syn keyword cppOperator typeid
syn keyword cppOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq
- syn match cCustomOperator "\<operator\>"
+ syn match cCustomOperator "\<operator\>"
hi def link cCustomOperator cppStructure
- syn match cTemplateOperatorDeclare "\<operator\_s*<\_[^;()]\{-}>[<>]=\?"
- \contains=cppOperator,cCustomOperator,cCustomAngleBracketStart
+ syn match cTemplateOperatorDeclare "\<operator\_s*<\_[^;()]\{-}>[<>]=\?"
+ \ contains=cppOperator,cCustomOperator,cCustomAngleBracketStart
endif
" Alternative syntax that is used in:
@@ -96,16 +108,18 @@ endif
" Cluster for all the stdlib functions defined below
syn cluster cppSTLgroup contains=cppSTLfunction,cppSTLfunctional,cppSTLconstant,cppSTLnamespace,cppSTLtype,cppSTLexception,cppSTLiterator,cppSTLiterator_tagcppSTLenumcppSTLioscppSTLcast
+
" -----------------------------------------------------------------------------
" Standard library types and functions.
"
-" Mainly based on the excellent STL Syntax vim script by
+" Mainly based on the excellent STL Syntax vim script by
" Mizuchi <ytj000@gmail.com>
" http://www.vim.org/scripts/script.php?script_id=4293
" which in turn is based on the scripts
" http://www.vim.org/scripts/script.php?script_id=2224
" http://www.vim.org/scripts/script.php?script_id=1640
" -----------------------------------------------------------------------------
+
syntax keyword cppSTLconstant badbit
syntax keyword cppSTLconstant cerr
syntax keyword cppSTLconstant cin
@@ -597,6 +611,7 @@ syntax keyword cppSTLiterator_tag output_iterator_tag
syntax keyword cppSTLiterator_tag random_access_iterator_tag
syntax keyword cppSTLnamespace rel_ops
syntax keyword cppSTLnamespace std
+syntax keyword cppSTLnamespace experimental
syntax keyword cppSTLtype allocator
syntax keyword cppSTLtype auto_ptr
syntax keyword cppSTLtype basic_filebuf
@@ -794,228 +809,26 @@ syntax keyword cppSTLconstant WEOF
syntax keyword cppSTLconstant WCHAR_MIN
syntax keyword cppSTLconstant WCHAR_MAX
+
if !exists("cpp_no_cpp11")
- syntax keyword cppSTLtype nullptr_t max_align_t
- syntax keyword cppSTLtype type_index
syntax keyword cppSTLconstant nullptr
- " type_traits
- syntax keyword cppSTLtype is_void
- syntax keyword cppSTLtype is_integral
- syntax keyword cppSTLtype is_floating_point
- syntax keyword cppSTLtype is_array
- syntax keyword cppSTLtype is_enum
- syntax keyword cppSTLtype is_union
- syntax keyword cppSTLtype is_class
- syntax keyword cppSTLtype is_function
- syntax keyword cppSTLtype is_pointer
- syntax keyword cppSTLtype is_lvalue_reference
- syntax keyword cppSTLtype is_rvalue_reference
- syntax keyword cppSTLtype is_member_object_pointer
- syntax keyword cppSTLtype is_member_function_pointer
- syntax keyword cppSTLtype is_fundamental
- syntax keyword cppSTLtype is_arithmetic
- syntax keyword cppSTLtype is_scalar
- syntax keyword cppSTLtype is_object
- syntax keyword cppSTLtype is_compound
- syntax keyword cppSTLtype is_reference
- syntax keyword cppSTLtype is_member_pointer
- syntax keyword cppSTLtype is_const
- syntax keyword cppSTLtype is_volatile
- syntax keyword cppSTLtype is_trivial
- syntax keyword cppSTLtype is_trivially_copyable
- syntax keyword cppSTLtype is_standard_layout
- syntax keyword cppSTLtype is_pod
- syntax keyword cppSTLtype is_literal_type
- syntax keyword cppSTLtype is_empty
- syntax keyword cppSTLtype is_polymorphic
- syntax keyword cppSTLtype is_abstract
- syntax keyword cppSTLtype is_signed
- syntax keyword cppSTLtype is_unsigned
- syntax keyword cppSTLtype is_constructible
- syntax keyword cppSTLtype is_trivially_constructible
- syntax keyword cppSTLtype is_nothrow_constructible
- syntax keyword cppSTLtype is_default_constructible
- syntax keyword cppSTLtype is_trivially_default_constructible
- syntax keyword cppSTLtype is_nothrow_default_constructible
- syntax keyword cppSTLtype is_copy_constructible
- syntax keyword cppSTLtype is_trivially_copy_constructible
- syntax keyword cppSTLtype is_nothrow_copy_constructible
- syntax keyword cppSTLtype is_move_constructible
- syntax keyword cppSTLtype is_trivially_move_constructible
- syntax keyword cppSTLtype is_nothrow_move_constructible
- syntax keyword cppSTLtype is_assignable
- syntax keyword cppSTLtype is_trivially_assignable
- syntax keyword cppSTLtype is_nothrow_assignable
- syntax keyword cppSTLtype is_copy_assignable
- syntax keyword cppSTLtype is_trivially_copy_assignable
- syntax keyword cppSTLtype is_nothrow_copy_assignable
- syntax keyword cppSTLtype is_move_assignable
- syntax keyword cppSTLtype is_trivially_move_assignable
- syntax keyword cppSTLtype is_nothrow_move_assignable
- syntax keyword cppSTLtype is_destructible
- syntax keyword cppSTLtype is_trivially_destructible
- syntax keyword cppSTLtype alignment_of
- syntax keyword cppSTLtype rank
- syntax keyword cppSTLtype extent
- syntax keyword cppSTLtype is_same
- syntax keyword cppSTLtype is_base_of
- syntax keyword cppSTLtype is_convertible
- syntax keyword cppSTLtype remove_cv
- syntax keyword cppSTLtype remove_const
- syntax keyword cppSTLtype remove_volatile
- syntax keyword cppSTLtype add_cv
- syntax keyword cppSTLtype add_const
- syntax keyword cppSTLtype add_volatile
- syntax keyword cppSTLtype remove_reference
- syntax keyword cppSTLtype add_lvalue_reference
- syntax keyword cppSTLtype add_rvalue_reference
- syntax keyword cppSTLtype remove_pointer
- syntax keyword cppSTLtype add_pointer
- syntax keyword cppSTLtype make_signed
- syntax keyword cppSTLtype make_unsigned
- syntax keyword cppSTLtype remove_extent
- syntax keyword cppSTLtype remove_all_extents
- syntax keyword cppSTLtype aligned_storage
- syntax keyword cppSTLtype aligned_union
- syntax keyword cppSTLtype decay
- syntax keyword cppSTLtype enable_if
- syntax keyword cppSTLtype conditional
- syntax keyword cppSTLtype common_type
- syntax keyword cppSTLtype underlying_type
- syntax keyword cppSTLtype result_of
- syntax keyword cppSTLtype integral_constant
- syntax keyword cppSTLtype true_type
- syntax keyword cppSTLtype false_type
- syntax keyword cppSTLfunction declval
-
- syntax keyword cppSTLconstant piecewise_construct
- syntax keyword cppSTLtype piecewise_construct_t
-
- " memory
- syntax keyword cppSTLtype unique_ptr
- syntax keyword cppSTLtype shared_ptr
- syntax keyword cppSTLtype weak_ptr
- syntax keyword cppSTLtype owner_less
- syntax keyword cppSTLtype enable_shared_from_this
- syntax keyword cppSTLexception bad_weak_ptr
- syntax keyword cppSTLtype default_delete
- syntax keyword cppSTLtype allocator_traits
- syntax keyword cppSTLtype allocator_type
- syntax keyword cppSTLtype allocator_arg_t
- syntax keyword cppSTLconstant allocator_arg
- syntax keyword cppSTLtype uses_allocator
- syntax keyword cppSTLtype scoped_allocator_adaptor
- syntax keyword cppSTLfunction declare_reachable
- syntax keyword cppSTLfunction undeclare_reachable
- syntax keyword cppSTLfunction declare_no_pointers
- syntax keyword cppSTLfunction undeclare_no_pointers
- syntax keyword cppSTLfunction get_pointer_safety
- syntax keyword cppSTLtype pointer_safety
- syntax keyword cppSTLtype pointer_traits
- syntax keyword cppSTLfunction addressof
- syntax keyword cppSTLfunction align
- syntax keyword cppSTLfunction make_shared
- syntax keyword cppSTLfunction allocate_shared
- syntax keyword cppSTLcast static_pointer_cast
- syntax keyword cppSTLcast dynamic_pointer_cast
- syntax keyword cppSTLcast const_pointer_cast
- syntax keyword cppSTLfunction get_deleter
-
- " function object
- syntax keyword cppSTLfunction bind
- syntax keyword cppSTLtype is_bind_expression
- syntax keyword cppSTLtype is_placeholder
- syntax keyword cppSTLconstant _1 _2 _3 _4 _5 _6 _7 _8 _9
- syntax keyword cppSTLfunction mem_fn
- syntax keyword cppSTLfunctional function
- syntax keyword cppSTLexception bad_function_call
- syntax keyword cppSTLtype reference_wrapper
- syntax keyword cppSTLfunction ref cref
-
- " bitset
- syntax keyword cppSTLfunction all
- syntax keyword cppSTLfunction to_ullong
-
- " iterator
- syntax keyword cppSTLiterator move_iterator
- syntax keyword cppSTLfunction make_move_iterator
- syntax keyword cppSTLfunction next prev
-
- " program support utilities
- syntax keyword cppSTLfunction quick_exit
- syntax keyword cppSTLfunction _Exit
- syntax keyword cppSTLfunction at_quick_exit
- syntax keyword cppSTLfunction forward
-
- " date and time
- syntax keyword cppSTLnamespace chrono
- syntax keyword cppSTLtype duration
- syntax keyword cppSTLtype system_clock
- syntax keyword cppSTLtype steady_clock
- syntax keyword cppSTLtype high_resolution_clock
- syntax keyword cppSTLtype time_point
- syntax keyword cppSTLcast duration_cast
- syntax keyword cppSTLcast time_point_cast
-
- " tuple
- syntax keyword cppSTLtype tuple
- syntax keyword cppSTLfunction make_tuple
- syntax keyword cppSTLfunction tie
- syntax keyword cppSTLfunction forward_as_tuple
- syntax keyword cppSTLfunction tuple_cat
- syntax keyword cppSTLtype tuple_size tuple_element
-
- " Container
+ " containers (array, vector, list, *map, *set, ...)
syntax keyword cppSTLtype array
- syntax keyword cppSTLtype forward_list
- syntax keyword cppSTLtype unordered_map
- syntax keyword cppSTLtype unordered_set
- syntax keyword cppSTLtype unordered_multimap
- syntax keyword cppSTLtype unordered_multiset
- syntax keyword cppSTLtype tuple
- syntax keyword cppSTLfunction cbegin
- syntax keyword cppSTLfunction cend
- syntax keyword cppSTLfunction crbegin
- syntax keyword cppSTLfunction crend
+ syntax keyword cppSTLfunction cbegin cend
+ syntax keyword cppSTLfunction crbegin crend
syntax keyword cppSTLfunction shrink_to_fit
syntax keyword cppSTLfunction emplace
syntax keyword cppSTLfunction emplace_back
syntax keyword cppSTLfunction emplace_front
syntax keyword cppSTLfunction emplace_hint
- "forward_list
- syntax keyword cppSTLfunction before_begin
- syntax keyword cppSTLfunction cbefore_begin
- syntax keyword cppSTLfunction insert_after
- syntax keyword cppSTLfunction emplace_after
- syntax keyword cppSTLfunction erase_after
- syntax keyword cppSTLfunction splice_after
-
- " unordered
- syntax keyword cppSTLtype hash
- syntax keyword cppSTLtype hasher
- syntax keyword cppSTLtype key_equal
- syntax keyword cppSTLiterator local_iterator
- syntax keyword cppSTLiterator const_local_iterator
- syntax keyword cppSTLfunction bucket_count
- syntax keyword cppSTLfunction max_bucket_count
- syntax keyword cppSTLfunction bucket_size
- syntax keyword cppSTLfunction bucket
- syntax keyword cppSTLfunction load_factor
- syntax keyword cppSTLfunction max_load_factor
- syntax keyword cppSTLfunction rehash
- syntax keyword cppSTLfunction reserve
- syntax keyword cppSTLfunction hash_function
- syntax keyword cppSTLfunction key_eq
-
" algorithm
syntax keyword cppSTLfunction all_of any_of none_of
syntax keyword cppSTLfunction find_if_not
syntax keyword cppSTLfunction copy_if
syntax keyword cppSTLfunction copy_n
syntax keyword cppSTLfunction move
- syntax keyword cppSTLfunction move_if_noexcept
syntax keyword cppSTLfunction move_backward
syntax keyword cppSTLfunction shuffle
syntax keyword cppSTLfunction is_partitioned
@@ -1023,13 +836,309 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLfunction partition_point
syntax keyword cppSTLfunction is_sorted
syntax keyword cppSTLfunction is_sorted_until
+ syntax keyword cppSTLfunction is_heap
syntax keyword cppSTLfunction is_heap_until
syntax keyword cppSTLfunction minmax
syntax keyword cppSTLfunction minmax_element
syntax keyword cppSTLfunction is_permutation
syntax keyword cppSTLfunction itoa
- " numerics
+ " atomic
+ syntax keyword cppSTLtype atomic
+ syntax keyword cppSTLtype atomic_flag
+ syntax keyword cppSTLtype atomic_bool
+ syntax keyword cppSTLtype atomic_char
+ syntax keyword cppSTLtype atomic_schar
+ syntax keyword cppSTLtype atomic_uchar
+ syntax keyword cppSTLtype atomic_short
+ syntax keyword cppSTLtype atomic_ushort
+ syntax keyword cppSTLtype atomic_int
+ syntax keyword cppSTLtype atomic_uint
+ syntax keyword cppSTLtype atomic_long
+ syntax keyword cppSTLtype atomic_ulong
+ syntax keyword cppSTLtype atomic_llong
+ syntax keyword cppSTLtype atomic_ullong
+ syntax keyword cppSTLtype atomic_char16_t
+ syntax keyword cppSTLtype atomic_char32_t
+ syntax keyword cppSTLtype atomic_wchar_t
+ syntax keyword cppSTLtype atomic_int_least8_t
+ syntax keyword cppSTLtype atomic_uint_least8_t
+ syntax keyword cppSTLtype atomic_int_least16_t
+ syntax keyword cppSTLtype atomic_uint_least16_t
+ syntax keyword cppSTLtype atomic_int_least32_t
+ syntax keyword cppSTLtype atomic_uint_least32_t
+ syntax keyword cppSTLtype atomic_int_least64_t
+ syntax keyword cppSTLtype atomic_uint_least64_t
+ syntax keyword cppSTLtype atomic_int_fast8_t
+ syntax keyword cppSTLtype atomic_uint_fast8_t
+ syntax keyword cppSTLtype atomic_int_fast16_t
+ syntax keyword cppSTLtype atomic_uint_fast16_t
+ syntax keyword cppSTLtype atomic_int_fast32_t
+ syntax keyword cppSTLtype atomic_uint_fast32_t
+ syntax keyword cppSTLtype atomic_int_fast64_t
+ syntax keyword cppSTLtype atomic_uint_fast64_t
+ syntax keyword cppSTLtype atomic_intptr_t
+ syntax keyword cppSTLtype atomic_uintptr_t
+ syntax keyword cppSTLtype atomic_size_t
+ syntax keyword cppSTLtype atomic_ptrdiff_t
+ syntax keyword cppSTLtype atomic_intmax_t
+ syntax keyword cppSTLtype atomic_uintmax_t
+ syntax keyword cppSTLconstant ATOMIC_FLAG_INIT
+ syntax keyword cppSTLenum memory_order
+ syntax keyword cppSTLfunction is_lock_free
+ syntax keyword cppSTLfunction compare_exchange_weak
+ syntax keyword cppSTLfunction compare_exchange_strong
+ syntax keyword cppSTLfunction fetch_add
+ syntax keyword cppSTLfunction fetch_sub
+ syntax keyword cppSTLfunction fetch_and
+ syntax keyword cppSTLfunction fetch_or
+ syntax keyword cppSTLfunction fetch_xor
+ syntax keyword cppSTLfunction atomic_is_lock_free
+ syntax keyword cppSTLfunction atomic_store
+ syntax keyword cppSTLfunction atomic_store_explicit
+ syntax keyword cppSTLfunction atomic_load
+ syntax keyword cppSTLfunction atomic_load_explicit
+ syntax keyword cppSTLfunction atomic_exchange
+ syntax keyword cppSTLfunction atomic_exchange_explicit
+ syntax keyword cppSTLfunction atomic_compare_exchange_weak
+ syntax keyword cppSTLfunction atomic_compare_exchange_weak_explicit
+ syntax keyword cppSTLfunction atomic_compare_exchange_strong
+ syntax keyword cppSTLfunction atomic_compare_exchange_strong_explicit
+ syntax keyword cppSTLfunction atomic_fetch_add
+ syntax keyword cppSTLfunction atomic_fetch_add_explicit
+ syntax keyword cppSTLfunction atomic_fetch_sub
+ syntax keyword cppSTLfunction atomic_fetch_sub_explicit
+ syntax keyword cppSTLfunction atomic_fetch_and
+ syntax keyword cppSTLfunction atomic_fetch_and_explicit
+ syntax keyword cppSTLfunction atomic_fetch_or
+ syntax keyword cppSTLfunction atomic_fetch_or_explicit
+ syntax keyword cppSTLfunction atomic_fetch_xor
+ syntax keyword cppSTLfunction atomic_fetch_xor_explicit
+ syntax keyword cppSTLfunction atomic_flag_test_and_set
+ syntax keyword cppSTLfunction atomic_flag_test_and_set_explicit
+ syntax keyword cppSTLfunction atomic_flag_clear
+ syntax keyword cppSTLfunction atomic_flag_clear_explicit
+ syntax keyword cppSTLfunction atomic_init
+ syntax keyword cppSTLfunction ATOMIC_VAR_INIT
+ syntax keyword cppSTLfunction kill_dependency
+ syntax keyword cppSTLfunction atomic_thread_fence
+ syntax keyword cppSTLfunction atomic_signal_fence
+ syntax keyword cppSTLfunction exchange
+ " syntax keyword cppSTLfunction store
+ " syntax keyword cppSTLfunction load
+
+ " bitset
+ syntax keyword cppSTLfunction to_ullong
+ " syntax keyword cppSTLfunction all
+
+ " cinttypes
+ syntax keyword cppSTLfunction strtoimax
+ syntax keyword cppSTLfunction strtoumax
+ syntax keyword cppSTLfunction wcstoimax
+ syntax keyword cppSTLfunction wcstoumax
+
+ " chrono
+ syntax keyword cppSTLnamespace chrono
+ syntax keyword cppSTLcast duration_cast
+ syntax keyword cppSTLcast time_point_cast
+ syntax keyword cppSTLtype duration
+ syntax keyword cppSTLtype system_clock
+ syntax keyword cppSTLtype steady_clock
+ syntax keyword cppSTLtype high_resolution_clock
+ syntax keyword cppSTLtype time_point
+ syntax keyword cppSTLtype nanoseconds
+ syntax keyword cppSTLtype microseconds
+ syntax keyword cppSTLtype milliseconds
+ syntax keyword cppSTLtype seconds
+ syntax keyword cppSTLtype minutes
+ syntax keyword cppSTLtype hours
+ syntax keyword cppSTLtype treat_as_floating_point
+ syntax keyword cppSTLtype duration_values
+ " syntax keyword cppSTLtype rep period
+ syntax keyword cppSTLfunction time_since_epoch
+ syntax keyword cppSTLfunction to_time_t
+ syntax keyword cppSTLfunction from_time_t
+ " syntax keyword cppSTLfunction zero
+ " syntax keyword cppSTLfunction now
+
+ " complex
+ " syntax keyword cppSTLfunction proj
+
+ " condition_variable
+ syntax keyword cppSTLtype condition_variable
+ syntax keyword cppSTLfunction notify_all
+ syntax keyword cppSTLfunction notify_one
+
+ " cstddef
+ syntax keyword cppSTLtype nullptr_t max_align_t
+
+ " cstdlib
+ syntax keyword cppSTLfunction quick_exit
+ syntax keyword cppSTLfunction _Exit
+ syntax keyword cppSTLfunction at_quick_exit
+
+ " cuchar
+ syntax keyword cppSTLfunction mbrtoc16
+ syntax keyword cppSTLfunction c16rtomb
+ syntax keyword cppSTLfunction mbrtoc32
+ syntax keyword cppSTLfunction c32rtomb
+
+ " exception
+ syntax keyword cppSTLtype exception_ptr
+ syntax keyword cppSTLtype nested_exception
+ syntax keyword cppSTLfunction get_terminate
+ syntax keyword cppSTLfunction make_exception_ptr
+ syntax keyword cppSTLfunction current_exception
+ syntax keyword cppSTLfunction rethrow_exception
+ syntax keyword cppSTLfunction throw_with_nested
+ syntax keyword cppSTLfunction rethrow_if_nested
+ syntax keyword cppSTLfunction rethrow_nested
+
+ " forward_list
+ syntax keyword cppSTLtype forward_list
+ syntax keyword cppSTLfunction before_begin
+ syntax keyword cppSTLfunction cbefore_begin
+ syntax keyword cppSTLfunction insert_after
+ syntax keyword cppSTLfunction emplace_after
+ syntax keyword cppSTLfunction erase_after
+ syntax keyword cppSTLfunction splice_after
+
+ " functional
+ syntax keyword cppSTLexception bad_function_call
+ syntax keyword cppSTLfunctional function
+ syntax keyword cppSTLconstant _1 _2 _3 _4 _5 _6 _7 _8 _9
+ syntax keyword cppSTLtype hash
+ syntax keyword cppSTLtype is_bind_expression
+ syntax keyword cppSTLtype is_placeholder
+ syntax keyword cppSTLtype reference_wrapper
+ syntax keyword cppSTLfunction bind
+ syntax keyword cppSTLfunction mem_fn
+ syntax keyword cppSTLfunction ref cref
+
+ " future
+ syntax keyword cppSTLtype future
+ syntax keyword cppSTLtype packaged_task
+ syntax keyword cppSTLtype promise
+ syntax keyword cppSTLtype shared_future
+ syntax keyword cppSTLenum future_status
+ syntax keyword cppSTLenum future_errc
+ syntax keyword cppSTLenum launch
+ syntax keyword cppSTLexception future_error
+ syntax keyword cppSTLfunction get_future
+ syntax keyword cppSTLfunction set_value
+ syntax keyword cppSTLfunction set_value_at_thread_exit
+ syntax keyword cppSTLfunction set_exception
+ syntax keyword cppSTLfunction set_exception_at_thread_exit
+ syntax keyword cppSTLfunction wait_for
+ syntax keyword cppSTLfunction wait_until
+ syntax keyword cppSTLfunction future_category
+ syntax keyword cppSTLfunction make_error_code
+ syntax keyword cppSTLfunction make_error_condition
+ syntax keyword cppSTLfunction make_ready_at_thread_exit
+ " syntax keyword cppSTLfunction async
+ " syntax keyword cppSTLfunction share
+ " syntax keyword cppSTLfunction valid
+ " syntax keyword cppSTLfunction wait
+
+ " initializer_list
+ syntax keyword cppSTLtype initializer_list
+
+ " io
+ syntax keyword cppSTLenum io_errc
+ syntax keyword cppSTLfunction iostream_category
+ syntax keyword cppSTLfunction vscanf vfscanf vsscanf
+ syntax keyword cppSTLfunction snprintf vsnprintf
+ syntax keyword cppSTLfunction vwscanf vfwscanf vswscanf
+
+ " iterator
+ syntax keyword cppSTLiterator move_iterator
+ syntax keyword cppSTLfunction make_move_iterator
+ syntax keyword cppSTLfunction next prev
+
+ " limits
+ syntax keyword cppSTLconstant max_digits10
+ syntax keyword cppSTLfunction lowest
+
+ " locale
+ syntax keyword cppSTLtype wstring_convert
+ syntax keyword cppSTLtype wbuffer_convert
+ syntax keyword cppSTLtype codecvt_utf8
+ syntax keyword cppSTLtype codecvt_utf16
+ syntax keyword cppSTLtype codecvt_utf8_utf16
+ syntax keyword cppSTLtype codecvt_mode
+ syntax keyword cppSTLfunction isblank
+ syntax keyword cppSTLfunction iswblank
+
+ " memory
+ syntax keyword cppSTLtype unique_ptr
+ syntax keyword cppSTLtype shared_ptr
+ syntax keyword cppSTLtype weak_ptr
+ syntax keyword cppSTLtype owner_less
+ syntax keyword cppSTLtype enable_shared_from_this
+ syntax keyword cppSTLtype default_delete
+ syntax keyword cppSTLtype allocator_traits
+ syntax keyword cppSTLtype allocator_type
+ syntax keyword cppSTLtype allocator_arg_t
+ syntax keyword cppSTLtype uses_allocator
+ syntax keyword cppSTLtype scoped_allocator_adaptor
+ syntax keyword cppSTLtype pointer_safety
+ syntax keyword cppSTLtype pointer_traits
+ syntax keyword cppSTLconstant allocator_arg
+ syntax keyword cppSTLexception bad_weak_ptr
+ syntax keyword cppSTLcast static_pointer_cast
+ syntax keyword cppSTLcast dynamic_pointer_cast
+ syntax keyword cppSTLcast const_pointer_cast
+ syntax keyword cppSTLfunction make_shared
+ syntax keyword cppSTLfunction declare_reachable
+ syntax keyword cppSTLfunction undeclare_reachable
+ syntax keyword cppSTLfunction declare_no_pointers
+ syntax keyword cppSTLfunction undeclare_no_pointers
+ syntax keyword cppSTLfunction get_pointer_safety
+ syntax keyword cppSTLfunction addressof
+ syntax keyword cppSTLfunction allocate_shared
+ syntax keyword cppSTLfunction get_deleter
+ " syntax keyword cppSTLfunction align
+
+ " mutex
+ syntax keyword cppSTLtype mutex
+ syntax keyword cppSTLtype timed_mutex
+ syntax keyword cppSTLtype recursive_mutex
+ syntax keyword cppSTLtype recursive_timed_mutex
+ syntax keyword cppSTLtype lock_guard
+ syntax keyword cppSTLtype unique_lock
+ syntax keyword cppSTLtype defer_lock_t
+ syntax keyword cppSTLtype try_to_lock_t
+ syntax keyword cppSTLtype adopt_lock_t
+ syntax keyword cppSTLtype once_flag
+ syntax keyword cppSTLtype condition_variable_any
+ syntax keyword cppSTLenum cv_status
+ syntax keyword cppSTLconstant defer_lock try_to_lock adopt_lock
+ syntax keyword cppSTLfunction try_lock lock unlock try_lock_for try_lock_until
+ syntax keyword cppSTLfunction call_once
+ syntax keyword cppSTLfunction owns_lock
+ syntax keyword cppSTLfunction notify_all_at_thread_exit
+ syntax keyword cppSTLfunction release
+ " Note: unique_lock has method 'mutex()', but already set as cppSTLtype
+ " syntax keyword cppSTLfunction mutex
+
+ " new
+ syntax keyword cppSTLexception bad_array_new_length
+ syntax keyword cppSTLfunction get_new_handler
+
+ " numerics, cmath
+ syntax keyword cppSTLconstant HUGE_VALF
+ syntax keyword cppSTLconstant HUGE_VALL
+ syntax keyword cppSTLconstant INFINITY
+ syntax keyword cppSTLconstant NAN
+ syntax keyword cppSTLconstant math_errhandling
+ syntax keyword cppSTLconstant MATH_ERRNO
+ syntax keyword cppSTLconstant MATH_ERREXCEPT
+ syntax keyword cppSTLconstant FP_NORMAL
+ syntax keyword cppSTLconstant FP_SUBNORMAL
+ syntax keyword cppSTLconstant FP_ZERO
+ syntax keyword cppSTLconstant FP_INFINITY
+ syntax keyword cppSTLconstant FP_NAN
+ syntax keyword cppSTLconstant FLT_EVAL_METHOD
syntax keyword cppSTLfunction imaxabs
syntax keyword cppSTLfunction imaxdiv
syntax keyword cppSTLfunction remainder
@@ -1075,22 +1184,6 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLfunction isnan
syntax keyword cppSTLfunction isnormal
syntax keyword cppSTLfunction signbit
- syntax keyword cppSTLconstant HUGE_VALF
- syntax keyword cppSTLconstant HUGE_VALL
- syntax keyword cppSTLconstant INFINITY
- syntax keyword cppSTLconstant NAN
- syntax keyword cppSTLconstant math_errhandling
- syntax keyword cppSTLconstant MATH_ERRNO
- syntax keyword cppSTLconstant MATH_ERREXCEPT
- syntax keyword cppSTLconstant FP_NORMAL
- syntax keyword cppSTLconstant FP_SUBNORMAL
- syntax keyword cppSTLconstant FP_ZERO
- syntax keyword cppSTLconstant FP_INFINITY
- syntax keyword cppSTLconstant FP_NAN
- syntax keyword cppSTLconstant FLT_EVAL_METHOD
-
- " complex
- "syntax keyword cppSTLfunction proj
" random
syntax keyword cppSTLtype linear_congruential_engine
@@ -1110,7 +1203,6 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLtype ranlux24
syntax keyword cppSTLtype ranlux48
syntax keyword cppSTLtype knuth_b
- syntax keyword cppSTLfunction generate_canonical
syntax keyword cppSTLtype uniform_int_distribution
syntax keyword cppSTLtype uniform_real_distribution
syntax keyword cppSTLtype bernoulli_distribution
@@ -1132,166 +1224,7 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLtype piecewise_constant_distribution
syntax keyword cppSTLtype piecewise_linear_distribution
syntax keyword cppSTLtype seed_seq
-
- " io
- syntax keyword cppSTLfunction iostream_category
- syntax keyword cppSTLenum io_errc
- syntax keyword cppSTLfunction vscanf vfscanf vsscanf
- syntax keyword cppSTLfunction snprintf vsnprintf
- syntax keyword cppSTLfunction vwscanf vfwscanf vswscanf
-
- " locale
- syntax keyword cppSTLfunction isblank
- syntax keyword cppSTLfunction iswblank
- syntax keyword cppSTLtype wstring_convert
- syntax keyword cppSTLtype wbuffer_convert
- syntax keyword cppSTLtype codecvt_utf8
- syntax keyword cppSTLtype codecvt_utf16
- syntax keyword cppSTLtype codecvt_utf8_utf16
- syntax keyword cppSTLtype codecvt_mode
-
- " regex
- syntax keyword cppSTLtype basic_regex
- syntax keyword cppSTLtype sub_match
- syntax keyword cppSTLtype match_results
- syntax keyword cppSTLtype regex_traits
- syntax keyword cppSTLtype regex_match regex_search regex_replace
- syntax keyword cppSTLiterator regex_iterator
- syntax keyword cppSTLiterator regex_token_iterator
- syntax keyword cppSTLexception regex_error
- syntax keyword cppSTLtype syntax_option_type match_flag_type error_type
-
- " atomic
- syntax keyword cppSTLtype atomic
- syntax keyword cppSTLfunction atomic_is_lock_free
- syntax keyword cppSTLfunction atomic_store
- syntax keyword cppSTLfunction atomic_store_explicit
- syntax keyword cppSTLfunction atomic_load
- syntax keyword cppSTLfunction atomic_load_explicit
- syntax keyword cppSTLfunction atomic_exchange
- syntax keyword cppSTLfunction atomic_exchange_explicit
- syntax keyword cppSTLfunction atomic_compare_exchange_weak
- syntax keyword cppSTLfunction atomic_compare_exchange_weak_explicit
- syntax keyword cppSTLfunction atomic_compare_exchange_strong
- syntax keyword cppSTLfunction atomic_compare_exchange_strong_explicit
- syntax keyword cppSTLfunction atomic_fetch_add
- syntax keyword cppSTLfunction atomic_fetch_add_explicit
- syntax keyword cppSTLfunction atomic_fetch_sub
- syntax keyword cppSTLfunction atomic_fetch_sub_explicit
- syntax keyword cppSTLfunction atomic_fetch_and
- syntax keyword cppSTLfunction atomic_fetch_and_explicit
- syntax keyword cppSTLfunction atomic_fetch_or
- syntax keyword cppSTLfunction atomic_fetch_or_explicit
- syntax keyword cppSTLfunction atomic_fetch_xor
- syntax keyword cppSTLfunction atomic_fetch_xor_explicit
-
- syntax keyword cppSTLtype atomic_flag
- syntax keyword cppSTLfunction atomic_flag_test_and_set
- syntax keyword cppSTLfunction atomic_flag_test_and_set_explicit
- syntax keyword cppSTLfunction atomic_flag_clear
- syntax keyword cppSTLfunction atomic_flag_clear_explicit
-
- syntax keyword cppSTLtype atomic_bool
- syntax keyword cppSTLtype atomic_char
- syntax keyword cppSTLtype atomic_schar
- syntax keyword cppSTLtype atomic_uchar
- syntax keyword cppSTLtype atomic_short
- syntax keyword cppSTLtype atomic_ushort
- syntax keyword cppSTLtype atomic_int
- syntax keyword cppSTLtype atomic_uint
- syntax keyword cppSTLtype atomic_long
- syntax keyword cppSTLtype atomic_ulong
- syntax keyword cppSTLtype atomic_llong
- syntax keyword cppSTLtype atomic_ullong
- syntax keyword cppSTLtype atomic_char16_t
- syntax keyword cppSTLtype atomic_char32_t
- syntax keyword cppSTLtype atomic_wchar_t
- syntax keyword cppSTLtype atomic_int_least8_t
- syntax keyword cppSTLtype atomic_uint_least8_t
- syntax keyword cppSTLtype atomic_int_least16_t
- syntax keyword cppSTLtype atomic_uint_least16_t
- syntax keyword cppSTLtype atomic_int_least32_t
- syntax keyword cppSTLtype atomic_uint_least32_t
- syntax keyword cppSTLtype atomic_int_least64_t
- syntax keyword cppSTLtype atomic_uint_least64_t
- syntax keyword cppSTLtype atomic_int_fast8_t
- syntax keyword cppSTLtype atomic_uint_fast8_t
- syntax keyword cppSTLtype atomic_int_fast16_t
- syntax keyword cppSTLtype atomic_uint_fast16_t
- syntax keyword cppSTLtype atomic_int_fast32_t
- syntax keyword cppSTLtype atomic_uint_fast32_t
- syntax keyword cppSTLtype atomic_int_fast64_t
- syntax keyword cppSTLtype atomic_uint_fast64_t
- syntax keyword cppSTLtype atomic_intptr_t
- syntax keyword cppSTLtype atomic_uintptr_t
- syntax keyword cppSTLtype atomic_size_t
- syntax keyword cppSTLtype atomic_ptrdiff_t
- syntax keyword cppSTLtype atomic_intmax_t
- syntax keyword cppSTLtype atomic_uintmax_t
-
- syntax keyword cppSTLtype memory_order
- syntax keyword cppSTLfunction atomic_init
- syntax keyword cppSTLfunction ATOMIC_VAR_INIT
- syntax keyword cppSTLconstant ATOMIC_FLAG_INIT
- syntax keyword cppSTLfunction kill_dependency
- syntax keyword cppSTLfunction atomic_thread_fence
- syntax keyword cppSTLfunction atomic_signal_fence
-
- " thread
- syntax keyword cppSTLtype thread
- syntax keyword cppSTLnamespace this_thread
- syntax keyword cppSTLfunction yield
- syntax keyword cppSTLfunction get_id
- syntax keyword cppSTLfunction sleep_for
- syntax keyword cppSTLfunction sleep_until
-
- syntax keyword cppSTLfunction joinable
- syntax keyword cppSTLfunction get_id
- syntax keyword cppSTLfunction native_handle
- syntax keyword cppSTLfunction hardware_concurrency
- syntax keyword cppSTLfunction join
- syntax keyword cppSTLfunction detach
-
- syntax keyword cppSTLtype mutex
- syntax keyword cppSTLtype timed_mutex
- syntax keyword cppSTLtype recursive_mutex
- syntax keyword cppSTLtype recursive_timed_mutex
- syntax keyword cppSTLtype lock_guard
- syntax keyword cppSTLtype unique_lock
- syntax keyword cppSTLtype defer_lock_t
- syntax keyword cppSTLtype try_to_lock_t
- syntax keyword cppSTLtype adopt_lock_t
- syntax keyword cppSTLconstant defer_lock try_to_lock adopt_lock
- syntax keyword cppSTLfunction try_lock lock
- syntax keyword cppSTLfunction call_once
- syntax keyword cppSTLtype once_flag
- syntax keyword cppSTLtype condition_variable
- syntax keyword cppSTLtype condition_variable_any
- syntax keyword cppSTLfunction notify_all_at_thread_exit
- syntax keyword cppSTLenum cv_status
-
- syntax keyword cppSTLtype promise
- syntax keyword cppSTLtype packaged_task
- syntax keyword cppSTLtype future
- syntax keyword cppSTLtype shared_future
-
- syntax keyword cppSTLfunction async
- syntax keyword cppSTLenum launch
-
- syntax keyword cppSTLenum future_status
- syntax keyword cppSTLenum future_errc
- syntax keyword cppSTLtype future_error
- syntax keyword cppSTLfunction future_category
-
- " string
- syntax keyword cppSTLfunction stoi
- syntax keyword cppSTLfunction stol
- syntax keyword cppSTLfunction stoll
- syntax keyword cppSTLfunction stoul
- syntax keyword cppSTLfunction stoull
- syntax keyword cppSTLfunction stof
- syntax keyword cppSTLfunction stod
- syntax keyword cppSTLfunction stold
+ syntax keyword cppSTLfunction generate_canonical
" ratio
syntax keyword cppSTLtype ratio
@@ -1326,56 +1259,703 @@ if !exists("cpp_no_cpp11")
syntax keyword cppSTLtype ratio_greater
syntax keyword cppSTLtype ratio_greater_equal
- "limits
- syntax keyword cppSTLfunction lowest
+ " regex
+ syntax keyword cppSTLtype basic_regex
+ syntax keyword cppSTLtype sub_match
+ syntax keyword cppSTLtype match_results
+ syntax keyword cppSTLtype regex_traits
+ syntax keyword cppSTLtype regex_match regex_search regex_replace
+ syntax keyword cppSTLiterator regex_iterator
+ syntax keyword cppSTLiterator regex_token_iterator
+ syntax keyword cppSTLexception regex_error
+ syntax keyword cppSTLtype syntax_option_type match_flag_type error_type
- "cuchar
- syntax keyword cppSTLfunction mbrtoc16
- syntax keyword cppSTLfunction c16rtomb
- syntax keyword cppSTLfunction mbrtoc32
- syntax keyword cppSTLfunction c32rtomb
+ " string
+ syntax keyword cppSTLfunction stoi
+ syntax keyword cppSTLfunction stol
+ syntax keyword cppSTLfunction stoll
+ syntax keyword cppSTLfunction stoul
+ syntax keyword cppSTLfunction stoull
+ syntax keyword cppSTLfunction stof
+ syntax keyword cppSTLfunction stod
+ syntax keyword cppSTLfunction stold
- "cinttypes
- syntax keyword cppSTLfunction strtoimax
- syntax keyword cppSTLfunction strtoumax
- syntax keyword cppSTLfunction wcstoimax
- syntax keyword cppSTLfunction wcstoumax
+ " system_error
+ syntax keyword cppSTLenum errc
+ syntax keyword cppSTLtype system_error
+ syntax keyword cppSTLtype error_code
+ syntax keyword cppSTLtype error_condition
+ syntax keyword cppSTLtype error_category
+ syntax keyword cppSTLtype is_error_code_enum
+ syntax keyword cppSTLtype is_error_condition_enum
+ " syntax keyword cppSTLfunction default_error_condition
+ " syntax keyword cppSTLfunction generic_category
+ " syntax keyword cppSTLfunction system_category
+ " syntax keyword cppSTLfunction code
+ " syntax keyword cppSTLfunction category
+ " syntax keyword cppSTLfunction message
+ " syntax keyword cppSTLfunction equivalent
- syntax keyword cppSTLtype nanoseconds
- syntax keyword cppSTLtype microseconds
- syntax keyword cppSTLtype milliseconds
- syntax keyword cppSTLtype seconds
- syntax keyword cppSTLtype minutes
- syntax keyword cppSTLtype hours
+ " thread
+ syntax keyword cppSTLnamespace this_thread
+ syntax keyword cppSTLtype thread
+ syntax keyword cppSTLfunction get_id
+ syntax keyword cppSTLfunction sleep_for
+ syntax keyword cppSTLfunction sleep_until
+ syntax keyword cppSTLfunction joinable
+ syntax keyword cppSTLfunction native_handle
+ syntax keyword cppSTLfunction hardware_concurrency
+ " syntax keyword cppSTLfunction yield
+ " syntax keyword cppSTLfunction join
+ " syntax keyword cppSTLfunction detach
+
+ " tuple
+ syntax keyword cppSTLtype tuple
+ syntax keyword cppSTLtype tuple_size
+ syntax keyword cppSTLtype tuple_element
+ syntax keyword cppSTLfunction make_tuple
+ syntax keyword cppSTLfunction tie
+ syntax keyword cppSTLfunction forward_as_tuple
+ syntax keyword cppSTLfunction tuple_cat
+ " Note: 'ignore' is already set as cppSTLfunction
+ " syntax keyword cppSTLconstant ignore
+
+ " typeindex
+ syntax keyword cppSTLtype type_index
- "raw string literals
+ " type_traits
+ syntax keyword cppSTLtype is_void
+ syntax keyword cppSTLtype is_integral
+ syntax keyword cppSTLtype is_floating_point
+ syntax keyword cppSTLtype is_array
+ syntax keyword cppSTLtype is_enum
+ syntax keyword cppSTLtype is_union
+ syntax keyword cppSTLtype is_class
+ syntax keyword cppSTLtype is_function
+ syntax keyword cppSTLtype is_pointer
+ syntax keyword cppSTLtype is_lvalue_reference
+ syntax keyword cppSTLtype is_rvalue_reference
+ syntax keyword cppSTLtype is_member_object_pointer
+ syntax keyword cppSTLtype is_member_function_pointer
+ syntax keyword cppSTLtype is_fundamental
+ syntax keyword cppSTLtype is_arithmetic
+ syntax keyword cppSTLtype is_scalar
+ syntax keyword cppSTLtype is_object
+ syntax keyword cppSTLtype is_compound
+ syntax keyword cppSTLtype is_reference
+ syntax keyword cppSTLtype is_member_pointer
+ syntax keyword cppSTLtype is_const
+ syntax keyword cppSTLtype is_volatile
+ syntax keyword cppSTLtype is_trivial
+ syntax keyword cppSTLtype is_trivially_copyable
+ syntax keyword cppSTLtype is_standard_layout
+ syntax keyword cppSTLtype is_pod
+ syntax keyword cppSTLtype is_literal_type
+ syntax keyword cppSTLtype is_empty
+ syntax keyword cppSTLtype is_polymorphic
+ syntax keyword cppSTLtype is_abstract
+ syntax keyword cppSTLtype is_signed
+ syntax keyword cppSTLtype is_unsigned
+ syntax keyword cppSTLtype is_constructible
+ syntax keyword cppSTLtype is_trivially_constructible
+ syntax keyword cppSTLtype is_nothrow_constructible
+ syntax keyword cppSTLtype is_default_constructible
+ syntax keyword cppSTLtype is_trivially_default_constructible
+ syntax keyword cppSTLtype is_nothrow_default_constructible
+ syntax keyword cppSTLtype is_copy_constructible
+ syntax keyword cppSTLtype is_trivially_copy_constructible
+ syntax keyword cppSTLtype is_nothrow_copy_constructible
+ syntax keyword cppSTLtype is_move_constructible
+ syntax keyword cppSTLtype is_trivially_move_constructible
+ syntax keyword cppSTLtype is_nothrow_move_constructible
+ syntax keyword cppSTLtype is_assignable
+ syntax keyword cppSTLtype is_trivially_assignable
+ syntax keyword cppSTLtype is_nothrow_assignable
+ syntax keyword cppSTLtype is_copy_assignable
+ syntax keyword cppSTLtype is_trivially_copy_assignable
+ syntax keyword cppSTLtype is_nothrow_copy_assignable
+ syntax keyword cppSTLtype is_move_assignable
+ syntax keyword cppSTLtype is_trivially_move_assignable
+ syntax keyword cppSTLtype is_nothrow_move_assignable
+ syntax keyword cppSTLtype is_destructible
+ syntax keyword cppSTLtype is_trivially_destructible
+ syntax keyword cppSTLtype is_nothrow_destructible
+ syntax keyword cppSTLtype has_virtual_destructor
+ syntax keyword cppSTLtype alignment_of
+ syntax keyword cppSTLtype rank
+ syntax keyword cppSTLtype extent
+ syntax keyword cppSTLtype is_same
+ syntax keyword cppSTLtype is_base_of
+ syntax keyword cppSTLtype is_convertible
+ syntax keyword cppSTLtype remove_cv
+ syntax keyword cppSTLtype remove_const
+ syntax keyword cppSTLtype remove_volatile
+ syntax keyword cppSTLtype add_cv
+ syntax keyword cppSTLtype add_const
+ syntax keyword cppSTLtype add_volatile
+ syntax keyword cppSTLtype remove_reference
+ syntax keyword cppSTLtype add_lvalue_reference
+ syntax keyword cppSTLtype add_rvalue_reference
+ syntax keyword cppSTLtype remove_pointer
+ syntax keyword cppSTLtype add_pointer
+ syntax keyword cppSTLtype make_signed
+ syntax keyword cppSTLtype make_unsigned
+ syntax keyword cppSTLtype remove_extent
+ syntax keyword cppSTLtype remove_all_extents
+ syntax keyword cppSTLtype aligned_storage
+ syntax keyword cppSTLtype aligned_union
+ syntax keyword cppSTLtype decay
+ syntax keyword cppSTLtype enable_if
+ syntax keyword cppSTLtype conditional
+ syntax keyword cppSTLtype common_type
+ syntax keyword cppSTLtype underlying_type
+ syntax keyword cppSTLtype result_of
+ syntax keyword cppSTLtype integral_constant
+ syntax keyword cppSTLtype true_type
+ syntax keyword cppSTLtype false_type
+
+ " unordered_map, unordered_set, unordered_multimap, unordered_multiset
+ syntax keyword cppSTLtype unordered_map
+ syntax keyword cppSTLtype unordered_set
+ syntax keyword cppSTLtype unordered_multimap
+ syntax keyword cppSTLtype unordered_multiset
+ syntax keyword cppSTLtype hasher
+ syntax keyword cppSTLtype key_equal
+ syntax keyword cppSTLiterator local_iterator
+ syntax keyword cppSTLiterator const_local_iterator
+ syntax keyword cppSTLfunction bucket_count
+ syntax keyword cppSTLfunction max_bucket_count
+ syntax keyword cppSTLfunction bucket_size
+ syntax keyword cppSTLfunction bucket
+ syntax keyword cppSTLfunction load_factor
+ syntax keyword cppSTLfunction max_load_factor
+ syntax keyword cppSTLfunction rehash
+ syntax keyword cppSTLfunction reserve
+ syntax keyword cppSTLfunction hash_function
+ syntax keyword cppSTLfunction key_eq
+
+ " utility
+ syntax keyword cppSTLtype piecewise_construct_t
+ syntax keyword cppSTLconstant piecewise_construct
+ syntax keyword cppSTLfunction declval
+ syntax keyword cppSTLfunction forward
+ syntax keyword cppSTLfunction move_if_noexcept
+
+ " raw string literals
syntax region cppRawString matchgroup=cppRawDelimiter start=@\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(@ end=/)\z1"/ contains=@Spell
syn match cNumber "0b[01]\+"
endif " C++11
+
if !exists("cpp_no_cpp14")
- "dynarray
- syntax keyword cppSTLtype dynarray
+ " chrono
+ syntax keyword cppSTLnamespace literals
+ syntax keyword cppSTLnamespace chrono_literals
- "thread
- syntax keyword cppSTLtype shared_mutex
- syntax keyword cppSTLtype shared_lock
+ " iterator
+ syntax keyword cppSTLfunction make_reverse_iterator
- "memory
+ " memory
syntax keyword cppSTLfunction make_unique
+
+ " utility
+ syntax keyword cppSTLtype integer_sequence
+ syntax keyword cppSTLtype index_sequence
+ syntax keyword cppSTLtype make_integer_sequence
+ syntax keyword cppSTLtype make_index_sequence
+ syntax keyword cppSTLtype index_sequence_for
+
+ " shared_mutex
+ syntax keyword cppSTLtype shared_timed_mutex
+ syntax keyword cppSTLtype shared_lock
+ syntax keyword cppSTLfunction lock_shared
+ syntax keyword cppSTLfunction unlock_shared
+ syntax keyword cppSTLfunction try_lock_shared
+ syntax keyword cppSTLfunction try_lock_shared_for
+ syntax keyword cppSTLfunction try_lock_shared_until
+
+ " string
+ syntax keyword cppSTLnamespace string_literals
+
+ " tuple
+ syntax keyword cppSTLtype tuple_element_t
+
+ " type_traits
+ syntax keyword cppSTLtype is_null_pointer
+ syntax keyword cppSTLtype remove_cv_t
+ syntax keyword cppSTLtype remove_const_t
+ syntax keyword cppSTLtype remove_volatile_t
+ syntax keyword cppSTLtype add_cv_t
+ syntax keyword cppSTLtype add_const_t
+ syntax keyword cppSTLtype add_volatile_t
+ syntax keyword cppSTLtype remove_reference_t
+ syntax keyword cppSTLtype add_lvalue_reference_t
+ syntax keyword cppSTLtype add_rvalue_reference_t
+ syntax keyword cppSTLtype remove_pointer_t
+ syntax keyword cppSTLtype add_pointer_t
+ syntax keyword cppSTLtype make_signed_t
+ syntax keyword cppSTLtype make_unsigned_t
+ syntax keyword cppSTLtype remove_extent_t
+ syntax keyword cppSTLtype remove_all_extents_t
+ syntax keyword cppSTLtype aligned_storage_t
+ syntax keyword cppSTLtype aligned_union_t
+ syntax keyword cppSTLtype decay_t
+ syntax keyword cppSTLtype enable_if_t
+ syntax keyword cppSTLtype conditional_t
+ syntax keyword cppSTLtype common_type_t
+ syntax keyword cppSTLtype underlying_type_t
+ syntax keyword cppSTLtype result_of_t
endif " C++14
-if !exists("cpp_no_boost")
- "optional is not a part of C++14 anymore
+
+if !exists("cpp_no_cpp17")
+ " algorithm
+ syntax keyword cppSTLfunction clamp
+ syntax keyword cppSTLfunction for_each_n
+
+ " any
+ syntax keyword cppSTLtype any
+ syntax keyword cppSTLexception bad_any_cast
+ syntax keyword cppSTLcast any_cast
+ syntax keyword cppSTLfunction make_any
+
+ " array
+ syntax keyword cppSTLfunction to_array
+ syntax keyword cppSTLfunction make_array
+
+ " atomic
+ syntax keyword cppSTLconstant is_always_lock_free
+
+ " chrono
+ syntax keyword cppSTLbool treat_as_floating_point_v
+
+ " cmath
+ syntax keyword cppSTLfunction assoc_laguerre assoc_laguerref assoc_laguerrel
+ syntax keyword cppSTLfunction assoc_legendre assoc_legendref assoc_legendrel
+ syntax keyword cppSTLfunction beta betaf betal
+ syntax keyword cppSTLfunction comp_ellint_1 comp_ellint_1f comp_ellint_1l
+ syntax keyword cppSTLfunction comp_ellint_2 comp_ellint_2f comp_ellint_2l
+ syntax keyword cppSTLfunction comp_ellint_3 comp_ellint_3f comp_ellint_3l
+ syntax keyword cppSTLfunction cyl_bessel_i cyl_bessel_if cyl_bessel_il
+ syntax keyword cppSTLfunction cyl_bessel_j cyl_bessel_jf cyl_bessel_jl
+ syntax keyword cppSTLfunction cyl_bessel_k cyl_bessel_kf cyl_bessel_kl
+ syntax keyword cppSTLfunction cyl_neumann cyl_neumannf cyl_neumannl
+ syntax keyword cppSTLfunction ellint_1 ellint_1f ellint_1l
+ syntax keyword cppSTLfunction ellint_2 ellint_2f ellint_2l
+ syntax keyword cppSTLfunction ellint_3 ellint_3f ellint_3l
+ syntax keyword cppSTLfunction expint expintf expintl
+ syntax keyword cppSTLfunction hermite hermitef hermitel
+ syntax keyword cppSTLfunction legendre legendrefl egendrel
+ syntax keyword cppSTLfunction laguerre laguerref laguerrel
+ syntax keyword cppSTLfunction riemann_zeta riemann_zetaf riemann_zetal
+ syntax keyword cppSTLfunction sph_bessel sph_besself sph_bessell
+ syntax keyword cppSTLfunction sph_legendre sph_legendref sph_legendrel
+ syntax keyword cppSTLfunction sph_neumann sph_neumannf sph_neumannl
+
+ " cstdlib
+ syntax keyword cppSTLfunction aligned_alloc
+
+ " exception
+ syntax keyword cppSTLfunction uncaught_exceptions
+
+ " execution
+ syntax keyword cppSTLnamespace execution
+ syntax keyword cppSTLconstant seq par par_unseq
+ syntax keyword cppSTLbool is_execution_policy_v
+ syntax keyword cppSTLtype sequenced_policy
+ syntax keyword cppSTLtype parallel_policy
+ syntax keyword cppSTLtype parallel_unsequenced_policy
+ syntax keyword cppSTLtype is_execution_policy
+
+ " filesystem
+ syntax keyword cppSTLnamespace filesystem
+ syntax keyword cppSTLexception filesystem_error
+ syntax keyword cppSTLtype path
+ syntax keyword cppSTLtype directory_entry
+ syntax keyword cppSTLtype directory_iterator
+ syntax keyword cppSTLtype recursive_directory_iterator
+ syntax keyword cppSTLtype file_status
+ syntax keyword cppSTLtype space_info
+ syntax keyword cppSTLtype file_time_type
+ syntax keyword cppSTLenum file_type
+ syntax keyword cppSTLenum perms
+ syntax keyword cppSTLenum copy_options
+ syntax keyword cppSTLenum directory_options
+ syntax keyword cppSTLConstant preferred_separator
+ syntax keyword cppSTLconstant available
+ " Note: 'capacity' and 'free' are already set as cppSTLfunction
+ " syntax keyword cppSTLconstant capacity
+ " syntax keyword cppSTLconstant free
+ syntax keyword cppSTLfunction concat
+ syntax keyword cppSTLfunction make_preferred
+ syntax keyword cppSTLfunction remove_filename
+ syntax keyword cppSTLfunction replace_filename
+ syntax keyword cppSTLfunction replace_extension
+ syntax keyword cppSTLfunction native
+ syntax keyword cppSTLfunction string_type
+ " Note: wstring, u8string, u16string, u32string already set as cppSTLtype
+ " syntax keyword cppSTLfunction wstring
+ " syntax keyword cppSTLfunction u8string
+ " syntax keyword cppSTLfunction u16string
+ " syntax keyword cppSTLfunction u32string
+ syntax keyword cppSTLfunction generic_string
+ syntax keyword cppSTLfunction generic_wstring
+ syntax keyword cppSTLfunction generic_u8string
+ syntax keyword cppSTLfunction generic_u16string
+ syntax keyword cppSTLfunction generic_u32string
+ syntax keyword cppSTLfunction lexically_normal
+ syntax keyword cppSTLfunction lexically_relative
+ syntax keyword cppSTLfunction lexically_proximate
+ syntax keyword cppSTLfunction root_name
+ syntax keyword cppSTLfunction root_directory
+ syntax keyword cppSTLfunction root_path
+ syntax keyword cppSTLfunction relative_path
+ syntax keyword cppSTLfunction parent_path
+ " syntax keyword cppSTLfunction filename
+ syntax keyword cppSTLfunction stem
+ syntax keyword cppSTLfunction extension
+ syntax keyword cppSTLfunction has_root_name
+ syntax keyword cppSTLfunction has_root_directory
+ syntax keyword cppSTLfunction has_root_path
+ syntax keyword cppSTLfunction has_relative_path
+ syntax keyword cppSTLfunction has_parent_path
+ syntax keyword cppSTLfunction has_filename
+ syntax keyword cppSTLfunction has_stem
+ syntax keyword cppSTLfunction has_extension
+ syntax keyword cppSTLfunction is_absolute
+ syntax keyword cppSTLfunction is_relative
+ syntax keyword cppSTLfunction hash_value
+ syntax keyword cppSTLfunction u8path
+ syntax keyword cppSTLfunction path1
+ syntax keyword cppSTLfunction path2
+ " syntax keyword cppSTLfunction path
+ syntax keyword cppSTLfunction status
+ syntax keyword cppSTLfunction symlink_status
+ syntax keyword cppSTLfunction options
+ " syntax keyword cppSTLfunction depth
+ syntax keyword cppSTLfunction recursive_pending
+ syntax keyword cppSTLfunction disable_recursive_pending
+ " syntax keyword cppSTLfunction type
+ syntax keyword cppSTLfunction permissions
+ syntax keyword cppSTLfunction absolute
+ syntax keyword cppSTLfunction system_complete
+ syntax keyword cppSTLfunction canonical
+ syntax keyword cppSTLfunction weakly_canonical
+ syntax keyword cppSTLfunction relative
+ syntax keyword cppSTLfunction proximate
+ syntax keyword cppSTLfunction copy_file
+ syntax keyword cppSTLfunction copy_symlink
+ syntax keyword cppSTLfunction create_directory
+ syntax keyword cppSTLfunction create_directories
+ syntax keyword cppSTLfunction create_hard_link
+ syntax keyword cppSTLfunction create_symlink
+ syntax keyword cppSTLfunction create_directory_symlink
+ syntax keyword cppSTLfunction current_path
+ " syntax keyword cppSTLfunction exists
+ syntax keyword cppSTLfunction file_size
+ syntax keyword cppSTLfunction hard_link_count
+ syntax keyword cppSTLfunction last_write_time
+ syntax keyword cppSTLfunction read_symlink
+ syntax keyword cppSTLfunction remove_all
+ syntax keyword cppSTLfunction resize_file
+ syntax keyword cppSTLfunction space
+ syntax keyword cppSTLfunction temp_directory_path
+ syntax keyword cppSTLfunction is_block_file
+ syntax keyword cppSTLfunction is_character_file
+ syntax keyword cppSTLfunction is_directory
+ syntax keyword cppSTLfunction is_fifo
+ syntax keyword cppSTLfunction is_other
+ syntax keyword cppSTLfunction is_regular_file
+ syntax keyword cppSTLfunction is_socket
+ syntax keyword cppSTLfunction is_symlink
+ syntax keyword cppSTLfunction status_known
+ " Note: 'is_empty' already set as cppSTLtype
+ " syntax keyword cppSTLfunction is_empty
+
+ " functional
+ syntax keyword cppSTLtype default_order
+ syntax keyword cppSTLtype default_order_t
+ syntax keyword cppSTLtype default_searcher
+ syntax keyword cppSTLtype boyer_moore_searcher
+ syntax keyword cppSTLtype boyer_moore_horspool_searcher
+ syntax keyword cppSTLbool is_bind_expression_v
+ syntax keyword cppSTLbool is_placeholder_v
+ syntax keyword cppSTLfunction not_fn
+ syntax keyword cppSTLfunction make_default_searcher
+ syntax keyword cppSTLfunction make_boyer_moore_searcher
+ syntax keyword cppSTLfunction make_boyer_moore_horspool_searcher
+ " syntax keyword cppSTLfunction invoke
+
+ " memory
+ syntax keyword cppSTLcast reinterpret_pointer_cast
+ syntax keyword cppSTLfunction uninitialized_move
+ syntax keyword cppSTLfunction uninitialized_move_n
+ syntax keyword cppSTLfunction uninitialized_default_construct
+ syntax keyword cppSTLfunction uninitialized_default_construct_n
+ syntax keyword cppSTLfunction uninitialized_value_construct
+ syntax keyword cppSTLfunction uninitialized_value_construct_n
+ syntax keyword cppSTLfunction destroy_at
+ syntax keyword cppSTLfunction destroy_n
+
+ " memory_resource
+ syntax keyword cppSTLtype polymorphic_allocator
+ syntax keyword cppSTLtype memory_resource
+ syntax keyword cppSTLtype synchronized_pool_resource
+ syntax keyword cppSTLtype unsynchronized_pool_resource
+ syntax keyword cppSTLtype pool_options
+ syntax keyword cppSTLtype monotonic_buffer_resource
+ syntax keyword cppSTLfunction upstream_resource
+ syntax keyword cppSTLfunction get_default_resource
+ syntax keyword cppSTLfunction new_default_resource
+ syntax keyword cppSTLfunction set_default_resource
+ syntax keyword cppSTLfunction null_memory_resource
+ syntax keyword cppSTLfunction allocate
+ syntax keyword cppSTLfunction deallocate
+ syntax keyword cppSTLfunction construct
+ syntax keyword cppSTLfunction destruct
+ syntax keyword cppSTLfunction resource
+ syntax keyword cppSTLfunction select_on_container_copy_construction
+ syntax keyword cppSTLfunction do_allocate
+ syntax keyword cppSTLfunction do_deallocate
+ syntax keyword cppSTLfunction do_is_equal
+
+ " new
+ syntax keyword cppSTLconstant hardware_destructive_interference_size
+ syntax keyword cppSTLconstant hardware_constructive_interference_size
+ syntax keyword cppSTLfunction launder
+
+ " numeric
+ syntax keyword cppSTLfunction gcd
+ syntax keyword cppSTLfunction lcm
+ syntax keyword cppSTLfunction exclusive_scan
+ syntax keyword cppSTLfunction inclusive_scan
+ syntax keyword cppSTLfunction transform_reduce
+ syntax keyword cppSTLfunction transform_exclusive_scan
+ syntax keyword cppSTLfunction transform_inclusive_scan
+ " syntax keyword cppSTLfunction reduce
+
+ " optional
syntax keyword cppSTLtype optional
- "syntax keyword cppSTLfunction value
- syntax keyword cppSTLfunction value_or
+ syntax keyword cppSTLtype nullopt_t
+ syntax keyword cppSTLexception bad_optional_access
+ syntax keyword cppSTLconstant nullopt
syntax keyword cppSTLfunction make_optional
+ syntax keyword cppSTLfunction value_or
+ syntax keyword cppSTLfunction has_value
+ " syntax keyword cppSTLfunction value
+
+ " string_view
+ syntax keyword cppSTLtype basic_string_view
+ syntax keyword cppSTLtype string_view
+ syntax keyword cppSTLtype wstring_view
+ syntax keyword cppSTLtype u16string_view
+ syntax keyword cppSTLtype u32string_view
+ syntax keyword cppSTLfunction remove_prefix
+ syntax keyword cppSTLfunction remove_suffix
+
+ " system_error
+ syntax keyword cppSTLbool is_error_code_enum_v
+ syntax keyword cppSTLbool is_error_condition_enum_v
+
+ " thread
+ syntax keyword cppSTLtype shared_mutex
+
+ " tuple
+ syntax keyword cppSTLconstant tuple_size_v
+ syntax keyword cppSTLfunction make_from_tuple
+ " syntax keyword cppSTLfunction apply
+
+ " type_traits
+ syntax keyword cppSTLbool is_void_v
+ syntax keyword cppSTLbool is_null_pointer_v
+ syntax keyword cppSTLbool is_integral_v
+ syntax keyword cppSTLbool is_floating_point_v
+ syntax keyword cppSTLbool is_array_v
+ syntax keyword cppSTLbool is_enum_v
+ syntax keyword cppSTLbool is_union_v
+ syntax keyword cppSTLbool is_class_v
+ syntax keyword cppSTLbool is_function_v
+ syntax keyword cppSTLbool is_pointer_v
+ syntax keyword cppSTLbool is_lvalue_reference_v
+ syntax keyword cppSTLbool is_rvalue_reference_v
+ syntax keyword cppSTLbool is_member_object_pointer_v
+ syntax keyword cppSTLbool is_member_function_pointer_v
+ syntax keyword cppSTLbool is_fundamental_v
+ syntax keyword cppSTLbool is_arithmetic_v
+ syntax keyword cppSTLbool is_scalar_v
+ syntax keyword cppSTLbool is_object_v
+ syntax keyword cppSTLbool is_compound_v
+ syntax keyword cppSTLbool is_reference_v
+ syntax keyword cppSTLbool is_member_pointer_v
+ syntax keyword cppSTLbool is_const_v
+ syntax keyword cppSTLbool is_volatile_v
+ syntax keyword cppSTLbool is_trivial_v
+ syntax keyword cppSTLbool is_trivially_copyable_v
+ syntax keyword cppSTLbool is_standard_layout_v
+ syntax keyword cppSTLbool is_pod_v
+ syntax keyword cppSTLbool is_literal_type_v
+ syntax keyword cppSTLbool is_empty_v
+ syntax keyword cppSTLbool is_polymorphic_v
+ syntax keyword cppSTLbool is_abstract_v
+ syntax keyword cppSTLbool is_signed_v
+ syntax keyword cppSTLbool is_unsigned_v
+ syntax keyword cppSTLbool is_constructible_v
+ syntax keyword cppSTLbool is_trivially_constructible_v
+ syntax keyword cppSTLbool is_nothrow_constructible_v
+ syntax keyword cppSTLbool is_default_constructible_v
+ syntax keyword cppSTLbool is_trivially_default_constructible_v
+ syntax keyword cppSTLbool is_nothrow_default_constructible_v
+ syntax keyword cppSTLbool is_copy_constructible_v
+ syntax keyword cppSTLbool is_trivially_copy_constructible_v
+ syntax keyword cppSTLbool is_nothrow_copy_constructible_v
+ syntax keyword cppSTLbool is_move_constructible_v
+ syntax keyword cppSTLbool is_trivially_move_constructible_v
+ syntax keyword cppSTLbool is_nothrow_move_constructible_v
+ syntax keyword cppSTLbool is_assignable_v
+ syntax keyword cppSTLbool is_trivially_assignable_v
+ syntax keyword cppSTLbool is_nothrow_assignable_v
+ syntax keyword cppSTLbool is_copy_assignable_v
+ syntax keyword cppSTLbool is_trivially_copy_assignable_v
+ syntax keyword cppSTLbool is_nothrow_copy_assignable_v
+ syntax keyword cppSTLbool is_move_assignable_v
+ syntax keyword cppSTLbool is_trivially_move_assignable_v
+ syntax keyword cppSTLbool is_nothrow_move_assignable_v
+ syntax keyword cppSTLbool is_destructible_v
+ syntax keyword cppSTLbool is_trivially_destructible_v
+ syntax keyword cppSTLbool is_nothrow_destructible_v
+ syntax keyword cppSTLbool has_virtual_destructor_v
+ syntax keyword cppSTLbool is_same_v
+ syntax keyword cppSTLbool is_base_of_v
+ syntax keyword cppSTLbool is_convertible_v
+ syntax keyword cppSTLbool is_callable_v
+ syntax keyword cppSTLbool is_nowthrow_callable_v
+ syntax keyword cppSTLbool conjunction_v
+ syntax keyword cppSTLbool disjunction_v
+ syntax keyword cppSTLbool negation_v
+ syntax keyword cppSTLconstant alignment_of_v
+ syntax keyword cppSTLconstant rank_v
+ syntax keyword cppSTLconstant extent_v
+ syntax keyword cppSTLtype bool_constant
+ syntax keyword cppSTLtype is_callable
+ syntax keyword cppSTLtype is_nowthrow_callable
+ syntax keyword cppSTLtype conjunction
+ syntax keyword cppSTLtype disjunction
+ syntax keyword cppSTLtype negation
+
+ " unordered_map, unordered_set, unordered_multimap, unordered_multiset
+ syntax keyword cppSTLtype node_type
+ syntax keyword cppSTLtype insert_return_type
+ syntax keyword cppSTLfunction try_emplace
+ syntax keyword cppSTLfunction insert_or_assign
+ syntax keyword cppSTLfunction extract
+
+ " utility
+ syntax keyword cppSTLtype in_place_tag
+ syntax keyword cppSTLtype in_place_t
+ syntax keyword cppSTLtype in_place_type_t
+ syntax keyword cppSTLtype in_place_index_t
+ syntax keyword cppSTLfunction in_place
+ syntax keyword cppSTLfunction as_const
+
+ " variant
+ syntax keyword cppSTLtype variant
+ syntax keyword cppSTLtype monostate
+ syntax keyword cppSTLtype variant_size
+ syntax keyword cppSTLtype variant_alternative
+ syntax keyword cppSTLtype variant_alternative_t
+ syntax keyword cppSTLconstant variant_size_v
+ syntax keyword cppSTLconstant variant_npos
+ syntax keyword cppSTLexception bad_variant_access
+ syntax keyword cppSTLfunction valueless_by_exception
+ syntax keyword cppSTLfunction holds_alternative
+ syntax keyword cppSTLfunction get_if
+ syntax keyword cppSTLfunction visit
+ " syntax keyword cppSTLfunction index
+endif " C++17
+
+
+if exists('g:cpp_concepts_highlight') && g:cpp_concepts_highlight
+ syntax keyword cppStatement concept
+ syntax keyword cppStorageClass requires
+ syntax keyword cppSTLtype DefaultConstructible
+ syntax keyword cppSTLtype MoveConstructible
+ syntax keyword cppSTLtype CopyConstructible
+ syntax keyword cppSTLtype MoveAssignable
+ syntax keyword cppSTLtype CopyAssignable
+ syntax keyword cppSTLtype Destructible
+ syntax keyword cppSTLtype TriviallyCopyable
+ syntax keyword cppSTLtype TrivialType
+ syntax keyword cppSTLtype StandardLayoutType
+ syntax keyword cppSTLtype PODType
+ syntax keyword cppSTLtype EqualityComparable
+ syntax keyword cppSTLtype LessThanComparable
+ syntax keyword cppSTLtype Swappable
+ syntax keyword cppSTLtype ValueSwappable
+ syntax keyword cppSTLtype NullablePointer
+ syntax keyword cppSTLtype Hash
+ syntax keyword cppSTLtype Allocator
+ syntax keyword cppSTLtype FunctionObject
+ syntax keyword cppSTLtype Callable
+ syntax keyword cppSTLtype Predicate
+ syntax keyword cppSTLtype BinaryPredicate
+ syntax keyword cppSTLtype Compare
+ syntax keyword cppSTLtype Container
+ syntax keyword cppSTLtype ReversibleContainer
+ syntax keyword cppSTLtype AllocatorAwareContainer
+ syntax keyword cppSTLtype SequenceContainer
+ syntax keyword cppSTLtype ContiguousContainer
+ syntax keyword cppSTLtype AssociativeContainer
+ syntax keyword cppSTLtype UnorderedAssociativeContainer
+ syntax keyword cppSTLtype DefaultInsertable
+ syntax keyword cppSTLtype CopyInsertable
+ syntax keyword cppSTLtype CopyInsertable
+ syntax keyword cppSTLtype MoveInsertable
+ syntax keyword cppSTLtype EmplaceConstructible
+ syntax keyword cppSTLtype Erasable
+ syntax keyword cppSTLtype Iterator
+ syntax keyword cppSTLtype InputIterator
+ syntax keyword cppSTLtype OutputIterator
+ syntax keyword cppSTLtype ForwardIterator
+ syntax keyword cppSTLtype BidirectionalIterator
+ syntax keyword cppSTLtype RandomAccessIterator
+ syntax keyword cppSTLtype ContiguousIterator
+ syntax keyword cppSTLtype UnformattedInputFunction
+ syntax keyword cppSTLtype FormattedInputFunction
+ syntax keyword cppSTLtype UnformattedOutputFunction
+ syntax keyword cppSTLtype FormattedOutputFunction
+ syntax keyword cppSTLtype SeedSequence
+ syntax keyword cppSTLtype UniformRandomBitGenerator
+ syntax keyword cppSTLtype RandomNumberEngine
+ syntax keyword cppSTLtype RandomNumberEngineAdaptor
+ syntax keyword cppSTLtype RandomNumberDistribution
+ syntax keyword cppSTLtype BasicLockable
+ syntax keyword cppSTLtype Lockable
+ syntax keyword cppSTLtype TimedLockable
+ syntax keyword cppSTLtype Mutex
+ syntax keyword cppSTLtype TimedMutex
+ syntax keyword cppSTLtype SharedMutex
+ syntax keyword cppSTLtype SharedTimedMutex
+ syntax keyword cppSTLtype UnaryTypeTrait
+ syntax keyword cppSTLtype BinaryTypeTrait
+ syntax keyword cppSTLtype TransformationTrait
+ syntax keyword cppSTLtype Clock
+ syntax keyword cppSTLtype TrivialClock
+ syntax keyword cppSTLtype CharTraits
+ syntax keyword cppSTLtype pos_type
+ syntax keyword cppSTLtype off_type
+ syntax keyword cppSTLtype BitmaskType
+ syntax keyword cppSTLtype NumericType
+ syntax keyword cppSTLtype RegexTraits
+ syntax keyword cppSTLtype LiteralType
+endif " C++ concepts
+
+if !exists("cpp_no_boost")
syntax keyword cppSTLnamespace boost
syntax keyword cppSTLcast lexical_cast
-endif " Boost
+endif " boost
+
" Default highlighting
if version >= 508 || !exists("did_cpp_syntax_inits")
@@ -1385,6 +1965,9 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
else
command -nargs=+ HiLink hi def link <args>
endif
+ HiLink cppSTLbool Boolean
+ HiLink cppStorageClass StorageClass
+ HiLink cppStatement Statement
HiLink cppSTLfunction Function
HiLink cppSTLfunctional Typedef
HiLink cppSTLconstant Constant
@@ -1396,7 +1979,7 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
HiLink cppSTLenum Typedef
HiLink cppSTLios Function
HiLink cppSTLcast Statement " be consistent with official syntax
- HiLink cppRawString String
+ HiLink cppRawString String
HiLink cppRawDelimiter Delimiter
delcommand HiLink
endif
diff --git a/autoload/dart.vim b/autoload/dart.vim
index 65380926..df341b48 100644
--- a/autoload/dart.vim
+++ b/autoload/dart.vim
@@ -20,18 +20,20 @@ endfunction
function! dart#fmt(q_args) abort
if executable('dartfmt')
- let path = expand('%:p:gs:\:/:')
- if filereadable(path)
- let joined_lines = system(printf('dartfmt %s %s', a:q_args, shellescape(path)))
- if 0 == v:shell_error
- silent % delete _
- silent put=joined_lines
- silent 1 delete _
- else
- call s:cexpr('line %l\, column %c of %f: %m', joined_lines)
- endif
+ let buffer_content = join(getline(1, '$'), "\n")
+ let joined_lines = system(printf('dartfmt %s', a:q_args), buffer_content)
+ if 0 == v:shell_error
+ let win_view = winsaveview()
+ silent % delete _
+ silent put=joined_lines
+ silent 1 delete _
+ call winrestview(win_view)
else
- call s:error(printf('cannot read a file: "%s"', path))
+ let errors = split(joined_lines, "\n")[2:]
+ let file_path = expand('%')
+ call map(errors, 'file_path.":".v:val')
+ let error_format = '%A%f:line %l\, column %c of stdin: %m,%C%.%#'
+ call s:cexpr(error_format, join(errors, "\n"))
endif
else
call s:error('cannot execute binary file: dartfmt')
diff --git a/autoload/elixir/indent.vim b/autoload/elixir/indent.vim
new file mode 100644
index 00000000..8e0c609c
--- /dev/null
+++ b/autoload/elixir/indent.vim
@@ -0,0 +1,212 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
+
+let s:NO_COLON_BEFORE = ':\@<!'
+let s:NO_COLON_AFTER = ':\@!'
+let s:ENDING_SYMBOLS = '\]\|}\|)'
+let s:STARTING_SYMBOLS = '\[\|{\|('
+let s:ARROW = '->'
+let s:END_WITH_ARROW = s:ARROW.'$'
+let s:SKIP_SYNTAX = '\%(Comment\|String\)$'
+let s:BLOCK_SKIP = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '".s:SKIP_SYNTAX."'"
+let s:DEF = '^\s*def'
+let s:FN = '\<fn\>'
+let s:MULTILINE_FN = s:FN.'\%(.*end\)\@!'
+let s:BLOCK_START = '\%(\<do\>\|'.s:FN.'\)\>'
+let s:MULTILINE_BLOCK = '\%(\<do\>'.s:NO_COLON_AFTER.'\|'.s:MULTILINE_FN.'\)'
+let s:BLOCK_MIDDLE = '\<\%(else\|match\|elsif\|catch\|after\|rescue\)\>'
+let s:BLOCK_END = 'end'
+let s:STARTS_WITH_PIPELINE = '^\s*|>.*$'
+let s:ENDING_WITH_ASSIGNMENT = '=\s*$'
+let s:INDENT_KEYWORDS = s:NO_COLON_BEFORE.'\%('.s:MULTILINE_BLOCK.'\|'.s:BLOCK_MIDDLE.'\)'
+let s:DEINDENT_KEYWORDS = '^\s*\<\%('.s:BLOCK_END.'\|'.s:BLOCK_MIDDLE.'\)\>'
+let s:PAIR_START = '\<\%('.s:NO_COLON_BEFORE.s:BLOCK_START.'\)\>'.s:NO_COLON_AFTER
+let s:PAIR_MIDDLE = '^\s*\%('.s:BLOCK_MIDDLE.'\)\>'.s:NO_COLON_AFTER.'\zs'
+let s:PAIR_END = '\<\%('.s:NO_COLON_BEFORE.s:BLOCK_END.'\)\>\zs'
+
+function! s:pending_parenthesis(line)
+ if a:line.last.text !~ s:ARROW
+ return elixir#util#count_indentable_symbol_diff(a:line.last, '(', '\%(end\s*\)\@<!)')
+ end
+endfunction
+
+function! s:pending_square_brackets(line)
+ if a:line.last.text !~ s:ARROW
+ return elixir#util#count_indentable_symbol_diff(a:line.last, '[', ']')
+ end
+endfunction
+
+function! s:pending_brackets(line)
+ if a:line.last.text !~ s:ARROW
+ return elixir#util#count_indentable_symbol_diff(a:line.last, '{', '}')
+ end
+endfunction
+
+function! elixir#indent#deindent_case_arrow(ind, line)
+ if get(b:old_ind, 'arrow', 0) > 0
+ \ && (a:line.current.text =~ s:ARROW
+ \ || a:line.current.text =~ s:BLOCK_END)
+ let ind = b:old_ind.arrow
+ let b:old_ind.arrow = 0
+ return ind
+ else
+ return a:ind
+ end
+endfunction
+
+function! elixir#indent#deindent_ending_symbols(ind, line)
+ if a:line.current.text =~ '^\s*\('.s:ENDING_SYMBOLS.'\)'
+ return a:ind - &sw
+ else
+ return a:ind
+ end
+endfunction
+
+function! elixir#indent#deindent_keywords(ind, line)
+ if a:line.current.text =~ s:DEINDENT_KEYWORDS
+ let bslnum = searchpair(
+ \ s:PAIR_START,
+ \ s:PAIR_MIDDLE,
+ \ s:PAIR_END,
+ \ 'nbW',
+ \ s:BLOCK_SKIP
+ \ )
+
+ return indent(bslnum)
+ else
+ return a:ind
+ end
+endfunction
+
+function! elixir#indent#deindent_opened_symbols(ind, line)
+ let s:opened_symbol =
+ \ s:pending_parenthesis(a:line)
+ \ + s:pending_square_brackets(a:line)
+ \ + s:pending_brackets(a:line)
+
+ if s:opened_symbol < 0
+ let ind = get(b:old_ind, 'symbol', a:ind + (s:opened_symbol * &sw))
+ let ind = float2nr(ceil(floor(ind)/&sw)*&sw)
+ return ind <= 0 ? 0 : ind
+ else
+ return a:ind
+ end
+endfunction
+
+function! elixir#indent#indent_after_pipeline(ind, line)
+ if a:line.last.text =~ s:STARTS_WITH_PIPELINE
+ if empty(substitute(a:line.current.text, ' ', '', 'g'))
+ \ || a:line.current.text =~ s:STARTS_WITH_PIPELINE
+ return indent(a:line.last.num)
+ elseif a:line.last.text !~ s:INDENT_KEYWORDS
+ let ind = b:old_ind.pipeline
+ let b:old_ind.pipeline = 0
+ return ind
+ end
+ end
+
+ return a:ind
+endfunction
+
+function! elixir#indent#indent_assignment(ind, line)
+ if a:line.last.text =~ s:ENDING_WITH_ASSIGNMENT
+ let b:old_ind.pipeline = indent(a:line.last.num) " FIXME: side effect
+ return a:ind + &sw
+ else
+ return a:ind
+ end
+endfunction
+
+function! elixir#indent#indent_brackets(ind, line)
+ if s:pending_brackets(a:line) > 0
+ return a:ind + &sw
+ else
+ return a:ind
+ end
+endfunction
+
+function! elixir#indent#indent_case_arrow(ind, line)
+ if a:line.last.text =~ s:END_WITH_ARROW && a:line.last.text !~ '\<fn\>'
+ let b:old_ind.arrow = a:ind
+ return a:ind + &sw
+ else
+ return a:ind
+ end
+endfunction
+
+function! elixir#indent#indent_ending_symbols(ind, line)
+ if a:line.last.text =~ '^\s*\('.s:ENDING_SYMBOLS.'\)\s*$'
+ return a:ind + &sw
+ else
+ return a:ind
+ end
+endfunction
+
+function! elixir#indent#indent_keywords(ind, line)
+ if a:line.last.text =~ s:INDENT_KEYWORDS
+ return a:ind + &sw
+ else
+ return a:ind
+ end
+endfunction
+
+function! elixir#indent#indent_parenthesis(ind, line)
+ if s:pending_parenthesis(a:line) > 0
+ \ && a:line.last.text !~ s:DEF
+ \ && a:line.last.text !~ s:END_WITH_ARROW
+ let b:old_ind.symbol = a:ind
+ return matchend(a:line.last.text, '(')
+ else
+ return a:ind
+ end
+endfunction
+
+function! elixir#indent#indent_pipeline_assignment(ind, line)
+ if a:line.current.text =~ s:STARTS_WITH_PIPELINE
+ \ && a:line.last.text =~ '^[^=]\+=.\+$'
+ let b:old_ind.pipeline = indent(a:line.last.num)
+ " if line starts with pipeline
+ " and last line is an attribution
+ " indents pipeline in same level as attribution
+ return match(a:line.last.text, '=\s*\zs[^ ]')
+ else
+ return a:ind
+ end
+endfunction
+
+function! elixir#indent#indent_pipeline_continuation(ind, line)
+ if a:line.last.text =~ s:STARTS_WITH_PIPELINE
+ \ && a:line.current.text =~ s:STARTS_WITH_PIPELINE
+ return indent(a:line.last.num)
+ else
+ return a:ind
+ end
+endfunction
+
+function! elixir#indent#indent_square_brackets(ind, line)
+ if s:pending_square_brackets(a:line) > 0
+ if a:line.last.text =~ '[\s*$'
+ return a:ind + &sw
+ else
+ " if start symbol is followed by a character, indent based on the
+ " whitespace after the symbol, otherwise use the default shiftwidth
+ " Avoid negative indentation index
+ return matchend(a:line.last.text, '[\s*')
+ end
+ else
+ return a:ind
+ end
+endfunction
+
+function! elixir#indent#deindent_case_arrow(ind, line)
+ if get(b:old_ind, 'arrow', 0) > 0
+ \ && (a:line.current.text =~ s:ARROW
+ \ || a:line.current.text =~ s:BLOCK_END)
+ let ind = b:old_ind.arrow
+ let b:old_ind.arrow = 0
+ return ind
+ else
+ return a:ind
+ end
+endfunction
+
+endif
diff --git a/autoload/elixir/util.vim b/autoload/elixir/util.vim
new file mode 100644
index 00000000..3139d779
--- /dev/null
+++ b/autoload/elixir/util.vim
@@ -0,0 +1,56 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
+
+let s:SKIP_SYNTAX = '\%(Comment\|String\)$'
+let s:BLOCK_SKIP = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '".s:SKIP_SYNTAX."'"
+
+function! elixir#util#is_indentable_at(line, col)
+ if a:col == -1 " skip synID lookup for not found match
+ return 1
+ end
+ " TODO: Remove these 2 lines
+ " I don't know why, but for the test on spec/indent/lists_spec.rb:24.
+ " Vim is making some mess on parsing the syntax of 'end', it is being
+ " recognized as 'elixirString' when should be recognized as 'elixirBlock'.
+ call synID(a:line, a:col, 1)
+ " This forces vim to sync the syntax. Using fromstart is very slow on files
+ " over 1k lines
+ syntax sync minlines=20 maxlines=150
+
+ return synIDattr(synID(a:line, a:col, 1), "name")
+ \ !~ s:SKIP_SYNTAX
+endfunction
+
+function! elixir#util#is_indentable_match(line, pattern)
+ return elixir#util#is_indentable_at(a:line.num, match(a:line.text, a:pattern))
+endfunction
+
+function! elixir#util#count_indentable_symbol_diff(line, open, close)
+ if elixir#util#is_indentable_match(a:line, a:open)
+ \ && elixir#util#is_indentable_match(a:line, a:close)
+ return
+ \ s:match_count(a:line.text, a:open)
+ \ - s:match_count(a:line.text, a:close)
+ else
+ return 0
+ end
+endfunction
+
+function! s:match_count(string, pattern)
+ let size = strlen(a:string)
+ let index = 0
+ let counter = 0
+
+ while index < size
+ let index = match(a:string, a:pattern, index)
+ if index >= 0
+ let index += 1
+ let counter +=1
+ else
+ break
+ end
+ endwhile
+
+ return counter
+endfunction
+
+endif
diff --git a/autoload/htmlcomplete.vim b/autoload/htmlcomplete.vim
index f58793a2..fc9a4b5a 100644
--- a/autoload/htmlcomplete.vim
+++ b/autoload/htmlcomplete.vim
@@ -1,12 +1,12 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'html5') == -1
" Vim completion script
-" Language: HTML and XHTML
-" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
-" Last Change: 2006 Oct 19
+" Language: HTML and XHTML
+" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
+" Last Change: 2006 Oct 19
" Modified: othree <othree@gmail.com>
" Changes: Add HTML5, WAI-ARIA support
-" Last Change: 2010 Sep 25
+" Last Change: 2016 Oct 11
if !exists('g:aria_attributes_complete')
let g:aria_attributes_complete = 1
@@ -16,42 +16,42 @@ endif
" To use with other HTML versions add another "elseif" condition to match
" proper DOCTYPE.
function! htmlcomplete#DetectOmniFlavor()
- if &filetype == 'xhtml'
- let b:html_omni_flavor = 'xhtml10s'
- else
- let b:html_omni_flavor = 'html5'
+ if &filetype == 'xhtml'
+ let b:html_omni_flavor = 'xhtml10s'
+ else
+ let b:html_omni_flavor = 'html5'
+ endif
+ let i = 1
+ let line = ""
+ while i < 10 && i < line("$")
+ let line = getline(i)
+ if line =~ '<!DOCTYPE.*\<DTD '
+ break
endif
- let i = 1
- let line = ""
- while i < 10 && i < line("$")
- let line = getline(i)
- if line =~ '<!DOCTYPE.*\<DTD '
- break
- endif
- let i += 1
- endwhile
- if line =~ '<!DOCTYPE.*\<DTD ' " doctype line found above
- if line =~ ' HTML 3\.2'
- let b:html_omni_flavor = 'html32'
- elseif line =~ ' XHTML 1\.1'
- let b:html_omni_flavor = 'xhtml11'
- else " two-step detection with strict/frameset/transitional
- if line =~ ' XHTML 1\.0'
- let b:html_omni_flavor = 'xhtml10'
- elseif line =~ ' HTML 4\.01'
- let b:html_omni_flavor = 'html401'
- elseif line =~ ' HTML 4.0\>'
- let b:html_omni_flavor = 'html40'
- endif
- if line =~ '\<Transitional\>'
- let b:html_omni_flavor .= 't'
- elseif line =~ '\<Frameset\>'
- let b:html_omni_flavor .= 'f'
- else
- let b:html_omni_flavor .= 's'
- endif
- endif
+ let i += 1
+ endwhile
+ if line =~ '<!DOCTYPE.*\<DTD ' " doctype line found above
+ if line =~ ' HTML 3\.2'
+ let b:html_omni_flavor = 'html32'
+ elseif line =~ ' XHTML 1\.1'
+ let b:html_omni_flavor = 'xhtml11'
+ else " two-step detection with strict/frameset/transitional
+ if line =~ ' XHTML 1\.0'
+ let b:html_omni_flavor = 'xhtml10'
+ elseif line =~ ' HTML 4\.01'
+ let b:html_omni_flavor = 'html401'
+ elseif line =~ ' HTML 4.0\>'
+ let b:html_omni_flavor = 'html40'
+ endif
+ if line =~ '\<Transitional\>'
+ let b:html_omni_flavor .= 't'
+ elseif line =~ '\<Frameset\>'
+ let b:html_omni_flavor .= 'f'
+ else
+ let b:html_omni_flavor .= 's'
+ endif
endif
+ endif
endfunction
function! htmlcomplete#CompleteTags(findstart, base)
@@ -59,491 +59,493 @@ function! htmlcomplete#CompleteTags(findstart, base)
" locate the start of the word
let line = getline('.')
let start = col('.') - 1
- let curline = line('.')
- let compl_begin = col('.') - 2
+ let curline = line('.')
+ let compl_begin = col('.') - 2
while start >= 0 && line[start - 1] =~ '\(\k\|[!:.-]\)'
- let start -= 1
+ let start -= 1
endwhile
- " Handling of entities {{{
- if start >= 0 && line[start - 1] =~ '&'
- let b:entitiescompl = 1
- let b:compl_context = ''
- return start
- endif
- " }}}
- " Handling of <style> tag {{{
- let stylestart = searchpair('<style\>', '', '<\/style\>', "bnW")
- let styleend = searchpair('<style\>', '', '<\/style\>', "nW")
- if stylestart != 0 && styleend != 0
- if stylestart <= curline && styleend >= curline
- let start = col('.') - 1
- let b:csscompl = 1
- while start >= 0 && line[start - 1] =~ '\(\k\|-\)'
- let start -= 1
- endwhile
- endif
- endif
- " }}}
- " Handling of <script> tag {{{
- let scriptstart = searchpair('<script\>', '', '<\/script\>', "bnW")
- let scriptend = searchpair('<script\>', '', '<\/script\>', "nW")
- if scriptstart != 0 && scriptend != 0
- if scriptstart <= curline && scriptend >= curline
- let start = col('.') - 1
- let b:jscompl = 1
- let b:jsrange = [scriptstart, scriptend]
- while start >= 0 && line[start - 1] =~ '\k'
- let start -= 1
- endwhile
- " We are inside of <script> tag. But we should also get contents
- " of all linked external files and (secondary, less probably) other <script> tags
- " This logic could possible be done in separate function - may be
- " reused in events scripting (also with option could be reused for
- " CSS
- let b:js_extfiles = []
- let l = line('.')
- let c = col('.')
- call cursor(1,1)
- while search('<\@<=script\>', 'W') && line('.') <= l
- if synIDattr(synID(line('.'),col('.')-1,0),"name") !~? 'comment'
- let sname = matchstr(getline('.'), '<script[^>]*src\s*=\s*\([''"]\)\zs.\{-}\ze\1')
- if filereadable(sname)
- let b:js_extfiles += readfile(sname)
- endif
- endif
- endwhile
- call cursor(1,1)
- let js_scripttags = []
- while search('<script\>', 'W') && line('.') < l
- if matchstr(getline('.'), '<script[^>]*src') == ''
- let js_scripttag = getline(line('.'), search('</script>', 'W'))
- let js_scripttags += js_scripttag
- endif
- endwhile
- let b:js_extfiles += js_scripttags
- call cursor(l,c)
- unlet! l c
- endif
- endif
- " }}}
- if !exists("b:csscompl") && !exists("b:jscompl")
- let b:compl_context = getline('.')[0:(compl_begin)]
- if b:compl_context !~ '<[^>]*$'
- " Look like we may have broken tag. Check previous lines.
- let i = 1
- while 1
- let context_line = getline(curline-i)
- if context_line =~ '<[^>]*$'
- " Yep, this is this line
- let context_lines = getline(curline-i, curline-1) + [b:compl_context]
- let b:compl_context = join(context_lines, ' ')
- break
- elseif context_line =~ '>[^<]*$' || i == curline
- " We are in normal tag line, no need for completion at all
- " OR reached first line without tag at all
- let b:compl_context = ''
- break
- endif
- let i += 1
- endwhile
- " Make sure we don't have counter
- unlet! i
- endif
- let b:compl_context = matchstr(b:compl_context, '.*\zs<.*')
-
- " Return proper start for on-events. Without that beginning of
- " completion will be badly reported
- if b:compl_context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$'
- let start = col('.') - 1
- while start >= 0 && line[start - 1] =~ '\k'
- let start -= 1
- endwhile
- endif
- " If b:compl_context begins with <? we are inside of PHP code. It
- " wasn't closed so PHP completion passed it to HTML
- if &filetype =~? 'php' && b:compl_context =~ '^<?'
- let b:phpcompl = 1
- let start = col('.') - 1
- while start >= 0 && line[start - 1] =~ '[a-zA-Z_0-9\x7f-\xff$]'
- let start -= 1
- endwhile
- endif
- else
- let b:compl_context = getline('.')[0:compl_begin]
- endif
+ " Handling of entities {{{
+ if start >= 0 && line[start - 1] =~ '&'
+ let b:entitiescompl = 1
+ let b:compl_context = ''
+ return start
+ endif
+ " }}}
+ " Handling of <style> tag {{{
+ let stylestart = searchpair('<style\>', '', '<\/style\>', "bnW")
+ let styleend = searchpair('<style\>', '', '<\/style\>', "nW")
+ if stylestart != 0 && styleend != 0
+ if stylestart <= curline && styleend >= curline
+ let start = col('.') - 1
+ let b:csscompl = 1
+ while start >= 0 && line[start - 1] =~ '\(\k\|-\)'
+ let start -= 1
+ endwhile
+ endif
+ endif
+ " }}}
+ " Handling of <script> tag {{{
+ let scriptstart = searchpair('<script\>', '', '<\/script\>', "bnW")
+ let scriptend = searchpair('<script\>', '', '<\/script\>', "nW")
+ if scriptstart != 0 && scriptend != 0
+ if scriptstart <= curline && scriptend >= curline
+ let start = col('.') - 1
+ let b:jscompl = 1
+ let b:jsrange = [scriptstart, scriptend]
+ while start >= 0 && line[start - 1] =~ '\k'
+ let start -= 1
+ endwhile
+ " We are inside of <script> tag. But we should also get contents
+ " of all linked external files and (secondary, less probably) other <script> tags
+ " This logic could possible be done in separate function - may be
+ " reused in events scripting (also with option could be reused for
+ " CSS
+ let b:js_extfiles = []
+ let l = line('.')
+ let c = col('.')
+ call cursor(1,1)
+ while search('<\@<=script\>', 'W') && line('.') <= l
+ if synIDattr(synID(line('.'),col('.')-1,0),"name") !~? 'comment'
+ let sname = matchstr(getline('.'), '<script[^>]*src\s*=\s*\([''"]\)\zs.\{-}\ze\1')
+ if filereadable(sname)
+ let b:js_extfiles += readfile(sname)
+ endif
+ endif
+ endwhile
+ call cursor(1,1)
+ let js_scripttags = []
+ while search('<script\>', 'W') && line('.') < l
+ if matchstr(getline('.'), '<script[^>]*src') == ''
+ let js_scripttag = getline(line('.'), search('</script>', 'W'))
+ let js_scripttags += js_scripttag
+ endif
+ endwhile
+ let b:js_extfiles += js_scripttags
+ call cursor(l,c)
+ unlet! l c
+ endif
+ endif
+ " }}}
+ if !exists("b:csscompl") && !exists("b:jscompl")
+ let b:compl_context = getline('.')[0:(compl_begin)]
+ if b:compl_context !~ '<[^>]*$'
+ " Look like we may have broken tag. Check previous lines.
+ let i = 1
+ while 1
+ let context_line = getline(curline-i)
+ if context_line =~ '<[^>]*$'
+ " Yep, this is this line
+ let context_lines = getline(curline-i, curline-1) + [b:compl_context]
+ let b:compl_context = join(context_lines, ' ')
+ break
+ elseif context_line =~ '>[^<]*$' || i == curline
+ " We are in normal tag line, no need for completion at all
+ " OR reached first line without tag at all
+ let b:compl_context = ''
+ break
+ endif
+ let i += 1
+ endwhile
+ " Make sure we don't have counter
+ unlet! i
+ endif
+ let b:compl_context = matchstr(b:compl_context, '.*\zs<.*')
+
+ " Return proper start for on-events. Without that beginning of
+ " completion will be badly reported
+ if b:compl_context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$'
+ let start = col('.') - 1
+ while start >= 0 && line[start - 1] =~ '\k'
+ let start -= 1
+ endwhile
+ endif
+ " If b:compl_context begins with <? we are inside of PHP code. It
+ " wasn't closed so PHP completion passed it to HTML
+ if &filetype =~? 'php' && b:compl_context =~ '^<?'
+ let b:phpcompl = 1
+ let start = col('.') - 1
+ while start >= 0 && line[start - 1] =~ '[a-zA-Z_0-9\x7f-\xff$]'
+ let start -= 1
+ endwhile
+ endif
+ else
+ let b:compl_context = getline('.')[0:compl_begin]
+ endif
return start
else
- " Initialize base return lists
+ " Initialize base return lists
let res = []
let res2 = []
- " a:base is very short - we need context
- let context = b:compl_context
- " Check if we should do CSS completion inside of <style> tag
- " or JS completion inside of <script> tag or PHP completion in case of <?
- " tag AND &ft==php
- if exists("b:csscompl")
- unlet! b:csscompl
- let context = b:compl_context
- unlet! b:compl_context
- return csscomplete#CompleteCSS(0, context)
- elseif exists("b:jscompl")
- unlet! b:jscompl
- return javascriptcomplete#CompleteJS(0, a:base)
- elseif exists("b:phpcompl")
- unlet! b:phpcompl
- let context = b:compl_context
- return phpcomplete#CompletePHP(0, a:base)
- else
- if len(b:compl_context) == 0 && !exists("b:entitiescompl")
- return []
- endif
- let context = matchstr(b:compl_context, '.\zs.*')
- endif
- unlet! b:compl_context
- " Entities completion {{{
- if exists("b:entitiescompl")
- unlet! b:entitiescompl
-
- if !exists("b:html_omni")
- call htmlcomplete#CheckDoctype()
- call htmlcomplete#LoadData()
- endif
+ " a:base is very short - we need context
+ let context = b:compl_context
+ " Check if we should do CSS completion inside of <style> tag
+ " or JS completion inside of <script> tag or PHP completion in case of <?
+ " tag AND &ft==php
+ if exists("b:csscompl")
+ unlet! b:csscompl
+ let context = b:compl_context
+ unlet! b:compl_context
+ return csscomplete#CompleteCSS(0, context)
+ elseif exists("b:jscompl")
+ unlet! b:jscompl
+ return javascriptcomplete#CompleteJS(0, a:base)
+ elseif exists("b:phpcompl")
+ unlet! b:phpcompl
+ let context = b:compl_context
+ return phpcomplete#CompletePHP(0, a:base)
+ else
+ if len(b:compl_context) == 0 && !exists("b:entitiescompl")
+ return []
+ endif
+ let context = matchstr(b:compl_context, '.\zs.*')
+ endif
+ unlet! b:compl_context
+ " Entities completion {{{
+ if exists("b:entitiescompl")
+ unlet! b:entitiescompl
+
+ if !exists("b:html_omni")
+ call htmlcomplete#CheckDoctype()
+ call htmlcomplete#LoadData()
+ endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
call htmlcomplete#LoadAria()
endif
let entities = b:html_omni['vimxmlentities']
- if len(a:base) == 1
- for m in entities
- if m =~ '^'.a:base
- call add(res, m.';')
- endif
- endfor
- return res
- else
- for m in entities
- if m =~? '^'.a:base
- call add(res, m.';')
- elseif m =~? a:base
- call add(res2, m.';')
- endif
- endfor
-
- return res + res2
- endif
-
-
- endif
- " }}}
- if context =~ '>'
- " Generally if context contains > it means we are outside of tag and
- " should abandon action - with one exception: <style> span { bo
- if context =~ 'style[^>]\{-}>[^<]\{-}$'
- return csscomplete#CompleteCSS(0, context)
- elseif context =~ 'script[^>]\{-}>[^<]\{-}$'
- let b:jsrange = [line('.'), search('<\/script\>', 'nW')]
- return javascriptcomplete#CompleteJS(0, context)
- else
- return []
- endif
- endif
-
- " If context contains > it means we are already outside of tag and we
- " should abandon action
- " If context contains white space it is attribute.
- " It can be also value of attribute.
- " We have to get first word to offer proper completions
- if context == ''
- let tag = ''
- else
- let tag = split(context)[0]
- " Detect if tag is uppercase to return in proper case,
- " we need to make it lowercase for processing
- if tag =~ '^\u*$'
- let uppercase_tag = 1
- let tag = tolower(tag)
- else
- let uppercase_tag = 0
- endif
- endif
- " Get last word, it should be attr name
- let attr = matchstr(context, '\S\+="[^"]*$')
+ if len(a:base) == 1
+ for m in entities
+ if m =~ '^'.a:base
+ call add(res, m.';')
+ endif
+ endfor
+ return res
+ else
+ for m in entities
+ if m =~? '^'.a:base
+ call add(res, m.';')
+ elseif m =~? a:base
+ call add(res2, m.';')
+ endif
+ endfor
+
+ return res + res2
+ endif
+
+
+ endif
+ " }}}
+ if context =~ '>'
+ " Generally if context contains > it means we are outside of tag and
+ " should abandon action - with one exception: <style> span { bo
+ if context =~ 'style[^>]\{-}>[^<]\{-}$'
+ return csscomplete#CompleteCSS(0, context)
+ elseif context =~ 'script[^>]\{-}>[^<]\{-}$'
+ let b:jsrange = [line('.'), search('<\/script\>', 'nW')]
+ return javascriptcomplete#CompleteJS(0, context)
+ else
+ return []
+ endif
+ endif
+
+ " If context contains > it means we are already outside of tag and we
+ " should abandon action
+ " If context contains white space it is attribute.
+ " It can be also value of attribute.
+ " We have to get first word to offer proper completions
+ if context == ''
+ let tag = ''
+ else
+ let tag = split(context)[0]
+ " Detect if tag is uppercase to return in proper case,
+ " we need to make it lowercase for processing
+ if tag =~ '^\u*$'
+ let uppercase_tag = 1
+ let tag = tolower(tag)
+ else
+ let uppercase_tag = 0
+ endif
+ endif
+ " Get last word, it should be attr name
+ let attr = matchstr(context, '\S\+="[^"]*$')
if attr == ''
let attr = matchstr(context, '.*\s\zs.*')
endif
- " Possible situations where any prediction would be difficult:
- " 1. Events attributes
- if context =~ '\s'
- " Sort out style, class, and on* cases
- if context =~? "\\s\\(on[a-z]+\\|id\\|style\\|class\\)\\s*=\\s*[\"']"
- " Id, class completion {{{
- if context =~? "\\(id\\|class\\)\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
- if context =~? "class\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
- let search_for = "class"
- elseif context =~? "id\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
- let search_for = "id"
- endif
- " Handle class name completion
- " 1. Find lines of <link stylesheet>
- " 1a. Check file for @import
- " 2. Extract filename(s?) of stylesheet,
- call cursor(1,1)
- let head = getline(search('<head\>'), search('<\/head>'))
- let headjoined = join(copy(head), ' ')
- if headjoined =~ '<style'
- " Remove possibly confusing CSS operators
- let stylehead = substitute(headjoined, '+>\*[,', ' ', 'g')
- if search_for == 'class'
- let styleheadlines = split(stylehead)
- let headclasslines = filter(copy(styleheadlines), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'")
- else
- let stylesheet = split(headjoined, '[{}]')
- " Get all lines which fit id syntax
- let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'")
- " Filter out possible color definitions
- call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'")
- " Filter out complex border definitions
- call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'")
- let templines = join(classlines, ' ')
- let headclasslines = split(templines)
- call filter(headclasslines, "v:val =~ '#[a-zA-Z0-9_-]\\+'")
- endif
- let internal = 1
- else
- let internal = 0
- endif
- let styletable = []
- let secimportfiles = []
- let filestable = filter(copy(head), "v:val =~ '\\(@import\\|link.*stylesheet\\)'")
- for line in filestable
- if line =~ "@import"
- let styletable += [matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze")]
- elseif line =~ "<link"
- let styletable += [matchstr(line, "href\\s*=\\s*[\"']\\zs\\f\\+\\ze")]
- endif
- endfor
- for file in styletable
- if filereadable(file)
- let stylesheet = readfile(file)
- let secimport = filter(copy(stylesheet), "v:val =~ '@import'")
- if len(secimport) > 0
- for line in secimport
- let secfile = matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze")
- let secfile = fnamemodify(file, ":p:h").'/'.secfile
- let secimportfiles += [secfile]
- endfor
- endif
- endif
- endfor
- let cssfiles = styletable + secimportfiles
- let classes = []
- for file in cssfiles
- if filereadable(file)
- let stylesheet = readfile(file)
- let stylefile = join(stylesheet, ' ')
- let stylefile = substitute(stylefile, '+>\*[,', ' ', 'g')
- if search_for == 'class'
- let stylesheet = split(stylefile)
- let classlines = filter(copy(stylesheet), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'")
- else
- let stylesheet = split(stylefile, '[{}]')
- " Get all lines which fit id syntax
- let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'")
- " Filter out possible color definitions
- call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'")
- " Filter out complex border definitions
- call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'")
- let templines = join(classlines, ' ')
- let stylelines = split(templines)
- let classlines = filter(stylelines, "v:val =~ '#[a-zA-Z0-9_-]\\+'")
-
- endif
+ " Possible situations where any prediction would be difficult:
+ " 1. Events attributes
+ if context =~ '\s'
+ " Sort out style, class, and on* cases
+ if context =~? "\\(id\\|class\\)\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
+ \ || context =~? "style\\s*=\\s*[\"'][^\"']*$"
+ \ || context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$'
+ " Id, class completion {{{
+ if context =~? "\\(id\\|class\\)\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
+ if context =~? "class\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
+ let search_for = "class"
+ elseif context =~? "id\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
+ let search_for = "id"
+ endif
+ " Handle class name completion
+ " 1. Find lines of <link stylesheet>
+ " 1a. Check file for @import
+ " 2. Extract filename(s?) of stylesheet,
+ call cursor(1,1)
+ let head = getline(search('<head\>'), search('<\/head>'))
+ let headjoined = join(copy(head), ' ')
+ if headjoined =~ '<style'
+ " Remove possibly confusing CSS operators
+ let stylehead = substitute(headjoined, '+>\*[,', ' ', 'g')
+ if search_for == 'class'
+ let styleheadlines = split(stylehead)
+ let headclasslines = filter(copy(styleheadlines), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'")
+ else
+ let stylesheet = split(headjoined, '[{}]')
+ " Get all lines which fit id syntax
+ let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'")
+ " Filter out possible color definitions
+ call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'")
+ " Filter out complex border definitions
+ call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'")
+ let templines = join(classlines, ' ')
+ let headclasslines = split(templines)
+ call filter(headclasslines, "v:val =~ '#[a-zA-Z0-9_-]\\+'")
+ endif
+ let internal = 1
+ else
+ let internal = 0
+ endif
+ let styletable = []
+ let secimportfiles = []
+ let filestable = filter(copy(head), "v:val =~ '\\(@import\\|link.*stylesheet\\)'")
+ for line in filestable
+ if line =~ "@import"
+ let styletable += [matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze")]
+ elseif line =~ "<link"
+ let styletable += [matchstr(line, "href\\s*=\\s*[\"']\\zs\\f\\+\\ze")]
+ endif
+ endfor
+ for file in styletable
+ if filereadable(file)
+ let stylesheet = readfile(file)
+ let secimport = filter(copy(stylesheet), "v:val =~ '@import'")
+ if len(secimport) > 0
+ for line in secimport
+ let secfile = matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze")
+ let secfile = fnamemodify(file, ":p:h").'/'.secfile
+ let secimportfiles += [secfile]
+ endfor
+ endif
+ endif
+ endfor
+ let cssfiles = styletable + secimportfiles
+ let classes = []
+ for file in cssfiles
+ if filereadable(file)
+ let stylesheet = readfile(file)
+ let stylefile = join(stylesheet, ' ')
+ let stylefile = substitute(stylefile, '+>\*[,', ' ', 'g')
+ if search_for == 'class'
+ let stylesheet = split(stylefile)
+ let classlines = filter(copy(stylesheet), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'")
+ else
+ let stylesheet = split(stylefile, '[{}]')
+ " Get all lines which fit id syntax
+ let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'")
+ " Filter out possible color definitions
+ call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'")
+ " Filter out complex border definitions
+ call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'")
+ let templines = join(classlines, ' ')
+ let stylelines = split(templines)
+ let classlines = filter(stylelines, "v:val =~ '#[a-zA-Z0-9_-]\\+'")
+
+ endif
" We gathered classes definitions from all external files
let classes += classlines
- endif
- endfor
- if internal == 1
- let classes += headclasslines
- endif
-
- if search_for == 'class'
- let elements = {}
- for element in classes
- if element =~ '^\.'
- let class = matchstr(element, '^\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze')
- let class = substitute(class, ':.*', '', '')
- if has_key(elements, 'common')
- let elements['common'] .= ' '.class
- else
- let elements['common'] = class
- endif
- else
- let class = matchstr(element, '[a-zA-Z1-6]*\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze')
- let tagname = tolower(matchstr(element, '[a-zA-Z1-6]*\ze.'))
- if tagname != ''
- if has_key(elements, tagname)
- let elements[tagname] .= ' '.class
- else
- let elements[tagname] = class
- endif
- endif
- endif
- endfor
-
- if has_key(elements, tag) && has_key(elements, 'common')
- let values = split(elements[tag]." ".elements['common'])
- elseif has_key(elements, tag) && !has_key(elements, 'common')
- let values = split(elements[tag])
- elseif !has_key(elements, tag) && has_key(elements, 'common')
- let values = split(elements['common'])
- else
- return []
- endif
-
- elseif search_for == 'id'
- " Find used IDs
- " 1. Catch whole file
- let filelines = getline(1, line('$'))
- " 2. Find lines with possible id
- let used_id_lines = filter(filelines, 'v:val =~ "id\\s*=\\s*[\"''][a-zA-Z0-9_-]\\+"')
- " 3a. Join all filtered lines
- let id_string = join(used_id_lines, ' ')
- " 3b. And split them to be sure each id is in separate item
- let id_list = split(id_string, 'id\s*=\s*')
- " 4. Extract id values
- let used_id = map(id_list, 'matchstr(v:val, "[\"'']\\zs[a-zA-Z0-9_-]\\+\\ze")')
- let joined_used_id = ','.join(used_id, ',').','
-
- let allvalues = map(classes, 'matchstr(v:val, ".*#\\zs[a-zA-Z0-9_-]\\+")')
-
- let values = []
-
- for element in classes
- if joined_used_id !~ ','.element.','
- let values += [element]
- endif
-
- endfor
-
- endif
-
- " We need special version of sbase
- let classbase = matchstr(context, ".*[\"']")
- let classquote = matchstr(classbase, '.$')
-
- let entered_class = matchstr(attr, ".*=\\s*[\"']\\zs.*")
-
- for m in sort(values)
- if m =~? '^'.entered_class
- call add(res, m . classquote)
- elseif m =~? entered_class
- call add(res2, m . classquote)
- endif
- endfor
-
- return res + res2
-
- elseif context =~? "style\\s*=\\s*[\"'][^\"']*$"
- return csscomplete#CompleteCSS(0, context)
-
- endif
- " }}}
- " Complete on-events {{{
- if context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$'
- " We have to:
- " 1. Find external files
- let b:js_extfiles = []
- let l = line('.')
- let c = col('.')
- call cursor(1,1)
- while search('<\@<=script\>', 'W') && line('.') <= l
- if synIDattr(synID(line('.'),col('.')-1,0),"name") !~? 'comment'
- let sname = matchstr(getline('.'), '<script[^>]*src\s*=\s*\([''"]\)\zs.\{-}\ze\1')
- if filereadable(sname)
- let b:js_extfiles += readfile(sname)
- endif
- endif
- endwhile
- " 2. Find at least one <script> tag
- call cursor(1,1)
- let js_scripttags = []
- while search('<script\>', 'W') && line('.') < l
- if matchstr(getline('.'), '<script[^>]*src') == ''
- let js_scripttag = getline(line('.'), search('</script>', 'W'))
- let js_scripttags += js_scripttag
- endif
- endwhile
- let b:js_extfiles += js_scripttags
-
- " 3. Proper call for javascriptcomplete#CompleteJS
- call cursor(l,c)
- let js_context = matchstr(a:base, '\k\+$')
- let js_shortcontext = substitute(a:base, js_context.'$', '', '')
- let b:compl_context = context
- let b:jsrange = [l, l]
- unlet! l c
- return javascriptcomplete#CompleteJS(0, js_context)
-
- endif
-
- " }}}
- let stripbase = matchstr(context, ".*\\(on[a-zA-Z]*\\|style\\|class\\)\\s*=\\s*[\"']\\zs.*")
- " Now we have context stripped from all chars up to style/class.
- " It may fail with some strange style value combinations.
- if stripbase !~ "[\"']"
- return []
- endif
- endif
- " Value of attribute completion {{{
- " If attr contains =\s*[\"'] we catched value of attribute
- if attr =~ "=\s*[\"']" || attr =~ "=\s*$"
- " Let do attribute specific completion
- let attrname = matchstr(attr, '.*\ze\s*=')
- let entered_value = matchstr(attr, ".*=\\s*[\"']\\?\\zs.*")
- let values = []
- " Load data {{{
- if !exists("b:html_omni")
- call htmlcomplete#CheckDoctype()
- call htmlcomplete#LoadData()
- endif
+ endif
+ endfor
+ if internal == 1
+ let classes += headclasslines
+ endif
+
+ if search_for == 'class'
+ let elements = {}
+ for element in classes
+ if element =~ '^\.'
+ let class = matchstr(element, '^\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze')
+ let class = substitute(class, ':.*', '', '')
+ if has_key(elements, 'common')
+ let elements['common'] .= ' '.class
+ else
+ let elements['common'] = class
+ endif
+ else
+ let class = matchstr(element, '[a-zA-Z1-6]*\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze')
+ let tagname = tolower(matchstr(element, '[a-zA-Z1-6]*\ze.'))
+ if tagname != ''
+ if has_key(elements, tagname)
+ let elements[tagname] .= ' '.class
+ else
+ let elements[tagname] = class
+ endif
+ endif
+ endif
+ endfor
+
+ if has_key(elements, tag) && has_key(elements, 'common')
+ let values = split(elements[tag]." ".elements['common'])
+ elseif has_key(elements, tag) && !has_key(elements, 'common')
+ let values = split(elements[tag])
+ elseif !has_key(elements, tag) && has_key(elements, 'common')
+ let values = split(elements['common'])
+ else
+ return []
+ endif
+
+ elseif search_for == 'id'
+ " Find used IDs
+ " 1. Catch whole file
+ let filelines = getline(1, line('$'))
+ " 2. Find lines with possible id
+ let used_id_lines = filter(filelines, 'v:val =~ "id\\s*=\\s*[\"''][a-zA-Z0-9_-]\\+"')
+ " 3a. Join all filtered lines
+ let id_string = join(used_id_lines, ' ')
+ " 3b. And split them to be sure each id is in separate item
+ let id_list = split(id_string, 'id\s*=\s*')
+ " 4. Extract id values
+ let used_id = map(id_list, 'matchstr(v:val, "[\"'']\\zs[a-zA-Z0-9_-]\\+\\ze")')
+ let joined_used_id = ','.join(used_id, ',').','
+
+ let allvalues = map(classes, 'matchstr(v:val, ".*#\\zs[a-zA-Z0-9_-]\\+")')
+
+ let values = []
+
+ for element in classes
+ if joined_used_id !~ ','.element.','
+ let values += [element]
+ endif
+
+ endfor
+
+ endif
+
+ " We need special version of sbase
+ let classbase = matchstr(context, ".*[\"']")
+ let classquote = matchstr(classbase, '.$')
+
+ let entered_class = matchstr(attr, ".*=\\s*[\"']\\zs.*")
+
+ for m in sort(values)
+ if m =~? '^'.entered_class
+ call add(res, m . classquote)
+ elseif m =~? entered_class
+ call add(res2, m . classquote)
+ endif
+ endfor
+
+ return res + res2
+
+ elseif context =~? "style\\s*=\\s*[\"'][^\"']*$"
+ return csscomplete#CompleteCSS(0, context)
+
+ endif
+ " }}}
+ " Complete on-events {{{
+ if context =~? 'on[a-z]*\s*=\s*\(''[^'']*\|"[^"]*\)$'
+ " We have to:
+ " 1. Find external files
+ let b:js_extfiles = []
+ let l = line('.')
+ let c = col('.')
+ call cursor(1,1)
+ while search('<\@<=script\>', 'W') && line('.') <= l
+ if synIDattr(synID(line('.'),col('.')-1,0),"name") !~? 'comment'
+ let sname = matchstr(getline('.'), '<script[^>]*src\s*=\s*\([''"]\)\zs.\{-}\ze\1')
+ if filereadable(sname)
+ let b:js_extfiles += readfile(sname)
+ endif
+ endif
+ endwhile
+ " 2. Find at least one <script> tag
+ call cursor(1,1)
+ let js_scripttags = []
+ while search('<script\>', 'W') && line('.') < l
+ if matchstr(getline('.'), '<script[^>]*src') == ''
+ let js_scripttag = getline(line('.'), search('</script>', 'W'))
+ let js_scripttags += js_scripttag
+ endif
+ endwhile
+ let b:js_extfiles += js_scripttags
+
+ " 3. Proper call for javascriptcomplete#CompleteJS
+ call cursor(l,c)
+ let js_context = matchstr(a:base, '\k\+$')
+ let js_shortcontext = substitute(a:base, js_context.'$', '', '')
+ let b:compl_context = context
+ let b:jsrange = [l, l]
+ unlet! l c
+ return javascriptcomplete#CompleteJS(0, js_context)
+
+ endif
+
+ " }}}
+ let stripbase = matchstr(context, ".*\\(on[a-zA-Z]*\\|style\\|class\\)\\s*=\\s*[\"']\\zs.*")
+ " Now we have context stripped from all chars up to style/class.
+ " It may fail with some strange style value combinations.
+ if stripbase !~ "[\"']"
+ return []
+ endif
+ endif
+ " Value of attribute completion {{{
+ " If attr contains =\s*[\"'] we catched value of attribute
+ if attr =~ "=\s*[\"']" || attr =~ "=\s*$"
+ " Let do attribute specific completion
+ let attrname = matchstr(attr, '.*\ze\s*=')
+ let entered_value = matchstr(attr, ".*=\\s*[\"']\\?\\zs.*")
+ let values = []
+ " Load data {{{
+ if !exists("b:html_omni")
+ call htmlcomplete#CheckDoctype()
+ call htmlcomplete#LoadData()
+ endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
call htmlcomplete#LoadAria()
endif
- " }}}
- if attrname == 'href'
- " Now we are looking for local anchors defined by name or id
- if entered_value =~ '^#'
- let file = join(getline(1, line('$')), ' ')
- " Split it be sure there will be one id/name element in
- " item, it will be also first word [a-zA-Z0-9_-] in element
- let oneelement = split(file, "\\(meta \\)\\@<!\\(name\\|id\\)\\s*=\\s*[\"']")
- for i in oneelement
- let values += ['#'.matchstr(i, "^[a-zA-Z][a-zA-Z0-9%_-]*")]
- endfor
- endif
- else
- if has_key(b:html_omni, tag) && has_key(b:html_omni[tag][1], attrname)
- let values = b:html_omni[tag][1][attrname]
+ " }}}
+ if attrname == 'href'
+ " Now we are looking for local anchors defined by name or id
+ if entered_value =~ '^#'
+ let file = join(getline(1, line('$')), ' ')
+ " Split it be sure there will be one id/name element in
+ " item, it will be also first word [a-zA-Z0-9_-] in element
+ let oneelement = split(file, "\\(meta \\)\\@<!\\(name\\|id\\)\\s*=\\s*[\"']")
+ for i in oneelement
+ let values += ['#'.matchstr(i, "^[a-zA-Z][a-zA-Z0-9%_-]*")]
+ endfor
+ endif
+ else
+ if has_key(b:html_omni, tag) && has_key(b:html_omni[tag][1], attrname)
+ let values = b:html_omni[tag][1][attrname]
elseif attrname =~ '^aria-' && exists("b:aria_omni") && has_key(b:aria_omni['aria_attributes'], attrname)
- let values = b:aria_omni['aria_attributes'][attrname]
- else
- return []
- endif
- endif
-
- if len(values) == 0
- return []
+ let values = b:aria_omni['aria_attributes'][attrname]
+ else
+ return []
+ endif
+ endif
+
+ if len(values) == 0
+ return []
endif
- " We need special version of sbase
- let attrbase = matchstr(context, ".*[\"']")
- let attrquote = matchstr(attrbase, '.$')
- if attrquote !~ "['\"]"
- let attrquoteopen = '"'
+ " We need special version of sbase
+ let attrbase = matchstr(context, ".*[\"']")
+ let attrquote = matchstr(attrbase, '.$')
+ if attrquote !~ "['\"]"
+ let attrquoteopen = '"'
let attrquote = '"'
- else
- let attrquoteopen = ''
+ else
+ let attrquoteopen = ''
endif
" Multi value attributes don't need ending quote
let info = ''
@@ -563,39 +565,39 @@ function! htmlcomplete#CompleteTags(findstart, base)
let entered_value = split(entered_value)[-1]
endif
endif
- for m in values
- " This if is needed to not offer all completions as-is
- " alphabetically but sort them. Those beginning with entered
- " part will be as first choices
- if m =~ '^'.entered_value
- call add(res, attrquoteopen . m . attrquote)
- elseif m =~ entered_value
- call add(res2, attrquoteopen . m . attrquote)
- endif
- endfor
-
- return res + res2
-
- endif
- " }}}
- " Attribute completion {{{
- " Shorten context to not include last word
- let sbase = matchstr(context, '.*\ze\s.*')
-
- " Load data {{{
- if !exists("b:html_omni")
- call htmlcomplete#CheckDoctype()
- call htmlcomplete#LoadData()
- endif
+ for m in values
+ " This if is needed to not offer all completions as-is
+ " alphabetically but sort them. Those beginning with entered
+ " part will be as first choices
+ if m =~ '^'.entered_value
+ call add(res, attrquoteopen . m . attrquote)
+ elseif m =~ entered_value
+ call add(res2, attrquoteopen . m . attrquote)
+ endif
+ endfor
+
+ return res + res2
+
+ endif
+ " }}}
+ " Attribute completion {{{
+ " Shorten context to not include last word
+ let sbase = matchstr(context, '.*\ze\s.*')
+
+ " Load data {{{
+ if !exists("b:html_omni")
+ call htmlcomplete#CheckDoctype()
+ call htmlcomplete#LoadData()
+ endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
call htmlcomplete#LoadAria()
endif
- " }}}
+ " }}}
- if has_key(b:html_omni, tag)
- let attrs = keys(b:html_omni[tag][1])
- else
- return []
+ if has_key(b:html_omni, tag)
+ let attrs = keys(b:html_omni[tag][1])
+ else
+ return []
endif
if exists("b:aria_omni")
let roles = []
@@ -617,28 +619,28 @@ function! htmlcomplete#CompleteTags(findstart, base)
endfor
endif
- for m in sort(attrs)
- if m =~ '^'.attr
- call add(res, m)
- elseif m =~ attr
- call add(res2, m)
- endif
- endfor
- "let menu = res + res2
- let menu = res
- if has_key(b:html_omni, 'vimxmlattrinfo') || (exists("b:aria_omni") && has_key(b:aria_omni, 'vimariaattrinfo'))
- let final_menu = []
- for i in range(len(menu))
- let item = menu[i]
- if has_key(b:html_omni['vimxmlattrinfo'], item)
- let m_menu = b:html_omni['vimxmlattrinfo'][item][0]
- let m_info = b:html_omni['vimxmlattrinfo'][item][1]
+ for m in sort(attrs)
+ if m =~ '^'.attr
+ call add(res, m)
+ elseif m =~ attr
+ call add(res2, m)
+ endif
+ endfor
+ "let menu = res + res2
+ let menu = res
+ if has_key(b:html_omni, 'vimxmlattrinfo') || (exists("b:aria_omni") && has_key(b:aria_omni, 'vimariaattrinfo'))
+ let final_menu = []
+ for i in range(len(menu))
+ let item = menu[i]
+ if has_key(b:html_omni['vimxmlattrinfo'], item)
+ let m_menu = b:html_omni['vimxmlattrinfo'][item][0]
+ let m_info = b:html_omni['vimxmlattrinfo'][item][1]
elseif exists("b:aria_omni") && has_key(b:aria_omni['vimariaattrinfo'], item)
- let m_menu = b:aria_omni['vimariaattrinfo'][item][0]
- let m_info = b:aria_omni['vimariaattrinfo'][item][1]
+ let m_menu = b:aria_omni['vimariaattrinfo'][item][0]
+ let m_info = b:aria_omni['vimariaattrinfo'][item][1]
else
- let m_menu = ''
- let m_info = ''
+ let m_menu = ''
+ let m_info = ''
endif
if item =~ '^aria-' && exists("b:aria_omni")
if len(b:aria_omni['aria_attributes'][item]) > 0 && b:aria_omni['aria_attributes'][item][0] =~ '^\(BOOL\|'.item.'\)$'
@@ -655,128 +657,128 @@ function! htmlcomplete#CompleteTags(findstart, base)
let item .= '="'
endif
endif
- let final_menu += [{'word':item, 'menu':m_menu, 'info':m_info}]
- endfor
- else
- let final_menu = []
- for i in range(len(menu))
- let item = menu[i]
- if len(b:html_omni[tag][1][item]) > 0 && b:html_omni[tag][1][item][0] =~ '^\(BOOL\|'.item.'\)$'
- let item = item
- else
- let item .= '="'
- endif
- let final_menu += [item]
- endfor
- return final_menu
-
- endif
- return final_menu
-
- endif
- " }}}
- " Close tag {{{
- let b:unaryTagsStack = "area base br col command embed hr img input keygen link meta param source track wbr"
- if context =~ '^\/'
- if context =~ '^\/.'
- return []
- else
- let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
- return [opentag.">"]
- endif
- endif
- " }}}
- " Load data {{{
- if !exists("b:html_omni")
- call htmlcomplete#CheckDoctype()
- call htmlcomplete#LoadData()
- endif
+ let final_menu += [{'word':item, 'menu':m_menu, 'info':m_info}]
+ endfor
+ else
+ let final_menu = []
+ for i in range(len(menu))
+ let item = menu[i]
+ if len(b:html_omni[tag][1][item]) > 0 && b:html_omni[tag][1][item][0] =~ '^\(BOOL\|'.item.'\)$'
+ let item = item
+ else
+ let item .= '="'
+ endif
+ let final_menu += [item]
+ endfor
+ return final_menu
+
+ endif
+ return final_menu
+
+ endif
+ " }}}
+ " Close tag {{{
+ let b:unaryTagsStack = "area base br col command embed hr img input keygen link meta param source track wbr"
+ if context =~ '^\/'
+ if context =~ '^\/.'
+ return []
+ else
+ let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
+ return [opentag.">"]
+ endif
+ endif
+ " }}}
+ " Load data {{{
+ if !exists("b:html_omni")
+ call htmlcomplete#CheckDoctype()
+ call htmlcomplete#LoadData()
+ endif
if g:aria_attributes_complete == 1 && !exists("b:aria_omni")
call htmlcomplete#LoadAria()
endif
- " }}}
- " Tag completion {{{
- " Deal with tag completion.
- let opentag = tolower(xmlcomplete#GetLastOpenTag("b:unaryTagsStack"))
- " MM: TODO: GLOT works always the same but with some weird situation it
- " behaves as intended in HTML but screws in PHP
- if opentag == '' || &filetype == 'php' && !has_key(b:html_omni, opentag)
- " Hack for sometimes failing GetLastOpenTag.
- " As far as I tested fail isn't GLOT fault but problem
- " of invalid document - not properly closed tags and other mish-mash.
- " Also when document is empty. Return list of *all* tags.
- let tags = keys(b:html_omni)
- call filter(tags, 'v:val !~ "^vimxml"')
- else
- if has_key(b:html_omni, opentag)
- let tags = b:html_omni[opentag][0]
- else
- return []
- endif
- endif
- " }}}
-
- if exists("uppercase_tag") && uppercase_tag == 1
- let context = tolower(context)
- endif
- " Handle XML keywords: DOCTYPE
- if opentag == ''
- let tags = [
- \ '!DOCTYPE html>',
- \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">',
- \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">',
- \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">',
- \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "http://www.w3.org/TR/REC-html40/frameset.dtd">',
- \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
- \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
- \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
- \ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
- \ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
- \ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
- \ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/1999/xhtml">'
- \ ] + sort(tags)
- endif
-
- "for m in sort(tags)
- for m in tags
- if m =~ '^'.context
- call add(res, m)
- elseif m =~ context
- call add(res2, m)
- endif
- endfor
- let menu = res + res2
- if has_key(b:html_omni, 'vimxmltaginfo')
- let final_menu = []
- for i in range(len(menu))
- let item = menu[i]
- if has_key(b:html_omni['vimxmltaginfo'], item)
- let m_menu = b:html_omni['vimxmltaginfo'][item][0]
- let m_info = b:html_omni['vimxmltaginfo'][item][1]
- else
- let m_menu = ''
- let m_info = ''
- endif
- if &filetype == 'html' && exists("uppercase_tag") && uppercase_tag == 1 && item !~ 'DOCTYPE'
- let item = toupper(item)
- endif
- if item =~ 'DOCTYPE'
+ " }}}
+ " Tag completion {{{
+ " Deal with tag completion.
+ let opentag = tolower(xmlcomplete#GetLastOpenTag("b:unaryTagsStack"))
+ " MM: TODO: GLOT works always the same but with some weird situation it
+ " behaves as intended in HTML but screws in PHP
+ if opentag == '' || &filetype == 'php' && !has_key(b:html_omni, opentag)
+ " Hack for sometimes failing GetLastOpenTag.
+ " As far as I tested fail isn't GLOT fault but problem
+ " of invalid document - not properly closed tags and other mish-mash.
+ " Also when document is empty. Return list of *all* tags.
+ let tags = keys(b:html_omni)
+ call filter(tags, 'v:val !~ "^vimxml"')
+ else
+ if has_key(b:html_omni, opentag)
+ let tags = b:html_omni[opentag][0]
+ else
+ return []
+ endif
+ endif
+ " }}}
+
+ if exists("uppercase_tag") && uppercase_tag == 1
+ let context = tolower(context)
+ endif
+ " Handle XML keywords: DOCTYPE
+ if opentag == ''
+ let tags = [
+ \ '!DOCTYPE html>',
+ \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">',
+ \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">',
+ \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">',
+ \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "http://www.w3.org/TR/REC-html40/frameset.dtd">',
+ \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
+ \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
+ \ '!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
+ \ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
+ \ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
+ \ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
+ \ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/1999/xhtml">'
+ \ ] + sort(tags)
+ endif
+
+ "for m in sort(tags)
+ for m in tags
+ if m =~ '^'.context
+ call add(res, m)
+ elseif m =~ context
+ call add(res2, m)
+ endif
+ endfor
+ let menu = res + res2
+ if has_key(b:html_omni, 'vimxmltaginfo')
+ let final_menu = []
+ for i in range(len(menu))
+ let item = menu[i]
+ if has_key(b:html_omni['vimxmltaginfo'], item)
+ let m_menu = b:html_omni['vimxmltaginfo'][item][0]
+ let m_info = b:html_omni['vimxmltaginfo'][item][1]
+ else
+ let m_menu = ''
+ let m_info = ''
+ endif
+ if &filetype == 'html' && exists("uppercase_tag") && uppercase_tag == 1 && item !~ 'DOCTYPE'
+ let item = toupper(item)
+ endif
+ if item =~ 'DOCTYPE'
if item =~ 'DTD'
let abbr = 'DOCTYPE '.matchstr(item, 'DTD \zsX\?HTML .\{-}\ze\/\/')
else
let abbr = 'DOCTYPE HTML 5'
endif
- else
- let abbr = item
- endif
- let final_menu += [{'abbr':abbr, 'word':item, 'menu':m_menu, 'info':m_info}]
- endfor
- else
- let final_menu = menu
- endif
- return final_menu
-
- " }}}
+ else
+ let abbr = item
+ endif
+ let final_menu += [{'abbr':abbr, 'word':item, 'menu':m_menu, 'info':m_info}]
+ endfor
+ else
+ let final_menu = menu
+ endif
+ return final_menu
+
+ " }}}
endif
endfunction
@@ -794,48 +796,48 @@ function! htmlcomplete#LoadAria() " {{{
endfunction
" }}}
function! htmlcomplete#LoadData() " {{{
- if !exists("b:html_omni_flavor")
- if &filetype == 'html'
- let b:html_omni_flavor = 'html5'
- else
- let b:html_omni_flavor = 'html5'
- endif
- endif
- " With that if we still have bloated memory but create new buffer
- " variables only by linking to existing g:variable, not sourcing whole
- " file.
- if exists('g:xmldata_'.b:html_omni_flavor)
- exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor
- else
- exe 'runtime! autoload/xml/'.b:html_omni_flavor.'.vim'
- exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor
- endif
+ if !exists("b:html_omni_flavor")
+ if &filetype == 'html'
+ let b:html_omni_flavor = 'html5'
+ else
+ let b:html_omni_flavor = 'html5'
+ endif
+ endif
+ " With that if we still have bloated memory but create new buffer
+ " variables only by linking to existing g:variable, not sourcing whole
+ " file.
+ if exists('g:xmldata_'.b:html_omni_flavor)
+ exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor
+ else
+ exe 'runtime! autoload/xml/'.b:html_omni_flavor.'.vim'
+ exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor
+ endif
endfunction
" }}}
function! htmlcomplete#CheckDoctype() " {{{
- if exists('b:html_omni_flavor')
- let old_flavor = b:html_omni_flavor
- else
- let old_flavor = ''
- endif
- call htmlcomplete#DetectOmniFlavor()
- if !exists('b:html_omni_flavor')
- return
- else
- " Tie g:xmldata with b:html_omni this way we need to sourca data file only
- " once, not every time per buffer.
- if old_flavor == b:html_omni_flavor
- return
- else
- if exists('g:xmldata_'.b:html_omni_flavor)
- exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor
- else
- exe 'runtime! autoload/xml/'.b:html_omni_flavor.'.vim'
- exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor
- endif
- return
- endif
- endif
+ if exists('b:html_omni_flavor')
+ let old_flavor = b:html_omni_flavor
+ else
+ let old_flavor = ''
+ endif
+ call htmlcomplete#DetectOmniFlavor()
+ if !exists('b:html_omni_flavor')
+ return
+ else
+ " Tie g:xmldata with b:html_omni this way we need to sourca data file only
+ " once, not every time per buffer.
+ if old_flavor == b:html_omni_flavor
+ return
+ else
+ if exists('g:xmldata_'.b:html_omni_flavor)
+ exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor
+ else
+ exe 'runtime! autoload/xml/'.b:html_omni_flavor.'.vim'
+ exe 'let b:html_omni = g:xmldata_'.b:html_omni_flavor
+ endif
+ return
+ endif
+ endif
endfunction
" }}}
" vim:set foldmethod=marker:
diff --git a/autoload/rubycomplete.vim b/autoload/rubycomplete.vim
index 9dd5d8c4..973be8ef 100644
--- a/autoload/rubycomplete.vim
+++ b/autoload/rubycomplete.vim
@@ -198,7 +198,7 @@ function! rubycomplete#Complete(findstart, base)
if c =~ '\w'
continue
elseif ! c =~ '\.'
- idx = -1
+ let idx = -1
break
else
break
diff --git a/autoload/rustfmt.vim b/autoload/rustfmt.vim
index 4cb91d60..a43c07cc 100644
--- a/autoload/rustfmt.vim
+++ b/autoload/rustfmt.vim
@@ -22,17 +22,20 @@ endif
let s:got_fmt_error = 0
-function! rustfmt#Format()
- let l:curw = winsaveview()
- let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
- call writefile(getline(1, '$'), l:tmpname)
+function! s:RustfmtCommandRange(filename, line1, line2)
+ let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]}
+ return printf("%s %s --write-mode=overwrite --file-lines '[%s]'", g:rustfmt_command, g:rustfmt_options, json_encode(l:arg))
+endfunction
- let command = g:rustfmt_command . " --write-mode=overwrite "
+function! s:RustfmtCommand(filename)
+ return g:rustfmt_command . " --write-mode=overwrite " . g:rustfmt_options . " " . shellescape(a:filename)
+endfunction
+function! s:RunRustfmt(command, curw, tmpname)
if exists("*systemlist")
- let out = systemlist(command . g:rustfmt_options . " " . shellescape(l:tmpname))
+ let out = systemlist(a:command)
else
- let out = split(system(command . g:rustfmt_options . " " . shellescape(l:tmpname)), '\r\?\n')
+ let out = split(system(a:command), '\r\?\n')
endif
if v:shell_error == 0 || v:shell_error == 3
@@ -40,7 +43,7 @@ function! rustfmt#Format()
try | silent undojoin | catch | endtry
" Replace current file with temp file, then reload buffer
- call rename(l:tmpname, expand('%'))
+ call rename(a:tmpname, expand('%'))
silent edit!
let &syntax = &syntax
@@ -78,10 +81,30 @@ function! rustfmt#Format()
let s:got_fmt_error = 1
lwindow
" We didn't use the temp file, so clean up
- call delete(l:tmpname)
+ call delete(a:tmpname)
endif
- call winrestview(l:curw)
+ call winrestview(a:curw)
+endfunction
+
+function! rustfmt#FormatRange(line1, line2)
+ let l:curw = winsaveview()
+ let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
+ call writefile(getline(1, '$'), l:tmpname)
+
+ let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2)
+
+ call s:RunRustfmt(command, l:curw, l:tmpname)
+endfunction
+
+function! rustfmt#Format()
+ let l:curw = winsaveview()
+ let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
+ call writefile(getline(1, '$'), l:tmpname)
+
+ let command = s:RustfmtCommand(l:tmpname)
+
+ call s:RunRustfmt(command, l:curw, l:tmpname)
endfunction
endif
diff --git a/autoload/xml/html5.vim b/autoload/xml/html5.vim
index b422b2ca..cf60cd63 100644
--- a/autoload/xml/html5.vim
+++ b/autoload/xml/html5.vim
@@ -62,6 +62,8 @@ let charset = [
\ 'windows-1256', 'windows-1257', 'windows-1258', 'TIS-620', ]
" }}}
+let autofill_tokens = ['on', 'off', 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'username', 'new-password', 'current-password', 'organization-title', 'organization', 'street-address', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'url', 'photo']
+
" Attributes_and_Settings: {{{
let core_attributes = {'accesskey': [], 'class': [], 'contenteditable': ['true', 'false', ''], 'contextmenu': [], 'dir': ['ltr', 'rtl'], 'draggable': ['true', 'false'], 'hidden': ['hidden', ''], 'id': [], 'is': [], 'lang': lang_tag, 'spellcheck': ['true', 'false', ''], 'style': [], 'tabindex': [], 'title': []}
let xml_attributes = {'xml:lang': lang_tag, 'xml:space': ['preserve'], 'xml:base': [], 'xmlns': ['http://www.w3.org/1999/xhtml', 'http://www.w3.org/1998/Math/MathML', 'http://www.w3.org/2000/svg', 'http://www.w3.org/1999/xlink']}
@@ -80,7 +82,7 @@ let attributes_value = {
\ 'action': ['URL', ''],
\ 'alt': ['Text', ''],
\ 'async': ['Bool', ''],
- \ 'autocomplete': ['on/off', ''],
+ \ 'autocomplete': ['*Token', ''],
\ 'autofocus': ['Bool', ''],
\ 'autoplay': ['Bool', ''],
\ 'border': ['1', ''],
@@ -347,7 +349,7 @@ let g:xmldata_html5 = {
\ 'vimxmlroot': ['html', 'head', 'body'] + flow_elements,
\ 'a': [
\ filter(copy(flow_elements), "!(v:val =~ '". abutton_dec ."')"),
- \ extend(copy(global_attributes), {'name': [], 'href': [], 'target': [], 'rel': linktypes, 'hreflang': lang_tag, 'media': [], 'type': []})
+ \ extend(copy(global_attributes), {'name': [], 'href': [], 'target': [], 'rel': linktypes, 'hreflang': lang_tag, 'media': [], 'type': [], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url']})
\ ],
\ 'abbr': [
\ phrasing_elements,
@@ -359,7 +361,7 @@ let g:xmldata_html5 = {
\ ],
\ 'area': [
\ [],
- \ extend(copy(global_attributes), {'alt': [], 'href': [], 'target': [], 'rel': linktypes, 'media': [], 'hreflang': lang_tag, 'type': [], 'shape': ['rect', 'circle', 'poly', 'default'], 'coords': []})
+ \ extend(copy(global_attributes), {'alt': [], 'href': [], 'target': [], 'rel': linktypes, 'media': [], 'hreflang': lang_tag, 'type': [], 'shape': ['rect', 'circle', 'poly', 'default'], 'coords': [], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url']})
\ ],
\ 'article': [
\ flow_elements + ['style'],
@@ -495,7 +497,7 @@ let g:xmldata_html5 = {
\ ],
\ 'form': [
\ flow_elements,
- \ extend(copy(global_attributes), {'name': [], 'action': [], 'enctype': ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain'], 'method': ['get', 'post', 'put', 'delete'], 'target': [], 'novalidate': ['novalidate', ''], 'accept-charset': charset, 'autocomplete': ['on', 'off']})
+ \ extend(copy(global_attributes), {'name': [], 'action': [], 'enctype': ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain'], 'method': ['get', 'post', 'put', 'delete'], 'target': [], 'novalidate': ['novalidate', ''], 'accept-charset': charset, 'autocomplete': autofill_tokens})
\ ],
\ 'h1': [
\ phrasing_elements,
@@ -547,15 +549,15 @@ let g:xmldata_html5 = {
\ ],
\ 'iframe': [
\ [],
- \ extend(copy(global_attributes), {'src': [], 'srcdoc': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', '']})
+ \ extend(copy(global_attributes), {'src': [], 'srcdoc': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', ''], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url']})
\ ],
\ 'img': [
\ [],
- \ extend(copy(global_attributes), {'src': [], 'alt': [], 'height': [], 'width': [], 'usemap': [], 'ismap': ['ismap', '']})
+ \ extend(copy(global_attributes), {'src': [], 'alt': [], 'height': [], 'width': [], 'usemap': [], 'ismap': ['ismap', ''], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url']})
\ ],
\ 'input': [
\ [],
- \ extend(copy(global_attributes), {'type': ['text', 'password', 'checkbox', 'radio', 'button', 'submit', 'reset', 'file', 'hidden', 'image', 'datetime', 'datetime-local', 'date', 'month', 'time', 'week', 'number', 'range', 'email', 'url', 'search', 'tel', 'color'], 'name': [], 'disabled': ['disabled', ''], 'form': [], 'maxlength': [], 'readonly': ['readonly', ''], 'size': [], 'value': [], 'autocomplete': ['on', 'off'], 'autofocus': ['autofocus', ''], 'list': [], 'pattern': [], 'required': ['required', ''], 'placeholder': [], 'checked': ['checked'], 'accept': [], 'multiple': ['multiple', ''], 'alt': [], 'src': [], 'height': [], 'width': [], 'min': [], 'max': [], 'step': [], 'formenctype': ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain'], 'formmethod': ['get', 'post', 'put', 'delete'], 'formtarget': [], 'formnovalidate': ['formnovalidate', '']})
+ \ extend(copy(global_attributes), {'type': ['text', 'password', 'checkbox', 'radio', 'button', 'submit', 'reset', 'file', 'hidden', 'image', 'datetime', 'datetime-local', 'date', 'month', 'time', 'week', 'number', 'range', 'email', 'url', 'search', 'tel', 'color'], 'name': [], 'disabled': ['disabled', ''], 'form': [], 'maxlength': [], 'readonly': ['readonly', ''], 'size': [], 'value': [], 'autocomplete': autofill_tokens, 'autofocus': ['autofocus', ''], 'list': [], 'pattern': [], 'required': ['required', ''], 'placeholder': [], 'checked': ['checked'], 'accept': [], 'multiple': ['multiple', ''], 'alt': [], 'src': [], 'height': [], 'width': [], 'min': [], 'max': [], 'step': [], 'formenctype': ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain'], 'formmethod': ['get', 'post', 'put', 'delete'], 'formtarget': [], 'formnovalidate': ['formnovalidate', '']})
\ ],
\ 'ins': [
\ flow_elements,
@@ -583,7 +585,7 @@ let g:xmldata_html5 = {
\ ],
\ 'link': [
\ [],
- \ extend(copy(global_attributes), {'href': [], 'rel': linkreltypes, 'hreflang': lang_tag, 'media': [], 'type': [], 'sizes': ['any']})
+ \ extend(copy(global_attributes), {'href': [], 'rel': linkreltypes, 'hreflang': lang_tag, 'media': [], 'type': [], 'sizes': ['any'], 'referrerpolicy': ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'unsafe-url']})
\ ],
\ 'main': [
\ flow_elements + ['style'],
@@ -691,7 +693,7 @@ let g:xmldata_html5 = {
\ ],
\ 'script': [
\ [],
- \ extend(copy(global_attributes), {'src': [], 'defer': ['defer', ''], 'async': ['async', ''], 'type': [], 'charset': charset})
+ \ extend(copy(global_attributes), {'src': [], 'defer': ['defer', ''], 'async': ['async', ''], 'type': [], 'charset': charset, 'nonce': []})
\ ],
\ 'section': [
\ flow_elements + ['style'],
@@ -723,7 +725,7 @@ let g:xmldata_html5 = {
\ ],
\ 'style': [
\ [],
- \ extend(copy(global_attributes), {'type': [], 'media': [], 'scoped': ['scoped', '']})
+ \ extend(copy(global_attributes), {'type': [], 'media': [], 'scoped': ['scoped', ''], 'nonce': []})
\ ],
\ 'sub': [
\ phrasing_elements,
diff --git a/compiler/cargo.vim b/compiler/cargo.vim
index 2902449d..160d214e 100644
--- a/compiler/cargo.vim
+++ b/compiler/cargo.vim
@@ -21,51 +21,12 @@ else
CompilerSet makeprg=cargo\ $*
endif
-" Allow a configurable global Cargo.toml name. This makes it easy to
-" support variations like 'cargo.toml'.
-let s:cargo_manifest_name = get(g:, 'cargo_manifest_name', 'Cargo.toml')
-
-function! s:is_absolute(path)
- return a:path[0] == '/' || a:path =~ '[A-Z]\+:'
-endfunction
-
-CompilerSet errorformat+=%-G%\\s%#Compiling%.%#
-
-let s:local_manifest = findfile(s:cargo_manifest_name, '.;')
-if s:local_manifest != ''
- let s:local_manifest = fnamemodify(s:local_manifest, ':p:h').'/'
- augroup cargo
- au!
- au QuickfixCmdPost make call s:FixPaths()
- augroup END
-
- " FixPaths() is run after Cargo, and is used to change the file paths
- " to be relative to the current directory instead of Cargo.toml.
- function! s:FixPaths()
- let qflist = getqflist()
- let manifest = s:local_manifest
- for qf in qflist
- if !qf.valid
- let m = matchlist(qf.text, '(file://\(.*\))$')
- if !empty(m)
- let manifest = m[1].'/'
- " Manually strip another slash if needed; usually just an
- " issue on Windows.
- if manifest =~ '^/[A-Z]\+:/'
- let manifest = manifest[1:]
- endif
- endif
- continue
- endif
- let filename = bufname(qf.bufnr)
- if s:is_absolute(filename)
- continue
- endif
- let qf.filename = simplify(manifest.filename)
- call remove(qf, 'bufnr')
- endfor
- call setqflist(qflist, 'r')
- endfunction
-endif
+" Ignore general cargo progress messages
+CompilerSet errorformat+=
+ \%-G%\\s%#Downloading%.%#,
+ \%-G%\\s%#Compiling%.%#,
+ \%-G%\\s%#Finished%.%#,
+ \%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
+ \%-G%\\s%#To\ learn\ more\\,%.%#
endif
diff --git a/compiler/rustc.vim b/compiler/rustc.vim
index e6a53cda..5c02dd28 100644
--- a/compiler/rustc.vim
+++ b/compiler/rustc.vim
@@ -23,6 +23,7 @@ else
CompilerSet makeprg=rustc\ \%
endif
+" Old errorformat (before nightly 2016/08/10)
CompilerSet errorformat=
\%f:%l:%c:\ %t%*[^:]:\ %m,
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
@@ -31,6 +32,17 @@ CompilerSet errorformat=
\%-G%*[\ ]^%*[~],
\%-G%*[\ ]...
+" New errorformat (after nightly 2016/08/10)
+CompilerSet errorformat+=
+ \%-G,
+ \%-Gerror:\ aborting\ %.%#,
+ \%-Gerror:\ Could\ not\ compile\ %.%#,
+ \%Eerror:\ %m,
+ \%Eerror[E%n]:\ %m,
+ \%Wwarning:\ %m,
+ \%Inote:\ %m,
+ \%C\ %#-->\ %f:%l:%c
+
let &cpo = s:cpo_save
unlet s:cpo_save
diff --git a/extras/flow.vim b/extras/flow.vim
index e4f02642..b12ab61c 100644
--- a/extras/flow.vim
+++ b/extras/flow.vim
@@ -8,13 +8,14 @@ syntax region jsFlowParens contained matchgroup=jsFlowNoise start=/(/
syntax match jsFlowNoise contained /[:;,<>]/
syntax keyword jsFlowType contained boolean number string null void any mixed JSON array function object array bool class
syntax keyword jsFlowTypeof contained typeof skipempty skipempty nextgroup=jsFlowTypeCustom,jsFlowType
-syntax match jsFlowTypeCustom contained /\k*/ skipwhite skipempty nextgroup=jsFlowGroup
+syntax match jsFlowTypeCustom contained /[0-9a-zA-Z_.]*/ skipwhite skipempty nextgroup=jsFlowGroup
syntax region jsFlowGroup contained matchgroup=jsFlowNoise start=/</ end=/>/ contains=@jsFlowCluster
syntax region jsFlowArrowArguments contained matchgroup=jsFlowNoise start=/(/ end=/)\%(\s*=>\)\@=/ oneline skipwhite skipempty nextgroup=jsFlowArrow contains=@jsFlowCluster
syntax match jsFlowArrow contained /=>/ skipwhite skipempty nextgroup=jsFlowType,jsFlowTypeCustom,jsFlowParens
syntax match jsFlowMaybe contained /?/ skipwhite skipempty nextgroup=jsFlowType,jsFlowTypeCustom,jsFlowParens,jsFlowArrowArguments
syntax match jsFlowObjectKey contained /[0-9a-zA-Z_$?]*\(\s*:\)\@=/ contains=jsFunctionKey,jsFlowMaybe skipwhite skipempty nextgroup=jsObjectValue containedin=jsObject
syntax match jsFlowOrOperator contained /|/ skipwhite skipempty nextgroup=@jsFlowCluster
+syntax keyword jsFlowImportType contained type skipwhite skipempty nextgroup=jsModuleAsterisk,jsModuleKeyword,jsModuleGroup
syntax match jsFlowReturn contained /:\s*/ contains=jsFlowNoise skipwhite skipempty nextgroup=@jsFlowReturnCluster
syntax region jsFlowReturnObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ contains=@jsFlowCluster skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturnOrOp
diff --git a/extras/jsdoc.vim b/extras/jsdoc.vim
index c5d7a572..6e622252 100644
--- a/extras/jsdoc.vim
+++ b/extras/jsdoc.vim
@@ -20,7 +20,7 @@ syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRe
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
-syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.{-}]\|=\)\+"
+syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.\{-}]\|=\)\+"
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
if version >= 508 || !exists("did_javascript_syn_inits")
diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim
index d036f661..f6f18c6d 100644
--- a/ftdetect/polyglot.vim
+++ b/ftdetect/polyglot.vim
@@ -58,7 +58,7 @@ endif
" ftdetect/clojure.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
-autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc setlocal filetype=clojure
+autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc,{build,profile}.boot setlocal filetype=clojure
endif
@@ -278,7 +278,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
" Language: OpenGL Shading Language
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
-autocmd! BufNewFile,BufRead *.glsl,*.geom,*.vert,*.frag,*.gsh,*.vsh,*.fsh,*.vs,*.fs,*.gs,*.tcs,*.tes set filetype=glsl
+autocmd! BufNewFile,BufRead *.glsl,*.geom,*.vert,*.frag,*.gsh,*.vsh,*.fsh,*.vs,*.fs,*.gs,*.tcs,*.tes,*.tesc,*.tese,*.comp set filetype=glsl
" vim:set sts=2 sw=2 :
@@ -357,6 +357,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') ==
au BufNewFile,BufRead *.js setf javascript
au BufNewFile,BufRead *.jsm setf javascript
au BufNewFile,BufRead Jakefile setf javascript
+au BufNewFile,BufRead *.es6 setf javascript
fun! s:SelectJavascript()
if getline(1) =~# '^#!.*/bin/\%(env\s\+\)\?node\>'
@@ -871,7 +872,7 @@ endif
" ftdetect/slim.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1
-autocmd BufNewFile,BufRead *.slim setf slim
+autocmd BufNewFile,BufRead *.slim setfiletype slim
endif
diff --git a/ftplugin/ansible.vim b/ftplugin/ansible.vim
index df766194..bbfd05df 100644
--- a/ftplugin/ansible.vim
+++ b/ftplugin/ansible.vim
@@ -4,5 +4,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
if exists('+regexpengine') && ('&regexpengine' == 0)
setlocal regexpengine=1
endif
+set path+=./../templates,./../files
endif
diff --git a/ftplugin/eelixir.vim b/ftplugin/eelixir.vim
index b0f3284f..eb6f6559 100644
--- a/ftplugin/eelixir.vim
+++ b/ftplugin/eelixir.vim
@@ -80,6 +80,23 @@ if exists("loaded_matchit")
let b:match_words = s:match_words
endif
+if !exists('b:surround_45')
+ " When using surround `-` (ASCII 45) would provide `<% selection %>`
+ let b:surround_45 = "<% \r %>"
+endif
+if !exists('b:surround_61')
+ " When using surround `=` (ASCII 61) would provide `<%= selection %>`
+ let b:surround_61 = "<%= \r %>"
+endif
+if !exists('b:surround_35')
+ " When using surround `#` (ASCII 35) would provide `<%# selection %>`
+ let b:surround_35 = "<%# \r %>"
+endif
+if !exists('b:surround_5')
+ " When using surround `<C-e>` (ASCII 5 `ENQ`) would provide `<% selection %>\n<% end %>`
+ let b:surround_5 = "<% \r %>\n<% end %>"
+endif
+
setlocal comments=:<%#
setlocal commentstring=<%#\ %s\ %>
diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim
index 3faa9dfb..b945fab7 100644
--- a/ftplugin/rust.vim
+++ b/ftplugin/rust.vim
@@ -112,16 +112,6 @@ xnoremap <silent> <buffer> ]] :call rust#Jump('v', 'Forward')<CR>
onoremap <silent> <buffer> [[ :call rust#Jump('o', 'Back')<CR>
onoremap <silent> <buffer> ]] :call rust#Jump('o', 'Forward')<CR>
-" %-matching. <:> is handy for generics.
-set matchpairs+=<:>
-" There are two minor issues with it; (a) comparison operators in expressions,
-" where a less-than may match a greater-than later on—this is deemed a trivial
-" issue—and (b) `Fn() -> X` syntax. This latter issue is irremediable from the
-" highlighting perspective (built into Vim), but the actual % functionality
-" can be fixed by this use of matchit.vim.
-let b:match_skip = 's:comment\|string\|rustArrow'
-source $VIMRUNTIME/macros/matchit.vim
-
" Commands {{{1
" See |:RustRun| for docs
@@ -142,6 +132,9 @@ command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
" See |:RustFmt| for docs
command! -buffer RustFmt call rustfmt#Format()
+" See |:RustFmtRange| for docs
+command! -range -buffer RustFmtRange call rustfmt#FormatRange(<line1>, <line2>)
+
" Mappings {{{1
" Bind ⌘R in MacVim to :RustRun
@@ -189,18 +182,27 @@ let b:undo_ftplugin = "
\|ounmap <buffer> ]]
\|set matchpairs-=<:>
\|unlet b:match_skip
- \|augroup! rust.vim
\"
" }}}1
" Code formatting on save
if get(g:, "rustfmt_autosave", 0)
- autocmd BufWritePre *.rs call rustfmt#Format()
+ autocmd BufWritePre *.rs silent! call rustfmt#Format()
endif
augroup END
+" %-matching. <:> is handy for generics.
+set matchpairs+=<:>
+" There are two minor issues with it; (a) comparison operators in expressions,
+" where a less-than may match a greater-than later on—this is deemed a trivial
+" issue—and (b) `Fn() -> X` syntax. This latter issue is irremediable from the
+" highlighting perspective (built into Vim), but the actual % functionality
+" can be fixed by this use of matchit.vim.
+let b:match_skip = 's:comment\|string\|rustArrow'
+source $VIMRUNTIME/macros/matchit.vim
+
let &cpo = s:save_cpo
unlet s:save_cpo
diff --git a/indent/clojure.vim b/indent/clojure.vim
index 1d474d8e..f538195a 100644
--- a/indent/clojure.vim
+++ b/indent/clojure.vim
@@ -89,7 +89,7 @@ if exists("*searchpairpos")
function! s:match_pairs(open, close, stopat)
" Stop only on vector and map [ resp. {. Ignore the ones in strings and
" comments.
- if a:stopat == 0
+ if a:stopat == 0 && g:clojure_maxlines > 0
let stopat = max([line(".") - g:clojure_maxlines, 0])
else
let stopat = a:stopat
@@ -123,7 +123,7 @@ if exists("*searchpairpos")
if s:syn_id_name() !~? "string"
return -1
endif
- if s:current_char() != '\\'
+ if s:current_char() != '\'
return -1
endif
call cursor(0, col("$") - 1)
diff --git a/indent/dart.vim b/indent/dart.vim
index af4cb7df..601abbb0 100644
--- a/indent/dart.vim
+++ b/indent/dart.vim
@@ -8,6 +8,32 @@ let b:did_indent = 1
setlocal cindent
setlocal cinoptions+=j1,J1
+setlocal indentexpr=DartIndent()
+
let b:undo_indent = 'setl cin< cino<'
+if exists("*DartIndent")
+ finish
+endif
+
+function! DartIndent()
+ " Default to cindent in most cases
+ let indentTo = cindent(v:lnum)
+
+ let previousLine = getline(prevnonblank(v:lnum - 1))
+ let currentLine = getline(v:lnum)
+
+ " Don't indent after an annotation
+ if previousLine =~# '^\s*@.*$'
+ let indentTo = indent(v:lnum - 1)
+ endif
+
+ " Indent after opening List literal
+ if previousLine =~# '\[$' && !(currentLine =~# '^\s*\]')
+ let indentTo = indent(v:lnum - 1) + &shiftwidth
+ endif
+
+ return indentTo
+endfunction
+
endif
diff --git a/indent/elixir.vim b/indent/elixir.vim
index 3e7b6de0..c5ce4f40 100644
--- a/indent/elixir.vim
+++ b/indent/elixir.vim
@@ -1,199 +1,71 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
-if exists("b:did_indent")
- finish
-end
-let b:did_indent = 1
-
setlocal nosmartindent
+setlocal indentexpr=elixir#indent()
+setlocal indentkeys+=0),0],0=\|>,=->
+setlocal indentkeys+=0=end,0=else,0=match,0=elsif,0=catch,0=after,0=rescue
-setlocal indentexpr=GetElixirIndent()
-setlocal indentkeys+=0),0],0=end,0=else,0=match,0=elsif,0=catch,0=after,0=rescue,0=\|>
-
-if exists("*GetElixirIndent")
+if exists("b:did_indent") || exists("*elixir#indent")
finish
end
+let b:did_indent = 1
let s:cpo_save = &cpo
set cpo&vim
-let s:no_colon_before = ':\@<!'
-let s:no_colon_after = ':\@!'
-let s:symbols_end = '\]\|}\|)'
-let s:symbols_start = '\[\|{\|('
-let s:arrow = '^.*->$'
-let s:skip_syntax = '\%(Comment\|String\)$'
-let s:block_skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '".s:skip_syntax."'"
-let s:block_start = '\<\%(do\|fn\)\>'
-let s:block_middle = 'else\|match\|elsif\|catch\|after\|rescue'
-let s:block_end = 'end'
-let s:starts_with_pipeline = '^\s*|>.*$'
-let s:ending_with_assignment = '=\s*$'
-
-let s:indent_keywords = '\<'.s:no_colon_before.'\%('.s:block_start.'\|'.s:block_middle.'\)$'.'\|'.s:arrow
-let s:deindent_keywords = '^\s*\<\%('.s:block_end.'\|'.s:block_middle.'\)\>'.'\|'.s:arrow
-
-let s:pair_start = '\<\%('.s:no_colon_before.s:block_start.'\)\>'.s:no_colon_after
-let s:pair_middle = '^\s*\%('.s:block_middle.'\)\>'.s:no_colon_after.'\zs'
-let s:pair_end = '\<\%('.s:no_colon_before.s:block_end.'\)\>\zs'
-
-function! s:is_indentable_syntax()
- " TODO: Remove these 2 lines
- " I don't know why, but for the test on spec/indent/lists_spec.rb:24.
- " Vim is making some mess on parsing the syntax of 'end', it is being
- " recognized as 'elixirString' when should be recognized as 'elixirBlock'.
- call synID(s:current_line_ref, 1, 1)
- " This forces vim to sync the syntax.
- syntax sync fromstart
-
- return synIDattr(synID(s:current_line_ref, 1, 1), "name")
- \ !~ s:skip_syntax
-endfunction
-
-function! s:indent_opened_symbol(ind)
- if s:opened_symbol > 0
- if s:pending_parenthesis > 0
- \ && s:last_line !~ '^\s*def'
- \ && s:last_line !~ s:arrow
- let b:old_ind = a:ind
- return matchend(s:last_line, '(')
- " if start symbol is followed by a character, indent based on the
- " whitespace after the symbol, otherwise use the default shiftwidth
- " Avoid negative indentation index
- elseif s:last_line =~ '\('.s:symbols_start.'\).'
- let regex = '\('.s:symbols_start.'\)\s*'
- let opened_prefix = matchlist(s:last_line, regex)[0]
- return a:ind + (s:opened_symbol * strlen(opened_prefix))
- else
- return a:ind + (s:opened_symbol * &sw)
- end
- elseif s:opened_symbol < 0
- let ind = get(b:, 'old_ind', a:ind + (s:opened_symbol * &sw))
- let ind = float2nr(ceil(floor(ind)/&sw)*&sw)
- return ind <= 0 ? 0 : ind
- else
- return a:ind
- end
-endfunction
-
-function! s:indent_last_line_end_symbol_or_indent_keyword(ind)
- if s:last_line =~ '^\s*\('.s:symbols_end.'\)'
- \ || s:last_line =~ s:indent_keywords
- return a:ind + &sw
- else
- return a:ind
- end
-endfunction
-
-function! s:indent_symbols_ending(ind)
- if s:current_line =~ '^\s*\('.s:symbols_end.'\)'
- return a:ind - &sw
- else
- return a:ind
- end
-endfunction
-
-function! s:indent_assignment(ind)
- if s:last_line =~ s:ending_with_assignment
- let b:old_ind = indent(s:last_line_ref) " FIXME: side effect
- return a:ind + &sw
- else
- return a:ind
- end
-endfunction
+function! elixir#indent()
+ " initiates the `old_ind` dictionary
+ let b:old_ind = get(b:, 'old_ind', {})
+ " initialtes the `line` dictionary
+ let line = s:build_line(v:lnum)
-function! s:indent_pipeline(ind)
- if s:last_line =~ s:starts_with_pipeline
- \ && s:current_line =~ s:starts_with_pipeline
- indent(s:last_line_ref)
- elseif s:current_line =~ s:starts_with_pipeline
- \ && s:last_line =~ '^[^=]\+=.\+$'
- let b:old_ind = indent(s:last_line_ref)
- " if line starts with pipeline
- " and last line is an attribution
- " indents pipeline in same level as attribution
- return match(s:last_line, '=\s*\zs[^ ]')
+ if s:is_beginning_of_file(line)
+ " Reset `old_ind` dictionary at the beginning of the file
+ let b:old_ind = {}
+ " At the start of the file use zero indent.
+ return 0
+ elseif !s:is_indentable_line(line)
+ " Keep last line indentation if the current line does not have an
+ " indentable syntax
+ return indent(line.last.num)
else
- return a:ind
+ " Calculates the indenation level based on the rules
+ " All the rules are defined in `autoload/indent.vim`
+ let ind = indent(line.last.num)
+ let ind = elixir#indent#deindent_case_arrow(ind, line)
+ let ind = elixir#indent#indent_parenthesis(ind, line)
+ let ind = elixir#indent#indent_square_brackets(ind, line)
+ let ind = elixir#indent#indent_brackets(ind, line)
+ let ind = elixir#indent#deindent_opened_symbols(ind, line)
+ let ind = elixir#indent#indent_pipeline_assignment(ind, line)
+ let ind = elixir#indent#indent_pipeline_continuation(ind, line)
+ let ind = elixir#indent#indent_after_pipeline(ind, line)
+ let ind = elixir#indent#indent_assignment(ind, line)
+ let ind = elixir#indent#indent_ending_symbols(ind, line)
+ let ind = elixir#indent#indent_keywords(ind, line)
+ let ind = elixir#indent#deindent_keywords(ind, line)
+ let ind = elixir#indent#deindent_ending_symbols(ind, line)
+ let ind = elixir#indent#indent_case_arrow(ind, line)
+ return ind
end
endfunction
-function! s:indent_after_pipeline(ind)
- if s:last_line =~ s:starts_with_pipeline
- if empty(substitute(s:current_line, ' ', '', 'g'))
- \ || s:current_line =~ s:starts_with_pipeline
- return indent(s:last_line_ref)
- elseif s:last_line !~ s:indent_keywords
- return b:old_ind
- else
- return a:ind
- end
- else
- return a:ind
- end
+function! s:is_beginning_of_file(line)
+ return a:line.last.num == 0
endfunction
-function! s:deindent_keyword(ind)
- if s:current_line =~ s:deindent_keywords
- let bslnum = searchpair(
- \ s:pair_start,
- \ s:pair_middle,
- \ s:pair_end,
- \ 'nbW',
- \ s:block_skip
- \ )
-
- return indent(bslnum)
- else
- return a:ind
- end
+function! s:is_indentable_line(line)
+ return elixir#util#is_indentable_at(a:line.current.num, 1)
endfunction
-function! s:indent_arrow(ind)
- if s:current_line =~ s:arrow
- " indent case statements '->'
- return a:ind + &sw
- else
- return a:ind
- end
-endfunction
-
-function! GetElixirIndent()
- let s:current_line_ref = v:lnum
- let s:last_line_ref = prevnonblank(s:current_line_ref - 1)
- let s:current_line = getline(s:current_line_ref)
- let s:last_line = getline(s:last_line_ref)
- let s:pending_parenthesis = 0
- let s:opened_symbol = 0
-
- if s:last_line !~ s:arrow
- let splitted_line = split(s:last_line, '\zs')
- let s:pending_parenthesis =
- \ + count(splitted_line, '(') - count(splitted_line, ')')
- let s:opened_symbol =
- \ + s:pending_parenthesis
- \ + count(splitted_line, '[') - count(splitted_line, ']')
- \ + count(splitted_line, '{') - count(splitted_line, '}')
- end
+function! s:build_line(line)
+ let line = { 'current': {}, 'last': {} }
+ let line.current.num = a:line
+ let line.current.text = getline(line.current.num)
+ let line.last.num = prevnonblank(line.current.num - 1)
+ let line.last.text = getline(line.last.num)
- if s:last_line_ref == 0
- " At the start of the file use zero indent.
- return 0
- elseif !s:is_indentable_syntax()
- " Current syntax is not indentable, keep last line indentation
- return indent(s:last_line_ref)
- else
- let ind = indent(s:last_line_ref)
- let ind = s:indent_opened_symbol(ind)
- let ind = s:indent_symbols_ending(ind)
- let ind = s:indent_pipeline(ind)
- let ind = s:indent_after_pipeline(ind)
- let ind = s:indent_assignment(ind)
- let ind = s:indent_last_line_end_symbol_or_indent_keyword(ind)
- let ind = s:deindent_keyword(ind)
- let ind = s:indent_arrow(ind)
- return ind
- end
+ return line
endfunction
let &cpo = s:cpo_save
diff --git a/indent/gohtmltmpl.vim b/indent/gohtmltmpl.vim
index 898e36b0..ed9e2eb5 100644
--- a/indent/gohtmltmpl.vim
+++ b/indent/gohtmltmpl.vim
@@ -32,13 +32,13 @@ function! GetGoHTMLTmplIndent(lnum)
" If need to indent based on last line
let last_line = getline(a:lnum-1)
- if last_line =~ '^\s*{{\s*\%(if\|else\|range\|with\|define\|block\).*}}'
+ if last_line =~ '^\s*{{-\=\s*\%(if\|else\|range\|with\|define\|block\).*}}'
let ind += sw
endif
" End of FuncMap block
let current_line = getline(a:lnum)
- if current_line =~ '^\s*{{\s*\%(else\|end\).*}}'
+ if current_line =~ '^\s*{{-\=\s*\%(else\|end\).*}}'
let ind -= sw
endif
diff --git a/indent/haskell.vim b/indent/haskell.vim
index ebdab5e7..fa2ee7cf 100644
--- a/indent/haskell.vim
+++ b/indent/haskell.vim
@@ -15,6 +15,10 @@ endif
let b:did_indent = 1
+if !exists('g:haskell_indent_disable')
+ let g:haskell_indent_disable = 0
+endif
+
if !exists('g:haskell_indent_if')
" if x
" >>>then ...
@@ -59,8 +63,14 @@ if !exists('g:haskell_indent_guard')
let g:haskell_indent_guard = 2
endif
-setlocal indentexpr=GetHaskellIndent()
-setlocal indentkeys=0{,0},0(,0),0[,0],!^F,o,O,0\=,0=where,0=let,0=deriving,<space>
+if exists("g:haskell_indent_disable") && g:haskell_indent_disable == 0
+ setlocal indentexpr=GetHaskellIndent()
+ setlocal indentkeys=0{,0},0(,0),0[,0],!^F,o,O,0\=,0=where,0=let,0=deriving,<space>
+else
+ setlocal nocindent
+ setlocal nosmartindent
+ setlocal autoindent
+endif
function! s:isInBlock(hlstack)
return index(a:hlstack, 'haskellParens') > -1 || index(a:hlstack, 'haskellBrackets') > -1 || index(a:hlstack, 'haskellBlock') > -1 || index(a:hlstack, 'haskellBlockComment') > -1 || index(a:hlstack, 'haskellPragma') > -1
@@ -270,7 +280,11 @@ function! GetHaskellIndent()
" case foo of
" >>bar -> quux
if l:prevline =~ '\C\<case\>.\+\<of\>\s*$'
- return match(l:prevline, '\C\<case\>') + g:haskell_indent_case
+ if exists('g:haskell_indent_case_alternative') && g:haskell_indent_case_alternative
+ return match(l:prevline, '\S') + &shiftwidth
+ else
+ return match(l:prevline, '\C\<case\>') + g:haskell_indent_case
+ endif
endif
"" where foo
@@ -324,8 +338,8 @@ function! GetHaskellIndent()
while v:lnum != l:c
" fun decl
- let l:s = match(l:l, l:m)
- if l:s >= 0
+ if l:l =~ ('^\s*' . l:m . '\(\s*::\|\n\s\+::\)')
+ let l:s = match(l:l, l:m)
if match(l:l, '\C^\s*\<default\>') > -1
return l:s - 8
else
diff --git a/indent/html.vim b/indent/html.vim
index 18c5bf15..0cbc3b17 100644
--- a/indent/html.vim
+++ b/indent/html.vim
@@ -42,6 +42,7 @@ setlocal indentkeys=o,O,*<Return>,<>>,{,},!^F
let s:tags = []
+let s:no_tags = []
" [-- <ELEMENT ? - - ...> --]
call add(s:tags, 'a')
@@ -165,6 +166,44 @@ call add(s:tags, 'text')
call add(s:tags, 'textPath')
call add(s:tags, 'tref')
call add(s:tags, 'tspan')
+" Common self closing SVG elements
+call add(s:no_tags, 'animate')
+call add(s:no_tags, 'animateTransform')
+call add(s:no_tags, 'circle')
+call add(s:no_tags, 'ellipse')
+call add(s:no_tags, 'feBlend')
+call add(s:no_tags, 'feColorMatrix')
+call add(s:no_tags, 'feComposite')
+call add(s:no_tags, 'feConvolveMatrix')
+call add(s:no_tags, 'feDisplacementMap')
+call add(s:no_tags, 'feFlood')
+call add(s:no_tags, 'feFuncR')
+call add(s:no_tags, 'feFuncG')
+call add(s:no_tags, 'feFuncB')
+call add(s:no_tags, 'feFuncA')
+call add(s:no_tags, 'feGaussianBlur')
+call add(s:no_tags, 'feImage')
+call add(s:no_tags, 'feMergeNode')
+call add(s:no_tags, 'feMorphology')
+call add(s:no_tags, 'feOffset')
+call add(s:no_tags, 'fePointLight')
+call add(s:no_tags, 'feSpotLight')
+call add(s:no_tags, 'feTile')
+call add(s:no_tags, 'feTurbulence')
+call add(s:no_tags, 'hatchpath')
+call add(s:no_tags, 'hkern')
+call add(s:no_tags, 'image')
+call add(s:no_tags, 'line')
+call add(s:no_tags, 'mpath')
+call add(s:no_tags, 'polygon')
+call add(s:no_tags, 'polyline')
+call add(s:no_tags, 'path')
+call add(s:no_tags, 'rect')
+call add(s:no_tags, 'solidColor')
+call add(s:no_tags, 'stop')
+call add(s:no_tags, 'use')
+call add(s:no_tags, 'view')
+call add(s:no_tags, 'vkern')
call add(s:tags, 'html')
call add(s:tags, 'head')
@@ -177,8 +216,6 @@ call add(s:tags, 'tr')
call add(s:tags, 'th')
call add(s:tags, 'td')
-let s:no_tags = []
-
call add(s:no_tags, 'base')
call add(s:no_tags, 'link')
call add(s:no_tags, 'meta')
diff --git a/indent/javascript.vim b/indent/javascript.vim
index e8573790..ea6b551d 100644
--- a/indent/javascript.vim
+++ b/indent/javascript.vim
@@ -2,9 +2,9 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') ==
" Vim indent file
" Language: Javascript
-" Maintainer: vim-javascript community
+" Maintainer: Chris Paul ( https://github.com/bounceme )
" URL: https://github.com/pangloss/vim-javascript
-" Last Change: August 20, 2016
+" Last Change: December 14, 2016
" Only load this indent file when no other was loaded.
if exists('b:did_indent')
@@ -14,11 +14,10 @@ let b:did_indent = 1
" Now, set up our indentation expression and keys that trigger it.
setlocal indentexpr=GetJavascriptIndent()
-setlocal nolisp noautoindent nosmartindent
-setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e
-setlocal cinoptions+=j1,J1
+setlocal autoindent nolisp nosmartindent
+setlocal indentkeys+=0],0)
-let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys< cinoptions<'
+let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
" Only define the function once.
if exists('*GetJavascriptIndent')
@@ -39,159 +38,280 @@ else
endfunction
endif
-let s:line_pre = '^\s*\%(\%(\%(\/\*.\{-}\)\=\*\+\/\s*\)\=\)\@>'
-let s:expr_case = s:line_pre . '\%(\%(case\>.\+\)\|default\)\s*:'
-" Regex of syntax group names that are or delimit string or are comments.
-let s:syng_strcom = '\%(s\%(tring\|pecial\)\|comment\|regex\|doc\|template\)'
-
-" Regex of syntax group names that are strings or documentation.
-let s:syng_comment = '\%(comment\|doc\)'
-
-" Expression used to check whether we should skip a match with searchpair().
-let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
-
+" searchpair() wrapper
if has('reltime')
- function s:GetPair(start,end,flags,time)
- return searchpair(a:start,'',a:end,a:flags,s:skip_expr,max([prevnonblank(v:lnum) - 2000,0]),a:time)
+ function s:GetPair(start,end,flags,skip,time,...)
+ return searchpair(a:start,'',a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 2000,0] + a:000),a:time)
endfunction
else
- function s:GetPair(start,end,flags,n)
- return searchpair(a:start,'',a:end,a:flags,0,max([prevnonblank(v:lnum) - 2000,0]))
+ function s:GetPair(start,end,flags,skip,...)
+ return searchpair(a:start,'',a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 1000,get(a:000,1)]))
endfunction
endif
-let s:line_term = '\s*\%(\%(\/\%(\%(\*.\{-}\*\/\)\|\%(\*\+\)\)\)\s*\)\=$'
+" Regex of syntax group names that are or delimit string or are comments.
+let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template'
+let s:syng_str = 'string\|template'
+let s:syng_com = 'comment\|doc'
+" Expression used to check whether we should skip a match with searchpair().
+let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
+
+function s:skip_func()
+ if !s:free || search('`\|\*\/','nW',s:looksyn)
+ let s:free = !eval(s:skip_expr)
+ let s:looksyn = s:free ? line('.') : s:looksyn
+ return !s:free
+ endif
+ let s:looksyn = line('.')
+ return (search('\/','nbW',s:looksyn) || search('[''"\\]','nW',s:looksyn)) && eval(s:skip_expr)
+endfunction
-" configurable regexes that define continuation lines, not including (, {, or [.
-if !exists('g:javascript_opfirst')
- let g:javascript_opfirst = '\%([<>,:?^%|*&]\|\([-/.+]\)\1\@!\|=>\@!\|in\%(stanceof\)\=\>\)'
-endif
-if !exists('g:javascript_continuation')
- let g:javascript_continuation = '\%([<=,.?/*:^%|&]\|+\@<!+\|-\@<!-\|=\@<!>\|\<in\%(stanceof\)\=\)'
-endif
+function s:alternatePair(stop)
+ while search('[][(){}]','bW',a:stop)
+ if !s:skip_func()
+ let idx = stridx('])}',s:looking_at())
+ if idx + 1
+ if !s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop)
+ break
+ endif
+ else
+ return
+ endif
+ endif
+ endwhile
+ call cursor(v:lnum,1)
+endfunction
-let g:javascript_opfirst = s:line_pre . g:javascript_opfirst
-let g:javascript_continuation .= s:line_term
+function s:syn_at(l,c)
+ return synIDattr(synID(a:l,a:c,0),'name')
+endfunction
-function s:OneScope(lnum,text,add)
- return a:text =~# '\%(\<else\|\<do\|=>\)' . s:line_term ? 'no b' :
- \ ((a:add && a:text =~ s:line_pre . '$' && search('\%' . s:PrevCodeLine(a:lnum - 1) . 'l.)' . s:line_term)) ||
- \ cursor(a:lnum, match(a:text, ')' . s:line_term)) > -1) &&
- \ s:GetPair('(', ')', 'cbW', 100) > 0 && search('\C\l\+\_s*\%#','bW') &&
- \ (a:add || ((expand('<cword>') !=# 'while' || !s:GetPair('\C\<do\>', '\C\<while\>','nbW',100)) &&
- \ expand('cword') !=# 'each' || search('\C\<for\_s\+\%#','nbW'))) ? expand('<cword>') : ''
+function s:looking_at()
+ return getline('.')[col('.')-1]
endfunction
-" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
-function s:IsBlock()
- return getline(line('.'))[col('.')-1] == '{' && !search(
- \ '\C\%(\<return\s*\|\%([-=~!<*+,.?^%|&\[(]\|=\@<!>\|\*\@<!\/\|\<\%(var\|const\|let\|yield\|delete\|void\|t\%(ypeof\|hrow\)\|new\|\<in\%(stanceof\)\=\)\)\_s*\)\%#','bnW') &&
- \ (!search(':\_s*\%#','bW') || (!s:GetPair('[({[]','[])}]','bW',200) || s:IsBlock()))
+function s:token()
+ return s:looking_at() =~ '\k' ? expand('<cword>') : s:looking_at()
endfunction
-" Auxiliary Functions {{{2
+" NOTE: Moves the cursor, unless a arg is supplied.
+function s:previous_token(...)
+ let l:pos = getpos('.')[1:2]
+ return [search('.\>\|[^[:alnum:][:space:]_$]','bW') ?
+ \ (s:looking_at() == '/' || line('.') != l:pos[0] && getline('.') =~ '\/\/') &&
+ \ s:syn_at(line('.'),col('.')) =~? s:syng_com ?
+ \ search('\_[^/]\zs\/[/*]','bW') ? s:previous_token() : ''
+ \ : s:token()
+ \ : ''][a:0 && call('cursor',l:pos)]
+endfunction
+
+" switch case label pattern
+let s:case_stmt = '\<\%(case\>\s*[^ \t:].*\|default\s*\):\C'
+
+function s:label_end(ln,con)
+ return !cursor(a:ln,match(' '.a:con, '.*\zs' . s:case_stmt . '$')) &&
+ \ (expand('<cword>') !=# 'default' || s:previous_token(1) !~ '[{,.]')
+endfunction
+
+" configurable regexes that define continuation lines, not including (, {, or [.
+let s:opfirst = '^' . get(g:,'javascript_opfirst',
+ \ '\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
+let s:continuation = get(g:,'javascript_continuation',
+ \ '\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|delete\|void\|in\|instanceof\)\)') . '$'
+
+function s:continues(ln,con)
+ return !cursor(a:ln, match(' '.a:con,s:continuation)) &&
+ \ eval((['s:syn_at(line("."),col(".")) !~? "regex"'] +
+ \ repeat(['s:previous_token() != "."'],5) + [1])[
+ \ index(split('/ typeof in instanceof void delete'),s:token())])
+endfunction
-" Find line above 'lnum' that isn't empty, in a comment, or in a string.
+" get the line of code stripped of comments. if called with two args, leave
+" cursor at the last non-comment char.
+function s:Trim(ln,...)
+ let pline = substitute(getline(a:ln),'\s*$','','')
+ let l:max = max([match(pline,'.*[^/]\zs\/[/*]'),0])
+ while l:max && s:syn_at(a:ln, strlen(pline)) =~? s:syng_com
+ let pline = substitute(strpart(pline, 0, l:max),'\s*$','','')
+ let l:max = max([match(pline,'.*[^/]\zs\/[/*]'),0])
+ endwhile
+ return !a:0 || cursor(a:ln,strlen(pline)) ? pline : pline
+endfunction
+
+" Find line above 'lnum' that isn't empty or in a comment
function s:PrevCodeLine(lnum)
- let l:lnum = prevnonblank(a:lnum)
- while l:lnum
- if synIDattr(synID(l:lnum,matchend(getline(l:lnum), '^\s*[^''"]'),0),'name') !~? s:syng_strcom
- return l:lnum
- endif
- let l:lnum = prevnonblank(l:lnum - 1)
+ let l:n = prevnonblank(a:lnum)
+ while getline(l:n) =~ '^\s*\/[/*]' || s:syn_at(l:n,1) =~? s:syng_com
+ let l:n = prevnonblank(l:n-1)
endwhile
+ return l:n
endfunction
" Check if line 'lnum' has a balanced amount of parentheses.
function s:Balanced(lnum)
- let [open_0,open_2,open_4] = [0,0,0]
+ let l:open = 0
let l:line = getline(a:lnum)
let pos = match(l:line, '[][(){}]', 0)
while pos != -1
- if synIDattr(synID(a:lnum,pos + 1,0),'name') !~? s:syng_strcom
- let idx = stridx('(){}[]', l:line[pos])
- if idx % 2 == 0
- let open_{idx} = open_{idx} + 1
- else
- let open_{idx - 1} = open_{idx - 1} - 1
+ if s:syn_at(a:lnum,pos + 1) !~? s:syng_strcom
+ let l:open += match(' ' . l:line[pos],'[[({]')
+ if l:open < 0
+ return
endif
endif
let pos = match(l:line, '[][(){}]', pos + 1)
endwhile
- return (!open_4 + !open_2 + !open_0) - 2
+ return !l:open
endfunction
-" }}}
-function GetJavascriptIndent()
- if !exists('b:js_cache')
- let b:js_cache = [0,0,0]
+function s:OneScope(lnum)
+ let pline = s:Trim(a:lnum,1)
+ if pline[-1:] == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
+ let token = s:previous_token()
+ if index(split('await each'),token) + 1
+ return s:previous_token() ==# 'for'
+ endif
+ return index(split('for if let while with'),token) + 1
+ endif
+ return eval((['getline(".")[col(".")-2] == "="'] +
+ \ repeat(['s:previous_token(1) != "."'],2) + [0])[
+ \ index(split('> else do'),s:token())])
+endfunction
+
+" returns braceless levels started by 'i' and above lines * &sw. 'num' is the
+" lineNr which encloses the entire context, 'cont' if whether line 'i' + 1 is
+" a continued expression, which could have started in a braceless context
+function s:iscontOne(i,num,cont)
+ let [l:i, l:num, bL] = [a:i, a:num + !a:num, 0]
+ let pind = a:num ? indent(l:num) + s:W : 0
+ let ind = indent(l:i) + (a:cont ? 0 : s:W)
+ while l:i >= l:num && (ind > pind || l:i == l:num)
+ if indent(l:i) < ind && s:OneScope(l:i)
+ let bL += s:W
+ let l:i = line('.')
+ elseif !a:cont || bL || ind < indent(a:i)
+ break
+ endif
+ let ind = min([ind, indent(l:i)])
+ let l:i = s:PrevCodeLine(l:i - 1)
+ endwhile
+ return bL
+endfunction
+
+" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
+function s:IsBlock()
+ let l:ln = line('.')
+ let char = s:previous_token()
+ let syn = char =~ '[{>/]' ? s:syn_at(line('.'),col('.')-(char == '{')) : ''
+ if syn =~? 'xml\|jsx'
+ return char != '{'
+ elseif char =~ '\k'
+ return index(split('return const let import export yield default delete var void typeof throw new in instanceof')
+ \ ,char) < (0 + (line('.') != l:ln)) || s:previous_token() == '.'
+ elseif char == '>'
+ return getline('.')[col('.')-2] == '=' || syn =~? '^jsflow'
+ elseif char == ':'
+ return s:label_end(0,strpart(getline('.'),0,col('.')))
endif
+ return syn =~? 'regex' || char !~ '[-=~!<*+,/?^%|&([]'
+endfunction
+
+function GetJavascriptIndent()
+ let b:js_cache = get(b:,'js_cache',[0,0,0])
" Get the current line.
let l:line = getline(v:lnum)
- let syns = synIDattr(synID(v:lnum, 1, 0), 'name')
+ let syns = s:syn_at(v:lnum, 1)
- " start with strings,comments,etc.{{{2
- if (l:line !~ '^[''"`]' && syns =~? '\%(string\|template\)') ||
- \ (l:line !~ '^\s*[/*]' && syns =~? s:syng_comment)
+ " start with strings,comments,etc.
+ if syns =~? s:syng_com
+ if l:line =~ '^\s*\*'
+ return cindent(v:lnum)
+ elseif l:line !~ '^\s*\/[/*]'
+ return -1
+ endif
+ elseif syns =~? s:syng_str && l:line !~ '^[''"]'
+ if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1)
+ let b:js_cache[0] = v:lnum
+ endif
return -1
endif
- if l:line !~ '^\%(\/\*\|\s*\/\/\)' && syns =~? s:syng_comment
- return cindent(v:lnum)
- endif
let l:lnum = s:PrevCodeLine(v:lnum - 1)
- if l:lnum == 0
- return 0
+ if !l:lnum
+ return
endif
- if (l:line =~# s:expr_case)
- let cpo_switch = &cpo
- set cpo+=%
- let ind = cindent(v:lnum)
- let &cpo = cpo_switch
- return ind
+ let l:line = substitute(l:line,'^\s*','','')
+ if l:line[:1] == '/*'
+ let l:line = substitute(l:line,'^\%(\/\*.\{-}\*\/\s*\)*','','')
+ endif
+ if l:line =~ '^\/[/*]'
+ let l:line = ''
endif
- "}}}
- " the containing paren, bracket, curly. Memoize, last lineNr either has the
- " same scope or starts a new one, unless if it closed a scope.
+ " the containing paren, bracket, or curly. Many hacks for performance
call cursor(v:lnum,1)
- if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum && b:js_cache[0] &&
- \ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum) > 0)
- let num = b:js_cache[1]
- elseif syns != '' && l:line[0] =~ '\s'
- let pattern = syns =~? 'block' ? ['{','}'] : syns =~? 'jsparen' ? ['(',')'] :
- \ syns =~? 'jsbracket'? ['\[','\]'] : ['[({[]','[])}]']
- let num = s:GetPair(pattern[0],pattern[1],'bW',2000)
+ let idx = strlen(l:line) ? stridx('])}',l:line[0]) : -1
+ if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
+ \ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
+ call call('cursor',b:js_cache[1:])
else
- let num = s:GetPair('[({[]','[])}]','bW',2000)
+ let [s:looksyn, s:free, top] = [v:lnum - 1, 1, (!indent(l:lnum) &&
+ \ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum]
+ if idx + 1
+ call s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,top)
+ elseif indent(v:lnum) && syns =~? 'block'
+ call s:GetPair('{','}','bW','s:skip_func()',2000,top)
+ else
+ call s:alternatePair(top)
+ endif
endif
- let b:js_cache = [v:lnum,num,line('.') == v:lnum ? b:js_cache[2] : col('.')]
- if l:line =~ s:line_pre . '[])}]'
- return indent(num)
+ if idx + 1
+ if idx == 2 && search('\S','bW',line('.')) && s:looking_at() == ')'
+ call s:GetPair('(',')','bW',s:skip_expr,200)
+ endif
+ return indent('.')
endif
- call cursor(b:js_cache[1],b:js_cache[2])
-
- let swcase = getline(l:lnum) =~# s:expr_case
- let pline = swcase ? getline(l:lnum) : substitute(getline(l:lnum), '\%(:\@<!\/\/.*\)$', '','')
- let inb = num == 0 || num < l:lnum && ((l:line !~ s:line_pre . ',' && pline !~ ',' . s:line_term) || s:IsBlock())
- let switch_offset = num == 0 || s:OneScope(num, strpart(getline(num),0,b:js_cache[2] - 1),1) !=# 'switch' ? 0 :
- \ &cino !~ ':' || !has('float') ? s:sw() :
- \ float2nr(str2float(matchstr(&cino,'.*:\zs[-0-9.]*')) * (&cino =~# '.*:[^,]*s' ? s:sw() : 1))
-
- " most significant, find the indent amount
- if inb && !swcase && ((l:line =~# g:javascript_opfirst || pline =~# g:javascript_continuation) ||
- \ num < l:lnum && s:OneScope(l:lnum,pline,0) =~# '\<\%(for\|each\|if\|let\|no\sb\|w\%(hile\|ith\)\)\>' &&
- \ l:line !~ s:line_pre . '{')
- return (num > 0 ? indent(num) : -s:sw()) + (s:sw() * 2) + switch_offset
- elseif num > 0
- return indent(num) + s:sw() + switch_offset
+ let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2])
+ let num = b:js_cache[1]
+
+ let [s:W, isOp, bL, switch_offset] = [s:sw(),0,0,0]
+ if !num || s:looking_at() == '{' && s:IsBlock()
+ let pline = s:Trim(l:lnum)
+ if num && s:looking_at() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
+ let num = line('.')
+ if s:previous_token() ==# 'switch'
+ if &cino !~ ':' || !has('float')
+ let switch_offset = s:W
+ else
+ let cinc = matchlist(&cino,'.*:\(-\)\=\([0-9.]*\)\(s\)\=\C')
+ let switch_offset = float2nr(str2float(cinc[1].(strlen(cinc[2]) ? cinc[2] : strlen(cinc[3])))
+ \ * (strlen(cinc[3]) ? s:W : 1))
+ endif
+ if pline[-1:] != '.' && l:line =~# '^' . s:case_stmt
+ return indent(num) + switch_offset
+ elseif s:label_end(l:lnum,pline)
+ return indent(l:lnum) + s:W
+ endif
+ endif
+ endif
+ if pline[-1:] !~ '[{;]'
+ let isOp = l:line =~# s:opfirst || s:continues(l:lnum,pline)
+ let bL = s:iscontOne(l:lnum,num,isOp)
+ let bL -= (bL && l:line[0] == '{') * s:W
+ endif
endif
+ " main return
+ if isOp
+ return (num ? indent(num) : -s:W) + (s:W * 2) + switch_offset + bL
+ elseif num
+ return indent(num) + s:W + switch_offset + bL
+ endif
+ return bL
endfunction
-
let &cpo = s:cpo_save
unlet s:cpo_save
diff --git a/indent/plantuml.vim b/indent/plantuml.vim
index 3e0f455d..93ecb8cb 100644
--- a/indent/plantuml.vim
+++ b/indent/plantuml.vim
@@ -14,45 +14,46 @@ if exists("*GetPlantUMLIndent")
endif
let s:incIndent =
- \ '^\s*\(loop\|alt\|opt\|group\|critical\|else\|legend\|box\)\>\|' .
- \ '^\s*\([hr]\?note\|ref\)\>[^:]*$\|' .
- \ '^\s*title\s*$\|' .
- \ '^\s*skinparam\>.*{\s*$\|' .
- \ '^\s*state\>.*{'
+ \ '^\s*\%(loop\|alt\|opt\|group\|critical\|else\|legend\|box\|if\|while\)\>\|' .
+ \ '^\s*ref\>[^:]*$\|' .
+ \ '^\s*[hr]\?note\>\%(\%("[^"]*" \<as\>\)\@![^:]\)*$\|' .
+ \ '^\s*title\s*$\|' .
+ \ '^\s*skinparam\>.*{\s*$\|' .
+ \ '^\s*\%(state\|class\|partition\|rectangle\)\>.*{'
-let s:decIndent = '^\s*\(end\|else\|}\)'
+let s:decIndent = '^\s*\%(end\|else\|}\)'
function! GetPlantUMLIndent(...) abort
- "for current line, use arg if given or v:lnum otherwise
- let clnum = a:0 ? a:1 : v:lnum
-
- if !s:insidePlantUMLTags(clnum)
- return indent(clnum)
+ "for current line, use arg if given or v:lnum otherwise
+ let clnum = a:0 ? a:1 : v:lnum
+
+ if !s:insidePlantUMLTags(clnum)
+ return indent(clnum)
+ endif
+
+ let pnum = prevnonblank(clnum-1)
+ let pindent = indent(pnum)
+ let pline = getline(pnum)
+ let cline = getline(clnum)
+
+ if cline =~ s:decIndent
+ if pline =~ s:incIndent
+ return pindent
+ else
+ return pindent - shiftwidth()
endif
- let pnum = prevnonblank(clnum-1)
- let pindent = indent(pnum)
- let pline = getline(pnum)
- let cline = getline(clnum)
-
- if cline =~ s:decIndent
- if pline =~ s:incIndent
- return pindent
- else
- return pindent - shiftwidth()
- endif
-
- elseif pline =~ s:incIndent
- return pindent + shiftwidth()
- endif
+ elseif pline =~ s:incIndent
+ return pindent + shiftwidth()
+ endif
- return pindent
+ return pindent
endfunction
function! s:insidePlantUMLTags(lnum) abort
- call cursor(a:lnum, 1)
- return search('@startuml', 'Wbn') && search('@enduml', 'Wn')
+ call cursor(a:lnum, 1)
+ return search('@startuml', 'Wbn') && search('@enduml', 'Wn')
endfunction
endif
diff --git a/indent/ruby.vim b/indent/ruby.vim
index 8d8fa2e9..84067fe9 100644
--- a/indent/ruby.vim
+++ b/indent/ruby.vim
@@ -51,11 +51,11 @@ let s:syng_strcom = '\<ruby\%(Regexp\|RegexpDelimiter\|RegexpEscape' .
" Regex of syntax group names that are strings.
let s:syng_string =
- \ '\<ruby\%(String\|Interpolation\|NoInterpolation\|StringEscape\)\>'
+ \ '\<ruby\%(String\|Interpolation\|InterpolationDelimiter\|NoInterpolation\|StringEscape\)\>'
" Regex of syntax group names that are strings or documentation.
let s:syng_stringdoc =
- \'\<ruby\%(String\|Interpolation\|NoInterpolation\|StringEscape\|Documentation\)\>'
+ \ '\<ruby\%(String\|Interpolation\|InterpolationDelimiter\|NoInterpolation\|StringEscape\|Documentation\)\>'
" Expression used to check whether we should skip a match with searchpair().
let s:skip_expr =
@@ -392,7 +392,7 @@ function! s:FindContainingClass()
call setpos('.', saved_position)
return found_lnum
endif
- endif
+ endwhile
call setpos('.', saved_position)
return 0
diff --git a/syntax/blade.vim b/syntax/blade.vim
index 42af5145..4c04db75 100644
--- a/syntax/blade.vim
+++ b/syntax/blade.vim
@@ -31,8 +31,15 @@ syn region bladeEcho matchgroup=bladeDelimiter start="@\@<!{{" end="}}"
syn region bladeEcho matchgroup=bladeDelimiter start="{!!" end="!!}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" contains=bladeTodo containedin=ALLBUT,@bladeExempt keepend
-syn keyword bladeKeyword @if @elseif @foreach @forelse @for @while @can @cannot @elsecan @elsecannot @include @includeIf @each @inject @extends @section @stack @push @unless @yield @parent @hasSection @break @continue @unset @lang @choice nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
-syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @empty @endforelse @endwhile @endcan @endcannot @stop @append @endsection @endpush @show @overwrite @verbatim @endverbatim containedin=ALLBUT,@bladeExempt
+syn keyword bladeKeyword @if @elseif @foreach @forelse @for @while @can @cannot @elsecan @elsecannot @include
+ \ @includeIf @each @inject @extends @section @stack @push @unless @yield @parent @hasSection @break @continue
+ \ @unset @lang @choice @component @slot
+ \ nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
+
+syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @empty @endforelse @endwhile @endcan
+ \ @endcannot @stop @append @endsection @endpush @show @overwrite @verbatim @endverbatim @endcomponent
+ \ @endslot
+ \ containedin=ALLBUT,@bladeExempt
if exists('g:blade_custom_directives')
exe "syn keyword bladeKeyword @" . join(g:blade_custom_directives, ' @') . " nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt"
diff --git a/syntax/c.vim b/syntax/c.vim
index 8f53efa4..0dff4be1 100644
--- a/syntax/c.vim
+++ b/syntax/c.vim
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c/c++') == -1
" Vim syntax file
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2016 Apr 10
+" Last Change: 2016 Nov 17
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
@@ -184,11 +184,6 @@ syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumbe
syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
"hex number
syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
-if s:ft ==# 'cpp' && !exists("cpp_no_cpp14")
- syn match cNumber display contained "\d\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
- syn match cNumber display contained "0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
- syn match cNumber display contained "0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
-endif
" Flag the first zero of an octal number as something special
syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
syn match cOctalZero display contained "\<0"
@@ -365,36 +360,36 @@ if !exists("c_no_c99") " ISO C99
endif
" Accept %: for # (C99)
-syn region cPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
-syn match cPreConditMatch display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
+syn region cPreCondit start="^\s*\zs\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
+syn match cPreConditMatch display "^\s*\zs\(%:\|#\)\s*\(else\|endif\)\>"
if !exists("c_no_if0")
syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip
- syn region cCppOutWrapper start="^\s*\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold
- syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
+ syn region cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold
+ syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
if !exists("c_no_if0_fold")
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold
else
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
endif
- syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
- syn region cCppInWrapper start="^\s*\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold
- syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
+ syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
+ syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold
+ syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
if !exists("c_no_if0_fold")
- syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
+ syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
else
- syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
+ syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
endif
- syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
- syn region cCppOutSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
- syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc
+ syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
+ syn region cCppOutSkip contained start="^\s*\zs\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
+ syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc
endif
syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
syn match cIncluded display contained "<[^>]*>"
-syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
+syn match cInclude display "^\s*\zs\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
"syn match cLineSkip "\\$"
syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock
-syn region cDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
-syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
+syn region cDefine start="^\s*\zs\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
+syn region cPreProc start="^\s*\zs\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
" Highlight User Labels
syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
@@ -403,21 +398,21 @@ if s:ft ==# 'c' || exists("cpp_no_cpp11")
endif
" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
syn cluster cLabelGroup contains=cUserLabel
-syn match cUserCont display "^\s*\I\i*\s*:$" contains=@cLabelGroup
-syn match cUserCont display ";\s*\I\i*\s*:$" contains=@cLabelGroup
+syn match cUserCont display "^\s*\zs\I\i*\s*:$" contains=@cLabelGroup
+syn match cUserCont display ";\s*\zs\I\i*\s*:$" contains=@cLabelGroup
if s:ft ==# 'cpp'
- syn match cUserCont display "^\s*\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
- syn match cUserCont display ";\s*\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
+ syn match cUserCont display "^\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
+ syn match cUserCont display ";\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
else
- syn match cUserCont display "^\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
- syn match cUserCont display ";\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
+ syn match cUserCont display "^\s*\zs\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
+ syn match cUserCont display ";\s*\zs\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
endif
syn match cUserLabel display "\I\i*" contained
" Avoid recognizing most bitfields as labels
-syn match cBitField display "^\s*\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
-syn match cBitField display ";\s*\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
+syn match cBitField display "^\s*\zs\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
+syn match cBitField display ";\s*\zs\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
if exists("c_minlines")
let b:c_minlines = c_minlines
diff --git a/syntax/coffee.vim b/syntax/coffee.vim
index 38839f35..589b8534 100644
--- a/syntax/coffee.vim
+++ b/syntax/coffee.vim
@@ -34,7 +34,7 @@ hi def link coffeeConditional Conditional
syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display
hi def link coffeeException Exception
-syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\|debugger\)\>/
+syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\|debugger\|import\|export\)\>/
\ display
" The `own` keyword is only a keyword after `for`.
syn match coffeeKeyword /\<for\s\+own\>/ contained containedin=coffeeRepeat
@@ -109,7 +109,7 @@ hi def link coffeeFloat Float
" An error for reserved keywords, taken from the RESERVED array:
" http://coffeescript.org/documentation/docs/lexer.html#section-67
-syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|export\|import\|native\|__hasProp\|__extends\|__slice\|__bind\|__indexOf\|implements\|interface\|package\|private\|protected\|public\|static\)\>/
+syn match coffeeReservedError /\<\%(case\|default\|function\|var\|void\|with\|const\|let\|enum\|native\|implements\|interface\|package\|private\|protected\|public\|static\)\>/
\ display
hi def link coffeeReservedError Error
diff --git a/syntax/cpp.vim b/syntax/cpp.vim
index 8406070d..ff0c7ec2 100644
--- a/syntax/cpp.vim
+++ b/syntax/cpp.vim
@@ -4,23 +4,16 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c/c++') == -1
" Language: C++
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
-" Last Change: 2015 Nov 10
+" Last Change: 2016 Oct 28
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
+" quit when a syntax file was already loaded
+if exists("b:current_syntax")
finish
endif
" Read the C syntax to start with
-if version < 600
- so <sfile>:p:h/c.vim
-else
- runtime! syntax/c.vim
- unlet b:current_syntax
-endif
+runtime! syntax/c.vim
+unlet b:current_syntax
" C++ extensions
syn keyword cppStatement new delete this friend using
@@ -39,8 +32,8 @@ syn keyword cppConstant __cplusplus
" C++ 11 extensions
if !exists("cpp_no_cpp11")
- syn keyword cppModifier override final auto
- syn keyword cppType nullptr_t
+ syn keyword cppModifier override final
+ syn keyword cppType nullptr_t auto
syn keyword cppExceptions noexcept
syn keyword cppStorageClass constexpr decltype thread_local
syn keyword cppConstant nullptr
@@ -55,36 +48,31 @@ endif
" C++ 14 extensions
if !exists("cpp_no_cpp14")
- syn match cppNumber display "\<0b[01]\+\(u\=l\{0,2}\|ll\=u\)\>"
+ syn case ignore
+ syn match cppNumber display "\<0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
+ syn match cppNumber display "\<[1-9]\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
+ syn match cppNumber display "\<0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
+ syn case match
endif
" The minimum and maximum operators in GNU C++
syn match cppMinMax "[<>]?"
" Default highlighting
-if version >= 508 || !exists("did_cpp_syntax_inits")
- if version < 508
- let did_cpp_syntax_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
- HiLink cppAccess cppStatement
- HiLink cppCast cppStatement
- HiLink cppExceptions Exception
- HiLink cppOperator Operator
- HiLink cppStatement Statement
- HiLink cppModifier Type
- HiLink cppType Type
- HiLink cppStorageClass StorageClass
- HiLink cppStructure Structure
- HiLink cppBoolean Boolean
- HiLink cppConstant Constant
- HiLink cppRawStringDelimiter Delimiter
- HiLink cppRawString String
- HiLink cppNumber Number
- delcommand HiLink
-endif
+hi def link cppAccess cppStatement
+hi def link cppCast cppStatement
+hi def link cppExceptions Exception
+hi def link cppOperator Operator
+hi def link cppStatement Statement
+hi def link cppModifier Type
+hi def link cppType Type
+hi def link cppStorageClass StorageClass
+hi def link cppStructure Structure
+hi def link cppBoolean Boolean
+hi def link cppConstant Constant
+hi def link cppRawStringDelimiter Delimiter
+hi def link cppRawString String
+hi def link cppNumber Number
let b:current_syntax = "cpp"
diff --git a/syntax/elixir.vim b/syntax/elixir.vim
index 12223577..cd24cba6 100644
--- a/syntax/elixir.vim
+++ b/syntax/elixir.vim
@@ -10,25 +10,23 @@ set cpo&vim
" syncing starts 2000 lines before top line so docstrings don't screw things up
syn sync minlines=2000
-syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@elixirDeclaration,elixirTodo,elixirArguments,elixirBlockDefinition
+syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@elixirDeclaration,elixirTodo,elixirArguments,elixirBlockDefinition,elixirUnusedVariable
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation
syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
syn cluster elixirDeclaration contains=elixirFunctionDeclaration,elixirModuleDeclaration,elixirProtocolDeclaration,elixirImplDeclaration,elixirRecordDeclaration,elixirMacroDeclaration,elixirDelegateDeclaration,elixirOverridableDeclaration,elixirExceptionDeclaration,elixirCallbackDeclaration,elixirStructDeclaration
-syn match elixirComment '^\s*#.*' contains=elixirTodo,@Spell
+syn match elixirComment '#.*' contains=elixirTodo,@Spell
syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
-syn keyword elixirKeyword case when with cond for if unless try receive send
-syn keyword elixirKeyword do end exit raise throw after rescue catch else
-syn keyword elixirKeyword quote unquote super spawn spawn_link spawn_monitor
+syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>'
+
+syn match elixirKeyword '\(\.\)\@<!\<\(for\|case\|when\|with\|cond\|if\|unless\|try\|receive\|send\)\>'
+syn match elixirKeyword '\(\.\)\@<!\<\(exit\|raise\|throw\|after\|rescue\|catch\|else\)\>'
+syn match elixirKeyword '\(\.\)\@<!\<\(quote\|unquote\|super\|spawn\|spawn_link\|spawn_monitor\)\>'
-" Functions used on guards
-syn keyword elixirKeyword contained is_atom is_binary is_bitstring is_boolean
-syn keyword elixirKeyword contained is_float is_function is_integer is_list
-syn keyword elixirKeyword contained is_map is_nil is_number is_pid is_port
-syn keyword elixirKeyword contained is_record is_reference is_tuple is_exception
-syn keyword elixirKeyword contained abs bit_size byte_size div elem hd length
-syn keyword elixirKeyword contained map_size node rem round tl trunc tuple_size
+" Kernel functions
+syn match elixirKernelFunction contained containedin=elixirGuard '\<\(is_atom\|is_binary\|is_bitstring\|is_boolean\|is_float\|is_function\|is_integer\|is_list\|is_map\|is_nil\|is_number\|is_pid\|is_port\)\>\([ (]\)\@='
+syn match elixirKernelFunction contained containedin=elixirGuard '\<\(is_record\|is_reference\|is_tuple\|is_exception\|abs\|bit_size\|byte_size\|div\|elem\|hd\|length\|map_size\|node\|rem\|round\|tl\|trunc\|tuple_size\)\>\([ (]\)\@='
syn match elixirGuard '.*when.*' contains=ALLBUT,@elixirNotTop
@@ -36,12 +34,10 @@ syn keyword elixirInclude import require alias use
syn keyword elixirSelf self
-syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>'
-
" This unfortunately also matches function names in function calls
-syn match elixirUnusedVariable '\(([^)]*\)\@<=\<_\w*\>'
+syn match elixirUnusedVariable contained '\<_\w*\>'
-syn keyword elixirOperator and not or when xor in
+syn keyword elixirOperator and not or in
syn match elixirOperator '!==\|!=\|!'
syn match elixirOperator '=\~\|===\|==\|='
syn match elixirOperator '<<<\|<<\|<=\|<-\|<'
@@ -58,6 +54,8 @@ syn match elixirAtom '\(:\)\@<!:\%([a-zA-Z_]\w*\%([?!]\|=[>=]\@!\)\?\|<>\|===\
syn match elixirAtom '\(:\)\@<!:\%(<=>\|&&\?\|%\(()\|\[\]\|{}\)\|++\?\|--\?\|||\?\|!\|//\|[%&`/|]\)'
syn match elixirAtom "\%([a-zA-Z_]\w*[?!]\?\):\(:\)\@!"
+syn match elixirBlockInline "\<\(do\|else\)\>:\@="
+
syn match elixirAlias '\<[!]\?[A-Z]\w*\(\.[A-Z]\w*\)*\>'
syn keyword elixirBoolean true false nil
@@ -79,20 +77,18 @@ syn match elixirRegexCharClass "\[:\(alnum\|alpha\|ascii\|blank\|cntrl\|
syn region elixirRegex matchgroup=elixirRegexDelimiter start="%r/" end="/[uiomxfr]*" skip="\\\\" contains=@elixirRegexSpecial
-syn region elixirString matchgroup=elixirStringDelimiter start=+\z('\)+ end=+\z1+ skip=+\\\\+ contains=@elixirStringContained
-syn region elixirString matchgroup=elixirStringDelimiter start=+\z("\)+ end=+\z1+ skip=+\\\\+ contains=@elixirStringContained
+syn region elixirString matchgroup=elixirStringDelimiter start=+\z('\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=@elixirStringContained
+syn region elixirString matchgroup=elixirStringDelimiter start=+\z("\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=@elixirStringContained
syn region elixirString matchgroup=elixirStringDelimiter start=+\z('''\)+ end=+^\s*\z1+ skip=+'\|\\\\+ contains=@elixirStringContained
syn region elixirString matchgroup=elixirStringDelimiter start=+\z("""\)+ end=+^\s*\z1+ skip=+"\|\\\\+ contains=@elixirStringContained
-syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop
-
-syn match elixirDocString +\(@\w*doc\s*\)\@<=\%("""\_.\{-}\_^\s*"""\|".\{-\}"\)+ contains=elixirTodo,elixirInterpolation,@Spell fold
+syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirKernelFunction,elixirComment,@elixirNotTop
syn match elixirAtomInterpolated ':\("\)\@=' contains=elixirString
syn match elixirString "\(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|0[0-7]{0,2}[0-7]\@!\>\|[^x0MC]\)\|(\\[MC]-)+\w\|[^\s\\]\)"
-syn region elixirBlock matchgroup=elixirBlockDefinition start="\<do\>:\@!" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
-syn region elixirElseBlock matchgroup=elixirBlockDefinition start="\<else\>:\@!" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
-syn region elixirAnonymousFunction matchgroup=elixirBlockDefinition start="\<fn\>" end="\<end\>" contains=ALLBUT,@elixirNotTop fold
+syn region elixirBlock matchgroup=elixirBlockDefinition start="\<do\>:\@!" end="\<end\>" contains=ALLBUT,elixirKernelFunction,@elixirNotTop fold
+syn region elixirElseBlock matchgroup=elixirBlockDefinition start="\<else\>:\@!" end="\<end\>" contains=ALLBUT,elixirKernelFunction,@elixirNotTop fold
+syn region elixirAnonymousFunction matchgroup=elixirBlockDefinition start="\<fn\>" end="\<end\>" contains=ALLBUT,elixirKernelFunction,@elixirNotTop fold
syn region elixirArguments start="(" end=")" contained contains=elixirOperator,elixirAtom,elixirPseudoVariable,elixirAlias,elixirBoolean,elixirVariable,elixirUnusedVariable,elixirNumber,elixirDocString,elixirAtomInterpolated,elixirRegex,elixirString,elixirStringDelimiter,elixirRegexDelimiter,elixirInterpolationDelimiter,elixirSigilDelimiter
@@ -109,26 +105,49 @@ syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l{"
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l<" end=">" skip="\\\\\|\\>" contains=@elixirStringContained,elixirRegexEscapePunctuation fold
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\[" end="\]" skip="\\\\\|\\\]" contains=@elixirStringContained,elixirRegexEscapePunctuation fold
syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l(" end=")" skip="\\\\\|\\)" contains=@elixirStringContained,elixirRegexEscapePunctuation fold
+syn region elixirSigil matchgroup=elixirSigilDelimiter start="\~\l\/" end="\/" skip="\\\\\|\\\/" contains=@elixirStringContained,elixirRegexEscapePunctuation fold
+
+" Sigils surrounded with heredoc
+syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z("""\)+ end=+^\s*\zs\z1\s*$+ skip=+\\"+ fold
+syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z('''\)+ end=+^\s*\zs\z1\s*$+ skip=+\\'+ fold
+
+" Documentation
+if exists('g:elixir_use_markdown_for_docs') && g:elixir_use_markdown_for_docs
+ syn include @markdown syntax/markdown.vim
+ syn cluster elixirDocStringContained contains=@markdown,@Spell
+else
+ let g:elixir_use_markdown_for_docs = 0
+ syn cluster elixirDocStringContained contains=elixirDocTest,elixirTodo,@Spell
+
+ " doctests
+ syn region elixirDocTest start="^\s*\%(iex\|\.\.\.\)\%((\d*)\)\?>\s" end="^\s*$" contained
+endif
-" Sigils surrounded with docString
-syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z("""\)+ end=+^\s*\zs\z1+ skip=+\\"+ fold
-syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z('''\)+ end=+^\s*\zs\z1+ skip=+\\'+ fold
+syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]\z(/\|\"\|'\||\)" end="\z1" skip="\\\\\|\\\z1" contains=@elixirDocStringContained fold keepend
+syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]{" end="}" skip="\\\\\|\\}" contains=@elixirDocStringContained fold keepend
+syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]<" end=">" skip="\\\\\|\\>" contains=@elixirDocStringContained fold keepend
+syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss]\[" end="\]" skip="\\\\\|\\\]" contains=@elixirDocStringContained fold keepend
+syn region elixirDocString matchgroup=elixirSigilDelimiter start="\%(@\w*doc\s\+\)\@<=\~[Ss](" end=")" skip="\\\\\|\\)" contains=@elixirDocStringContained fold keepend
+syn region elixirDocString matchgroup=elixirStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=@elixirDocStringContained keepend
+syn region elixirDocString matchgroup=elixirStringDelimiter start=+\%(@\w*doc\s\+\)\@<=\z("""\)+ end=+\z1+ contains=@elixirDocStringContained fold keepend
+syn region elixirDocString matchgroup=elixirSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z('''\)+ end=+\z1+ skip=+\\'+ contains=@elixirDocStringContained fold keepend
+syn region elixirDocString matchgroup=elixirSigilDelimiter start=+\%(@\w*doc\s\+\)\@<=\~[Ss]\z("""\)+ end=+\z1+ skip=+\\"+ contains=@elixirDocStringContained fold keepend
" Defines
-syn keyword elixirDefine def nextgroup=elixirFunctionDeclaration skipwhite skipnl
-syn keyword elixirPrivateDefine defp nextgroup=elixirFunctionDeclaration skipwhite skipnl
-syn keyword elixirModuleDefine defmodule nextgroup=elixirModuleDeclaration skipwhite skipnl
-syn keyword elixirProtocolDefine defprotocol nextgroup=elixirProtocolDeclaration skipwhite skipnl
-syn keyword elixirImplDefine defimpl nextgroup=elixirImplDeclaration skipwhite skipnl
-syn keyword elixirRecordDefine defrecord nextgroup=elixirRecordDeclaration skipwhite skipnl
-syn keyword elixirPrivateRecordDefine defrecordp nextgroup=elixirRecordDeclaration skipwhite skipnl
-syn keyword elixirMacroDefine defmacro nextgroup=elixirMacroDeclaration skipwhite skipnl
-syn keyword elixirPrivateMacroDefine defmacrop nextgroup=elixirMacroDeclaration skipwhite skipnl
-syn keyword elixirDelegateDefine defdelegate nextgroup=elixirDelegateDeclaration skipwhite skipnl
-syn keyword elixirOverridableDefine defoverridable nextgroup=elixirOverridableDeclaration skipwhite skipnl
-syn keyword elixirExceptionDefine defexception nextgroup=elixirExceptionDeclaration skipwhite skipnl
-syn keyword elixirCallbackDefine defcallback nextgroup=elixirCallbackDeclaration skipwhite skipnl
-syn keyword elixirStructDefine defstruct skipwhite skipnl
+syn match elixirDefine '\<def\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
+syn match elixirPrivateDefine '\<defp\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
+syn match elixirModuleDefine '\<defmodule\>\(:\)\@!' nextgroup=elixirModuleDeclaration skipwhite skipnl
+syn match elixirProtocolDefine '\<defprotocol\>\(:\)\@!' nextgroup=elixirProtocolDeclaration skipwhite skipnl
+syn match elixirImplDefine '\<defimpl\>\(:\)\@!' nextgroup=elixirImplDeclaration skipwhite skipnl
+syn match elixirRecordDefine '\<defrecord\>\(:\)\@!' nextgroup=elixirRecordDeclaration skipwhite skipnl
+syn match elixirPrivateRecordDefine '\<defrecordp\>\(:\)\@!' nextgroup=elixirRecordDeclaration skipwhite skipnl
+syn match elixirMacroDefine '\<defmacro\>\(:\)\@!' nextgroup=elixirMacroDeclaration skipwhite skipnl
+syn match elixirPrivateMacroDefine '\<defmacrop\>\(:\)\@!' nextgroup=elixirMacroDeclaration skipwhite skipnl
+syn match elixirDelegateDefine '\<defdelegate\>\(:\)\@!' nextgroup=elixirDelegateDeclaration skipwhite skipnl
+syn match elixirOverridableDefine '\<defoverridable\>\(:\)\@!' nextgroup=elixirOverridableDeclaration skipwhite skipnl
+syn match elixirExceptionDefine '\<defexception\>\(:\)\@!' nextgroup=elixirExceptionDeclaration skipwhite skipnl
+syn match elixirCallbackDefine '\<defcallback\>\(:\)\@!' nextgroup=elixirCallbackDeclaration skipwhite skipnl
+syn match elixirStructDefine '\<defstruct\>\(:\)\@!' skipwhite skipnl
" Declarations
syn match elixirModuleDeclaration "[^[:space:];#<]\+" contained nextgroup=elixirBlock skipwhite skipnl
@@ -143,6 +162,12 @@ syn match elixirOverridableDeclaration "[^[:space:];#<]\+" contained con
syn match elixirExceptionDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
syn match elixirCallbackDeclaration "[^[:space:];#<,()\[\]]\+" contained contains=elixirFunctionDeclaration skipwhite skipnl
+" ExUnit
+syn match elixirExUnitMacro "\(^\s*\)\@<=\<\(test\|describe\|setup\|setup_all\|on_exit\|doctest\)\>"
+syn match elixirExUnitAssert "\(^\s*\)\@<=\<\(assert\|assert_in_delta\|assert_raise\|assert_receive\|assert_received\|catch_error\)\>"
+syn match elixirExUnitAssert "\(^\s*\)\@<=\<\(catch_exit\|catch_throw\|flunk\|refute\|refute_in_delta\|refute_receive\|refute_received\)\>"
+
+hi def link elixirBlockInline Keyword
hi def link elixirBlockDefinition Keyword
hi def link elixirDefine Define
hi def link elixirPrivateDefine Define
@@ -158,6 +183,7 @@ hi def link elixirOverridableDefine Define
hi def link elixirExceptionDefine Define
hi def link elixirCallbackDefine Define
hi def link elixirStructDefine Define
+hi def link elixirExUnitMacro Define
hi def link elixirModuleDeclaration Type
hi def link elixirFunctionDeclaration Function
hi def link elixirMacroDeclaration Macro
@@ -165,6 +191,8 @@ hi def link elixirInclude Include
hi def link elixirComment Comment
hi def link elixirTodo Todo
hi def link elixirKeyword Keyword
+hi def link elixirExUnitAssert Keyword
+hi def link elixirKernelFunction Keyword
hi def link elixirOperator Operator
hi def link elixirAtom Constant
hi def link elixirPseudoVariable Constant
@@ -175,6 +203,7 @@ hi def link elixirSelf Identifier
hi def link elixirUnusedVariable Comment
hi def link elixirNumber Number
hi def link elixirDocString Comment
+hi def link elixirDocTest elixirKeyword
hi def link elixirAtomInterpolated elixirAtom
hi def link elixirRegex elixirString
hi def link elixirRegexEscape elixirSpecial
diff --git a/syntax/glsl.vim b/syntax/glsl.vim
index 147c42e7..f0424b50 100644
--- a/syntax/glsl.vim
+++ b/syntax/glsl.vim
@@ -8,7 +8,7 @@ if exists("b:current_syntax") && b:current_syntax == "glsl"
endif
" Statements
-syn keyword glslConditional if else
+syn keyword glslConditional if else switch case default
syn keyword glslRepeat for while do
syn keyword glslStatement discard return break continue
diff --git a/syntax/go.vim b/syntax/go.vim
index 203be1f2..0beaf545 100644
--- a/syntax/go.vim
+++ b/syntax/go.vim
@@ -129,12 +129,12 @@ hi def link goComplexes Type
" Predefined functions and values
syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/
syn match goBuiltins /\<\v(make|new|panic|print|println|real|recover)\ze\(/
-syn keyword goPredefinedIdentifiers nil iota
syn keyword goBoolean true false
+syn keyword goPredefinedIdentifiers nil iota
hi def link goBuiltins Keyword
-hi def link goPredefinedIdentifiers Identifier
hi def link goBoolean Boolean
+hi def link goPredefinedIdentifiers goBoolean
" Comments; their contents
syn keyword goTodo contained TODO FIXME XXX BUG
@@ -304,16 +304,18 @@ if g:go_highlight_functions != 0
syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
syn match goReceiverType /\w\+/ contained
syn match goFunction /\w\+/ contained
+ syn match goFunctionCall /\w\+\ze(/ contains=GoBuiltins,goDeclaration
else
syn keyword goDeclaration func
endif
hi def link goFunction Function
+hi def link goFunctionCall Type
" Methods;
if g:go_highlight_methods != 0
- syn match goMethod /\.\w\+\ze(/hs=s+1
+ syn match goMethodCall /\.\w\+\ze(/hs=s+1
endif
-hi def link goMethod Type
+hi def link goMethodCall Type
" Fields;
if g:go_highlight_fields != 0
@@ -326,7 +328,7 @@ if g:go_highlight_types != 0
syn match goTypeConstructor /\<\w\+{/he=e-1
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
- syn match goDeclType /\<interface\|struct\>/ contained skipwhite skipnl
+ syn match goDeclType /\<interface\|struct\>/ skipwhite skipnl
hi def link goReceiverType Type
else
syn keyword goDeclType struct interface
@@ -374,12 +376,7 @@ endif
hi def link goCoverageNormalText Comment
function! s:hi()
- " :GoSameIds
- if &background == 'dark'
- hi def goSameId term=bold cterm=bold ctermbg=white ctermfg=black guibg=white guifg=black
- else
- hi def goSameId term=bold cterm=bold ctermbg=14 guibg=Cyan
- endif
+ hi def link goSameId Search
" :GoCoverage commands
hi def goCoverageCovered ctermfg=green guifg=#A6E22E
diff --git a/syntax/haskell.vim b/syntax/haskell.vim
index b35c0225..1f0f905a 100644
--- a/syntax/haskell.vim
+++ b/syntax/haskell.vim
@@ -13,6 +13,10 @@ elseif exists("b:current_syntax")
finish
endif
+if !exists('g:haskell_disable_TH')
+ let g:haskell_disable_TH = 0
+endif
+
syn spell notoplevel
syn match haskellRecordField contained containedin=haskellBlock
\ "[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)"
@@ -82,7 +86,7 @@ syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$"
\ contains=
\ haskellTodo,
\ @Spell
-syn match haskellBacktick "`[A-Za-z_][A-Za-z0-9_\.']*`"
+syn match haskellBacktick "`[A-Za-z_][A-Za-z0-9_\.']*#\?`"
syn region haskellString start=+"+ skip=+\\\\\|\\"+ end=+"+
\ contains=@Spell
syn match haskellIdentifier "[_a-z][a-zA-z0-9_']*" contained
@@ -94,14 +98,16 @@ syn region haskellBlockComment start="{-" end="-}"
\ haskellTodo,
\ @Spell
syn region haskellPragma start="{-#" end="#-}"
-syn match haskellQuasiQuoted "." containedin=haskellQuasiQuote contained
-syn region haskellQuasiQuote matchgroup=haskellTH start="\[[_a-zA-Z][a-zA-z0-9._']*|" end="|\]"
-syn region haskellTHBlock matchgroup=haskellTH start="\[\(d\|t\|p\)\?|" end="|]" contains=TOP
-syn region haskellTHDoubleBlock matchgroup=haskellTH start="\[||" end="||]" contains=TOP
syn match haskellPreProc "^#.*$"
syn keyword haskellTodo TODO FIXME contained
" Treat a shebang line at the start of the file as a comment
syn match haskellShebang "\%^#!.*$"
+if exists('g:haskell_disable_TH') && g:haskell_disable_TH == 0
+ syn match haskellQuasiQuoted "." containedin=haskellQuasiQuote contained
+ syn region haskellQuasiQuote matchgroup=haskellTH start="\[[_a-zA-Z][a-zA-z0-9._']*|" end="|\]"
+ syn region haskellTHBlock matchgroup=haskellTH start="\[\(d\|t\|p\)\?|" end="|]" contains=TOP
+ syn region haskellTHDoubleBlock matchgroup=haskellTH start="\[||" end="||]" contains=TOP
+endif
if exists('g:haskell_enable_typeroles') && g:haskell_enable_typeroles == 1
syn keyword haskellTypeRoles phantom representational nominal contained
syn region haskellTypeRoleBlock matchgroup=haskellTypeRoles start="type\s\+role" end="$" keepend
diff --git a/syntax/html.vim b/syntax/html.vim
index 77dc0fce..0c03fa22 100644
--- a/syntax/html.vim
+++ b/syntax/html.vim
@@ -44,6 +44,29 @@ syn keyword htmlTagName contained missing-glyph mpath
syn keyword htmlTagName contained text textPath tref tspan vkern
syn keyword htmlTagName contained metadata title
+" MathML tags
+" https://www.w3.org/TR/MathML3/appendixi.html#index.elem
+syn keyword htmlTagName contained abs and annotation annotation-xml apply approx arccos arccosh arccot arccoth
+syn keyword htmlTagName contained arccsc arccsch arcsec arcsech arcsin arcsinh arctan arctanh arg bind
+syn keyword htmlTagName contained bvar card cartesianproduct cbytes ceiling cerror ci cn codomain complexes
+syn keyword htmlTagName contained compose condition conjugate cos cosh cot coth cs csc csch
+syn keyword htmlTagName contained csymbol curl declare degree determinant diff divergence divide domain domainofapplication
+syn keyword htmlTagName contained emptyset eq equivalent eulergamma exists exp exponentiale factorial factorof false
+syn keyword htmlTagName contained floor fn forall gcd geq grad gt ident image imaginary
+syn keyword htmlTagName contained imaginaryi implies in infinity int integers intersect interval inverse lambda
+syn keyword htmlTagName contained laplacian lcm leq limit list ln log logbase lowlimit lt
+syn keyword htmlTagName contained maction maligngroup malignmark math matrix matrixrow max mean median menclose
+syn keyword htmlTagName contained merror mfenced mfrac mglyph mi mi" min minus mlabeledtr mlongdiv
+syn keyword htmlTagName contained mmultiscripts mn mo mode moment momentabout mover mpadded mphantom mprescripts
+syn keyword htmlTagName contained mroot mrow ms mscarries mscarry msgroup msline mspace msqrt msrow
+syn keyword htmlTagName contained mstack mstyle msub msubsup msup mtable mtd mtext mtr munder
+syn keyword htmlTagName contained munderover naturalnumbers neq none not notanumber notin notprsubset notsubset or
+syn keyword htmlTagName contained otherwise outerproduct partialdiff pi piece piecewise plus power primes product
+syn keyword htmlTagName contained prsubset quotient rationals real reals reln rem root scalarproduct sdev
+syn keyword htmlTagName contained sec sech selector semantics sep set setdiff share sin sinh
+syn keyword htmlTagName contained span subset sum tan tanh tendsto times transpose true union
+syn keyword htmlTagName contained uplimit variance vector vectorproduct xor
+
" Custom Element
syn match htmlTagName contained "\<[a-z_]\([a-z0-9_.]\+\)\?\(\-[a-z0-9_.]\+\)\+\>"
@@ -79,13 +102,26 @@ syn keyword htmlArg contained async
" <content>
syn keyword htmlArg contained select
" <iframe>
-syn keyword htmlArg contained seamless srcdoc sandbox
+syn keyword htmlArg contained seamless srcdoc sandbox allowfullscreen
" <picture>
syn keyword htmlArg contained srcset sizes
+" <a>
+syn keyword htmlArg contained download media
+" <script>, <style>
+syn keyword htmlArg contained nonce
+" <area>, <a>, <img>, <iframe>, <link>
+syn keyword htmlArg contained referrerpolicy
+" <script>
+" https://w3c.github.io/webappsec-subresource-integrity/#the-integrity-attribute
+syn keyword htmlArg contained integrity crossorigin
" Custom Data Attributes
-" http://dev.w3.org/html5/spec/elements.html#embedding-custom-non-visible-data
-syn match htmlArg "\<\(data\-\([a-z_][a-z0-9_.\-]*\)\+\)\=\>" contained
+" http://w3c.github.io/html/single-page.html#embedding-custom-non-visible-data-with-the-data-attributes
+syn match htmlArg "\<\(data\-\([a-z_][a-z0-9_.\-]*\)\+\)\{1,}\>" contained
+
+" Vendor Extension Attributes
+" http://w3c.github.io/html/single-page.html#conformance-requirements-extensibility
+syn match htmlArg "\<\(x\-\([a-z_][a-z0-9_.\-]*\)\+\)\{2,}\>" contained
" Microdata
" http://dev.w3.org/html5/md/
@@ -120,4 +156,22 @@ syn keyword htmlArg contained y y1 y2 yChannelSelector
syn keyword htmlArg contained z zoomAndPan
syn keyword htmlArg contained alignment-baseline baseline-shift clip-path clip-rule clip color-interpolation-filters color-interpolation color-profile color-rendering color cursor direction display dominant-baseline enable-background fill-opacity fill-rule fill filter flood-color flood-opacity font-family font-size-adjust font-size font-stretch font-style font-variant font-weight glyph-orientation-horizontal glyph-orientation-vertical image-rendering kerning letter-spacing lighting-color marker-end marker-mid marker-start mask opacity overflow pointer-events shape-rendering stop-color stop-opacity stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width stroke text-anchor text-decoration text-rendering unicode-bidi visibility word-spacing writing-mode
+" MathML attributes
+" https://www.w3.org/TR/MathML3/chapter2.html#interf.toplevel.atts
+syn keyword htmlArg contained accent accentunder actiontype align alignmentscope altimg altimg-height altimg-valign altimg-width alttext
+syn keyword htmlArg contained annotation-xml background base baseline bevelled cd cdgroup charalign charspacing close
+syn keyword htmlArg contained closure color columnalign columnalignment columnlines columnspacing columnspan columnwidth crossout decimalpoint
+syn keyword htmlArg contained definitionURL denomalign depth display displaystyle edge encoding equalcolumns equalrows fence
+syn keyword htmlArg contained fontfamily fontsize fontstyle fontweight form frame framespacing groupalign height indentalign
+syn keyword htmlArg contained indentalignfirst indentalignlast indentshift indentshiftfirst indentshiftlast indenttarget index infixlinebreakstyle integer largeop
+syn keyword htmlArg contained leftoverhang length linebreak linebreakmultchar linebreakstyle lineleading linethickness location longdivstyle lquote
+syn keyword htmlArg contained lspace ltr macros math mathbackground mathcolor mathsize mathvariant maxsize maxwidth
+syn keyword htmlArg contained mediummathspace menclose minlabelspacing minsize mode movablelimits msgroup mslinethickness name nargs
+syn keyword htmlArg contained newline notation numalign number occurrence open order other overflow position
+syn keyword htmlArg contained rightoverhang role rowalign rowlines rowspacing rowspan rquote rspace schemaLocation scope
+syn keyword htmlArg contained scriptlevel scriptminsize scriptsize scriptsizemultiplier selection separator separators shift side stackalign
+syn keyword htmlArg contained stretchy subscriptshift superscriptshift symmetric thickmathspace thinmathspace type valign verythickmathspace verythinmathspace
+syn keyword htmlArg contained veryverythickmathspace veryverythinmathspace voffset width xref
+
+
endif
diff --git a/syntax/jasmine.vim b/syntax/jasmine.vim
index c1d194e9..eaa83d76 100644
--- a/syntax/jasmine.vim
+++ b/syntax/jasmine.vim
@@ -11,7 +11,7 @@ endif
syntax case match
" keywords
-syntax keyword jasmineSuite describe it beforeEach afterEach
+syntax keyword jasmineSuite describe it beforeEach afterEach beforeAll afterAll
syntax keyword jasmine jasmine
" special
@@ -35,6 +35,9 @@ syntax match jasmineClock /\.mockDate/
" disabled
syntax keyword jasmineDisabled xdescribe xit
+" focused
+syntax keyword jasmineFocused fdescribe fit
+
" expectation
syntax keyword jasmineExpectation expect
@@ -59,6 +62,7 @@ syntax cluster JavaScriptAll add=
\ jasmine,
\ jasmineClock,
\ jasmineDisabled,
+ \ jasmineFocused,
\ jasmineExpectation,
\ jasmineMatcher,
\ jasmineNot,
@@ -72,6 +76,7 @@ let b:current_syntax = "jasmine"
hi def link jasmine Special
hi def link jasmineClock Special
hi def link jasmineDisabled Error
+hi def link jasmineFocused Special
hi def link jasmineExpectation Statement
hi def link jasmineMatcher Statement
hi def link jasmineNot Special
diff --git a/syntax/javascript.vim b/syntax/javascript.vim
index 20c5b1e6..ac7a4b27 100644
--- a/syntax/javascript.vim
+++ b/syntax/javascript.vim
@@ -39,16 +39,15 @@ syntax keyword jsBooleanTrue true
syntax keyword jsBooleanFalse false
" Modules
-syntax keyword jsModuleKeywords contained import
-syntax keyword jsModuleKeywords contained export skipwhite skipempty nextgroup=jsExportBlock,jsModuleDefault
-syntax keyword jsModuleOperators contained from
-syntax keyword jsModuleOperators contained as
-syntax region jsModuleGroup contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise,jsComment
-syntax match jsModuleAsterisk contained /*/
-syntax keyword jsModuleDefault contained default skipwhite skipempty nextgroup=@jsExpression
-syntax region jsImportContainer start=/\<import\> / end="\%(;\|$\)" contains=jsModuleKeywords,jsModuleOperators,jsComment,jsString,jsTemplateString,jsNoise,jsModuleGroup,jsModuleAsterisk
-syntax region jsExportContainer start=/\<export\> / end="\%(;\|$\)" contains=jsModuleKeywords,jsModuleOperators,jsStorageClass,jsModuleDefault,@jsExpression
-syntax region jsExportBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise,jsComment
+syntax keyword jsImport import skipwhite skipempty nextgroup=jsModuleAsterisk,jsModuleKeyword,jsModuleGroup,jsFlowImportType
+syntax keyword jsExport export skipwhite skipempty nextgroup=@jsAll,jsModuleGroup,jsExportDefault,jsModuleAsterisk,jsModuleKeyword
+syntax match jsModuleKeyword contained /\k\+/ skipwhite skipempty nextgroup=jsModuleAs,jsFrom,jsModuleComma
+syntax keyword jsExportDefault contained default skipwhite skipempty nextgroup=@jsExpression
+syntax keyword jsExportDefaultGroup contained default skipwhite skipempty nextgroup=jsModuleAs,jsFrom,jsModuleComma
+syntax match jsModuleAsterisk contained /\*/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAs,jsFrom
+syntax keyword jsModuleAs contained as skipwhite skipempty nextgroup=jsModuleKeyword,jsExportDefaultGroup
+syntax keyword jsFrom contained from skipwhite skipempty nextgroup=jsString
+syntax match jsModuleComma contained /,/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAsterisk,jsModuleGroup
" Strings, Templates, Numbers
syntax region jsString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend
@@ -76,12 +75,14 @@ else
endif
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
+" Objects
syntax match jsObjectKey contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue
+syntax match jsObjectColon contained /:/ skipwhite skipempty
syntax region jsObjectKeyString contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
syntax region jsObjectKeyString contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
syntax region jsObjectKeyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsObjectValue,jsFuncArgs extend
syntax match jsObjectSeparator contained /,/
-syntax region jsObjectValue contained start=/:/ end=/\%(,\|}\)\@=/ contains=@jsExpression extend
+syntax region jsObjectValue contained start=/:/ end=/\%(,\|}\)\@=/ contains=jsObjectColon,@jsExpression extend
syntax match jsObjectFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>[\r\n\t ]*(\@=/ skipwhite skipempty nextgroup=jsFuncArgs
syntax match jsFunctionKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/
syntax match jsObjectMethodType contained /\%(get\|set\|static\|async\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsObjectFuncName
@@ -93,32 +94,32 @@ exe 'syntax keyword jsReturn return contained '.(exists('g:javascript_conceal
exe 'syntax keyword jsUndefined undefined '.(exists('g:javascript_conceal_undefined') ? 'conceal cchar='.g:javascript_conceal_undefined : '')
exe 'syntax keyword jsNan NaN '.(exists('g:javascript_conceal_NaN') ? 'conceal cchar='.g:javascript_conceal_NaN : '')
exe 'syntax keyword jsPrototype prototype '.(exists('g:javascript_conceal_prototype') ? 'conceal cchar='.g:javascript_conceal_prototype : '')
-exe 'syntax keyword jsThis this contained '.(exists('g:javascript_conceal_this') ? 'conceal cchar='.g:javascript_conceal_this : '')
+exe 'syntax keyword jsThis this '.(exists('g:javascript_conceal_this') ? 'conceal cchar='.g:javascript_conceal_this : '')
exe 'syntax keyword jsSuper super contained '.(exists('g:javascript_conceal_super') ? 'conceal cchar='.g:javascript_conceal_super : '')
" Statement Keywords
syntax keyword jsStatement contained break continue with yield debugger
syntax keyword jsConditional if skipwhite skipempty nextgroup=jsParenIfElse
-syntax keyword jsConditional else skipwhite skipempty nextgroup=jsCommentMisc,jsBlock
+syntax keyword jsConditional else skipwhite skipempty nextgroup=jsCommentMisc,jsIfElseBlock
syntax keyword jsConditional switch skipwhite skipempty nextgroup=jsParenSwitch
-syntax keyword jsRepeat while for skipwhite skipempty nextgroup=jsParenRepeat
-syntax keyword jsDo do skipwhite skipempty nextgroup=jsBlock
+syntax keyword jsRepeat while for skipwhite skipempty nextgroup=jsParenRepeat,jsForAwait
+syntax keyword jsDo do skipwhite skipempty nextgroup=jsRepeatBlock
syntax keyword jsLabel contained case default
syntax keyword jsTry try skipwhite skipempty nextgroup=jsTryCatchBlock
-syntax keyword jsFinally contained finally skipwhite skipempty nextgroup=jsBlock
+syntax keyword jsFinally contained finally skipwhite skipempty nextgroup=jsFinallyBlock
syntax keyword jsCatch contained catch skipwhite skipempty nextgroup=jsParenCatch
syntax keyword jsException throw
syntax keyword jsAsyncKeyword async await
-syntax match jsSwitchColon contained /:/ skipwhite skipempty nextgroup=jsBlock
+syntax match jsSwitchColon contained /:/ skipwhite skipempty nextgroup=jsSwitchBlock
" Keywords
-syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat
-syntax keyword jsGlobalNodeObjects module exports global process
-syntax match jsGlobalNodeObjects /require/ contains=jsFuncCall
-syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError
-syntax keyword jsBuiltins decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval
+syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat fetch
+syntax keyword jsGlobalNodeObjects module exports global process
+syntax match jsGlobalNodeObjects /require/ containedin=jsFuncCall
+syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError
+syntax keyword jsBuiltins decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval
" DISCUSS: How imporant is this, really? Perhaps it should be linked to an error because I assume the keywords are reserved?
-syntax keyword jsFutureKeys abstract enum int short boolean interface byte long char final native synchronized float package throws goto private transient implements protected volatile double public
+syntax keyword jsFutureKeys abstract enum int short boolean interface byte long char final native synchronized float package throws goto private transient implements protected volatile double public
" DISCUSS: Should we really be matching stuff like this?
" DOM2 Objects
@@ -134,22 +135,27 @@ syntax keyword jsDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECT
" HTML events and internal variables
syntax keyword jsHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize
-"" Code blocks
-syntax region jsBracket matchgroup=jsBrackets start=/\[/ end=/\]/ contains=@jsExpression extend fold
+" Code blocks
+syntax region jsBracket matchgroup=jsBrackets start=/\[/ end=/\]/ contains=@jsExpression,jsSpreadExpression extend fold
syntax region jsParen matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll extend fold
-syntax region jsParenIfElse contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentMisc,jsBlock extend fold
-syntax region jsParenRepeat contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentMisc,jsBlock extend fold
-syntax region jsParenSwitch contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold
-syntax region jsParenCatch contained matchgroup=jsParens start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock extend fold
-syntax region jsFuncArgs contained matchgroup=jsFuncParens start=/(/ end=/)/ contains=jsFuncArgCommas,jsComment,jsFuncArgExpression,jsDestructuringBlock,jsRestExpression,jsFlowArgumentDef skipwhite skipempty nextgroup=jsCommentFunction,jsFuncBlock,jsFlowReturn extend fold
+syntax region jsParenDecorator contained matchgroup=jsParensDecorator start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentMisc extend fold
+syntax region jsParenIfElse contained matchgroup=jsParensIfElse start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentMisc,jsIfElseBlock extend fold
+syntax region jsParenRepeat contained matchgroup=jsParensRepeat start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentMisc,jsRepeatBlock extend fold
+syntax region jsParenSwitch contained matchgroup=jsParensSwitch start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold
+syntax region jsParenCatch contained matchgroup=jsParensCatch start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock extend fold
+syntax region jsFuncArgs contained matchgroup=jsFuncParens start=/(/ end=/)/ contains=jsFuncArgCommas,jsComment,jsFuncArgExpression,jsDestructuringBlock,jsDestructuringArray,jsRestExpression,jsFlowArgumentDef skipwhite skipempty nextgroup=jsCommentFunction,jsFuncBlock,jsFlowReturn extend fold
syntax region jsClassBlock contained matchgroup=jsClassBraces start=/{/ end=/}/ contains=jsClassFuncName,jsClassMethodType,jsArrowFunction,jsArrowFuncArgs,jsComment,jsGenerator,jsDecorator,jsClassProperty,jsClassPropertyComputed,jsClassStringKey,jsNoise extend fold
syntax region jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll extend fold
+syntax region jsIfElseBlock contained matchgroup=jsIfElseBraces start=/{/ end=/}/ contains=@jsAll extend fold
syntax region jsBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll extend fold
-syntax region jsTryCatchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold
-syntax region jsSwitchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsLabel,jsSwitchColon extend fold
+syntax region jsTryCatchBlock contained matchgroup=jsTryCatchBraces start=/{/ end=/}/ contains=@jsAll skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold
+syntax region jsFinallyBlock contained matchgroup=jsFinallyBraces start=/{/ end=/}/ contains=@jsAll extend fold
+syntax region jsSwitchBlock contained matchgroup=jsSwitchBraces start=/{/ end=/}/ contains=@jsAll,jsLabel,jsSwitchColon extend fold
+syntax region jsRepeatBlock contained matchgroup=jsRepeatBraces start=/{/ end=/}/ contains=@jsAll extend fold
syntax region jsDestructuringBlock contained matchgroup=jsDestructuringBraces start=/{/ end=/}/ contains=jsDestructuringProperty,jsDestructuringAssignment,jsDestructuringNoise,jsDestructuringPropertyComputed,jsSpreadExpression extend fold
syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsNoise,jsDestructuringProperty,jsSpreadExpression extend fold
-syntax region jsObject matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression extend fold
+syntax region jsObject matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsDecorator extend fold
+syntax region jsModuleGroup contained matchgroup=jsModuleBraces start=/{/ end=/}/ contains=jsModuleKeyword,jsModuleComma,jsModuleAs,jsComment skipwhite skipempty nextgroup=jsFrom
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression
syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression
syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/
@@ -160,6 +166,7 @@ syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>/ s
syntax region jsFuncArgExpression contained matchgroup=jsFuncArgOperator start=/=/ end=/[,)]\@=/ contains=@jsExpression extend
syntax match jsFuncArgCommas contained ','
syntax keyword jsArguments contained arguments
+syntax keyword jsForAwait contained await skipwhite skipempty nextgroup=jsParenRepeat
" Matches a single keyword argument with no parens
syntax match jsArrowFuncArgs /\k\+\s*\%(=>\)\@=/ skipwhite contains=jsFuncArgs skipwhite skipempty nextgroup=jsArrowFunction extend
@@ -167,14 +174,16 @@ syntax match jsArrowFuncArgs /\k\+\s*\%(=>\)\@=/ skipwhite contains=jsFuncArg
syntax match jsArrowFuncArgs /([^()]*)\s*\(=>\)\@=/ contains=jsFuncArgs skipempty skipwhite nextgroup=jsArrowFunction extend
exe 'syntax match jsFunction /\<function\>/ skipwhite skipempty nextgroup=jsGenerator,jsFuncName,jsFuncArgs skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
-exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFuncBlock contains=jsFuncBraces '.(exists('g:javascript_conceal_arrow_function') ? 'conceal cchar='.g:javascript_conceal_arrow_function : '')
+exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFuncBlock,jsCommentFunction '.(exists('g:javascript_conceal_arrow_function') ? 'conceal cchar='.g:javascript_conceal_arrow_function : '')
+exe 'syntax match jsArrowFunction /()\s*\(=>\)\@=/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_noarg_arrow_function') ? 'conceal cchar='.g:javascript_conceal_noarg_arrow_function : '')
+exe 'syntax match jsArrowFunction /_\s*\(=>\)\@=/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_underscore_arrow_function') ? 'conceal cchar='.g:javascript_conceal_underscore_arrow_function : '')
-syntax keyword jsClassKeywords contained extends class
+" Classes
+syntax keyword jsClassKeyword contained class
+syntax keyword jsExtendsKeyword contained extends skipwhite skipempty nextgroup=@jsExpression
syntax match jsClassNoise contained /\./
syntax match jsClassMethodType contained /\%(get\|set\|static\|async\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsFuncName,jsClassProperty
-syntax match jsClassDefinition /\<class\>\%( [a-zA-Z_$][0-9a-zA-Z_$ \n.]*\)*/ contains=jsClassKeywords,jsClassNoise skipwhite skipempty nextgroup=jsCommentClass,jsClassBlock,jsFlowClassGroup
-syntax match jsDecorator contained "@" nextgroup=jsDecoratorFunction
-syntax match jsDecoratorFunction contained "[a-zA-Z_][a-zA-Z0-9_.]*"
+syntax region jsClassDefinition start=/\<class\>/ end=/\(\<extends\>\s\+\)\@<!{\@=/ contains=jsClassKeyword,jsExtendsKeyword,jsClassNoise,@jsExpression skipwhite skipempty nextgroup=jsCommentClass,jsClassBlock,jsFlowClassGroup
syntax match jsClassProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsClassValue
syntax region jsClassValue contained start=/=/ end=/\%(;\|}\|\n\)\@=/ contains=@jsExpression
syntax region jsClassPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsFuncArgs,jsClassValue extend
@@ -207,6 +216,10 @@ syntax region jsCommentClass contained start=/\/\*/ end=/\*\// contains=j
syntax region jsCommentMisc contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsBlock extend keepend
syntax region jsCommentMisc contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsBlock fold extend keepend
+" Decorators
+syntax match jsDecorator /^\s*@/ nextgroup=jsDecoratorFunction
+syntax match jsDecoratorFunction contained /[a-zA-Z_][a-zA-Z0-9_.]*/ nextgroup=jsParenDecorator
+
if exists("javascript_plugin_jsdoc")
runtime extras/jsdoc.vim
" NGDoc requires JSDoc
@@ -220,7 +233,7 @@ if exists("javascript_plugin_flow")
endif
syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsBlock,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper,jsDo
-syntax cluster jsAll contains=@jsExpression,jsExportContainer,jsImportContainer,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsStatement,jsException,jsTry,jsAsyncKeyword
+syntax cluster jsAll contains=@jsExpression,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsStatement,jsException,jsTry,jsAsyncKeyword
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
@@ -234,6 +247,10 @@ if version >= 508 || !exists("did_javascript_syn_inits")
endif
HiLink jsComment Comment
HiLink jsEnvComment PreProc
+ HiLink jsParensIfElse jsParens
+ HiLink jsParensRepeat jsParens
+ HiLink jsParensSwitch jsParens
+ HiLink jsParensCatch jsParens
HiLink jsCommentTodo Todo
HiLink jsString String
HiLink jsObjectKeyString String
@@ -264,6 +281,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsFinally Exception
HiLink jsCatch Exception
HiLink jsAsyncKeyword Keyword
+ HiLink jsForAwait Keyword
HiLink jsArrowFunction Type
HiLink jsFunction Type
HiLink jsGenerator jsFunction
@@ -277,7 +295,8 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsOperator Operator
HiLink jsOf Operator
HiLink jsStorageClass StorageClass
- HiLink jsClassKeywords Structure
+ HiLink jsClassKeyword Keyword
+ HiLink jsExtendsKeyword Keyword
HiLink jsThis Special
HiLink jsSuper Constant
HiLink jsNan Number
@@ -287,6 +306,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsFloat Float
HiLink jsBooleanTrue Boolean
HiLink jsBooleanFalse Boolean
+ HiLink jsObjectColon jsNoise
HiLink jsNoise Noise
HiLink jsBrackets Noise
HiLink jsParens Noise
@@ -295,8 +315,14 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsFuncParens Noise
HiLink jsClassBraces Noise
HiLink jsClassNoise Noise
+ HiLink jsIfElseBraces jsBraces
+ HiLink jsTryCatchBraces jsBraces
+ HiLink jsModuleBraces jsBraces
HiLink jsObjectBraces Noise
HiLink jsObjectSeparator Noise
+ HiLink jsFinallyBraces jsBraces
+ HiLink jsRepeatBraces jsBraces
+ HiLink jsSwitchBraces jsBraces
HiLink jsSpecial Special
HiLink jsTemplateVar Special
HiLink jsTemplateBraces jsBraces
@@ -304,13 +330,18 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsGlobalNodeObjects Constant
HiLink jsExceptions Constant
HiLink jsBuiltins Constant
- HiLink jsModuleKeywords Include
- HiLink jsModuleOperators Include
- HiLink jsModuleDefault Include
+ HiLink jsImport Include
+ HiLink jsExport Include
+ HiLink jsExportDefault StorageClass
+ HiLink jsExportDefaultGroup jsExportDefault
+ HiLink jsModuleAs Include
+ HiLink jsModuleComma jsNoise
+ HiLink jsModuleAsterisk Noise
+ HiLink jsFrom Include
HiLink jsDecorator Special
- HiLink jsDecoratorFunction Special
+ HiLink jsDecoratorFunction Function
+ HiLink jsParensDecorator jsParens
HiLink jsFuncArgOperator jsFuncArgs
- HiLink jsModuleAsterisk Noise
HiLink jsClassProperty jsObjectKey
HiLink jsSpreadOperator Operator
HiLink jsRestOperator Operator
diff --git a/syntax/layout/footer.vim b/syntax/layout/footer.vim
new file mode 100644
index 00000000..7f887b61
--- /dev/null
+++ b/syntax/layout/footer.vim
@@ -0,0 +1,25 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" highlight
+
+hi link ngxComment Comment
+hi link ngxVariable Identifier
+hi link ngxVariableString PreProc
+hi link ngxString String
+hi link ngxLocationPath String
+hi link ngxLocationNamedLoc Identifier
+
+hi link ngxBoolean Boolean
+hi link ngxRewriteFlag 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
+
+let b:current_syntax = "nginx"
+
+
+endif
diff --git a/syntax/layout/header.vim b/syntax/layout/header.vim
new file mode 100644
index 00000000..9a752522
--- /dev/null
+++ b/syntax/layout/header.vim
@@ -0,0 +1,566 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Vim syntax file
+" Language: nginx.conf
+
+if exists("b:current_syntax")
+ finish
+end
+
+setlocal iskeyword+=.
+setlocal iskeyword+=/
+setlocal iskeyword+=:
+
+syn match ngxVariable '\$\(\w\+\|{\w\+}\)'
+syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained
+syn match ngxComment ' *#.*$'
+syn match ngxRewriteURI /\S\+/ contained contains=ngxVariableString nextgroup=ngxURI skipwhite
+syn match ngxURI /\S\+/ contained contains=ngxVariableString skipwhite
+syn match ngxLocationPath /[^ {]\+/ contained
+syn region ngxString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString
+
+syn keyword ngxBoolean on
+syn keyword ngxBoolean off
+
+
+syn keyword ngxDirectiveBlock http
+syn keyword ngxDirectiveBlock mail
+syn keyword ngxDirectiveBlock events
+syn keyword ngxDirectiveBlock server
+syn keyword ngxDirectiveBlock types
+syn match ngxLocationOperator /\(=\|\~\*\|\^\~\|\~\)/ contained nextgroup=ngxLocationPath,ngxString skipwhite
+syn match ngxLocationNamedLoc /@\w\+/
+syn keyword ngxDirectiveBlock location nextgroup=ngxLocationNamedLoc,ngxLocationOperator,ngxLocationPath,ngxString skipwhite
+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
+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 ngxDirectiveControl break
+syn keyword ngxDirectiveControl return
+syn keyword ngxDirectiveControl rewrite nextgroup=ngxRewriteURI skipwhite
+syn keyword ngxDirectiveControl set
+
+syn keyword ngxRewriteFlag last break redirect permanent
+
+syn keyword ngxDirectiveError error_page
+syn keyword ngxDirectiveError post_action
+
+syn keyword ngxDirectiveDeprecated connections
+syn keyword ngxDirectiveDeprecated imap
+syn keyword ngxDirectiveDeprecated limit_zone
+syn keyword ngxDirectiveDeprecated mysql_test
+syn keyword ngxDirectiveDeprecated open_file_cache_retest
+syn keyword ngxDirectiveDeprecated optimize_server_names
+syn keyword ngxDirectiveDeprecated satisfy_any
+syn keyword ngxDirectiveDeprecated so_keepalive
+
+syn keyword ngxDirective accept_mutex
+syn keyword ngxDirective accept_mutex_delay
+syn keyword ngxDirective acceptex_read
+syn keyword ngxDirective access_log
+syn keyword ngxDirective add_after_body
+syn keyword ngxDirective add_before_body
+syn keyword ngxDirective add_header
+syn keyword ngxDirective addition_types
+syn keyword ngxDirective aio
+syn keyword ngxDirective alias
+syn keyword ngxDirective allow
+syn keyword ngxDirective ancient_browser
+syn keyword ngxDirective ancient_browser_value
+syn keyword ngxDirective auth_basic
+syn keyword ngxDirective auth_basic_user_file
+syn keyword ngxDirective auth_http
+syn keyword ngxDirective auth_http_header
+syn keyword ngxDirective auth_http_timeout
+syn keyword ngxDirective auth_request
+syn keyword ngxDirective auth_request_set
+syn keyword ngxDirective autoindex
+syn keyword ngxDirective autoindex_exact_size
+syn keyword ngxDirective autoindex_localtime
+syn keyword ngxDirective charset
+syn keyword ngxDirective charset_types
+syn keyword ngxDirective chunked_transfer_encoding
+syn keyword ngxDirective client_body_buffer_size
+syn keyword ngxDirective client_body_in_file_only
+syn keyword ngxDirective client_body_in_single_buffer
+syn keyword ngxDirective client_body_temp_path
+syn keyword ngxDirective client_body_timeout
+syn keyword ngxDirective client_header_buffer_size
+syn keyword ngxDirective client_header_timeout
+syn keyword ngxDirective client_max_body_size
+syn keyword ngxDirective connection_pool_size
+syn keyword ngxDirective create_full_put_path
+syn keyword ngxDirective daemon
+syn keyword ngxDirective dav_access
+syn keyword ngxDirective dav_methods
+syn keyword ngxDirective debug_connection
+syn keyword ngxDirective debug_points
+syn keyword ngxDirective default_type
+syn keyword ngxDirective degradation
+syn keyword ngxDirective degrade
+syn keyword ngxDirective deny
+syn keyword ngxDirective devpoll_changes
+syn keyword ngxDirective devpoll_events
+syn keyword ngxDirective directio
+syn keyword ngxDirective directio_alignment
+syn keyword ngxDirective disable_symlinks
+syn keyword ngxDirective empty_gif
+syn keyword ngxDirective env
+syn keyword ngxDirective epoll_events
+syn keyword ngxDirective error_log
+syn keyword ngxDirective etag
+syn keyword ngxDirective eventport_events
+syn keyword ngxDirective expires
+syn keyword ngxDirective fastcgi_bind
+syn keyword ngxDirective fastcgi_buffer_size
+syn keyword ngxDirective fastcgi_buffering
+syn keyword ngxDirective fastcgi_buffers
+syn keyword ngxDirective fastcgi_busy_buffers_size
+syn keyword ngxDirective fastcgi_cache
+syn keyword ngxDirective fastcgi_cache_bypass
+syn keyword ngxDirective fastcgi_cache_key
+syn keyword ngxDirective fastcgi_cache_lock
+syn keyword ngxDirective fastcgi_cache_lock_age
+syn keyword ngxDirective fastcgi_cache_lock_timeout
+syn keyword ngxDirective fastcgi_cache_methods
+syn keyword ngxDirective fastcgi_cache_min_uses
+syn keyword ngxDirective fastcgi_cache_path
+syn keyword ngxDirective fastcgi_cache_purge
+syn keyword ngxDirective fastcgi_cache_revalidate
+syn keyword ngxDirective fastcgi_cache_use_stale
+syn keyword ngxDirective fastcgi_cache_valid
+syn keyword ngxDirective fastcgi_catch_stderr
+syn keyword ngxDirective fastcgi_connect_timeout
+syn keyword ngxDirective fastcgi_force_ranges
+syn keyword ngxDirective fastcgi_hide_header
+syn keyword ngxDirective fastcgi_ignore_client_abort
+syn keyword ngxDirective fastcgi_ignore_headers
+syn keyword ngxDirective fastcgi_index
+syn keyword ngxDirective fastcgi_intercept_errors
+syn keyword ngxDirective fastcgi_keep_conn
+syn keyword ngxDirective fastcgi_limit_rate
+syn keyword ngxDirective fastcgi_max_temp_file_size
+syn keyword ngxDirective fastcgi_next_upstream
+syn keyword ngxDirective fastcgi_next_upstream_timeout
+syn keyword ngxDirective fastcgi_next_upstream_tries
+syn keyword ngxDirective fastcgi_no_cache
+syn keyword ngxDirective fastcgi_param
+syn keyword ngxDirective fastcgi_pass_header
+syn keyword ngxDirective fastcgi_pass_request_body
+syn keyword ngxDirective fastcgi_pass_request_headers
+syn keyword ngxDirective fastcgi_read_timeout
+syn keyword ngxDirective fastcgi_request_buffering
+syn keyword ngxDirective fastcgi_send_lowat
+syn keyword ngxDirective fastcgi_send_timeout
+syn keyword ngxDirective fastcgi_split_path_info
+syn keyword ngxDirective fastcgi_store
+syn keyword ngxDirective fastcgi_store_access
+syn keyword ngxDirective fastcgi_temp_file_write_size
+syn keyword ngxDirective fastcgi_temp_path
+syn keyword ngxDirective flv
+syn keyword ngxDirective geoip_city
+syn keyword ngxDirective geoip_country
+syn keyword ngxDirective geoip_org
+syn keyword ngxDirective geoip_proxy
+syn keyword ngxDirective geoip_proxy_recursive
+syn keyword ngxDirective google_perftools_profiles
+syn keyword ngxDirective gunzip
+syn keyword ngxDirective gunzip_buffers
+syn keyword ngxDirective gzip
+syn keyword ngxDirective gzip_buffers
+syn keyword ngxDirective gzip_comp_level
+syn keyword ngxDirective gzip_disable
+syn keyword ngxDirective gzip_hash
+syn keyword ngxDirective gzip_http_version
+syn keyword ngxDirective gzip_min_length
+syn keyword ngxDirective gzip_no_buffer
+syn keyword ngxDirective gzip_proxied
+syn keyword ngxDirective gzip_static
+syn keyword ngxDirective gzip_types
+syn keyword ngxDirective gzip_vary
+syn keyword ngxDirective gzip_window
+syn keyword ngxDirective hash
+syn keyword ngxDirective http2 " Not a real directive
+syn keyword ngxDirective if_modified_since
+syn keyword ngxDirective ignore_invalid_headers
+syn keyword ngxDirective image_filter
+syn keyword ngxDirective image_filter_buffer
+syn keyword ngxDirective image_filter_interlace
+syn keyword ngxDirective image_filter_jpeg_quality
+syn keyword ngxDirective image_filter_sharpen
+syn keyword ngxDirective image_filter_transparency
+syn keyword ngxDirective imap_auth
+syn keyword ngxDirective imap_capabilities
+syn keyword ngxDirective imap_client_buffer
+syn keyword ngxDirective index
+syn keyword ngxDirective iocp_threads
+syn keyword ngxDirective ip_hash
+syn keyword ngxDirective js_run
+syn keyword ngxDirective js_set
+syn keyword ngxDirective keepalive
+syn keyword ngxDirective keepalive_disable
+syn keyword ngxDirective keepalive_requests
+syn keyword ngxDirective keepalive_timeout
+syn keyword ngxDirective kqueue_changes
+syn keyword ngxDirective kqueue_events
+syn keyword ngxDirective large_client_header_buffers
+syn keyword ngxDirective least_conn
+syn keyword ngxDirective limit_conn
+syn keyword ngxDirective limit_conn_log_level
+syn keyword ngxDirective limit_conn_status
+syn keyword ngxDirective limit_conn_zone
+syn keyword ngxDirective limit_rate
+syn keyword ngxDirective limit_rate_after
+syn keyword ngxDirective limit_req
+syn keyword ngxDirective limit_req_log_level
+syn keyword ngxDirective limit_req_status
+syn keyword ngxDirective limit_req_zone
+syn keyword ngxDirective lingering_close
+syn keyword ngxDirective lingering_time
+syn keyword ngxDirective lingering_timeout
+syn keyword ngxDirective load_module
+syn keyword ngxDirective lock_file
+syn keyword ngxDirective log_format
+syn keyword ngxDirective log_not_found
+syn keyword ngxDirective log_subrequest
+syn keyword ngxDirective map_hash_bucket_size
+syn keyword ngxDirective map_hash_max_size
+syn keyword ngxDirective master_process
+syn keyword ngxDirective max_ranges
+syn keyword ngxDirective memcached_bind
+syn keyword ngxDirective memcached_buffer_size
+syn keyword ngxDirective memcached_connect_timeout
+syn keyword ngxDirective memcached_gzip_flag
+syn keyword ngxDirective memcached_next_upstream
+syn keyword ngxDirective memcached_next_upstream_timeout
+syn keyword ngxDirective memcached_next_upstream_tries
+syn keyword ngxDirective memcached_read_timeout
+syn keyword ngxDirective memcached_send_timeout
+syn keyword ngxDirective merge_slashes
+syn keyword ngxDirective min_delete_depth
+syn keyword ngxDirective modern_browser
+syn keyword ngxDirective modern_browser_value
+syn keyword ngxDirective mp4
+syn keyword ngxDirective mp4_buffer_size
+syn keyword ngxDirective mp4_max_buffer_size
+syn keyword ngxDirective mp4_limit_rate
+syn keyword ngxDirective mp4_limit_rate_after
+syn keyword ngxDirective msie_padding
+syn keyword ngxDirective msie_refresh
+syn keyword ngxDirective multi_accept
+syn keyword ngxDirective open_file_cache
+syn keyword ngxDirective open_file_cache_errors
+syn keyword ngxDirective open_file_cache_events
+syn keyword ngxDirective open_file_cache_min_uses
+syn keyword ngxDirective open_file_cache_valid
+syn keyword ngxDirective open_log_file_cache
+syn keyword ngxDirective output_buffers
+syn keyword ngxDirective override_charset
+syn keyword ngxDirective pcre_jit
+syn keyword ngxDirective perl
+syn keyword ngxDirective perl_modules
+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 nextgroup=ngxMailProtocol skipwhite
+syn keyword ngxMailProtocol imap pop3 smtp
+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
+syn keyword ngxDirective proxy_cache_bypass
+syn keyword ngxDirective proxy_cache_key
+syn keyword ngxDirective proxy_cache_lock
+syn keyword ngxDirective proxy_cache_lock_timeout
+syn keyword ngxDirective proxy_cache_methods
+syn keyword ngxDirective proxy_cache_min_uses
+syn keyword ngxDirective proxy_cache_path
+syn keyword ngxDirective proxy_cache_revalidate
+syn keyword ngxDirective proxy_cache_use_stale
+syn keyword ngxDirective proxy_cache_valid
+syn keyword ngxDirective proxy_connect_timeout
+syn keyword ngxDirective proxy_cookie_domain
+syn keyword ngxDirective proxy_cookie_path
+syn keyword ngxDirective proxy_force_ranges
+syn keyword ngxDirective proxy_headers_hash_bucket_size
+syn keyword ngxDirective proxy_headers_hash_max_size
+syn keyword ngxDirective proxy_hide_header
+syn keyword ngxDirective proxy_http_version
+syn keyword ngxDirective proxy_ignore_client_abort
+syn keyword ngxDirective proxy_ignore_headers
+syn keyword ngxDirective proxy_intercept_errors
+syn keyword ngxDirective proxy_max_temp_file_size
+syn keyword ngxDirective proxy_method
+syn keyword ngxDirective proxy_next_upstream
+syn keyword ngxDirective proxy_next_upstream_timeout
+syn keyword ngxDirective proxy_next_upstream_tries
+syn keyword ngxDirective proxy_no_cache
+syn keyword ngxDirective proxy_pass_error_message
+syn keyword ngxDirective proxy_pass_header
+syn keyword ngxDirective proxy_pass_request_body
+syn keyword ngxDirective proxy_pass_request_headers
+syn keyword ngxDirective proxy_read_timeout
+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_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
+syn keyword ngxDirective proxy_temp_path
+syn keyword ngxDirective proxy_timeout
+syn keyword ngxDirective random_index
+syn keyword ngxDirective read_ahead
+syn keyword ngxDirective real_ip_header
+syn keyword ngxDirective real_ip_recursive
+syn keyword ngxDirective recursive_error_pages
+syn keyword ngxDirective referer_hash_bucket_size
+syn keyword ngxDirective referer_hash_max_size
+syn keyword ngxDirective request_pool_size
+syn keyword ngxDirective reset_timedout_connection
+syn keyword ngxDirective resolver
+syn keyword ngxDirective resolver_timeout
+syn keyword ngxDirective rewrite_log
+syn keyword ngxDirective rtsig_overflow_events
+syn keyword ngxDirective rtsig_overflow_test
+syn keyword ngxDirective rtsig_overflow_threshold
+syn keyword ngxDirective rtsig_signo
+syn keyword ngxDirective satisfy
+syn keyword ngxDirective scgi_bind
+syn keyword ngxDirective scgi_buffer_size
+syn keyword ngxDirective scgi_buffering
+syn keyword ngxDirective scgi_buffers
+syn keyword ngxDirective scgi_busy_buffers_size
+syn keyword ngxDirective scgi_cache
+syn keyword ngxDirective scgi_cache_bypass
+syn keyword ngxDirective scgi_cache_key
+syn keyword ngxDirective scgi_cache_lock
+syn keyword ngxDirective scgi_cache_lock_timeout
+syn keyword ngxDirective scgi_cache_methods
+syn keyword ngxDirective scgi_cache_min_uses
+syn keyword ngxDirective scgi_cache_path
+syn keyword ngxDirective scgi_cache_revalidate
+syn keyword ngxDirective scgi_cache_use_stale
+syn keyword ngxDirective scgi_cache_valid
+syn keyword ngxDirective scgi_connect_timeout
+syn keyword ngxDirective scgi_force_ranges
+syn keyword ngxDirective scgi_hide_header
+syn keyword ngxDirective scgi_ignore_client_abort
+syn keyword ngxDirective scgi_ignore_headers
+syn keyword ngxDirective scgi_intercept_errors
+syn keyword ngxDirective scgi_max_temp_file_size
+syn keyword ngxDirective scgi_next_upstream
+syn keyword ngxDirective scgi_next_upstream_timeout
+syn keyword ngxDirective scgi_next_upstream_tries
+syn keyword ngxDirective scgi_no_cache
+syn keyword ngxDirective scgi_param
+syn keyword ngxDirective scgi_pass_header
+syn keyword ngxDirective scgi_pass_request_body
+syn keyword ngxDirective scgi_pass_request_headers
+syn keyword ngxDirective scgi_read_timeout
+syn keyword ngxDirective scgi_send_timeout
+syn keyword ngxDirective scgi_store
+syn keyword ngxDirective scgi_store_access
+syn keyword ngxDirective scgi_temp_file_write_size
+syn keyword ngxDirective scgi_temp_path
+syn keyword ngxDirective secure_link
+syn keyword ngxDirective secure_link_md5
+syn keyword ngxDirective secure_link_secret
+syn keyword ngxDirective send_lowat
+syn keyword ngxDirective send_timeout
+syn keyword ngxDirective sendfile
+syn keyword ngxDirective sendfile_max_chunk
+syn keyword ngxDirective server_name_in_redirect
+syn keyword ngxDirective server_names_hash_bucket_size
+syn keyword ngxDirective server_names_hash_max_size
+syn keyword ngxDirective server_tokens
+syn keyword ngxDirective set_real_ip_from
+syn keyword ngxDirective smtp_auth
+syn keyword ngxDirective smtp_capabilities
+syn keyword ngxDirective smtp_client_buffer
+syn keyword ngxDirective smtp_greeting_delay
+syn keyword ngxDirective source_charset
+syn keyword ngxDirective spdy_chunk_size
+syn keyword ngxDirective spdy_headers_comp
+syn keyword ngxDirective spdy_keepalive_timeout
+syn keyword ngxDirective spdy_max_concurrent_streams
+syn keyword ngxDirective spdy_pool_size
+syn keyword ngxDirective spdy_recv_buffer_size
+syn keyword ngxDirective spdy_recv_timeout
+syn keyword ngxDirective spdy_streams_index_size
+syn keyword ngxDirective ssi
+syn keyword ngxDirective ssi_ignore_recycled_buffers
+syn keyword ngxDirective ssi_last_modified
+syn keyword ngxDirective ssi_min_file_chunk
+syn keyword ngxDirective ssi_silent_errors
+syn keyword ngxDirective ssi_types
+syn keyword ngxDirective ssi_value_length
+syn keyword ngxDirective ssl
+syn keyword ngxDirective ssl_buffer_size
+syn keyword ngxDirective ssl_certificate
+syn keyword ngxDirective ssl_certificate_key
+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_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
+syn keyword ngxDirective ssl_trusted_certificate
+syn keyword ngxDirective ssl_verify_client
+syn keyword ngxDirective ssl_verify_depth
+syn keyword ngxDirective starttls
+syn keyword ngxDirective stub_status
+syn keyword ngxDirective sub_filter
+syn keyword ngxDirective sub_filter_last_modified
+syn keyword ngxDirective sub_filter_once
+syn keyword ngxDirective sub_filter_types
+syn keyword ngxDirective tcp_nodelay
+syn keyword ngxDirective tcp_nopush
+syn keyword ngxDirective thread_pool
+syn keyword ngxDirective thread_stack_size
+syn keyword ngxDirective timeout
+syn keyword ngxDirective timer_resolution
+syn keyword ngxDirective types_hash_bucket_size
+syn keyword ngxDirective types_hash_max_size
+syn keyword ngxDirective underscores_in_headers
+syn keyword ngxDirective uninitialized_variable_warn
+syn keyword ngxDirective use
+syn keyword ngxDirective user
+syn keyword ngxDirective userid
+syn keyword ngxDirective userid_domain
+syn keyword ngxDirective userid_expires
+syn keyword ngxDirective userid_mark
+syn keyword ngxDirective userid_name
+syn keyword ngxDirective userid_p3p
+syn keyword ngxDirective userid_path
+syn keyword ngxDirective userid_service
+syn keyword ngxDirective uwsgi_bind
+syn keyword ngxDirective uwsgi_buffer_size
+syn keyword ngxDirective uwsgi_buffering
+syn keyword ngxDirective uwsgi_buffers
+syn keyword ngxDirective uwsgi_busy_buffers_size
+syn keyword ngxDirective uwsgi_cache
+syn keyword ngxDirective uwsgi_cache_bypass
+syn keyword ngxDirective uwsgi_cache_key
+syn keyword ngxDirective uwsgi_cache_lock
+syn keyword ngxDirective uwsgi_cache_lock_age
+syn keyword ngxDirective uwsgi_cache_lock_timeout
+syn keyword ngxDirective uwsgi_cache_methods
+syn keyword ngxDirective uwsgi_cache_min_uses
+syn keyword ngxDirective uwsgi_cache_path
+syn keyword ngxDirective uwsgi_cache_revalidate
+syn keyword ngxDirective uwsgi_cache_use_stale
+syn keyword ngxDirective uwsgi_cache_valid
+syn keyword ngxDirective uwsgi_connect_timeout
+syn keyword ngxDirective uwsgi_force_ranges
+syn keyword ngxDirective uwsgi_hide_header
+syn keyword ngxDirective uwsgi_ignore_client_abort
+syn keyword ngxDirective uwsgi_ignore_headers
+syn keyword ngxDirective uwsgi_intercept_errors
+syn keyword ngxDirective uwsgi_max_temp_file_size
+syn keyword ngxDirective uwsgi_modifier1
+syn keyword ngxDirective uwsgi_modifier2
+syn keyword ngxDirective uwsgi_next_upstream
+syn keyword ngxDirective uwsgi_next_upstream_timeout
+syn keyword ngxDirective uwsgi_next_upstream_tries
+syn keyword ngxDirective uwsgi_no_cache
+syn keyword ngxDirective uwsgi_param
+syn keyword ngxDirective uwsgi_pass
+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_request_buffering
+syn keyword ngxDirective uwsgi_send_timeout
+syn keyword ngxDirective uwsgi_ssl_certificate
+syn keyword ngxDirective uwsgi_ssl_certificate_key
+syn keyword ngxDirective uwsgi_ssl_ciphers
+syn keyword ngxDirective uwsgi_ssl_crl
+syn keyword ngxDirective uwsgi_ssl_name
+syn keyword ngxDirective uwsgi_ssl_password_file
+syn keyword ngxDirective uwsgi_ssl_protocols
+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
+syn keyword ngxDirective uwsgi_temp_file_write_size
+syn keyword ngxDirective uwsgi_temp_path
+syn keyword ngxDirective valid_referers
+syn keyword ngxDirective variables_hash_bucket_size
+syn keyword ngxDirective variables_hash_max_size
+syn keyword ngxDirective worker_aio_requests
+syn keyword ngxDirective worker_connections
+syn keyword ngxDirective worker_cpu_affinity
+syn keyword ngxDirective worker_priority
+syn keyword ngxDirective worker_processes
+syn keyword ngxDirective worker_rlimit_core
+syn keyword ngxDirective worker_rlimit_nofile
+syn keyword ngxDirective worker_rlimit_sigpending
+syn keyword ngxDirective worker_threads
+syn keyword ngxDirective working_directory
+syn keyword ngxDirective xclient
+syn keyword ngxDirective xml_entities
+syn keyword ngxDirective xslt_last_modified
+syn keyword ngxDirective xslt_param
+syn keyword ngxDirective xslt_string_param
+syn keyword ngxDirective xslt_stylesheet
+syn keyword ngxDirective xslt_types
+
+" 3rd party module list:
+" https://www.nginx.com/resources/wiki/modules/
+
+
+
+endif
diff --git a/syntax/lua.vim b/syntax/lua.vim
index 87ba9e9b..9ef55e4e 100644
--- a/syntax/lua.vim
+++ b/syntax/lua.vim
@@ -15,20 +15,33 @@ endif
syntax sync fromstart
+function! s:FoldableRegion(tag, name, expr)
+ let synexpr = 'syntax region ' . a:name . ' ' . a:expr
+ let pfx = 'g:lua_syntax_fold_'
+ if !exists('g:lua_syntax_nofold') || exists(pfx . a:tag) || exists(pfx . a:name)
+ let synexpr .= ' fold'
+ end
+ exec synexpr
+endfunction
+
" Clusters
syntax cluster luaBase contains=luaComment,luaCommentLong,luaConstant,luaNumber,luaString,luaStringLong,luaBuiltIn
-syntax cluster luaExpr contains=@luaBase,luaTable,luaParen,luaBracket,luaSpecialTable,luaSpecialValue,luaOperator,luaEllipsis,luaComma,luaFunc,luaFuncCall,luaError
-syntax cluster luaStat contains=@luaExpr,luaIfThen,luaBlock,luaLoop,luaGoto,luaLabel,luaLocal,luaStatement,luaSemiCol
+syntax cluster luaExpr contains=@luaBase,luaTable,luaParen,luaBracket,luaSpecialTable,luaSpecialValue,luaOperator,luaSymbolOperator,luaEllipsis,luaComma,luaFunc,luaFuncCall,luaError
+syntax cluster luaStat
+ \ contains=@luaExpr,luaIfThen,luaBlock,luaLoop,luaGoto,luaLabel,luaLocal,luaStatement,luaSemiCol,luaErrHand
syntax match luaNoise /\%(\.\|,\|:\|\;\)/
" Symbols
-syntax region luaTable transparent matchgroup=luaBraces start="{" end="}" contains=@luaExpr fold
+call s:FoldableRegion('table', 'luaTable',
+ \ 'transparent matchgroup=luaBraces start="{" end="}" contains=@luaExpr')
syntax region luaParen transparent matchgroup=luaParens start='(' end=')' contains=@luaExpr
syntax region luaBracket transparent matchgroup=luaBrackets start="\[" end="\]" contains=@luaExpr
syntax match luaComma ","
syntax match luaSemiCol ";"
-syntax match luaOperator "[#<>=~^&|*/%+-]\|\.\."
+if !exists('g:lua_syntax_nosymboloperator')
+ syntax match luaSymbolOperator "[#<>=~^&|*/%+-]\|\.\."
+endi
syntax match luaEllipsis "\.\.\."
" Catch errors caused by unbalanced brackets and keywords
@@ -43,14 +56,16 @@ syntax match luaComment "\%^#!.*"
" Comments
syntax keyword luaCommentTodo contained TODO FIXME XXX TBD
syntax match luaComment "--.*$" contains=luaCommentTodo,luaDocTag,@Spell
-syntax region luaCommentLong matchgroup=luaCommentLongTag start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaCommentTodo,luaDocTag,@Spell fold
+call s:FoldableRegion('comment', 'luaCommentLong',
+ \ 'matchgroup=luaCommentLongTag start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaCommentTodo,luaDocTag,@Spell')
syntax match luaDocTag contained "\s@\k\+"
" Function calls
syntax match luaFuncCall /\k\+\%(\s*[{('"]\)\@=/
" Functions
-syntax region luaFunc transparent matchgroup=luaFuncKeyword start="\<function\>" end="\<end\>" contains=@luaStat,luaFuncSig fold
+call s:FoldableRegion('function', 'luaFunc',
+ \ 'transparent matchgroup=luaFuncKeyword start="\<function\>" end="\<end\>" contains=@luaStat,luaFuncSig')
syntax region luaFuncSig contained transparent start="\(\<function\>\)\@<=" end=")" contains=luaFuncId,luaFuncArgs keepend
syntax match luaFuncId contained "[^(]*(\@=" contains=luaFuncTable,luaFuncName
syntax match luaFuncTable contained /\k\+\%(\s*[.:]\)\@=/
@@ -63,7 +78,8 @@ syntax match luaFuncArgComma contained /,/
syntax region luaIfThen transparent matchgroup=luaCond start="\<if\>" end="\<then\>"me=e-4 contains=@luaExpr nextgroup=luaThenEnd skipwhite skipempty
" then ... end
-syntax region luaThenEnd contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=@luaStat,luaElseifThen,luaElse fold
+call s:FoldableRegion('control', 'luaThenEnd',
+ \ 'contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=@luaStat,luaElseifThen,luaElse')
" elseif ... then
syntax region luaElseifThen contained transparent matchgroup=luaCond start="\<elseif\>" end="\<then\>" contains=@luaExpr
@@ -72,16 +88,20 @@ syntax region luaElseifThen contained transparent matchgroup=luaCond start="\<el
syntax keyword luaElse contained else
" do ... end
-syntax region luaBlock transparent matchgroup=luaRepeat start="\<do\>" end="\<end\>" contains=@luaStat fold
+call s:FoldableRegion('control', 'luaLoopBlock',
+ \ 'transparent matchgroup=luaRepeat start="\<do\>" end="\<end\>" contains=@luaStat contained')
+call s:FoldableRegion('control', 'luaBlock',
+ \ 'transparent matchgroup=luaStatement start="\<do\>" end="\<end\>" contains=@luaStat')
" repeat ... until
-syntax region luaLoop transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=@luaStat nextgroup=@luaExpr fold
+call s:FoldableRegion('control', 'luaLoop',
+ \ 'transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=@luaStat nextgroup=@luaExpr')
" while ... do
-syntax region luaLoop transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=@luaExpr nextgroup=luaBlock skipwhite skipempty fold
+syntax region luaLoop transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=@luaExpr nextgroup=luaLoopBlock skipwhite skipempty
" for ... do and for ... in ... do
-syntax region luaLoop transparent matchgroup=luaRepeat start="\<for\>" end="\<do\>"me=e-2 contains=@luaExpr,luaIn nextgroup=luaBlock skipwhite skipempty
+syntax region luaLoop transparent matchgroup=luaRepeat start="\<for\>" end="\<do\>"me=e-2 contains=@luaExpr,luaIn nextgroup=luaLoopBlock skipwhite skipempty
syntax keyword luaIn contained in
" goto and labels
@@ -98,7 +118,8 @@ syntax keyword luaStatement break return
" Strings
syntax match luaStringSpecial contained #\\[\\abfnrtvz'"]\|\\x[[:xdigit:]]\{2}\|\\[[:digit:]]\{,3}#
-syntax region luaStringLong matchgroup=luaStringLongTag start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell
+call s:FoldableRegion('string', 'luaStringLong',
+ \ 'matchgroup=luaStringLongTag start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell')
syntax region luaString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaStringSpecial,@Spell
syntax region luaString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaStringSpecial,@Spell
@@ -113,50 +134,60 @@ syntax match luaFloat "\.\d\+\%([eE][-+]\=\d\+\)\=\>"
" Floating point constant, without dot, with exponent
syntax match luaFloat "\<\d\+[eE][-+]\=\d\+\>"
+
" Special names from the Standard Library
-syntax keyword luaSpecialTable
-\ bit32
-\ coroutine
-\ debug
-\ io
-\ math
-\ os
-\ package
-\ string
-\ table
-\ utf8
-
-syntax keyword luaSpecialValue
-\ _G
-\ _VERSION
-\ assert
-\ collectgarbage
-\ dofile
-\ error
-\ getfenv
-\ getmetatable
-\ ipairs
-\ load
-\ loadfile
-\ loadstring
-\ module
-\ next
-\ pairs
-\ pcall
-\ print
-\ rawequal
-\ rawget
-\ rawlen
-\ rawset
-\ require
-\ select
-\ setfenv
-\ setmetatable
-\ tonumber
-\ tostring
-\ type
-\ unpack
-\ xpcall
+if !exists('g:lua_syntax_nostdlib')
+ syntax keyword luaSpecialValue
+ \ module
+ \ require
+
+ syntax keyword luaSpecialTable _G
+
+ syntax keyword luaErrHand
+ \ assert
+ \ error
+ \ pcall
+ \ xpcall
+
+ if !exists('g:lua_syntax_noextendedstdlib')
+ syntax keyword luaSpecialTable
+ \ bit32
+ \ coroutine
+ \ debug
+ \ io
+ \ math
+ \ os
+ \ package
+ \ string
+ \ table
+ \ utf8
+
+ syntax keyword luaSpecialValue
+ \ _VERSION
+ \ collectgarbage
+ \ dofile
+ \ getfenv
+ \ getmetatable
+ \ ipairs
+ \ load
+ \ loadfile
+ \ loadstring
+ \ next
+ \ pairs
+ \ print
+ \ rawequal
+ \ rawget
+ \ rawlen
+ \ rawset
+ \ select
+ \ setfenv
+ \ setmetatable
+ \ tonumber
+ \ tostring
+ \ type
+ \ unpack
+ endif
+endif
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
@@ -173,21 +204,23 @@ if version >= 508 || !exists("did_lua_syn_inits")
HiLink luaBrackets Noise
HiLink luaBuiltIn Special
HiLink luaComment Comment
+ HiLink luaCommentLongTag luaCommentLong
HiLink luaCommentLong luaComment
HiLink luaCommentTodo Todo
HiLink luaCond Conditional
- HiLink luaConstant Boolean
+ HiLink luaConstant Constant
HiLink luaDocTag Underlined
- HiLink luaEllipsis StorageClass
+ HiLink luaEllipsis Special
HiLink luaElse Conditional
HiLink luaError Error
HiLink luaFloat Float
- HiLink luaFuncTable Function
HiLink luaFuncArgName Noise
HiLink luaFuncCall PreProc
HiLink luaFuncId Function
- HiLink luaFuncKeyword Type
- HiLink luaFuncName Function
+ HiLink luaFuncName luaFuncId
+ HiLink luaFuncTable luaFuncId
+ HiLink luaFuncKeyword luaFunction
+ HiLink luaFunction Structure
HiLink luaFuncParens Noise
HiLink luaGoto luaStatement
HiLink luaGotoLabel Noise
@@ -195,6 +228,7 @@ if version >= 508 || !exists("did_lua_syn_inits")
HiLink luaLabel Label
HiLink luaLocal Type
HiLink luaNumber Number
+ HiLink luaSymbolOperator luaOperator
HiLink luaOperator Operator
HiLink luaRepeat Repeat
HiLink luaSemiCol Delimiter
@@ -204,6 +238,7 @@ if version >= 508 || !exists("did_lua_syn_inits")
HiLink luaString String
HiLink luaStringLong luaString
HiLink luaStringSpecial SpecialChar
+ HiLink luaErrHand Exception
delcommand HiLink
end
diff --git a/syntax/modules/accept-language.vim b/syntax/modules/accept-language.vim
new file mode 100644
index 00000000..2d9ef32d
--- /dev/null
+++ b/syntax/modules/accept-language.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Accept Language Module <https://www.nginx.com/resources/wiki/modules/accept_language/>
+" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.
+syn keyword ngxDirectiveThirdParty set_from_accept_language
+
+
+endif
diff --git a/syntax/modules/access-key.vim b/syntax/modules/access-key.vim
new file mode 100644
index 00000000..71b2c4c9
--- /dev/null
+++ b/syntax/modules/access-key.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Access Key Module (DEPRECATED) <http://wiki.nginx.org/NginxHttpAccessKeyModule>
+" Denies access unless the request URL contains an access key.
+syn keyword ngxDirectiveThirdParty accesskey
+syn keyword ngxDirectiveThirdParty accesskey_arg
+syn keyword ngxDirectiveThirdParty accesskey_hashmethod
+syn keyword ngxDirectiveThirdParty accesskey_signature
+
+
+endif
diff --git a/syntax/modules/afcgi.vim b/syntax/modules/afcgi.vim
new file mode 100644
index 00000000..32d7fd25
--- /dev/null
+++ b/syntax/modules/afcgi.vim
@@ -0,0 +1,42 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Asynchronous FastCGI Module <https://github.com/rsms/afcgi>
+" Primarily a modified version of the Nginx FastCGI module which implements multiplexing of connections, allowing a single FastCGI server to handle many concurrent requests.
+" syn keyword ngxDirectiveThirdParty fastcgi_bind
+" syn keyword ngxDirectiveThirdParty fastcgi_buffer_size
+" syn keyword ngxDirectiveThirdParty fastcgi_buffers
+" syn keyword ngxDirectiveThirdParty fastcgi_busy_buffers_size
+" syn keyword ngxDirectiveThirdParty fastcgi_cache
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_key
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_methods
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_min_uses
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_path
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_use_stale
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_valid
+" syn keyword ngxDirectiveThirdParty fastcgi_catch_stderr
+" syn keyword ngxDirectiveThirdParty fastcgi_connect_timeout
+" syn keyword ngxDirectiveThirdParty fastcgi_hide_header
+" syn keyword ngxDirectiveThirdParty fastcgi_ignore_client_abort
+" syn keyword ngxDirectiveThirdParty fastcgi_ignore_headers
+" syn keyword ngxDirectiveThirdParty fastcgi_index
+" syn keyword ngxDirectiveThirdParty fastcgi_intercept_errors
+" syn keyword ngxDirectiveThirdParty fastcgi_max_temp_file_size
+" syn keyword ngxDirectiveThirdParty fastcgi_next_upstream
+" syn keyword ngxDirectiveThirdParty fastcgi_param
+" syn keyword ngxDirectiveThirdParty fastcgi_pass
+" syn keyword ngxDirectiveThirdParty fastcgi_pass_header
+" syn keyword ngxDirectiveThirdParty fastcgi_pass_request_body
+" syn keyword ngxDirectiveThirdParty fastcgi_pass_request_headers
+" syn keyword ngxDirectiveThirdParty fastcgi_read_timeout
+" syn keyword ngxDirectiveThirdParty fastcgi_send_lowat
+" syn keyword ngxDirectiveThirdParty fastcgi_send_timeout
+" syn keyword ngxDirectiveThirdParty fastcgi_split_path_info
+" syn keyword ngxDirectiveThirdParty fastcgi_store
+" syn keyword ngxDirectiveThirdParty fastcgi_store_access
+" syn keyword ngxDirectiveThirdParty fastcgi_temp_file_write_size
+" syn keyword ngxDirectiveThirdParty fastcgi_temp_path
+syn keyword ngxDirectiveThirdParty fastcgi_upstream_fail_timeout
+syn keyword ngxDirectiveThirdParty fastcgi_upstream_max_fails
+
+
+endif
diff --git a/syntax/modules/akamai-g2o.vim b/syntax/modules/akamai-g2o.vim
new file mode 100644
index 00000000..36a29b4f
--- /dev/null
+++ b/syntax/modules/akamai-g2o.vim
@@ -0,0 +1,10 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Akamai G2O Module <https://github.com/kaltura/nginx_mod_akamai_g2o>
+" Nginx Module for Authenticating Akamai G2O requests
+syn keyword ngxDirectiveThirdParty g2o
+syn keyword ngxDirectiveThirdParty g2o_nonce
+syn keyword ngxDirectiveThirdParty g2o_key
+
+
+endif
diff --git a/syntax/modules/alacner-lua.vim b/syntax/modules/alacner-lua.vim
new file mode 100644
index 00000000..1772422d
--- /dev/null
+++ b/syntax/modules/alacner-lua.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Lua Module <https://github.com/alacner/nginx_lua_module>
+" You can be very simple to execute lua code for nginx
+syn keyword ngxDirectiveThirdParty lua_file
+
+
+endif
diff --git a/syntax/modules/array-var.vim b/syntax/modules/array-var.vim
new file mode 100644
index 00000000..12c86cc3
--- /dev/null
+++ b/syntax/modules/array-var.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Array Variable Module <https://github.com/openresty/array-var-nginx-module>
+" Add support for array-typed variables to nginx config files
+syn keyword ngxDirectiveThirdParty array_split
+syn keyword ngxDirectiveThirdParty array_join
+syn keyword ngxDirectiveThirdParty array_map
+syn keyword ngxDirectiveThirdParty array_map_op
+
+
+endif
diff --git a/syntax/modules/audio-track-for-hls.vim b/syntax/modules/audio-track-for-hls.vim
new file mode 100644
index 00000000..afe98957
--- /dev/null
+++ b/syntax/modules/audio-track-for-hls.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Nginx Audio Track for HTTP Live Streaming <https://github.com/flavioribeiro/nginx-audio-track-for-hls-module>
+" This nginx module generates audio track for hls streams on the fly.
+syn keyword ngxDirectiveThirdParty ngx_hls_audio_track
+syn keyword ngxDirectiveThirdParty ngx_hls_audio_track_rootpath
+syn keyword ngxDirectiveThirdParty ngx_hls_audio_track_output_format
+syn keyword ngxDirectiveThirdParty ngx_hls_audio_track_output_header
+
+
+endif
diff --git a/syntax/modules/aws-auth.vim b/syntax/modules/aws-auth.vim
new file mode 100644
index 00000000..f98e960c
--- /dev/null
+++ b/syntax/modules/aws-auth.vim
@@ -0,0 +1,13 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" AWS Proxy Module <https://github.com/anomalizer/ngx_aws_auth>
+" Nginx module to proxy to authenticated AWS services
+syn keyword ngxDirectiveThirdParty aws_access_key
+syn keyword ngxDirectiveThirdParty aws_key_scope
+syn keyword ngxDirectiveThirdParty aws_signing_key
+syn keyword ngxDirectiveThirdParty aws_endpoint
+syn keyword ngxDirectiveThirdParty aws_s3_bucket
+syn keyword ngxDirectiveThirdParty aws_sign
+
+
+endif
diff --git a/syntax/modules/backtrace.vim b/syntax/modules/backtrace.vim
new file mode 100644
index 00000000..7a2e6258
--- /dev/null
+++ b/syntax/modules/backtrace.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Backtrace module <https://github.com/alibaba/nginx-backtrace>
+" A Nginx module to dump backtrace when a worker process exits abnormally
+syn keyword ngxDirectiveThirdParty backtrace_log
+syn keyword ngxDirectiveThirdParty backtrace_max_stack_size
+
+
+endif
diff --git a/syntax/modules/brotli.vim b/syntax/modules/brotli.vim
new file mode 100644
index 00000000..b6103d48
--- /dev/null
+++ b/syntax/modules/brotli.vim
@@ -0,0 +1,14 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Brotli Module <https://github.com/google/ngx_brotli>
+" Nginx module for Brotli compression
+syn keyword ngxDirectiveThirdParty brotli_static
+syn keyword ngxDirectiveThirdParty brotli
+syn keyword ngxDirectiveThirdParty brotli_types
+syn keyword ngxDirectiveThirdParty brotli_buffers
+syn keyword ngxDirectiveThirdParty brotli_comp_level
+syn keyword ngxDirectiveThirdParty brotli_window
+syn keyword ngxDirectiveThirdParty brotli_min_length
+
+
+endif
diff --git a/syntax/modules/cache-purge.vim b/syntax/modules/cache-purge.vim
new file mode 100644
index 00000000..2b57226e
--- /dev/null
+++ b/syntax/modules/cache-purge.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Cache Purge Module <https://github.com/FRiCKLE/ngx_cache_purge>
+" Module adding ability to purge content from FastCGI and proxy caches.
+syn keyword ngxDirectiveThirdParty fastcgi_cache_purge
+syn keyword ngxDirectiveThirdParty proxy_cache_purge
+
+
+endif
diff --git a/syntax/modules/chunkin.vim b/syntax/modules/chunkin.vim
new file mode 100644
index 00000000..8375598b
--- /dev/null
+++ b/syntax/modules/chunkin.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Chunkin Module (DEPRECATED) <http://wiki.nginx.org/NginxHttpChunkinModule>
+" HTTP 1.1 chunked-encoding request body support for Nginx.
+syn keyword ngxDirectiveThirdParty chunkin
+syn keyword ngxDirectiveThirdParty chunkin_keepalive
+syn keyword ngxDirectiveThirdParty chunkin_max_chunks_per_buf
+syn keyword ngxDirectiveThirdParty chunkin_resume
+
+
+endif
diff --git a/syntax/modules/circle-gif.vim b/syntax/modules/circle-gif.vim
new file mode 100644
index 00000000..0a4eac9e
--- /dev/null
+++ b/syntax/modules/circle-gif.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Circle GIF Module <https://github.com/evanmiller/nginx_circle_gif>
+" Generates simple circle images with the colors and size specified in the URL.
+syn keyword ngxDirectiveThirdParty circle_gif
+syn keyword ngxDirectiveThirdParty circle_gif_max_radius
+syn keyword ngxDirectiveThirdParty circle_gif_min_radius
+syn keyword ngxDirectiveThirdParty circle_gif_step_radius
+
+
+endif
diff --git a/syntax/modules/clojure.vim b/syntax/modules/clojure.vim
new file mode 100644
index 00000000..e5a6c8d4
--- /dev/null
+++ b/syntax/modules/clojure.vim
@@ -0,0 +1,39 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Nginx-Clojure Module http://nginx-clojure.github.io/index.html<>
+" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.
+syn keyword ngxDirectiveThirdParty jvm_path
+syn keyword ngxDirectiveThirdParty jvm_var
+syn keyword ngxDirectiveThirdParty jvm_classpath
+syn keyword ngxDirectiveThirdParty jvm_classpath_check
+syn keyword ngxDirectiveThirdParty jvm_workers
+syn keyword ngxDirectiveThirdParty jvm_options
+syn keyword ngxDirectiveThirdParty jvm_handler_type
+syn keyword ngxDirectiveThirdParty jvm_init_handler_name
+syn keyword ngxDirectiveThirdParty jvm_init_handler_code
+syn keyword ngxDirectiveThirdParty jvm_exit_handler_name
+syn keyword ngxDirectiveThirdParty jvm_exit_handler_code
+syn keyword ngxDirectiveThirdParty handlers_lazy_init
+syn keyword ngxDirectiveThirdParty auto_upgrade_ws
+syn keyword ngxDirectiveThirdParty content_handler_type
+syn keyword ngxDirectiveThirdParty content_handler_name
+syn keyword ngxDirectiveThirdParty content_handler_code
+syn keyword ngxDirectiveThirdParty rewrite_handler_type
+syn keyword ngxDirectiveThirdParty rewrite_handler_name
+syn keyword ngxDirectiveThirdParty rewrite_handler_code
+syn keyword ngxDirectiveThirdParty access_handler_type
+syn keyword ngxDirectiveThirdParty access_handler_name
+syn keyword ngxDirectiveThirdParty access_handler_code
+syn keyword ngxDirectiveThirdParty header_filter_type
+syn keyword ngxDirectiveThirdParty header_filter_name
+syn keyword ngxDirectiveThirdParty header_filter_code
+syn keyword ngxDirectiveThirdParty content_handler_property
+syn keyword ngxDirectiveThirdParty rewrite_handler_property
+syn keyword ngxDirectiveThirdParty access_handler_property
+syn keyword ngxDirectiveThirdParty header_filter_property
+syn keyword ngxDirectiveThirdParty always_read_body
+syn keyword ngxDirectiveThirdParty shared_map
+syn keyword ngxDirectiveThirdParty write_page_size
+
+
+endif
diff --git a/syntax/modules/consistent-hash.vim b/syntax/modules/consistent-hash.vim
new file mode 100644
index 00000000..b066b2b0
--- /dev/null
+++ b/syntax/modules/consistent-hash.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Upstream Consistent Hash <https://www.nginx.com/resources/wiki/modules/consistent_hash/>
+" A load balancer that uses an internal consistent hash ring to select the right backend node.
+syn keyword ngxDirectiveThirdParty consistent_hash
+
+
+endif
diff --git a/syntax/modules/devel-kit.vim b/syntax/modules/devel-kit.vim
new file mode 100644
index 00000000..b097a8c3
--- /dev/null
+++ b/syntax/modules/devel-kit.vim
@@ -0,0 +1,10 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Nginx Development Kit <https://github.com/simpl/ngx_devel_kit>
+" The NDK is an Nginx module that is designed to extend the core functionality of the excellent Nginx webserver in a way that can be used as a basis of other Nginx modules.
+" NDK_UPSTREAM_LIST
+" This submodule provides a directive that creates a list of upstreams, with optional weighting. This list can then be used by other modules to hash over the upstreams however they choose.
+syn keyword ngxDirectiveThirdParty upstream_list
+
+
+endif
diff --git a/syntax/modules/drizzle.vim b/syntax/modules/drizzle.vim
new file mode 100644
index 00000000..507977e3
--- /dev/null
+++ b/syntax/modules/drizzle.vim
@@ -0,0 +1,17 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Drizzle Module <https://github.com/openresty/drizzle-nginx-module>
+" Make nginx talk directly to mysql, drizzle, and sqlite3 by libdrizzle.
+syn keyword ngxDirectiveThirdParty drizzle_connect_timeout
+syn keyword ngxDirectiveThirdParty drizzle_dbname
+syn keyword ngxDirectiveThirdParty drizzle_keepalive
+syn keyword ngxDirectiveThirdParty drizzle_module_header
+syn keyword ngxDirectiveThirdParty drizzle_pass
+syn keyword ngxDirectiveThirdParty drizzle_query
+syn keyword ngxDirectiveThirdParty drizzle_recv_cols_timeout
+syn keyword ngxDirectiveThirdParty drizzle_recv_rows_timeout
+syn keyword ngxDirectiveThirdParty drizzle_send_query_timeout
+syn keyword ngxDirectiveThirdParty drizzle_server
+
+
+endif
diff --git a/syntax/modules/dynamic-etags.vim b/syntax/modules/dynamic-etags.vim
new file mode 100644
index 00000000..9655fd6a
--- /dev/null
+++ b/syntax/modules/dynamic-etags.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Dynamic ETags Module <https://github.com/kali/nginx-dynamic-etags>
+" Attempt at handling ETag / If-None-Match on proxied content.
+syn keyword ngxDirectiveThirdParty dynamic_etags
+
+
+endif
diff --git a/syntax/modules/echo.vim b/syntax/modules/echo.vim
new file mode 100644
index 00000000..062a856c
--- /dev/null
+++ b/syntax/modules/echo.vim
@@ -0,0 +1,24 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Echo Module <https://github.com/openresty/echo-nginx-module>
+" Brings 'echo', 'sleep', 'time', 'exec' and more shell-style goodies to Nginx config file.
+syn keyword ngxDirectiveThirdParty echo
+syn keyword ngxDirectiveThirdParty echo_after_body
+syn keyword ngxDirectiveThirdParty echo_before_body
+syn keyword ngxDirectiveThirdParty echo_blocking_sleep
+syn keyword ngxDirectiveThirdParty echo_duplicate
+syn keyword ngxDirectiveThirdParty echo_end
+syn keyword ngxDirectiveThirdParty echo_exec
+syn keyword ngxDirectiveThirdParty echo_flush
+syn keyword ngxDirectiveThirdParty echo_foreach_split
+syn keyword ngxDirectiveThirdParty echo_location
+syn keyword ngxDirectiveThirdParty echo_location_async
+syn keyword ngxDirectiveThirdParty echo_read_request_body
+syn keyword ngxDirectiveThirdParty echo_request_body
+syn keyword ngxDirectiveThirdParty echo_reset_timer
+syn keyword ngxDirectiveThirdParty echo_sleep
+syn keyword ngxDirectiveThirdParty echo_subrequest
+syn keyword ngxDirectiveThirdParty echo_subrequest_async
+
+
+endif
diff --git a/syntax/modules/encrypted-session.vim b/syntax/modules/encrypted-session.vim
new file mode 100644
index 00000000..1450ec11
--- /dev/null
+++ b/syntax/modules/encrypted-session.vim
@@ -0,0 +1,13 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Encrypted Session Module <https://github.com/openresty/encrypted-session-nginx-module>
+" Encrypt and decrypt nginx variable values
+syn keyword ngxDirectiveThirdParty encrypted_session_key
+syn keyword ngxDirectiveThirdParty encrypted_session_iv
+syn keyword ngxDirectiveThirdParty encrypted_session_expires
+syn keyword ngxDirectiveThirdParty set_encrypt_session
+syn keyword ngxDirectiveThirdParty set_decrypt_session
+
+
+
+endif
diff --git a/syntax/modules/enhanced-memcached.vim b/syntax/modules/enhanced-memcached.vim
new file mode 100644
index 00000000..67d6e192
--- /dev/null
+++ b/syntax/modules/enhanced-memcached.vim
@@ -0,0 +1,19 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Enhanced Memcached Module <https://github.com/bpaquet/ngx_http_enhanced_memcached_module>
+" This module is based on the standard Nginx Memcached module, with some additonal features
+syn keyword ngxDirectiveThirdParty enhanced_memcached_pass
+syn keyword ngxDirectiveThirdParty enhanced_memcached_hash_keys_with_md5
+syn keyword ngxDirectiveThirdParty enhanced_memcached_allow_put
+syn keyword ngxDirectiveThirdParty enhanced_memcached_allow_delete
+syn keyword ngxDirectiveThirdParty enhanced_memcached_stats
+syn keyword ngxDirectiveThirdParty enhanced_memcached_flush
+syn keyword ngxDirectiveThirdParty enhanced_memcached_flush_namespace
+syn keyword ngxDirectiveThirdParty enhanced_memcached_bind
+syn keyword ngxDirectiveThirdParty enhanced_memcached_connect_timeout
+syn keyword ngxDirectiveThirdParty enhanced_memcached_send_timeout
+syn keyword ngxDirectiveThirdParty enhanced_memcached_buffer_size
+syn keyword ngxDirectiveThirdParty enhanced_memcached_read_timeout
+
+
+endif
diff --git a/syntax/modules/events.vim b/syntax/modules/events.vim
new file mode 100644
index 00000000..56578406
--- /dev/null
+++ b/syntax/modules/events.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Events Module (DEPRECATED) <http://docs.dutov.org/nginx_modules_events_en.html>
+" Provides options for start/stop events.
+syn keyword ngxDirectiveThirdParty on_start
+syn keyword ngxDirectiveThirdParty on_stop
+
+
+endif
diff --git a/syntax/modules/ey-balancer.vim b/syntax/modules/ey-balancer.vim
new file mode 100644
index 00000000..825bab8b
--- /dev/null
+++ b/syntax/modules/ey-balancer.vim
@@ -0,0 +1,10 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" EY Balancer Module <https://github.com/ezmobius/nginx-ey-balancer>
+" Adds a request queue to Nginx that allows the limiting of concurrent requests passed to the upstream.
+syn keyword ngxDirectiveThirdParty max_connections
+syn keyword ngxDirectiveThirdParty max_connections_max_queue_length
+syn keyword ngxDirectiveThirdParty max_connections_queue_timeout
+
+
+endif
diff --git a/syntax/modules/fair-balancer.vim b/syntax/modules/fair-balancer.vim
new file mode 100644
index 00000000..097232ce
--- /dev/null
+++ b/syntax/modules/fair-balancer.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Upstream Fair Balancer <https://www.nginx.com/resources/wiki/modules/fair_balancer/>
+" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin.
+syn keyword ngxDirectiveThirdParty fair
+syn keyword ngxDirectiveThirdParty upstream_fair_shm_size
+
+
+endif
diff --git a/syntax/modules/fancyindex.vim b/syntax/modules/fancyindex.vim
new file mode 100644
index 00000000..423b5524
--- /dev/null
+++ b/syntax/modules/fancyindex.vim
@@ -0,0 +1,14 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Fancy Indexes Module <https://github.com/aperezdc/ngx-fancyindex>
+" Like the built-in autoindex module, but fancier.
+syn keyword ngxDirectiveThirdParty fancyindex
+syn keyword ngxDirectiveThirdParty fancyindex_exact_size
+syn keyword ngxDirectiveThirdParty fancyindex_footer
+syn keyword ngxDirectiveThirdParty fancyindex_header
+syn keyword ngxDirectiveThirdParty fancyindex_localtime
+syn keyword ngxDirectiveThirdParty fancyindex_readme
+syn keyword ngxDirectiveThirdParty fancyindex_readme_mode
+
+
+endif
diff --git a/syntax/modules/form-auth.vim b/syntax/modules/form-auth.vim
new file mode 100644
index 00000000..6e044f2d
--- /dev/null
+++ b/syntax/modules/form-auth.vim
@@ -0,0 +1,12 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Form Auth Module <https://github.com/veruu/ngx_form_auth>
+" Provides authentication and authorization with credentials submitted via POST request
+syn keyword ngxDirectiveThirdParty form_auth
+syn keyword ngxDirectiveThirdParty form_auth_pam_service
+syn keyword ngxDirectiveThirdParty form_auth_login
+syn keyword ngxDirectiveThirdParty form_auth_password
+syn keyword ngxDirectiveThirdParty form_auth_remote_user
+
+
+endif
diff --git a/syntax/modules/form-input.vim b/syntax/modules/form-input.vim
new file mode 100644
index 00000000..563dfc28
--- /dev/null
+++ b/syntax/modules/form-input.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Form Input Module <https://github.com/calio/form-input-nginx-module>
+" Reads HTTP POST and PUT request body encoded in "application/x-www-form-urlencoded" and parses the arguments into nginx variables.
+syn keyword ngxDirectiveThirdParty set_form_input
+syn keyword ngxDirectiveThirdParty set_form_input_multi
+
+
+endif
diff --git a/syntax/modules/geoip.vim b/syntax/modules/geoip.vim
new file mode 100644
index 00000000..4f7409ce
--- /dev/null
+++ b/syntax/modules/geoip.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" GeoIP Module (DEPRECATED) <http://wiki.nginx.org/NginxHttp3rdPartyGeoIPModule>
+" Country code lookups via the MaxMind GeoIP API.
+syn keyword ngxDirectiveThirdParty geoip_country_file
+
+
+endif
diff --git a/syntax/modules/gridfs.vim b/syntax/modules/gridfs.vim
new file mode 100644
index 00000000..b65ec1d9
--- /dev/null
+++ b/syntax/modules/gridfs.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" GridFS Module <https://github.com/mdirolf/nginx-gridfs>
+" Nginx module for serving files from MongoDB's GridFS
+syn keyword ngxDirectiveThirdParty gridfs
+
+
+endif
diff --git a/syntax/modules/headers-more.vim b/syntax/modules/headers-more.vim
new file mode 100644
index 00000000..73ad8201
--- /dev/null
+++ b/syntax/modules/headers-more.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Headers More Module <https://github.com/openresty/headers-more-nginx-module>
+" Set and clear input and output headers...more than "add"!
+syn keyword ngxDirectiveThirdParty more_clear_headers
+syn keyword ngxDirectiveThirdParty more_clear_input_headers
+syn keyword ngxDirectiveThirdParty more_set_headers
+syn keyword ngxDirectiveThirdParty more_set_input_headers
+
+
+endif
diff --git a/syntax/modules/healthcheck-upstream.vim b/syntax/modules/healthcheck-upstream.vim
new file mode 100644
index 00000000..362324b6
--- /dev/null
+++ b/syntax/modules/healthcheck-upstream.vim
@@ -0,0 +1,15 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Health Checks Upstreams Module <https://www.nginx.com/resources/wiki/modules/healthcheck/>
+" Polls backends and if they respond with HTTP 200 + an optional request body, they are marked good. Otherwise, they are marked bad.
+syn keyword ngxDirectiveThirdParty healthcheck_enabled
+syn keyword ngxDirectiveThirdParty healthcheck_delay
+syn keyword ngxDirectiveThirdParty healthcheck_timeout
+syn keyword ngxDirectiveThirdParty healthcheck_failcount
+syn keyword ngxDirectiveThirdParty healthcheck_send
+syn keyword ngxDirectiveThirdParty healthcheck_expected
+syn keyword ngxDirectiveThirdParty healthcheck_buffer
+syn keyword ngxDirectiveThirdParty healthcheck_status
+
+
+endif
diff --git a/syntax/modules/http-accounting.vim b/syntax/modules/http-accounting.vim
new file mode 100644
index 00000000..fbe2defa
--- /dev/null
+++ b/syntax/modules/http-accounting.vim
@@ -0,0 +1,12 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" HTTP Accounting Module <https://github.com/Lax/ngx_http_accounting_module>
+" Add traffic stat function to nginx. Useful for http accounting based on nginx configuration logic
+syn keyword ngxDirectiveThirdParty http_accounting
+syn keyword ngxDirectiveThirdParty http_accounting_log
+syn keyword ngxDirectiveThirdParty http_accounting_id
+syn keyword ngxDirectiveThirdParty http_accounting_interval
+syn keyword ngxDirectiveThirdParty http_accounting_perturb
+
+
+endif
diff --git a/syntax/modules/http-auth-digest.vim b/syntax/modules/http-auth-digest.vim
new file mode 100644
index 00000000..ff850a61
--- /dev/null
+++ b/syntax/modules/http-auth-digest.vim
@@ -0,0 +1,13 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Nginx Digest Authentication module <https://github.com/atomx/nginx-http-auth-digest>
+" Digest Authentication for Nginx
+syn keyword ngxDirectiveThirdParty auth_digest
+syn keyword ngxDirectiveThirdParty auth_digest_user_file
+syn keyword ngxDirectiveThirdParty auth_digest_timeout
+syn keyword ngxDirectiveThirdParty auth_digest_expires
+syn keyword ngxDirectiveThirdParty auth_digest_replays
+syn keyword ngxDirectiveThirdParty auth_digest_shm_size
+
+
+endif
diff --git a/syntax/modules/http-auth-pam.vim b/syntax/modules/http-auth-pam.vim
new file mode 100644
index 00000000..1a8d6dc2
--- /dev/null
+++ b/syntax/modules/http-auth-pam.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Auth PAM Module <https://github.com/sto/ngx_http_auth_pam_module>
+" HTTP Basic Authentication using PAM.
+syn keyword ngxDirectiveThirdParty auth_pam
+syn keyword ngxDirectiveThirdParty auth_pam_service_name
+
+
+endif
diff --git a/syntax/modules/http-auth-request.vim b/syntax/modules/http-auth-request.vim
new file mode 100644
index 00000000..9238cd5c
--- /dev/null
+++ b/syntax/modules/http-auth-request.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" HTTP Auth Request Module <http://nginx.org/en/docs/http/ngx_http_auth_request_module.html>
+" Implements client authorization based on the result of a subrequest
+syn keyword ngxDirectiveThirdParty auth_request
+syn keyword ngxDirectiveThirdParty auth_request_set
+
+
+endif
diff --git a/syntax/modules/http-concat.vim b/syntax/modules/http-concat.vim
new file mode 100644
index 00000000..fbd4d828
--- /dev/null
+++ b/syntax/modules/http-concat.vim
@@ -0,0 +1,13 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" HTTP Concatenation module for Nginx <https://github.com/alibaba/nginx-http-concat>
+" A Nginx module for concatenating files in a given context: CSS and JS files usually
+syn keyword ngxDirectiveThirdParty concat
+syn keyword ngxDirectiveThirdParty concat_types
+syn keyword ngxDirectiveThirdParty concat_unique
+syn keyword ngxDirectiveThirdParty concat_max_files
+syn keyword ngxDirectiveThirdParty concat_delimiter
+syn keyword ngxDirectiveThirdParty concat_ignore_file_error
+
+
+endif
diff --git a/syntax/modules/http-dyups.vim b/syntax/modules/http-dyups.vim
new file mode 100644
index 00000000..9191d4fd
--- /dev/null
+++ b/syntax/modules/http-dyups.vim
@@ -0,0 +1,12 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" HTTP Dynamic Upstream Module <https://github.com/yzprofile/ngx_http_dyups_module>
+" Update upstreams' config by restful interface
+syn keyword ngxDirectiveThirdParty dyups_interface
+syn keyword ngxDirectiveThirdParty dyups_read_msg_timeout
+syn keyword ngxDirectiveThirdParty dyups_shm_zone_size
+syn keyword ngxDirectiveThirdParty dyups_upstream_conf
+syn keyword ngxDirectiveThirdParty dyups_trylock
+
+
+endif
diff --git a/syntax/modules/http-footer-filter-if.vim b/syntax/modules/http-footer-filter-if.vim
new file mode 100644
index 00000000..74a5e4c1
--- /dev/null
+++ b/syntax/modules/http-footer-filter-if.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" HTTP Footer If Filter Module <https://github.com/flygoast/ngx_http_footer_if_filter>
+" The ngx_http_footer_if_filter_module is used to add given content to the end of the response according to the condition specified.
+syn keyword ngxDirectiveThirdParty footer_if
+
+
+endif
diff --git a/syntax/modules/http-footer-filter.vim b/syntax/modules/http-footer-filter.vim
new file mode 100644
index 00000000..7dd33db1
--- /dev/null
+++ b/syntax/modules/http-footer-filter.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" HTTP Footer Filter Module <https://github.com/alibaba/nginx-http-footer-filter>
+" This module implements a body filter that adds a given string to the page footer.
+syn keyword ngxDirectiveThirdParty footer
+syn keyword ngxDirectiveThirdParty footer_types
+
+
+endif
diff --git a/syntax/modules/http-internal-redirect.vim b/syntax/modules/http-internal-redirect.vim
new file mode 100644
index 00000000..2484dc8a
--- /dev/null
+++ b/syntax/modules/http-internal-redirect.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" HTTP Internal Redirect Module <https://github.com/flygoast/ngx_http_internal_redirect>
+" Make an internal redirect to the uri specified according to the condition specified.
+syn keyword ngxDirectiveThirdParty internal_redirect_if
+syn keyword ngxDirectiveThirdParty internal_redirect_if_no_postponed
+
+
+endif
diff --git a/syntax/modules/http-js.vim b/syntax/modules/http-js.vim
new file mode 100644
index 00000000..fe16fb9c
--- /dev/null
+++ b/syntax/modules/http-js.vim
@@ -0,0 +1,15 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" HTTP JavaScript Module <https://github.com/peter-leonov/ngx_http_js_module>
+" Embedding SpiderMonkey. Nearly full port on Perl module.
+syn keyword ngxDirectiveThirdParty js
+syn keyword ngxDirectiveThirdParty js_filter
+syn keyword ngxDirectiveThirdParty js_filter_types
+syn keyword ngxDirectiveThirdParty js_load
+syn keyword ngxDirectiveThirdParty js_maxmem
+syn keyword ngxDirectiveThirdParty js_require
+syn keyword ngxDirectiveThirdParty js_set
+syn keyword ngxDirectiveThirdParty js_utf8
+
+
+endif
diff --git a/syntax/modules/http-push.vim b/syntax/modules/http-push.vim
new file mode 100644
index 00000000..d53ad5e1
--- /dev/null
+++ b/syntax/modules/http-push.vim
@@ -0,0 +1,12 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" HTTP Push Module (DEPRECATED) <http://pushmodule.slact.net/>
+" Turn Nginx into an adept long-polling HTTP Push (Comet) server.
+syn keyword ngxDirectiveThirdParty push_buffer_size
+syn keyword ngxDirectiveThirdParty push_listener
+syn keyword ngxDirectiveThirdParty push_message_timeout
+syn keyword ngxDirectiveThirdParty push_queue_messages
+syn keyword ngxDirectiveThirdParty push_sender
+
+
+endif
diff --git a/syntax/modules/http-redis.vim b/syntax/modules/http-redis.vim
new file mode 100644
index 00000000..95a3a34a
--- /dev/null
+++ b/syntax/modules/http-redis.vim
@@ -0,0 +1,14 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" HTTP Redis Module <https://www.nginx.com/resources/wiki/modules/redis/>
+" Redis <http://code.google.com/p/redis/> support.>
+syn keyword ngxDirectiveThirdParty redis_bind
+syn keyword ngxDirectiveThirdParty redis_buffer_size
+syn keyword ngxDirectiveThirdParty redis_connect_timeout
+syn keyword ngxDirectiveThirdParty redis_next_upstream
+syn keyword ngxDirectiveThirdParty redis_pass
+syn keyword ngxDirectiveThirdParty redis_read_timeout
+syn keyword ngxDirectiveThirdParty redis_send_timeout
+
+
+endif
diff --git a/syntax/modules/iconv.vim b/syntax/modules/iconv.vim
new file mode 100644
index 00000000..6480895a
--- /dev/null
+++ b/syntax/modules/iconv.vim
@@ -0,0 +1,10 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Iconv Module <https://github.com/calio/iconv-nginx-module>
+" A character conversion nginx module using libiconv
+syn keyword ngxDirectiveThirdParty set_iconv
+syn keyword ngxDirectiveThirdParty iconv_buffer_size
+syn keyword ngxDirectiveThirdParty iconv_filter
+
+
+endif
diff --git a/syntax/modules/ip-blocker.vim b/syntax/modules/ip-blocker.vim
new file mode 100644
index 00000000..2189c0f1
--- /dev/null
+++ b/syntax/modules/ip-blocker.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" IP Blocker Module <https://github.com/tmthrgd/nginx-ip-blocker>
+" An efficient shared memory IP blocking system for nginx.
+syn keyword ngxDirectiveThirdParty ip_blocker
+
+
+endif
diff --git a/syntax/modules/ip2location.vim b/syntax/modules/ip2location.vim
new file mode 100644
index 00000000..0476a43e
--- /dev/null
+++ b/syntax/modules/ip2location.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" IP2Location Module <https://github.com/chrislim2888/ip2location-nginx>
+" Allows user to lookup for geolocation information using IP2Location database
+syn keyword ngxDirectiveThirdParty ip2location_database
+
+
+endif
diff --git a/syntax/modules/limit-upload-rate.vim b/syntax/modules/limit-upload-rate.vim
new file mode 100644
index 00000000..51354570
--- /dev/null
+++ b/syntax/modules/limit-upload-rate.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Limit Upload Rate Module <https://github.com/cfsego/limit_upload_rate>
+" Limit client-upload rate when they are sending request bodies to you
+syn keyword ngxDirectiveThirdParty limit_upload_rate
+syn keyword ngxDirectiveThirdParty limit_upload_rate_after
+
+
+endif
diff --git a/syntax/modules/limit-upstream.vim b/syntax/modules/limit-upstream.vim
new file mode 100644
index 00000000..be8242f1
--- /dev/null
+++ b/syntax/modules/limit-upstream.vim
@@ -0,0 +1,10 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Limit Upstream Module <https://github.com/cfsego/nginx-limit-upstream>
+" Limit the number of connections to upstream for NGINX
+syn keyword ngxDirectiveThirdParty limit_upstream_zone
+syn keyword ngxDirectiveThirdParty limit_upstream_conn
+syn keyword ngxDirectiveThirdParty limit_upstream_log_level
+
+
+endif
diff --git a/syntax/modules/log-if.vim b/syntax/modules/log-if.vim
new file mode 100644
index 00000000..2e5b4ca3
--- /dev/null
+++ b/syntax/modules/log-if.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Log If Module <https://github.com/cfsego/ngx_log_if>
+" Conditional accesslog for nginx
+syn keyword ngxDirectiveThirdParty access_log_bypass_if
+
+
+endif
diff --git a/syntax/modules/log-request-speed.vim b/syntax/modules/log-request-speed.vim
new file mode 100644
index 00000000..792e2e7b
--- /dev/null
+++ b/syntax/modules/log-request-speed.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Log Request Speed (DEPRECATED) <http://wiki.nginx.org/NginxHttpLogRequestSpeed>
+" Log the time it took to process each request.
+syn keyword ngxDirectiveThirdParty log_request_speed_filter
+syn keyword ngxDirectiveThirdParty log_request_speed_filter_timeout
+
+
+endif
diff --git a/syntax/modules/log-zmq.vim b/syntax/modules/log-zmq.vim
new file mode 100644
index 00000000..e9c5c339
--- /dev/null
+++ b/syntax/modules/log-zmq.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Log ZeroMQ Module <https://github.com/alticelabs/nginx-log-zmq>
+" ZeroMQ logger module for nginx
+syn keyword ngxDirectiveThirdParty log_zmq_server
+syn keyword ngxDirectiveThirdParty log_zmq_endpoint
+syn keyword ngxDirectiveThirdParty log_zmq_format
+syn keyword ngxDirectiveThirdParty log_zmq_off
+
+
+endif
diff --git a/syntax/modules/lower-upper-case.vim b/syntax/modules/lower-upper-case.vim
new file mode 100644
index 00000000..698e63b5
--- /dev/null
+++ b/syntax/modules/lower-upper-case.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Lower/UpperCase Module <https://github.com/replay/ngx_http_lower_upper_case>
+" This module simply uppercases or lowercases a string and saves it into a new variable.
+syn keyword ngxDirectiveThirdParty lower
+syn keyword ngxDirectiveThirdParty upper
+
+
+endif
diff --git a/syntax/modules/lua-upstream.vim b/syntax/modules/lua-upstream.vim
new file mode 100644
index 00000000..cebee545
--- /dev/null
+++ b/syntax/modules/lua-upstream.vim
@@ -0,0 +1,7 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Lua Upstream Module <https://github.com/openresty/lua-upstream-nginx-module>
+" Nginx C module to expose Lua API to ngx_lua for Nginx upstreams
+
+
+endif
diff --git a/syntax/modules/lua.vim b/syntax/modules/lua.vim
new file mode 100644
index 00000000..2fbb2a61
--- /dev/null
+++ b/syntax/modules/lua.vim
@@ -0,0 +1,66 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Lua Module <https://github.com/openresty/lua-nginx-module>
+" Embed the Power of Lua into NGINX HTTP servers
+syn keyword ngxDirectiveThirdParty lua_use_default_type
+syn keyword ngxDirectiveThirdParty lua_code_cache
+syn keyword ngxDirectiveThirdParty lua_regex_cache_max_entries
+syn keyword ngxDirectiveThirdParty lua_regex_match_limit
+syn keyword ngxDirectiveThirdParty lua_package_path
+syn keyword ngxDirectiveThirdParty lua_package_cpath
+syn keyword ngxDirectiveThirdParty init_by_lua
+syn keyword ngxDirectiveThirdParty init_by_lua_block
+syn keyword ngxDirectiveThirdParty init_by_lua_file
+syn keyword ngxDirectiveThirdParty init_worker_by_lua
+syn keyword ngxDirectiveThirdParty init_worker_by_lua_block
+syn keyword ngxDirectiveThirdParty init_worker_by_lua_file
+syn keyword ngxDirectiveThirdParty set_by_lua
+syn keyword ngxDirectiveThirdParty set_by_lua_block
+syn keyword ngxDirectiveThirdParty set_by_lua_file
+syn keyword ngxDirectiveThirdParty content_by_lua
+syn keyword ngxDirectiveThirdParty content_by_lua_block
+syn keyword ngxDirectiveThirdParty content_by_lua_file
+syn keyword ngxDirectiveThirdParty rewrite_by_lua
+syn keyword ngxDirectiveThirdParty rewrite_by_lua_block
+syn keyword ngxDirectiveThirdParty rewrite_by_lua_file
+syn keyword ngxDirectiveThirdParty access_by_lua
+syn keyword ngxDirectiveThirdParty access_by_lua_block
+syn keyword ngxDirectiveThirdParty access_by_lua_file
+syn keyword ngxDirectiveThirdParty header_filter_by_lua
+syn keyword ngxDirectiveThirdParty header_filter_by_lua_block
+syn keyword ngxDirectiveThirdParty header_filter_by_lua_file
+syn keyword ngxDirectiveThirdParty body_filter_by_lua
+syn keyword ngxDirectiveThirdParty body_filter_by_lua_block
+syn keyword ngxDirectiveThirdParty body_filter_by_lua_file
+syn keyword ngxDirectiveThirdParty log_by_lua
+syn keyword ngxDirectiveThirdParty log_by_lua_block
+syn keyword ngxDirectiveThirdParty log_by_lua_file
+syn keyword ngxDirectiveThirdParty balancer_by_lua_block
+syn keyword ngxDirectiveThirdParty balancer_by_lua_file
+syn keyword ngxDirectiveThirdParty lua_need_request_body
+syn keyword ngxDirectiveThirdParty ssl_certificate_by_lua_block
+syn keyword ngxDirectiveThirdParty ssl_certificate_by_lua_file
+syn keyword ngxDirectiveThirdParty lua_shared_dict
+syn keyword ngxDirectiveThirdParty lua_socket_connect_timeout
+syn keyword ngxDirectiveThirdParty lua_socket_send_timeout
+syn keyword ngxDirectiveThirdParty lua_socket_send_lowat
+syn keyword ngxDirectiveThirdParty lua_socket_read_timeout
+syn keyword ngxDirectiveThirdParty lua_socket_buffer_size
+syn keyword ngxDirectiveThirdParty lua_socket_pool_size
+syn keyword ngxDirectiveThirdParty lua_socket_keepalive_timeout
+syn keyword ngxDirectiveThirdParty lua_socket_log_errors
+syn keyword ngxDirectiveThirdParty lua_ssl_ciphers
+syn keyword ngxDirectiveThirdParty lua_ssl_crl
+syn keyword ngxDirectiveThirdParty lua_ssl_protocols
+syn keyword ngxDirectiveThirdParty lua_ssl_trusted_certificate
+syn keyword ngxDirectiveThirdParty lua_ssl_verify_depth
+syn keyword ngxDirectiveThirdParty lua_http10_buffering
+syn keyword ngxDirectiveThirdParty rewrite_by_lua_no_postpone
+syn keyword ngxDirectiveThirdParty access_by_lua_no_postpone
+syn keyword ngxDirectiveThirdParty lua_transform_underscores_in_response_headers
+syn keyword ngxDirectiveThirdParty lua_check_client_abort
+syn keyword ngxDirectiveThirdParty lua_max_pending_timers
+syn keyword ngxDirectiveThirdParty lua_max_running_timers
+
+
+endif
diff --git a/syntax/modules/md5-filter.vim b/syntax/modules/md5-filter.vim
new file mode 100644
index 00000000..2d8df29d
--- /dev/null
+++ b/syntax/modules/md5-filter.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" MD5 Filter Module <https://github.com/kainswor/nginx_md5_filter>
+" A content filter for nginx, which returns the md5 hash of the content otherwise returned.
+syn keyword ngxDirectiveThirdParty md5_filter
+
+
+endif
diff --git a/syntax/modules/memc.vim b/syntax/modules/memc.vim
new file mode 100644
index 00000000..a448ae7b
--- /dev/null
+++ b/syntax/modules/memc.vim
@@ -0,0 +1,17 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Memc Module <https://github.com/openresty/memc-nginx-module>
+" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.
+syn keyword ngxDirectiveThirdParty memc_buffer_size
+syn keyword ngxDirectiveThirdParty memc_cmds_allowed
+syn keyword ngxDirectiveThirdParty memc_connect_timeout
+syn keyword ngxDirectiveThirdParty memc_flags_to_last_modified
+syn keyword ngxDirectiveThirdParty memc_next_upstream
+syn keyword ngxDirectiveThirdParty memc_pass
+syn keyword ngxDirectiveThirdParty memc_read_timeout
+syn keyword ngxDirectiveThirdParty memc_send_timeout
+syn keyword ngxDirectiveThirdParty memc_upstream_fail_timeout
+syn keyword ngxDirectiveThirdParty memc_upstream_max_fails
+
+
+endif
diff --git a/syntax/modules/mod-security.vim b/syntax/modules/mod-security.vim
new file mode 100644
index 00000000..0f1fa6fd
--- /dev/null
+++ b/syntax/modules/mod-security.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Mod Security Module <https://github.com/SpiderLabs/ModSecurity>
+" ModSecurity is an open source, cross platform web application firewall (WAF) engine
+syn keyword ngxDirectiveThirdParty ModSecurityConfig
+syn keyword ngxDirectiveThirdParty ModSecurityEnabled
+syn keyword ngxDirectiveThirdParty pool_context
+syn keyword ngxDirectiveThirdParty pool_context_hash_size
+
+
+endif
diff --git a/syntax/modules/mogilefs.vim b/syntax/modules/mogilefs.vim
new file mode 100644
index 00000000..340c60f5
--- /dev/null
+++ b/syntax/modules/mogilefs.vim
@@ -0,0 +1,15 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Mogilefs Module <http://www.grid.net.ru/nginx/mogilefs.en.html>
+" Implements a MogileFS client, provides a replace to the Perlbal reverse proxy of the original MogileFS.
+syn keyword ngxDirectiveThirdParty mogilefs_connect_timeout
+syn keyword ngxDirectiveThirdParty mogilefs_domain
+syn keyword ngxDirectiveThirdParty mogilefs_methods
+syn keyword ngxDirectiveThirdParty mogilefs_noverify
+syn keyword ngxDirectiveThirdParty mogilefs_pass
+syn keyword ngxDirectiveThirdParty mogilefs_read_timeout
+syn keyword ngxDirectiveThirdParty mogilefs_send_timeout
+syn keyword ngxDirectiveThirdParty mogilefs_tracker
+
+
+endif
diff --git a/syntax/modules/mongo.vim b/syntax/modules/mongo.vim
new file mode 100644
index 00000000..18bb0d31
--- /dev/null
+++ b/syntax/modules/mongo.vim
@@ -0,0 +1,20 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Mongo Module <https://github.com/simpl/ngx_mongo>
+" Upstream module that allows nginx to communicate directly with MongoDB database.
+syn keyword ngxDirectiveThirdParty mongo_auth
+syn keyword ngxDirectiveThirdParty mongo_pass
+syn keyword ngxDirectiveThirdParty mongo_query
+syn keyword ngxDirectiveThirdParty mongo_json
+syn keyword ngxDirectiveThirdParty mongo_bind
+syn keyword ngxDirectiveThirdParty mongo_connect_timeout
+syn keyword ngxDirectiveThirdParty mongo_send_timeout
+syn keyword ngxDirectiveThirdParty mongo_read_timeout
+syn keyword ngxDirectiveThirdParty mongo_buffering
+syn keyword ngxDirectiveThirdParty mongo_buffer_size
+syn keyword ngxDirectiveThirdParty mongo_buffers
+syn keyword ngxDirectiveThirdParty mongo_busy_buffers_size
+syn keyword ngxDirectiveThirdParty mongo_next_upstream
+
+
+endif
diff --git a/syntax/modules/mp4-streaming.vim b/syntax/modules/mp4-streaming.vim
new file mode 100644
index 00000000..1b7f417d
--- /dev/null
+++ b/syntax/modules/mp4-streaming.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" MP4 Streaming Lite Module <https://www.nginx.com/resources/wiki/modules/mp4_streaming/>
+" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL.
+syn keyword ngxDirectiveThirdParty mp4
+
+
+endif
diff --git a/syntax/modules/naxsi.vim b/syntax/modules/naxsi.vim
new file mode 100644
index 00000000..4c54a60c
--- /dev/null
+++ b/syntax/modules/naxsi.vim
@@ -0,0 +1,16 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" NAXSI Module <https://github.com/nbs-system/naxsi>
+" NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX
+syn keyword ngxDirectiveThirdParty DeniedUrl denied_url
+syn keyword ngxDirectiveThirdParty LearningMode learning_mode
+syn keyword ngxDirectiveThirdParty SecRulesEnabled rules_enabled
+syn keyword ngxDirectiveThirdParty SecRulesDisabled rules_disabled
+syn keyword ngxDirectiveThirdParty CheckRule check_rule
+syn keyword ngxDirectiveThirdParty BasicRule basic_rule
+syn keyword ngxDirectiveThirdParty MainRule main_rule
+syn keyword ngxDirectiveThirdParty LibInjectionSql libinjection_sql
+syn keyword ngxDirectiveThirdParty LibInjectionXss libinjection_xss
+
+
+endif
diff --git a/syntax/modules/notice.vim b/syntax/modules/notice.vim
new file mode 100644
index 00000000..db503143
--- /dev/null
+++ b/syntax/modules/notice.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Nginx Notice Module <https://github.com/kr/nginx-notice>
+" Serve static file to POST requests.
+syn keyword ngxDirectiveThirdParty notice
+syn keyword ngxDirectiveThirdParty notice_type
+
+
+endif
diff --git a/syntax/modules/ocsp-proxy.vim b/syntax/modules/ocsp-proxy.vim
new file mode 100644
index 00000000..8c1e54a8
--- /dev/null
+++ b/syntax/modules/ocsp-proxy.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" OCSP Proxy Module <https://github.com/kyprizel/nginx_ocsp_proxy-module>
+" Nginx OCSP processing module designed for response caching
+syn keyword ngxDirectiveThirdParty ocsp_proxy
+syn keyword ngxDirectiveThirdParty ocsp_cache_timeout
+
+
+endif
diff --git a/syntax/modules/openresty-eval.vim b/syntax/modules/openresty-eval.vim
new file mode 100644
index 00000000..3eb7f61f
--- /dev/null
+++ b/syntax/modules/openresty-eval.vim
@@ -0,0 +1,12 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Eval Module <https://github.com/openresty/nginx-eval-module>
+" Module for nginx web server evaluates response of proxy or memcached module into variables.
+syn keyword ngxDirectiveThirdParty eval
+syn keyword ngxDirectiveThirdParty eval_escalate
+syn keyword ngxDirectiveThirdParty eval_buffer_size
+syn keyword ngxDirectiveThirdParty eval_override_content_type
+syn keyword ngxDirectiveThirdParty eval_subrequest_in_memory
+
+
+endif
diff --git a/syntax/modules/openssl-version.vim b/syntax/modules/openssl-version.vim
new file mode 100644
index 00000000..58caffd2
--- /dev/null
+++ b/syntax/modules/openssl-version.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" OpenSSL Version Module <https://github.com/apcera/nginx-openssl-version>
+" Nginx OpenSSL version check at startup
+syn keyword ngxDirectiveThirdParty openssl_version_minimum
+syn keyword ngxDirectiveThirdParty openssl_builddate_minimum
+
+
+endif
diff --git a/syntax/modules/owner-match.vim b/syntax/modules/owner-match.vim
new file mode 100644
index 00000000..02103a62
--- /dev/null
+++ b/syntax/modules/owner-match.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Owner Match Module <https://www.nginx.com/resources/wiki/modules/owner_match/>
+" Control access for specific owners and groups of files
+syn keyword ngxDirectiveThirdParty omallow
+syn keyword ngxDirectiveThirdParty omdeny
+
+
+endif
diff --git a/syntax/modules/pagespeed.vim b/syntax/modules/pagespeed.vim
new file mode 100644
index 00000000..bea92ee8
--- /dev/null
+++ b/syntax/modules/pagespeed.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Accept Language Module <https://www.nginx.com/resources/wiki/modules/accept_language/>
+" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.
+syn keyword ngxDirectiveThirdParty pagespeed
+
+
+endif
diff --git a/syntax/modules/php-memcache-standard-balancer.vim b/syntax/modules/php-memcache-standard-balancer.vim
new file mode 100644
index 00000000..7f99ac4c
--- /dev/null
+++ b/syntax/modules/php-memcache-standard-balancer.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" PHP Memcache Standard Balancer Module <>
+" Loadbalancer that is compatible to the standard loadbalancer in the php-memcache module
+syn keyword ngxDirectiveThirdParty hash_key
+
+
+endif
diff --git a/syntax/modules/php-session.vim b/syntax/modules/php-session.vim
new file mode 100644
index 00000000..fd1a05f6
--- /dev/null
+++ b/syntax/modules/php-session.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" PHP Session Module <https://github.com/replay/ngx_http_php_session>
+" Nginx module to parse php sessions
+syn keyword ngxDirectiveThirdParty php_session_parse
+syn keyword ngxDirectiveThirdParty php_session_strip_formatting
+
+
+endif
diff --git a/syntax/modules/phusion-passenger.vim b/syntax/modules/phusion-passenger.vim
new file mode 100644
index 00000000..7285660f
--- /dev/null
+++ b/syntax/modules/phusion-passenger.vim
@@ -0,0 +1,23 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Phusion Passenger <https://www.phusionpassenger.com/>
+" Easy and robust deployment of Ruby on Rails application on Apache and Nginx webservers.
+syn keyword ngxDirectiveThirdParty passenger_base_uri
+syn keyword ngxDirectiveThirdParty passenger_default_user
+syn keyword ngxDirectiveThirdParty passenger_enabled
+syn keyword ngxDirectiveThirdParty passenger_log_level
+syn keyword ngxDirectiveThirdParty passenger_max_instances_per_app
+syn keyword ngxDirectiveThirdParty passenger_max_pool_size
+syn keyword ngxDirectiveThirdParty passenger_pool_idle_time
+syn keyword ngxDirectiveThirdParty passenger_root
+syn keyword ngxDirectiveThirdParty passenger_ruby
+syn keyword ngxDirectiveThirdParty passenger_use_global_queue
+syn keyword ngxDirectiveThirdParty passenger_user_switching
+syn keyword ngxDirectiveThirdParty rack_env
+syn keyword ngxDirectiveThirdParty rails_app_spawner_idle_time
+syn keyword ngxDirectiveThirdParty rails_env
+syn keyword ngxDirectiveThirdParty rails_framework_spawner_idle_time
+syn keyword ngxDirectiveThirdParty rails_spawn_method
+
+
+endif
diff --git a/syntax/modules/postgres.vim b/syntax/modules/postgres.vim
new file mode 100644
index 00000000..37cd901a
--- /dev/null
+++ b/syntax/modules/postgres.vim
@@ -0,0 +1,17 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Postgres Module <http://labs.frickle.com/nginx_ngx_postgres/>
+" Upstream module that allows nginx to communicate directly with PostgreSQL database.
+syn keyword ngxDirectiveThirdParty postgres_server
+syn keyword ngxDirectiveThirdParty postgres_keepalive
+syn keyword ngxDirectiveThirdParty postgres_pass
+syn keyword ngxDirectiveThirdParty postgres_query
+syn keyword ngxDirectiveThirdParty postgres_rewrite
+syn keyword ngxDirectiveThirdParty postgres_output
+syn keyword ngxDirectiveThirdParty postgres_set
+syn keyword ngxDirectiveThirdParty postgres_escape
+syn keyword ngxDirectiveThirdParty postgres_connect_timeout
+syn keyword ngxDirectiveThirdParty postgres_result_timeout
+
+
+endif
diff --git a/syntax/modules/pubcookie.vim b/syntax/modules/pubcookie.vim
new file mode 100644
index 00000000..7a9fc5bb
--- /dev/null
+++ b/syntax/modules/pubcookie.vim
@@ -0,0 +1,34 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Pubcookie Module <https://www.vanko.me/book/page/pubcookie-module-nginx>
+" Authorizes users using encrypted cookies
+syn keyword ngxDirectiveThirdParty pubcookie_inactive_expire
+syn keyword ngxDirectiveThirdParty pubcookie_hard_expire
+syn keyword ngxDirectiveThirdParty pubcookie_app_id
+syn keyword ngxDirectiveThirdParty pubcookie_dir_depth
+syn keyword ngxDirectiveThirdParty pubcookie_catenate_app_ids
+syn keyword ngxDirectiveThirdParty pubcookie_app_srv_id
+syn keyword ngxDirectiveThirdParty pubcookie_login
+syn keyword ngxDirectiveThirdParty pubcookie_login_method
+syn keyword ngxDirectiveThirdParty pubcookie_post
+syn keyword ngxDirectiveThirdParty pubcookie_domain
+syn keyword ngxDirectiveThirdParty pubcookie_granting_cert_file
+syn keyword ngxDirectiveThirdParty pubcookie_session_key_file
+syn keyword ngxDirectiveThirdParty pubcookie_session_cert_file
+syn keyword ngxDirectiveThirdParty pubcookie_crypt_key_file
+syn keyword ngxDirectiveThirdParty pubcookie_end_session
+syn keyword ngxDirectiveThirdParty pubcookie_encryption
+syn keyword ngxDirectiveThirdParty pubcookie_session_reauth
+syn keyword ngxDirectiveThirdParty pubcookie_auth_type_names
+syn keyword ngxDirectiveThirdParty pubcookie_no_prompt
+syn keyword ngxDirectiveThirdParty pubcookie_on_demand
+syn keyword ngxDirectiveThirdParty pubcookie_addl_request
+syn keyword ngxDirectiveThirdParty pubcookie_no_obscure_cookies
+syn keyword ngxDirectiveThirdParty pubcookie_no_clean_creds
+syn keyword ngxDirectiveThirdParty pubcookie_egd_device
+syn keyword ngxDirectiveThirdParty pubcookie_no_blank
+syn keyword ngxDirectiveThirdParty pubcookie_super_debug
+syn keyword ngxDirectiveThirdParty pubcookie_set_remote_user
+
+
+endif
diff --git a/syntax/modules/push-stream.vim b/syntax/modules/push-stream.vim
new file mode 100644
index 00000000..0ada17ac
--- /dev/null
+++ b/syntax/modules/push-stream.vim
@@ -0,0 +1,43 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Push Stream Module <https://github.com/wandenberg/nginx-push-stream-module>
+" A pure stream http push technology for your Nginx setup
+syn keyword ngxDirectiveThirdParty push_stream_channels_statistics
+syn keyword ngxDirectiveThirdParty push_stream_publisher
+syn keyword ngxDirectiveThirdParty push_stream_subscriber
+syn keyword ngxDirectiveThirdParty push_stream_shared_memory_size
+syn keyword ngxDirectiveThirdParty push_stream_channel_deleted_message_text
+syn keyword ngxDirectiveThirdParty push_stream_channel_inactivity_time
+syn keyword ngxDirectiveThirdParty push_stream_ping_message_text
+syn keyword ngxDirectiveThirdParty push_stream_timeout_with_body
+syn keyword ngxDirectiveThirdParty push_stream_message_ttl
+syn keyword ngxDirectiveThirdParty push_stream_max_subscribers_per_channel
+syn keyword ngxDirectiveThirdParty push_stream_max_messages_stored_per_channel
+syn keyword ngxDirectiveThirdParty push_stream_max_channel_id_length
+syn keyword ngxDirectiveThirdParty push_stream_max_number_of_channels
+syn keyword ngxDirectiveThirdParty push_stream_max_number_of_wildcard_channels
+syn keyword ngxDirectiveThirdParty push_stream_wildcard_channel_prefix
+syn keyword ngxDirectiveThirdParty push_stream_events_channel_id
+syn keyword ngxDirectiveThirdParty push_stream_channels_path
+syn keyword ngxDirectiveThirdParty push_stream_store_messages
+syn keyword ngxDirectiveThirdParty push_stream_channel_info_on_publish
+syn keyword ngxDirectiveThirdParty push_stream_authorized_channels_only
+syn keyword ngxDirectiveThirdParty push_stream_header_template_file
+syn keyword ngxDirectiveThirdParty push_stream_header_template
+syn keyword ngxDirectiveThirdParty push_stream_message_template
+syn keyword ngxDirectiveThirdParty push_stream_footer_template
+syn keyword ngxDirectiveThirdParty push_stream_wildcard_channel_max_qtd
+syn keyword ngxDirectiveThirdParty push_stream_ping_message_interval
+syn keyword ngxDirectiveThirdParty push_stream_subscriber_connection_ttl
+syn keyword ngxDirectiveThirdParty push_stream_longpolling_connection_ttl
+syn keyword ngxDirectiveThirdParty push_stream_websocket_allow_publish
+syn keyword ngxDirectiveThirdParty push_stream_last_received_message_time
+syn keyword ngxDirectiveThirdParty push_stream_last_received_message_tag
+syn keyword ngxDirectiveThirdParty push_stream_last_event_id
+syn keyword ngxDirectiveThirdParty push_stream_user_agent
+syn keyword ngxDirectiveThirdParty push_stream_padding_by_user_agent
+syn keyword ngxDirectiveThirdParty push_stream_allowed_origins
+syn keyword ngxDirectiveThirdParty push_stream_allow_connections_to_events_channel
+
+
+endif
diff --git a/syntax/modules/rdns.vim b/syntax/modules/rdns.vim
new file mode 100644
index 00000000..b4bab59d
--- /dev/null
+++ b/syntax/modules/rdns.vim
@@ -0,0 +1,10 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" rDNS Module <https://github.com/flant/nginx-http-rdns>
+" Make a reverse DNS (rDNS) lookup for incoming connection and provides simple access control of incoming hostname by allow/deny rules
+syn keyword ngxDirectiveThirdParty rdns
+syn keyword ngxDirectiveThirdParty rdns_allow
+syn keyword ngxDirectiveThirdParty rdns_deny
+
+
+endif
diff --git a/syntax/modules/rds-csv.vim b/syntax/modules/rds-csv.vim
new file mode 100644
index 00000000..fb8eef51
--- /dev/null
+++ b/syntax/modules/rds-csv.vim
@@ -0,0 +1,13 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" RDS CSV Module <https://github.com/openresty/rds-csv-nginx-module>
+" Nginx output filter module to convert Resty-DBD-Streams (RDS) to Comma-Separated Values (CSV)
+syn keyword ngxDirectiveThirdParty rds_csv
+syn keyword ngxDirectiveThirdParty rds_csv_row_terminator
+syn keyword ngxDirectiveThirdParty rds_csv_field_separator
+syn keyword ngxDirectiveThirdParty rds_csv_field_name_header
+syn keyword ngxDirectiveThirdParty rds_csv_content_type
+syn keyword ngxDirectiveThirdParty rds_csv_buffer_size
+
+
+endif
diff --git a/syntax/modules/rds-json.vim b/syntax/modules/rds-json.vim
new file mode 100644
index 00000000..81854e33
--- /dev/null
+++ b/syntax/modules/rds-json.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" RDS JSON Module <https://github.com/openresty/rds-json-nginx-module>
+" Help ngx_drizzle and other DBD modules emit JSON data.
+syn keyword ngxDirectiveThirdParty rds_json
+syn keyword ngxDirectiveThirdParty rds_json_content_type
+syn keyword ngxDirectiveThirdParty rds_json_format
+syn keyword ngxDirectiveThirdParty rds_json_ret
+
+
+endif
diff --git a/syntax/modules/redis2.vim b/syntax/modules/redis2.vim
new file mode 100644
index 00000000..acd547d2
--- /dev/null
+++ b/syntax/modules/redis2.vim
@@ -0,0 +1,17 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Redis 2 Module <https://github.com/openresty/redis2-nginx-module>
+" Nginx upstream module for the Redis 2.0 protocol
+syn keyword ngxDirectiveThirdParty redis2_query
+syn keyword ngxDirectiveThirdParty redis2_raw_query
+syn keyword ngxDirectiveThirdParty redis2_raw_queries
+syn keyword ngxDirectiveThirdParty redis2_literal_raw_query
+syn keyword ngxDirectiveThirdParty redis2_pass
+syn keyword ngxDirectiveThirdParty redis2_connect_timeout
+syn keyword ngxDirectiveThirdParty redis2_send_timeout
+syn keyword ngxDirectiveThirdParty redis2_read_timeout
+syn keyword ngxDirectiveThirdParty redis2_buffer_size
+syn keyword ngxDirectiveThirdParty redis2_next_upstream
+
+
+endif
diff --git a/syntax/modules/replace-filter.vim b/syntax/modules/replace-filter.vim
new file mode 100644
index 00000000..b41f1055
--- /dev/null
+++ b/syntax/modules/replace-filter.vim
@@ -0,0 +1,12 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Replace Filter Module <https://github.com/openresty/replace-filter-nginx-module>
+" Streaming regular expression replacement in response bodies
+syn keyword ngxDirectiveThirdParty replace_filter
+syn keyword ngxDirectiveThirdParty replace_filter_types
+syn keyword ngxDirectiveThirdParty replace_filter_max_buffered_size
+syn keyword ngxDirectiveThirdParty replace_filter_last_modified
+syn keyword ngxDirectiveThirdParty replace_filter_skip
+
+
+endif
diff --git a/syntax/modules/roboo.vim b/syntax/modules/roboo.vim
new file mode 100644
index 00000000..cefea1fc
--- /dev/null
+++ b/syntax/modules/roboo.vim
@@ -0,0 +1,7 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Roboo Module <https://github.com/yuri-gushin/Roboo>
+" HTTP Robot Mitigator
+
+
+endif
diff --git a/syntax/modules/rrd-graph.vim b/syntax/modules/rrd-graph.vim
new file mode 100644
index 00000000..d01a4623
--- /dev/null
+++ b/syntax/modules/rrd-graph.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" RRD Graph Module <https://www.nginx.com/resources/wiki/modules/rrd_graph/>
+" This module provides an HTTP interface to RRDtool's graphing facilities.
+syn keyword ngxDirectiveThirdParty rrd_graph
+syn keyword ngxDirectiveThirdParty rrd_graph_root
+
+
+endif
diff --git a/syntax/modules/rtmp.vim b/syntax/modules/rtmp.vim
new file mode 100644
index 00000000..94812d41
--- /dev/null
+++ b/syntax/modules/rtmp.vim
@@ -0,0 +1,108 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" RTMP Module <https://github.com/arut/nginx-rtmp-module>
+" NGINX-based Media Streaming Server
+syn keyword ngxDirectiveThirdParty rtmp
+syn keyword ngxDirectiveThirdParty server
+syn keyword ngxDirectiveThirdParty listen
+syn keyword ngxDirectiveThirdParty application
+syn keyword ngxDirectiveThirdParty timeout
+syn keyword ngxDirectiveThirdParty ping
+syn keyword ngxDirectiveThirdParty ping_timeout
+syn keyword ngxDirectiveThirdParty max_streams
+syn keyword ngxDirectiveThirdParty ack_window
+syn keyword ngxDirectiveThirdParty chunk_size
+syn keyword ngxDirectiveThirdParty max_queue
+syn keyword ngxDirectiveThirdParty max_message
+syn keyword ngxDirectiveThirdParty out_queue
+syn keyword ngxDirectiveThirdParty out_cork
+syn keyword ngxDirectiveThirdParty allow
+syn keyword ngxDirectiveThirdParty deny
+syn keyword ngxDirectiveThirdParty exec_push
+syn keyword ngxDirectiveThirdParty exec_pull
+syn keyword ngxDirectiveThirdParty exec
+syn keyword ngxDirectiveThirdParty exec_options
+syn keyword ngxDirectiveThirdParty exec_static
+syn keyword ngxDirectiveThirdParty exec_kill_signal
+syn keyword ngxDirectiveThirdParty respawn
+syn keyword ngxDirectiveThirdParty respawn_timeout
+syn keyword ngxDirectiveThirdParty exec_publish
+syn keyword ngxDirectiveThirdParty exec_play
+syn keyword ngxDirectiveThirdParty exec_play_done
+syn keyword ngxDirectiveThirdParty exec_publish_done
+syn keyword ngxDirectiveThirdParty exec_record_done
+syn keyword ngxDirectiveThirdParty live
+syn keyword ngxDirectiveThirdParty meta
+syn keyword ngxDirectiveThirdParty interleave
+syn keyword ngxDirectiveThirdParty wait_key
+syn keyword ngxDirectiveThirdParty wait_video
+syn keyword ngxDirectiveThirdParty publish_notify
+syn keyword ngxDirectiveThirdParty drop_idle_publisher
+syn keyword ngxDirectiveThirdParty sync
+syn keyword ngxDirectiveThirdParty play_restart
+syn keyword ngxDirectiveThirdParty idle_streams
+syn keyword ngxDirectiveThirdParty record
+syn keyword ngxDirectiveThirdParty record_path
+syn keyword ngxDirectiveThirdParty record_suffix
+syn keyword ngxDirectiveThirdParty record_unique
+syn keyword ngxDirectiveThirdParty record_append
+syn keyword ngxDirectiveThirdParty record_lock
+syn keyword ngxDirectiveThirdParty record_max_size
+syn keyword ngxDirectiveThirdParty record_max_frames
+syn keyword ngxDirectiveThirdParty record_interval
+syn keyword ngxDirectiveThirdParty recorder
+syn keyword ngxDirectiveThirdParty record_notify
+syn keyword ngxDirectiveThirdParty play
+syn keyword ngxDirectiveThirdParty play_temp_path
+syn keyword ngxDirectiveThirdParty play_local_path
+syn keyword ngxDirectiveThirdParty pull
+syn keyword ngxDirectiveThirdParty push
+syn keyword ngxDirectiveThirdParty push_reconnect
+syn keyword ngxDirectiveThirdParty session_relay
+syn keyword ngxDirectiveThirdParty on_connect
+syn keyword ngxDirectiveThirdParty on_play
+syn keyword ngxDirectiveThirdParty on_publish
+syn keyword ngxDirectiveThirdParty on_done
+syn keyword ngxDirectiveThirdParty on_play_done
+syn keyword ngxDirectiveThirdParty on_publish_done
+syn keyword ngxDirectiveThirdParty on_record_done
+syn keyword ngxDirectiveThirdParty on_update
+syn keyword ngxDirectiveThirdParty notify_update_timeout
+syn keyword ngxDirectiveThirdParty notify_update_strict
+syn keyword ngxDirectiveThirdParty notify_relay_redirect
+syn keyword ngxDirectiveThirdParty notify_method
+syn keyword ngxDirectiveThirdParty hls
+syn keyword ngxDirectiveThirdParty hls_path
+syn keyword ngxDirectiveThirdParty hls_fragment
+syn keyword ngxDirectiveThirdParty hls_playlist_length
+syn keyword ngxDirectiveThirdParty hls_sync
+syn keyword ngxDirectiveThirdParty hls_continuous
+syn keyword ngxDirectiveThirdParty hls_nested
+syn keyword ngxDirectiveThirdParty hls_base_url
+syn keyword ngxDirectiveThirdParty hls_cleanup
+syn keyword ngxDirectiveThirdParty hls_fragment_naming
+syn keyword ngxDirectiveThirdParty hls_fragment_slicing
+syn keyword ngxDirectiveThirdParty hls_variant
+syn keyword ngxDirectiveThirdParty hls_type
+syn keyword ngxDirectiveThirdParty hls_keys
+syn keyword ngxDirectiveThirdParty hls_key_path
+syn keyword ngxDirectiveThirdParty hls_key_url
+syn keyword ngxDirectiveThirdParty hls_fragments_per_key
+syn keyword ngxDirectiveThirdParty dash
+syn keyword ngxDirectiveThirdParty dash_path
+syn keyword ngxDirectiveThirdParty dash_fragment
+syn keyword ngxDirectiveThirdParty dash_playlist_length
+syn keyword ngxDirectiveThirdParty dash_nested
+syn keyword ngxDirectiveThirdParty dash_cleanup
+syn keyword ngxDirectiveThirdParty access_log
+syn keyword ngxDirectiveThirdParty log_format
+syn keyword ngxDirectiveThirdParty max_connections
+syn keyword ngxDirectiveThirdParty rtmp_stat
+syn keyword ngxDirectiveThirdParty rtmp_stat_stylesheet
+syn keyword ngxDirectiveThirdParty rtmp_auto_push
+syn keyword ngxDirectiveThirdParty rtmp_auto_push_reconnect
+syn keyword ngxDirectiveThirdParty rtmp_socket_dir
+syn keyword ngxDirectiveThirdParty rtmp_control
+
+
+endif
diff --git a/syntax/modules/rtmpt-proxy.vim b/syntax/modules/rtmpt-proxy.vim
new file mode 100644
index 00000000..4dd066b8
--- /dev/null
+++ b/syntax/modules/rtmpt-proxy.vim
@@ -0,0 +1,12 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" RTMPT Module <https://github.com/kwojtek/nginx-rtmpt-proxy-module>
+" Module for nginx to proxy rtmp using http protocol
+syn keyword ngxDirectiveThirdParty rtmpt_proxy_target
+syn keyword ngxDirectiveThirdParty rtmpt_proxy_rtmp_timeout
+syn keyword ngxDirectiveThirdParty rtmpt_proxy_http_timeout
+syn keyword ngxDirectiveThirdParty rtmpt_proxy
+syn keyword ngxDirectiveThirdParty rtmpt_proxy_stat
+syn keyword ngxDirectiveThirdParty rtmpt_proxy_stylesheet
+
+endif
diff --git a/syntax/modules/sass.vim b/syntax/modules/sass.vim
new file mode 100644
index 00000000..397b74f6
--- /dev/null
+++ b/syntax/modules/sass.vim
@@ -0,0 +1,17 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Syntactically Awesome Module <https://github.com/mneudert/sass-nginx-module>
+" Providing on-the-fly compiling of Sass files as an NGINX module.
+syn keyword ngxDirectiveThirdParty sass_compile
+syn keyword ngxDirectiveThirdParty sass_error_log
+syn keyword ngxDirectiveThirdParty sass_include_path
+syn keyword ngxDirectiveThirdParty sass_indent
+syn keyword ngxDirectiveThirdParty sass_is_indented_syntax
+syn keyword ngxDirectiveThirdParty sass_linefeed
+syn keyword ngxDirectiveThirdParty sass_precision
+syn keyword ngxDirectiveThirdParty sass_output_style
+syn keyword ngxDirectiveThirdParty sass_source_comments
+syn keyword ngxDirectiveThirdParty sass_source_map_embed
+
+
+endif
diff --git a/syntax/modules/secure-download.vim b/syntax/modules/secure-download.vim
new file mode 100644
index 00000000..67622140
--- /dev/null
+++ b/syntax/modules/secure-download.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Secure Download <https://www.nginx.com/resources/wiki/modules/secure_download/>
+" Create expiring links.
+syn keyword ngxDirectiveThirdParty secure_download
+syn keyword ngxDirectiveThirdParty secure_download_fail_location
+syn keyword ngxDirectiveThirdParty secure_download_path_mode
+syn keyword ngxDirectiveThirdParty secure_download_secret
+
+
+endif
diff --git a/syntax/modules/selective-cache-purge.vim b/syntax/modules/selective-cache-purge.vim
new file mode 100644
index 00000000..d67d9727
--- /dev/null
+++ b/syntax/modules/selective-cache-purge.vim
@@ -0,0 +1,12 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Selective Cache Purge Module <https://github.com/wandenberg/nginx-selective-cache-purge-module>
+" A module to purge cache by GLOB patterns. The supported patterns are the same as supported by Redis.
+syn keyword ngxDirectiveThirdParty selective_cache_purge_redis_unix_socket
+syn keyword ngxDirectiveThirdParty selective_cache_purge_redis_host
+syn keyword ngxDirectiveThirdParty selective_cache_purge_redis_port
+syn keyword ngxDirectiveThirdParty selective_cache_purge_redis_database
+syn keyword ngxDirectiveThirdParty selective_cache_purge_query
+
+
+endif
diff --git a/syntax/modules/set-cconv.vim b/syntax/modules/set-cconv.vim
new file mode 100644
index 00000000..4b6c4c56
--- /dev/null
+++ b/syntax/modules/set-cconv.vim
@@ -0,0 +1,10 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Set cconv Module <https://github.com/liseen/set-cconv-nginx-module>
+" Cconv rewrite set commands
+syn keyword ngxDirectiveThirdParty set_cconv_to_simp
+syn keyword ngxDirectiveThirdParty set_cconv_to_trad
+syn keyword ngxDirectiveThirdParty set_pinyin_to_normal
+
+
+endif
diff --git a/syntax/modules/set-hash.vim b/syntax/modules/set-hash.vim
new file mode 100644
index 00000000..0c2d7d78
--- /dev/null
+++ b/syntax/modules/set-hash.vim
@@ -0,0 +1,13 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Set Hash Module <https://github.com/simpl/ngx_http_set_hash>
+" Nginx module that allows the setting of variables to the value of a variety of hashes
+syn keyword ngxDirectiveThirdParty set_md5
+syn keyword ngxDirectiveThirdParty set_md5_upper
+syn keyword ngxDirectiveThirdParty set_murmur2
+syn keyword ngxDirectiveThirdParty set_murmur2_upper
+syn keyword ngxDirectiveThirdParty set_sha1
+syn keyword ngxDirectiveThirdParty set_sha1_upper
+
+
+endif
diff --git a/syntax/modules/set-lang.vim b/syntax/modules/set-lang.vim
new file mode 100644
index 00000000..e35e577d
--- /dev/null
+++ b/syntax/modules/set-lang.vim
@@ -0,0 +1,15 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Set Lang Module <https://github.com/simpl/ngx_http_set_lang>
+" Provides a variety of ways for setting a variable denoting the langauge that content should be returned in.
+syn keyword ngxDirectiveThirdParty set_lang
+syn keyword ngxDirectiveThirdParty set_lang_method
+syn keyword ngxDirectiveThirdParty lang_cookie
+syn keyword ngxDirectiveThirdParty lang_get_var
+syn keyword ngxDirectiveThirdParty lang_list
+syn keyword ngxDirectiveThirdParty lang_post_var
+syn keyword ngxDirectiveThirdParty lang_host
+syn keyword ngxDirectiveThirdParty lang_referer
+
+
+endif
diff --git a/syntax/modules/set-misc.vim b/syntax/modules/set-misc.vim
new file mode 100644
index 00000000..18ca6753
--- /dev/null
+++ b/syntax/modules/set-misc.vim
@@ -0,0 +1,33 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Set Misc Module <https://github.com/openresty/set-misc-nginx-module>
+" Various set_xxx directives added to nginx's rewrite module
+syn keyword ngxDirectiveThirdParty set_if_empty
+syn keyword ngxDirectiveThirdParty set_quote_sql_str
+syn keyword ngxDirectiveThirdParty set_quote_pgsql_str
+syn keyword ngxDirectiveThirdParty set_quote_json_str
+syn keyword ngxDirectiveThirdParty set_unescape_uri
+syn keyword ngxDirectiveThirdParty set_escape_uri
+syn keyword ngxDirectiveThirdParty set_hashed_upstream
+syn keyword ngxDirectiveThirdParty set_encode_base32
+syn keyword ngxDirectiveThirdParty set_base32_padding
+syn keyword ngxDirectiveThirdParty set_misc_base32_padding
+syn keyword ngxDirectiveThirdParty set_base32_alphabet
+syn keyword ngxDirectiveThirdParty set_decode_base32
+syn keyword ngxDirectiveThirdParty set_encode_base64
+syn keyword ngxDirectiveThirdParty set_decode_base64
+syn keyword ngxDirectiveThirdParty set_encode_hex
+syn keyword ngxDirectiveThirdParty set_decode_hex
+syn keyword ngxDirectiveThirdParty set_sha1
+syn keyword ngxDirectiveThirdParty set_md5
+syn keyword ngxDirectiveThirdParty set_hmac_sha1
+syn keyword ngxDirectiveThirdParty set_random
+syn keyword ngxDirectiveThirdParty set_secure_random_alphanum
+syn keyword ngxDirectiveThirdParty set_secure_random_lcalpha
+syn keyword ngxDirectiveThirdParty set_rotate
+syn keyword ngxDirectiveThirdParty set_local_today
+syn keyword ngxDirectiveThirdParty set_formatted_gmt_time
+syn keyword ngxDirectiveThirdParty set_formatted_local_time
+
+
+endif
diff --git a/syntax/modules/sflow.vim b/syntax/modules/sflow.vim
new file mode 100644
index 00000000..21d66e9a
--- /dev/null
+++ b/syntax/modules/sflow.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" SFlow Module <https://github.com/sflow/nginx-sflow-module>
+" A binary, random-sampling nginx module designed for: lightweight, centralized, continuous, real-time monitoring of very large and very busy web farms.
+syn keyword ngxDirectiveThirdParty sflow
+
+
+endif
diff --git a/syntax/modules/shibboleth.vim b/syntax/modules/shibboleth.vim
new file mode 100644
index 00000000..77863eb8
--- /dev/null
+++ b/syntax/modules/shibboleth.vim
@@ -0,0 +1,10 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Shibboleth Module <https://github.com/nginx-shib/nginx-http-shibboleth>
+" Shibboleth auth request module for nginx
+syn keyword ngxDirectiveThirdParty shib_request
+syn keyword ngxDirectiveThirdParty shib_request_set
+syn keyword ngxDirectiveThirdParty shib_request_use_headers
+
+
+endif
diff --git a/syntax/modules/slice.vim b/syntax/modules/slice.vim
new file mode 100644
index 00000000..75a935d7
--- /dev/null
+++ b/syntax/modules/slice.vim
@@ -0,0 +1,14 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Slice Module <https://github.com/alibaba/nginx-http-slice>
+" Nginx module for serving a file in slices (reverse byte-range)
+syn keyword ngxDirectiveThirdParty slice
+syn keyword ngxDirectiveThirdParty slice_arg_begin
+syn keyword ngxDirectiveThirdParty slice_arg_end
+syn keyword ngxDirectiveThirdParty slice_header
+syn keyword ngxDirectiveThirdParty slice_footer
+syn keyword ngxDirectiveThirdParty slice_header_first
+syn keyword ngxDirectiveThirdParty slice_footer_last
+
+
+endif
diff --git a/syntax/modules/slowfs.vim b/syntax/modules/slowfs.vim
new file mode 100644
index 00000000..dbd4e162
--- /dev/null
+++ b/syntax/modules/slowfs.vim
@@ -0,0 +1,15 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" SlowFS Cache Module <https://github.com/FRiCKLE/ngx_slowfs_cache/>
+" Module adding ability to cache static files.
+syn keyword ngxDirectiveThirdParty slowfs_big_file_size
+syn keyword ngxDirectiveThirdParty slowfs_cache
+syn keyword ngxDirectiveThirdParty slowfs_cache_key
+syn keyword ngxDirectiveThirdParty slowfs_cache_min_uses
+syn keyword ngxDirectiveThirdParty slowfs_cache_path
+syn keyword ngxDirectiveThirdParty slowfs_cache_purge
+syn keyword ngxDirectiveThirdParty slowfs_cache_valid
+syn keyword ngxDirectiveThirdParty slowfs_temp_path
+
+
+endif
diff --git a/syntax/modules/small-light.vim b/syntax/modules/small-light.vim
new file mode 100644
index 00000000..83562b7c
--- /dev/null
+++ b/syntax/modules/small-light.vim
@@ -0,0 +1,15 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Small Light Module <https://github.com/cubicdaiya/ngx_small_light>
+" Dynamic Image Transformation Module For nginx.
+syn keyword ngxDirectiveThirdParty small_light
+syn keyword ngxDirectiveThirdParty small_light_getparam_mode
+syn keyword ngxDirectiveThirdParty small_light_material_dir
+syn keyword ngxDirectiveThirdParty small_light_pattern_define
+syn keyword ngxDirectiveThirdParty small_light_radius_max
+syn keyword ngxDirectiveThirdParty small_light_sigma_max
+syn keyword ngxDirectiveThirdParty small_light_imlib2_temp_dir
+syn keyword ngxDirectiveThirdParty small_light_buffer
+
+
+endif
diff --git a/syntax/modules/sorted-querystring-filter.vim b/syntax/modules/sorted-querystring-filter.vim
new file mode 100644
index 00000000..c3b4116e
--- /dev/null
+++ b/syntax/modules/sorted-querystring-filter.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Sorted Querystring Filter Module <https://github.com/wandenberg/nginx-sorted-querystring-module>
+" Nginx module to expose querystring parameters sorted in a variable to be used on cache_key as example
+syn keyword ngxDirectiveThirdParty sorted_querystring_filter_parameter
+
+
+endif
diff --git a/syntax/modules/sphinx2.vim b/syntax/modules/sphinx2.vim
new file mode 100644
index 00000000..ff737113
--- /dev/null
+++ b/syntax/modules/sphinx2.vim
@@ -0,0 +1,14 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Sphinx2 Module <https://github.com/reeteshranjan/sphinx2-nginx-module>
+" Nginx upstream module for Sphinx 2.x
+syn keyword ngxDirectiveThirdParty sphinx2_pass
+syn keyword ngxDirectiveThirdParty sphinx2_bind
+syn keyword ngxDirectiveThirdParty sphinx2_connect_timeout
+syn keyword ngxDirectiveThirdParty sphinx2_send_timeout
+syn keyword ngxDirectiveThirdParty sphinx2_buffer_size
+syn keyword ngxDirectiveThirdParty sphinx2_read_timeout
+syn keyword ngxDirectiveThirdParty sphinx2_next_upstream
+
+
+endif
diff --git a/syntax/modules/spnego-auth.vim b/syntax/modules/spnego-auth.vim
new file mode 100644
index 00000000..d247b4f4
--- /dev/null
+++ b/syntax/modules/spnego-auth.vim
@@ -0,0 +1,13 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" HTTP SPNEGO auth Module <https://github.com/stnoonan/spnego-http-auth-nginx-module>
+" This module implements adds SPNEGO support to nginx(http://nginx.org). It currently supports only Kerberos authentication via GSSAPI
+syn keyword ngxDirectiveThirdParty auth_gss
+syn keyword ngxDirectiveThirdParty auth_gss_keytab
+syn keyword ngxDirectiveThirdParty auth_gss_realm
+syn keyword ngxDirectiveThirdParty auth_gss_service_name
+syn keyword ngxDirectiveThirdParty auth_gss_authorized_principal
+syn keyword ngxDirectiveThirdParty auth_gss_allow_basic_fallback
+
+
+endif
diff --git a/syntax/modules/srcache.vim b/syntax/modules/srcache.vim
new file mode 100644
index 00000000..93eca3d9
--- /dev/null
+++ b/syntax/modules/srcache.vim
@@ -0,0 +1,26 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" SR Cache Module <https://github.com/openresty/srcache-nginx-module>
+" Transparent subrequest-based caching layout for arbitrary nginx locations
+syn keyword ngxDirectiveThirdParty srcache_fetch
+syn keyword ngxDirectiveThirdParty srcache_fetch_skip
+syn keyword ngxDirectiveThirdParty srcache_store
+syn keyword ngxDirectiveThirdParty srcache_store_max_size
+syn keyword ngxDirectiveThirdParty srcache_store_skip
+syn keyword ngxDirectiveThirdParty srcache_store_statuses
+syn keyword ngxDirectiveThirdParty srcache_store_ranges
+syn keyword ngxDirectiveThirdParty srcache_header_buffer_size
+syn keyword ngxDirectiveThirdParty srcache_store_hide_header
+syn keyword ngxDirectiveThirdParty srcache_store_pass_header
+syn keyword ngxDirectiveThirdParty srcache_methods
+syn keyword ngxDirectiveThirdParty srcache_ignore_content_encoding
+syn keyword ngxDirectiveThirdParty srcache_request_cache_control
+syn keyword ngxDirectiveThirdParty srcache_response_cache_control
+syn keyword ngxDirectiveThirdParty srcache_store_no_store
+syn keyword ngxDirectiveThirdParty srcache_store_no_cache
+syn keyword ngxDirectiveThirdParty srcache_store_private
+syn keyword ngxDirectiveThirdParty srcache_default_expire
+syn keyword ngxDirectiveThirdParty srcache_max_expire
+
+
+endif
diff --git a/syntax/modules/sssd-info.vim b/syntax/modules/sssd-info.vim
new file mode 100644
index 00000000..150944fe
--- /dev/null
+++ b/syntax/modules/sssd-info.vim
@@ -0,0 +1,15 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" SSSD Info Module <https://github.com/veruu/ngx_sssd_info>
+" Retrives additional attributes from SSSD for current authentizated user
+syn keyword ngxDirectiveThirdParty sssd_info
+syn keyword ngxDirectiveThirdParty sssd_info_output_to
+syn keyword ngxDirectiveThirdParty sssd_info_groups
+syn keyword ngxDirectiveThirdParty sssd_info_group
+syn keyword ngxDirectiveThirdParty sssd_info_group_separator
+syn keyword ngxDirectiveThirdParty sssd_info_attributes
+syn keyword ngxDirectiveThirdParty sssd_info_attribute
+syn keyword ngxDirectiveThirdParty sssd_info_attribute_separator
+
+
+endif
diff --git a/syntax/modules/static-etags.vim b/syntax/modules/static-etags.vim
new file mode 100644
index 00000000..dcaebac1
--- /dev/null
+++ b/syntax/modules/static-etags.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Static Etags Module <https://github.com/mikewest/nginx-static-etags>
+" Generate etags for static content
+syn keyword ngxDirectiveThirdParty FileETag
+
+
+endif
diff --git a/syntax/modules/statsd.vim b/syntax/modules/statsd.vim
new file mode 100644
index 00000000..358d0682
--- /dev/null
+++ b/syntax/modules/statsd.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Statsd Module <https://github.com/zebrafishlabs/nginx-statsd>
+" An nginx module for sending statistics to statsd
+syn keyword ngxDirectiveThirdParty statsd_server
+syn keyword ngxDirectiveThirdParty statsd_sample_rate
+syn keyword ngxDirectiveThirdParty statsd_count
+syn keyword ngxDirectiveThirdParty statsd_timing
+
+
+endif
diff --git a/syntax/modules/sticky.vim b/syntax/modules/sticky.vim
new file mode 100644
index 00000000..1bdc5382
--- /dev/null
+++ b/syntax/modules/sticky.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Sticky Module <https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng>
+" Add a sticky cookie to be always forwarded to the same upstream server
+syn keyword ngxDirectiveThirdParty sticky
+
+
+endif
diff --git a/syntax/modules/stream-echo.vim b/syntax/modules/stream-echo.vim
new file mode 100644
index 00000000..1ca57ad8
--- /dev/null
+++ b/syntax/modules/stream-echo.vim
@@ -0,0 +1,22 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Stream Echo Module <https://github.com/openresty/stream-echo-nginx-module>
+" TCP/stream echo module for NGINX (a port of ngx_http_echo_module)
+syn keyword ngxDirectiveThirdParty echo
+syn keyword ngxDirectiveThirdParty echo_duplicate
+syn keyword ngxDirectiveThirdParty echo_flush_wait
+syn keyword ngxDirectiveThirdParty echo_sleep
+syn keyword ngxDirectiveThirdParty echo_send_timeout
+syn keyword ngxDirectiveThirdParty echo_read_bytes
+syn keyword ngxDirectiveThirdParty echo_read_line
+syn keyword ngxDirectiveThirdParty echo_request_data
+syn keyword ngxDirectiveThirdParty echo_discard_request
+syn keyword ngxDirectiveThirdParty echo_read_buffer_size
+syn keyword ngxDirectiveThirdParty echo_read_timeout
+syn keyword ngxDirectiveThirdParty echo_client_error_log_level
+syn keyword ngxDirectiveThirdParty echo_lingering_close
+syn keyword ngxDirectiveThirdParty echo_lingering_time
+syn keyword ngxDirectiveThirdParty echo_lingering_timeout
+
+
+endif
diff --git a/syntax/modules/stream-lua.vim b/syntax/modules/stream-lua.vim
new file mode 100644
index 00000000..1e51ac92
--- /dev/null
+++ b/syntax/modules/stream-lua.vim
@@ -0,0 +1,12 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Stream Lua Module <https://github.com/openresty/stream-lua-nginx-module>
+" Embed the power of Lua into Nginx stream/TCP Servers.
+syn keyword ngxDirectiveThirdParty lua_resolver
+syn keyword ngxDirectiveThirdParty lua_resolver_timeout
+syn keyword ngxDirectiveThirdParty lua_lingering_close
+syn keyword ngxDirectiveThirdParty lua_lingering_time
+syn keyword ngxDirectiveThirdParty lua_lingering_timeout
+
+
+endif
diff --git a/syntax/modules/stream-upsync.vim b/syntax/modules/stream-upsync.vim
new file mode 100644
index 00000000..2769f871
--- /dev/null
+++ b/syntax/modules/stream-upsync.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Stream Upsync Module <https://github.com/xiaokai-wang/nginx-stream-upsync-module>
+" Sync upstreams from consul or others, dynamiclly modify backend-servers attribute(weight, max_fails,...), needn't reload nginx.
+syn keyword ngxDirectiveThirdParty upsync
+syn keyword ngxDirectiveThirdParty upsync_dump_path
+syn keyword ngxDirectiveThirdParty upsync_lb
+syn keyword ngxDirectiveThirdParty upsync_show
+
+
+endif
diff --git a/syntax/modules/strip.vim b/syntax/modules/strip.vim
new file mode 100644
index 00000000..aceb3a25
--- /dev/null
+++ b/syntax/modules/strip.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Strip Module <https://github.com/evanmiller/mod_strip>
+" Whitespace remover.
+syn keyword ngxDirectiveThirdParty strip
+
+
+endif
diff --git a/syntax/modules/subrange.vim b/syntax/modules/subrange.vim
new file mode 100644
index 00000000..9f1d0456
--- /dev/null
+++ b/syntax/modules/subrange.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Subrange Module <https://github.com/Qihoo360/ngx_http_subrange_module>
+" Split one big HTTP/Range request to multiple subrange requesets
+syn keyword ngxDirectiveThirdParty subrange
+
+
+endif
diff --git a/syntax/modules/substitutions.vim b/syntax/modules/substitutions.vim
new file mode 100644
index 00000000..f3263b98
--- /dev/null
+++ b/syntax/modules/substitutions.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Substitutions Module <https://www.nginx.com/resources/wiki/modules/substitutions/>
+" A filter module which can do both regular expression and fixed string substitutions on response bodies.
+syn keyword ngxDirectiveThirdParty subs_filter
+syn keyword ngxDirectiveThirdParty subs_filter_types
+
+
+endif
diff --git a/syntax/modules/summarizer.vim b/syntax/modules/summarizer.vim
new file mode 100644
index 00000000..574cda8a
--- /dev/null
+++ b/syntax/modules/summarizer.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Summarizer Module <https://github.com/reeteshranjan/summarizer-nginx-module>
+" Upstream nginx module to get summaries of documents using the summarizer daemon service
+syn keyword ngxDirectiveThirdParty smrzr_filename
+syn keyword ngxDirectiveThirdParty smrzr_ratio
+
+
+endif
diff --git a/syntax/modules/supervisord.vim b/syntax/modules/supervisord.vim
new file mode 100644
index 00000000..b4a2a349
--- /dev/null
+++ b/syntax/modules/supervisord.vim
@@ -0,0 +1,12 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Supervisord Module <https://github.com/FRiCKLE/ngx_supervisord/>
+" Module providing nginx with API to communicate with supervisord and manage (start/stop) backends on-demand.
+syn keyword ngxDirectiveThirdParty supervisord
+syn keyword ngxDirectiveThirdParty supervisord_inherit_backend_status
+syn keyword ngxDirectiveThirdParty supervisord_name
+syn keyword ngxDirectiveThirdParty supervisord_start
+syn keyword ngxDirectiveThirdParty supervisord_stop
+
+
+endif
diff --git a/syntax/modules/tarantool-upstream.vim b/syntax/modules/tarantool-upstream.vim
new file mode 100644
index 00000000..bebcf304
--- /dev/null
+++ b/syntax/modules/tarantool-upstream.vim
@@ -0,0 +1,22 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Tarantool Upstream Module <https://github.com/tarantool/nginx_upstream_module>
+" Tarantool NginX upstream module (REST, JSON API, websockets, load balancing)
+syn keyword ngxDirectiveThirdParty tnt_pass
+syn keyword ngxDirectiveThirdParty tnt_http_methods
+syn keyword ngxDirectiveThirdParty tnt_http_rest_methods
+syn keyword ngxDirectiveThirdParty tnt_pass_http_request
+syn keyword ngxDirectiveThirdParty tnt_pass_http_request_buffer_size
+syn keyword ngxDirectiveThirdParty tnt_method
+syn keyword ngxDirectiveThirdParty tnt_http_allowed_methods - experemental
+syn keyword ngxDirectiveThirdParty tnt_send_timeout
+syn keyword ngxDirectiveThirdParty tnt_read_timeout
+syn keyword ngxDirectiveThirdParty tnt_buffer_size
+syn keyword ngxDirectiveThirdParty tnt_next_upstream
+syn keyword ngxDirectiveThirdParty tnt_connect_timeout
+syn keyword ngxDirectiveThirdParty tnt_next_upstream
+syn keyword ngxDirectiveThirdParty tnt_next_upstream_tries
+syn keyword ngxDirectiveThirdParty tnt_next_upstream_timeout
+
+
+endif
diff --git a/syntax/modules/tcp-proxy.vim b/syntax/modules/tcp-proxy.vim
new file mode 100644
index 00000000..bfe03623
--- /dev/null
+++ b/syntax/modules/tcp-proxy.vim
@@ -0,0 +1,33 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" TCP Proxy Module <http://yaoweibin.github.io/nginx_tcp_proxy_module/>
+" Add the feature of tcp proxy with nginx, with health check and status monitor
+syn keyword ngxDirectiveThirdParty tcp
+syn keyword ngxDirectiveThirdParty server
+syn keyword ngxDirectiveThirdParty listen
+syn keyword ngxDirectiveThirdParty allow
+syn keyword ngxDirectiveThirdParty deny
+syn keyword ngxDirectiveThirdParty so_keepalive
+syn keyword ngxDirectiveThirdParty tcp_nodelay
+syn keyword ngxDirectiveThirdParty timeout
+syn keyword ngxDirectiveThirdParty server_name
+syn keyword ngxDirectiveThirdParty resolver
+syn keyword ngxDirectiveThirdParty resolver_timeout
+syn keyword ngxDirectiveThirdParty upstream
+syn keyword ngxDirectiveThirdParty server
+syn keyword ngxDirectiveThirdParty check
+syn keyword ngxDirectiveThirdParty check_http_send
+syn keyword ngxDirectiveThirdParty check_http_expect_alive
+syn keyword ngxDirectiveThirdParty check_smtp_send
+syn keyword ngxDirectiveThirdParty check_smtp_expect_alive
+syn keyword ngxDirectiveThirdParty check_shm_size
+syn keyword ngxDirectiveThirdParty check_status
+syn keyword ngxDirectiveThirdParty ip_hash
+syn keyword ngxDirectiveThirdParty proxy_pass
+syn keyword ngxDirectiveThirdParty proxy_buffer
+syn keyword ngxDirectiveThirdParty proxy_connect_timeout
+syn keyword ngxDirectiveThirdParty proxy_read_timeout
+syn keyword ngxDirectiveThirdParty proxy_write_timeout
+
+
+endif
diff --git a/syntax/modules/testcookie.vim b/syntax/modules/testcookie.vim
new file mode 100644
index 00000000..7087a3d4
--- /dev/null
+++ b/syntax/modules/testcookie.vim
@@ -0,0 +1,32 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Testcookie Module <https://github.com/kyprizel/testcookie-nginx-module>
+" NGINX module for L7 DDoS attack mitigation
+syn keyword ngxDirectiveThirdParty testcookie
+syn keyword ngxDirectiveThirdParty testcookie_name
+syn keyword ngxDirectiveThirdParty testcookie_domain
+syn keyword ngxDirectiveThirdParty testcookie_expires
+syn keyword ngxDirectiveThirdParty testcookie_path
+syn keyword ngxDirectiveThirdParty testcookie_secret
+syn keyword ngxDirectiveThirdParty testcookie_session
+syn keyword ngxDirectiveThirdParty testcookie_arg
+syn keyword ngxDirectiveThirdParty testcookie_max_attempts
+syn keyword ngxDirectiveThirdParty testcookie_p3p
+syn keyword ngxDirectiveThirdParty testcookie_fallback
+syn keyword ngxDirectiveThirdParty testcookie_whitelist
+syn keyword ngxDirectiveThirdParty testcookie_pass
+syn keyword ngxDirectiveThirdParty testcookie_redirect_via_refresh
+syn keyword ngxDirectiveThirdParty testcookie_refresh_template
+syn keyword ngxDirectiveThirdParty testcookie_refresh_status
+syn keyword ngxDirectiveThirdParty testcookie_deny_keepalive
+syn keyword ngxDirectiveThirdParty testcookie_get_only
+syn keyword ngxDirectiveThirdParty testcookie_https_location
+syn keyword ngxDirectiveThirdParty testcookie_refresh_encrypt_cookie
+syn keyword ngxDirectiveThirdParty testcookie_refresh_encrypt_cookie_key
+syn keyword ngxDirectiveThirdParty testcookie_refresh_encrypt_iv
+syn keyword ngxDirectiveThirdParty testcookie_internal
+syn keyword ngxDirectiveThirdParty testcookie_httponly_flag
+syn keyword ngxDirectiveThirdParty testcookie_secure_flag
+
+
+endif
diff --git a/syntax/modules/types-filter.vim b/syntax/modules/types-filter.vim
new file mode 100644
index 00000000..f15e502b
--- /dev/null
+++ b/syntax/modules/types-filter.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Types Filter Module <https://github.com/flygoast/ngx_http_types_filter>
+" Change the `Content-Type` output header depending on an extension variable according to a condition specified in the 'if' clause.
+syn keyword ngxDirectiveThirdParty types_filter
+syn keyword ngxDirectiveThirdParty types_filter_use_default
+
+
+endif
diff --git a/syntax/modules/unzip.vim b/syntax/modules/unzip.vim
new file mode 100644
index 00000000..a2f35d7f
--- /dev/null
+++ b/syntax/modules/unzip.vim
@@ -0,0 +1,10 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Unzip Module <https://github.com/youzee/nginx-unzip-module>
+" Enabling fetching of files that are stored in zipped archives.
+syn keyword ngxDirectiveThirdParty file_in_unzip_archivefile
+syn keyword ngxDirectiveThirdParty file_in_unzip_extract
+syn keyword ngxDirectiveThirdParty file_in_unzip
+
+
+endif
diff --git a/syntax/modules/upload-progress.vim b/syntax/modules/upload-progress.vim
new file mode 100644
index 00000000..218b6d76
--- /dev/null
+++ b/syntax/modules/upload-progress.vim
@@ -0,0 +1,14 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Upload Progress Module <https://www.nginx.com/resources/wiki/modules/upload_progress/>
+" Tracks and reports upload progress.
+syn keyword ngxDirectiveThirdParty report_uploads
+syn keyword ngxDirectiveThirdParty track_uploads
+syn keyword ngxDirectiveThirdParty upload_progress
+syn keyword ngxDirectiveThirdParty upload_progress_content_type
+syn keyword ngxDirectiveThirdParty upload_progress_header
+syn keyword ngxDirectiveThirdParty upload_progress_json_output
+syn keyword ngxDirectiveThirdParty upload_progress_template
+
+
+endif
diff --git a/syntax/modules/upload.vim b/syntax/modules/upload.vim
new file mode 100644
index 00000000..2699f338
--- /dev/null
+++ b/syntax/modules/upload.vim
@@ -0,0 +1,20 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Upload Module <https://www.nginx.com/resources/wiki/modules/upload/>
+" Parses multipart/form-data allowing arbitrary handling of uploaded files.
+syn keyword ngxDirectiveThirdParty upload_aggregate_form_field
+syn keyword ngxDirectiveThirdParty upload_buffer_size
+syn keyword ngxDirectiveThirdParty upload_cleanup
+syn keyword ngxDirectiveThirdParty upload_limit_rate
+syn keyword ngxDirectiveThirdParty upload_max_file_size
+syn keyword ngxDirectiveThirdParty upload_max_output_body_len
+syn keyword ngxDirectiveThirdParty upload_max_part_header_len
+syn keyword ngxDirectiveThirdParty upload_pass
+syn keyword ngxDirectiveThirdParty upload_pass_args
+syn keyword ngxDirectiveThirdParty upload_pass_form_field
+syn keyword ngxDirectiveThirdParty upload_set_form_field
+syn keyword ngxDirectiveThirdParty upload_store
+syn keyword ngxDirectiveThirdParty upload_store_access
+
+
+endif
diff --git a/syntax/modules/upstream-fair.vim b/syntax/modules/upstream-fair.vim
new file mode 100644
index 00000000..4dff6a22
--- /dev/null
+++ b/syntax/modules/upstream-fair.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Upstream Fair Module <https://github.com/gnosek/nginx-upstream-fair>
+" The fair load balancer module for nginx http://nginx.localdomain.pl
+syn keyword ngxDirectiveThirdParty fair
+syn keyword ngxDirectiveThirdParty upstream_fair_shm_size
+
+
+endif
diff --git a/syntax/modules/upstream-hash.vim b/syntax/modules/upstream-hash.vim
new file mode 100644
index 00000000..b86980ab
--- /dev/null
+++ b/syntax/modules/upstream-hash.vim
@@ -0,0 +1,9 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Upstream Hash Module (DEPRECATED) <http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule>
+" Provides simple upstream load distribution by hashing a configurable variable.
+syn keyword ngxDirectiveThirdParty hash
+syn keyword ngxDirectiveThirdParty hash_again
+
+
+endif
diff --git a/syntax/modules/upstream-jdomain.vim b/syntax/modules/upstream-jdomain.vim
new file mode 100644
index 00000000..ae7eb03d
--- /dev/null
+++ b/syntax/modules/upstream-jdomain.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Upstream Domain Resolve Module <https://www.nginx.com/resources/wiki/modules/domain_resolve/>
+" A load-balancer that resolves an upstream domain name asynchronously.
+syn keyword ngxDirectiveThirdParty jdomain
+
+
+endif
diff --git a/syntax/modules/upsync.vim b/syntax/modules/upsync.vim
new file mode 100644
index 00000000..ddf8a1a7
--- /dev/null
+++ b/syntax/modules/upsync.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Upsync Module <https://github.com/weibocom/nginx-upsync-module>
+" Sync upstreams from consul or others, dynamiclly modify backend-servers attribute(weight, max_fails,...), needn't reload nginx
+syn keyword ngxDirectiveThirdParty upsync
+syn keyword ngxDirectiveThirdParty upsync_dump_path
+syn keyword ngxDirectiveThirdParty upsync_lb
+syn keyword ngxDirectiveThirdParty upstream_show
+
+
+endif
diff --git a/syntax/modules/url.vim b/syntax/modules/url.vim
new file mode 100644
index 00000000..00169bb2
--- /dev/null
+++ b/syntax/modules/url.vim
@@ -0,0 +1,10 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" URL Module <https://github.com/vozlt/nginx-module-url>
+" Nginx url encoding converting module
+syn keyword ngxDirectiveThirdParty url_encoding_convert
+syn keyword ngxDirectiveThirdParty url_encoding_convert_from
+syn keyword ngxDirectiveThirdParty url_encoding_convert_to
+
+
+endif
diff --git a/syntax/modules/user-agent.vim b/syntax/modules/user-agent.vim
new file mode 100644
index 00000000..a718b2a1
--- /dev/null
+++ b/syntax/modules/user-agent.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" User Agent Module <https://github.com/alibaba/nginx-http-user-agent>
+" Match browsers and crawlers
+syn keyword ngxDirectiveThirdParty user_agent
+
+
+endif
diff --git a/syntax/modules/usptream-ketama-chash.vim b/syntax/modules/usptream-ketama-chash.vim
new file mode 100644
index 00000000..57887a7b
--- /dev/null
+++ b/syntax/modules/usptream-ketama-chash.vim
@@ -0,0 +1,8 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Upstrema Ketama Chash Module <https://github.com/flygoast/ngx_http_upstream_ketama_chash>
+" Nginx load-balancer module implementing ketama consistent hashing.
+syn keyword ngxDirectiveThirdParty ketama_chash
+
+
+endif
diff --git a/syntax/modules/video-thumbextractor.vim b/syntax/modules/video-thumbextractor.vim
new file mode 100644
index 00000000..0abdc1a5
--- /dev/null
+++ b/syntax/modules/video-thumbextractor.vim
@@ -0,0 +1,24 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Video Thumbextractor Module <https://github.com/wandenberg/nginx-video-thumbextractor-module>
+" Extract thumbs from a video file
+syn keyword ngxDirectiveThirdParty video_thumbextractor
+syn keyword ngxDirectiveThirdParty video_thumbextractor_video_filename
+syn keyword ngxDirectiveThirdParty video_thumbextractor_video_second
+syn keyword ngxDirectiveThirdParty video_thumbextractor_image_width
+syn keyword ngxDirectiveThirdParty video_thumbextractor_image_height
+syn keyword ngxDirectiveThirdParty video_thumbextractor_only_keyframe
+syn keyword ngxDirectiveThirdParty video_thumbextractor_next_time
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_rows
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_cols
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_max_rows
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_max_cols
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_sample_interval
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_color
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_margin
+syn keyword ngxDirectiveThirdParty video_thumbextractor_tile_padding
+syn keyword ngxDirectiveThirdParty video_thumbextractor_threads
+syn keyword ngxDirectiveThirdParty video_thumbextractor_processes_per_worker
+
+
+endif
diff --git a/syntax/modules/vkholodkov-eval.vim b/syntax/modules/vkholodkov-eval.vim
new file mode 100644
index 00000000..711416be
--- /dev/null
+++ b/syntax/modules/vkholodkov-eval.vim
@@ -0,0 +1,10 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" Eval Module <http://www.grid.net.ru/nginx/eval.en.html>
+" Module for nginx web server evaluates response of proxy or memcached module into variables.
+syn keyword ngxDirectiveThirdParty eval
+syn keyword ngxDirectiveThirdParty eval_escalate
+syn keyword ngxDirectiveThirdParty eval_override_content_type
+
+
+endif
diff --git a/syntax/modules/vts.vim b/syntax/modules/vts.vim
new file mode 100644
index 00000000..9c006c39
--- /dev/null
+++ b/syntax/modules/vts.vim
@@ -0,0 +1,20 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" VTS Module <https://github.com/vozlt/nginx-module-vts>
+" Nginx virtual host traffic status module
+syn keyword ngxDirectiveThirdParty vhost_traffic_status
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_zone
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_display
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_display_format
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_display_jsonp
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_filter
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_filter_by_host
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_filter_by_set_key
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_filter_check_duplicate
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_limit
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_limit_traffic
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_limit_traffic_by_set_key
+syn keyword ngxDirectiveThirdParty vhost_traffic_status_limit_check_duplicate
+
+
+endif
diff --git a/syntax/modules/xss.vim b/syntax/modules/xss.vim
new file mode 100644
index 00000000..34d77a9f
--- /dev/null
+++ b/syntax/modules/xss.vim
@@ -0,0 +1,11 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" XSS Module <https://github.com/openresty/xss-nginx-module>
+" Native support for cross-site scripting (XSS) in an nginx.
+syn keyword ngxDirectiveThirdParty xss_callback_arg
+syn keyword ngxDirectiveThirdParty xss_get
+syn keyword ngxDirectiveThirdParty xss_input_types
+syn keyword ngxDirectiveThirdParty xss_output_type
+
+
+endif
diff --git a/syntax/modules/zip.vim b/syntax/modules/zip.vim
new file mode 100644
index 00000000..c78f6fd1
--- /dev/null
+++ b/syntax/modules/zip.vim
@@ -0,0 +1,7 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
+
+" ZIP Module <https://www.nginx.com/resources/wiki/modules/zip/>
+" ZIP archiver for nginx
+
+
+endif
diff --git a/syntax/nginx.vim b/syntax/nginx.vim
index 35999b00..37992454 100644
--- a/syntax/nginx.vim
+++ b/syntax/nginx.vim
@@ -7,9 +7,14 @@ if exists("b:current_syntax")
finish
end
-setlocal iskeyword+=.
-setlocal iskeyword+=/
-setlocal iskeyword+=:
+" Patch 7.4.1142
+if has("win32")
+ syn iskeyword @,48-57,_,128-167,224-235,.,/,:
+else
+ syn iskeyword @,48-57,_,192-255,.,/,:
+endif
+
+setlocal commentstring=#\ %s
syn match ngxVariable '\$\(\w\+\|{\w\+}\)'
syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained
@@ -65,6 +70,7 @@ syn keyword ngxDirectiveError post_action
syn keyword ngxDirectiveDeprecated connections
syn keyword ngxDirectiveDeprecated imap
syn keyword ngxDirectiveDeprecated limit_zone
+syn keyword ngxDirectiveDeprecated mysql_test
syn keyword ngxDirectiveDeprecated open_file_cache_retest
syn keyword ngxDirectiveDeprecated optimize_server_names
syn keyword ngxDirectiveDeprecated satisfy_any
@@ -234,6 +240,7 @@ syn keyword ngxDirective limit_req_zone
syn keyword ngxDirective lingering_close
syn keyword ngxDirective lingering_time
syn keyword ngxDirective lingering_timeout
+syn keyword ngxDirective load_module
syn keyword ngxDirective lock_file
syn keyword ngxDirective log_format
syn keyword ngxDirective log_not_found
@@ -263,7 +270,6 @@ syn keyword ngxDirective mp4_limit_rate_after
syn keyword ngxDirective msie_padding
syn keyword ngxDirective msie_refresh
syn keyword ngxDirective multi_accept
-syn keyword ngxDirective mysql_test
syn keyword ngxDirective open_file_cache
syn keyword ngxDirective open_file_cache_errors
syn keyword ngxDirective open_file_cache_events
@@ -463,6 +469,7 @@ syn keyword ngxDirective sub_filter_once
syn keyword ngxDirective sub_filter_types
syn keyword ngxDirective tcp_nodelay
syn keyword ngxDirective tcp_nopush
+syn keyword ngxDirective thread_pool
syn keyword ngxDirective thread_stack_size
syn keyword ngxDirective timeout
syn keyword ngxDirective timer_resolution
@@ -557,23 +564,57 @@ syn keyword ngxDirective xslt_stylesheet
syn keyword ngxDirective xslt_types
" 3rd party module list:
-" http://wiki.nginx.org/Nginx3rdPartyModules
+" https://www.nginx.com/resources/wiki/modules/
+
-" Accept Language Module <http://wiki.nginx.org/NginxAcceptLanguageModule>
+" Accept Language Module <https://www.nginx.com/resources/wiki/modules/accept_language/>
" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.
syn keyword ngxDirectiveThirdParty set_from_accept_language
-" Access Key Module <http://wiki.nginx.org/NginxHttpAccessKeyModule>
+" Access Key Module (DEPRECATED) <http://wiki.nginx.org/NginxHttpAccessKeyModule>
" Denies access unless the request URL contains an access key.
syn keyword ngxDirectiveThirdParty accesskey
syn keyword ngxDirectiveThirdParty accesskey_arg
syn keyword ngxDirectiveThirdParty accesskey_hashmethod
syn keyword ngxDirectiveThirdParty accesskey_signature
-" Auth PAM Module <http://web.iti.upv.es/~sto/nginx/>
-" HTTP Basic Authentication using PAM.
-syn keyword ngxDirectiveThirdParty auth_pam
-syn keyword ngxDirectiveThirdParty auth_pam_service_name
+" Asynchronous FastCGI Module <https://github.com/rsms/afcgi>
+" Primarily a modified version of the Nginx FastCGI module which implements multiplexing of connections, allowing a single FastCGI server to handle many concurrent requests.
+" syn keyword ngxDirectiveThirdParty fastcgi_bind
+" syn keyword ngxDirectiveThirdParty fastcgi_buffer_size
+" syn keyword ngxDirectiveThirdParty fastcgi_buffers
+" syn keyword ngxDirectiveThirdParty fastcgi_busy_buffers_size
+" syn keyword ngxDirectiveThirdParty fastcgi_cache
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_key
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_methods
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_min_uses
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_path
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_use_stale
+" syn keyword ngxDirectiveThirdParty fastcgi_cache_valid
+" syn keyword ngxDirectiveThirdParty fastcgi_catch_stderr
+" syn keyword ngxDirectiveThirdParty fastcgi_connect_timeout
+" syn keyword ngxDirectiveThirdParty fastcgi_hide_header
+" syn keyword ngxDirectiveThirdParty fastcgi_ignore_client_abort
+" syn keyword ngxDirectiveThirdParty fastcgi_ignore_headers
+" syn keyword ngxDirectiveThirdParty fastcgi_index
+" syn keyword ngxDirectiveThirdParty fastcgi_intercept_errors
+" syn keyword ngxDirectiveThirdParty fastcgi_max_temp_file_size
+" syn keyword ngxDirectiveThirdParty fastcgi_next_upstream
+" syn keyword ngxDirectiveThirdParty fastcgi_param
+" syn keyword ngxDirectiveThirdParty fastcgi_pass
+" syn keyword ngxDirectiveThirdParty fastcgi_pass_header
+" syn keyword ngxDirectiveThirdParty fastcgi_pass_request_body
+" syn keyword ngxDirectiveThirdParty fastcgi_pass_request_headers
+" syn keyword ngxDirectiveThirdParty fastcgi_read_timeout
+" syn keyword ngxDirectiveThirdParty fastcgi_send_lowat
+" syn keyword ngxDirectiveThirdParty fastcgi_send_timeout
+" syn keyword ngxDirectiveThirdParty fastcgi_split_path_info
+" syn keyword ngxDirectiveThirdParty fastcgi_store
+" syn keyword ngxDirectiveThirdParty fastcgi_store_access
+" syn keyword ngxDirectiveThirdParty fastcgi_temp_file_write_size
+" syn keyword ngxDirectiveThirdParty fastcgi_temp_path
+syn keyword ngxDirectiveThirdParty fastcgi_upstream_fail_timeout
+syn keyword ngxDirectiveThirdParty fastcgi_upstream_max_fails
" Brotli Module <https://github.com/google/ngx_brotli>
" Nginx module for Brotli compression
@@ -585,26 +626,30 @@ syn keyword ngxDirectiveThirdParty brotli_comp_level
syn keyword ngxDirectiveThirdParty brotli_window
syn keyword ngxDirectiveThirdParty brotli_min_length
-" Cache Purge Module <http://labs.frickle.com/nginx_ngx_cache_purge/>
+" Cache Purge Module <https://github.com/FRiCKLE/ngx_cache_purge>
" Module adding ability to purge content from FastCGI and proxy caches.
syn keyword ngxDirectiveThirdParty fastcgi_cache_purge
syn keyword ngxDirectiveThirdParty proxy_cache_purge
-" Chunkin Module <http://wiki.nginx.org/NginxHttpChunkinModule>
+" Chunkin Module (DEPRECATED) <http://wiki.nginx.org/NginxHttpChunkinModule>
" HTTP 1.1 chunked-encoding request body support for Nginx.
syn keyword ngxDirectiveThirdParty chunkin
syn keyword ngxDirectiveThirdParty chunkin_keepalive
syn keyword ngxDirectiveThirdParty chunkin_max_chunks_per_buf
syn keyword ngxDirectiveThirdParty chunkin_resume
-" Circle GIF Module <http://wiki.nginx.org/NginxHttpCircleGifModule>
+" Circle GIF Module <https://github.com/evanmiller/nginx_circle_gif>
" Generates simple circle images with the colors and size specified in the URL.
syn keyword ngxDirectiveThirdParty circle_gif
syn keyword ngxDirectiveThirdParty circle_gif_max_radius
syn keyword ngxDirectiveThirdParty circle_gif_min_radius
syn keyword ngxDirectiveThirdParty circle_gif_step_radius
-" Drizzle Module <http://github.com/chaoslawful/drizzle-nginx-module>
+" Upstream Consistent Hash <https://www.nginx.com/resources/wiki/modules/consistent_hash/>
+" Select backend based on Consistent hash ring.
+syn keyword ngxDirectiveThirdParty consistent_hash
+
+" Drizzle Module <https://github.com/openresty/drizzle-nginx-module>
" Make nginx talk directly to mysql, drizzle, and sqlite3 by libdrizzle.
syn keyword ngxDirectiveThirdParty drizzle_connect_timeout
syn keyword ngxDirectiveThirdParty drizzle_dbname
@@ -617,7 +662,7 @@ syn keyword ngxDirectiveThirdParty drizzle_recv_rows_timeout
syn keyword ngxDirectiveThirdParty drizzle_send_query_timeout
syn keyword ngxDirectiveThirdParty drizzle_server
-" Echo Module <http://wiki.nginx.org/NginxHttpEchoModule>
+" Echo Module <https://github.com/openresty/echo-nginx-module>
" Brings 'echo', 'sleep', 'time', 'exec' and more shell-style goodies to Nginx config file.
syn keyword ngxDirectiveThirdParty echo
syn keyword ngxDirectiveThirdParty echo_after_body
@@ -637,18 +682,23 @@ syn keyword ngxDirectiveThirdParty echo_sleep
syn keyword ngxDirectiveThirdParty echo_subrequest
syn keyword ngxDirectiveThirdParty echo_subrequest_async
-" Events Module <http://docs.dutov.org/nginx_modules_events_en.html>
-" Privides options for start/stop events.
+" Events Module (DEPRECATED) <http://docs.dutov.org/nginx_modules_events_en.html>
+" Provides options for start/stop events.
syn keyword ngxDirectiveThirdParty on_start
syn keyword ngxDirectiveThirdParty on_stop
-" EY Balancer Module <http://github.com/ry/nginx-ey-balancer>
+" EY Balancer Module <https://github.com/ezmobius/nginx-ey-balancer>
" Adds a request queue to Nginx that allows the limiting of concurrent requests passed to the upstream.
syn keyword ngxDirectiveThirdParty max_connections
syn keyword ngxDirectiveThirdParty max_connections_max_queue_length
syn keyword ngxDirectiveThirdParty max_connections_queue_timeout
-" Fancy Indexes Module <https://connectical.com/projects/ngx-fancyindex/wiki>
+" Upstream Fair Balancer <https://www.nginx.com/resources/wiki/modules/fair_balancer/>
+" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin.
+syn keyword ngxDirectiveThirdParty fair
+syn keyword ngxDirectiveThirdParty upstream_fair_shm_size
+
+" Fancy Indexes Module <https://github.com/aperezdc/ngx-fancyindex>
" Like the built-in autoindex module, but fancier.
syn keyword ngxDirectiveThirdParty fancyindex
syn keyword ngxDirectiveThirdParty fancyindex_exact_size
@@ -662,14 +712,30 @@ syn keyword ngxDirectiveThirdParty fancyindex_readme_mode
" Country code lookups via the MaxMind GeoIP API.
syn keyword ngxDirectiveThirdParty geoip_country_file
-" Headers More Module <http://wiki.nginx.org/NginxHttpHeadersMoreModule>
+" Headers More Module <https://github.com/openresty/headers-more-nginx-module>
" Set and clear input and output headers...more than "add"!
syn keyword ngxDirectiveThirdParty more_clear_headers
syn keyword ngxDirectiveThirdParty more_clear_input_headers
syn keyword ngxDirectiveThirdParty more_set_headers
syn keyword ngxDirectiveThirdParty more_set_input_headers
-" HTTP Push Module <http://pushmodule.slact.net/>
+" Auth PAM Module <https://github.com/sto/ngx_http_auth_pam_module>
+" HTTP Basic Authentication using PAM.
+syn keyword ngxDirectiveThirdParty auth_pam
+syn keyword ngxDirectiveThirdParty auth_pam_service_name
+
+" HTTP JavaScript Module <https://github.com/peter-leonov/ngx_http_js_module>
+" Embedding SpiderMonkey. Nearly full port on Perl module.
+syn keyword ngxDirectiveThirdParty js
+syn keyword ngxDirectiveThirdParty js_filter
+syn keyword ngxDirectiveThirdParty js_filter_types
+syn keyword ngxDirectiveThirdParty js_load
+syn keyword ngxDirectiveThirdParty js_maxmem
+syn keyword ngxDirectiveThirdParty js_require
+syn keyword ngxDirectiveThirdParty js_set
+syn keyword ngxDirectiveThirdParty js_utf8
+
+" HTTP Push Module (DEPRECATED) <http://pushmodule.slact.net/>
" Turn Nginx into an adept long-polling HTTP Push (Comet) server.
syn keyword ngxDirectiveThirdParty push_buffer_size
syn keyword ngxDirectiveThirdParty push_listener
@@ -677,7 +743,7 @@ syn keyword ngxDirectiveThirdParty push_message_timeout
syn keyword ngxDirectiveThirdParty push_queue_messages
syn keyword ngxDirectiveThirdParty push_sender
-" HTTP Redis Module <http://people.FreeBSD.ORG/~osa/ngx_http_redis-0.3.1.tar.gz>>
+" HTTP Redis Module <https://www.nginx.com/resources/wiki/modules/redis/>
" Redis <http://code.google.com/p/redis/> support.>
syn keyword ngxDirectiveThirdParty redis_bind
syn keyword ngxDirectiveThirdParty redis_buffer_size
@@ -687,23 +753,11 @@ syn keyword ngxDirectiveThirdParty redis_pass
syn keyword ngxDirectiveThirdParty redis_read_timeout
syn keyword ngxDirectiveThirdParty redis_send_timeout
-" HTTP JavaScript Module <http://wiki.github.com/kung-fu-tzu/ngx_http_js_module>
-" Embedding SpiderMonkey. Nearly full port on Perl module.
-syn keyword ngxDirectiveThirdParty js
-syn keyword ngxDirectiveThirdParty js_filter
-syn keyword ngxDirectiveThirdParty js_filter_types
-syn keyword ngxDirectiveThirdParty js_load
-syn keyword ngxDirectiveThirdParty js_maxmem
-syn keyword ngxDirectiveThirdParty js_require
-syn keyword ngxDirectiveThirdParty js_set
-syn keyword ngxDirectiveThirdParty js_utf8
-
-" Log Request Speed <http://wiki.nginx.org/NginxHttpLogRequestSpeed>
+" Log Request Speed (DEPRECATED) <http://wiki.nginx.org/NginxHttpLogRequestSpeed>
" Log the time it took to process each request.
syn keyword ngxDirectiveThirdParty log_request_speed_filter
syn keyword ngxDirectiveThirdParty log_request_speed_filter_timeout
-
" Lua Module <https://github.com/openresty/lua-nginx-module>
" Embed the Power of Lua into NGINX HTTP servers
syn keyword ngxDirectiveThirdParty lua_use_default_type
@@ -766,8 +820,7 @@ syn keyword ngxDirectiveThirdParty lua_check_client_abort
syn keyword ngxDirectiveThirdParty lua_max_pending_timers
syn keyword ngxDirectiveThirdParty lua_max_running_timers
-
-" Memc Module <http://wiki.nginx.org/NginxHttpMemcModule>
+" Memc Module <https://github.com/openresty/memc-nginx-module>
" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.
syn keyword ngxDirectiveThirdParty memc_buffer_size
syn keyword ngxDirectiveThirdParty memc_cmds_allowed
@@ -791,16 +844,16 @@ syn keyword ngxDirectiveThirdParty mogilefs_read_timeout
syn keyword ngxDirectiveThirdParty mogilefs_send_timeout
syn keyword ngxDirectiveThirdParty mogilefs_tracker
-" MP4 Streaming Lite Module <http://wiki.nginx.org/NginxMP4StreamingLite>
+" MP4 Streaming Lite Module <https://www.nginx.com/resources/wiki/modules/mp4_streaming/>
" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL.
syn keyword ngxDirectiveThirdParty mp4
-" Nginx Notice Module <http://xph.us/software/nginx-notice/>
+" Nginx Notice Module <https://github.com/kr/nginx-notice>
" Serve static file to POST requests.
syn keyword ngxDirectiveThirdParty notice
syn keyword ngxDirectiveThirdParty notice_type
-" Phusion Passenger <http://www.modrails.com/documentation.html>
+" Phusion Passenger <https://www.phusionpassenger.com/>
" Easy and robust deployment of Ruby on Rails application on Apache and Nginx webservers.
syn keyword ngxDirectiveThirdParty passenger_base_uri
syn keyword ngxDirectiveThirdParty passenger_default_user
@@ -819,26 +872,26 @@ syn keyword ngxDirectiveThirdParty rails_env
syn keyword ngxDirectiveThirdParty rails_framework_spawner_idle_time
syn keyword ngxDirectiveThirdParty rails_spawn_method
-" RDS JSON Module <http://github.com/agentzh/rds-json-nginx-module>
+" RDS JSON Module <https://github.com/openresty/rds-json-nginx-module>
" Help ngx_drizzle and other DBD modules emit JSON data.
syn keyword ngxDirectiveThirdParty rds_json
syn keyword ngxDirectiveThirdParty rds_json_content_type
syn keyword ngxDirectiveThirdParty rds_json_format
syn keyword ngxDirectiveThirdParty rds_json_ret
-" RRD Graph Module <http://wiki.nginx.org/NginxNgx_rrd_graph>
+" RRD Graph Module <https://www.nginx.com/resources/wiki/modules/rrd_graph/>
" This module provides an HTTP interface to RRDtool's graphing facilities.
syn keyword ngxDirectiveThirdParty rrd_graph
syn keyword ngxDirectiveThirdParty rrd_graph_root
-" Secure Download <http://wiki.nginx.org/NginxHttpSecureDownload>
+" Secure Download <https://www.nginx.com/resources/wiki/modules/secure_download/>
" Create expiring links.
syn keyword ngxDirectiveThirdParty secure_download
syn keyword ngxDirectiveThirdParty secure_download_fail_location
syn keyword ngxDirectiveThirdParty secure_download_path_mode
syn keyword ngxDirectiveThirdParty secure_download_secret
-" SlowFS Cache Module <http://labs.frickle.com/nginx_ngx_slowfs_cache/>
+" SlowFS Cache Module <https://github.com/FRiCKLE/ngx_slowfs_cache/>
" Module adding ability to cache static files.
syn keyword ngxDirectiveThirdParty slowfs_big_file_size
syn keyword ngxDirectiveThirdParty slowfs_cache
@@ -849,16 +902,16 @@ syn keyword ngxDirectiveThirdParty slowfs_cache_purge
syn keyword ngxDirectiveThirdParty slowfs_cache_valid
syn keyword ngxDirectiveThirdParty slowfs_temp_path
-" Strip Module <http://wiki.nginx.org/NginxHttpStripModule>
+" Strip Module <https://github.com/evanmiller/mod_strip>
" Whitespace remover.
syn keyword ngxDirectiveThirdParty strip
-" Substitutions Module <http://wiki.nginx.org/NginxHttpSubsModule>
+" Substitutions Module <https://www.nginx.com/resources/wiki/modules/substitutions/>
" A filter module which can do both regular expression and fixed string substitutions on response bodies.
syn keyword ngxDirectiveThirdParty subs_filter
syn keyword ngxDirectiveThirdParty subs_filter_types
-" Supervisord Module <http://labs.frickle.com/nginx_ngx_supervisord/>
+" Supervisord Module <https://github.com/FRiCKLE/ngx_supervisord/>
" Module providing nginx with API to communicate with supervisord and manage (start/stop) backends on-demand.
syn keyword ngxDirectiveThirdParty supervisord
syn keyword ngxDirectiveThirdParty supervisord_inherit_backend_status
@@ -866,7 +919,17 @@ syn keyword ngxDirectiveThirdParty supervisord_name
syn keyword ngxDirectiveThirdParty supervisord_start
syn keyword ngxDirectiveThirdParty supervisord_stop
-" Upload Module <http://www.grid.net.ru/nginx/upload.en.html>
+" Upload Progress Module <https://www.nginx.com/resources/wiki/modules/upload_progress/>
+" Tracks and reports upload progress.
+syn keyword ngxDirectiveThirdParty report_uploads
+syn keyword ngxDirectiveThirdParty track_uploads
+syn keyword ngxDirectiveThirdParty upload_progress
+syn keyword ngxDirectiveThirdParty upload_progress_content_type
+syn keyword ngxDirectiveThirdParty upload_progress_header
+syn keyword ngxDirectiveThirdParty upload_progress_json_output
+syn keyword ngxDirectiveThirdParty upload_progress_template
+
+" Upload Module <https://www.nginx.com/resources/wiki/modules/upload/>
" Parses multipart/form-data allowing arbitrary handling of uploaded files.
syn keyword ngxDirectiveThirdParty upload_aggregate_form_field
syn keyword ngxDirectiveThirdParty upload_buffer_size
@@ -882,31 +945,12 @@ syn keyword ngxDirectiveThirdParty upload_set_form_field
syn keyword ngxDirectiveThirdParty upload_store
syn keyword ngxDirectiveThirdParty upload_store_access
-" Upload Progress Module <http://wiki.nginx.org/NginxHttpUploadProgressModule>
-" Tracks and reports upload progress.
-syn keyword ngxDirectiveThirdParty report_uploads
-syn keyword ngxDirectiveThirdParty track_uploads
-syn keyword ngxDirectiveThirdParty upload_progress
-syn keyword ngxDirectiveThirdParty upload_progress_content_type
-syn keyword ngxDirectiveThirdParty upload_progress_header
-syn keyword ngxDirectiveThirdParty upload_progress_json_output
-syn keyword ngxDirectiveThirdParty upload_progress_template
-
-" Upstream Fair Balancer <http://wiki.nginx.org/NginxHttpUpstreamFairModule>
-" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin.
-syn keyword ngxDirectiveThirdParty fair
-syn keyword ngxDirectiveThirdParty upstream_fair_shm_size
-
-" Upstream Consistent Hash <http://wiki.nginx.org/NginxHttpUpstreamConsistentHash>
-" Select backend based on Consistent hash ring.
-syn keyword ngxDirectiveThirdParty consistent_hash
-
-" Upstream Hash Module <http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule>
+" Upstream Hash Module (DEPRECATED) <http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule>
" Provides simple upstream load distribution by hashing a configurable variable.
syn keyword ngxDirectiveThirdParty hash
syn keyword ngxDirectiveThirdParty hash_again
-" XSS Module <http://github.com/agentzh/xss-nginx-module>
+" XSS Module <https://github.com/openresty/xss-nginx-module>
" Native support for cross-site scripting (XSS) in an nginx.
syn keyword ngxDirectiveThirdParty xss_callback_arg
syn keyword ngxDirectiveThirdParty xss_get
@@ -934,4 +978,5 @@ hi link ngxDirectiveThirdParty Special
let b:current_syntax = "nginx"
+
endif
diff --git a/syntax/pug.vim b/syntax/pug.vim
index 992fef64..4ac85f87 100644
--- a/syntax/pug.vim
+++ b/syntax/pug.vim
@@ -34,9 +34,10 @@ syn cluster pugTop contains=pugBegin,pugComment,pugHtmlComment,pugJavascript
syn match pugBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=pugTag,pugClassChar,pugIdChar,pugPlainChar,pugJavascript,pugScriptConditional,pugScriptStatement,pugPipedText
syn match pugTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@pugComponent
syn cluster pugComponent contains=pugAttributes,pugIdChar,pugBlockExpansionChar,pugClassChar,pugPlainChar,pugJavascript,pugTagBlockChar,pugTagInlineText
-syn match pugComment '\(\s\+\|^\)\/\/.*$'
-syn region pugCommentBlock start="\z(\s\+\|^\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" keepend
-syn region pugHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
+syntax keyword pugCommentTodo contained TODO FIXME XXX TBD
+syn match pugComment '\(\s\+\|^\)\/\/.*$' contains=pugCommentTodo
+syn region pugCommentBlock start="\z(\s\+\|^\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" contains=pugCommentTodo keepend
+syn region pugHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->" contains=pugCommentTodo
syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,pugHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent
syn match pugClassChar "\." contained nextgroup=pugClass
syn match pugBlockExpansionChar ":\s\+" contained nextgroup=pugTag,pugClassChar,pugIdChar
@@ -95,6 +96,7 @@ hi def link pugInterpolationDelimiter Delimiter
hi def link pugInlineDelimiter Delimiter
hi def link pugFilter PreProc
hi def link pugDocType PreProc
+hi def link pugCommentTodo Todo
hi def link pugComment Comment
hi def link pugCommentBlock Comment
hi def link pugHtmlConditionalComment pugComment
diff --git a/syntax/puppet.vim b/syntax/puppet.vim
index b7ce2d9d..7128ea23 100644
--- a/syntax/puppet.vim
+++ b/syntax/puppet.vim
@@ -1,170 +1,439 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
-" puppet syntax file
-" Filename: puppet.vim
-" Language: puppet configuration file
-" Maintainer: Luke Kanies <luke@madstop.com>
-" URL:
-" Last Change:
-" Version:
+" Language: Puppet
+" Maintainer: Voxpupuli
+" URL: https://github.com/voxpupuli/vim-puppet
"
+" Thanks to Doug Kearns who maintains the vim syntax file for Ruby. Many constructs, including interpolation
+" and heredoc was copied from ruby and then modified to comply with Puppet syntax.
-" Copied from the cfengine, ruby, and perl syntax files
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
+" Prelude {{{1
+if exists("b:current_syntax")
finish
endif
-" match class/definition/node declarations/application
-syn region puppetDefine start="^\s*\(class\|define\|node\|application\)\s" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments,puppetNodeRe,@NoSpell
-syn keyword puppetDefType class define node inherits application contained
-syn region puppetDefArguments start="(" end=")" contained contains=puppetArgument,puppetString,puppetComment,puppetMultilineComment,puppetDataTypes
-syn match puppetArgument "\w\+" contained
-syn match puppetArgument "\$\w\+" contained
-syn match puppetArgument "'[^']+'" contained
-syn match puppetArgument '"[^"]+"' contained
-syn match puppetDefName "\w\+" contained
-syn match puppetNodeRe "/.*/" contained
-syn keyword puppetDataTypes String Integer Float Numeric Boolean Array Hash Regexp Undef Default Resource Class Scalar Collection Variant Data Pattern Enum Tuple Struct Optional Catalogentry Type Any Callable
-
-" match 'foo' in 'class foo { ...'
-" match 'foo::bar' in 'class foo::bar { ...'
-" match 'Foo::Bar' in 'Foo::Bar["..."]
-"FIXME: "Foo-bar" doesn't get highlighted as expected, although "foo-bar" does.
-syn match puppetInstance "[A-Za-z0-9_-]\+\(::[A-Za-z0-9_-]\+\)*\s*{" contains=puppetTypeName,puppetTypeDefault,@NoSpell
-syn match puppetInstance "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*[[{]" contains=puppetTypeName,puppetTypeDefault,@NoSpell
-syn match puppetInstance "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*<\?<|" contains=puppetTypeName,puppetTypeDefault,@NoSpell
-syn match puppetTypeName "[a-z]\w*" contained
-syn match puppetTypeDefault "[A-Z]\w*" contained
-
-syn match puppetParam "\w\+\s*\(=\|+\)>" contains=puppetTypeRArrow,puppetParamName
-syn match puppetParamRArrow "\(=\|+\)>" contained
-syn match puppetParamName "\w\+" contained contains=@NoSpell
-syn match puppetVariable "$\(\(::\)\?\w\+\|{\(::\)\?\w\+}\)"
-syn match puppetParen "("
-syn match puppetParen ")"
-syn match puppetBrace "{"
-syn match puppetBrace "}"
-syn match puppetBrack "\["
-syn match puppetBrack "\]"
-syn match puppetBrack "<|"
-syn match puppetBrack "|>"
-
-" match 'present' in 'ensure => present'
-" match '2755' in 'mode => 2755'
-" don't match 'bar' in 'foo => bar'
-syn match puppetParam "\w\+\s*[=+]>\s*[a-z0-9]\+" contains=puppetParamString,puppetParamName
-syn match puppetParamString "[=+]>\s*\w\+" contains=puppetParamKeyword,puppetParamSpecial,puppetParamDigits contained
-syn keyword puppetParamKeyword present absent purged latest installed running stopped mounted unmounted role configured file directory link on_failure contained
-syn keyword puppetParamSpecial true false undef contained
-syn match puppetParamDigits "[0-9]\+"
-
-" match 'template' in 'content => template("...")'
-syn match puppetParam "\w\+\s*[=+]>\s*\w\+\s*(" contains=puppetFunction,puppetParamName
-" statements
-syn region puppetFunction start="^\s*\(alert\|crit\|debug\|emerg\|err\|fail\|include\|info\|notice\|realize\|require\|search\|tag\|warning\)\s*(" end=")" contained contains=puppetString
-" rvalues
-syn region puppetFunction start="^\s*\(defined\|file\|fqdn_rand\|generate\|inline_template\|regsubst\|sha1\|shellquote\|split\|sprintf\|tagged\|template\|versioncmp\)\s*(" end=")" contained contains=puppetString
-
-syn match puppetVariable "$[a-zA-Z0-9_:]\+" contains=@NoSpell
-syn match puppetVariable "${[a-zA-Z0-9_:]\+}" contains=@NoSpell
-
-" match anything between simple/double quotes.
-" don't match variables if preceded by a backslash.
-syn region puppetString start=+'+ skip=+\\\\\|\\'+ end=+'+
-syn region puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=puppetVariable,puppetNotVariable
-syn match puppetNotVariable "\\$\w\+" contained
-syn match puppetNotVariable "\\${\w\+}" contained
-
-syn keyword puppetKeyword import inherits include require contain produces
-syn keyword puppetControl case default if else elsif unless
-syn keyword puppetSpecial true false undef
-
-syn match puppetClass "[A-Za-z0-9_-]\+\(::[A-Za-z0-9_-]\+\)\+" contains=@NoSpell
-
-" Match the Regular Expression type
-" XXX: Puppet does not currently support a few features available in the
-" full Ruby Regexp class, namely, interpolation, lookbehind and named
-" sub-expressions. Matches for these features are included in the
-" commented-out versions of puppetRegexParen and puppetRegexSubName,
-" plus the supporting groups puppetRegexAngBrack and puppetRegexTick.
-syn region puppetRegex start="/" skip="\\/" end="/" contains=puppetRegexParen,puppetRegexBrace,puppetRegexOrpuppetRegexBrack,puppetRegexComment
-syn match puppetRegexParen "(\(?\([imx]\{0,4}:\|[=!]\)\)\?" contains=puppetRegexSpecChar,puppetRegexSubName contained
-"syn match puppetRegexParen "(\(?\([imxo]\{0,4}:\|['<][[:alnum:]]\+[>']\|<?[=!]\)\)\?" contains=puppetRegexSpecChar,puppetRegexSubName contained
-syn match puppetRegexParen ")" contained
-syn match puppetRegexBrace "{" contained
-syn match puppetRegexBrace "}" contained
-syn match puppetRegexBrack "\[" contained
-syn match puppetRegexBrack "\]" contained
-"syn match puppetRegexAngBrack "<" contained
-"syn match puppetRegexAngBrack ">" contained
-"syn match puppetRegexTick +'+ contained
-syn match puppetRegexOr "|" contained
-"syn match puppetRegexSubName "['<][[:alnum:]]\+[>']" contains=puppetRegexAngBrack,puppetRegexTick contained
-syn match puppetRegexSpecialChar "[?:imx]\|\(<?[=!]\)" contained
-syn region puppetRegexComment start="(?#" skip="\\)" end=")" contained
+" this file uses line continuations
+let s:cpo_sav = &cpo
+set cpo&vim
+
+syn cluster puppetNotTop contains=@puppetExtendedStringSpecial,@puppetRegexpSpecial,@puppetDeclaration,puppetConditional,puppetExceptional,puppetMethodExceptional,puppetTodo
+
+syn match puppetSpaceError display excludenl "\s\+$"
+syn match puppetSpaceError display " \+\t"me=e-1
+
+" one character operators
+syn match puppetOperator "[=><+/*%!.|@:,;?~-]"
+
+" two character operators
+syn match puppetOperator "+=\|-=\|==\|!=\|=\~\|!\~\|>=\|<=\|<-\|<\~\|=>\|+>\|->\|\~>\|<<\||>\|@@"
+
+" three character operators
+syn match puppetOperator "<<|\||>>"
+
+syn region puppetBracketOperator matchgroup=puppetDelimiter start="\[\s*" end="\s*]" contains=ALLBUT,@puppetNotTop
+syn region puppetBraceOperator matchgroup=puppetDelimiter start="{\s*" end="\s*}" contains=ALLBUT,@puppetNotTop
+syn region puppetParenOperator matchgroup=puppetDelimiter start="(\s*" end="\s*)" contains=ALLBUT,@puppetNotTop
+
+" Expression Substitution and Backslash Notation {{{1
+syn match puppetStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display
+syn match puppetStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display
+syn match puppetQuoteEscape "\\[\\']" contained display
+
+syn region puppetInterpolation matchgroup=puppetInterpolationDelimiter start="${" end="}" contained contains=ALLBUT,@puppetNotTop
+syn match puppetInterpolation "$\w\+" display contained contains=puppetInterpolationDelimiter,puppetVariable
+syn match puppetInterpolationDelimiter "$\ze\$\w\+" display contained
+syn match puppetInterpolation "$\$\%(-\w\|\W\)" display contained contains=puppetInterpolationDelimiter,puppetVariable,puppetInvalidVariable
+syn match puppetInterpolationDelimiter "$\ze\$\%(-\w\|\W\)" display contained
+syn region puppetNoInterpolation start="\\${" end="}" contained
+syn match puppetNoInterpolation "\\${" display contained
+syn match puppetNoInterpolation "\\$\w\+" display contained
+
+syn match puppetDelimiterEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE
+
+syn region puppetNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=puppetString end=")" transparent contained
+syn region puppetNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=puppetString end="}" transparent contained
+syn region puppetNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=puppetString end=">" transparent contained
+syn region puppetNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=puppetString end="\]" transparent contained
+
+" Regular Expression Metacharacters {{{1
+" These are mostly Oniguruma ready
+syn region puppetRegexpComment matchgroup=puppetRegexpSpecial start="(?#" skip="\\)" end=")" contained
+syn region puppetRegexpParens matchgroup=puppetRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\)" end=")" contained transparent contains=@puppetRegexpSpecial
+syn region puppetRegexpBrackets matchgroup=puppetRegexpCharClass start="\[\^\=" skip="\\\]" end="\]" contained transparent contains=puppetStringEscape,puppetRegexpEscape,puppetRegexpCharClass oneline
+syn match puppetRegexpCharClass "\\[DdHhSsWw]" contained display
+syn match puppetRegexpCharClass "\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\):\]" contained
+syn match puppetRegexpEscape "\\[].*?+^$|\\/(){}[]" contained
+syn match puppetRegexpQuantifier "[*?+][?+]\=" contained display
+syn match puppetRegexpQuantifier "{\d\+\%(,\d*\)\=}?\=" contained display
+syn match puppetRegexpAnchor "[$^]\|\\[ABbGZz]" contained display
+syn match puppetRegexpDot "\." contained display
+syn match puppetRegexpSpecial "|" contained display
+syn match puppetRegexpSpecial "\\[1-9]\d\=\d\@!" contained display
+syn match puppetRegexpSpecial "\\k<\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\=>" contained display
+syn match puppetRegexpSpecial "\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" contained display
+syn match puppetRegexpSpecial "\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display
+syn match puppetRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display
+
+syn cluster puppetStringSpecial contains=puppetInterpolation,puppetNoInterpolation,puppetStringEscape
+syn cluster puppetExtendedStringSpecial contains=@puppetStringSpecial,puppetNestedParentheses,puppetNestedCurlyBraces,puppetNestedAngleBrackets,puppetNestedSquareBrackets
+syn cluster puppetRegexpSpecial contains=puppetRegexpSpecial,puppetRegexpEscape,puppetRegexpBrackets,puppetRegexpCharClass,puppetRegexpDot,puppetRegexpQuantifier,puppetRegexpAnchor,puppetRegexpParens,puppetRegexpComment
+
+syn match puppetInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*r\=i\=\>" display
+syn match puppetInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)r\=i\=\>" display
+syn match puppetInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*r\=i\=\>" display
+syn match puppetInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)*r\=i\=\>" display
+syn match puppetFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*r\=i\=\>" display
+syn match puppetFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)r\=i\=\>" display
+
+syn match puppetVariable "$\%(::\)\=\w\+\%(::\w\+\)*" display
+syn match puppetName "\%(::\)\=[a-z]\w*\%(::[a-z]\w*\)*" display
+syn match puppetType "\%(::\)\=[A-Z]\w*\%(::[A-Z]\w*\)*" display
+syn match puppetWord "\%(\%(::\)\=\%(_[\w-]*\w\+\)\|\%([a-z]\%(\w*-\)\+\w\+\)\)\+" display
+
+" bad name containing combinations of segment starting with lower case and segement starting with upper case (or vice versa)
+syn match puppetNameBad "\%(::\)\=\%(\w\+::\)*\%(\%([a-z]\w*::[A-Z]\w*\)\|\%([A-Z]\w*::[a-z]\w*\)\)\%(::\w\+\)*" display
+syn cluster puppetNameOrType contains=puppetVariable,puppetName,puppetType,puppetWord,puppetNameBad
+
+syn keyword puppetControl case and or in
+syn keyword puppetKeyword class define inherits node undef function type attr private
+syn keyword puppetKeyword application consumes produces site
+syn keyword puppetKeyword present absent purged latest installed running stopped mounted unmounted role configured file directory link on_failure contained
+syn keyword puppetConstant default undef
+syn keyword puppetConditional if else elsif unless
+syn keyword puppetBoolean true false
+
+" Core functions
+syn match puppetFunction "\<alert\>"
+syn match puppetFunction "\<assert_type\>"
+syn match puppetFunction "\<binary_file\>"
+syn match puppetFunction "\<break\>"
+syn match puppetFunction "\<contain\>"
+syn match puppetFunction "\<crit\>"
+syn match puppetFunction "\<create_resources\>"
+syn match puppetFunction "\<debug\>"
+syn match puppetFunction "\<defined\>"
+syn match puppetFunction "\<dig\>"
+syn match puppetFunction "\<each\>"
+syn match puppetFunction "\<emerg\>"
+syn match puppetFunction "\<epp\>"
+syn match puppetFunction "\<err\>"
+syn match puppetFunction "\<fail\>"
+syn match puppetFunction "\<file\>"
+syn match puppetFunction "\<filter\>"
+syn match puppetFunction "\<find_file\>"
+syn match puppetFunction "\<fqdn_rand\>"
+syn match puppetFunction "\<hiera\>"
+syn match puppetFunction "\<hiera_array\>"
+syn match puppetFunction "\<hiera_hash\>"
+syn match puppetFunction "\<hiera_include\>"
+syn match puppetFunction "\<import\>"
+syn match puppetFunction "\<include\>"
+syn match puppetFunction "\<info\>"
+syn match puppetFunction "\<inline_epp\>"
+syn match puppetFunction "\<lest\>"
+syn match puppetFunction "\<lookup\>"
+syn match puppetFunction "\<map\>"
+syn match puppetFunction "\<match\>"
+syn match puppetFunction "\<new\>"
+syn match puppetFunction "\<next\>"
+syn match puppetFunction "\<notice\>"
+syn match puppetFunction "\<realize\>"
+syn match puppetFunction "\<reduce\>"
+syn match puppetFunction "\<regsubst\>"
+syn match puppetFunction "\<require\>"
+syn match puppetFunction "\<return\>"
+syn match puppetFunction "\<reverse_each\>"
+syn match puppetFunction "\<scanf\>"
+syn match puppetFunction "\<sha1\>"
+syn match puppetFunction "\<shellquote\>"
+syn match puppetFunction "\<slice\>"
+syn match puppetFunction "\<split\>"
+syn match puppetFunction "\<sprintf\>"
+syn match puppetFunction "\<step\>"
+syn match puppetFunction "\<strftime\>"
+syn match puppetFunction "\<tag\>"
+syn match puppetFunction "\<tagged\>"
+syn match puppetFunction "\<template\>"
+syn match puppetFunction "\<then\>"
+syn match puppetFunction "\<type\>"
+syn match puppetFunction "\<unwrap\>"
+syn match puppetFunction "\<versioncmp\>"
+syn match puppetFunction "\<warning\>"
+syn match puppetFunction "\<with\>"
+
+" Stdlib functions
+syn match puppetStdLibFunction "\<abs\>"
+syn match puppetStdLibFunction "\<any2array\>"
+syn match puppetStdLibFunction "\<any2bool\>"
+syn match puppetStdLibFunction "\<assert_private\>"
+syn match puppetStdLibFunction "\<base64\>"
+syn match puppetStdLibFunction "\<basename\>"
+syn match puppetStdLibFunction "\<bool2num\>"
+syn match puppetStdLibFunction "\<bool2str\>"
+syn match puppetStdLibFunction "\<camelcase\>"
+syn match puppetStdLibFunction "\<capitalize\>"
+syn match puppetStdLibFunction "\<ceiling\>"
+syn match puppetStdLibFunction "\<chomp\>"
+syn match puppetStdLibFunction "\<chop\>"
+syn match puppetStdLibFunction "\<clamp\>"
+syn match puppetStdLibFunction "\<concat\>"
+syn match puppetStdLibFunction "\<convert_base\>"
+syn match puppetStdLibFunction "\<count\>"
+syn match puppetStdLibFunction "\<deep_merge\>"
+syn match puppetStdLibFunction "\<defined_with_params\>"
+syn match puppetStdLibFunction "\<delete\>"
+syn match puppetStdLibFunction "\<delete_at\>"
+syn match puppetStdLibFunction "\<delete_regex\>"
+syn match puppetStdLibFunction "\<delete_undef_values\>"
+syn match puppetStdLibFunction "\<delete_values\>"
+syn match puppetStdLibFunction "\<deprecation\>"
+syn match puppetStdLibFunction "\<difference\>"
+syn match puppetStdLibFunction "\<dig\>"
+syn match puppetStdLibFunction "\<dig44\>"
+syn match puppetStdLibFunction "\<dirname\>"
+syn match puppetStdLibFunction "\<dos2unix\>"
+syn match puppetStdLibFunction "\<downcase\>"
+syn match puppetStdLibFunction "\<empty\>"
+syn match puppetStdLibFunction "\<enclose_ipv6\>"
+syn match puppetStdLibFunction "\<ensure_packages\>"
+syn match puppetStdLibFunction "\<ensure_resource\>"
+syn match puppetStdLibFunction "\<ensure_resources\>"
+syn match puppetStdLibFunction "\<flatten\>"
+syn match puppetStdLibFunction "\<floor\>"
+syn match puppetStdLibFunction "\<fqdn_rand_string\>"
+syn match puppetStdLibFunction "\<fqdn_rotate\>"
+syn match puppetStdLibFunction "\<get_module_path\>"
+syn match puppetStdLibFunction "\<getparam\>"
+syn match puppetStdLibFunction "\<getvar\>"
+syn match puppetStdLibFunction "\<grep\>"
+syn match puppetStdLibFunction "\<has_interface_with\>"
+syn match puppetStdLibFunction "\<has_ip_address\>"
+syn match puppetStdLibFunction "\<has_ip_network\>"
+syn match puppetStdLibFunction "\<has_key\>"
+syn match puppetStdLibFunction "\<hash\>"
+syn match puppetStdLibFunction "\<intersection\>"
+syn match puppetStdLibFunction "\<is_absolute_path\>"
+syn match puppetStdLibFunction "\<is_array\>"
+syn match puppetStdLibFunction "\<is_bool\>"
+syn match puppetStdLibFunction "\<is_domain_name\>"
+syn match puppetStdLibFunction "\<is_email_address\>"
+syn match puppetStdLibFunction "\<is_float\>"
+syn match puppetStdLibFunction "\<is_function_available\>"
+syn match puppetStdLibFunction "\<is_hash\>"
+syn match puppetStdLibFunction "\<is_integer\>"
+syn match puppetStdLibFunction "\<is_ip_address\>"
+syn match puppetStdLibFunction "\<is_ipv4_address\>"
+syn match puppetStdLibFunction "\<is_ipv6_address\>"
+syn match puppetStdLibFunction "\<is_mac_address\>"
+syn match puppetStdLibFunction "\<is_numeric\>"
+syn match puppetStdLibFunction "\<is_string\>"
+syn match puppetStdLibFunction "\<join\>"
+syn match puppetStdLibFunction "\<join_keys_to_values\>"
+syn match puppetStdLibFunction "\<keys\>"
+syn match puppetStdLibFunction "\<load_module_metadata\>"
+syn match puppetStdLibFunction "\<loadjson\>"
+syn match puppetStdLibFunction "\<loadyaml\>"
+syn match puppetStdLibFunction "\<lstrip\>"
+syn match puppetStdLibFunction "\<max\>"
+syn match puppetStdLibFunction "\<member\>"
+syn match puppetStdLibFunction "\<merge\>"
+syn match puppetStdLibFunction "\<min\>"
+syn match puppetStdLibFunction "\<num2bool\>"
+syn match puppetStdLibFunction "\<parsejson\>"
+syn match puppetStdLibFunction "\<parseyaml\>"
+syn match puppetStdLibFunction "\<pick\>"
+syn match puppetStdLibFunction "\<pick_default\>"
+syn match puppetStdLibFunction "\<prefix\>"
+syn match puppetStdLibFunction "\<private\>"
+syn match puppetStdLibFunction "\<pw_hash\>"
+syn match puppetStdLibFunction "\<range\>"
+syn match puppetStdLibFunction "\<regexpescape\>"
+syn match puppetStdLibFunction "\<reject\>"
+syn match puppetStdLibFunction "\<reverse\>"
+syn match puppetStdLibFunction "\<rstrip\>"
+syn match puppetStdLibFunction "\<seeded_rand\>"
+syn match puppetStdLibFunction "\<shell_escape\>"
+syn match puppetStdLibFunction "\<shell_join\>"
+syn match puppetStdLibFunction "\<shell_split\>"
+syn match puppetStdLibFunction "\<shuffle\>"
+syn match puppetStdLibFunction "\<size\>"
+syn match puppetStdLibFunction "\<sort\>"
+syn match puppetStdLibFunction "\<squeeze\>"
+syn match puppetStdLibFunction "\<str2bool\>"
+syn match puppetStdLibFunction "\<str2saltedsha512\>"
+syn match puppetStdLibFunction "\<strftime\>"
+syn match puppetStdLibFunction "\<strip\>"
+syn match puppetStdLibFunction "\<suffix\>"
+syn match puppetStdLibFunction "\<swapcase\>"
+syn match puppetStdLibFunction "\<time\>"
+syn match puppetStdLibFunction "\<to_bytes\>"
+syn match puppetStdLibFunction "\<try_get_value\>"
+syn match puppetStdLibFunction "\<type\>"
+syn match puppetStdLibFunction "\<type3x\>"
+syn match puppetStdLibFunction "\<union\>"
+syn match puppetStdLibFunction "\<unique\>"
+syn match puppetStdLibFunction "\<unix2dos\>"
+syn match puppetStdLibFunction "\<upcase\>"
+syn match puppetStdLibFunction "\<uriescape\>"
+syn match puppetStdLibFunction "\<validate_absolute_path\>"
+syn match puppetStdLibFunction "\<validate_array\>"
+syn match puppetStdLibFunction "\<validate_augeas\>"
+syn match puppetStdLibFunction "\<validate_bool\>"
+syn match puppetStdLibFunction "\<validate_cmd\>"
+syn match puppetStdLibFunction "\<validate_email_address\>"
+syn match puppetStdLibFunction "\<validate_hash\>"
+syn match puppetStdLibFunction "\<validate_integer\>"
+syn match puppetStdLibFunction "\<validate_ip_address\>"
+syn match puppetStdLibFunction "\<validate_ipv4_address\>"
+syn match puppetStdLibFunction "\<validate_ipv6_address\>"
+syn match puppetStdLibFunction "\<validate_numeric\>"
+syn match puppetStdLibFunction "\<validate_re\>"
+syn match puppetStdLibFunction "\<validate_slength\>"
+syn match puppetStdLibFunction "\<validate_string\>"
+syn match puppetStdLibFunction "\<validate_x509_rsa_key_pair\>"
+syn match puppetStdLibFunction "\<values\>"
+syn match puppetStdLibFunction "\<values_at\>"
+syn match puppetStdLibFunction "\<zip\>"
+
+syn match puppetType "\<Any\>"
+syn match puppetType "\<Array\>"
+syn match puppetType "\<Binary\>"
+syn match puppetType "\<Boolean\>"
+syn match puppetType "\<Callable\>"
+syn match puppetType "\<CatalogEntry\>"
+syn match puppetType "\<Class\>"
+syn match puppetType "\<Collection\>"
+syn match puppetType "\<Data\>"
+syn match puppetType "\<Default\>"
+syn match puppetType "\<Enum\>"
+syn match puppetType "\<Float\>"
+syn match puppetType "\<Hash\>"
+syn match puppetType "\<Integer\>"
+syn match puppetType "\<Iterable\>"
+syn match puppetType "\<Iterator\>"
+syn match puppetType "\<NotUndef\>"
+syn match puppetType "\<Numeric\>"
+syn match puppetType "\<Object\>"
+syn match puppetType "\<Optional\>"
+syn match puppetType "\<Pattern\>"
+syn match puppetType "\<Regexp\>"
+syn match puppetType "\<Resource\>"
+syn match puppetType "\<Runtime\>"
+syn match puppetType "\<Scalar\>"
+syn match puppetType "\<ScalarData\>"
+syn match puppetType "\<SemVer\>"
+syn match puppetType "\<SemVerRange\>"
+syn match puppetType "\<Sensitive\>"
+syn match puppetType "\<String\>"
+syn match puppetType "\<Struct\>"
+syn match puppetType "\<TimeSpan\>"
+syn match puppetType "\<Timestamp\>"
+syn match puppetType "\<Tuple\>"
+syn match puppetType "\<Type\>"
+syn match puppetType "\<TypeAlias\>"
+syn match puppetType "\<TypeReference\>"
+syn match puppetType "\<TypeSet\>"
+syn match puppetType "\<Undef\>"
+syn match puppetType "\<Unit\>"
+syn match puppetType "\<Variant\>"
+
+syn match puppetType "\<augeas\>"
+syn match puppetType "\<computer\>"
+syn match puppetType "\<cron\>"
+syn match puppetType "\<exec\>"
+syn match puppetType "\<file\>"
+syn match puppetType "\<filebucket\>"
+syn match puppetType "\<group\>"
+syn match puppetType "\<host\>"
+syn match puppetType "\<interface\>"
+syn match puppetType "\<k5login\>"
+syn match puppetType "\<macauthorization\>"
+syn match puppetType "\<mailalias\>"
+syn match puppetType "\<maillist\>"
+syn match puppetType "\<mcx\>"
+syn match puppetType "\<mount\>"
+syn match puppetType "\<nagios_command\>"
+syn match puppetType "\<nagios_contact\>"
+syn match puppetType "\<nagios_contactgroup\>"
+syn match puppetType "\<nagios_host\>"
+syn match puppetType "\<nagios_hostdependency\>"
+syn match puppetType "\<nagios_hostescalation\>"
+syn match puppetType "\<nagios_hostextinfo\>"
+syn match puppetType "\<nagios_hostgroup\>"
+syn match puppetType "\<nagios_service\>"
+syn match puppetType "\<nagios_servicedependency\>"
+syn match puppetType "\<nagios_serviceescalation\>"
+syn match puppetType "\<nagios_serviceextinfo\>"
+syn match puppetType "\<nagios_servicegroup\>"
+syn match puppetType "\<nagios_timeperiod\>"
+syn match puppetType "\<notify\>"
+syn match puppetType "\<package\>"
+syn match puppetType "\<resources\>"
+syn match puppetType "\<router\>"
+syn match puppetType "\<schedule\>"
+syn match puppetType "\<scheduled_task\>"
+syn match puppetType "\<selboolean\>"
+syn match puppetType "\<selmodule\>"
+syn match puppetType "\<service\>"
+syn match puppetType "\<ssh_authorized_key\>"
+syn match puppetType "\<sshkey\>"
+syn match puppetType "\<stage\>"
+syn match puppetType "\<tidy\>"
+syn match puppetType "\<user\>"
+syn match puppetType "\<vlan\>"
+syn match puppetType "\<whit\>"
+syn match puppetType "\<yumrepo\>"
+syn match puppetType "\<zfs\>"
+syn match puppetType "\<zone\>"
+syn match puppetType "\<zpool\>"
+
+" Normal String {{{1
+syn region puppetString matchgroup=puppetStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@puppetStringSpecial
+syn region puppetString matchgroup=puppetStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=puppetQuoteEscape
+
+" Normal Regular Expression {{{1
+syn region puppetRegexp matchgroup=puppetRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/" skip="\\\\\|\\/" contains=@puppetRegexpSpecial
+syn region puppetRegexp matchgroup=puppetRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/" skip="\\\\\|\\/" contains=@puppetRegexpSpecial
+
+" Here Document {{{1
+syn region puppetHeredocStart matchgroup=puppetStringDelimiter start=+@(\s*\%("[^"]\+"\|\w\+\)\%(/[nrtsuL$\\]*\)\=)+ end=+$+ oneline contains=ALLBUT,@puppetNotTop
+
+syn region puppetString start=+@(\s*"\z([^"]\+\)"\%(/[nrtsuL$\\]*\)\=+hs=s+2 matchgroup=puppetStringDelimiter end=+^\s*|\=\s*-\=\s*\zs\z1$+ contains=puppetHeredocStart,@puppetStringSpecial keepend
+syn region puppetString start=+@(\s*\z(\w\+\)\%(/[nrtsuL$\\]*\)\=+hs=s+2 matchgroup=puppetStringDelimiter end=+^\s*|\=\s*-\=\s*\zs\z1$+ contains=puppetHeredocStart keepend
" comments last overriding everything else
-syn match puppetComment "\s*#.*$" contains=puppetTodo,@Spell
-syn region puppetMultilineComment start="/\*" end="\*/" contains=puppetTodo,@Spell
-syn keyword puppetTodo TODO NOTE FIXME XXX BUG HACK contained
-syn keyword puppetTodo TODO: NOTE: FIXME: XXX: BUG: HACK: contained
+syn match puppetComment "\s*#.*$" contains=puppetTodo,@Spell
+syn region puppetComment start="/\*" end="\*/" contains=puppetTodo,@Spell extend
+syn keyword puppetTodo TODO NOTE FIXME XXX BUG HACK contained
" Define the default highlighting.
-" For version 5.7 and earlier: only when not done already
-" For version 5.8 and later: only when an item doesn't have highlighting yet
-if version >= 508 || !exists("did_puppet_syn_inits")
- if version < 508
- let did_puppet_syn_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- HiLink puppetVariable Identifier
- HiLink puppetType Identifier
- HiLink puppetKeyword Keyword
- HiLink puppetComment Comment
- HiLink puppetMultilineComment Comment
- HiLink puppetString String
- HiLink puppetRegex Constant
- HiLink puppetRegexParen Delimiter
- HiLink puppetRegexBrace Delimiter
- HiLink puppetRegexBrack Delimiter
- HiLink puppetRegexAngBrack Delimiter
- HiLink puppetRegexTick Delimiter
- HiLink puppetRegexOr Delimiter
- HiLink puppetRegexSubName Identifier
- HiLink puppetRegexSpecChar SpecialChar
- HiLink puppetRegexComment Comment
- HiLink puppetParamKeyword Keyword
- HiLink puppetParamDigits String
- HiLink puppetNotVariable String
- HiLink puppetParamSpecial Boolean
- HiLink puppetSpecial Special
- HiLink puppetTodo Todo
- HiLink puppetBrack Delimiter
- HiLink puppetTypeBrack Delimiter
- HiLink puppetBrace Delimiter
- HiLink puppetTypeBrace Delimiter
- HiLink puppetParen Delimiter
- HiLink puppetDelimiter Delimiter
- HiLink puppetControl Statement
- HiLink puppetDefType Define
- HiLink puppetDefName Type
- HiLink puppetNodeRe Type
- HiLink puppetTypeName Statement
- HiLink puppetTypeDefault Type
- HiLink puppetParamName Identifier
- HiLink puppetArgument Identifier
- HiLink puppetFunction Function
- HiLink puppetClass Include
-
- delcommand HiLink
-endif
+command -nargs=+ HiLink hi def link <args>
+
+HiLink puppetRegexp puppetConstant
+HiLink puppetStdLibFunction puppetFunction
+HiLink puppetNoInterpolation puppetString
+HiLink puppetFunction Function
+HiLink puppetOperator Operator
+HiLink puppetString String
+HiLink puppetWord String
+HiLink puppetFloat Float
+HiLink puppetInteger Number
+HiLink puppetBoolean Boolean
+HiLink puppetName puppetIdentifier
+HiLink puppetNameBad Error
+HiLink puppetVariable puppetIdentifier
+HiLink puppetIdentifier Identifier
+HiLink puppetType Type
+HiLink puppetConditional Conditional
+HiLink puppetConstant Constant
+HiLink puppetControl Statement
+HiLink puppetKeyword Keyword
+HiLink puppetStringDelimiter Delimiter
+HiLink puppetDelimiter Delimiter
+HiLink puppetTodo Todo
+HiLink puppetComment Comment
+
+delcommand HiLink
let b:current_syntax = "puppet"
diff --git a/syntax/python.vim b/syntax/python.vim
index b55dc658..55f20a36 100644
--- a/syntax/python.vim
+++ b/syntax/python.vim
@@ -99,7 +99,7 @@ syn keyword pythonException try except finally
syn keyword pythonOperator and in is not or
" Print keyword but only if not used as function
-syn match pythonStatement "\<print\>\((\)\@!" display
+syn match pythonStatement "\<print\>\((\|,\|*=\)\@!" display
" Decorators (new in Python 2.4)
syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite
diff --git a/syntax/rust.vim b/syntax/rust.vim
index dd225116..c398252c 100644
--- a/syntax/rust.vim
+++ b/syntax/rust.vim
@@ -132,6 +132,7 @@ syn match rustOperator display "&&\|||"
" This is rustArrowCharacter rather than rustArrow for the sake of matchparen,
" so it skips the ->; see http://stackoverflow.com/a/30309949 for details.
syn match rustArrowCharacter display "->"
+syn match rustQuestionMark display "?\([a-zA-Z]\+\)\@!"
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic
@@ -280,6 +281,7 @@ hi def link rustInvalidBareKeyword Error
hi def link rustExternCrate rustKeyword
hi def link rustObsoleteExternMod Error
hi def link rustBoxPlacementParens Delimiter
+hi def link rustQuestionMark Special
" Other Suggestions:
" hi rustAttribute ctermfg=cyan
diff --git a/syntax/swift.vim b/syntax/swift.vim
index 7970859a..ae7f9835 100644
--- a/syntax/swift.vim
+++ b/syntax/swift.vim
@@ -105,6 +105,7 @@ syntax keyword swiftAvailabilityArg renamed unavailable introduced deprecated ob
" Keywords {{{
syntax keyword swiftKeywords
\ associatedtype
+ \ associativity
\ atexit
\ break
\ case
@@ -143,6 +144,8 @@ syntax keyword swiftKeywords
\ optional
\ override
\ postfix
+ \ precedence
+ \ precedencegroup
\ prefix
\ private
\ protocol
@@ -181,6 +184,7 @@ syntax keyword swiftAttributes
\ @autoclosure
\ @available
\ @convention
+ \ @discardableResult
\ @exported
\ @IBAction
\ @IBDesignable
diff --git a/syntax/tmux.vim b/syntax/tmux.vim
index abf4c21a..0cfe740c 100644
--- a/syntax/tmux.vim
+++ b/syntax/tmux.vim
@@ -276,6 +276,7 @@ syn keyword tmuxOptsSetw
\ window-status-activity-style
\ window-status-bell-style
\ window-status-current-bg
+ \ window-status-current-fg
\ window-status-current-format
\ window-status-current-style
\ window-status-format