mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Update
This commit is contained in:
13
README.md
13
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.
|
> 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 **won't affect your startup time**, as scripts are loaded only on demand\*.
|
||||||
- It **installs and updates 120+ times faster** than the <!--Package Count-->599<!--/Package Count--> packages it consists of.
|
- It **installs and updates 120+ times faster** than the <!--Package Count-->598<!--/Package Count--> packages it consists of.
|
||||||
- It is also more secure (scripts loaded for every filetype are generated by vim-polyglot)
|
- 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.
|
- 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)
|
- 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)
|
- [caddyfile](https://github.com/isobit/vim-caddyfile)
|
||||||
- [carp](https://github.com/hellerve/carp-vim) (Syntax highlighting for carp files)
|
- [carp](https://github.com/hellerve/carp-vim) (Syntax highlighting for carp files)
|
||||||
- [cjsx](https://github.com/mtscout6/vim-cjsx)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [git](https://github.com/tpope/vim-git) (Git Config syntax highlighting for gitconfig files)
|
||||||
- [gitignore](https://github.com/SirJson/fzf-gitignore)
|
- [gitignore](https://github.com/SirJson/fzf-gitignore)
|
||||||
- [gleam](https://github.com/gleam-lang/gleam.vim) (Syntax highlighting for gleam files)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [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)
|
- [xsl](https://github.com/vim-scripts/XSLT-syntax) (XSLT syntax highlighting for xslt and xsl files)
|
||||||
- [yard](https://github.com/noprompt/vim-yardoc)
|
- [yard](https://github.com/noprompt/vim-yardoc)
|
||||||
- [zephir](https://github.com/xwsoul/vim-zephir) (Zephir syntax highlighting for zep files)
|
- [zephir](https://github.com/xwsoul/vim-zephir) (Zephir syntax highlighting for zep files)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ endif
|
|||||||
" Original Author: Jon Haggblad <https://github.com/octol>
|
" Original Author: Jon Haggblad <https://github.com/octol>
|
||||||
" Maintainer: bfrg <https://github.com/bfrg>
|
" Maintainer: bfrg <https://github.com/bfrg>
|
||||||
" Website: https://github.com/bfrg/vim-cpp-modern
|
" Website: https://github.com/bfrg/vim-cpp-modern
|
||||||
" Last Change: Nov 23, 2020
|
" Last Change: Sep 15, 2022
|
||||||
"
|
"
|
||||||
" This syntax file is based on:
|
" This syntax file is based on:
|
||||||
" https://github.com/octol/vim-cpp-enhanced-highlight
|
" 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 cppSTLnamespace chrono this_thread
|
||||||
|
|
||||||
syntax keyword cppSTLtype
|
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
|
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
|
\ 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
|
syntax keyword cppSTLexception
|
||||||
\ bad_function_call future_error regex_error system_error bad_weak_ptr bad_array_new_length
|
\ bad_function_call future_error regex_error system_error bad_weak_ptr bad_array_new_length
|
||||||
|
|
||||||
" syntax keyword cppSTLiterator contained
|
|
||||||
syntax keyword cppSTLiterator
|
syntax keyword cppSTLiterator
|
||||||
\ move_iterator regex_iterator regex_token_iterator const_local_iterator local_iterator
|
\ 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 cppSTLnamespace filesystem execution string_view_literals
|
||||||
|
|
||||||
syntax keyword cppSTLtype
|
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
|
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
|
\ 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 cppSTLnamespace ranges views
|
||||||
syntax keyword cppSTLconstant dynamic_extent
|
syntax keyword cppSTLconstant dynamic_extent
|
||||||
syntax keyword cppSTLvariable default_sentinel unreachable_sentinel
|
syntax keyword cppSTLvariable default_sentinel unreachable_sentinel
|
||||||
|
syntax keyword cppSTLexception format_error
|
||||||
|
|
||||||
syntax keyword cppSTLtype
|
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
|
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
|
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
|
\ 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
|
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
|
" Boost {{{1
|
||||||
if !exists('cpp_no_boost')
|
if !exists('cpp_no_boost')
|
||||||
syntax keyword cppSTLnamespace boost
|
syntax keyword cppSTLnamespace boost
|
||||||
|
|||||||
@@ -38,5 +38,5 @@ if exists('s:current_syntax')
|
|||||||
let b:current_syntax = s:current_syntax
|
let b:current_syntax = s:current_syntax
|
||||||
endif
|
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
|
syntax region graphqlExtensionPointS matchgroup=String start=+{|+ end=+|}+ contains=@GraphQLSyntax contained
|
||||||
|
|||||||
@@ -38,5 +38,5 @@ if exists('s:current_syntax')
|
|||||||
let b:current_syntax = s:current_syntax
|
let b:current_syntax = s:current_syntax
|
||||||
endif
|
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
|
syntax region graphqlExtensionPointS matchgroup=String start=+`+ end=+`+ contains=@GraphQLSyntax contained
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(param\)"+ skip=+\\"
|
|||||||
\ contains=ZinitIceDoubleQuoteParam
|
\ contains=ZinitIceDoubleQuoteParam
|
||||||
|
|
||||||
" added by the existing annexes
|
" 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
|
\ nextgroup=@ZinitLine,ZinitContinue
|
||||||
\ contains=ZinitIceDoubleQuoteParam
|
\ contains=ZinitIceDoubleQuoteParam
|
||||||
syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(dl\|patch\|submods\|cargo\|dlink\|dlink0\)"+ skip=+\\"+ end=+"+ skipwhite contained
|
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
|
\ contains=ZinitIceSingleQuoteParam
|
||||||
|
|
||||||
" added by the existing annexes
|
" 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
|
\ nextgroup=@ZinitLine,ZinitContinue
|
||||||
\ contains=ZinitIceSingleQuoteParam
|
\ contains=ZinitIceSingleQuoteParam
|
||||||
syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(dl\|patch\|submods\|cargo\|dlink\|dlink0\)'+ skip=+\\'+ end=+'+ skipwhite contained
|
syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(dl\|patch\|submods\|cargo\|dlink\|dlink0\)'+ skip=+\\'+ end=+'+ skipwhite contained
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ endfunction
|
|||||||
" It returns the previous maparg dictionary, so that the previous mapping can
|
" It returns the previous maparg dictionary, so that the previous mapping can
|
||||||
" be reinstated if needed.
|
" be reinstated if needed.
|
||||||
function! s:L2U_SetFallbackMapping(s, k)
|
function! s:L2U_SetFallbackMapping(s, k)
|
||||||
let mmdict = maparg(a:s, 'i', 0, 1)
|
let mmdict = maparg(a:s, 'i', 0, 1)
|
||||||
if empty(mmdict) || !has_key(mmdict, "rhs")
|
if empty(mmdict) || !has_key(mmdict, "rhs")
|
||||||
exe 'inoremap <buffer> ' . a:k . ' ' . a:s
|
exe 'inoremap <buffer> ' . a:k . ' ' . a:s
|
||||||
return mmdict
|
return mmdict
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
24
autoload/coc/source/requirements.vim
Normal file
24
autoload/coc/source/requirements.vim
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
if polyglot#init#is_disabled(expand('<sfile>: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:
|
||||||
@@ -96,7 +96,7 @@ lockvar g:crystal#indent#block_regex
|
|||||||
" Regex that defines the beginning of a hanging expression.
|
" Regex that defines the beginning of a hanging expression.
|
||||||
let g:crystal#indent#hanging_assignment_regex =
|
let g:crystal#indent#hanging_assignment_regex =
|
||||||
\ '\%('.g:crystal#indent#operator_regex.'\s*\)\@<=' .
|
\ '\%('.g:crystal#indent#operator_regex.'\s*\)\@<=' .
|
||||||
\ '\.\@1<!\<\%(if\||unless\|case\|begin\)\>'
|
\ '\.\@1<!\<\%(if\||unless\|case\|begin\|select\)\>'
|
||||||
lockvar g:crystal#indent#hanging_assignment_regex
|
lockvar g:crystal#indent#hanging_assignment_regex
|
||||||
|
|
||||||
" Regex that defines the start-match for the 'end' keyword.
|
" Regex that defines the start-match for the 'end' keyword.
|
||||||
@@ -107,7 +107,7 @@ let g:crystal#indent#end_start_regex =
|
|||||||
\ '\%(\<\%(private\|protected\)\s\+\)\=' .
|
\ '\%(\<\%(private\|protected\)\s\+\)\=' .
|
||||||
\ '\%(\<\%(abstract\s\+\)\=\%(class\|struct\)\>\|\<\%(def\|module\|macro\|lib\|enum\|annotation\)\>\)' .
|
\ '\%(\<\%(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 .
|
\ g:crystal#indent#hanging_assignment_regex .
|
||||||
|
|||||||
@@ -826,8 +826,8 @@ fu! csv#Columnize(field) "{{{3
|
|||||||
let colnr = s:columnize_count % s:max_cols
|
let colnr = s:columnize_count % s:max_cols
|
||||||
let width = get(b:col_width, colnr, 20)
|
let width = get(b:col_width, colnr, 20)
|
||||||
let align = 'r'
|
let align = 'r'
|
||||||
if exists('b:csv_arrange_align')
|
if exists('b:csv_arrange_align') || exists('g:csv_arrange_align')
|
||||||
let align=b:csv_arrange_align
|
let align=get(b:, 'csv_arrange_align', g:csv_arrange_align)
|
||||||
let indx=match(align, '\*')
|
let indx=match(align, '\*')
|
||||||
if indx > 0
|
if indx > 0
|
||||||
let align = align[0:(indx-1)]. repeat(align[indx-1], len(b:col_width)-indx)
|
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
|
endfu
|
||||||
fu! csv#SetupAutoCmd(window,bufnr) "{{{3
|
fu! csv#SetupAutoCmd(window,bufnr) "{{{3
|
||||||
" Setup QuitPre autocommand to quit cleanly
|
" Setup QuitPre autocommand to quit cleanly
|
||||||
|
if a:bufnr == 0
|
||||||
|
" something went wrong,
|
||||||
|
" how can this happen?
|
||||||
|
return
|
||||||
|
endif
|
||||||
aug CSV_QuitPre
|
aug CSV_QuitPre
|
||||||
au!
|
au!
|
||||||
exe "au QuitPre * call CSV_CloseBuffer(".winbufnr(a:window).")"
|
exe "au QuitPre * call CSV_CloseBuffer(".winbufnr(a:window).")"
|
||||||
@@ -1024,7 +1029,7 @@ fu! csv#SplitHeaderLine(lines, bang, hor) "{{{3
|
|||||||
" disable airline
|
" disable airline
|
||||||
let w:airline_disabled = 1
|
let w:airline_disabled = 1
|
||||||
let win = winnr()
|
let win = winnr()
|
||||||
setl scrollbind buftype=nowrite bufhidden=wipe noswapfile nobuflisted
|
setl scrollbind buftype=nofile bufhidden=wipe noswapfile nobuflisted
|
||||||
noa wincmd p
|
noa wincmd p
|
||||||
let b:csv_SplitWindow = win
|
let b:csv_SplitWindow = win
|
||||||
aug CSV_Preview
|
aug CSV_Preview
|
||||||
|
|||||||
@@ -92,9 +92,9 @@ endfunction
|
|||||||
|
|
||||||
" Finds the path to `uri`.
|
" Finds the path to `uri`.
|
||||||
"
|
"
|
||||||
" If the file is a package: uri, looks for a .packages file to resolve the path.
|
" If the file is a package: uri, looks for a package_config.json or .packages
|
||||||
" If the path cannot be resolved, or is not a package: uri, returns the
|
" file to resolve the path. If the path cannot be resolved, or is not a
|
||||||
" original.
|
" package: uri, returns the original.
|
||||||
function! dart#resolveUri(uri) abort
|
function! dart#resolveUri(uri) abort
|
||||||
if a:uri !~# 'package:'
|
if a:uri !~# 'package:'
|
||||||
return a:uri
|
return a:uri
|
||||||
@@ -102,7 +102,7 @@ function! dart#resolveUri(uri) abort
|
|||||||
let package_name = substitute(a:uri, 'package:\(\w\+\)\/.*', '\1', '')
|
let package_name = substitute(a:uri, 'package:\(\w\+\)\/.*', '\1', '')
|
||||||
let [found, package_map] = s:PackageMap()
|
let [found, package_map] = s:PackageMap()
|
||||||
if !found
|
if !found
|
||||||
call s:error('cannot find .packages file')
|
call s:error('cannot find .packages or package_config.json file')
|
||||||
return a:uri
|
return a:uri
|
||||||
endif
|
endif
|
||||||
if !has_key(package_map, package_name)
|
if !has_key(package_map, package_name)
|
||||||
@@ -116,14 +116,38 @@ function! dart#resolveUri(uri) abort
|
|||||||
\ '')
|
\ '')
|
||||||
endfunction
|
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]
|
" Returns [found, package_map]
|
||||||
function! s:PackageMap() abort
|
function! s:PackageMap() abort
|
||||||
let [found, dot_packages] = s:DotPackagesFile()
|
let [found, package_config] = s:FindFile('.dart_tool/package_config.json')
|
||||||
if !found
|
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, {}]
|
return [v:false, {}]
|
||||||
endif
|
endif
|
||||||
|
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
|
||||||
|
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 dot_packages_dir = fnamemodify(dot_packages, ':p:h')
|
||||||
let lines = readfile(dot_packages)
|
let lines = readfile(dot_packages)
|
||||||
let map = {}
|
let map = {}
|
||||||
@@ -147,6 +171,8 @@ function! s:PackageMap() abort
|
|||||||
let map[package] = lib_dir
|
let map[package] = lib_dir
|
||||||
endfor
|
endfor
|
||||||
return [v:true, map]
|
return [v:true, map]
|
||||||
|
endif
|
||||||
|
return [v:false, {}]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Toggle whether dartfmt is run on save or not.
|
" Toggle whether dartfmt is run on save or not.
|
||||||
@@ -158,17 +184,17 @@ function! dart#ToggleFormatOnSave() abort
|
|||||||
let g:dart_format_on_save = 1
|
let g:dart_format_on_save = 1
|
||||||
endfunction
|
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.
|
" file.
|
||||||
"
|
"
|
||||||
" Returns [found, file].
|
" Returns [found, file]
|
||||||
function! s:DotPackagesFile() abort
|
function! s:FindFile(path) abort
|
||||||
if filereadable('.packages')
|
if filereadable(a:path)
|
||||||
return [v:true, '.packages']
|
return [v:true, a:path]
|
||||||
endif
|
endif
|
||||||
let dir_path = expand('%:p:h')
|
let dir_path = expand('%:p:h')
|
||||||
while v:true
|
while v:true
|
||||||
let file_path = dir_path.'/.packages'
|
let file_path = dir_path.'/'.a:path
|
||||||
if filereadable(file_path)
|
if filereadable(file_path)
|
||||||
return [v:true, file_path]
|
return [v:true, file_path]
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ function! fsharp#loadConfig()
|
|||||||
let g:fsharp#automatic_reload_workspace = 1
|
let g:fsharp#automatic_reload_workspace = 1
|
||||||
endif
|
endif
|
||||||
if !exists('g:fsharp#show_signature_on_cursor_move')
|
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
|
endif
|
||||||
if !exists('g:fsharp#fsi_command')
|
if !exists('g:fsharp#fsi_command')
|
||||||
let g:fsharp#fsi_command = "dotnet fsi"
|
let g:fsharp#fsi_command = "dotnet fsi"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function! ledger#transaction_state_toggle(lnum, ...) abort
|
|||||||
endf
|
endf
|
||||||
|
|
||||||
function! ledger#transaction_state_set(lnum, char) abort
|
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
|
" removing the state altogether if a:char is empty
|
||||||
let trans = s:transaction.from_lnum(a:lnum)
|
let trans = s:transaction.from_lnum(a:lnum)
|
||||||
if empty(trans) || has_key(trans, 'expr')
|
if empty(trans) || has_key(trans, 'expr')
|
||||||
@@ -130,7 +130,7 @@ function! ledger#transaction_post_state_set(lnum, char) abort
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let line = getline('.')
|
let line = getline(a:lnum)
|
||||||
if a:char =~# '^\s*$'
|
if a:char =~# '^\s*$'
|
||||||
let newline = substitute(line, '\V' . state . '\m[ \t]', '', '')
|
let newline = substitute(line, '\V' . state . '\m[ \t]', '', '')
|
||||||
elseif state ==# ' '
|
elseif state ==# ' '
|
||||||
@@ -457,10 +457,20 @@ endf
|
|||||||
|
|
||||||
" Return character position of decimal separator (multibyte safe)
|
" Return character position of decimal separator (multibyte safe)
|
||||||
function! s:decimalpos(expr) abort
|
function! s:decimalpos(expr) abort
|
||||||
let pos = match(a:expr, '\V' . g:ledger_decimal_sep)
|
" 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
|
if pos > 0
|
||||||
let pos = strchars(a:expr[:pos]) - 1
|
let pos = strchars(a:expr[:pos]) - 1
|
||||||
endif
|
endif
|
||||||
|
end
|
||||||
return pos
|
return pos
|
||||||
endf
|
endf
|
||||||
|
|
||||||
@@ -544,6 +554,10 @@ function! ledger#align_amount_at_cursor() abort
|
|||||||
endif
|
endif
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
function! ledger#align_formatexpr(lnum, count) abort
|
||||||
|
execute a:lnum . ',' . (a:lnum + a:count - 1) . 'call ledger#align_commodity()'
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Report generation {{{1
|
" Report generation {{{1
|
||||||
|
|
||||||
" Helper functions and variables {{{2
|
" Helper functions and variables {{{2
|
||||||
@@ -732,8 +746,6 @@ function! ledger#register(file, args) abort
|
|||||||
endf
|
endf
|
||||||
|
|
||||||
" Reconcile the given account.
|
" 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:
|
" Parameters:
|
||||||
" file The file to be processed
|
" file The file to be processed
|
||||||
|
|||||||
@@ -1775,7 +1775,7 @@ if !has_key(g:polyglot_is_disabled, 'prolog')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'bzl')
|
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
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'odin')
|
if !has_key(g:polyglot_is_disabled, 'odin')
|
||||||
@@ -1783,7 +1783,7 @@ if !has_key(g:polyglot_is_disabled, 'odin')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'dosini')
|
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 php.ini-* call s:StarSetf('dosini')
|
||||||
au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
|
au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
|
||||||
endif
|
endif
|
||||||
@@ -1873,7 +1873,7 @@ if !has_key(g:polyglot_is_disabled, 'unison')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'typescript')
|
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
|
au BufNewFile,BufRead *.tsx setf typescriptreact
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -2233,7 +2233,7 @@ if !has_key(g:polyglot_is_disabled, 'jsonnet')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'json')
|
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
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'json5')
|
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
|
au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'gdscript')
|
|
||||||
au BufNewFile,BufRead *.gd setf gdscript3
|
|
||||||
endif
|
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'fsharp')
|
if !has_key(g:polyglot_is_disabled, 'fsharp')
|
||||||
au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs()
|
au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs()
|
||||||
au BufNewFile,BufRead *.fsi,*.fsx setf fsharp
|
au BufNewFile,BufRead *.fsi,*.fsx setf fsharp
|
||||||
@@ -2464,7 +2460,7 @@ if !has_key(g:polyglot_is_disabled, 'coffee-script')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'markdown')
|
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
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'cmake')
|
if !has_key(g:polyglot_is_disabled, 'cmake')
|
||||||
@@ -2472,7 +2468,7 @@ if !has_key(g:polyglot_is_disabled, 'cmake')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'clojure')
|
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
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'carp')
|
if !has_key(g:polyglot_is_disabled, 'carp')
|
||||||
@@ -2583,7 +2579,7 @@ if !has_key(g:polyglot_is_disabled, 'ant')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'xml')
|
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
|
endif
|
||||||
|
|
||||||
if !has_key(g:polyglot_is_disabled, 'csv')
|
if !has_key(g:polyglot_is_disabled, 'csv')
|
||||||
|
|||||||
@@ -462,6 +462,7 @@ endfunc
|
|||||||
let s:interpreters = {
|
let s:interpreters = {
|
||||||
\ 'osascript': 'applescript',
|
\ 'osascript': 'applescript',
|
||||||
\ 'tcc': 'c',
|
\ 'tcc': 'c',
|
||||||
|
\ 'bb': 'clojure',
|
||||||
\ 'coffee': 'coffee',
|
\ 'coffee': 'coffee',
|
||||||
\ 'crystal': 'crystal',
|
\ 'crystal': 'crystal',
|
||||||
\ 'dart': 'dart',
|
\ 'dart': 'dart',
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ let s:globs = {
|
|||||||
\ 'brewfile': 'Brewfile',
|
\ 'brewfile': 'Brewfile',
|
||||||
\ 'bsdl': '*.bsdl,*bsd',
|
\ 'bsdl': '*.bsdl,*bsd',
|
||||||
\ 'bst': '*.bst',
|
\ '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.*',
|
\ 'bzr': 'bzr_log.*',
|
||||||
\ 'c': '*.c,*.cats,*.h,*.idc,*.qc',
|
\ 'c': '*.c,*.cats,*.h,*.idc,*.qc',
|
||||||
\ 'cabal': '*.cabal',
|
\ 'cabal': '*.cabal',
|
||||||
@@ -75,7 +75,7 @@ let s:globs = {
|
|||||||
\ 'chordpro': '*.chopro,*.crd,*.cho,*.crdpro,*.chordpro',
|
\ 'chordpro': '*.chopro,*.crd,*.cho,*.crdpro,*.chordpro',
|
||||||
\ 'cl': '*.eni',
|
\ 'cl': '*.eni',
|
||||||
\ 'clean': '*.dcl,*.icl',
|
\ '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',
|
\ 'cmake': '*.cmake,*.cmake.in,CMakeLists.txt',
|
||||||
\ 'cmod': '*.cmod',
|
\ 'cmod': '*.cmod',
|
||||||
\ 'cmusrc': '',
|
\ 'cmusrc': '',
|
||||||
@@ -130,7 +130,7 @@ let s:globs = {
|
|||||||
\ 'dnsmasq': '',
|
\ 'dnsmasq': '',
|
||||||
\ 'dockerfile': '*.Dockerfile,*.dock,Containerfile,Dockerfile,dockerfile,Dockerfile*',
|
\ 'dockerfile': '*.Dockerfile,*.dock,Containerfile,Dockerfile,dockerfile,Dockerfile*',
|
||||||
\ 'dosbatch': '*.bat,*.sys',
|
\ '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',
|
\ 'dot': '*.dot,*.gv',
|
||||||
\ 'dracula': '*.drac,*.drc,*lvs,*lpe,drac.*',
|
\ 'dracula': '*.drac,*.drc,*lvs,*lpe,drac.*',
|
||||||
\ 'dsdl': '*.sdl',
|
\ 'dsdl': '*.sdl',
|
||||||
@@ -181,7 +181,6 @@ let s:globs = {
|
|||||||
\ 'fvwm': '',
|
\ 'fvwm': '',
|
||||||
\ 'gdb': '.gdbinit',
|
\ 'gdb': '.gdbinit',
|
||||||
\ 'gdmo': '*.mo,*.gdmo',
|
\ 'gdmo': '*.mo,*.gdmo',
|
||||||
\ 'gdscript3': '*.gd',
|
|
||||||
\ 'gedcom': '*.ged,lltxxxxx.txt',
|
\ 'gedcom': '*.ged,lltxxxxx.txt',
|
||||||
\ 'gitcommit': 'COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG',
|
\ 'gitcommit': 'COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG',
|
||||||
\ 'gitconfig': '*.gitconfig,.gitconfig,.gitmodules',
|
\ 'gitconfig': '*.gitconfig,.gitconfig,.gitmodules',
|
||||||
@@ -263,7 +262,7 @@ let s:globs = {
|
|||||||
\ 'jovial': '*.jov,*.j73,*.jovial',
|
\ 'jovial': '*.jov,*.j73,*.jovial',
|
||||||
\ 'jproperties': '*.properties,*.properties_??,*.properties_??_??,*.properties_??_??_*',
|
\ 'jproperties': '*.properties,*.properties_??,*.properties_??_??,*.properties_??_??_*',
|
||||||
\ 'jq': '*.jq,.jqrc,.jqrc*',
|
\ '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',
|
\ 'json5': '*.json5',
|
||||||
\ 'jsonc': '*.cjson,*.jsonc,coc-settings.json,.eslintrc.json,.babelrc,.jshintrc,.jslintrc,.mocharc.json,coffeelint.json,tsconfig.json,jsconfig.json',
|
\ 'jsonc': '*.cjson,*.jsonc,coc-settings.json,.eslintrc.json,.babelrc,.jshintrc,.jslintrc,.mocharc.json,coffeelint.json,tsconfig.json,jsconfig.json',
|
||||||
\ 'jsonnet': '*.jsonnet,*.libsonnet',
|
\ 'jsonnet': '*.jsonnet,*.libsonnet',
|
||||||
@@ -321,7 +320,7 @@ let s:globs = {
|
|||||||
\ 'mallard': '*.page',
|
\ 'mallard': '*.page',
|
||||||
\ 'manconf': 'man.config',
|
\ 'manconf': 'man.config',
|
||||||
\ 'maple': '*.mv,*.mpl,*.mws',
|
\ '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',
|
\ 'markdown.mdx': '*.mdx',
|
||||||
\ 'mason': '*.mason,*.mhtml,*.comp',
|
\ 'mason': '*.mason,*.mhtml,*.comp',
|
||||||
\ 'master': '*.mas,*.master',
|
\ 'master': '*.mas,*.master',
|
||||||
@@ -568,7 +567,7 @@ let s:globs = {
|
|||||||
\ 'tt2': '*.tt2',
|
\ 'tt2': '*.tt2',
|
||||||
\ 'tt2html': '*.tt2',
|
\ 'tt2html': '*.tt2',
|
||||||
\ 'tutor': '*.tutor',
|
\ 'tutor': '*.tutor',
|
||||||
\ 'typescript': '*.ts',
|
\ 'typescript': '*.ts,*.cts,*.mts',
|
||||||
\ 'typescriptreact': '*.tsx',
|
\ 'typescriptreact': '*.tsx',
|
||||||
\ 'uc': '*.uc',
|
\ 'uc': '*.uc',
|
||||||
\ 'udevconf': '',
|
\ 'udevconf': '',
|
||||||
@@ -614,7 +613,7 @@ let s:globs = {
|
|||||||
\ 'xhtml': '*.xhtml,*.xht',
|
\ 'xhtml': '*.xhtml,*.xht',
|
||||||
\ 'xinetd': '',
|
\ 'xinetd': '',
|
||||||
\ 'xmath': '*.msc,*.msf',
|
\ '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',
|
\ 'xml.twig': '*.xml.twig',
|
||||||
\ 'xmodmap': '*Xmodmap,*xmodmap*',
|
\ 'xmodmap': '*Xmodmap,*xmodmap*',
|
||||||
\ 'xpm': '*.xpm,*.pm',
|
\ 'xpm': '*.xpm,*.pm',
|
||||||
|
|||||||
@@ -2,35 +2,47 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'autoload/requ
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" the Requirements File Format syntax support for Vim
|
""
|
||||||
" Version: 1.6.0
|
" @section Introduction, intro
|
||||||
" Author: raimon <raimon49@hotmail.com>
|
" @library
|
||||||
" License: MIT LICENSE
|
" <doc/@plugin(name).txt> is generated by <https://github.com/google/vimdoc>.
|
||||||
" The MIT License (MIT)
|
" See <README.md> for more information about installation and screenshots.
|
||||||
"
|
|
||||||
" 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.
|
|
||||||
|
|
||||||
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
|
if exists('*stdpath')
|
||||||
unlet s:save_cpo
|
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:
|
" vim: et sw=4 ts=4 sts=4:
|
||||||
|
|||||||
15
autoload/requirements/utils.vim
Normal file
15
autoload/requirements/utils.vim
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
if polyglot#init#is_disabled(expand('<sfile>: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:
|
||||||
@@ -38,10 +38,12 @@ augroup END
|
|||||||
" Ignore general cargo progress messages
|
" Ignore general cargo progress messages
|
||||||
CompilerSet errorformat+=
|
CompilerSet errorformat+=
|
||||||
\%-G%\\s%#Downloading%.%#,
|
\%-G%\\s%#Downloading%.%#,
|
||||||
|
\%-G%\\s%#Checking%.%#,
|
||||||
\%-G%\\s%#Compiling%.%#,
|
\%-G%\\s%#Compiling%.%#,
|
||||||
\%-G%\\s%#Finished%.%#,
|
\%-G%\\s%#Finished%.%#,
|
||||||
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
|
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
|
||||||
\%-G%\\s%#To\ learn\ more\\,%.%#,
|
\%-G%\\s%#To\ learn\ more\\,%.%#,
|
||||||
|
\%-G%\\s%#For\ more\ information\ about\ this\ error\\,%.%#,
|
||||||
\%-Gnote:\ Run\ with\ \`RUST_BACKTRACE=%.%#,
|
\%-Gnote:\ Run\ with\ \`RUST_BACKTRACE=%.%#,
|
||||||
\%.%#panicked\ at\ \\'%m\\'\\,\ %f:%l:%c
|
\%.%#panicked\ at\ \\'%m\\'\\,\ %f:%l:%c
|
||||||
|
|
||||||
|
|||||||
49
compiler/pip_compile.vim
Normal file
49
compiler/pip_compile.vim
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'compiler/pip_compile.vim')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" the Requirements File Format syntax support for Vim
|
||||||
|
" Version: 1.7.1
|
||||||
|
" Author: raimon <raimon49@hotmail.com>
|
||||||
|
" 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 <args>
|
||||||
|
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:
|
||||||
@@ -22,7 +22,8 @@ syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRe
|
|||||||
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
|
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
|
||||||
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
|
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
|
||||||
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
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
|
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
||||||
|
|
||||||
if version >= 508 || !exists("did_javascript_syn_inits")
|
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'caddyfile', 'ftplugin/caddyfi
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Language: Caddyfile
|
" Language: Caddyfile
|
||||||
" Author: Josh Glendenning <josh@isobit.io>
|
" Maintainer: 0az <0az@afzhou.com>
|
||||||
|
" Original Author: Josh Glendenning <josh@isobit.io>
|
||||||
|
|
||||||
if exists('b:did_ftplugin')
|
if exists('b:did_ftplugin')
|
||||||
finish
|
finish
|
||||||
@@ -20,7 +21,7 @@ if exists('g:NERDDelimiterMap')
|
|||||||
endif
|
endif
|
||||||
elseif exists('g:NERDCustomDelimiters')
|
elseif exists('g:NERDCustomDelimiters')
|
||||||
if !has_key(g:NERDCustomDelimiters, 'caddyfile')
|
if !has_key(g:NERDCustomDelimiters, 'caddyfile')
|
||||||
let g:NERDDelimiterMap.caddyfile = s:delimiters
|
let g:NERDCustomDelimiters.caddyfile = s:delimiters
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
let g:NERDCustomDelimiters = {'caddyfile': s:delimiters}
|
let g:NERDCustomDelimiters = {'caddyfile': s:delimiters}
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ endif
|
|||||||
" Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
" Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||||
" Eduardo Lopez (http://github.com/tapichu)
|
" Eduardo Lopez (http://github.com/tapichu)
|
||||||
" Arvid Bjurklint (http://github.com/slarwise)
|
" 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
|
" License: Vim license
|
||||||
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
" 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:include = '^\s*-\%(include\|include_lib\)\s*("\zs\f*\ze")'
|
||||||
let &l:define = '^\s*-\%(define\|record\|type\|opaque\)'
|
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*\(%.*\)\?$'
|
let s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$'
|
||||||
|
|
||||||
if !exists('*GetErlangFold')
|
if !exists('*GetErlangFold')
|
||||||
@@ -103,6 +104,23 @@ let b:undo_ftplugin = "setlocal keywordprg< foldmethod< foldexpr< foldtext<"
|
|||||||
\ . " comments< commentstring< formatoptions< suffixesadd< include<"
|
\ . " comments< commentstring< formatoptions< suffixesadd< include<"
|
||||||
\ . " define<"
|
\ . " 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\)\>' .
|
||||||
|
\ ':\<end\>,' .
|
||||||
|
\ '^\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
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
|
||||||
|
|||||||
@@ -89,8 +89,12 @@ runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim
|
|||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
" Combine the new set of values with those previously included.
|
" Combine the new set of values with those previously included.
|
||||||
if exists("b:undo_ftplugin")
|
if !exists('b:undo_ftplugin')
|
||||||
let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
|
" No-op
|
||||||
|
let b:undo_ftplugin = 'exe'
|
||||||
|
endif
|
||||||
|
if !empty(s:undo_ftplugin)
|
||||||
|
let b:undo_ftplugin .= '|' . s:undo_ftplugin
|
||||||
endif
|
endif
|
||||||
if exists ("b:browsefilter")
|
if exists ("b:browsefilter")
|
||||||
let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter
|
let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter
|
||||||
@@ -122,7 +126,7 @@ endif
|
|||||||
setlocal commentstring=<%#%s%>
|
setlocal commentstring=<%#%s%>
|
||||||
|
|
||||||
let b:undo_ftplugin = "setl cms< " .
|
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
|
let &cpo = s:save_cpo
|
||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ endif
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: git commit file
|
" Language: git commit file
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2019 Dec 05
|
" Last Change: 2022 Jan 05
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if (exists("b:did_ftplugin"))
|
if (exists("b:did_ftplugin"))
|
||||||
@@ -16,7 +16,7 @@ let b:did_ftplugin = 1
|
|||||||
|
|
||||||
setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72
|
setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72
|
||||||
setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n
|
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 include=^+++
|
||||||
setlocal includeexpr=substitute(v:fname,'^[bi]/','','')
|
setlocal includeexpr=substitute(v:fname,'^[bi]/','','')
|
||||||
|
|
||||||
@@ -46,6 +46,11 @@ function! s:diffcomplete(A, L, P) abort
|
|||||||
return args
|
return args
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:setupdiff() abort
|
||||||
|
command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0, <f-args>)
|
||||||
|
setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:gitdiffcached(bang, ...) abort
|
function! s:gitdiffcached(bang, ...) abort
|
||||||
let name = tempname()
|
let name = tempname()
|
||||||
if a:0
|
if a:0
|
||||||
@@ -54,8 +59,6 @@ function! s:gitdiffcached(bang, ...) abort
|
|||||||
let extra = "-p --stat=".&columns
|
let extra = "-p --stat=".&columns
|
||||||
endif
|
endif
|
||||||
call system("git diff --cached --no-color --no-ext-diff ".extra." > ".shellescape(name))
|
call system("git diff --cached --no-color --no-ext-diff ".extra." > ".shellescape(name))
|
||||||
exe "pedit " . fnameescape(name)
|
exe 'pedit +call\ s:setupdiff()' fnameescape(name)
|
||||||
wincmd P
|
silent! wincmd P
|
||||||
command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0, <f-args>)
|
|
||||||
setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ endif
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: git rebase --interactive
|
" Language: git rebase --interactive
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2019 Dec 05
|
" Last Change: 2022 Jan 05
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if (exists("b:did_ftplugin"))
|
if (exists("b:did_ftplugin"))
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ endif
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: Haml
|
" Language: Haml
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2016 Aug 29
|
" Last Change: 2019 Dec 05
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
|
|||||||
@@ -26,11 +26,17 @@ setlocal fo-=t fo+=croql
|
|||||||
let b:julia_vim_loaded = 1
|
let b:julia_vim_loaded = 1
|
||||||
|
|
||||||
let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<"
|
let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<"
|
||||||
|
\ . " expandtab< shiftwidth<"
|
||||||
\ . " define< fo< indentexpr< indentkeys< cinoptions< completefunc<"
|
\ . " define< fo< indentexpr< indentkeys< cinoptions< completefunc<"
|
||||||
\ . " | unlet! b:commentary_format"
|
\ . " | unlet! b:commentary_format"
|
||||||
\ . " | unlet! b:smartcomment_force_linemode"
|
\ . " | unlet! b:smartcomment_force_linemode"
|
||||||
\ . " | unlet! b:julia_vim_loaded"
|
\ . " | 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
|
" MatchIt plugin support
|
||||||
if exists("loaded_matchit")
|
if exists("loaded_matchit")
|
||||||
let b:match_ignorecase = 0
|
let b:match_ignorecase = 0
|
||||||
|
|||||||
@@ -860,7 +860,11 @@ endfunction
|
|||||||
|
|
||||||
|
|
||||||
function! s:MarkdownRefreshSyntax(force)
|
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)
|
call s:MarkdownHighlightSources(a:force)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
17
ftplugin/mir.vim
Normal file
17
ftplugin/mir.vim
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
if polyglot#init#is_disabled(expand('<sfile>: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+=:;
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ let b:did_ftplugin = 1
|
|||||||
|
|
||||||
setlocal tw=0
|
setlocal tw=0
|
||||||
setlocal commentstring=#%s
|
setlocal commentstring=#%s
|
||||||
setlocal formatoptions=tcqro
|
setlocal formatoptions+=tcqroj
|
||||||
" Enable autocompletion of hyphenated PowerShell commands,
|
" Enable autocompletion of hyphenated PowerShell commands,
|
||||||
" e.g. Get-Content or Get-ADUser
|
" e.g. Get-Content or Get-ADUser
|
||||||
setlocal iskeyword+=-
|
setlocal iskeyword+=-
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'after/ftplugin/requirements.vim')
|
if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'ftplugin/requirements.vim')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" the Requirements File Format syntax support for Vim
|
" the Requirements File Format syntax support for Vim
|
||||||
" Version: 1.6.0
|
" Version: 1.7.1
|
||||||
" Author: raimon <raimon49@hotmail.com>
|
" Author: raimon <raimon49@hotmail.com>
|
||||||
" License: MIT LICENSE
|
" License: MIT LICENSE
|
||||||
" The MIT License (MIT)
|
" The MIT License (MIT)
|
||||||
@@ -27,16 +27,20 @@ endif
|
|||||||
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
" 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
|
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
" SOFTWARE.
|
" SOFTWARE.
|
||||||
if executable('pip-compile')
|
if exists("b:did_ftplugin")
|
||||||
let s:filename = expand("%:p")
|
finish
|
||||||
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
|
|
||||||
endif
|
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
|
setlocal commentstring=#\ %s
|
||||||
|
compiler pip_compile
|
||||||
|
|
||||||
|
let &cpoptions = s:save_cpoptions
|
||||||
|
unlet s:save_cpoptions
|
||||||
" vim: et sw=4 ts=4 sts=4:
|
" vim: et sw=4 ts=4 sts=4:
|
||||||
@@ -54,6 +54,13 @@ endif
|
|||||||
let b:undo_ftplugin =
|
let b:undo_ftplugin =
|
||||||
\ 'setl isk< et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<'
|
\ 'setl isk< et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<'
|
||||||
|
|
||||||
|
augroup vim-zig
|
||||||
|
autocmd! * <buffer>
|
||||||
|
autocmd BufWritePre <buffer> if get(g:, 'zig_fmt_autosave', 1) | call zig#fmt#Format() | endif
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
let b:undo_ftplugin .= '|au! vim-zig * <buffer>'
|
||||||
|
|
||||||
let &cpo = s:cpo_orig
|
let &cpo = s:cpo_orig
|
||||||
unlet s:cpo_orig
|
unlet s:cpo_orig
|
||||||
" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab
|
" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab
|
||||||
|
|||||||
@@ -55,6 +55,10 @@ if exists("*searchpairpos")
|
|||||||
let g:clojure_align_subforms = 0
|
let g:clojure_align_subforms = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:clojure_cljfmt_compat')
|
||||||
|
let g:clojure_cljfmt_compat = 0
|
||||||
|
endif
|
||||||
|
|
||||||
function! s:syn_id_name()
|
function! s:syn_id_name()
|
||||||
return synIDattr(synID(line("."), col("."), 0), "name")
|
return synIDattr(synID(line("."), col("."), 0), "name")
|
||||||
endfunction
|
endfunction
|
||||||
@@ -326,9 +330,16 @@ if exists("*searchpairpos")
|
|||||||
return [paren[0], paren[1] + (g:clojure_align_subforms ? 0 : &shiftwidth - 1)]
|
return [paren[0], paren[1] + (g:clojure_align_subforms ? 0 : &shiftwidth - 1)]
|
||||||
elseif w[1] == '_'
|
elseif w[1] == '_'
|
||||||
return paren
|
return paren
|
||||||
|
elseif w[1] == "'" && g:clojure_cljfmt_compat
|
||||||
|
return paren
|
||||||
endif
|
endif
|
||||||
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
|
" Test words without namespace qualifiers and leading reader macro
|
||||||
" metacharacters.
|
" metacharacters.
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -8,7 +8,12 @@ endif
|
|||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
setlocal cindent
|
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()
|
setlocal indentexpr=DartIndent()
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ endif
|
|||||||
" Contributors: Edwin Fine <efine145_nospam01 at usa dot net>
|
" Contributors: Edwin Fine <efine145_nospam01 at usa dot net>
|
||||||
" Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
|
" Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
|
||||||
" Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
" Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||||
" Last Update: 2020-Jun-11
|
" Last Update: 2022-Sep-06
|
||||||
" License: Vim license
|
" License: Vim license
|
||||||
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
setlocal indentexpr=ErlangIndent()
|
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<"
|
let b:undo_indent = "setl inde< indk<"
|
||||||
|
|
||||||
@@ -241,8 +241,8 @@ function! s:GetTokensFromLine(line, string_continuation, atom_continuation,
|
|||||||
|
|
||||||
" Two-character tokens
|
" Two-character tokens
|
||||||
elseif i + 1 < linelen &&
|
elseif i + 1 < linelen &&
|
||||||
\ index(['->', '<<', '>>', '||', '==', '/=', '=<', '>=', '++', '--',
|
\ index(['->', '<<', '>>', '||', '==', '/=', '=<', '>=', '?=', '++',
|
||||||
\ '::'],
|
\ '--', '::'],
|
||||||
\ a:line[i : i + 1]) != -1
|
\ a:line[i : i + 1]) != -1
|
||||||
call add(indtokens, [a:line[i : i + 1], vcol, i])
|
call add(indtokens, [a:line[i : i + 1], vcol, i])
|
||||||
let next_i = i + 2
|
let next_i = i + 2
|
||||||
@@ -564,8 +564,8 @@ function! s:IsCatchStandalone(lnum, i)
|
|||||||
let is_standalone = 0
|
let is_standalone = 0
|
||||||
elseif prev_token =~# '[a-z]'
|
elseif prev_token =~# '[a-z]'
|
||||||
if index(['after', 'and', 'andalso', 'band', 'begin', 'bnot', 'bor', 'bsl',
|
if index(['after', 'and', 'andalso', 'band', 'begin', 'bnot', 'bor', 'bsl',
|
||||||
\ 'bsr', 'bxor', 'case', 'catch', 'div', 'not', 'or', 'orelse',
|
\ 'bsr', 'bxor', 'case', 'catch', 'div', 'maybe', 'not', 'or',
|
||||||
\ 'rem', 'try', 'xor'], prev_token) != -1
|
\ 'orelse', 'rem', 'try', 'xor'], prev_token) != -1
|
||||||
" If catch is after these keywords, it is standalone
|
" If catch is after these keywords, it is standalone
|
||||||
let is_standalone = 1
|
let is_standalone = 1
|
||||||
else
|
else
|
||||||
@@ -574,7 +574,7 @@ function! s:IsCatchStandalone(lnum, i)
|
|||||||
"
|
"
|
||||||
" Keywords:
|
" Keywords:
|
||||||
" - may precede 'catch': end
|
" - 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
|
" - unused: cond let query
|
||||||
let is_standalone = 0
|
let is_standalone = 0
|
||||||
endif
|
endif
|
||||||
@@ -583,7 +583,7 @@ function! s:IsCatchStandalone(lnum, i)
|
|||||||
let is_standalone = 0
|
let is_standalone = 0
|
||||||
else
|
else
|
||||||
" This 'else' branch includes the following tokens:
|
" This 'else' branch includes the following tokens:
|
||||||
" -> == /= =< < >= > =:= =/= + - * / ++ -- :: < > ; ( [ { ? = ! . |
|
" -> == /= =< < >= > ?= =:= =/= + - * / ++ -- :: < > ; ( [ { ? = ! . |
|
||||||
let is_standalone = 1
|
let is_standalone = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -596,6 +596,7 @@ endfunction
|
|||||||
" Purpose:
|
" Purpose:
|
||||||
" This function is called when a begin-type element ('begin', 'case',
|
" This function is called when a begin-type element ('begin', 'case',
|
||||||
" '[', '<<', etc.) is found. It asks the caller to return if the stack
|
" '[', '<<', etc.) is found. It asks the caller to return if the stack
|
||||||
|
" if already empty.
|
||||||
" Parameters:
|
" Parameters:
|
||||||
" stack: [token]
|
" stack: [token]
|
||||||
" token: string
|
" token: string
|
||||||
@@ -764,7 +765,7 @@ endfunction
|
|||||||
function! s:SearchEndPair(lnum, curr_col)
|
function! s:SearchEndPair(lnum, curr_col)
|
||||||
return s:SearchPair(
|
return s:SearchPair(
|
||||||
\ a:lnum, a:curr_col,
|
\ a:lnum, a:curr_col,
|
||||||
\ '\C\<\%(case\|try\|begin\|receive\|if\)\>\|' .
|
\ '\C\<\%(case\|try\|begin\|receive\|if\|maybe\)\>\|' .
|
||||||
\ '\<fun\>\%(\s\|\n\|%.*$\|[A-Z_@][a-zA-Z_@]*\)*(',
|
\ '\<fun\>\%(\s\|\n\|%.*$\|[A-Z_@][a-zA-Z_@]*\)*(',
|
||||||
\ '',
|
\ '',
|
||||||
\ '\<end\>')
|
\ '\<end\>')
|
||||||
@@ -853,6 +854,7 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
|||||||
if ret | return res | endif
|
if ret | return res | endif
|
||||||
|
|
||||||
" case EXPR of BRANCHES end
|
" case EXPR of BRANCHES end
|
||||||
|
" if BRANCHES end
|
||||||
" try EXPR catch BRANCHES end
|
" try EXPR catch BRANCHES end
|
||||||
" try EXPR after BODY end
|
" try EXPR after BODY end
|
||||||
" try EXPR catch BRANCHES 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
|
" try EXPR of BRANCHES catch BRANCHES after BODY end
|
||||||
" receive BRANCHES end
|
" receive BRANCHES end
|
||||||
" receive BRANCHES after BRANCHES end
|
" receive BRANCHES after BRANCHES end
|
||||||
|
" maybe EXPR end
|
||||||
|
" maybe EXPR else BRANCHES end
|
||||||
|
|
||||||
" This branch is not Emacs-compatible
|
" 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))) &&
|
\ (token ==# 'catch' && !s:IsCatchStandalone(lnum, i))) &&
|
||||||
\ !last_token_of_line &&
|
\ !last_token_of_line &&
|
||||||
\ (empty(stack) || stack ==# ['when'] || stack ==# ['->'] ||
|
\ (empty(stack) || stack ==# ['when'] || stack ==# ['->'] ||
|
||||||
\ 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:
|
" tokens of the line, we want to indent like this:
|
||||||
"
|
"
|
||||||
" % stack == []
|
" % stack == []
|
||||||
@@ -895,21 +899,21 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
|||||||
" stack = ['when'] => LTI is a guard
|
" stack = ['when'] => LTI is a guard
|
||||||
if empty(stack) || stack == ['->', ';']
|
if empty(stack) || stack == ['->', ';']
|
||||||
call s:Log(' LTI is in a condition after ' .
|
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
|
return stored_vcol
|
||||||
elseif stack == ['->']
|
elseif stack == ['->']
|
||||||
call s:Log(' LTI is in a branch after ' .
|
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()
|
return stored_vcol + shiftwidth()
|
||||||
elseif stack == ['when']
|
elseif stack == ['when']
|
||||||
call s:Log(' LTI is in a guard after ' .
|
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()
|
return stored_vcol + shiftwidth()
|
||||||
else
|
else
|
||||||
return s:UnexpectedToken(token, stack)
|
return s:UnexpectedToken(token, stack)
|
||||||
endif
|
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 condition
|
||||||
" stack = ['->'] => LTI is a branch
|
" stack = ['->'] => LTI is a branch
|
||||||
@@ -919,45 +923,47 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
|||||||
" pass
|
" pass
|
||||||
elseif (token ==# 'case' && stack[0] ==# 'of') ||
|
elseif (token ==# 'case' && stack[0] ==# 'of') ||
|
||||||
\ (token ==# 'if') ||
|
\ (token ==# 'if') ||
|
||||||
|
\ (token ==# 'maybe' && stack[0] ==# 'else') ||
|
||||||
\ (token ==# 'try' && (stack[0] ==# 'of' ||
|
\ (token ==# 'try' && (stack[0] ==# 'of' ||
|
||||||
\ stack[0] ==# 'catch' ||
|
\ stack[0] ==# 'catch' ||
|
||||||
\ stack[0] ==# 'after')) ||
|
\ stack[0] ==# 'after')) ||
|
||||||
\ (token ==# 'receive')
|
\ (token ==# 'receive')
|
||||||
|
|
||||||
" From the indentation point of view, the keyword
|
" 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
|
" 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),
|
" This way when we reach case/try/receive/maybe (i.e. now),
|
||||||
" there is at most one of/catch/after/end token in the
|
" there is at most one of/catch/after/else/end token in the
|
||||||
" stack.
|
" stack.
|
||||||
if token ==# 'case' || token ==# 'try' ||
|
if token ==# 'case' || token ==# 'try' ||
|
||||||
\ (token ==# 'receive' && stack[0] ==# 'after')
|
\ (token ==# 'receive' && stack[0] ==# 'after') ||
|
||||||
|
\ (token ==# 'maybe' && stack[0] ==# 'else')
|
||||||
call s:Pop(stack)
|
call s:Pop(stack)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if empty(stack)
|
if empty(stack)
|
||||||
call s:Log(' LTI is in a condition; matching ' .
|
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()
|
let stored_vcol = curr_vcol + shiftwidth()
|
||||||
elseif stack[0] ==# 'align_to_begin_element'
|
elseif stack[0] ==# 'align_to_begin_element'
|
||||||
call s:Pop(stack)
|
call s:Pop(stack)
|
||||||
let stored_vcol = curr_vcol
|
let stored_vcol = curr_vcol
|
||||||
elseif len(stack) > 1 && stack[0] ==# '->' && stack[1] ==# ';'
|
elseif len(stack) > 1 && stack[0] ==# '->' && stack[1] ==# ';'
|
||||||
call s:Log(' LTI is in a condition; matching ' .
|
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)
|
||||||
call s:Pop(stack)
|
call s:Pop(stack)
|
||||||
let stored_vcol = curr_vcol + shiftwidth()
|
let stored_vcol = curr_vcol + shiftwidth()
|
||||||
elseif stack[0] ==# '->'
|
elseif stack[0] ==# '->'
|
||||||
call s:Log(' LTI is in a branch; matching ' .
|
call s:Log(' LTI is in a branch; 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 + 2 * shiftwidth()
|
let stored_vcol = curr_vcol + 2 * shiftwidth()
|
||||||
elseif stack[0] ==# 'when'
|
elseif stack[0] ==# 'when'
|
||||||
call s:Log(' LTI is in a guard; matching ' .
|
call s:Log(' LTI is in a guard; 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 + 2 * shiftwidth() + 2
|
let stored_vcol = curr_vcol + 2 * shiftwidth() + 2
|
||||||
endif
|
endif
|
||||||
@@ -1219,7 +1225,7 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
|||||||
|
|
||||||
if empty(stack)
|
if empty(stack)
|
||||||
call s:Push(stack, ';')
|
call s:Push(stack, ';')
|
||||||
elseif index([';', '->', 'when', 'end', 'after', 'catch'],
|
elseif index([';', '->', 'when', 'end', 'after', 'catch', 'else'],
|
||||||
\stack[0]) != -1
|
\stack[0]) != -1
|
||||||
" Pass:
|
" Pass:
|
||||||
"
|
"
|
||||||
@@ -1229,10 +1235,10 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
|||||||
" should keep that, because they signify the type of the
|
" should keep that, because they signify the type of the
|
||||||
" LTI (branch, condition or guard).
|
" LTI (branch, condition or guard).
|
||||||
" - From the indentation point of view, the keyword
|
" - 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
|
||||||
" if the stack already has a catch/after/end, we don't
|
" if the stack already has a catch/after/else/end, we don't
|
||||||
" modify it. This way when we reach case/try/receive,
|
" modify it. This way when we reach case/try/receive/maybe,
|
||||||
" there will be at most one of/catch/after/end token in
|
" there will be at most one of/catch/after/else/end token in
|
||||||
" the stack.
|
" the stack.
|
||||||
else
|
else
|
||||||
return s:UnexpectedToken(token, stack)
|
return s:UnexpectedToken(token, stack)
|
||||||
@@ -1248,7 +1254,8 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
|||||||
" stack = ['->'] -> LTI is a condition
|
" stack = ['->'] -> LTI is a condition
|
||||||
" stack = ['->', ';'] -> LTI is a branch
|
" stack = ['->', ';'] -> LTI is a branch
|
||||||
call s:Push(stack, '->')
|
call s:Push(stack, '->')
|
||||||
elseif index(['->', 'when', 'end', 'after', 'catch'], stack[0]) != -1
|
elseif index(['->', 'when', 'end', 'after', 'catch', 'else'],
|
||||||
|
\stack[0]) != -1
|
||||||
" Pass:
|
" Pass:
|
||||||
"
|
"
|
||||||
" - If the stack top is another '->', then one '->' is
|
" - 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
|
" - If the stack top is a 'when', then we should keep
|
||||||
" that, because this signifies that LTI is a in a guard.
|
" that, because this signifies that LTI is a in a guard.
|
||||||
" - From the indentation point of view, the keyword
|
" - 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
|
||||||
" if the stack already has a catch/after/end, we don't
|
" if the stack already has a catch/after/else/end, we don't
|
||||||
" modify it. This way when we reach case/try/receive,
|
" modify it. This way when we reach case/try/receive/maybe,
|
||||||
" there will be at most one of/catch/after/end token in
|
" there will be at most one of/catch/after/else/end token in
|
||||||
" the stack.
|
" the stack.
|
||||||
else
|
else
|
||||||
return s:UnexpectedToken(token, stack)
|
return s:UnexpectedToken(token, stack)
|
||||||
@@ -1289,7 +1296,8 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
|||||||
" LTI
|
" LTI
|
||||||
call s:Push(stack, token)
|
call s:Push(stack, token)
|
||||||
endif
|
endif
|
||||||
elseif index(['->', 'when', 'end', 'after', 'catch'], stack[0]) != -1
|
elseif index(['->', 'when', 'end', 'after', 'catch', 'else'],
|
||||||
|
\stack[0]) != -1
|
||||||
" Pass:
|
" Pass:
|
||||||
" - If the stack top is another 'when', then one 'when' is
|
" - If the stack top is another 'when', then one 'when' is
|
||||||
" enough.
|
" enough.
|
||||||
@@ -1297,21 +1305,63 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
|||||||
" should keep that, because they signify the type of the
|
" should keep that, because they signify the type of the
|
||||||
" LTI (branch, condition or guard).
|
" LTI (branch, condition or guard).
|
||||||
" - From the indentation point of view, the keyword
|
" - 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
|
||||||
" if the stack already has a catch/after/end, we don't
|
" if the stack already has a catch/after/else/end, we don't
|
||||||
" modify it. This way when we reach case/try/receive,
|
" modify it. This way when we reach case/try/receive/maybe,
|
||||||
" there will be at most one of/catch/after/end token in
|
" there will be at most one of/catch/after/else/end token in
|
||||||
" the stack.
|
" the stack.
|
||||||
else
|
else
|
||||||
return s:UnexpectedToken(token, stack)
|
return s:UnexpectedToken(token, stack)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
elseif token ==# 'of' || token ==# 'after' ||
|
elseif token ==# 'of' || token ==# 'after' || token ==# 'else' ||
|
||||||
\ (token ==# 'catch' && !s:IsCatchStandalone(lnum, i))
|
\ (token ==# 'catch' && !s:IsCatchStandalone(lnum, i))
|
||||||
|
|
||||||
if token ==# 'after'
|
if token ==# 'after' || token ==# 'else'
|
||||||
" If LTI is between an 'after' and the corresponding
|
" If LTI is between an after/else and the corresponding 'end', then
|
||||||
" 'end', then let's return
|
" 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,
|
let [ret, res] = s:BeginElementFoundIfEmpty(stack, token, curr_vcol,
|
||||||
\stored_vcol, shiftwidth())
|
\stored_vcol, shiftwidth())
|
||||||
if ret | return res | endif
|
if ret | return res | endif
|
||||||
@@ -1319,7 +1369,8 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
|||||||
|
|
||||||
if empty(stack) || stack[0] ==# '->' || stack[0] ==# 'when'
|
if empty(stack) || stack[0] ==# '->' || stack[0] ==# 'when'
|
||||||
call s:Push(stack, token)
|
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
|
" Pass: From the indentation point of view, the keyword
|
||||||
" (of/catch/after/end) before the LTI is what counts, so
|
" (of/catch/after/end) before the LTI is what counts, so
|
||||||
" if the stack already has a catch/after/end, we don't
|
" if the stack already has a catch/after/end, we don't
|
||||||
@@ -1409,7 +1460,7 @@ function! ErlangIndent()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let ml = matchlist(currline,
|
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 the line has a special beginning, but not a standalone catch
|
||||||
if !empty(ml) && !(ml[2] ==# 'catch' && s:IsCatchStandalone(v:lnum, 0))
|
if !empty(ml) && !(ml[2] ==# 'catch' && s:IsCatchStandalone(v:lnum, 0))
|
||||||
|
|||||||
@@ -1,204 +0,0 @@
|
|||||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'gdscript', 'indent/gdscript3.vim')
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Vim indent file
|
|
||||||
" Language: Python
|
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
|
||||||
" Original Author: David Bustos <bustos@caltech.edu>
|
|
||||||
" 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
|
|
||||||
@@ -11,5 +11,6 @@ endif
|
|||||||
|
|
||||||
setlocal autoindent cindent
|
setlocal autoindent cindent
|
||||||
setlocal formatoptions+=roq
|
setlocal formatoptions+=roq
|
||||||
|
setlocal cinoptions&
|
||||||
|
|
||||||
" vim:set sts=2 sw=2 :
|
" vim:set sts=2 sw=2 :
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ endif
|
|||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: Haml
|
" Language: Haml
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2017 Jun 13
|
" Last Change: 2022 Mar 15
|
||||||
|
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ let s:ruby_indent_keywords =
|
|||||||
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>'
|
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>'
|
||||||
|
|
||||||
" Def without an end clause: def method_call(...) = <expression>
|
" Def without an end clause: def method_call(...) = <expression>
|
||||||
let s:ruby_endless_def = '\<def\s\+\k\+[!?]\=\%((.*)\|\s\)\s*='
|
let s:ruby_endless_def = '\<def\s\+\%(\k\+\.\)\=\k\+[!?]\=\%((.*)\|\s\)\s*='
|
||||||
|
|
||||||
" Regex used for words that, at the start of a line, remove a level of indent.
|
" Regex used for words that, at the start of a line, remove a level of indent.
|
||||||
let s:ruby_deindent_keywords =
|
let s:ruby_deindent_keywords =
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ setlocal cinkeys=0{,0},0),0],!^F,o,O
|
|||||||
|
|
||||||
setlocal indentexpr=GetZigIndent(v:lnum)
|
setlocal indentexpr=GetZigIndent(v:lnum)
|
||||||
|
|
||||||
|
let b:undo_indent = "setlocal cindent< cinkeys< cinoptions< indentexpr<"
|
||||||
|
|
||||||
function! GetZigIndent(lnum)
|
function! GetZigIndent(lnum)
|
||||||
let curretLineNum = a:lnum
|
let curretLineNum = a:lnum
|
||||||
let currentLine = getline(a:lnum)
|
let currentLine = getline(a:lnum)
|
||||||
|
|||||||
@@ -606,15 +606,6 @@ filetypes:
|
|||||||
- name: fsharp
|
- name: fsharp
|
||||||
linguist: F#
|
linguist: F#
|
||||||
---
|
---
|
||||||
name: gdscript
|
|
||||||
remote: calviken/vim-gdscript3
|
|
||||||
dirs:
|
|
||||||
- syntax
|
|
||||||
- indent
|
|
||||||
filetypes:
|
|
||||||
- name: gdscript3
|
|
||||||
linguist: GDScript
|
|
||||||
---
|
|
||||||
name: git
|
name: git
|
||||||
remote: tpope/vim-git
|
remote: tpope/vim-git
|
||||||
filetypes:
|
filetypes:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ endif
|
|||||||
"Import
|
"Import
|
||||||
syntax keyword typescriptImport from as
|
syntax keyword typescriptImport from as
|
||||||
syntax keyword typescriptImport import
|
syntax keyword typescriptImport import
|
||||||
\ nextgroup=typescriptImportType
|
\ nextgroup=typescriptImportType,typescriptTypeBlock,typescriptDefaultImportName
|
||||||
\ skipwhite
|
\ skipwhite
|
||||||
syntax keyword typescriptImportType type
|
syntax keyword typescriptImportType type
|
||||||
\ contained
|
\ contained
|
||||||
@@ -17,11 +17,10 @@ syntax match typescriptExportType /\<type\s*{\@=/
|
|||||||
syntax keyword typescriptModule namespace module
|
syntax keyword typescriptModule namespace module
|
||||||
|
|
||||||
|
|
||||||
syntax keyword typescriptCastKeyword as
|
syntax keyword typescriptCastKeyword as satisfies
|
||||||
\ nextgroup=@typescriptType
|
\ nextgroup=@typescriptType
|
||||||
\ skipwhite
|
\ skipwhite
|
||||||
|
|
||||||
|
|
||||||
syntax keyword typescriptVariable let var
|
syntax keyword typescriptVariable let var
|
||||||
\ nextgroup=@typescriptVariableDeclarations
|
\ nextgroup=@typescriptVariableDeclarations
|
||||||
\ skipwhite skipempty
|
\ skipwhite skipempty
|
||||||
@@ -90,6 +89,17 @@ syntax cluster typescriptAmbients contains=
|
|||||||
\ typescriptModule
|
\ typescriptModule
|
||||||
|
|
||||||
syntax keyword typescriptIdentifier arguments nextgroup=@afterIdentifier
|
syntax keyword typescriptIdentifier arguments nextgroup=@afterIdentifier
|
||||||
|
syntax match typescriptDefaultImportName /\v\h\k*( |,)/
|
||||||
|
\ contained
|
||||||
|
\ nextgroup=typescriptTypeBlock
|
||||||
|
\ skipwhite skipempty
|
||||||
|
|
||||||
|
syntax region typescriptTypeBlock
|
||||||
|
\ matchgroup=typescriptBraces
|
||||||
|
\ start=/{/ end=/}/
|
||||||
|
\ contained
|
||||||
|
\ contains=typescriptIdentifierName,typescriptImportType
|
||||||
|
\ fold
|
||||||
|
|
||||||
"Program Keywords
|
"Program Keywords
|
||||||
exec 'syntax keyword typescriptNull null '.(exists('g:typescript_conceal_null') ? 'conceal cchar='.g:typescript_conceal_null : '').' nextgroup=@typescriptSymbols skipwhite skipempty'
|
exec 'syntax keyword typescriptNull null '.(exists('g:typescript_conceal_null') ? 'conceal cchar='.g:typescript_conceal_null : '').' nextgroup=@typescriptSymbols skipwhite skipempty'
|
||||||
|
|||||||
@@ -22,9 +22,20 @@ syntax region typescriptString
|
|||||||
|
|
||||||
syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{1,6}})|c\u|.)"
|
syntax match typescriptSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{1,6}})|c\u|.)"
|
||||||
|
|
||||||
" From vim runtime
|
" From pangloss/vim-javascript
|
||||||
" <https://github.com/vim/vim/blob/master/runtime/syntax/javascript.vim#L48>
|
" <https://github.com/pangloss/vim-javascript/blob/d6e137563c47fb59f26ed25d044c0c7532304f18/syntax/javascript.vim#L64-L72>
|
||||||
syntax region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gimsuy]\{0,5\}\s*$+ end=+/[gimsuy]\{0,5\}\s*[;.,)\]}:]+me=e-1 nextgroup=typescriptDotNotation oneline
|
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=+\%(\%(\<return\|\<typeof\|\_[^)\]'"[:blank:][:alnum:]_$]\)\s*\)\@<=/\ze[^*/]+ skip=+\\.\|\[[^]]\{1,}\]+ end=+/[gimyus]\{,6}+
|
||||||
|
\ contains=typescriptRegexpCharClass,typescriptRegexpGroup,@typescriptRegexpSpecial
|
||||||
|
\ oneline keepend extend
|
||||||
|
syntax cluster typescriptRegexpSpecial contains=typescriptSpecial,typescriptRegexpBoundary,typescriptRegexpBackRef,typescriptRegexpQuantifier,typescriptRegexpOr,typescriptRegexpMod
|
||||||
|
|
||||||
syntax region typescriptTemplate
|
syntax region typescriptTemplate
|
||||||
\ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/
|
\ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/
|
||||||
|
|||||||
@@ -3,31 +3,50 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'caddyfile', 'syntax/caddyfile
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Language: Caddyfile
|
" Language: Caddyfile
|
||||||
" Author: Josh Glendenning <josh@isobit.io>
|
" Maintainer: 0az <0az@afzhou.com>
|
||||||
|
" Original Author: Josh Glendenning <josh@isobit.io>
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn match caddyDirective "^\s*\([a-zA-Z0-9_]\+\)" nextgroup=caddyDirectiveArgs skipwhite
|
syn match caddyDirective "\v^\s*(\w\S*)" nextgroup=caddyDirectiveArgs skipwhite
|
||||||
syn region caddyDirectiveArgs start="" end="\({\|#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString nextgroup=caddyDirectiveBlock 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
|
syn region caddyDirectiveBlock start="{" skip="\\}" end="}" contained contains=caddySubdirective,caddyComment,caddyImport
|
||||||
|
|
||||||
syn match caddySubdirective "^\s*\([a-zA-Z0-9_]\+\)" contained nextgroup=caddySubdirectiveArgs skipwhite
|
syn match caddySubdirective "\v^\s*(\w\S*)" contained nextgroup=caddySubdirectiveArgs skipwhite
|
||||||
syn region caddySubdirectiveArgs start="" end="\(#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString
|
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
|
" Needs priority over Directive
|
||||||
syn region caddyHostBlock start="{" skip="\\}" end="}" contained contains=caddyDirective,caddyComment
|
syn match caddyImport "\v^\s*<import>" 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 caddyPlaceholder start="{" skip="\\}" end="}" oneline contained
|
||||||
syn region caddyString start='"' skip='\\\\\|\\"' end='"' oneline
|
syn region caddyString start='"' skip='\\\\\|\\"' end='"' oneline
|
||||||
syn match caddyComment "#.*$"
|
syn region caddyComment start="#" end="$" oneline
|
||||||
|
|
||||||
hi link caddyDirective Keyword
|
hi link caddyDirective Keyword
|
||||||
hi link caddySubdirective Structure
|
hi link caddySubdirective Structure
|
||||||
hi link caddyHost Identifier
|
hi link caddyHost Identifier
|
||||||
|
hi link caddyImport PreProc
|
||||||
|
hi link caddySnippetDef PreProc
|
||||||
|
hi link caddySnippet Identifier
|
||||||
hi link caddyPlaceholder Special
|
hi link caddyPlaceholder Special
|
||||||
hi link caddyString String
|
hi link caddyString String
|
||||||
hi link caddyComment Comment
|
hi link caddyComment Comment
|
||||||
|
hi link caddyNamedMatcherDef caddyNamedMatcher
|
||||||
|
hi link caddyNamedMatcher Identifier
|
||||||
|
|
||||||
let b:current_syntax = "caddyfile"
|
let b:current_syntax = "caddyfile"
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ endif
|
|||||||
|
|
||||||
" -*- KEYWORDS -*-
|
" -*- KEYWORDS -*-
|
||||||
" Generated from https://github.com/clojure-vim/clojure.vim/blob/%%RELEASE_TAG%%/clj/src/vim_clojure_static/generate.clj
|
" 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 = {
|
let s:clojure_syntax_keywords = {
|
||||||
\ 'clojureBoolean': ["false","true"],
|
\ '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"],
|
\ '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 -*-
|
" -*- CHARACTER PROPERTY CLASSES -*-
|
||||||
" Generated from https://github.com/clojure-vim/clojure.vim/blob/%%RELEASE_TAG%%/clj/src/vim_clojure_static/generate.clj
|
" 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 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 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
|
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
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ endif
|
|||||||
" Language: Erlang (http://www.erlang.org)
|
" Language: Erlang (http://www.erlang.org)
|
||||||
" Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
|
" Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
|
||||||
" Contributor: Adam Rutkowski <hq@mtod.org>
|
" Contributor: Adam Rutkowski <hq@mtod.org>
|
||||||
" Last Update: 2020-May-26
|
" Last Update: 2022-Sep-06
|
||||||
" License: Vim license
|
" License: Vim license
|
||||||
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
" 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\+}\|\^.\|.\)\)'
|
syn match erlangModifier '\$\%([^\\]\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\)'
|
||||||
|
|
||||||
" Operators, separators
|
" 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 keyword erlangOperator div rem or xor bor bxor bsl bsr and band not bnot andalso orelse
|
||||||
syn match erlangBracket '{\|}\|\[\|]\||\|||'
|
syn match erlangBracket '{\|}\|\[\|]\||\|||'
|
||||||
syn match erlangPipe '|'
|
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
|
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
|
" 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 '??\=[[:alnum:]_@]\+'
|
||||||
syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+'
|
syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+'
|
||||||
syn region erlangQuotedMacro start=/??\=\s*'/ end=/'/ contains=erlangQuotedAtomModifier
|
syn region erlangQuotedMacro start=/??\=\s*'/ end=/'/ contains=erlangQuotedAtomModifier
|
||||||
@@ -96,7 +98,7 @@ syn match erlangBitType '\%(\/\%(\s\|\n\|%.*\n\)*\)\@<=\%(integer\|float\|binary
|
|||||||
|
|
||||||
" Constants and Directives
|
" Constants and Directives
|
||||||
syn match erlangUnknownAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\l[[:alnum:]_@]*' contains=erlangComment
|
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 erlangInclude '^\s*-\%(\s\|\n\|%.*\n\)*\%(include\|include_lib\)\>' contains=erlangComment
|
||||||
syn match erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment
|
syn match erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment
|
||||||
syn match erlangDefine '^\s*-\%(\s\|\n\|%.*\n\)*\%(define\|undef\)\>' 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
|
syn match erlangType '^\s*-\%(\s\|\n\|%.*\n\)*\%(spec\|type\|opaque\|callback\)\>' contains=erlangComment
|
||||||
|
|
||||||
" Keywords
|
" Keywords
|
||||||
syn keyword erlangKeyword after begin case catch cond end fun if let of
|
syn keyword erlangKeyword after begin case catch cond end fun if let of else
|
||||||
syn keyword erlangKeyword receive when try
|
syn keyword erlangKeyword receive when try maybe
|
||||||
|
|
||||||
" Build-in-functions (BIFs)
|
" Build-in-functions (BIFs)
|
||||||
syn keyword erlangBIF abs alive apply atom_to_binary atom_to_list contained
|
syn keyword erlangBIF abs alive apply atom_to_binary atom_to_list contained
|
||||||
@@ -178,6 +180,7 @@ hi def link erlangModifier Special
|
|||||||
|
|
||||||
" Operators, separators
|
" Operators, separators
|
||||||
hi def link erlangOperator Operator
|
hi def link erlangOperator Operator
|
||||||
|
hi def link erlangEqualsBinary ErrorMsg
|
||||||
hi def link erlangRightArrow Operator
|
hi def link erlangRightArrow Operator
|
||||||
if s:old_style
|
if s:old_style
|
||||||
hi def link erlangBracket Normal
|
hi def link erlangBracket Normal
|
||||||
@@ -195,6 +198,7 @@ hi def link erlangLocalFuncRef Normal
|
|||||||
hi def link erlangGlobalFuncCall Function
|
hi def link erlangGlobalFuncCall Function
|
||||||
hi def link erlangGlobalFuncRef Function
|
hi def link erlangGlobalFuncRef Function
|
||||||
hi def link erlangVariable Normal
|
hi def link erlangVariable Normal
|
||||||
|
hi def link erlangAnonymousVariable erlangVariable
|
||||||
hi def link erlangMacro Normal
|
hi def link erlangMacro Normal
|
||||||
hi def link erlangQuotedMacro Normal
|
hi def link erlangQuotedMacro Normal
|
||||||
hi def link erlangRecord Normal
|
hi def link erlangRecord Normal
|
||||||
@@ -207,6 +211,7 @@ hi def link erlangLocalFuncRef Normal
|
|||||||
hi def link erlangGlobalFuncCall Normal
|
hi def link erlangGlobalFuncCall Normal
|
||||||
hi def link erlangGlobalFuncRef Normal
|
hi def link erlangGlobalFuncRef Normal
|
||||||
hi def link erlangVariable Identifier
|
hi def link erlangVariable Identifier
|
||||||
|
hi def link erlangAnonymousVariable erlangVariable
|
||||||
hi def link erlangMacro Macro
|
hi def link erlangMacro Macro
|
||||||
hi def link erlangQuotedMacro Macro
|
hi def link erlangQuotedMacro Macro
|
||||||
hi def link erlangRecord Structure
|
hi def link erlangRecord Structure
|
||||||
|
|||||||
@@ -1,101 +0,0 @@
|
|||||||
if polyglot#init#is_disabled(expand('<sfile>: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(<signal>\s+)@<=<\w+>"
|
|
||||||
syn match gdSetGet "\v(<setget>\s+)@<=<\w+>"
|
|
||||||
syn match gdSetGet "\v(<setget>\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
|
|
||||||
@@ -5,7 +5,7 @@ endif
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: generic git output
|
" Language: generic git output
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2019 Dec 05
|
" Last Change: 2022 Jan 05
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
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=/^\%(diff --git \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff fold
|
||||||
syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --\%(git\|cc\|combined\) \|$\)\@=/ contains=@gitDiff
|
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 region gitDiffMerge start=/^\%(@@@@* -\)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
|
||||||
syn match gitDiffAdded "^ \++.*" contained containedin=gitDiffMerge
|
syn match gitDiffAdded "^ \++.*" contained containedin=gitDiffMerge
|
||||||
syn match gitDiffAdded "{+[^}]*+}" contained containedin=gitDiff
|
syn match gitDiffAdded "{+[^}]*+}" contained containedin=gitDiff
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ endif
|
|||||||
" Language: git commit file
|
" Language: git commit file
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Filenames: *.git/COMMIT_EDITMSG
|
" Filenames: *.git/COMMIT_EDITMSG
|
||||||
" Last Change: 2019 Dec 05
|
" Last Change: 2022 Jan 05
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ endif
|
|||||||
" Language: git rebase --interactive
|
" Language: git rebase --interactive
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Filenames: git-rebase-todo
|
" Filenames: git-rebase-todo
|
||||||
" Last Change: 2019 Dec 06
|
" Last Change: 2022 Jan 05
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
|
|||||||
@@ -169,14 +169,10 @@ endif
|
|||||||
syn match goSingleDecl /\%(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst
|
syn match goSingleDecl /\%(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst
|
||||||
|
|
||||||
" Integers
|
" Integers
|
||||||
syn match goDecimalInt "\<-\=\(0\|[1-9]_\?\(\d\|\d\+_\?\d\+\)*\)\%([Ee][-+]\=\d\+\)\=\>"
|
syn match goDecimalInt "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)\>"
|
||||||
"syn match goDecimalError "\<-\=\(_\(\d\+_*\)\+\|\([1-9]\d*_*\)\+__\(\d\+_*\)\+\|\([1-9]\d*_*\)\+_\+\)\%([Ee][-+]\=\d\+\)\=\>"
|
syn match goHexadecimalInt "\<-\=0[xX]_\?\%(\x\|\x_\x\)\+\>"
|
||||||
syn match goHexadecimalInt "\<-\=0[xX]_\?\(\x\+_\?\)\+\>"
|
syn match goOctalInt "\<-\=0[oO]\?_\?\%(\o\|\o_\o\)\+\>"
|
||||||
"syn match goHexadecimalError "\<-\=0[xX]_\?\(\x\+_\?\)*\(\([^-+%&|^*/ \t0-9A-Fa-f_)]\|__\)\S*\|_\)\>"
|
syn match goBinaryInt "\<-\=0[bB]_\?\%([01]\|[01]_[01]\)\+\>"
|
||||||
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*\|_\)\>"
|
|
||||||
|
|
||||||
hi def link goDecimalInt Integer
|
hi def link goDecimalInt Integer
|
||||||
hi def link goDecimalError Error
|
hi def link goDecimalError Error
|
||||||
@@ -189,19 +185,55 @@ hi def link goBinaryError Error
|
|||||||
hi def link Integer Number
|
hi def link Integer Number
|
||||||
|
|
||||||
" Floating point
|
" Floating point
|
||||||
syn match goFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=\>"
|
"float_lit = decimal_float_lit | hex_float_lit .
|
||||||
syn match goFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=\>"
|
"
|
||||||
|
"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 goFloat Float
|
||||||
|
hi def link goHexadecimalFloat Float
|
||||||
|
|
||||||
" Imaginary literals
|
" Imaginary literals
|
||||||
syn match goImaginary "\<-\=\d\+i\>"
|
syn match goImaginaryDecimal "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)i\>"
|
||||||
syn match goImaginary "\<-\=\d\+[Ee][-+]\=\d\+i\>"
|
syn match goImaginaryHexadecimal "\<-\=0[xX]_\?\%(\x\|\x_\x\)\+i\>"
|
||||||
syn match goImaginaryFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=i\>"
|
syn match goImaginaryOctal "\<-\=0[oO]\?_\?\%(\o\|\o_\o\)\+i\>"
|
||||||
syn match goImaginaryFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=i\>"
|
syn match goImaginaryBinary "\<-\=0[bB]_\?\%([01]\|[01]_[01]\)\+i\>"
|
||||||
|
|
||||||
hi def link goImaginary Number
|
" 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 goImaginaryFloat Float
|
||||||
|
hi def link goImaginaryHexadecimalFloat Float
|
||||||
|
|
||||||
" Spaces after "[]"
|
" Spaces after "[]"
|
||||||
if go#config#HighlightArrayWhitespaceError()
|
if go#config#HighlightArrayWhitespaceError()
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
if polyglot#init#is_disabled(expand('<sfile>: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
|
|
||||||
@@ -6,7 +6,7 @@ endif
|
|||||||
" Language: Haml
|
" Language: Haml
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Filenames: *.haml
|
" Filenames: *.haml
|
||||||
" Last Change: 2018 Aug 21
|
" Last Change: 2019 Dec 05
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ endif
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: Vim help file
|
" Language: Vim help file
|
||||||
" Maintainer: Bram Moolenaar (Bram@vim.org)
|
" 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
|
" Quit when a (custom) syntax file was already loaded
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
@@ -43,6 +43,7 @@ syn match helpVim "VIM REFERENCE.*"
|
|||||||
syn match helpVim "NVIM REFERENCE.*"
|
syn match helpVim "NVIM REFERENCE.*"
|
||||||
syn match helpOption "'[a-z]\{2,\}'"
|
syn match helpOption "'[a-z]\{2,\}'"
|
||||||
syn match helpOption "'t_..'"
|
syn match helpOption "'t_..'"
|
||||||
|
syn match helpNormal "'ab'"
|
||||||
syn match helpCommand "`[^` \t]\+`"hs=s+1,he=e-1 contains=helpBacktick
|
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 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
|
syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore
|
||||||
|
|||||||
@@ -28,16 +28,18 @@ syntax sync fromstart
|
|||||||
" syntax case ignore
|
" syntax case ignore
|
||||||
syntax case match
|
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 jsDot /\./ skipwhite skipempty nextgroup=jsObjectProp,jsFuncCall,jsPrototype,jsTaggedTemplate
|
||||||
syntax match jsObjectProp contained /\<\K\k*/
|
syntax match jsObjectProp contained /\<\K\k*/
|
||||||
syntax match jsFuncCall /\<\K\k*\ze\s*(/
|
syntax match jsFuncCall /\<\K\k*\ze[\s\n]*(/
|
||||||
syntax match jsParensError /[)}\]]/
|
syntax match jsParensError /[)}\]]/
|
||||||
|
|
||||||
" Program Keywords
|
" Program Keywords
|
||||||
syntax keyword jsStorageClass const var let skipwhite skipempty nextgroup=jsDestructuringBlock,jsDestructuringArray,jsVariableDef
|
syntax keyword jsStorageClass const var let skipwhite skipempty nextgroup=jsDestructuringBlock,jsDestructuringArray,jsVariableDef
|
||||||
syntax match jsVariableDef contained /\<\K\k*/ skipwhite skipempty nextgroup=jsFlowDefinition
|
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 match jsOperator /::/ skipwhite skipempty nextgroup=@jsExpression
|
syntax match jsOperator /::/ skipwhite skipempty nextgroup=@jsExpression
|
||||||
syntax keyword jsBooleanTrue true
|
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 if skipwhite skipempty nextgroup=jsParenIfElse
|
||||||
syntax keyword jsConditional else skipwhite skipempty nextgroup=jsCommentIfElse,jsIfElseBlock
|
syntax keyword jsConditional else skipwhite skipempty nextgroup=jsCommentIfElse,jsIfElseBlock
|
||||||
syntax keyword jsConditional switch skipwhite skipempty nextgroup=jsParenSwitch
|
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 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 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
|
syntax keyword jsTry try skipwhite skipempty nextgroup=jsTryCatchBlock
|
||||||
@@ -139,19 +142,20 @@ syntax keyword jsHtmlEvents onblur onclick oncontextmenu ondblclick onfocus
|
|||||||
" Code blocks
|
" Code blocks
|
||||||
syntax region jsBracket matchgroup=jsBrackets start=/\[/ end=/\]/ contains=@jsExpression,jsSpreadExpression extend fold
|
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 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 jsParenDecorator contained matchgroup=jsParensDecorator start=/(/ end=/)/ contains=@jsExpression extend fold
|
||||||
syntax region jsParenIfElse contained matchgroup=jsParensIfElse start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentIfElse,jsIfElseBlock,jsReturn extend fold
|
syntax region jsParenIfElse contained matchgroup=jsParensIfElse start=/(/ end=/)/ contains=@jsExpression 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 jsParenWhile contained matchgroup=jsParensWhile start=/(/ end=/)/ contains=@jsExpression 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 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 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 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 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 jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll extend fold
|
||||||
syntax region jsIfElseBlock contained matchgroup=jsIfElseBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold
|
syntax region jsIfElseBlock contained matchgroup=jsIfElseBraces start=/{/ end=/}/ contains=@jsAll extend fold
|
||||||
syntax region jsTryCatchBlock contained matchgroup=jsTryCatchBraces start=/{/ end=/}/ contains=@jsAll,jsBlock skipwhite skipempty nextgroup=jsCatch,jsFinally 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,jsBlock extend fold
|
syntax region jsFinallyBlock contained matchgroup=jsFinallyBraces start=/{/ end=/}/ contains=@jsAll extend fold
|
||||||
syntax region jsSwitchBlock contained matchgroup=jsSwitchBraces start=/{/ end=/}/ contains=@jsAll,jsBlock,jsSwitchCase 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,jsBlock 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 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 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
|
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 region jsFuncArgExpression contained matchgroup=jsFuncArgOperator start=/=/ end=/[,)]\@=/ contains=@jsExpression extend
|
||||||
syntax match jsFuncArgCommas contained ','
|
syntax match jsFuncArgCommas contained ','
|
||||||
syntax keyword jsArguments contained arguments
|
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
|
" Matches a single keyword argument with no parens
|
||||||
syntax match jsArrowFuncArgs /\<\K\k*\ze\s*=>/ skipwhite contains=jsFuncArgs skipwhite skipempty nextgroup=jsArrowFunction extend
|
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
|
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 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.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" 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 jsComment Comment
|
||||||
HiLink jsEnvComment PreProc
|
HiLink jsEnvComment PreProc
|
||||||
HiLink jsParensIfElse jsParens
|
HiLink jsParensIfElse jsParens
|
||||||
|
HiLink jsParensWhile jsParensRepeat
|
||||||
|
HiLink jsParensFor jsParensRepeat
|
||||||
HiLink jsParensRepeat jsParens
|
HiLink jsParensRepeat jsParens
|
||||||
HiLink jsParensSwitch jsParens
|
HiLink jsParensSwitch jsParens
|
||||||
HiLink jsParensCatch jsParens
|
HiLink jsParensCatch jsParens
|
||||||
@@ -277,6 +283,8 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
|||||||
HiLink jsBranch Conditional
|
HiLink jsBranch Conditional
|
||||||
HiLink jsLabel Label
|
HiLink jsLabel Label
|
||||||
HiLink jsReturn Statement
|
HiLink jsReturn Statement
|
||||||
|
HiLink jsWhile jsRepeat
|
||||||
|
HiLink jsFor jsRepeat
|
||||||
HiLink jsRepeat Repeat
|
HiLink jsRepeat Repeat
|
||||||
HiLink jsDo Repeat
|
HiLink jsDo Repeat
|
||||||
HiLink jsStatement Statement
|
HiLink jsStatement Statement
|
||||||
|
|||||||
@@ -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: '…⁝⅋←↑→↓↔↚↛↜↝↞↠↢↣↤↦↩↪↫↬↮↶↷↺↻↼↽⇀⇁⇄⇆⇇⇉⇋⇌⇍⇎⇏⇐⇒⇔⇚⇛⇜⇝⇠⇢⇴⇵⇶⇷⇸⇹⇺⇻⇼⇽⇾⇿∈∉∊∋∌∍∓∔∗∘∙√∛∜∝∤∥∦∧∨∩∪∷∸∺∻∽∾≀≁≂≃≄≅≆≇≈≉≊≋≌≍≎≏≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≠≡≢≣≤≥≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊂⊃⊄⊅⊆⊇⊈⊉⊊⊋⊍⊎⊏⊐⊑⊒⊓⊔⊕⊖⊗⊘⊙⊚⊛⊜⊞⊟⊠⊡⊢⊣⊩⊬⊮⊰⊱⊲⊳⊴⊵⊶⊷⊻⊼⊽⋄⋅⋆⋇⋉⋊⋋⋌⋍⋎⋏⋐⋑⋒⋓⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋮⋯⋰⋱⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⌿▷⟂⟈⟉⟑⟒⟕⟖⟗⟰⟱⟵⟶⟷⟹⟺⟻⟼⟽⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤈⤉⤊⤋⤌⤍⤎⤏⤐⤑⤒⤓⤔⤕⤖⤗⤘⤝⤞⤟⤠⥄⥅⥆⥇⥈⥉⥊⥋⥌⥍⥎⥏⥐⥑⥒⥓⥔⥕⥖⥗⥘⥙⥚⥛⥜⥝⥞⥟⥠⥡⥢⥣⥤⥥⥦⥧⥨⥩⥪⥫⥬⥭⥮⥯⥰⦷⦸⦼⦾⦿⧀⧁⧡⧣⧤⧥⧴⧶⧷⧺⧻⨇⨈⨝⨟⨢⨣⨤⨥⨦⨧⨨⨩⨪⨫⨬⨭⨮⨰⨱⨲⨳⨴⨵⨶⨷⨸⨹⨺⨻⨼⨽⩀⩁⩂⩃⩄⩅⩊⩋⩌⩍⩎⩏⩐⩑⩒⩓⩔⩕⩖⩗⩘⩚⩛⩜⩝⩞⩟⩠⩡⩢⩣⩦⩧⩪⩫⩬⩭⩮⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫛⫷⫸⫹⫺⬰⬱⬲⬳⬴⬵⬶⬷⬸⬹⬺⬻⬼⬽⬾⬿⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌←↑→↓'
|
" 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'
|
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
|
" 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.)
|
" 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
|
" A valid julia identifier, more or less
|
||||||
let s:idregex = '\%(' . s:id_charsH . s:id_charsW . '*\)'
|
let s:idregex = '\%(' . s:id_charsH . s:id_charsW . '*\)'
|
||||||
|
|
||||||
|
" Full operators regex
|
||||||
|
let s:operators = '\%(' . '\.\%([-+*/^÷%|&⊻]\|//\|\\\|>>\|>>>\?\)\?='
|
||||||
|
\ . '\|' . '[!:<>]=\|||\|&&\||>\|<|\|[<>:]:\|<<\|>>>\?\|//\|[-=]>\|\.\.\.\?'
|
||||||
|
\ . '\|' . '\.!' . '\|'.s:id_charsW.'\@'.s:d(1).'<!!'
|
||||||
|
\ . '\|' . '\.\?[' . s:op_chars . s:op_chars_wc . ']'
|
||||||
|
\ . '\)'
|
||||||
|
|
||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
@@ -90,10 +90,10 @@ syntax cluster juliaExprsNodot contains=@juliaParItems,@juliaStringItems,@julia
|
|||||||
|
|
||||||
syntax cluster juliaParItems contains=juliaParBlock,juliaSqBraIdxBlock,juliaSqBraBlock,juliaCurBraBlock,juliaQuotedParBlock,juliaQuotedQMarkPar
|
syntax cluster juliaParItems contains=juliaParBlock,juliaSqBraIdxBlock,juliaSqBraBlock,juliaCurBraBlock,juliaQuotedParBlock,juliaQuotedQMarkPar
|
||||||
syntax cluster juliaKeywordItems contains=juliaKeyword,juliaWhereKeyword,juliaImportLine,juliaInfixKeyword,juliaRepKeyword
|
syntax cluster juliaKeywordItems contains=juliaKeyword,juliaWhereKeyword,juliaImportLine,juliaInfixKeyword,juliaRepKeyword
|
||||||
syntax cluster juliaBlocksItems contains=juliaConditionalBlock,juliaWhileBlock,juliaForBlock,juliaBeginBlock,juliaFunctionBlock,juliaMacroBlock,juliaQuoteBlock,juliaTypeBlock,juliaImmutableBlock,juliaExceptionBlock,juliaLetBlock,juliaDoBlock,juliaModuleBlock,juliaStructBlock,juliaMutableStructBlock,juliaAbstractBlock,juliaPrimitiveBlock
|
syntax cluster juliaBlocksItems contains=juliaConditionalBlock,juliaWhileBlock,juliaForBlock,juliaBeginBlock,juliaFunctionBlock,juliaMacroBlock,juliaQuoteBlock,juliaExceptionBlock,juliaLetBlock,juliaDoBlock,juliaModuleBlock,juliaStructBlock,juliaMutableStructBlock,juliaAbstractBlock,juliaPrimitiveBlock
|
||||||
syntax cluster juliaTypesItems contains=juliaBaseTypeBasic,juliaBaseTypeNum,juliaBaseTypeC,juliaBaseTypeError,juliaBaseTypeIter,juliaBaseTypeString,juliaBaseTypeArray,juliaBaseTypeDict,juliaBaseTypeSet,juliaBaseTypeIO,juliaBaseTypeProcess,juliaBaseTypeRange,juliaBaseTypeRegex,juliaBaseTypeFact,juliaBaseTypeFact,juliaBaseTypeSort,juliaBaseTypeRound,juliaBaseTypeSpecial,juliaBaseTypeRandom,juliaBaseTypeDisplay,juliaBaseTypeTime,juliaBaseTypeOther
|
syntax cluster juliaTypesItems contains=juliaBaseTypeBasic,juliaBaseTypeNum,juliaBaseTypeC,juliaBaseTypeError,juliaBaseTypeIter,juliaBaseTypeString,juliaBaseTypeArray,juliaBaseTypeDict,juliaBaseTypeSet,juliaBaseTypeIO,juliaBaseTypeProcess,juliaBaseTypeRange,juliaBaseTypeRegex,juliaBaseTypeFact,juliaBaseTypeSort,juliaBaseTypeRound,juliaBaseTypeSpecial,juliaBaseTypeRandom,juliaBaseTypeDisplay,juliaBaseTypeTime,juliaBaseTypeOther
|
||||||
|
|
||||||
syntax cluster juliaConstItems contains=juliaConstNum,juliaConstBool,juliaConstEnv,juliaConstMMap,juliaConstC,juliaConstGeneric,juliaConstIO,juliaPossibleEuler
|
syntax cluster juliaConstItems contains=juliaConstNum,juliaConstBool,juliaConstEnv,juliaConstC,juliaConstGeneric,juliaConstIO,juliaPossibleEuler
|
||||||
|
|
||||||
syntax cluster juliaMacroItems contains=juliaPossibleMacro,juliaDollarVar,juliaDollarPar,juliaDollarSqBra
|
syntax cluster juliaMacroItems contains=juliaPossibleMacro,juliaDollarVar,juliaDollarPar,juliaDollarSqBra
|
||||||
syntax cluster juliaSymbolItems contains=juliaPossibleSymbol
|
syntax cluster juliaSymbolItems contains=juliaPossibleSymbol
|
||||||
|
|||||||
@@ -60,10 +60,11 @@ syn keyword ktConstant null
|
|||||||
|
|
||||||
syn keyword ktModifier reified external inline noinline crossinline
|
syn keyword ktModifier reified external inline noinline crossinline
|
||||||
|
|
||||||
syn match ktModifier "\v<(data|value)>\ze\@=.*<class>"
|
syn match ktModifier "\v<data>\ze\@=.*<(class|object)>"
|
||||||
|
syn match ktModifier "\v<value>\ze\@=.*<class>"
|
||||||
syn match ktModifier "\v<(tailrec|operator|infix)>\ze\@=.*<fun>"
|
syn match ktModifier "\v<(tailrec|operator|infix)>\ze\@=.*<fun>"
|
||||||
syn match ktModifier "\v<(const)>\ze\@=.*<val>"
|
syn match ktModifier "\v<const>\ze\@=.*<val>"
|
||||||
syn match ktModifier "\v<(lateinit)>\ze\@=.*<var>"
|
syn match ktModifier "\v<lateinit>\ze\@=.*<var>"
|
||||||
syn match ktModifier "\v<(internal|private|protected|public)>\ze\@=.*<(class|object|interface|typealias|fun|val|var|constructor|get|set)>"
|
syn match ktModifier "\v<(internal|private|protected|public)>\ze\@=.*<(class|object|interface|typealias|fun|val|var|constructor|get|set)>"
|
||||||
|
|
||||||
syn match ktOperator "\v\?:|::|\<\=? | \>\=?|[!=]\=\=?|<as>\??|[-*+/%]\=?|[!&|]"
|
syn match ktOperator "\v\?:|::|\<\=? | \>\=?|[!=]\=\=?|<as>\??|[-*+/%]\=?|[!&|]"
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ syn case match
|
|||||||
" Types also include struct, array, vector, etc. but these don't
|
" Types also include struct, array, vector, etc. but these don't
|
||||||
" benefit as much from having dedicated highlighting rules.
|
" benefit as much from having dedicated highlighting rules.
|
||||||
syn keyword llvmType void half bfloat float double x86_fp80 fp128 ppc_fp128
|
syn keyword llvmType void half bfloat float double x86_fp80 fp128 ppc_fp128
|
||||||
syn keyword llvmType label metadata x86_mmx
|
syn keyword llvmType label metadata x86_mmx x86_amx
|
||||||
syn keyword llvmType type label opaque token
|
syn keyword llvmType type label opaque token ptr
|
||||||
syn match llvmType /\<i\d\+\>/
|
syn match llvmType /\<i\d\+\>/
|
||||||
|
|
||||||
" Instructions.
|
" Instructions.
|
||||||
@@ -29,16 +29,16 @@ syn match llvmType /\<i\d\+\>/
|
|||||||
syn keyword llvmStatement add addrspacecast alloca and arcp ashr atomicrmw
|
syn keyword llvmStatement add addrspacecast alloca and arcp ashr atomicrmw
|
||||||
syn keyword llvmStatement bitcast br catchpad catchswitch catchret call callbr
|
syn keyword llvmStatement bitcast br catchpad catchswitch catchret call callbr
|
||||||
syn keyword llvmStatement cleanuppad cleanupret cmpxchg eq exact extractelement
|
syn keyword llvmStatement cleanuppad cleanupret cmpxchg eq exact extractelement
|
||||||
syn keyword llvmStatement extractvalue fadd fast fcmp fdiv fence fmul fpext
|
syn keyword llvmStatement extractvalue fadd fast fcmp fdiv fence fmul fneg fpext
|
||||||
syn keyword llvmStatement fptosi fptoui fptrunc free frem fsub fneg getelementptr
|
syn keyword llvmStatement fptosi fptoui fptrunc free freeze frem fsub
|
||||||
syn keyword llvmStatement icmp inbounds indirectbr insertelement insertvalue
|
syn keyword llvmStatement getelementptr icmp inbounds indirectbr insertelement
|
||||||
syn keyword llvmStatement inttoptr invoke landingpad load lshr malloc max min
|
syn keyword llvmStatement insertvalue inttoptr invoke landingpad load lshr
|
||||||
syn keyword llvmStatement mul nand ne ninf nnan nsw nsz nuw oeq oge ogt ole
|
syn keyword llvmStatement malloc max min mul nand ne ninf nnan nsw nsz nuw oeq
|
||||||
syn keyword llvmStatement olt one or ord phi ptrtoint resume ret sdiv select
|
syn keyword llvmStatement oge ogt ole olt one or ord phi ptrtoint resume ret
|
||||||
syn keyword llvmStatement sext sge sgt shl shufflevector sitofp sle slt srem
|
syn keyword llvmStatement sdiv select sext sge sgt shl shufflevector sitofp
|
||||||
syn keyword llvmStatement store sub switch trunc udiv ueq uge ugt uitofp ule ult
|
syn keyword llvmStatement sle slt srem store sub switch trunc udiv ueq uge ugt
|
||||||
syn keyword llvmStatement umax umin une uno unreachable unwind urem va_arg
|
syn keyword llvmStatement uitofp ule ult umax umin une uno unreachable unwind
|
||||||
syn keyword llvmStatement xchg xor zext
|
syn keyword llvmStatement urem va_arg xchg xor zext
|
||||||
|
|
||||||
" Keywords.
|
" Keywords.
|
||||||
syn keyword llvmKeyword
|
syn keyword llvmKeyword
|
||||||
@@ -48,11 +48,12 @@ syn keyword llvmKeyword
|
|||||||
\ alias
|
\ alias
|
||||||
\ align
|
\ align
|
||||||
\ alignstack
|
\ alignstack
|
||||||
|
\ allocsize
|
||||||
\ alwaysinline
|
\ alwaysinline
|
||||||
\ appending
|
\ appending
|
||||||
\ argmemonly
|
\ argmemonly
|
||||||
\ arm_aapcscc
|
|
||||||
\ arm_aapcs_vfpcc
|
\ arm_aapcs_vfpcc
|
||||||
|
\ arm_aapcscc
|
||||||
\ arm_apcscc
|
\ arm_apcscc
|
||||||
\ asm
|
\ asm
|
||||||
\ atomic
|
\ atomic
|
||||||
@@ -62,51 +63,58 @@ syn keyword llvmKeyword
|
|||||||
\ byref
|
\ byref
|
||||||
\ byval
|
\ byval
|
||||||
\ c
|
\ c
|
||||||
\ catch
|
|
||||||
\ caller
|
\ caller
|
||||||
|
\ catch
|
||||||
\ cc
|
\ cc
|
||||||
\ ccc
|
\ ccc
|
||||||
\ cleanup
|
\ cleanup
|
||||||
|
\ cold
|
||||||
\ coldcc
|
\ coldcc
|
||||||
\ comdat
|
\ comdat
|
||||||
\ common
|
\ common
|
||||||
\ constant
|
\ constant
|
||||||
|
\ convergent
|
||||||
\ datalayout
|
\ datalayout
|
||||||
\ declare
|
\ declare
|
||||||
\ default
|
\ default
|
||||||
\ define
|
\ define
|
||||||
\ deplibs
|
\ deplibs
|
||||||
\ dereferenceable
|
\ dereferenceable
|
||||||
|
\ dereferenceable_or_null
|
||||||
\ distinct
|
\ distinct
|
||||||
\ dllexport
|
\ dllexport
|
||||||
\ dllimport
|
\ dllimport
|
||||||
\ dso_local
|
\ dso_local
|
||||||
\ dso_preemptable
|
\ dso_preemptable
|
||||||
\ except
|
\ except
|
||||||
|
\ extern_weak
|
||||||
\ external
|
\ external
|
||||||
\ externally_initialized
|
\ externally_initialized
|
||||||
\ extern_weak
|
|
||||||
\ fastcc
|
\ fastcc
|
||||||
\ tailcc
|
|
||||||
\ filter
|
\ filter
|
||||||
\ from
|
\ from
|
||||||
\ gc
|
\ gc
|
||||||
\ global
|
\ global
|
||||||
\ hhvmcc
|
|
||||||
\ hhvm_ccc
|
\ hhvm_ccc
|
||||||
|
\ hhvmcc
|
||||||
\ hidden
|
\ hidden
|
||||||
|
\ hot
|
||||||
\ immarg
|
\ immarg
|
||||||
|
\ inaccessiblemem_or_argmemonly
|
||||||
|
\ inaccessiblememonly
|
||||||
|
\ inalloca
|
||||||
\ initialexec
|
\ initialexec
|
||||||
\ inlinehint
|
\ inlinehint
|
||||||
\ inreg
|
\ inreg
|
||||||
\ inteldialect
|
|
||||||
\ intel_ocl_bicc
|
\ intel_ocl_bicc
|
||||||
|
\ inteldialect
|
||||||
\ internal
|
\ internal
|
||||||
|
\ jumptable
|
||||||
\ linkonce
|
\ linkonce
|
||||||
\ linkonce_odr
|
\ linkonce_odr
|
||||||
|
\ local_unnamed_addr
|
||||||
\ localdynamic
|
\ localdynamic
|
||||||
\ localexec
|
\ localexec
|
||||||
\ local_unnamed_addr
|
|
||||||
\ minsize
|
\ minsize
|
||||||
\ module
|
\ module
|
||||||
\ monotonic
|
\ monotonic
|
||||||
@@ -117,19 +125,32 @@ syn keyword llvmKeyword
|
|||||||
\ nest
|
\ nest
|
||||||
\ noalias
|
\ noalias
|
||||||
\ nobuiltin
|
\ nobuiltin
|
||||||
|
\ nocallback
|
||||||
\ nocapture
|
\ nocapture
|
||||||
|
\ nocf_check
|
||||||
|
\ no_cfi
|
||||||
|
\ noduplicate
|
||||||
|
\ nofree
|
||||||
\ noimplicitfloat
|
\ noimplicitfloat
|
||||||
\ noinline
|
\ noinline
|
||||||
|
\ nomerge
|
||||||
\ nonlazybind
|
\ nonlazybind
|
||||||
\ nonnull
|
\ nonnull
|
||||||
|
\ noprofile
|
||||||
\ norecurse
|
\ norecurse
|
||||||
\ noredzone
|
\ noredzone
|
||||||
\ noreturn
|
\ noreturn
|
||||||
|
\ nosync
|
||||||
\ noundef
|
\ noundef
|
||||||
\ nounwind
|
\ nounwind
|
||||||
|
\ nosanitize_bounds
|
||||||
|
\ nosanitize_coverage
|
||||||
|
\ null_pointer_is_valid
|
||||||
|
\ optforfuzzing
|
||||||
\ optnone
|
\ optnone
|
||||||
\ optsize
|
\ optsize
|
||||||
\ personality
|
\ personality
|
||||||
|
\ preallocated
|
||||||
\ private
|
\ private
|
||||||
\ protected
|
\ protected
|
||||||
\ ptx_device
|
\ ptx_device
|
||||||
@@ -139,16 +160,20 @@ syn keyword llvmKeyword
|
|||||||
\ release
|
\ release
|
||||||
\ returned
|
\ returned
|
||||||
\ returns_twice
|
\ returns_twice
|
||||||
|
\ safestack
|
||||||
\ sanitize_address
|
\ sanitize_address
|
||||||
|
\ sanitize_hwaddress
|
||||||
\ sanitize_memory
|
\ sanitize_memory
|
||||||
|
\ sanitize_memtag
|
||||||
\ sanitize_thread
|
\ sanitize_thread
|
||||||
\ section
|
\ section
|
||||||
\ seq_cst
|
\ seq_cst
|
||||||
|
\ shadowcallstack
|
||||||
\ sideeffect
|
\ sideeffect
|
||||||
\ signext
|
\ signext
|
||||||
\ syncscope
|
|
||||||
\ source_filename
|
\ source_filename
|
||||||
\ speculatable
|
\ speculatable
|
||||||
|
\ speculative_load_hardening
|
||||||
\ spir_func
|
\ spir_func
|
||||||
\ spir_kernel
|
\ spir_kernel
|
||||||
\ sret
|
\ sret
|
||||||
@@ -157,8 +182,12 @@ syn keyword llvmKeyword
|
|||||||
\ sspstrong
|
\ sspstrong
|
||||||
\ strictfp
|
\ strictfp
|
||||||
\ swiftcc
|
\ swiftcc
|
||||||
|
\ swifterror
|
||||||
|
\ swifttailcc
|
||||||
\ swiftself
|
\ swiftself
|
||||||
|
\ syncscope
|
||||||
\ tail
|
\ tail
|
||||||
|
\ tailcc
|
||||||
\ target
|
\ target
|
||||||
\ thread_local
|
\ thread_local
|
||||||
\ to
|
\ to
|
||||||
@@ -171,10 +200,11 @@ syn keyword llvmKeyword
|
|||||||
\ volatile
|
\ volatile
|
||||||
\ weak
|
\ weak
|
||||||
\ weak_odr
|
\ weak_odr
|
||||||
|
\ willreturn
|
||||||
|
\ win64cc
|
||||||
\ within
|
\ within
|
||||||
\ writeonly
|
\ writeonly
|
||||||
\ x86_64_sysvcc
|
\ x86_64_sysvcc
|
||||||
\ win64cc
|
|
||||||
\ x86_fastcallcc
|
\ x86_fastcallcc
|
||||||
\ x86_stdcallcc
|
\ x86_stdcallcc
|
||||||
\ x86_thiscallcc
|
\ x86_thiscallcc
|
||||||
@@ -189,7 +219,7 @@ syn match llvmNumber /-\?\<\d\+\>/
|
|||||||
syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
|
syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
|
||||||
syn match llvmFloat /\<0x\x\+\>/
|
syn match llvmFloat /\<0x\x\+\>/
|
||||||
syn keyword llvmBoolean true false
|
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 match llvmComment /;.*$/
|
||||||
syn region llvmString start=/"/ skip=/\\"/ end=/"/
|
syn region llvmString start=/"/ skip=/\\"/ end=/"/
|
||||||
syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/
|
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*RUN:.*$/
|
||||||
syn match llvmSpecialComment /;\s*ALLOW_RETRIES:.*$/
|
syn match llvmSpecialComment /;\s*ALLOW_RETRIES:.*$/
|
||||||
syn match llvmSpecialComment /;\s*CHECK:.*$/
|
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:.*$/
|
syn match llvmSpecialComment /;\s*XFAIL:.*$/
|
||||||
|
|
||||||
if version >= 508 || !exists("did_c_syn_inits")
|
if version >= 508 || !exists("did_c_syn_inits")
|
||||||
|
|||||||
42
syntax/machine-ir.vim
Normal file
42
syntax/machine-ir.vim
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
if polyglot#init#is_disabled(expand('<sfile>: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 <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
HiLink mirType Type
|
||||||
|
HiLink mirStatement Statement
|
||||||
|
HiLink mirPReg Identifier
|
||||||
|
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax = "mir"
|
||||||
@@ -72,6 +72,7 @@ syn keyword mesonBuiltin
|
|||||||
\ add_global_link_arguments
|
\ add_global_link_arguments
|
||||||
\ add_languages
|
\ add_languages
|
||||||
\ add_project_arguments
|
\ add_project_arguments
|
||||||
|
\ add_project_dependencies
|
||||||
\ add_project_link_arguments
|
\ add_project_link_arguments
|
||||||
\ add_test_setup
|
\ add_test_setup
|
||||||
\ alias_target
|
\ alias_target
|
||||||
|
|||||||
52
syntax/mir.vim
Normal file
52
syntax/mir.vim
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
if polyglot#init#is_disabled(expand('<sfile>: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 <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
HiLink mirSpecialComment SpecialComment
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax = "mir"
|
||||||
@@ -18,7 +18,7 @@ syn case match
|
|||||||
|
|
||||||
" Types.
|
" Types.
|
||||||
"
|
"
|
||||||
syn keyword mlirType index f16 f32 f64
|
syn keyword mlirType index f16 f32 f64 bf16
|
||||||
" Signless integer types.
|
" Signless integer types.
|
||||||
syn match mlirType /\<i\d\+\>/
|
syn match mlirType /\<i\d\+\>/
|
||||||
" Unsigned integer types.
|
" Unsigned integer types.
|
||||||
@@ -27,7 +27,7 @@ syn match mlirType /\<ui\d\+\>/
|
|||||||
syn match mlirType /\<si\d\+\>/
|
syn match mlirType /\<si\d\+\>/
|
||||||
|
|
||||||
" Elemental types inside memref, tensor, or vector types.
|
" 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.
|
" Shaped types.
|
||||||
syn match mlirType /\<memref\ze\s*<.*>/
|
syn match mlirType /\<memref\ze\s*<.*>/
|
||||||
@@ -38,7 +38,6 @@ syn match mlirType /\<vector\ze\s*<.*>/
|
|||||||
syn match mlirType /x\s*\zsvector/
|
syn match mlirType /x\s*\zsvector/
|
||||||
|
|
||||||
" Operations.
|
" Operations.
|
||||||
" Standard dialect ops.
|
|
||||||
" TODO: this list is not exhaustive.
|
" TODO: this list is not exhaustive.
|
||||||
syn keyword mlirOps alloc alloca addf addi and call call_indirect cmpf cmpi
|
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
|
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 splat store select sqrt subf subi subview tanh
|
||||||
syn keyword mlirOps view
|
syn keyword mlirOps view
|
||||||
|
|
||||||
|
" Math ops.
|
||||||
|
syn match mlirOps /\<math\.erf\>/
|
||||||
|
|
||||||
" Affine ops.
|
" Affine ops.
|
||||||
syn match mlirOps /\<affine\.apply\>/
|
syn match mlirOps /\<affine\.apply\>/
|
||||||
syn match mlirOps /\<affine\.dma_start\>/
|
syn match mlirOps /\<affine\.dma_start\>/
|
||||||
@@ -57,8 +59,10 @@ syn match mlirOps /\<affine\.load\>/
|
|||||||
syn match mlirOps /\<affine\.parallel\>/
|
syn match mlirOps /\<affine\.parallel\>/
|
||||||
syn match mlirOps /\<affine\.prefetch\>/
|
syn match mlirOps /\<affine\.prefetch\>/
|
||||||
syn match mlirOps /\<affine\.store\>/
|
syn match mlirOps /\<affine\.store\>/
|
||||||
syn match mlirOps /\<loop\.for\>/
|
syn match mlirOps /\<scf\.execute_region\>/
|
||||||
syn match mlirOps /\<loop\.if\>/
|
syn match mlirOps /\<scf\.for\>/
|
||||||
|
syn match mlirOps /\<scf\.if\>/
|
||||||
|
syn match mlirOps /\<scf\.yield\>/
|
||||||
|
|
||||||
" TODO: dialect name prefixed ops (llvm or std).
|
" 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 /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
|
||||||
syn match mlirFloat /\<0x\x\+\>/
|
syn match mlirFloat /\<0x\x\+\>/
|
||||||
syn keyword mlirBoolean true false
|
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 region mlirString start=/"/ skip=/\\"/ end=/"/
|
||||||
syn match mlirLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/
|
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 /[%@][a-zA-Z$._-][a-zA-Z0-9$._-]*/
|
||||||
syn match mlirIdentifier /[%@!]\d\+\>/
|
syn match mlirIdentifier /[%@]\d\+\>/
|
||||||
syn match mlirMapSetOutline "#.*$"
|
" 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.
|
" Syntax-highlight lit test commands and bug numbers.
|
||||||
syn match mlirSpecialComment /\/\/\s*RUN:.*$/
|
syn match mlirSpecialComment /\/\/\s*RUN:.*$/
|
||||||
@@ -111,7 +125,6 @@ if version >= 508 || !exists("did_c_syn_inits")
|
|||||||
|
|
||||||
HiLink mlirType Type
|
HiLink mlirType Type
|
||||||
HiLink mlirOps Statement
|
HiLink mlirOps Statement
|
||||||
HiLink mlirMapSetOutline PreProc
|
|
||||||
HiLink mlirNumber Number
|
HiLink mlirNumber Number
|
||||||
HiLink mlirComment Comment
|
HiLink mlirComment Comment
|
||||||
HiLink mlirString String
|
HiLink mlirString String
|
||||||
@@ -122,6 +135,9 @@ if version >= 508 || !exists("did_c_syn_inits")
|
|||||||
HiLink mlirConstant Constant
|
HiLink mlirConstant Constant
|
||||||
HiLink mlirSpecialComment SpecialComment
|
HiLink mlirSpecialComment SpecialComment
|
||||||
HiLink mlirIdentifier Identifier
|
HiLink mlirIdentifier Identifier
|
||||||
|
HiLink mlirBlockIdentifier Label
|
||||||
|
HiLink mlirTypeIdentifier Type
|
||||||
|
HiLink mlirAttrIdentifier PreProc
|
||||||
|
|
||||||
delcommand HiLink
|
delcommand HiLink
|
||||||
endif
|
endif
|
||||||
|
|||||||
372
syntax/ocaml.vim
372
syntax/ocaml.vim
@@ -10,6 +10,7 @@ endif
|
|||||||
" Issac Trotts <ijtrotts@ucdavis.edu>
|
" Issac Trotts <ijtrotts@ucdavis.edu>
|
||||||
" URL: https://github.com/ocaml/vim-ocaml
|
" URL: https://github.com/ocaml/vim-ocaml
|
||||||
" Last Change:
|
" Last Change:
|
||||||
|
" 2019 Nov 05 - Accurate type highlighting (Maëlan)
|
||||||
" 2018 Nov 08 - Improved highlighting of operators (Maëlan)
|
" 2018 Nov 08 - Improved highlighting of operators (Maëlan)
|
||||||
" 2018 Apr 22 - Improved support for PPX (Andrey Popp)
|
" 2018 Apr 22 - Improved support for PPX (Andrey Popp)
|
||||||
" 2018 Mar 16 - Remove raise, lnot and not from keywords (Étienne Millon, "copy")
|
" 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
|
" Access to the method of an object
|
||||||
syn match ocamlMethod "#"
|
syn match ocamlMethod "#"
|
||||||
|
|
||||||
" Script headers highlighted like comments
|
|
||||||
syn match ocamlComment "^#!.*" contains=@Spell
|
|
||||||
|
|
||||||
" Scripting directives
|
" 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\)\>"
|
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
|
" lowercase identifier - the standard way to match
|
||||||
syn match ocamlLCIdentifier /\<\(\l\|_\)\(\w\|'\)*\>/
|
syn match ocamlLCIdentifier /\<\(\l\|_\)\(\w\|'\)*\>/
|
||||||
|
|
||||||
syn match ocamlKeyChar "|"
|
|
||||||
|
|
||||||
" Errors
|
" Errors
|
||||||
syn match ocamlBraceErr "}"
|
syn match ocamlBraceErr "}"
|
||||||
syn match ocamlBrackErr "\]"
|
syn match ocamlBrackErr "\]"
|
||||||
syn match ocamlParenErr ")"
|
syn match ocamlParenErr ")"
|
||||||
syn match ocamlArrErr "|]"
|
syn match ocamlArrErr "|]"
|
||||||
|
|
||||||
syn match ocamlCommentErr "\*)"
|
|
||||||
|
|
||||||
syn match ocamlCountErr "\<downto\>"
|
syn match ocamlCountErr "\<downto\>"
|
||||||
syn match ocamlCountErr "\<to\>"
|
syn match ocamlCountErr "\<to\>"
|
||||||
|
|
||||||
@@ -79,19 +73,22 @@ else
|
|||||||
syn match ocamlEndErr "\<end\>"
|
syn match ocamlEndErr "\<end\>"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Some convenient clusters
|
" These keywords are only expected nested in constructions that are handled by
|
||||||
syn cluster ocamlAllErrs contains=ocamlBraceErr,ocamlBrackErr,ocamlParenErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr
|
" 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
|
syn cluster ocamlContained contains=ocamlTodo,ocamlPreDef,ocamlModParam,ocamlModParam1,ocamlMPRestr,ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3,ocamlModRHS,ocamlFuncWith,ocamlFuncStruct,ocamlModTypeRestr,ocamlModTRWith,ocamlWith,ocamlWithRest,ocamlModType,ocamlFullMod,ocamlVal
|
||||||
|
|
||||||
|
|
||||||
" Enclosing delimiters
|
" Enclosing delimiters
|
||||||
syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="(" matchgroup=ocamlKeywordDelimiter end=")" contains=ALLBUT,@ocamlContained,ocamlParenErr
|
syn region ocamlNone transparent matchgroup=ocamlEncl start="(" matchgroup=ocamlEncl end=")" contains=ALLBUT,@ocamlContained,ocamlParenErr
|
||||||
syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="{" matchgroup=ocamlKeywordDelimiter end="}" contains=ALLBUT,@ocamlContained,ocamlBraceErr
|
syn region ocamlNone transparent matchgroup=ocamlEncl start="{" matchgroup=ocamlEncl end="}" contains=ALLBUT,@ocamlContained,ocamlBraceErr
|
||||||
syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="\[" matchgroup=ocamlKeywordDelimiter end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr
|
syn region ocamlNone transparent matchgroup=ocamlEncl start="\[" matchgroup=ocamlEncl 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,ocamlArrErr
|
||||||
|
|
||||||
|
|
||||||
" Comments
|
" Comments
|
||||||
@@ -141,7 +138,7 @@ syn match ocamlKeyword "\<include\>" skipwhite skipempty nextgroup=ocamlModPa
|
|||||||
" "module" - somewhat complicated stuff ;-)
|
" "module" - somewhat complicated stuff ;-)
|
||||||
syn region ocamlModule matchgroup=ocamlKeyword start="\<module\>" matchgroup=ocamlModule end="\<\u\(\w\|'\)*\>" contains=@ocamlAllErrs,ocamlComment skipwhite skipempty nextgroup=ocamlPreDef
|
syn region ocamlModule matchgroup=ocamlKeyword start="\<module\>" 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 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 ocamlModParam1 "\<\u\(\w\|'\)*\>" contained skipwhite skipempty
|
||||||
syn match ocamlGenMod "()" contained skipwhite skipempty
|
syn match ocamlGenMod "()" contained skipwhite skipempty
|
||||||
|
|
||||||
@@ -155,7 +152,7 @@ syn region ocamlVal matchgroup=ocamlKeyword start="\<val\>" matchgroup=ocamlLC
|
|||||||
syn region ocamlModRHS start="." end=". *\w\|([^*]"me=e-2 contained contains=ocamlComment skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
|
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 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="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
|
syn region ocamlFuncStruct matchgroup=ocamlStructEncl start="[^a-zA-Z]struct\>"hs=s+1 matchgroup=ocamlStructEncl end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
|
||||||
|
|
||||||
syn match ocamlModTypeRestr "\<\w\(\w\|'\)*\( *\. *\w\(\w\|'\)*\)*\>" contained
|
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="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
|
syn region ocamlStruct matchgroup=ocamlStructEncl start="\<\(module\s\+\)\=struct\>" matchgroup=ocamlStructEncl end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
|
||||||
|
|
||||||
" "module type"
|
" "module type"
|
||||||
syn region ocamlKeyword start="\<module\>\s*\<type\>\(\s*\<of\>\)\=" matchgroup=ocamlModule end="\<\w\(\w\|'\)*\>" contains=ocamlComment skipwhite skipempty nextgroup=ocamlMTDef
|
syn region ocamlKeyword start="\<module\s\+type\(\s\+of\)\=\>" 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
|
syn match ocamlMTDef "=\s*\w\(\w\|'\)*\>"hs=s+1,me=s+1 skipwhite skipempty nextgroup=ocamlFullMod
|
||||||
|
|
||||||
" Quoted strings
|
" 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 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 and as assert class
|
||||||
syn keyword ocamlKeyword constraint else
|
syn keyword ocamlKeyword else
|
||||||
syn keyword ocamlKeyword exception external fun
|
syn keyword ocamlKeyword external
|
||||||
|
|
||||||
syn keyword ocamlKeyword in inherit initializer
|
syn keyword ocamlKeyword in inherit initializer
|
||||||
syn keyword ocamlKeyword lazy let match
|
syn keyword ocamlKeyword lazy let match
|
||||||
syn keyword ocamlKeyword method mutable new nonrec of
|
syn keyword ocamlKeyword method new
|
||||||
syn keyword ocamlKeyword parser private rec
|
syn keyword ocamlKeyword parser rec
|
||||||
syn keyword ocamlKeyword try type
|
syn keyword ocamlKeyword try
|
||||||
syn keyword ocamlKeyword virtual when while with
|
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='\<fun\>' matchgroup=ocamlArrow end='->'
|
||||||
|
\ contains=ALLBUT,@ocamlContained,ocamlArrow,ocamlInfixOp,ocamlTypeAnnot
|
||||||
|
|
||||||
if exists("ocaml_revised")
|
if exists("ocaml_revised")
|
||||||
syn keyword ocamlKeyword do value
|
syn keyword ocamlKeyword do value
|
||||||
syn keyword ocamlBoolean True False
|
syn keyword ocamlBoolean True False
|
||||||
@@ -193,14 +200,10 @@ else
|
|||||||
syn keyword ocamlBoolean true false
|
syn keyword ocamlBoolean true false
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn keyword ocamlType array bool char exn float format format4
|
syn match ocamlEmptyConstructor "(\s*)"
|
||||||
syn keyword ocamlType int int32 int64 lazy_t list nativeint option
|
syn match ocamlEmptyConstructor "\[\s*\]"
|
||||||
syn keyword ocamlType bytes string unit
|
syn match ocamlEmptyConstructor "\[|\s*>|]"
|
||||||
|
syn match ocamlEmptyConstructor "\[<\s*>\]"
|
||||||
syn match ocamlConstructorDelimiter "(\s*)"
|
|
||||||
syn match ocamlConstructorDelimiter "\[\s*\]"
|
|
||||||
syn match ocamlConstructorDelimiter "\[|\s*>|]"
|
|
||||||
syn match ocamlConstructorDelimiter "\[<\s*>\]"
|
|
||||||
syn match ocamlConstructor "\u\(\w\|'\)*\>"
|
syn match ocamlConstructor "\u\(\w\|'\)*\>"
|
||||||
|
|
||||||
" Polymorphic variants
|
" Polymorphic variants
|
||||||
@@ -215,26 +218,24 @@ syn match ocamlCharErr "'\\\d\d'\|'\\\d'"
|
|||||||
syn match ocamlCharErr "'\\[^\'ntbr]'"
|
syn match ocamlCharErr "'\\[^\'ntbr]'"
|
||||||
syn region ocamlString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
|
syn region ocamlString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
|
||||||
|
|
||||||
syn match ocamlTopStop ";;"
|
|
||||||
|
|
||||||
syn match ocamlAnyVar "\<_\>"
|
syn match ocamlAnyVar "\<_\>"
|
||||||
syn match ocamlKeyChar "|[^\]]"me=e-1
|
syn match ocamlKeyChar "|]\@!"
|
||||||
syn match ocamlKeyChar ";"
|
syn match ocamlKeyChar ";"
|
||||||
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
|
"" Operators
|
||||||
|
|
||||||
" The grammar of operators is found there:
|
" 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/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:ext-ops
|
||||||
" https://caml.inria.fr/pub/docs/manual-ocaml/extn.html#s:index-operators
|
" 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
|
" = is both an operator name and a keyword, we let the user choose how
|
||||||
" to display them (has to be declared before regular infix operators):
|
" to display it (has to be declared before regular infix operators):
|
||||||
syn match ocamlEqual "="
|
syn match ocamlEqual "="
|
||||||
syn match ocamlStar "*"
|
|
||||||
syn match ocamlAngle "<"
|
|
||||||
syn match ocamlAngle ">"
|
|
||||||
" Custom indexing operators:
|
" Custom indexing operators:
|
||||||
syn region ocamlIndexing matchgroup=ocamlIndexingOp
|
syn region ocamlIndexing matchgroup=ocamlIndexingOp
|
||||||
\ start="\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\_s*("
|
\ start="\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\_s*("
|
||||||
@@ -253,8 +254,8 @@ syn match ocamlExtensionOp "#[#~?!.:|&$%<=>@^*/+-]\+"
|
|||||||
" Infix and prefix operators:
|
" Infix and prefix operators:
|
||||||
syn match ocamlPrefixOp "![~?!.:|&$%<=>@^*/+-]*"
|
syn match ocamlPrefixOp "![~?!.:|&$%<=>@^*/+-]*"
|
||||||
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 match ocamlInfixOp "!=[~?!.:|&$%<=>@^*/+-]\@!"
|
syn match ocamlInfixOp "!=[~?!.:|&$%<=>@^*/+-]\@!"
|
||||||
syn keyword ocamlInfixOpKeyword asr land lor lsl lsr lxor mod or
|
syn keyword ocamlInfixOpKeyword asr land lor lsl lsr lxor mod or
|
||||||
@@ -271,6 +272,9 @@ else
|
|||||||
syn match ocamlKeyChar "<-[~?!.:|&$%<=>@^*/+-]\@!"
|
syn match ocamlKeyChar "<-[~?!.:|&$%<=>@^*/+-]\@!"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Script shebang (has to be declared after operators)
|
||||||
|
syn match ocamlShebang "\%1l^#!.*$"
|
||||||
|
|
||||||
syn match ocamlNumber "-\=\<\d\(_\|\d\)*[l|L|n]\?\>"
|
syn match ocamlNumber "-\=\<\d\(_\|\d\)*[l|L|n]\?\>"
|
||||||
syn match ocamlNumber "-\=\<0[x|X]\(\x\|_\)\+[l|L|n]\?\>"
|
syn match ocamlNumber "-\=\<0[x|X]\(\x\|_\)\+[l|L|n]\?\>"
|
||||||
syn match ocamlNumber "-\=\<0[o|O]\(\o\|_\)\+[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\)*\)\=\>"
|
syn match ocamlFloat "-\=\<\d\(_\|\d\)*\.\?\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)\=\>"
|
||||||
|
|
||||||
" Labels
|
" Labels
|
||||||
syn match ocamlLabel "\~\(\l\|_\)\(\w\|'\)*"lc=1
|
syn match ocamlLabel "[~?]\(\l\|_\)\(\w\|'\)*:\?"
|
||||||
syn match ocamlLabel "?\(\l\|_\)\(\w\|'\)*"lc=1
|
|
||||||
syn region ocamlLabel transparent matchgroup=ocamlLabel start="[~?](\(\l\|_\)\(\w\|'\)*"lc=2 end=")"me=e-1 contains=ALLBUT,@ocamlContained,ocamlParenErr
|
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 "\<array\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<bool\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<bytes\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<char\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<exn\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<float\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<format\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<format4\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<format6\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<in_channel\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<int\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<int32\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<int64\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<lazy_t\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<list\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<nativeint\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<option\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<out_channel\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<ref\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<result\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<scanner\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<string\>"
|
||||||
|
syn match ocamlTypeBuiltin contained "\<unit\>"
|
||||||
|
|
||||||
|
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="\<of\>"
|
||||||
|
\ 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="\<false\>" start="\<true\>"
|
||||||
|
\ matchgroup=ocamlTypeSumConstr start="(\_s*)" start="\[\_s*]" start="(\_s*::\_s*)"
|
||||||
|
\ matchgroup=NONE end="\(\<type\>\|\<exception\>\|\<val\>\|\<module\>\|\<class\>\|\<method\>\|\<constraint\>\|\<inherit\>\|\<object\>\|\<struct\>\|\<open\>\|\<include\>\|\<let\>\|\<external\>\|\<in\>\|\<end\>\|)\|]\|}\|;\|;;\|=\)\@="
|
||||||
|
\ matchgroup=NONE end="\(\<and\>\)\@="
|
||||||
|
\ 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 "\<false\>"
|
||||||
|
syn match ocamlTypeSumConstr contained "\<true\>"
|
||||||
|
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="\<of\>"
|
||||||
|
\ matchgroup=ocamlKeyChar start=":"
|
||||||
|
\ matchgroup=NONE end="|\@="
|
||||||
|
\ matchgroup=NONE end="\(\<type\>\|\<exception\>\|\<val\>\|\<module\>\|\<class\>\|\<method\>\|\<constraint\>\|\<inherit\>\|\<object\>\|\<struct\>\|\<open\>\|\<include\>\|\<let\>\|\<external\>\|\<in\>\|\<end\>\|)\|]\|}\|;\|;;\)\@="
|
||||||
|
\ matchgroup=NONE end="\(\<and\>\)\@="
|
||||||
|
\ 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="\<type\>\(\_s\+\<nonrec\>\)\?\|\<constraint\>\|\<exception\>"
|
||||||
|
\ matchgroup=NONE end="\(\<type\>\|\<exception\>\|\<val\>\|\<module\>\|\<class\>\|\<method\>\|\<constraint\>\|\<inherit\>\|\<object\>\|\<struct\>\|\<open\>\|\<include\>\|\<let\>\|\<external\>\|\<in\>\|\<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 "\<with\_s\+exception\>"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="\(\<type\>\|\<exception\>\|\<val\>\|\<module\>\|\<class\>\|\<method\>\|\<constraint\>\|\<inherit\>\|\<object\>\|\<struct\>\|\<open\>\|\<include\>\|\<let\>\|\<external\>\|\<in\>\|\<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
|
" Synchronization
|
||||||
syn sync minlines=50
|
syn sync minlines=50
|
||||||
@@ -311,19 +569,19 @@ hi def link ocamlBrackErr Error
|
|||||||
hi def link ocamlParenErr Error
|
hi def link ocamlParenErr Error
|
||||||
hi def link ocamlArrErr Error
|
hi def link ocamlArrErr Error
|
||||||
|
|
||||||
hi def link ocamlCommentErr Error
|
|
||||||
|
|
||||||
hi def link ocamlCountErr Error
|
hi def link ocamlCountErr Error
|
||||||
hi def link ocamlDoErr Error
|
hi def link ocamlDoErr Error
|
||||||
hi def link ocamlDoneErr Error
|
hi def link ocamlDoneErr Error
|
||||||
hi def link ocamlEndErr Error
|
hi def link ocamlEndErr Error
|
||||||
hi def link ocamlThenErr Error
|
hi def link ocamlThenErr Error
|
||||||
|
hi def link ocamlKwErr Error
|
||||||
|
|
||||||
hi def link ocamlCharErr Error
|
hi def link ocamlCharErr Error
|
||||||
|
|
||||||
hi def link ocamlErr Error
|
hi def link ocamlErr Error
|
||||||
|
|
||||||
hi def link ocamlComment Comment
|
hi def link ocamlComment Comment
|
||||||
|
hi def link ocamlShebang ocamlComment
|
||||||
|
|
||||||
hi def link ocamlModPath Include
|
hi def link ocamlModPath Include
|
||||||
hi def link ocamlObject Include
|
hi def link ocamlObject Include
|
||||||
@@ -344,13 +602,12 @@ hi def link ocamlStructEncl ocamlModule
|
|||||||
hi def link ocamlScript Include
|
hi def link ocamlScript Include
|
||||||
|
|
||||||
hi def link ocamlConstructor Constant
|
hi def link ocamlConstructor Constant
|
||||||
hi def link ocamlConstructorDelimiter ocamlConstructor
|
hi def link ocamlEmptyConstructor ocamlConstructor
|
||||||
|
|
||||||
hi def link ocamlVal Keyword
|
hi def link ocamlVal Keyword
|
||||||
hi def link ocamlModPreRHS Keyword
|
hi def link ocamlModPreRHS Keyword
|
||||||
hi def link ocamlMPRestr2 Keyword
|
hi def link ocamlMPRestr2 Keyword
|
||||||
hi def link ocamlKeyword Keyword
|
hi def link ocamlKeyword Keyword
|
||||||
hi def link ocamlKeywordDelimiter ocamlKeyword
|
|
||||||
hi def link ocamlMethod Include
|
hi def link ocamlMethod Include
|
||||||
hi def link ocamlArrow Keyword
|
hi def link ocamlArrow Keyword
|
||||||
hi def link ocamlKeyChar Keyword
|
hi def link ocamlKeyChar Keyword
|
||||||
@@ -359,8 +616,6 @@ hi def link ocamlTopStop Keyword
|
|||||||
|
|
||||||
hi def link ocamlRefAssign ocamlKeyChar
|
hi def link ocamlRefAssign ocamlKeyChar
|
||||||
hi def link ocamlEqual ocamlKeyChar
|
hi def link ocamlEqual ocamlKeyChar
|
||||||
hi def link ocamlStar ocamlInfixOp
|
|
||||||
hi def link ocamlAngle ocamlInfixOp
|
|
||||||
hi def link ocamlCons ocamlInfixOp
|
hi def link ocamlCons ocamlInfixOp
|
||||||
|
|
||||||
hi def link ocamlPrefixOp ocamlOperator
|
hi def link ocamlPrefixOp ocamlOperator
|
||||||
@@ -384,7 +639,24 @@ hi def link ocamlQuotedStringDelim Identifier
|
|||||||
|
|
||||||
hi def link ocamlLabel 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
|
hi def link ocamlTodo Todo
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ syntax keyword odinTransmute transmute
|
|||||||
syntax keyword odinCast cast
|
syntax keyword odinCast cast
|
||||||
syntax keyword odinDistinct distinct
|
syntax keyword odinDistinct distinct
|
||||||
syntax keyword odinOpaque opaque
|
syntax keyword odinOpaque opaque
|
||||||
|
syntax keyword odinWhere where
|
||||||
|
|
||||||
syntax keyword odinStruct struct
|
syntax keyword odinStruct struct
|
||||||
syntax keyword odinEnum enum
|
syntax keyword odinEnum enum
|
||||||
@@ -47,10 +48,11 @@ syntax match odinFixMe "FIXME"
|
|||||||
syntax match odinNoCheckin "NOCHECKIN"
|
syntax match odinNoCheckin "NOCHECKIN"
|
||||||
syntax match odinHack "HACK"
|
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 odinBool true false
|
||||||
syntax keyword odinNull nil
|
syntax keyword odinNull nil
|
||||||
syntax keyword odinDynamic dynamic
|
syntax keyword odinDynamic dynamic
|
||||||
|
syntax keyword odinMap map
|
||||||
syntax keyword odinProc proc
|
syntax keyword odinProc proc
|
||||||
syntax keyword odinIn in
|
syntax keyword odinIn in
|
||||||
syntax keyword odinNotIn notin
|
syntax keyword odinNotIn notin
|
||||||
@@ -65,9 +67,9 @@ syntax keyword odinPackage package
|
|||||||
syntax keyword odinReturn return
|
syntax keyword odinReturn return
|
||||||
syntax keyword odinDefer defer
|
syntax keyword odinDefer defer
|
||||||
|
|
||||||
syntax region odinChar start=/\v'/ skip=/\v\\./ end=/\v'/
|
syntax region odinRawString start=+`+ end=+`+
|
||||||
syntax region odinString start=/\v"/ skip=/\v\\./ end=/\v"/
|
syntax region odinChar start=+'+ skip=+\\\\\|\\'+ end=+'+
|
||||||
syntax region odinRawString start=/\v`/ skip=/\v\\./ end=/\v`/
|
syntax region odinString start=+"+ skip=+\\\\\|\\'+ end=+"+
|
||||||
|
|
||||||
syntax match odinFunction "\v<\w*>(\s*::\s*proc)@="
|
syntax match odinFunction "\v<\w*>(\s*::\s*proc)@="
|
||||||
|
|
||||||
@@ -96,7 +98,7 @@ syntax match odinMacro "#\<\w\+\>" display
|
|||||||
syntax match odinTemplate "$\<\w\+\>"
|
syntax match odinTemplate "$\<\w\+\>"
|
||||||
|
|
||||||
syntax match odinCommentNote "@\<\w\+\>" contained display
|
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
|
syntax region odinBlockComment start=/\v\/\*/ end=/\v\*\// contains=odinBlockComment, odinCommentNote, odinTodo, odinNote, odinXXX, odinFixMe, odinNoCheckin, odinHack
|
||||||
|
|
||||||
highlight link odinUsing Keyword
|
highlight link odinUsing Keyword
|
||||||
@@ -121,6 +123,7 @@ highlight link odinAlignOf Keyword
|
|||||||
highlight link odinPackage Keyword
|
highlight link odinPackage Keyword
|
||||||
highlight link odinOrReturn Keyword
|
highlight link odinOrReturn Keyword
|
||||||
highlight link odinOrElse Keyword
|
highlight link odinOrElse Keyword
|
||||||
|
highlight link odinWhere Keyword
|
||||||
|
|
||||||
highlight link odinInline Keyword
|
highlight link odinInline Keyword
|
||||||
highlight link odinNoInline Keyword
|
highlight link odinNoInline Keyword
|
||||||
@@ -133,6 +136,7 @@ highlight link odinDo Keyword
|
|||||||
|
|
||||||
highlight link odinDefer Operator
|
highlight link odinDefer Operator
|
||||||
highlight link odinDynamic Operator
|
highlight link odinDynamic Operator
|
||||||
|
highlight link odinMap Operator
|
||||||
highlight link odinRange Operator
|
highlight link odinRange Operator
|
||||||
highlight link odinHalfRange Operator
|
highlight link odinHalfRange Operator
|
||||||
highlight link odinAssign Operator
|
highlight link odinAssign Operator
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ syn keyword openscadPrimitiveSolid cube sphere cylinder polyhedron surface
|
|||||||
syn keyword openscadPrimitive2D square circle polygon import_dxf text
|
syn keyword openscadPrimitive2D square circle polygon import_dxf text
|
||||||
syn keyword openscadPrimitiveImport import child children
|
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 openscadModifier "^\s*[\*\!\#\%]" display
|
||||||
|
|
||||||
syn match openscadNumbers "\<\d\|\.\d" contains=openscadNumber display transparent
|
syn match openscadNumbers "\<\d\|\.\d" contains=openscadNumber display transparent
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ endif
|
|||||||
|
|
||||||
syn case ignore
|
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 keyword qmlCommentTodo TODO FIXME XXX TBD contained
|
||||||
syn match qmlLineComment "\/\/.*" contains=@Spell,qmlCommentTodo
|
syn match qmlLineComment "\/\/.*" contains=@Spell,qmlCommentTodo
|
||||||
syn match qmlCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
|
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 match qmlObjectLiteralType "[A-Za-z][_A-Za-z0-9]*\s*\({\)\@="
|
||||||
syn region qmlTernaryColon start="?" end=":" contains=@qmlExpr,qmlBraces,qmlParens
|
syn region qmlTernaryColon start="?" end=":" contains=@qmlExpr,qmlBraces,qmlParens
|
||||||
syn match qmlBindingProperty "\<[A-Za-z][_A-Za-z.0-9]*\s*:"
|
syn match qmlBindingProperty "\<[A-Za-z][_A-Za-z.0-9]*\s*:"
|
||||||
|
syn match qmlNullishCoalescing "??"
|
||||||
|
|
||||||
syn keyword qmlConditional if else switch
|
syn keyword qmlConditional if else switch
|
||||||
syn keyword qmlRepeat while for do in
|
syn keyword qmlRepeat while for do in
|
||||||
@@ -1126,6 +1127,7 @@ if version >= 508 || !exists("did_qml_syn_inits")
|
|||||||
HiLink qmlNull Keyword
|
HiLink qmlNull Keyword
|
||||||
HiLink qmlBoolean Boolean
|
HiLink qmlBoolean Boolean
|
||||||
HiLink qmlRegexpString String
|
HiLink qmlRegexpString String
|
||||||
|
HiLink qmlNullishCoalescing Operator
|
||||||
|
|
||||||
HiLink qmlIdentifier Identifier
|
HiLink qmlIdentifier Identifier
|
||||||
HiLink qmlLabel Label
|
HiLink qmlLabel Label
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'syntax/requir
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" the Requirements File Format syntax support for Vim
|
" the Requirements File Format syntax support for Vim
|
||||||
" Version: 1.6.0
|
" Version: 1.7.1
|
||||||
" Author: raimon <raimon49@hotmail.com>
|
" Author: raimon <raimon49@hotmail.com>
|
||||||
" License: MIT LICENSE
|
" License: MIT LICENSE
|
||||||
" The MIT License (MIT)
|
" The MIT License (MIT)
|
||||||
@@ -34,6 +34,7 @@ endif
|
|||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
|
syn match requirementsVersion "\v\d+[a-zA-Z0-9\.\-\*]*"
|
||||||
syn region requirementsComment start="[ \t]*#" end="$"
|
syn region requirementsComment start="[ \t]*#" end="$"
|
||||||
syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?"
|
syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?"
|
||||||
syn match requirementsVersionSpecifiers "\v(\=\=\=?|\<\=?|\>\=?|\~\=|\!\=)"
|
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 requirementsURLs "\v(\@\s)?(https?|ftp|gopher)://?[^\s/$.?#].\S*"
|
||||||
syn match requirementsEnvironmentMarkers "\v;\s[^#]+"
|
syn match requirementsEnvironmentMarkers "\v;\s[^#]+"
|
||||||
|
|
||||||
hi link requirementsComment Comment
|
hi def link requirementsVersion Number
|
||||||
hi link requirementsCommandOption Special
|
hi def link requirementsComment Comment
|
||||||
hi link requirementsVersionSpecifiers Boolean
|
hi def link requirementsCommandOption Special
|
||||||
hi link requirementsPackageName Identifier
|
hi def link requirementsVersionSpecifiers Boolean
|
||||||
hi link requirementsExtras Type
|
hi def link requirementsPackageName Identifier
|
||||||
hi link requirementsVersionControls Underlined
|
hi def link requirementsExtras Type
|
||||||
hi link requirementsURLs Underlined
|
hi def link requirementsVersionControls Underlined
|
||||||
hi link requirementsEnvironmentMarkers Macro
|
hi def link requirementsURLs Underlined
|
||||||
|
hi def link requirementsEnvironmentMarkers Macro
|
||||||
|
|
||||||
let b:current_syntax = "requirements"
|
let b:current_syntax = "requirements"
|
||||||
|
|
||||||
|
|||||||
@@ -402,11 +402,6 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
|
|||||||
|
|
||||||
SynFold 'for' syn region rubyRepeatExpression start="\<for\>" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\@<![!?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat skip="\<end:" end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine
|
SynFold 'for' syn region rubyRepeatExpression start="\<for\>" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\@<![!?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat skip="\<end:" end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine
|
||||||
|
|
||||||
if !exists("ruby_minlines")
|
|
||||||
let ruby_minlines = 500
|
|
||||||
endif
|
|
||||||
exe "syn sync minlines=" . ruby_minlines
|
|
||||||
|
|
||||||
else
|
else
|
||||||
syn match rubyControl "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl
|
syn match rubyControl "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl
|
||||||
syn match rubyControl "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl
|
syn match rubyControl "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl
|
||||||
@@ -415,6 +410,11 @@ else
|
|||||||
syn match rubyKeyword "\<\%(alias\|undef\)\>"
|
syn match rubyKeyword "\<\%(alias\|undef\)\>"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists("ruby_minlines")
|
||||||
|
let ruby_minlines = 500
|
||||||
|
endif
|
||||||
|
exe "syn sync minlines=" . ruby_minlines
|
||||||
|
|
||||||
" Special Methods {{{1
|
" Special Methods {{{1
|
||||||
if !exists("ruby_no_special_methods")
|
if !exists("ruby_no_special_methods")
|
||||||
syn match rubyAccess "\<\%(public\|protected\|private\)\>" " use re=2
|
syn match rubyAccess "\<\%(public\|protected\|private\)\>" " use re=2
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ syn region solFuncBody contained contains=solDestructure,solComment,s
|
|||||||
\ start='{'
|
\ start='{'
|
||||||
\ end='}'
|
\ end='}'
|
||||||
syn match solFuncCall contained skipempty skipwhite nextgroup=solCallOptions,solFuncCallParens
|
syn match solFuncCall contained skipempty skipwhite nextgroup=solCallOptions,solFuncCallParens
|
||||||
\ '\v%(%(<if>|<uint>|<int>|<ufixed>|<bytes>|<address>|<string>|<bool>)\s*)@<!<[a-zA-Z_][0-9a-zA-Z_]*\s*%((\{(\n|.|\s)*\})?\s*(\((\n|.|\s)*\)))@='
|
\ '\v%(%(<if>|<uint>|<int>|<ufixed>|<bytes>|<address>|<string>|<bool>)\s*)@<!<[a-zA-Z_][0-9a-zA-Z_]*\s*%((\{[^}]*\})?\s*\()@='
|
||||||
syn region solFuncCallParens contained transparent contains=solComment,solString,solFuncCall,solConstant,solNumber,solMethod,solTypeCast,solComma,solOperator
|
syn region solFuncCallParens contained transparent contains=solComment,solString,solFuncCall,solConstant,solNumber,solMethod,solTypeCast,solComma,solOperator
|
||||||
\ start='('
|
\ start='('
|
||||||
\ end=')'
|
\ end=')'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ endif
|
|||||||
" Language: sway config file
|
" Language: sway config file
|
||||||
" Original Author: Mohamed Boughaba <mohamed dot bgb at gmail dot com>
|
" Original Author: Mohamed Boughaba <mohamed dot bgb at gmail dot com>
|
||||||
" Maintainer: James Eapen <jamespeapen at gmail dot com>
|
" Maintainer: James Eapen <jamespeapen at gmail dot com>
|
||||||
" Version: 1.0
|
" Version: 0.11.6
|
||||||
" Last Change: 2020-10-07
|
" Last Change: 2020-10-07
|
||||||
|
|
||||||
" References:
|
" References:
|
||||||
@@ -60,30 +60,41 @@ syn match swayConfigInitialize /^\s*set\s\+.*$/ contains=swayConfigVariable,sway
|
|||||||
" Gaps
|
" Gaps
|
||||||
syn keyword swayConfigGapStyleKeyword inner outer horizontal vertical top right bottom left current all set plus minus toggle up down contained
|
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 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 keyword swayConfigSmartGapKeyword on inverse_outer off contained
|
||||||
syn match swayConfigSmartGap /^\s*smart_gaps\s\+\(on\|inverse_outer\)\s\?$/ contains=swayConfigSmartGapKeyword
|
syn match swayConfigSmartGap /^\s*smart_gaps\s\+\(on\|inverse_outer\|off\)\s\?$/ contains=swayConfigSmartGapKeyword
|
||||||
syn keyword swayConfigSmartBorderKeyword on no_gaps contained
|
syn keyword swayConfigSmartBorderKeyword on no_gaps off contained
|
||||||
syn match swayConfigSmartBorder /^\s*smart_borders\s\+\(on\|no_gaps\)\s\?$/ contains=swayConfigSmartBorderKeyword
|
syn match swayConfigSmartBorder /^\s*smart_borders\s\+\(on\|no_gaps\|off\)\s\?$/ contains=swayConfigSmartBorderKeyword
|
||||||
|
|
||||||
" Keyboard bindings
|
" Keyboard bindings
|
||||||
syn keyword swayConfigAction toggle fullscreen restart key import kill shrink grow contained
|
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 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 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 swayConfigUnit /\sp\(pt\|x\)/ contained
|
||||||
syn match swayConfigUnitOr /\sor/ 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 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
|
" 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 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 keyword swayConfigSizeSpecial x contained
|
||||||
syn match swayConfigNegativeSize /-/ contained
|
syn match swayConfigNegativeSize /-/ contained
|
||||||
syn match swayConfigSize /-\?\d\+\s\?x\s\?-\?\d\+/ contained contains=swayConfigSizeSpecial,swayConfigNumber,swayConfigNegativeSize
|
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
|
" Orientation
|
||||||
syn keyword swayConfigOrientationKeyword vertical horizontal auto contained
|
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 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
|
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
|
" Automatically putting workspaces on specific screens
|
||||||
syn keyword swayConfigWorkspaceKeyword workspace contained
|
syn keyword swayConfigWorkspaceKeyword workspace contained
|
||||||
syn keyword swayConfigOutputKeyword output 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
|
syn match swayConfigFocus /^\s*focus\soutput\s.*$/ contains=swayConfigFocusKeyword,swayConfigFocusType
|
||||||
|
|
||||||
" Changing colors
|
" Changing colors
|
||||||
syn keyword swayConfigClientColorKeyword client focused focused_inactive unfocused urgent placeholder background contained
|
syn keyword swayConfigClientKeyword client contained
|
||||||
syn match swayConfigClientColor /^\s*client.\w\+\s\+.*$/ contains=swayConfigClientColorKeyword,swayConfigColor,swayConfigVariable
|
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 keyword swayConfigTitleAlignKeyword left center right contained
|
||||||
syn match swayConfigTitleAlign /^\s*title_align\s\+.*$/ contains=swayConfigTitleAlignKeyword
|
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
|
" Focus follows mouse
|
||||||
syn keyword swayConfigFocusFollowsMouseKeyword focus_follows_mouse contained
|
syn keyword swayConfigFocusFollowsMouseKeyword focus_follows_mouse contained
|
||||||
syn keyword swayConfigFocusFollowsMouseType yes no contained
|
syn keyword swayConfigFocusFollowsMouseType yes no always contained
|
||||||
syn match swayConfigFocusFollowsMouse /^\s*focus_follows_mouse\s\+\(yes\|no\)\s\?$/ contains=swayConfigFocusFollowsMouseKeyword,swayConfigFocusFollowsMouseType
|
syn match swayConfigFocusFollowsMouse /^\s*focus_follows_mouse\s\+\(yes\|no\|always\)\s\?$/ contains=swayConfigFocusFollowsMouseKeyword,swayConfigFocusFollowsMouseType
|
||||||
|
|
||||||
" Popups during fullscreen mode
|
" Popups during fullscreen mode
|
||||||
syn keyword swayConfigPopupOnFullscreenKeyword popup_during_fullscreen contained
|
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
|
syn match swayConfigDrawingMarks /^\s*show_marks\s\+\(yes\|no\)\s\?$/ contains=swayConfigFocusWrappingType,swayConfigDrawingMarksKeyword
|
||||||
|
|
||||||
" Group mode/bar
|
" 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 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,swayConfigBind,swayConfigComment,swayConfigFont,swayConfigFocusWrappingType,swayConfigColor,swayConfigVariable transparent keepend extend
|
syn region swayConfigBlock start=+.*s\?{$+ end=+^}$+ contains=swayConfigBlockKeyword,swayConfigString,swayConfigAction,swayConfigBind,swayConfigComment,swayConfigFont,swayConfigFocusWrappingType,swayConfigColor,swayConfigVariable,swayConfigInputKeyword,swayConfigOutputKeyword transparent keepend extend
|
||||||
|
|
||||||
" Line continuation
|
" 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
|
" Includes with relative paths to config files
|
||||||
syn keyword swayConfigInclude include contained
|
syn keyword swayConfigInclude include contained
|
||||||
syn match swayConfigFile /^include\s\(\~\?\/.*$\|\.\{0,2}\/.*$\)/ contains=swayConfigInclude
|
syn match swayConfigFile /^\s\?include\s\+.*$/ contains=swayConfigInclude
|
||||||
|
|
||||||
" xwayland
|
" xwayland
|
||||||
syn keyword swayConfigXwaylandKeyword xwayland contained
|
syn keyword swayConfigXwaylandKeyword xwayland contained
|
||||||
@@ -227,9 +243,14 @@ hi! def link swayConfigEdgeKeyword Type
|
|||||||
hi! def link swayConfigAction Type
|
hi! def link swayConfigAction Type
|
||||||
hi! def link swayConfigCommand Type
|
hi! def link swayConfigCommand Type
|
||||||
hi! def link swayConfigOutputKeyword Type
|
hi! def link swayConfigOutputKeyword Type
|
||||||
|
hi! def link swayConfigInputKeyword Type
|
||||||
hi! def link swayConfigWindowCommandSpecial Type
|
hi! def link swayConfigWindowCommandSpecial Type
|
||||||
hi! def link swayConfigFocusWrappingType Type
|
hi! def link swayConfigFocusWrappingType Type
|
||||||
hi! def link swayConfigUnitOr 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 swayConfigFontSize Constant
|
||||||
hi! def link swayConfigColor Constant
|
hi! def link swayConfigColor Constant
|
||||||
hi! def link swayConfigNumber Constant
|
hi! def link swayConfigNumber Constant
|
||||||
@@ -247,8 +268,10 @@ hi! def link swayConfigAssignSpecial Special
|
|||||||
hi! def link swayConfigFontNamespace PreProc
|
hi! def link swayConfigFontNamespace PreProc
|
||||||
hi! def link swayConfigBindArgument PreProc
|
hi! def link swayConfigBindArgument PreProc
|
||||||
hi! def link swayConfigNoStartupId PreProc
|
hi! def link swayConfigNoStartupId PreProc
|
||||||
|
hi! def link swayConfigBindGesture PreProc
|
||||||
hi! def link swayConfigFontKeyword Identifier
|
hi! def link swayConfigFontKeyword Identifier
|
||||||
hi! def link swayConfigBindKeyword Identifier
|
hi! def link swayConfigBindKeyword Identifier
|
||||||
|
hi! def link swayConfigBindGestureCommand Identifier
|
||||||
hi! def link swayConfigOrientation Identifier
|
hi! def link swayConfigOrientation Identifier
|
||||||
hi! def link swayConfigGapStyle Identifier
|
hi! def link swayConfigGapStyle Identifier
|
||||||
hi! def link swayConfigTitleAlign Identifier
|
hi! def link swayConfigTitleAlign Identifier
|
||||||
@@ -257,7 +280,7 @@ hi! def link swayConfigSmartBorder Identifier
|
|||||||
hi! def link swayConfigLayout Identifier
|
hi! def link swayConfigLayout Identifier
|
||||||
hi! def link swayConfigBorderStyle Identifier
|
hi! def link swayConfigBorderStyle Identifier
|
||||||
hi! def link swayConfigEdge Identifier
|
hi! def link swayConfigEdge Identifier
|
||||||
hi! def link swayConfigFloating Identifier
|
hi! def link swayConfigFloatingSize Identifier
|
||||||
hi! def link swayConfigCommandKeyword Identifier
|
hi! def link swayConfigCommandKeyword Identifier
|
||||||
hi! def link swayConfigNoFocusKeyword Identifier
|
hi! def link swayConfigNoFocusKeyword Identifier
|
||||||
hi! def link swayConfigInitializeKeyword Identifier
|
hi! def link swayConfigInitializeKeyword Identifier
|
||||||
@@ -265,7 +288,7 @@ hi! def link swayConfigAssignKeyword Identifier
|
|||||||
hi! def link swayConfigResourceKeyword Identifier
|
hi! def link swayConfigResourceKeyword Identifier
|
||||||
hi! def link swayConfigExecKeyword Identifier
|
hi! def link swayConfigExecKeyword Identifier
|
||||||
hi! def link swayConfigWorkspaceKeyword Identifier
|
hi! def link swayConfigWorkspaceKeyword Identifier
|
||||||
hi! def link swayConfigClientColorKeyword Identifier
|
hi! def link swayConfigClientKeyword Identifier
|
||||||
hi! def link swayConfigInterprocessKeyword Identifier
|
hi! def link swayConfigInterprocessKeyword Identifier
|
||||||
hi! def link swayConfigMouseWarpingKeyword Identifier
|
hi! def link swayConfigMouseWarpingKeyword Identifier
|
||||||
hi! def link swayConfigFocusFollowsMouseKeyword Identifier
|
hi! def link swayConfigFocusFollowsMouseKeyword Identifier
|
||||||
@@ -281,6 +304,7 @@ hi! def link swayConfigVariable Statement
|
|||||||
hi! def link swayConfigArbitraryCommand Type
|
hi! def link swayConfigArbitraryCommand Type
|
||||||
hi! def link swayConfigInclude Identifier
|
hi! def link swayConfigInclude Identifier
|
||||||
hi! def link swayConfigFile Constant
|
hi! def link swayConfigFile Constant
|
||||||
|
hi! def link swayConfigFloatingKeyword Identifier
|
||||||
hi! def link swayConfigFloatingModifier Identifier
|
hi! def link swayConfigFloatingModifier Identifier
|
||||||
hi! def link swayConfigFloatingMouseAction Type
|
hi! def link swayConfigFloatingMouseAction Type
|
||||||
hi! def link swayConfigFocusKeyword Type
|
hi! def link swayConfigFocusKeyword Type
|
||||||
|
|||||||
@@ -192,6 +192,7 @@ syntax match swiftMultiwordKeywords "indirect enum"
|
|||||||
syntax region swiftEscapedReservedWord start="`" end="`" oneline
|
syntax region swiftEscapedReservedWord start="`" end="`" oneline
|
||||||
|
|
||||||
syntax keyword swiftAttributes
|
syntax keyword swiftAttributes
|
||||||
|
\ @_disfavoredOverload
|
||||||
\ @_exported
|
\ @_exported
|
||||||
\ @_implementationOnly
|
\ @_implementationOnly
|
||||||
\ @_silgen_name
|
\ @_silgen_name
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'tmux', 'syntax/tmux.vim')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Language: tmux(1) configuration file
|
" Language: tmux(1) configuration file
|
||||||
" Version: 3.3-rc (git-8bcd392e)
|
" Version: 3.3a (git-7b8ececd)
|
||||||
" URL: https://github.com/ericpruitt/tmux.vim/
|
" URL: https://github.com/ericpruitt/tmux.vim/
|
||||||
" Maintainer: Eric Pruitt <eric.pruitt@gmail.com>
|
" Maintainer: Eric Pruitt <eric.pruitt@gmail.com>
|
||||||
" License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause)
|
" 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
|
\ switch-client switchc unbind unbind-key unlink-window unlinkw wait wait-for
|
||||||
|
|
||||||
syn keyword tmuxEnums
|
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
|
\ blinking-underline block both bottom centre color colour current default
|
||||||
\ double emacs external failed heavy largest latest left manual no-detached
|
\ double emacs external failed heavy largest latest left manual no-detached
|
||||||
\ none number off on other padded right rounded simple single smallest top
|
\ none number off on other padded right rounded simple single smallest top
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ call TestFiletype('fish')
|
|||||||
call TestFiletype('fbs')
|
call TestFiletype('fbs')
|
||||||
call TestFiletype('forth')
|
call TestFiletype('forth')
|
||||||
call TestFiletype('fsharp')
|
call TestFiletype('fsharp')
|
||||||
call TestFiletype('gdscript3')
|
|
||||||
call TestFiletype('gitconfig')
|
call TestFiletype('gitconfig')
|
||||||
call TestFiletype('gitrebase')
|
call TestFiletype('gitrebase')
|
||||||
call TestFiletype('gitsendemail')
|
call TestFiletype('gitsendemail')
|
||||||
|
|||||||
Reference in New Issue
Block a user