diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2020-10-04 21:17:06 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-10-04 21:17:06 +0200 |
commit | b4868c7ea7b75dd09a6d172871c901905f5d539a (patch) | |
tree | 23f20821b10163083aa5c0b2016bce1db28ccc91 | |
parent | d221139bd70fd474be52237dc8e6440e6da632bd (diff) | |
download | vim-polyglot-b4868c7ea7b75dd09a6d172871c901905f5d539a.tar.gz vim-polyglot-b4868c7ea7b75dd09a6d172871c901905f5d539a.zip |
Add comments for some extensions + test
-rw-r--r-- | after/syntax/c.vim | 25 | ||||
-rw-r--r-- | after/syntax/cpp.vim | 59 | ||||
-rw-r--r-- | after/syntax/javascript/graphql.vim | 4 | ||||
-rw-r--r-- | after/syntax/typescript/graphql.vim | 2 | ||||
-rw-r--r-- | doc/pgsql.txt | 2 | ||||
-rw-r--r-- | ftdetect/polyglot.vim | 150 | ||||
-rw-r--r-- | indent/graphql.vim | 7 | ||||
-rw-r--r-- | packages.yaml | 11 | ||||
-rwxr-xr-x | scripts/build | 78 | ||||
-rw-r--r-- | syntax/pgsql.vim | 35 |
10 files changed, 185 insertions, 188 deletions
diff --git a/after/syntax/c.vim b/after/syntax/c.vim index a3db4e08..1f2821d7 100644 --- a/after/syntax/c.vim +++ b/after/syntax/c.vim @@ -7,7 +7,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cpp-modern') == " http://www.vim.org/scripts/script.php?script_id=3064 " Maintainer: bfrg <bfrg@users.noreply.github.com> " Website: https://github.com/bfrg/vim-cpp-modern -" Last Change: Mar 14, 2020 +" Last Change: Oct 4, 2020 " " Extended C syntax highlighting including highlighting of user-defined " functions. @@ -17,7 +17,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cpp-modern') == " ============================================================================== -" Highlight some additional keywords in the comments +" Highlight additional keywords in the comments syn keyword cTodo contained BUG NOTE @@ -50,25 +50,4 @@ if get(g:, 'cpp_simple_highlight', 0) hi link cLabel Statement endif - -" Operators -" syn match cOperator "\(<<\|>>\|[-+*/%&^|<>!=]\)=" -" syn match cOperator "<<\|>>\|&&\|||\|++\|--\|->" -" syn match cOperator "[.!~*&%<>^|=,+-]" -" syn match cOperator "/[^/*=]"me=e-1 -" syn match cOperator "/$" -" syn match cOperator "&&\|||" -" syn match cOperator "[][]" - -" Preprocessor -" syn keyword cDefined defined contained containedin=cDefine -" hi def link cDefined cDefine - -" Delimiters -" syn match cDelimiter "[();\\]" -" hi def link cDelimiter Delimiter -" foldmethod=syntax fix, courtesy of Ivan Freitas -" syn match cBraces display "[{}]" -" hi def link cBraces Delimiter - endif diff --git a/after/syntax/cpp.vim b/after/syntax/cpp.vim index 91030f39..730bb819 100644 --- a/after/syntax/cpp.vim +++ b/after/syntax/cpp.vim @@ -6,7 +6,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cpp-modern') == " Original Author: Jon Haggblad <https://github.com/octol> " Maintainer: bfrg <https://github.com/bfrg> " Website: https://github.com/bfrg/vim-cpp-modern -" Last Change: Oct 1, 2020 +" Last Change: Oct 4, 2020 " " This syntax file is based on: " https://github.com/octol/vim-cpp-enhanced-highlight @@ -14,17 +14,17 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cpp-modern') == " ============================================================================== " Standard library {{{1 -syntax keyword cppSTLconstant +syntax keyword cppSTLdefine \ MB_CUR_MAX MB_LEN_MAX WCHAR_MAX WCHAR_MIN WEOF __STDC_UTF_16__ __STDC_UTF_32__ syntax keyword cppSTLnamespace \ std experimental rel_ops syntax keyword cppSTLconstant - \ badbit digits digits10 eofbit failbit goodbit has_denorm has_denorm_loss has_infinity has_quiet_NaN has_signaling_NaN is_bounded is_exact is_iec559 is_integer is_modulo is_signed is_specialized max_exponent max_exponent10 min_exponent min_exponent10 nothrow npos radix round_style tinyness_before traps + \ badbit digits digits10 eofbit failbit goodbit has_denorm has_denorm_loss has_infinity has_quiet_NaN has_signaling_NaN is_bounded is_exact is_iec559 is_integer is_modulo is_signed is_specialized max_exponent max_exponent10 min_exponent min_exponent10 npos radix round_style tinyness_before traps syntax keyword cppSTLvariable - \ cerr cin clog cout wcerr wcin wclog wcout + \ cerr cin clog cout wcerr wcin wclog wcout nothrow syntax keyword cppSTLexception \ bad_alloc bad_exception bad_typeid bad_cast domain_error exception failure invalid_argument length_error logic_error out_of_range overflow_error range_error runtime_error underflow_error @@ -36,7 +36,10 @@ syntax keyword cppSTLios \ boolalpha dec defaultfloat fixed hex hexfloat internal left noboolalpha noshowbase noshowpoint noshowpos noskipws nounitbuf nouppercase oct right scientific showbase showpoint showpos skipws unitbuf uppercase syntax keyword cppSTLtype - \ fmtflags iostate openmode Init allocator auto_ptr basic_filebuf basic_fstream basic_ifstream basic_ios basic_iostream basic_istream basic_istringstream basic_ofstream basic_ostream basic_ostringstream basic_streambuf basic_string basic_stringbuf basic_stringstream binary_compose binder1st binder2nd bitset char_traits char_type const_mem_fun1_t const_mem_fun_ref1_t const_mem_fun_ref_t const_mem_fun_t const_pointer const_reference container_type deque difference_type div_t double_t event_callback filebuf first_type float_denorm_style float_round_style float_t fpos fstream gslice_array ifstream imaxdiv_t indirect_array int_type ios ios_base iostream istream istringstream istrstream iterator_category iterator_traits key_compare key_type ldiv_t list lldiv_t map mapped_type mask_array mbstate_t mem_fun1_t mem_fun_ref1_t mem_fun_ref_t mem_fun_t multimap multiset nothrow_t numeric_limits off_type ofstream ostream ostringstream ostrstream pair pointer pointer_to_binary_function pointer_to_unary_function pos_type priority_queue queue reference second_type seekdir sequence_buffer set sig_atomic_t size_type slice_array stack state_type stream streambuf streamoff streampos streamsize string stringbuf stringstream strstream strstreambuf temporary_buffer test_type time_t tm traits_type type_info u16string u32string unary_compose unary_negate valarray value_compare value_type vector wctrans_t wctype_t wfilebuf wfstream wifstream wint_t wios wiostream wistream wistringstream wofstream wostream wostringstream wstreambuf wstreampos wstring wstringbuf wstringstream codecvt codecvt_base codecvt_byname collate collate_byname ctype ctype_base ctype_byname locale messages messages_base messages_byname money_base money_get money_put moneypunct moneypunct_byname num_get num_put numpunct numpunct_byname time_base time_get time_get_byname time_put time_put_byname binary_function binary_negate bit_and bit_not bit_or divides equal_to greater greater_equal less less_equal logical_and logical_not logical_or minus modulus multiplies negate not_equal_to plus unary_function unary_negate bidirectional_iterator_tag forward_iterator_tag input_iterator_tag output_iterator_tag random_access_iterator_tag + \ fmtflags iostate openmode Init allocator auto_ptr basic_filebuf basic_fstream basic_ifstream basic_ios basic_iostream basic_istream basic_istringstream basic_ofstream basic_ostream basic_ostringstream basic_streambuf basic_string basic_stringbuf basic_stringstream binary_compose binder1st binder2nd bitset char_traits char_type const_mem_fun1_t const_mem_fun_ref1_t const_mem_fun_ref_t const_mem_fun_t const_pointer const_reference container_type deque difference_type div_t event_callback filebuf first_type float_denorm_style float_round_style fpos fstream gslice_array ifstream imaxdiv_t indirect_array int_type ios ios_base iostream istream istringstream istrstream iterator_category iterator_traits key_compare key_type ldiv_t list lldiv_t map mapped_type mask_array mbstate_t mem_fun1_t mem_fun_ref1_t mem_fun_ref_t mem_fun_t multimap multiset nothrow_t numeric_limits off_type ofstream ostream ostringstream ostrstream pair pointer pointer_to_binary_function pointer_to_unary_function pos_type priority_queue queue reference second_type seekdir sequence_buffer set size_type slice_array stack state_type stream streambuf streamoff streampos streamsize string stringbuf stringstream strstream strstreambuf temporary_buffer test_type tm traits_type type_info u16string u32string unary_compose unary_negate valarray value_compare value_type vector wfilebuf wfstream wifstream wios wiostream wistream wistringstream wofstream wostream wostringstream wstreambuf wstreampos wstring wstringbuf wstringstream codecvt codecvt_base codecvt_byname collate collate_byname ctype ctype_base ctype_byname locale messages messages_base messages_byname money_base money_get money_put moneypunct moneypunct_byname num_get num_put numpunct numpunct_byname time_base time_get time_get_byname time_put time_put_byname binary_function binary_negate bit_and bit_not bit_or divides equal_to greater greater_equal less less_equal logical_and logical_not logical_or minus modulus multiplies negate not_equal_to plus unary_function unary_negate bidirectional_iterator_tag forward_iterator_tag input_iterator_tag output_iterator_tag random_access_iterator_tag + +syntax keyword cppSTLtypedef + \ time_t sig_atomic_t wctrans_t wctype_t wint_t syntax keyword cppSTLiterator \ back_insert_iterator bidirectional_iterator const_iterator const_reverse_iterator forward_iterator front_insert_iterator input_iterator insert_iterator istream_iterator istreambuf_iterator iterator ostream_iterator ostreambuf_iterator output_iterator random_access_iterator raw_storage_iterator reverse_bidirectional_iterator reverse_iterator @@ -58,13 +61,18 @@ if !exists('cpp_no_cpp11') syntax keyword cppSTLnamespace chrono this_thread syntax keyword cppSTLtype - \ array atomic atomic_bool atomic_char atomic_char16_t atomic_char32_t atomic_flag atomic_int 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_llong atomic_long atomic_ptrdiff_t atomic_schar atomic_short atomic_size_t atomic_uchar atomic_uint 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_ullong atomic_ulong atomic_ushort atomic_wchar_t duration duration_values high_resolution_clock hours microseconds milliseconds minutes nanoseconds seconds steady_clock system_clock time_point treat_as_floating_point condition_variable nullptr_t max_align_t 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_arg_t 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 adopt_lock_t condition_variable_any defer_lock_t lock_guard mutex once_flag recursive_mutex recursive_timed_mutex timed_mutex try_to_lock_t 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 piecewise_construct_t 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 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 cppSTLconstant - \ _1 _2 _3 _4 _5 _6 _7 _8 _9 max_digits10 allocator_arg defer_lock try_to_lock adopt_lock math_errhandling + 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 - syntax keyword cppSTLconstant - \ FLT_EVAL_METHOD FP_INFINITE FP_NAN FP_NORMAL FP_SUBNORMAL FP_ZERO HUGE_VALF HUGE_VALL INFINITY MATH_ERREXCEPT MATH_ERRNO NAN + syntax keyword cppSTLconstant max_digits10 + + syntax keyword cppSTLvariable + \ _1 _2 _3 _4 _5 _6 _7 _8 _9 defer_lock try_to_lock adopt_lock allocator_arg + + syntax keyword cppSTLdefine + \ math_errhandling FLT_EVAL_METHOD FP_INFINITE FP_NAN FP_NORMAL FP_SUBNORMAL FP_ZERO HUGE_VALF HUGE_VALL INFINITY MATH_ERREXCEPT MATH_ERRNO NAN syntax keyword cppSTLenum \ memory_order future_status future_errc launch io_errc cv_status errc @@ -79,8 +87,8 @@ if !exists('cpp_no_cpp11') syntax keyword cppSTLiterator \ move_iterator regex_iterator regex_token_iterator const_local_iterator local_iterator - " Note: ignore is also a function (could also be put under cppSTLvariable) - syntax match cppSTLconstant "\<ignore\>(\@!" + " Note: ignore is also a function + syntax match cppSTLvariable "\<ignore\>(\@!" endif @@ -91,7 +99,10 @@ if !exists('cpp_no_cpp14') syntax keyword cppSTLfunction make_unique syntax keyword cppSTLtype - \ index_sequence index_sequence_for integer_sequence make_index_sequence make_integer_sequence shared_lock shared_timed_mutex tuple_element_t add_const_t add_cv_t add_lvalue_reference_t add_pointer_t add_rvalue_reference_t add_volatile_t aligned_storage_t aligned_union_t common_type_t conditional_t decay_t enable_if_t is_null_pointer make_signed_t make_unsigned_t remove_all_extents_t remove_const_t remove_cv_t remove_extent_t remove_pointer_t remove_reference_t remove_volatile_t result_of_t underlying_type_t + \ index_sequence index_sequence_for integer_sequence make_index_sequence make_integer_sequence shared_lock shared_timed_mutex is_null_pointer + + syntax keyword cppSTLtypedef + \ tuple_element_t add_const_t add_cv_t add_lvalue_reference_t add_pointer_t add_rvalue_reference_t add_volatile_t aligned_storage_t aligned_union_t common_type_t conditional_t decay_t enable_if_t make_signed_t make_unsigned_t remove_all_extents_t remove_const_t remove_cv_t remove_extent_t remove_pointer_t remove_reference_t remove_volatile_t result_of_t underlying_type_t endif @@ -100,7 +111,10 @@ if !exists('cpp_no_cpp17') syntax keyword cppSTLnamespace filesystem execution syntax keyword cppSTLtype - \ any 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_order_t 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 nullopt_t shared_mutex basic_string_view string_view u16string_view u32string_view wstring_view bool_constant conjunction disjunction has_unique_object_representations invoke_result invoke_result_t 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 void_t node_type insert_return_type in_place_tag in_place_t in_place_type_t in_place_index_t monostate variant variant_size variant_alternative variant_alternative_t + \ any 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 + + 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 syntax keyword cppSTLexception \ bad_any_cast filesystem_error bad_optional_access bad_variant_access @@ -120,12 +134,12 @@ if !exists('cpp_no_cpp17') " Note: There is std::filesystem::path::format and std::format() in <format> syntax match cppSTLenum "\<format\>(\@!" + " Note: these can be both member objects and methods + syntax match cppSTLvariable "\<\%(capacity\|free\|available\)\>(\@!" + " Note: these keywords are very likely to coincide with user-defined variables " syntax keyword cppSTLconstant " \ all mask unknown replace add remove nofollow none not_found regular directory symlink block character fifo socket unknown - - " Note: these are also functions - " syntax keyword cppSTLconstant capacity free available endif @@ -136,7 +150,10 @@ if !exists('cpp_no_cpp20') syntax keyword cppSTLvariable default_sentinel unreachable_sentinel syntax keyword cppSTLtype - \ atomic_ref endian weak_ordering strong_ordering partial_ordering weak_equality strong_equality common_comparison_category common_comparison_category_t contract_violation coroutine_traits coroutine_handle noop_coroutine_handle noop_coroutine_promise suspend_never suspend_always remove_cvref remove_cvref_t is_bounded_array is_layout_compatible is_unbounded_array is_nothrow_convertible has_strong_structural_equality is_pointer_interconvertible_base_of unwrap_reference unwrap_reference_t unwrap_ref_decay unwrap_ref_decay_t basic_common_reference common_reference common_reference_t iterator_t sentinel_t dangling safe_iterator_t safe_subrange_t 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 compare_three_way_result_t contiguous_iterator_tag incrementable_traits iter_value_t iter_reference_t iter_difference_t iter_rvalue_reference_t iter_common_reference_t indirectly_readable_traits move_sentinel default_sentinel_t unreachable_sentinel_t common_iterator counted_iterator indirect_result_t projected type_identity type_identity_t + \ 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 + + 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 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 @@ -161,11 +178,13 @@ endif hi def link cppSTLbool Boolean hi def link cppStatement Statement hi def link cppSTLfunction Function +hi def link cppSTLdefine Constant hi def link cppSTLconstant Constant hi def link cppSTLnamespace Constant -hi def link cppSTLtype Type hi def link cppSTLexception Type -hi def link cppSTLiterator Typedef +hi def link cppSTLiterator Type +hi def link cppSTLtype Type +hi def link cppSTLtypedef Typedef hi def link cppSTLenum Typedef hi def link cppSTLios Function hi def link cppSTLconcept Typedef diff --git a/after/syntax/javascript/graphql.vim b/after/syntax/javascript/graphql.vim index f085a301..22557862 100644 --- a/after/syntax/javascript/graphql.vim +++ b/after/syntax/javascript/graphql.vim @@ -36,7 +36,7 @@ let s:tags = '\%(' . join(graphql#javascript_tags(), '\|') . '\)' if graphql#has_syntax_group('jsTemplateExpression') " pangloss/vim-javascript - exec 'syntax region graphqlTemplateString start=+' . s:tags . '\@20<=`+ skip=+\\\\\|\\`+ end=+`+ contains=@GraphQLSyntax,jsTemplateExpression,jsSpecial extend' + exec 'syntax region graphqlTemplateString matchgroup=jsTemplateString start=+' . s:tags . '\@20<=`+ skip=+\\\\\|\\`+ end=+`+ contains=@GraphQLSyntax,jsTemplateExpression,jsSpecial extend' exec 'syntax match graphqlTaggedTemplate +' . s:tags . '\ze`+ nextgroup=graphqlTemplateString' syntax region graphqlTemplateExpression start=+${+ end=+}+ contained contains=jsTemplateExpression containedin=graphqlFold keepend @@ -48,7 +48,7 @@ if graphql#has_syntax_group('jsTemplateExpression') syn cluster graphqlTaggedTemplate add=graphqlTemplateString elseif graphql#has_syntax_group('javaScriptStringT') " runtime/syntax/javascript.vim - exec 'syntax region graphqlTemplateString start=+' . s:tags . '\@20<=`+ skip=+\\\\\|\\`+ end=+`+ contains=@GraphQLSyntax,javaScriptSpecial,javaScriptEmbed,@htmlPreproc extend' + exec 'syntax region graphqlTemplateString matchgroup=javaScriptStringT start=+' . s:tags . '\@20<=`+ skip=+\\\\\|\\`+ end=+`+ contains=@GraphQLSyntax,javaScriptSpecial,javaScriptEmbed,@htmlPreproc extend' exec 'syntax match graphqlTaggedTemplate +' . s:tags . '\ze`+ nextgroup=graphqlTemplateString' syntax region graphqlTemplateExpression start=+${+ end=+}+ contained contains=@javaScriptEmbededExpr containedin=graphqlFold keepend diff --git a/after/syntax/typescript/graphql.vim b/after/syntax/typescript/graphql.vim index 30075e6d..5dd01e28 100644 --- a/after/syntax/typescript/graphql.vim +++ b/after/syntax/typescript/graphql.vim @@ -34,7 +34,7 @@ endif let s:tags = '\%(' . join(graphql#javascript_tags(), '\|') . '\)' -exec 'syntax region graphqlTemplateString start=+' . s:tags . '\@20<=`+ skip=+\\`+ end=+`+ contains=@GraphQLSyntax,typescriptTemplateSubstitution extend' +exec 'syntax region graphqlTemplateString matchgroup=typescriptTemplate start=+' . s:tags . '\@20<=`+ skip=+\\`+ end=+`+ contains=@GraphQLSyntax,typescriptTemplateSubstitution extend' exec 'syntax match graphqlTaggedTemplate +' . s:tags . '\ze`+ nextgroup=graphqlTemplateString' " Support expression interpolation ((${...})) inside template strings. diff --git a/doc/pgsql.txt b/doc/pgsql.txt index 7ccd03d0..2d2de6ed 100644 --- a/doc/pgsql.txt +++ b/doc/pgsql.txt @@ -53,6 +53,8 @@ Text enclosed between `$anyword$` pairs, where `anyword` is any non-empty sequence of word characters different from those with a special meaning (such as `$pgsql$`) is treated as a multi-line string. +When |foldmethod| is set to "syntax", SQL commands can be folded. + Finally, the plugin supports syntax highlighting of arbitrary languages within procedure and function blocks. This feature needs to be configured: see |g:pgsql_pl|. diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index d4a5fe55..1e079217 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -162,8 +162,8 @@ if !has_key(s:disabled_packages, 'trasys') endif if !has_key(s:disabled_packages, 'zig') - au BufNewFile,BufRead *.zig,*.zir setf zig au BufNewFile,BufRead *.zir setf zir + au BufNewFile,BufRead *.zig,*.zir setf zig endif if !has_key(s:disabled_packages, 'zephir') @@ -225,13 +225,13 @@ if !has_key(s:disabled_packages, 'unison') endif if !has_key(s:disabled_packages, 'typescript') - au BufNewFile,BufRead *.tsx setf typescriptreact au BufNewFile,BufRead *.ts setf typescript + au BufNewFile,BufRead *.tsx setf typescriptreact endif if !has_key(s:disabled_packages, 'twig') - au BufNewFile,BufRead *.xml.twig setf xml.twig au BufNewFile,BufRead *.twig setf html.twig + au BufNewFile,BufRead *.xml.twig setf xml.twig endif if !has_key(s:disabled_packages, 'tptp') @@ -271,9 +271,6 @@ if !has_key(s:disabled_packages, 'swift') au BufNewFile,BufRead *.swift setf swift endif -if !has_key(s:disabled_packages, 'svg-indent') -endif - if !has_key(s:disabled_packages, 'svg') au BufNewFile,BufRead *.svg setf svg endif @@ -302,15 +299,12 @@ if !has_key(s:disabled_packages, 'slim') au BufNewFile,BufRead *.slim setf slim endif -if !has_key(s:disabled_packages, 'zinit') -endif - if !has_key(s:disabled_packages, 'sh') + au BufNewFile,BufRead *.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh,*.sh.in,*.tmux,*.tool,*/etc/udev/cdsymlinks.conf,{.,}bash_aliases,{.,}bash_history,{.,}bash_logout,{.,}bash_profile,{.,}bashrc,{.,}cshrc,{.,}env,{.,}env.example,{.,}flaskenv,{.,}login,{.,}profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,login,man,profile,zlogin,zlogout,zprofile,zshenv,zshrc setf sh au BufNewFile,BufRead *.zsh,{.,}zfbfmarks,{.,}zlogin,{.,}zlogout,{.,}zprofile,{.,}zshenv,{.,}zshrc setf zsh au BufNewFile,BufRead {.,}zsh* call s:StarSetf('zsh') au BufNewFile,BufRead {.,}zlog* call s:StarSetf('zsh') au BufNewFile,BufRead {.,}zcompdump* call s:StarSetf('zsh') - au BufNewFile,BufRead *.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh,*.sh.in,*.tmux,*.tool,*/etc/udev/cdsymlinks.conf,{.,}bash_aliases,{.,}bash_history,{.,}bash_logout,{.,}bash_profile,{.,}bashrc,{.,}cshrc,{.,}env,{.,}env.example,{.,}flaskenv,{.,}login,{.,}profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,login,man,profile,zlogin,zlogout,zprofile,zshenv,zshrc setf sh endif if !has_key(s:disabled_packages, 'scss') @@ -333,17 +327,14 @@ if !has_key(s:disabled_packages, 'brewfile') au BufNewFile,BufRead Brewfile setf brewfile endif -if !has_key(s:disabled_packages, 'yard') -endif - if !has_key(s:disabled_packages, 'rspec') au BufNewFile,BufRead *_spec.rb set ft=ruby syntax=rspec endif if !has_key(s:disabled_packages, 'ruby') - au BufNewFile,BufRead *.erb,*.erb.deface,*.rhtml setf eruby au BufNewFile,BufRead *.axlsx,*.builder,*.cap,*.eye,*.fcgi,*.gemspec,*.god,*.jbuilder,*.mspec,*.opal,*.pluginspec,*.podspec,*.rabl,*.rake,*.rant,*.rb,*.rbi,*.rbuild,*.rbw,*.rbx,*.rjs,*.ru,*.ruby,*.rxml,*.spec,*.thor,*.watchr,{.,}Brewfile,{.,}Guardfile,{.,}autotest,{.,}irbrc,{.,}pryrc,{.,}simplecov,Appraisals,Berksfile,Buildfile,Capfile,Cheffile,Dangerfile,Deliverfile,Fastfile,Gemfile,Gemfile.lock,Guardfile,Jarfile,KitchenSink,Mavenfile,Podfile,Puppetfile,Rakefile,Rantfile,Routefile,Snapfile,Thorfile,Vagrantfile,buildfile,vagrantfile setf ruby au BufNewFile,BufRead [Rr]akefile* call s:StarSetf('ruby') + au BufNewFile,BufRead *.erb,*.erb.deface,*.rhtml setf eruby endif if !has_key(s:disabled_packages, 'rst') @@ -379,8 +370,8 @@ if !has_key(s:disabled_packages, 'racket') endif if !has_key(s:disabled_packages, 'r-lang') - au BufNewFile,BufRead *.rd setf rhelp au BufNewFile,BufRead *.S,*.r,*.rsx,*.s,{.,}Rprofile,expr-dist setf r + au BufNewFile,BufRead *.rd setf rhelp endif if !has_key(s:disabled_packages, 'qml') @@ -395,12 +386,6 @@ if !has_key(s:disabled_packages, 'requirements') au BufNewFile,BufRead *.pip,*require.{txt,in},*requirements.{txt,in},constraints.{txt,in} setf requirements endif -if !has_key(s:disabled_packages, 'python-compiler') -endif - -if !has_key(s:disabled_packages, 'python-indent') -endif - if !has_key(s:disabled_packages, 'python') au BufNewFile,BufRead *.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.ptl,*.py,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.smk,*.spec,*.tac,*.wsgi,*.xpy,{.,}gclient,{.,}pythonrc,{.,}pythonstartup,DEPS,SConscript,SConstruct,Snakefile,wscript setf python endif @@ -410,8 +395,8 @@ if !has_key(s:disabled_packages, 'purescript') endif if !has_key(s:disabled_packages, 'puppet') - au BufNewFile,BufRead *.epp setf embeddedpuppet au BufNewFile,BufRead *.pp,Modulefile setf puppet + au BufNewFile,BufRead *.epp setf embeddedpuppet endif if !has_key(s:disabled_packages, 'pug') @@ -423,8 +408,8 @@ if !has_key(s:disabled_packages, 'protobuf') endif if !has_key(s:disabled_packages, 'powershell') - au BufNewFile,BufRead *.ps1xml setf ps1xml au BufNewFile,BufRead *.ps1,*.psd1,*.psm1,*.pssc setf ps1 + au BufNewFile,BufRead *.ps1xml setf ps1xml endif if !has_key(s:disabled_packages, 'pony') @@ -452,14 +437,15 @@ if !has_key(s:disabled_packages, 'pgsql') endif if !has_key(s:disabled_packages, 'perl') - au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2() au! BufNewFile,BufRead,BufWritePost *.t call polyglot#detect#T() au! BufNewFile,BufRead,BufWritePost *.pm call polyglot#detect#Pm() au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl() - au BufNewFile,BufRead *.xs setf xs - au BufNewFile,BufRead *.comp,*.mason,*.mhtml setf mason - au BufNewFile,BufRead *.pod setf pod au BufNewFile,BufRead *.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.psgi,{.,}gitolite.rc,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc setf perl + au BufNewFile,BufRead *.pod setf pod + au BufNewFile,BufRead *.comp,*.mason,*.mhtml setf mason + au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2() + au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2() + au BufNewFile,BufRead *.xs setf xs endif if !has_key(s:disabled_packages, 'opencl') @@ -472,15 +458,15 @@ if !has_key(s:disabled_packages, 'octave') endif if !has_key(s:disabled_packages, 'ocaml') - au BufNewFile,BufRead *.sexp setf sexplib - au BufNewFile,BufRead *.root setf ocpbuildroot - au BufNewFile,BufRead *.ocp setf ocpbuild - au BufNewFile,BufRead _tags setf ocamlbuild_tags - au BufNewFile,BufRead dune,dune-project,dune-workspace,jbuild setf dune - au BufNewFile,BufRead _oasis setf oasis - au BufNewFile,BufRead *.opam,*.opam.template,opam setf opam - au BufNewFile,BufRead *.om,OMakefile,OMakeroot,OMakeroot.in setf omake au BufNewFile,BufRead *.eliom,*.eliomi,*.ml,*.ml.cppo,*.ml4,*.mli,*.mli.cppo,*.mlip,*.mll,*.mlp,*.mlt,*.mly,{.,}ocamlinit setf ocaml + au BufNewFile,BufRead *.om,OMakefile,OMakeroot,OMakeroot.in setf omake + au BufNewFile,BufRead *.opam,*.opam.template,opam setf opam + au BufNewFile,BufRead _oasis setf oasis + au BufNewFile,BufRead dune,dune-project,dune-workspace,jbuild setf dune + au BufNewFile,BufRead _tags setf ocamlbuild_tags + au BufNewFile,BufRead *.ocp setf ocpbuild + au BufNewFile,BufRead *.root setf ocpbuildroot + au BufNewFile,BufRead *.sexp setf sexplib endif if !has_key(s:disabled_packages, 'objc') @@ -511,8 +497,8 @@ if !has_key(s:disabled_packages, 'moonscript') endif if !has_key(s:disabled_packages, 'meson') - au BufNewFile,BufRead *.wrap setf dosini au BufNewFile,BufRead meson.build,meson_options.txt setf meson + au BufNewFile,BufRead *.wrap setf dosini endif if !has_key(s:disabled_packages, 'mdx') @@ -549,8 +535,8 @@ if !has_key(s:disabled_packages, 'log') endif if !has_key(s:disabled_packages, 'llvm') - au BufNewFile,BufRead *.td setf tablegen au BufNewFile,BufRead *.ll setf llvm + au BufNewFile,BufRead *.td setf tablegen endif if !has_key(s:disabled_packages, 'livescript') @@ -607,17 +593,14 @@ if !has_key(s:disabled_packages, 'jenkins') au BufNewFile,BufRead Jenkinsfile* call s:StarSetf('Jenkinsfile') endif -if !has_key(s:disabled_packages, 'javascript-sql') -endif - if !has_key(s:disabled_packages, 'ion') au BufNewFile,BufRead *.ion,~/.config/ion/initrc setf ion endif if !has_key(s:disabled_packages, 'idris2') - au! BufNewFile,BufRead,BufWritePost *.lidr call polyglot#detect#Lidr() au! BufNewFile,BufRead,BufWritePost *.idr call polyglot#detect#Idr() au BufNewFile,BufRead *.ipkg,idris-response setf idris2 + au! BufNewFile,BufRead,BufWritePost *.lidr call polyglot#detect#Lidr() endif if !has_key(s:disabled_packages, 'idris') @@ -656,8 +639,8 @@ if !has_key(s:disabled_packages, 'haskell') endif if !has_key(s:disabled_packages, 'handlebars') - au BufNewFile,BufRead *.handlebars,*.hb,*.hbs,*.hdbs setf html.handlebars au BufNewFile,BufRead *.hjs,*.hogan,*.hulk,*.mustache setf html.mustache + au BufNewFile,BufRead *.handlebars,*.hb,*.hbs,*.hdbs setf html.handlebars endif if !has_key(s:disabled_packages, 'haml') @@ -668,9 +651,6 @@ if !has_key(s:disabled_packages, 'grub') au BufNewFile,BufRead */boot/grub/grub.conf,*/boot/grub/menu.lst,*/etc/grub.conf setf grub endif -if !has_key(s:disabled_packages, 'gradle') -endif - if !has_key(s:disabled_packages, 'groovy') au BufNewFile,BufRead *.gradle,*.groovy,*.grt,*.gtpl,*.gvy,Jenkinsfile setf groovy endif @@ -684,14 +664,14 @@ if !has_key(s:disabled_packages, 'jsx') endif if !has_key(s:disabled_packages, 'javascript') - au BufNewFile,BufRead *.flow setf flow au BufNewFile,BufRead *._js,*.bones,*.cjs,*.es,*.es6,*.frag,*.gs,*.jake,*.javascript,*.js,*.jsb,*.jscad,*.jsfl,*.jsm,*.jss,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib,Jakefile setf javascript + au BufNewFile,BufRead *.flow setf flow endif if !has_key(s:disabled_packages, 'go') - au BufNewFile,BufRead *.tmpl setf gohtmltmpl - au BufNewFile,BufRead go.mod setf gomod au BufNewFile,BufRead *.go setf go + au BufNewFile,BufRead go.mod setf gomod + au BufNewFile,BufRead *.tmpl setf gohtmltmpl endif if !has_key(s:disabled_packages, 'gnuplot') @@ -708,11 +688,11 @@ if !has_key(s:disabled_packages, 'glsl') endif if !has_key(s:disabled_packages, 'git') - au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit - au BufNewFile,BufRead {.,}gitsendemail.* call s:StarSetf('gitsendemail') - au BufNewFile,BufRead git-rebase-todo setf gitrebase au BufNewFile,BufRead *.gitconfig,*.git/config,*.git/modules/*/config,*/.config/git/config,*/git/config,{.,}gitconfig,{.,}gitmodules setf gitconfig au BufNewFile,BufRead */{.,}gitconfig.d/* call s:StarSetf('gitconfig') + au BufNewFile,BufRead git-rebase-todo setf gitrebase + au BufNewFile,BufRead {.,}gitsendemail.* call s:StarSetf('gitsendemail') + au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit endif if !has_key(s:disabled_packages, 'gdscript') @@ -762,14 +742,14 @@ if !has_key(s:disabled_packages, 'elm') endif if !has_key(s:disabled_packages, 'elixir') - au BufNewFile,BufRead *.eex,*.leex setf eelixir au BufNewFile,BufRead *.ex,*.exs,mix.lock setf elixir + au BufNewFile,BufRead *.eex,*.leex setf eelixir endif if !has_key(s:disabled_packages, 'dockerfile') - au BufNewFile,BufRead docker-compose*.yaml,docker-compose*.yml setf yaml.docker-compose au BufNewFile,BufRead *.Dockerfile,*.dock,*.dockerfile,Dockerfile,dockerfile setf Dockerfile au BufNewFile,BufRead Dockerfile* call s:StarSetf('Dockerfile') + au BufNewFile,BufRead docker-compose*.yaml,docker-compose*.yml setf yaml.docker-compose endif if !has_key(s:disabled_packages, 'yaml') @@ -777,11 +757,11 @@ if !has_key(s:disabled_packages, 'yaml') endif if !has_key(s:disabled_packages, 'dlang') - au BufNewFile,BufRead *.sdl setf dsdl - au BufNewFile,BufRead *.ddoc setf ddoc - au BufNewFile,BufRead *.dd setf dd - au BufNewFile,BufRead *.lst setf dcov au BufNewFile,BufRead *.d,*.di setf d + au BufNewFile,BufRead *.lst setf dcov + au BufNewFile,BufRead *.dd setf dd + au BufNewFile,BufRead *.ddoc setf ddoc + au BufNewFile,BufRead *.sdl setf dsdl endif if !has_key(s:disabled_packages, 'dhall') @@ -801,20 +781,17 @@ if !has_key(s:disabled_packages, 'cucumber') endif if !has_key(s:disabled_packages, 'crystal') - au BufNewFile,BufRead *.ecr setf ecrystal au BufNewFile,BufRead *.cr,Projectfile setf crystal + au BufNewFile,BufRead *.ecr setf ecrystal endif if !has_key(s:disabled_packages, 'cryptol') au BufNewFile,BufRead *.cry,*.cyl,*.lcry,*.lcyl setf cryptol endif -if !has_key(s:disabled_packages, 'cjsx') -endif - if !has_key(s:disabled_packages, 'coffee-script') - au BufNewFile,BufRead *.coffee.md,*.litcoffee setf litcoffee au BufNewFile,BufRead *._coffee,*.cake,*.cjsx,*.coffee,*.coffeekup,*.iced,Cakefile setf coffee + au BufNewFile,BufRead *.coffee.md,*.litcoffee setf litcoffee endif if !has_key(s:disabled_packages, 'cmake') @@ -829,9 +806,6 @@ if !has_key(s:disabled_packages, 'carp') au BufNewFile,BufRead *.carp setf carp endif -if !has_key(s:disabled_packages, 'cpp-modern') -endif - if !has_key(s:disabled_packages, 'caddyfile') au BufNewFile,BufRead Caddyfile setf caddyfile endif @@ -891,8 +865,9 @@ endif if !has_key(s:disabled_packages, 'c/c++') au! BufNewFile,BufRead,BufWritePost *.h call polyglot#detect#H() - au BufNewFile,BufRead *.c,*.cats,*.idc,*.qc,*enlightenment/*.cfg setf c au BufNewFile,BufRead *.c++,*.cc,*.cp,*.cpp,*.cxx,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.moc,*.tcc,*.tlh,*.tpp setf cpp + au! BufNewFile,BufRead,BufWritePost *.h call polyglot#detect#H() + au BufNewFile,BufRead *.c,*.cats,*.idc,*.qc,*enlightenment/*.cfg setf c endif if !has_key(s:disabled_packages, 'arch') @@ -939,6 +914,7 @@ if !has_key(s:disabled_packages, 'csv') endif if !has_key(s:disabled_packages, 'ampl') + " AMPL au BufNewFile,BufRead *.run setf ampl endif @@ -951,14 +927,17 @@ if !has_key(s:disabled_packages, 'alsaconf') endif if !has_key(s:disabled_packages, 'aidl') + " AIDL au BufNewFile,BufRead *.aidl setf aidl endif if !has_key(s:disabled_packages, 'ahdl') + " AHDL au BufNewFile,BufRead *.tdf setf ahdl endif if !has_key(s:disabled_packages, 'ada') + " Ada (83, 9X, 95) au BufNewFile,BufRead *.ada,*.ada_m,*.adb,*.adc,*.ads,*.gpr setf ada endif @@ -967,14 +946,17 @@ if !has_key(s:disabled_packages, 'acpiasl') endif if !has_key(s:disabled_packages, 'acedb') + " AceDB au BufNewFile,BufRead *.wrm setf acedb endif if !has_key(s:disabled_packages, 'abel') + " ABEL au BufNewFile,BufRead *.abl setf abel endif if !has_key(s:disabled_packages, 'abc') + " ABC music notation au BufNewFile,BufRead *.abc setf abc endif @@ -983,14 +965,17 @@ if !has_key(s:disabled_packages, 'abaqus') endif if !has_key(s:disabled_packages, 'abap') + " ABAB/4 au BufNewFile,BufRead *.abap setf abap endif if !has_key(s:disabled_packages, 'aap') + " A-A-P recipe au BufNewFile,BufRead *.aap setf aap endif if !has_key(s:disabled_packages, 'a65') + " XA65 MOS6510 cross assembler au BufNewFile,BufRead *.a65 setf a65 endif @@ -1008,6 +993,7 @@ if !has_key(s:disabled_packages, 'conf') endif if !has_key(s:disabled_packages, '8th') + " 8th (Firth-derivative) au BufNewFile,BufRead *.8th setf 8th endif @@ -1253,41 +1239,9 @@ au BufNewFile,BufRead $VIMRUNTIME/doc/*.txt setf help " Abaqus or Trasys au BufNewFile,BufRead *.inp call polyglot#ft#Check_inp() -" 8th (Firth-derivative) -au BufNewFile,BufRead *.8th setf 8th - -" A-A-P recipe -au BufNewFile,BufRead *.aap setf aap - " A2ps printing utility au BufNewFile,BufRead */etc/a2ps.cfg,*/etc/a2ps/*.cfg,a2psrc,.a2psrc setf a2ps -" ABAB/4 -au BufNewFile,BufRead *.abap setf abap - -" ABC music notation -au BufNewFile,BufRead *.abc setf abc - -" ABEL -au BufNewFile,BufRead *.abl setf abel - -" AceDB -au BufNewFile,BufRead *.wrm setf acedb - -" Ada (83, 9X, 95) -au BufNewFile,BufRead *.adb,*.ads,*.ada setf ada -if has("vms") - au BufNewFile,BufRead *.gpr,*.ada_m,*.adc setf ada -else - au BufNewFile,BufRead *.gpr setf ada -endif - -" AHDL -au BufNewFile,BufRead *.tdf setf ahdl - -" AIDL -au BufNewFile,BufRead *.aidl setf aidl - " AMPL au BufNewFile,BufRead *.run setf ampl diff --git a/indent/graphql.vim b/indent/graphql.vim index 3a910928..12204f5f 100644 --- a/indent/graphql.vim +++ b/indent/graphql.vim @@ -62,6 +62,13 @@ function GetGraphQLIndent() return 0 endif + " If the previous line isn't GraphQL, don't change this line's indentation. + " Assume we've been manually indented as part of a template string. + let l:stack = map(synstack(l:prevlnum, 1), "synIDattr(v:val, 'name')") + if get(l:stack, -1) !~# '^graphql' + return -1 + endif + let l:line = getline(v:lnum) " If this line contains just a closing bracket, find its matching opening diff --git a/packages.yaml b/packages.yaml index 4d4365d3..2baddea2 100644 --- a/packages.yaml +++ b/packages.yaml @@ -4,6 +4,7 @@ remote: vim/vim:runtime glob: '**/8th.vim' filetypes: - name: 8th + description: 8th (Firth-derivative) extensions: - 8th --- @@ -23,6 +24,7 @@ remote: vim/vim:runtime glob: '**/a65.vim' filetypes: - name: a65 + description: XA65 MOS6510 cross assembler extensions: - a65 --- @@ -31,6 +33,7 @@ remote: vim/vim:runtime glob: '**/aap.vim' filetypes: - name: aap + description: A-A-P recipe extensions: - aap --- @@ -39,6 +42,7 @@ remote: vim/vim:runtime glob: '**/abap.vim' filetypes: - name: abap + description: ABAB/4 extensions: - abap --- @@ -55,6 +59,7 @@ remote: vim/vim:runtime glob: '**/abc.vim' filetypes: - name: abc + description: ABC music notation extensions: - abc --- @@ -63,6 +68,7 @@ remote: vim/vim:runtime glob: '**/abel.vim' filetypes: - name: abel + description: ABEL extensions: - abl --- @@ -71,6 +77,7 @@ remote: vim/vim:runtime glob: '**/acedb.vim' filetypes: - name: acedb + description: AceDB extensions: - wrm --- @@ -87,6 +94,7 @@ remote: vim/vim:runtime glob: '**/ada.vim' filetypes: - name: ada + description: Ada (83, 9X, 95) extensions: - adb - ads @@ -100,6 +108,7 @@ remote: vim/vim:runtime glob: '**/ahdl.vim' filetypes: - name: ahdl + description: AHDL extensions: - tdf --- @@ -108,6 +117,7 @@ remote: vim/vim:runtime glob: '**/aidl.vim' filetypes: - name: aidl + description: AIDL extensions: - aidl --- @@ -134,6 +144,7 @@ remote: vim/vim:runtime glob: '**/ampl.vim' filetypes: - name: ampl + description: AMPL extensions: - run --- diff --git a/scripts/build b/scripts/build index fe07db70..948da115 100755 --- a/scripts/build +++ b/scripts/build @@ -43,6 +43,18 @@ def verify(packages, heuristics) puts "No heuristics for .#{e} extension (#{names.join(", ")})" end end + + extensions = packages.flat_map { |e| e["filetypes"] || [] } + .flat_map { |e| e["extensions"].map { |e| "*." + e } } + native_filetypes = detect_filetypes_str( + File.read('ftdetect/polyglot.vim').match(/" DO NOT EDIT CODE ABOVE.*/m)[0] + ).flat_map { |e| expand_all(e) } + + for e in (native_filetypes & extensions) + if ENV["DEV"] + puts "Duplicated handling for #{e}" + end + end end def sort_packages(packages) @@ -506,10 +518,12 @@ def generate_ftdetect(packages, heuristics) for package in packages.reverse filetypes = package["filetypes"] or raise "Unknown filetype for: #{package["name"]}" - package_heuristics = [] + package_autocommands = [] - autocommands = [] for filetype in filetypes + autocommands = [] + filetype_heuristics = [] + name = filetype.fetch("name") syntax = filetype["syntax"] ? " | set syntax=#{filetype["syntax"]}" : "" @@ -531,13 +545,13 @@ def generate_ftdetect(packages, heuristics) for extension in extensions.sort outer_filetype = filetype["outer_filetype"] if outer_filetype - autocommands << " au BufNewFile *.*.#{extension} execute \"do BufNewFile filetypedetect \" . expand(\"<afile>:r\") | #{outer_filetype}\n" - autocommands << " au BufReadPre *.*.#{extension} execute \"do BufRead filetypedetect \" . expand(\"<afile>:r\") | #{outer_filetype}\n" + autocommands << "au BufNewFile *.*.#{extension} execute \"do BufNewFile filetypedetect \" . expand(\"<afile>:r\") | #{outer_filetype}" + autocommands << "au BufReadPre *.*.#{extension} execute \"do BufRead filetypedetect \" . expand(\"<afile>:r\") | #{outer_filetype}" end heuristic = heuristics.find { |h| h["extensions"].include?(extension) } if heuristic - package_heuristics << heuristic + filetype_heuristics << heuristic else set_globs << "*." + extension end @@ -548,28 +562,34 @@ def generate_ftdetect(packages, heuristics) filename = "{.,}" + filename[1..-1] end if filename[-1] == "*" - autocommands << " au BufNewFile,BufRead #{filename} call s:StarSetf('#{name}')\n" + autocommands << "au BufNewFile,BufRead #{filename} call s:StarSetf('#{name}')" else set_globs << filename end end if set_globs.size > 0 - autocommands << " au BufNewFile,BufRead #{set_globs.join(",")} #{set_command}\n" + autocommands << "au BufNewFile,BufRead #{set_globs.join(",")} #{set_command}" end - end + for heuristic in filetype_heuristics.uniq + extensions = heuristic["extensions"].map { |e| "*.#{e}" } + autocommands << "au! BufNewFile,BufRead,BufWritePost #{extensions.join(",")} call polyglot#detect##{camelize(heuristic["extensions"].first)}()" + end - for heuristic in package_heuristics.uniq - extensions = heuristic["extensions"].map { |e| "*.#{e}" } - autocommands << " au! BufNewFile,BufRead,BufWritePost #{extensions.join(",")} call polyglot#detect##{camelize(heuristic["extensions"].first)}()\n" + if autocommands.size > 0 && filetype["description"] + autocommands << '" ' + filetype["description"] + end + + package_autocommands << autocommands end - if autocommands != "" + if package_autocommands.flatten.size > 0 output << "if !has_key(s:disabled_packages, '#{package["name"]}')\n" - output << autocommands.reverse.join("") - output << "endif\n\n" + output << indent(package_autocommands.map { |pc| pc.reverse.join("\n") }.join("\n\n"), 2) + output << "\nendif\n\n" end + end show_warnings(all_filetypes, expected_filetypes) @@ -701,21 +721,23 @@ def expand_all(pattern, all = false) end end +def detect_filetypes_str(contents) + contents = contents.gsub(/^\s*au(tocmd)?!?\s*$/, '') + results = contents.scan(/^\s*(?:au!|au|au[^g][^ ]*) +(?:\S+)\s+(\S+)[\s\\]+([^\n]+)/) + results = results.map do |a, b| + [ + a, + b.gsub(/call (?:s:setf|s:StarSetf)\('([^']+)'\)/i, 'setf \1') + .gsub(/set(?:local)?\s+(?:ft|filetype)=(\S+)/, 'setf \1') + .gsub(/setf\S*/, 'setf') + .gsub(/.*setf\s+(\S+).*/, 'setf \1') + ] + end.select { |a, b| b.match(/setf \S+/) }.map { |a, b| [a, b.split(" ")[1]] } + results +end + def detect_filetypes(glob) - filetypes = Dir[glob].flat_map do |file| - contents = File.read(file).gsub(/^\s*au(tocmd)?!?\s*$/, '') - results = contents.scan(/^\s*(?:au!|au|au[^g][^ ]*) +(?:\S+)\s+(\S+)[\s\\]+([^\n]+)/) - results = results.map do |a, b| - [ - a, - b.gsub(/call (?:s:setf|s:StarSetf)\('([^']+)'\)/i, 'setf \1') - .gsub(/set(?:local)?\s+(?:ft|filetype)=(\S+)/, 'setf \1') - .gsub(/setf\S*/, 'setf') - .gsub(/.*setf\s+(\S+).*/, 'setf \1') - ] - end.select { |a, b| b.match(/setf \S+/) }.map { |a, b| [a, b.split(" ")[1]] } - results - end + filetypes = Dir[glob].flat_map { |file| detect_filetypes_str(File.read(file)) } filetypes.flat_map do |ext, filetype| expand_all(ext).map { |e| [filetype, e] } diff --git a/syntax/pgsql.vim b/syntax/pgsql.vim index 20da69d1..c85b97cb 100644 --- a/syntax/pgsql.vim +++ b/syntax/pgsql.vim @@ -6,8 +6,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pgsql') == -1 " Version: 2.2.2 " License: This file is placed in the public domain. -" Based on PostgreSQL 12.3 -" Automatically generated on 2020-07-31 at 10:47:30 +" Based on PostgreSQL 12.4 +" Automatically generated on 2020-10-03 at 18:36:49 if exists("b:current_syntax") finish @@ -25,12 +25,12 @@ syn keyword sqlSpecial contained false null true " Statements syn keyword sqlStatement contained abort add alter analyze begin checkpoint close cluster comment -syn keyword sqlStatement contained commit constraints copy create deallocate declare delete discard do drop -syn keyword sqlStatement contained end execute explain fetch grant import insert label listen load lock -syn keyword sqlStatement contained move notify prepare prepared reassign refresh reindex release reset -syn keyword sqlStatement contained revoke rollback savepoint security select select set show start -syn keyword sqlStatement contained transaction truncate unlisten update vacuum values work -syn match sqlStatement /\<create\_s\+or\_s\+replace\>/ +syn keyword sqlStatement contained commit constraints copy deallocate declare delete discard do drop end +syn keyword sqlStatement contained execute explain fetch grant import insert label listen load lock move +syn keyword sqlStatement contained notify prepare prepared reassign refresh reindex release reset revoke +syn keyword sqlStatement contained rollback savepoint security select select set show start transaction +syn keyword sqlStatement contained truncate unlisten update vacuum values work +syn match sqlStatement contained /\<create\%(\_s\+or\_s\+replace\)\=\>/ " Types syn keyword sqlType contained aclitem addbandarg addr addr_gid_seq addrfeat addrfeat_gid_seq syn keyword sqlType contained agg_count agg_samealignment anyarray anyelement anyenum @@ -702,7 +702,7 @@ syn keyword sqlConstant contained ltree_plpythonu pldbgapi plpython2u plpython3u if index(get(g:, 'pgsql_disabled_extensions', []), 'refint') == -1 syn keyword sqlFunction contained check_foreign_key check_primary_key endif " refint -" Extension: postgis (v3.0.1) +" Extension: postgis (v3.0.2) if index(get(g:, 'pgsql_disabled_extensions', []), 'postgis') == -1 syn keyword sqlFunction contained addauth addgeometrycolumn box syn keyword sqlFunction contained box2d box2d_in box2d_out box2df_in @@ -988,7 +988,7 @@ endif " adminpack if index(get(g:, 'pgsql_disabled_extensions', []), 'dict_xsyn') == -1 syn keyword sqlFunction contained dxsyn_init dxsyn_lexize endif " dict_xsyn -" Extension: address_standardizer (v3.0.1) +" Extension: address_standardizer (v3.0.2) if index(get(g:, 'pgsql_disabled_extensions', []), 'address_standardizer') == -1 syn keyword sqlFunction contained parse_address standardize_address syn keyword sqlType contained stdaddr @@ -1046,7 +1046,7 @@ if index(get(g:, 'pgsql_disabled_extensions', []), 'cube') == -1 syn keyword sqlType contained cube syn keyword sqlFunction contained g_cube_compress g_cube_decompress endif " cube -" Extension: postgis_tiger_geocoder (v3.0.1) +" Extension: postgis_tiger_geocoder (v3.0.2) if index(get(g:, 'pgsql_disabled_extensions', []), 'postgis_tiger_geocoder') == -1 syn keyword sqlFunction contained count_words create_census_base_tables syn keyword sqlFunction contained cull_null diff_zip @@ -1150,11 +1150,11 @@ endif " pgstattuple if index(get(g:, 'pgsql_disabled_extensions', []), 'autoinc') == -1 syn keyword sqlFunction contained autoinc endif " autoinc -" Extension: address_standardizer_data_us (v3.0.1) +" Extension: address_standardizer_data_us (v3.0.2) if index(get(g:, 'pgsql_disabled_extensions', []), 'address_standardizer_data_us') == -1 syn keyword sqlTable contained us_gaz us_lex us_rules endif " address_standardizer_data_us -" Extension: postgis_topology (v3.0.1) +" Extension: postgis_topology (v3.0.2) if index(get(g:, 'pgsql_disabled_extensions', []), 'postgis_topology') == -1 syn keyword sqlFunction contained addedge addface addnode syn keyword sqlFunction contained addtopogeometrycolumn addtosearchpath asgml @@ -1187,7 +1187,7 @@ if index(get(g:, 'pgsql_disabled_extensions', []), 'postgis_topology') == -1 syn keyword sqlType contained topoelementarray topogeometry syn keyword sqlType contained validatetopology_returntype endif " postgis_topology -" Extension: postgis_raster (v3.0.1) +" Extension: postgis_raster (v3.0.2) if index(get(g:, 'pgsql_disabled_extensions', []), 'postgis_raster') == -1 syn keyword sqlFunction contained addoverviewconstraints addrasterconstraints syn keyword sqlFunction contained box3d bytea dropoverviewconstraints @@ -1534,7 +1534,7 @@ if index(get(g:, 'pgsql_disabled_extensions', []), 'fuzzystrmatch') == -1 syn keyword sqlFunction contained levenshtein levenshtein_less_equal syn keyword sqlFunction contained metaphone soundex text_soundex endif " fuzzystrmatch -" Extension: pgrouting (v3.0.2) +" Extension: pgrouting (v3.1.0) if index(get(g:, 'pgsql_disabled_extensions', []), 'pgrouting') == -1 syn keyword sqlFunction contained pgr_alphashape pgr_analyzegraph syn keyword sqlFunction contained pgr_analyzeoneway pgr_articulationpoints pgr_astar @@ -1578,7 +1578,7 @@ if index(get(g:, 'pgsql_disabled_extensions', []), 'pgcrypto') == -1 syn keyword sqlFunction contained pgp_sym_decrypt_bytea pgp_sym_encrypt syn keyword sqlFunction contained pgp_sym_encrypt_bytea endif " pgcrypto -" Extension: postgis_sfcgal (v3.0.1) +" Extension: postgis_sfcgal (v3.0.2) if index(get(g:, 'pgsql_disabled_extensions', []), 'postgis_sfcgal') == -1 syn keyword sqlFunction contained postgis_sfcgal_noop syn keyword sqlFunction contained postgis_sfcgal_scripts_installed postgis_sfcgal_version st_3darea @@ -1972,6 +1972,9 @@ else \ contains=sqlIsKeyword,sqlIsFunction,sqlComment,sqlPlpgsqlKeyword,sqlPlpgsqlVariable,sqlPlpgsqlOperator,sqlNumber,sqlIsOperator,sqlString,sqlTodo endif +" Folding +syn region sqlFold start='^\s*\zs\c\(create\|update\|alter\|select\|insert\|do\)\>' end=';$' transparent fold contains=ALL + " PL/<any other language> fun! s:add_syntax(s) execute 'syn include @PL' . a:s . ' syntax/' . a:s . '.vim' |