mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Compare commits
15 Commits
v4.17.1
...
542f68ebc8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
542f68ebc8 | ||
|
|
692e359ad9 | ||
|
|
bc8a81d359 | ||
|
|
38282d5838 | ||
|
|
36a2bf60ad | ||
|
|
db7bb8ba22 | ||
|
|
aae85fe8c2 | ||
|
|
55eed00f71 | ||
|
|
db3a87a50b | ||
|
|
8bb9203790 | ||
|
|
32d08013a6 | ||
|
|
0e1b191209 | ||
|
|
a4f98d2a9e | ||
|
|
83422e0a1f | ||
|
|
8d4a480375 |
18
README.md
18
README.md
@@ -2,9 +2,7 @@ This is my top-starred repository on Github, so I've decided to put this ad here
|
||||
|
||||
If you work for big corp and seek consulting, please visit following repository: https://github.com/sheerun/consultation
|
||||
|
||||

|
||||
|
||||
[](https://github.com/sheerun/vim-polyglot/actions) []()
|
||||
 (Processing syntax highlighting for pde and ino files)
|
||||
- [asciidoc](https://github.com/asciidoc/vim-asciidoc) (AsciiDoc syntax highlighting for asciidoc, adoc and asc files)
|
||||
- [autohotkey](https://github.com/hnamikaw/vim-autohotkey) (AutoHotkey syntax highlighting for ahk and ahkl files)
|
||||
- [bicep](https://github.com/carlsmedstad/vim-bicep) (Syntax highlighting for bicep files)
|
||||
- [blade](https://github.com/jwalton512/vim-blade) (Blade syntax highlighting for blade and blade.php files)
|
||||
- [brewfile](https://github.com/bfontaine/Brewfile.vim)
|
||||
- [c/c++](https://github.com/vim-jp/vim-cpp) (C++ and C syntax highlighting for cpp, c++, cc, cp, cxx and 18 more files)
|
||||
- [caddyfile](https://github.com/isobit/vim-caddyfile)
|
||||
- [carp](https://github.com/hellerve/carp-vim) (Syntax highlighting for carp files)
|
||||
- [cjsx](https://github.com/mtscout6/vim-cjsx)
|
||||
- [clojure](https://github.com/clojure-vim/clojure.vim) (Clojure syntax highlighting for clj, boot, cl2, cljc, cljs, cljs.hl, cljscm, cljx, hic and edn files)
|
||||
- [clojure](https://github.com/clojure-vim/clojure.vim) (Clojure syntax highlighting for clj, bb, boot, cl2, cljc and 6 more files)
|
||||
- [cmake](https://github.com/pboettch/vim-cmake-syntax) (CMake syntax highlighting for cmake and cmake.in files)
|
||||
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (CoffeeScript and Literate CoffeeScript syntax highlighting for coffee, cake, cjsx, iced, coffeekup, cson, litcoffee and coffee.md files)
|
||||
- [cpp-modern](https://github.com/bfrg/vim-cpp-modern)
|
||||
@@ -85,7 +84,6 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [fish](https://github.com/blankname/vim-fish) (fish syntax highlighting for fish files)
|
||||
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers) (Syntax highlighting for fbs files)
|
||||
- [fsharp](https://github.com/ionide/Ionide-vim) (F# syntax highlighting for fs, fsi and fsx files)
|
||||
- [gdscript](https://github.com/calviken/vim-gdscript3) (GDScript syntax highlighting for gd files)
|
||||
- [git](https://github.com/tpope/vim-git) (Git Config syntax highlighting for gitconfig files)
|
||||
- [gitignore](https://github.com/SirJson/fzf-gitignore)
|
||||
- [gleam](https://github.com/gleam-lang/gleam.vim) (Syntax highlighting for gleam files)
|
||||
@@ -110,11 +108,11 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [idris](https://github.com/idris-hackers/idris-vim) (Idris syntax highlighting for idr and lidr files)
|
||||
- [ion](https://github.com/vmchale/ion-vim) (Syntax highlighting for ion files)
|
||||
- [javascript-sql](https://github.com/statico/vim-javascript-sql)
|
||||
- [javascript](https://github.com/pangloss/vim-javascript) (JavaScript syntax highlighting for js, bones, cjs, es, es6 and 18 more files)
|
||||
- [javascript](https://github.com/pangloss/vim-javascript) (JavaScript syntax highlighting for js, bones, cjs, es, es6 and 20 more 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)
|
||||
- [json5](https://github.com/GutenYe/json5.vim) (JSON5 syntax highlighting for json5 files)
|
||||
- [json](https://github.com/elzr/vim-json) (JSON syntax highlighting for json, avsc, geojson, gltf, har and 13 more files)
|
||||
- [json](https://github.com/elzr/vim-json) (JSON syntax highlighting for json, 4DForm, 4DProject, avsc, geojson and 15 more files)
|
||||
- [jsonc](https://github.com/neoclide/jsonc.vim) (Syntax highlighting for cjson and jsonc files)
|
||||
- [jsonnet](https://github.com/google/vim-jsonnet) (Jsonnet syntax highlighting for jsonnet and libsonnet files)
|
||||
- [jst](https://github.com/briancollins/vim-jst) (EJS syntax highlighting for ejs, ect, ejs.t and jst files)
|
||||
@@ -129,7 +127,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [log](https://github.com/MTDL9/vim-log-highlighting) (Syntax highlighting for log and LOG files)
|
||||
- [lua](https://github.com/tbastos/vim-lua) (Lua syntax highlighting for lua, fcgi, nse, p8, rbxs, rockspec and wlua files)
|
||||
- [mako](https://github.com/sophacles/vim-bundle-mako) (Mako syntax highlighting for mako and mao files)
|
||||
- [markdown](https://github.com/plasticboy/vim-markdown) (Markdown syntax highlighting for md, markdown, mdown, mdwn, mkd, mkdn, mkdown, ronn, scd and workbook files)
|
||||
- [markdown](https://github.com/plasticboy/vim-markdown) (Markdown syntax highlighting for md, livemd, markdown, mdown, mdwn and 6 more files)
|
||||
- [mathematica](https://github.com/voldikss/vim-mma) (Mathematica syntax highlighting for mathematica, cdf, m, ma, mt and 6 more files)
|
||||
- [mdx](https://github.com/jxnblk/vim-mdx-js) (Syntax highlighting for mdx files)
|
||||
- [mermaid](https://github.com/mracos/mermaid.vim/tree/main) (Syntax highlighting for mermaid, mm and mmd files)
|
||||
@@ -197,7 +195,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [toml](https://github.com/cespare/vim-toml/tree/main) (TOML syntax highlighting for toml files)
|
||||
- [tptp](https://github.com/c-cube/vim-tptp) (Syntax highlighting for p, tptp and ax files)
|
||||
- [twig](https://github.com/lumiliet/vim-twig) (Twig syntax highlighting for twig and xml.twig files)
|
||||
- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (TypeScript and TSX syntax highlighting for ts and tsx files)
|
||||
- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (TypeScript and TSX syntax highlighting for ts, cts, mts and tsx files)
|
||||
- [unison](https://github.com/unisonweb/unison/tree/trunk/editor-support/vim) (Syntax highlighting for u and uu files)
|
||||
- [v](https://github.com/ollykel/v-vim) (V syntax highlighting for v, vv and vsh files)
|
||||
- [vala](https://github.com/arrufat/vala.vim) (Vala syntax highlighting for vala, vapi and valadoc files)
|
||||
@@ -206,7 +204,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [velocity](https://github.com/lepture/vim-velocity) (Syntax highlighting for vm files)
|
||||
- [vue](https://github.com/posva/vim-vue) (Vue syntax highlighting for vue and wpy files)
|
||||
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax) (Syntax highlighting for xdc files)
|
||||
- [xml](https://github.com/amadeus/vim-xml) (XML syntax highlighting for xml, adml, admx, ant, axaml and 96 more files)
|
||||
- [xml](https://github.com/amadeus/vim-xml) (XML syntax highlighting for xml, adml, admx, ant, axaml and 97 more files)
|
||||
- [xsl](https://github.com/vim-scripts/XSLT-syntax) (XSLT syntax highlighting for xslt and xsl files)
|
||||
- [yard](https://github.com/noprompt/vim-yardoc)
|
||||
- [zephir](https://github.com/xwsoul/vim-zephir) (Zephir syntax highlighting for zep files)
|
||||
|
||||
@@ -8,7 +8,7 @@ endif
|
||||
" Original Author: Jon Haggblad <https://github.com/octol>
|
||||
" Maintainer: bfrg <https://github.com/bfrg>
|
||||
" Website: https://github.com/bfrg/vim-cpp-modern
|
||||
" Last Change: Nov 23, 2020
|
||||
" Last Change: Sep 15, 2022
|
||||
"
|
||||
" This syntax file is based on:
|
||||
" https://github.com/octol/vim-cpp-enhanced-highlight
|
||||
@@ -70,7 +70,7 @@ if !exists('cpp_no_cpp11')
|
||||
syntax keyword cppSTLnamespace chrono this_thread
|
||||
|
||||
syntax keyword cppSTLtype
|
||||
\ array atomic atomic_bool atomic_char atomic_flag atomic_int atomic_llong atomic_long atomic_schar atomic_short atomic_uchar atomic_uint atomic_ullong atomic_ulong atomic_ushort duration duration_values high_resolution_clock hours microseconds milliseconds minutes nanoseconds seconds steady_clock system_clock time_point treat_as_floating_point condition_variable exception_ptr nested_exception hash is_bind_expression is_placeholder reference_wrapper forward_list future packaged_task promise shared_future initializer_list codecvt_mode codecvt_utf16 codecvt_utf8 codecvt_utf8_utf16 wbuffer_convert wstring_convert allocator_traits allocator_type default_delete enable_shared_from_this is_always_equal owner_less pointer_safety pointer_traits propagate_on_container_copy_assignment propagate_on_container_move_assignment propagate_on_container_swap rebind_alloc rebind_traits shared_ptr unique_ptr uses_allocator void_pointer const_void_pointer weak_ptr condition_variable_any lock_guard mutex once_flag recursive_mutex recursive_timed_mutex timed_mutex unique_lock bernoulli_distribution binomial_distribution cauchy_distribution chi_squared_distribution default_random_engine discard_block_engine discrete_distribution exponential_distribution extreme_value_distribution fisher_f_distribution gamma_distribution geometric_distribution independent_bits_engine knuth_b linear_congruential_engine lognormal_distribution mersenne_twister_engine minstd_rand minstd_rand0 mt19937 mt19937_64 negative_binomial_distribution normal_distribution piecewise_constant_distribution piecewise_linear_distribution poisson_distribution random_device ranlux24 ranlux24_base ranlux48 ranlux48_base seed_seq shuffle_order_engine student_t_distribution subtract_with_carry_engine uniform_int_distribution uniform_real_distribution weibull_distribution atto centi deca deci exa femto giga hecto kilo mega micro milli nano peta pico ratio ratio_add ratio_divide ratio_equal ratio_greater ratio_greater_equal ratio_less ratio_less_equal ratio_multiply ratio_not_equal ratio_subtract tera yocto yotta zepto zetta basic_regex match_results regex_traits sub_match syntax_option_type match_flag_type error_type scoped_allocator_adaptor outer_allocator_type inner_allocator_type error_code error_condition error_category is_error_code_enum is_error_condition_enum thread tuple tuple_size tuple_element type_index add_const add_cv add_lvalue_reference add_pointer add_rvalue_reference add_volatile aligned_storage aligned_union alignment_of common_type conditional decay enable_if extent false_type has_virtual_destructor integral_constant is_abstract is_arithmetic is_array is_assignable is_base_of is_class is_compound is_const is_constructible is_convertible is_copy_assignable is_copy_constructible is_default_constructible is_destructible is_empty is_enum is_floating_point is_function is_fundamental is_integral is_literal_type is_lvalue_reference is_member_function_pointer is_member_object_pointer is_member_pointer is_move_assignable is_move_constructible is_nothrow_assignable is_nothrow_constructible is_nothrow_copy_assignable is_nothrow_copy_constructible is_nothrow_default_constructible is_nothrow_destructible is_nothrow_move_assignable is_nothrow_move_constructible is_object is_pod is_pointer is_polymorphic is_reference is_rvalue_reference is_same is_scalar is_signed is_standard_layout is_trivial is_trivially_assignable is_trivially_constructible is_trivially_copy_assignable is_trivially_copy_constructible is_trivially_copyable is_trivially_default_constructible is_trivially_destructible is_trivially_move_assignable is_trivially_move_constructible is_union is_unsigned is_void is_volatile make_signed make_unsigned rank remove_all_extents remove_const remove_cv remove_extent remove_pointer remove_reference remove_volatile result_of true_type underlying_type hasher key_equal unordered_map unordered_multimap unordered_multiset unordered_set function
|
||||
\ array atomic atomic_bool atomic_char atomic_flag atomic_int atomic_llong atomic_long atomic_schar atomic_short atomic_uchar atomic_uint atomic_ullong atomic_ulong atomic_ushort duration duration_values high_resolution_clock hours microseconds milliseconds minutes nanoseconds seconds steady_clock system_clock time_point treat_as_floating_point condition_variable exception_ptr nested_exception hash is_bind_expression is_placeholder reference_wrapper forward_list future packaged_task promise shared_future initializer_list codecvt_mode codecvt_utf16 codecvt_utf8 codecvt_utf8_utf16 wbuffer_convert wstring_convert allocator_traits allocator_type default_delete enable_shared_from_this is_always_equal owner_less pointer_safety pointer_traits propagate_on_container_copy_assignment propagate_on_container_move_assignment propagate_on_container_swap rebind_alloc rebind_traits shared_ptr unique_ptr uses_allocator void_pointer const_void_pointer weak_ptr condition_variable_any lock_guard mutex once_flag recursive_mutex recursive_timed_mutex timed_mutex unique_lock bernoulli_distribution binomial_distribution cauchy_distribution chi_squared_distribution default_random_engine discard_block_engine discrete_distribution exponential_distribution extreme_value_distribution fisher_f_distribution gamma_distribution geometric_distribution independent_bits_engine knuth_b linear_congruential_engine lognormal_distribution mersenne_twister_engine minstd_rand minstd_rand0 mt19937 mt19937_64 negative_binomial_distribution normal_distribution piecewise_constant_distribution piecewise_linear_distribution poisson_distribution random_device ranlux24 ranlux24_base ranlux48 ranlux48_base seed_seq shuffle_order_engine student_t_distribution subtract_with_carry_engine uniform_int_distribution uniform_real_distribution weibull_distribution atto centi deca deci exa femto giga hecto kilo mega micro milli nano peta pico ratio ratio_add ratio_divide ratio_equal ratio_greater ratio_greater_equal ratio_less ratio_less_equal ratio_multiply ratio_not_equal ratio_subtract tera yocto yotta zepto zetta basic_regex regex wregex match_results regex_traits sub_match syntax_option_type match_flag_type error_type scoped_allocator_adaptor outer_allocator_type inner_allocator_type error_code error_condition error_category is_error_code_enum is_error_condition_enum thread tuple tuple_size tuple_element type_index add_const add_cv add_lvalue_reference add_pointer add_rvalue_reference add_volatile aligned_storage aligned_union alignment_of common_type conditional decay enable_if extent false_type has_virtual_destructor integral_constant is_abstract is_arithmetic is_array is_assignable is_base_of is_class is_compound is_const is_constructible is_convertible is_copy_assignable is_copy_constructible is_default_constructible is_destructible is_empty is_enum is_floating_point is_function is_fundamental is_integral is_literal_type is_lvalue_reference is_member_function_pointer is_member_object_pointer is_member_pointer is_move_assignable is_move_constructible is_nothrow_assignable is_nothrow_constructible is_nothrow_copy_assignable is_nothrow_copy_constructible is_nothrow_default_constructible is_nothrow_destructible is_nothrow_move_assignable is_nothrow_move_constructible is_object is_pod is_pointer is_polymorphic is_reference is_rvalue_reference is_same is_scalar is_signed is_standard_layout is_trivial is_trivially_assignable is_trivially_constructible is_trivially_copy_assignable is_trivially_copy_constructible is_trivially_copyable is_trivially_default_constructible is_trivially_destructible is_trivially_move_assignable is_trivially_move_constructible is_union is_unsigned is_void is_volatile make_signed make_unsigned rank remove_all_extents remove_const remove_cv remove_extent remove_pointer remove_reference remove_volatile result_of true_type underlying_type hasher key_equal unordered_map unordered_multimap unordered_multiset unordered_set function
|
||||
|
||||
syntax keyword cppSTLtypedef
|
||||
\ atomic_char16_t atomic_char32_t atomic_int_fast16_t atomic_int_fast32_t atomic_int_fast64_t atomic_int_fast8_t atomic_int_least16_t atomic_int_least32_t atomic_int_least64_t atomic_int_least8_t atomic_intmax_t atomic_intptr_t atomic_ptrdiff_t atomic_size_t atomic_uint_fast16_t atomic_uint_fast32_t atomic_uint_fast64_t atomic_uint_fast8_t atomic_uint_least16_t atomic_uint_least32_t atomic_uint_least64_t atomic_uint_least8_t atomic_uintmax_t atomic_uintptr_t atomic_wchar_t nullptr_t max_align_t allocator_arg_t adopt_lock_t defer_lock_t try_to_lock_t piecewise_construct_t
|
||||
@@ -92,7 +92,6 @@ if !exists('cpp_no_cpp11')
|
||||
syntax keyword cppSTLexception
|
||||
\ bad_function_call future_error regex_error system_error bad_weak_ptr bad_array_new_length
|
||||
|
||||
" syntax keyword cppSTLiterator contained
|
||||
syntax keyword cppSTLiterator
|
||||
\ move_iterator regex_iterator regex_token_iterator const_local_iterator local_iterator
|
||||
|
||||
@@ -120,7 +119,7 @@ if !exists('cpp_no_cpp17')
|
||||
syntax keyword cppSTLnamespace filesystem execution string_view_literals
|
||||
|
||||
syntax keyword cppSTLtype
|
||||
\ any byte is_execution_policy parallel_policy parallel_unsequenced_policy sequenced_policy directory_entry directory_iterator file_status file_time_type path recursive_directory_iterator space_info default_order default_searcher boyer_moore_searcher boyer_moore_horspool_searcher memory_resource monotonic_buffer_resource polymorphic_allocator pool_options synchronized_pool_resource unsynchronized_pool_resource scoped_lock optional shared_mutex basic_string_view string_view u16string_view u32string_view wstring_view bool_constant conjunction disjunction has_unique_object_representations invoke_result is_aggregate is_callable is_invocable is_invocable_r is_nothrow_invocable is_nothrow_invocable_r is_nothrow_swappable is_nothrow_swappable_with is_nowthrow_callable is_swappable is_swappable_with negation node_type insert_return_type in_place_tag monostate variant variant_size variant_alternative
|
||||
\ any byte is_execution_policy parallel_policy parallel_unsequenced_policy sequenced_policy directory_entry directory_iterator file_status file_time_type path recursive_directory_iterator space_info default_order default_searcher boyer_moore_searcher boyer_moore_horspool_searcher memory_resource monotonic_buffer_resource polymorphic_allocator pool_options synchronized_pool_resource unsynchronized_pool_resource scoped_lock optional shared_mutex basic_string_view string_view u16string_view u32string_view wstring_view bool_constant conjunction disjunction has_unique_object_representations invoke_result is_aggregate is_callable is_invocable is_invocable_r is_nothrow_invocable is_nothrow_invocable_r is_nothrow_swappable is_nothrow_swappable_with is_nowthrow_callable is_swappable is_swappable_with negation node_type insert_return_type in_place_tag monostate variant variant_size variant_alternative from_chars_result to_chars_result chars_format
|
||||
|
||||
syntax keyword cppSTLtypedef
|
||||
\ invoke_result_t default_order_t nullopt_t void_t in_place_t in_place_type_t in_place_index_t variant_alternative_t
|
||||
@@ -157,12 +156,13 @@ if !exists('cpp_no_cpp20')
|
||||
syntax keyword cppSTLnamespace ranges views
|
||||
syntax keyword cppSTLconstant dynamic_extent
|
||||
syntax keyword cppSTLvariable default_sentinel unreachable_sentinel
|
||||
syntax keyword cppSTLexception format_error
|
||||
|
||||
syntax keyword cppSTLtype
|
||||
\ atomic_ref endian weak_ordering strong_ordering partial_ordering weak_equality strong_equality common_comparison_category contract_violation coroutine_traits coroutine_handle noop_coroutine_handle noop_coroutine_promise suspend_never suspend_always remove_cvref is_bounded_array is_layout_compatible is_unbounded_array is_nothrow_convertible has_strong_structural_equality is_pointer_interconvertible_base_of unwrap_reference unwrap_ref_decay basic_common_reference common_reference dangling ref_view filter_view transform_view iota_view join_view empty_view single_view split_view common_view reverse_view view_interface span basic_syncbuf basic_osyncstream syncbuf wsyncbuf osyncstream wosyncstream jthread latch barrier stop_token stop_source stop_callback counting_semaphore binary_semaphore source_location compare_three_way_result contiguous_iterator_tag incrementable_traits indirectly_readable_traits move_sentinel common_iterator counted_iterator projected type_identity
|
||||
\ atomic_ref endian weak_ordering strong_ordering partial_ordering weak_equality strong_equality common_comparison_category contract_violation coroutine_traits coroutine_handle noop_coroutine_handle noop_coroutine_promise suspend_never suspend_always remove_cvref is_bounded_array is_layout_compatible is_unbounded_array is_nothrow_convertible has_strong_structural_equality is_pointer_interconvertible_base_of unwrap_reference unwrap_ref_decay basic_common_reference common_reference dangling ref_view filter_view transform_view iota_view join_view empty_view single_view split_view common_view reverse_view view_interface span basic_syncbuf basic_osyncstream syncbuf wsyncbuf osyncstream wosyncstream jthread latch barrier stop_token stop_source stop_callback counting_semaphore binary_semaphore source_location compare_three_way_result contiguous_iterator_tag incrementable_traits indirectly_readable_traits move_sentinel common_iterator counted_iterator projected type_identity formatter basic_format_context basic_format_args basic_format_string basic_format_parse_context
|
||||
|
||||
syntax keyword cppSTLtypedef
|
||||
\ common_comparison_category_t remove_cvref_t unwrap_reference_t unwrap_ref_decay_t common_reference_t iterator_t sentinel_t safe_iterator_t safe_subrange_t compare_three_way_result_t iter_value_t iter_reference_t iter_difference_t iter_rvalue_reference_t iter_common_reference_t default_sentinel_t unreachable_sentinel_t indirect_result_t type_identity_t
|
||||
\ common_comparison_category_t remove_cvref_t unwrap_reference_t unwrap_ref_decay_t common_reference_t iterator_t sentinel_t safe_iterator_t safe_subrange_t compare_three_way_result_t iter_value_t iter_reference_t iter_difference_t iter_rvalue_reference_t iter_common_reference_t default_sentinel_t unreachable_sentinel_t indirect_result_t type_identity_t format_context wformat_context format_args wformat_args format_string wformat_string format_parse_context wformat_parse_context
|
||||
|
||||
syntax keyword cppSTLfunction
|
||||
\ make_unique_default_init make_shared_default_init allocate_shared_default_init uses_allocator_construction_args make_obj_using_allocator is_corresponding_member subspan in_range is_pointer_interconvertible_with_class
|
||||
@@ -175,6 +175,17 @@ if !exists('cpp_no_cpp20')
|
||||
endif
|
||||
|
||||
|
||||
" C++23 extensions {{{1
|
||||
if !exists('cpp_no_cpp23')
|
||||
syntax keyword cppSTLtype basic_stacktrace stacktrace_entry is_scoped_enum
|
||||
syntax keyword cppSTLtypedef stacktrace
|
||||
syntax keyword cppSTLbool is_scoped_enum_v
|
||||
syntax keyword cppSTLfunction invoke_r
|
||||
syntax keyword cppSTLtype expected unexpected unexpect_t bad_expected_access
|
||||
syntax keyword cppSTLvariable unexpect
|
||||
endif
|
||||
|
||||
|
||||
" Boost {{{1
|
||||
if !exists('cpp_no_boost')
|
||||
syntax keyword cppSTLnamespace boost
|
||||
|
||||
@@ -38,5 +38,5 @@ if exists('s:current_syntax')
|
||||
let b:current_syntax = s:current_syntax
|
||||
endif
|
||||
|
||||
syntax region graphqlExtensionPoint start=+\[%graphql+ end=+\]+ contains=graphqlExtensionPointS
|
||||
syntax region graphqlExtensionPoint start=+\[%\(graphql\|relay\)+ end=+\]+ contains=graphqlExtensionPointS
|
||||
syntax region graphqlExtensionPointS matchgroup=String start=+{|+ end=+|}+ contains=@GraphQLSyntax contained
|
||||
|
||||
@@ -38,5 +38,5 @@ if exists('s:current_syntax')
|
||||
let b:current_syntax = s:current_syntax
|
||||
endif
|
||||
|
||||
syntax region graphqlExtensionPoint start=+%graphql(+ end=+)+ contains=graphqlExtensionPointS
|
||||
syntax region graphqlExtensionPoint start=+%\(graphql\|relay\)(+ end=+)+ contains=graphqlExtensionPointS
|
||||
syntax region graphqlExtensionPointS matchgroup=String start=+`+ end=+`+ contains=@GraphQLSyntax contained
|
||||
|
||||
@@ -82,7 +82,7 @@ syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(param\)"+ skip=+\\"
|
||||
\ contains=ZinitIceDoubleQuoteParam
|
||||
|
||||
" added by the existing annexes
|
||||
syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(fbin\|sbin\|gem\|node\|pip\|fmod\|fsrc\|ferc\)"+ skip=+\\"+ end=+"+ skipwhite contained
|
||||
syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(fbin\|lbin\|sbin\|gem\|node\|pip\|fmod\|fsrc\|ferc\)"+ skip=+\\"+ end=+"+ skipwhite contained
|
||||
\ nextgroup=@ZinitLine,ZinitContinue
|
||||
\ contains=ZinitIceDoubleQuoteParam
|
||||
syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(dl\|patch\|submods\|cargo\|dlink\|dlink0\)"+ skip=+\\"+ end=+"+ skipwhite contained
|
||||
@@ -118,7 +118,7 @@ syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(param\)'+ skip=+\\'
|
||||
\ contains=ZinitIceSingleQuoteParam
|
||||
|
||||
" added by the existing annexes
|
||||
syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(fbin\|sbin\|gem\|node\|pip\|fmod\|fsrc\|ferc\)'+ skip=+\\'+ end=+'+ skipwhite contained
|
||||
syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(fbin\|lbin\|sbin\|gem\|node\|pip\|fmod\|fsrc\|ferc\)'+ skip=+\\'+ end=+'+ skipwhite contained
|
||||
\ nextgroup=@ZinitLine,ZinitContinue
|
||||
\ contains=ZinitIceSingleQuoteParam
|
||||
syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(dl\|patch\|submods\|cargo\|dlink\|dlink0\)'+ skip=+\\'+ end=+'+ skipwhite contained
|
||||
|
||||
@@ -348,7 +348,7 @@ endfunction
|
||||
" It returns the previous maparg dictionary, so that the previous mapping can
|
||||
" be reinstated if needed.
|
||||
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")
|
||||
exe 'inoremap <buffer> ' . a:k . ' ' . a:s
|
||||
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.
|
||||
let g:crystal#indent#hanging_assignment_regex =
|
||||
\ '\%('.g:crystal#indent#operator_regex.'\s*\)\@<=' .
|
||||
\ '\.\@1<!\<\%(if\||unless\|case\|begin\)\>'
|
||||
\ '\.\@1<!\<\%(if\||unless\|case\|begin\|select\)\>'
|
||||
lockvar g:crystal#indent#hanging_assignment_regex
|
||||
|
||||
" Regex that defines the start-match for the 'end' keyword.
|
||||
@@ -107,7 +107,7 @@ let g:crystal#indent#end_start_regex =
|
||||
\ '\%(\<\%(private\|protected\)\s\+\)\=' .
|
||||
\ '\%(\<\%(abstract\s\+\)\=\%(class\|struct\)\>\|\<\%(def\|module\|macro\|lib\|enum\|annotation\)\>\)' .
|
||||
\ '\|' .
|
||||
\ '\<\%(if\|unless\|while\|until\|case\|begin\|union\)\>' .
|
||||
\ '\<\%(if\|unless\|while\|until\|case\|begin\|union\|select\)\>' .
|
||||
\ '\)' .
|
||||
\ '\|' .
|
||||
\ g:crystal#indent#hanging_assignment_regex .
|
||||
@@ -1042,4 +1042,4 @@ endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
" vim:sw=2 sts=2 ts=8 fdm=marker et:
|
||||
" vim:sw=2 sts=2 ts=8 fdm=marker et:
|
||||
|
||||
@@ -826,8 +826,8 @@ fu! csv#Columnize(field) "{{{3
|
||||
let colnr = s:columnize_count % s:max_cols
|
||||
let width = get(b:col_width, colnr, 20)
|
||||
let align = 'r'
|
||||
if exists('b:csv_arrange_align')
|
||||
let align=b:csv_arrange_align
|
||||
if exists('b:csv_arrange_align') || exists('g:csv_arrange_align')
|
||||
let align=get(b:, 'csv_arrange_align', g:csv_arrange_align)
|
||||
let indx=match(align, '\*')
|
||||
if indx > 0
|
||||
let align = align[0:(indx-1)]. repeat(align[indx-1], len(b:col_width)-indx)
|
||||
@@ -934,6 +934,11 @@ fu! csv#GetColPat(colnr, zs_flag) "{{{3
|
||||
endfu
|
||||
fu! csv#SetupAutoCmd(window,bufnr) "{{{3
|
||||
" Setup QuitPre autocommand to quit cleanly
|
||||
if a:bufnr == 0
|
||||
" something went wrong,
|
||||
" how can this happen?
|
||||
return
|
||||
endif
|
||||
aug CSV_QuitPre
|
||||
au!
|
||||
exe "au QuitPre * call CSV_CloseBuffer(".winbufnr(a:window).")"
|
||||
@@ -1024,7 +1029,7 @@ fu! csv#SplitHeaderLine(lines, bang, hor) "{{{3
|
||||
" disable airline
|
||||
let w:airline_disabled = 1
|
||||
let win = winnr()
|
||||
setl scrollbind buftype=nowrite bufhidden=wipe noswapfile nobuflisted
|
||||
setl scrollbind buftype=nofile bufhidden=wipe noswapfile nobuflisted
|
||||
noa wincmd p
|
||||
let b:csv_SplitWindow = win
|
||||
aug CSV_Preview
|
||||
|
||||
@@ -92,9 +92,9 @@ endfunction
|
||||
|
||||
" Finds the path to `uri`.
|
||||
"
|
||||
" If the file is a package: uri, looks for a .packages file to resolve the path.
|
||||
" If the path cannot be resolved, or is not a package: uri, returns the
|
||||
" original.
|
||||
" If the file is a package: uri, looks for a package_config.json or .packages
|
||||
" file to resolve the path. If the path cannot be resolved, or is not a
|
||||
" package: uri, returns the original.
|
||||
function! dart#resolveUri(uri) abort
|
||||
if a:uri !~# 'package:'
|
||||
return a:uri
|
||||
@@ -102,7 +102,7 @@ function! dart#resolveUri(uri) abort
|
||||
let package_name = substitute(a:uri, 'package:\(\w\+\)\/.*', '\1', '')
|
||||
let [found, package_map] = s:PackageMap()
|
||||
if !found
|
||||
call s:error('cannot find .packages file')
|
||||
call s:error('cannot find .packages or package_config.json file')
|
||||
return a:uri
|
||||
endif
|
||||
if !has_key(package_map, package_name)
|
||||
@@ -116,37 +116,63 @@ function! dart#resolveUri(uri) abort
|
||||
\ '')
|
||||
endfunction
|
||||
|
||||
" A map from package name to lib directory parse from a '.packages' file.
|
||||
" A map from package name to lib directory parse from a 'package_config.json'
|
||||
" or '.packages' file.
|
||||
"
|
||||
" Returns [found, package_map]
|
||||
function! s:PackageMap() abort
|
||||
let [found, dot_packages] = s:DotPackagesFile()
|
||||
if !found
|
||||
return [v:false, {}]
|
||||
endif
|
||||
let dot_packages_dir = fnamemodify(dot_packages, ':p:h')
|
||||
let lines = readfile(dot_packages)
|
||||
let map = {}
|
||||
for line in lines
|
||||
if line =~# '\s*#'
|
||||
continue
|
||||
let [found, package_config] = s:FindFile('.dart_tool/package_config.json')
|
||||
if found
|
||||
let dart_tool_dir = fnamemodify(package_config, ':p:h')
|
||||
let content = join(readfile(package_config), "\n")
|
||||
let packages_dict = json_decode(content)
|
||||
if packages_dict['configVersion'] != '2'
|
||||
s:error('Unsupported version of package_config.json')
|
||||
return [v:false, {}]
|
||||
endif
|
||||
let package = substitute(line, ':.*$', '', '')
|
||||
let lib_dir = substitute(line, '^[^:]*:', '', '')
|
||||
if lib_dir =~# 'file:/'
|
||||
let lib_dir = substitute(lib_dir, 'file://', '', '')
|
||||
if lib_dir =~# '/[A-Z]:/'
|
||||
let lib_dir = lib_dir[1:]
|
||||
let map = {}
|
||||
for package in packages_dict['packages']
|
||||
let name = package['name']
|
||||
let uri = package['rootUri']
|
||||
let package_uri = package['packageUri']
|
||||
if uri =~# 'file:/'
|
||||
let uri = substitute(uri, 'file://', '', '')
|
||||
let lib_dir = resolve(uri.'/'.package_uri)
|
||||
else
|
||||
let lib_dir = resolve(dart_tool_dir.'/'.uri.'/'.package_uri)
|
||||
endif
|
||||
else
|
||||
let lib_dir = resolve(dot_packages_dir.'/'.lib_dir)
|
||||
endif
|
||||
if lib_dir =~# '/$'
|
||||
let lib_dir = lib_dir[:len(lib_dir) - 2]
|
||||
endif
|
||||
let map[package] = lib_dir
|
||||
endfor
|
||||
return [v:true, map]
|
||||
let map[name] = lib_dir
|
||||
endfor
|
||||
return [v:true, map]
|
||||
endif
|
||||
|
||||
let [found, dot_packages] = s:FindFile('.packages')
|
||||
if found
|
||||
let dot_packages_dir = fnamemodify(dot_packages, ':p:h')
|
||||
let lines = readfile(dot_packages)
|
||||
let map = {}
|
||||
for line in lines
|
||||
if line =~# '\s*#'
|
||||
continue
|
||||
endif
|
||||
let package = substitute(line, ':.*$', '', '')
|
||||
let lib_dir = substitute(line, '^[^:]*:', '', '')
|
||||
if lib_dir =~# 'file:/'
|
||||
let lib_dir = substitute(lib_dir, 'file://', '', '')
|
||||
if lib_dir =~# '/[A-Z]:/'
|
||||
let lib_dir = lib_dir[1:]
|
||||
endif
|
||||
else
|
||||
let lib_dir = resolve(dot_packages_dir.'/'.lib_dir)
|
||||
endif
|
||||
if lib_dir =~# '/$'
|
||||
let lib_dir = lib_dir[:len(lib_dir) - 2]
|
||||
endif
|
||||
let map[package] = lib_dir
|
||||
endfor
|
||||
return [v:true, map]
|
||||
endif
|
||||
return [v:false, {}]
|
||||
endfunction
|
||||
|
||||
" Toggle whether dartfmt is run on save or not.
|
||||
@@ -158,17 +184,17 @@ function! dart#ToggleFormatOnSave() abort
|
||||
let g:dart_format_on_save = 1
|
||||
endfunction
|
||||
|
||||
" Finds a file name '.packages' in the cwd, or in any directory above the open
|
||||
" Finds a file named [a:path] in the cwd, or in any directory above the open
|
||||
" file.
|
||||
"
|
||||
" Returns [found, file].
|
||||
function! s:DotPackagesFile() abort
|
||||
if filereadable('.packages')
|
||||
return [v:true, '.packages']
|
||||
" Returns [found, file]
|
||||
function! s:FindFile(path) abort
|
||||
if filereadable(a:path)
|
||||
return [v:true, a:path]
|
||||
endif
|
||||
let dir_path = expand('%:p:h')
|
||||
while v:true
|
||||
let file_path = dir_path.'/.packages'
|
||||
let file_path = dir_path.'/'.a:path
|
||||
if filereadable(file_path)
|
||||
return [v:true, file_path]
|
||||
endif
|
||||
|
||||
@@ -71,8 +71,6 @@ function! fish#Indent()
|
||||
let l:prevline = getline(l:prevlnum)
|
||||
let l:previndent = indent(l:prevlnum)
|
||||
if s:IsContinuedLine(v:lnum)
|
||||
" It is customary to increment indentation of continued lines by three
|
||||
" or a custom value defined by the user if available.
|
||||
let l:previndent = indent(v:lnum - 1)
|
||||
if s:IsContinuedLine(v:lnum - 1)
|
||||
return l:previndent
|
||||
@@ -81,7 +79,7 @@ function! fish#Indent()
|
||||
elseif exists('g:indent_cont')
|
||||
return l:previndent + g:indent_cont
|
||||
else
|
||||
return l:previndent + 3
|
||||
return l:previndent + l:shiftwidth
|
||||
endif
|
||||
endif
|
||||
if l:prevline =~# '\v^\s*%(begin|if|else|while|for|function|case|switch)>'
|
||||
|
||||
@@ -251,7 +251,7 @@ function! fsharp#loadConfig()
|
||||
let g:fsharp#automatic_reload_workspace = 1
|
||||
endif
|
||||
if !exists('g:fsharp#show_signature_on_cursor_move')
|
||||
let g:fsharp#show_signature_on_cursor_move = 1
|
||||
let g:fsharp#show_signature_on_cursor_move = 0
|
||||
endif
|
||||
if !exists('g:fsharp#fsi_command')
|
||||
let g:fsharp#fsi_command = "dotnet fsi"
|
||||
|
||||
@@ -117,8 +117,8 @@ function! s:unmap(function)
|
||||
return
|
||||
endif
|
||||
let mapids = a:function =~# "^move" ? ["n", "x", "o"] :
|
||||
\ a:function =~# "^select" ? ["x", "o"] :
|
||||
\ ["n"]
|
||||
\ a:function =~# "^select" ? ["x", "o"] :
|
||||
\ ["n"]
|
||||
let fn = "julia_blocks#" . a:function
|
||||
let cmd = "<buffer> " . chars
|
||||
for m in mapids
|
||||
@@ -355,10 +355,10 @@ function! s:move_before_begin()
|
||||
endfunction
|
||||
|
||||
function! s:cycle_until_end()
|
||||
let pos = getpos('.')
|
||||
let c = 0
|
||||
while !s:on_end()
|
||||
let pos = getpos('.')
|
||||
call s:matchit()
|
||||
let c = 0
|
||||
if getpos('.') == pos || c > 1000
|
||||
" shouldn't happen, but let's avoid infinite loops anyway
|
||||
return 0
|
||||
@@ -384,12 +384,12 @@ function! s:moveto_block_delim(toend, backwards, ...)
|
||||
while 1
|
||||
let searchret = search('\C' . pattern, flags)
|
||||
if !searchret
|
||||
return ret
|
||||
return ret
|
||||
endif
|
||||
exe "let skip = " . b:match_skip
|
||||
if !skip
|
||||
let ret = 1
|
||||
break
|
||||
let ret = 1
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
endfor
|
||||
@@ -495,15 +495,15 @@ function! julia_blocks#moveblock_N()
|
||||
let start1_pos = ret_start ? getpos('.') : [0,0,0,0]
|
||||
call setpos('.', save_pos)
|
||||
if s:on_end()
|
||||
normal! h
|
||||
normal! h
|
||||
endif
|
||||
let ret_end = s:moveto_block_delim(1, 0, 1)
|
||||
let end1_pos = ret_end ? getpos('.') : [0,0,0,0]
|
||||
|
||||
if ret_start && (!ret_end || s:compare_pos(start1_pos, end1_pos) < 0)
|
||||
call setpos('.', start1_pos)
|
||||
call setpos('.', start1_pos)
|
||||
else
|
||||
call setpos('.', save_pos)
|
||||
call setpos('.', save_pos)
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -564,7 +564,7 @@ function! julia_blocks#moveblock_p()
|
||||
if s:on_begin()
|
||||
call s:move_before_begin()
|
||||
if s:on_end()
|
||||
normal! l
|
||||
normal! l
|
||||
endif
|
||||
let save_pos = getpos('.')
|
||||
let ret_start = s:moveto_block_delim(0, 1, 1)
|
||||
@@ -574,9 +574,9 @@ function! julia_blocks#moveblock_p()
|
||||
let end1_pos = ret_end ? getpos('.') : [0,0,0,0]
|
||||
|
||||
if ret_end && (!ret_start || s:compare_pos(start1_pos, end1_pos) < 0)
|
||||
call setpos('.', end1_pos)
|
||||
call setpos('.', end1_pos)
|
||||
else
|
||||
call setpos('.', save_pos)
|
||||
call setpos('.', save_pos)
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -700,7 +700,7 @@ function! s:find_block(current_mode)
|
||||
endfunction
|
||||
|
||||
function! s:repeated_find(ai_mode)
|
||||
let repeat = b:jlblk_count + (a:ai_mode == 'i' && v:count1 > 1 ? 1 : 0)
|
||||
let repeat = b:jlblk_count + (a:ai_mode == 'i' && b:jlblk_count > 1 ? 1 : 0)
|
||||
for c in range(repeat)
|
||||
let current_mode = (c < repeat - 1 ? 'a' : a:ai_mode)
|
||||
let ret_find_block = s:find_block(current_mode)
|
||||
@@ -734,8 +734,8 @@ function! julia_blocks#select_a(...)
|
||||
|
||||
let b:jlblk_doing_select = 1
|
||||
|
||||
" CursorMove is only triggered if end_pos
|
||||
" end_pos is different than the staring position;
|
||||
" CursorMoved is only triggered if end_pos
|
||||
" is different than the staring position;
|
||||
" so when starting from the 'd' in 'end' we need to
|
||||
" force it
|
||||
if current_pos == end_pos
|
||||
@@ -746,6 +746,39 @@ function! julia_blocks#select_a(...)
|
||||
return [start_pos, end_pos]
|
||||
endfunction
|
||||
|
||||
let s:bracketBlocks = '\<julia\%(\%(\%(Printf\)\?Par\|SqBra\%(Idx\)\?\|CurBra\)Block\|ParBlockInRange\|StringVars\%(Par\|SqBra\|CurBra\)\|Dollar\%(Par\|SqBra\)\|QuotedParBlockS\?\)\>'
|
||||
let s:codeBlocks = '\<julia\%(Conditional\|While\|For\|Begin\|Function\|Macro\|Quote\|\%(Mutable\)\?Struct\|Let\|Do\|Exception\|Abstract\|Primitive\)Block\>'
|
||||
|
||||
function s:is_in_brackets(lnum, c)
|
||||
let stack = map(synstack(a:lnum, a:c), 'synIDattr(v:val, "name")')
|
||||
for i in range(len(stack)-1, 0, -1)
|
||||
if stack[i] =~# s:bracketBlocks
|
||||
return 1
|
||||
elseif stack[i] =~# s:codeBlocks
|
||||
return 0
|
||||
endif
|
||||
endfor
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:seek_bracket_end()
|
||||
let [lnum, c] = [line('.'), col('.')]
|
||||
if !s:is_in_brackets(lnum, c)
|
||||
return
|
||||
endif
|
||||
while c > 0 && s:is_in_brackets(lnum, c)
|
||||
let c -= 1
|
||||
endwhile
|
||||
let c += 1
|
||||
if !s:is_in_brackets(lnum, c)
|
||||
echoerr "this is a bug, please report it"
|
||||
return
|
||||
end
|
||||
call cursor(lnum, c)
|
||||
call s:matchit()
|
||||
return
|
||||
endfunction
|
||||
|
||||
function! julia_blocks#select_i()
|
||||
call s:get_save_pos(!b:jlblk_did_select)
|
||||
let current_pos = getpos('.')
|
||||
@@ -759,19 +792,32 @@ function! julia_blocks#select_i()
|
||||
return s:abort()
|
||||
endif
|
||||
|
||||
call setpos('.', end_pos)
|
||||
|
||||
let b:jlblk_doing_select = 1
|
||||
|
||||
let start_pos[1] += 1
|
||||
call setpos('.', start_pos)
|
||||
normal! ^
|
||||
normal! $
|
||||
call s:seek_bracket_end()
|
||||
let l = getline('.')
|
||||
while col('.') < len(l) && l[col('.'):] =~# '^\s*;'
|
||||
normal! l
|
||||
endwhile
|
||||
if col('.') == len(l) || l[col('.')] =~# '\s'
|
||||
normal! W
|
||||
else
|
||||
normal! l
|
||||
endif
|
||||
let start_pos = getpos('.')
|
||||
let end_pos[1] -= 1
|
||||
let end_pos[2] = len(getline(end_pos[1]))
|
||||
|
||||
" CursorMove is only triggered if end_pos
|
||||
" end_pos is different than the staring position;
|
||||
call setpos('.', end_pos)
|
||||
if end_pos[2] > 1 && getline('.')[end_pos[2]-2] =~# '\S'
|
||||
normal! h
|
||||
else
|
||||
normal! gE
|
||||
endif
|
||||
let end_pos = getpos('.')
|
||||
|
||||
" CursorMoved is only triggered if end_pos
|
||||
" is different than the staring position;
|
||||
" so when starting from the 'd' in 'end' we need to
|
||||
" force it
|
||||
if current_pos == end_pos
|
||||
|
||||
@@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'julia', 'autoload/julia_latex
|
||||
endif
|
||||
|
||||
" This file is autogenerated from the script 'generate_latex_symbols_table.jl'
|
||||
" The symbols are based on Julia version 1.5.0-DEV.67
|
||||
" The symbols are based on Julia version 1.9.0-DEV.16
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
@@ -267,7 +267,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\^c': 'ᶜ',
|
||||
\ '\^f': 'ᶠ',
|
||||
\ '\^iota': 'ᶥ',
|
||||
\ '\^Phi': 'ᶲ',
|
||||
\ '\^ltphi': 'ᶲ',
|
||||
\ '\^z': 'ᶻ',
|
||||
\ '\^theta': 'ᶿ',
|
||||
\ '\enspace': ' ',
|
||||
@@ -281,8 +281,8 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\lq': '‘',
|
||||
\ '\rq': '’',
|
||||
\ '\reapos': '‛',
|
||||
\ '\quotedblleft': '“',
|
||||
\ '\quotedblright': '”',
|
||||
\ '\ldq': '“',
|
||||
\ '\rdq': '”',
|
||||
\ '\dagger': '†',
|
||||
\ '\ddagger': '‡',
|
||||
\ '\bullet': '•',
|
||||
@@ -374,10 +374,12 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\scrH': 'ℋ',
|
||||
\ '\frakH': 'ℌ',
|
||||
\ '\bbH': 'ℍ',
|
||||
\ '\ith': 'ℎ',
|
||||
\ '\planck': 'ℎ',
|
||||
\ '\hslash': 'ℏ',
|
||||
\ '\scrI': 'ℐ',
|
||||
\ '\Im': 'ℑ',
|
||||
\ '\frakI': 'ℑ',
|
||||
\ '\scrL': 'ℒ',
|
||||
\ '\ell': 'ℓ',
|
||||
\ '\bbN': 'ℕ',
|
||||
@@ -387,6 +389,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bbQ': 'ℚ',
|
||||
\ '\scrR': 'ℛ',
|
||||
\ '\Re': 'ℜ',
|
||||
\ '\frakR': 'ℜ',
|
||||
\ '\bbR': 'ℝ',
|
||||
\ '\xrat': '℞',
|
||||
\ '\trademark': '™',
|
||||
@@ -759,7 +762,9 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\veebar': '⊻',
|
||||
\ '\xor': '⊻',
|
||||
\ '\barwedge': '⊼',
|
||||
\ '\nand': '⊼',
|
||||
\ '\barvee': '⊽',
|
||||
\ '\nor': '⊽',
|
||||
\ '\rightanglearc': '⊾',
|
||||
\ '\varlrtriangle': '⊿',
|
||||
\ '\bigwedge': '⋀',
|
||||
@@ -1009,6 +1014,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\astrosun': '☉',
|
||||
\ '\:phone:': '☎',
|
||||
\ '\:ballot_box_with_check:': '☑',
|
||||
\ '\:umbrella_with_rain_drops:': '☔',
|
||||
\ '\:umbrella:': '☔',
|
||||
\ '\:coffee:': '☕',
|
||||
\ '\:point_up:': '☝',
|
||||
@@ -1097,6 +1103,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:soccer:': '⚽',
|
||||
\ '\:baseball:': '⚾',
|
||||
\ '\:snowman:': '⛄',
|
||||
\ '\:snowman_without_snow:': '⛄',
|
||||
\ '\:partly_sunny:': '⛅',
|
||||
\ '\:ophiuchus:': '⛎',
|
||||
\ '\:no_entry:': '⛔',
|
||||
@@ -1352,8 +1359,8 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\intcup': '⨚',
|
||||
\ '\upint': '⨛',
|
||||
\ '\lowint': '⨜',
|
||||
\ '\Join': '⨝',
|
||||
\ '\join': '⨝',
|
||||
\ '\bbsemi': '⨟',
|
||||
\ '\ringplus': '⨢',
|
||||
\ '\plushat': '⨣',
|
||||
\ '\simplus': '⨤',
|
||||
@@ -1541,6 +1548,11 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\forksnot': '⫝',
|
||||
\ '\dashV': '⫣',
|
||||
\ '\Dashv': '⫤',
|
||||
\ '\Top': '⫪',
|
||||
\ '\downvDash': '⫪',
|
||||
\ '\upvDash': '⫫',
|
||||
\ '\Bot': '⫫',
|
||||
\ '\indep': '⫫',
|
||||
\ '\interleave': '⫴',
|
||||
\ '\tdcol': '⫶',
|
||||
\ '\lllnest': '⫷',
|
||||
@@ -1625,6 +1637,9 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:part_alternation_mark:': '〽',
|
||||
\ '\:congratulations:': '㊗',
|
||||
\ '\:secret:': '㊙',
|
||||
\ '\^uparrow': 'ꜛ',
|
||||
\ '\^downarrow': 'ꜜ',
|
||||
\ '\^!': 'ꜝ',
|
||||
\ '\bfA': '𝐀',
|
||||
\ '\bfB': '𝐁',
|
||||
\ '\bfC': '𝐂',
|
||||
@@ -2309,7 +2324,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bfbeta': '𝛃',
|
||||
\ '\bfgamma': '𝛄',
|
||||
\ '\bfdelta': '𝛅',
|
||||
\ '\bfepsilon': '𝛆',
|
||||
\ '\bfvarepsilon': '𝛆',
|
||||
\ '\bfzeta': '𝛇',
|
||||
\ '\bfeta': '𝛈',
|
||||
\ '\bftheta': '𝛉',
|
||||
@@ -2331,7 +2346,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bfpsi': '𝛙',
|
||||
\ '\bfomega': '𝛚',
|
||||
\ '\bfpartial': '𝛛',
|
||||
\ '\bfvarepsilon': '𝛜',
|
||||
\ '\bfepsilon': '𝛜',
|
||||
\ '\bfvartheta': '𝛝',
|
||||
\ '\bfvarkappa': '𝛞',
|
||||
\ '\bfphi': '𝛟',
|
||||
@@ -2367,7 +2382,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\itbeta': '𝛽',
|
||||
\ '\itgamma': '𝛾',
|
||||
\ '\itdelta': '𝛿',
|
||||
\ '\itepsilon': '𝜀',
|
||||
\ '\itvarepsilon': '𝜀',
|
||||
\ '\itzeta': '𝜁',
|
||||
\ '\iteta': '𝜂',
|
||||
\ '\ittheta': '𝜃',
|
||||
@@ -2384,15 +2399,15 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\itsigma': '𝜎',
|
||||
\ '\ittau': '𝜏',
|
||||
\ '\itupsilon': '𝜐',
|
||||
\ '\itphi': '𝜑',
|
||||
\ '\itvarphi': '𝜑',
|
||||
\ '\itchi': '𝜒',
|
||||
\ '\itpsi': '𝜓',
|
||||
\ '\itomega': '𝜔',
|
||||
\ '\itpartial': '𝜕',
|
||||
\ '\itvarepsilon': '𝜖',
|
||||
\ '\itepsilon': '𝜖',
|
||||
\ '\itvartheta': '𝜗',
|
||||
\ '\itvarkappa': '𝜘',
|
||||
\ '\itvarphi': '𝜙',
|
||||
\ '\itphi': '𝜙',
|
||||
\ '\itvarrho': '𝜚',
|
||||
\ '\itvarpi': '𝜛',
|
||||
\ '\biAlpha': '𝜜',
|
||||
@@ -2425,7 +2440,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bibeta': '𝜷',
|
||||
\ '\bigamma': '𝜸',
|
||||
\ '\bidelta': '𝜹',
|
||||
\ '\biepsilon': '𝜺',
|
||||
\ '\bivarepsilon': '𝜺',
|
||||
\ '\bizeta': '𝜻',
|
||||
\ '\bieta': '𝜼',
|
||||
\ '\bitheta': '𝜽',
|
||||
@@ -2442,15 +2457,15 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bisigma': '𝝈',
|
||||
\ '\bitau': '𝝉',
|
||||
\ '\biupsilon': '𝝊',
|
||||
\ '\biphi': '𝝋',
|
||||
\ '\bivarphi': '𝝋',
|
||||
\ '\bichi': '𝝌',
|
||||
\ '\bipsi': '𝝍',
|
||||
\ '\biomega': '𝝎',
|
||||
\ '\bipartial': '𝝏',
|
||||
\ '\bivarepsilon': '𝝐',
|
||||
\ '\biepsilon': '𝝐',
|
||||
\ '\bivartheta': '𝝑',
|
||||
\ '\bivarkappa': '𝝒',
|
||||
\ '\bivarphi': '𝝓',
|
||||
\ '\biphi': '𝝓',
|
||||
\ '\bivarrho': '𝝔',
|
||||
\ '\bivarpi': '𝝕',
|
||||
\ '\bsansAlpha': '𝝖',
|
||||
@@ -2483,7 +2498,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bsansbeta': '𝝱',
|
||||
\ '\bsansgamma': '𝝲',
|
||||
\ '\bsansdelta': '𝝳',
|
||||
\ '\bsansepsilon': '𝝴',
|
||||
\ '\bsansvarepsilon': '𝝴',
|
||||
\ '\bsanszeta': '𝝵',
|
||||
\ '\bsanseta': '𝝶',
|
||||
\ '\bsanstheta': '𝝷',
|
||||
@@ -2500,15 +2515,15 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bsanssigma': '𝞂',
|
||||
\ '\bsanstau': '𝞃',
|
||||
\ '\bsansupsilon': '𝞄',
|
||||
\ '\bsansphi': '𝞅',
|
||||
\ '\bsansvarphi': '𝞅',
|
||||
\ '\bsanschi': '𝞆',
|
||||
\ '\bsanspsi': '𝞇',
|
||||
\ '\bsansomega': '𝞈',
|
||||
\ '\bsanspartial': '𝞉',
|
||||
\ '\bsansvarepsilon': '𝞊',
|
||||
\ '\bsansepsilon': '𝞊',
|
||||
\ '\bsansvartheta': '𝞋',
|
||||
\ '\bsansvarkappa': '𝞌',
|
||||
\ '\bsansvarphi': '𝞍',
|
||||
\ '\bsansphi': '𝞍',
|
||||
\ '\bsansvarrho': '𝞎',
|
||||
\ '\bsansvarpi': '𝞏',
|
||||
\ '\bisansAlpha': '𝞐',
|
||||
@@ -2541,7 +2556,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bisansbeta': '𝞫',
|
||||
\ '\bisansgamma': '𝞬',
|
||||
\ '\bisansdelta': '𝞭',
|
||||
\ '\bisansepsilon': '𝞮',
|
||||
\ '\bisansvarepsilon': '𝞮',
|
||||
\ '\bisanszeta': '𝞯',
|
||||
\ '\bisanseta': '𝞰',
|
||||
\ '\bisanstheta': '𝞱',
|
||||
@@ -2558,15 +2573,15 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bisanssigma': '𝞼',
|
||||
\ '\bisanstau': '𝞽',
|
||||
\ '\bisansupsilon': '𝞾',
|
||||
\ '\bisansphi': '𝞿',
|
||||
\ '\bisansvarphi': '𝞿',
|
||||
\ '\bisanschi': '𝟀',
|
||||
\ '\bisanspsi': '𝟁',
|
||||
\ '\bisansomega': '𝟂',
|
||||
\ '\bisanspartial': '𝟃',
|
||||
\ '\bisansvarepsilon': '𝟄',
|
||||
\ '\bisansepsilon': '𝟄',
|
||||
\ '\bisansvartheta': '𝟅',
|
||||
\ '\bisansvarkappa': '𝟆',
|
||||
\ '\bisansvarphi': '𝟇',
|
||||
\ '\bisansphi': '𝟇',
|
||||
\ '\bisansvarrho': '𝟈',
|
||||
\ '\bisansvarpi': '𝟉',
|
||||
\ '\bfDigamma': '𝟊',
|
||||
@@ -2686,6 +2701,9 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:sun_with_face:': '🌞',
|
||||
\ '\:star2:': '🌟',
|
||||
\ '\:stars:': '🌠',
|
||||
\ '\:hotdog:': '🌭',
|
||||
\ '\:taco:': '🌮',
|
||||
\ '\:burrito:': '🌯',
|
||||
\ '\:chestnut:': '🌰',
|
||||
\ '\:seedling:': '🌱',
|
||||
\ '\:evergreen_tree:': '🌲',
|
||||
@@ -2752,7 +2770,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:cake:': '🍰',
|
||||
\ '\:bento:': '🍱',
|
||||
\ '\:stew:': '🍲',
|
||||
\ '\:egg:': '🍳',
|
||||
\ '\:fried_egg:': '🍳',
|
||||
\ '\:fork_and_knife:': '🍴',
|
||||
\ '\:tea:': '🍵',
|
||||
\ '\:sake:': '🍶',
|
||||
@@ -2762,6 +2780,8 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:beer:': '🍺',
|
||||
\ '\:beers:': '🍻',
|
||||
\ '\:baby_bottle:': '🍼',
|
||||
\ '\:champagne:': '🍾',
|
||||
\ '\:popcorn:': '🍿',
|
||||
\ '\:ribbon:': '🎀',
|
||||
\ '\:gift:': '🎁',
|
||||
\ '\:birthday:': '🎂',
|
||||
@@ -2819,11 +2839,17 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:snowboarder:': '🏂',
|
||||
\ '\:runner:': '🏃',
|
||||
\ '\:surfer:': '🏄',
|
||||
\ '\:sports_medal:': '🏅',
|
||||
\ '\:trophy:': '🏆',
|
||||
\ '\:horse_racing:': '🏇',
|
||||
\ '\:football:': '🏈',
|
||||
\ '\:rugby_football:': '🏉',
|
||||
\ '\:swimmer:': '🏊',
|
||||
\ '\:cricket_bat_and_ball:': '🏏',
|
||||
\ '\:volleyball:': '🏐',
|
||||
\ '\:field_hockey_stick_and_ball:': '🏑',
|
||||
\ '\:ice_hockey_stick_and_puck:': '🏒',
|
||||
\ '\:table_tennis_paddle_and_ball:': '🏓',
|
||||
\ '\:house:': '🏠',
|
||||
\ '\:house_with_garden:': '🏡',
|
||||
\ '\:office:': '🏢',
|
||||
@@ -2841,6 +2867,10 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:izakaya_lantern:': '🏮',
|
||||
\ '\:japanese_castle:': '🏯',
|
||||
\ '\:european_castle:': '🏰',
|
||||
\ '\:waving_black_flag:': '🏴',
|
||||
\ '\:badminton_racquet_and_shuttlecock:': '🏸',
|
||||
\ '\:bow_and_arrow:': '🏹',
|
||||
\ '\:amphora:': '🏺',
|
||||
\ '\:skin-tone-2:': '🏻',
|
||||
\ '\:skin-tone-3:': '🏼',
|
||||
\ '\:skin-tone-4:': '🏽',
|
||||
@@ -2876,7 +2906,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:bug:': '🐛',
|
||||
\ '\:ant:': '🐜',
|
||||
\ '\:bee:': '🐝',
|
||||
\ '\:beetle:': '🐞',
|
||||
\ '\:ladybug:': '🐞',
|
||||
\ '\:fish:': '🐟',
|
||||
\ '\:tropical_fish:': '🐠',
|
||||
\ '\:blowfish:': '🐡',
|
||||
@@ -2952,6 +2982,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:woman:': '👩',
|
||||
\ '\:family:': '👪',
|
||||
\ '\:couple:': '👫',
|
||||
\ '\:man_and_woman_holding_hands:': '👫',
|
||||
\ '\:two_men_holding_hands:': '👬',
|
||||
\ '\:two_women_holding_hands:': '👭',
|
||||
\ '\:cop:': '👮',
|
||||
@@ -3070,6 +3101,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:pager:': '📟',
|
||||
\ '\:fax:': '📠',
|
||||
\ '\:satellite:': '📡',
|
||||
\ '\:satellite_antenna:': '📡',
|
||||
\ '\:loudspeaker:': '📢',
|
||||
\ '\:mega:': '📣',
|
||||
\ '\:outbox_tray:': '📤',
|
||||
@@ -3092,10 +3124,12 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:no_mobile_phones:': '📵',
|
||||
\ '\:signal_strength:': '📶',
|
||||
\ '\:camera:': '📷',
|
||||
\ '\:camera_with_flash:': '📸',
|
||||
\ '\:video_camera:': '📹',
|
||||
\ '\:tv:': '📺',
|
||||
\ '\:radio:': '📻',
|
||||
\ '\:vhs:': '📼',
|
||||
\ '\:prayer_beads:': '📿',
|
||||
\ '\:twisted_rightwards_arrows:': '🔀',
|
||||
\ '\:repeat:': '🔁',
|
||||
\ '\:repeat_one:': '🔂',
|
||||
@@ -3158,6 +3192,10 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:small_red_triangle_down:': '🔻',
|
||||
\ '\:arrow_up_small:': '🔼',
|
||||
\ '\:arrow_down_small:': '🔽',
|
||||
\ '\:kaaba:': '🕋',
|
||||
\ '\:mosque:': '🕌',
|
||||
\ '\:synagogue:': '🕍',
|
||||
\ '\:menorah_with_nine_branches:': '🕎',
|
||||
\ '\:clock1:': '🕐',
|
||||
\ '\:clock2:': '🕑',
|
||||
\ '\:clock3:': '🕒',
|
||||
@@ -3182,6 +3220,10 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:clock1030:': '🕥',
|
||||
\ '\:clock1130:': '🕦',
|
||||
\ '\:clock1230:': '🕧',
|
||||
\ '\:man_dancing:': '🕺',
|
||||
\ '\:middle_finger:': '🖕',
|
||||
\ '\:spock-hand:': '🖖',
|
||||
\ '\:black_heart:': '🖤',
|
||||
\ '\:mount_fuji:': '🗻',
|
||||
\ '\:tokyo_tower:': '🗼',
|
||||
\ '\:statue_of_liberty:': '🗽',
|
||||
@@ -3252,6 +3294,10 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:pouting_cat:': '😾',
|
||||
\ '\:crying_cat_face:': '😿',
|
||||
\ '\:scream_cat:': '🙀',
|
||||
\ '\:slightly_frowning_face:': '🙁',
|
||||
\ '\:slightly_smiling_face:': '🙂',
|
||||
\ '\:upside_down_face:': '🙃',
|
||||
\ '\:face_with_rolling_eyes:': '🙄',
|
||||
\ '\:no_good:': '🙅',
|
||||
\ '\:ok_woman:': '🙆',
|
||||
\ '\:bow:': '🙇',
|
||||
@@ -3332,5 +3378,328 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:passport_control:': '🛂',
|
||||
\ '\:customs:': '🛃',
|
||||
\ '\:baggage_claim:': '🛄',
|
||||
\ '\:left_luggage:': '🛅'}
|
||||
\ '\:left_luggage:': '🛅',
|
||||
\ '\:sleeping_accommodation:': '🛌',
|
||||
\ '\:place_of_worship:': '🛐',
|
||||
\ '\:octagonal_sign:': '🛑',
|
||||
\ '\:shopping_trolley:': '🛒',
|
||||
\ '\:hindu_temple:': '🛕',
|
||||
\ '\:hut:': '🛖',
|
||||
\ '\:elevator:': '🛗',
|
||||
\ '\:airplane_departure:': '🛫',
|
||||
\ '\:airplane_arriving:': '🛬',
|
||||
\ '\:scooter:': '🛴',
|
||||
\ '\:motor_scooter:': '🛵',
|
||||
\ '\:canoe:': '🛶',
|
||||
\ '\:sled:': '🛷',
|
||||
\ '\:flying_saucer:': '🛸',
|
||||
\ '\:skateboard:': '🛹',
|
||||
\ '\:auto_rickshaw:': '🛺',
|
||||
\ '\:pickup_truck:': '🛻',
|
||||
\ '\:roller_skate:': '🛼',
|
||||
\ '\:large_orange_circle:': '🟠',
|
||||
\ '\:large_yellow_circle:': '🟡',
|
||||
\ '\:large_green_circle:': '🟢',
|
||||
\ '\:large_purple_circle:': '🟣',
|
||||
\ '\:large_brown_circle:': '🟤',
|
||||
\ '\:large_red_square:': '🟥',
|
||||
\ '\:large_blue_square:': '🟦',
|
||||
\ '\:large_orange_square:': '🟧',
|
||||
\ '\:large_yellow_square:': '🟨',
|
||||
\ '\:large_green_square:': '🟩',
|
||||
\ '\:large_purple_square:': '🟪',
|
||||
\ '\:large_brown_square:': '🟫',
|
||||
\ '\:pinched_fingers:': '🤌',
|
||||
\ '\:white_heart:': '🤍',
|
||||
\ '\:brown_heart:': '🤎',
|
||||
\ '\:pinching_hand:': '🤏',
|
||||
\ '\:zipper_mouth_face:': '🤐',
|
||||
\ '\:money_mouth_face:': '🤑',
|
||||
\ '\:face_with_thermometer:': '🤒',
|
||||
\ '\:nerd_face:': '🤓',
|
||||
\ '\:thinking_face:': '🤔',
|
||||
\ '\:face_with_head_bandage:': '🤕',
|
||||
\ '\:robot_face:': '🤖',
|
||||
\ '\:hugging_face:': '🤗',
|
||||
\ '\:the_horns:': '🤘',
|
||||
\ '\:call_me_hand:': '🤙',
|
||||
\ '\:raised_back_of_hand:': '🤚',
|
||||
\ '\:left-facing_fist:': '🤛',
|
||||
\ '\:right-facing_fist:': '🤜',
|
||||
\ '\:handshake:': '🤝',
|
||||
\ '\:crossed_fingers:': '🤞',
|
||||
\ '\:i_love_you_hand_sign:': '🤟',
|
||||
\ '\:face_with_cowboy_hat:': '🤠',
|
||||
\ '\:clown_face:': '🤡',
|
||||
\ '\:nauseated_face:': '🤢',
|
||||
\ '\:rolling_on_the_floor_laughing:': '🤣',
|
||||
\ '\:drooling_face:': '🤤',
|
||||
\ '\:lying_face:': '🤥',
|
||||
\ '\:face_palm:': '🤦',
|
||||
\ '\:sneezing_face:': '🤧',
|
||||
\ '\:face_with_raised_eyebrow:': '🤨',
|
||||
\ '\:star-struck:': '🤩',
|
||||
\ '\:zany_face:': '🤪',
|
||||
\ '\:shushing_face:': '🤫',
|
||||
\ '\:face_with_symbols_on_mouth:': '🤬',
|
||||
\ '\:face_with_hand_over_mouth:': '🤭',
|
||||
\ '\:face_vomiting:': '🤮',
|
||||
\ '\:exploding_head:': '🤯',
|
||||
\ '\:pregnant_woman:': '🤰',
|
||||
\ '\:breast-feeding:': '🤱',
|
||||
\ '\:palms_up_together:': '🤲',
|
||||
\ '\:selfie:': '🤳',
|
||||
\ '\:prince:': '🤴',
|
||||
\ '\:person_in_tuxedo:': '🤵',
|
||||
\ '\:mrs_claus:': '🤶',
|
||||
\ '\:shrug:': '🤷',
|
||||
\ '\:person_doing_cartwheel:': '🤸',
|
||||
\ '\:juggling:': '🤹',
|
||||
\ '\:fencer:': '🤺',
|
||||
\ '\:wrestlers:': '🤼',
|
||||
\ '\:water_polo:': '🤽',
|
||||
\ '\:handball:': '🤾',
|
||||
\ '\:diving_mask:': '🤿',
|
||||
\ '\:wilted_flower:': '🥀',
|
||||
\ '\:drum_with_drumsticks:': '🥁',
|
||||
\ '\:clinking_glasses:': '🥂',
|
||||
\ '\:tumbler_glass:': '🥃',
|
||||
\ '\:spoon:': '🥄',
|
||||
\ '\:goal_net:': '🥅',
|
||||
\ '\:first_place_medal:': '🥇',
|
||||
\ '\:second_place_medal:': '🥈',
|
||||
\ '\:third_place_medal:': '🥉',
|
||||
\ '\:boxing_glove:': '🥊',
|
||||
\ '\:martial_arts_uniform:': '🥋',
|
||||
\ '\:curling_stone:': '🥌',
|
||||
\ '\:lacrosse:': '🥍',
|
||||
\ '\:softball:': '🥎',
|
||||
\ '\:flying_disc:': '🥏',
|
||||
\ '\:croissant:': '🥐',
|
||||
\ '\:avocado:': '🥑',
|
||||
\ '\:cucumber:': '🥒',
|
||||
\ '\:bacon:': '🥓',
|
||||
\ '\:potato:': '🥔',
|
||||
\ '\:carrot:': '🥕',
|
||||
\ '\:baguette_bread:': '🥖',
|
||||
\ '\:green_salad:': '🥗',
|
||||
\ '\:shallow_pan_of_food:': '🥘',
|
||||
\ '\:stuffed_flatbread:': '🥙',
|
||||
\ '\:egg:': '🥚',
|
||||
\ '\:glass_of_milk:': '🥛',
|
||||
\ '\:peanuts:': '🥜',
|
||||
\ '\:kiwifruit:': '🥝',
|
||||
\ '\:pancakes:': '🥞',
|
||||
\ '\:dumpling:': '🥟',
|
||||
\ '\:fortune_cookie:': '🥠',
|
||||
\ '\:takeout_box:': '🥡',
|
||||
\ '\:chopsticks:': '🥢',
|
||||
\ '\:bowl_with_spoon:': '🥣',
|
||||
\ '\:cup_with_straw:': '🥤',
|
||||
\ '\:coconut:': '🥥',
|
||||
\ '\:broccoli:': '🥦',
|
||||
\ '\:pie:': '🥧',
|
||||
\ '\:pretzel:': '🥨',
|
||||
\ '\:cut_of_meat:': '🥩',
|
||||
\ '\:sandwich:': '🥪',
|
||||
\ '\:canned_food:': '🥫',
|
||||
\ '\:leafy_green:': '🥬',
|
||||
\ '\:mango:': '🥭',
|
||||
\ '\:moon_cake:': '🥮',
|
||||
\ '\:bagel:': '🥯',
|
||||
\ '\:smiling_face_with_3_hearts:': '🥰',
|
||||
\ '\:yawning_face:': '🥱',
|
||||
\ '\:smiling_face_with_tear:': '🥲',
|
||||
\ '\:partying_face:': '🥳',
|
||||
\ '\:woozy_face:': '🥴',
|
||||
\ '\:hot_face:': '🥵',
|
||||
\ '\:cold_face:': '🥶',
|
||||
\ '\:ninja:': '🥷',
|
||||
\ '\:disguised_face:': '🥸',
|
||||
\ '\:pleading_face:': '🥺',
|
||||
\ '\:sari:': '🥻',
|
||||
\ '\:lab_coat:': '🥼',
|
||||
\ '\:goggles:': '🥽',
|
||||
\ '\:hiking_boot:': '🥾',
|
||||
\ '\:womans_flat_shoe:': '🥿',
|
||||
\ '\:crab:': '🦀',
|
||||
\ '\:lion_face:': '🦁',
|
||||
\ '\:scorpion:': '🦂',
|
||||
\ '\:turkey:': '🦃',
|
||||
\ '\:unicorn_face:': '🦄',
|
||||
\ '\:eagle:': '🦅',
|
||||
\ '\:duck:': '🦆',
|
||||
\ '\:bat:': '🦇',
|
||||
\ '\:shark:': '🦈',
|
||||
\ '\:owl:': '🦉',
|
||||
\ '\:fox_face:': '🦊',
|
||||
\ '\:butterfly:': '🦋',
|
||||
\ '\:deer:': '🦌',
|
||||
\ '\:gorilla:': '🦍',
|
||||
\ '\:lizard:': '🦎',
|
||||
\ '\:rhinoceros:': '🦏',
|
||||
\ '\:shrimp:': '🦐',
|
||||
\ '\:squid:': '🦑',
|
||||
\ '\:giraffe_face:': '🦒',
|
||||
\ '\:zebra_face:': '🦓',
|
||||
\ '\:hedgehog:': '🦔',
|
||||
\ '\:sauropod:': '🦕',
|
||||
\ '\:t-rex:': '🦖',
|
||||
\ '\:cricket:': '🦗',
|
||||
\ '\:kangaroo:': '🦘',
|
||||
\ '\:llama:': '🦙',
|
||||
\ '\:peacock:': '🦚',
|
||||
\ '\:hippopotamus:': '🦛',
|
||||
\ '\:parrot:': '🦜',
|
||||
\ '\:raccoon:': '🦝',
|
||||
\ '\:lobster:': '🦞',
|
||||
\ '\:mosquito:': '🦟',
|
||||
\ '\:microbe:': '🦠',
|
||||
\ '\:badger:': '🦡',
|
||||
\ '\:swan:': '🦢',
|
||||
\ '\:mammoth:': '🦣',
|
||||
\ '\:dodo:': '🦤',
|
||||
\ '\:sloth:': '🦥',
|
||||
\ '\:otter:': '🦦',
|
||||
\ '\:orangutan:': '🦧',
|
||||
\ '\:skunk:': '🦨',
|
||||
\ '\:flamingo:': '🦩',
|
||||
\ '\:oyster:': '🦪',
|
||||
\ '\:beaver:': '🦫',
|
||||
\ '\:bison:': '🦬',
|
||||
\ '\:seal:': '🦭',
|
||||
\ '\:guide_dog:': '🦮',
|
||||
\ '\:probing_cane:': '🦯',
|
||||
\ '\:bone:': '🦴',
|
||||
\ '\:leg:': '🦵',
|
||||
\ '\:foot:': '🦶',
|
||||
\ '\:tooth:': '🦷',
|
||||
\ '\:superhero:': '🦸',
|
||||
\ '\:supervillain:': '🦹',
|
||||
\ '\:safety_vest:': '🦺',
|
||||
\ '\:ear_with_hearing_aid:': '🦻',
|
||||
\ '\:motorized_wheelchair:': '🦼',
|
||||
\ '\:manual_wheelchair:': '🦽',
|
||||
\ '\:mechanical_arm:': '🦾',
|
||||
\ '\:mechanical_leg:': '🦿',
|
||||
\ '\:cheese_wedge:': '🧀',
|
||||
\ '\:cupcake:': '🧁',
|
||||
\ '\:salt:': '🧂',
|
||||
\ '\:beverage_box:': '🧃',
|
||||
\ '\:garlic:': '🧄',
|
||||
\ '\:onion:': '🧅',
|
||||
\ '\:falafel:': '🧆',
|
||||
\ '\:waffle:': '🧇',
|
||||
\ '\:butter:': '🧈',
|
||||
\ '\:mate_drink:': '🧉',
|
||||
\ '\:ice_cube:': '🧊',
|
||||
\ '\:bubble_tea:': '🧋',
|
||||
\ '\:standing_person:': '🧍',
|
||||
\ '\:kneeling_person:': '🧎',
|
||||
\ '\:deaf_person:': '🧏',
|
||||
\ '\:face_with_monocle:': '🧐',
|
||||
\ '\:adult:': '🧑',
|
||||
\ '\:child:': '🧒',
|
||||
\ '\:older_adult:': '🧓',
|
||||
\ '\:bearded_person:': '🧔',
|
||||
\ '\:person_with_headscarf:': '🧕',
|
||||
\ '\:person_in_steamy_room:': '🧖',
|
||||
\ '\:person_climbing:': '🧗',
|
||||
\ '\:person_in_lotus_position:': '🧘',
|
||||
\ '\:mage:': '🧙',
|
||||
\ '\:fairy:': '🧚',
|
||||
\ '\:vampire:': '🧛',
|
||||
\ '\:merperson:': '🧜',
|
||||
\ '\:elf:': '🧝',
|
||||
\ '\:genie:': '🧞',
|
||||
\ '\:zombie:': '🧟',
|
||||
\ '\:brain:': '🧠',
|
||||
\ '\:orange_heart:': '🧡',
|
||||
\ '\:billed_cap:': '🧢',
|
||||
\ '\:scarf:': '🧣',
|
||||
\ '\:gloves:': '🧤',
|
||||
\ '\:coat:': '🧥',
|
||||
\ '\:socks:': '🧦',
|
||||
\ '\:red_envelope:': '🧧',
|
||||
\ '\:firecracker:': '🧨',
|
||||
\ '\:jigsaw:': '🧩',
|
||||
\ '\:test_tube:': '🧪',
|
||||
\ '\:petri_dish:': '🧫',
|
||||
\ '\:dna:': '🧬',
|
||||
\ '\:compass:': '🧭',
|
||||
\ '\:abacus:': '🧮',
|
||||
\ '\:fire_extinguisher:': '🧯',
|
||||
\ '\:toolbox:': '🧰',
|
||||
\ '\:bricks:': '🧱',
|
||||
\ '\:magnet:': '🧲',
|
||||
\ '\:luggage:': '🧳',
|
||||
\ '\:lotion_bottle:': '🧴',
|
||||
\ '\:thread:': '🧵',
|
||||
\ '\:yarn:': '🧶',
|
||||
\ '\:safety_pin:': '🧷',
|
||||
\ '\:teddy_bear:': '🧸',
|
||||
\ '\:broom:': '🧹',
|
||||
\ '\:basket:': '🧺',
|
||||
\ '\:roll_of_paper:': '🧻',
|
||||
\ '\:soap:': '🧼',
|
||||
\ '\:sponge:': '🧽',
|
||||
\ '\:receipt:': '🧾',
|
||||
\ '\:nazar_amulet:': '🧿',
|
||||
\ '\:ballet_shoes:': '🩰',
|
||||
\ '\:one-piece_swimsuit:': '🩱',
|
||||
\ '\:briefs:': '🩲',
|
||||
\ '\:shorts:': '🩳',
|
||||
\ '\:thong_sandal:': '🩴',
|
||||
\ '\:drop_of_blood:': '🩸',
|
||||
\ '\:adhesive_bandage:': '🩹',
|
||||
\ '\:stethoscope:': '🩺',
|
||||
\ '\:yo-yo:': '🪀',
|
||||
\ '\:kite:': '🪁',
|
||||
\ '\:parachute:': '🪂',
|
||||
\ '\:boomerang:': '🪃',
|
||||
\ '\:magic_wand:': '🪄',
|
||||
\ '\:pinata:': '🪅',
|
||||
\ '\:nesting_dolls:': '🪆',
|
||||
\ '\:ringed_planet:': '🪐',
|
||||
\ '\:chair:': '🪑',
|
||||
\ '\:razor:': '🪒',
|
||||
\ '\:axe:': '🪓',
|
||||
\ '\:diya_lamp:': '🪔',
|
||||
\ '\:banjo:': '🪕',
|
||||
\ '\:military_helmet:': '🪖',
|
||||
\ '\:accordion:': '🪗',
|
||||
\ '\:long_drum:': '🪘',
|
||||
\ '\:coin:': '🪙',
|
||||
\ '\:carpentry_saw:': '🪚',
|
||||
\ '\:screwdriver:': '🪛',
|
||||
\ '\:ladder:': '🪜',
|
||||
\ '\:hook:': '🪝',
|
||||
\ '\:mirror:': '🪞',
|
||||
\ '\:window:': '🪟',
|
||||
\ '\:plunger:': '🪠',
|
||||
\ '\:sewing_needle:': '🪡',
|
||||
\ '\:knot:': '🪢',
|
||||
\ '\:bucket:': '🪣',
|
||||
\ '\:mouse_trap:': '🪤',
|
||||
\ '\:toothbrush:': '🪥',
|
||||
\ '\:headstone:': '🪦',
|
||||
\ '\:placard:': '🪧',
|
||||
\ '\:rock:': '🪨',
|
||||
\ '\:fly:': '🪰',
|
||||
\ '\:worm:': '🪱',
|
||||
\ '\:beetle:': '🪲',
|
||||
\ '\:cockroach:': '🪳',
|
||||
\ '\:potted_plant:': '🪴',
|
||||
\ '\:wood:': '🪵',
|
||||
\ '\:feather:': '🪶',
|
||||
\ '\:anatomical_heart:': '🫀',
|
||||
\ '\:lungs:': '🫁',
|
||||
\ '\:people_hugging:': '🫂',
|
||||
\ '\:blueberries:': '🫐',
|
||||
\ '\:bell_pepper:': '🫑',
|
||||
\ '\:olive:': '🫒',
|
||||
\ '\:flatbread:': '🫓',
|
||||
\ '\:tamale:': '🫔',
|
||||
\ '\:fondue:': '🫕',
|
||||
\ '\:teapot:': '🫖'}
|
||||
endfunction
|
||||
|
||||
@@ -25,7 +25,7 @@ function! ledger#transaction_state_toggle(lnum, ...) abort
|
||||
endf
|
||||
|
||||
function! ledger#transaction_state_set(lnum, char) abort
|
||||
" modifies or sets the state of the transaction at the cursor,
|
||||
" modifies or sets the state of the transaction at the given line no.,
|
||||
" removing the state altogether if a:char is empty
|
||||
let trans = s:transaction.from_lnum(a:lnum)
|
||||
if empty(trans) || has_key(trans, 'expr')
|
||||
@@ -130,7 +130,7 @@ function! ledger#transaction_post_state_set(lnum, char) abort
|
||||
return
|
||||
endif
|
||||
|
||||
let line = getline('.')
|
||||
let line = getline(a:lnum)
|
||||
if a:char =~# '^\s*$'
|
||||
let newline = substitute(line, '\V' . state . '\m[ \t]', '', '')
|
||||
elseif state ==# ' '
|
||||
@@ -457,10 +457,20 @@ endf
|
||||
|
||||
" Return character position of decimal separator (multibyte safe)
|
||||
function! s:decimalpos(expr) abort
|
||||
let pos = match(a:expr, '\V' . g:ledger_decimal_sep)
|
||||
if pos > 0
|
||||
let pos = strchars(a:expr[:pos]) - 1
|
||||
endif
|
||||
" Remove trailing comments
|
||||
let l:expr = substitute(a:expr, '\v +;.*$', '', '')
|
||||
" Find first or last possible decimal separator candidate
|
||||
if g:ledger_align_last
|
||||
let pos = matchend(l:expr, '\v.*[' . g:ledger_decimal_sep . ']')
|
||||
if pos > 0
|
||||
let pos = strchars(a:expr[:pos]) + 1
|
||||
endif
|
||||
else
|
||||
let pos = match(l:expr, '\v[' . g:ledger_decimal_sep . ']')
|
||||
if pos > 0
|
||||
let pos = strchars(a:expr[:pos]) - 1
|
||||
endif
|
||||
end
|
||||
return pos
|
||||
endf
|
||||
|
||||
@@ -544,6 +554,10 @@ function! ledger#align_amount_at_cursor() abort
|
||||
endif
|
||||
endf
|
||||
|
||||
function! ledger#align_formatexpr(lnum, count) abort
|
||||
execute a:lnum . ',' . (a:lnum + a:count - 1) . 'call ledger#align_commodity()'
|
||||
endfunction
|
||||
|
||||
" Report generation {{{1
|
||||
|
||||
" Helper functions and variables {{{2
|
||||
@@ -732,8 +746,6 @@ function! ledger#register(file, args) abort
|
||||
endf
|
||||
|
||||
" Reconcile the given account.
|
||||
" This function accepts a file path as a third optional argument.
|
||||
" The default is to use the value of g:ledger_main.
|
||||
"
|
||||
" Parameters:
|
||||
" file The file to be processed
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -169,6 +169,10 @@ let did_load_filetypes = 1
|
||||
|
||||
" DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'bicep')
|
||||
au BufNewFile,BufRead *.bicep setf bicep
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'org')
|
||||
au BufNewFile,BufRead *.org setf org
|
||||
endif
|
||||
@@ -1328,10 +1332,6 @@ if !has_key(g:polyglot_is_disabled, 'hex')
|
||||
au BufNewFile,BufRead *.h32,*.hex setf hex
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'hercules')
|
||||
au BufNewFile,BufRead *.errsum,*.ev,*.sum,*.vc setf hercules
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'hastepreproc')
|
||||
au BufNewFile,BufRead *.htpp setf hastepreproc
|
||||
endif
|
||||
@@ -1775,7 +1775,7 @@ if !has_key(g:polyglot_is_disabled, 'prolog')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'bzl')
|
||||
au BufNewFile,BufRead *.BUILD,*.bazel,*.bzl,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE setf bzl
|
||||
au BufNewFile,BufRead *.BUILD,*.bazel,*.bzl,*.star,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE setf bzl
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'odin')
|
||||
@@ -1783,7 +1783,7 @@ if !has_key(g:polyglot_is_disabled, 'odin')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'dosini')
|
||||
au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*/etc/pacman.conf,*/etc/yum.conf,{.,}editorconfig,{.,}flake8,{.,}npmrc,buildozer.spec setf dosini
|
||||
au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*.url,*/etc/pacman.conf,*/etc/yum.conf,{.,}coveragerc,{.,}editorconfig,{.,}flake8,{.,}npmrc,{.,}pylintrc,buildozer.spec,pylintrc setf dosini
|
||||
au BufNewFile,BufRead php.ini-* call s:StarSetf('dosini')
|
||||
au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
|
||||
endif
|
||||
@@ -1873,7 +1873,7 @@ if !has_key(g:polyglot_is_disabled, 'unison')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'typescript')
|
||||
au BufNewFile,BufRead *.ts setf typescript
|
||||
au BufNewFile,BufRead *.cts,*.mts,*.ts setf typescript
|
||||
au BufNewFile,BufRead *.tsx setf typescriptreact
|
||||
endif
|
||||
|
||||
@@ -2157,7 +2157,7 @@ if !has_key(g:polyglot_is_disabled, 'mako')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'm4')
|
||||
au BufNewFile,BufRead *.at,*.m4 setf m4
|
||||
au BufNewFile,BufRead *.at,*.m4,*.mc setf m4
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'lua')
|
||||
@@ -2233,7 +2233,7 @@ if !has_key(g:polyglot_is_disabled, 'jsonnet')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'json')
|
||||
au BufNewFile,BufRead *.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}arcconfig,{.,}auto-changelog,{.,}c8rc,{.,}htmlhintrc,{.,}imgbotconfig,{.,}nycrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,Pipfile.lock,composer.lock,mcmod.info setf json
|
||||
au BufNewFile,BufRead *.4DForm,*.4DProject,*.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}arcconfig,{.,}auto-changelog,{.,}c8rc,{.,}htmlhintrc,{.,}imgbotconfig,{.,}nycrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,Pipfile.lock,composer.lock,mcmod.info setf json
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'json5')
|
||||
@@ -2320,16 +2320,22 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'javascript')
|
||||
au! BufNewFile,BufRead,BufWritePost *.frag call polyglot#detect#Frag()
|
||||
au BufNewFile,BufRead *._js,*.bones,*.cjs,*.es,*.es6,*.gs,*.jake,*.javascript,*.js,*.jsb,*.jscad,*.jsfl,*.jsm,*.jss,*.jsx,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib,Jakefile setf javascript
|
||||
au BufNewFile,BufRead *._js,*.bones,*.cjs,*.es,*.es6,*.gs,*.jake,*.javascript,*.js,*.jsb,*.jscad,*.jsfl,*.jslib,*.jsm,*.jspre,*.jss,*.jsx,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib,Jakefile setf javascript
|
||||
au BufNewFile,BufRead *.flow setf flow
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'go')
|
||||
au BufNewFile,BufRead *.go setf go
|
||||
au BufNewFile,BufRead go.mod setf gomod
|
||||
au BufNewFile,BufRead go.sum setf gosum
|
||||
au BufNewFile,BufRead go.work setf gowork
|
||||
au BufNewFile,BufRead *.tmpl setf gohtmltmpl
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'hercules')
|
||||
au BufNewFile,BufRead *.errsum,*.ev,*.sum,*.vc setf hercules
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'gnuplot')
|
||||
au BufNewFile,BufRead *.gnu,*.gnuplot,*.gp,*.gpi,*.p,*.plot,*.plt setf gnuplot
|
||||
endif
|
||||
@@ -2352,10 +2358,6 @@ if !has_key(g:polyglot_is_disabled, 'git')
|
||||
au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'gdscript')
|
||||
au BufNewFile,BufRead *.gd setf gdscript3
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'fsharp')
|
||||
au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs()
|
||||
au BufNewFile,BufRead *.fsi,*.fsx setf fsharp
|
||||
@@ -2458,7 +2460,7 @@ if !has_key(g:polyglot_is_disabled, 'coffee-script')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'markdown')
|
||||
au BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr setf markdown
|
||||
au BufNewFile,BufRead *.livemd,*.markdown,*.md,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr setf markdown
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'cmake')
|
||||
@@ -2466,7 +2468,7 @@ if !has_key(g:polyglot_is_disabled, 'cmake')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'clojure')
|
||||
au BufNewFile,BufRead *.boot,*.cl2,*.clj,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.edn,*.hic,build.boot,profile.boot,riemann.config setf clojure
|
||||
au BufNewFile,BufRead *.bb,*.boot,*.cl2,*.clj,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.edn,*.hic,build.boot,profile.boot,riemann.config setf clojure
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'carp')
|
||||
@@ -2577,7 +2579,7 @@ if !has_key(g:polyglot_is_disabled, 'ant')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'xml')
|
||||
au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.tpm,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu,*fglrxrc,{.,}classpath,{.,}cproject,{.,}project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config setf xml
|
||||
au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.tpm,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu,*fglrxrc,{.,}classpath,{.,}cproject,{.,}project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config setf xml
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'csv')
|
||||
@@ -3510,7 +3512,7 @@ au BufNewFile,BufRead .reminders* call s:StarSetf('remind')
|
||||
au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog')
|
||||
|
||||
" Shell scripts ending in a star
|
||||
au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,,PKGBUILD* call polyglot#ft#SetFileTypeSH("bash")
|
||||
au BufNewFile,BufRead .bashrc*,.bash[_-]profile*,.bash[_-]logout*,.bash[_-]aliases*,bash-fc[-.]*,PKGBUILD* call polyglot#ft#SetFileTypeSH("bash")
|
||||
au BufNewFile,BufRead .kshrc* call polyglot#ft#SetFileTypeSH("ksh")
|
||||
au BufNewFile,BufRead .profile* call polyglot#ft#SetFileTypeSH(getline(1))
|
||||
|
||||
|
||||
@@ -462,6 +462,7 @@ endfunc
|
||||
let s:interpreters = {
|
||||
\ 'osascript': 'applescript',
|
||||
\ 'tcc': 'c',
|
||||
\ 'bb': 'clojure',
|
||||
\ 'coffee': 'coffee',
|
||||
\ 'crystal': 'crystal',
|
||||
\ 'dart': 'dart',
|
||||
|
||||
@@ -48,13 +48,14 @@ let s:globs = {
|
||||
\ 'bc': '*.bc',
|
||||
\ 'bdf': '*.bdf',
|
||||
\ 'bib': '*.bib',
|
||||
\ 'bicep': '*.bicep',
|
||||
\ 'bindzone': 'named.root',
|
||||
\ 'blade': '*.blade,*.blade.php',
|
||||
\ 'blank': '*.bl',
|
||||
\ 'brewfile': 'Brewfile',
|
||||
\ 'bsdl': '*.bsdl,*bsd',
|
||||
\ 'bst': '*.bst',
|
||||
\ 'bzl': '*.bzl,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE',
|
||||
\ 'bzl': '*.bzl,*.star,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE',
|
||||
\ 'bzr': 'bzr_log.*',
|
||||
\ 'c': '*.c,*.cats,*.h,*.idc,*.qc',
|
||||
\ 'cabal': '*.cabal',
|
||||
@@ -74,7 +75,7 @@ let s:globs = {
|
||||
\ 'chordpro': '*.chopro,*.crd,*.cho,*.crdpro,*.chordpro',
|
||||
\ 'cl': '*.eni',
|
||||
\ 'clean': '*.dcl,*.icl',
|
||||
\ 'clojure': '*.clj,*.boot,*.cl2,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.hic,*.edn,riemann.config,build.boot,profile.boot',
|
||||
\ 'clojure': '*.clj,*.bb,*.boot,*.cl2,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.hic,*.edn,riemann.config,build.boot,profile.boot',
|
||||
\ 'cmake': '*.cmake,*.cmake.in,CMakeLists.txt',
|
||||
\ 'cmod': '*.cmod',
|
||||
\ 'cmusrc': '',
|
||||
@@ -129,7 +130,7 @@ let s:globs = {
|
||||
\ 'dnsmasq': '',
|
||||
\ 'dockerfile': '*.Dockerfile,*.dock,Containerfile,Dockerfile,dockerfile,Dockerfile*',
|
||||
\ 'dosbatch': '*.bat,*.sys',
|
||||
\ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,.flake8,buildozer.spec,.editorconfig,.npmrc,php.ini-*',
|
||||
\ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,*.url,.coveragerc,.flake8,.pylintrc,buildozer.spec,pylintrc,.editorconfig,.npmrc,php.ini-*',
|
||||
\ 'dot': '*.dot,*.gv',
|
||||
\ 'dracula': '*.drac,*.drc,*lvs,*lpe,drac.*',
|
||||
\ 'dsdl': '*.sdl',
|
||||
@@ -180,7 +181,6 @@ let s:globs = {
|
||||
\ 'fvwm': '',
|
||||
\ 'gdb': '.gdbinit',
|
||||
\ 'gdmo': '*.mo,*.gdmo',
|
||||
\ 'gdscript3': '*.gd',
|
||||
\ 'gedcom': '*.ged,lltxxxxx.txt',
|
||||
\ 'gitcommit': 'COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG',
|
||||
\ 'gitconfig': '*.gitconfig,.gitconfig,.gitmodules',
|
||||
@@ -197,6 +197,8 @@ let s:globs = {
|
||||
\ 'go': '*.go',
|
||||
\ 'gohtmltmpl': '*.tmpl',
|
||||
\ 'gomod': 'go.mod',
|
||||
\ 'gosum': 'go.sum',
|
||||
\ 'gowork': 'go.work',
|
||||
\ 'gp': '*.gp,.gprc',
|
||||
\ 'gpg': '',
|
||||
\ 'grads': '*.gs',
|
||||
@@ -253,14 +255,14 @@ let s:globs = {
|
||||
\ 'jam': '*.jpl,*.jpr,Prl*.*,JAM*.*',
|
||||
\ 'java': '*.java,*.jav',
|
||||
\ 'javacc': '*.jj,*.jjt',
|
||||
\ 'javascript': '*.js,*._js,*.bones,*.cjs,*.es,*.es6,*.frag,*.gs,*.jake,*.javascript,*.jsb,*.jscad,*.jsfl,*.jsm,*.jss,*.jsx,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib,Jakefile',
|
||||
\ 'javascript': '*.js,*._js,*.bones,*.cjs,*.es,*.es6,*.frag,*.gs,*.jake,*.javascript,*.jsb,*.jscad,*.jsfl,*.jslib,*.jsm,*.jspre,*.jss,*.jsx,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib,Jakefile',
|
||||
\ 'javascriptreact': '*.jsx',
|
||||
\ 'jess': '*.clp',
|
||||
\ 'jgraph': '*.jgr',
|
||||
\ 'jovial': '*.jov,*.j73,*.jovial',
|
||||
\ 'jproperties': '*.properties,*.properties_??,*.properties_??_??,*.properties_??_??_*',
|
||||
\ 'jq': '*.jq,.jqrc,.jqrc*',
|
||||
\ 'json': '*.json,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.auto-changelog,.c8rc,.htmlhintrc,.imgbotconfig,.nycrc,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,mcmod.info',
|
||||
\ 'json': '*.json,*.4DForm,*.4DProject,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.auto-changelog,.c8rc,.htmlhintrc,.imgbotconfig,.nycrc,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,mcmod.info',
|
||||
\ 'json5': '*.json5',
|
||||
\ 'jsonc': '*.cjson,*.jsonc,coc-settings.json,.eslintrc.json,.babelrc,.jshintrc,.jslintrc,.mocharc.json,coffeelint.json,tsconfig.json,jsconfig.json',
|
||||
\ 'jsonnet': '*.jsonnet,*.libsonnet',
|
||||
@@ -309,7 +311,7 @@ let s:globs = {
|
||||
\ 'lss': '*.lss',
|
||||
\ 'lua': '*.lua,*.fcgi,*.nse,*.p8,*.pd_lua,*.rbxs,*.rockspec,*.wlua,.luacheckrc',
|
||||
\ 'lynx': 'lynx.cfg',
|
||||
\ 'm4': '*.m4,*.at',
|
||||
\ 'm4': '*.m4,*.mc,*.at',
|
||||
\ 'mail': '*.eml,snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt[[:alnum:]_-]\\\{6\},neomutt-*-\w\+,neomutt[[:alnum:]_-]\\\{6\},ae\d\+.txt,{neo,}mutt[[:alnum:]._-]\\\{6\},reportbug-*',
|
||||
\ 'mailaliases': '',
|
||||
\ 'mailcap': '.mailcap,mailcap',
|
||||
@@ -318,7 +320,7 @@ let s:globs = {
|
||||
\ 'mallard': '*.page',
|
||||
\ 'manconf': 'man.config',
|
||||
\ 'maple': '*.mv,*.mpl,*.mws',
|
||||
\ 'markdown': '*.md,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr',
|
||||
\ 'markdown': '*.md,*.livemd,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr',
|
||||
\ 'markdown.mdx': '*.mdx',
|
||||
\ 'mason': '*.mason,*.mhtml,*.comp',
|
||||
\ 'master': '*.mas,*.master',
|
||||
@@ -565,7 +567,7 @@ let s:globs = {
|
||||
\ 'tt2': '*.tt2',
|
||||
\ 'tt2html': '*.tt2',
|
||||
\ 'tutor': '*.tutor',
|
||||
\ 'typescript': '*.ts',
|
||||
\ 'typescript': '*.ts,*.cts,*.mts',
|
||||
\ 'typescriptreact': '*.tsx',
|
||||
\ 'uc': '*.uc',
|
||||
\ 'udevconf': '',
|
||||
@@ -611,7 +613,7 @@ let s:globs = {
|
||||
\ 'xhtml': '*.xhtml,*.xht',
|
||||
\ 'xinetd': '',
|
||||
\ 'xmath': '*.msc,*.msf',
|
||||
\ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc',
|
||||
\ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc',
|
||||
\ 'xml.twig': '*.xml.twig',
|
||||
\ 'xmodmap': '*Xmodmap,*xmodmap*',
|
||||
\ 'xpm': '*.xpm,*.pm',
|
||||
|
||||
@@ -2,35 +2,47 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'autoload/requ
|
||||
finish
|
||||
endif
|
||||
|
||||
" the Requirements File Format syntax support for Vim
|
||||
" Version: 1.6.0
|
||||
" 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.
|
||||
""
|
||||
" @section Introduction, intro
|
||||
" @library
|
||||
" <doc/@plugin(name).txt> is generated by <https://github.com/google/vimdoc>.
|
||||
" See <README.md> for more information about installation and screenshots.
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
""
|
||||
" Update cache.
|
||||
function! requirements#update_cache() abort
|
||||
let s:items = []
|
||||
let l:pip_items = split(system('COMP_WORDS="pip install -" COMP_CWORD=2 PIP_AUTO_COMPLETE=1 pip'))
|
||||
let l:pypi_items = split(system('pip-cache pkgnames'))
|
||||
for l:item in l:pip_items
|
||||
let s:items += [{'word': l:item, 'menu': 'pip'}]
|
||||
endfor
|
||||
for l:item in l:pypi_items
|
||||
let s:items += [{'word': l:item, 'menu': 'pypi'}]
|
||||
endfor
|
||||
call writefile([json_encode(s:items)], s:cache)
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
if exists('*stdpath')
|
||||
let s:cache_dir_home = stdpath('cache')
|
||||
else
|
||||
let s:cache_dir_home = $HOME . '/.cache/nvim'
|
||||
endif
|
||||
let s:cache_dir = s:cache_dir_home . '/requirements.vim'
|
||||
call mkdir(s:cache_dir, 'p')
|
||||
""
|
||||
" Completion cache path.
|
||||
call g:requirements#utils#plugin.Flag('g:requirements#cache',
|
||||
\ s:cache_dir . '/requirements.json'
|
||||
\ )
|
||||
let s:cache = g:requirements#cache
|
||||
try
|
||||
let s:items = json_decode(readfile(s:cache)[0])
|
||||
catch /\v^Vim%(\(\a+\))?:E(684|484|491):/
|
||||
call requirements#update_cache()
|
||||
let s:items = json_decode(readfile(s:cache)[0])
|
||||
endtry
|
||||
""
|
||||
" Completion cache contents. For program.
|
||||
call g:requirements#utils#plugin.Flag('g:requirements#items', s:items)
|
||||
" vim: et sw=4 ts=4 sts=4:
|
||||
|
||||
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:
|
||||
@@ -66,7 +66,7 @@ function! unison#Complete(findstart, base) abort
|
||||
"
|
||||
" (List.fol<cursor>
|
||||
" ^
|
||||
while start > 0 && line[start - 1] !~ '\v\s|[(){}\[\]]'
|
||||
while start > 0 && line[start - 1] !~ '\v\s|[!(){}\[\]]'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
|
||||
@@ -38,10 +38,12 @@ augroup END
|
||||
" Ignore general cargo progress messages
|
||||
CompilerSet errorformat+=
|
||||
\%-G%\\s%#Downloading%.%#,
|
||||
\%-G%\\s%#Checking%.%#,
|
||||
\%-G%\\s%#Compiling%.%#,
|
||||
\%-G%\\s%#Finished%.%#,
|
||||
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
|
||||
\%-G%\\s%#To\ learn\ more\\,%.%#,
|
||||
\%-G%\\s%#For\ more\ information\ about\ this\ error\\,%.%#,
|
||||
\%-Gnote:\ Run\ with\ \`RUST_BACKTRACE=%.%#,
|
||||
\%.%#panicked\ at\ \\'%m\\'\\,\ %f:%l:%c
|
||||
|
||||
|
||||
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:
|
||||
@@ -1547,9 +1547,6 @@ au BufNewFile,BufRead *.r,*.R call polyglot#ft#FTr()
|
||||
" Remind
|
||||
au BufNewFile,BufRead .reminders,*.remind,*.rem setf remind
|
||||
|
||||
" ReScript
|
||||
au BufNewFile,BufRead *.res,*.resi setf rescript
|
||||
|
||||
" Resolv.conf
|
||||
au BufNewFile,BufRead resolv.conf setf resolv
|
||||
|
||||
@@ -2509,7 +2506,7 @@ endif
|
||||
" Function called for testing all functions defined here. These are
|
||||
" script-local, thus need to be executed here.
|
||||
" Returns a string with error messages (hopefully empty).
|
||||
func! TestFiletypeFuncs(testlist)
|
||||
func! TestPolyglotFiletypeFuncs(testlist)
|
||||
let output = ''
|
||||
for f in a:testlist
|
||||
try
|
||||
|
||||
@@ -22,7 +22,8 @@ syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRe
|
||||
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
|
||||
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
|
||||
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
||||
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.\{-}]\|=\)\+"
|
||||
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\~\|\.\|:\|\/\|\[.\{-}]\|=\)\+"
|
||||
|
||||
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
||||
|
||||
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||
|
||||
671
extras/menu.vim
671
extras/menu.vim
File diff suppressed because it is too large
Load Diff
21
ftplugin/bicep.vim
Normal file
21
ftplugin/bicep.vim
Normal file
@@ -0,0 +1,21 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bicep', 'ftplugin/bicep.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" bicep.vim - basic bicep integration
|
||||
" Maintainer: Carl Smedstad <carl.smedstad at protonmail dot com>
|
||||
|
||||
if exists('b:did_ftplugin') || v:version < 700 || &compatible
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
" Set the commentstring
|
||||
setlocal commentstring=//%s
|
||||
let b:undo_ftplugin = 'setlocal commentstring<'
|
||||
|
||||
let &cpoptions = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -2,8 +2,9 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'caddyfile', 'ftplugin/caddyfi
|
||||
finish
|
||||
endif
|
||||
|
||||
" Language: Caddyfile
|
||||
" Author: Josh Glendenning <josh@isobit.io>
|
||||
" Language: Caddyfile
|
||||
" Maintainer: 0az <0az@afzhou.com>
|
||||
" Original Author: Josh Glendenning <josh@isobit.io>
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
@@ -20,7 +21,7 @@ if exists('g:NERDDelimiterMap')
|
||||
endif
|
||||
elseif exists('g:NERDCustomDelimiters')
|
||||
if !has_key(g:NERDCustomDelimiters, 'caddyfile')
|
||||
let g:NERDDelimiterMap.caddyfile = s:delimiters
|
||||
let g:NERDCustomDelimiters.caddyfile = s:delimiters
|
||||
endif
|
||||
else
|
||||
let g:NERDCustomDelimiters = {'caddyfile': s:delimiters}
|
||||
|
||||
@@ -53,7 +53,7 @@ if get(g:, 'crystal_define_mappings', 1)
|
||||
nmap <buffer>gsc <Plug>(crystal-spec-run-current)
|
||||
endif
|
||||
|
||||
if &l:ofu ==# ''
|
||||
if &l:ofu ==# '' && get(g:, 'crystal_enable_completion', 1)
|
||||
setlocal omnifunc=crystal_lang#complete
|
||||
endif
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@ endif
|
||||
" Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||
" Eduardo Lopez (http://github.com/tapichu)
|
||||
" Arvid Bjurklint (http://github.com/slarwise)
|
||||
" Last Update: 2021-Jan-08
|
||||
" Paweł Zacharek (http://github.com/subc2)
|
||||
" Last Update: 2022-Sep-28
|
||||
" License: Vim license
|
||||
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
||||
|
||||
@@ -61,7 +62,7 @@ setlocal suffixesadd=.erl,.hrl
|
||||
let &l:include = '^\s*-\%(include\|include_lib\)\s*("\zs\f*\ze")'
|
||||
let &l:define = '^\s*-\%(define\|record\|type\|opaque\)'
|
||||
|
||||
let s:erlang_fun_begin = '^\a\w*(.*$'
|
||||
let s:erlang_fun_begin = '^\l[A-Za-z0-9_@]*(.*$'
|
||||
let s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$'
|
||||
|
||||
if !exists('*GetErlangFold')
|
||||
@@ -103,6 +104,23 @@ let b:undo_ftplugin = "setlocal keywordprg< foldmethod< foldexpr< foldtext<"
|
||||
\ . " comments< commentstring< formatoptions< suffixesadd< include<"
|
||||
\ . " define<"
|
||||
|
||||
" The following lines enable the macros/matchit.vim plugin for
|
||||
" extended matching with the % key.
|
||||
if exists("loaded_matchit")
|
||||
let s:sw = &sw
|
||||
if exists('*shiftwidth')
|
||||
let s:sw = shiftwidth()
|
||||
endif
|
||||
|
||||
let b:match_words =
|
||||
\ '\<\%(begin\|case\|fun\|if\|maybe\|receive\|try\)\>' .
|
||||
\ ':\<\%(after\|catch\|else\|of\)\>' .
|
||||
\ ':\<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
|
||||
unlet s:cpo_save
|
||||
|
||||
|
||||
@@ -89,8 +89,12 @@ runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Combine the new set of values with those previously included.
|
||||
if exists("b:undo_ftplugin")
|
||||
let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin
|
||||
if !exists('b:undo_ftplugin')
|
||||
" No-op
|
||||
let b:undo_ftplugin = 'exe'
|
||||
endif
|
||||
if !empty(s:undo_ftplugin)
|
||||
let b:undo_ftplugin .= '|' . s:undo_ftplugin
|
||||
endif
|
||||
if exists ("b:browsefilter")
|
||||
let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter
|
||||
@@ -122,7 +126,7 @@ endif
|
||||
setlocal commentstring=<%#%s%>
|
||||
|
||||
let b:undo_ftplugin = "setl cms< " .
|
||||
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
|
||||
\ " | unlet! b:browsefilter b:match_words | " . b:undo_ftplugin
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
@@ -5,7 +5,7 @@ endif
|
||||
" Vim filetype plugin
|
||||
" Language: git commit file
|
||||
" 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
|
||||
if (exists("b:did_ftplugin"))
|
||||
@@ -16,7 +16,7 @@ let b:did_ftplugin = 1
|
||||
|
||||
setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72
|
||||
setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n
|
||||
setlocal formatlistpat+=\\\|^\\s*[-*+]\\s\\+
|
||||
setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}]\\s\\+\\\|^\\s*[-*+]\\s\\+
|
||||
setlocal include=^+++
|
||||
setlocal includeexpr=substitute(v:fname,'^[bi]/','','')
|
||||
|
||||
@@ -46,6 +46,11 @@ function! s:diffcomplete(A, L, P) abort
|
||||
return args
|
||||
endfunction
|
||||
|
||||
function! s:setupdiff() abort
|
||||
command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0, <f-args>)
|
||||
setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git
|
||||
endfunction
|
||||
|
||||
function! s:gitdiffcached(bang, ...) abort
|
||||
let name = tempname()
|
||||
if a:0
|
||||
@@ -54,8 +59,6 @@ function! s:gitdiffcached(bang, ...) abort
|
||||
let extra = "-p --stat=".&columns
|
||||
endif
|
||||
call system("git diff --cached --no-color --no-ext-diff ".extra." > ".shellescape(name))
|
||||
exe "pedit " . fnameescape(name)
|
||||
wincmd P
|
||||
command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0, <f-args>)
|
||||
setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git
|
||||
exe 'pedit +call\ s:setupdiff()' fnameescape(name)
|
||||
silent! wincmd P
|
||||
endfunction
|
||||
|
||||
@@ -5,7 +5,7 @@ endif
|
||||
" Vim filetype plugin
|
||||
" Language: git rebase --interactive
|
||||
" 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
|
||||
if (exists("b:did_ftplugin"))
|
||||
|
||||
@@ -5,7 +5,7 @@ endif
|
||||
" Vim filetype plugin
|
||||
" Language: Haml
|
||||
" 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
|
||||
if exists("b:did_ftplugin")
|
||||
|
||||
@@ -26,10 +26,16 @@ setlocal fo-=t fo+=croql
|
||||
let b:julia_vim_loaded = 1
|
||||
|
||||
let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<"
|
||||
\ . " define< fo< shiftwidth< expandtab< indentexpr< indentkeys< cinoptions< completefunc<"
|
||||
\ . " expandtab< shiftwidth<"
|
||||
\ . " define< fo< indentexpr< indentkeys< cinoptions< completefunc<"
|
||||
\ . " | unlet! b:commentary_format"
|
||||
\ . " | unlet! b:smartcomment_force_linemode"
|
||||
\ . " | unlet! b:julia_vim_loaded"
|
||||
|
||||
if !exists("g:julia_set_indentation") || g:julia_set_indentation != 0
|
||||
" As suggested by Style Guide.
|
||||
setlocal expandtab shiftwidth=4
|
||||
endif
|
||||
|
||||
" MatchIt plugin support
|
||||
if exists("loaded_matchit")
|
||||
@@ -72,7 +78,7 @@ if exists("loaded_matchit")
|
||||
elseif attr == 'juliaBlKeyword'
|
||||
return b:julia_begin_keywordsm . ':' . b:julia_end_keywords
|
||||
elseif attr == 'juliaException'
|
||||
return b:julia_begin_keywordsm . ':\<\%(catch\|finally\)\>:' . b:julia_end_keywords
|
||||
return b:julia_begin_keywordsm . ':\<\%(catch\|else\|finally\)\>:' . b:julia_end_keywords
|
||||
endif
|
||||
return '\<\>:\<\>'
|
||||
endfunction
|
||||
|
||||
@@ -792,7 +792,7 @@ function! s:MarkdownHighlightSources(force)
|
||||
" Look for code blocks in the current file
|
||||
let filetypes = {}
|
||||
for line in getline(1, '$')
|
||||
let ft = matchstr(line, '```\s*\zs[0-9A-Za-z_+-]*\ze.*')
|
||||
let ft = matchstr(line, '\(`\{3,}\|\~\{3,}\)\s*\zs[0-9A-Za-z_+-]*\ze.*')
|
||||
if !empty(ft) && ft !~# '^\d*$' | let filetypes[ft] = 1 | endif
|
||||
endfor
|
||||
if !exists('b:mkd_known_filetypes')
|
||||
@@ -823,8 +823,10 @@ function! s:MarkdownHighlightSources(force)
|
||||
else
|
||||
let include = '@' . toupper(filetype)
|
||||
endif
|
||||
let command = 'syntax region %s matchgroup=%s start="^\s*```\s*%s.*$" matchgroup=%s end="\s*```$" keepend contains=%s%s'
|
||||
execute printf(command, group, startgroup, ft, endgroup, include, has('conceal') && get(g:, 'vim_markdown_conceal', 1) && get(g:, 'vim_markdown_conceal_code_blocks', 1) ? ' concealends' : '')
|
||||
let command_backtick = 'syntax region %s matchgroup=%s start="^\s*`\{3,}\s*%s.*$" matchgroup=%s end="\s*`\{3,}$" keepend contains=%s%s'
|
||||
let command_tilde = 'syntax region %s matchgroup=%s start="^\s*\~\{3,}\s*%s.*$" matchgroup=%s end="\s*\~\{3,}$" keepend contains=%s%s'
|
||||
execute printf(command_backtick, group, startgroup, ft, endgroup, include, has('conceal') && get(g:, 'vim_markdown_conceal', 1) && get(g:, 'vim_markdown_conceal_code_blocks', 1) ? ' concealends' : '')
|
||||
execute printf(command_tilde, group, startgroup, ft, endgroup, include, has('conceal') && get(g:, 'vim_markdown_conceal', 1) && get(g:, 'vim_markdown_conceal_code_blocks', 1) ? ' concealends' : '')
|
||||
execute printf('syntax cluster mkdNonListItem add=%s', group)
|
||||
|
||||
let b:mkd_known_filetypes[ft] = 1
|
||||
@@ -858,7 +860,11 @@ endfunction
|
||||
|
||||
|
||||
function! s:MarkdownRefreshSyntax(force)
|
||||
if &filetype =~# 'markdown' && line('$') > 1
|
||||
" Use != to compare &syntax's value to use the same logic run on
|
||||
" $VIMRUNTIME/syntax/synload.vim.
|
||||
"
|
||||
" vint: next-line -ProhibitEqualTildeOperator
|
||||
if &filetype =~# 'markdown' && line('$') > 1 && &syntax != 'OFF'
|
||||
call s:MarkdownHighlightSources(a:force)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
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+=:;
|
||||
|
||||
@@ -2,7 +2,6 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'plantuml', 'ftplugin/plantuml
|
||||
finish
|
||||
endif
|
||||
|
||||
scriptencoding utf-8
|
||||
" Vim filetype plugin file
|
||||
" Language: PlantUML
|
||||
" License: VIM LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ let b:did_ftplugin = 1
|
||||
|
||||
setlocal tw=0
|
||||
setlocal commentstring=#%s
|
||||
setlocal formatoptions=tcqro
|
||||
setlocal formatoptions+=tcqroj
|
||||
" Enable autocompletion of hyphenated PowerShell commands,
|
||||
" e.g. Get-Content or Get-ADUser
|
||||
setlocal iskeyword+=-
|
||||
|
||||
@@ -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
|
||||
endif
|
||||
|
||||
" the Requirements File Format syntax support for Vim
|
||||
" Version: 1.6.0
|
||||
" Version: 1.7.1
|
||||
" Author: raimon <raimon49@hotmail.com>
|
||||
" License: MIT LICENSE
|
||||
" The MIT License (MIT)
|
||||
@@ -27,16 +27,20 @@ endif
|
||||
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
" SOFTWARE.
|
||||
if executable('pip-compile')
|
||||
let s:filename = expand("%:p")
|
||||
if fnamemodify(s:filename, ":t") ==# 'requirements.in'
|
||||
" this is the default filename for pip-compile
|
||||
setlocal makeprg=pip-compile
|
||||
elseif fnamemodify(s:filename, ":e") ==# 'in'
|
||||
\ && Requirements_matched_filename(s:filename)
|
||||
setlocal makeprg=pip-compile\ %
|
||||
endif
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:save_cpoptions = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
let b:undo_ftplugin = "setl iskeyword< commentstring<"
|
||||
" pip options contain "-"
|
||||
setlocal iskeyword+=-
|
||||
setlocal commentstring=#\ %s
|
||||
compiler pip_compile
|
||||
|
||||
let &cpoptions = s:save_cpoptions
|
||||
unlet s:save_cpoptions
|
||||
" vim: et sw=4 ts=4 sts=4:
|
||||
@@ -22,7 +22,7 @@ if !exists('g:rst_fold_enabled')
|
||||
let g:rst_fold_enabled = 0
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< et< fo<"
|
||||
let b:undo_ftplugin = "setlocal comments< commentstring< expandtab< formatoptions<"
|
||||
|
||||
setlocal comments=fb:.. commentstring=..\ %s expandtab
|
||||
setlocal formatoptions+=tcroql
|
||||
@@ -36,6 +36,7 @@ setlocal formatoptions+=tcroql
|
||||
|
||||
if exists("g:rst_style") && g:rst_style != 0
|
||||
setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8
|
||||
let b:undo_ftplugin .= " | setlocal softtabstop< shiftwidth< tabstop<"
|
||||
endif
|
||||
|
||||
if g:rst_fold_enabled != 0 && has('patch-7.3.867') " Introduced the TextChanged event.
|
||||
@@ -45,6 +46,7 @@ if g:rst_fold_enabled != 0 && has('patch-7.3.867') " Introduced the TextChanged
|
||||
augroup RstFold
|
||||
autocmd TextChanged,InsertLeave <buffer> unlet! b:RstFoldCache
|
||||
augroup END
|
||||
let b:undo_ftplugin .= " | setlocal foldexpr< foldmethod< foldtext<"
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -56,7 +56,7 @@ endif
|
||||
" TODO:
|
||||
"setlocal define=^\\s*def
|
||||
|
||||
setlocal comments=:#
|
||||
setlocal comments=b:#
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
if !exists('g:ruby_version_paths')
|
||||
|
||||
@@ -54,6 +54,13 @@ endif
|
||||
let b:undo_ftplugin =
|
||||
\ 'setl isk< et< ts< sts< sw< fo< sua< mp< com< cms< inex< inc< pa<'
|
||||
|
||||
augroup vim-zig
|
||||
autocmd! * <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
|
||||
unlet s:cpo_orig
|
||||
" vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab
|
||||
|
||||
68
indent/bicep.vim
Normal file
68
indent/bicep.vim
Normal file
@@ -0,0 +1,68 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bicep', 'indent/bicep.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Only load this file if no other indent file was loaded
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
let s:cpo_save = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
setlocal nolisp
|
||||
setlocal autoindent shiftwidth=2 tabstop=2 softtabstop=2 expandtab
|
||||
setlocal indentexpr=BicepIndent(v:lnum)
|
||||
setlocal indentkeys+=<:>,0=},0=),0=*/
|
||||
let b:undo_indent = 'setlocal lisp< autoindent< shiftwidth< tabstop< softtabstop<'
|
||||
\ . ' expandtab< indentexpr< indentkeys<'
|
||||
|
||||
let &cpoptions = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
if exists('*BicepIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
function! BicepIndent(lnum)
|
||||
" Beginning of the file should have no indent
|
||||
if a:lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Usual case is to continue at the same indent as the previous non-blank line.
|
||||
let prevlnum = prevnonblank(a:lnum-1)
|
||||
let thisindent = indent(prevlnum)
|
||||
|
||||
" If that previous line is a non-comment ending in [ { (, increase the
|
||||
" indent level.
|
||||
let prevline = getline(prevlnum)
|
||||
if prevline !~# '^\s*//' && prevline =~# '[\[{\(]\s*$'
|
||||
let thisindent += &shiftwidth
|
||||
endif
|
||||
|
||||
" If the current line ends a block, decrease the indent level.
|
||||
let thisline = getline(a:lnum)
|
||||
if thisline =~# '^\s*[\)}\]]'
|
||||
let thisindent -= &shiftwidth
|
||||
endif
|
||||
|
||||
" If the previous line starts a block comment /*, increase by one
|
||||
if prevline =~# '/\*'
|
||||
let thisindent += 2
|
||||
endif
|
||||
|
||||
" If the this line ends a block comment */, decrease by one
|
||||
if thisline =~# '\*/'
|
||||
let thisindent -= 2
|
||||
endif
|
||||
|
||||
return thisindent
|
||||
endfunction
|
||||
|
||||
let &cpoptions = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -55,6 +55,10 @@ if exists("*searchpairpos")
|
||||
let g:clojure_align_subforms = 0
|
||||
endif
|
||||
|
||||
if !exists('g:clojure_cljfmt_compat')
|
||||
let g:clojure_cljfmt_compat = 0
|
||||
endif
|
||||
|
||||
function! s:syn_id_name()
|
||||
return synIDattr(synID(line("."), col("."), 0), "name")
|
||||
endfunction
|
||||
@@ -326,9 +330,16 @@ if exists("*searchpairpos")
|
||||
return [paren[0], paren[1] + (g:clojure_align_subforms ? 0 : &shiftwidth - 1)]
|
||||
elseif w[1] == '_'
|
||||
return paren
|
||||
elseif w[1] == "'" && g:clojure_cljfmt_compat
|
||||
return paren
|
||||
endif
|
||||
endif
|
||||
|
||||
" Paren indent for keywords, symbols and derefs
|
||||
if g:clojure_cljfmt_compat && w[0] =~# "[:@']"
|
||||
return paren
|
||||
endif
|
||||
|
||||
" Test words without namespace qualifiers and leading reader macro
|
||||
" metacharacters.
|
||||
"
|
||||
|
||||
@@ -8,7 +8,12 @@ endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal cindent
|
||||
setlocal cinoptions+=j1,J1,(2s,u2s,U1,m1,+2s
|
||||
setlocal cinoptions+=j1,J1,U1,m1,+2s
|
||||
if get(g:, 'dart_trailing_comma_indent', v:false)
|
||||
setlocal cinoptions+=(2s,u2s
|
||||
else
|
||||
setlocal cinoptions+=(s,us
|
||||
endif
|
||||
|
||||
setlocal indentexpr=DartIndent()
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ endif
|
||||
" Contributors: Edwin Fine <efine145_nospam01 at usa dot net>
|
||||
" Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
|
||||
" Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||
" Last Update: 2020-Jun-11
|
||||
" Last Update: 2022-Sep-06
|
||||
" License: Vim license
|
||||
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
||||
|
||||
@@ -34,7 +34,7 @@ else
|
||||
endif
|
||||
|
||||
setlocal indentexpr=ErlangIndent()
|
||||
setlocal indentkeys+=0=end,0=of,0=catch,0=after,0=when,0=),0=],0=},0=>>
|
||||
setlocal indentkeys+=0=end,0=of,0=catch,0=after,0=else,0=when,0=),0=],0=},0=>>
|
||||
|
||||
let b:undo_indent = "setl inde< indk<"
|
||||
|
||||
@@ -241,8 +241,8 @@ function! s:GetTokensFromLine(line, string_continuation, atom_continuation,
|
||||
|
||||
" Two-character tokens
|
||||
elseif i + 1 < linelen &&
|
||||
\ index(['->', '<<', '>>', '||', '==', '/=', '=<', '>=', '++', '--',
|
||||
\ '::'],
|
||||
\ index(['->', '<<', '>>', '||', '==', '/=', '=<', '>=', '?=', '++',
|
||||
\ '--', '::'],
|
||||
\ a:line[i : i + 1]) != -1
|
||||
call add(indtokens, [a:line[i : i + 1], vcol, i])
|
||||
let next_i = i + 2
|
||||
@@ -564,8 +564,8 @@ function! s:IsCatchStandalone(lnum, i)
|
||||
let is_standalone = 0
|
||||
elseif prev_token =~# '[a-z]'
|
||||
if index(['after', 'and', 'andalso', 'band', 'begin', 'bnot', 'bor', 'bsl',
|
||||
\ 'bsr', 'bxor', 'case', 'catch', 'div', 'not', 'or', 'orelse',
|
||||
\ 'rem', 'try', 'xor'], prev_token) != -1
|
||||
\ 'bsr', 'bxor', 'case', 'catch', 'div', 'maybe', 'not', 'or',
|
||||
\ 'orelse', 'rem', 'try', 'xor'], prev_token) != -1
|
||||
" If catch is after these keywords, it is standalone
|
||||
let is_standalone = 1
|
||||
else
|
||||
@@ -574,7 +574,7 @@ function! s:IsCatchStandalone(lnum, i)
|
||||
"
|
||||
" Keywords:
|
||||
" - may precede 'catch': end
|
||||
" - may not precede 'catch': fun if of receive when
|
||||
" - may not precede 'catch': else fun if of receive when
|
||||
" - unused: cond let query
|
||||
let is_standalone = 0
|
||||
endif
|
||||
@@ -583,7 +583,7 @@ function! s:IsCatchStandalone(lnum, i)
|
||||
let is_standalone = 0
|
||||
else
|
||||
" This 'else' branch includes the following tokens:
|
||||
" -> == /= =< < >= > =:= =/= + - * / ++ -- :: < > ; ( [ { ? = ! . |
|
||||
" -> == /= =< < >= > ?= =:= =/= + - * / ++ -- :: < > ; ( [ { ? = ! . |
|
||||
let is_standalone = 1
|
||||
endif
|
||||
|
||||
@@ -596,6 +596,7 @@ endfunction
|
||||
" Purpose:
|
||||
" This function is called when a begin-type element ('begin', 'case',
|
||||
" '[', '<<', etc.) is found. It asks the caller to return if the stack
|
||||
" if already empty.
|
||||
" Parameters:
|
||||
" stack: [token]
|
||||
" token: string
|
||||
@@ -764,7 +765,7 @@ endfunction
|
||||
function! s:SearchEndPair(lnum, curr_col)
|
||||
return s:SearchPair(
|
||||
\ a:lnum, a:curr_col,
|
||||
\ '\C\<\%(case\|try\|begin\|receive\|if\)\>\|' .
|
||||
\ '\C\<\%(case\|try\|begin\|receive\|if\|maybe\)\>\|' .
|
||||
\ '\<fun\>\%(\s\|\n\|%.*$\|[A-Z_@][a-zA-Z_@]*\)*(',
|
||||
\ '',
|
||||
\ '\<end\>')
|
||||
@@ -853,6 +854,7 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
if ret | return res | endif
|
||||
|
||||
" case EXPR of BRANCHES end
|
||||
" if BRANCHES end
|
||||
" try EXPR catch BRANCHES end
|
||||
" try EXPR after BODY end
|
||||
" try EXPR catch BRANCHES after BODY end
|
||||
@@ -861,15 +863,17 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" try EXPR of BRANCHES catch BRANCHES after BODY end
|
||||
" receive BRANCHES end
|
||||
" receive BRANCHES after BRANCHES end
|
||||
" maybe EXPR end
|
||||
" maybe EXPR else BRANCHES end
|
||||
|
||||
" This branch is not Emacs-compatible
|
||||
elseif (index(['of', 'receive', 'after', 'if'], token) != -1 ||
|
||||
elseif (index(['of', 'receive', 'after', 'if', 'else'], token) != -1 ||
|
||||
\ (token ==# 'catch' && !s:IsCatchStandalone(lnum, i))) &&
|
||||
\ !last_token_of_line &&
|
||||
\ (empty(stack) || stack ==# ['when'] || stack ==# ['->'] ||
|
||||
\ stack ==# ['->', ';'])
|
||||
|
||||
" If we are after of/receive, but these are not the last
|
||||
" If we are after of/receive/etc, but these are not the last
|
||||
" tokens of the line, we want to indent like this:
|
||||
"
|
||||
" % stack == []
|
||||
@@ -895,21 +899,21 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" stack = ['when'] => LTI is a guard
|
||||
if empty(stack) || stack == ['->', ';']
|
||||
call s:Log(' LTI is in a condition after ' .
|
||||
\'"of/receive/after/if/catch" -> return')
|
||||
\'"of/receive/after/if/else/catch" -> return')
|
||||
return stored_vcol
|
||||
elseif stack == ['->']
|
||||
call s:Log(' LTI is in a branch after ' .
|
||||
\'"of/receive/after/if/catch" -> return')
|
||||
\'"of/receive/after/if/else/catch" -> return')
|
||||
return stored_vcol + shiftwidth()
|
||||
elseif stack == ['when']
|
||||
call s:Log(' LTI is in a guard after ' .
|
||||
\'"of/receive/after/if/catch" -> return')
|
||||
\'"of/receive/after/if/else/catch" -> return')
|
||||
return stored_vcol + shiftwidth()
|
||||
else
|
||||
return s:UnexpectedToken(token, stack)
|
||||
endif
|
||||
|
||||
elseif index(['case', 'if', 'try', 'receive'], token) != -1
|
||||
elseif index(['case', 'if', 'try', 'receive', 'maybe'], token) != -1
|
||||
|
||||
" stack = [] => LTI is a condition
|
||||
" stack = ['->'] => LTI is a branch
|
||||
@@ -919,45 +923,47 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" pass
|
||||
elseif (token ==# 'case' && stack[0] ==# 'of') ||
|
||||
\ (token ==# 'if') ||
|
||||
\ (token ==# 'maybe' && stack[0] ==# 'else') ||
|
||||
\ (token ==# 'try' && (stack[0] ==# 'of' ||
|
||||
\ stack[0] ==# 'catch' ||
|
||||
\ stack[0] ==# 'after')) ||
|
||||
\ (token ==# 'receive')
|
||||
|
||||
" From the indentation point of view, the keyword
|
||||
" (of/catch/after/end) before the LTI is what counts, so
|
||||
" (of/catch/after/else/end) before the LTI is what counts, so
|
||||
" when we reached these tokens, and the stack already had
|
||||
" a catch/after/end, we didn't modify it.
|
||||
" a catch/after/else/end, we didn't modify it.
|
||||
"
|
||||
" This way when we reach case/try/receive (i.e. now),
|
||||
" there is at most one of/catch/after/end token in the
|
||||
" This way when we reach case/try/receive/maybe (i.e. now),
|
||||
" there is at most one of/catch/after/else/end token in the
|
||||
" stack.
|
||||
if token ==# 'case' || token ==# 'try' ||
|
||||
\ (token ==# 'receive' && stack[0] ==# 'after')
|
||||
\ (token ==# 'receive' && stack[0] ==# 'after') ||
|
||||
\ (token ==# 'maybe' && stack[0] ==# 'else')
|
||||
call s:Pop(stack)
|
||||
endif
|
||||
|
||||
if empty(stack)
|
||||
call s:Log(' LTI is in a condition; matching ' .
|
||||
\'"case/if/try/receive" found')
|
||||
\'"case/if/try/receive/maybe" found')
|
||||
let stored_vcol = curr_vcol + shiftwidth()
|
||||
elseif stack[0] ==# 'align_to_begin_element'
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol
|
||||
elseif len(stack) > 1 && stack[0] ==# '->' && stack[1] ==# ';'
|
||||
call s:Log(' LTI is in a condition; matching ' .
|
||||
\'"case/if/try/receive" found')
|
||||
\'"case/if/try/receive/maybe" found')
|
||||
call s:Pop(stack)
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol + shiftwidth()
|
||||
elseif stack[0] ==# '->'
|
||||
call s:Log(' LTI is in a branch; matching ' .
|
||||
\'"case/if/try/receive" found')
|
||||
\'"case/if/try/receive/maybe" found')
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol + 2 * shiftwidth()
|
||||
elseif stack[0] ==# 'when'
|
||||
call s:Log(' LTI is in a guard; matching ' .
|
||||
\'"case/if/try/receive" found')
|
||||
\'"case/if/try/receive/maybe" found')
|
||||
call s:Pop(stack)
|
||||
let stored_vcol = curr_vcol + 2 * shiftwidth() + 2
|
||||
endif
|
||||
@@ -1219,7 +1225,7 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
|
||||
if empty(stack)
|
||||
call s:Push(stack, ';')
|
||||
elseif index([';', '->', 'when', 'end', 'after', 'catch'],
|
||||
elseif index([';', '->', 'when', 'end', 'after', 'catch', 'else'],
|
||||
\stack[0]) != -1
|
||||
" Pass:
|
||||
"
|
||||
@@ -1229,10 +1235,10 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" should keep that, because they signify the type of the
|
||||
" LTI (branch, condition or guard).
|
||||
" - From the indentation point of view, the keyword
|
||||
" (of/catch/after/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/end, we don't
|
||||
" modify it. This way when we reach case/try/receive,
|
||||
" there will be at most one of/catch/after/end token in
|
||||
" (of/catch/after/else/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/else/end, we don't
|
||||
" modify it. This way when we reach case/try/receive/maybe,
|
||||
" there will be at most one of/catch/after/else/end token in
|
||||
" the stack.
|
||||
else
|
||||
return s:UnexpectedToken(token, stack)
|
||||
@@ -1248,7 +1254,8 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" stack = ['->'] -> LTI is a condition
|
||||
" stack = ['->', ';'] -> LTI is a branch
|
||||
call s:Push(stack, '->')
|
||||
elseif index(['->', 'when', 'end', 'after', 'catch'], stack[0]) != -1
|
||||
elseif index(['->', 'when', 'end', 'after', 'catch', 'else'],
|
||||
\stack[0]) != -1
|
||||
" Pass:
|
||||
"
|
||||
" - If the stack top is another '->', then one '->' is
|
||||
@@ -1256,10 +1263,10 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" - If the stack top is a 'when', then we should keep
|
||||
" that, because this signifies that LTI is a in a guard.
|
||||
" - From the indentation point of view, the keyword
|
||||
" (of/catch/after/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/end, we don't
|
||||
" modify it. This way when we reach case/try/receive,
|
||||
" there will be at most one of/catch/after/end token in
|
||||
" (of/catch/after/else/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/else/end, we don't
|
||||
" modify it. This way when we reach case/try/receive/maybe,
|
||||
" there will be at most one of/catch/after/else/end token in
|
||||
" the stack.
|
||||
else
|
||||
return s:UnexpectedToken(token, stack)
|
||||
@@ -1289,7 +1296,8 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" LTI
|
||||
call s:Push(stack, token)
|
||||
endif
|
||||
elseif index(['->', 'when', 'end', 'after', 'catch'], stack[0]) != -1
|
||||
elseif index(['->', 'when', 'end', 'after', 'catch', 'else'],
|
||||
\stack[0]) != -1
|
||||
" Pass:
|
||||
" - If the stack top is another 'when', then one 'when' is
|
||||
" enough.
|
||||
@@ -1297,21 +1305,63 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
" should keep that, because they signify the type of the
|
||||
" LTI (branch, condition or guard).
|
||||
" - From the indentation point of view, the keyword
|
||||
" (of/catch/after/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/end, we don't
|
||||
" modify it. This way when we reach case/try/receive,
|
||||
" there will be at most one of/catch/after/end token in
|
||||
" (of/catch/after/else/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/else/end, we don't
|
||||
" modify it. This way when we reach case/try/receive/maybe,
|
||||
" there will be at most one of/catch/after/else/end token in
|
||||
" the stack.
|
||||
else
|
||||
return s:UnexpectedToken(token, stack)
|
||||
endif
|
||||
|
||||
elseif token ==# 'of' || token ==# 'after' ||
|
||||
elseif token ==# 'of' || token ==# 'after' || token ==# 'else' ||
|
||||
\ (token ==# 'catch' && !s:IsCatchStandalone(lnum, i))
|
||||
|
||||
if token ==# 'after'
|
||||
" If LTI is between an 'after' and the corresponding
|
||||
" 'end', then let's return
|
||||
if token ==# 'after' || token ==# 'else'
|
||||
" If LTI is between an after/else and the corresponding 'end', then
|
||||
" let's return because calculating the indentation based on
|
||||
" after/else is enough.
|
||||
"
|
||||
" Example:
|
||||
" receive A after
|
||||
" LTI
|
||||
" maybe A else
|
||||
" LTI
|
||||
"
|
||||
" Note about Emacs compabitility {{{
|
||||
"
|
||||
" It would be fine to indent the examples above the following way:
|
||||
"
|
||||
" receive A after
|
||||
" LTI
|
||||
" maybe A else
|
||||
" LTI
|
||||
"
|
||||
" We intend it the way above because that is how Emacs does it.
|
||||
" Also, this is a bit faster.
|
||||
"
|
||||
" We are still not 100% Emacs compatible because of placing the
|
||||
" 'end' after the indented blocks.
|
||||
"
|
||||
" Emacs example:
|
||||
"
|
||||
" receive A after
|
||||
" LTI
|
||||
" end,
|
||||
" maybe A else
|
||||
" LTI
|
||||
" end % Yes, it's here (in OTP 25.0, might change
|
||||
" % later)
|
||||
"
|
||||
" vim-erlang example:
|
||||
"
|
||||
" receive A after
|
||||
" LTI
|
||||
" end,
|
||||
" maybe A else
|
||||
" LTI
|
||||
" end
|
||||
" }}}
|
||||
let [ret, res] = s:BeginElementFoundIfEmpty(stack, token, curr_vcol,
|
||||
\stored_vcol, shiftwidth())
|
||||
if ret | return res | endif
|
||||
@@ -1319,7 +1369,8 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
||||
|
||||
if empty(stack) || stack[0] ==# '->' || stack[0] ==# 'when'
|
||||
call s:Push(stack, token)
|
||||
elseif stack[0] ==# 'catch' || stack[0] ==# 'after' || stack[0] ==# 'end'
|
||||
elseif stack[0] ==# 'catch' || stack[0] ==# 'after' ||
|
||||
\stack[0] ==# 'else' || stack[0] ==# 'end'
|
||||
" Pass: From the indentation point of view, the keyword
|
||||
" (of/catch/after/end) before the LTI is what counts, so
|
||||
" if the stack already has a catch/after/end, we don't
|
||||
@@ -1409,7 +1460,7 @@ function! ErlangIndent()
|
||||
endif
|
||||
|
||||
let ml = matchlist(currline,
|
||||
\'^\(\s*\)\(\%(end\|of\|catch\|after\)\>\|[)\]}]\|>>\)')
|
||||
\'^\(\s*\)\(\%(end\|of\|catch\|after\|else\)\>\|[)\]}]\|>>\)')
|
||||
|
||||
" If the line has a special beginning, but not a standalone catch
|
||||
if !empty(ml) && !(ml[2] ==# 'catch' && s:IsCatchStandalone(v:lnum, 0))
|
||||
|
||||
@@ -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 formatoptions+=roq
|
||||
setlocal cinoptions&
|
||||
|
||||
" vim:set sts=2 sw=2 :
|
||||
|
||||
@@ -5,7 +5,7 @@ endif
|
||||
" Vim indent file
|
||||
" Language: Haml
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2017 Jun 13
|
||||
" Last Change: 2022 Mar 15
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
|
||||
@@ -92,7 +92,7 @@ function GetJuliaNestingStruct(lnum, ...)
|
||||
let i = JuliaMatch(a:lnum, line, '\<else\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
if len(blocks_stack) > 0 && blocks_stack[-1] =~# '\<\%(else\)\=if\>'
|
||||
if len(blocks_stack) > 0 && blocks_stack[-1] =~# '\<\%(\%(else\)\=if\|catch\)\>'
|
||||
let blocks_stack[-1] = 'else'
|
||||
else
|
||||
call add(blocks_stack, 'else')
|
||||
@@ -110,7 +110,7 @@ function GetJuliaNestingStruct(lnum, ...)
|
||||
let i = JuliaMatch(a:lnum, line, '\<catch\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
if len(blocks_stack) > 0 && blocks_stack[-1] == 'try'
|
||||
if len(blocks_stack) > 0 && blocks_stack[-1] =~# '\<\%(try\|finally\)\>'
|
||||
let blocks_stack[-1] = 'catch'
|
||||
else
|
||||
call add(blocks_stack, 'catch')
|
||||
@@ -121,7 +121,7 @@ function GetJuliaNestingStruct(lnum, ...)
|
||||
let i = JuliaMatch(a:lnum, line, '\<finally\>', s)
|
||||
if i >= 0 && i == fb
|
||||
let s = i+1
|
||||
if len(blocks_stack) > 0 && (blocks_stack[-1] == 'try' || blocks_stack[-1] == 'catch')
|
||||
if len(blocks_stack) > 0 && blocks_stack[-1] =~# '\<\%(try\|catch\|else\)\>'
|
||||
let blocks_stack[-1] = 'finally'
|
||||
else
|
||||
call add(blocks_stack, 'finally')
|
||||
|
||||
@@ -2,7 +2,6 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'plantuml', 'indent/plantuml.v
|
||||
finish
|
||||
endif
|
||||
|
||||
scriptencoding utf-8
|
||||
" Vim indent file
|
||||
" Language: PlantUML
|
||||
" License: VIM LICENSE
|
||||
|
||||
@@ -18,6 +18,8 @@ setlocal indentexpr=GetRSTIndent()
|
||||
setlocal indentkeys=!^F,o,O
|
||||
setlocal nosmartindent
|
||||
|
||||
let b:undo_indent = "setlocal indentexpr< indentkeys< smartindent<"
|
||||
|
||||
if exists("*GetRSTIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -43,9 +43,11 @@ setlocal nosmartindent
|
||||
" Now, set up our indentation expression and keys that trigger it.
|
||||
setlocal indentexpr=GetRubyIndent(v:lnum)
|
||||
setlocal indentkeys=0{,0},0),0],!^F,o,O,e,:,.
|
||||
setlocal indentkeys+==end,=else,=elsif,=when,=in,=ensure,=rescue,==begin,==end
|
||||
setlocal indentkeys+==end,=else,=elsif,=when,=in\ ,=ensure,=rescue,==begin,==end
|
||||
setlocal indentkeys+==private,=protected,=public
|
||||
|
||||
let b:undo_indent = "setlocal indentexpr< indentkeys< smartindent<"
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetRubyIndent")
|
||||
finish
|
||||
@@ -94,7 +96,7 @@ let s:ruby_indent_keywords =
|
||||
\ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>'
|
||||
|
||||
" 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.
|
||||
let s:ruby_deindent_keywords =
|
||||
|
||||
91
indent/svelte-css.vim
Normal file
91
indent/svelte-css.vim
Normal file
@@ -0,0 +1,91 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'svelte', 'indent/svelte-css.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim indent file
|
||||
" Language: CSS
|
||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2012-05-30
|
||||
" Use of shiftwidth() added by Oleg Zubchenko.
|
||||
|
||||
" Changes: 1) Reacquire the line while checking comment lines.
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetCSSIndent()
|
||||
setlocal indentkeys=0{,0},!^F,o,O
|
||||
setlocal nosmartindent
|
||||
|
||||
let b:undo_indent = "setl smartindent< indentkeys< indentexpr<"
|
||||
|
||||
if exists("*GetCSSIndent")
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
function s:prevnonblanknoncomment(lnum)
|
||||
let lnum = a:lnum
|
||||
while lnum > 1
|
||||
let lnum = prevnonblank(lnum)
|
||||
let line = getline(lnum)
|
||||
if line =~ '\*/'
|
||||
while lnum > 1 && line !~ '/\*'
|
||||
let lnum -= 1
|
||||
let line = getline(lnum)
|
||||
endwhile
|
||||
if line =~ '^\s*/\*'
|
||||
let lnum -= 1
|
||||
else
|
||||
break
|
||||
endif
|
||||
else
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
return lnum
|
||||
endfunction
|
||||
|
||||
function s:count_braces(lnum, count_open)
|
||||
let n_open = 0
|
||||
let n_close = 0
|
||||
let line = getline(a:lnum)
|
||||
let pattern = '[{}]'
|
||||
let i = match(line, pattern)
|
||||
while i != -1
|
||||
if synIDattr(synID(a:lnum, i + 1, 0), 'name') !~ 'css\%(Comment\|StringQ\{1,2}\)'
|
||||
if line[i] == '{'
|
||||
let n_open += 1
|
||||
elseif line[i] == '}'
|
||||
if n_open > 0
|
||||
let n_open -= 1
|
||||
else
|
||||
let n_close += 1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
let i = match(line, pattern, i + 1)
|
||||
endwhile
|
||||
return a:count_open ? n_open : n_close
|
||||
endfunction
|
||||
|
||||
function GetCSSIndent()
|
||||
let line = getline(v:lnum)
|
||||
if line =~ '^\s*\*'
|
||||
return cindent(v:lnum)
|
||||
endif
|
||||
|
||||
let pnum = s:prevnonblanknoncomment(v:lnum - 1)
|
||||
if pnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
return indent(pnum) + s:count_braces(pnum, 1) * shiftwidth()
|
||||
\ - s:count_braces(v:lnum, 0) * shiftwidth()
|
||||
endfunction
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
111
indent/svelte-xml.vim
Normal file
111
indent/svelte-xml.vim
Normal file
@@ -0,0 +1,111 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'svelte', 'indent/svelte-xml.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Language: xml
|
||||
" Maintainer: Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: 2017 Jun 13
|
||||
" Notes: 1) does not indent pure non-xml code (e.g. embedded scripts)
|
||||
" 2) will be confused by unbalanced tags in comments
|
||||
" or CDATA sections.
|
||||
" 2009-05-26 patch by Nikolai Weibull
|
||||
" TODO: implement pre-like tags, see xml_indent_open / xml_indent_close
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
" [-- local settings (must come before aborting the script) --]
|
||||
setlocal indentexpr=XmlIndentGet(v:lnum,1)
|
||||
setlocal indentkeys=o,O,*<Return>,<>>,<<>,/,{,}
|
||||
|
||||
if !exists('b:xml_indent_open')
|
||||
let b:xml_indent_open = '.\{-}<\a'
|
||||
" pre tag, e.g. <address>
|
||||
" let b:xml_indent_open = '.\{-}<[/]\@!\(address\)\@!'
|
||||
endif
|
||||
|
||||
if !exists('b:xml_indent_close')
|
||||
let b:xml_indent_close = '.\{-}</'
|
||||
" end pre tag, e.g. </address>
|
||||
" let b:xml_indent_close = '.\{-}</\(address\)\@!'
|
||||
endif
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" [-- finish, if the function already exists --]
|
||||
if exists('*XmlIndentGet')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
fun! <SID>XmlIndentWithPattern(line, pat)
|
||||
let s = substitute('x'.a:line, a:pat, "\1", 'g')
|
||||
return strlen(substitute(s, "[^\1].*$", '', ''))
|
||||
endfun
|
||||
|
||||
" [-- check if it's xml --]
|
||||
fun! <SID>XmlIndentSynCheck(lnum)
|
||||
if '' != &syntax
|
||||
let syn1 = synIDattr(synID(a:lnum, 1, 1), 'name')
|
||||
let syn2 = synIDattr(synID(a:lnum, strlen(getline(a:lnum)) - 1, 1), 'name')
|
||||
if '' != syn1 && syn1 !~ 'xml' && '' != syn2 && syn2 !~ 'xml'
|
||||
" don't indent pure non-xml code
|
||||
return 0
|
||||
elseif syn1 =~ '^xmlComment' && syn2 =~ '^xmlComment'
|
||||
" indent comments specially
|
||||
return -1
|
||||
endif
|
||||
endif
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" [-- return the sum of indents of a:lnum --]
|
||||
fun! <SID>XmlIndentSum(lnum, style, add)
|
||||
let line = getline(a:lnum)
|
||||
if a:style == match(line, '^\s*</')
|
||||
return (shiftwidth() *
|
||||
\ (<SID>XmlIndentWithPattern(line, b:xml_indent_open)
|
||||
\ - <SID>XmlIndentWithPattern(line, b:xml_indent_close)
|
||||
\ - <SID>XmlIndentWithPattern(line, '.\{-}/>'))) + a:add
|
||||
else
|
||||
return a:add
|
||||
endif
|
||||
endfun
|
||||
|
||||
fun! XmlIndentGet(lnum, use_syntax_check)
|
||||
" Find a non-empty line above the current line.
|
||||
let lnum = prevnonblank(a:lnum - 1)
|
||||
|
||||
" Hit the start of the file, use zero indent.
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
if a:use_syntax_check
|
||||
let check_lnum = <SID>XmlIndentSynCheck(lnum)
|
||||
let check_alnum = <SID>XmlIndentSynCheck(a:lnum)
|
||||
if 0 == check_lnum || 0 == check_alnum
|
||||
return indent(a:lnum)
|
||||
elseif -1 == check_lnum || -1 == check_alnum
|
||||
return -1
|
||||
endif
|
||||
endif
|
||||
|
||||
let ind = <SID>XmlIndentSum(lnum, -1, indent(lnum))
|
||||
let ind = <SID>XmlIndentSum(a:lnum, 0, ind)
|
||||
|
||||
return ind
|
||||
endfun
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" vim:ts=8
|
||||
@@ -55,12 +55,12 @@ let s:debug = svelte#GetConfig('debug', 0)
|
||||
" Save shiftwidth
|
||||
let s:sw = &sw
|
||||
|
||||
" Use lib/indent/ files for compatibility
|
||||
" Use specific indent files for compatibility
|
||||
unlet! b:did_indent
|
||||
runtime lib/indent/xml.vim
|
||||
runtime indent/svelte-xml.vim
|
||||
|
||||
unlet! b:did_indent
|
||||
runtime lib/indent/css.vim
|
||||
runtime indent/svelte-css.vim
|
||||
|
||||
" Use normal indent files
|
||||
unlet! b:did_indent
|
||||
@@ -119,7 +119,7 @@ function! GetSvelteIndent()
|
||||
let cursyns = s:SynsSOL(v:lnum)
|
||||
let cursyn = get(cursyns, 0, '')
|
||||
|
||||
if s:SynHTML(cursyn)
|
||||
if s:SynHTML(cursyn) && !s:IsMultipleLineSvelteExpression(curline, cursyns)
|
||||
call s:Log('syntax: html')
|
||||
let ind = XmlIndentGet(v:lnum, 0)
|
||||
if prevline =~? s:empty_tag
|
||||
@@ -233,6 +233,20 @@ function! s:SynHTML(syn)
|
||||
return a:syn ==? 'htmlSvelteTemplate'
|
||||
endfunction
|
||||
|
||||
function! s:IsMultipleLineSvelteExpression(curline, syns)
|
||||
if a:curline =~ '^\s*{.*}\s*$'
|
||||
return 0
|
||||
endif
|
||||
|
||||
for syn in a:syns
|
||||
if syn ==? 'svelteExpression'
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:SynBlockBody(syn)
|
||||
return a:syn ==? 'svelteBlockBody'
|
||||
endfunction
|
||||
|
||||
@@ -3,18 +3,16 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'yaml', 'indent/yaml.vim')
|
||||
endif
|
||||
|
||||
" Vim indent file
|
||||
" Language: YAML
|
||||
" Maintainer: Nikolai Pavlov <zyx.vim@gmail.com>
|
||||
" Last Change: 2019 Sep 28
|
||||
" Language: YAML
|
||||
" Maintainer: Nikolai Pavlov <zyx.vim@gmail.com>
|
||||
" Last Update: Lukas Reineke
|
||||
" Last Change: 2021 Aug 13
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetYAMLIndent(v:lnum)
|
||||
@@ -28,6 +26,9 @@ if exists('*GetYAMLIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function s:FindPrevLessIndentedLine(lnum, ...)
|
||||
let prevlnum = prevnonblank(a:lnum-1)
|
||||
let curindent = a:0 ? a:1 : indent(a:lnum)
|
||||
@@ -57,7 +58,7 @@ let s:c_ns_anchor_name = s:c_ns_anchor_char.'+'
|
||||
let s:c_ns_anchor_property = '\v\&'.s:c_ns_anchor_name
|
||||
|
||||
let s:ns_word_char = '\v[[:alnum:]_\-]'
|
||||
let s:ns_tag_char = '\v%(%\x\x|'.s:ns_word_char.'|[#/;?:@&=+$.~*''()])'
|
||||
let s:ns_tag_char = '\v%('.s:ns_word_char.'|[#/;?:@&=+$.~*''()])'
|
||||
let s:c_named_tag_handle = '\v\!'.s:ns_word_char.'+\!'
|
||||
let s:c_secondary_tag_handle = '\v\!\!'
|
||||
let s:c_primary_tag_handle = '\v\!'
|
||||
@@ -66,7 +67,7 @@ let s:c_tag_handle = '\v%('.s:c_named_tag_handle.
|
||||
\ '|'.s:c_primary_tag_handle.')'
|
||||
let s:c_ns_shorthand_tag = '\v'.s:c_tag_handle . s:ns_tag_char.'+'
|
||||
let s:c_non_specific_tag = '\v\!'
|
||||
let s:ns_uri_char = '\v%(%\x\x|'.s:ns_word_char.'\v|[#/;?:@&=+$,.!~*''()[\]])'
|
||||
let s:ns_uri_char = '\v%('.s:ns_word_char.'\v|[#/;?:@&=+$,.!~*''()[\]])'
|
||||
let s:c_verbatim_tag = '\v\!\<'.s:ns_uri_char.'+\>'
|
||||
let s:c_ns_tag_property = '\v'.s:c_verbatim_tag.
|
||||
\ '\v|'.s:c_ns_shorthand_tag.
|
||||
|
||||
@@ -37,6 +37,8 @@ setlocal cinkeys=0{,0},0),0],!^F,o,O
|
||||
|
||||
setlocal indentexpr=GetZigIndent(v:lnum)
|
||||
|
||||
let b:undo_indent = "setlocal cindent< cinkeys< cinoptions< indentexpr<"
|
||||
|
||||
function! GetZigIndent(lnum)
|
||||
let curretLineNum = a:lnum
|
||||
let currentLine = getline(a:lnum)
|
||||
|
||||
891
packages.yaml
891
packages.yaml
File diff suppressed because it is too large
Load Diff
@@ -896,16 +896,17 @@ def show_warnings(all_filetypes, expected_filetypes)
|
||||
end
|
||||
|
||||
def generate_fallback
|
||||
filetype_content = File.read('tmp/vim/vim/runtime/filetype.vim')
|
||||
filetype_content = File.read('tmp/vim/vim-v8.2.4274/runtime/filetype.vim')
|
||||
filetype_content.gsub!('runtime! ftdetect/*.vim', '')
|
||||
filetype_content.gsub!(/^au BufNewFile,BufRead \*\n.+?runtime!.+?endif/m) {}
|
||||
filetype_content.gsub!(/^au StdinReadPost \* .+?runtime!.+?endif/m) {}
|
||||
filetype_content.gsub!(/^au filetypedetect BufNewFile,BufRead,StdinReadPost \*\n.+?endif/m) {}
|
||||
filetype_content.gsub!("dist#ft#", "polyglot#ft#")
|
||||
filetype_content.gsub!("TestFiletypeFuncs", "TestPolyglotFiletypeFuncs")
|
||||
File.write('extras/filetype.vim', filetype_content)
|
||||
File.write('extras/menu.vim', File.read('tmp/vim/vim/runtime/menu.vim'))
|
||||
File.write('extras/menu.vim', File.read('tmp/vim/vim-v8.2.4274/runtime/menu.vim'))
|
||||
|
||||
autoload_content = File.read('tmp/vim/vim/runtime/autoload/dist/ft.vim')
|
||||
autoload_content = File.read('tmp/vim/vim-v8.2.4274/runtime/autoload/dist/ft.vim')
|
||||
autoload_content.gsub!('dist#ft#', 'polyglot#ft#')
|
||||
File.write('autoload/polyglot/ft.vim', autoload_content)
|
||||
end
|
||||
@@ -919,6 +920,11 @@ if __FILE__ == $0
|
||||
Dir.mkdir('tmp') unless File.exists?('tmp')
|
||||
|
||||
packages, heuristics = load_data()
|
||||
packages.each do |package|
|
||||
if package["native"] == true
|
||||
package["remote"] = "vim/vim@v8.2.4274:runtime"
|
||||
end
|
||||
end
|
||||
download(packages)
|
||||
extract(packages)
|
||||
generate_fallback()
|
||||
|
||||
@@ -5,7 +5,7 @@ endif
|
||||
"Import
|
||||
syntax keyword typescriptImport from as
|
||||
syntax keyword typescriptImport import
|
||||
\ nextgroup=typescriptImportType
|
||||
\ nextgroup=typescriptImportType,typescriptTypeBlock,typescriptDefaultImportName
|
||||
\ skipwhite
|
||||
syntax keyword typescriptImportType type
|
||||
\ contained
|
||||
@@ -17,11 +17,10 @@ syntax match typescriptExportType /\<type\s*{\@=/
|
||||
syntax keyword typescriptModule namespace module
|
||||
|
||||
|
||||
syntax keyword typescriptCastKeyword as
|
||||
syntax keyword typescriptCastKeyword as satisfies
|
||||
\ nextgroup=@typescriptType
|
||||
\ skipwhite
|
||||
|
||||
|
||||
syntax keyword typescriptVariable let var
|
||||
\ nextgroup=@typescriptVariableDeclarations
|
||||
\ skipwhite skipempty
|
||||
@@ -90,6 +89,17 @@ syntax cluster typescriptAmbients contains=
|
||||
\ typescriptModule
|
||||
|
||||
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
|
||||
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|.)"
|
||||
|
||||
" From vim runtime
|
||||
" <https://github.com/vim/vim/blob/master/runtime/syntax/javascript.vim#L48>
|
||||
syntax region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gimsuy]\{0,5\}\s*$+ end=+/[gimsuy]\{0,5\}\s*[;.,)\]}:]+me=e-1 nextgroup=typescriptDotNotation oneline
|
||||
" From pangloss/vim-javascript
|
||||
" <https://github.com/pangloss/vim-javascript/blob/d6e137563c47fb59f26ed25d044c0c7532304f18/syntax/javascript.vim#L64-L72>
|
||||
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
|
||||
\ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/
|
||||
|
||||
83
syntax/bicep.vim
Normal file
83
syntax/bicep.vim
Normal file
@@ -0,0 +1,83 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bicep', 'syntax/bicep.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
if has('patch-7.4.1142')
|
||||
syn iskeyword a-z,A-Z,48-57,_,-
|
||||
endif
|
||||
|
||||
syn case match
|
||||
|
||||
|
||||
syn keyword bicepDataType array bool int object string contained
|
||||
|
||||
syn keyword bicepStatement var module targetScope
|
||||
|
||||
syn keyword bicepStatement param nextgroup=bicepParameterName skipwhite
|
||||
syn match bicepParameterName /\h\w*/ nextgroup=bicepDataType skipwhite contained
|
||||
|
||||
syn keyword bicepStatement output nextgroup=bicepOutputName skipwhite
|
||||
syn match bicepOutputName /\h\w*/ nextgroup=bicepDataType skipwhite contained
|
||||
|
||||
syn keyword bicepStatement resource nextgroup=bicepResourceName skipwhite
|
||||
syn match bicepResourceName /\h\w*/ nextgroup=bicepResourceString skipwhite contained
|
||||
syn region bicepResourceString start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=bicepStringInterp nextgroup=bicepExisting skipwhite
|
||||
syn keyword bicepExisting existing contained
|
||||
|
||||
syn match bicepDecoratorName /@\s*\h\%(\w\|\.\)*/ contains=bicepDecorator
|
||||
syn match bicepDecorator /@/ contained
|
||||
|
||||
syn region bicepComment start="/\*" end="\*/" contains=bicepTodo,@Spell
|
||||
syn region bicepComment start="//" end="$" contains=bicepTodo,@Spell
|
||||
syn keyword bicepTodo TODO FIXME XXX BUG contained
|
||||
|
||||
syn keyword bicepValueBool true false
|
||||
syn keyword bicepValueNull null
|
||||
syn match bicepValueDec /\<[0-9]\+\([kKmMgG]b\?\)\?\>/
|
||||
|
||||
syn region bicepValueString start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=bicepStringInterp,bicepEscape
|
||||
syn region bicepStringInterp start=/${/ end=/}/ contained
|
||||
syn match bicepEscape /\\n/ contained
|
||||
syn match bicepEscape /\\r/ contained
|
||||
|
||||
syn keyword bicepRepeat for in
|
||||
syn keyword bicepConditional if
|
||||
|
||||
syn match bicepBraces /[{}\[\]]/
|
||||
|
||||
|
||||
hi def link bicepDataType Type
|
||||
hi def link bicepStatement Statement
|
||||
hi def link bicepResourceString String
|
||||
hi def link bicepExisting Label
|
||||
|
||||
hi def link bicepDecorator Define
|
||||
|
||||
hi def link bicepComment Comment
|
||||
hi def link bicepTodo Todo
|
||||
|
||||
hi def link bicepValueBool Boolean
|
||||
hi def link bicepValueDec Number
|
||||
hi def link bicepValueNull Constant
|
||||
|
||||
hi def link bicepValueString String
|
||||
hi def link bicepStringInterp Identifier
|
||||
hi def link bicepEscape Special
|
||||
|
||||
hi def link bicepRepeat Repeat
|
||||
hi def link bicepConditional Conditional
|
||||
|
||||
hi def link bicepBraces Delimiter
|
||||
|
||||
|
||||
let b:current_syntax = 'bicep'
|
||||
|
||||
let &cpoptions = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -2,32 +2,51 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'caddyfile', 'syntax/caddyfile
|
||||
finish
|
||||
endif
|
||||
|
||||
" Language: Caddyfile
|
||||
" Author: Josh Glendenning <josh@isobit.io>
|
||||
" Language: Caddyfile
|
||||
" Maintainer: 0az <0az@afzhou.com>
|
||||
" Original Author: Josh Glendenning <josh@isobit.io>
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match caddyDirective "^\s*\([a-zA-Z0-9_]\+\)" nextgroup=caddyDirectiveArgs skipwhite
|
||||
syn region caddyDirectiveArgs start="" end="\({\|#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString nextgroup=caddyDirectiveBlock skipwhite
|
||||
syn region caddyDirectiveBlock start="{" skip="\\}" end="}" contained contains=caddySubdirective,caddyComment
|
||||
syn match caddyDirective "\v^\s*(\w\S*)" nextgroup=caddyDirectiveArgs skipwhite
|
||||
syn region caddyDirectiveArgs start="" end="\({\|#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString,caddyNamedMatcher nextgroup=caddyDirectiveBlock skipwhite
|
||||
syn region caddyDirectiveBlock start="{" skip="\\}" end="}" contained contains=caddySubdirective,caddyComment,caddyImport
|
||||
|
||||
syn match caddySubdirective "^\s*\([a-zA-Z0-9_]\+\)" contained nextgroup=caddySubdirectiveArgs skipwhite
|
||||
syn region caddySubdirectiveArgs start="" end="\(#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString
|
||||
syn match caddySubdirective "\v^\s*(\w\S*)" contained nextgroup=caddySubdirectiveArgs skipwhite
|
||||
syn region caddySubdirectiveArgs start="" end="\(#\|$\)"me=s-1 oneline contained contains=caddyPlaceholder,caddyString,caddyNamedMatcher
|
||||
|
||||
syn match caddyHost "\(https\?:\/\/\)\?\(\(\w\{1,}\.\)\(\w\{2,}\.\?\)\+\|localhost\)\(:[0-9]\{1,5}\)\?" nextgroup=caddyHostBlock skipwhite
|
||||
syn region caddyHostBlock start="{" skip="\\}" end="}" contained contains=caddyDirective,caddyComment
|
||||
" Needs priority over Directive
|
||||
syn match caddyImport "\v^\s*<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 caddyString start='"' skip='\\\\\|\\"' end='"' oneline
|
||||
syn match caddyComment "#.*$"
|
||||
syn region caddyComment start="#" end="$" oneline
|
||||
|
||||
hi link caddyDirective Keyword
|
||||
hi link caddySubdirective Structure
|
||||
hi link caddyHost Identifier
|
||||
hi link caddyImport PreProc
|
||||
hi link caddySnippetDef PreProc
|
||||
hi link caddySnippet Identifier
|
||||
hi link caddyPlaceholder Special
|
||||
hi link caddyString String
|
||||
hi link caddyComment Comment
|
||||
hi link caddyNamedMatcherDef caddyNamedMatcher
|
||||
hi link caddyNamedMatcher Identifier
|
||||
|
||||
let b:current_syntax = "caddyfile"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -149,6 +149,7 @@ syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc
|
||||
" Defines
|
||||
syn match elixirDefine '\<def\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
||||
syn match elixirPrivateDefine '\<defp\>\(:\)\@!' nextgroup=elixirPrivateFunctionDeclaration skipwhite skipnl
|
||||
syn match elixirNumericalDefine '\<defn\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
||||
syn match elixirGuard '\<defguard\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
||||
syn match elixirPrivateGuard '\<defguardp\>\(:\)\@!' nextgroup=elixirPrivateFunctionDeclaration skipwhite skipnl
|
||||
syn match elixirModuleDefine '\<defmodule\>\(:\)\@!' nextgroup=elixirModuleDeclaration skipwhite skipnl
|
||||
@@ -191,6 +192,7 @@ syn sync minlines=2000
|
||||
hi def link elixirBlockDefinition Define
|
||||
hi def link elixirDefine Define
|
||||
hi def link elixirPrivateDefine Define
|
||||
hi def link elixirNumericalDefine Define
|
||||
hi def link elixirGuard Define
|
||||
hi def link elixirPrivateGuard Define
|
||||
hi def link elixirModuleDefine Define
|
||||
|
||||
@@ -6,7 +6,7 @@ endif
|
||||
" Language: Erlang (http://www.erlang.org)
|
||||
" Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
|
||||
" Contributor: Adam Rutkowski <hq@mtod.org>
|
||||
" Last Update: 2020-May-26
|
||||
" Last Update: 2022-Sep-06
|
||||
" License: Vim license
|
||||
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
||||
|
||||
@@ -65,7 +65,8 @@ syn match erlangQuotedAtomModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' con
|
||||
syn match erlangModifier '\$\%([^\\]\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\)'
|
||||
|
||||
" Operators, separators
|
||||
syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|=>\|:=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/'
|
||||
syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|=>\|:=\|?=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/'
|
||||
syn match erlangEqualsBinary '=<<\%(<\)\@!'
|
||||
syn keyword erlangOperator div rem or xor bor bxor bsl bsr and band not bnot andalso orelse
|
||||
syn match erlangBracket '{\|}\|\[\|]\||\|||'
|
||||
syn match erlangPipe '|'
|
||||
@@ -80,7 +81,8 @@ syn match erlangGlobalFuncCall '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\
|
||||
syn match erlangGlobalFuncRef '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@=' contains=erlangComment,erlangVariable
|
||||
|
||||
" Variables, macros, records, maps
|
||||
syn match erlangVariable '\<[A-Z_][[:alnum:]_@]*'
|
||||
syn match erlangVariable '\<[A-Z][[:alnum:]_@]*'
|
||||
syn match erlangAnonymousVariable '\<_[[:alnum:]_@]*'
|
||||
syn match erlangMacro '??\=[[:alnum:]_@]\+'
|
||||
syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+'
|
||||
syn region erlangQuotedMacro start=/??\=\s*'/ end=/'/ contains=erlangQuotedAtomModifier
|
||||
@@ -96,7 +98,7 @@ syn match erlangBitType '\%(\/\%(\s\|\n\|%.*\n\)*\)\@<=\%(integer\|float\|binary
|
||||
|
||||
" Constants and Directives
|
||||
syn match erlangUnknownAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\l[[:alnum:]_@]*' contains=erlangComment
|
||||
syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\|optional_callbacks\)\>' contains=erlangComment
|
||||
syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\|optional_callbacks\|feature\)\>' contains=erlangComment
|
||||
syn match erlangInclude '^\s*-\%(\s\|\n\|%.*\n\)*\%(include\|include_lib\)\>' contains=erlangComment
|
||||
syn match erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment
|
||||
syn match erlangDefine '^\s*-\%(\s\|\n\|%.*\n\)*\%(define\|undef\)\>' contains=erlangComment
|
||||
@@ -104,8 +106,8 @@ syn match erlangPreCondit '^\s*-\%(\s\|\n\|%.*\n\)*\%(ifdef\|ifndef\|else\|endif
|
||||
syn match erlangType '^\s*-\%(\s\|\n\|%.*\n\)*\%(spec\|type\|opaque\|callback\)\>' contains=erlangComment
|
||||
|
||||
" Keywords
|
||||
syn keyword erlangKeyword after begin case catch cond end fun if let of
|
||||
syn keyword erlangKeyword receive when try
|
||||
syn keyword erlangKeyword after begin case catch cond end fun if let of else
|
||||
syn keyword erlangKeyword receive when try maybe
|
||||
|
||||
" Build-in-functions (BIFs)
|
||||
syn keyword erlangBIF abs alive apply atom_to_binary atom_to_list contained
|
||||
@@ -178,6 +180,7 @@ hi def link erlangModifier Special
|
||||
|
||||
" Operators, separators
|
||||
hi def link erlangOperator Operator
|
||||
hi def link erlangEqualsBinary ErrorMsg
|
||||
hi def link erlangRightArrow Operator
|
||||
if s:old_style
|
||||
hi def link erlangBracket Normal
|
||||
@@ -195,6 +198,7 @@ hi def link erlangLocalFuncRef Normal
|
||||
hi def link erlangGlobalFuncCall Function
|
||||
hi def link erlangGlobalFuncRef Function
|
||||
hi def link erlangVariable Normal
|
||||
hi def link erlangAnonymousVariable erlangVariable
|
||||
hi def link erlangMacro Normal
|
||||
hi def link erlangQuotedMacro Normal
|
||||
hi def link erlangRecord Normal
|
||||
@@ -207,6 +211,7 @@ hi def link erlangLocalFuncRef Normal
|
||||
hi def link erlangGlobalFuncCall Normal
|
||||
hi def link erlangGlobalFuncRef Normal
|
||||
hi def link erlangVariable Identifier
|
||||
hi def link erlangAnonymousVariable erlangVariable
|
||||
hi def link erlangMacro Macro
|
||||
hi def link erlangQuotedMacro Macro
|
||||
hi def link erlangRecord Structure
|
||||
|
||||
@@ -8,7 +8,7 @@ endif
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if &syntax !~# '\<eruby\>' || get(b:, 'current_syntax') =~# '\<eruby\>'
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -22,8 +22,6 @@ endif
|
||||
|
||||
if &filetype =~ '^eruby\.'
|
||||
let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+')
|
||||
elseif &filetype =~ '^.*\.eruby\>'
|
||||
let b:eruby_subtype = matchstr(&filetype,'^.\{-\}\ze\.eruby\>')
|
||||
elseif !exists("b:eruby_subtype") && main_syntax == 'eruby'
|
||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
|
||||
@@ -57,10 +55,10 @@ if !b:eruby_nest_level
|
||||
let b:eruby_nest_level = 1
|
||||
endif
|
||||
|
||||
if get(b:, 'eruby_subtype', '') !~# '^\%(eruby\)\=$' && &syntax =~# '^eruby\>'
|
||||
if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=? 'eruby'
|
||||
exe "runtime! syntax/".b:eruby_subtype.".vim"
|
||||
unlet! b:current_syntax
|
||||
endif
|
||||
unlet! b:current_syntax
|
||||
syn include @rubyTop syntax/ruby.vim
|
||||
|
||||
syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,erubyComment
|
||||
@@ -75,7 +73,7 @@ exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:erub
|
||||
hi def link erubyDelimiter PreProc
|
||||
hi def link erubyComment Comment
|
||||
|
||||
let b:current_syntax = matchstr(&syntax, '^.*\<eruby\>')
|
||||
let b:current_syntax = 'eruby'
|
||||
|
||||
if main_syntax == 'eruby'
|
||||
unlet main_syntax
|
||||
|
||||
@@ -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
|
||||
" Language: generic git output
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2019 Dec 05
|
||||
" Last Change: 2022 Jan 05
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -42,7 +42,7 @@ syn match gitReflog /^\x\{40,\} \x\{40,\} .\{-\}\d\+\s-\d\{4\}\t.*/ skipwhite c
|
||||
syn region gitDiff start=/^\%(diff --git \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff fold
|
||||
syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --\%(git\|cc\|combined\) \|$\)\@=/ contains=@gitDiff
|
||||
|
||||
syn region gitDiffMerge start=/^\%(diff --\%(cc\|combined\) \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
|
||||
syn region gitDiffMerge start=/^\%(diff --\%(cc\|combined\) \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff fold
|
||||
syn region gitDiffMerge start=/^\%(@@@@* -\)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
|
||||
syn match gitDiffAdded "^ \++.*" contained containedin=gitDiffMerge
|
||||
syn match gitDiffAdded "{+[^}]*+}" contained containedin=gitDiff
|
||||
|
||||
@@ -6,7 +6,7 @@ endif
|
||||
" Language: git commit file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: *.git/COMMIT_EDITMSG
|
||||
" Last Change: 2019 Dec 05
|
||||
" Last Change: 2022 Jan 05
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
|
||||
@@ -6,7 +6,7 @@ endif
|
||||
" Language: git rebase --interactive
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: git-rebase-todo
|
||||
" Last Change: 2019 Dec 06
|
||||
" Last Change: 2022 Jan 05
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
|
||||
101
syntax/go.vim
101
syntax/go.vim
@@ -169,14 +169,10 @@ endif
|
||||
syn match goSingleDecl /\%(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst
|
||||
|
||||
" Integers
|
||||
syn match goDecimalInt "\<-\=\(0\|[1-9]_\?\(\d\|\d\+_\?\d\+\)*\)\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goDecimalError "\<-\=\(_\(\d\+_*\)\+\|\([1-9]\d*_*\)\+__\(\d\+_*\)\+\|\([1-9]\d*_*\)\+_\+\)\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goHexadecimalInt "\<-\=0[xX]_\?\(\x\+_\?\)\+\>"
|
||||
syn match goHexadecimalError "\<-\=0[xX]_\?\(\x\+_\?\)*\(\([^ \t0-9A-Fa-f_)]\|__\)\S*\|_\)\>"
|
||||
syn match goOctalInt "\<-\=0[oO]\?_\?\(\o\+_\?\)\+\>"
|
||||
syn match goOctalError "\<-\=0[0-7oO_]*\(\([^ \t0-7oOxX_/)\]\}\:;]\|[oO]\{2,\}\|__\)\S*\|_\|[oOxX]\)\>"
|
||||
syn match goBinaryInt "\<-\=0[bB]_\?\([01]\+_\?\)\+\>"
|
||||
syn match goBinaryError "\<-\=0[bB]_\?[01_]*\([^ \t01_)]\S*\|__\S*\|_\)\>"
|
||||
syn match goDecimalInt "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)\>"
|
||||
syn match goHexadecimalInt "\<-\=0[xX]_\?\%(\x\|\x_\x\)\+\>"
|
||||
syn match goOctalInt "\<-\=0[oO]\?_\?\%(\o\|\o_\o\)\+\>"
|
||||
syn match goBinaryInt "\<-\=0[bB]_\?\%([01]\|[01]_[01]\)\+\>"
|
||||
|
||||
hi def link goDecimalInt Integer
|
||||
hi def link goDecimalError Error
|
||||
@@ -189,19 +185,55 @@ hi def link goBinaryError Error
|
||||
hi def link Integer Number
|
||||
|
||||
" Floating point
|
||||
syn match goFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=\>"
|
||||
"float_lit = decimal_float_lit | hex_float_lit .
|
||||
"
|
||||
"decimal_float_lit = decimal_digits "." [ decimal_digits ] [ decimal_exponent ] |
|
||||
" decimal_digits decimal_exponent |
|
||||
" "." decimal_digits [ decimal_exponent ] .
|
||||
"decimal_exponent = ( "e" | "E" ) [ "+" | "-" ] decimal_digits .
|
||||
"
|
||||
"hex_float_lit = "0" ( "x" | "X" ) hex_mantissa hex_exponent .
|
||||
"hex_mantissa = [ "_" ] hex_digits "." [ hex_digits ] |
|
||||
" [ "_" ] hex_digits |
|
||||
" "." hex_digits .
|
||||
"hex_exponent = ( "p" | "P" ) [ "+" | "-" ] decimal_digits .
|
||||
" decimal floats with a decimal point
|
||||
syn match goFloat "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)\.\%(\%(\%(\d\|\d_\d\)\+\)\=\%([Ee][-+]\=\%(\d\|\d_\d\)\+\)\=\>\)\="
|
||||
syn match goFloat "\s\zs-\=\.\%(\d\|\d_\d\)\+\%(\%([Ee][-+]\=\%(\d\|\d_\d\)\+\)\>\)\="
|
||||
" decimal floats without a decimal point
|
||||
syn match goFloat "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)[Ee][-+]\=\%(\d\|\d_\d\)\+\>"
|
||||
" hexadecimal floats with a decimal point
|
||||
syn match goHexadecimalFloat "\<-\=0[xX]\%(_\x\|\x\)\+\.\%(\%(\x\|\x_\x\)\+\)\=\%([Pp][-+]\=\%(\d\|\d_\d\)\+\)\=\>"
|
||||
syn match goHexadecimalFloat "\<-\=0[xX]\.\%(\x\|\x_\x\)\+\%([Pp][-+]\=\%(\d\|\d_\d\)\+\)\=\>"
|
||||
" hexadecimal floats without a decimal point
|
||||
syn match goHexadecimalFloat "\<-\=0[xX]\%(_\x\|\x\)\+[Pp][-+]\=\%(\d\|\d_\d\)\+\>"
|
||||
|
||||
hi def link goFloat Float
|
||||
hi def link goHexadecimalFloat Float
|
||||
|
||||
" Imaginary literals
|
||||
syn match goImaginary "\<-\=\d\+i\>"
|
||||
syn match goImaginary "\<-\=\d\+[Ee][-+]\=\d\+i\>"
|
||||
syn match goImaginaryFloat "\<-\=\d\+\.\d*\%([Ee][-+]\=\d\+\)\=i\>"
|
||||
syn match goImaginaryFloat "\<-\=\.\d\+\%([Ee][-+]\=\d\+\)\=i\>"
|
||||
syn match goImaginaryDecimal "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)i\>"
|
||||
syn match goImaginaryHexadecimal "\<-\=0[xX]_\?\%(\x\|\x_\x\)\+i\>"
|
||||
syn match goImaginaryOctal "\<-\=0[oO]\?_\?\%(\o\|\o_\o\)\+i\>"
|
||||
syn match goImaginaryBinary "\<-\=0[bB]_\?\%([01]\|[01]_[01]\)\+i\>"
|
||||
|
||||
hi def link goImaginary Number
|
||||
hi def link goImaginaryFloat Float
|
||||
" imaginary decimal floats with a decimal point
|
||||
syn match goImaginaryFloat "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)\.\%(\%(\%(\d\|\d_\d\)\+\)\=\%([Ee][-+]\=\%(\d\|\d_\d\)\+\)\=\)\=i\>"
|
||||
syn match goImaginaryFloat "\s\zs-\=\.\%(\d\|\d_\d\)\+\%([Ee][-+]\=\%(\d\|\d_\d\)\+\)\=i\>"
|
||||
" imaginary decimal floats without a decimal point
|
||||
syn match goImaginaryFloat "\<-\=\%(0\|\%(\d\|\d_\d\)\+\)[Ee][-+]\=\%(\d\|\d_\d\)\+i\>"
|
||||
" imaginary hexadecimal floats with a decimal point
|
||||
syn match goImaginaryHexadecimalFloat "\<-\=0[xX]\%(_\x\|\x\)\+\.\%(\%(\x\|\x_\x\)\+\)\=\%([Pp][-+]\=\%(\d\|\d_\d\)\+\)\=i\>"
|
||||
syn match goImaginaryHexadecimalFloat "\<-\=0[xX]\.\%(\x\|\x_\x\)\+\%([Pp][-+]\=\%(\d\|\d_\d\)\+\)\=i\>"
|
||||
" imaginary hexadecimal floats without a decimal point
|
||||
syn match goImaginaryHexadecimalFloat "\<-\=0[xX]\%(_\x\|\x\)\+[Pp][-+]\=\%(\d\|\d_\d\)\+i\>"
|
||||
|
||||
hi def link goImaginaryDecimal Number
|
||||
hi def link goImaginaryHexadecimal Number
|
||||
hi def link goImaginaryOctal Number
|
||||
hi def link goImaginaryBinary Number
|
||||
hi def link goImaginaryFloat Float
|
||||
hi def link goImaginaryHexadecimalFloat Float
|
||||
|
||||
" Spaces after "[]"
|
||||
if go#config#HighlightArrayWhitespaceError()
|
||||
@@ -270,6 +302,8 @@ if go#config#HighlightOperators()
|
||||
syn match goOperator /\%(<<\|>>\|&^\)=\?/
|
||||
" match remaining two-char operators: := && || <- ++ --
|
||||
syn match goOperator /:=\|||\|<-\|++\|--/
|
||||
" match ~
|
||||
syn match goOperator /\~/
|
||||
" match ...
|
||||
|
||||
hi def link goPointerOperator goOperator
|
||||
@@ -277,14 +311,37 @@ if go#config#HighlightOperators()
|
||||
endif
|
||||
hi def link goOperator Operator
|
||||
|
||||
" -> type constraint opening bracket
|
||||
" |-> start non-counting group
|
||||
" || -> any word character
|
||||
" || | -> at least one, as many as possible
|
||||
" || | | -> start non-counting group
|
||||
" || | | | -> match ~
|
||||
" || | | | | -> at most once
|
||||
" || | | | | | -> allow a slice type
|
||||
" || | | | | | | -> any word character
|
||||
" || | | | | | | | -> start a non-counting group
|
||||
" || | | | | | | | | -> that matches word characters and |
|
||||
" || | | | | | | | | | -> close the non-counting group
|
||||
" || | | | | | | | | | | -> close the non-counting group
|
||||
" || | | | | | | | | | | |-> any number of matches
|
||||
" || | | | | | | | | | | || -> start a non-counting group
|
||||
" || | | | | | | | | | | || | -> a comma and whitespace
|
||||
" || | | | | | | | | | | || | | -> at most once
|
||||
" || | | | | | | | | | | || | | | -> close the non-counting group
|
||||
" || | | | | | | | | | | || | | | | -> at least one of those non-counting groups, as many as possible
|
||||
" || | | | | | -------- | | | | || | | | | | -> type constraint closing bracket
|
||||
" || | | | | || | | | | | || | | | | | |
|
||||
syn match goTypeParams /\[\%(\w\+\s\+\%(\~\?\%(\[]\)\?\w\%(\w\||\)\)*\%(,\s*\)\?\)\+\]/ nextgroup=goSimpleParams,goDeclType contained
|
||||
|
||||
" Functions;
|
||||
if go#config#HighlightFunctions() || go#config#HighlightFunctionParameters()
|
||||
syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction,goSimpleParams skipwhite skipnl
|
||||
syn match goReceiverDecl /(\s*\zs\%(\%(\w\+\s\+\)\?\*\?\w\+\)\ze\s*)/ contained contains=goReceiverVar,goReceiverType,goPointerOperator
|
||||
syn match goReceiverDecl /(\s*\zs\%(\%(\w\+\s\+\)\?\*\?\w\+\%(\[\%(\%(\[\]\)\?\w\+\%(,\s*\)\?\)\+\]\)\?\)\ze\s*)/ contained contains=goReceiverVar,goReceiverType,goPointerOperator
|
||||
syn match goReceiverVar /\w\+\ze\s\+\%(\w\|\*\)/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained
|
||||
syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
|
||||
syn match goFunction /\w\+/ nextgroup=goSimpleParams contained skipwhite skipnl
|
||||
syn match goReceiverType /\w\+\ze\s*)/ contained
|
||||
syn match goFunction /\w\+/ nextgroup=goSimpleParams,goTypeParams contained skipwhite skipnl
|
||||
syn match goReceiverType /\w\+\%(\[\%(\%(\[\]\)\?\w\+\%(,\s*\)\?\)\+\]\)\?\ze\s*)/ contained
|
||||
if go#config#HighlightFunctionParameters()
|
||||
syn match goSimpleParams /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType nextgroup=goFunctionReturn skipwhite skipnl
|
||||
syn match goFunctionReturn /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType skipwhite skipnl
|
||||
@@ -294,7 +351,7 @@ if go#config#HighlightFunctions() || go#config#HighlightFunctionParameters()
|
||||
hi def link goReceiverVar goParamName
|
||||
hi def link goParamName Identifier
|
||||
endif
|
||||
syn match goReceiver /(\s*\%(\w\+\s\+\)\?\*\?\s*\w\+\s*)\ze\s*\w/ contained nextgroup=goFunction contains=goReceiverDecl skipwhite skipnl
|
||||
syn match goReceiver /(\s*\%(\w\+\s\+\)\?\*\?\s*\w\+\%(\[\%(\%(\[\]\)\?\w\+\%(,\s*\)\?\)\+\]\)\?\s*)\ze\s*\w/ contained nextgroup=goFunction contains=goReceiverDecl skipwhite skipnl
|
||||
else
|
||||
syn keyword goDeclaration func
|
||||
endif
|
||||
@@ -302,7 +359,7 @@ hi def link goFunction Function
|
||||
|
||||
" Function calls;
|
||||
if go#config#HighlightFunctionCalls()
|
||||
syn match goFunctionCall /\w\+\ze(/ contains=goBuiltins,goDeclaration
|
||||
syn match goFunctionCall /\w\+\ze\%(\[\%(\%(\[]\)\?\w\+\(,\s*\)\?\)\+\]\)\?(/ contains=goBuiltins,goDeclaration
|
||||
endif
|
||||
hi def link goFunctionCall Type
|
||||
|
||||
@@ -329,7 +386,7 @@ hi def link goField Identifier
|
||||
if go#config#HighlightTypes()
|
||||
syn match goTypeConstructor /\<\w\+{\@=/
|
||||
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
|
||||
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
|
||||
syn match goTypeName /\w\+/ contained nextgroup=goDeclType,goTypeParams skipwhite skipnl
|
||||
syn match goDeclType /\<\%(interface\|struct\)\>/ skipwhite skipnl
|
||||
hi def link goReceiverType Type
|
||||
else
|
||||
|
||||
100
syntax/gowork.vim
Normal file
100
syntax/gowork.vim
Normal file
@@ -0,0 +1,100 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'go', 'syntax/gowork.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" gowork.vim: Vim syntax file for go.work file
|
||||
"
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syntax case match
|
||||
|
||||
" Reference documentation:
|
||||
" https://go.dev/ref/mod#workspaces
|
||||
|
||||
" match keywords
|
||||
syntax keyword goworkGo go contained
|
||||
syntax keyword goworkUse use
|
||||
syntax keyword goworkExclude exclude
|
||||
syntax keyword goworkReplace replace
|
||||
syntax keyword goworkRetract retract
|
||||
|
||||
" require, exclude, replace, and go can be also grouped into block
|
||||
syntax region goworkUse start='require (' end=')' transparent contains=goworkUse,goworkPath
|
||||
syntax region goworkReplace start='replace (' end=')' transparent contains=goworkReplace,goworkVersion
|
||||
syntax match goworkGo '^go .*$' transparent contains=goworkGo,goworkGoVersion
|
||||
|
||||
" set highlights
|
||||
highlight default link goworkGo Keyword
|
||||
highlight default link goworkUse Keyword
|
||||
highlight default link goworkReplace Keyword
|
||||
|
||||
" comments are always in form of // ...
|
||||
syntax region goworkComment start="//" end="$" contains=@Spell
|
||||
highlight default link goworkComment Comment
|
||||
|
||||
" make sure quoted import paths are higlighted
|
||||
syntax region goworkString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
highlight default link goworkString String
|
||||
|
||||
" replace operator is in the form of '=>'
|
||||
syntax match goworkReplaceOperator "\v\=\>"
|
||||
highlight default link goworkReplaceOperator Operator
|
||||
|
||||
" match go versions
|
||||
syntax match goworkGoVersion "1\.\d\+" contained
|
||||
highlight default link goworkGoVersion Identifier
|
||||
|
||||
|
||||
" match paths in use directives
|
||||
syntax match goworkPath "\f\+"
|
||||
|
||||
highlight default link goworkPath Identifier
|
||||
" highlight versions:
|
||||
" * vX.Y.Z-pre
|
||||
" * vX.Y.Z
|
||||
" * vX.0.0-yyyyymmddhhmmss-abcdefabcdef
|
||||
" * vX.Y.Z-pre.0.yyyymmddhhmmss-abcdefabcdef
|
||||
" * vX.Y.(Z+1)-0.yyyymmddhhss-abcdefabcdef
|
||||
" see https://godoc.org/golang.org/x/tools/internal/semver for more
|
||||
" information about how semantic versions are parsed and
|
||||
" https://golang.org/cmd/go/ for how pseudo-versions and +incompatible
|
||||
" are applied.
|
||||
|
||||
|
||||
" match vX.Y.Z and their prereleases
|
||||
syntax match goworkVersion "v\d\+\.\d\+\.\d\+\%(-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?"
|
||||
" ^--- version ---^^------------ pre-release ---------------------^^--------------- metadata ---------------------^
|
||||
" ^--------------------------------------- semantic version -------------------------------------------------------^
|
||||
|
||||
" match pseudo versions
|
||||
" without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef)
|
||||
syntax match goworkVersion "v\d\+\.0\.0-\d\{14\}-\x\+"
|
||||
" when most recent version before target is a pre-release
|
||||
syntax match goworkVersion "v\d\+\.\d\+\.\d\+-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?\.0\.\d\{14}-\x\+"
|
||||
" ^--- version ---^^--- ------ pre-release -----------------^^--------------- metadata ---------------------^
|
||||
" ^------------------------------------- semantic version --------------------------------------------------^
|
||||
" most recent version before the target is X.Y.Z
|
||||
syntax match goworkVersion "v\d\+\.\d\+\.\d\+\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?-0\.\d\{14}-\x\+"
|
||||
" ^--- version ---^^--------------- metadata ---------------------^
|
||||
|
||||
" match incompatible vX.Y.Z and their prereleases
|
||||
syntax match goworkVersion "v[2-9]\{1}\d*\.\d\+\.\d\+\%(-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?+incompatible"
|
||||
" ^------- version -------^^------------- pre-release ---------------------^^--------------- metadata ---------------------^
|
||||
" ^------------------------------------------- semantic version -----------------------------------------------------------^
|
||||
|
||||
" match incompatible pseudo versions
|
||||
" incompatible without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef)
|
||||
syntax match goworkVersion "v[2-9]\{1}\d*\.0\.0-\d\{14\}-\x\++incompatible"
|
||||
" when most recent version before target is a pre-release
|
||||
syntax match goworkVersion "v[2-9]\{1}\d*\.\d\+\.\d\+-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?\.0\.\d\{14}-\x\++incompatible"
|
||||
" ^------- version -------^^---------- pre-release -----------------^^--------------- metadata ---------------------^
|
||||
" ^---------------------------------------- semantic version ------------------------------------------------------^
|
||||
" most recent version before the target is X.Y.Z
|
||||
syntax match goworkVersion "v[2-9]\{1}\d*\.\d\+\.\d\+\%(+\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?-0\.\d\{14}-\x\++incompatible"
|
||||
" ^------- version -------^^---------------- metadata ---------------------^
|
||||
highlight default link goworkVersion Identifier
|
||||
|
||||
let b:current_syntax = "gowork"
|
||||
@@ -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
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: *.haml
|
||||
" Last Change: 2018 Aug 21
|
||||
" Last Change: 2019 Dec 05
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
|
||||
@@ -5,7 +5,7 @@ endif
|
||||
" Vim syntax file
|
||||
" Language: Vim help file
|
||||
" Maintainer: Bram Moolenaar (Bram@vim.org)
|
||||
" Last Change: 2021 Jun 13
|
||||
" Last Change: 2022 Sep 26
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -43,6 +43,7 @@ syn match helpVim "VIM REFERENCE.*"
|
||||
syn match helpVim "NVIM REFERENCE.*"
|
||||
syn match helpOption "'[a-z]\{2,\}'"
|
||||
syn match helpOption "'t_..'"
|
||||
syn match helpNormal "'ab'"
|
||||
syn match helpCommand "`[^` \t]\+`"hs=s+1,he=e-1 contains=helpBacktick
|
||||
syn match helpCommand "\(^\|[^a-z"[]\)\zs`[^`]\+`\ze\([^a-z\t."']\|$\)"hs=s+1,he=e-1 contains=helpBacktick
|
||||
syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore
|
||||
|
||||
@@ -28,16 +28,18 @@ syntax sync fromstart
|
||||
" syntax case ignore
|
||||
syntax case match
|
||||
|
||||
syntax match jsNoise /[:,;]/
|
||||
syntax match jsNoise /[:;]/
|
||||
syntax match jsNoise /,/ skipwhite skipempty nextgroup=@jsExpression
|
||||
syntax match jsDot /\./ skipwhite skipempty nextgroup=jsObjectProp,jsFuncCall,jsPrototype,jsTaggedTemplate
|
||||
syntax match jsObjectProp contained /\<\K\k*/
|
||||
syntax match jsFuncCall /\<\K\k*\ze\s*(/
|
||||
syntax match jsFuncCall /\<\K\k*\ze[\s\n]*(/
|
||||
syntax match jsParensError /[)}\]]/
|
||||
|
||||
" Program Keywords
|
||||
syntax keyword jsStorageClass const var let skipwhite skipempty nextgroup=jsDestructuringBlock,jsDestructuringArray,jsVariableDef
|
||||
syntax match jsVariableDef contained /\<\K\k*/ skipwhite skipempty nextgroup=jsFlowDefinition
|
||||
syntax keyword jsOperatorKeyword delete instanceof typeof void new in of skipwhite skipempty nextgroup=@jsExpression
|
||||
syntax keyword jsOperatorKeyword delete instanceof typeof void new in skipwhite skipempty nextgroup=@jsExpression
|
||||
syntax keyword jsOf of skipwhite skipempty nextgroup=@jsExpression
|
||||
syntax match jsOperator "[-!|&+<>=%/*~^]" skipwhite skipempty nextgroup=@jsExpression
|
||||
syntax match jsOperator /::/ skipwhite skipempty nextgroup=@jsExpression
|
||||
syntax keyword jsBooleanTrue true
|
||||
@@ -103,7 +105,8 @@ syntax keyword jsStatement contained break continue skipwhite skipempty next
|
||||
syntax keyword jsConditional if skipwhite skipempty nextgroup=jsParenIfElse
|
||||
syntax keyword jsConditional else skipwhite skipempty nextgroup=jsCommentIfElse,jsIfElseBlock
|
||||
syntax keyword jsConditional switch skipwhite skipempty nextgroup=jsParenSwitch
|
||||
syntax keyword jsRepeat while for skipwhite skipempty nextgroup=jsParenRepeat,jsForAwait
|
||||
syntax keyword jsWhile while skipwhite skipempty nextgroup=jsParenWhile
|
||||
syntax keyword jsFor for skipwhite skipempty nextgroup=jsParenFor,jsForAwait
|
||||
syntax keyword jsDo do skipwhite skipempty nextgroup=jsRepeatBlock
|
||||
syntax region jsSwitchCase contained matchgroup=jsLabel start=/\<\%(case\|default\)\>/ end=/:\@=/ contains=@jsExpression,jsLabel skipwhite skipempty nextgroup=jsSwitchColon keepend
|
||||
syntax keyword jsTry try skipwhite skipempty nextgroup=jsTryCatchBlock
|
||||
@@ -139,19 +142,20 @@ syntax keyword jsHtmlEvents onblur onclick oncontextmenu ondblclick onfocus
|
||||
" Code blocks
|
||||
syntax region jsBracket matchgroup=jsBrackets start=/\[/ end=/\]/ contains=@jsExpression,jsSpreadExpression extend fold
|
||||
syntax region jsParen matchgroup=jsParens start=/(/ end=/)/ contains=@jsExpression extend fold nextgroup=jsFlowDefinition
|
||||
syntax region jsParenDecorator contained matchgroup=jsParensDecorator start=/(/ end=/)/ contains=@jsAll extend fold
|
||||
syntax region jsParenIfElse contained matchgroup=jsParensIfElse start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentIfElse,jsIfElseBlock,jsReturn extend fold
|
||||
syntax region jsParenRepeat contained matchgroup=jsParensRepeat start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsCommentRepeat,jsRepeatBlock,jsReturn extend fold
|
||||
syntax region jsParenSwitch contained matchgroup=jsParensSwitch start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold
|
||||
syntax region jsParenDecorator contained matchgroup=jsParensDecorator start=/(/ end=/)/ contains=@jsExpression extend fold
|
||||
syntax region jsParenIfElse contained matchgroup=jsParensIfElse start=/(/ end=/)/ contains=@jsExpression skipwhite skipempty nextgroup=jsCommentIfElse,jsIfElseBlock,jsReturn extend fold
|
||||
syntax region jsParenWhile contained matchgroup=jsParensWhile start=/(/ end=/)/ contains=@jsExpression skipwhite skipempty nextgroup=jsCommentRepeat,jsRepeatBlock,jsReturn extend fold
|
||||
syntax region jsParenFor contained matchgroup=jsParensFor start=/(/ end=/)/ contains=@jsExpression,jsStorageClass,jsOf skipwhite skipempty nextgroup=jsCommentRepeat,jsRepeatBlock,jsReturn extend fold
|
||||
syntax region jsParenSwitch contained matchgroup=jsParensSwitch start=/(/ end=/)/ contains=@jsExpression skipwhite skipempty nextgroup=jsSwitchBlock extend fold
|
||||
syntax region jsParenCatch contained matchgroup=jsParensCatch start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock extend fold
|
||||
syntax region jsFuncArgs contained matchgroup=jsFuncParens start=/(/ end=/)/ contains=jsFuncArgCommas,jsComment,jsFuncArgExpression,jsDestructuringBlock,jsDestructuringArray,jsRestExpression,jsFlowArgumentDef skipwhite skipempty nextgroup=jsCommentFunction,jsFuncBlock,jsFlowReturn extend fold
|
||||
syntax region jsClassBlock contained matchgroup=jsClassBraces start=/{/ end=/}/ contains=jsClassFuncName,jsClassMethodType,jsArrowFunction,jsArrowFuncArgs,jsComment,jsGenerator,jsDecorator,jsClassProperty,jsClassPropertyComputed,jsClassStringKey,jsAsyncKeyword,jsNoise extend fold
|
||||
syntax region jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold
|
||||
syntax region jsIfElseBlock contained matchgroup=jsIfElseBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold
|
||||
syntax region jsTryCatchBlock contained matchgroup=jsTryCatchBraces start=/{/ end=/}/ contains=@jsAll,jsBlock skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold
|
||||
syntax region jsFinallyBlock contained matchgroup=jsFinallyBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold
|
||||
syntax region jsSwitchBlock contained matchgroup=jsSwitchBraces start=/{/ end=/}/ contains=@jsAll,jsBlock,jsSwitchCase extend fold
|
||||
syntax region jsRepeatBlock contained matchgroup=jsRepeatBraces start=/{/ end=/}/ contains=@jsAll,jsBlock extend fold
|
||||
syntax region jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll extend fold
|
||||
syntax region jsIfElseBlock contained matchgroup=jsIfElseBraces start=/{/ end=/}/ contains=@jsAll extend fold
|
||||
syntax region jsTryCatchBlock contained matchgroup=jsTryCatchBraces start=/{/ end=/}/ contains=@jsAll skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold
|
||||
syntax region jsFinallyBlock contained matchgroup=jsFinallyBraces start=/{/ end=/}/ contains=@jsAll extend fold
|
||||
syntax region jsSwitchBlock contained matchgroup=jsSwitchBraces start=/{/ end=/}/ contains=@jsAll,jsSwitchCase extend fold
|
||||
syntax region jsRepeatBlock contained matchgroup=jsRepeatBraces start=/{/ end=/}/ contains=@jsAll extend fold
|
||||
syntax region jsDestructuringBlock contained matchgroup=jsDestructuringBraces start=/{/ end=/}/ contains=jsDestructuringProperty,jsDestructuringAssignment,jsDestructuringNoise,jsDestructuringPropertyComputed,jsSpreadExpression,jsComment nextgroup=jsFlowDefinition extend fold
|
||||
syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsDestructuringNoise,jsDestructuringProperty,jsSpreadExpression,jsDestructuringBlock,jsDestructuringArray,jsComment nextgroup=jsFlowDefinition extend fold
|
||||
syntax region jsObject contained matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectShorthandProp,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression,jsDecorator,jsAsyncKeyword,jsTemplateString extend fold
|
||||
@@ -169,7 +173,7 @@ syntax match jsFuncName contained /\<\K\k*/ skipwhite skipempty ne
|
||||
syntax region jsFuncArgExpression contained matchgroup=jsFuncArgOperator start=/=/ end=/[,)]\@=/ contains=@jsExpression extend
|
||||
syntax match jsFuncArgCommas contained ','
|
||||
syntax keyword jsArguments contained arguments
|
||||
syntax keyword jsForAwait contained await skipwhite skipempty nextgroup=jsParenRepeat
|
||||
syntax keyword jsForAwait contained await skipwhite skipempty nextgroup=jsParenFor
|
||||
|
||||
" Matches a single keyword argument with no parens
|
||||
syntax match jsArrowFuncArgs /\<\K\k*\ze\s*=>/ skipwhite contains=jsFuncArgs skipwhite skipempty nextgroup=jsArrowFunction extend
|
||||
@@ -237,7 +241,7 @@ if exists("javascript_plugin_flow")
|
||||
endif
|
||||
|
||||
syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsOperatorKeyword,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper,jsDo,jsForAwait,jsAsyncKeyword,jsStatement,jsDot
|
||||
syntax cluster jsAll contains=@jsExpression,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsException,jsTry,jsNoise,jsBlockLabel
|
||||
syntax cluster jsAll contains=@jsExpression,jsStorageClass,jsConditional,jsWhile,jsFor,jsReturn,jsException,jsTry,jsNoise,jsBlockLabel,jsBlock
|
||||
|
||||
" Define the default highlighting.
|
||||
" For version 5.7 and earlier: only when not done already
|
||||
@@ -252,6 +256,8 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
||||
HiLink jsComment Comment
|
||||
HiLink jsEnvComment PreProc
|
||||
HiLink jsParensIfElse jsParens
|
||||
HiLink jsParensWhile jsParensRepeat
|
||||
HiLink jsParensFor jsParensRepeat
|
||||
HiLink jsParensRepeat jsParens
|
||||
HiLink jsParensSwitch jsParens
|
||||
HiLink jsParensCatch jsParens
|
||||
@@ -277,6 +283,8 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
||||
HiLink jsBranch Conditional
|
||||
HiLink jsLabel Label
|
||||
HiLink jsReturn Statement
|
||||
HiLink jsWhile jsRepeat
|
||||
HiLink jsFor jsRepeat
|
||||
HiLink jsRepeat Repeat
|
||||
HiLink jsDo Repeat
|
||||
HiLink jsStatement Statement
|
||||
|
||||
@@ -62,12 +62,6 @@ let s:op_chars = '\U25\U26\U2A\U2B\U2D\U2F\U3C-\U3E\U5C\U5E\U7C\U7E\UAC\UB1\UD7\
|
||||
" The list contains the following characters: '…⁝⅋←↑→↓↔↚↛↜↝↞↠↢↣↤↦↩↪↫↬↮↶↷↺↻↼↽⇀⇁⇄⇆⇇⇉⇋⇌⇍⇎⇏⇐⇒⇔⇚⇛⇜⇝⇠⇢⇴⇵⇶⇷⇸⇹⇺⇻⇼⇽⇾⇿∈∉∊∋∌∍∓∔∗∘∙√∛∜∝∤∥∦∧∨∩∪∷∸∺∻∽∾≀≁≂≃≄≅≆≇≈≉≊≋≌≍≎≏≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≠≡≢≣≤≥≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊂⊃⊄⊅⊆⊇⊈⊉⊊⊋⊍⊎⊏⊐⊑⊒⊓⊔⊕⊖⊗⊘⊙⊚⊛⊜⊞⊟⊠⊡⊢⊣⊩⊬⊮⊰⊱⊲⊳⊴⊵⊶⊷⊻⊼⊽⋄⋅⋆⋇⋉⋊⋋⋌⋍⋎⋏⋐⋑⋒⋓⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋮⋯⋰⋱⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⌿▷⟂⟈⟉⟑⟒⟕⟖⟗⟰⟱⟵⟶⟷⟹⟺⟻⟼⟽⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤈⤉⤊⤋⤌⤍⤎⤏⤐⤑⤒⤓⤔⤕⤖⤗⤘⤝⤞⤟⤠⥄⥅⥆⥇⥈⥉⥊⥋⥌⥍⥎⥏⥐⥑⥒⥓⥔⥕⥖⥗⥘⥙⥚⥛⥜⥝⥞⥟⥠⥡⥢⥣⥤⥥⥦⥧⥨⥩⥪⥫⥬⥭⥮⥯⥰⦷⦸⦼⦾⦿⧀⧁⧡⧣⧤⧥⧴⧶⧷⧺⧻⨇⨈⨝⨟⨢⨣⨤⨥⨦⨧⨨⨩⨪⨫⨬⨭⨮⨰⨱⨲⨳⨴⨵⨶⨷⨸⨹⨺⨻⨼⨽⩀⩁⩂⩃⩄⩅⩊⩋⩌⩍⩎⩏⩐⩑⩒⩓⩔⩕⩖⩗⩘⩚⩛⩜⩝⩞⩟⩠⩡⩢⩣⩦⩧⩪⩫⩬⩭⩮⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫛⫷⫸⫹⫺⬰⬱⬲⬳⬴⬵⬶⬷⬸⬹⬺⬻⬼⬽⬾⬿⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌←↑→↓'
|
||||
let s:op_chars_wc = '\U2026\U205D\U214B\U2190-\U2194\U219A-\U219E\U21A0\U21A2-\U21A4\U21A6\U21A9-\U21AC\U21AE\U21B6\U21B7\U21BA-\U21BD\U21C0\U21C1\U21C4\U21C6\U21C7\U21C9\U21CB-\U21D0\U21D2\U21D4\U21DA-\U21DD\U21E0\U21E2\U21F4-\U21FF\U2208-\U220D\U2213\U2214\U2217-\U221D\U2224-\U222A\U2237\U2238\U223A\U223B\U223D\U223E\U2240-\U228B\U228D-\U229C\U229E-\U22A3\U22A9\U22AC\U22AE\U22B0-\U22B7\U22BB-\U22BD\U22C4-\U22C7\U22C9-\U22D3\U22D5-\U22FF\U233F\U25B7\U27C2\U27C8\U27C9\U27D1\U27D2\U27D5-\U27D7\U27F0\U27F1\U27F5-\U27F7\U27F9-\U27FF\U2900-\U2918\U291D-\U2920\U2944-\U2970\U29B7\U29B8\U29BC\U29BE-\U29C1\U29E1\U29E3-\U29E5\U29F4\U29F6\U29F7\U29FA\U29FB\U2A07\U2A08\U2A1D\U2A1F\U2A22-\U2A2E\U2A30-\U2A3D\U2A40-\U2A45\U2A4A-\U2A58\U2A5A-\U2A63\U2A66\U2A67\U2A6A-\U2AD9\U2ADB\U2AF7-\U2AFA\U2B30-\U2B44\U2B47-\U2B4C\UFFE9-\UFFEC'
|
||||
|
||||
" Full operators regex
|
||||
let s:operators = '\%(' . '\.\%([-+*/^÷%|&⊻]\|//\|\\\|>>\|>>>\?\)\?='
|
||||
\ . '\|' . '[:<>]=\|||\|&&\||>\|<|\|[<>:]:\|<<\|>>>\?\|//\|[-=]>\|\.\.\.\?'
|
||||
\ . '\|' . '\.\?[!' . s:op_chars . s:op_chars_wc . ']'
|
||||
\ . '\)'
|
||||
|
||||
|
||||
" Characters that can be used to start an identifier. Above \UBF we don't
|
||||
" bother checking. (If a UTF8 operator is used, it will take precedence anyway.)
|
||||
@@ -80,6 +74,12 @@ let s:id_charsW = '\%([0-9A-Za-z_!\UA2-\UA6\UA9\UAA\UAE-\UB0\UB2-\UB5\UB8-\UBA\U
|
||||
" A valid julia identifier, more or less
|
||||
let s:idregex = '\%(' . s:id_charsH . s:id_charsW . '*\)'
|
||||
|
||||
" Full operators regex
|
||||
let s:operators = '\%(' . '\.\%([-+*/^÷%|&⊻]\|//\|\\\|>>\|>>>\?\)\?='
|
||||
\ . '\|' . '[!:<>]=\|||\|&&\||>\|<|\|[<>:]:\|<<\|>>>\?\|//\|[-=]>\|\.\.\.\?'
|
||||
\ . '\|' . '\.!' . '\|'.s:id_charsW.'\@'.s:d(1).'<!!'
|
||||
\ . '\|' . '\.\?[' . s:op_chars . s:op_chars_wc . ']'
|
||||
\ . '\)'
|
||||
|
||||
|
||||
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 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 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 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,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 juliaSymbolItems contains=juliaPossibleSymbol
|
||||
@@ -183,8 +183,9 @@ syntax region juliaLetBlock matchgroup=juliaBlKeyword start="\<let\>" end="\<e
|
||||
syntax region juliaDoBlock matchgroup=juliaBlKeyword start="\<do\>" end="\<end\>" contains=@juliaExpressions fold
|
||||
syntax region juliaModuleBlock matchgroup=juliaBlKeyword start="\<\%(bare\)\?module\>" end="\<end\>" contains=@juliaExpressions fold
|
||||
syntax region juliaExceptionBlock matchgroup=juliaException start="\<try\>" end="\<end\>" contains=@juliaExpressions,juliaCatchBlock,juliaFinallyBlock fold
|
||||
syntax region juliaCatchBlock matchgroup=juliaException transparent contained start="\<catch\>" end="\<end\>"me=s-1 contains=@juliaExpressions,juliaFinallyBlock
|
||||
syntax region juliaFinallyBlock matchgroup=juliaException transparent contained start="\<finally\>" end="\<end\>"me=s-1 contains=@juliaExpressions
|
||||
syntax region juliaCatchBlock matchgroup=juliaException transparent contained start="\<catch\>" end="\<end\>"me=s-1 contains=@juliaExpressions,juliaTryElseBlock,juliaFinallyBlock
|
||||
syntax region juliaTryElseBlock matchgroup=juliaException transparent contained start="\<else\>" end="\<end\>"me=s-1 contains=@juliaExpressions,juliaFinallyBlock
|
||||
syntax region juliaFinallyBlock matchgroup=juliaException transparent contained start="\<finally\>" end="\<end\>"me=s-1 contains=@juliaExpressions,juliaCatchBlock
|
||||
syntax region juliaAbstractBlock matchgroup=juliaBlKeyword start="\<abstract\s\+type\>" end="\<end\>" fold contains=@juliaExpressions,juliaStructR
|
||||
syntax region juliaPrimitiveBlock matchgroup=juliaBlKeyword start="\<primitive\s\+type\>" end="\<end\>" fold contains=@juliaExpressions,juliaStructR
|
||||
|
||||
|
||||
@@ -60,10 +60,11 @@ syn keyword ktConstant null
|
||||
|
||||
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<(const)>\ze\@=.*<val>"
|
||||
syn match ktModifier "\v<(lateinit)>\ze\@=.*<var>"
|
||||
syn match ktModifier "\v<const>\ze\@=.*<val>"
|
||||
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 ktOperator "\v\?:|::|\<\=? | \>\=?|[!=]\=\=?|<as>\??|[-*+/%]\=?|[!&|]"
|
||||
|
||||
@@ -19,8 +19,8 @@ syn case match
|
||||
" Types also include struct, array, vector, etc. but these don't
|
||||
" benefit as much from having dedicated highlighting rules.
|
||||
syn keyword llvmType void half bfloat float double x86_fp80 fp128 ppc_fp128
|
||||
syn keyword llvmType label metadata x86_mmx
|
||||
syn keyword llvmType type label opaque token
|
||||
syn keyword llvmType label metadata x86_mmx x86_amx
|
||||
syn keyword llvmType type label opaque token ptr
|
||||
syn match llvmType /\<i\d\+\>/
|
||||
|
||||
" Instructions.
|
||||
@@ -29,16 +29,16 @@ syn match llvmType /\<i\d\+\>/
|
||||
syn keyword llvmStatement add addrspacecast alloca and arcp ashr atomicrmw
|
||||
syn keyword llvmStatement bitcast br catchpad catchswitch catchret call callbr
|
||||
syn keyword llvmStatement cleanuppad cleanupret cmpxchg eq exact extractelement
|
||||
syn keyword llvmStatement extractvalue fadd fast fcmp fdiv fence fmul fpext
|
||||
syn keyword llvmStatement fptosi fptoui fptrunc free frem fsub fneg getelementptr
|
||||
syn keyword llvmStatement icmp inbounds indirectbr insertelement insertvalue
|
||||
syn keyword llvmStatement inttoptr invoke landingpad load lshr malloc max min
|
||||
syn keyword llvmStatement mul nand ne ninf nnan nsw nsz nuw oeq oge ogt ole
|
||||
syn keyword llvmStatement olt one or ord phi ptrtoint resume ret sdiv select
|
||||
syn keyword llvmStatement sext sge sgt shl shufflevector sitofp sle slt srem
|
||||
syn keyword llvmStatement store sub switch trunc udiv ueq uge ugt uitofp ule ult
|
||||
syn keyword llvmStatement umax umin une uno unreachable unwind urem va_arg
|
||||
syn keyword llvmStatement xchg xor zext
|
||||
syn keyword llvmStatement extractvalue fadd fast fcmp fdiv fence fmul fneg fpext
|
||||
syn keyword llvmStatement fptosi fptoui fptrunc free freeze frem fsub
|
||||
syn keyword llvmStatement getelementptr icmp inbounds indirectbr insertelement
|
||||
syn keyword llvmStatement insertvalue inttoptr invoke landingpad load lshr
|
||||
syn keyword llvmStatement malloc max min mul nand ne ninf nnan nsw nsz nuw oeq
|
||||
syn keyword llvmStatement oge ogt ole olt one or ord phi ptrtoint resume ret
|
||||
syn keyword llvmStatement sdiv select sext sge sgt shl shufflevector sitofp
|
||||
syn keyword llvmStatement sle slt srem store sub switch trunc udiv ueq uge ugt
|
||||
syn keyword llvmStatement uitofp ule ult umax umin une uno unreachable unwind
|
||||
syn keyword llvmStatement urem va_arg xchg xor zext
|
||||
|
||||
" Keywords.
|
||||
syn keyword llvmKeyword
|
||||
@@ -48,11 +48,12 @@ syn keyword llvmKeyword
|
||||
\ alias
|
||||
\ align
|
||||
\ alignstack
|
||||
\ allocsize
|
||||
\ alwaysinline
|
||||
\ appending
|
||||
\ argmemonly
|
||||
\ arm_aapcscc
|
||||
\ arm_aapcs_vfpcc
|
||||
\ arm_aapcscc
|
||||
\ arm_apcscc
|
||||
\ asm
|
||||
\ atomic
|
||||
@@ -62,51 +63,58 @@ syn keyword llvmKeyword
|
||||
\ byref
|
||||
\ byval
|
||||
\ c
|
||||
\ catch
|
||||
\ caller
|
||||
\ catch
|
||||
\ cc
|
||||
\ ccc
|
||||
\ cleanup
|
||||
\ cold
|
||||
\ coldcc
|
||||
\ comdat
|
||||
\ common
|
||||
\ constant
|
||||
\ convergent
|
||||
\ datalayout
|
||||
\ declare
|
||||
\ default
|
||||
\ define
|
||||
\ deplibs
|
||||
\ dereferenceable
|
||||
\ dereferenceable_or_null
|
||||
\ distinct
|
||||
\ dllexport
|
||||
\ dllimport
|
||||
\ dso_local
|
||||
\ dso_preemptable
|
||||
\ except
|
||||
\ extern_weak
|
||||
\ external
|
||||
\ externally_initialized
|
||||
\ extern_weak
|
||||
\ fastcc
|
||||
\ tailcc
|
||||
\ filter
|
||||
\ from
|
||||
\ gc
|
||||
\ global
|
||||
\ hhvmcc
|
||||
\ hhvm_ccc
|
||||
\ hhvmcc
|
||||
\ hidden
|
||||
\ hot
|
||||
\ immarg
|
||||
\ inaccessiblemem_or_argmemonly
|
||||
\ inaccessiblememonly
|
||||
\ inalloca
|
||||
\ initialexec
|
||||
\ inlinehint
|
||||
\ inreg
|
||||
\ inteldialect
|
||||
\ intel_ocl_bicc
|
||||
\ inteldialect
|
||||
\ internal
|
||||
\ jumptable
|
||||
\ linkonce
|
||||
\ linkonce_odr
|
||||
\ local_unnamed_addr
|
||||
\ localdynamic
|
||||
\ localexec
|
||||
\ local_unnamed_addr
|
||||
\ minsize
|
||||
\ module
|
||||
\ monotonic
|
||||
@@ -117,19 +125,32 @@ syn keyword llvmKeyword
|
||||
\ nest
|
||||
\ noalias
|
||||
\ nobuiltin
|
||||
\ nocallback
|
||||
\ nocapture
|
||||
\ nocf_check
|
||||
\ no_cfi
|
||||
\ noduplicate
|
||||
\ nofree
|
||||
\ noimplicitfloat
|
||||
\ noinline
|
||||
\ nomerge
|
||||
\ nonlazybind
|
||||
\ nonnull
|
||||
\ noprofile
|
||||
\ norecurse
|
||||
\ noredzone
|
||||
\ noreturn
|
||||
\ nosync
|
||||
\ noundef
|
||||
\ nounwind
|
||||
\ nosanitize_bounds
|
||||
\ nosanitize_coverage
|
||||
\ null_pointer_is_valid
|
||||
\ optforfuzzing
|
||||
\ optnone
|
||||
\ optsize
|
||||
\ personality
|
||||
\ preallocated
|
||||
\ private
|
||||
\ protected
|
||||
\ ptx_device
|
||||
@@ -139,16 +160,20 @@ syn keyword llvmKeyword
|
||||
\ release
|
||||
\ returned
|
||||
\ returns_twice
|
||||
\ safestack
|
||||
\ sanitize_address
|
||||
\ sanitize_hwaddress
|
||||
\ sanitize_memory
|
||||
\ sanitize_memtag
|
||||
\ sanitize_thread
|
||||
\ section
|
||||
\ seq_cst
|
||||
\ shadowcallstack
|
||||
\ sideeffect
|
||||
\ signext
|
||||
\ syncscope
|
||||
\ source_filename
|
||||
\ speculatable
|
||||
\ speculative_load_hardening
|
||||
\ spir_func
|
||||
\ spir_kernel
|
||||
\ sret
|
||||
@@ -157,8 +182,12 @@ syn keyword llvmKeyword
|
||||
\ sspstrong
|
||||
\ strictfp
|
||||
\ swiftcc
|
||||
\ swifterror
|
||||
\ swifttailcc
|
||||
\ swiftself
|
||||
\ syncscope
|
||||
\ tail
|
||||
\ tailcc
|
||||
\ target
|
||||
\ thread_local
|
||||
\ to
|
||||
@@ -171,10 +200,11 @@ syn keyword llvmKeyword
|
||||
\ volatile
|
||||
\ weak
|
||||
\ weak_odr
|
||||
\ willreturn
|
||||
\ win64cc
|
||||
\ within
|
||||
\ writeonly
|
||||
\ x86_64_sysvcc
|
||||
\ win64cc
|
||||
\ x86_fastcallcc
|
||||
\ x86_stdcallcc
|
||||
\ x86_thiscallcc
|
||||
@@ -189,7 +219,7 @@ syn match llvmNumber /-\?\<\d\+\>/
|
||||
syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
|
||||
syn match llvmFloat /\<0x\x\+\>/
|
||||
syn keyword llvmBoolean true false
|
||||
syn keyword llvmConstant zeroinitializer undef null none
|
||||
syn keyword llvmConstant zeroinitializer undef null none poison vscale
|
||||
syn match llvmComment /;.*$/
|
||||
syn region llvmString start=/"/ skip=/\\"/ end=/"/
|
||||
syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/
|
||||
@@ -212,7 +242,8 @@ syn match llvmSpecialComment /;\s*REQUIRES:.*$/
|
||||
syn match llvmSpecialComment /;\s*RUN:.*$/
|
||||
syn match llvmSpecialComment /;\s*ALLOW_RETRIES:.*$/
|
||||
syn match llvmSpecialComment /;\s*CHECK:.*$/
|
||||
syn match llvmSpecialComment "\v;\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL):.*$"
|
||||
syn match llvmSpecialComment /;\s*CHECK-EMPTY:\s*$/
|
||||
syn match llvmSpecialComment /\v;\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL|COUNT-\d+):.*$/
|
||||
syn match llvmSpecialComment /;\s*XFAIL:.*$/
|
||||
|
||||
if version >= 508 || !exists("did_c_syn_inits")
|
||||
|
||||
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_languages
|
||||
\ add_project_arguments
|
||||
\ add_project_dependencies
|
||||
\ add_project_link_arguments
|
||||
\ add_test_setup
|
||||
\ alias_target
|
||||
@@ -120,6 +121,7 @@ syn keyword mesonBuiltin
|
||||
\ shared_library
|
||||
\ shared_module
|
||||
\ static_library
|
||||
\ structured_sources
|
||||
\ subdir
|
||||
\ subdir_done
|
||||
\ subproject
|
||||
@@ -130,6 +132,7 @@ syn keyword mesonBuiltin
|
||||
\ vcs_tag
|
||||
\ warning
|
||||
\ range
|
||||
\ debug
|
||||
|
||||
if exists("meson_space_error_highlight")
|
||||
" trailing whitespace
|
||||
|
||||
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.
|
||||
"
|
||||
syn keyword mlirType index f16 f32 f64
|
||||
syn keyword mlirType index f16 f32 f64 bf16
|
||||
" Signless integer types.
|
||||
syn match mlirType /\<i\d\+\>/
|
||||
" Unsigned integer types.
|
||||
@@ -27,7 +27,7 @@ syn match mlirType /\<ui\d\+\>/
|
||||
syn match mlirType /\<si\d\+\>/
|
||||
|
||||
" Elemental types inside memref, tensor, or vector types.
|
||||
syn match mlirType /x\s*\zs\(f16\|f32\|f64\|i\d\+\|ui\d\+\|si\d\+\)/
|
||||
syn match mlirType /x\s*\zs\(bf16|f16\|f32\|f64\|i\d\+\|ui\d\+\|si\d\+\)/
|
||||
|
||||
" Shaped types.
|
||||
syn match mlirType /\<memref\ze\s*<.*>/
|
||||
@@ -38,7 +38,6 @@ syn match mlirType /\<vector\ze\s*<.*>/
|
||||
syn match mlirType /x\s*\zsvector/
|
||||
|
||||
" Operations.
|
||||
" Standard dialect ops.
|
||||
" TODO: this list is not exhaustive.
|
||||
syn keyword mlirOps alloc alloca addf addi and call call_indirect cmpf cmpi
|
||||
syn keyword mlirOps constant dealloc divf dma_start dma_wait dim exp
|
||||
@@ -47,6 +46,9 @@ syn keyword mlirOps memref_shape_cast mulf muli negf powf prefetch rsqrt sitofp
|
||||
syn keyword mlirOps splat store select sqrt subf subi subview tanh
|
||||
syn keyword mlirOps view
|
||||
|
||||
" Math ops.
|
||||
syn match mlirOps /\<math\.erf\>/
|
||||
|
||||
" Affine ops.
|
||||
syn match mlirOps /\<affine\.apply\>/
|
||||
syn match mlirOps /\<affine\.dma_start\>/
|
||||
@@ -57,8 +59,10 @@ syn match mlirOps /\<affine\.load\>/
|
||||
syn match mlirOps /\<affine\.parallel\>/
|
||||
syn match mlirOps /\<affine\.prefetch\>/
|
||||
syn match mlirOps /\<affine\.store\>/
|
||||
syn match mlirOps /\<loop\.for\>/
|
||||
syn match mlirOps /\<loop\.if\>/
|
||||
syn match mlirOps /\<scf\.execute_region\>/
|
||||
syn match mlirOps /\<scf\.for\>/
|
||||
syn match mlirOps /\<scf\.if\>/
|
||||
syn match mlirOps /\<scf\.yield\>/
|
||||
|
||||
" TODO: dialect name prefixed ops (llvm or std).
|
||||
|
||||
@@ -84,12 +88,22 @@ syn match mlirNumber /x\s*\zs-\?\d\+\ze\s*x/
|
||||
syn match mlirFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
|
||||
syn match mlirFloat /\<0x\x\+\>/
|
||||
syn keyword mlirBoolean true false
|
||||
syn match mlirComment /\/\/.*$/
|
||||
" Spell checking is enabled only in comments by default.
|
||||
syn match mlirComment /\/\/.*$/ contains=@Spell
|
||||
syn region mlirString start=/"/ skip=/\\"/ end=/"/
|
||||
syn match mlirLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/
|
||||
" Prefixed identifiers usually used for ssa values and symbols.
|
||||
syn match mlirIdentifier /[%@][a-zA-Z$._-][a-zA-Z0-9$._-]*/
|
||||
syn match mlirIdentifier /[%@!]\d\+\>/
|
||||
syn match mlirMapSetOutline "#.*$"
|
||||
syn match mlirIdentifier /[%@]\d\+\>/
|
||||
" Prefixed identifiers usually used for blocks.
|
||||
syn match mlirBlockIdentifier /\^[a-zA-Z$._-][a-zA-Z0-9$._-]*/
|
||||
syn match mlirBlockIdentifier /\^\d\+\>/
|
||||
" Prefixed identifiers usually used for types.
|
||||
syn match mlirTypeIdentifier /![a-zA-Z$._-][a-zA-Z0-9$._-]*/
|
||||
syn match mlirTypeIdentifier /!\d\+\>/
|
||||
" Prefixed identifiers usually used for attribute aliases and result numbers.
|
||||
syn match mlirAttrIdentifier /#[a-zA-Z$._-][a-zA-Z0-9$._-]*/
|
||||
syn match mlirAttrIdentifier /#\d\+\>/
|
||||
|
||||
" Syntax-highlight lit test commands and bug numbers.
|
||||
syn match mlirSpecialComment /\/\/\s*RUN:.*$/
|
||||
@@ -111,7 +125,6 @@ if version >= 508 || !exists("did_c_syn_inits")
|
||||
|
||||
HiLink mlirType Type
|
||||
HiLink mlirOps Statement
|
||||
HiLink mlirMapSetOutline PreProc
|
||||
HiLink mlirNumber Number
|
||||
HiLink mlirComment Comment
|
||||
HiLink mlirString String
|
||||
@@ -122,6 +135,9 @@ if version >= 508 || !exists("did_c_syn_inits")
|
||||
HiLink mlirConstant Constant
|
||||
HiLink mlirSpecialComment SpecialComment
|
||||
HiLink mlirIdentifier Identifier
|
||||
HiLink mlirBlockIdentifier Label
|
||||
HiLink mlirTypeIdentifier Type
|
||||
HiLink mlirAttrIdentifier PreProc
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
@@ -43,6 +43,8 @@ syn match nixStringSpecial /''['$]/ contained
|
||||
syn match nixStringSpecial /\$\$/ contained
|
||||
syn match nixStringSpecial /''\\[nrt]/ contained
|
||||
|
||||
syn match nixSimpleStringSpecial /\$\$/ contained
|
||||
|
||||
syn match nixInvalidSimpleStringEscape /\\[^nrt"\\$]/ contained
|
||||
syn match nixInvalidStringEscape /''\\[^nrt]/ contained
|
||||
|
||||
@@ -63,7 +65,7 @@ syn match nixAttribute "[a-zA-Z_][a-zA-Z0-9_'-]*\ze\%([^a-zA-Z0-9_'.-]\|$\)" con
|
||||
syn region nixAttributeAssignment start="=" end="\ze;" contained contains=@nixExpr
|
||||
syn region nixAttributeDefinition start=/\ze[a-zA-Z_"$]/ end=";" contained contains=nixComment,nixAttribute,nixInterpolation,nixSimpleString,nixAttributeDot,nixAttributeAssignment
|
||||
|
||||
syn region nixInheritAttributeScope start="(" end=")" contained contains=nixComment,nixAttributeDot
|
||||
syn region nixInheritAttributeScope start="(" end="\ze)" contained contains=@nixExpr
|
||||
syn region nixAttributeDefinition matchgroup=nixInherit start="\<inherit\>" end=";" contained contains=nixComment,nixInheritAttributeScope,nixAttribute
|
||||
|
||||
syn region nixAttributeSet start="{" end="}" contains=nixComment,nixAttributeDefinition
|
||||
@@ -133,7 +135,7 @@ syn match nixInterpolationParam "[a-zA-Z_][a-zA-Z0-9_'-]*\%(\.[a-zA-Z_][a-zA-Z0-
|
||||
" Non-namespaced Nix builtins as of version 2.0:
|
||||
syn keyword nixSimpleBuiltin
|
||||
\ abort baseNameOf derivation derivationStrict dirOf fetchGit
|
||||
\ fetchMercurial fetchTarball import isNull map placeholder removeAttrs
|
||||
\ fetchMercurial fetchTarball import isNull map mapAttrs placeholder removeAttrs
|
||||
\ scopedImport throw toString
|
||||
|
||||
|
||||
@@ -146,13 +148,13 @@ syn keyword nixNamespacedBuiltin contained
|
||||
\ findFile foldl' fromJSON functionArgs genList \ genericClosure getAttr
|
||||
\ getEnv hasAttr hasContext hashString head import intersectAttrs isAttrs
|
||||
\ isBool isFloat isFunction isInt isList isNull isString langVersion
|
||||
\ length lessThan listToAttrs map match mul nixPath nixVersion
|
||||
\ length lessThan listToAttrs map mapAttrs match mul nixPath nixVersion
|
||||
\ parseDrvName partition path pathExists placeholder readDir readFile
|
||||
\ removeAttrs replaceStrings scopedImport seq sort split splitVersion
|
||||
\ storeDir storePath stringLength sub substring tail throw toFile toJSON
|
||||
\ toPath toString toXML trace tryEval typeOf unsafeDiscardOutputDependency
|
||||
\ unsafeDiscardStringContext unsafeGetAttrPos valueSize fromTOML bitAnd
|
||||
\ bitOr bitXor
|
||||
\ bitOr bitXor floor ceil
|
||||
|
||||
syn match nixBuiltin "builtins\.[a-zA-Z']\+"he=s+9 contains=nixComment,nixNamespacedBuiltin
|
||||
|
||||
|
||||
372
syntax/ocaml.vim
372
syntax/ocaml.vim
@@ -10,6 +10,7 @@ endif
|
||||
" Issac Trotts <ijtrotts@ucdavis.edu>
|
||||
" URL: https://github.com/ocaml/vim-ocaml
|
||||
" Last Change:
|
||||
" 2019 Nov 05 - Accurate type highlighting (Maëlan)
|
||||
" 2018 Nov 08 - Improved highlighting of operators (Maëlan)
|
||||
" 2018 Apr 22 - Improved support for PPX (Andrey Popp)
|
||||
" 2018 Mar 16 - Remove raise, lnot and not from keywords (Étienne Millon, "copy")
|
||||
@@ -42,25 +43,18 @@ syn case match
|
||||
" Access to the method of an object
|
||||
syn match ocamlMethod "#"
|
||||
|
||||
" Script headers highlighted like comments
|
||||
syn match ocamlComment "^#!.*" contains=@Spell
|
||||
|
||||
" Scripting directives
|
||||
syn match ocamlScript "^#\<\(quit\|labels\|warnings\|warn_error\|directory\|remove_directory\|cd\|load\|load_rec\|use\|mod_use\|install_printer\|remove_printer\|require\|list\|ppx\|principal\|predicates\|rectypes\|thread\|trace\|untrace\|untrace_all\|print_depth\|print_length\|camlp4o\|camlp4r\|topfind_log\|topfind_verbose\)\>"
|
||||
|
||||
" lowercase identifier - the standard way to match
|
||||
syn match ocamlLCIdentifier /\<\(\l\|_\)\(\w\|'\)*\>/
|
||||
|
||||
syn match ocamlKeyChar "|"
|
||||
|
||||
" Errors
|
||||
syn match ocamlBraceErr "}"
|
||||
syn match ocamlBrackErr "\]"
|
||||
syn match ocamlParenErr ")"
|
||||
syn match ocamlArrErr "|]"
|
||||
|
||||
syn match ocamlCommentErr "\*)"
|
||||
|
||||
syn match ocamlCountErr "\<downto\>"
|
||||
syn match ocamlCountErr "\<to\>"
|
||||
|
||||
@@ -79,19 +73,22 @@ else
|
||||
syn match ocamlEndErr "\<end\>"
|
||||
endif
|
||||
|
||||
" Some convenient clusters
|
||||
syn cluster ocamlAllErrs contains=ocamlBraceErr,ocamlBrackErr,ocamlParenErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr
|
||||
" These keywords are only expected nested in constructions that are handled by
|
||||
" the type linter, so outside of type contexts we highlight them as errors:
|
||||
syn match ocamlKwErr "\<\(mutable\|nonrec\|of\|private\)\>"
|
||||
|
||||
syn cluster ocamlAENoParen contains=ocamlBraceErr,ocamlBrackErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr
|
||||
" Some convenient clusters
|
||||
syn cluster ocamlAllErrs contains=@ocamlAENoParen,ocamlParenErr
|
||||
syn cluster ocamlAENoParen contains=ocamlBraceErr,ocamlBrackErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr,ocamlKwErr
|
||||
|
||||
syn cluster ocamlContained contains=ocamlTodo,ocamlPreDef,ocamlModParam,ocamlModParam1,ocamlMPRestr,ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3,ocamlModRHS,ocamlFuncWith,ocamlFuncStruct,ocamlModTypeRestr,ocamlModTRWith,ocamlWith,ocamlWithRest,ocamlModType,ocamlFullMod,ocamlVal
|
||||
|
||||
|
||||
" Enclosing delimiters
|
||||
syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="(" matchgroup=ocamlKeywordDelimiter end=")" contains=ALLBUT,@ocamlContained,ocamlParenErr
|
||||
syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="{" matchgroup=ocamlKeywordDelimiter end="}" contains=ALLBUT,@ocamlContained,ocamlBraceErr
|
||||
syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="\[" matchgroup=ocamlKeywordDelimiter end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr
|
||||
syn region ocamlEncl transparent matchgroup=ocamlKeywordDelimiter start="\[|" matchgroup=ocamlKeywordDelimiter end="|\]" contains=ALLBUT,@ocamlContained,ocamlArrErr
|
||||
syn region ocamlNone transparent matchgroup=ocamlEncl start="(" matchgroup=ocamlEncl end=")" contains=ALLBUT,@ocamlContained,ocamlParenErr
|
||||
syn region ocamlNone transparent matchgroup=ocamlEncl start="{" matchgroup=ocamlEncl end="}" contains=ALLBUT,@ocamlContained,ocamlBraceErr
|
||||
syn region ocamlNone transparent matchgroup=ocamlEncl start="\[" matchgroup=ocamlEncl end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr
|
||||
syn region ocamlNone transparent matchgroup=ocamlEncl start="\[|" matchgroup=ocamlEncl end="|\]" contains=ALLBUT,@ocamlContained,ocamlArrErr
|
||||
|
||||
|
||||
" Comments
|
||||
@@ -141,7 +138,7 @@ syn match ocamlKeyword "\<include\>" skipwhite skipempty nextgroup=ocamlModPa
|
||||
" "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 ocamlPreDef start="."me=e-1 matchgroup=ocamlKeyword end="\l\|=\|)"me=e-1 contained contains=@ocamlAllErrs,ocamlComment,ocamlModParam,ocamlGenMod,ocamlModTypeRestr,ocamlModTRWith nextgroup=ocamlModPreRHS
|
||||
syn region ocamlModParam start="([^*]" end=")" contained contains=ocamlGenMod,ocamlModParam1,ocamlSig,ocamlVal
|
||||
syn region ocamlModParam start="(\*\@!" end=")" contained contains=ocamlGenMod,ocamlModParam,ocamlModParam1,ocamlSig,ocamlVal
|
||||
syn match ocamlModParam1 "\<\u\(\w\|'\)*\>" contained skipwhite skipempty
|
||||
syn match ocamlGenMod "()" contained skipwhite skipempty
|
||||
|
||||
@@ -155,7 +152,7 @@ syn region ocamlVal matchgroup=ocamlKeyword start="\<val\>" matchgroup=ocamlLC
|
||||
syn region ocamlModRHS start="." end=". *\w\|([^*]"me=e-2 contained contains=ocamlComment skipwhite skipempty nextgroup=ocamlModParam,ocamlFullMod
|
||||
syn match ocamlFullMod "\<\u\(\w\|'\)*\( *\. *\u\(\w\|'\)*\)*" contained skipwhite skipempty nextgroup=ocamlFuncWith
|
||||
|
||||
syn region ocamlFuncWith start="([^*)]"me=e-1 end=")" contained contains=ocamlComment,ocamlWith,ocamlFuncStruct skipwhite skipempty nextgroup=ocamlFuncWith
|
||||
syn region ocamlFuncWith start="([*)]\@!" end=")" contained contains=ocamlComment,ocamlWith,ocamlFuncStruct skipwhite skipempty nextgroup=ocamlFuncWith
|
||||
syn region ocamlFuncStruct matchgroup=ocamlStructEncl start="[^a-zA-Z]struct\>"hs=s+1 matchgroup=ocamlStructEncl end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
|
||||
|
||||
syn match ocamlModTypeRestr "\<\w\(\w\|'\)*\( *\. *\w\(\w\|'\)*\)*\>" contained
|
||||
@@ -167,7 +164,7 @@ syn region ocamlWithRest start="[^)]" end=")"me=e-1 contained contains=ALLBUT,
|
||||
syn region ocamlStruct matchgroup=ocamlStructEncl start="\<\(module\s\+\)\=struct\>" matchgroup=ocamlStructEncl end="\<end\>" contains=ALLBUT,@ocamlContained,ocamlEndErr
|
||||
|
||||
" "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
|
||||
|
||||
" Quoted strings
|
||||
@@ -175,16 +172,26 @@ syn region ocamlString matchgroup=ocamlQuotedStringDelim start="{\z\([a-z_]*\)|"
|
||||
syn region ocamlString matchgroup=ocamlQuotedStringDelim start="{%[a-z_]\+\(\.[a-z_]\+\)\?\( \z\([a-z_]\+\)\)\?|" end="|\z1}" contains=@Spell
|
||||
|
||||
syn keyword ocamlKeyword and as assert class
|
||||
syn keyword ocamlKeyword constraint else
|
||||
syn keyword ocamlKeyword exception external fun
|
||||
|
||||
syn keyword ocamlKeyword else
|
||||
syn keyword ocamlKeyword external
|
||||
syn keyword ocamlKeyword in inherit initializer
|
||||
syn keyword ocamlKeyword lazy let match
|
||||
syn keyword ocamlKeyword method mutable new nonrec of
|
||||
syn keyword ocamlKeyword parser private rec
|
||||
syn keyword ocamlKeyword try type
|
||||
syn keyword ocamlKeyword method new
|
||||
syn keyword ocamlKeyword parser rec
|
||||
syn keyword ocamlKeyword try
|
||||
syn keyword ocamlKeyword virtual when while with
|
||||
|
||||
" Keywords which are handled by the type linter:
|
||||
" as (within a type equation)
|
||||
" constraint exception mutable nonrec of private type
|
||||
|
||||
" The `fun` keyword has special treatment because of the syntax `fun … : t -> e`
|
||||
" where `->` ends the type context rather than being part of it; to handle that,
|
||||
" we blacklist the ocamlTypeAnnot matchgroup, and we plug ocamlFunTypeAnnot
|
||||
" instead (later in this file, by using containedin=ocamlFun):
|
||||
syn region ocamlFun matchgroup=ocamlKeyword start='\<fun\>' matchgroup=ocamlArrow end='->'
|
||||
\ contains=ALLBUT,@ocamlContained,ocamlArrow,ocamlInfixOp,ocamlTypeAnnot
|
||||
|
||||
if exists("ocaml_revised")
|
||||
syn keyword ocamlKeyword do value
|
||||
syn keyword ocamlBoolean True False
|
||||
@@ -193,14 +200,10 @@ else
|
||||
syn keyword ocamlBoolean true false
|
||||
endif
|
||||
|
||||
syn keyword ocamlType array bool char exn float format format4
|
||||
syn keyword ocamlType int int32 int64 lazy_t list nativeint option
|
||||
syn keyword ocamlType bytes string unit
|
||||
|
||||
syn match ocamlConstructorDelimiter "(\s*)"
|
||||
syn match ocamlConstructorDelimiter "\[\s*\]"
|
||||
syn match ocamlConstructorDelimiter "\[|\s*>|]"
|
||||
syn match ocamlConstructorDelimiter "\[<\s*>\]"
|
||||
syn match ocamlEmptyConstructor "(\s*)"
|
||||
syn match ocamlEmptyConstructor "\[\s*\]"
|
||||
syn match ocamlEmptyConstructor "\[|\s*>|]"
|
||||
syn match ocamlEmptyConstructor "\[<\s*>\]"
|
||||
syn match ocamlConstructor "\u\(\w\|'\)*\>"
|
||||
|
||||
" Polymorphic variants
|
||||
@@ -215,26 +218,24 @@ syn match ocamlCharErr "'\\\d\d'\|'\\\d'"
|
||||
syn match ocamlCharErr "'\\[^\'ntbr]'"
|
||||
syn region ocamlString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
|
||||
|
||||
syn match ocamlTopStop ";;"
|
||||
|
||||
syn match ocamlAnyVar "\<_\>"
|
||||
syn match ocamlKeyChar "|[^\]]"me=e-1
|
||||
syn match ocamlKeyChar "|]\@!"
|
||||
syn match ocamlKeyChar ";"
|
||||
syn match ocamlKeyChar "\~"
|
||||
syn match ocamlKeyChar "?"
|
||||
|
||||
" NOTE: for correct precedence, the rule for ";;" must come after that for ";"
|
||||
syn match ocamlTopStop ";;"
|
||||
|
||||
"" Operators
|
||||
|
||||
" The grammar of operators is found there:
|
||||
" https://caml.inria.fr/pub/docs/manual-ocaml/names.html#operator-name
|
||||
" https://caml.inria.fr/pub/docs/manual-ocaml/extn.html#s:ext-ops
|
||||
" https://caml.inria.fr/pub/docs/manual-ocaml/extn.html#s:index-operators
|
||||
" =, *, < and > are both operator names and keywords, we let the user choose how
|
||||
" to display them (has to be declared before regular infix operators):
|
||||
" = is both an operator name and a keyword, we let the user choose how
|
||||
" to display it (has to be declared before regular infix operators):
|
||||
syn match ocamlEqual "="
|
||||
syn match ocamlStar "*"
|
||||
syn match ocamlAngle "<"
|
||||
syn match ocamlAngle ">"
|
||||
" Custom indexing operators:
|
||||
syn region ocamlIndexing matchgroup=ocamlIndexingOp
|
||||
\ start="\.[~?!:|&$%=>@^/*+-][~?!.:|&$%<=>@^*/+-]*\_s*("
|
||||
@@ -253,8 +254,8 @@ syn match ocamlExtensionOp "#[#~?!.:|&$%<=>@^*/+-]\+"
|
||||
" Infix and prefix operators:
|
||||
syn match ocamlPrefixOp "![~?!.:|&$%<=>@^*/+-]*"
|
||||
syn match ocamlPrefixOp "[~?][~?!.:|&$%<=>@^*/+-]\+"
|
||||
syn match ocamlInfixOp "[&$%@^/+-][~?!.:|&$%<=>@^*/+-]*"
|
||||
syn match ocamlInfixOp "[|<=>*][~?!.:|&$%<=>@^*/+-]\+"
|
||||
syn match ocamlInfixOp "[&$%<>@^*/+-][~?!.:|&$%<=>@^*/+-]*"
|
||||
syn match ocamlInfixOp "[|=][~?!.:|&$%<=>@^*/+-]\+"
|
||||
syn match ocamlInfixOp "#[~?!.:|&$%<=>@^*/+-]\+#\@!"
|
||||
syn match ocamlInfixOp "!=[~?!.:|&$%<=>@^*/+-]\@!"
|
||||
syn keyword ocamlInfixOpKeyword asr land lor lsl lsr lxor mod or
|
||||
@@ -271,6 +272,9 @@ else
|
||||
syn match ocamlKeyChar "<-[~?!.:|&$%<=>@^*/+-]\@!"
|
||||
endif
|
||||
|
||||
" Script shebang (has to be declared after operators)
|
||||
syn match ocamlShebang "\%1l^#!.*$"
|
||||
|
||||
syn match ocamlNumber "-\=\<\d\(_\|\d\)*[l|L|n]\?\>"
|
||||
syn match ocamlNumber "-\=\<0[x|X]\(\x\|_\)\+[l|L|n]\?\>"
|
||||
syn match ocamlNumber "-\=\<0[o|O]\(\o\|_\)\+[l|L|n]\?\>"
|
||||
@@ -278,10 +282,264 @@ syn match ocamlNumber "-\=\<0[b|B]\([01]\|_\)\+[l|L|n]\?\>"
|
||||
syn match ocamlFloat "-\=\<\d\(_\|\d\)*\.\?\(_\|\d\)*\([eE][-+]\=\d\(_\|\d\)*\)\=\>"
|
||||
|
||||
" Labels
|
||||
syn match ocamlLabel "\~\(\l\|_\)\(\w\|'\)*"lc=1
|
||||
syn match ocamlLabel "?\(\l\|_\)\(\w\|'\)*"lc=1
|
||||
syn match ocamlLabel "[~?]\(\l\|_\)\(\w\|'\)*:\?"
|
||||
syn region ocamlLabel transparent matchgroup=ocamlLabel start="[~?](\(\l\|_\)\(\w\|'\)*"lc=2 end=")"me=e-1 contains=ALLBUT,@ocamlContained,ocamlParenErr
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
"" Type contexts
|
||||
|
||||
" How we recognize type contexts is explained in `type-linter-notes.md`
|
||||
" and a test suite is found in `type-linter-test.ml`.
|
||||
"
|
||||
" ocamlTypeExpr is the cluster of things that can make up a type expression
|
||||
" (in a loose sense, e.g. the “as” keyword and universal quantification are
|
||||
" included). Regions containing a type expression use it like this:
|
||||
"
|
||||
" contains=@ocamlTypeExpr,...
|
||||
"
|
||||
" ocamlTypeContained is the cluster of things that can be found in a type
|
||||
" expression or a type definition. It is not expected to be used in any region,
|
||||
" it exists solely for throwing things in it that should not pollute the main
|
||||
" linter.
|
||||
"
|
||||
" Both clusters are filled in incrementally. Every match group that is not to be
|
||||
" found at the main level must be declared as “contained” and added to either
|
||||
" ocamlTypeExpr or ocamlTypeContained.
|
||||
"
|
||||
" In these clusters we don’t put generic things that can also be found elswhere,
|
||||
" i.e. ocamlComment and ocamlPpx, because everything that is in these clusters
|
||||
" is also put in ocamlContained and thus ignored by the main linter.
|
||||
|
||||
"syn cluster ocamlTypeExpr contains=
|
||||
syn cluster ocamlTypeContained contains=@ocamlTypeExpr
|
||||
syn cluster ocamlContained add=@ocamlTypeContained
|
||||
|
||||
" We’ll use a “catch-all” highlighting group to show as error anything that is
|
||||
" not matched more specifically; we don’t want spaces to be reported as errors
|
||||
" (different background color), so we just catch them here:
|
||||
syn cluster ocamlTypeExpr add=ocamlTypeBlank
|
||||
syn match ocamlTypeBlank contained "\_s\+"
|
||||
hi link ocamlTypeBlank NONE
|
||||
|
||||
" NOTE: Carefully avoid catching "(*" here.
|
||||
syn cluster ocamlTypeExpr add=ocamlTypeParen
|
||||
syn region ocamlTypeParen contained transparent
|
||||
\ matchgroup=ocamlEncl start="(\*\@!"
|
||||
\ matchgroup=ocamlEncl end=")"
|
||||
\ contains=@ocamlTypeExpr,ocamlComment,ocamlPpx
|
||||
|
||||
syn cluster ocamlTypeExpr add=ocamlTypeKeyChar,ocamlTypeAs
|
||||
syn match ocamlTypeKeyChar contained "->"
|
||||
syn match ocamlTypeKeyChar contained "\*"
|
||||
syn match ocamlTypeKeyChar contained "#"
|
||||
syn match ocamlTypeKeyChar contained ","
|
||||
syn match ocamlTypeKeyChar contained "\."
|
||||
syn keyword ocamlTypeAs contained as
|
||||
hi link ocamlTypeAs ocamlKeyword
|
||||
|
||||
syn cluster ocamlTypeExpr add=ocamlTypeVariance
|
||||
syn match ocamlTypeVariance contained "[-+!]\ze *\('\|\<_\>\)"
|
||||
syn match ocamlTypeVariance contained "[-+] *!\+\ze *\('\|\<_\>\)"
|
||||
syn match ocamlTypeVariance contained "! *[-+]\+\ze *\('\|\<_\>\)"
|
||||
|
||||
syn cluster ocamlTypeContained add=ocamlTypeEq
|
||||
syn match ocamlTypeEq contained "[+:]\?="
|
||||
hi link ocamlTypeEq ocamlKeyChar
|
||||
|
||||
syn cluster ocamlTypeExpr add=ocamlTypeVar,ocamlTypeConstr,ocamlTypeAnyVar,ocamlTypeBuiltin
|
||||
syn match ocamlTypeVar contained "'\(\l\|_\)\(\w\|'\)*\>"
|
||||
syn match ocamlTypeConstr contained "\<\(\l\|_\)\(\w\|'\)*\>"
|
||||
" NOTE: for correct precedence, the rule for the wildcard (ocamlTypeAnyVar)
|
||||
" must come after the rule for type constructors (ocamlTypeConstr).
|
||||
syn match ocamlTypeAnyVar contained "\<_\>"
|
||||
" NOTE: For correct precedence, these builtin names must occur after the rule
|
||||
" for type constructors (ocamlTypeConstr) but before the rule for non-optional
|
||||
" labeled arguments (ocamlTypeLabel). For the latter to take precedence over
|
||||
" these builtin names, we use “syn match” here instead of “syn keyword”.
|
||||
syn match ocamlTypeBuiltin contained "\<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
|
||||
syn sync minlines=50
|
||||
@@ -311,19 +569,19 @@ hi def link ocamlBrackErr Error
|
||||
hi def link ocamlParenErr Error
|
||||
hi def link ocamlArrErr Error
|
||||
|
||||
hi def link ocamlCommentErr Error
|
||||
|
||||
hi def link ocamlCountErr Error
|
||||
hi def link ocamlDoErr Error
|
||||
hi def link ocamlDoneErr Error
|
||||
hi def link ocamlEndErr Error
|
||||
hi def link ocamlThenErr Error
|
||||
hi def link ocamlKwErr Error
|
||||
|
||||
hi def link ocamlCharErr Error
|
||||
|
||||
hi def link ocamlErr Error
|
||||
|
||||
hi def link ocamlComment Comment
|
||||
hi def link ocamlShebang ocamlComment
|
||||
|
||||
hi def link ocamlModPath Include
|
||||
hi def link ocamlObject Include
|
||||
@@ -344,13 +602,12 @@ hi def link ocamlStructEncl ocamlModule
|
||||
hi def link ocamlScript Include
|
||||
|
||||
hi def link ocamlConstructor Constant
|
||||
hi def link ocamlConstructorDelimiter ocamlConstructor
|
||||
hi def link ocamlEmptyConstructor ocamlConstructor
|
||||
|
||||
hi def link ocamlVal Keyword
|
||||
hi def link ocamlModPreRHS Keyword
|
||||
hi def link ocamlMPRestr2 Keyword
|
||||
hi def link ocamlKeyword Keyword
|
||||
hi def link ocamlKeywordDelimiter ocamlKeyword
|
||||
hi def link ocamlMethod Include
|
||||
hi def link ocamlArrow Keyword
|
||||
hi def link ocamlKeyChar Keyword
|
||||
@@ -359,8 +616,6 @@ hi def link ocamlTopStop Keyword
|
||||
|
||||
hi def link ocamlRefAssign ocamlKeyChar
|
||||
hi def link ocamlEqual ocamlKeyChar
|
||||
hi def link ocamlStar ocamlInfixOp
|
||||
hi def link ocamlAngle ocamlInfixOp
|
||||
hi def link ocamlCons ocamlInfixOp
|
||||
|
||||
hi def link ocamlPrefixOp ocamlOperator
|
||||
@@ -384,7 +639,24 @@ hi def link ocamlQuotedStringDelim Identifier
|
||||
|
||||
hi def link ocamlLabel Identifier
|
||||
|
||||
hi def link ocamlType Type
|
||||
" Type linting groups that the user can customize:
|
||||
" - ocamlTypeCatchAll: anything in a type context that is not caught by more
|
||||
" specific rules (in principle, this should only match syntax errors)
|
||||
" - ocamlTypeConstr: type constructors
|
||||
" - ocamlTypeBuiltin: builtin type constructors (like int or list)
|
||||
" - ocamlTypeVar: type variables ('a)
|
||||
" - ocamlTypeAnyVar: wildcard (_)
|
||||
" - ocamlTypeVariance: variance and injectivity indications (+'a, !'a)
|
||||
" - ocamlTypeKeyChar: symbols such as -> and *
|
||||
" Default values below mimick the behavior before the type linter was
|
||||
" implemented, but now we can do better. :-)
|
||||
hi def link ocamlTypeCatchAll Error
|
||||
hi def link ocamlTypeConstr NONE
|
||||
hi def link ocamlTypeBuiltin Type
|
||||
hi def link ocamlTypeVar NONE
|
||||
hi def link ocamlTypeAnyVar NONE
|
||||
hi def link ocamlTypeVariance ocamlKeyChar
|
||||
hi def link ocamlTypeKeyChar ocamlKeyChar
|
||||
|
||||
hi def link ocamlTodo Todo
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ syntax keyword odinTransmute transmute
|
||||
syntax keyword odinCast cast
|
||||
syntax keyword odinDistinct distinct
|
||||
syntax keyword odinOpaque opaque
|
||||
syntax keyword odinWhere where
|
||||
|
||||
syntax keyword odinStruct struct
|
||||
syntax keyword odinEnum enum
|
||||
@@ -47,10 +48,11 @@ syntax match odinFixMe "FIXME"
|
||||
syntax match odinNoCheckin "NOCHECKIN"
|
||||
syntax match odinHack "HACK"
|
||||
|
||||
syntax keyword odinDataType string cstring bool b8 b16 b32 b64 rune any rawptr f32 f64 f32le f32be f64le f64be u8 u16 u32 u64 u128 u16le u32le u64le u128le u16be u32be u64be u128be uint uintptr i8 i16 i32 i64 i128 i16le i32le i64le i128le i16be i32be i64be i128be int complex complex32 complex64 complex128 quaternion quaternion64 quaternion128 quaternion256 matrix
|
||||
syntax keyword odinDataType string cstring bool b8 b16 b32 b64 rune any rawptr f16 f32 f64 f16le f16be f32le f32be f64le f64be u8 u16 u32 u64 u128 u16le u32le u64le u128le u16be u32be u64be u128be uint uintptr i8 i16 i32 i64 i128 i16le i32le i64le i128le i16be i32be i64be i128be int complex complex32 complex64 complex128 quaternion quaternion64 quaternion128 quaternion256 matrix typeid
|
||||
syntax keyword odinBool true false
|
||||
syntax keyword odinNull nil
|
||||
syntax keyword odinDynamic dynamic
|
||||
syntax keyword odinMap map
|
||||
syntax keyword odinProc proc
|
||||
syntax keyword odinIn in
|
||||
syntax keyword odinNotIn notin
|
||||
@@ -65,9 +67,9 @@ syntax keyword odinPackage package
|
||||
syntax keyword odinReturn return
|
||||
syntax keyword odinDefer defer
|
||||
|
||||
syntax region odinChar start=/\v'/ skip=/\v\\./ end=/\v'/
|
||||
syntax region odinString start=/\v"/ skip=/\v\\./ end=/\v"/
|
||||
syntax region odinRawString start=/\v`/ skip=/\v\\./ end=/\v`/
|
||||
syntax region odinRawString start=+`+ end=+`+
|
||||
syntax region odinChar start=+'+ skip=+\\\\\|\\'+ end=+'+
|
||||
syntax region odinString start=+"+ skip=+\\\\\|\\'+ end=+"+
|
||||
|
||||
syntax match odinFunction "\v<\w*>(\s*::\s*proc)@="
|
||||
|
||||
@@ -96,7 +98,7 @@ syntax match odinMacro "#\<\w\+\>" display
|
||||
syntax match odinTemplate "$\<\w\+\>"
|
||||
|
||||
syntax match odinCommentNote "@\<\w\+\>" contained display
|
||||
syntax region odinLineComment start=/\/\// end=/$/ contains=odinLineComment, odinCommentNote, odinTodo, odinNote, odinXXX, odinFixMe, odinNoCheckin, odinHack
|
||||
syntax region odinLineComment start=/\/\// end=/$/ contains=odinCommentNote, odinTodo, odinNote, odinXXX, odinFixMe, odinNoCheckin, odinHack
|
||||
syntax region odinBlockComment start=/\v\/\*/ end=/\v\*\// contains=odinBlockComment, odinCommentNote, odinTodo, odinNote, odinXXX, odinFixMe, odinNoCheckin, odinHack
|
||||
|
||||
highlight link odinUsing Keyword
|
||||
@@ -121,6 +123,7 @@ highlight link odinAlignOf Keyword
|
||||
highlight link odinPackage Keyword
|
||||
highlight link odinOrReturn Keyword
|
||||
highlight link odinOrElse Keyword
|
||||
highlight link odinWhere Keyword
|
||||
|
||||
highlight link odinInline Keyword
|
||||
highlight link odinNoInline Keyword
|
||||
@@ -133,6 +136,7 @@ highlight link odinDo Keyword
|
||||
|
||||
highlight link odinDefer Operator
|
||||
highlight link odinDynamic Operator
|
||||
highlight link odinMap Operator
|
||||
highlight link odinRange Operator
|
||||
highlight link odinHalfRange Operator
|
||||
highlight link odinAssign Operator
|
||||
|
||||
@@ -32,7 +32,7 @@ syn keyword openscadPrimitiveSolid cube sphere cylinder polyhedron surface
|
||||
syn keyword openscadPrimitive2D square circle polygon import_dxf text
|
||||
syn keyword openscadPrimitiveImport import child children
|
||||
|
||||
syn match openscadSpecialVariable "\$[a-zA-Z]\+\>" display
|
||||
syn match openscadSpecialVariable "\$[a-zA-Z0-9_]\+\>" display
|
||||
syn match openscadModifier "^\s*[\*\!\#\%]" display
|
||||
|
||||
syn match openscadNumbers "\<\d\|\.\d" contains=openscadNumber display transparent
|
||||
|
||||
@@ -2,7 +2,6 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'plantuml', 'syntax/plantuml.v
|
||||
finish
|
||||
endif
|
||||
|
||||
scriptencoding utf-8
|
||||
" Vim syntax file
|
||||
" Language: PlantUML
|
||||
" License: VIM LICENSE
|
||||
|
||||
@@ -31,7 +31,7 @@ endif
|
||||
|
||||
syn case ignore
|
||||
|
||||
syn cluster qmlExpr contains=qmlStringD,qmlStringS,qmlStringT,SqmlCharacter,qmlNumber,qmlObjectLiteralType,qmlBoolean,qmlType,qmlJsType,qmlNull,qmlGlobal,qmlFunction,qmlArrowFunction
|
||||
syn cluster qmlExpr contains=qmlStringD,qmlStringS,qmlStringT,SqmlCharacter,qmlNumber,qmlObjectLiteralType,qmlBoolean,qmlType,qmlJsType,qmlNull,qmlGlobal,qmlFunction,qmlArrowFunction,qmlNullishCoalescing
|
||||
syn keyword qmlCommentTodo TODO FIXME XXX TBD contained
|
||||
syn match qmlLineComment "\/\/.*" contains=@Spell,qmlCommentTodo
|
||||
syn match qmlCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
|
||||
@@ -49,6 +49,7 @@ syn region qmlRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi
|
||||
syn match qmlObjectLiteralType "[A-Za-z][_A-Za-z0-9]*\s*\({\)\@="
|
||||
syn region qmlTernaryColon start="?" end=":" contains=@qmlExpr,qmlBraces,qmlParens
|
||||
syn match qmlBindingProperty "\<[A-Za-z][_A-Za-z.0-9]*\s*:"
|
||||
syn match qmlNullishCoalescing "??"
|
||||
|
||||
syn keyword qmlConditional if else switch
|
||||
syn keyword qmlRepeat while for do in
|
||||
@@ -1065,7 +1066,7 @@ syntax keyword qmlObjectLiteralType XYSeries
|
||||
|
||||
syntax keyword qmlObjectLiteralType YAnimator
|
||||
|
||||
syntax keyword qmlObjectLiteralType ZoomBlur
|
||||
syntax keyword qmlObjectLiteralType ZoomBlur
|
||||
|
||||
" }}}
|
||||
|
||||
@@ -1126,6 +1127,7 @@ if version >= 508 || !exists("did_qml_syn_inits")
|
||||
HiLink qmlNull Keyword
|
||||
HiLink qmlBoolean Boolean
|
||||
HiLink qmlRegexpString String
|
||||
HiLink qmlNullishCoalescing Operator
|
||||
|
||||
HiLink qmlIdentifier Identifier
|
||||
HiLink qmlLabel Label
|
||||
|
||||
@@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'syntax/requir
|
||||
endif
|
||||
|
||||
" the Requirements File Format syntax support for Vim
|
||||
" Version: 1.6.0
|
||||
" Version: 1.7.1
|
||||
" Author: raimon <raimon49@hotmail.com>
|
||||
" License: MIT LICENSE
|
||||
" The MIT License (MIT)
|
||||
@@ -34,6 +34,7 @@ endif
|
||||
|
||||
syn case match
|
||||
|
||||
syn match requirementsVersion "\v\d+[a-zA-Z0-9\.\-\*]*"
|
||||
syn region requirementsComment start="[ \t]*#" end="$"
|
||||
syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?"
|
||||
syn match requirementsVersionSpecifiers "\v(\=\=\=?|\<\=?|\>\=?|\~\=|\!\=)"
|
||||
@@ -43,14 +44,15 @@ syn match requirementsVersionControls "\v(git\+?|hg\+|svn\+|bzr\+).*://.\S+"
|
||||
syn match requirementsURLs "\v(\@\s)?(https?|ftp|gopher)://?[^\s/$.?#].\S*"
|
||||
syn match requirementsEnvironmentMarkers "\v;\s[^#]+"
|
||||
|
||||
hi link requirementsComment Comment
|
||||
hi link requirementsCommandOption Special
|
||||
hi link requirementsVersionSpecifiers Boolean
|
||||
hi link requirementsPackageName Identifier
|
||||
hi link requirementsExtras Type
|
||||
hi link requirementsVersionControls Underlined
|
||||
hi link requirementsURLs Underlined
|
||||
hi link requirementsEnvironmentMarkers Macro
|
||||
hi def link requirementsVersion Number
|
||||
hi def link requirementsComment Comment
|
||||
hi def link requirementsCommandOption Special
|
||||
hi def link requirementsVersionSpecifiers Boolean
|
||||
hi def link requirementsPackageName Identifier
|
||||
hi def link requirementsExtras Type
|
||||
hi def link requirementsVersionControls Underlined
|
||||
hi def link requirementsURLs Underlined
|
||||
hi def link requirementsEnvironmentMarkers Macro
|
||||
|
||||
let b:current_syntax = "requirements"
|
||||
|
||||
|
||||
@@ -148,9 +148,9 @@ syn cluster rubyStringSpecial contains=rubyInterpolation,rubyStringEscape
|
||||
syn cluster rubyStringNotTop contains=@rubyStringSpecial,@rubyNestedBrackets,@rubySingleCharEscape
|
||||
|
||||
" Regular Expression Metacharacters {{{1
|
||||
syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\\\\|\\)" end=")" contained
|
||||
syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\\\\|\\)" end=")" contained transparent contains=@rubyRegexpSpecial
|
||||
syn region rubyRegexpBrackets matchgroup=rubyRegexpCharClass start="\[\^\=" skip="\\\\\|\\\]" end="\]" contained transparent contains=rubyRegexpBrackets,rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass,rubyRegexpIntersection oneline
|
||||
syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\\\\|\\)" end=")" contained
|
||||
syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\%(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\\\\|\\)" end=")" contained transparent contains=@rubyRegexpSpecial
|
||||
syn region rubyRegexpBrackets matchgroup=rubyRegexpCharClass start="\[\^\=" skip="\\\\\|\\\]" end="\]" contained transparent contains=rubyRegexpBrackets,rubyStringEscape,rubyRegexpEscape,rubyRegexpCharClass,rubyRegexpIntersection oneline
|
||||
syn match rubyRegexpCharClass "\\[DdHhRSsWw]" contained display
|
||||
syn match rubyRegexpCharClass "\[:\^\=\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]" contained
|
||||
syn match rubyRegexpCharClass "\\[pP]{^\=.\{-}}" contained display
|
||||
@@ -349,7 +349,7 @@ syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,
|
||||
syn match rubyControl "\%#=1\<\%(break\|in\|next\|redo\|retry\|return\)\>"
|
||||
syn match rubyKeyword "\%#=1\<\%(super\|yield\)\>"
|
||||
syn match rubyBoolean "\%#=1\<\%(true\|false\)\>[?!]\@!"
|
||||
syn match rubyPseudoVariable "\%#=1\<\(self\|nil\)\>[?!]\@!"
|
||||
syn match rubyPseudoVariable "\%#=1\<\%(self\|nil\)\>[?!]\@!"
|
||||
syn match rubyPseudoVariable "\%#=1\<__\%(ENCODING\|dir\|FILE\|LINE\|callee\|method\)__\>"
|
||||
syn match rubyBeginEnd "\%#=1\<\%(BEGIN\|END\)\>"
|
||||
|
||||
@@ -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
|
||||
|
||||
if !exists("ruby_minlines")
|
||||
let ruby_minlines = 500
|
||||
endif
|
||||
exe "syn sync minlines=" . ruby_minlines
|
||||
|
||||
else
|
||||
syn match rubyControl "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl
|
||||
syn match rubyControl "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl
|
||||
@@ -415,13 +410,18 @@ else
|
||||
syn match rubyKeyword "\<\%(alias\|undef\)\>"
|
||||
endif
|
||||
|
||||
if !exists("ruby_minlines")
|
||||
let ruby_minlines = 500
|
||||
endif
|
||||
exe "syn sync minlines=" . ruby_minlines
|
||||
|
||||
" Special Methods {{{1
|
||||
if !exists("ruby_no_special_methods")
|
||||
syn match rubyAccess "\<\%(public\|protected\|private\)\>" " use re=2
|
||||
syn match rubyAccess "\%#=1\<\%(public\|private\)_class_method\>"
|
||||
syn match rubyAccess "\%#=1\<\%(public\|private\)_constant\>"
|
||||
syn match rubyAccess "\%#=1\<module_function\>"
|
||||
syn match rubyAttribute "\%#=1\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!" " attr is a common variable name
|
||||
syn match rubyAttribute "\%#=1\%(\%(^\|;\)\s*\)\@<=attr\>\%(\s*[.=]\)\@!" " attr is a common variable name
|
||||
syn match rubyAttribute "\%#=1\<attr_\%(accessor\|reader\|writer\)\>"
|
||||
syn match rubyControl "\%#=1\<\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>"
|
||||
syn match rubyEval "\%#=1\<eval\>"
|
||||
|
||||
@@ -129,7 +129,6 @@ syntax keyword smt2Builtin
|
||||
\ rotate_left
|
||||
\ rotate_right
|
||||
\ sat
|
||||
\ sat
|
||||
\ select
|
||||
\ sign_extend
|
||||
\ store
|
||||
@@ -137,7 +136,6 @@ syntax keyword smt2Builtin
|
||||
\ to_real
|
||||
\ true
|
||||
\ unsat
|
||||
\ unsat
|
||||
\ xor
|
||||
\ zero_extend
|
||||
syntax match smt2Builtin "\m\C[\^\~]"
|
||||
|
||||
@@ -120,13 +120,13 @@ syn region solFuncModParens contained contains=solString,solFuncCall,solCo
|
||||
\ end=')'
|
||||
syn keyword solFuncReturn contained nextgroup=solFuncRetParens skipwhite skipempty returns
|
||||
syn region solFuncRetParens contains=solValueType,solFuncStorageType nextgroup=solFuncBody skipempty skipwhite
|
||||
\ start='('
|
||||
\ end=')'
|
||||
\ start='('
|
||||
\ end=')'
|
||||
syn region solFuncBody contained contains=solDestructure,solComment,solAssemblyBlock,solEmitEvent,solTypeCast,solMethod,solValueType,solConstant,solKeyword,solRepeat,solLabel,solException,solStructure,solFuncStorageType,solOperator,solNumber,solString,solFuncCall,solIf,solElse,solLoop skipempty skipwhite
|
||||
\ start='{'
|
||||
\ end='}'
|
||||
\ start='{'
|
||||
\ end='}'
|
||||
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
|
||||
\ start='('
|
||||
\ end=')'
|
||||
@@ -185,6 +185,12 @@ hi def link solEventName Function
|
||||
hi def link solEventParamMod Keyword
|
||||
hi def link solEmitEvent Special
|
||||
|
||||
" Errors
|
||||
syn match solError /\<error\>/ nextgroup=solErrorName,solFuncParams skipwhite
|
||||
syn match solErrorName /\<[a-zA-Z_][0-9a-zA-Z_]*/ nextgroup=solFuncParam contained skipwhite
|
||||
|
||||
hi def link solErrorName Function
|
||||
|
||||
" Constants
|
||||
syn keyword solConstant true false wei szabo finney ether seconds minutes hours days weeks years now super
|
||||
syn keyword solConstant block msg now tx this abi
|
||||
@@ -241,7 +247,7 @@ syn keyword solMethod delete new var return import
|
||||
syn region solMethodParens start='(' end=')' contains=solString,solConstant,solNumber,solFuncCall,solTypeCast,solMethod,solComma,solOperator contained transparent
|
||||
syn keyword solMethod nextgroup=solMethodParens skipwhite skipempty
|
||||
\ blockhash require revert assert keccak256 sha256
|
||||
\ ripemd160 ecrecover addmod mullmod selfdestruct
|
||||
\ ripemd160 ecrecover addmod mulmod selfdestruct
|
||||
|
||||
hi def link solMethod Special
|
||||
|
||||
|
||||
@@ -22,43 +22,41 @@ syntax match svelteComponentName containedin=htmlTagN '\v\C<[a-z0-9]+(-[a-z0-9]+
|
||||
syntax match svelteComponentName containedin=htmlTagN '\vsvelte:\w*'
|
||||
|
||||
" Syntax for vim-svelte-theme
|
||||
syntax match htmlAttr '\v(\S|\<)@<![^\/\<\>[:blank:]]+' containedin=htmlTag
|
||||
syntax match htmlAttr '\v(\S|\<)@<![^\/\<\>[:blank:]]+'
|
||||
\ containedin=htmlTag
|
||||
\ contains=htmlString,svelteValue,htmlArg
|
||||
syntax match htmlAttrEqual '\v\=' containedin=htmlAttr
|
||||
|
||||
syntax match svelteAttr
|
||||
\ '\v(\S)@<!(on|bind|use|in|out|transition|animate|class):[^\=\>[:blank:]]+(\=\"[^"]*\"|\=\{[^}]*\})?'
|
||||
syntax match svelteAttr
|
||||
\ '\(\S\)\@<!\w\+:[^=>[:blank:]]\+\(="[^"]*"\|={[^}]*}\)\?'
|
||||
\ containedin=htmlTag
|
||||
\ contains=svelteKey,svelteValue
|
||||
|
||||
syntax match svelteKey contained '\v(on|bind|use|in|out|transition|animate|class):[^\=\>[:blank:]]+'
|
||||
syntax match svelteValue contained '\v\{[^}]*\}'
|
||||
syntax match svelteValue contained '{[^}]*}'
|
||||
syntax match svelteKey contained '\w\+:[^=>[:blank:]]\+'
|
||||
|
||||
syntax region svelteExpression
|
||||
\ containedin=htmlH.*,htmlItalic
|
||||
\ matchgroup=svelteBrace
|
||||
\ transparent
|
||||
\ start="{"
|
||||
\ end="}\(}\)\@!"
|
||||
\ end="}\(}\|;\)\@!"
|
||||
|
||||
" Multiple lines expressions are supposed to end with '}}'
|
||||
syntax region svelteExpression
|
||||
\ containedin=svelteValue,htmlValue,htmlAttr
|
||||
\ contains=@simpleJavascriptExpression
|
||||
\ matchgroup=svelteBrace
|
||||
\ start="{"
|
||||
\ end="\(}\)\@<=}"
|
||||
|
||||
syntax region svelteExpression
|
||||
\ containedin=htmlSvelteTemplate,svelteValue,htmlString,htmlValue,htmlArg,htmlTag
|
||||
\ containedin=htmlSvelteTemplate,svelteValue,htmlString,htmlArg,htmlTag,htmlAttr,htmlValue,htmlAttr
|
||||
\ contains=@simpleJavascriptExpression,svelteAtTags
|
||||
\ matchgroup=svelteBrace
|
||||
\ transparent
|
||||
\ start="{"
|
||||
\ end="}\(}\)\@!"
|
||||
\ end="}\(}\|;\)\@!"
|
||||
\ oneline
|
||||
|
||||
syntax region svelteExpression
|
||||
\ containedin=htmlTag
|
||||
\ contains=@simpleJavascriptExpression,svelteAtTags,svelteShortProp
|
||||
\ matchgroup=svelteBrace
|
||||
\ transparent
|
||||
\ start="{"
|
||||
\ end="}\(}\)\@!"
|
||||
|
||||
syntax match svelteAtTags '\v\@(html|debug)'
|
||||
syntax match svelteShortProp '\v<\w+>'
|
||||
syntax match svelteAtTags '@\(html\|debug\)'
|
||||
|
||||
syntax region svelteBlockBody
|
||||
\ containedin=htmlSvelteTemplate,htmlLink
|
||||
@@ -101,7 +99,9 @@ syntax region javaScriptTemplateExpression
|
||||
syntax match javaScriptNumber '\v<-?\d+L?>|0[xX][0-9a-fA-F]+>' contained
|
||||
syntax match javaScriptOperator '[-!|&+<>=%*~^]' contained
|
||||
syntax match javaScriptOperator '\v(*)@<!/(/|*)@!' contained
|
||||
syntax keyword javaScriptOperator delete instanceof typeof void new in of contained
|
||||
syntax keyword javaScriptOperator contained
|
||||
\ delete instanceof typeof void new in of const let var
|
||||
\ return function
|
||||
|
||||
highlight default link svelteAttr htmlTag
|
||||
if s:highlight_svelte_attr
|
||||
@@ -112,7 +112,9 @@ else
|
||||
highlight default link svelteValue String
|
||||
endif
|
||||
|
||||
highlight default link svelteExpression None
|
||||
highlight default link svelteBrace Type
|
||||
highlight default link svelteAtTags Type
|
||||
highlight default link svelteBlockKeyword Statement
|
||||
highlight default link svelteComponentName htmlTagName
|
||||
highlight default link javaScriptTemplateString String
|
||||
@@ -122,6 +124,5 @@ highlight default link javaScriptNumber Constant
|
||||
highlight default link javaScriptOperator Operator
|
||||
highlight default link svelteAttr htmlTag
|
||||
highlight default link svelteAttrEqual htmlTag
|
||||
highlight default link svelteShortProp htmlValue
|
||||
"}}}
|
||||
" vim: fdm=marker
|
||||
|
||||
@@ -271,6 +271,15 @@ silent! syntax clear htmlHead
|
||||
syntax match javaScriptNumber '\v<-?\d+L?>|0[xX][0-9a-fA-F]+>'
|
||||
\ containedin=@javascriptSvelteScript display
|
||||
|
||||
" TypeScript
|
||||
" Fix template string `...` breaking syntax highlighting
|
||||
syntax region typescriptTemplate
|
||||
\ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/
|
||||
\ contains=typescriptTemplateSubstitution,typescriptSpecial,@Spell
|
||||
\ containedin=typescriptObjectLiteral
|
||||
\ nextgroup=@typescriptSymbols
|
||||
\ skipwhite skipempty
|
||||
|
||||
" html5 data-*
|
||||
syntax match htmlArg '\v<data(-[.a-z0-9]+)+>' containedin=@HTMLSyntax
|
||||
"}}}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user