mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-18 08:23:40 -05:00
Compare commits
17 Commits
patch-42
...
6bc992cfdf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bc992cfdf | ||
|
|
692e359ad9 | ||
|
|
ccddddd81e | ||
|
|
be4b94a788 | ||
|
|
94311fc168 | ||
|
|
bc8a81d359 | ||
|
|
38282d5838 | ||
|
|
36a2bf60ad | ||
|
|
db7bb8ba22 | ||
|
|
aae85fe8c2 | ||
|
|
55eed00f71 | ||
|
|
db3a87a50b | ||
|
|
8bb9203790 | ||
|
|
32d08013a6 | ||
|
|
0e1b191209 | ||
|
|
a4f98d2a9e | ||
|
|
83422e0a1f |
37
README.md
37
README.md
@@ -2,16 +2,14 @@ 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) []()
|
||||

|
||||
- Best syntax and indentation support (no other features). Hand-selected language packs.
|
||||
- Automatically detects indentation (includes performance-optimized version of [vim-sleuth](https://github.com/tpope/vim-sleuth), can be disabled)
|
||||
@@ -55,13 +53,14 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [arduino](https://github.com/sudar/vim-arduino-syntax) (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)
|
||||
- [c/c++](https://github.com/vim-jp/vim-cpp) (C++ and C syntax highlighting for cpp, c++, cc, cp, cppm and 20 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)
|
||||
@@ -79,17 +78,16 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [elm](https://github.com/andys8/vim-elm-syntax) (Elm syntax highlighting for elm files)
|
||||
- [emberscript](https://github.com/yalesov/vim-ember-script) (EmberScript syntax highlighting for em and emberscript files)
|
||||
- [emblem](https://github.com/yalesov/vim-emblem) (Syntax highlighting for emblem and em files)
|
||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (Erlang syntax highlighting for erl, app.src, es, escript, hrl, xrl, yrl, app and yaws files)
|
||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (Erlang syntax highlighting for erl, app, app.src, es, escript, hrl, xrl, yrl and yaws files)
|
||||
- [fennel](https://github.com/bakpakin/fennel.vim) (Syntax highlighting for fnl files)
|
||||
- [ferm](https://github.com/vim-scripts/ferm.vim) (Syntax highlighting for ferm files)
|
||||
- [fish](https://github.com/blankname/vim-fish) (fish syntax highlighting for fish files)
|
||||
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers) (Syntax highlighting for fbs files)
|
||||
- [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)
|
||||
- [glsl](https://github.com/tikhomirov/vim-glsl) (GLSL syntax highlighting for glsl, fp, frag, frg, fs and 18 more files)
|
||||
- [gleam](https://github.com/gleam-lang/gleam.vim/tree/main) (Syntax highlighting for gleam files)
|
||||
- [glsl](https://github.com/tikhomirov/vim-glsl) (GLSL syntax highlighting for glsl, fp, frag, frg, fs and 19 more files)
|
||||
- [gmpl](https://github.com/maelvalais/gmpl.vim) (Syntax highlighting for mod files)
|
||||
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting) (Gnuplot syntax highlighting for gp, gnu, gnuplot, p, plot, plt and gpi files)
|
||||
- [go](https://github.com/fatih/vim-go) (Go syntax highlighting for go and tmpl files)
|
||||
@@ -110,17 +108,17 @@ 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 16 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)
|
||||
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (Syntax highlighting for jsx files)
|
||||
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (Julia syntax highlighting for jl files)
|
||||
- [just](https://github.com/NoahTheDuke/vim-just) (Syntax highlighting for just files)
|
||||
- [just](https://github.com/NoahTheDuke/vim-just/tree/main) (Syntax highlighting for just files)
|
||||
- [kotlin](https://github.com/udalov/kotlin-vim) (Kotlin syntax highlighting for kt, ktm and kts files)
|
||||
- [ledger](https://github.com/ledger/vim-ledger) (Syntax highlighting for ldg, ledger and journal files)
|
||||
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond/tree/main) (LilyPond syntax highlighting for ly and ily 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)
|
||||
@@ -152,15 +150,16 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
|
||||
- [pgsql](https://github.com/lifepillar/pgsql.vim) (PLpgSQL syntax highlighting for pgsql files)
|
||||
- [php](https://github.com/StanAngeloff/php.vim) (PHP syntax highlighting for php, aw, ctp, fcgi, inc and 7 more files)
|
||||
- [plantuml](https://github.com/aklt/plantuml-syntax) (PlantUML syntax highlighting for puml, iuml, plantuml, uml and pu files)
|
||||
- [pony](https://github.com/jakwings/vim-pony) (Pony syntax highlighting for pony files)
|
||||
- [pony](https://github.com/dleonard0/pony-vim-syntax) (Pony syntax highlighting for pony files)
|
||||
- [powershell](https://github.com/PProvost/vim-ps1) (PowerShell syntax highlighting for ps1, psd1, psm1, pssc and ps1xml files)
|
||||
- [prisma](https://github.com/prisma/vim-prisma) (Prisma syntax highlighting for prisma files)
|
||||
- [protobuf](https://github.com/uarun/vim-protobuf) (Protocol Buffer syntax highlighting for proto files)
|
||||
- [pug](https://github.com/digitaltoad/vim-pug) (Pug syntax highlighting for jade and pug files)
|
||||
- [puppet](https://github.com/rodjek/vim-puppet) (Puppet syntax highlighting for pp and epp files)
|
||||
- [purescript](https://github.com/purescript-contrib/purescript-vim) (PureScript syntax highlighting for purs files)
|
||||
- [python-compiler](https://github.com/aliev/vim-compiler-python)
|
||||
- [python-indent](https://github.com/Vimjas/vim-python-pep8-indent)
|
||||
- [python](https://github.com/vim-python/python-syntax) (Python syntax highlighting for py, cgi, fcgi, gyp, gypi and 14 more files)
|
||||
- [python](https://github.com/vim-python/python-syntax) (Python syntax highlighting for py, cgi, fcgi, gyp, gypi and 13 more files)
|
||||
- [qmake](https://github.com/artoj/qmake-syntax-vim) (QMake syntax highlighting for pro and pri files)
|
||||
- [qml](https://github.com/peterhoeg/vim-qml) (QML syntax highlighting for qml and qbs files)
|
||||
- [r-lang](https://github.com/vim-scripts/R.vim) (R syntax highlighting for r, rsx, s, S and rd files)
|
||||
@@ -197,7 +196,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,11 +205,11 @@ 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 100 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)
|
||||
- [zig](https://github.com/ziglang/zig.vim) (Zig syntax highlighting for zir, zig and zir files)
|
||||
- [zig](https://github.com/ziglang/zig.vim) (Zig syntax highlighting for zir, zig, zig.zon and zir files)
|
||||
- [zinit](https://github.com/zdharma-continuum/zinit-vim-syntax/tree/main)
|
||||
<!--/Language Packs-->
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'just', 'after/ftplugin/just.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim ftplugin file
|
||||
" Language: Justfile
|
||||
" Maintainer: Noah Bogart <noah.bogart@hey.com>
|
||||
" URL: https://github.com/NoahTheDuke/vim-just.git
|
||||
" Last Change: 2021 May 19
|
||||
|
||||
setlocal iskeyword+=-
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/indent/javas
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/indent/php.v
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/indent/types
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -8,7 +8,7 @@ endif
|
||||
" Original Author: Mikhail Wolfson <mywolfson@gmail.com>
|
||||
" Maintainer: bfrg <https://github.com/bfrg>
|
||||
" Website: https://github.com/bfrg/vim-cpp-modern
|
||||
" Last Change: Jul 24, 2021
|
||||
" Last Change: Jul 9, 2024
|
||||
"
|
||||
" This syntax file is based on:
|
||||
" https://github.com/octol/vim-cpp-enhanced-highlight
|
||||
@@ -21,8 +21,10 @@ syn keyword cTodo contained BUG NOTE
|
||||
|
||||
" Highlight function names
|
||||
if get(g:, 'cpp_function_highlight', 1)
|
||||
syn match cUserFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cParen,cCppParen
|
||||
syn match cUserFunction "\<\h\w*\ze\_s\{-}(\%(\*\h\w*)\_s\{-}(\)\@!"
|
||||
syn match cUserFunctionPointer "\%((\s*\*\s*\)\@6<=\h\w*\ze\s*)\_s\{-}(.*)"
|
||||
hi def link cUserFunction Function
|
||||
hi def link cUserFunctionPointer Function
|
||||
endif
|
||||
|
||||
|
||||
|
||||
@@ -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: Oct 13, 2023
|
||||
"
|
||||
" 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 mdspan extents default_accessor layout_left layout_right layout_stride flat_set flat_map flat_multiset flat_multimap is_implicit_lifetime reference_constructs_from_temporary reference_converts_from_temporary
|
||||
syntax keyword cppSTLtypedef stacktrace dextents
|
||||
syntax keyword cppSTLbool is_implicit_lifetime_v is_scoped_enum_v reference_constructs_from_temporary_v reference_converts_from_temporary_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
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/javas
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/php/g
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/reaso
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
@@ -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
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/rescr
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
@@ -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
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/types
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -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
@@ -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:
|
||||
|
||||
227
autoload/csv.vim
227
autoload/csv.vim
@@ -224,11 +224,11 @@ endfu
|
||||
|
||||
fu! csv#RemoveAutoHighlight() "{{{3
|
||||
exe "aug CSV_HI".bufnr('')
|
||||
exe "au! CursorMoved <buffer=".bufnr('').">"
|
||||
exe "au! "
|
||||
aug end
|
||||
exe "aug! CSV_HI".bufnr('')
|
||||
" Remove any existing highlighting
|
||||
HiColumn!
|
||||
call csv#HiCol('', 1)
|
||||
endfu
|
||||
|
||||
fu! csv#DoAutoCommands() "{{{3
|
||||
@@ -246,9 +246,8 @@ fu! csv#DoAutoCommands() "{{{3
|
||||
endif
|
||||
" undo autocommand:
|
||||
let b:undo_ftplugin .= '| exe "sil! au! CSV_HI'.bufnr('').' CursorMoved <buffer> "'
|
||||
let b:undo_ftplugin .= '| exe "sil! aug! CSV_HI'.bufnr('').'"'
|
||||
let b:undo_ftplugin .= '| call csv#RemoveAutoHighlight()'
|
||||
let b:undo_ftplugin = 'exe "sil! HiColumn!" |' . b:undo_ftplugin
|
||||
|
||||
if has("gui_running") && !exists("#CSV_Menu#FileType")
|
||||
augroup CSV_Menu
|
||||
au!
|
||||
@@ -443,10 +442,14 @@ fu! csv#HiCol(colnr, bang) "{{{3
|
||||
if exists("s:matchid")
|
||||
" ignore errors, that come from already deleted matches
|
||||
sil! call matchdelete(s:matchid)
|
||||
if a:bang
|
||||
unlet! s:matchid
|
||||
return
|
||||
endif
|
||||
endif
|
||||
" Additionally, filter all matches, that could have been used earlier
|
||||
let matchlist=getmatches()
|
||||
call filter(matchlist, 'v:val["group"] !~ s:hiGroup')
|
||||
call filter(matchlist, 'v:val["group"] !~? s:hiGroup')
|
||||
call setmatches(matchlist)
|
||||
if a:bang
|
||||
return
|
||||
@@ -455,6 +458,10 @@ fu! csv#HiCol(colnr, bang) "{{{3
|
||||
elseif !a:bang
|
||||
exe ":2match " . s:hiGroup . ' /' . pat . '/'
|
||||
endif
|
||||
" Remove Highlighting once switching away from the buffer
|
||||
exe "aug CSV_HI".bufnr('')
|
||||
exe "au BufWinLeave <buffer=".bufnr('')."> call csv#RemoveAutoHighlight()"
|
||||
aug end
|
||||
endfu
|
||||
fu! csv#GetDelimiter(first, last, ...) "{{{3
|
||||
" This depends on the locale. Hopefully it works
|
||||
@@ -482,12 +489,16 @@ fu! csv#GetDelimiter(first, last, ...) "{{{3
|
||||
" :silent :s does not work with lazyredraw
|
||||
let _lz = &lz
|
||||
set nolz
|
||||
" substitute without output when cmdheight=0
|
||||
let _cmdheight = &cmdheight
|
||||
set cmdheight=1
|
||||
for i in values(Delim)
|
||||
redir => temp[i]
|
||||
" use very non-magic
|
||||
exe ":silent! :". first. ",". last. 's/\V' . i . "/&/nge"
|
||||
redir END
|
||||
endfor
|
||||
let &cmdheight = _cmdheight
|
||||
let &lz = _lz
|
||||
let Delim = map(temp, 'matchstr(substitute(v:val, "\n", "", ""), "^\\s*\\d\\+")')
|
||||
let Delim = filter(temp, 'v:val=~''\d''')
|
||||
@@ -779,7 +790,11 @@ fu! csv#CalculateColumnWidth(row, silent) "{{{3
|
||||
" does not work with fixed width columns
|
||||
" row for the row for which to calculate the width
|
||||
let b:col_width=[]
|
||||
let vts_save=""
|
||||
if has( 'vartabs' ) && b:delimiter == "\t"
|
||||
if &l:vts
|
||||
let vts_save=&vts
|
||||
endif
|
||||
setlocal vts=
|
||||
endif
|
||||
try
|
||||
@@ -800,6 +815,9 @@ fu! csv#CalculateColumnWidth(row, silent) "{{{3
|
||||
" delete buffer content in variable b:csv_list,
|
||||
" this was only necessary for calculating the max width
|
||||
unlet! b:csv_list s:columnize_count s:decimal_column
|
||||
if vts_save
|
||||
let &l:vts=vts_save
|
||||
endif
|
||||
endfu
|
||||
fu! csv#Columnize(field) "{{{3
|
||||
" Internal function, not called from external,
|
||||
@@ -826,8 +844,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)
|
||||
@@ -867,7 +885,7 @@ fu! csv#Columnize(field) "{{{3
|
||||
if get(s:decimal_column, colnr, 0) == 0
|
||||
call csv#CheckHeaderLine()
|
||||
call csv#NumberFormat()
|
||||
let data = csv#CopyCol('', colnr+1, '')[s:csv_fold_headerline : -1]
|
||||
let data = csv#CopyCol('', colnr+1, '', 0)[s:csv_fold_headerline : -1]
|
||||
let pat1 = escape(s:nr_format[1], '.').'\zs[^'.s:nr_format[1].']*\ze'.
|
||||
\ (has_delimiter ? b:delimiter : '').'$'
|
||||
let pat2 = '\d\+\ze\%(\%('.escape(s:nr_format[1], '.'). '\d\+\)\|'.
|
||||
@@ -934,6 +952,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).")"
|
||||
@@ -996,9 +1019,9 @@ fu! csv#SplitHeaderLine(lines, bang, hor) "{{{3
|
||||
setl scrollopt=ver scrollbind cursorbind
|
||||
noa 0
|
||||
if a:lines[-1:] is? '!'
|
||||
let a=csv#CopyCol('',a:lines,'')
|
||||
let a=csv#CopyCol('',a:lines,'', 0)
|
||||
else
|
||||
let a=csv#CopyCol('',1, a:lines-1)
|
||||
let a=csv#CopyCol('',1, a:lines-1, 0)
|
||||
endif
|
||||
" Does it make sense to use the preview window?
|
||||
"vert sil! pedit |wincmd w | enew!
|
||||
@@ -1024,7 +1047,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
|
||||
@@ -1235,7 +1258,7 @@ fu! csv#Sort(bang, line1, line2, colnr) range "{{{3
|
||||
\' r'. flag. ' /' . pat . '/'
|
||||
call winrestview(wsv)
|
||||
endfun
|
||||
fu! csv#CopyCol(reg, col, cnt) "{{{3
|
||||
fu! csv#CopyCol(reg, col, cnt, bang) "{{{3
|
||||
" Return Specified Column into register reg
|
||||
let col = a:col == "0" ? csv#WColumn() : a:col+0
|
||||
let mcol = csv#MaxColumns()
|
||||
@@ -1249,11 +1272,18 @@ fu! csv#CopyCol(reg, col, cnt) "{{{3
|
||||
let cnt_cols = col + a:cnt - 1
|
||||
endif
|
||||
let a = []
|
||||
let first = 1
|
||||
call csv#CheckHeaderLine()
|
||||
if a:bang && first <= s:csv_fold_headerline
|
||||
" don't take the header line into consideration
|
||||
let first = s:csv_fold_headerline + 1
|
||||
endif
|
||||
|
||||
" Don't get lines, that are currently filtered away
|
||||
if !exists("b:csv_filter") || empty(b:csv_filter)
|
||||
let a=getline(1, '$')
|
||||
let a=getline(first, '$')
|
||||
else
|
||||
for line in range(1, line('$'))
|
||||
for line in range(first, line('$'))
|
||||
if foldlevel(line)
|
||||
continue
|
||||
else
|
||||
@@ -1681,7 +1711,7 @@ fu! csv#DoForEachColumn(start, stop, bang) range "{{{3
|
||||
endif
|
||||
|
||||
for item in range(a:start, a:stop, 1)
|
||||
if foldlevel(line)
|
||||
if foldlevel(item)
|
||||
" Filter out folded lines (from dynamic filter)
|
||||
continue
|
||||
endif
|
||||
@@ -1714,7 +1744,7 @@ fu! csv#DoForEachColumn(start, stop, bang) range "{{{3
|
||||
endfor
|
||||
endif
|
||||
for j in range(1, columns, 1)
|
||||
let t=substitute(t, '%s', fields[j-1], '')
|
||||
let t=substitute(t, '%s', get(fields, j-1, ''), '')
|
||||
endfor
|
||||
call add(result, t)
|
||||
endfor
|
||||
@@ -1733,7 +1763,7 @@ fu! csv#PrepareDoForEachColumn(start, stop, bang) range"{{{3
|
||||
let post = exists("g:csv_post_convert") ? g:csv_post_convert : ''
|
||||
let g:csv_post_convert=input('Post convert text: ', post)
|
||||
let convert = exists("g:csv_convert") ? g:csv_convert : ''
|
||||
let g:csv_convert=input("Converted text, use %s for column input:\n", convert)
|
||||
let g:csv_convert=input("How to convert data (use %s for column input):\n", convert)
|
||||
call csv#DoForEachColumn(a:start, a:stop, a:bang)
|
||||
endfun
|
||||
fu! csv#EscapeValue(val) "{{{3
|
||||
@@ -1981,7 +2011,7 @@ fu! csv#AnalyzeColumn(...) "{{{3
|
||||
|
||||
" Initialize csv#fold_headerline
|
||||
call csv#CheckHeaderLine()
|
||||
let data = csv#CopyCol('', colnr, '')[s:csv_fold_headerline : -1]
|
||||
let data = csv#CopyCol('', colnr, '', 0)[s:csv_fold_headerline : -1]
|
||||
let qty = len(data)
|
||||
let res = {}
|
||||
for item in data
|
||||
@@ -2254,100 +2284,45 @@ fu! csv#CSVMappings() "{{{3
|
||||
endif
|
||||
endfu
|
||||
fu! csv#CommandDefinitions() "{{{3
|
||||
call csv#LocalCmd("WhatColumn", ':echo csv#WColumn(<bang>0)',
|
||||
\ '-bang')
|
||||
call csv#LocalCmd("NrColumns", ':call csv#NrColumns(<q-bang>)', '-bang')
|
||||
call csv#LocalCmd("HiColumn", ':call csv#HiCol(<q-args>,<bang>0)',
|
||||
\ '-bang -nargs=?')
|
||||
call csv#LocalCmd("SearchInColumn",
|
||||
\ ':call csv#SearchColumn(<q-args>)', '-nargs=*')
|
||||
call csv#LocalCmd("DeleteColumn", ':call csv#DeleteColumn(<q-args>)',
|
||||
\ '-nargs=? -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("ArrangeColumn",
|
||||
\ ':call csv#ArrangeCol(<line1>, <line2>, <bang>0, -1, <q-args>)',
|
||||
\ '-range -bang -bar -nargs=?')
|
||||
call csv#LocalCmd("SmplVarCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#SmplVarianceColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("PopVarCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#PopVarianceColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("SmplStdCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#SmplStdDevColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("PopStdCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#PopStdDevColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("UnArrangeColumn",
|
||||
\':call csv#PrepUnArrangeCol(<line1>, <line2>)',
|
||||
\ '-bar -range')
|
||||
call csv#LocalCmd("CSVInit", ':call csv#Init(<line1>,<line2>,<bang>0)',
|
||||
\ '-bang -range=%')
|
||||
call csv#LocalCmd('Header',
|
||||
\ ':call csv#SplitHeaderLine(<q-args>,<bang>0,1)',
|
||||
\ '-nargs=? -bang')
|
||||
call csv#LocalCmd('VHeader',
|
||||
\ ':call csv#SplitHeaderLine(<q-args>,<bang>0,0)',
|
||||
\ '-nargs=? -bang')
|
||||
call csv#LocalCmd("HeaderToggle",
|
||||
\ ':call csv#SplitHeaderToggle(1)', '')
|
||||
call csv#LocalCmd("VHeaderToggle",
|
||||
\ ':call csv#SplitHeaderToggle(0)', '')
|
||||
call csv#LocalCmd("Sort",
|
||||
\ ':call csv#Sort(<bang>0, <line1>,<line2>,<q-args>)',
|
||||
\ '-nargs=* -bang -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("Column",
|
||||
\ ':call csv#CopyCol(empty(<q-reg>)?''"'':<q-reg>,<q-count>,<q-args>)',
|
||||
\ '-count -register -nargs=?')
|
||||
call csv#LocalCmd("MoveColumn",
|
||||
\ ':call csv#MoveColumn(<line1>,<line2>,<f-args>)',
|
||||
\ '-range=% -nargs=* -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("SumCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#SumColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("MaxCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#MaxColumn", <line1>,<line2>, 1)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("MinCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#MaxColumn", <line1>,<line2>, 0)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("CountCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#CountColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("AvgCol",
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#AvgColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd('SumRow', ':call csv#SumCSVRow(<q-count>, <q-args>)',
|
||||
\ '-nargs=? -range')
|
||||
call csv#LocalCmd("ConvertData",
|
||||
\ ':call csv#PrepareDoForEachColumn(<line1>,<line2>,<bang>0)',
|
||||
\ '-bang -nargs=? -range=%')
|
||||
call csv#LocalCmd("Filters", ':call csv#OutputFilters(<bang>0)',
|
||||
\ '-nargs=0 -bang')
|
||||
call csv#LocalCmd("Analyze", ':call csv#AnalyzeColumn(<f-args>)',
|
||||
\ '-nargs=*' )
|
||||
call csv#LocalCmd("VertFold", ':call csv#Vertfold(<bang>0,<q-args>)',
|
||||
\ '-bang -nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("AddColumn", ':call csv#AddColumn(<line1>,<line2>,<f-args>)', '-range=% -nargs=* -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("Analyze", ':call csv#AnalyzeColumn(<f-args>)', '-nargs=*' )
|
||||
call csv#LocalCmd("ArrangeColumn", ':call csv#ArrangeCol(<line1>, <line2>, <bang>0, -1, <q-args>)', '-range -bang -bar -nargs=?')
|
||||
call csv#LocalCmd("AvgCol", ':echo csv#EvalColumn(<q-args>, "csv#AvgColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("CSVFixed", ':call csv#InitCSVFixedWidth()', '')
|
||||
call csv#LocalCmd("NewRecord", ':call csv#NewRecord(<line1>,
|
||||
\ <line2>, <q-args>)', '-nargs=? -range')
|
||||
call csv#LocalCmd("NewDelimiter", ':call csv#NewDelimiter(<q-args>, 1, line(''$''))',
|
||||
\ '-nargs=1')
|
||||
call csv#LocalCmd("Duplicates", ':call csv#CheckDuplicates(<q-args>)',
|
||||
\ '-nargs=? -complete=custom,csv#CompleteColumnNr')
|
||||
call csv#LocalCmd('Transpose', ':call csv#Transpose(<line1>, <line2>)',
|
||||
\ '-range=%')
|
||||
call csv#LocalCmd('CSVTabularize', ':call csv#Tabularize(<bang>0,<line1>,<line2>)',
|
||||
\ '-bang -range=%')
|
||||
call csv#LocalCmd("AddColumn",
|
||||
\ ':call csv#AddColumn(<line1>,<line2>,<f-args>)',
|
||||
\ '-range=% -nargs=* -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("DupColumn",
|
||||
\ ':call csv#DupColumn(<line1>,<line2>,<f-args>)',
|
||||
\ '-range=% -nargs=* -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd('Substitute', ':call csv#SubstituteInColumn(<q-args>,<line1>,<line2>)',
|
||||
\ '-nargs=1 -range=%')
|
||||
call csv#LocalCmd("CSVInit", ':call csv#Init(<line1>,<line2>,<bang>0)', '-bang -range=%')
|
||||
call csv#LocalCmd("Column", ':call csv#CopyCol(empty(<q-reg>)?''"'':<q-reg>,<q-count>,<q-args>, <bang>0)', '-bang -count -register -nargs=?')
|
||||
call csv#LocalCmd("ConvertData", ':call csv#PrepareDoForEachColumn(<line1>,<line2>,<bang>0)', '-bang -nargs=0 -range=%')
|
||||
call csv#LocalCmd("CountCol", ':echo csv#EvalColumn(<q-args>, "csv#CountColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("DeleteColumn", ':call csv#DeleteColumn(<q-args>)', '-nargs=? -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("DupColumn", ':call csv#DupColumn(<line1>,<line2>,<f-args>)', '-range=% -nargs=* -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("Duplicates", ':call csv#CheckDuplicates(<q-args>)', '-nargs=? -complete=custom,csv#CompleteColumnNr')
|
||||
call csv#LocalCmd("Filters", ':call csv#OutputFilters(<bang>0)', '-nargs=0 -bang')
|
||||
call csv#LocalCmd("HeaderToggle", ':call csv#SplitHeaderToggle(1)', '')
|
||||
call csv#LocalCmd("HiColumn", ':call csv#HiCol(<q-args>,<bang>0)', '-bang -nargs=?')
|
||||
call csv#LocalCmd("MaxCol", ':echo csv#EvalColumn(<q-args>, "csv#MaxColumn", <line1>,<line2>, 1)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("MinCol", ':echo csv#EvalColumn(<q-args>, "csv#MaxColumn", <line1>,<line2>, 0)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("MoveColumn", ':call csv#MoveColumn(<line1>,<line2>,<f-args>)', '-range=% -nargs=* -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("NewDelimiter", ':call csv#NewDelimiter(<q-args>, 1, line(''$''))', '-nargs=1')
|
||||
call csv#LocalCmd("NewRecord", ':call csv#NewRecord(<line1>, <line2>, <q-args>)', '-nargs=? -range')
|
||||
call csv#LocalCmd("NrColumns", ':call csv#NrColumns(<q-bang>)', '-bang')
|
||||
call csv#LocalCmd("PopStdCol", ':echo csv#EvalColumn(<q-args>, "csv#PopStdDevColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("PopVarCol", ':echo csv#EvalColumn(<q-args>, "csv#PopVarianceColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("SearchInColumn", ':call csv#SearchColumn(<q-args>)', '-nargs=*')
|
||||
call csv#LocalCmd("SmplStdCol", ':echo csv#EvalColumn(<q-args>, "csv#SmplStdDevColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("SmplVarCol", ':echo csv#EvalColumn(<q-args>, "csv#SmplVarianceColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("Sort", ':call csv#Sort(<bang>0, <line1>,<line2>,<q-args>)', '-nargs=* -bang -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("SumCol", ':echo csv#EvalColumn(<q-args>, "csv#SumColumn", <line1>,<line2>)', '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("UnArrangeColumn", ':call csv#PrepUnArrangeCol(<line1>, <line2>)', '-bar -range')
|
||||
call csv#LocalCmd("VHeaderToggle", ':call csv#SplitHeaderToggle(0)', '')
|
||||
call csv#LocalCmd("VertFold", ':call csv#Vertfold(<bang>0,<q-args>)', '-bang -nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("WhatColumn", ':echo csv#WColumn(<bang>0)', '-bang')
|
||||
call csv#LocalCmd('CSVTabularize', ':call csv#Tabularize(<bang>0,<line1>,<line2>)', '-bang -range=%')
|
||||
call csv#LocalCmd('ColumnWidth', ':call csv#ColumnWidth()', '')
|
||||
call csv#LocalCmd('Header', ':call csv#SplitHeaderLine(<q-args>,<bang>0,1)', '-nargs=? -bang')
|
||||
call csv#LocalCmd('Substitute', ':call csv#SubstituteInColumn(<q-args>,<line1>,<line2>)', '-nargs=1 -range=%')
|
||||
call csv#LocalCmd('SumRow', ':call csv#SumCSVRow(<q-count>, <q-args>)', '-nargs=? -range')
|
||||
call csv#LocalCmd('Transpose', ':call csv#Transpose(<line1>, <line2>)', '-range=%')
|
||||
call csv#LocalCmd('VHeader', ':call csv#SplitHeaderLine(<q-args>,<bang>0,0)', '-nargs=? -bang')
|
||||
endfu
|
||||
fu! csv#ColumnWidth()
|
||||
let w=CSVWidth()
|
||||
@@ -2631,21 +2606,21 @@ fu! csv#Tabularize(bang, first, last) "{{{3
|
||||
endif
|
||||
let _c = winsaveview()
|
||||
" Table delimiter definition "{{{4
|
||||
if !exists("s:td")
|
||||
let s:td = {
|
||||
\ 'hbar': (&enc =~# 'utf-8' ? '─' : '-'),
|
||||
\ 'vbar': (&enc =~# 'utf-8' ? '│' : '|'),
|
||||
\ 'scol': (&enc =~# 'utf-8' ? '├' : '|'),
|
||||
\ 'ecol': (&enc =~# 'utf-8' ? '┤' : '|'),
|
||||
\ 'ltop': (&enc =~# 'utf-8' ? '┌' : '+'),
|
||||
\ 'rtop': (&enc =~# 'utf-8' ? '┐' : '+'),
|
||||
\ 'lbot': (&enc =~# 'utf-8' ? '└' : '+'),
|
||||
\ 'rbot': (&enc =~# 'utf-8' ? '┘' : '+'),
|
||||
\ 'cros': (&enc =~# 'utf-8' ? '┼' : '+'),
|
||||
\ 'dhor': (&enc =~# 'utf-8' ? '┬' : '-'),
|
||||
\ 'uhor': (&enc =~# 'utf-8' ? '┴' : '-')
|
||||
let use_unicode = &enc =~# 'utf-8' && get(g:, 'csv_table_use_ascii', 0) == 0
|
||||
let s:td = {
|
||||
\ 'hbar': (use_unicode ? '─' : '-'),
|
||||
\ 'vbar': (use_unicode ? '│' : '|'),
|
||||
\ 'scol': (use_unicode ? '├' : '|'),
|
||||
\ 'ecol': (use_unicode ? '┤' : '|'),
|
||||
\ 'ltop': (use_unicode ? '┌' : '+'),
|
||||
\ 'rtop': (use_unicode ? '┐' : '+'),
|
||||
\ 'lbot': (use_unicode ? '└' : '+'),
|
||||
\ 'rbot': (use_unicode ? '┘' : '+'),
|
||||
\ 'cros': (use_unicode ? '┼' : '+'),
|
||||
\ 'dhor': (use_unicode ? '┬' : '-'),
|
||||
\ 'uhor': (use_unicode ? '┴' : '-')
|
||||
\ }
|
||||
endif "}}}4
|
||||
"}}}4
|
||||
if match(getline(a:first), '^'.s:td.ltop) > -1
|
||||
" Already tabularized, done
|
||||
call csv#Warn("Looks already Tabularized, aborting!")
|
||||
@@ -2989,7 +2964,7 @@ fu! csv#EvalColumn(nr, func, first, last, ...) range "{{{3
|
||||
let stop += s:csv_fold_headerline
|
||||
endif
|
||||
|
||||
let column = csv#CopyCol('', col, '')[start : stop]
|
||||
let column = csv#CopyCol('', col, '', 0)[start : stop]
|
||||
let column = csv#GetCells(column)
|
||||
" Delete empty values
|
||||
" Leave this up to the function that does something
|
||||
@@ -3108,7 +3083,7 @@ fu! CSVField(x, y, ...) "{{{3
|
||||
let orig = !empty(a:0)
|
||||
let y = (y < 0 ? 0 : y)
|
||||
let x = (x > (csv#MaxColumns()) ? (csv#MaxColumns()) : x)
|
||||
let col = csv#CopyCol('',x,'')
|
||||
let col = csv#CopyCol('',x,'',0)
|
||||
if !orig
|
||||
" remove leading and trainling whitespace and the delimiter
|
||||
return matchstr(col[y], '^\s*\zs.\{-}\ze\s*'.b:delimiter.'\?$')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -72,7 +72,7 @@ endfunction
|
||||
|
||||
function! s:in_embedded_view()
|
||||
let groups = map(synstack(line('.'), col('.')), "synIDattr(v:val, 'name')")
|
||||
for group in ['elixirPhoenixESigil', 'elixirLiveViewSigil', 'elixirSurfaceSigil']
|
||||
for group in ['elixirPhoenixESigil', 'elixirLiveViewSigil', 'elixirSurfaceSigil', 'elixirHeexSigil']
|
||||
if index(groups, group) >= 0
|
||||
return 1
|
||||
endif
|
||||
@@ -383,7 +383,7 @@ endfunction
|
||||
" function, etc... so we need to first figure out what the innermost structure
|
||||
" is then forward execution to the proper handler
|
||||
function! elixir#indent#handle_inside_block(context)
|
||||
let start_pattern = '\C\%(\<with\>\|\<if\>\|\<case\>\|\<cond\>\|\<try\>\|\<receive\>\|\<fn\>\|{\|\[\|(\)'
|
||||
let start_pattern = '\C\%(\<with\>\|\<if\>\|\<case\>\|\<cond\>\|\<try\>\|\<receive\>\|\<fn\>\|\<quote\>\|{\|\[\|(\)'
|
||||
let end_pattern = '\C\%(\<end\>\|\]\|}\|)\)'
|
||||
" hack - handle do: better
|
||||
let block_info = searchpairpos(start_pattern, '', end_pattern, 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip() || getline(line('.')) =~ 'do:'", max([0, a:context.lnum - g:elixir_indent_max_lookbehind]))
|
||||
@@ -398,6 +398,7 @@ function! elixir#indent#handle_inside_block(context)
|
||||
let never_match = ''
|
||||
let config = {
|
||||
\'f': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
|
||||
\'q': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
|
||||
\'c': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
|
||||
\'t': {'aligned_clauses': s:keyword('end\|catch\|rescue\|after\|else'), 'pattern_match_clauses': s:keyword('catch\|rescue\|else')},
|
||||
\'r': {'aligned_clauses': s:keyword('end\|after'), 'pattern_match_clauses': s:keyword('after')},
|
||||
|
||||
@@ -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)>'
|
||||
@@ -155,5 +153,5 @@ function! fish#Complete(findstart, base)
|
||||
endfunction
|
||||
|
||||
function! fish#errorformat()
|
||||
return '%Afish: %m,%-G%*\\ ^,%-Z%f (line %l):%s'
|
||||
return '%E%f (line %l):%m,%C%p^%.%#,%-C%.%#'
|
||||
endfunction
|
||||
|
||||
@@ -167,7 +167,10 @@ let s:config_keys_camel =
|
||||
\ {'key': 'ExcludeProjectDirectories', 'default': []},
|
||||
\ {'key': 'keywordsAutocomplete', 'default': 1},
|
||||
\ {'key': 'ExternalAutocomplete', 'default': 0},
|
||||
\ {'key': 'FullNameExternalAutocomplete', 'default': 0},
|
||||
\ {'key': 'Linter', 'default': 1},
|
||||
\ {'key': 'LinterConfig'},
|
||||
\ {'key': 'IndentationSize', 'default': 4},
|
||||
\ {'key': 'UnionCaseStubGeneration', 'default': 1},
|
||||
\ {'key': 'UnionCaseStubGenerationBody'},
|
||||
\ {'key': 'RecordStubGeneration', 'default': 1},
|
||||
@@ -175,18 +178,39 @@ let s:config_keys_camel =
|
||||
\ {'key': 'InterfaceStubGeneration', 'default': 1},
|
||||
\ {'key': 'InterfaceStubGenerationObjectIdentifier', 'default': 'this'},
|
||||
\ {'key': 'InterfaceStubGenerationMethodBody'},
|
||||
\ {'key': 'AddPrivateAccessModifier', 'default': 0},
|
||||
\ {'key': 'UnusedOpensAnalyzer', 'default': 1},
|
||||
\ {'key': 'UnusedOpensAnalyzerExclusions', 'default': []},
|
||||
\ {'key': 'UnusedDeclarationsAnalyzer', 'default': 1},
|
||||
\ {'key': 'UnusedDeclarationsAnalyzerExclusions', 'default': []},
|
||||
\ {'key': 'SimplifyNameAnalyzer', 'default': 0},
|
||||
\ {'key': 'SimplifyNameAnalyzerExclusions', 'default': []},
|
||||
\ {'key': 'UnnecessaryParenthesesAnalyzer', 'default': 0},
|
||||
\ {'key': 'ResolveNamespaces', 'default': 1},
|
||||
\ {'key': 'EnableReferenceCodeLens', 'default': 1},
|
||||
\ {'key': 'EnableAnalyzers', 'default': 0},
|
||||
\ {'key': 'AnalyzersPath'},
|
||||
\ {'key': 'ExcludeAnalyzers'},
|
||||
\ {'key': 'IncludeAnalyzers'},
|
||||
\ {'key': 'DisableInMemoryProjectReferences', 'default': 0},
|
||||
\ {'key': 'LineLens', 'default': {'enabled': 'never', 'prefix': ''}},
|
||||
\ {'key': 'UseSdkScripts', 'default': 1},
|
||||
\ {'key': 'dotNetRoot'},
|
||||
\ {'key': 'fsiExtraParameters', 'default': []},
|
||||
\ {'key': 'fsiExtraParameters'},
|
||||
\ {'key': 'fsiExtraInteractiveParameters', 'default': ['--readline-']},
|
||||
\ {'key': 'fsiExtraSharedParameters', 'default': []},
|
||||
\ {'key': 'fsiCompilerToolLocations', 'default': []},
|
||||
\ {'key': 'TooltipMode', 'default': 'full'},
|
||||
\ {'key': 'GenerateBinlog', 'default': 0},
|
||||
\ {'key': 'AbstractClassStubGeneration', 'default': 1},
|
||||
\ {'key': 'AbstractClassStubGenerationObjectIdentifier', 'default': 'this'},
|
||||
\ {'key': 'AbstractClassStubGenerationMethodBody', 'default': 'failwith "Not Implemented"'},
|
||||
"\ {'key': 'CodeLenses', TODO},
|
||||
"\ {'key': 'PipelineHints', TODO}
|
||||
"\ {'key': 'InlayHints', TODO}
|
||||
"\ {'key': 'Fsac', TODO}
|
||||
"\ {'key': 'Notifications', TODO}
|
||||
"\ {'key': 'Debug', TODO}
|
||||
\ ]
|
||||
let s:config_keys = []
|
||||
|
||||
@@ -238,7 +262,7 @@ function! fsharp#loadConfig()
|
||||
endif
|
||||
|
||||
if !exists('g:fsharp#fsautocomplete_command')
|
||||
let g:fsharp#fsautocomplete_command = ['fsautocomplete', '--background-service-enabled']
|
||||
let g:fsharp#fsautocomplete_command = ['fsautocomplete']
|
||||
endif
|
||||
if !exists('g:fsharp#use_recommended_server_config')
|
||||
let g:fsharp#use_recommended_server_config = 1
|
||||
@@ -251,7 +275,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"
|
||||
@@ -411,6 +435,10 @@ endfunction
|
||||
|
||||
let s:workspace = []
|
||||
|
||||
function! fsharp#getLoadedProjects()
|
||||
return copy(s:workspace)
|
||||
endfunction
|
||||
|
||||
function! fsharp#handle_notifyWorkspace(payload) abort
|
||||
let content = json_decode(a:payload.content)
|
||||
if content.Kind == 'projectLoading'
|
||||
@@ -532,7 +560,16 @@ endfunction
|
||||
|
||||
function! s:get_fsi_command()
|
||||
let cmd = g:fsharp#fsi_command
|
||||
for prm in g:fsharp#fsi_extra_parameters
|
||||
if exists("g:fsharp#fsi_extra_parameters")
|
||||
echom "[Ionide-vim]: `g:fsharp#fsi_extra_parameters` is being deprecated. Migrate to `g:fsharp#fsi_extra_interactive_parameters` and `g:fsharp_extra_shared_parameters`."
|
||||
for prm in g:fsharp#fsi_extra_parameters
|
||||
let cmd = cmd . " " . prm
|
||||
endfor
|
||||
endif
|
||||
for prm in g:fsharp#fsi_extra_interactive_parameters
|
||||
let cmd = cmd . " " . prm
|
||||
endfor
|
||||
for prm in g:fsharp#fsi_extra_shared_parameters
|
||||
let cmd = cmd . " " . prm
|
||||
endfor
|
||||
return cmd
|
||||
@@ -584,7 +621,7 @@ function! fsharp#openFsi(returnFocus)
|
||||
if a:returnFocus | call s:win_gotoid_safe(current_win) | endif
|
||||
return s:fsi_buffer
|
||||
else
|
||||
echom "[FSAC] Your (neo)vim does not support terminal".
|
||||
echom "[FSAC] Your (neo)vim does not support terminal."
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -141,32 +141,6 @@ function! go#config#ListAutoclose() abort
|
||||
return get(g:, 'go_list_autoclose', 1)
|
||||
endfunction
|
||||
|
||||
function! go#config#InfoMode() abort
|
||||
return get(g:, 'go_info_mode', 'gopls')
|
||||
endfunction
|
||||
|
||||
function! go#config#GuruScope() abort
|
||||
let scope = get(g:, 'go_guru_scope', [])
|
||||
|
||||
if !empty(scope)
|
||||
" strip trailing slashes for each path in scope. bug:
|
||||
" https://github.com/golang/go/issues/14584
|
||||
let scopes = go#util#StripTrailingSlash(scope)
|
||||
endif
|
||||
|
||||
return scope
|
||||
endfunction
|
||||
|
||||
function! go#config#SetGuruScope(scope) abort
|
||||
if empty(a:scope)
|
||||
if exists('g:go_guru_scope')
|
||||
unlet g:go_guru_scope
|
||||
endif
|
||||
else
|
||||
let g:go_guru_scope = a:scope
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! go#config#EchoCommandInfo() abort
|
||||
return get(g:, 'go_echo_command_info', 1)
|
||||
endfunction
|
||||
@@ -204,6 +178,10 @@ function! go#config#Debug() abort
|
||||
return get(g:, 'go_debug', [])
|
||||
endfunction
|
||||
|
||||
function! go#config#DebugLogDelay() abort
|
||||
return get(g:, 'go_debug_log_delay', 10)
|
||||
endfunction
|
||||
|
||||
function! go#config#DebugWindows() abort
|
||||
return get(g:, 'go_debug_windows', {
|
||||
\ 'vars': 'leftabove 30vnew',
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'autoload/graphql.v
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
@@ -25,6 +25,12 @@ endif
|
||||
" Language: GraphQL
|
||||
" Maintainer: Jon Parise <jon@indelible.org>
|
||||
|
||||
" Look up the named variable in buffer scope and then in global scope.
|
||||
" Returns default if the named variable can't be found in either.
|
||||
function! graphql#var(name, default) abort
|
||||
return get(b:, a:name, get(g:, a:name, a:default))
|
||||
endfunction
|
||||
|
||||
function! graphql#has_syntax_group(group) abort
|
||||
try
|
||||
silent execute 'silent highlight ' . a:group
|
||||
@@ -35,5 +41,5 @@ function! graphql#has_syntax_group(group) abort
|
||||
endfunction
|
||||
|
||||
function! graphql#javascript_tags() abort
|
||||
return get(g:, 'graphql_javascript_tags', ['gql', 'graphql', 'Relay.QL'])
|
||||
return graphql#var('graphql_javascript_tags', ['gql', 'graphql', 'Relay.QL'])
|
||||
endfunction
|
||||
|
||||
@@ -109,9 +109,11 @@ function! jsonnet#Format()
|
||||
call setfperm(expand('%'), l:originalFPerm)
|
||||
endif
|
||||
" the file has been changed outside of vim, enable reedit
|
||||
mkview
|
||||
silent edit!
|
||||
let &fileformat = l:originalFileFormat
|
||||
let &syntax = &syntax
|
||||
silent loadview
|
||||
elseif g:jsonnet_fmt_fail_silently == 0
|
||||
" FixMe: We could leverage the errors coming from the `jsonnetfmt` and
|
||||
" give immediate feedback to the user at every save time.
|
||||
@@ -126,4 +128,63 @@ function! jsonnet#Format()
|
||||
call winrestview(l:curw)
|
||||
endfunction
|
||||
|
||||
function! jsonnet#GetVisualSelection()
|
||||
" Source: https://stackoverflow.com/a/6271254
|
||||
" Why is this not a built-in Vim script function?!
|
||||
let [line_start, column_start] = getpos("'<")[1:2]
|
||||
let [line_end, column_end] = getpos("'>")[1:2]
|
||||
let lines = getline(line_start, line_end)
|
||||
if len(lines) == 0
|
||||
return ''
|
||||
endif
|
||||
let lines[-1] = lines[-1][: column_end - (&selection == 'inclusive' ? 1 : 2)]
|
||||
let lines[0] = lines[0][column_start - 1:]
|
||||
return join(lines, "\n")
|
||||
endfun
|
||||
|
||||
" Format calls `jsonnetfmt ... ` on a Visual selection
|
||||
function! jsonnet#FormatVisual()
|
||||
" Get current visual selection
|
||||
let l:selection = jsonnet#GetVisualSelection()
|
||||
|
||||
" Get the command first so we can test it
|
||||
let l:binName = g:jsonnet_fmt_command
|
||||
|
||||
" Check if the user has installed command binary.
|
||||
let l:binPath = jsonnet#CheckBinPath(l:binName)
|
||||
if empty(l:binPath)
|
||||
return
|
||||
endif
|
||||
|
||||
" Populate the final command.
|
||||
let l:command = l:binPath
|
||||
let l:command = l:command . ' -e '
|
||||
let l:command = l:command . g:jsonnet_fmt_options
|
||||
|
||||
" Execute the compiled jsonnetfmt command and save the return value
|
||||
let l:out = jsonnet#System(l:command . " \"" . l:selection . "\"")
|
||||
let l:errorCode = v:shell_error
|
||||
|
||||
" Save register contents
|
||||
let reg = '"'
|
||||
let save_cb = &cb
|
||||
let regInfo = getreginfo(reg)
|
||||
try
|
||||
" Set register to formatted output
|
||||
call setreg(reg,l:out)
|
||||
" Paste formatted output
|
||||
silent exe 'norm! gv'.(reg == '"' ? '' : '"' . reg).'p`['
|
||||
finally
|
||||
" Restore register contents
|
||||
let &cb = save_cb
|
||||
call setreg(reg, regInfo)
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" Evaluate jsonnet into vsplit
|
||||
function! jsonnet#Eval()
|
||||
let output = system(g:jsonnet_command . ' ' . shellescape(expand('%')))
|
||||
vnew
|
||||
setlocal nobuflisted buftype=nofile bufhidden=wipe noswapfile ft=jsonnet
|
||||
put! = output
|
||||
endfunction
|
||||
|
||||
@@ -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.12.0-DEV.387
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
@@ -17,6 +17,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\copyright': '©',
|
||||
\ '\:copyright:': '©',
|
||||
\ '\ordfeminine': 'ª',
|
||||
\ '\guillemotleft': '«',
|
||||
\ '\neg': '¬',
|
||||
\ '\circledR': '®',
|
||||
\ '\:registered:': '®',
|
||||
@@ -29,6 +30,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\cdotp': '·',
|
||||
\ '\^1': '¹',
|
||||
\ '\ordmasculine': 'º',
|
||||
\ '\guillemotright': '»',
|
||||
\ '\1/4': '¼',
|
||||
\ '\1/2': '½',
|
||||
\ '\3/4': '¾',
|
||||
@@ -160,10 +162,10 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\Iota': 'Ι',
|
||||
\ '\Kappa': 'Κ',
|
||||
\ '\Lambda': 'Λ',
|
||||
\ '\upMu': 'Μ',
|
||||
\ '\upNu': 'Ν',
|
||||
\ '\Mu': 'Μ',
|
||||
\ '\Nu': 'Ν',
|
||||
\ '\Xi': 'Ξ',
|
||||
\ '\upOmicron': 'Ο',
|
||||
\ '\Omicron': 'Ο',
|
||||
\ '\Pi': 'Π',
|
||||
\ '\Rho': 'Ρ',
|
||||
\ '\Sigma': 'Σ',
|
||||
@@ -177,7 +179,6 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\beta': 'β',
|
||||
\ '\gamma': 'γ',
|
||||
\ '\delta': 'δ',
|
||||
\ '\upepsilon': 'ε',
|
||||
\ '\varepsilon': 'ε',
|
||||
\ '\zeta': 'ζ',
|
||||
\ '\eta': 'η',
|
||||
@@ -188,7 +189,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\mu': 'μ',
|
||||
\ '\nu': 'ν',
|
||||
\ '\xi': 'ξ',
|
||||
\ '\upomicron': 'ο',
|
||||
\ '\omicron': 'ο',
|
||||
\ '\pi': 'π',
|
||||
\ '\rho': 'ρ',
|
||||
\ '\varsigma': 'ς',
|
||||
@@ -199,20 +200,20 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\chi': 'χ',
|
||||
\ '\psi': 'ψ',
|
||||
\ '\omega': 'ω',
|
||||
\ '\upvarbeta': 'ϐ',
|
||||
\ '\varbeta': 'ϐ',
|
||||
\ '\vartheta': 'ϑ',
|
||||
\ '\phi': 'ϕ',
|
||||
\ '\varpi': 'ϖ',
|
||||
\ '\upoldKoppa': 'Ϙ',
|
||||
\ '\upoldkoppa': 'ϙ',
|
||||
\ '\oldKoppa': 'Ϙ',
|
||||
\ '\oldkoppa': 'ϙ',
|
||||
\ '\Stigma': 'Ϛ',
|
||||
\ '\upstigma': 'ϛ',
|
||||
\ '\stigma': 'ϛ',
|
||||
\ '\Digamma': 'Ϝ',
|
||||
\ '\digamma': 'ϝ',
|
||||
\ '\Koppa': 'Ϟ',
|
||||
\ '\upkoppa': 'ϟ',
|
||||
\ '\koppa': 'ϟ',
|
||||
\ '\Sampi': 'Ϡ',
|
||||
\ '\upsampi': 'ϡ',
|
||||
\ '\sampi': 'ϡ',
|
||||
\ '\varkappa': 'ϰ',
|
||||
\ '\varrho': 'ϱ',
|
||||
\ '\varTheta': 'ϴ',
|
||||
@@ -267,7 +268,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\^c': 'ᶜ',
|
||||
\ '\^f': 'ᶠ',
|
||||
\ '\^iota': 'ᶥ',
|
||||
\ '\^Phi': 'ᶲ',
|
||||
\ '\^ltphi': 'ᶲ',
|
||||
\ '\^z': 'ᶻ',
|
||||
\ '\^theta': 'ᶿ',
|
||||
\ '\enspace': ' ',
|
||||
@@ -281,8 +282,8 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\lq': '‘',
|
||||
\ '\rq': '’',
|
||||
\ '\reapos': '‛',
|
||||
\ '\quotedblleft': '“',
|
||||
\ '\quotedblright': '”',
|
||||
\ '\ldq': '“',
|
||||
\ '\rdq': '”',
|
||||
\ '\dagger': '†',
|
||||
\ '\ddagger': '‡',
|
||||
\ '\bullet': '•',
|
||||
@@ -374,10 +375,12 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\scrH': 'ℋ',
|
||||
\ '\frakH': 'ℌ',
|
||||
\ '\bbH': 'ℍ',
|
||||
\ '\ith': 'ℎ',
|
||||
\ '\planck': 'ℎ',
|
||||
\ '\hslash': 'ℏ',
|
||||
\ '\scrI': 'ℐ',
|
||||
\ '\Im': 'ℑ',
|
||||
\ '\frakI': 'ℑ',
|
||||
\ '\scrL': 'ℒ',
|
||||
\ '\ell': 'ℓ',
|
||||
\ '\bbN': 'ℕ',
|
||||
@@ -387,6 +390,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bbQ': 'ℚ',
|
||||
\ '\scrR': 'ℛ',
|
||||
\ '\Re': 'ℜ',
|
||||
\ '\frakR': 'ℜ',
|
||||
\ '\bbR': 'ℝ',
|
||||
\ '\xrat': '℞',
|
||||
\ '\trademark': '™',
|
||||
@@ -656,6 +660,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\measeq': '≞',
|
||||
\ '\questeq': '≟',
|
||||
\ '\ne': '≠',
|
||||
\ '\neq': '≠',
|
||||
\ '\equiv': '≡',
|
||||
\ '\nequiv': '≢',
|
||||
\ '\Equiv': '≣',
|
||||
@@ -759,7 +764,9 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\veebar': '⊻',
|
||||
\ '\xor': '⊻',
|
||||
\ '\barwedge': '⊼',
|
||||
\ '\nand': '⊼',
|
||||
\ '\barvee': '⊽',
|
||||
\ '\nor': '⊽',
|
||||
\ '\rightanglearc': '⊾',
|
||||
\ '\varlrtriangle': '⊿',
|
||||
\ '\bigwedge': '⋀',
|
||||
@@ -799,7 +806,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\nsqsubseteq': '⋢',
|
||||
\ '\nsqsupseteq': '⋣',
|
||||
\ '\sqsubsetneq': '⋤',
|
||||
\ '\sqspne': '⋥',
|
||||
\ '\sqsupsetneq': '⋥',
|
||||
\ '\lnsim': '⋦',
|
||||
\ '\gnsim': '⋧',
|
||||
\ '\precnsim': '⋨',
|
||||
@@ -1009,6 +1016,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\astrosun': '☉',
|
||||
\ '\:phone:': '☎',
|
||||
\ '\:ballot_box_with_check:': '☑',
|
||||
\ '\:umbrella_with_rain_drops:': '☔',
|
||||
\ '\:umbrella:': '☔',
|
||||
\ '\:coffee:': '☕',
|
||||
\ '\:point_up:': '☝',
|
||||
@@ -1097,6 +1105,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:soccer:': '⚽',
|
||||
\ '\:baseball:': '⚾',
|
||||
\ '\:snowman:': '⛄',
|
||||
\ '\:snowman_without_snow:': '⛄',
|
||||
\ '\:partly_sunny:': '⛅',
|
||||
\ '\:ophiuchus:': '⛎',
|
||||
\ '\:no_entry:': '⛔',
|
||||
@@ -1144,6 +1153,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\threedangle': '⟀',
|
||||
\ '\whiteinwhitetriangle': '⟁',
|
||||
\ '\perp': '⟂',
|
||||
\ '\veedot': '⟇',
|
||||
\ '\bsolhsub': '⟈',
|
||||
\ '\suphsol': '⟉',
|
||||
\ '\wedgedot': '⟑',
|
||||
@@ -1266,6 +1276,8 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\UpEquilibrium': '⥮',
|
||||
\ '\ReverseUpEquilibrium': '⥯',
|
||||
\ '\RoundImplies': '⥰',
|
||||
\ '\leftarrowless': '⥷',
|
||||
\ '\leftarrowsubset': '⥺',
|
||||
\ '\Vvert': '⦀',
|
||||
\ '\Elroang': '⦆',
|
||||
\ '\ddfnc': '⦙',
|
||||
@@ -1352,8 +1364,8 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\intcup': '⨚',
|
||||
\ '\upint': '⨛',
|
||||
\ '\lowint': '⨜',
|
||||
\ '\Join': '⨝',
|
||||
\ '\join': '⨝',
|
||||
\ '\bbsemi': '⨟',
|
||||
\ '\ringplus': '⨢',
|
||||
\ '\plushat': '⨣',
|
||||
\ '\simplus': '⨤',
|
||||
@@ -1541,6 +1553,11 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\forksnot': '⫝',
|
||||
\ '\dashV': '⫣',
|
||||
\ '\Dashv': '⫤',
|
||||
\ '\Top': '⫪',
|
||||
\ '\downvDash': '⫪',
|
||||
\ '\upvDash': '⫫',
|
||||
\ '\Bot': '⫫',
|
||||
\ '\indep': '⫫',
|
||||
\ '\interleave': '⫴',
|
||||
\ '\tdcol': '⫶',
|
||||
\ '\lllnest': '⫷',
|
||||
@@ -1625,6 +1642,9 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:part_alternation_mark:': '〽',
|
||||
\ '\:congratulations:': '㊗',
|
||||
\ '\:secret:': '㊙',
|
||||
\ '\^uparrow': 'ꜛ',
|
||||
\ '\^downarrow': 'ꜜ',
|
||||
\ '\^!': 'ꜝ',
|
||||
\ '\bfA': '𝐀',
|
||||
\ '\bfB': '𝐁',
|
||||
\ '\bfC': '𝐂',
|
||||
@@ -2309,7 +2329,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bfbeta': '𝛃',
|
||||
\ '\bfgamma': '𝛄',
|
||||
\ '\bfdelta': '𝛅',
|
||||
\ '\bfepsilon': '𝛆',
|
||||
\ '\bfvarepsilon': '𝛆',
|
||||
\ '\bfzeta': '𝛇',
|
||||
\ '\bfeta': '𝛈',
|
||||
\ '\bftheta': '𝛉',
|
||||
@@ -2331,7 +2351,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bfpsi': '𝛙',
|
||||
\ '\bfomega': '𝛚',
|
||||
\ '\bfpartial': '𝛛',
|
||||
\ '\bfvarepsilon': '𝛜',
|
||||
\ '\bfepsilon': '𝛜',
|
||||
\ '\bfvartheta': '𝛝',
|
||||
\ '\bfvarkappa': '𝛞',
|
||||
\ '\bfphi': '𝛟',
|
||||
@@ -2367,7 +2387,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\itbeta': '𝛽',
|
||||
\ '\itgamma': '𝛾',
|
||||
\ '\itdelta': '𝛿',
|
||||
\ '\itepsilon': '𝜀',
|
||||
\ '\itvarepsilon': '𝜀',
|
||||
\ '\itzeta': '𝜁',
|
||||
\ '\iteta': '𝜂',
|
||||
\ '\ittheta': '𝜃',
|
||||
@@ -2384,15 +2404,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 +2445,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bibeta': '𝜷',
|
||||
\ '\bigamma': '𝜸',
|
||||
\ '\bidelta': '𝜹',
|
||||
\ '\biepsilon': '𝜺',
|
||||
\ '\bivarepsilon': '𝜺',
|
||||
\ '\bizeta': '𝜻',
|
||||
\ '\bieta': '𝜼',
|
||||
\ '\bitheta': '𝜽',
|
||||
@@ -2442,15 +2462,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 +2503,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bsansbeta': '𝝱',
|
||||
\ '\bsansgamma': '𝝲',
|
||||
\ '\bsansdelta': '𝝳',
|
||||
\ '\bsansepsilon': '𝝴',
|
||||
\ '\bsansvarepsilon': '𝝴',
|
||||
\ '\bsanszeta': '𝝵',
|
||||
\ '\bsanseta': '𝝶',
|
||||
\ '\bsanstheta': '𝝷',
|
||||
@@ -2500,15 +2520,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 +2561,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\bisansbeta': '𝞫',
|
||||
\ '\bisansgamma': '𝞬',
|
||||
\ '\bisansdelta': '𝞭',
|
||||
\ '\bisansepsilon': '𝞮',
|
||||
\ '\bisansvarepsilon': '𝞮',
|
||||
\ '\bisanszeta': '𝞯',
|
||||
\ '\bisanseta': '𝞰',
|
||||
\ '\bisanstheta': '𝞱',
|
||||
@@ -2558,15 +2578,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 +2706,9 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:sun_with_face:': '🌞',
|
||||
\ '\:star2:': '🌟',
|
||||
\ '\:stars:': '🌠',
|
||||
\ '\:hotdog:': '🌭',
|
||||
\ '\:taco:': '🌮',
|
||||
\ '\:burrito:': '🌯',
|
||||
\ '\:chestnut:': '🌰',
|
||||
\ '\:seedling:': '🌱',
|
||||
\ '\:evergreen_tree:': '🌲',
|
||||
@@ -2752,7 +2775,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:cake:': '🍰',
|
||||
\ '\:bento:': '🍱',
|
||||
\ '\:stew:': '🍲',
|
||||
\ '\:egg:': '🍳',
|
||||
\ '\:fried_egg:': '🍳',
|
||||
\ '\:fork_and_knife:': '🍴',
|
||||
\ '\:tea:': '🍵',
|
||||
\ '\:sake:': '🍶',
|
||||
@@ -2762,6 +2785,8 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:beer:': '🍺',
|
||||
\ '\:beers:': '🍻',
|
||||
\ '\:baby_bottle:': '🍼',
|
||||
\ '\:champagne:': '🍾',
|
||||
\ '\:popcorn:': '🍿',
|
||||
\ '\:ribbon:': '🎀',
|
||||
\ '\:gift:': '🎁',
|
||||
\ '\:birthday:': '🎂',
|
||||
@@ -2819,11 +2844,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 +2872,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 +2911,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:bug:': '🐛',
|
||||
\ '\:ant:': '🐜',
|
||||
\ '\:bee:': '🐝',
|
||||
\ '\:beetle:': '🐞',
|
||||
\ '\:ladybug:': '🐞',
|
||||
\ '\:fish:': '🐟',
|
||||
\ '\:tropical_fish:': '🐠',
|
||||
\ '\:blowfish:': '🐡',
|
||||
@@ -2952,6 +2987,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 +3106,7 @@ function! julia_latex_symbols#get_dict()
|
||||
\ '\:pager:': '📟',
|
||||
\ '\:fax:': '📠',
|
||||
\ '\:satellite:': '📡',
|
||||
\ '\:satellite_antenna:': '📡',
|
||||
\ '\:loudspeaker:': '📢',
|
||||
\ '\:mega:': '📣',
|
||||
\ '\:outbox_tray:': '📤',
|
||||
@@ -3092,10 +3129,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 +3197,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 +3225,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 +3299,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 +3383,385 @@ 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:': '🛗',
|
||||
\ '\:wireless:': '🛜',
|
||||
\ '\:playground_slide:': '🛝',
|
||||
\ '\:wheel:': '🛞',
|
||||
\ '\:ring_buoy:': '🛟',
|
||||
\ '\: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:': '🟫',
|
||||
\ '\:heavy_equals_sign:': '🟰',
|
||||
\ '\: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:': '🥸',
|
||||
\ '\:face_holding_back_tears:': '🥹',
|
||||
\ '\: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:': '🧋',
|
||||
\ '\:troll:': '🧌',
|
||||
\ '\: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:': '🩴',
|
||||
\ '\:light_blue_heart:': '🩵',
|
||||
\ '\:grey_heart:': '🩶',
|
||||
\ '\:pink_heart:': '🩷',
|
||||
\ '\:drop_of_blood:': '🩸',
|
||||
\ '\:adhesive_bandage:': '🩹',
|
||||
\ '\:stethoscope:': '🩺',
|
||||
\ '\:x-ray:': '🩻',
|
||||
\ '\:crutch:': '🩼',
|
||||
\ '\:yo-yo:': '🪀',
|
||||
\ '\:kite:': '🪁',
|
||||
\ '\:parachute:': '🪂',
|
||||
\ '\:boomerang:': '🪃',
|
||||
\ '\:magic_wand:': '🪄',
|
||||
\ '\:pinata:': '🪅',
|
||||
\ '\:nesting_dolls:': '🪆',
|
||||
\ '\:maracas:': '🪇',
|
||||
\ '\:flute:': '🪈',
|
||||
\ '\: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:': '🪨',
|
||||
\ '\:mirror_ball:': '🪩',
|
||||
\ '\:identification_card:': '🪪',
|
||||
\ '\:low_battery:': '🪫',
|
||||
\ '\:hamsa:': '🪬',
|
||||
\ '\:folding_hand_fan:': '🪭',
|
||||
\ '\:hair_pick:': '🪮',
|
||||
\ '\:khanda:': '🪯',
|
||||
\ '\:fly:': '🪰',
|
||||
\ '\:worm:': '🪱',
|
||||
\ '\:beetle:': '🪲',
|
||||
\ '\:cockroach:': '🪳',
|
||||
\ '\:potted_plant:': '🪴',
|
||||
\ '\:wood:': '🪵',
|
||||
\ '\:feather:': '🪶',
|
||||
\ '\:lotus:': '🪷',
|
||||
\ '\:coral:': '🪸',
|
||||
\ '\:empty_nest:': '🪹',
|
||||
\ '\:nest_with_eggs:': '🪺',
|
||||
\ '\:hyacinth:': '🪻',
|
||||
\ '\:jellyfish:': '🪼',
|
||||
\ '\:wing:': '🪽',
|
||||
\ '\:goose:': '🪿',
|
||||
\ '\:anatomical_heart:': '🫀',
|
||||
\ '\:lungs:': '🫁',
|
||||
\ '\:people_hugging:': '🫂',
|
||||
\ '\:pregnant_man:': '🫃',
|
||||
\ '\:pregnant_person:': '🫄',
|
||||
\ '\:person_with_crown:': '🫅',
|
||||
\ '\:moose:': '🫎',
|
||||
\ '\:donkey:': '🫏',
|
||||
\ '\:blueberries:': '🫐',
|
||||
\ '\:bell_pepper:': '🫑',
|
||||
\ '\:olive:': '🫒',
|
||||
\ '\:flatbread:': '🫓',
|
||||
\ '\:tamale:': '🫔',
|
||||
\ '\:fondue:': '🫕',
|
||||
\ '\:teapot:': '🫖',
|
||||
\ '\:pouring_liquid:': '🫗',
|
||||
\ '\:beans:': '🫘',
|
||||
\ '\:jar:': '🫙',
|
||||
\ '\:ginger_root:': '🫚',
|
||||
\ '\:pea_pod:': '🫛',
|
||||
\ '\:melting_face:': '🫠',
|
||||
\ '\:saluting_face:': '🫡',
|
||||
\ '\:face_with_open_eyes_and_hand_over_mouth:': '🫢',
|
||||
\ '\:face_with_peeking_eye:': '🫣',
|
||||
\ '\:face_with_diagonal_mouth:': '🫤',
|
||||
\ '\:dotted_line_face:': '🫥',
|
||||
\ '\:biting_lip:': '🫦',
|
||||
\ '\:bubbles:': '🫧',
|
||||
\ '\:shaking_face:': '🫨',
|
||||
\ '\:hand_with_index_finger_and_thumb_crossed:': '🫰',
|
||||
\ '\:rightwards_hand:': '🫱',
|
||||
\ '\:leftwards_hand:': '🫲',
|
||||
\ '\:palm_down_hand:': '🫳',
|
||||
\ '\:palm_up_hand:': '🫴',
|
||||
\ '\:index_pointing_at_the_viewer:': '🫵',
|
||||
\ '\:heart_hands:': '🫶',
|
||||
\ '\:leftwards_pushing_hand:': '🫷',
|
||||
\ '\:rightwards_pushing_hand:': '🫸'}
|
||||
endfunction
|
||||
|
||||
@@ -3,6 +3,11 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'ledger', 'autoload/ledger.vim
|
||||
endif
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists ('b:is_hledger')
|
||||
let b:is_hledger = g:ledger_is_hledger
|
||||
endif
|
||||
|
||||
" vim:ts=2:sw=2:sts=2:foldmethod=marker
|
||||
function! ledger#transaction_state_toggle(lnum, ...) abort
|
||||
if a:0 == 1
|
||||
@@ -25,7 +30,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 +135,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 +462,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
|
||||
|
||||
@@ -499,7 +514,10 @@ function! ledger#align_commodity() abort
|
||||
endif
|
||||
if pos < 0
|
||||
" Find the position after the first digits
|
||||
let pos = matchend(rhs, '\m\d[^[:space:]]*')
|
||||
let pos = matchend(rhs, '\m\d[^[:space:]]*') - 1
|
||||
if pos >= 0
|
||||
let pos = strchars(rhs[:pos])
|
||||
endif
|
||||
endif
|
||||
" Go to the column that allows us to align the decimal separator at g:ledger_align_at:
|
||||
if pos >= 0
|
||||
@@ -544,6 +562,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
|
||||
@@ -629,7 +651,7 @@ endf
|
||||
" Build a ledger command to process the given file.
|
||||
function! s:ledger_cmd(file, args) abort
|
||||
let l:options = g:ledger_extra_options
|
||||
if len(g:ledger_date_format) > 0 && !g:ledger_is_hledger
|
||||
if len(g:ledger_date_format) > 0 && !b:is_hledger
|
||||
let l:options = join([l:options, '--date-format', g:ledger_date_format,
|
||||
\ '--input-date-format', g:ledger_date_format])
|
||||
endif
|
||||
@@ -656,7 +678,7 @@ endf
|
||||
" Use current line as input to ledger entry and replace with output. If there
|
||||
" are errors, they are echoed instead.
|
||||
function! ledger#entry() abort
|
||||
let l:output = systemlist(s:ledger_cmd(g:ledger_main, join(['entry', getline('.')])))
|
||||
let l:output = split(system(s:ledger_cmd(g:ledger_main, join(['entry', getline('.')]))), '\n')
|
||||
" Filter out warnings
|
||||
let l:output = filter(l:output, "v:val !~? '^Warning: '")
|
||||
" Errors may occur
|
||||
@@ -680,7 +702,7 @@ endfunc
|
||||
" Returns:
|
||||
" Ledger's output as a String.
|
||||
function! ledger#report(file, args) abort
|
||||
let l:output = systemlist(s:ledger_cmd(a:file, a:args))
|
||||
let l:output = split(system(s:ledger_cmd(a:file, a:args)), '\n')
|
||||
if v:shell_error " If there are errors, show them in a quickfix/location list.
|
||||
call s:quickfix_populate(l:output)
|
||||
call s:quickfix_toggle('Errors', 'Unable to parse errors')
|
||||
@@ -727,13 +749,11 @@ function! ledger#register(file, args) abort
|
||||
\ "--prepend-format='%(filename):%(beg_line) '",
|
||||
\ a:args
|
||||
\ ]))
|
||||
call s:quickfix_populate(systemlist(l:cmd))
|
||||
call s:quickfix_populate(split(system(l:cmd), '\n'))
|
||||
call s:quickfix_toggle('Register report')
|
||||
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
|
||||
@@ -748,7 +768,7 @@ function! ledger#reconcile(file, account, target_amount) abort
|
||||
\ shellescape(a:account)
|
||||
\ ]))
|
||||
let l:file = expand(a:file) " Needed for #show_balance() later
|
||||
call s:quickfix_populate(systemlist(l:cmd))
|
||||
call s:quickfix_populate(split(system(l:cmd), '\n'))
|
||||
if s:quickfix_toggle('Reconcile ' . a:account, 'Nothing to reconcile')
|
||||
let g:ledger_target_amount = a:target_amount
|
||||
" Show updated account balance upon saving, as long as the quickfix window is open
|
||||
@@ -792,7 +812,7 @@ function! ledger#show_balance(file, ...) abort
|
||||
\ "--format='%(scrub(get_at(display_total, 0)))|%(scrub(get_at(display_total, 1)))|%(quantity(scrub(get_at(display_total, 1))))'",
|
||||
\ (empty(g:ledger_default_commodity) ? '' : '-X ' . shellescape(g:ledger_default_commodity))
|
||||
\ ]))
|
||||
let l:output = systemlist(l:cmd)
|
||||
let l:output = split(system(l:cmd), '\n')
|
||||
" Errors may occur, for example, when the account has multiple commodities
|
||||
" and g:ledger_default_commodity is empty.
|
||||
if v:shell_error
|
||||
|
||||
18
autoload/neomake/makers/ft/pony.vim
Normal file
18
autoload/neomake/makers/ft/pony.vim
Normal file
@@ -0,0 +1,18 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'pony', 'autoload/neomake/makers/ft/pony.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! neomake#makers#ft#pony#EnabledMakers()
|
||||
return ['ponyc']
|
||||
endfunction
|
||||
|
||||
function! neomake#makers#ft#pony#ponyc()
|
||||
" This is currently a hack. Ponyc itself uses the project directory as
|
||||
" the target to build. Using %:p:h like this fetches the parent
|
||||
" directory of the current file which might cause supurious errors on
|
||||
" package imports if the current file is nested under a sub-directory.
|
||||
return {
|
||||
\ 'args': ['--pass=expr', '%:p:h'],
|
||||
\ 'errorformat': '%f:%l:%c: %m'
|
||||
\ }
|
||||
endfunction
|
||||
27
autoload/nix.vim
Normal file
27
autoload/nix.vim
Normal file
@@ -0,0 +1,27 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'nix', 'autoload/nix.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! nix#find_drv_position()
|
||||
let line = search("description")
|
||||
if line == 0
|
||||
let line = search("name")
|
||||
endif
|
||||
if line == 0
|
||||
echo "error: could not find derivation"
|
||||
return
|
||||
endif
|
||||
|
||||
return expand("%") . ":" . line
|
||||
endfunction
|
||||
|
||||
function! nix#edit(attr)
|
||||
let output = system("nix-instantiate --eval ./. -A " . a:attr . ".meta.position")
|
||||
if match(output, "^error:") == -1
|
||||
let position = split(split(output, '"')[0], ":")
|
||||
execute "edit " . position[0]
|
||||
execute position[1]
|
||||
" Update default command to nix-build.
|
||||
let b:dispatch = 'nix-build --no-out-link -A ' . a:attr
|
||||
endif
|
||||
endfunction
|
||||
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
|
||||
@@ -1771,11 +1771,11 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'prolog')
|
||||
au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl()
|
||||
au BufNewFile,BufRead *.pdb,*.pro,*.prolog,*.yap setf prolog
|
||||
au BufNewFile,BufRead *.pdb,*.plt,*.pro,*.prolog,*.yap setf 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,MODULE.bazel,Tiltfile,WORKSPACE,WORKSPACE.bazel 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 *.cnf,*.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*.url,*/etc/pacman.conf,*/etc/yum.conf,{.,}coveragerc,{.,}editorconfig,{.,}flake8,{.,}npmrc,{.,}pylintrc,HOSTS,buildozer.spec,hosts,pylintrc,vlcrc setf dosini
|
||||
au BufNewFile,BufRead php.ini-* call s:StarSetf('dosini')
|
||||
au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
|
||||
endif
|
||||
@@ -1794,7 +1794,7 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'visual-basic')
|
||||
au! BufNewFile,BufRead,BufWritePost *.bas call polyglot#detect#Bas()
|
||||
au BufNewFile,BufRead *.cls,*.ctl,*.dsm,*.frm,*.frx,*.sba,*.vba,*.vbs setf vb
|
||||
au BufNewFile,BufRead *.cls,*.ctl,*.dsm,*.frm,*.sba,*.vba,*.vbs setf vb
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'basic')
|
||||
@@ -1807,7 +1807,7 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'zig')
|
||||
au BufNewFile,BufRead *.zir setf zir
|
||||
au BufNewFile,BufRead *.zig,*.zir setf zig
|
||||
au BufNewFile,BufRead *.zig,*.zig.zon,*.zir setf zig
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'zephir')
|
||||
@@ -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
|
||||
|
||||
@@ -1891,7 +1891,7 @@ if !has_key(g:polyglot_is_disabled, 'tptp')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'toml')
|
||||
au BufNewFile,BufRead *.toml,*/.cargo/config,*/.cargo/credentials,Cargo.lock,Gopkg.lock,Pipfile,poetry.lock setf toml
|
||||
au BufNewFile,BufRead *.toml,*/.cargo/config,*/.cargo/credentials,Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,pdm.lock,poetry.lock setf toml
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'tmux')
|
||||
@@ -1957,7 +1957,7 @@ if !has_key(g:polyglot_is_disabled, 'slim')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'sh')
|
||||
au BufNewFile,BufRead *.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh,*.sh.in,*.tmux,*.tool,*.zsh-theme,*/etc/udev/cdsymlinks.conf,{.,}bash_aliases,{.,}bash_history,{.,}bash_logout,{.,}bash_profile,{.,}bashrc,{.,}cshrc,{.,}env,{.,}env.example,{.,}flaskenv,{.,}kshrc,{.,}login,{.,}profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile setf sh
|
||||
au BufNewFile,BufRead *.bash,*.bats,*.cgi,*.command,*.fcgi,*.ksh,*.sh,*.sh.in,*.tmux,*.tool,*.trigger,*.zsh-theme,*/etc/udev/cdsymlinks.conf,{.,}bash_aliases,{.,}bash_functions,{.,}bash_history,{.,}bash_logout,{.,}bash_profile,{.,}bashrc,{.,}cshrc,{.,}envrc,{.,}flaskenv,{.,}kshrc,{.,}login,{.,}profile,{.,}tmux.conf,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile,tmux.conf setf sh
|
||||
au BufNewFile,BufRead *.zsh,*/etc/zprofile,{.,}zfbfmarks,{.,}zlogin,{.,}zlogout,{.,}zprofile,{.,}zshenv,{.,}zshrc setf zsh
|
||||
au BufNewFile,BufRead .zsh* call s:StarSetf('zsh')
|
||||
au BufNewFile,BufRead .zlog* call s:StarSetf('zsh')
|
||||
@@ -2033,7 +2033,7 @@ if !has_key(g:polyglot_is_disabled, 'requirements')
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, '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
|
||||
au BufNewFile,BufRead *.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.ptl,*.py,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.spec,*.tac,*.wsgi,*.xpy,{.,}gclient,{.,}pythonrc,{.,}pythonstartup,DEPS,SConscript,SConstruct,wscript setf python
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'purescript')
|
||||
@@ -2053,6 +2053,10 @@ if !has_key(g:polyglot_is_disabled, 'protobuf')
|
||||
au BufNewFile,BufRead *.proto setf proto
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'prisma')
|
||||
au BufNewFile,BufRead *.prisma setf prisma
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'powershell')
|
||||
au BufNewFile,BufRead *.ps1,*.psd1,*.psm1,*.pssc setf ps1
|
||||
au BufNewFile,BufRead *.ps1xml setf ps1xml
|
||||
@@ -2157,7 +2161,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')
|
||||
@@ -2216,7 +2220,7 @@ if !has_key(g:polyglot_is_disabled, 'perl')
|
||||
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 *.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.psgi,{.,}gitolite.rc,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc setf perl
|
||||
au BufNewFile,BufRead *.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.psgi,{.,}gitolite.rc,{.,}latexmkrc,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc,latexmkrc 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()
|
||||
@@ -2233,7 +2237,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,*.sarif,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}all-contributorsrc,{.,}arcconfig,{.,}auto-changelog,{.,}c8rc,{.,}htmlhintrc,{.,}imgbotconfig,{.,}nycrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,MODULE.bazel.lock,Pipfile.lock,composer.lock,deno.lock,flake.lock,mcmod.info setf json
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'json5')
|
||||
@@ -2320,16 +2324,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
|
||||
@@ -2341,7 +2351,7 @@ endif
|
||||
if !has_key(g:polyglot_is_disabled, 'glsl')
|
||||
au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs()
|
||||
au! BufNewFile,BufRead,BufWritePost *.frag call polyglot#detect#Frag()
|
||||
au BufNewFile,BufRead *.comp,*.fp,*.frg,*.fsh,*.fshader,*.geo,*.geom,*.glsl,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader setf glsl
|
||||
au BufNewFile,BufRead *.comp,*.fp,*.frg,*.fsh,*.fshader,*.geo,*.geom,*.glsl,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vs,*.vsh,*.vshader setf glsl
|
||||
endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'git')
|
||||
@@ -2352,10 +2362,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 +2464,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 +2472,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')
|
||||
@@ -2536,7 +2542,7 @@ endif
|
||||
|
||||
if !has_key(g:polyglot_is_disabled, 'c/c++')
|
||||
au! BufNewFile,BufRead,BufWritePost *.h call polyglot#detect#H()
|
||||
au BufNewFile,BufRead *.c++,*.cc,*.cp,*.cpp,*.cxx,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.moc,*.tcc,*.tlh,*.tpp setf cpp
|
||||
au BufNewFile,BufRead *.c++,*.cc,*.cp,*.cpp,*.cppm,*.cxx,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.moc,*.tcc,*.tlh,*.tpp,*.txx setf cpp
|
||||
au! BufNewFile,BufRead,BufWritePost *.h call polyglot#detect#H()
|
||||
au BufNewFile,BufRead *.c,*.cats,*.idc,*.qc,*enlightenment/*.cfg setf c
|
||||
endif
|
||||
@@ -2577,7 +2583,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,*.mojo,*.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,*.sw,*.targets,*.tml,*.tpm,*.typ,*.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 +3516,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',
|
||||
@@ -498,6 +499,9 @@ let s:interpreters = {
|
||||
\ 'python': 'python',
|
||||
\ 'python2': 'python',
|
||||
\ 'python3': 'python',
|
||||
\ 'py': 'python',
|
||||
\ 'pypy': 'python',
|
||||
\ 'pypy3': 'python',
|
||||
\ 'qmake': 'qmake',
|
||||
\ 'Rscript': 'r',
|
||||
\ 'racket': 'racket',
|
||||
@@ -509,6 +513,7 @@ let s:interpreters = {
|
||||
\ 'rake': 'ruby',
|
||||
\ 'jruby': 'ruby',
|
||||
\ 'rbx': 'ruby',
|
||||
\ 'rust-script': 'rust',
|
||||
\ 'scala': 'scala',
|
||||
\ 'ash': 'sh',
|
||||
\ 'bash': 'sh',
|
||||
@@ -530,6 +535,7 @@ let s:interpreters = {
|
||||
\ 'z3': 'smt2',
|
||||
\ 'deno': 'typescript',
|
||||
\ 'ts-node': 'typescript',
|
||||
\ 'tsx': 'typescript',
|
||||
\ 'zsh': 'zsh',
|
||||
\ }
|
||||
" DO NOT EDIT CODE ABOVE, IT IS GENERATED WITH MAKEFILE
|
||||
|
||||
@@ -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,MODULE.bazel,Tiltfile,WORKSPACE,WORKSPACE.bazel',
|
||||
\ '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': '',
|
||||
@@ -85,7 +86,7 @@ let s:globs = {
|
||||
\ 'conf': '*.conf,auto.master,config',
|
||||
\ 'config': 'configure.in,configure.ac,Pipfile',
|
||||
\ 'context': '*.mkii,*.mkiv,*.mkvi',
|
||||
\ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.tcc,*.tpp,*.moc,*.tlh',
|
||||
\ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cppm,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.ixx,*.tcc,*.tpp,*.txx,*.moc,*.tlh',
|
||||
\ 'cql': '*.cql',
|
||||
\ 'crm': '*.crm',
|
||||
\ 'crontab': 'crontab,crontab.*',
|
||||
@@ -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,*.cnf,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,*.url,.coveragerc,.flake8,.pylintrc,HOSTS,buildozer.spec,hosts,pylintrc,vlcrc,.editorconfig,.npmrc,php.ini-*',
|
||||
\ 'dot': '*.dot,*.gv',
|
||||
\ 'dracula': '*.drac,*.drc,*lvs,*lpe,drac.*',
|
||||
\ 'dsdl': '*.sdl',
|
||||
@@ -152,7 +153,7 @@ let s:globs = {
|
||||
\ 'embeddedpuppet': '*.epp',
|
||||
\ 'ember-script': '*.em,*.emberscript',
|
||||
\ 'emblem': '*.emblem,*.em',
|
||||
\ 'erlang': '*.erl,*.app.src,*.es,*.escript,*.hrl,*.xrl,*.yrl,*.app,*.yaws,Emakefile,rebar.config,rebar.config.lock,rebar.lock',
|
||||
\ 'erlang': '*.erl,*.app,*.app.src,*.es,*.escript,*.hrl,*.xrl,*.yrl,*.yaws,Emakefile,rebar.config,rebar.config.lock,rebar.lock',
|
||||
\ 'eruby': '*.erb,*.erb.deface,*.rhtml',
|
||||
\ 'esmtprc': '*esmtprc',
|
||||
\ 'esqlc': '*.ec,*.EC',
|
||||
@@ -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',
|
||||
@@ -190,13 +190,15 @@ let s:globs = {
|
||||
\ 'gitsendemail': '.gitsendemail.*',
|
||||
\ 'gkrellmrc': 'gkrellmrc,gkrellmrc_?',
|
||||
\ 'gleam': '*.gleam',
|
||||
\ 'glsl': '*.glsl,*.fp,*.frag,*.frg,*.fs,*.fsh,*.fshader,*.geo,*.geom,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader,*.comp',
|
||||
\ 'glsl': '*.glsl,*.fp,*.frag,*.frg,*.fs,*.fsh,*.fshader,*.geo,*.geom,*.glslf,*.glslv,*.gs,*.gshader,*.rchit,*.rmiss,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vs,*.vsh,*.vshader,*.comp',
|
||||
\ 'gmpl': '*.mod',
|
||||
\ 'gnash': 'gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc',
|
||||
\ 'gnuplot': '*.gp,*.gnu,*.gnuplot,*.p,*.plot,*.plt,*.gpi',
|
||||
\ '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,*.sarif,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.all-contributorsrc,.arcconfig,.auto-changelog,.c8rc,.htmlhintrc,.imgbotconfig,.nycrc,.tern-config,.tern-project,.watchmanconfig,MODULE.bazel.lock,Pipfile.lock,composer.lock,deno.lock,flake.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',
|
||||
@@ -391,7 +393,7 @@ let s:globs = {
|
||||
\ 'passwd': '',
|
||||
\ 'pccts': '*.g',
|
||||
\ 'pdf': '*.pdf',
|
||||
\ 'perl': '*.pl,*.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.pm,*.psgi,*.t,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc,.gitolite.rc',
|
||||
\ 'perl': '*.pl,*.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.pm,*.psgi,*.t,.latexmkrc,Makefile.PL,Rexfile,ack,cpanfile,latexmkrc,example.gitolite.rc,.gitolite.rc',
|
||||
\ 'pest': '*.pest',
|
||||
\ 'pf': 'pf.conf',
|
||||
\ 'pfmain': 'main.cf',
|
||||
@@ -413,9 +415,10 @@ let s:globs = {
|
||||
\ 'povini': '.povrayrc',
|
||||
\ 'ppd': '*.ppd',
|
||||
\ 'ppwiz': '*.it,*.ih',
|
||||
\ 'prisma': '*.prisma',
|
||||
\ 'privoxy': '*.action',
|
||||
\ 'procmail': '.procmail,.procmailrc',
|
||||
\ 'prolog': '*.pl,*.pro,*.prolog,*.yap,*.pdb',
|
||||
\ 'prolog': '*.pl,*.plt,*.pro,*.prolog,*.yap,*.pdb',
|
||||
\ 'promela': '*.pml',
|
||||
\ 'proto': '*.proto',
|
||||
\ 'protocols': '',
|
||||
@@ -426,7 +429,7 @@ let s:globs = {
|
||||
\ 'puppet': '*.pp,Modulefile',
|
||||
\ 'purescript': '*.purs',
|
||||
\ 'pyrex': '*.pyx,*.pxd',
|
||||
\ 'python': '*.py,*.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.smk,*.spec,*.tac,*.wsgi,*.xpy,*.ptl,.gclient,DEPS,SConscript,SConstruct,Snakefile,wscript,.pythonrc,.pythonstartup',
|
||||
\ 'python': '*.py,*.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.spec,*.tac,*.wsgi,*.xpy,*.ptl,.gclient,DEPS,SConscript,SConstruct,wscript,.pythonrc,.pythonstartup',
|
||||
\ 'qmake': '*.pro,*.pri',
|
||||
\ 'qml': '*.qml,*.qbs',
|
||||
\ 'quake': '',
|
||||
@@ -480,7 +483,7 @@ let s:globs = {
|
||||
\ 'services': '',
|
||||
\ 'setserial': '',
|
||||
\ 'sexplib': '*.sexp',
|
||||
\ 'sh': '*.sh,*.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh.in,*.tmux,*.tool,*.zsh-theme,.bash_aliases,.bash_history,.bash_logout,.bash_profile,.bashrc,.cshrc,.env,.env.example,.flaskenv,.kshrc,.login,.profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile',
|
||||
\ 'sh': '*.sh,*.bash,*.bats,*.cgi,*.command,*.fcgi,*.ksh,*.sh.in,*.tmux,*.tool,*.trigger,*.zsh-theme,.bash_aliases,.bash_functions,.bash_history,.bash_logout,.bash_profile,.bashrc,.cshrc,.envrc,.flaskenv,.kshrc,.login,.profile,.tmux.conf,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile,tmux.conf',
|
||||
\ 'sieve': '*.siv,*.sieve',
|
||||
\ 'sil': '*.sil',
|
||||
\ 'simula': '*.sim',
|
||||
@@ -552,7 +555,7 @@ let s:globs = {
|
||||
\ 'tilde': '*.t.html',
|
||||
\ 'tli': '*.tli',
|
||||
\ 'tmux': '.tmux*.conf',
|
||||
\ 'toml': '*.toml,Cargo.lock,Gopkg.lock,Pipfile,poetry.lock',
|
||||
\ 'toml': '*.toml,Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,pdm.lock,poetry.lock',
|
||||
\ 'tpp': '*.tpp',
|
||||
\ 'tptp': '*.p,*.tptp,*.ax',
|
||||
\ 'trasys': '*.inp',
|
||||
@@ -565,7 +568,7 @@ let s:globs = {
|
||||
\ 'tt2': '*.tt2',
|
||||
\ 'tt2html': '*.tt2',
|
||||
\ 'tutor': '*.tutor',
|
||||
\ 'typescript': '*.ts',
|
||||
\ 'typescript': '*.ts,*.cts,*.mts',
|
||||
\ 'typescriptreact': '*.tsx',
|
||||
\ 'uc': '*.uc',
|
||||
\ 'udevconf': '',
|
||||
@@ -580,7 +583,7 @@ let s:globs = {
|
||||
\ 'usserverlog': '*.usserver.log\c,usserver.log\c,usserver.*.log\c',
|
||||
\ 'usw2kagtlog': '*.usw2kagt.log\c,usw2kagt.log\c,usw2kagt.*.log\c',
|
||||
\ 'vala': '*.vala,*.vapi,*.valadoc',
|
||||
\ 'vb': '*.bas,*.cls,*.frm,*.frx,*.vba,*.vbs,*.dsm,*.ctl,*.sba',
|
||||
\ 'vb': '*.bas,*.cls,*.frm,*.vba,*.vbs,*.dsm,*.ctl,*.sba',
|
||||
\ 'vbnet': '*.vb,*.vbhtml',
|
||||
\ 'vcl': '*.vcl',
|
||||
\ 'velocity': '*.vm',
|
||||
@@ -611,7 +614,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,*.mojo,*.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,*.sw,*.targets,*.tml,*.typ,*.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',
|
||||
@@ -627,7 +630,7 @@ let s:globs = {
|
||||
\ 'yaml.docker-compose': 'docker-compose*.yaml,docker-compose*.yml',
|
||||
\ 'z8a': '*.z8a',
|
||||
\ 'zephir': '*.zep',
|
||||
\ 'zig': '*.zig,*.zir',
|
||||
\ 'zig': '*.zig,*.zig.zon,*.zir',
|
||||
\ 'zimbu': '*.zu',
|
||||
\ 'zir': '*.zir',
|
||||
\ 'zsh': '*.zsh,.zshrc,.zshenv,.zlogin,.zprofile,.zlogout,.zlog*,.zcompdump*,.zfbfmarks,.zsh*',
|
||||
|
||||
@@ -1,536 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'pony', 'autoload/pony.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim plugin file
|
||||
" Language: Pony
|
||||
" Maintainer: Jak Wings
|
||||
|
||||
" TODO: Make sure echomsg is off for release.
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
"let s:skip = '<SID>InCommentOrLiteral(line("."), col("."))'
|
||||
let s:skip2 = '<SID>InLiteral(line("."), col(".")) || <SID>InComment(line("."), col(".")) == 1'
|
||||
let s:skip3 = '!<SID>InKeyword(line("."), col("."))'
|
||||
let s:skip4 = '!<SID>InBracket(line("."), col("."))'
|
||||
let s:cfstart = '\v<%(ifdef|if|match|while|for|repeat|try|with|recover|object|lambda|iftype)>'
|
||||
let s:cfmiddle = '\v<%(then|elseif|else|until|do|in|elseiftype)>|\|'
|
||||
let s:cfend = '\v<end>'
|
||||
let s:bstartp = '\v<%(ifdef|if|then|elseif|else|(match)|while|for|in|do|try|with|recover|repeat|until|(object)|lambda|iftype|elseiftype)>'
|
||||
|
||||
function! pony#Indent()
|
||||
if v:lnum <= 1
|
||||
return 0
|
||||
endif
|
||||
|
||||
call cursor(v:lnum, 1)
|
||||
let l:pnzpos = searchpos('.', 'cbnW')
|
||||
if l:pnzpos == [0, 0]
|
||||
return 0
|
||||
endif
|
||||
|
||||
if s:InComment2(l:pnzpos) > 1
|
||||
"echomsg 'Comment' (l:pnzpos[0] . '-' . v:lnum) -1
|
||||
return cindent(v:lnum)
|
||||
endif
|
||||
|
||||
if s:InLiteral2(l:pnzpos)
|
||||
"echomsg 'String' (l:pnzpos[0] . '-' . v:lnum) -1
|
||||
return -1
|
||||
endif
|
||||
|
||||
unlet! l:pnzpos
|
||||
|
||||
" NOTE: Lines started in comments and strings are checked already.
|
||||
|
||||
let l:pnblnum = s:PrevNonblank(v:lnum - 1)
|
||||
if l:pnblnum < 1
|
||||
return 0
|
||||
endif
|
||||
|
||||
let l:pnbline = getline(l:pnblnum)
|
||||
let l:pnbindent = indent(l:pnblnum)
|
||||
|
||||
let l:line = getline(v:lnum)
|
||||
let l:indent = l:pnbindent
|
||||
let l:shiftwidth = shiftwidth()
|
||||
|
||||
" FIXME?
|
||||
let l:continuing = 0
|
||||
" If the previous line ends with a unary or binary operator,
|
||||
if s:IsContinued(l:pnblnum)
|
||||
let l:contlnum = l:pnblnum
|
||||
let l:ppcontinued = 0
|
||||
let l:ppnblnum = s:PrevNonblank(l:pnblnum - 1)
|
||||
while s:IsContinued(l:ppnblnum)
|
||||
let l:ppcontinued += 1
|
||||
let l:contlnum = l:ppnblnum
|
||||
let l:ppnblnum = s:PrevNonblank(l:ppnblnum - 1)
|
||||
endwhile
|
||||
"echomsg 'Continued1' l:pnblnum l:contlnum
|
||||
" If the previous line is also continuing another line,
|
||||
if l:ppcontinued
|
||||
let l:continuing = 1
|
||||
if getline(l:contlnum) =~# '\v^\s*%(actor|class|struct|primitive|trait|type|interface)>'
|
||||
" reset the indent level.
|
||||
"echomsg 'Continuing0' (l:contlnum . '-' . v:lnum) (l:shiftwidth * 2)
|
||||
let l:indent = l:shiftwidth * 2
|
||||
else
|
||||
" keep using the previous indent.
|
||||
"echomsg 'Continuing1' (l:pnblnum . '-' . v:lnum) l:pnbindent
|
||||
let l:indent = l:pnbindent
|
||||
endif
|
||||
" if the previous line is part of the definition of a class,
|
||||
elseif l:pnbline =~# '\v^\s*%(actor|class|struct|primitive|trait|type|interface)>'
|
||||
" reset the indent level.
|
||||
"echomsg 'Continuing2' (l:pnblnum . '-' . v:lnum) (l:shiftwidth * 2)
|
||||
let l:continuing = 1
|
||||
let l:indent = l:shiftwidth * 2
|
||||
" if the previous line is part of the definition of a method,
|
||||
elseif l:pnbline =~# '\v^\s*%(fun|new|be)>'
|
||||
" reset the indent level.
|
||||
"echomsg 'Continuing3' (l:pnblnum . '-' . v:lnum) (l:pnbindent + l:shiftwidth)
|
||||
let l:continuing = 1
|
||||
let l:indent = l:pnbindent + l:shiftwidth
|
||||
" if the previous line is the start of a definition body,
|
||||
elseif l:pnbline =~# '=>\s*$'
|
||||
" indent this line.
|
||||
"echomsg 'Continuing4' (l:pnblnum . '-' . v:lnum) (l:pnbindent + l:shiftwidth)
|
||||
let l:continuing = 1
|
||||
let l:indent = l:pnbindent + l:shiftwidth
|
||||
else
|
||||
" indent this line twice as far.
|
||||
"echomsg 'Continuing5' (l:pnblnum . '-' . v:lnum) (l:pnbindent + l:shiftwidth * 2)
|
||||
let l:continuing = 1
|
||||
let l:indent = l:pnbindent + l:shiftwidth * 2
|
||||
endif
|
||||
|
||||
unlet! l:contlnum l:ppnblnum l:ppcontinued
|
||||
endif
|
||||
|
||||
" If this line starts a document string,
|
||||
if !l:continuing && l:line =~# '^\s*"""'
|
||||
let l:ppnblnum = s:PrevNonblank(l:pnblnum - 1)
|
||||
if s:IsContinued(l:ppnblnum)
|
||||
let l:contlnum = l:ppnblnum
|
||||
while s:IsContinued(l:ppnblnum)
|
||||
let l:contlnum = l:ppnblnum
|
||||
let l:ppnblnum = s:PrevNonblank(l:ppnblnum - 1)
|
||||
endwhile
|
||||
if getline(l:contlnum) =~# '\v^\s*%(actor|class|struct|primitive|trait|type|interface)>'
|
||||
" reset the indent level.
|
||||
"echomsg 'DocString' (l:contlnum . '-' . v:lnum) l:shiftwidth
|
||||
return l:shiftwidth
|
||||
endif
|
||||
endif
|
||||
|
||||
unlet! l:contlnum l:ppnblnum
|
||||
endif
|
||||
|
||||
" If the previous line contains an unmatched opening bracket
|
||||
if !l:continuing && l:pnbline =~# '[{[(]'
|
||||
" if the line ends with an opening bracket,
|
||||
if l:pnbline =~# '[{[(]\s*$' && !s:InCommentOrLiteral(l:pnblnum, col([l:pnblnum, '$']) - 1)
|
||||
" indent this line.
|
||||
let l:indent += l:shiftwidth
|
||||
else
|
||||
" find the unmatched opening bracket,
|
||||
let l:start = [0, 0]
|
||||
let l:end = col([l:pnblnum, '$']) - 1
|
||||
call cursor(l:pnblnum, l:end)
|
||||
while l:end > 0
|
||||
let l:start = s:OuterPos(l:start, searchpairpos('(', '', ')', 'bnW', s:skip4, l:pnblnum))
|
||||
let l:start = s:OuterPos(l:start, searchpairpos('\[', '', '\]', 'bnW', s:skip4, l:pnblnum))
|
||||
let l:start = s:OuterPos(l:start, searchpairpos('{', '', '}', 'bnW', s:skip4, l:pnblnum))
|
||||
if l:start == [0, 0]
|
||||
break
|
||||
endif
|
||||
" find the matched closing bracket on the same line,
|
||||
call cursor(l:start[0], l:start[1])
|
||||
let l:c = s:CharAtCursor(l:start[0], l:start[1])
|
||||
if searchpair(escape(l:c, '['), '', escape(tr(l:c, '([{', ')]}'), ']'),
|
||||
\ 'znW', s:skip4, l:pnblnum) < 1
|
||||
" the unmatched opening bracket is found,
|
||||
break
|
||||
endif
|
||||
let l:end = l:start[1]
|
||||
let l:start = [0, 0]
|
||||
endwhile
|
||||
if l:start != [0, 0]
|
||||
" indent this line.
|
||||
"echomsg 'Open bracket' (l:pnblnum . '-' . v:lnum) (l:indent + l:shiftwidth)
|
||||
let l:indent += l:shiftwidth
|
||||
endif
|
||||
endif
|
||||
|
||||
unlet! l:start l:end l:c
|
||||
endif
|
||||
|
||||
" If there is a matched closing bracket on the previous line,
|
||||
" NOTE:
|
||||
" >|[
|
||||
" | (1 -
|
||||
" | 1) * 2]
|
||||
" | command
|
||||
" ^
|
||||
if !l:continuing
|
||||
call cursor(l:pnblnum, 1)
|
||||
" find the last closing bracket,
|
||||
let l:end = [0, 0]
|
||||
let l:end = s:OuterPos(l:end, searchpairpos('(', '', ')', 'zncr', s:skip4, l:pnblnum))
|
||||
let l:end = s:OuterPos(l:end, searchpairpos('\[', '', '\]', 'zncr', s:skip4, l:pnblnum))
|
||||
let l:end = s:OuterPos(l:end, searchpairpos('{', '', '}', 'zncr', s:skip4, l:pnblnum))
|
||||
if l:end != [0, 0]
|
||||
" find the matched opening bracket on another line,
|
||||
let l:c = s:CharAtCursor(l:end[0], l:end[1])
|
||||
let l:start = searchpairpos(escape(tr(l:c, ')]}', '([{'), '['), '', escape(l:c, ']'), 'nbW', s:skip4)
|
||||
if l:start[0] != l:end[0]
|
||||
" and then this line has the same indent as the line the matched bracket stays.
|
||||
"echomsg 'Matched bracket' (l:start[0] . '-' . v:lnum) indent(l:start[0])
|
||||
let l:indent = indent(l:start[0])
|
||||
endif
|
||||
endif
|
||||
|
||||
unlet! l:start l:end l:c
|
||||
endif
|
||||
|
||||
" If there is a matched closing bracket on this line,
|
||||
" NOTE:
|
||||
" |[
|
||||
" >| (1 -
|
||||
" | 1) * 2
|
||||
" |]
|
||||
" ^ ^
|
||||
if l:line =~# '^\s*[)\]}]'
|
||||
" find the first closing bracket,
|
||||
call cursor(v:lnum, 1)
|
||||
let l:end = [0, 0]
|
||||
let l:end = s:InnerPos(l:end, searchpairpos('(', '', ')', 'zncW', s:skip4, v:lnum))
|
||||
let l:end = s:InnerPos(l:end, searchpairpos('\[', '', '\]', 'zncW', s:skip4, v:lnum))
|
||||
let l:end = s:InnerPos(l:end, searchpairpos('{', '', '}', 'zncW', s:skip4, v:lnum))
|
||||
if l:end != [0, 0]
|
||||
" find the matched opening bracket on another line,
|
||||
let l:c = s:CharAtCursor(l:end[0], l:end[1])
|
||||
let l:start = searchpairpos(escape(tr(l:c, ')]}', '([{'), '['), '', escape(l:c, ']'), 'nbW', s:skip4)
|
||||
if l:start[0] != l:end[0]
|
||||
" and then this line has the same indent as the line the matched bracket stays.
|
||||
"echomsg 'Closing Bracket' (l:start[0] . '-' . v:lnum) indent(l:start[0])
|
||||
let l:indent = indent(l:start[0])
|
||||
endif
|
||||
endif
|
||||
|
||||
unlet! l:start l:end l:c
|
||||
endif
|
||||
|
||||
" If this line starts the definition of a method, closure or match case,
|
||||
if l:line =~# '^\s*=>'
|
||||
" find the start of the definition,
|
||||
call cursor(v:lnum, 1)
|
||||
let l:start = searchpairpos('\v<%(new|be|fun|lambda)>|\|', '', '=>\zs', 'bnW', s:skip3)
|
||||
if l:start != [0, 0]
|
||||
" then this line has the same indent as the start.
|
||||
"echomsg 'Method body' (l:start[0] . '-' . v:lnum) indent(l:start[0])
|
||||
return indent(l:start[0])
|
||||
endif
|
||||
|
||||
unlet! l:start
|
||||
endif
|
||||
|
||||
" If this line starts a class definition or starts an alias,
|
||||
if l:line =~# '\v^\s*%(actor|class|struct|primitive|trait|interface|use|type)>'
|
||||
" reset the indent level.
|
||||
return 0
|
||||
endif
|
||||
|
||||
" If this line starts a method definition,
|
||||
if l:line =~# '\v^\s*%(new|be|fun)>'
|
||||
call cursor(v:lnum, 1)
|
||||
let l:start = searchpairpos(s:cfstart, s:cfmiddle, s:cfend, 'bW', s:skip3)
|
||||
if l:start != [0, 0]
|
||||
let l:start = searchpos(s:bstartp, 'zcnpW', l:start[0])
|
||||
" see if it is in an object block,
|
||||
if l:start[2] == 3
|
||||
"echomsg 'Method in object' (l:start[0] . '-' . v:lnum) (l:shiftwidth + indent(l:start[0]))
|
||||
return l:shiftwidth + indent(l:start[0])
|
||||
endif
|
||||
endif
|
||||
return l:shiftwidth
|
||||
endif
|
||||
|
||||
" If this line starts a match case,
|
||||
call cursor(v:lnum, 1)
|
||||
if l:line =~# '^\s*|' && s:InKeyword(searchpos('|', 'znW', v:lnum))
|
||||
" find the start or the previous case of the match block,
|
||||
let l:start = searchpairpos(s:cfstart, s:cfmiddle, s:cfend, 'bnW', s:skip3)
|
||||
if l:start != [0, 0]
|
||||
" then this line has the same indent as the start.
|
||||
"echomsg 'Match case' (l:start[0] . '-' . v:lnum) indent(l:start[0])
|
||||
return indent(l:start[0])
|
||||
endif
|
||||
|
||||
unlet! l:start
|
||||
endif
|
||||
|
||||
" If this line ends (part of) a control flow,
|
||||
if l:line =~# '\v^\s*%(end|elseif|else|then|in|do|until|elseiftype)>'
|
||||
" find the start or middle of the control block,
|
||||
call cursor(v:lnum, 1)
|
||||
let l:start = searchpairpos(s:cfstart, s:cfmiddle, s:cfend, 'bnW', s:skip3)
|
||||
if l:start != [0, 0]
|
||||
" then this line has the same indent as the start.
|
||||
"echomsg 'Block end' (l:start[0] . '-' . v:lnum) indent(l:start[0])
|
||||
return indent(l:start[0])
|
||||
endif
|
||||
|
||||
unlet! l:start
|
||||
endif
|
||||
|
||||
" If the previous line starts a class definition,
|
||||
if l:pnbline =~# '\v^\s*%(actor|class|struct|primitive|trait|type|interface)>'
|
||||
" reset the indent level.
|
||||
if s:IsContinued(l:pnblnum)
|
||||
return l:shiftwidth * 2
|
||||
else
|
||||
return l:shiftwidth
|
||||
endif
|
||||
endif
|
||||
|
||||
" If the previous line starts a method definition,
|
||||
if l:pnbline =~# '\v^\s*%(new|be|fun)>'
|
||||
return l:pnbindent + l:shiftwidth
|
||||
endif
|
||||
|
||||
" If the previous line starts (part of) a control flow,
|
||||
call cursor(l:pnblnum, 1)
|
||||
while 1
|
||||
" find the start of the control block,
|
||||
let l:start = searchpos(s:bstartp, 'zcepW', l:pnblnum)
|
||||
if l:start[2] == 0
|
||||
break
|
||||
endif
|
||||
if !s:InKeyword(l:start[0:1])
|
||||
call cursor(l:pnblnum, l:start[1] + 3)
|
||||
continue
|
||||
endif
|
||||
let l:index = l:start[2]
|
||||
" find the end of the control block on the same line,
|
||||
let l:end = searchpair(s:cfstart, '', s:cfend, 'znW', s:skip3, l:pnblnum)
|
||||
" if the control block is not ended,
|
||||
if l:end < 1
|
||||
" if this line is a case for a match,
|
||||
if l:index == 2 && l:line =~# '^\s*|'
|
||||
" then this line has the same indent as the start of the match block.
|
||||
return l:pnbindent
|
||||
else
|
||||
" then indent this line.
|
||||
"echomsg 'Block start' (l:pnblnum . '-' . v:lnum) (l:pnbindent + l:shiftwidth)
|
||||
return l:pnbindent + l:shiftwidth
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
|
||||
unlet! l:start l:end l:index
|
||||
|
||||
return l:indent
|
||||
endfunction
|
||||
|
||||
function! s:PrevNonblank(lnum)
|
||||
let l:lnum = prevnonblank(a:lnum)
|
||||
while l:lnum > 0 && (s:InComment2(l:lnum, 1) || s:InLiteral2(l:lnum, 1))
|
||||
let l:lnum = prevnonblank(l:lnum - 1)
|
||||
endwhile
|
||||
return l:lnum
|
||||
endfunction
|
||||
|
||||
" NOTE:
|
||||
" v
|
||||
" |1 /* comment */
|
||||
" |2
|
||||
function! s:IsContinued(lnum)
|
||||
let l:lnum = s:PrevNonblank(a:lnum)
|
||||
if l:lnum < 1
|
||||
return 0
|
||||
endif
|
||||
let l:line = getline(l:lnum)
|
||||
let l:width = strwidth(substitute(l:line, '\s*$', '', ''))
|
||||
" FIXME?
|
||||
" | 1 + //
|
||||
" | //
|
||||
" | 2
|
||||
return !s:InCommentOrLiteral(a:lnum, l:width)
|
||||
\ && (l:line =~# '\v<%(and|or|xor|is|isnt|as|not|consume|addressof|digestof)\s*$'
|
||||
\ || l:line =~# '\v%([=\-.]\>|[<!=>]\=\~?|\<\<\~?|\>\>\~?|\<:|[+\-*/%<>]\~?|[.,|:@~])\s*$'
|
||||
\ )
|
||||
endfunction
|
||||
|
||||
function! s:InCommentOrLiteral(...)
|
||||
return call('s:InComment', a:000) || call('s:InLiteral', a:000)
|
||||
endfunction
|
||||
|
||||
function! s:InKeyword(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
for id in s:Or(synstack(l:lnum, l:col), [])
|
||||
if synIDattr(id, 'name') =~# '^ponyKw'
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:InBracket(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
for id in s:Or(synstack(l:lnum, l:col), [])
|
||||
if synIDattr(id, 'name') ==# 'ponyBracket'
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:InComment(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
let l:stack = synstack(l:lnum, l:col)
|
||||
let l:i = len(l:stack)
|
||||
while l:i > 0
|
||||
let l:sname = synIDattr(l:stack[l:i - 1], 'name')
|
||||
if l:sname =~# '^ponyNestedCommentX\?$'
|
||||
return 1 + l:i - (l:sname =~# 'X$')
|
||||
elseif l:sname =~# '^ponyCommentX\?$'
|
||||
return 1
|
||||
endif
|
||||
let l:i -= 1
|
||||
endwhile
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:InLiteral(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
let l:stack = synstack(l:lnum, l:col)
|
||||
let l:i = len(l:stack)
|
||||
while l:i > 0
|
||||
let l:sname = synIDattr(l:stack[l:i - 1], 'name')
|
||||
if l:sname =~# '^ponyDocumentStringX\?$'
|
||||
return 3
|
||||
elseif l:sname =~# '^ponyStringX\?$'
|
||||
return 2
|
||||
elseif l:sname =~# '^ponyCharacterX\?$'
|
||||
return 1
|
||||
endif
|
||||
let l:i -= 1
|
||||
endwhile
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" NOTE:
|
||||
" |// //inside
|
||||
" ^^^^^^^^^^
|
||||
" |/* /*inside*/ */
|
||||
" ^^^^^^^^^^^^^^
|
||||
function! s:InComment2(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
let l:stack = synstack(l:lnum, l:col)
|
||||
let l:i = len(l:stack)
|
||||
while l:i > 0
|
||||
let l:sname = synIDattr(l:stack[l:i - 1], 'name')
|
||||
if l:sname ==# 'ponyNestedComment'
|
||||
return 1 + l:i
|
||||
elseif l:sname ==# 'ponyComment'
|
||||
return 1
|
||||
elseif l:sname =~# '\v^pony%(Nested)?CommentX$'
|
||||
return 0
|
||||
endif
|
||||
let l:i -= 1
|
||||
endwhile
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" NOTE:
|
||||
" |"inside"
|
||||
" ^^^^^^
|
||||
" |"""inside"""""
|
||||
" ^^^^^^^^^^^^
|
||||
function! s:InLiteral2(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
let l:stack = synstack(l:lnum, l:col)
|
||||
let l:i = len(l:stack)
|
||||
while l:i > 0
|
||||
let l:sname = synIDattr(l:stack[l:i - 1], 'name')
|
||||
if l:sname ==# 'ponyDocumentString'
|
||||
return 3
|
||||
elseif l:sname ==# 'ponyString'
|
||||
return 2
|
||||
elseif l:sname ==# 'ponyCharacter'
|
||||
return 1
|
||||
elseif l:sname =~# '\v^pony%(DocumentString|String|Character)X$'
|
||||
return 0
|
||||
endif
|
||||
let l:i -= 1
|
||||
endwhile
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:CharAtCursor(...)
|
||||
let [l:lnum, l:col] = (type(a:1) == type([]) ? a:1 : a:000)
|
||||
return matchstr(getline(l:lnum), '\%' . l:col . 'c.')
|
||||
endfunction
|
||||
|
||||
function! s:Or(x, y)
|
||||
return !empty(a:x) ? a:x : a:y
|
||||
endfunction
|
||||
|
||||
function! s:InnerPos(x, y)
|
||||
if a:x == [0, 0]
|
||||
return a:y
|
||||
elseif a:y == [0, 0]
|
||||
return a:x
|
||||
else
|
||||
return a:x[1] < a:y[1] ? a:x : a:y
|
||||
end
|
||||
endfunction
|
||||
|
||||
function! s:OuterPos(x, y)
|
||||
if a:x == [0, 0]
|
||||
return a:y
|
||||
elseif a:y == [0, 0]
|
||||
return a:x
|
||||
else
|
||||
return a:x[1] > a:y[1] ? a:x : a:y
|
||||
end
|
||||
endfunction
|
||||
|
||||
function! pony#ClearTrailingSpace(all, alt, ...)
|
||||
let l:force = (a:0 > 0 ? a:1 : 0)
|
||||
if !l:force && (&readonly || !&modifiable || !&modified)
|
||||
return
|
||||
endif
|
||||
if a:all
|
||||
for lnum in range(1, line('$'))
|
||||
let l:line = getline(lnum)
|
||||
let l:end = col([lnum, '$']) - 1
|
||||
if l:end > 0 && l:line =~# '\s$' && !s:InLiteral(lnum, l:end)
|
||||
if a:alt
|
||||
call setline(lnum, substitute(l:line, '\S\@<=\s\s*$', '', ''))
|
||||
else
|
||||
call setline(lnum, substitute(l:line, '\s\+$', '', ''))
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
let l:lnum = line('.')
|
||||
let l:end = col('$') - 1
|
||||
let l:line = getline(l:lnum)
|
||||
if l:line =~# '\s$' && !s:InLiteral(l:lnum, l:end)
|
||||
if a:alt
|
||||
call setline(l:lnum, substitute(l:line, '\s\+$', '', ''))
|
||||
else
|
||||
call setline(l:lnum, substitute(l:line, '\S\@<=\s\s*$', '', ''))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -2,35 +2,32 @@ 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)
|
||||
""
|
||||
" Refer https://github.com/vim/vim/blob/75e27d78f5370e7d2e0898326d9b080937e7b090/runtime/scripts.vim#L33-L71
|
||||
"
|
||||
" 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.
|
||||
" When a file's shebang is "pip install -r" or "pip-compile",
|
||||
" set its filetype to |requirements|.
|
||||
function! requirements#shebang() abort
|
||||
let s:line1 = getline(1)
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
if s:line1 =~# "^#!"
|
||||
if s:line1 =~# '^#!\s*\S*\<env\s'
|
||||
let s:line1 = substitute(s:line1, '\S\+=\S\+', '', 'g')
|
||||
let s:line1 = substitute(s:line1, '\(-[iS]\|--ignore-environment\|--split-string\)', '', '')
|
||||
let s:line1 = substitute(s:line1, '\<env\s\+', '', '')
|
||||
endif
|
||||
if s:line1 =~# '^#!\s*\a:[/\\]'
|
||||
let s:name = substitute(s:line1, '^#!.*[/\\]\(\i\+\).*', '\1', '')
|
||||
elseif s:line1 =~# '^#!.*\<env\>'
|
||||
let s:name = substitute(s:line1, '^#!.*\<env\>\s\+\(\i\+\).*', '\1', '')
|
||||
elseif s:line1 =~# '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)'
|
||||
let s:name = substitute(s:line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '')
|
||||
else
|
||||
let s:name = substitute(s:line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '')
|
||||
endif
|
||||
if s:name =~# '^pip'
|
||||
set ft=requirements
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
" vim: et sw=4 ts=4 sts=4:
|
||||
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: Ruby
|
||||
" Maintainer: Mark Guzman <segfault@hasno.info>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
" ----------------------------------------------------------------------------
|
||||
"
|
||||
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
|
||||
@@ -493,7 +492,7 @@ class VimRubyCompletion
|
||||
trail = "%s%s" % [ dir, sub ]
|
||||
tcfg = "%sconfig" % trail
|
||||
|
||||
if File.exists?( tcfg )
|
||||
if File.exist?( tcfg )
|
||||
rails_base = trail
|
||||
break
|
||||
end
|
||||
@@ -506,7 +505,7 @@ class VimRubyCompletion
|
||||
|
||||
bootfile = rails_base + "config/boot.rb"
|
||||
envfile = rails_base + "config/environment.rb"
|
||||
if File.exists?( bootfile ) && File.exists?( envfile )
|
||||
if File.exist?( bootfile ) && File.exist?( envfile )
|
||||
begin
|
||||
require bootfile
|
||||
require envfile
|
||||
|
||||
@@ -3,14 +3,17 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'smt2', 'autoload/smt2/formatt
|
||||
endif
|
||||
|
||||
" Formatting requires a rather recent Vim version
|
||||
if !((v:version > 802) || (v:version == 802 && has("patch2725")))
|
||||
if (v:version < 802) || (v:version == 802 && !has("patch2725"))
|
||||
const s:errmsg_oldvim = "Vim >= 8.2.2725 required for auto-formatting"
|
||||
|
||||
"Dummies
|
||||
function! smt2#formatter#FormatCurrentParagraph()
|
||||
echoerr s:errmsg_oldvim
|
||||
endfunction
|
||||
function! smt2#formatter#FormatAllParagraphs()
|
||||
function! smt2#formatter#FormatOutermostSExpr()
|
||||
echoerr s:errmsg_oldvim
|
||||
endfunction
|
||||
function! smt2#formatter#FormatFile()
|
||||
echoerr s:errmsg_oldvim
|
||||
endfunction
|
||||
|
||||
@@ -88,55 +91,75 @@ def Format(ast: dict<any>, indent = 0): string
|
||||
call formatted->add(child->Format())
|
||||
endfor
|
||||
return formatted->join("\n")
|
||||
elseif ast.kind ==# 'File'
|
||||
var formatted = []
|
||||
for child in ast.value
|
||||
call formatted->add(child->Format())
|
||||
endfor
|
||||
return formatted->join("\n\n")
|
||||
endif
|
||||
throw 'Cannot format AST node: ' .. string(ast)
|
||||
return '' # Unreachable
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Auxiliary
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
def FormatInCurrentBuffer(ast: dict<any>)
|
||||
const cursor = getpos('.')
|
||||
|
||||
# Format lines and potential surrounding text on them
|
||||
const formatted_lines = split(Format(ast), '\n')
|
||||
const ast_coords = ast.CalcCoords()
|
||||
const ws_mask = " \n\r\t"
|
||||
const first_line_part_to_keep = getline(ast_coords[0].line)
|
||||
->strcharpart(0, ast_coords[0].col - 2)
|
||||
->trim(ws_mask, 2)
|
||||
const last_line_part_to_keep = getline(ast_coords[1].line)
|
||||
->strcharpart(ast_coords[1].col - 1)
|
||||
->trim(ws_mask, 1)
|
||||
|
||||
# If section of AST has trailing whitespace until the file end, remove it
|
||||
cursor(ast_coords[1].line, ast_coords[1].col)
|
||||
if search('\m\C\S', 'W') == 0
|
||||
deletebufline('%', ast_coords[1].line + 1, line('$'))
|
||||
endif
|
||||
|
||||
# Replace section of AST by formatted lines (w/o killing surrounding text)
|
||||
deletebufline('%', ast_coords[0].line, ast_coords[1].line)
|
||||
if !empty(last_line_part_to_keep)
|
||||
last_line_part_to_keep->append(ast_coords[0].line - 1)
|
||||
endif
|
||||
formatted_lines->append(ast_coords[0].line - 1)
|
||||
if !empty(first_line_part_to_keep)
|
||||
first_line_part_to_keep->append(ast_coords[0].line - 1)
|
||||
endif
|
||||
|
||||
# If section of AST has leading whitespace until the file start, remove it
|
||||
cursor(ast_coords[0].line, ast_coords[0].col)
|
||||
if search('\m\C\S', 'bW') == 0
|
||||
deletebufline('%', 1, ast_coords[0].line - 1)
|
||||
endif
|
||||
|
||||
# Restore cursor position
|
||||
call setpos('.', cursor)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Public functions
|
||||
# ------------------------------------------------------------------------------
|
||||
def smt2#formatter#FormatCurrentParagraph()
|
||||
const cursor = getpos('.')
|
||||
const ast = smt2#parser#ParseCurrentParagraph()
|
||||
|
||||
# Identify on which end of the buffer we are (to fix newlines later)
|
||||
silent! normal! {
|
||||
const is_first_paragraph = line('.') == 1
|
||||
silent! normal! }
|
||||
const is_last_paragraph = line('.') == line('$')
|
||||
|
||||
# Replace paragraph by formatted lines
|
||||
const lines = split(Format(ast), '\n')
|
||||
silent! normal! {d}
|
||||
if is_last_paragraph && !is_first_paragraph
|
||||
call append('.', [''] + lines)
|
||||
else
|
||||
call append('.', lines + [''])
|
||||
endif
|
||||
|
||||
# Remove potentially introduced first empty line
|
||||
if is_first_paragraph | silent! :1delete | endif
|
||||
|
||||
# Restore cursor position
|
||||
call setpos('.', cursor)
|
||||
FormatInCurrentBuffer(ast)
|
||||
enddef
|
||||
|
||||
def smt2#formatter#FormatAllParagraphs()
|
||||
const cursor = getpos('.')
|
||||
const asts = smt2#parser#ParseAllParagraphs()
|
||||
|
||||
# Clear buffer & insert formatted paragraphs
|
||||
silent! :1,$delete
|
||||
for ast in asts
|
||||
const lines = split(Format(ast), '\n') + ['']
|
||||
call append('$', lines)
|
||||
endfor
|
||||
|
||||
# Remove first & trailing empty lines
|
||||
silent! :1delete
|
||||
silent! :$delete
|
||||
|
||||
# Restore cursor position
|
||||
call setpos('.', cursor)
|
||||
def smt2#formatter#FormatOutermostSExpr()
|
||||
const ast = smt2#parser#ParseOutermostSExpr()
|
||||
FormatInCurrentBuffer(ast)
|
||||
enddef
|
||||
|
||||
def smt2#formatter#FormatFile()
|
||||
const ast = smt2#parser#ParseFile()
|
||||
FormatInCurrentBuffer(ast)
|
||||
enddef
|
||||
|
||||
@@ -11,17 +11,37 @@ set maxfuncdepth=100000000 # SMT files tend to be highly nested
|
||||
# TODO: Change Ast.kind type from string to enum/number?
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# AST nodes -- essentially named token wrappers
|
||||
# AST nodes
|
||||
#
|
||||
# Note: pos_from, pos_to and contains_comment were only introduced to allow for
|
||||
# a fast FitsOneLine(ast) function in the formatter.
|
||||
# Here, pos_from and pos_to refer to indices of characters -- not tokens
|
||||
# Note: pos_from, pos_to and contains_comment allow for a fast FitsOneLine(ast)
|
||||
# function in the formatter.
|
||||
# Here, pos_from and pos_to refer to indices of characters -- not tokens.
|
||||
# ------------------------------------------------------------------------------
|
||||
def Ast(kind: string, value: any, pos_from: number, pos_to: number, contains_comment: bool): dict<any>
|
||||
return {kind: kind, value: value, pos_from: pos_from, pos_to: pos_to, contains_comment: contains_comment}
|
||||
def Ast(kind: string, value: any, pos_from: number, pos_to: number, contains_comment: bool, scanner: dict<any>): dict<any>
|
||||
# User-facing functionality wants start/end line and column -- not positions
|
||||
def CalcCoords(): list<dict<number>>
|
||||
const from = scanner.calcCoord(pos_from)
|
||||
# If expression ends at end of line, pos_to will be in next line.
|
||||
# That's undesired. Stay in the actual last line.
|
||||
var to = scanner.calcCoord(pos_to - 1)
|
||||
to.col += 1
|
||||
return [from, to]
|
||||
enddef
|
||||
return {kind: kind, value: value, pos_from: pos_from, pos_to: pos_to, contains_comment: contains_comment, CalcCoords: CalcCoords}
|
||||
enddef
|
||||
|
||||
def ParagraphAst(exprs: list<dict<any>>, pos_from: number, pos_to: number): dict<any>
|
||||
def FileAst(paragraphs: list<dict<any>>, pos_from: number, pos_to: number, scanner: dict<any>): dict<any>
|
||||
var contains_comment = false
|
||||
for paragraph in paragraphs
|
||||
if paragraph.contains_comment
|
||||
contains_comment = true
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return Ast('File', paragraphs, pos_from, pos_to, contains_comment, scanner)
|
||||
enddef
|
||||
|
||||
def ParagraphAst(exprs: list<dict<any>>, pos_from: number, pos_to: number, scanner: dict<any>): dict<any>
|
||||
var contains_comment = false
|
||||
for expr in exprs
|
||||
if expr.contains_comment
|
||||
@@ -29,10 +49,10 @@ def ParagraphAst(exprs: list<dict<any>>, pos_from: number, pos_to: number): dict
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return Ast('Paragraph', exprs, pos_from, pos_to, contains_comment)
|
||||
return Ast('Paragraph', exprs, pos_from, pos_to, contains_comment, scanner)
|
||||
enddef
|
||||
|
||||
def SExprAst(exprs: list<dict<any>>, pos_from: number, pos_to: number): dict<any>
|
||||
def SExprAst(exprs: list<dict<any>>, pos_from: number, pos_to: number, scanner: dict<any>): dict<any>
|
||||
var contains_comment = false
|
||||
for expr in exprs
|
||||
if expr.contains_comment
|
||||
@@ -40,15 +60,22 @@ def SExprAst(exprs: list<dict<any>>, pos_from: number, pos_to: number): dict<any
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return Ast('SExpr', exprs, pos_from, pos_to, contains_comment)
|
||||
return Ast('SExpr', exprs, pos_from, pos_to, contains_comment, scanner)
|
||||
enddef
|
||||
|
||||
def AtomAst(token: dict<any>): dict<any>
|
||||
return Ast('Atom', token, token.pos, token.pos + len(token.lexeme), token.kind == 8)
|
||||
def AtomAst(token: dict<any>, scanner: dict<any>): dict<any>
|
||||
return Ast('Atom', token, token.pos, token.pos + len(token.lexeme), token.kind == 8, scanner)
|
||||
enddef
|
||||
|
||||
def PrintAst(ast: dict<any>, indent = 0)
|
||||
echo repeat(' ', indent * 2) .. '[' .. ast.kind .. '] '
|
||||
const coords = ast.CalcCoords()
|
||||
|
||||
echo printf("[%5d-%-5d) [%4d:%-3d-%4d:%-3d) %s[%s] ",
|
||||
ast.pos_from, ast.pos_to,
|
||||
coords[0].line, coords[0].col,
|
||||
coords[1].line, coords[1].col,
|
||||
repeat(' ', indent * 2),
|
||||
ast.kind)
|
||||
|
||||
if ast.kind ==# 'Atom'
|
||||
echon ast.value.lexeme
|
||||
@@ -60,13 +87,18 @@ def PrintAst(ast: dict<any>, indent = 0)
|
||||
for v in ast.value
|
||||
call PrintAst(v, indent + 1)
|
||||
endfor
|
||||
elseif ast.kind ==# 'File'
|
||||
for v in ast.value
|
||||
call PrintAst(v, indent + 1)
|
||||
endfor
|
||||
endif
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Grammar
|
||||
# ------------------------------------------------------------------------------
|
||||
# Paragraph ::= Expr+
|
||||
# File ::= Paragraph+
|
||||
# Paragraph ::= Expr+ EndOfParagraph
|
||||
# Expr ::= SExpr | Atom
|
||||
# SExpr ::= '(' Expr* ')'
|
||||
|
||||
@@ -77,14 +109,16 @@ def AtStartOfLParen(scanner: dict<any>): bool
|
||||
return scanner.cur_token.kind == 0 # token_lparen
|
||||
enddef
|
||||
|
||||
def ParseLParen(scanner: dict<any>) # consumes token; no return
|
||||
def ParseLParen(scanner: dict<any>): dict<any>
|
||||
if debug
|
||||
scanner->smt2#scanner#Enforce(scanner->AtStartOfLParen(),
|
||||
"ParseLParen called but not at start of LParen",
|
||||
scanner.cur_token.pos)
|
||||
endif
|
||||
|
||||
const token = scanner.cur_token
|
||||
scanner->smt2#scanner#NextToken()
|
||||
return token
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -94,14 +128,16 @@ def AtStartOfRParen(scanner: dict<any>): bool
|
||||
return scanner.cur_token.kind == 1 # token_rparen
|
||||
enddef
|
||||
|
||||
def ParseRParen(scanner: dict<any>) # consumes token; no return
|
||||
def ParseRParen(scanner: dict<any>): dict<any>
|
||||
if debug
|
||||
scanner->smt2#scanner#Enforce(scanner->AtStartOfRParen(),
|
||||
"ParseRParen called but not at start of RParen",
|
||||
scanner.cur_token.pos)
|
||||
endif
|
||||
|
||||
const token = scanner.cur_token
|
||||
scanner->smt2#scanner#NextToken()
|
||||
return token
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -118,7 +154,7 @@ def ParseAtom(scanner: dict<any>): dict<any>
|
||||
scanner.cur_token.pos)
|
||||
endif
|
||||
|
||||
const ast = AtomAst(scanner.cur_token)
|
||||
const ast = AtomAst(scanner.cur_token, scanner)
|
||||
scanner->smt2#scanner#NextToken()
|
||||
return ast
|
||||
enddef
|
||||
@@ -129,6 +165,7 @@ enddef
|
||||
def AtStartOfExpr(scanner: dict<any>): bool
|
||||
return scanner->AtStartOfSExpr() || scanner->AtStartOfAtom()
|
||||
enddef
|
||||
|
||||
def ParseExpr(scanner: dict<any>): dict<any>
|
||||
if debug
|
||||
scanner->smt2#scanner#Enforce(scanner->AtStartOfExpr(),
|
||||
@@ -146,6 +183,7 @@ enddef
|
||||
# SExpr
|
||||
# ------------------------------------------------------------------------------
|
||||
const AtStartOfSExpr = funcref(AtStartOfLParen)
|
||||
|
||||
def ParseSExpr(scanner: dict<any>): dict<any>
|
||||
const pos_from = scanner.cur_token.pos
|
||||
|
||||
@@ -165,10 +203,10 @@ def ParseSExpr(scanner: dict<any>): dict<any>
|
||||
scanner->smt2#scanner#Enforce(scanner->AtStartOfRParen(),
|
||||
printf("Expected RParen but got %s", scanner.cur_token.kind->smt2#scanner#TokenKind2Str()),
|
||||
scanner.cur_token.pos)
|
||||
scanner->ParseRParen()
|
||||
const end_token = scanner->ParseRParen()
|
||||
|
||||
const pos_to = scanner.cur_token.pos
|
||||
return SExprAst(exprs, pos_from, pos_to)
|
||||
const pos_to = end_token.pos + 1
|
||||
return SExprAst(exprs, pos_from, pos_to, scanner)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -187,41 +225,132 @@ def ParseParagraph(scanner: dict<any>): dict<any>
|
||||
exprs->add(scanner->ParseExpr())
|
||||
endwhile
|
||||
|
||||
const pos_to = scanner.cur_token.pos
|
||||
return ParagraphAst(exprs, pos_from, pos_to)
|
||||
const pos_to = exprs[-1].pos_to
|
||||
return ParagraphAst(exprs, pos_from, pos_to, scanner)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# File
|
||||
# ------------------------------------------------------------------------------
|
||||
def ParseFile(scanner: dict<any>): dict<any>
|
||||
const pos_from = scanner.cur_token.pos
|
||||
|
||||
var paragraphs = []
|
||||
while scanner.cur_token.kind != 9 # token_eof
|
||||
const ast = scanner->ParseParagraph()
|
||||
paragraphs->add(ast)
|
||||
endwhile
|
||||
|
||||
const pos_to = empty(paragraphs) ? pos_from : paragraphs[-1].pos_to
|
||||
return FileAst(paragraphs, pos_from, pos_to, scanner)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Auxiliary
|
||||
#
|
||||
# TODO: MoveTo* functions rely on local search instead of proper (but slow)
|
||||
# scanning of the whole file and may be incorrect in corner cases.
|
||||
# Consider tweaking.
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# Returns true if successful, i.e. on move to '(' of outermost SExpr
|
||||
def MoveToOutermostSExpr(): bool
|
||||
var cur_pos = getpos('.')
|
||||
while true
|
||||
silent! normal! [(
|
||||
const new_pos = getpos('.')
|
||||
if cur_pos == new_pos
|
||||
break
|
||||
else
|
||||
cur_pos = new_pos
|
||||
endif
|
||||
endwhile
|
||||
|
||||
const cur_char = getline('.')[charcol('.') - 1]
|
||||
return cur_char == '('
|
||||
enddef
|
||||
|
||||
def CursorInSExpr(): bool
|
||||
const cursor = getpos('.')
|
||||
silent! normal! [(
|
||||
const res = cursor != getpos('.')
|
||||
call setpos('.', cursor)
|
||||
return res
|
||||
enddef
|
||||
|
||||
def MoveToStartOfCurrentParagraph()
|
||||
# Empty (or whitespace) lines outside of S-expressions separate paragraphs.
|
||||
# Nothing to do if cursor is already at such a line.
|
||||
if !(getline('.')->trim()->empty() && !CursorInSExpr())
|
||||
# Move backwards until an empty line that is not in an SExpr is found,
|
||||
# or -- if there is none -- to the first line of the file
|
||||
while true
|
||||
const empty_line = search('\m\C^\s*$', 'b', 1)
|
||||
if !CursorInSExpr()
|
||||
break
|
||||
elseif empty_line == 0
|
||||
cursor(1, 1)
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
endif
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Public functions
|
||||
# ------------------------------------------------------------------------------
|
||||
def smt2#parser#ParseCurrentParagraph(): dict<any>
|
||||
# source = [start of current paragraph, EOF]
|
||||
# Note: This is needed since `silent! normal! {y}` may not yank full paragraphs
|
||||
# in the context of multiline expressions
|
||||
const cursor = getpos('.')
|
||||
silent! normal! {
|
||||
const line_offset = line('.')
|
||||
const source = join(getline('.', '$'), "\n")
|
||||
MoveToStartOfCurrentParagraph()
|
||||
const from = getpos('.')
|
||||
call setpos('.', cursor)
|
||||
|
||||
var scanner = smt2#scanner#Scanner(source, line_offset)
|
||||
# source = [paragraph of outermost SExpr, EOF]
|
||||
# Note: This is needed since `silent! normal! {` is not guaranteed to jump
|
||||
# to the start of the paragraph, e.g. if newlines occur in between.
|
||||
const lines_to_format = getline(from[1], '$')
|
||||
const source = join(lines_to_format, "\n")
|
||||
|
||||
var scanner = smt2#scanner#Scanner(source, from[1], from[2])
|
||||
const ast = scanner->ParseParagraph()
|
||||
|
||||
if debug | ast->PrintAst() | endif
|
||||
return ast
|
||||
enddef
|
||||
|
||||
def smt2#parser#ParseAllParagraphs(): list<dict<any>>
|
||||
# source = current buffer
|
||||
const source = join(getline(1, '$'), "\n")
|
||||
def smt2#parser#ParseOutermostSExpr(): dict<any>
|
||||
const cursor = getpos('.')
|
||||
if ! MoveToOutermostSExpr()
|
||||
throw "Cursor is not in an S-expression!"
|
||||
endif
|
||||
const from = getpos('.')
|
||||
call setpos('.', cursor)
|
||||
|
||||
var scanner = smt2#scanner#Scanner(source)
|
||||
var asts = []
|
||||
while scanner.cur_token.kind != 9 # token_eof
|
||||
const ast = scanner->ParseParagraph()
|
||||
asts->add(ast)
|
||||
# source = [start of outermost SExpr, EOF]
|
||||
# Note: This is needed since `silent! normal! %` is not guaranteed to jump
|
||||
# to the matching ')', e.g. if an unmatched '(' occurs in a comment.
|
||||
const lines_to_format = getline(from[1], '$')
|
||||
const source = join(lines_to_format, "\n")
|
||||
|
||||
if debug | ast->PrintAst() | endif
|
||||
endwhile
|
||||
return asts
|
||||
var scanner = smt2#scanner#Scanner(source, from[1], from[2])
|
||||
const ast = scanner->ParseSExpr()
|
||||
|
||||
if debug | ast->PrintAst() | endif
|
||||
return ast
|
||||
enddef
|
||||
|
||||
def smt2#parser#ParseFile(): dict<any>
|
||||
const cursor = getpos('.')
|
||||
cursor(1, 1)
|
||||
const first_non_empty_line = search('.')
|
||||
call setpos('.', cursor)
|
||||
|
||||
# source = [first non-empty line, EOF]
|
||||
const source = join(getline(first_non_empty_line, '$'), "\n")
|
||||
|
||||
var scanner = smt2#scanner#Scanner(source, first_non_empty_line)
|
||||
const ast = scanner->ParseFile()
|
||||
|
||||
if debug | ast->PrintAst() | endif
|
||||
return ast
|
||||
enddef
|
||||
|
||||
@@ -56,7 +56,7 @@ enddef
|
||||
|
||||
def PrettyPrint(scanner: dict<any>, token: dict<any>)
|
||||
const coord = scanner->Pos2Coord(token.pos)
|
||||
echo printf("%4d:%-3d (%5d) %8s %s", coord.line, coord.col, token.pos, token.kind->smt2#scanner#TokenKind2Str(), token.lexeme)
|
||||
echo printf("%5d %4d:%-3d %8s %s", token.pos, coord.line, coord.col, token.kind->smt2#scanner#TokenKind2Str(), token.lexeme)
|
||||
enddef
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -72,12 +72,14 @@ enddef
|
||||
# TODO: Enforce restriction to ASCII? We should if we use the lookup table below
|
||||
# TODO: Do not take a string but a character stream (or just buffer and pos)?
|
||||
|
||||
def smt2#scanner#Scanner(source: string, line_offset = 1): dict<any>
|
||||
def smt2#scanner#Scanner(source: string, start_line = 1, start_col = 1): dict<any>
|
||||
var scanner = {
|
||||
chars: source->trim(" \t\n\r", 2)->split('\zs'),
|
||||
line_offset: line_offset, # start line of source string in buffer
|
||||
pos: 0, # pos in source string -- not column in line
|
||||
at_new_paragraph: false}
|
||||
chars: source->trim(" \n\r\t", 2)->split('\zs'),
|
||||
line_offset: start_line, # start line of source string in buffer
|
||||
pos: start_col - 1, # pos in source string -- not column in line
|
||||
at_new_paragraph: false,
|
||||
}
|
||||
scanner.calcCoord = (pos: number): dict<number> => Pos2Coord(scanner, pos)
|
||||
|
||||
if scanner.chars->empty()
|
||||
scanner.at_eof = true
|
||||
|
||||
@@ -9,6 +9,11 @@ set cpoptions&vim
|
||||
let $TF_CLI_ARGS_fmt=''
|
||||
|
||||
function! terraform#fmt() abort
|
||||
silent execute 'w !'.g:terraform_binary_path.' fmt -check -'
|
||||
if v:shell_error == 0
|
||||
return
|
||||
endif
|
||||
|
||||
" Save the view.
|
||||
let curw = winsaveview()
|
||||
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'unison', 'autoload/unison.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Unison functionality for Vim, including type/term omnicompletion.
|
||||
"
|
||||
" Maintainer: Unison Computing
|
||||
" Original Author: Cody Allen (ceedubs)
|
||||
|
||||
if exists('g:autoloaded_unison')
|
||||
finish
|
||||
endif
|
||||
let g:autoloaded_unison = 1
|
||||
|
||||
let s:required_config_value = "!REQUIRED!"
|
||||
|
||||
" adapted from https://github.com/rust-lang/rust.vim/blob/4aa69b84c8a58fcec6b6dad6fe244b916b1cf830/autoload/rust.vim#L9-L18
|
||||
function! s:config(name, default) abort
|
||||
let name = 'unison_' . a:name
|
||||
" Local buffer variable with same name takes predeence over global
|
||||
if has_key(b:, name)
|
||||
return get(b:, name)
|
||||
elseif has_key(g:, name)
|
||||
return get(g:, name)
|
||||
elseif a:default == s:required_config_value
|
||||
throw 'Missing required configuration value: ' . name
|
||||
else
|
||||
return a:default
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:curl_path() abort
|
||||
return s:config('curl_path', "curl")
|
||||
endfunction
|
||||
|
||||
function! s:jq_path() abort
|
||||
return s:config('jq_path', "jq")
|
||||
endfunction
|
||||
|
||||
function! unison#SetBufferDefaults() abort
|
||||
if s:config('set_buffer_defaults', 1)
|
||||
" Since Unison completion is fuzzy and not prefix-based, 'longest' doesn't
|
||||
" work well, and 'noinsert' behaves a little better.
|
||||
setlocal completeopt=menuone,noinsert,preview
|
||||
|
||||
setlocal omnifunc=unison#Complete
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Unison completion satisfying the standard vim completion signature, such
|
||||
" that it can be assigned to omnifunc.
|
||||
" vim will first call this to find the base input that should be completed,
|
||||
" and then will call it again with the base input.
|
||||
function! unison#Complete(findstart, base) abort
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
" Examples of where we want to count the start of a word:
|
||||
"
|
||||
" foo List.fold<cursor>
|
||||
" ^
|
||||
"
|
||||
" {Abor<cursor>
|
||||
" ^
|
||||
"
|
||||
" (List.fol<cursor>
|
||||
" ^
|
||||
while start > 0 && line[start - 1] !~ '\v\s|[(){}\[\]]'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
return unison#CompleteForBase(a:base)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Return an array of completion items for the provided base input. For example
|
||||
" base could be 'List.foldL', in which case the top result would probably be
|
||||
" 'List.foldLeft'.
|
||||
function! unison#CompleteForBase(base) abort
|
||||
let resultLimit = s:config('complete_result_limit', 20)
|
||||
let apiHost = s:config('api_host', 'localhost')
|
||||
let apiPort = s:config('api_port', s:required_config_value)
|
||||
let apiToken = s:config('api_token', s:required_config_value)
|
||||
let apiUri = 'http://' . apiHost . ':' . apiPort . '/' . apiToken . '/api/find'
|
||||
|
||||
let curlCommand = s:curl_path() . " -Gfs
|
||||
\ --data-urlencode 'limit=" . resultLimit . "'
|
||||
\ --data-urlencode 'query=" . a:base . "' "
|
||||
\ . apiUri
|
||||
|
||||
let jqFilter = '
|
||||
\ def prettyTermType: .termType|[(.[] | .segment)]|add;
|
||||
\ def prettyTypeDef: if .tag == "BuiltinObject" then "builtin type " else "" end + (.contents|[(.[] | .segment)]|add);
|
||||
\ def termToMatch: {
|
||||
\ word: .bestFoundTermName,
|
||||
\ info: (.namedTerm.termName + " : " + (.namedTerm|prettyTermType)),
|
||||
\ menu: .namedTerm|prettyTermType
|
||||
\ };
|
||||
\ def typeToMatch: {
|
||||
\ word: .bestFoundTypeName,
|
||||
\ info: (.namedType.typeName + " : " + (.typeDef|prettyTypeDef)),
|
||||
\ menu: .typeDef|prettyTypeDef
|
||||
\ };
|
||||
\ .[][1]|(
|
||||
\ (select(.tag == "FoundTermResult")|.contents|termToMatch),
|
||||
\ (select(.tag == "FoundTypeResult")|.contents|typeToMatch)
|
||||
\ )'
|
||||
|
||||
let command = curlCommand . " | " . s:jq_path() . " -c '" . jqFilter . "'"
|
||||
let lines = system(command)
|
||||
let resultObjects = split(lines, "\n")
|
||||
call map(resultObjects, {_, val -> json_decode(val)})
|
||||
return resultObjects
|
||||
endfunction
|
||||
|
||||
" vim: set et sw=2 sts=2 ts=2:
|
||||
@@ -128,6 +128,7 @@ let attributes_value = {
|
||||
\ 'http-equiv': ['Text', ''],
|
||||
\ 'icon': ['URL', ''],
|
||||
\ 'id': ['Text', ''],
|
||||
\ 'inert': ['Bool', ''],
|
||||
\ 'ismap': ['Bool', ''],
|
||||
\ 'keytype': ['Text', ''],
|
||||
\ 'label': ['Text', ''],
|
||||
@@ -194,7 +195,7 @@ let attributes_value = {
|
||||
\ }
|
||||
|
||||
if g:html5_event_handler_attributes_complete == 1
|
||||
let event_handler_attributes = {'onabort': [], 'onblur': [], 'oncanplay': [], 'oncanplaythrough': [], 'onchange': [], 'onclick': [], 'oncontextmenu': [], 'ondblclick': [], 'ondrag': [], 'ondragend': [], 'ondragenter': [], 'ondragleave': [], 'ondragover': [], 'ondragstart': [], 'ondrop': [], 'ondurationchange': [], 'onemptied': [], 'onended': [], 'onerror': [], 'onfocus': [], 'onformchange': [], 'onforminput': [], 'oninput': [], 'oninvalid': [], 'onkeydown': [], 'onkeypress': [], 'onkeyup': [], 'onload': [], 'onloadeddata': [], 'onloadedmetadata': [], 'onloadstart': [], 'onmousedown': [], 'onmousemove': [], 'onmouseout': [], 'onmouseover': [], 'onmouseup': [], 'onmousewheel': [], 'onpause': [], 'onplay': [], 'onplaying': [], 'onprogress': [], 'onratechange': [], 'onreadystatechange': [], 'onscroll': [], 'onseeked': [], 'onseeking': [], 'onselect': [], 'onshow': [], 'onstalled': [], 'onsubmit': [], 'onsuspend': [], 'ontimeupdate': [], 'onvolumechange': [], 'onwaiting': [], 'onselectstart': [], 'onselectchange': []}
|
||||
let event_handler_attributes = {'onabort': [], 'onblur': [], 'oncancel': [], 'oncanplay': [], 'oncanplaythrough': [], 'onchange': [], 'onclick': [], 'oncontextmenu': [], 'ondblclick': [], 'ondrag': [], 'ondragend': [], 'ondragenter': [], 'ondragleave': [], 'ondragover': [], 'ondragstart': [], 'ondrop': [], 'ondurationchange': [], 'onemptied': [], 'onended': [], 'onerror': [], 'onfocus': [], 'onformchange': [], 'onforminput': [], 'oninput': [], 'oninvalid': [], 'onkeydown': [], 'onkeypress': [], 'onkeyup': [], 'onload': [], 'onloadeddata': [], 'onloadedmetadata': [], 'onloadstart': [], 'onmousedown': [], 'onmousemove': [], 'onmouseout': [], 'onmouseover': [], 'onmouseup': [], 'onmousewheel': [], 'onpause': [], 'onplay': [], 'onplaying': [], 'onprogress': [], 'onratechange': [], 'onreadystatechange': [], 'onscroll': [], 'onseeked': [], 'onseeking': [], 'onselect': [], 'onshow': [], 'onstalled': [], 'onsubmit': [], 'onsuspend': [], 'ontimeupdate': [], 'onvolumechange': [], 'onwaiting': [], 'onselectstart': [], 'onselectchange': []}
|
||||
let global_attributes = extend(global_attributes, event_handler_attributes)
|
||||
|
||||
let body_attributes = {'onafterprint': [], 'onbeforeprint': [], 'onbeforeunload': [], 'onblur': [], 'onerror': [], 'onfocus': [], 'onhashchange': [], 'onload': [], 'onmessage': [], 'onoffline': [], 'ononline': [], 'onpopstate': [], 'onredo': [], 'onresize': [], 'onstorage': [], 'onundo': [], 'onunload': []}
|
||||
@@ -205,6 +206,7 @@ if g:html5_event_handler_attributes_complete == 1
|
||||
\ 'onbeforeprint': ['Script', ''],
|
||||
\ 'onbeforeunload': ['Script', ''],
|
||||
\ 'onblur': ['Script', ''],
|
||||
\ 'oncancel': ['Script', ''],
|
||||
\ 'oncanplay': ['Script', ''],
|
||||
\ 'oncanplaythrough': ['Script', ''],
|
||||
\ 'onchange': ['Script', ''],
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: eRuby
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
29
compiler/jq.vim
Normal file
29
compiler/jq.vim
Normal file
@@ -0,0 +1,29 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'jq', 'compiler/jq.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Compiler: jq
|
||||
" Maintainer: Vito <vito.blog@gmail.com>
|
||||
" Last Change: 2024 Apr 17
|
||||
" Upstream: https://github.com/vito-c/jq.vim
|
||||
|
||||
if exists('b:current_compiler')
|
||||
finish
|
||||
endif
|
||||
let b:current_compiler = 'jq'
|
||||
|
||||
let s:save_cpoptions = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
if has('unix')
|
||||
CompilerSet makeprg=jq\ -f\ %:S\ /dev/null
|
||||
else
|
||||
CompilerSet makeprg=jq\ -f\ %:S\ nul
|
||||
endif
|
||||
CompilerSet errorformat=%E%m\ at\ \\<%o\\>\\,\ line\ %l:,
|
||||
\%Z,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpoptions = s:save_cpoptions
|
||||
unlet s:save_cpoptions
|
||||
@@ -23,7 +23,11 @@ if !exists('g:ledger_main')
|
||||
let g:ledger_main = '%'
|
||||
endif
|
||||
|
||||
if !g:ledger_is_hledger
|
||||
if !exists ('b:is_hledger')
|
||||
let b:is_hledger = g:ledger_is_hledger
|
||||
endif
|
||||
|
||||
if !b:is_hledger
|
||||
" Capture Ledger errors (%-C ignores all lines between "While parsing..." and "Error:..."):
|
||||
CompilerSet errorformat=%EWhile\ parsing\ file\ \"%f\"\\,\ line\ %l:,%ZError:\ %m,%-C%.%#
|
||||
" Capture Ledger warnings:
|
||||
@@ -32,5 +36,8 @@ if !g:ledger_is_hledger
|
||||
CompilerSet errorformat+=%-G%.%#
|
||||
exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . substitute(shellescape(expand(g:ledger_main)), ' ', '\\ ', 'g') . '\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ source\ ' . shellescape(expand(g:ledger_main))
|
||||
else
|
||||
exe 'CompilerSet makeprg=('.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . substitute(shellescape(expand(g:ledger_main)), ' ', '\\ ', 'g') . '\ print\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ >\ /dev/null)'
|
||||
exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . substitute(shellescape(expand(g:ledger_main)), ' ', '\\ ', 'g') . '\ check\ '. substitute(g:ledger_extra_options, ' ', '\\ ', 'g')
|
||||
CompilerSet errorformat=hledger:\ %trror:\ %f:%l:%c:
|
||||
CompilerSet errorformat+=hledger:\ %trror:\ %f:%l:
|
||||
CompilerSet errorformat+=hledger:\ %trror:\ %f:%l-%.%#:
|
||||
endif
|
||||
|
||||
@@ -7,7 +7,7 @@ endif
|
||||
" Maintainer: Heikki Junes <hjunes@cc.hut.fi>
|
||||
" License: This file is part of LilyPond, the GNU music typesetter.
|
||||
"
|
||||
" Copyright (C) 2004, 2007 Heikki Junes <hjunes@cc.hut.fi>
|
||||
" Copyright (C) 2004--2022 Heikki Junes <hjunes@cc.hut.fi>
|
||||
"
|
||||
" LilyPond is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -7,6 +7,7 @@ endif
|
||||
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
|
||||
" URL: https://github.com/ocaml/vim-ocaml
|
||||
" Last Change:
|
||||
" 2023 Nov 24 - Improved error format (Samuel Hym)
|
||||
" 2021 Nov 03 - Improved error format (Jules Aguillon)
|
||||
" 2020 Mar 28 - Improved error format (Thomas Leonard)
|
||||
" 2017 Nov 26 - Improved error format (Markus Mottl)
|
||||
@@ -15,17 +16,6 @@ endif
|
||||
" Marc Weber's comments:
|
||||
" Setting makeprg doesn't make sense, because there is ocamlc, ocamlopt,
|
||||
" ocamake and whatnot. So which one to use?
|
||||
"
|
||||
" This error format was moved from ftplugin/ocaml.vim to this file,
|
||||
" because ftplugin is the wrong file to set an error format
|
||||
" and the error format itself is annoying because it joins many lines in this
|
||||
" error case:
|
||||
"
|
||||
" Error: The implementation foo.ml does not match the interface foo.cmi:
|
||||
" Modules do not match case.
|
||||
"
|
||||
" So having it here makes people opt-in
|
||||
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -35,19 +25,37 @@ let current_compiler = "ocaml"
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
CompilerSet errorformat =
|
||||
\%EFile\ \"%f\"\\,\ lines\ %*\\d-%l\\,\ characters\ %c-%*\\d:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d\ %.%#,
|
||||
" Patch 8.2.4329 introduces %e and %k as end line and end column positions
|
||||
|
||||
if has('patch-8.2.4329')
|
||||
CompilerSet errorformat =
|
||||
\%EFile\ \"%f\"\\,\ lines\ %l-%e\\,\ characters\ %c-%k:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%k:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%k\ %.%#,
|
||||
else
|
||||
CompilerSet errorformat =
|
||||
\%EFile\ \"%f\"\\,\ lines\ %l-%*\\d\\,\ characters\ %c-%*\\d:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d\ %.%#,
|
||||
endif
|
||||
|
||||
CompilerSet errorformat +=
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l:,
|
||||
\%+EReference\ to\ unbound\ regexp\ name\ %m,
|
||||
\%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
|
||||
\%Wocamlyacc:\ w\ -\ %m,
|
||||
\%-Zmake%.%#,
|
||||
\%C%*\\d\ \|%.%#,
|
||||
\%C%p^%#,
|
||||
\%C%m,
|
||||
\%-Zmake%.%#
|
||||
|
||||
if get(g:, "ocaml_compiler_compact_messages", v:true)
|
||||
CompilerSet errorformat +=
|
||||
\%C%*\\d\ \|%.%#,
|
||||
\%C%p^%#,
|
||||
\%C%m
|
||||
endif
|
||||
|
||||
CompilerSet errorformat +=
|
||||
\%Z,
|
||||
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
|
||||
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
|
||||
\%D%*\\a:\ Entering\ directory\ `%f',
|
||||
@@ -58,8 +66,12 @@ CompilerSet errorformat =
|
||||
\%X%*\\a:\ Leaving\ directory\ '%f',
|
||||
\%DEntering\ directory\ '%f',
|
||||
\%XLeaving\ directory\ '%f',
|
||||
\%DMaking\ %*\\a\ in\ %f,
|
||||
\%+G%m
|
||||
\%DMaking\ %*\\a\ in\ %f
|
||||
|
||||
if get(g:, "ocaml_compiler_compact_messages", v:true)
|
||||
CompilerSet errorformat +=
|
||||
\%+G%m
|
||||
endif
|
||||
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
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.8.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.
|
||||
|
||||
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:
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: Rake
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: RSpec
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
@@ -7,7 +7,6 @@ endif
|
||||
" Function: Syntax check and/or error reporting
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: Test::Unit - Ruby Unit Testing Framework
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
||||
@@ -22,4 +22,4 @@ endif
|
||||
|
||||
let &l:makeprg = g:typescript_compiler_binary . ' ' . g:typescript_compiler_options . ' $* %'
|
||||
|
||||
CompilerSet errorformat=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
||||
CompilerSet errorformat+=%+A\ %#%f\ %#(%l\\\,%c):\ %m,%C%m
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -62,7 +62,7 @@ if exists('g:loaded_matchit') && !exists('b:match_words')
|
||||
let b:match_ignorecase = 0
|
||||
|
||||
let b:match_words =
|
||||
\ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|struct\|lib\|macro\|ifdef\|def\|begin\|enum\|annotation\)\>=\@!' .
|
||||
\ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|struct\|lib\|macro\|ifdef\|\%(abstract\s\+\)\@<!def\|begin\|enum\|annotation\)\>=\@!' .
|
||||
\ ':' .
|
||||
\ '\<\%(else\|elsif\|ensure\|when\|in\|rescue\|break\|next\)\>' .
|
||||
\ ':' .
|
||||
|
||||
@@ -11,37 +11,4 @@ setlocal commentstring=--\ %s
|
||||
|
||||
set smarttab
|
||||
|
||||
if exists('g:dhall_use_ctags')
|
||||
if g:dhall_use_ctags == 1
|
||||
autocmd BufWritePost *.dhall silent !ctags -R .
|
||||
endif
|
||||
endif
|
||||
|
||||
function! StripTrailingWhitespace()
|
||||
let myline=line('.')
|
||||
let mycolumn = col('.')
|
||||
exec 'silent %s/ *$//'
|
||||
call cursor(myline, mycolumn)
|
||||
endfunction
|
||||
|
||||
if exists('g:dhall_strip_whitespace')
|
||||
if g:dhall_strip_whitespace == 1
|
||||
au BufWritePre *.dhall silent! call StripTrailingWhitespace()
|
||||
endif
|
||||
endif
|
||||
|
||||
function! DhallFormat()
|
||||
let cursor = getpos('.')
|
||||
exec 'normal! gg'
|
||||
exec 'silent !dhall format ' . expand('%')
|
||||
exec 'e'
|
||||
call setpos('.', cursor)
|
||||
endfunction
|
||||
|
||||
if exists('g:dhall_format')
|
||||
if g:dhall_format == 1
|
||||
au BufWritePost *.dhall call DhallFormat()
|
||||
endif
|
||||
endif
|
||||
|
||||
au BufNewFile,BufRead *.dhall setl shiftwidth=2
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: eRuby
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -89,8 +88,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 +125,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
|
||||
|
||||
19
ftplugin/git.vim
Normal file
19
ftplugin/git.vim
Normal file
@@ -0,0 +1,19 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'git', 'ftplugin/git.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin
|
||||
" Language: generic git output
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2023 Mar 26
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal nomodeline
|
||||
|
||||
let b:undo_ftplugin = "setl modeline<"
|
||||
@@ -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"))
|
||||
|
||||
@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'ftplugin/graphql.v
|
||||
finish
|
||||
endif
|
||||
|
||||
" Copyright (c) 2016-2021 Jon Parise <jon@indelible.org>
|
||||
" Copyright (c) Jon Parise <jon@indelible.org>
|
||||
"
|
||||
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
" of this software and associated documentation files (the "Software"), to
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -31,7 +31,7 @@ if get(g:, 'hcl_fold_sections', 0)
|
||||
endif
|
||||
|
||||
" Set the commentstring
|
||||
setlocal commentstring=#%s
|
||||
setlocal commentstring=#\ %s
|
||||
let b:undo_ftplugin .= ' commentstring<'
|
||||
|
||||
if get(g:, 'hcl_align', 0) && exists(':Tabularize')
|
||||
|
||||
@@ -25,77 +25,5 @@ endif
|
||||
" Prefer Vim help instead of manpages.
|
||||
setlocal keywordprg=:help
|
||||
|
||||
if !exists('g:no_plugin_maps')
|
||||
function! s:show_toc() abort
|
||||
let bufname = bufname('%')
|
||||
let info = getloclist(0, {'winid': 1})
|
||||
if !empty(info) && getwinvar(info.winid, 'qf_toc') ==# bufname
|
||||
lopen
|
||||
return
|
||||
endif
|
||||
|
||||
let toc = []
|
||||
let lnum = 2
|
||||
let last_line = line('$') - 1
|
||||
let last_added = 0
|
||||
let has_section = 0
|
||||
let has_sub_section = 0
|
||||
|
||||
while lnum && lnum <= last_line
|
||||
let level = 0
|
||||
let add_text = ''
|
||||
let text = getline(lnum)
|
||||
|
||||
if text =~# '^=\+$' && lnum + 1 < last_line
|
||||
" A de-facto section heading. Other headings are inferred.
|
||||
let has_section = 1
|
||||
let has_sub_section = 0
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
let text = getline(lnum)
|
||||
let add_text = text
|
||||
while add_text =~# '\*[^*]\+\*\s*$'
|
||||
let add_text = matchstr(add_text, '.*\ze\*[^*]\+\*\s*$')
|
||||
endwhile
|
||||
elseif text =~# '^[A-Z0-9][-A-ZA-Z0-9 .][-A-Z0-9 .():]*\%([ \t]\+\*.\+\*\)\?$'
|
||||
" Any line that's yelling is important.
|
||||
let has_sub_section = 1
|
||||
let level = has_section
|
||||
let add_text = matchstr(text, '.\{-}\ze\s*\%([ \t]\+\*.\+\*\)\?$')
|
||||
elseif text =~# '\~$'
|
||||
\ && matchstr(text, '^\s*\zs.\{-}\ze\s*\~$') !~# '\t\|\s\{2,}'
|
||||
\ && getline(lnum - 1) =~# '^\s*<\?$\|^\s*\*.*\*$'
|
||||
\ && getline(lnum + 1) =~# '^\s*>\?$\|^\s*\*.*\*$'
|
||||
" These lines could be headers or code examples. We only want the
|
||||
" ones that have subsequent lines at the same indent or more.
|
||||
let l = nextnonblank(lnum + 1)
|
||||
if getline(l) =~# '\*[^*]\+\*$'
|
||||
" Ignore tag lines
|
||||
let l = nextnonblank(l + 1)
|
||||
endif
|
||||
|
||||
if indent(lnum) <= indent(l)
|
||||
let level = has_section + has_sub_section
|
||||
let add_text = matchstr(text, '\S.*')
|
||||
endif
|
||||
endif
|
||||
|
||||
let add_text = substitute(add_text, '\s\+$', '', 'g')
|
||||
if !empty(add_text) && last_added != lnum
|
||||
let last_added = lnum
|
||||
call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum,
|
||||
\ 'text': repeat(' ', level) . add_text})
|
||||
endif
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
endwhile
|
||||
|
||||
call setloclist(0, toc, ' ')
|
||||
call setloclist(0, [], 'a', {'title': 'Help TOC'})
|
||||
lopen
|
||||
let w:qf_toc = bufname
|
||||
endfunction
|
||||
|
||||
nnoremap <silent><buffer> gO :call <sid>show_toc()<cr>
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -2,4 +2,19 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'jq', 'ftplugin/jq.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim compiler file
|
||||
" Language: jq
|
||||
" Maintainer: Vito <vito.blog@gmail.com>
|
||||
" Last Change: 2024 Apr 17
|
||||
" Upstream: https://github.com/vito-c/jq.vim
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = 'setl inc< commentstring<'
|
||||
|
||||
setlocal include=^\\s*\\%(import\\\|include\\)
|
||||
setlocal commentstring=#%s
|
||||
compiler jq
|
||||
|
||||
@@ -8,6 +8,9 @@ endif
|
||||
" -- fmt
|
||||
command! -nargs=0 JsonnetFmt call jsonnet#Format()
|
||||
|
||||
" -- eval
|
||||
command! -nargs=0 JsonnetEval call jsonnet#Eval()
|
||||
|
||||
setlocal commentstring=//\ %s
|
||||
|
||||
|
||||
|
||||
@@ -26,11 +26,17 @@ 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<"
|
||||
\ . " define< fo< 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
|
||||
let b:undo_ftplugin .= " | setlocal expandtab< shiftwidth<"
|
||||
endif
|
||||
|
||||
" MatchIt plugin support
|
||||
if exists("loaded_matchit")
|
||||
let b:match_ignorecase = 0
|
||||
@@ -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
|
||||
@@ -103,7 +109,7 @@ let b:smartcomment_force_linemode = 1 " for carlobaldassi/vim-smartcomment
|
||||
|
||||
if has("gui_win32")
|
||||
let b:browsefilter = "Julia Source Files (*.jl)\t*.jl\n"
|
||||
let b:undo_ftplugin = b:undo_ftplugin . " | unlet! b:browsefilter"
|
||||
let b:undo_ftplugin .= " | unlet! b:browsefilter"
|
||||
endif
|
||||
|
||||
" Lookup documents
|
||||
|
||||
21
ftplugin/just.vim
Normal file
21
ftplugin/just.vim
Normal file
@@ -0,0 +1,21 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'just', 'ftplugin/just.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim ftplugin file
|
||||
" Language: Justfile
|
||||
" Maintainer: Noah Bogart <noah.bogart@hey.com>
|
||||
" URL: https://github.com/NoahTheDuke/vim-just.git
|
||||
" Last Change: 2023 Jul 08
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal iskeyword+=-
|
||||
setlocal comments=n:#
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
let b:undo_ftplugin = "setlocal iskeyword< comments< commentstring<"
|
||||
@@ -7,8 +7,7 @@ endif
|
||||
" Maintainer: Heikki Junes <hjunes@cc.hut.fi>
|
||||
" License: This file is part of LilyPond, the GNU music typesetter.
|
||||
"
|
||||
" Copyright (C) 1998, 2002, 2004, 2010, 2016
|
||||
" Han-Wen Nienhuys <hanwen@xs4all.nl>
|
||||
" Copyright (C) 1998--2022 Han-Wen Nienhuys <hanwen@xs4all.nl>
|
||||
"
|
||||
" LilyPond is free software: you can redistribute it and/or modify
|
||||
" it under the terms of the GNU General Public License as published by
|
||||
@@ -36,6 +35,9 @@ endif
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal autoindent
|
||||
setlocal shiftwidth=2
|
||||
"
|
||||
@@ -77,3 +79,17 @@ setlocal dictionary-=$VIM/syntax/lilypond-words dictionary+=$VIM/syntax/lilypond
|
||||
setlocal complete-=k complete+=k
|
||||
"
|
||||
setlocal showmatch
|
||||
|
||||
let b:undo_ftplugin = "setlocal autoindent< cpoptions< complete< dictionary< showmatch< shiftwidth< wildcharm< wildmenu<" .
|
||||
\ " | silent! execute 'unmap <buffer> <F4>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F5>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F6>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F7>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F8>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F9>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F10>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <F12>'" .
|
||||
\ " | silent! execute 'unmap <buffer> <S-F12>'"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -4,7 +4,7 @@ endif
|
||||
|
||||
"TODO print messages when on visual mode. I only see VISUAL, not the messages.
|
||||
|
||||
" Function interface phylosophy:
|
||||
" Function interface philosophy:
|
||||
"
|
||||
" - functions take arbitrary line numbers as parameters.
|
||||
" Current cursor line is only a suitable default parameter.
|
||||
@@ -60,7 +60,7 @@ let s:levelRegexpDict = {
|
||||
\ 6: '\v^######[^#]@='
|
||||
\ }
|
||||
|
||||
" Maches any header level of any type.
|
||||
" Matches any header level of any type.
|
||||
"
|
||||
" This could be deduced from `s:levelRegexpDict`, but it is more
|
||||
" efficient to have a single regexp for this.
|
||||
@@ -498,7 +498,9 @@ endfunction
|
||||
function! s:SetexToAtx(line1, line2)
|
||||
let l:originalNumLines = line('$')
|
||||
execute 'silent! ' . a:line1 . ',' . a:line2 . 'substitute/\v(.*\S.*)\n\=+$/# \1/'
|
||||
execute 'silent! ' . a:line1 . ',' . a:line2 . 'substitute/\v(.*\S.*)\n-+$/## \1/'
|
||||
|
||||
let l:changed = l:originalNumLines - line('$')
|
||||
execute 'silent! ' . a:line1 . ',' . (a:line2 - l:changed) . 'substitute/\v(.*\S.*)\n-+$/## \1'
|
||||
return l:originalNumLines - line('$')
|
||||
endfunction
|
||||
|
||||
@@ -540,6 +542,19 @@ endfunction
|
||||
"
|
||||
function! s:TableFormat()
|
||||
let l:pos = getpos('.')
|
||||
|
||||
if get(g:, 'vim_markdown_borderless_table', 0)
|
||||
" add `|` to the beginning of the line if it isn't present
|
||||
normal! {
|
||||
call search('|')
|
||||
execute 'silent .,''}s/\v^(\s{0,})\|?([^\|])/\1|\2/e'
|
||||
|
||||
" add `|` to the end of the line if it isn't present
|
||||
normal! {
|
||||
call search('|')
|
||||
execute 'silent .,''}s/\v([^\|])\|?(\s{0,})$/\1|\2/e'
|
||||
endif
|
||||
|
||||
normal! {
|
||||
" Search instead of `normal! j` because of the table at beginning of file edge case.
|
||||
call search('|')
|
||||
@@ -550,7 +565,7 @@ function! s:TableFormat()
|
||||
let l:flags = (&gdefault ? '' : 'g')
|
||||
execute 's/\(:\@<!-:\@!\|[^|:-]\)//e' . l:flags
|
||||
execute 's/--/-/e' . l:flags
|
||||
Tabularize /|
|
||||
Tabularize /\(\\\)\@<!|
|
||||
" Move colons for alignment to left or right side of the cell.
|
||||
execute 's/:\( \+\)|/\1:|/e' . l:flags
|
||||
execute 's/|\( \+\):/|:\1/e' . l:flags
|
||||
@@ -658,7 +673,12 @@ endfunction
|
||||
function! s:OpenUrlUnderCursor()
|
||||
let l:url = s:Markdown_GetUrlForPosition(line('.'), col('.'))
|
||||
if l:url !=# ''
|
||||
call s:VersionAwareNetrwBrowseX(l:url)
|
||||
if l:url =~? 'http[s]\?:\/\/[[:alnum:]%\/_#.-]*'
|
||||
"Do nothing
|
||||
else
|
||||
let l:url = expand(expand('%:h').'/'.l:url)
|
||||
endif
|
||||
call s:VersionAwareNetrwBrowseX(l:url)
|
||||
else
|
||||
echomsg 'The cursor is not on a link.'
|
||||
endif
|
||||
@@ -716,7 +736,7 @@ if !exists('*s:EditUrlUnderCursor')
|
||||
execute l:editmethod l:url
|
||||
endif
|
||||
if l:anchor !=# ''
|
||||
silent! execute '/'.l:anchor
|
||||
call search(l:anchor, 's')
|
||||
endif
|
||||
else
|
||||
execute l:editmethod . ' <cfile>'
|
||||
@@ -762,7 +782,7 @@ endif
|
||||
command! -buffer -range=% HeaderDecrease call s:HeaderDecrease(<line1>, <line2>)
|
||||
command! -buffer -range=% HeaderIncrease call s:HeaderDecrease(<line1>, <line2>, 1)
|
||||
command! -buffer -range=% SetexToAtx call s:SetexToAtx(<line1>, <line2>)
|
||||
command! -buffer TableFormat call s:TableFormat()
|
||||
command! -buffer -range TableFormat call s:TableFormat()
|
||||
command! -buffer Toc call s:Toc()
|
||||
command! -buffer Toch call s:Toc('horizontal')
|
||||
command! -buffer Tocv call s:Toc('vertical')
|
||||
@@ -792,7 +812,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 +843,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
|
||||
@@ -856,15 +878,23 @@ function! s:SyntaxInclude(filetype)
|
||||
return grouplistname
|
||||
endfunction
|
||||
|
||||
function! s:IsHighlightSourcesEnabledForBuffer()
|
||||
" Enable for markdown buffers, and for liquid buffers with markdown format
|
||||
return &filetype =~# 'markdown' || get(b:, 'liquid_subtype', '') =~# 'markdown'
|
||||
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 s:IsHighlightSourcesEnabledForBuffer() && line('$') > 1 && &syntax != 'OFF'
|
||||
call s:MarkdownHighlightSources(a:force)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:MarkdownClearSyntaxVariables()
|
||||
if &filetype =~# 'markdown'
|
||||
if s:IsHighlightSourcesEnabledForBuffer()
|
||||
unlet! b:mkd_included_filetypes
|
||||
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+=:;
|
||||
|
||||
@@ -23,3 +23,4 @@ if get(g:, 'nix_recommended_style', 1)
|
||||
\ softtabstop=2
|
||||
\ expandtab
|
||||
endif
|
||||
let b:match_words = '\<if\>:\<then\>:\<else\>,\<let\>:\<in\>'
|
||||
|
||||
@@ -125,21 +125,13 @@ if !exists("g:did_ocaml_switch")
|
||||
nnoremap <Plug>OCamlSwitchEdit :<C-u>call OCaml_switch(0)<CR>
|
||||
nnoremap <Plug>OCamlSwitchNewWin :<C-u>call OCaml_switch(1)<CR>
|
||||
fun OCaml_switch(newwin)
|
||||
let open_command = a:newwin == 1 ? "new" : "arge"
|
||||
if (match(bufname(""), "\\.mli$") >= 0)
|
||||
let fname = s:Fnameescape(substitute(bufname(""), "\\.mli$", ".ml", ""))
|
||||
if (a:newwin == 1)
|
||||
exec "new " . fname
|
||||
else
|
||||
exec "arge " . fname
|
||||
endif
|
||||
elseif (match(bufname(""), "\\.ml$") >= 0)
|
||||
let fname = s:Fnameescape(bufname("")) . "i"
|
||||
if (a:newwin == 1)
|
||||
exec "new " . fname
|
||||
else
|
||||
exec "arge " . fname
|
||||
endif
|
||||
endif
|
||||
exec open_command " " . fname
|
||||
endfun
|
||||
endif
|
||||
|
||||
@@ -653,6 +645,11 @@ endfunction
|
||||
nnoremap <silent> <Plug>OCamlPrintType :<C-U>call Ocaml_print_type("normal")<CR>
|
||||
xnoremap <silent> <Plug>OCamlPrintType :<C-U>call Ocaml_print_type("visual")<CR>`<
|
||||
|
||||
" Make sure the environment is consistent
|
||||
if !exists('g:opam_current_compiler') && exists('g:opam_init_env') && g:opam_init_env != 0
|
||||
call opam#eval_env()
|
||||
endif
|
||||
|
||||
let &cpoptions=s:cposet
|
||||
unlet s:cposet
|
||||
|
||||
|
||||
@@ -2,4 +2,66 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'octave', 'ftplugin/octave.vim
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: GNU Octave
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 Sep 02
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" TODO: update Matlab ftplugin and source it as the base file?
|
||||
|
||||
setlocal comments=s:%{,m:\ ,e:%},s:#{,m:\ ,e:#},:%,:#
|
||||
setlocal commentstring=%\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
setlocal keywordprg=info\ octave\ --vi-keys\ --index-search
|
||||
|
||||
if exists("loaded_matchit") && !exists("b:match_words")
|
||||
let b:match_words = '\<unwind_protect\>:\<unwind_protect_cleanup\>:\<end_unwind_protect\>'
|
||||
if exists("octave_use_matlab_end")
|
||||
let b:match_words .= ',' ..
|
||||
\ '\<\%(classdef\|enumeration\|events\|for\|function\|if\|methods\|parfor\|properties\|switch\|while\|try\)\>' ..
|
||||
\ ':' ..
|
||||
\ '\<\%(elseif\|else\|case\|otherwise\|break\|continue\|catch\)\>' ..
|
||||
\ ':' ..
|
||||
\ '\<end\>'
|
||||
else
|
||||
let b:match_words .= ',' ..
|
||||
\ '\<classdef\>:\<endclassdef\>,' ..
|
||||
\ '\<enumeration\>:\<endenumeration\>,' ..
|
||||
\ '\<events\>:\<endevents\>,' ..
|
||||
\ '\<do\>:\<\%(break\|continue\)\>:\<until\>' ..
|
||||
\ '\<for\>:\<\%(break\|continue\)\>:\<endfor\>,' ..
|
||||
\ '\<function\>:\<return\>:\<endfunction\>,' ..
|
||||
\ '\<if\>:\<\%(elseif\|else\)\>:\<endif\>,' ..
|
||||
\ '\<methods\>:\<endmethods\>,' ..
|
||||
\ '\<parfor\>:\<endparfor\>,' ..
|
||||
\ '\<properties\>:\<endproperties\>,' ..
|
||||
\ '\<switch\>:\<\%(case\|otherwise\)\>:\<endswitch\>,' ..
|
||||
\ '\<while\>:\<\%(break\|continue\)\>:\<endwhile\>,' ..
|
||||
\ '\<try\>:\<catch\>:\<end_try_catch\>'
|
||||
endif
|
||||
" only match in statement position
|
||||
let s:statement_start = escape('\%(\%(^\|;\)\s*\)\@<=', '\')
|
||||
let b:match_words = substitute(b:match_words, '\\<', s:statement_start, 'g')
|
||||
endif
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "GNU Octave Source Files (*.m)\t*.m\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo< kp< " ..
|
||||
\ "| unlet! b:browsefilter b:match_words"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
||||
|
||||
@@ -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
|
||||
@@ -34,6 +33,7 @@ endif
|
||||
|
||||
if get(g:, 'plantuml_set_makeprg', 1)
|
||||
let &l:makeprg=g:plantuml_executable_script . ' %'
|
||||
let &l:errorformat='Error\ line %l in file: %f,%Z%m'
|
||||
endif
|
||||
|
||||
setlocal comments=s1:/',mb:',ex:'/,:' commentstring=/'%s'/ formatoptions-=t formatoptions+=croql
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'pony', 'ftplugin/pony.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: Pony
|
||||
" Maintainer: Jak Wings
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
||||
setlocal comments=://,nsr:/*,mb:*,ex:*/
|
||||
setlocal commentstring=/*%s*/
|
||||
setlocal formatoptions-=t fo+=c fo+=r fo+=o fo+=q fo+=l fo+=j
|
||||
|
||||
"setlocal path=
|
||||
"setlocal includeexpr=
|
||||
setlocal include=\\v^\\s*use\\_s+%(\\i+\\_s*\\=\\_s*)?"\\zs[^"]*\\ze"
|
||||
setlocal define=\\v^\\s*%(actor\|class\|struct\|primitive\|trait\|interface\|type\|new\|be\|fun\|let\|var\|embed\|use\|for\\_s+%(\\i+\\_s*,\\_s*)*\|with\\_s+%(\\i+\\_s*,\\_s*)*)\|(<\\i+\\_s*:\\_s*\\i+)@=
|
||||
setlocal isident=@,48-57,_,39
|
||||
setlocal iskeyword=@,48-57,_,39
|
||||
setlocal suffixesadd=.pony
|
||||
setlocal matchpairs=(:),{:},[:]
|
||||
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_skip = 's:Comment\|String\|Character\|CaseGuard'
|
||||
let b:match_words = '\v<%(ifdef|if|match|while|for|repeat|try|with|recover|object|lambda|iftype)>\m:\v<%(then|elseif|else|until|do|in|elseiftype)>|\|\m:\<end\>,(:),\[:\],{:}'
|
||||
" TODO: for more concise behavior
|
||||
"let b:match_words = 'pony#GetMatchWords()'
|
||||
source $VIMRUNTIME/macros/matchit.vim
|
||||
|
||||
let b:undo_ftplugin = 'set comments< commentstring< formatoptions< path< include< includeexpr< define< isident< iskeyword< suffixesadd< matchpairs<'
|
||||
\ . ' | unlet! b:match_ignorecase b:match_skip b:match_words'
|
||||
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
let b:did_ftplugin = 1
|
||||
11
ftplugin/prisma.vim
Normal file
11
ftplugin/prisma.vim
Normal file
@@ -0,0 +1,11 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'prisma', 'ftplugin/prisma.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
if (exists('b:did_ftplugin'))
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
setlocal iskeyword+=@-@
|
||||
setlocal comments=://
|
||||
setlocal commentstring=//\ %s
|
||||
@@ -17,10 +17,13 @@ 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+=-
|
||||
" Make string literal related text objects work properly when string
|
||||
" contains escaped quote characters
|
||||
setlocal quoteescape=`
|
||||
|
||||
" Change the browse dialog on Win32 to show mainly PowerShell-related files
|
||||
if has("gui_win32")
|
||||
@@ -45,16 +48,16 @@ if exists('s:pwsh_cmd')
|
||||
if !has('gui_running') && executable('less') &&
|
||||
\ !(exists('$ConEmuBuild') && &term =~? '^xterm')
|
||||
" For exclusion of ConEmu, see https://github.com/Maximus5/ConEmu/issues/2048
|
||||
command! -buffer -nargs=1 GetHelp silent exe '!' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>" | ' . (has('unix') ? 'LESS= less' : 'less') | redraw!
|
||||
command! -buffer -nargs=1 Ps1KeywordPrg silent exe '!' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>" | ' . (has('unix') ? 'LESS= less' : 'less') | redraw!
|
||||
elseif has('terminal')
|
||||
command! -buffer -nargs=1 GetHelp silent exe 'term ' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>"' . (executable('less') ? ' | less' : '')
|
||||
command! -buffer -nargs=1 Ps1KeywordPrg silent exe 'term ' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>"' . (executable('less') ? ' | less' : '')
|
||||
else
|
||||
command! -buffer -nargs=1 GetHelp echo system(s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full <args>')
|
||||
command! -buffer -nargs=1 Ps1KeywordPrg echo system(s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full <args>')
|
||||
endif
|
||||
setlocal keywordprg=:Ps1KeywordPrg
|
||||
endif
|
||||
setlocal keywordprg=:GetHelp
|
||||
|
||||
" Undo the stuff we changed
|
||||
let b:undo_ftplugin = "setlocal tw< cms< fo< iskeyword< keywordprg<" .
|
||||
let b:undo_ftplugin = "setlocal tw< cms< fo< iskeyword< keywordprg< quoteescape<" .
|
||||
\ " | sil! delc -buffer Ps1KeywordPrg" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
|
||||
@@ -71,6 +71,11 @@ endif
|
||||
"setl commentstring=;;%s
|
||||
setl commentstring=#\|\ %s\ \|#
|
||||
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Racket Source Files (*.rkt *.rktl)\t*.rkt;*.rktl\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
" Undo our settings when the filetype changes away from Racket
|
||||
" (this should be amended if settings/mappings are added above!)
|
||||
let b:undo_ftplugin =
|
||||
@@ -78,3 +83,4 @@ let b:undo_ftplugin =
|
||||
\. "| setl makeprg< commentstring<"
|
||||
\. "| nunmap <buffer> K"
|
||||
\. "| vunmap <buffer> K"
|
||||
\. "| unlet! b:browsefilter"
|
||||
|
||||
@@ -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.8.0
|
||||
" 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
|
||||
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: Ruby
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if (exists("b:did_ftplugin"))
|
||||
finish
|
||||
@@ -56,31 +55,45 @@ endif
|
||||
" TODO:
|
||||
"setlocal define=^\\s*def
|
||||
|
||||
setlocal comments=:#
|
||||
setlocal comments=b:#
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
if !exists('g:ruby_version_paths')
|
||||
let g:ruby_version_paths = {}
|
||||
endif
|
||||
|
||||
let s:path_split = has('win32') ? ';' : ':'
|
||||
|
||||
function! s:query_path(root) abort
|
||||
let code = "print $:.join %q{,}"
|
||||
if &shell =~# 'sh' && empty(&shellxquote)
|
||||
let prefix = 'env PATH='.shellescape($PATH).' '
|
||||
else
|
||||
let prefix = ''
|
||||
" Disabled by default for security reasons.
|
||||
if !get(g:, 'ruby_exec', get(g:, 'plugin_exec', 0)) || empty(a:root)
|
||||
return map(split($RUBYLIB, s:path_split), 'v:val ==# "." ? "" : v:val')
|
||||
endif
|
||||
let code = "print $:.join %q{,}"
|
||||
if &shellxquote == "'"
|
||||
let path_check = prefix.'ruby --disable-gems -e "' . code . '"'
|
||||
let args = ' --disable-gems -e "' . code . '"'
|
||||
else
|
||||
let path_check = prefix."ruby --disable-gems -e '" . code . "'"
|
||||
let args = " --disable-gems -e '" . code . "'"
|
||||
endif
|
||||
|
||||
let cd = haslocaldir() ? 'lcd' : 'cd'
|
||||
let cd = haslocaldir() ? 'lcd' : exists(':tcd') && haslocaldir(-1) ? 'tcd' : 'cd'
|
||||
let cwd = fnameescape(getcwd())
|
||||
try
|
||||
exe cd fnameescape(a:root)
|
||||
let path = split(system(path_check),',')
|
||||
for dir in split($PATH, s:path_split)
|
||||
if dir !=# '.' && executable(dir . '/ruby') == 1
|
||||
let exepath = dir . '/ruby'
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if exists('l:exepath')
|
||||
let path = split(system(exepath . args),',')
|
||||
if v:shell_error
|
||||
let path = []
|
||||
endif
|
||||
else
|
||||
let path = []
|
||||
endif
|
||||
exe cd cwd
|
||||
return path
|
||||
finally
|
||||
@@ -121,10 +134,8 @@ else
|
||||
if !exists('g:ruby_default_path')
|
||||
if has("ruby") && has("win32")
|
||||
ruby ::VIM::command( 'let g:ruby_default_path = split("%s",",")' % $:.join(%q{,}) )
|
||||
elseif executable('ruby') && !empty($HOME)
|
||||
let g:ruby_default_path = s:query_path($HOME)
|
||||
else
|
||||
let g:ruby_default_path = map(split($RUBYLIB,':'), 'v:val ==# "." ? "" : v:val')
|
||||
let g:ruby_default_path = s:query_path($HOME)
|
||||
endif
|
||||
endif
|
||||
let s:ruby_paths = g:ruby_default_path
|
||||
|
||||
@@ -5,11 +5,36 @@ endif
|
||||
setlocal iskeyword+=-,:,#,',$
|
||||
setlocal commentstring=;%s
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
" Mappings for solver functionality
|
||||
nnoremap <silent> <buffer> <localleader>r :call smt2#solver#Run()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>R :call smt2#solver#RunAndShowResult()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>v :call smt2#solver#PrintVersion()<cr>
|
||||
" ------------------------------------------------------------------------------
|
||||
nnoremap <silent> <buffer> <Plug>Smt2Run :call smt2#solver#Run()<cr>
|
||||
if !hasmapto('<Plug>Smt2Run', 'n')
|
||||
nmap <silent> <localleader>r <Plug>Smt2Run
|
||||
endif
|
||||
|
||||
nnoremap <silent> <buffer> <Plug>Smt2RunAndShowResult :call smt2#solver#RunAndShowResult()<cr>
|
||||
if !hasmapto('<Plug>Smt2RunAndShowResult', 'n')
|
||||
nmap <silent> <localleader>R <Plug>Smt2RunAndShowResult
|
||||
endif
|
||||
|
||||
nnoremap <silent> <Plug>Smt2PrintVersion :call smt2#solver#PrintVersion()<CR>
|
||||
if !hasmapto('<Plug>Smt2PrintVersion', 'n')
|
||||
nmap <silent> <localleader>v <Plug>Smt2PrintVersion
|
||||
endif
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
" Mappings for formatting functionality
|
||||
nnoremap <silent> <buffer> <localleader>f :call smt2#formatter#FormatCurrentParagraph()<cr>
|
||||
nnoremap <silent> <buffer> <localleader>F :call smt2#formatter#FormatAllParagraphs()<cr>
|
||||
" ------------------------------------------------------------------------------
|
||||
nnoremap <silent> <buffer> <Plug>Smt2FormatCurrentParagraph :call smt2#formatter#FormatCurrentParagraph()<cr>
|
||||
if !hasmapto('<Plug>Smt2FormatCurrentParagraph', 'n') && (mapcheck('<localleader>f', 'n') == '')
|
||||
nmap <silent> <localleader>f <Plug>Smt2FormatCurrentParagraph
|
||||
endif
|
||||
|
||||
" Alternative function to put on <localleader>f
|
||||
nnoremap <silent> <buffer> <Plug>Smt2FormatOutermostSExpr :call smt2#formatter#FormatOutermostSExpr()<cr>
|
||||
|
||||
nnoremap <silent> <buffer> <Plug>Smt2FormalFile :call smt2#formatter#FormatFile()<cr>
|
||||
if !hasmapto('<Plug>Smt2FormalFile', 'n')
|
||||
nmap <silent> <localleader>F <Plug>Smt2FormalFile
|
||||
endif
|
||||
|
||||
@@ -52,6 +52,7 @@ if get(g:, 'terraform_fmt_on_save', 0)
|
||||
autocmd!
|
||||
autocmd BufWritePre *.tf call terraform#fmt()
|
||||
autocmd BufWritePre *.tfvars call terraform#fmt()
|
||||
autocmd BufWritePre *.tftest.hcl call terraform#fmt()
|
||||
augroup END
|
||||
endif
|
||||
|
||||
|
||||
@@ -19,8 +19,11 @@ setlocal commentstring=//\ %s
|
||||
" " and insert the comment leader when hitting <CR> or using "o".
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
let b:undo_ftplugin = 'setl fo< cms<'
|
||||
|
||||
if !&l:formatexpr && !&l:formatprg
|
||||
setlocal formatexpr=Fixedgq(v:lnum,v:count)
|
||||
setlocal formatexpr=Fixedgq(v:lnum,v:count)
|
||||
let b:undo_ftplugin .= ' fex<'
|
||||
endif
|
||||
|
||||
" setlocal foldmethod=syntax
|
||||
@@ -29,64 +32,64 @@ let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
function! Fixedgq(lnum, count)
|
||||
let l:tw = &tw ? &tw : 80
|
||||
let l:tw = &tw ? &tw : 80
|
||||
|
||||
let l:count = a:count
|
||||
let l:first_char = indent(a:lnum) + 1
|
||||
let l:count = a:count
|
||||
let l:first_char = indent(a:lnum) + 1
|
||||
|
||||
if mode() == 'i' " gq was not pressed, but tw was set
|
||||
return 1
|
||||
endif
|
||||
if mode() == 'i' " gq was not pressed, but tw was set
|
||||
return 1
|
||||
endif
|
||||
|
||||
" This gq is only meant to do code with strings, not comments
|
||||
if yats#IsLineComment(a:lnum, l:first_char) || yats#IsInMultilineComment(a:lnum, l:first_char)
|
||||
return 1
|
||||
endif
|
||||
" This gq is only meant to do code with strings, not comments
|
||||
if yats#IsLineComment(a:lnum, l:first_char) || yats#IsInMultilineComment(a:lnum, l:first_char)
|
||||
return 1
|
||||
endif
|
||||
|
||||
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
|
||||
return 1
|
||||
endif
|
||||
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Put all the lines on one line and do normal splitting after that
|
||||
if l:count > 1
|
||||
while l:count > 1
|
||||
let l:count -= 1
|
||||
normal! J
|
||||
endwhile
|
||||
endif
|
||||
" Put all the lines on one line and do normal splitting after that
|
||||
if l:count > 1
|
||||
while l:count > 1
|
||||
let l:count -= 1
|
||||
normal! J
|
||||
endwhile
|
||||
endif
|
||||
|
||||
let l:winview = winsaveview()
|
||||
let l:winview = winsaveview()
|
||||
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let orig_breakpoint = searchpairpos(' ', '', '\.', 'bcW', '', a:lnum)
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let breakpoint = searchpairpos(' ', '', '\.', 'bcW', s:skip_expr, a:lnum)
|
||||
|
||||
" No need for special treatment, normal gq handles edgecases better
|
||||
if breakpoint[1] == orig_breakpoint[1]
|
||||
call winrestview(l:winview)
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Try breaking after string
|
||||
if breakpoint[1] <= indent(a:lnum)
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let orig_breakpoint = searchpairpos(' ', '', '\.', 'bcW', '', a:lnum)
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let breakpoint = searchpairpos(' ', '', '\.', 'bcW', s:skip_expr, a:lnum)
|
||||
|
||||
" No need for special treatment, normal gq handles edgecases better
|
||||
if breakpoint[1] == orig_breakpoint[1]
|
||||
call winrestview(l:winview)
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Try breaking after string
|
||||
if breakpoint[1] <= indent(a:lnum)
|
||||
call cursor(a:lnum, l:tw + 1)
|
||||
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
|
||||
endif
|
||||
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
|
||||
endif
|
||||
|
||||
|
||||
if breakpoint[1] != 0
|
||||
call feedkeys("r\<CR>")
|
||||
else
|
||||
let l:count = l:count - 1
|
||||
endif
|
||||
if breakpoint[1] != 0
|
||||
call feedkeys("r\<CR>")
|
||||
else
|
||||
let l:count = l:count - 1
|
||||
endif
|
||||
|
||||
" run gq on new lines
|
||||
if l:count == 1
|
||||
call feedkeys("gqq")
|
||||
endif
|
||||
" run gq on new lines
|
||||
if l:count == 1
|
||||
call feedkeys("gqq")
|
||||
endif
|
||||
|
||||
return 0
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! TsIncludeExpr(file)
|
||||
@@ -98,10 +101,12 @@ function! TsIncludeExpr(file)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
set path+=./node_modules/**,node_modules/**
|
||||
set include=import\_s.\\zs[^'\"]*\\ze
|
||||
set includeexpr=TsIncludeExpr(v:fname)
|
||||
set suffixesadd+=.ts
|
||||
setlocal path+=./node_modules/**,node_modules/**
|
||||
setlocal include=import\_s.\\zs[^'\"]*\\ze
|
||||
setlocal includeexpr=TsIncludeExpr(v:fname)
|
||||
setlocal suffixesadd+=.ts
|
||||
|
||||
let b:undo_ftplugin .= ' pa< inc< inex< fex<'
|
||||
|
||||
"
|
||||
" TagBar
|
||||
|
||||
@@ -2,6 +2,14 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'typescript', 'ftplugin/typesc
|
||||
finish
|
||||
endif
|
||||
|
||||
" Comment formatting
|
||||
setlocal comments=s1:/*,mb:*,ex:*/,://
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
setlocal suffixesadd+=.tsx
|
||||
|
||||
let b:undo_ftplugin = 'setl fo< cms< sua<'
|
||||
|
||||
" modified from mxw/vim-jsx from html.vim
|
||||
if exists("loaded_matchit") && !exists('b:tsx_match_words')
|
||||
let b:match_ignorecase = 0
|
||||
@@ -10,10 +18,6 @@ if exists("loaded_matchit") && !exists('b:tsx_match_words')
|
||||
let b:match_words = exists('b:match_words')
|
||||
\ ? b:match_words . ',' . b:tsx_match_words
|
||||
\ : b:tsx_match_words
|
||||
|
||||
let b:undo_ftplugin .= ' | unlet! b:match_words b:match_ignorecase b:tsx_match_words'
|
||||
endif
|
||||
|
||||
" Comment formatting
|
||||
setlocal comments=s1:/*,mb:*,ex:*/,://
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
set suffixesadd+=.tsx
|
||||
|
||||
@@ -8,4 +8,9 @@ if exists("b:did_ftplugin")
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
call unison#SetBufferDefaults()
|
||||
setlocal commentstring=--\ %s
|
||||
setlocal iskeyword+=!,'
|
||||
" setlocal tabstop=2
|
||||
" setlocal softtabstop=2
|
||||
" setlocal shiftwidth=2
|
||||
" setlocal completefunc=syntaxcomplete#Complete
|
||||
|
||||
@@ -28,7 +28,7 @@ setlocal formatoptions-=t formatoptions+=croql
|
||||
setlocal suffixesadd=.zig,.zir
|
||||
|
||||
if has('comments')
|
||||
setlocal comments=:///,://!,://,:\\\\
|
||||
setlocal comments=:///,://!,://
|
||||
setlocal commentstring=//\ %s
|
||||
endif
|
||||
|
||||
@@ -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.
|
||||
"
|
||||
|
||||
@@ -23,57 +23,80 @@ if exists("*GetCucumberIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
function! s:syn(lnum)
|
||||
return synIDattr(synID(a:lnum,1+indent(a:lnum),1),'name')
|
||||
let s:headings = {
|
||||
\ 'Feature': 'feature',
|
||||
\ 'Rule': 'rule',
|
||||
\ 'Background': 'bg_or_scenario',
|
||||
\ 'Scenario': 'bg_or_scenario',
|
||||
\ 'ScenarioOutline': 'bg_or_scenario',
|
||||
\ 'Examples': 'examples',
|
||||
\ 'Scenarios': 'examples'}
|
||||
|
||||
function! s:Line(lnum) abort
|
||||
if getline(a:lnum) =~# ':'
|
||||
let group = matchstr(synIDattr(synID(a:lnum,1+indent(a:lnum), 1), 'name'), '^cucumber\zs.*')
|
||||
if !has_key(s:headings, group)
|
||||
let group = substitute(matchstr(getline(a:lnum), '^\s*\zs\%([^:]\+\)\ze:\S\@!'), '\s\+', '', 'g')
|
||||
endif
|
||||
else
|
||||
let group = ''
|
||||
endif
|
||||
let char = matchstr(getline(a:lnum), '^\s*\zs[[:punct:]]')
|
||||
return {
|
||||
\ 'lnum': a:lnum,
|
||||
\ 'indent': indent(a:lnum),
|
||||
\ 'heading': get(s:headings, group, ''),
|
||||
\ 'tag': char ==# '@',
|
||||
\ 'table': char ==# '|',
|
||||
\ 'comment': char ==# '#',
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
function! GetCucumberIndent()
|
||||
let line = getline(prevnonblank(v:lnum-1))
|
||||
let cline = getline(v:lnum)
|
||||
let nline = getline(nextnonblank(v:lnum+1))
|
||||
let sw = exists('*shiftwidth') ? shiftwidth() : shiftwidth()
|
||||
let syn = s:syn(prevnonblank(v:lnum-1))
|
||||
let csyn = s:syn(v:lnum)
|
||||
let nsyn = s:syn(nextnonblank(v:lnum+1))
|
||||
if csyn ==# 'cucumberFeature' || cline =~# '^\s*Feature:'
|
||||
function! GetCucumberIndent(...) abort
|
||||
let lnum = a:0 ? a:1 : v:lnum
|
||||
let sw = shiftwidth()
|
||||
let prev = s:Line(prevnonblank(lnum-1))
|
||||
let curr = s:Line(lnum)
|
||||
let next = s:Line(nextnonblank(lnum+1))
|
||||
if curr.heading ==# 'feature'
|
||||
" feature heading
|
||||
return 0
|
||||
elseif csyn ==# 'cucumberExamples' || cline =~# '^\s*\%(Examples\|Scenarios\):'
|
||||
elseif curr.heading ==# 'examples'
|
||||
" examples heading
|
||||
return 2 * sw
|
||||
elseif csyn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || cline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):'
|
||||
elseif curr.heading ==# 'bg_or_scenario'
|
||||
" background, scenario or outline heading
|
||||
return sw
|
||||
elseif syn ==# 'cucumberFeature' || line =~# '^\s*Feature:'
|
||||
elseif prev.heading ==# 'feature'
|
||||
" line after feature heading
|
||||
return sw
|
||||
elseif syn ==# 'cucumberExamples' || line =~# '^\s*\%(Examples\|Scenarios\):'
|
||||
elseif prev.heading ==# 'examples'
|
||||
" line after examples heading
|
||||
return 3 * sw
|
||||
elseif syn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || line =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):'
|
||||
elseif prev.heading ==# 'bg_or_scenario'
|
||||
" line after background, scenario or outline heading
|
||||
return 2 * sw
|
||||
elseif cline =~# '^\s*[@#]' && (nsyn == 'cucumberFeature' || nline =~# '^\s*Feature:' || indent(prevnonblank(v:lnum-1)) <= 0)
|
||||
elseif (curr.tag || curr.comment) && (next.heading ==# 'feature' || prev.indent <= 0)
|
||||
" tag or comment before a feature heading
|
||||
return 0
|
||||
elseif cline =~# '^\s*@'
|
||||
elseif curr.tag
|
||||
" other tags
|
||||
return sw
|
||||
elseif cline =~# '^\s*[#|]' && line =~# '^\s*|'
|
||||
elseif (curr.table || curr.comment) && prev.table
|
||||
" mid-table
|
||||
" preserve indent
|
||||
return indent(prevnonblank(v:lnum-1))
|
||||
elseif cline =~# '^\s*|' && line =~# '^\s*[^|]'
|
||||
return prev.indent
|
||||
elseif curr.table && !prev.table
|
||||
" first line of a table, relative indent
|
||||
return indent(prevnonblank(v:lnum-1)) + sw
|
||||
elseif cline =~# '^\s*[^|]' && line =~# '^\s*|'
|
||||
return prev.indent + sw
|
||||
elseif !curr.table && prev.table
|
||||
" line after a table, relative unindent
|
||||
return indent(prevnonblank(v:lnum-1)) - sw
|
||||
elseif cline =~# '^\s*#' && getline(v:lnum-1) =~ '^\s*$' && (nsyn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || nline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):')
|
||||
return prev.indent - sw
|
||||
elseif curr.comment && getline(v:lnum-1) =~# '^\s*$' && next.heading ==# 'bg_or_scenario'
|
||||
" comments on scenarios
|
||||
return sw
|
||||
endif
|
||||
return indent(prevnonblank(v:lnum-1))
|
||||
return prev.indent < 0 ? 0 : prev.indent
|
||||
endfunction
|
||||
|
||||
" vim:set sts=2 sw=2:
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -6,7 +6,6 @@ endif
|
||||
" Language: eRuby
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user