From bc8a81d3592dab86334f27d1d43c080ebf680d42 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 14 Oct 2022 17:40:10 +0200 Subject: [PATCH] Update --- README.md | 13 +- after/syntax/cpp.vim | 23 +- after/syntax/reason/graphql.vim | 2 +- after/syntax/rescript/graphql.vim | 2 +- after/syntax/zsh.vim | 4 +- autoload/LaTeXtoUnicode.vim | 2 +- autoload/clojurecomplete.vim | 2 +- autoload/coc/source/requirements.vim | 24 ++ autoload/crystal/indent.vim | 6 +- autoload/csv.vim | 11 +- autoload/dart.vim | 98 +++-- autoload/fsharp.vim | 2 +- autoload/ledger.vim | 28 +- autoload/polyglot/init.vim | 18 +- autoload/polyglot/shebang.vim | 1 + autoload/polyglot/sleuth.vim | 15 +- autoload/requirements.vim | 70 ++-- autoload/requirements/utils.vim | 15 + compiler/cargo.vim | 2 + compiler/pip_compile.vim | 49 +++ extras/jsdoc.vim | 3 +- ftplugin/caddyfile.vim | 7 +- ftplugin/erlang.vim | 22 +- ftplugin/eruby.vim | 10 +- ftplugin/gitcommit.vim | 15 +- ftplugin/gitrebase.vim | 2 +- ftplugin/haml.vim | 2 +- ftplugin/julia.vim | 6 + ftplugin/markdown.vim | 6 +- ftplugin/mir.vim | 17 + ftplugin/ps1.vim | 2 +- {after/ftplugin => ftplugin}/requirements.vim | 26 +- ftplugin/zig.vim | 7 + indent/clojure.vim | 11 + indent/dart.vim | 7 +- indent/erlang.vim | 141 ++++--- indent/gdscript3.vim | 204 ---------- indent/glsl.vim | 1 + indent/haml.vim | 2 +- indent/ruby.vim | 2 +- indent/zig.vim | 2 + packages.yaml | 9 - syntax/basic/keyword.vim | 16 +- syntax/basic/literal.vim | 17 +- syntax/caddyfile.vim | 39 +- syntax/clojure.vim | 4 +- syntax/erlang.vim | 17 +- syntax/gdscript3.vim | 101 ----- syntax/git.vim | 4 +- syntax/gitcommit.vim | 2 +- syntax/gitrebase.vim | 2 +- syntax/go.vim | 66 +++- syntax/gsl.vim | 63 --- syntax/haml.vim | 2 +- syntax/help.vim | 3 +- syntax/javascript.vim | 40 +- syntax/julia.vim | 18 +- syntax/kotlin.vim | 7 +- syntax/llvm.vim | 77 ++-- syntax/machine-ir.vim | 42 ++ syntax/meson.vim | 1 + syntax/mir.vim | 52 +++ syntax/mlir.vim | 34 +- syntax/ocaml.vim | 372 +++++++++++++++--- syntax/odin.vim | 14 +- syntax/openscad.vim | 2 +- syntax/qml.vim | 6 +- syntax/requirements.vim | 20 +- syntax/ruby.vim | 10 +- syntax/solidity.vim | 2 +- syntax/swayconfig.vim | 64 ++- syntax/swift.vim | 1 + syntax/tmux.vim | 4 +- tests/filetypes.vim | 1 - 74 files changed, 1218 insertions(+), 776 deletions(-) create mode 100644 autoload/coc/source/requirements.vim create mode 100644 autoload/requirements/utils.vim create mode 100644 compiler/pip_compile.vim create mode 100644 ftplugin/mir.vim rename {after/ftplugin => ftplugin}/requirements.vim (76%) delete mode 100644 indent/gdscript3.vim delete mode 100644 syntax/gdscript3.vim delete mode 100644 syntax/gsl.vim create mode 100644 syntax/machine-ir.vim create mode 100644 syntax/mir.vim diff --git a/README.md b/README.md index 0bb21ce9f..113ce5a60 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ A collection of language packs for Vim. > One to rule them all, one to find them, one to bring them all and in the darkness bind them. - It **won't affect your startup time**, as scripts are loaded only on demand\*. -- It **installs and updates 120+ times faster** than the 599 packages it consists of. +- It **installs and updates 120+ times faster** than the 598 packages it consists of. - It is also more secure (scripts loaded for every filetype are generated by vim-polyglot) - Best syntax and indentation support (no other features). Hand-selected language packs. - Automatically detects indentation (includes performance-optimized version of [vim-sleuth](https://github.com/tpope/vim-sleuth), can be disabled) @@ -62,7 +62,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr - [caddyfile](https://github.com/isobit/vim-caddyfile) - [carp](https://github.com/hellerve/carp-vim) (Syntax highlighting for carp files) - [cjsx](https://github.com/mtscout6/vim-cjsx) -- [clojure](https://github.com/clojure-vim/clojure.vim) (Clojure syntax highlighting for clj, boot, cl2, cljc, cljs, cljs.hl, cljscm, cljx, hic and edn files) +- [clojure](https://github.com/clojure-vim/clojure.vim) (Clojure syntax highlighting for clj, bb, boot, cl2, cljc and 6 more files) - [cmake](https://github.com/pboettch/vim-cmake-syntax) (CMake syntax highlighting for cmake and cmake.in files) - [coffee-script](https://github.com/kchmck/vim-coffee-script) (CoffeeScript and Literate CoffeeScript syntax highlighting for coffee, cake, cjsx, iced, coffeekup, cson, litcoffee and coffee.md files) - [cpp-modern](https://github.com/bfrg/vim-cpp-modern) @@ -86,7 +86,6 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr - [fish](https://github.com/blankname/vim-fish) (fish syntax highlighting for fish files) - [flatbuffers](https://github.com/dcharbon/vim-flatbuffers) (Syntax highlighting for fbs files) - [fsharp](https://github.com/ionide/Ionide-vim) (F# syntax highlighting for fs, fsi and fsx files) -- [gdscript](https://github.com/calviken/vim-gdscript3) (GDScript syntax highlighting for gd files) - [git](https://github.com/tpope/vim-git) (Git Config syntax highlighting for gitconfig files) - [gitignore](https://github.com/SirJson/fzf-gitignore) - [gleam](https://github.com/gleam-lang/gleam.vim) (Syntax highlighting for gleam files) @@ -115,7 +114,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr - [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (Syntax highlighting for jenkinsfile and Jenkinsfile files) - [jq](https://github.com/vito-c/jq.vim) (JSONiq syntax highlighting for jq files) - [json5](https://github.com/GutenYe/json5.vim) (JSON5 syntax highlighting for json5 files) -- [json](https://github.com/elzr/vim-json) (JSON syntax highlighting for json, avsc, geojson, gltf, har and 13 more files) +- [json](https://github.com/elzr/vim-json) (JSON syntax highlighting for json, 4DForm, 4DProject, avsc, geojson and 15 more files) - [jsonc](https://github.com/neoclide/jsonc.vim) (Syntax highlighting for cjson and jsonc files) - [jsonnet](https://github.com/google/vim-jsonnet) (Jsonnet syntax highlighting for jsonnet and libsonnet files) - [jst](https://github.com/briancollins/vim-jst) (EJS syntax highlighting for ejs, ect, ejs.t and jst files) @@ -130,7 +129,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr - [log](https://github.com/MTDL9/vim-log-highlighting) (Syntax highlighting for log and LOG files) - [lua](https://github.com/tbastos/vim-lua) (Lua syntax highlighting for lua, fcgi, nse, p8, rbxs, rockspec and wlua files) - [mako](https://github.com/sophacles/vim-bundle-mako) (Mako syntax highlighting for mako and mao files) -- [markdown](https://github.com/plasticboy/vim-markdown) (Markdown syntax highlighting for md, markdown, mdown, mdwn, mkd, mkdn, mkdown, ronn, scd and workbook files) +- [markdown](https://github.com/plasticboy/vim-markdown) (Markdown syntax highlighting for md, livemd, markdown, mdown, mdwn and 6 more files) - [mathematica](https://github.com/voldikss/vim-mma) (Mathematica syntax highlighting for mathematica, cdf, m, ma, mt and 6 more files) - [mdx](https://github.com/jxnblk/vim-mdx-js) (Syntax highlighting for mdx files) - [mermaid](https://github.com/mracos/mermaid.vim/tree/main) (Syntax highlighting for mermaid, mm and mmd files) @@ -198,7 +197,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr - [toml](https://github.com/cespare/vim-toml/tree/main) (TOML syntax highlighting for toml files) - [tptp](https://github.com/c-cube/vim-tptp) (Syntax highlighting for p, tptp and ax files) - [twig](https://github.com/lumiliet/vim-twig) (Twig syntax highlighting for twig and xml.twig files) -- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (TypeScript and TSX syntax highlighting for ts and tsx files) +- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (TypeScript and TSX syntax highlighting for ts, cts, mts and tsx files) - [unison](https://github.com/unisonweb/unison/tree/trunk/editor-support/vim) (Syntax highlighting for u and uu files) - [v](https://github.com/ollykel/v-vim) (V syntax highlighting for v, vv and vsh files) - [vala](https://github.com/arrufat/vala.vim) (Vala syntax highlighting for vala, vapi and valadoc files) @@ -207,7 +206,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr - [velocity](https://github.com/lepture/vim-velocity) (Syntax highlighting for vm files) - [vue](https://github.com/posva/vim-vue) (Vue syntax highlighting for vue and wpy files) - [xdc](https://github.com/amal-khailtash/vim-xdc-syntax) (Syntax highlighting for xdc files) -- [xml](https://github.com/amadeus/vim-xml) (XML syntax highlighting for xml, adml, admx, ant, axaml and 96 more files) +- [xml](https://github.com/amadeus/vim-xml) (XML syntax highlighting for xml, adml, admx, ant, axaml and 97 more files) - [xsl](https://github.com/vim-scripts/XSLT-syntax) (XSLT syntax highlighting for xslt and xsl files) - [yard](https://github.com/noprompt/vim-yardoc) - [zephir](https://github.com/xwsoul/vim-zephir) (Zephir syntax highlighting for zep files) diff --git a/after/syntax/cpp.vim b/after/syntax/cpp.vim index c8d98dbbd..2e8f5ac6e 100644 --- a/after/syntax/cpp.vim +++ b/after/syntax/cpp.vim @@ -8,7 +8,7 @@ endif " Original Author: Jon Haggblad " Maintainer: bfrg " Website: https://github.com/bfrg/vim-cpp-modern -" Last Change: Nov 23, 2020 +" Last Change: Sep 15, 2022 " " This syntax file is based on: " https://github.com/octol/vim-cpp-enhanced-highlight @@ -70,7 +70,7 @@ if !exists('cpp_no_cpp11') syntax keyword cppSTLnamespace chrono this_thread syntax keyword cppSTLtype - \ array atomic atomic_bool atomic_char atomic_flag atomic_int atomic_llong atomic_long atomic_schar atomic_short atomic_uchar atomic_uint atomic_ullong atomic_ulong atomic_ushort duration duration_values high_resolution_clock hours microseconds milliseconds minutes nanoseconds seconds steady_clock system_clock time_point treat_as_floating_point condition_variable exception_ptr nested_exception hash is_bind_expression is_placeholder reference_wrapper forward_list future packaged_task promise shared_future initializer_list codecvt_mode codecvt_utf16 codecvt_utf8 codecvt_utf8_utf16 wbuffer_convert wstring_convert allocator_traits allocator_type default_delete enable_shared_from_this is_always_equal owner_less pointer_safety pointer_traits propagate_on_container_copy_assignment propagate_on_container_move_assignment propagate_on_container_swap rebind_alloc rebind_traits shared_ptr unique_ptr uses_allocator void_pointer const_void_pointer weak_ptr condition_variable_any lock_guard mutex once_flag recursive_mutex recursive_timed_mutex timed_mutex unique_lock bernoulli_distribution binomial_distribution cauchy_distribution chi_squared_distribution default_random_engine discard_block_engine discrete_distribution exponential_distribution extreme_value_distribution fisher_f_distribution gamma_distribution geometric_distribution independent_bits_engine knuth_b linear_congruential_engine lognormal_distribution mersenne_twister_engine minstd_rand minstd_rand0 mt19937 mt19937_64 negative_binomial_distribution normal_distribution piecewise_constant_distribution piecewise_linear_distribution poisson_distribution random_device ranlux24 ranlux24_base ranlux48 ranlux48_base seed_seq shuffle_order_engine student_t_distribution subtract_with_carry_engine uniform_int_distribution uniform_real_distribution weibull_distribution atto centi deca deci exa femto giga hecto kilo mega micro milli nano peta pico ratio ratio_add ratio_divide ratio_equal ratio_greater ratio_greater_equal ratio_less ratio_less_equal ratio_multiply ratio_not_equal ratio_subtract tera yocto yotta zepto zetta basic_regex match_results regex_traits sub_match syntax_option_type match_flag_type error_type scoped_allocator_adaptor outer_allocator_type inner_allocator_type error_code error_condition error_category is_error_code_enum is_error_condition_enum thread tuple tuple_size tuple_element type_index add_const add_cv add_lvalue_reference add_pointer add_rvalue_reference add_volatile aligned_storage aligned_union alignment_of common_type conditional decay enable_if extent false_type has_virtual_destructor integral_constant is_abstract is_arithmetic is_array is_assignable is_base_of is_class is_compound is_const is_constructible is_convertible is_copy_assignable is_copy_constructible is_default_constructible is_destructible is_empty is_enum is_floating_point is_function is_fundamental is_integral is_literal_type is_lvalue_reference is_member_function_pointer is_member_object_pointer is_member_pointer is_move_assignable is_move_constructible is_nothrow_assignable is_nothrow_constructible is_nothrow_copy_assignable is_nothrow_copy_constructible is_nothrow_default_constructible is_nothrow_destructible is_nothrow_move_assignable is_nothrow_move_constructible is_object is_pod is_pointer is_polymorphic is_reference is_rvalue_reference is_same is_scalar is_signed is_standard_layout is_trivial is_trivially_assignable is_trivially_constructible is_trivially_copy_assignable is_trivially_copy_constructible is_trivially_copyable is_trivially_default_constructible is_trivially_destructible is_trivially_move_assignable is_trivially_move_constructible is_union is_unsigned is_void is_volatile make_signed make_unsigned rank remove_all_extents remove_const remove_cv remove_extent remove_pointer remove_reference remove_volatile result_of true_type underlying_type hasher key_equal unordered_map unordered_multimap unordered_multiset unordered_set function + \ array atomic atomic_bool atomic_char atomic_flag atomic_int atomic_llong atomic_long atomic_schar atomic_short atomic_uchar atomic_uint atomic_ullong atomic_ulong atomic_ushort duration duration_values high_resolution_clock hours microseconds milliseconds minutes nanoseconds seconds steady_clock system_clock time_point treat_as_floating_point condition_variable exception_ptr nested_exception hash is_bind_expression is_placeholder reference_wrapper forward_list future packaged_task promise shared_future initializer_list codecvt_mode codecvt_utf16 codecvt_utf8 codecvt_utf8_utf16 wbuffer_convert wstring_convert allocator_traits allocator_type default_delete enable_shared_from_this is_always_equal owner_less pointer_safety pointer_traits propagate_on_container_copy_assignment propagate_on_container_move_assignment propagate_on_container_swap rebind_alloc rebind_traits shared_ptr unique_ptr uses_allocator void_pointer const_void_pointer weak_ptr condition_variable_any lock_guard mutex once_flag recursive_mutex recursive_timed_mutex timed_mutex unique_lock bernoulli_distribution binomial_distribution cauchy_distribution chi_squared_distribution default_random_engine discard_block_engine discrete_distribution exponential_distribution extreme_value_distribution fisher_f_distribution gamma_distribution geometric_distribution independent_bits_engine knuth_b linear_congruential_engine lognormal_distribution mersenne_twister_engine minstd_rand minstd_rand0 mt19937 mt19937_64 negative_binomial_distribution normal_distribution piecewise_constant_distribution piecewise_linear_distribution poisson_distribution random_device ranlux24 ranlux24_base ranlux48 ranlux48_base seed_seq shuffle_order_engine student_t_distribution subtract_with_carry_engine uniform_int_distribution uniform_real_distribution weibull_distribution atto centi deca deci exa femto giga hecto kilo mega micro milli nano peta pico ratio ratio_add ratio_divide ratio_equal ratio_greater ratio_greater_equal ratio_less ratio_less_equal ratio_multiply ratio_not_equal ratio_subtract tera yocto yotta zepto zetta basic_regex regex wregex match_results regex_traits sub_match syntax_option_type match_flag_type error_type scoped_allocator_adaptor outer_allocator_type inner_allocator_type error_code error_condition error_category is_error_code_enum is_error_condition_enum thread tuple tuple_size tuple_element type_index add_const add_cv add_lvalue_reference add_pointer add_rvalue_reference add_volatile aligned_storage aligned_union alignment_of common_type conditional decay enable_if extent false_type has_virtual_destructor integral_constant is_abstract is_arithmetic is_array is_assignable is_base_of is_class is_compound is_const is_constructible is_convertible is_copy_assignable is_copy_constructible is_default_constructible is_destructible is_empty is_enum is_floating_point is_function is_fundamental is_integral is_literal_type is_lvalue_reference is_member_function_pointer is_member_object_pointer is_member_pointer is_move_assignable is_move_constructible is_nothrow_assignable is_nothrow_constructible is_nothrow_copy_assignable is_nothrow_copy_constructible is_nothrow_default_constructible is_nothrow_destructible is_nothrow_move_assignable is_nothrow_move_constructible is_object is_pod is_pointer is_polymorphic is_reference is_rvalue_reference is_same is_scalar is_signed is_standard_layout is_trivial is_trivially_assignable is_trivially_constructible is_trivially_copy_assignable is_trivially_copy_constructible is_trivially_copyable is_trivially_default_constructible is_trivially_destructible is_trivially_move_assignable is_trivially_move_constructible is_union is_unsigned is_void is_volatile make_signed make_unsigned rank remove_all_extents remove_const remove_cv remove_extent remove_pointer remove_reference remove_volatile result_of true_type underlying_type hasher key_equal unordered_map unordered_multimap unordered_multiset unordered_set function syntax keyword cppSTLtypedef \ atomic_char16_t atomic_char32_t atomic_int_fast16_t atomic_int_fast32_t atomic_int_fast64_t atomic_int_fast8_t atomic_int_least16_t atomic_int_least32_t atomic_int_least64_t atomic_int_least8_t atomic_intmax_t atomic_intptr_t atomic_ptrdiff_t atomic_size_t atomic_uint_fast16_t atomic_uint_fast32_t atomic_uint_fast64_t atomic_uint_fast8_t atomic_uint_least16_t atomic_uint_least32_t atomic_uint_least64_t atomic_uint_least8_t atomic_uintmax_t atomic_uintptr_t atomic_wchar_t nullptr_t max_align_t allocator_arg_t adopt_lock_t defer_lock_t try_to_lock_t piecewise_construct_t @@ -92,7 +92,6 @@ if !exists('cpp_no_cpp11') syntax keyword cppSTLexception \ bad_function_call future_error regex_error system_error bad_weak_ptr bad_array_new_length - " syntax keyword cppSTLiterator contained syntax keyword cppSTLiterator \ move_iterator regex_iterator regex_token_iterator const_local_iterator local_iterator @@ -120,7 +119,7 @@ if !exists('cpp_no_cpp17') syntax keyword cppSTLnamespace filesystem execution string_view_literals syntax keyword cppSTLtype - \ any byte is_execution_policy parallel_policy parallel_unsequenced_policy sequenced_policy directory_entry directory_iterator file_status file_time_type path recursive_directory_iterator space_info default_order default_searcher boyer_moore_searcher boyer_moore_horspool_searcher memory_resource monotonic_buffer_resource polymorphic_allocator pool_options synchronized_pool_resource unsynchronized_pool_resource scoped_lock optional shared_mutex basic_string_view string_view u16string_view u32string_view wstring_view bool_constant conjunction disjunction has_unique_object_representations invoke_result is_aggregate is_callable is_invocable is_invocable_r is_nothrow_invocable is_nothrow_invocable_r is_nothrow_swappable is_nothrow_swappable_with is_nowthrow_callable is_swappable is_swappable_with negation node_type insert_return_type in_place_tag monostate variant variant_size variant_alternative + \ any byte is_execution_policy parallel_policy parallel_unsequenced_policy sequenced_policy directory_entry directory_iterator file_status file_time_type path recursive_directory_iterator space_info default_order default_searcher boyer_moore_searcher boyer_moore_horspool_searcher memory_resource monotonic_buffer_resource polymorphic_allocator pool_options synchronized_pool_resource unsynchronized_pool_resource scoped_lock optional shared_mutex basic_string_view string_view u16string_view u32string_view wstring_view bool_constant conjunction disjunction has_unique_object_representations invoke_result is_aggregate is_callable is_invocable is_invocable_r is_nothrow_invocable is_nothrow_invocable_r is_nothrow_swappable is_nothrow_swappable_with is_nowthrow_callable is_swappable is_swappable_with negation node_type insert_return_type in_place_tag monostate variant variant_size variant_alternative from_chars_result to_chars_result chars_format syntax keyword cppSTLtypedef \ invoke_result_t default_order_t nullopt_t void_t in_place_t in_place_type_t in_place_index_t variant_alternative_t @@ -157,12 +156,13 @@ if !exists('cpp_no_cpp20') syntax keyword cppSTLnamespace ranges views syntax keyword cppSTLconstant dynamic_extent syntax keyword cppSTLvariable default_sentinel unreachable_sentinel + syntax keyword cppSTLexception format_error syntax keyword cppSTLtype - \ atomic_ref endian weak_ordering strong_ordering partial_ordering weak_equality strong_equality common_comparison_category contract_violation coroutine_traits coroutine_handle noop_coroutine_handle noop_coroutine_promise suspend_never suspend_always remove_cvref is_bounded_array is_layout_compatible is_unbounded_array is_nothrow_convertible has_strong_structural_equality is_pointer_interconvertible_base_of unwrap_reference unwrap_ref_decay basic_common_reference common_reference dangling ref_view filter_view transform_view iota_view join_view empty_view single_view split_view common_view reverse_view view_interface span basic_syncbuf basic_osyncstream syncbuf wsyncbuf osyncstream wosyncstream jthread latch barrier stop_token stop_source stop_callback counting_semaphore binary_semaphore source_location compare_three_way_result contiguous_iterator_tag incrementable_traits indirectly_readable_traits move_sentinel common_iterator counted_iterator projected type_identity + \ atomic_ref endian weak_ordering strong_ordering partial_ordering weak_equality strong_equality common_comparison_category contract_violation coroutine_traits coroutine_handle noop_coroutine_handle noop_coroutine_promise suspend_never suspend_always remove_cvref is_bounded_array is_layout_compatible is_unbounded_array is_nothrow_convertible has_strong_structural_equality is_pointer_interconvertible_base_of unwrap_reference unwrap_ref_decay basic_common_reference common_reference dangling ref_view filter_view transform_view iota_view join_view empty_view single_view split_view common_view reverse_view view_interface span basic_syncbuf basic_osyncstream syncbuf wsyncbuf osyncstream wosyncstream jthread latch barrier stop_token stop_source stop_callback counting_semaphore binary_semaphore source_location compare_three_way_result contiguous_iterator_tag incrementable_traits indirectly_readable_traits move_sentinel common_iterator counted_iterator projected type_identity formatter basic_format_context basic_format_args basic_format_string basic_format_parse_context syntax keyword cppSTLtypedef - \ common_comparison_category_t remove_cvref_t unwrap_reference_t unwrap_ref_decay_t common_reference_t iterator_t sentinel_t safe_iterator_t safe_subrange_t compare_three_way_result_t iter_value_t iter_reference_t iter_difference_t iter_rvalue_reference_t iter_common_reference_t default_sentinel_t unreachable_sentinel_t indirect_result_t type_identity_t + \ common_comparison_category_t remove_cvref_t unwrap_reference_t unwrap_ref_decay_t common_reference_t iterator_t sentinel_t safe_iterator_t safe_subrange_t compare_three_way_result_t iter_value_t iter_reference_t iter_difference_t iter_rvalue_reference_t iter_common_reference_t default_sentinel_t unreachable_sentinel_t indirect_result_t type_identity_t format_context wformat_context format_args wformat_args format_string wformat_string format_parse_context wformat_parse_context syntax keyword cppSTLfunction \ make_unique_default_init make_shared_default_init allocate_shared_default_init uses_allocator_construction_args make_obj_using_allocator is_corresponding_member subspan in_range is_pointer_interconvertible_with_class @@ -175,6 +175,17 @@ if !exists('cpp_no_cpp20') endif +" C++23 extensions {{{1 +if !exists('cpp_no_cpp23') + syntax keyword cppSTLtype basic_stacktrace stacktrace_entry is_scoped_enum + syntax keyword cppSTLtypedef stacktrace + syntax keyword cppSTLbool is_scoped_enum_v + syntax keyword cppSTLfunction invoke_r + syntax keyword cppSTLtype expected unexpected unexpect_t bad_expected_access + syntax keyword cppSTLvariable unexpect +endif + + " Boost {{{1 if !exists('cpp_no_boost') syntax keyword cppSTLnamespace boost diff --git a/after/syntax/reason/graphql.vim b/after/syntax/reason/graphql.vim index af28b8e4e..47a63e624 100644 --- a/after/syntax/reason/graphql.vim +++ b/after/syntax/reason/graphql.vim @@ -38,5 +38,5 @@ if exists('s:current_syntax') let b:current_syntax = s:current_syntax endif -syntax region graphqlExtensionPoint start=+\[%graphql+ end=+\]+ contains=graphqlExtensionPointS +syntax region graphqlExtensionPoint start=+\[%\(graphql\|relay\)+ end=+\]+ contains=graphqlExtensionPointS syntax region graphqlExtensionPointS matchgroup=String start=+{|+ end=+|}+ contains=@GraphQLSyntax contained diff --git a/after/syntax/rescript/graphql.vim b/after/syntax/rescript/graphql.vim index f78913387..1e5ed04ca 100644 --- a/after/syntax/rescript/graphql.vim +++ b/after/syntax/rescript/graphql.vim @@ -38,5 +38,5 @@ if exists('s:current_syntax') let b:current_syntax = s:current_syntax endif -syntax region graphqlExtensionPoint start=+%graphql(+ end=+)+ contains=graphqlExtensionPointS +syntax region graphqlExtensionPoint start=+%\(graphql\|relay\)(+ end=+)+ contains=graphqlExtensionPointS syntax region graphqlExtensionPointS matchgroup=String start=+`+ end=+`+ contains=@GraphQLSyntax contained diff --git a/after/syntax/zsh.vim b/after/syntax/zsh.vim index 118345c43..90349e37d 100644 --- a/after/syntax/zsh.vim +++ b/after/syntax/zsh.vim @@ -82,7 +82,7 @@ syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(param\)"+ skip=+\\" \ contains=ZinitIceDoubleQuoteParam " added by the existing annexes -syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(fbin\|sbin\|gem\|node\|pip\|fmod\|fsrc\|ferc\)"+ skip=+\\"+ end=+"+ skipwhite contained +syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(fbin\|lbin\|sbin\|gem\|node\|pip\|fmod\|fsrc\|ferc\)"+ skip=+\\"+ end=+"+ skipwhite contained \ nextgroup=@ZinitLine,ZinitContinue \ contains=ZinitIceDoubleQuoteParam syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(dl\|patch\|submods\|cargo\|dlink\|dlink0\)"+ skip=+\\"+ end=+"+ skipwhite contained @@ -118,7 +118,7 @@ syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(param\)'+ skip=+\\' \ contains=ZinitIceSingleQuoteParam " added by the existing annexes -syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(fbin\|sbin\|gem\|node\|pip\|fmod\|fsrc\|ferc\)'+ skip=+\\'+ end=+'+ skipwhite contained +syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(fbin\|lbin\|sbin\|gem\|node\|pip\|fmod\|fsrc\|ferc\)'+ skip=+\\'+ end=+'+ skipwhite contained \ nextgroup=@ZinitLine,ZinitContinue \ contains=ZinitIceSingleQuoteParam syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(dl\|patch\|submods\|cargo\|dlink\|dlink0\)'+ skip=+\\'+ end=+'+ skipwhite contained diff --git a/autoload/LaTeXtoUnicode.vim b/autoload/LaTeXtoUnicode.vim index 86420ccac..b512a734e 100644 --- a/autoload/LaTeXtoUnicode.vim +++ b/autoload/LaTeXtoUnicode.vim @@ -348,7 +348,7 @@ endfunction " be reinstated if needed. function! s:L2U_SetFallbackMapping(s, k) let mmdict = maparg(a:s, 'i', 0, 1) - if empty(mmdict) + if empty(mmdict) || !has_key(mmdict, "rhs") exe 'inoremap ' . a:k . ' ' . a:s return mmdict endif diff --git a/autoload/clojurecomplete.vim b/autoload/clojurecomplete.vim index e5dfb205a..31065c1fe 100644 --- a/autoload/clojurecomplete.vim +++ b/autoload/clojurecomplete.vim @@ -12,7 +12,7 @@ endif " -*- COMPLETION WORDS -*- " Generated from https://github.com/clojure-vim/clojure.vim/blob/%%RELEASE_TAG%%/clj/src/vim_clojure_static/generate.clj -" Clojure version 1.11.0 +" Clojure version 1.11.1 let s:words = ["&","*","*'","*1","*2","*3","*agent*","*allow-unresolved-vars*","*assert*","*clojure-version*","*command-line-args*","*compile-files*","*compile-path*","*compiler-options*","*data-readers*","*default-data-reader-fn*","*e","*err*","*file*","*flush-on-newline*","*fn-loader*","*in*","*math-context*","*ns*","*out*","*print-dup*","*print-length*","*print-level*","*print-meta*","*print-namespace-maps*","*print-readably*","*read-eval*","*reader-resolver*","*source-path*","*suppress-read*","*unchecked-math*","*use-context-classloader*","*verbose-defrecords*","*warn-on-reflection*","+","+'","-","-'","->","->>","->ArrayChunk","->Eduction","->Vec","->VecNode","->VecSeq","-cache-protocol-fn","-reset-methods",".","..","/","<","<=","=","==",">",">=","EMPTY-NODE","Inst","NaN?","PrintWriter-on","StackTraceElement->vec","Throwable->map","abs","accessor","aclone","add-classpath","add-tap","add-watch","agent","agent-error","agent-errors","aget","alength","alias","all-ns","alter","alter-meta!","alter-var-root","amap","ancestors","and","any?","apply","areduce","array-map","as->","aset","aset-boolean","aset-byte","aset-char","aset-double","aset-float","aset-int","aset-long","aset-short","assert","assoc","assoc!","assoc-in","associative?","atom","await","await-for","await1","bases","bean","bigdec","bigint","biginteger","binding","bit-and","bit-and-not","bit-clear","bit-flip","bit-not","bit-or","bit-set","bit-shift-left","bit-shift-right","bit-test","bit-xor","boolean","boolean-array","boolean?","booleans","bound-fn","bound-fn*","bound?","bounded-count","butlast","byte","byte-array","bytes","bytes?","case","case*","cast","cat","catch","char","char-array","char-escape-string","char-name-string","char?","chars","chunk","chunk-append","chunk-buffer","chunk-cons","chunk-first","chunk-next","chunk-rest","chunked-seq?","class","class?","clear-agent-errors","clojure-version","coll?","comment","commute","comp","comparator","compare","compare-and-set!","compile","complement","completing","concat","cond","cond->","cond->>","condp","conj","conj!","cons","constantly","construct-proxy","contains?","count","counted?","create-ns","create-struct","cycle","dec","dec'","decimal?","declare","dedupe","def","default-data-readers","definline","definterface","defmacro","defmethod","defmulti","defn","defn-","defonce","defprotocol","defrecord","defstruct","deftype","deftype*","delay","delay?","deliver","denominator","deref","derive","descendants","destructure","disj","disj!","dissoc","dissoc!","distinct","distinct?","do","doall","dorun","doseq","dosync","dotimes","doto","double","double-array","double?","doubles","drop","drop-last","drop-while","eduction","empty","empty?","ensure","ensure-reduced","enumeration-seq","error-handler","error-mode","eval","even?","every-pred","every?","ex-cause","ex-data","ex-info","ex-message","extend","extend-protocol","extend-type","extenders","extends?","false","false?","ffirst","file-seq","filter","filterv","finally","find","find-keyword","find-ns","find-protocol-impl","find-protocol-method","find-var","first","flatten","float","float-array","float?","floats","flush","fn","fn*","fn?","fnext","fnil","for","force","format","frequencies","future","future-call","future-cancel","future-cancelled?","future-done?","future?","gen-class","gen-interface","gensym","get","get-in","get-method","get-proxy-class","get-thread-bindings","get-validator","group-by","halt-when","hash","hash-combine","hash-map","hash-ordered-coll","hash-set","hash-unordered-coll","ident?","identical?","identity","if","if-let","if-not","if-some","ifn?","import","in-ns","inc","inc'","indexed?","infinite?","init-proxy","inst-ms","inst-ms*","inst?","instance?","int","int-array","int?","integer?","interleave","intern","interpose","into","into-array","ints","io!","isa?","iterate","iteration","iterator-seq","juxt","keep","keep-indexed","key","keys","keyword","keyword?","last","lazy-cat","lazy-seq","let","let*","letfn","letfn*","line-seq","list","list*","list?","load","load-file","load-reader","load-string","loaded-libs","locking","long","long-array","longs","loop","loop*","macroexpand","macroexpand-1","make-array","make-hierarchy","map","map-entry?","map-indexed","map?","mapcat","mapv","max","max-key","memfn","memoize","merge","merge-with","meta","method-sig","methods","min","min-key","mix-collection-hash","mod","monitor-enter","monitor-exit","munge","name","namespace","namespace-munge","nat-int?","neg-int?","neg?","new","newline","next","nfirst","nil","nil?","nnext","not","not-any?","not-empty","not-every?","not=","ns","ns-aliases","ns-imports","ns-interns","ns-map","ns-name","ns-publics","ns-refers","ns-resolve","ns-unalias","ns-unmap","nth","nthnext","nthrest","num","number?","numerator","object-array","odd?","or","parents","parse-boolean","parse-double","parse-long","parse-uuid","partial","partition","partition-all","partition-by","pcalls","peek","persistent!","pmap","pop","pop!","pop-thread-bindings","pos-int?","pos?","pr","pr-str","prefer-method","prefers","primitives-classnames","print","print-ctor","print-dup","print-method","print-simple","print-str","printf","println","println-str","prn","prn-str","promise","proxy","proxy-call-with-super","proxy-mappings","proxy-name","proxy-super","push-thread-bindings","pvalues","qualified-ident?","qualified-keyword?","qualified-symbol?","quot","quote","rand","rand-int","rand-nth","random-sample","random-uuid","range","ratio?","rational?","rationalize","re-find","re-groups","re-matcher","re-matches","re-pattern","re-seq","read","read+string","read-line","read-string","reader-conditional","reader-conditional?","realized?","record?","recur","reduce","reduce-kv","reduced","reduced?","reductions","ref","ref-history-count","ref-max-history","ref-min-history","ref-set","refer","refer-clojure","reify","reify*","release-pending-sends","rem","remove","remove-all-methods","remove-method","remove-ns","remove-tap","remove-watch","repeat","repeatedly","replace","replicate","require","requiring-resolve","reset!","reset-meta!","reset-vals!","resolve","rest","restart-agent","resultset-seq","reverse","reversible?","rseq","rsubseq","run!","satisfies?","second","select-keys","send","send-off","send-via","seq","seq-to-map-for-destructuring","seq?","seqable?","seque","sequence","sequential?","set","set!","set-agent-send-executor!","set-agent-send-off-executor!","set-error-handler!","set-error-mode!","set-validator!","set?","short","short-array","shorts","shuffle","shutdown-agents","simple-ident?","simple-keyword?","simple-symbol?","slurp","some","some->","some->>","some-fn","some?","sort","sort-by","sorted-map","sorted-map-by","sorted-set","sorted-set-by","sorted?","special-symbol?","spit","split-at","split-with","str","string?","struct","struct-map","subs","subseq","subvec","supers","swap!","swap-vals!","symbol","symbol?","sync","tagged-literal","tagged-literal?","take","take-last","take-nth","take-while","tap>","test","the-ns","thread-bound?","throw","time","to-array","to-array-2d","trampoline","transduce","transient","tree-seq","true","true?","try","type","unchecked-add","unchecked-add-int","unchecked-byte","unchecked-char","unchecked-dec","unchecked-dec-int","unchecked-divide-int","unchecked-double","unchecked-float","unchecked-inc","unchecked-inc-int","unchecked-int","unchecked-long","unchecked-multiply","unchecked-multiply-int","unchecked-negate","unchecked-negate-int","unchecked-remainder-int","unchecked-short","unchecked-subtract","unchecked-subtract-int","underive","unquote","unquote-splicing","unreduced","unsigned-bit-shift-right","update","update-in","update-keys","update-proxy","update-vals","uri?","use","uuid?","val","vals","var","var-get","var-set","var?","vary-meta","vec","vector","vector-of","vector?","volatile!","volatile?","vreset!","vswap!","when","when-first","when-let","when-not","when-some","while","with-bindings","with-bindings*","with-in-str","with-loading-context","with-local-vars","with-meta","with-open","with-out-str","with-precision","with-redefs","with-redefs-fn","xml-seq","zero?","zipmap"] " Simple word completion for special forms and public vars in clojure.core diff --git a/autoload/coc/source/requirements.vim b/autoload/coc/source/requirements.vim new file mode 100644 index 000000000..c2c64dbd0 --- /dev/null +++ b/autoload/coc/source/requirements.vim @@ -0,0 +1,24 @@ +if polyglot#init#is_disabled(expand(':p'), 'requirements', 'autoload/coc/source/requirements.vim') + finish +endif + +"" +" https://github.com/neoclide/coc.nvim/wiki/Create-custom-source +function! coc#source#requirements#init() abort + return { + \ 'shortcut': 'pip', + \ 'priority': 9, + \ 'filetypes': ['requirements'], + \ } +endfunction + +"" +" https://github.com/neoclide/coc.nvim/wiki/Create-custom-source +" +" Completion pip option and PYPI package names. +" Note: completion PYPI package names need install pip-cache from PYPI, +" and run `pip-cache update` first to generate cache. +function! coc#source#requirements#complete(opt, cb) abort + call a:cb(g:requirements#items) +endfunction +" vim: et sw=4 ts=4 sts=4: diff --git a/autoload/crystal/indent.vim b/autoload/crystal/indent.vim index 3e8b07e5c..4e9ddcf73 100644 --- a/autoload/crystal/indent.vim +++ b/autoload/crystal/indent.vim @@ -96,7 +96,7 @@ lockvar g:crystal#indent#block_regex " Regex that defines the beginning of a hanging expression. let g:crystal#indent#hanging_assignment_regex = \ '\%('.g:crystal#indent#operator_regex.'\s*\)\@<=' . - \ '\.\@1' + \ '\.\@1' lockvar g:crystal#indent#hanging_assignment_regex " Regex that defines the start-match for the 'end' keyword. @@ -107,7 +107,7 @@ let g:crystal#indent#end_start_regex = \ '\%(\<\%(private\|protected\)\s\+\)\=' . \ '\%(\<\%(abstract\s\+\)\=\%(class\|struct\)\>\|\<\%(def\|module\|macro\|lib\|enum\|annotation\)\>\)' . \ '\|' . - \ '\<\%(if\|unless\|while\|until\|case\|begin\|union\)\>' . + \ '\<\%(if\|unless\|while\|until\|case\|begin\|union\|select\)\>' . \ '\)' . \ '\|' . \ g:crystal#indent#hanging_assignment_regex . @@ -1042,4 +1042,4 @@ endfunction " }}}1 -" vim:sw=2 sts=2 ts=8 fdm=marker et: \ No newline at end of file +" vim:sw=2 sts=2 ts=8 fdm=marker et: diff --git a/autoload/csv.vim b/autoload/csv.vim index ba04d2bcc..4111f6ed8 100644 --- a/autoload/csv.vim +++ b/autoload/csv.vim @@ -826,8 +826,8 @@ fu! csv#Columnize(field) "{{{3 let colnr = s:columnize_count % s:max_cols let width = get(b:col_width, colnr, 20) let align = 'r' - if exists('b:csv_arrange_align') - let align=b:csv_arrange_align + if exists('b:csv_arrange_align') || exists('g:csv_arrange_align') + let align=get(b:, 'csv_arrange_align', g:csv_arrange_align) let indx=match(align, '\*') if indx > 0 let align = align[0:(indx-1)]. repeat(align[indx-1], len(b:col_width)-indx) @@ -934,6 +934,11 @@ fu! csv#GetColPat(colnr, zs_flag) "{{{3 endfu fu! csv#SetupAutoCmd(window,bufnr) "{{{3 " Setup QuitPre autocommand to quit cleanly + if a:bufnr == 0 + " something went wrong, + " how can this happen? + return + endif aug CSV_QuitPre au! exe "au QuitPre * call CSV_CloseBuffer(".winbufnr(a:window).")" @@ -1024,7 +1029,7 @@ fu! csv#SplitHeaderLine(lines, bang, hor) "{{{3 " disable airline let w:airline_disabled = 1 let win = winnr() - setl scrollbind buftype=nowrite bufhidden=wipe noswapfile nobuflisted + setl scrollbind buftype=nofile bufhidden=wipe noswapfile nobuflisted noa wincmd p let b:csv_SplitWindow = win aug CSV_Preview diff --git a/autoload/dart.vim b/autoload/dart.vim index 28e55552c..09ca49e05 100644 --- a/autoload/dart.vim +++ b/autoload/dart.vim @@ -92,9 +92,9 @@ endfunction " Finds the path to `uri`. " -" If the file is a package: uri, looks for a .packages file to resolve the path. -" If the path cannot be resolved, or is not a package: uri, returns the -" original. +" If the file is a package: uri, looks for a package_config.json or .packages +" file to resolve the path. If the path cannot be resolved, or is not a +" package: uri, returns the original. function! dart#resolveUri(uri) abort if a:uri !~# 'package:' return a:uri @@ -102,7 +102,7 @@ function! dart#resolveUri(uri) abort let package_name = substitute(a:uri, 'package:\(\w\+\)\/.*', '\1', '') let [found, package_map] = s:PackageMap() if !found - call s:error('cannot find .packages file') + call s:error('cannot find .packages or package_config.json file') return a:uri endif if !has_key(package_map, package_name) @@ -116,37 +116,63 @@ function! dart#resolveUri(uri) abort \ '') endfunction -" A map from package name to lib directory parse from a '.packages' file. +" A map from package name to lib directory parse from a 'package_config.json' +" or '.packages' file. " " Returns [found, package_map] function! s:PackageMap() abort - let [found, dot_packages] = s:DotPackagesFile() - if !found - return [v:false, {}] - endif - let dot_packages_dir = fnamemodify(dot_packages, ':p:h') - let lines = readfile(dot_packages) - let map = {} - for line in lines - if line =~# '\s*#' - continue + let [found, package_config] = s:FindFile('.dart_tool/package_config.json') + if found + let dart_tool_dir = fnamemodify(package_config, ':p:h') + let content = join(readfile(package_config), "\n") + let packages_dict = json_decode(content) + if packages_dict['configVersion'] != '2' + s:error('Unsupported version of package_config.json') + return [v:false, {}] endif - let package = substitute(line, ':.*$', '', '') - let lib_dir = substitute(line, '^[^:]*:', '', '') - if lib_dir =~# 'file:/' - let lib_dir = substitute(lib_dir, 'file://', '', '') - if lib_dir =~# '/[A-Z]:/' - let lib_dir = lib_dir[1:] + let map = {} + for package in packages_dict['packages'] + let name = package['name'] + let uri = package['rootUri'] + let package_uri = package['packageUri'] + if uri =~# 'file:/' + let uri = substitute(uri, 'file://', '', '') + let lib_dir = resolve(uri.'/'.package_uri) + else + let lib_dir = resolve(dart_tool_dir.'/'.uri.'/'.package_uri) endif - else - let lib_dir = resolve(dot_packages_dir.'/'.lib_dir) - endif - if lib_dir =~# '/$' - let lib_dir = lib_dir[:len(lib_dir) - 2] - endif - let map[package] = lib_dir - endfor - return [v:true, map] + let map[name] = lib_dir + endfor + return [v:true, map] + endif + + let [found, dot_packages] = s:FindFile('.packages') + if found + let dot_packages_dir = fnamemodify(dot_packages, ':p:h') + let lines = readfile(dot_packages) + let map = {} + for line in lines + if line =~# '\s*#' + continue + endif + let package = substitute(line, ':.*$', '', '') + let lib_dir = substitute(line, '^[^:]*:', '', '') + if lib_dir =~# 'file:/' + let lib_dir = substitute(lib_dir, 'file://', '', '') + if lib_dir =~# '/[A-Z]:/' + let lib_dir = lib_dir[1:] + endif + else + let lib_dir = resolve(dot_packages_dir.'/'.lib_dir) + endif + if lib_dir =~# '/$' + let lib_dir = lib_dir[:len(lib_dir) - 2] + endif + let map[package] = lib_dir + endfor + return [v:true, map] + endif + return [v:false, {}] endfunction " Toggle whether dartfmt is run on save or not. @@ -158,17 +184,17 @@ function! dart#ToggleFormatOnSave() abort let g:dart_format_on_save = 1 endfunction -" Finds a file name '.packages' in the cwd, or in any directory above the open +" Finds a file named [a:path] in the cwd, or in any directory above the open " file. " -" Returns [found, file]. -function! s:DotPackagesFile() abort - if filereadable('.packages') - return [v:true, '.packages'] +" Returns [found, file] +function! s:FindFile(path) abort + if filereadable(a:path) + return [v:true, a:path] endif let dir_path = expand('%:p:h') while v:true - let file_path = dir_path.'/.packages' + let file_path = dir_path.'/'.a:path if filereadable(file_path) return [v:true, file_path] endif diff --git a/autoload/fsharp.vim b/autoload/fsharp.vim index 275913cfd..bb93b9cd7 100644 --- a/autoload/fsharp.vim +++ b/autoload/fsharp.vim @@ -251,7 +251,7 @@ function! fsharp#loadConfig() let g:fsharp#automatic_reload_workspace = 1 endif if !exists('g:fsharp#show_signature_on_cursor_move') - let g:fsharp#show_signature_on_cursor_move = 1 + let g:fsharp#show_signature_on_cursor_move = 0 endif if !exists('g:fsharp#fsi_command') let g:fsharp#fsi_command = "dotnet fsi" diff --git a/autoload/ledger.vim b/autoload/ledger.vim index 90c888029..984070c08 100644 --- a/autoload/ledger.vim +++ b/autoload/ledger.vim @@ -25,7 +25,7 @@ function! ledger#transaction_state_toggle(lnum, ...) abort endf function! ledger#transaction_state_set(lnum, char) abort - " modifies or sets the state of the transaction at the cursor, + " modifies or sets the state of the transaction at the given line no., " removing the state altogether if a:char is empty let trans = s:transaction.from_lnum(a:lnum) if empty(trans) || has_key(trans, 'expr') @@ -130,7 +130,7 @@ function! ledger#transaction_post_state_set(lnum, char) abort return endif - let line = getline('.') + let line = getline(a:lnum) if a:char =~# '^\s*$' let newline = substitute(line, '\V' . state . '\m[ \t]', '', '') elseif state ==# ' ' @@ -457,10 +457,20 @@ endf " Return character position of decimal separator (multibyte safe) function! s:decimalpos(expr) abort - let pos = match(a:expr, '\V' . g:ledger_decimal_sep) - if pos > 0 - let pos = strchars(a:expr[:pos]) - 1 - endif + " Remove trailing comments + let l:expr = substitute(a:expr, '\v +;.*$', '', '') + " Find first or last possible decimal separator candidate + if g:ledger_align_last + let pos = matchend(l:expr, '\v.*[' . g:ledger_decimal_sep . ']') + if pos > 0 + let pos = strchars(a:expr[:pos]) + 1 + endif + else + let pos = match(l:expr, '\v[' . g:ledger_decimal_sep . ']') + if pos > 0 + let pos = strchars(a:expr[:pos]) - 1 + endif + end return pos endf @@ -544,6 +554,10 @@ function! ledger#align_amount_at_cursor() abort endif endf +function! ledger#align_formatexpr(lnum, count) abort + execute a:lnum . ',' . (a:lnum + a:count - 1) . 'call ledger#align_commodity()' +endfunction + " Report generation {{{1 " Helper functions and variables {{{2 @@ -732,8 +746,6 @@ function! ledger#register(file, args) abort endf " Reconcile the given account. -" This function accepts a file path as a third optional argument. -" The default is to use the value of g:ledger_main. " " Parameters: " file The file to be processed diff --git a/autoload/polyglot/init.vim b/autoload/polyglot/init.vim index 45e9aab2a..9e991f369 100644 --- a/autoload/polyglot/init.vim +++ b/autoload/polyglot/init.vim @@ -1775,7 +1775,7 @@ if !has_key(g:polyglot_is_disabled, 'prolog') endif if !has_key(g:polyglot_is_disabled, 'bzl') - au BufNewFile,BufRead *.BUILD,*.bazel,*.bzl,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE setf bzl + au BufNewFile,BufRead *.BUILD,*.bazel,*.bzl,*.star,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE setf bzl endif if !has_key(g:polyglot_is_disabled, 'odin') @@ -1783,7 +1783,7 @@ if !has_key(g:polyglot_is_disabled, 'odin') endif if !has_key(g:polyglot_is_disabled, 'dosini') - au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*.url,*/etc/pacman.conf,*/etc/yum.conf,{.,}editorconfig,{.,}flake8,{.,}npmrc,buildozer.spec setf dosini + au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*.url,*/etc/pacman.conf,*/etc/yum.conf,{.,}coveragerc,{.,}editorconfig,{.,}flake8,{.,}npmrc,{.,}pylintrc,buildozer.spec,pylintrc setf dosini au BufNewFile,BufRead php.ini-* call s:StarSetf('dosini') au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini') endif @@ -1873,7 +1873,7 @@ if !has_key(g:polyglot_is_disabled, 'unison') endif if !has_key(g:polyglot_is_disabled, 'typescript') - au BufNewFile,BufRead *.ts setf typescript + au BufNewFile,BufRead *.cts,*.mts,*.ts setf typescript au BufNewFile,BufRead *.tsx setf typescriptreact endif @@ -2233,7 +2233,7 @@ if !has_key(g:polyglot_is_disabled, 'jsonnet') endif if !has_key(g:polyglot_is_disabled, 'json') - au BufNewFile,BufRead *.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}arcconfig,{.,}auto-changelog,{.,}c8rc,{.,}htmlhintrc,{.,}imgbotconfig,{.,}nycrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,Pipfile.lock,composer.lock,mcmod.info setf json + au BufNewFile,BufRead *.4DForm,*.4DProject,*.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}arcconfig,{.,}auto-changelog,{.,}c8rc,{.,}htmlhintrc,{.,}imgbotconfig,{.,}nycrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,Pipfile.lock,composer.lock,mcmod.info setf json endif if !has_key(g:polyglot_is_disabled, 'json5') @@ -2358,10 +2358,6 @@ if !has_key(g:polyglot_is_disabled, 'git') au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit endif -if !has_key(g:polyglot_is_disabled, 'gdscript') - au BufNewFile,BufRead *.gd setf gdscript3 -endif - if !has_key(g:polyglot_is_disabled, 'fsharp') au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs() au BufNewFile,BufRead *.fsi,*.fsx setf fsharp @@ -2464,7 +2460,7 @@ if !has_key(g:polyglot_is_disabled, 'coffee-script') endif if !has_key(g:polyglot_is_disabled, 'markdown') - au BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr setf markdown + au BufNewFile,BufRead *.livemd,*.markdown,*.md,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr setf markdown endif if !has_key(g:polyglot_is_disabled, 'cmake') @@ -2472,7 +2468,7 @@ if !has_key(g:polyglot_is_disabled, 'cmake') endif if !has_key(g:polyglot_is_disabled, 'clojure') - au BufNewFile,BufRead *.boot,*.cl2,*.clj,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.edn,*.hic,build.boot,profile.boot,riemann.config setf clojure + au BufNewFile,BufRead *.bb,*.boot,*.cl2,*.clj,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.edn,*.hic,build.boot,profile.boot,riemann.config setf clojure endif if !has_key(g:polyglot_is_disabled, 'carp') @@ -2583,7 +2579,7 @@ if !has_key(g:polyglot_is_disabled, 'ant') endif if !has_key(g:polyglot_is_disabled, 'xml') - au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.tpm,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu,*fglrxrc,{.,}classpath,{.,}cproject,{.,}project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config setf xml + au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.tpm,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu,*fglrxrc,{.,}classpath,{.,}cproject,{.,}project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config setf xml endif if !has_key(g:polyglot_is_disabled, 'csv') diff --git a/autoload/polyglot/shebang.vim b/autoload/polyglot/shebang.vim index a8f103484..31b975681 100644 --- a/autoload/polyglot/shebang.vim +++ b/autoload/polyglot/shebang.vim @@ -462,6 +462,7 @@ endfunc let s:interpreters = { \ 'osascript': 'applescript', \ 'tcc': 'c', + \ 'bb': 'clojure', \ 'coffee': 'coffee', \ 'crystal': 'crystal', \ 'dart': 'dart', diff --git a/autoload/polyglot/sleuth.vim b/autoload/polyglot/sleuth.vim index ba166bf78..5eb946e13 100644 --- a/autoload/polyglot/sleuth.vim +++ b/autoload/polyglot/sleuth.vim @@ -55,7 +55,7 @@ let s:globs = { \ 'brewfile': 'Brewfile', \ 'bsdl': '*.bsdl,*bsd', \ 'bst': '*.bst', - \ 'bzl': '*.bzl,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE', + \ 'bzl': '*.bzl,*.star,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE', \ 'bzr': 'bzr_log.*', \ 'c': '*.c,*.cats,*.h,*.idc,*.qc', \ 'cabal': '*.cabal', @@ -75,7 +75,7 @@ let s:globs = { \ 'chordpro': '*.chopro,*.crd,*.cho,*.crdpro,*.chordpro', \ 'cl': '*.eni', \ 'clean': '*.dcl,*.icl', - \ 'clojure': '*.clj,*.boot,*.cl2,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.hic,*.edn,riemann.config,build.boot,profile.boot', + \ 'clojure': '*.clj,*.bb,*.boot,*.cl2,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.hic,*.edn,riemann.config,build.boot,profile.boot', \ 'cmake': '*.cmake,*.cmake.in,CMakeLists.txt', \ 'cmod': '*.cmod', \ 'cmusrc': '', @@ -130,7 +130,7 @@ let s:globs = { \ 'dnsmasq': '', \ 'dockerfile': '*.Dockerfile,*.dock,Containerfile,Dockerfile,dockerfile,Dockerfile*', \ 'dosbatch': '*.bat,*.sys', - \ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,*.url,.flake8,buildozer.spec,.editorconfig,.npmrc,php.ini-*', + \ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,*.url,.coveragerc,.flake8,.pylintrc,buildozer.spec,pylintrc,.editorconfig,.npmrc,php.ini-*', \ 'dot': '*.dot,*.gv', \ 'dracula': '*.drac,*.drc,*lvs,*lpe,drac.*', \ 'dsdl': '*.sdl', @@ -181,7 +181,6 @@ let s:globs = { \ 'fvwm': '', \ 'gdb': '.gdbinit', \ 'gdmo': '*.mo,*.gdmo', - \ 'gdscript3': '*.gd', \ 'gedcom': '*.ged,lltxxxxx.txt', \ 'gitcommit': 'COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG', \ 'gitconfig': '*.gitconfig,.gitconfig,.gitmodules', @@ -263,7 +262,7 @@ let s:globs = { \ 'jovial': '*.jov,*.j73,*.jovial', \ 'jproperties': '*.properties,*.properties_??,*.properties_??_??,*.properties_??_??_*', \ 'jq': '*.jq,.jqrc,.jqrc*', - \ 'json': '*.json,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.auto-changelog,.c8rc,.htmlhintrc,.imgbotconfig,.nycrc,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,mcmod.info', + \ 'json': '*.json,*.4DForm,*.4DProject,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.auto-changelog,.c8rc,.htmlhintrc,.imgbotconfig,.nycrc,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,mcmod.info', \ 'json5': '*.json5', \ 'jsonc': '*.cjson,*.jsonc,coc-settings.json,.eslintrc.json,.babelrc,.jshintrc,.jslintrc,.mocharc.json,coffeelint.json,tsconfig.json,jsconfig.json', \ 'jsonnet': '*.jsonnet,*.libsonnet', @@ -321,7 +320,7 @@ let s:globs = { \ 'mallard': '*.page', \ 'manconf': 'man.config', \ 'maple': '*.mv,*.mpl,*.mws', - \ 'markdown': '*.md,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr', + \ 'markdown': '*.md,*.livemd,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr', \ 'markdown.mdx': '*.mdx', \ 'mason': '*.mason,*.mhtml,*.comp', \ 'master': '*.mas,*.master', @@ -568,7 +567,7 @@ let s:globs = { \ 'tt2': '*.tt2', \ 'tt2html': '*.tt2', \ 'tutor': '*.tutor', - \ 'typescript': '*.ts', + \ 'typescript': '*.ts,*.cts,*.mts', \ 'typescriptreact': '*.tsx', \ 'uc': '*.uc', \ 'udevconf': '', @@ -614,7 +613,7 @@ let s:globs = { \ 'xhtml': '*.xhtml,*.xht', \ 'xinetd': '', \ 'xmath': '*.msc,*.msf', - \ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc', + \ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc', \ 'xml.twig': '*.xml.twig', \ 'xmodmap': '*Xmodmap,*xmodmap*', \ 'xpm': '*.xpm,*.pm', diff --git a/autoload/requirements.vim b/autoload/requirements.vim index 3d7837945..1132d7b27 100644 --- a/autoload/requirements.vim +++ b/autoload/requirements.vim @@ -2,35 +2,47 @@ if polyglot#init#is_disabled(expand(':p'), 'requirements', 'autoload/requ finish endif -" the Requirements File Format syntax support for Vim -" Version: 1.6.0 -" Author: raimon -" License: MIT LICENSE -" The MIT License (MIT) -" -" Copyright (c) 2015 raimon -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to deal -" in the Software without restriction, including without limitation the rights -" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -" copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in all -" copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -" SOFTWARE. +"" +" @section Introduction, intro +" @library +" is generated by . +" See for more information about installation and screenshots. -let s:save_cpo = &cpo -set cpo&vim +"" +" Update cache. +function! requirements#update_cache() abort + let s:items = [] + let l:pip_items = split(system('COMP_WORDS="pip install -" COMP_CWORD=2 PIP_AUTO_COMPLETE=1 pip')) + let l:pypi_items = split(system('pip-cache pkgnames')) + for l:item in l:pip_items + let s:items += [{'word': l:item, 'menu': 'pip'}] + endfor + for l:item in l:pypi_items + let s:items += [{'word': l:item, 'menu': 'pypi'}] + endfor + call writefile([json_encode(s:items)], s:cache) +endfunction -let &cpo = s:save_cpo -unlet s:save_cpo +if exists('*stdpath') + let s:cache_dir_home = stdpath('cache') +else + let s:cache_dir_home = $HOME . '/.cache/nvim' +endif +let s:cache_dir = s:cache_dir_home . '/requirements.vim' +call mkdir(s:cache_dir, 'p') +"" +" Completion cache path. +call g:requirements#utils#plugin.Flag('g:requirements#cache', + \ s:cache_dir . '/requirements.json' + \ ) +let s:cache = g:requirements#cache +try + let s:items = json_decode(readfile(s:cache)[0]) +catch /\v^Vim%(\(\a+\))?:E(684|484|491):/ + call requirements#update_cache() + let s:items = json_decode(readfile(s:cache)[0]) +endtry +"" +" Completion cache contents. For program. +call g:requirements#utils#plugin.Flag('g:requirements#items', s:items) " vim: et sw=4 ts=4 sts=4: diff --git a/autoload/requirements/utils.vim b/autoload/requirements/utils.vim new file mode 100644 index 000000000..963ecb719 --- /dev/null +++ b/autoload/requirements/utils.vim @@ -0,0 +1,15 @@ +if polyglot#init#is_disabled(expand(':p'), 'requirements', 'autoload/requirements/utils.vim') + finish +endif + +"" +" @section Configuration, config + +function! s:Flag(name, default) abort + let l:scope = get(split(a:name, ':'), 0, 'g:') + let l:name = get(split(a:name, ':'), -1) + let {l:scope}:{l:name} = get({l:scope}:, l:name, a:default) +endfunction + +let g:requirements#utils#plugin = {'Flag': funcref('s:Flag')} +" vim: et sw=4 ts=4 sts=4: diff --git a/compiler/cargo.vim b/compiler/cargo.vim index d56612f2c..f5854a4d1 100644 --- a/compiler/cargo.vim +++ b/compiler/cargo.vim @@ -38,10 +38,12 @@ augroup END " Ignore general cargo progress messages CompilerSet errorformat+= \%-G%\\s%#Downloading%.%#, + \%-G%\\s%#Checking%.%#, \%-G%\\s%#Compiling%.%#, \%-G%\\s%#Finished%.%#, \%-G%\\s%#error:\ Could\ not\ compile\ %.%#, \%-G%\\s%#To\ learn\ more\\,%.%#, + \%-G%\\s%#For\ more\ information\ about\ this\ error\\,%.%#, \%-Gnote:\ Run\ with\ \`RUST_BACKTRACE=%.%#, \%.%#panicked\ at\ \\'%m\\'\\,\ %f:%l:%c diff --git a/compiler/pip_compile.vim b/compiler/pip_compile.vim new file mode 100644 index 000000000..5b6b29d5e --- /dev/null +++ b/compiler/pip_compile.vim @@ -0,0 +1,49 @@ +if polyglot#init#is_disabled(expand(':p'), 'requirements', 'compiler/pip_compile.vim') + finish +endif + +" the Requirements File Format syntax support for Vim +" Version: 1.7.1 +" Author: raimon +" License: MIT LICENSE +" The MIT License (MIT) +" +" Copyright (c) 2015 raimon +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in all +" copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +" SOFTWARE. + +if exists('b:current_compiler') + finish +endif +let b:current_compiler = 'pip_compile' + +let s:save_cpoptions = &cpoptions +set cpoptions&vim + +if exists(':CompilerSet') != 2 + command -nargs=* CompilerSet setlocal +endif +CompilerSet makeprg=pip-compile\ %:S +CompilerSet errorformat=%ECould\ not\ find\ a\ version\ that\ matches\ %o\ (from\ -r\ %f\ (line\ %l)), + \%C%m, + \%Z, + \%-G%.%# +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions +" vim: et sw=4 ts=4 sts=4: diff --git a/extras/jsdoc.vim b/extras/jsdoc.vim index 369027c40..1acbb0216 100644 --- a/extras/jsdoc.vim +++ b/extras/jsdoc.vim @@ -22,7 +22,8 @@ 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/ftplugin/caddyfile.vim b/ftplugin/caddyfile.vim index b3e48a088..ae45e27e2 100644 --- a/ftplugin/caddyfile.vim +++ b/ftplugin/caddyfile.vim @@ -2,8 +2,9 @@ if polyglot#init#is_disabled(expand(':p'), 'caddyfile', 'ftplugin/caddyfi finish endif -" Language: Caddyfile -" Author: Josh Glendenning +" Language: Caddyfile +" Maintainer: 0az <0az@afzhou.com> +" Original Author: Josh Glendenning if exists('b:did_ftplugin') finish @@ -20,7 +21,7 @@ if exists('g:NERDDelimiterMap') endif elseif exists('g:NERDCustomDelimiters') if !has_key(g:NERDCustomDelimiters, 'caddyfile') - let g:NERDDelimiterMap.caddyfile = s:delimiters + let g:NERDCustomDelimiters.caddyfile = s:delimiters endif else let g:NERDCustomDelimiters = {'caddyfile': s:delimiters} diff --git a/ftplugin/erlang.vim b/ftplugin/erlang.vim index 85f572095..d9a7eaeb1 100644 --- a/ftplugin/erlang.vim +++ b/ftplugin/erlang.vim @@ -9,7 +9,8 @@ endif " Contributors: Ricardo Catalinas Jiménez " Eduardo Lopez (http://github.com/tapichu) " Arvid Bjurklint (http://github.com/slarwise) -" Last Update: 2021-Jan-08 +" Paweł Zacharek (http://github.com/subc2) +" Last Update: 2022-Sep-28 " License: Vim license " URL: https://github.com/vim-erlang/vim-erlang-runtime @@ -61,7 +62,7 @@ setlocal suffixesadd=.erl,.hrl let &l:include = '^\s*-\%(include\|include_lib\)\s*("\zs\f*\ze")' let &l:define = '^\s*-\%(define\|record\|type\|opaque\)' -let s:erlang_fun_begin = '^\a\w*(.*$' +let s:erlang_fun_begin = '^\l[A-Za-z0-9_@]*(.*$' let s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$' if !exists('*GetErlangFold') @@ -103,6 +104,23 @@ let b:undo_ftplugin = "setlocal keywordprg< foldmethod< foldexpr< foldtext<" \ . " comments< commentstring< formatoptions< suffixesadd< include<" \ . " define<" +" The following lines enable the macros/matchit.vim plugin for +" extended matching with the % key. +if exists("loaded_matchit") + let s:sw = &sw + if exists('*shiftwidth') + let s:sw = shiftwidth() + endif + + let b:match_words = + \ '\<\%(begin\|case\|fun\|if\|maybe\|receive\|try\)\>' . + \ ':\<\%(after\|catch\|else\|of\)\>' . + \ ':\,' . + \ '^\l[A-Za-z0-9_@]*' . + \ ':^\%(\%(\t\| \{' . s:sw . '}\)\%([^\t\ %][^%]*\)\?\)\?;\s*\%(%.*\)\?$\|\.[\t\ %]\|\.$' + let b:match_skip = 's:comment\|string\|erlangmodifier\|erlangquotedatom' +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/ftplugin/eruby.vim b/ftplugin/eruby.vim index 7ea19deab..33c769dd9 100644 --- a/ftplugin/eruby.vim +++ b/ftplugin/eruby.vim @@ -89,8 +89,12 @@ runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim let b:did_ftplugin = 1 " Combine the new set of values with those previously included. -if exists("b:undo_ftplugin") - let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin +if !exists('b:undo_ftplugin') + " No-op + let b:undo_ftplugin = 'exe' +endif +if !empty(s:undo_ftplugin) + let b:undo_ftplugin .= '|' . s:undo_ftplugin endif if exists ("b:browsefilter") let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter @@ -122,7 +126,7 @@ endif setlocal commentstring=<%#%s%> let b:undo_ftplugin = "setl cms< " . - \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin + \ " | unlet! b:browsefilter b:match_words | " . b:undo_ftplugin let &cpo = s:save_cpo unlet s:save_cpo diff --git a/ftplugin/gitcommit.vim b/ftplugin/gitcommit.vim index 56e72973a..bcd823567 100644 --- a/ftplugin/gitcommit.vim +++ b/ftplugin/gitcommit.vim @@ -5,7 +5,7 @@ endif " Vim filetype plugin " Language: git commit file " Maintainer: Tim Pope -" Last Change: 2019 Dec 05 +" Last Change: 2022 Jan 05 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) @@ -16,7 +16,7 @@ let b:did_ftplugin = 1 setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72 setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n -setlocal formatlistpat+=\\\|^\\s*[-*+]\\s\\+ +setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}]\\s\\+\\\|^\\s*[-*+]\\s\\+ setlocal include=^+++ setlocal includeexpr=substitute(v:fname,'^[bi]/','','') @@ -46,6 +46,11 @@ function! s:diffcomplete(A, L, P) abort return args endfunction +function! s:setupdiff() abort + command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(0, ) + setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git +endfunction + function! s:gitdiffcached(bang, ...) abort let name = tempname() if a:0 @@ -54,8 +59,6 @@ function! s:gitdiffcached(bang, ...) abort let extra = "-p --stat=".&columns endif call system("git diff --cached --no-color --no-ext-diff ".extra." > ".shellescape(name)) - exe "pedit " . fnameescape(name) - wincmd P - command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(0, ) - setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git + exe 'pedit +call\ s:setupdiff()' fnameescape(name) + silent! wincmd P endfunction diff --git a/ftplugin/gitrebase.vim b/ftplugin/gitrebase.vim index 285f76a41..f83280a1e 100644 --- a/ftplugin/gitrebase.vim +++ b/ftplugin/gitrebase.vim @@ -5,7 +5,7 @@ endif " Vim filetype plugin " Language: git rebase --interactive " Maintainer: Tim Pope -" Last Change: 2019 Dec 05 +" Last Change: 2022 Jan 05 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) diff --git a/ftplugin/haml.vim b/ftplugin/haml.vim index ec6f249d7..1dc83371c 100644 --- a/ftplugin/haml.vim +++ b/ftplugin/haml.vim @@ -5,7 +5,7 @@ endif " Vim filetype plugin " Language: Haml " Maintainer: Tim Pope -" Last Change: 2016 Aug 29 +" Last Change: 2019 Dec 05 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") diff --git a/ftplugin/julia.vim b/ftplugin/julia.vim index e33b1a42a..de9834661 100644 --- a/ftplugin/julia.vim +++ b/ftplugin/julia.vim @@ -26,10 +26,16 @@ setlocal fo-=t fo+=croql let b:julia_vim_loaded = 1 let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<" + \ . " expandtab< shiftwidth<" \ . " define< fo< indentexpr< indentkeys< cinoptions< completefunc<" \ . " | unlet! b:commentary_format" \ . " | unlet! b:smartcomment_force_linemode" \ . " | unlet! b:julia_vim_loaded" + +if !exists("g:julia_set_indentation") || g:julia_set_indentation != 0 + " As suggested by Style Guide. + setlocal expandtab shiftwidth=4 +endif " MatchIt plugin support if exists("loaded_matchit") diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index d3129a876..a0474d945 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -860,7 +860,11 @@ endfunction function! s:MarkdownRefreshSyntax(force) - if &filetype =~# 'markdown' && line('$') > 1 + " Use != to compare &syntax's value to use the same logic run on + " $VIMRUNTIME/syntax/synload.vim. + " + " vint: next-line -ProhibitEqualTildeOperator + if &filetype =~# 'markdown' && line('$') > 1 && &syntax != 'OFF' call s:MarkdownHighlightSources(a:force) endif endfunction diff --git a/ftplugin/mir.vim b/ftplugin/mir.vim new file mode 100644 index 000000000..332e3272b --- /dev/null +++ b/ftplugin/mir.vim @@ -0,0 +1,17 @@ +if polyglot#init#is_disabled(expand(':p'), 'llvm', 'ftplugin/mir.vim') + finish +endif + +" Vim filetype plugin file +" Language: LLVM Machine IR +" Maintainer: The LLVM team, http://llvm.org/ + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal softtabstop=2 shiftwidth=2 +setlocal expandtab +setlocal comments+=:; + diff --git a/ftplugin/ps1.vim b/ftplugin/ps1.vim index e7c1a8533..82e184691 100644 --- a/ftplugin/ps1.vim +++ b/ftplugin/ps1.vim @@ -17,7 +17,7 @@ let b:did_ftplugin = 1 setlocal tw=0 setlocal commentstring=#%s -setlocal formatoptions=tcqro +setlocal formatoptions+=tcqroj " Enable autocompletion of hyphenated PowerShell commands, " e.g. Get-Content or Get-ADUser setlocal iskeyword+=- diff --git a/after/ftplugin/requirements.vim b/ftplugin/requirements.vim similarity index 76% rename from after/ftplugin/requirements.vim rename to ftplugin/requirements.vim index 5097952c3..b79e55e70 100644 --- a/after/ftplugin/requirements.vim +++ b/ftplugin/requirements.vim @@ -1,9 +1,9 @@ -if polyglot#init#is_disabled(expand(':p'), 'requirements', 'after/ftplugin/requirements.vim') +if polyglot#init#is_disabled(expand(':p'), 'requirements', 'ftplugin/requirements.vim') finish endif " the Requirements File Format syntax support for Vim -" Version: 1.6.0 +" Version: 1.7.1 " Author: raimon " License: MIT LICENSE " The MIT License (MIT) @@ -27,16 +27,20 @@ endif " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE " SOFTWARE. -if executable('pip-compile') - let s:filename = expand("%:p") - if fnamemodify(s:filename, ":t") ==# 'requirements.in' - " this is the default filename for pip-compile - setlocal makeprg=pip-compile - elseif fnamemodify(s:filename, ":e") ==# 'in' - \ && Requirements_matched_filename(s:filename) - setlocal makeprg=pip-compile\ % - endif +if exists("b:did_ftplugin") + finish endif +let b:did_ftplugin = 1 + +let s:save_cpoptions = &cpoptions +set cpoptions&vim +let b:undo_ftplugin = "setl iskeyword< commentstring<" +" pip options contain "-" +setlocal iskeyword+=- setlocal commentstring=#\ %s +compiler pip_compile + +let &cpoptions = s:save_cpoptions +unlet s:save_cpoptions " vim: et sw=4 ts=4 sts=4: diff --git a/ftplugin/zig.vim b/ftplugin/zig.vim index 1e6f91b3a..a2921a9b0 100644 --- a/ftplugin/zig.vim +++ b/ftplugin/zig.vim @@ -54,6 +54,13 @@ endif let b:undo_ftplugin = \ 'setl isk< et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<' +augroup vim-zig + autocmd! * + autocmd BufWritePre if get(g:, 'zig_fmt_autosave', 1) | call zig#fmt#Format() | endif +augroup END + +let b:undo_ftplugin .= '|au! vim-zig * ' + let &cpo = s:cpo_orig unlet s:cpo_orig " vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab diff --git a/indent/clojure.vim b/indent/clojure.vim index c60693241..583df7dd6 100644 --- a/indent/clojure.vim +++ b/indent/clojure.vim @@ -55,6 +55,10 @@ if exists("*searchpairpos") let g:clojure_align_subforms = 0 endif + if !exists('g:clojure_cljfmt_compat') + let g:clojure_cljfmt_compat = 0 + endif + function! s:syn_id_name() return synIDattr(synID(line("."), col("."), 0), "name") endfunction @@ -326,9 +330,16 @@ if exists("*searchpairpos") return [paren[0], paren[1] + (g:clojure_align_subforms ? 0 : &shiftwidth - 1)] elseif w[1] == '_' return paren + elseif w[1] == "'" && g:clojure_cljfmt_compat + return paren endif endif + " Paren indent for keywords, symbols and derefs + if g:clojure_cljfmt_compat && w[0] =~# "[:@']" + return paren + endif + " Test words without namespace qualifiers and leading reader macro " metacharacters. " diff --git a/indent/dart.vim b/indent/dart.vim index 4f08a36f0..f685cfa7f 100644 --- a/indent/dart.vim +++ b/indent/dart.vim @@ -8,7 +8,12 @@ endif let b:did_indent = 1 setlocal cindent -setlocal cinoptions+=j1,J1,(2s,u2s,U1,m1,+2s +setlocal cinoptions+=j1,J1,U1,m1,+2s +if get(g:, 'dart_trailing_comma_indent', v:false) + setlocal cinoptions+=(2s,u2s +else + setlocal cinoptions+=(s,us +endif setlocal indentexpr=DartIndent() diff --git a/indent/erlang.vim b/indent/erlang.vim index adfd0dd93..8a24126e7 100644 --- a/indent/erlang.vim +++ b/indent/erlang.vim @@ -8,7 +8,7 @@ endif " Contributors: Edwin Fine " Pawel 'kTT' Salata " Ricardo Catalinas Jiménez -" Last Update: 2020-Jun-11 +" Last Update: 2022-Sep-06 " License: Vim license " URL: https://github.com/vim-erlang/vim-erlang-runtime @@ -34,7 +34,7 @@ else endif setlocal indentexpr=ErlangIndent() -setlocal indentkeys+=0=end,0=of,0=catch,0=after,0=when,0=),0=],0=},0=>> +setlocal indentkeys+=0=end,0=of,0=catch,0=after,0=else,0=when,0=),0=],0=},0=>> let b:undo_indent = "setl inde< indk<" @@ -241,8 +241,8 @@ function! s:GetTokensFromLine(line, string_continuation, atom_continuation, " Two-character tokens elseif i + 1 < linelen && - \ index(['->', '<<', '>>', '||', '==', '/=', '=<', '>=', '++', '--', - \ '::'], + \ index(['->', '<<', '>>', '||', '==', '/=', '=<', '>=', '?=', '++', + \ '--', '::'], \ a:line[i : i + 1]) != -1 call add(indtokens, [a:line[i : i + 1], vcol, i]) let next_i = i + 2 @@ -564,8 +564,8 @@ function! s:IsCatchStandalone(lnum, i) let is_standalone = 0 elseif prev_token =~# '[a-z]' if index(['after', 'and', 'andalso', 'band', 'begin', 'bnot', 'bor', 'bsl', - \ 'bsr', 'bxor', 'case', 'catch', 'div', 'not', 'or', 'orelse', - \ 'rem', 'try', 'xor'], prev_token) != -1 + \ 'bsr', 'bxor', 'case', 'catch', 'div', 'maybe', 'not', 'or', + \ 'orelse', 'rem', 'try', 'xor'], prev_token) != -1 " If catch is after these keywords, it is standalone let is_standalone = 1 else @@ -574,7 +574,7 @@ function! s:IsCatchStandalone(lnum, i) " " Keywords: " - may precede 'catch': end - " - may not precede 'catch': fun if of receive when + " - may not precede 'catch': else fun if of receive when " - unused: cond let query let is_standalone = 0 endif @@ -583,7 +583,7 @@ function! s:IsCatchStandalone(lnum, i) let is_standalone = 0 else " This 'else' branch includes the following tokens: - " -> == /= =< < >= > =:= =/= + - * / ++ -- :: < > ; ( [ { ? = ! . | + " -> == /= =< < >= > ?= =:= =/= + - * / ++ -- :: < > ; ( [ { ? = ! . | let is_standalone = 1 endif @@ -596,6 +596,7 @@ endfunction " Purpose: " This function is called when a begin-type element ('begin', 'case', " '[', '<<', etc.) is found. It asks the caller to return if the stack +" if already empty. " Parameters: " stack: [token] " token: string @@ -764,7 +765,7 @@ endfunction function! s:SearchEndPair(lnum, curr_col) return s:SearchPair( \ a:lnum, a:curr_col, - \ '\C\<\%(case\|try\|begin\|receive\|if\)\>\|' . + \ '\C\<\%(case\|try\|begin\|receive\|if\|maybe\)\>\|' . \ '\\%(\s\|\n\|%.*$\|[A-Z_@][a-zA-Z_@]*\)*(', \ '', \ '\') @@ -853,6 +854,7 @@ function! s:ErlangCalcIndent2(lnum, stack) if ret | return res | endif " case EXPR of BRANCHES end + " if BRANCHES end " try EXPR catch BRANCHES end " try EXPR after BODY end " try EXPR catch BRANCHES after BODY end @@ -861,15 +863,17 @@ function! s:ErlangCalcIndent2(lnum, stack) " try EXPR of BRANCHES catch BRANCHES after BODY end " receive BRANCHES end " receive BRANCHES after BRANCHES end + " maybe EXPR end + " maybe EXPR else BRANCHES end " This branch is not Emacs-compatible - elseif (index(['of', 'receive', 'after', 'if'], token) != -1 || + elseif (index(['of', 'receive', 'after', 'if', 'else'], token) != -1 || \ (token ==# 'catch' && !s:IsCatchStandalone(lnum, i))) && \ !last_token_of_line && \ (empty(stack) || stack ==# ['when'] || stack ==# ['->'] || \ stack ==# ['->', ';']) - " If we are after of/receive, but these are not the last + " If we are after of/receive/etc, but these are not the last " tokens of the line, we want to indent like this: " " % stack == [] @@ -895,21 +899,21 @@ function! s:ErlangCalcIndent2(lnum, stack) " stack = ['when'] => LTI is a guard if empty(stack) || stack == ['->', ';'] call s:Log(' LTI is in a condition after ' . - \'"of/receive/after/if/catch" -> return') + \'"of/receive/after/if/else/catch" -> return') return stored_vcol elseif stack == ['->'] call s:Log(' LTI is in a branch after ' . - \'"of/receive/after/if/catch" -> return') + \'"of/receive/after/if/else/catch" -> return') return stored_vcol + shiftwidth() elseif stack == ['when'] call s:Log(' LTI is in a guard after ' . - \'"of/receive/after/if/catch" -> return') + \'"of/receive/after/if/else/catch" -> return') return stored_vcol + shiftwidth() else return s:UnexpectedToken(token, stack) endif - elseif index(['case', 'if', 'try', 'receive'], token) != -1 + elseif index(['case', 'if', 'try', 'receive', 'maybe'], token) != -1 " stack = [] => LTI is a condition " stack = ['->'] => LTI is a branch @@ -919,45 +923,47 @@ function! s:ErlangCalcIndent2(lnum, stack) " pass elseif (token ==# 'case' && stack[0] ==# 'of') || \ (token ==# 'if') || + \ (token ==# 'maybe' && stack[0] ==# 'else') || \ (token ==# 'try' && (stack[0] ==# 'of' || \ stack[0] ==# 'catch' || \ stack[0] ==# 'after')) || \ (token ==# 'receive') " From the indentation point of view, the keyword - " (of/catch/after/end) before the LTI is what counts, so + " (of/catch/after/else/end) before the LTI is what counts, so " when we reached these tokens, and the stack already had - " a catch/after/end, we didn't modify it. + " a catch/after/else/end, we didn't modify it. " - " This way when we reach case/try/receive (i.e. now), - " there is at most one of/catch/after/end token in the + " This way when we reach case/try/receive/maybe (i.e. now), + " there is at most one of/catch/after/else/end token in the " stack. if token ==# 'case' || token ==# 'try' || - \ (token ==# 'receive' && stack[0] ==# 'after') + \ (token ==# 'receive' && stack[0] ==# 'after') || + \ (token ==# 'maybe' && stack[0] ==# 'else') call s:Pop(stack) endif if empty(stack) call s:Log(' LTI is in a condition; matching ' . - \'"case/if/try/receive" found') + \'"case/if/try/receive/maybe" found') let stored_vcol = curr_vcol + shiftwidth() elseif stack[0] ==# 'align_to_begin_element' call s:Pop(stack) let stored_vcol = curr_vcol elseif len(stack) > 1 && stack[0] ==# '->' && stack[1] ==# ';' call s:Log(' LTI is in a condition; matching ' . - \'"case/if/try/receive" found') + \'"case/if/try/receive/maybe" found') call s:Pop(stack) call s:Pop(stack) let stored_vcol = curr_vcol + shiftwidth() elseif stack[0] ==# '->' call s:Log(' LTI is in a branch; matching ' . - \'"case/if/try/receive" found') + \'"case/if/try/receive/maybe" found') call s:Pop(stack) let stored_vcol = curr_vcol + 2 * shiftwidth() elseif stack[0] ==# 'when' call s:Log(' LTI is in a guard; matching ' . - \'"case/if/try/receive" found') + \'"case/if/try/receive/maybe" found') call s:Pop(stack) let stored_vcol = curr_vcol + 2 * shiftwidth() + 2 endif @@ -1219,7 +1225,7 @@ function! s:ErlangCalcIndent2(lnum, stack) if empty(stack) call s:Push(stack, ';') - elseif index([';', '->', 'when', 'end', 'after', 'catch'], + elseif index([';', '->', 'when', 'end', 'after', 'catch', 'else'], \stack[0]) != -1 " Pass: " @@ -1229,10 +1235,10 @@ function! s:ErlangCalcIndent2(lnum, stack) " should keep that, because they signify the type of the " LTI (branch, condition or guard). " - From the indentation point of view, the keyword - " (of/catch/after/end) before the LTI is what counts, so - " if the stack already has a catch/after/end, we don't - " modify it. This way when we reach case/try/receive, - " there will be at most one of/catch/after/end token in + " (of/catch/after/else/end) before the LTI is what counts, so + " if the stack already has a catch/after/else/end, we don't + " modify it. This way when we reach case/try/receive/maybe, + " there will be at most one of/catch/after/else/end token in " the stack. else return s:UnexpectedToken(token, stack) @@ -1248,7 +1254,8 @@ function! s:ErlangCalcIndent2(lnum, stack) " stack = ['->'] -> LTI is a condition " stack = ['->', ';'] -> LTI is a branch call s:Push(stack, '->') - elseif index(['->', 'when', 'end', 'after', 'catch'], stack[0]) != -1 + elseif index(['->', 'when', 'end', 'after', 'catch', 'else'], + \stack[0]) != -1 " Pass: " " - If the stack top is another '->', then one '->' is @@ -1256,10 +1263,10 @@ function! s:ErlangCalcIndent2(lnum, stack) " - If the stack top is a 'when', then we should keep " that, because this signifies that LTI is a in a guard. " - From the indentation point of view, the keyword - " (of/catch/after/end) before the LTI is what counts, so - " if the stack already has a catch/after/end, we don't - " modify it. This way when we reach case/try/receive, - " there will be at most one of/catch/after/end token in + " (of/catch/after/else/end) before the LTI is what counts, so + " if the stack already has a catch/after/else/end, we don't + " modify it. This way when we reach case/try/receive/maybe, + " there will be at most one of/catch/after/else/end token in " the stack. else return s:UnexpectedToken(token, stack) @@ -1289,7 +1296,8 @@ function! s:ErlangCalcIndent2(lnum, stack) " LTI call s:Push(stack, token) endif - elseif index(['->', 'when', 'end', 'after', 'catch'], stack[0]) != -1 + elseif index(['->', 'when', 'end', 'after', 'catch', 'else'], + \stack[0]) != -1 " Pass: " - If the stack top is another 'when', then one 'when' is " enough. @@ -1297,21 +1305,63 @@ function! s:ErlangCalcIndent2(lnum, stack) " should keep that, because they signify the type of the " LTI (branch, condition or guard). " - From the indentation point of view, the keyword - " (of/catch/after/end) before the LTI is what counts, so - " if the stack already has a catch/after/end, we don't - " modify it. This way when we reach case/try/receive, - " there will be at most one of/catch/after/end token in + " (of/catch/after/else/end) before the LTI is what counts, so + " if the stack already has a catch/after/else/end, we don't + " modify it. This way when we reach case/try/receive/maybe, + " there will be at most one of/catch/after/else/end token in " the stack. else return s:UnexpectedToken(token, stack) endif - elseif token ==# 'of' || token ==# 'after' || + elseif token ==# 'of' || token ==# 'after' || token ==# 'else' || \ (token ==# 'catch' && !s:IsCatchStandalone(lnum, i)) - if token ==# 'after' - " If LTI is between an 'after' and the corresponding - " 'end', then let's return + if token ==# 'after' || token ==# 'else' + " If LTI is between an after/else and the corresponding 'end', then + " let's return because calculating the indentation based on + " after/else is enough. + " + " Example: + " receive A after + " LTI + " maybe A else + " LTI + " + " Note about Emacs compabitility {{{ + " + " It would be fine to indent the examples above the following way: + " + " receive A after + " LTI + " maybe A else + " LTI + " + " We intend it the way above because that is how Emacs does it. + " Also, this is a bit faster. + " + " We are still not 100% Emacs compatible because of placing the + " 'end' after the indented blocks. + " + " Emacs example: + " + " receive A after + " LTI + " end, + " maybe A else + " LTI + " end % Yes, it's here (in OTP 25.0, might change + " % later) + " + " vim-erlang example: + " + " receive A after + " LTI + " end, + " maybe A else + " LTI + " end + " }}} let [ret, res] = s:BeginElementFoundIfEmpty(stack, token, curr_vcol, \stored_vcol, shiftwidth()) if ret | return res | endif @@ -1319,7 +1369,8 @@ function! s:ErlangCalcIndent2(lnum, stack) if empty(stack) || stack[0] ==# '->' || stack[0] ==# 'when' call s:Push(stack, token) - elseif stack[0] ==# 'catch' || stack[0] ==# 'after' || stack[0] ==# 'end' + elseif stack[0] ==# 'catch' || stack[0] ==# 'after' || + \stack[0] ==# 'else' || stack[0] ==# 'end' " Pass: From the indentation point of view, the keyword " (of/catch/after/end) before the LTI is what counts, so " if the stack already has a catch/after/end, we don't @@ -1409,7 +1460,7 @@ function! ErlangIndent() endif let ml = matchlist(currline, - \'^\(\s*\)\(\%(end\|of\|catch\|after\)\>\|[)\]}]\|>>\)') + \'^\(\s*\)\(\%(end\|of\|catch\|after\|else\)\>\|[)\]}]\|>>\)') " If the line has a special beginning, but not a standalone catch if !empty(ml) && !(ml[2] ==# 'catch' && s:IsCatchStandalone(v:lnum, 0)) diff --git a/indent/gdscript3.vim b/indent/gdscript3.vim deleted file mode 100644 index 8d69ed1b7..000000000 --- a/indent/gdscript3.vim +++ /dev/null @@ -1,204 +0,0 @@ -if polyglot#init#is_disabled(expand(':p'), 'gdscript', 'indent/gdscript3.vim') - finish -endif - -" Vim indent file -" Language: Python -" Maintainer: Bram Moolenaar -" Original Author: David Bustos -" Last Change: 2013 Jul 9 - -" Modified for GDScript - -" Only load this indent file when no other was loaded. -if exists("b:did_indent") - finish -endif -let b:did_indent = 1 - -" Some preliminary settings -setlocal nolisp " Make sure lisp indenting doesn't supersede us -setlocal autoindent " indentexpr isn't much help otherwise - -setlocal indentexpr=GetPythonIndent(v:lnum) -setlocal indentkeys+=<:>,=elif - -" Only define the function once. -if exists("*GetPythonIndent") - finish -endif -let s:keepcpo= &cpo -set cpo&vim - -" Come here when loading the script the first time. - -let s:maxoff = 50 " maximum number of lines to look backwards for () - -function GetPythonIndent(lnum) - - " If this line is explicitly joined: If the previous line was also joined, - " line it up with that one, otherwise add two 'shiftwidth' - if getline(a:lnum - 1) =~ '\\$' - if a:lnum > 1 && getline(a:lnum - 2) =~ '\\$' - return indent(a:lnum - 1) - endif - return indent(a:lnum - 1) + (exists("g:pyindent_continue") ? eval(g:pyindent_continue) : (shiftwidth() * 2)) - endif - - " If the start of the line is in a string don't change the indent. - if has('syntax_items') - \ && synIDattr(synID(a:lnum, 1, 1), "name") =~ "String$" - return -1 - endif - - " Search backwards for the previous non-empty line. - let plnum = prevnonblank(v:lnum - 1) - - if plnum == 0 - " This is the first non-empty line, use zero indent. - return 0 - endif - - " If the previous line is inside parenthesis, use the indent of the starting - " line. - " Trick: use the non-existing "dummy" variable to break out of the loop when - " going too far back. - call cursor(plnum, 1) - let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW', - \ "line('.') < " . (plnum - s:maxoff) . " ? dummy :" - \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" - \ . " =~ '\\(Comment\\|Todo\\|String\\)$'") - if parlnum > 0 - let plindent = indent(parlnum) - let plnumstart = parlnum - else - let plindent = indent(plnum) - let plnumstart = plnum - endif - - - " When inside parenthesis: If at the first line below the parenthesis add - " two 'shiftwidth', otherwise same as previous line. - " i = (a - " + b - " + c) - call cursor(a:lnum, 1) - let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW', - \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" - \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" - \ . " =~ '\\(Comment\\|Todo\\|String\\)$'") - if p > 0 - if p == plnum - " When the start is inside parenthesis, only indent one 'shiftwidth'. - let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW', - \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" - \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" - \ . " =~ '\\(Comment\\|Todo\\|String\\)$'") - if pp > 0 - return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : shiftwidth()) - endif - return indent(plnum) + (exists("g:pyindent_open_paren") ? eval(g:pyindent_open_paren) : (shiftwidth() * 2)) - endif - if plnumstart == p - return indent(plnum) - endif - return plindent - endif - - - " Get the line and remove a trailing comment. - " Use syntax highlighting attributes when possible. - let pline = getline(plnum) - let pline_len = strlen(pline) - if has('syntax_items') - " If the last character in the line is a comment, do a binary search for - " the start of the comment. synID() is slow, a linear search would take - " too long on a long line. - if synIDattr(synID(plnum, pline_len, 1), "name") =~ "\\(Comment\\|Todo\\)$" - let min = 1 - let max = pline_len - while min < max - let col = (min + max) / 2 - if synIDattr(synID(plnum, col, 1), "name") =~ "\\(Comment\\|Todo\\)$" - let max = col - else - let min = col + 1 - endif - endwhile - let pline = strpart(pline, 0, min - 1) - endif - else - let col = 0 - while col < pline_len - if pline[col] == '#' - let pline = strpart(pline, 0, col) - break - endif - let col = col + 1 - endwhile - endif - - " If the previous line ended with a colon, indent this line - if pline =~ ':\s*$' - return plindent + shiftwidth() - endif - - " If the previous line was a stop-execution statement... - if getline(plnum) =~ '^\s*\(break\|continue\|return\|pass\)\>' - " See if the user has already dedented - if indent(a:lnum) > indent(plnum) - shiftwidth() - " If not, recommend one dedent - return indent(plnum) - shiftwidth() - endif - " Otherwise, trust the user - return -1 - endif - - " If the current line begins with a keyword that lines up with "try" - " if getline(a:lnum) =~ '^\s*\(except\|finally\)\>' - " let lnum = a:lnum - 1 - " while lnum >= 1 - " if getline(lnum) =~ '^\s*\(try\|except\)\>' - " let ind = indent(lnum) - " if ind >= indent(a:lnum) - " return -1 " indent is already less than this - " endif - " return ind " line up with previous try or except - " endif - " let lnum = lnum - 1 - " endwhile - " return -1 " no matching "try"! - " endif - - " If the current line begins with a header keyword, dedent - if getline(a:lnum) =~ '^\s*\(elif\|else\)\>' - - " Unless the previous line was a one-liner - if getline(plnumstart) =~ '^\s*\(for\|if\)\>' - return plindent - endif - - " Or the user has already dedented - if indent(a:lnum) <= plindent - shiftwidth() - return -1 - endif - - return plindent - shiftwidth() - endif - - " When after a () construct we probably want to go back to the start line. - " a = (b - " + c) - " here - if parlnum > 0 - return plindent - endif - - return -1 - -endfunction - -let &cpo = s:keepcpo -unlet s:keepcpo - -" vim:sw=2 diff --git a/indent/glsl.vim b/indent/glsl.vim index 604592847..8b957b480 100644 --- a/indent/glsl.vim +++ b/indent/glsl.vim @@ -11,5 +11,6 @@ endif setlocal autoindent cindent setlocal formatoptions+=roq +setlocal cinoptions& " vim:set sts=2 sw=2 : diff --git a/indent/haml.vim b/indent/haml.vim index ae4f2d105..c636a6e75 100644 --- a/indent/haml.vim +++ b/indent/haml.vim @@ -5,7 +5,7 @@ endif " Vim indent file " Language: Haml " Maintainer: Tim Pope -" Last Change: 2017 Jun 13 +" Last Change: 2022 Mar 15 if exists("b:did_indent") finish diff --git a/indent/ruby.vim b/indent/ruby.vim index e08a38cf2..4bba63de9 100644 --- a/indent/ruby.vim +++ b/indent/ruby.vim @@ -96,7 +96,7 @@ let s:ruby_indent_keywords = \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' " Def without an end clause: def method_call(...) = -let s:ruby_endless_def = '\ -syntax region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gimsuy]\{0,5\}\s*$+ end=+/[gimsuy]\{0,5\}\s*[;.,)\]}:]+me=e-1 nextgroup=typescriptDotNotation oneline +" From pangloss/vim-javascript +" +syntax region typescriptRegexpCharClass contained start=+\[+ skip=+\\.+ end=+\]+ contains=typescriptSpecial extend +syntax match typescriptRegexpBoundary contained "\v\c[$^]|\\b" +syntax match typescriptRegexpBackRef contained "\v\\[1-9]\d*" +syntax match typescriptRegexpQuantifier contained "\v[^\\]%([?*+]|\{\d+%(,\d*)?})\??"lc=1 +syntax match typescriptRegexpOr contained "|" +syntax match typescriptRegexpMod contained "\v\(\?[:=!>]"lc=1 +syntax region typescriptRegexpGroup contained start="[^\\]("lc=1 skip="\\.\|\[\(\\.\|[^]]\+\)\]" end=")" contains=typescriptRegexpCharClass,@typescriptRegexpSpecial keepend +syntax region typescriptRegexpString + \ start=+\%(\%(\:p'), 'caddyfile', 'syntax/caddyfile finish endif -" Language: Caddyfile -" Author: Josh Glendenning +" Language: Caddyfile +" Maintainer: 0az <0az@afzhou.com> +" Original Author: Josh Glendenning if exists("b:current_syntax") finish endif -syn match caddyDirective "^\s*\([a-zA-Z0-9_]\+\)" nextgroup=caddyDirectiveArgs skipwhite -syn region caddyDirectiveArgs start="" end="\({\|#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString nextgroup=caddyDirectiveBlock skipwhite -syn region caddyDirectiveBlock start="{" skip="\\}" end="}" contained contains=caddySubdirective,caddyComment +syn match caddyDirective "\v^\s*(\w\S*)" nextgroup=caddyDirectiveArgs skipwhite +syn region caddyDirectiveArgs start="" end="\({\|#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString,caddyNamedMatcher nextgroup=caddyDirectiveBlock skipwhite +syn region caddyDirectiveBlock start="{" skip="\\}" end="}" contained contains=caddySubdirective,caddyComment,caddyImport -syn match caddySubdirective "^\s*\([a-zA-Z0-9_]\+\)" contained nextgroup=caddySubdirectiveArgs skipwhite -syn region caddySubdirectiveArgs start="" end="\(#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString +syn match caddySubdirective "\v^\s*(\w\S*)" contained nextgroup=caddySubdirectiveArgs skipwhite +syn region caddySubdirectiveArgs start="" end="\(#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString,caddyNamedMatcher -syn match caddyHost "\(https\?:\/\/\)\?\(\(\w\{1,}\.\)\(\w\{2,}\.\?\)\+\|localhost\)\(:[0-9]\{1,5}\)\?" nextgroup=caddyHostBlock skipwhite -syn region caddyHostBlock start="{" skip="\\}" end="}" contained contains=caddyDirective,caddyComment +" Needs priority over Directive +syn match caddyImport "\v^\s*" nextgroup=caddyImportPattern skipwhite +syn match caddyImportPattern "\v\c\S+" contained nextgroup=caddyImportArgs skipwhite +syn region caddyImportArgs start="" end="$"me=s-1 oneline contained contains=caddyPlaceholder,caddyString,caddyNamedMatcher + +syn match caddyHost "\v\c^\s*\zs(https?://)?(([0-9a-z-]+\.)([0-9a-z-]+\.?)+|[0-9a-z-]+)?(:\d{1,5})?" nextgroup=caddyHostBlock skipwhite +syn region caddyHostBlock start="{" skip="\\}" end="}" contained contains=caddyDirective,caddyComment,caddyNamedMatcherDef,caddyImport + +" Needs priority over Host +syn region caddySnippetDef start="("rs=e+1 end=")"re=s-1 oneline keepend contains=caddySnippet +syn match caddySnippet "\v\w+" contained nextgroup=caddySnippetBlock skipwhite + +syn match caddyNamedMatcher "\v^\s*\zs\@\S+" contained skipwhite +syn match caddyNamedMatcherDef "\v\s*\zs\@\S+" nextgroup=caddyNamedMatcherDefBlock +syn region caddyNamedMatcherDefBlock start="{" skip="\\}" end="}" contained contains=caddySubdirective,caddyComment,caddyImport syn region caddyPlaceholder start="{" skip="\\}" end="}" oneline contained syn region caddyString start='"' skip='\\\\\|\\"' end='"' oneline -syn match caddyComment "#.*$" +syn region caddyComment start="#" end="$" oneline hi link caddyDirective Keyword hi link caddySubdirective Structure hi link caddyHost Identifier +hi link caddyImport PreProc +hi link caddySnippetDef PreProc +hi link caddySnippet Identifier hi link caddyPlaceholder Special hi link caddyString String hi link caddyComment Comment +hi link caddyNamedMatcherDef caddyNamedMatcher +hi link caddyNamedMatcher Identifier let b:current_syntax = "caddyfile" diff --git a/syntax/clojure.vim b/syntax/clojure.vim index c892c2673..4397b89be 100644 --- a/syntax/clojure.vim +++ b/syntax/clojure.vim @@ -26,7 +26,7 @@ endif " -*- KEYWORDS -*- " Generated from https://github.com/clojure-vim/clojure.vim/blob/%%RELEASE_TAG%%/clj/src/vim_clojure_static/generate.clj -" Clojure version 1.11.0 +" Clojure version 1.11.1 let s:clojure_syntax_keywords = { \ 'clojureBoolean': ["false","true"], \ 'clojureCond': ["case","case*","clojure.core/case","clojure.core/cond","clojure.core/cond->","clojure.core/cond->>","clojure.core/condp","clojure.core/if-let","clojure.core/if-not","clojure.core/if-some","clojure.core/when","clojure.core/when-first","clojure.core/when-let","clojure.core/when-not","clojure.core/when-some","cond","cond->","cond->>","condp","if","if-let","if-not","if-some","when","when-first","when-let","when-not","when-some"], @@ -100,7 +100,7 @@ syntax region clojureRegexpQuote start=/\\Q/ skip=/\\\\\|\\"/ end=/\\E/ " -*- CHARACTER PROPERTY CLASSES -*- " Generated from https://github.com/clojure-vim/clojure.vim/blob/%%RELEASE_TAG%%/clj/src/vim_clojure_static/generate.clj -" Java version 17.0.2 +" Java version 18.0.1 syntax match clojureRegexpPosixCharClass "\v\\[pP]\{%(Cntrl|A%(l%(pha|num)|SCII)|Space|Graph|Upper|P%(rint|unct)|Blank|XDigit|Digit|Lower)\}" contained display syntax match clojureRegexpJavaCharClass "\v\\[pP]\{java%(Whitespace|JavaIdentifier%(Part|Start)|SpaceChar|Mirrored|TitleCase|I%(SOControl|de%(ographic|ntifierIgnorable))|D%(efined|igit)|U%(pperCase|nicodeIdentifier%(Part|Start))|L%(etter%(OrDigit)?|owerCase)|Alphabetic)\}" contained display syntax match clojureRegexpUnicodeCharClass "\v\\[pP]\{\cIs%(l%(owercase|etter)|hex%(digit|_digit)|w%(hite%(_space|space)|ord)|noncharacter%(_code_point|codepoint)|p%(rint|unctuation)|ideographic|graph|a%(l%(num|phabetic)|ssigned)|uppercase|join%(control|_control)|titlecase|blank|digit|control)\}" contained display diff --git a/syntax/erlang.vim b/syntax/erlang.vim index 473c0606a..72bfb2d52 100644 --- a/syntax/erlang.vim +++ b/syntax/erlang.vim @@ -6,7 +6,7 @@ endif " Language: Erlang (http://www.erlang.org) " Maintainer: Csaba Hoch " Contributor: Adam Rutkowski -" Last Update: 2020-May-26 +" Last Update: 2022-Sep-06 " License: Vim license " URL: https://github.com/vim-erlang/vim-erlang-runtime @@ -65,7 +65,8 @@ syn match erlangQuotedAtomModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' con syn match erlangModifier '\$\%([^\\]\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\)' " Operators, separators -syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|=>\|:=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/' +syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|=>\|:=\|?=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/' +syn match erlangEqualsBinary '=<<\%(<\)\@!' syn keyword erlangOperator div rem or xor bor bxor bsl bsr and band not bnot andalso orelse syn match erlangBracket '{\|}\|\[\|]\||\|||' syn match erlangPipe '|' @@ -80,7 +81,8 @@ syn match erlangGlobalFuncCall '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\ syn match erlangGlobalFuncRef '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@=' contains=erlangComment,erlangVariable " Variables, macros, records, maps -syn match erlangVariable '\<[A-Z_][[:alnum:]_@]*' +syn match erlangVariable '\<[A-Z][[:alnum:]_@]*' +syn match erlangAnonymousVariable '\<_[[:alnum:]_@]*' syn match erlangMacro '??\=[[:alnum:]_@]\+' syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+' syn region erlangQuotedMacro start=/??\=\s*'/ end=/'/ contains=erlangQuotedAtomModifier @@ -96,7 +98,7 @@ syn match erlangBitType '\%(\/\%(\s\|\n\|%.*\n\)*\)\@<=\%(integer\|float\|binary " Constants and Directives syn match erlangUnknownAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\l[[:alnum:]_@]*' contains=erlangComment -syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\|optional_callbacks\)\>' contains=erlangComment +syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\|optional_callbacks\|feature\)\>' contains=erlangComment syn match erlangInclude '^\s*-\%(\s\|\n\|%.*\n\)*\%(include\|include_lib\)\>' contains=erlangComment syn match erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment syn match erlangDefine '^\s*-\%(\s\|\n\|%.*\n\)*\%(define\|undef\)\>' contains=erlangComment @@ -104,8 +106,8 @@ syn match erlangPreCondit '^\s*-\%(\s\|\n\|%.*\n\)*\%(ifdef\|ifndef\|else\|endif syn match erlangType '^\s*-\%(\s\|\n\|%.*\n\)*\%(spec\|type\|opaque\|callback\)\>' contains=erlangComment " Keywords -syn keyword erlangKeyword after begin case catch cond end fun if let of -syn keyword erlangKeyword receive when try +syn keyword erlangKeyword after begin case catch cond end fun if let of else +syn keyword erlangKeyword receive when try maybe " Build-in-functions (BIFs) syn keyword erlangBIF abs alive apply atom_to_binary atom_to_list contained @@ -178,6 +180,7 @@ hi def link erlangModifier Special " Operators, separators hi def link erlangOperator Operator +hi def link erlangEqualsBinary ErrorMsg hi def link erlangRightArrow Operator if s:old_style hi def link erlangBracket Normal @@ -195,6 +198,7 @@ hi def link erlangLocalFuncRef Normal hi def link erlangGlobalFuncCall Function hi def link erlangGlobalFuncRef Function hi def link erlangVariable Normal +hi def link erlangAnonymousVariable erlangVariable hi def link erlangMacro Normal hi def link erlangQuotedMacro Normal hi def link erlangRecord Normal @@ -207,6 +211,7 @@ hi def link erlangLocalFuncRef Normal hi def link erlangGlobalFuncCall Normal hi def link erlangGlobalFuncRef Normal hi def link erlangVariable Identifier +hi def link erlangAnonymousVariable erlangVariable hi def link erlangMacro Macro hi def link erlangQuotedMacro Macro hi def link erlangRecord Structure diff --git a/syntax/gdscript3.vim b/syntax/gdscript3.vim deleted file mode 100644 index cabfdfbd1..000000000 --- a/syntax/gdscript3.vim +++ /dev/null @@ -1,101 +0,0 @@ -if polyglot#init#is_disabled(expand(':p'), 'gdscript', 'syntax/gdscript3.vim') - finish -endif - -" Syntax file for GDScript - -if exists("b:current_syntax") - finish -endif -let b:current_syntax = "gdscript3" - -let s:save_cpo = &cpo -set cpo&vim - -syn keyword gdConditional if elif else match -syn keyword gdRepeat for while -syn keyword gdOperator and or not is in -syn match gdOperator "\V&&\|||\|!\|&\|^\||\|~\|*\|/\|%\|+\|-\|=\|<\|>" -syn match gdDelimiter "\V(\|)\|[\|]\|{\|}" -syn keyword gdStatement break continue pass return -syn keyword gdKeyword extends tool signal self - \ const enum var onready export setget -syn match gdKeyword "\v^\s*((static\s*)=func|class)" - \ nextgroup=gdFunction skipwhite -syn keyword gdBoolean true false - -syn match gdMember "\v<(\.)@<=[a-z_]+\w*>" -syn match gdFunction "\v<\w*>(\()@=" -syn match gdSignal "\v(\s+)@<=<\w+>" -syn match gdSetGet "\v(\s+)@<=<\w+>" -syn match gdSetGet "\v(\s+\w*\s*,\s*)@<=<\w+>" - -syn keyword gdNull null -syn keyword gdClass int float bool -syn match gdClass "\v<\u\w+>" -syn match gdConstant "\v<[A-Z_]+[A-Z0-9_]*>" -syn keyword gdClass AABB IP JSON OS RID -syn match gdNode "\v\$\a+\w*" - -syn region gdString start='\v\"' end='\v\"' -syn region gdString start='\v\'' end='\v\'' -syn match gdEscapeError "\v\\." containedin=gdString -syn match gdEscapeError "\v\\u.{,3}" containedin=gdString -syn match gdEscape "\v\\[abfnrtv\\'"]" containedin=gdString -syn match gdEscape "\v\\u[0-9]{4}" containedin=gdString - -syn match gdFormat "\v\%\%" containedin=gdString -syn match gdFormat "\v\%[+-]=(\d*|\*)=\.=(\d*|\*)=[scdoxXf]" containedin=gdString - -syn match gdNumber "\v<\d+(\.)@!>" -syn match gdNumber "\v<0x\x+(\.)@!>" -syn match gdFloat "\v<\d*\.\d+(\.)@!>" -syn match gdFloat "\v<\d*\.=\d+(e-=\d+)@=" -syn match gdExponent "\v(\d*\.=\d+)@<=e-=\d+>" - -syn match gdComment "\v#.*$" -syn keyword gdTodo TODO FIXME XXX NOTE BUG HACK OPTIMIZE containedin=gdComment - -syn region gdFunctionFold - \ start="\v^\z(\s*)%(%(static\s+)=func|class)>" - \ end="\v\ze%(\s*\n)+%(\z1\s)@!." - \ fold transparent - -syn region gdFold - \ matchgroup=gdComment - \ start='#.*{{{.*$' - \ end='#.*}}}.*$' - \ fold transparent - -hi def link gdConditional Conditional -hi def link gdRepeat Repeat -hi def link gdOperator Operator -hi def link gdDelimiter Delimiter -hi def link gdStatement Statement -hi def link gdKeyword Keyword -hi def link gdBoolean Boolean - -hi def link gdMember Identifier -hi def link gdFunction Function -hi def link gdSignal Function -hi def link gdSetGet Function - -hi def link gdNull Constant -hi def link gdClass Type -hi def link gdConstant Constant -hi def link gdNode Identifier - -hi def link gdString String -hi def link gdEscape Special -hi def link gdFormat Special -hi def link gdNumber Number -hi def link gdFloat Float -hi def link gdExponent Special - -hi def link gdEscapeError Error - -hi def link gdComment Comment -hi def link gdTodo Todo - -let &cpo = s:save_cpo -unlet s:save_cpo diff --git a/syntax/git.vim b/syntax/git.vim index 66a77c206..165930705 100644 --- a/syntax/git.vim +++ b/syntax/git.vim @@ -5,7 +5,7 @@ endif " Vim syntax file " Language: generic git output " Maintainer: Tim Pope -" Last Change: 2019 Dec 05 +" Last Change: 2022 Jan 05 if exists("b:current_syntax") finish @@ -42,7 +42,7 @@ syn match gitReflog /^\x\{40,\} \x\{40,\} .\{-\}\d\+\s-\d\{4\}\t.*/ skipwhite c syn region gitDiff start=/^\%(diff --git \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff fold syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --\%(git\|cc\|combined\) \|$\)\@=/ contains=@gitDiff -syn region gitDiffMerge start=/^\%(diff --\%(cc\|combined\) \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff +syn region gitDiffMerge start=/^\%(diff --\%(cc\|combined\) \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff fold syn region gitDiffMerge start=/^\%(@@@@* -\)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff syn match gitDiffAdded "^ \++.*" contained containedin=gitDiffMerge syn match gitDiffAdded "{+[^}]*+}" contained containedin=gitDiff diff --git a/syntax/gitcommit.vim b/syntax/gitcommit.vim index 3839fffbb..abd945770 100644 --- a/syntax/gitcommit.vim +++ b/syntax/gitcommit.vim @@ -6,7 +6,7 @@ endif " Language: git commit file " Maintainer: Tim Pope " Filenames: *.git/COMMIT_EDITMSG -" Last Change: 2019 Dec 05 +" Last Change: 2022 Jan 05 if exists("b:current_syntax") finish diff --git a/syntax/gitrebase.vim b/syntax/gitrebase.vim index c042f1939..5c94796dd 100644 --- a/syntax/gitrebase.vim +++ b/syntax/gitrebase.vim @@ -6,7 +6,7 @@ endif " Language: git rebase --interactive " Maintainer: Tim Pope " Filenames: git-rebase-todo -" Last Change: 2019 Dec 06 +" Last Change: 2022 Jan 05 if exists("b:current_syntax") finish diff --git a/syntax/go.vim b/syntax/go.vim index 23270e842..2d7dbde41 100644 --- a/syntax/go.vim +++ b/syntax/go.vim @@ -169,14 +169,10 @@ endif syn match goSingleDecl /\%(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst " Integers -syn match goDecimalInt "\<-\=\(0\|[1-9]_\?\(\d\|\d\+_\?\d\+\)*\)\%([Ee][-+]\=\d\+\)\=\>" -"syn match goDecimalError "\<-\=\(_\(\d\+_*\)\+\|\([1-9]\d*_*\)\+__\(\d\+_*\)\+\|\([1-9]\d*_*\)\+_\+\)\%([Ee][-+]\=\d\+\)\=\>" -syn match goHexadecimalInt "\<-\=0[xX]_\?\(\x\+_\?\)\+\>" -"syn match goHexadecimalError "\<-\=0[xX]_\?\(\x\+_\?\)*\(\([^-+%&|^*/ \t0-9A-Fa-f_)]\|__\)\S*\|_\)\>" -syn match goOctalInt "\<-\=0[oO]\?_\?\(\o\+_\?\)\+\>" -"syn match goOctalError "\<-\=0[0-7oO_]*\(\([^-+%&|^*/ \t0-7oOxX_/)\]\}\:;]\|[oO]\{2,\}\|__\)\S*\|_\|[oOxX]\)\>" -syn match goBinaryInt "\<-\=0[bB]_\?\([01]\+_\?\)\+\>" -"syn match goBinaryError "\<-\=0[bB]_\?[01_]*\([^-+%&|^*/ \t01_)]\S*\|__\S*\|_\)\>" +syn match goDecimalInt "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)\>" +syn match goHexadecimalInt "\<-\=0[xX]_\?\%(\x\|\x_\x\)\+\>" +syn match goOctalInt "\<-\=0[oO]\?_\?\%(\o\|\o_\o\)\+\>" +syn match goBinaryInt "\<-\=0[bB]_\?\%([01]\|[01]_[01]\)\+\>" hi def link goDecimalInt Integer hi def link goDecimalError Error @@ -189,19 +185,55 @@ hi def link goBinaryError Error hi def link Integer Number " Floating point -syn match goFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=\>" -syn match goFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=\>" +"float_lit = decimal_float_lit | hex_float_lit . +" +"decimal_float_lit = decimal_digits "." [ decimal_digits ] [ decimal_exponent ] | +" decimal_digits decimal_exponent | +" "." decimal_digits [ decimal_exponent ] . +"decimal_exponent = ( "e" | "E" ) [ "+" | "-" ] decimal_digits . +" +"hex_float_lit = "0" ( "x" | "X" ) hex_mantissa hex_exponent . +"hex_mantissa = [ "_" ] hex_digits "." [ hex_digits ] | +" [ "_" ] hex_digits | +" "." hex_digits . +"hex_exponent = ( "p" | "P" ) [ "+" | "-" ] decimal_digits . +" decimal floats with a decimal point +syn match goFloat "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)\.\%(\%(\%(\d\|\d_\d\)\+\)\=\%([Ee][-+]\=\%(\d\|\d_\d\)\+\)\=\>\)\=" +syn match goFloat "\s\zs-\=\.\%(\d\|\d_\d\)\+\%(\%([Ee][-+]\=\%(\d\|\d_\d\)\+\)\>\)\=" +" decimal floats without a decimal point +syn match goFloat "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)[Ee][-+]\=\%(\d\|\d_\d\)\+\>" +" hexadecimal floats with a decimal point +syn match goHexadecimalFloat "\<-\=0[xX]\%(_\x\|\x\)\+\.\%(\%(\x\|\x_\x\)\+\)\=\%([Pp][-+]\=\%(\d\|\d_\d\)\+\)\=\>" +syn match goHexadecimalFloat "\<-\=0[xX]\.\%(\x\|\x_\x\)\+\%([Pp][-+]\=\%(\d\|\d_\d\)\+\)\=\>" +" hexadecimal floats without a decimal point +syn match goHexadecimalFloat "\<-\=0[xX]\%(_\x\|\x\)\+[Pp][-+]\=\%(\d\|\d_\d\)\+\>" hi def link goFloat Float +hi def link goHexadecimalFloat Float " Imaginary literals -syn match goImaginary "\<-\=\d\+i\>" -syn match goImaginary "\<-\=\d\+[Ee][-+]\=\d\+i\>" -syn match goImaginaryFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=i\>" -syn match goImaginaryFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=i\>" - -hi def link goImaginary Number -hi def link goImaginaryFloat Float +syn match goImaginaryDecimal "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)i\>" +syn match goImaginaryHexadecimal "\<-\=0[xX]_\?\%(\x\|\x_\x\)\+i\>" +syn match goImaginaryOctal "\<-\=0[oO]\?_\?\%(\o\|\o_\o\)\+i\>" +syn match goImaginaryBinary "\<-\=0[bB]_\?\%([01]\|[01]_[01]\)\+i\>" + +" imaginary decimal floats with a decimal point +syn match goImaginaryFloat "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)\.\%(\%(\%(\d\|\d_\d\)\+\)\=\%([Ee][-+]\=\%(\d\|\d_\d\)\+\)\=\)\=i\>" +syn match goImaginaryFloat "\s\zs-\=\.\%(\d\|\d_\d\)\+\%([Ee][-+]\=\%(\d\|\d_\d\)\+\)\=i\>" +" imaginary decimal floats without a decimal point +syn match goImaginaryFloat "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)[Ee][-+]\=\%(\d\|\d_\d\)\+i\>" +" imaginary hexadecimal floats with a decimal point +syn match goImaginaryHexadecimalFloat "\<-\=0[xX]\%(_\x\|\x\)\+\.\%(\%(\x\|\x_\x\)\+\)\=\%([Pp][-+]\=\%(\d\|\d_\d\)\+\)\=i\>" +syn match goImaginaryHexadecimalFloat "\<-\=0[xX]\.\%(\x\|\x_\x\)\+\%([Pp][-+]\=\%(\d\|\d_\d\)\+\)\=i\>" +" imaginary hexadecimal floats without a decimal point +syn match goImaginaryHexadecimalFloat "\<-\=0[xX]\%(_\x\|\x\)\+[Pp][-+]\=\%(\d\|\d_\d\)\+i\>" + +hi def link goImaginaryDecimal Number +hi def link goImaginaryHexadecimal Number +hi def link goImaginaryOctal Number +hi def link goImaginaryBinary Number +hi def link goImaginaryFloat Float +hi def link goImaginaryHexadecimalFloat Float " Spaces after "[]" if go#config#HighlightArrayWhitespaceError() diff --git a/syntax/gsl.vim b/syntax/gsl.vim deleted file mode 100644 index 1c8407be9..000000000 --- a/syntax/gsl.vim +++ /dev/null @@ -1,63 +0,0 @@ -if polyglot#init#is_disabled(expand(':p'), 'gdscript', 'syntax/gsl.vim') - finish -endif - -" Syntax file for Godot Shading Language - -if exists("b:current_syntax") - finish -endif -let b:current_syntax = "gsl" - -let s:save_cpo = &cpo -set cpo&vim - -syn keyword gslConditional if else -syn keyword gslRepeat for while -syn match gslOperator "\V&&\|||\|!\|&\|^\||\|~\|*\|/\|%\|+\|-\|=\|<\|>\|;" -syn match gslDelimiter "\V(\|)\|[\|]\|{\|}" -syn keyword gslStatement return discard -syn keyword gslBoolean true false - -syn keyword gslKeyword shader_type render_mode varying flat noperspective smooth - \ uniform lowp mediump highp in out inout - -syn keyword gslType void bool bvec2 bvec3 bvec4 int ivec2 ivec3 ivec4 - \ uint uvec2 uvec3 uvec4 float vec2 vec3 vec4 - \ mat2 mat3 mat4 sampler2D isampler2D usampler2D samplerCube - -syn match gslMember "\v<(\.)@<=[a-z_]+\w*>" -syn match gslConstant "\v<[A-Z_]+[A-Z0-9_]*>" -syn match gslFunction "\v<\w*>(\()@=" - -syn match gslNumber "\v<\d+(\.)@!>" -syn match gslFloat "\v<\d*\.\d+(\.)@!>" -syn match gslFloat "\v<\d*\.=\d+(e-=\d+)@=" -syn match gslExponent "\v(\d*\.=\d+)@<=e-=\d+>" - -syn match gslComment "\v//.*$" -syn region gslComment start="/\*" end="\*/" -syn keyword gslTodo TODO FIXME XXX NOTE BUG HACK OPTIMIZE containedin=gslComment - -hi def link gslConditional Conditional -hi def link gslRepeat Repeat -hi def link gslOperator Operator -hi def link gslDelimiter Delimiter -hi def link gslStatement Statement -hi def link gslBoolean Boolean - -hi def link gslKeyword Keyword -hi def link gslMember Identifier -hi def link gslConstant Constant -hi def link gslFunction Function -hi def link gslType Type - -hi def link gslNumber Number -hi def link gslFloat Float -hi def link gslExponent Special - -hi def link gslComment Comment -hi def link gslTodo Todo - -let &cpo = s:save_cpo -unlet s:save_cpo diff --git a/syntax/haml.vim b/syntax/haml.vim index 0861ed33c..a6a8b5688 100644 --- a/syntax/haml.vim +++ b/syntax/haml.vim @@ -6,7 +6,7 @@ endif " Language: Haml " Maintainer: Tim Pope " Filenames: *.haml -" Last Change: 2018 Aug 21 +" Last Change: 2019 Dec 05 if exists("b:current_syntax") finish diff --git a/syntax/help.vim b/syntax/help.vim index 5a39fd999..e11f345e7 100644 --- a/syntax/help.vim +++ b/syntax/help.vim @@ -5,7 +5,7 @@ endif " Vim syntax file " Language: Vim help file " Maintainer: Bram Moolenaar (Bram@vim.org) -" Last Change: 2021 Jun 13 +" Last Change: 2022 Sep 26 " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") @@ -43,6 +43,7 @@ syn match helpVim "VIM REFERENCE.*" syn match helpVim "NVIM REFERENCE.*" syn match helpOption "'[a-z]\{2,\}'" syn match helpOption "'t_..'" +syn match helpNormal "'ab'" syn match helpCommand "`[^` \t]\+`"hs=s+1,he=e-1 contains=helpBacktick syn match helpCommand "\(^\|[^a-z"[]\)\zs`[^`]\+`\ze\([^a-z\t."']\|$\)"hs=s+1,he=e-1 contains=helpBacktick syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore diff --git a/syntax/javascript.vim b/syntax/javascript.vim index a30956ebd..c4253b665 100644 --- a/syntax/javascript.vim +++ b/syntax/javascript.vim @@ -28,16 +28,18 @@ syntax sync fromstart " syntax case ignore syntax case match -syntax match jsNoise /[:,;]/ +syntax match jsNoise /[:;]/ +syntax match jsNoise /,/ skipwhite skipempty nextgroup=@jsExpression syntax match jsDot /\./ skipwhite skipempty nextgroup=jsObjectProp,jsFuncCall,jsPrototype,jsTaggedTemplate syntax match jsObjectProp contained /\<\K\k*/ -syntax match jsFuncCall /\<\K\k*\ze\s*(/ +syntax match jsFuncCall /\<\K\k*\ze[\s\n]*(/ syntax match jsParensError /[)}\]]/ " Program Keywords syntax keyword jsStorageClass const var let skipwhite skipempty nextgroup=jsDestructuringBlock,jsDestructuringArray,jsVariableDef syntax match jsVariableDef contained /\<\K\k*/ skipwhite skipempty nextgroup=jsFlowDefinition -syntax keyword jsOperatorKeyword delete instanceof typeof void new in of skipwhite skipempty nextgroup=@jsExpression +syntax keyword jsOperatorKeyword delete instanceof typeof void new in skipwhite skipempty nextgroup=@jsExpression +syntax keyword jsOf of skipwhite skipempty nextgroup=@jsExpression syntax match jsOperator "[-!|&+<>=%/*~^]" skipwhite skipempty nextgroup=@jsExpression syntax match jsOperator /::/ skipwhite skipempty nextgroup=@jsExpression syntax keyword jsBooleanTrue true @@ -103,7 +105,8 @@ syntax keyword jsStatement contained break continue skipwhite skipempty next syntax keyword jsConditional if skipwhite skipempty nextgroup=jsParenIfElse syntax keyword jsConditional else skipwhite skipempty nextgroup=jsCommentIfElse,jsIfElseBlock syntax keyword jsConditional switch skipwhite skipempty nextgroup=jsParenSwitch -syntax keyword jsRepeat while for skipwhite skipempty nextgroup=jsParenRepeat,jsForAwait +syntax keyword jsWhile while skipwhite skipempty nextgroup=jsParenWhile +syntax keyword jsFor for skipwhite skipempty nextgroup=jsParenFor,jsForAwait syntax keyword jsDo do skipwhite skipempty nextgroup=jsRepeatBlock syntax region jsSwitchCase contained matchgroup=jsLabel start=/\<\%(case\|default\)\>/ end=/:\@=/ contains=@jsExpression,jsLabel skipwhite skipempty nextgroup=jsSwitchColon keepend syntax keyword jsTry try skipwhite skipempty nextgroup=jsTryCatchBlock @@ -139,19 +142,20 @@ syntax keyword jsHtmlEvents onblur onclick oncontextmenu ondblclick onfocus " Code blocks syntax region jsBracket matchgroup=jsBrackets start=/\[/ end=/\]/ contains=@jsExpression,jsSpreadExpression extend fold syntax region jsParen matchgroup=jsParens start=/(/ end=/)/ contains=@jsExpression extend fold nextgroup=jsFlowDefinition -syntax region jsParenDecorator contained matchgroup=jsParensDecorator start=/(/ end=/)/ contains=@jsAll extend fold -syntax region jsParenIfElse contained matchgroup=jsParensIfElse start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentIfElse,jsIfElseBlock,jsReturn extend fold -syntax region jsParenRepeat contained matchgroup=jsParensRepeat start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentRepeat,jsRepeatBlock,jsReturn extend fold -syntax region jsParenSwitch contained matchgroup=jsParensSwitch start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold +syntax region jsParenDecorator contained matchgroup=jsParensDecorator start=/(/ end=/)/ contains=@jsExpression extend fold +syntax region jsParenIfElse contained matchgroup=jsParensIfElse start=/(/ end=/)/ contains=@jsExpression skipwhite skipempty nextgroup=jsCommentIfElse,jsIfElseBlock,jsReturn extend fold +syntax region jsParenWhile contained matchgroup=jsParensWhile start=/(/ end=/)/ contains=@jsExpression skipwhite skipempty nextgroup=jsCommentRepeat,jsRepeatBlock,jsReturn extend fold +syntax region jsParenFor contained matchgroup=jsParensFor start=/(/ end=/)/ contains=@jsExpression,jsStorageClass,jsOf skipwhite skipempty nextgroup=jsCommentRepeat,jsRepeatBlock,jsReturn extend fold +syntax region jsParenSwitch contained matchgroup=jsParensSwitch start=/(/ end=/)/ contains=@jsExpression 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,jsAsyncKeyword,jsNoise extend fold -syntax region jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold -syntax region jsIfElseBlock contained matchgroup=jsIfElseBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold -syntax region jsTryCatchBlock contained matchgroup=jsTryCatchBraces start=/{/ end=/}/ contains=@jsAll,jsBlock skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold -syntax region jsFinallyBlock contained matchgroup=jsFinallyBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold -syntax region jsSwitchBlock contained matchgroup=jsSwitchBraces start=/{/ end=/}/ contains=@jsAll,jsBlock,jsSwitchCase extend fold -syntax region jsRepeatBlock contained matchgroup=jsRepeatBraces start=/{/ end=/}/ contains=@jsAll,jsBlock 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 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,jsSwitchCase 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,jsComment nextgroup=jsFlowDefinition extend fold syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsDestructuringNoise,jsDestructuringProperty,jsSpreadExpression,jsDestructuringBlock,jsDestructuringArray,jsComment nextgroup=jsFlowDefinition extend fold syntax region jsObject contained matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectShorthandProp,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsDecorator,jsAsyncKeyword,jsTemplateString extend fold @@ -169,7 +173,7 @@ syntax match jsFuncName contained /\<\K\k*/ skipwhite skipempty ne 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 +syntax keyword jsForAwait contained await skipwhite skipempty nextgroup=jsParenFor " Matches a single keyword argument with no parens syntax match jsArrowFuncArgs /\<\K\k*\ze\s*=>/ skipwhite contains=jsFuncArgs skipwhite skipempty nextgroup=jsArrowFunction extend @@ -237,7 +241,7 @@ if exists("javascript_plugin_flow") endif syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsOperatorKeyword,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,jsForAwait,jsAsyncKeyword,jsStatement,jsDot -syntax cluster jsAll contains=@jsExpression,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsException,jsTry,jsNoise,jsBlockLabel +syntax cluster jsAll contains=@jsExpression,jsStorageClass,jsConditional,jsWhile,jsFor,jsReturn,jsException,jsTry,jsNoise,jsBlockLabel,jsBlock " Define the default highlighting. " For version 5.7 and earlier: only when not done already @@ -252,6 +256,8 @@ if version >= 508 || !exists("did_javascript_syn_inits") HiLink jsComment Comment HiLink jsEnvComment PreProc HiLink jsParensIfElse jsParens + HiLink jsParensWhile jsParensRepeat + HiLink jsParensFor jsParensRepeat HiLink jsParensRepeat jsParens HiLink jsParensSwitch jsParens HiLink jsParensCatch jsParens @@ -277,6 +283,8 @@ if version >= 508 || !exists("did_javascript_syn_inits") HiLink jsBranch Conditional HiLink jsLabel Label HiLink jsReturn Statement + HiLink jsWhile jsRepeat + HiLink jsFor jsRepeat HiLink jsRepeat Repeat HiLink jsDo Repeat HiLink jsStatement Statement diff --git a/syntax/julia.vim b/syntax/julia.vim index 0dcb1382e..5f35f4071 100644 --- a/syntax/julia.vim +++ b/syntax/julia.vim @@ -62,12 +62,6 @@ let s:op_chars = '\U25\U26\U2A\U2B\U2D\U2F\U3C-\U3E\U5C\U5E\U7C\U7E\UAC\UB1\UD7\ " The list contains the following characters: '…⁝⅋←↑→↓↔↚↛↜↝↞↠↢↣↤↦↩↪↫↬↮↶↷↺↻↼↽⇀⇁⇄⇆⇇⇉⇋⇌⇍⇎⇏⇐⇒⇔⇚⇛⇜⇝⇠⇢⇴⇵⇶⇷⇸⇹⇺⇻⇼⇽⇾⇿∈∉∊∋∌∍∓∔∗∘∙√∛∜∝∤∥∦∧∨∩∪∷∸∺∻∽∾≀≁≂≃≄≅≆≇≈≉≊≋≌≍≎≏≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≠≡≢≣≤≥≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊂⊃⊄⊅⊆⊇⊈⊉⊊⊋⊍⊎⊏⊐⊑⊒⊓⊔⊕⊖⊗⊘⊙⊚⊛⊜⊞⊟⊠⊡⊢⊣⊩⊬⊮⊰⊱⊲⊳⊴⊵⊶⊷⊻⊼⊽⋄⋅⋆⋇⋉⋊⋋⋌⋍⋎⋏⋐⋑⋒⋓⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋮⋯⋰⋱⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⌿▷⟂⟈⟉⟑⟒⟕⟖⟗⟰⟱⟵⟶⟷⟹⟺⟻⟼⟽⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤈⤉⤊⤋⤌⤍⤎⤏⤐⤑⤒⤓⤔⤕⤖⤗⤘⤝⤞⤟⤠⥄⥅⥆⥇⥈⥉⥊⥋⥌⥍⥎⥏⥐⥑⥒⥓⥔⥕⥖⥗⥘⥙⥚⥛⥜⥝⥞⥟⥠⥡⥢⥣⥤⥥⥦⥧⥨⥩⥪⥫⥬⥭⥮⥯⥰⦷⦸⦼⦾⦿⧀⧁⧡⧣⧤⧥⧴⧶⧷⧺⧻⨇⨈⨝⨟⨢⨣⨤⨥⨦⨧⨨⨩⨪⨫⨬⨭⨮⨰⨱⨲⨳⨴⨵⨶⨷⨸⨹⨺⨻⨼⨽⩀⩁⩂⩃⩄⩅⩊⩋⩌⩍⩎⩏⩐⩑⩒⩓⩔⩕⩖⩗⩘⩚⩛⩜⩝⩞⩟⩠⩡⩢⩣⩦⩧⩪⩫⩬⩭⩮⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫛⫷⫸⫹⫺⬰⬱⬲⬳⬴⬵⬶⬷⬸⬹⬺⬻⬼⬽⬾⬿⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌←↑→↓' let s:op_chars_wc = '\U2026\U205D\U214B\U2190-\U2194\U219A-\U219E\U21A0\U21A2-\U21A4\U21A6\U21A9-\U21AC\U21AE\U21B6\U21B7\U21BA-\U21BD\U21C0\U21C1\U21C4\U21C6\U21C7\U21C9\U21CB-\U21D0\U21D2\U21D4\U21DA-\U21DD\U21E0\U21E2\U21F4-\U21FF\U2208-\U220D\U2213\U2214\U2217-\U221D\U2224-\U222A\U2237\U2238\U223A\U223B\U223D\U223E\U2240-\U228B\U228D-\U229C\U229E-\U22A3\U22A9\U22AC\U22AE\U22B0-\U22B7\U22BB-\U22BD\U22C4-\U22C7\U22C9-\U22D3\U22D5-\U22FF\U233F\U25B7\U27C2\U27C8\U27C9\U27D1\U27D2\U27D5-\U27D7\U27F0\U27F1\U27F5-\U27F7\U27F9-\U27FF\U2900-\U2918\U291D-\U2920\U2944-\U2970\U29B7\U29B8\U29BC\U29BE-\U29C1\U29E1\U29E3-\U29E5\U29F4\U29F6\U29F7\U29FA\U29FB\U2A07\U2A08\U2A1D\U2A1F\U2A22-\U2A2E\U2A30-\U2A3D\U2A40-\U2A45\U2A4A-\U2A58\U2A5A-\U2A63\U2A66\U2A67\U2A6A-\U2AD9\U2ADB\U2AF7-\U2AFA\U2B30-\U2B44\U2B47-\U2B4C\UFFE9-\UFFEC' -" Full operators regex -let s:operators = '\%(' . '\.\%([-+*/^÷%|&⊻]\|//\|\\\|>>\|>>>\?\)\?=' - \ . '\|' . '[:<>]=\|||\|&&\||>\|<|\|[<>:]:\|<<\|>>>\?\|//\|[-=]>\|\.\.\.\?' - \ . '\|' . '\.\?[!' . s:op_chars . s:op_chars_wc . ']' - \ . '\)' - " Characters that can be used to start an identifier. Above \UBF we don't " bother checking. (If a UTF8 operator is used, it will take precedence anyway.) @@ -80,6 +74,12 @@ let s:id_charsW = '\%([0-9A-Za-z_!\UA2-\UA6\UA9\UAA\UAE-\UB0\UB2-\UB5\UB8-\UBA\U " A valid julia identifier, more or less let s:idregex = '\%(' . s:id_charsH . s:id_charsW . '*\)' +" Full operators regex +let s:operators = '\%(' . '\.\%([-+*/^÷%|&⊻]\|//\|\\\|>>\|>>>\?\)\?=' + \ . '\|' . '[!:<>]=\|||\|&&\||>\|<|\|[<>:]:\|<<\|>>>\?\|//\|[-=]>\|\.\.\.\?' + \ . '\|' . '\.!' . '\|'.s:id_charsW.'\@'.s:d(1).'\ze\@=.*" +syn match ktModifier "\v\ze\@=.*<(class|object)>" +syn match ktModifier "\v\ze\@=.*" syn match ktModifier "\v<(tailrec|operator|infix)>\ze\@=.*" -syn match ktModifier "\v<(const)>\ze\@=.*" -syn match ktModifier "\v<(lateinit)>\ze\@=.*" +syn match ktModifier "\v\ze\@=.*" +syn match ktModifier "\v\ze\@=.*" syn match ktModifier "\v<(internal|private|protected|public)>\ze\@=.*<(class|object|interface|typealias|fun|val|var|constructor|get|set)>" syn match ktOperator "\v\?:|::|\<\=? | \>\=?|[!=]\=\=?|\??|[-*+/%]\=?|[!&|]" diff --git a/syntax/llvm.vim b/syntax/llvm.vim index ee58753f3..50dc0c9fe 100644 --- a/syntax/llvm.vim +++ b/syntax/llvm.vim @@ -19,8 +19,8 @@ syn case match " Types also include struct, array, vector, etc. but these don't " benefit as much from having dedicated highlighting rules. syn keyword llvmType void half bfloat float double x86_fp80 fp128 ppc_fp128 -syn keyword llvmType label metadata x86_mmx -syn keyword llvmType type label opaque token +syn keyword llvmType label metadata x86_mmx x86_amx +syn keyword llvmType type label opaque token ptr syn match llvmType /\/ " Instructions. @@ -29,16 +29,16 @@ syn match llvmType /\/ syn keyword llvmStatement add addrspacecast alloca and arcp ashr atomicrmw syn keyword llvmStatement bitcast br catchpad catchswitch catchret call callbr syn keyword llvmStatement cleanuppad cleanupret cmpxchg eq exact extractelement -syn keyword llvmStatement extractvalue fadd fast fcmp fdiv fence fmul fpext -syn keyword llvmStatement fptosi fptoui fptrunc free frem fsub fneg getelementptr -syn keyword llvmStatement icmp inbounds indirectbr insertelement insertvalue -syn keyword llvmStatement inttoptr invoke landingpad load lshr malloc max min -syn keyword llvmStatement mul nand ne ninf nnan nsw nsz nuw oeq oge ogt ole -syn keyword llvmStatement olt one or ord phi ptrtoint resume ret sdiv select -syn keyword llvmStatement sext sge sgt shl shufflevector sitofp sle slt srem -syn keyword llvmStatement store sub switch trunc udiv ueq uge ugt uitofp ule ult -syn keyword llvmStatement umax umin une uno unreachable unwind urem va_arg -syn keyword llvmStatement xchg xor zext +syn keyword llvmStatement extractvalue fadd fast fcmp fdiv fence fmul fneg fpext +syn keyword llvmStatement fptosi fptoui fptrunc free freeze frem fsub +syn keyword llvmStatement getelementptr icmp inbounds indirectbr insertelement +syn keyword llvmStatement insertvalue inttoptr invoke landingpad load lshr +syn keyword llvmStatement malloc max min mul nand ne ninf nnan nsw nsz nuw oeq +syn keyword llvmStatement oge ogt ole olt one or ord phi ptrtoint resume ret +syn keyword llvmStatement sdiv select sext sge sgt shl shufflevector sitofp +syn keyword llvmStatement sle slt srem store sub switch trunc udiv ueq uge ugt +syn keyword llvmStatement uitofp ule ult umax umin une uno unreachable unwind +syn keyword llvmStatement urem va_arg xchg xor zext " Keywords. syn keyword llvmKeyword @@ -48,11 +48,12 @@ syn keyword llvmKeyword \ alias \ align \ alignstack + \ allocsize \ alwaysinline \ appending \ argmemonly - \ arm_aapcscc \ arm_aapcs_vfpcc + \ arm_aapcscc \ arm_apcscc \ asm \ atomic @@ -62,51 +63,58 @@ syn keyword llvmKeyword \ byref \ byval \ c - \ catch \ caller + \ catch \ cc \ ccc \ cleanup + \ cold \ coldcc \ comdat \ common \ constant + \ convergent \ datalayout \ declare \ default \ define \ deplibs \ dereferenceable + \ dereferenceable_or_null \ distinct \ dllexport \ dllimport \ dso_local \ dso_preemptable \ except + \ extern_weak \ external \ externally_initialized - \ extern_weak \ fastcc - \ tailcc \ filter \ from \ gc \ global - \ hhvmcc \ hhvm_ccc + \ hhvmcc \ hidden + \ hot \ immarg + \ inaccessiblemem_or_argmemonly + \ inaccessiblememonly + \ inalloca \ initialexec \ inlinehint \ inreg - \ inteldialect \ intel_ocl_bicc + \ inteldialect \ internal + \ jumptable \ linkonce \ linkonce_odr + \ local_unnamed_addr \ localdynamic \ localexec - \ local_unnamed_addr \ minsize \ module \ monotonic @@ -117,19 +125,32 @@ syn keyword llvmKeyword \ nest \ noalias \ nobuiltin + \ nocallback \ nocapture + \ nocf_check + \ no_cfi + \ noduplicate + \ nofree \ noimplicitfloat \ noinline + \ nomerge \ nonlazybind \ nonnull + \ noprofile \ norecurse \ noredzone \ noreturn + \ nosync \ noundef \ nounwind + \ nosanitize_bounds + \ nosanitize_coverage + \ null_pointer_is_valid + \ optforfuzzing \ optnone \ optsize \ personality + \ preallocated \ private \ protected \ ptx_device @@ -139,16 +160,20 @@ syn keyword llvmKeyword \ release \ returned \ returns_twice + \ safestack \ sanitize_address + \ sanitize_hwaddress \ sanitize_memory + \ sanitize_memtag \ sanitize_thread \ section \ seq_cst + \ shadowcallstack \ sideeffect \ signext - \ syncscope \ source_filename \ speculatable + \ speculative_load_hardening \ spir_func \ spir_kernel \ sret @@ -157,8 +182,12 @@ syn keyword llvmKeyword \ sspstrong \ strictfp \ swiftcc + \ swifterror + \ swifttailcc \ swiftself + \ syncscope \ tail + \ tailcc \ target \ thread_local \ to @@ -171,10 +200,11 @@ syn keyword llvmKeyword \ volatile \ weak \ weak_odr + \ willreturn + \ win64cc \ within \ writeonly \ x86_64_sysvcc - \ win64cc \ x86_fastcallcc \ x86_stdcallcc \ x86_thiscallcc @@ -189,7 +219,7 @@ syn match llvmNumber /-\?\<\d\+\>/ syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/ syn match llvmFloat /\<0x\x\+\>/ syn keyword llvmBoolean true false -syn keyword llvmConstant zeroinitializer undef null none +syn keyword llvmConstant zeroinitializer undef null none poison vscale syn match llvmComment /;.*$/ syn region llvmString start=/"/ skip=/\\"/ end=/"/ syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/ @@ -212,7 +242,8 @@ syn match llvmSpecialComment /;\s*REQUIRES:.*$/ syn match llvmSpecialComment /;\s*RUN:.*$/ syn match llvmSpecialComment /;\s*ALLOW_RETRIES:.*$/ syn match llvmSpecialComment /;\s*CHECK:.*$/ -syn match llvmSpecialComment "\v;\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL):.*$" +syn match llvmSpecialComment /;\s*CHECK-EMPTY:\s*$/ +syn match llvmSpecialComment /\v;\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL|COUNT-\d+):.*$/ syn match llvmSpecialComment /;\s*XFAIL:.*$/ if version >= 508 || !exists("did_c_syn_inits") diff --git a/syntax/machine-ir.vim b/syntax/machine-ir.vim new file mode 100644 index 000000000..ad43a9f5e --- /dev/null +++ b/syntax/machine-ir.vim @@ -0,0 +1,42 @@ +if polyglot#init#is_disabled(expand(':p'), 'llvm', 'syntax/machine-ir.vim') + finish +endif + +" Vim syntax file +" Language: mir +" Maintainer: The LLVM team, http://llvm.org/ +" Version: $Revision$ + +syn case match + +" FIXME: MIR doesn't actually match LLVM IR. Stop including it all as a +" fallback once enough is implemented. +" See the MIR LangRef: https://llvm.org/docs/MIRLangRef.html +unlet b:current_syntax " Unlet so that the LLVM syntax will load +runtime! syntax/llvm.vim +unlet b:current_syntax + +syn match mirType /\<[sp]\d\+\>/ + +" Opcodes. Matching instead of listing them because individual targets can add +" these. FIXME: Maybe use some more context to make this more accurate? +syn match mirStatement /\<[A-Z][A-Za-z0-9_]*\>/ + +syn match mirPReg /$[-a-zA-Z$._][-a-zA-Z$._0-9]*/ + +if version >= 508 || !exists("did_c_syn_inits") + if version < 508 + let did_c_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink mirType Type + HiLink mirStatement Statement + HiLink mirPReg Identifier + + delcommand HiLink +endif + +let b:current_syntax = "mir" diff --git a/syntax/meson.vim b/syntax/meson.vim index c392cccd9..d3af405de 100644 --- a/syntax/meson.vim +++ b/syntax/meson.vim @@ -72,6 +72,7 @@ syn keyword mesonBuiltin \ add_global_link_arguments \ add_languages \ add_project_arguments + \ add_project_dependencies \ add_project_link_arguments \ add_test_setup \ alias_target diff --git a/syntax/mir.vim b/syntax/mir.vim new file mode 100644 index 000000000..55273945d --- /dev/null +++ b/syntax/mir.vim @@ -0,0 +1,52 @@ +if polyglot#init#is_disabled(expand(':p'), 'llvm', 'syntax/mir.vim') + finish +endif + +" Vim syntax file +" Language: mir +" Maintainer: The LLVM team, http://llvm.org/ +" Version: $Revision$ + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn case match + +" MIR is embedded in a yaml container, so we load all of the yaml syntax. +runtime! syntax/yaml.vim +unlet b:current_syntax + +" The first document of a file is allowed to contain an LLVM IR module inside +" a top-level yaml block string. +syntax include @LLVM syntax/llvm.vim +" FIXME: This should only be allowed for the first document of the file +syntax region llvm start=/\(^---\s*|\)\@<=/ end=/\(^\.\.\.\)\@=/ contains=@LLVM + +" The `body:` field of a document contains the MIR dump of the function +syntax include @MIR syntax/machine-ir.vim +syntax region mir start=/\(^body:\s*|\)\@<=/ end=/\(^[^[:space:]]\)\@=/ contains=@MIR + +" Syntax-highlight lit test commands and bug numbers. +syn match mirSpecialComment /#\s*PR\d*\s*$/ +syn match mirSpecialComment /#\s*REQUIRES:.*$/ +syn match mirSpecialComment /#\s*RUN:.*$/ +syn match mirSpecialComment /#\s*ALLOW_RETRIES:.*$/ +syn match mirSpecialComment /#\s*CHECK:.*$/ +syn match mirSpecialComment "\v#\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL):.*$" +syn match mirSpecialComment /#\s*XFAIL:.*$/ + +if version >= 508 || !exists("did_c_syn_inits") + if version < 508 + let did_c_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink mirSpecialComment SpecialComment +endif + +let b:current_syntax = "mir" diff --git a/syntax/mlir.vim b/syntax/mlir.vim index 6539cbdc9..13f468c95 100644 --- a/syntax/mlir.vim +++ b/syntax/mlir.vim @@ -18,7 +18,7 @@ syn case match " Types. " -syn keyword mlirType index f16 f32 f64 +syn keyword mlirType index f16 f32 f64 bf16 " Signless integer types. syn match mlirType /\/ " Unsigned integer types. @@ -27,7 +27,7 @@ syn match mlirType /\/ syn match mlirType /\/ " Elemental types inside memref, tensor, or vector types. -syn match mlirType /x\s*\zs\(f16\|f32\|f64\|i\d\+\|ui\d\+\|si\d\+\)/ +syn match mlirType /x\s*\zs\(bf16|f16\|f32\|f64\|i\d\+\|ui\d\+\|si\d\+\)/ " Shaped types. syn match mlirType /\/ @@ -38,7 +38,6 @@ syn match mlirType /\/ syn match mlirType /x\s*\zsvector/ " Operations. -" Standard dialect ops. " TODO: this list is not exhaustive. syn keyword mlirOps alloc alloca addf addi and call call_indirect cmpf cmpi syn keyword mlirOps constant dealloc divf dma_start dma_wait dim exp @@ -47,6 +46,9 @@ syn keyword mlirOps memref_shape_cast mulf muli negf powf prefetch rsqrt sitofp syn keyword mlirOps splat store select sqrt subf subi subview tanh syn keyword mlirOps view +" Math ops. +syn match mlirOps /\/ + " Affine ops. syn match mlirOps /\/ syn match mlirOps /\/ @@ -57,8 +59,10 @@ syn match mlirOps /\/ syn match mlirOps /\/ syn match mlirOps /\/ syn match mlirOps /\/ -syn match mlirOps /\/ -syn match mlirOps /\/ +syn match mlirOps /\/ +syn match mlirOps /\/ +syn match mlirOps /\/ +syn match mlirOps /\/ " TODO: dialect name prefixed ops (llvm or std). @@ -84,12 +88,22 @@ syn match mlirNumber /x\s*\zs-\?\d\+\ze\s*x/ syn match mlirFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/ syn match mlirFloat /\<0x\x\+\>/ syn keyword mlirBoolean true false -syn match mlirComment /\/\/.*$/ +" Spell checking is enabled only in comments by default. +syn match mlirComment /\/\/.*$/ contains=@Spell syn region mlirString start=/"/ skip=/\\"/ end=/"/ syn match mlirLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/ +" Prefixed identifiers usually used for ssa values and symbols. syn match mlirIdentifier /[%@][a-zA-Z$._-][a-zA-Z0-9$._-]*/ -syn match mlirIdentifier /[%@!]\d\+\>/ -syn match mlirMapSetOutline "#.*$" +syn match mlirIdentifier /[%@]\d\+\>/ +" Prefixed identifiers usually used for blocks. +syn match mlirBlockIdentifier /\^[a-zA-Z$._-][a-zA-Z0-9$._-]*/ +syn match mlirBlockIdentifier /\^\d\+\>/ +" Prefixed identifiers usually used for types. +syn match mlirTypeIdentifier /![a-zA-Z$._-][a-zA-Z0-9$._-]*/ +syn match mlirTypeIdentifier /!\d\+\>/ +" Prefixed identifiers usually used for attribute aliases and result numbers. +syn match mlirAttrIdentifier /#[a-zA-Z$._-][a-zA-Z0-9$._-]*/ +syn match mlirAttrIdentifier /#\d\+\>/ " Syntax-highlight lit test commands and bug numbers. syn match mlirSpecialComment /\/\/\s*RUN:.*$/ @@ -111,7 +125,6 @@ if version >= 508 || !exists("did_c_syn_inits") HiLink mlirType Type HiLink mlirOps Statement - HiLink mlirMapSetOutline PreProc HiLink mlirNumber Number HiLink mlirComment Comment HiLink mlirString String @@ -122,6 +135,9 @@ if version >= 508 || !exists("did_c_syn_inits") HiLink mlirConstant Constant HiLink mlirSpecialComment SpecialComment HiLink mlirIdentifier Identifier + HiLink mlirBlockIdentifier Label + HiLink mlirTypeIdentifier Type + HiLink mlirAttrIdentifier PreProc delcommand HiLink endif diff --git a/syntax/ocaml.vim b/syntax/ocaml.vim index e3e6cfa3e..88b2fa314 100644 --- a/syntax/ocaml.vim +++ b/syntax/ocaml.vim @@ -10,6 +10,7 @@ endif " Issac Trotts " URL: https://github.com/ocaml/vim-ocaml " Last Change: +" 2019 Nov 05 - Accurate type highlighting (Maëlan) " 2018 Nov 08 - Improved highlighting of operators (Maëlan) " 2018 Apr 22 - Improved support for PPX (Andrey Popp) " 2018 Mar 16 - Remove raise, lnot and not from keywords (Étienne Millon, "copy") @@ -42,25 +43,18 @@ syn case match " Access to the method of an object syn match ocamlMethod "#" -" Script headers highlighted like comments -syn match ocamlComment "^#!.*" contains=@Spell - " Scripting directives syn match ocamlScript "^#\<\(quit\|labels\|warnings\|warn_error\|directory\|remove_directory\|cd\|load\|load_rec\|use\|mod_use\|install_printer\|remove_printer\|require\|list\|ppx\|principal\|predicates\|rectypes\|thread\|trace\|untrace\|untrace_all\|print_depth\|print_length\|camlp4o\|camlp4r\|topfind_log\|topfind_verbose\)\>" " lowercase identifier - the standard way to match syn match ocamlLCIdentifier /\<\(\l\|_\)\(\w\|'\)*\>/ -syn match ocamlKeyChar "|" - " Errors syn match ocamlBraceErr "}" syn match ocamlBrackErr "\]" syn match ocamlParenErr ")" syn match ocamlArrErr "|]" -syn match ocamlCommentErr "\*)" - syn match ocamlCountErr "\" syn match ocamlCountErr "\" @@ -79,19 +73,22 @@ else syn match ocamlEndErr "\" endif -" Some convenient clusters -syn cluster ocamlAllErrs contains=ocamlBraceErr,ocamlBrackErr,ocamlParenErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr +" These keywords are only expected nested in constructions that are handled by +" the type linter, so outside of type contexts we highlight them as errors: +syn match ocamlKwErr "\<\(mutable\|nonrec\|of\|private\)\>" -syn cluster ocamlAENoParen contains=ocamlBraceErr,ocamlBrackErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr +" Some convenient clusters +syn cluster ocamlAllErrs contains=@ocamlAENoParen,ocamlParenErr +syn cluster ocamlAENoParen contains=ocamlBraceErr,ocamlBrackErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr,ocamlKwErr syn cluster ocamlContained contains=ocamlTodo,ocamlPreDef,ocamlModParam,ocamlModParam1,ocamlMPRestr,ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3,ocamlModRHS,ocamlFuncWith,ocamlFuncStruct,ocamlModTypeRestr,ocamlModTRWith,ocamlWith,ocamlWithRest,ocamlModType,ocamlFullMod,ocamlVal " Enclosing delimiters -syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="(" matchgroup=ocamlKeywordDelimiter end=")" contains=ALLBUT,@ocamlContained,ocamlParenErr -syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="{" matchgroup=ocamlKeywordDelimiter end="}" contains=ALLBUT,@ocamlContained,ocamlBraceErr -syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="\[" matchgroup=ocamlKeywordDelimiter end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr -syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="\[|" matchgroup=ocamlKeywordDelimiter end="|\]" contains=ALLBUT,@ocamlContained,ocamlArrErr +syn region ocamlNone transparent matchgroup=ocamlEncl start="(" matchgroup=ocamlEncl end=")" contains=ALLBUT,@ocamlContained,ocamlParenErr +syn region ocamlNone transparent matchgroup=ocamlEncl start="{" matchgroup=ocamlEncl end="}" contains=ALLBUT,@ocamlContained,ocamlBraceErr +syn region ocamlNone transparent matchgroup=ocamlEncl start="\[" matchgroup=ocamlEncl end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr +syn region ocamlNone transparent matchgroup=ocamlEncl start="\[|" matchgroup=ocamlEncl end="|\]" contains=ALLBUT,@ocamlContained,ocamlArrErr " Comments @@ -141,7 +138,7 @@ syn match ocamlKeyword "\" skipwhite skipempty nextgroup=ocamlModPa " "module" - somewhat complicated stuff ;-) syn region ocamlModule matchgroup=ocamlKeyword start="\" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlPreDef syn region ocamlPreDef start="."me=e-1 matchgroup=ocamlKeyword end="\l\|=\|)"me=e-1 contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam,ocamlGenMod,ocamlModTypeRestr,ocamlModTRWith nextgroup=ocamlModPreRHS -syn region ocamlModParam start="([^*]" end=")" contained contains=ocamlGenMod,ocamlModParam1,ocamlSig,ocamlVal +syn region ocamlModParam start="(\*\@!" end=")" contained contains=ocamlGenMod,ocamlModParam,ocamlModParam1,ocamlSig,ocamlVal syn match ocamlModParam1 "\<\u\(\w\|'\)*\>" contained skipwhite skipempty syn match ocamlGenMod "()" contained skipwhite skipempty @@ -155,7 +152,7 @@ syn region ocamlVal matchgroup=ocamlKeyword start="\" matchgroup=ocamlLC syn region ocamlModRHS start="." end=". *\w\|([^*]"me=e-2 contained contains=ocamlComment skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod syn match ocamlFullMod "\<\u\(\w\|'\)*\( *\. *\u\(\w\|'\)*\)*" contained skipwhite skipempty nextgroup=ocamlFuncWith -syn region ocamlFuncWith start="([^*)]"me=e-1 end=")" contained contains=ocamlComment,ocamlWith,ocamlFuncStruct skipwhite skipempty nextgroup=ocamlFuncWith +syn region ocamlFuncWith start="([*)]\@!" end=")" contained contains=ocamlComment,ocamlWith,ocamlFuncStruct skipwhite skipempty nextgroup=ocamlFuncWith syn region ocamlFuncStruct matchgroup=ocamlStructEncl start="[^a-zA-Z]struct\>"hs=s+1 matchgroup=ocamlStructEncl end="\" contains=ALLBUT,@ocamlContained,ocamlEndErr syn match ocamlModTypeRestr "\<\w\(\w\|'\)*\( *\. *\w\(\w\|'\)*\)*\>" contained @@ -167,7 +164,7 @@ syn region ocamlWithRest start="[^)]" end=")"me=e-1 contained contains=ALLBUT, syn region ocamlStruct matchgroup=ocamlStructEncl start="\<\(module\s\+\)\=struct\>" matchgroup=ocamlStructEncl end="\" contains=ALLBUT,@ocamlContained,ocamlEndErr " "module type" -syn region ocamlKeyword start="\\s*\\(\s*\\)\=" matchgroup=ocamlModule end="\<\w\(\w\|'\)*\>" contains=ocamlComment skipwhite skipempty nextgroup=ocamlMTDef +syn region ocamlKeyword start="\" matchgroup=ocamlModule end="\<\w\(\w\|'\)*\>" contains=ocamlComment skipwhite skipempty nextgroup=ocamlMTDef syn match ocamlMTDef "=\s*\w\(\w\|'\)*\>"hs=s+1,me=s+1 skipwhite skipempty nextgroup=ocamlFullMod " Quoted strings @@ -175,16 +172,26 @@ syn region ocamlString matchgroup=ocamlQuotedStringDelim start="{\z\([a-z_]*\)|" syn region ocamlString matchgroup=ocamlQuotedStringDelim start="{%[a-z_]\+\(\.[a-z_]\+\)\?\( \z\([a-z_]\+\)\)\?|" end="|\z1}" contains=@Spell syn keyword ocamlKeyword and as assert class -syn keyword ocamlKeyword constraint else -syn keyword ocamlKeyword exception external fun - +syn keyword ocamlKeyword else +syn keyword ocamlKeyword external syn keyword ocamlKeyword in inherit initializer syn keyword ocamlKeyword lazy let match -syn keyword ocamlKeyword method mutable new nonrec of -syn keyword ocamlKeyword parser private rec -syn keyword ocamlKeyword try type +syn keyword ocamlKeyword method new +syn keyword ocamlKeyword parser rec +syn keyword ocamlKeyword try syn keyword ocamlKeyword virtual when while with +" Keywords which are handled by the type linter: +" as (within a type equation) +" constraint exception mutable nonrec of private type + +" The `fun` keyword has special treatment because of the syntax `fun … : t -> e` +" where `->` ends the type context rather than being part of it; to handle that, +" we blacklist the ocamlTypeAnnot matchgroup, and we plug ocamlFunTypeAnnot +" instead (later in this file, by using containedin=ocamlFun): +syn region ocamlFun matchgroup=ocamlKeyword start='\' matchgroup=ocamlArrow end='->' +\ contains=ALLBUT,@ocamlContained,ocamlArrow,ocamlInfixOp,ocamlTypeAnnot + if exists("ocaml_revised") syn keyword ocamlKeyword do value syn keyword ocamlBoolean True False @@ -193,14 +200,10 @@ else syn keyword ocamlBoolean true false endif -syn keyword ocamlType array bool char exn float format format4 -syn keyword ocamlType int int32 int64 lazy_t list nativeint option -syn keyword ocamlType bytes string unit - -syn match ocamlConstructorDelimiter "(\s*)" -syn match ocamlConstructorDelimiter "\[\s*\]" -syn match ocamlConstructorDelimiter "\[|\s*>|]" -syn match ocamlConstructorDelimiter "\[<\s*>\]" +syn match ocamlEmptyConstructor "(\s*)" +syn match ocamlEmptyConstructor "\[\s*\]" +syn match ocamlEmptyConstructor "\[|\s*>|]" +syn match ocamlEmptyConstructor "\[<\s*>\]" syn match ocamlConstructor "\u\(\w\|'\)*\>" " Polymorphic variants @@ -215,26 +218,24 @@ syn match ocamlCharErr "'\\\d\d'\|'\\\d'" syn match ocamlCharErr "'\\[^\'ntbr]'" syn region ocamlString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell -syn match ocamlTopStop ";;" - syn match ocamlAnyVar "\<_\>" -syn match ocamlKeyChar "|[^\]]"me=e-1 +syn match ocamlKeyChar "|]\@!" syn match ocamlKeyChar ";" syn match ocamlKeyChar "\~" syn match ocamlKeyChar "?" +" NOTE: for correct precedence, the rule for ";;" must come after that for ";" +syn match ocamlTopStop ";;" + "" Operators " The grammar of operators is found there: " https://caml.inria.fr/pub/docs/manual-ocaml/names.html#operator-name " https://caml.inria.fr/pub/docs/manual-ocaml/extn.html#s:ext-ops " https://caml.inria.fr/pub/docs/manual-ocaml/extn.html#s:index-operators -" =, *, < and > are both operator names and keywords, we let the user choose how -" to display them (has to be declared before regular infix operators): +" = is both an operator name and a keyword, we let the user choose how +" to display it (has to be declared before regular infix operators): syn match ocamlEqual "=" -syn match ocamlStar "*" -syn match ocamlAngle "<" -syn match ocamlAngle ">" " Custom indexing operators: syn region ocamlIndexing matchgroup=ocamlIndexingOp \ start="\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\_s*(" @@ -253,8 +254,8 @@ syn match ocamlExtensionOp "#[#~?!.:|&$%<=>@^*/+-]\+" " Infix and prefix operators: syn match ocamlPrefixOp "![~?!.:|&$%<=>@^*/+-]*" syn match ocamlPrefixOp "[~?][~?!.:|&$%<=>@^*/+-]\+" -syn match ocamlInfixOp "[&$%@^/+-][~?!.:|&$%<=>@^*/+-]*" -syn match ocamlInfixOp "[|<=>*][~?!.:|&$%<=>@^*/+-]\+" +syn match ocamlInfixOp "[&$%<>@^*/+-][~?!.:|&$%<=>@^*/+-]*" +syn match ocamlInfixOp "[|=][~?!.:|&$%<=>@^*/+-]\+" syn match ocamlInfixOp "#[~?!.:|&$%<=>@^*/+-]\+#\@!" syn match ocamlInfixOp "!=[~?!.:|&$%<=>@^*/+-]\@!" syn keyword ocamlInfixOpKeyword asr land lor lsl lsr lxor mod or @@ -271,6 +272,9 @@ else syn match ocamlKeyChar "<-[~?!.:|&$%<=>@^*/+-]\@!" endif +" Script shebang (has to be declared after operators) +syn match ocamlShebang "\%1l^#!.*$" + syn match ocamlNumber "-\=\<\d\(_\|\d\)*[l|L|n]\?\>" syn match ocamlNumber "-\=\<0[x|X]\(\x\|_\)\+[l|L|n]\?\>" syn match ocamlNumber "-\=\<0[o|O]\(\o\|_\)\+[l|L|n]\?\>" @@ -278,10 +282,264 @@ syn match ocamlNumber "-\=\<0[b|B]\([01]\|_\)\+[l|L|n]\?\>" syn match ocamlFloat "-\=\<\d\(_\|\d\)*\.\?\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)\=\>" " Labels -syn match ocamlLabel "\~\(\l\|_\)\(\w\|'\)*"lc=1 -syn match ocamlLabel "?\(\l\|_\)\(\w\|'\)*"lc=1 +syn match ocamlLabel "[~?]\(\l\|_\)\(\w\|'\)*:\?" syn region ocamlLabel transparent matchgroup=ocamlLabel start="[~?](\(\l\|_\)\(\w\|'\)*"lc=2 end=")"me=e-1 contains=ALLBUT,@ocamlContained,ocamlParenErr +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +"" Type contexts + +" How we recognize type contexts is explained in `type-linter-notes.md` +" and a test suite is found in `type-linter-test.ml`. +" +" ocamlTypeExpr is the cluster of things that can make up a type expression +" (in a loose sense, e.g. the “as” keyword and universal quantification are +" included). Regions containing a type expression use it like this: +" +" contains=@ocamlTypeExpr,... +" +" ocamlTypeContained is the cluster of things that can be found in a type +" expression or a type definition. It is not expected to be used in any region, +" it exists solely for throwing things in it that should not pollute the main +" linter. +" +" Both clusters are filled in incrementally. Every match group that is not to be +" found at the main level must be declared as “contained” and added to either +" ocamlTypeExpr or ocamlTypeContained. +" +" In these clusters we don’t put generic things that can also be found elswhere, +" i.e. ocamlComment and ocamlPpx, because everything that is in these clusters +" is also put in ocamlContained and thus ignored by the main linter. + +"syn cluster ocamlTypeExpr contains= +syn cluster ocamlTypeContained contains=@ocamlTypeExpr +syn cluster ocamlContained add=@ocamlTypeContained + +" We’ll use a “catch-all” highlighting group to show as error anything that is +" not matched more specifically; we don’t want spaces to be reported as errors +" (different background color), so we just catch them here: +syn cluster ocamlTypeExpr add=ocamlTypeBlank +syn match ocamlTypeBlank contained "\_s\+" +hi link ocamlTypeBlank NONE + +" NOTE: Carefully avoid catching "(*" here. +syn cluster ocamlTypeExpr add=ocamlTypeParen +syn region ocamlTypeParen contained transparent +\ matchgroup=ocamlEncl start="(\*\@!" +\ matchgroup=ocamlEncl end=")" +\ contains=@ocamlTypeExpr,ocamlComment,ocamlPpx + +syn cluster ocamlTypeExpr add=ocamlTypeKeyChar,ocamlTypeAs +syn match ocamlTypeKeyChar contained "->" +syn match ocamlTypeKeyChar contained "\*" +syn match ocamlTypeKeyChar contained "#" +syn match ocamlTypeKeyChar contained "," +syn match ocamlTypeKeyChar contained "\." +syn keyword ocamlTypeAs contained as +hi link ocamlTypeAs ocamlKeyword + +syn cluster ocamlTypeExpr add=ocamlTypeVariance +syn match ocamlTypeVariance contained "[-+!]\ze *\('\|\<_\>\)" +syn match ocamlTypeVariance contained "[-+] *!\+\ze *\('\|\<_\>\)" +syn match ocamlTypeVariance contained "! *[-+]\+\ze *\('\|\<_\>\)" + +syn cluster ocamlTypeContained add=ocamlTypeEq +syn match ocamlTypeEq contained "[+:]\?=" +hi link ocamlTypeEq ocamlKeyChar + +syn cluster ocamlTypeExpr add=ocamlTypeVar,ocamlTypeConstr,ocamlTypeAnyVar,ocamlTypeBuiltin +syn match ocamlTypeVar contained "'\(\l\|_\)\(\w\|'\)*\>" +syn match ocamlTypeConstr contained "\<\(\l\|_\)\(\w\|'\)*\>" +" NOTE: for correct precedence, the rule for the wildcard (ocamlTypeAnyVar) +" must come after the rule for type constructors (ocamlTypeConstr). +syn match ocamlTypeAnyVar contained "\<_\>" +" NOTE: For correct precedence, these builtin names must occur after the rule +" for type constructors (ocamlTypeConstr) but before the rule for non-optional +" labeled arguments (ocamlTypeLabel). For the latter to take precedence over +" these builtin names, we use “syn match” here instead of “syn keyword”. +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" +syn match ocamlTypeBuiltin contained "\" + +syn cluster ocamlTypeExpr add=ocamlTypeLabel +syn match ocamlTypeLabel contained "?\?\(\l\|_\)\(\w\|'\)*\_s*:[>=]\@!" +hi link ocamlTypeLabel ocamlLabel + +" Object type +syn cluster ocamlTypeExpr add=ocamlTypeObject +syn region ocamlTypeObject contained +\ matchgroup=ocamlEncl start="<" +\ matchgroup=ocamlEncl end=">" +\ contains=ocamlTypeObjectDots,ocamlLCIdentifier,ocamlTypeObjectAnnot,ocamlTypeBlank,ocamlComment,ocamlPpx +hi link ocamlTypeObject ocamlTypeCatchAll +syn cluster ocamlTypeContained add=ocamlTypeObjectDots +syn match ocamlTypeObjectDots contained "\.\." +hi link ocamlTypeObjectDots ocamlKeyChar +syn cluster ocamlTypeContained add=ocamlTypeObjectAnnot +syn region ocamlTypeObjectAnnot contained +\ matchgroup=ocamlKeyChar start=":" +\ matchgroup=ocamlKeyChar end=";\|>\@=" +\ contains=@ocamlTypeExpr,ocamlComment,ocamlPpx +hi link ocamlTypeObjectAnnot ocamlTypeCatchAll + +" Record type definition +syn cluster ocamlTypeContained add=ocamlTypeRecordDecl +syn region ocamlTypeRecordDecl contained +\ matchgroup=ocamlEncl start="{" +\ matchgroup=ocamlEncl end="}" +\ contains=ocamlTypeMutable,ocamlLCIdentifier,ocamlTypeRecordAnnot,ocamlTypeBlank,ocamlComment,ocamlPpx +hi link ocamlTypeRecordDecl ocamlTypeCatchAll +syn cluster ocamlTypeContained add=ocamlTypeMutable +syn keyword ocamlTypeMutable contained mutable +hi link ocamlTypeMutable ocamlKeyword +syn cluster ocamlTypeContained add=ocamlTypeRecordAnnot +syn region ocamlTypeRecordAnnot contained +\ matchgroup=ocamlKeyChar start=":" +\ matchgroup=ocamlKeyChar end=";\|}\@=" +\ contains=@ocamlTypeExpr,ocamlComment,ocamlPpx +hi link ocamlTypeRecordAnnot ocamlTypeCatchAll + +" Polymorphic variant types +" NOTE: Carefully avoid catching "[@" here. +syn cluster ocamlTypeExpr add=ocamlTypeVariant +syn region ocamlTypeVariant contained +\ matchgroup=ocamlEncl start="\[>" start="\[<" start="\[@\@!" +\ matchgroup=ocamlEncl end="\]" +\ contains=ocamlTypeVariantKeyChar,ocamlTypeVariantConstr,ocamlTypeVariantAnnot,ocamlTypeBlank,ocamlComment,ocamlPpx +hi link ocamlTypeVariant ocamlTypeCatchAll +syn cluster ocamlTypeContained add=ocamlTypeVariantKeyChar +syn match ocamlTypeVariantKeyChar contained "|" +syn match ocamlTypeVariantKeyChar contained ">" +hi link ocamlTypeVariantKeyChar ocamlKeyChar +syn cluster ocamlTypeContained add=ocamlTypeVariantConstr +syn match ocamlTypeVariantConstr contained "`\w\(\w\|'\)*\>" +hi link ocamlTypeVariantConstr ocamlConstructor +syn cluster ocamlTypeContained add=ocamlTypeVariantAnnot +syn region ocamlTypeVariantAnnot contained +\ matchgroup=ocamlKeyword start="\" +\ matchgroup=ocamlKeyChar end="|\|>\|\]\@=" +\ contains=@ocamlTypeExpr,ocamlTypeAmp,ocamlComment,ocamlPpx +hi link ocamlTypeVariantAnnot ocamlTypeCatchAll +syn cluster ocamlTypeContained add=ocamlTypeAmp +syn match ocamlTypeAmp contained "&" +hi link ocamlTypeAmp ocamlTypeKeyChar + +" Sum type definition +syn cluster ocamlTypeContained add=ocamlTypeSumDecl +syn region ocamlTypeSumDecl contained +\ matchgroup=ocamlTypeSumBar start="|" +\ matchgroup=ocamlTypeSumConstr start="\<\u\(\w\|'\)*\>" +\ matchgroup=ocamlTypeSumConstr start="\" start="\" +\ matchgroup=ocamlTypeSumConstr start="(\_s*)" start="\[\_s*]" start="(\_s*::\_s*)" +\ matchgroup=NONE end="\(\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|)\|]\|}\|;\|;;\|=\)\@=" +\ matchgroup=NONE end="\(\\)\@=" +\ contains=ocamlTypeSumBar,ocamlTypeSumConstr,ocamlTypeSumAnnot,ocamlTypeBlank,ocamlComment,ocamlPpx +hi link ocamlTypeSumDecl ocamlTypeCatchAll +syn cluster ocamlTypeContained add=ocamlTypeSumBar +syn match ocamlTypeSumBar contained "|" +hi link ocamlTypeSumBar ocamlKeyChar +syn cluster ocamlTypeContained add=ocamlTypeSumConstr +syn match ocamlTypeSumConstr contained "\<\u\(\w\|'\)*\>" +syn match ocamlTypeSumConstr contained "\" +syn match ocamlTypeSumConstr contained "\" +syn match ocamlTypeSumConstr contained "(\_s*)" +syn match ocamlTypeSumConstr contained "\[\_s*]" +syn match ocamlTypeSumConstr contained "(\_s*::\_s*)" +hi link ocamlTypeSumConstr ocamlConstructor +syn cluster ocamlTypeContained add=ocamlTypeSumAnnot +syn region ocamlTypeSumAnnot contained +\ matchgroup=ocamlKeyword start="\" +\ matchgroup=ocamlKeyChar start=":" +\ matchgroup=NONE end="|\@=" +\ matchgroup=NONE end="\(\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|)\|]\|}\|;\|;;\)\@=" +\ matchgroup=NONE end="\(\\)\@=" +\ contains=@ocamlTypeExpr,ocamlTypeRecordDecl,ocamlComment,ocamlPpx +hi link ocamlTypeSumAnnot ocamlTypeCatchAll + +" Type context opened by “type” (type definition), “constraint” (type +" constraint) and “exception” (exception definition) +syn region ocamlTypeDef +\ matchgroup=ocamlKeyword start="\\(\_s\+\\)\?\|\\|\" +\ matchgroup=NONE end="\(\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|)\|]\|}\|;\|;;\)\@=" +\ contains=@ocamlTypeExpr,ocamlTypeEq,ocamlTypePrivate,ocamlTypeDefDots,ocamlTypeRecordDecl,ocamlTypeSumDecl,ocamlTypeDefAnd,ocamlComment,ocamlPpx +hi link ocamlTypeDef ocamlTypeCatchAll +syn cluster ocamlTypeContained add=ocamlTypePrivate +syn keyword ocamlTypePrivate contained private +hi link ocamlTypePrivate ocamlKeyword +syn cluster ocamlTypeContained add=ocamlTypeDefAnd +syn keyword ocamlTypeDefAnd contained and +hi link ocamlTypeDefAnd ocamlKeyword +syn cluster ocamlTypeContained add=ocamlTypeDefDots +syn match ocamlTypeDefDots contained "\.\." +hi link ocamlTypeDefDots ocamlKeyChar + +" When "exception" is preceded by "with", "|" or "(", that’s not an exception +" definition but an exception pattern; we simply highlight the keyword without +" starting a type context. +" NOTE: These rules must occur after that for "exception". +syn match ocamlKeyword "\"lc=4 +syn match ocamlKeyword "|\_s*exception\>"lc=1 +syn match ocamlKeyword "(\_s*exception\>"lc=1 + +" Type context opened by “:” (countless kinds of type annotations) and “:>” +" (type coercions) +syn region ocamlTypeAnnot matchgroup=ocamlKeyChar start=":\(>\|\_s*type\>\|[>:=]\@!\)" +\ matchgroup=NONE end="\(\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|\\|)\|]\|}\|;\|;;\)\@=" +\ matchgroup=NONE end="\(;\|}\)\@=" +\ matchgroup=NONE end="\(=\|:>\)\@=" +\ contains=@ocamlTypeExpr,ocamlComment,ocamlPpx +hi link ocamlTypeAnnot ocamlTypeCatchAll + +" Type annotation that gives the return type of a `fun` keyword +" (the type context is ended by `->`) +syn cluster ocamlTypeContained add=ocamlFunTypeAnnot +syn region ocamlFunTypeAnnot contained containedin=ocamlFun +\ matchgroup=ocamlKeyChar start=":" +\ matchgroup=NONE end="\(->\)\@=" +\ contains=@ocamlTypeExpr,ocamlComment,ocamlPpx +hi link ocamlFunTypeAnnot ocamlTypeCatchAll + +" Module paths (including functors) in types. +" NOTE: This rule must occur after the rule for ocamlTypeSumDecl as it must take +" precedence over it (otherwise the module name would be mistakenly highlighted +" as a constructor). +" NOTE: Carefully avoid catching "(*" here. +syn cluster ocamlTypeExpr add=ocamlTypeModPath +syn match ocamlTypeModPath contained "\<\u\(\w\|'\)*\_s*\." +syn region ocamlTypeModPath contained transparent +\ matchgroup=ocamlModPath start="\<\u\(\w\|'\)*\_s*(\*\@!" +\ matchgroup=ocamlModPath end=")\_s*\." +\ contains=ocamlTypeDotlessModPath,ocamlTypeBlank,ocamlComment,ocamlPpx +hi link ocamlTypeModPath ocamlModPath +syn cluster ocamlTypeContained add=ocamlTypeDotlessModPath +syn match ocamlTypeDotlessModPath contained "\<\u\(\w\|'\)*\_s*\.\?" +syn region ocamlTypeDotlessModPath contained transparent +\ matchgroup=ocamlModPath start="\<\u\(\w\|'\)*\_s*(\*\@!" +\ matchgroup=ocamlModPath end=")\_s*\.\?" +\ contains=ocamlTypeDotlessModPath,ocamlTypeBlank,ocamlComment,ocamlPpx +hi link ocamlTypeDotlessModPath ocamlTypeModPath + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Synchronization syn sync minlines=50 @@ -311,19 +569,19 @@ hi def link ocamlBrackErr Error hi def link ocamlParenErr Error hi def link ocamlArrErr Error -hi def link ocamlCommentErr Error - hi def link ocamlCountErr Error hi def link ocamlDoErr Error hi def link ocamlDoneErr Error hi def link ocamlEndErr Error hi def link ocamlThenErr Error +hi def link ocamlKwErr Error hi def link ocamlCharErr Error hi def link ocamlErr Error hi def link ocamlComment Comment +hi def link ocamlShebang ocamlComment hi def link ocamlModPath Include hi def link ocamlObject Include @@ -344,13 +602,12 @@ hi def link ocamlStructEncl ocamlModule hi def link ocamlScript Include hi def link ocamlConstructor Constant -hi def link ocamlConstructorDelimiter ocamlConstructor +hi def link ocamlEmptyConstructor ocamlConstructor hi def link ocamlVal Keyword hi def link ocamlModPreRHS Keyword hi def link ocamlMPRestr2 Keyword hi def link ocamlKeyword Keyword -hi def link ocamlKeywordDelimiter ocamlKeyword hi def link ocamlMethod Include hi def link ocamlArrow Keyword hi def link ocamlKeyChar Keyword @@ -359,8 +616,6 @@ hi def link ocamlTopStop Keyword hi def link ocamlRefAssign ocamlKeyChar hi def link ocamlEqual ocamlKeyChar -hi def link ocamlStar ocamlInfixOp -hi def link ocamlAngle ocamlInfixOp hi def link ocamlCons ocamlInfixOp hi def link ocamlPrefixOp ocamlOperator @@ -384,7 +639,24 @@ hi def link ocamlQuotedStringDelim Identifier hi def link ocamlLabel Identifier -hi def link ocamlType Type +" Type linting groups that the user can customize: +" - ocamlTypeCatchAll: anything in a type context that is not caught by more +" specific rules (in principle, this should only match syntax errors) +" - ocamlTypeConstr: type constructors +" - ocamlTypeBuiltin: builtin type constructors (like int or list) +" - ocamlTypeVar: type variables ('a) +" - ocamlTypeAnyVar: wildcard (_) +" - ocamlTypeVariance: variance and injectivity indications (+'a, !'a) +" - ocamlTypeKeyChar: symbols such as -> and * +" Default values below mimick the behavior before the type linter was +" implemented, but now we can do better. :-) +hi def link ocamlTypeCatchAll Error +hi def link ocamlTypeConstr NONE +hi def link ocamlTypeBuiltin Type +hi def link ocamlTypeVar NONE +hi def link ocamlTypeAnyVar NONE +hi def link ocamlTypeVariance ocamlKeyChar +hi def link ocamlTypeKeyChar ocamlKeyChar hi def link ocamlTodo Todo diff --git a/syntax/odin.vim b/syntax/odin.vim index 9f8521ae8..418aa8dbc 100644 --- a/syntax/odin.vim +++ b/syntax/odin.vim @@ -11,6 +11,7 @@ syntax keyword odinTransmute transmute syntax keyword odinCast cast syntax keyword odinDistinct distinct syntax keyword odinOpaque opaque +syntax keyword odinWhere where syntax keyword odinStruct struct syntax keyword odinEnum enum @@ -47,10 +48,11 @@ syntax match odinFixMe "FIXME" syntax match odinNoCheckin "NOCHECKIN" syntax match odinHack "HACK" -syntax keyword odinDataType string cstring bool b8 b16 b32 b64 rune any rawptr f32 f64 f32le f32be f64le f64be u8 u16 u32 u64 u128 u16le u32le u64le u128le u16be u32be u64be u128be uint uintptr i8 i16 i32 i64 i128 i16le i32le i64le i128le i16be i32be i64be i128be int complex complex32 complex64 complex128 quaternion quaternion64 quaternion128 quaternion256 matrix +syntax keyword odinDataType string cstring bool b8 b16 b32 b64 rune any rawptr f16 f32 f64 f16le f16be f32le f32be f64le f64be u8 u16 u32 u64 u128 u16le u32le u64le u128le u16be u32be u64be u128be uint uintptr i8 i16 i32 i64 i128 i16le i32le i64le i128le i16be i32be i64be i128be int complex complex32 complex64 complex128 quaternion quaternion64 quaternion128 quaternion256 matrix typeid syntax keyword odinBool true false syntax keyword odinNull nil syntax keyword odinDynamic dynamic +syntax keyword odinMap map syntax keyword odinProc proc syntax keyword odinIn in syntax keyword odinNotIn notin @@ -65,9 +67,9 @@ syntax keyword odinPackage package syntax keyword odinReturn return syntax keyword odinDefer defer -syntax region odinChar start=/\v'/ skip=/\v\\./ end=/\v'/ -syntax region odinString start=/\v"/ skip=/\v\\./ end=/\v"/ -syntax region odinRawString start=/\v`/ skip=/\v\\./ end=/\v`/ +syntax region odinRawString start=+`+ end=+`+ +syntax region odinChar start=+'+ skip=+\\\\\|\\'+ end=+'+ +syntax region odinString start=+"+ skip=+\\\\\|\\'+ end=+"+ syntax match odinFunction "\v<\w*>(\s*::\s*proc)@=" @@ -96,7 +98,7 @@ syntax match odinMacro "#\<\w\+\>" display syntax match odinTemplate "$\<\w\+\>" syntax match odinCommentNote "@\<\w\+\>" contained display -syntax region odinLineComment start=/\/\// end=/$/ contains=odinLineComment, odinCommentNote, odinTodo, odinNote, odinXXX, odinFixMe, odinNoCheckin, odinHack +syntax region odinLineComment start=/\/\// end=/$/ contains=odinCommentNote, odinTodo, odinNote, odinXXX, odinFixMe, odinNoCheckin, odinHack syntax region odinBlockComment start=/\v\/\*/ end=/\v\*\// contains=odinBlockComment, odinCommentNote, odinTodo, odinNote, odinXXX, odinFixMe, odinNoCheckin, odinHack highlight link odinUsing Keyword @@ -121,6 +123,7 @@ highlight link odinAlignOf Keyword highlight link odinPackage Keyword highlight link odinOrReturn Keyword highlight link odinOrElse Keyword +highlight link odinWhere Keyword highlight link odinInline Keyword highlight link odinNoInline Keyword @@ -133,6 +136,7 @@ highlight link odinDo Keyword highlight link odinDefer Operator highlight link odinDynamic Operator +highlight link odinMap Operator highlight link odinRange Operator highlight link odinHalfRange Operator highlight link odinAssign Operator diff --git a/syntax/openscad.vim b/syntax/openscad.vim index 40156d58e..14e6b2236 100644 --- a/syntax/openscad.vim +++ b/syntax/openscad.vim @@ -32,7 +32,7 @@ syn keyword openscadPrimitiveSolid cube sphere cylinder polyhedron surface syn keyword openscadPrimitive2D square circle polygon import_dxf text syn keyword openscadPrimitiveImport import child children -syn match openscadSpecialVariable "\$[a-zA-Z]\+\>" display +syn match openscadSpecialVariable "\$[a-zA-Z0-9_]\+\>" display syn match openscadModifier "^\s*[\*\!\#\%]" display syn match openscadNumbers "\<\d\|\.\d" contains=openscadNumber display transparent diff --git a/syntax/qml.vim b/syntax/qml.vim index 73540c7cd..aee23df44 100644 --- a/syntax/qml.vim +++ b/syntax/qml.vim @@ -31,7 +31,7 @@ endif syn case ignore -syn cluster qmlExpr contains=qmlStringD,qmlStringS,qmlStringT,SqmlCharacter,qmlNumber,qmlObjectLiteralType,qmlBoolean,qmlType,qmlJsType,qmlNull,qmlGlobal,qmlFunction,qmlArrowFunction +syn cluster qmlExpr contains=qmlStringD,qmlStringS,qmlStringT,SqmlCharacter,qmlNumber,qmlObjectLiteralType,qmlBoolean,qmlType,qmlJsType,qmlNull,qmlGlobal,qmlFunction,qmlArrowFunction,qmlNullishCoalescing syn keyword qmlCommentTodo TODO FIXME XXX TBD contained syn match qmlLineComment "\/\/.*" contains=@Spell,qmlCommentTodo syn match qmlCommentSkip "^[ \t]*\*\($\|[ \t]\+\)" @@ -49,6 +49,7 @@ syn region qmlRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi syn match qmlObjectLiteralType "[A-Za-z][_A-Za-z0-9]*\s*\({\)\@=" syn region qmlTernaryColon start="?" end=":" contains=@qmlExpr,qmlBraces,qmlParens syn match qmlBindingProperty "\<[A-Za-z][_A-Za-z.0-9]*\s*:" +syn match qmlNullishCoalescing "??" syn keyword qmlConditional if else switch syn keyword qmlRepeat while for do in @@ -1065,7 +1066,7 @@ syntax keyword qmlObjectLiteralType XYSeries syntax keyword qmlObjectLiteralType YAnimator -syntax keyword qmlObjectLiteralType ZoomBlur +syntax keyword qmlObjectLiteralType ZoomBlur " }}} @@ -1126,6 +1127,7 @@ if version >= 508 || !exists("did_qml_syn_inits") HiLink qmlNull Keyword HiLink qmlBoolean Boolean HiLink qmlRegexpString String + HiLink qmlNullishCoalescing Operator HiLink qmlIdentifier Identifier HiLink qmlLabel Label diff --git a/syntax/requirements.vim b/syntax/requirements.vim index 3835c07f8..d665d456b 100644 --- a/syntax/requirements.vim +++ b/syntax/requirements.vim @@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand(':p'), 'requirements', 'syntax/requir endif " the Requirements File Format syntax support for Vim -" Version: 1.6.0 +" Version: 1.7.1 " Author: raimon " License: MIT LICENSE " The MIT License (MIT) @@ -34,6 +34,7 @@ endif syn case match +syn match requirementsVersion "\v\d+[a-zA-Z0-9\.\-\*]*" syn region requirementsComment start="[ \t]*#" end="$" syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?" syn match requirementsVersionSpecifiers "\v(\=\=\=?|\<\=?|\>\=?|\~\=|\!\=)" @@ -43,14 +44,15 @@ syn match requirementsVersionControls "\v(git\+?|hg\+|svn\+|bzr\+).*://.\S+" syn match requirementsURLs "\v(\@\s)?(https?|ftp|gopher)://?[^\s/$.?#].\S*" syn match requirementsEnvironmentMarkers "\v;\s[^#]+" -hi link requirementsComment Comment -hi link requirementsCommandOption Special -hi link requirementsVersionSpecifiers Boolean -hi link requirementsPackageName Identifier -hi link requirementsExtras Type -hi link requirementsVersionControls Underlined -hi link requirementsURLs Underlined -hi link requirementsEnvironmentMarkers Macro +hi def link requirementsVersion Number +hi def link requirementsComment Comment +hi def link requirementsCommandOption Special +hi def link requirementsVersionSpecifiers Boolean +hi def link requirementsPackageName Identifier +hi def link requirementsExtras Type +hi def link requirementsVersionControls Underlined +hi def link requirementsURLs Underlined +hi def link requirementsEnvironmentMarkers Macro let b:current_syntax = "requirements" diff --git a/syntax/ruby.vim b/syntax/ruby.vim index a2fae63a3..a2e3c3aa8 100644 --- a/syntax/ruby.vim +++ b/syntax/ruby.vim @@ -402,11 +402,6 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") SynFold 'for' syn region rubyRepeatExpression start="\" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\@" matchgroup=rubyRepeat skip="\" nextgroup=rubyMethodDeclaration skipwhite skipnl syn match rubyControl "\" nextgroup=rubyClassDeclaration skipwhite skipnl @@ -415,6 +410,11 @@ else syn match rubyKeyword "\<\%(alias\|undef\)\>" endif +if !exists("ruby_minlines") + let ruby_minlines = 500 +endif +exe "syn sync minlines=" . ruby_minlines + " Special Methods {{{1 if !exists("ruby_no_special_methods") syn match rubyAccess "\<\%(public\|protected\|private\)\>" " use re=2 diff --git a/syntax/solidity.vim b/syntax/solidity.vim index e533ab545..d145a5476 100644 --- a/syntax/solidity.vim +++ b/syntax/solidity.vim @@ -126,7 +126,7 @@ syn region solFuncBody contained contains=solDestructure,solComment,s \ start='{' \ end='}' syn match solFuncCall contained skipempty skipwhite nextgroup=solCallOptions,solFuncCallParens - \ '\v%(%(|||||
||)\s*)@|||||
||)\s*)@ " Maintainer: James Eapen -" Version: 1.0 +" Version: 0.11.6 " Last Change: 2020-10-07 " References: @@ -60,30 +60,41 @@ syn match swayConfigInitialize /^\s*set\s\+.*$/ contains=swayConfigVariable,sway " Gaps syn keyword swayConfigGapStyleKeyword inner outer horizontal vertical top right bottom left current all set plus minus toggle up down contained syn match swayConfigGapStyle /^\s*\(gaps\)\s\+\(inner\|outer\|horizontal\|vertical\|left\|top\|right\|bottom\)\(\s\+\(current\|all\)\)\?\(\s\+\(set\|plus\|minus\|toggle\)\)\?\(\s\+\(-\?\d\+\|\$.*\)\)$/ contains=swayConfigGapStyleKeyword,swayConfigNumber,swayConfigVariable -syn keyword swayConfigSmartGapKeyword on inverse_outer contained -syn match swayConfigSmartGap /^\s*smart_gaps\s\+\(on\|inverse_outer\)\s\?$/ contains=swayConfigSmartGapKeyword -syn keyword swayConfigSmartBorderKeyword on no_gaps contained -syn match swayConfigSmartBorder /^\s*smart_borders\s\+\(on\|no_gaps\)\s\?$/ contains=swayConfigSmartBorderKeyword +syn keyword swayConfigSmartGapKeyword on inverse_outer off contained +syn match swayConfigSmartGap /^\s*smart_gaps\s\+\(on\|inverse_outer\|off\)\s\?$/ contains=swayConfigSmartGapKeyword +syn keyword swayConfigSmartBorderKeyword on no_gaps off contained +syn match swayConfigSmartBorder /^\s*smart_borders\s\+\(on\|no_gaps\|off\)\s\?$/ contains=swayConfigSmartBorderKeyword " Keyboard bindings syn keyword swayConfigAction toggle fullscreen restart key import kill shrink grow contained syn keyword swayConfigAction focus move grow height width split layout resize restore reload mute unmute exit mode workspace container to output contained syn match swayConfigModifier /\w\++\w\+\(\(+\w\+\)\+\)\?/ contained contains=swayConfigVariableModifier -syn match swayConfigNumber /\s\d\+/ contained +syn match swayConfigNumber /\s[+-]\?\(\d\+\.\)\?\d\+/ contained syn match swayConfigUnit /\sp\(pt\|x\)/ contained syn match swayConfigUnitOr /\sor/ contained -syn keyword swayConfigBindKeyword bindsym bindcode exec gaps border contained +syn keyword swayConfigBindKeyword bindsym bindcode bindswitch bindgesture exec gaps border contained syn match swayConfigBindArgument /--\w\+\(\(-\w\+\)\+\)\?\s/ contained -syn match swayConfigBind /^\s*\(bindsym\|bindcode\)\s\+.*$/ contains=swayConfigVariable,swayConfigBindKeyword,swayConfigVariableAndModifier,swayConfigNumber,swayConfigUnit,swayConfigUnitOr,swayConfigBindArgument,swayConfigModifier,swayConfigAction,swayConfigString,swayConfigGapStyleKeyword,swayConfigBorderStyleKeyword +syn match swayConfigBind /^\s*\(bindsym\|bindcode\|bindswitch\)\s\+.*$/ contains=swayConfigVariable,swayConfigBindKeyword,swayConfigVariableAndModifier,swayConfigNumber,swayConfigUnit,swayConfigUnitOr,swayConfigBindArgument,swayConfigModifier,swayConfigAction,swayConfigString,swayConfigGapStyleKeyword,swayConfigBorderStyleKeyword + +" bindgestures +syn keyword swayConfigBindGestureCommand swipe pinch hold contained +syn keyword swayConfigBindGestureDirection up down left right next prev contained +syn keyword swayConfigBindGesturePinchDirection inward outward clockwise counterclockwise contained +syn match swayConfigBindGestureHold /^\s*\(bindgesture\)\s\+hold\(:[1-5]\)\?\s\+.*$/ contains=swayConfigBindKeyword,swayConfigBindGestureCommand,swayConfigBindGestureDirection,swayConfigWorkspaceKeyword,swayConfigAction +syn match swayConfigBindGestureSwipe /^\s*\(bindgesture\)\s\+swipe\(:[3-5]\)\?:\(up\|down\|left\|right\)\s\+.*$/ contains=swayConfigBindKeyword,swayConfigBindGestureCommand,swayConfigBindGestureDirection,swayConfigWorkspaceKeyword,swayConfigAction +syn match swayConfigBindGesturePinch /^\s*\(bindgesture\)\s\+pinch\(:[2-5]\)\?:\(up\|down\|left\|right\|inward\|outward\|clockwise\|counterclockwise\)\(+\(up\|down\|left\|right\|inward\|outward\|clockwise\|counterclockwise\)\)\?.*$/ contains=swayConfigBindKeyword,swayConfigBindGestureCommand,swayConfigBindGestureDirection,swayConfigBindGesturePinchDirection,swayConfigWorkspaceKeyword,swayConfigAction " Floating +syn keyword swayConfigFloatingKeyword floating contained +syn match swayConfigFloating /^\s*floating\s\+\(enable\|disable\|toggle\)\s*$/ contains=swayConfigFloatingKeyword + syn keyword swayConfigFloatingModifier floating_modifier contained -syn match swayConfigFloatingMouseAction /^\s\?.*floating_modifier\s.*\(normal\|inverted\)$/ contains=swayConfigFloatingModifier,swayConfigVariable +syn match swayConfigFloatingMouseAction /^\s\?.*floating_modifier\s\S\+\s\?\(normal\|inverted\|none\)\?$/ contains=swayConfigFloatingModifier,swayConfigVariable syn keyword swayConfigSizeSpecial x contained syn match swayConfigNegativeSize /-/ contained syn match swayConfigSize /-\?\d\+\s\?x\s\?-\?\d\+/ contained contains=swayConfigSizeSpecial,swayConfigNumber,swayConfigNegativeSize -syn match swayConfigFloating /^\s*floating_\(maximum\|minimum\)_size\s\+-\?\d\+\s\?x\s\?-\?\d\+/ contains=swayConfigSize +syn match swayConfigFloatingSize /^\s*floating_\(maximum\|minimum\)_size\s\+-\?\d\+\s\?x\s\?-\?\d\+/ contains=swayConfigSize " Orientation syn keyword swayConfigOrientationKeyword vertical horizontal auto contained @@ -125,6 +136,10 @@ syn keyword swayConfigExecKeyword exec exec_always contained syn match swayConfigNoStartupId /--no-startup-id/ contained " We are not using swayConfigBindArgument as only no-startup-id is supported here syn match swayConfigExec /^\s*exec\(_always\)\?\s\+.*$/ contains=swayConfigExecKeyword,swayConfigNoStartupId,swayConfigString +" Input config +syn keyword swayConfigInputKeyword input contained +syn match swayConfigInput /^\s*input\s\+.*$/ contains=swayConfigInputKeyword + " Automatically putting workspaces on specific screens syn keyword swayConfigWorkspaceKeyword workspace contained syn keyword swayConfigOutputKeyword output contained @@ -139,8 +154,9 @@ syn keyword swayConfigFocusType output contained syn match swayConfigFocus /^\s*focus\soutput\s.*$/ contains=swayConfigFocusKeyword,swayConfigFocusType " Changing colors -syn keyword swayConfigClientColorKeyword client focused focused_inactive unfocused urgent placeholder background contained -syn match swayConfigClientColor /^\s*client.\w\+\s\+.*$/ contains=swayConfigClientColorKeyword,swayConfigColor,swayConfigVariable +syn keyword swayConfigClientKeyword client contained +syn keyword swayConfigClientColorKeyword focused focused_inactive focused_tab_title unfocused urgent placeholder contained +syn match swayConfigClientColor /^\s*client.\w\+\s\+.*$/ contains=swayConfigClientKeyword,swayConfigClientColorKeyword,swayConfigColor,swayConfigVariable syn keyword swayConfigTitleAlignKeyword left center right contained syn match swayConfigTitleAlign /^\s*title_align\s\+.*$/ contains=swayConfigTitleAlignKeyword @@ -156,8 +172,8 @@ syn match swayConfigMouseWarping /^\s*mouse_warping\s\+\(output\|none\)\s\?$/ co " Focus follows mouse syn keyword swayConfigFocusFollowsMouseKeyword focus_follows_mouse contained -syn keyword swayConfigFocusFollowsMouseType yes no contained -syn match swayConfigFocusFollowsMouse /^\s*focus_follows_mouse\s\+\(yes\|no\)\s\?$/ contains=swayConfigFocusFollowsMouseKeyword,swayConfigFocusFollowsMouseType +syn keyword swayConfigFocusFollowsMouseType yes no always contained +syn match swayConfigFocusFollowsMouse /^\s*focus_follows_mouse\s\+\(yes\|no\|always\)\s\?$/ contains=swayConfigFocusFollowsMouseKeyword,swayConfigFocusFollowsMouseType " Popups during fullscreen mode syn keyword swayConfigPopupOnFullscreenKeyword popup_during_fullscreen contained @@ -192,15 +208,15 @@ syn keyword swayConfigDrawingMarksKeyword show_marks contained syn match swayConfigDrawingMarks /^\s*show_marks\s\+\(yes\|no\)\s\?$/ contains=swayConfigFocusWrappingType,swayConfigDrawingMarksKeyword " Group mode/bar -syn keyword swayConfigBlockKeyword set input mode bar colors i3bar_command status_command position exec mode hidden_state modifier id position output background statusline tray_output tray_padding separator separator_symbol workspace_buttons strip_workspace_numbers binding_mode_indicator focused_workspace active_workspace inactive_workspace urgent_workspace binding_mode contained -syn region swayConfigBlock start=+.*s\?{$+ end=+^}$+ contains=swayConfigBlockKeyword,swayConfigString,swayConfigBind,swayConfigComment,swayConfigFont,swayConfigFocusWrappingType,swayConfigColor,swayConfigVariable transparent keepend extend +syn keyword swayConfigBlockKeyword set bar colors i3bar_command status_command position hidden_state modifier id position background statusline tray_output tray_padding separator separator_symbol workspace_buttons strip_workspace_numbers binding_mode_indicator focused_workspace active_workspace inactive_workspace urgent_workspace binding_mode contained +syn region swayConfigBlock start=+.*s\?{$+ end=+^}$+ contains=swayConfigBlockKeyword,swayConfigString,swayConfigAction,swayConfigBind,swayConfigComment,swayConfigFont,swayConfigFocusWrappingType,swayConfigColor,swayConfigVariable,swayConfigInputKeyword,swayConfigOutputKeyword transparent keepend extend " Line continuation -syn region swayConfigLineCont start=/^.*\\$/ end=/^.*$/ contains=swayConfigBlockKeyword,swayConfigString,swayConfigBind,swayConfigComment,swayConfigFont,swayConfigFocusWrappingType,swayConfigColor,swayConfigVariable transparent keepend extend +syn region swayConfigLineCont start=/^.*\\$/ end=/^[^\\]*$/ contains=swayConfigBlockKeyword,swayConfigString,swayConfigAction,swayConfigBind,swayConfigComment,swayConfigFont,swayConfigFocusWrappingType,swayConfigColor,swayConfigVariable,swayConfigExecKeyword transparent keepend extend " Includes with relative paths to config files syn keyword swayConfigInclude include contained -syn match swayConfigFile /^include\s\(\~\?\/.*$\|\.\{0,2}\/.*$\)/ contains=swayConfigInclude +syn match swayConfigFile /^\s\?include\s\+.*$/ contains=swayConfigInclude " xwayland syn keyword swayConfigXwaylandKeyword xwayland contained @@ -227,9 +243,14 @@ hi! def link swayConfigEdgeKeyword Type hi! def link swayConfigAction Type hi! def link swayConfigCommand Type hi! def link swayConfigOutputKeyword Type +hi! def link swayConfigInputKeyword Type hi! def link swayConfigWindowCommandSpecial Type hi! def link swayConfigFocusWrappingType Type hi! def link swayConfigUnitOr Type +hi! def link swayConfigClientColorKeyword Type +hi! def link swayConfigFloating Type +hi! def link swayConfigBindGestureDirection Constant +hi! def link swayConfigBindGesturePinchDirection Constant hi! def link swayConfigFontSize Constant hi! def link swayConfigColor Constant hi! def link swayConfigNumber Constant @@ -247,8 +268,10 @@ hi! def link swayConfigAssignSpecial Special hi! def link swayConfigFontNamespace PreProc hi! def link swayConfigBindArgument PreProc hi! def link swayConfigNoStartupId PreProc +hi! def link swayConfigBindGesture PreProc hi! def link swayConfigFontKeyword Identifier hi! def link swayConfigBindKeyword Identifier +hi! def link swayConfigBindGestureCommand Identifier hi! def link swayConfigOrientation Identifier hi! def link swayConfigGapStyle Identifier hi! def link swayConfigTitleAlign Identifier @@ -257,7 +280,7 @@ hi! def link swayConfigSmartBorder Identifier hi! def link swayConfigLayout Identifier hi! def link swayConfigBorderStyle Identifier hi! def link swayConfigEdge Identifier -hi! def link swayConfigFloating Identifier +hi! def link swayConfigFloatingSize Identifier hi! def link swayConfigCommandKeyword Identifier hi! def link swayConfigNoFocusKeyword Identifier hi! def link swayConfigInitializeKeyword Identifier @@ -265,7 +288,7 @@ hi! def link swayConfigAssignKeyword Identifier hi! def link swayConfigResourceKeyword Identifier hi! def link swayConfigExecKeyword Identifier hi! def link swayConfigWorkspaceKeyword Identifier -hi! def link swayConfigClientColorKeyword Identifier +hi! def link swayConfigClientKeyword Identifier hi! def link swayConfigInterprocessKeyword Identifier hi! def link swayConfigMouseWarpingKeyword Identifier hi! def link swayConfigFocusFollowsMouseKeyword Identifier @@ -281,6 +304,7 @@ hi! def link swayConfigVariable Statement hi! def link swayConfigArbitraryCommand Type hi! def link swayConfigInclude Identifier hi! def link swayConfigFile Constant +hi! def link swayConfigFloatingKeyword Identifier hi! def link swayConfigFloatingModifier Identifier hi! def link swayConfigFloatingMouseAction Type hi! def link swayConfigFocusKeyword Type diff --git a/syntax/swift.vim b/syntax/swift.vim index 2dcb0376e..90035eacd 100644 --- a/syntax/swift.vim +++ b/syntax/swift.vim @@ -192,6 +192,7 @@ syntax match swiftMultiwordKeywords "indirect enum" syntax region swiftEscapedReservedWord start="`" end="`" oneline syntax keyword swiftAttributes + \ @_disfavoredOverload \ @_exported \ @_implementationOnly \ @_silgen_name diff --git a/syntax/tmux.vim b/syntax/tmux.vim index f73e8e49b..f3917e703 100644 --- a/syntax/tmux.vim +++ b/syntax/tmux.vim @@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand(':p'), 'tmux', 'syntax/tmux.vim') endif " Language: tmux(1) configuration file -" Version: 3.3-rc (git-8bcd392e) +" Version: 3.3a (git-7b8ececd) " URL: https://github.com/ericpruitt/tmux.vim/ " Maintainer: Eric Pruitt " License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause) @@ -165,7 +165,7 @@ syn keyword tmuxCommands \ switch-client switchc unbind unbind-key unlink-window unlinkw wait wait-for syn keyword tmuxEnums -\ absolute-centre always any arrows bar blinking-bar blinking-block +\ absolute-centre all always any arrows bar blinking-bar blinking-block \ blinking-underline block both bottom centre color colour current default \ double emacs external failed heavy largest latest left manual no-detached \ none number off on other padded right rounded simple single smallest top diff --git a/tests/filetypes.vim b/tests/filetypes.vim index 1e54cfbe7..2588cf3f3 100644 --- a/tests/filetypes.vim +++ b/tests/filetypes.vim @@ -94,7 +94,6 @@ call TestFiletype('fish') call TestFiletype('fbs') call TestFiletype('forth') call TestFiletype('fsharp') -call TestFiletype('gdscript3') call TestFiletype('gitconfig') call TestFiletype('gitrebase') call TestFiletype('gitsendemail')