Compare commits

...

29 Commits

Author SHA1 Message Date
Danielle McLean
777b00c628 Merge a126d20c24 into f5393cfee0 2024-12-05 09:47:17 +11:00
Haim
f5393cfee0 Update README.md (#861)
Some checks failed
Vim Polyglot CI / test (push) Has been cancelled
Fix parenthesis missing, thus logo was not showing up
2024-12-04 23:22:43 +01:00
Adam Stankiewicz
692e359ad9 Update README.md
Some checks failed
Vim Polyglot CI / test (push) Has been cancelled
2024-10-22 08:33:53 +02:00
Danielle McLean
a126d20c24 Run a build and commit the results 2023-10-10 23:21:12 +11:00
Danielle McLean
158ffef943 Omit natively-supported filetypes from packaging
This is one of the more drastic changes to the build process, but it
seems to be a good one. Having two copies of the same filetype can cause
a variety of problems since Vim tries to load both of them - for
example, :setf ada will error if you have mainline vim-polyglot
installed, because the Ada autoload file uses :lockvar. Not copying the
filetype support that's bundled with Vim already prevents that collision
issue.

This change also means you can immediately get the latest version of the
natively-supported filetypes if you keep your Vim up to date, while the
version bundled into vim-polyglot is still pinned at v8.2.4274 for
compatibility reasons. (I did try bumping up that version number, but
you end up getting Vim9 script, which will break vim-polyglot on older
Vims.)
2023-10-10 22:41:20 +11:00
Danielle McLean
2a41a13242 Gen ftdetect for native filetypes not in packages.yaml 2023-10-10 22:40:04 +11:00
Danielle McLean
41ef24676a Remove unused native_* sets 2023-10-10 22:37:35 +11:00
Danielle McLean
eeb517c330 Tweak detect_filetypes regex so 'setf cpp|endif' works right 2023-10-10 22:36:28 +11:00
Danielle McLean
4dda82ad99 Use constants to reference tmp/vim runtime in scripts/build 2023-10-10 22:35:09 +11:00
Danielle McLean
01d1375124 Spotfix some package defs in packages.yaml 2023-10-10 22:25:52 +11:00
Danielle McLean
55a8775570 Set nofileignorecase when running tests 2023-10-10 22:25:18 +11:00
Danielle McLean
df71259406 Add a workaround for vim-ledger in tests/filetypes.vim 2023-10-10 22:24:34 +11:00
Danielle McLean
4d25ca6d81 Display caught exceptions in tests/filetypes.vim 2023-10-10 22:24:14 +11:00
Danielle McLean
e58c5db4e6 Don't expect file.rkt to be ft=scheme, since in newer Vims it's ft=racket 2023-10-10 22:23:17 +11:00
Danielle McLean
0c238d2206 Dedupe nroff key in tests/native.vim 2023-10-10 22:22:41 +11:00
Danielle McLean
56b56c9907 Update packages.yaml to account for upstream changes 2023-10-10 12:20:20 +11:00
Danielle McLean
e813ced93e Avoid non-existent File.exists? method in scripts/build 2023-10-10 12:19:37 +11:00
Adam Stankiewicz
bc8a81d359 Update 2022-10-14 17:40:10 +02:00
Adam Stankiewicz
38282d5838 Update 2022-04-30 15:07:33 +02:00
ptzz
36a2bf60ad Rename TestFiletypeFuncs to avoid name collision (#796)
Fixes #783.
2022-04-27 10:51:23 +02:00
Adam Stankiewicz
db7bb8ba22 Update 2022-04-18 12:08:27 +02:00
Adam Stankiewicz
aae85fe8c2 Merge branch 'master' of https://github.com/sheerun/vim-polyglot 2022-04-18 12:08:03 +02:00
Carl Smedstad
55eed00f71 Add support for Microsoft's DSL Bicep (#776)
See: https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/overview
2022-04-18 12:05:30 +02:00
nyuszika7h
db3a87a50b Fix files being misdetected as shell scripts (#787)
Closes #784.
2022-04-18 12:04:32 +02:00
Josa Gesell
8bb9203790 Add missing filetypes for go.sum and go.work (#789)
* Add filetype for go.sum

* Add filetype for go.work
2022-04-18 12:04:09 +02:00
Michael Meyer
32d08013a6 Fix doubled comma in autocmd (#791)
The doubled comma (,,) in the list of autocmd patterns introduces a
blank pattern which matches all filenames in the most recent version of
neovim, causing the default filetype to be sh unless another rule
overrides it.
2022-04-18 12:03:43 +02:00
Olaf Alders
0e1b191209 Check if TestFiletypeFuncs exists before defining it (#788)
Fixes #783
2022-04-18 12:03:02 +02:00
Adam Stankiewicz
a4f98d2a9e Update 2022-03-12 15:46:18 +01:00
Adam Stankiewicz
83422e0a1f Use old version of vim repository, fixes #779
closes #780
2022-02-21 00:07:11 +01:00
870 changed files with 6852 additions and 91240 deletions

View File

@@ -4,8 +4,6 @@ If you work for big corp and seek consulting, please visit following repository:
![vim-polyglot](https://i.imgur.com/9RxQK6k.png) ![vim-polyglot](https://i.imgur.com/9RxQK6k.png)
[![build](https://github.com/sheerun/vim-polyglot/workflows/Vim%20Polyglot%20CI/badge.svg)](https://github.com/sheerun/vim-polyglot/actions) [![Maintenance](https://img.shields.io/badge/maintained%20since-2013-yes)]()
A collection of language packs for Vim. A collection of language packs for Vim.
> One to rule them all, one to find them, one to bring them all and in the darkness bind them. > One to rule them all, one to find them, one to bring them all and in the darkness bind them.
@@ -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) - [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) - [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) - [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) - [blade](https://github.com/jwalton512/vim-blade) (Blade syntax highlighting for blade and blade.php files)
- [brewfile](https://github.com/bfontaine/Brewfile.vim) - [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) - [caddyfile](https://github.com/isobit/vim-caddyfile)
- [carp](https://github.com/hellerve/carp-vim) (Syntax highlighting for carp files) - [carp](https://github.com/hellerve/carp-vim) (Syntax highlighting for carp files)
- [cjsx](https://github.com/mtscout6/vim-cjsx) - [cjsx](https://github.com/mtscout6/vim-cjsx)
- [clojure](https://github.com/clojure-vim/clojure.vim) (Clojure syntax highlighting for clj, boot, cl2, cljc, cljs, cljs.hl, cljscm, cljx, hic and edn files) - [clojure](https://github.com/clojure-vim/clojure.vim) (Clojure syntax highlighting for clj, bb, boot, cl2, cljc and 6 more files)
- [cmake](https://github.com/pboettch/vim-cmake-syntax) (CMake syntax highlighting for cmake and cmake.in files) - [cmake](https://github.com/pboettch/vim-cmake-syntax) (CMake syntax highlighting for cmake and cmake.in files)
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (CoffeeScript and Literate CoffeeScript syntax highlighting for coffee, cake, cjsx, iced, coffeekup, cson, litcoffee and coffee.md files) - [coffee-script](https://github.com/kchmck/vim-coffee-script) (CoffeeScript and Literate CoffeeScript syntax highlighting for coffee, cake, cjsx, iced, coffeekup, cson, litcoffee and coffee.md files)
- [cpp-modern](https://github.com/bfrg/vim-cpp-modern) - [cpp-modern](https://github.com/bfrg/vim-cpp-modern)
@@ -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) - [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) - [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) - [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) - [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) - [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) - [fish](https://github.com/blankname/vim-fish) (fish syntax highlighting for fish files)
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers) (Syntax highlighting for fbs files) - [flatbuffers](https://github.com/dcharbon/vim-flatbuffers) (Syntax highlighting for fbs files)
- [fsharp](https://github.com/ionide/Ionide-vim) (F# syntax highlighting for fs, fsi and fsx files) - [fsharp](https://github.com/ionide/Ionide-vim) (F# syntax highlighting for fs, fsi and fsx files)
- [gdscript](https://github.com/calviken/vim-gdscript3) (GDScript syntax highlighting for gd files)
- [git](https://github.com/tpope/vim-git) (Git Config syntax highlighting for gitconfig files) - [git](https://github.com/tpope/vim-git) (Git Config syntax highlighting for gitconfig files)
- [gitignore](https://github.com/SirJson/fzf-gitignore) - [gitignore](https://github.com/SirJson/fzf-gitignore)
- [gleam](https://github.com/gleam-lang/gleam.vim) (Syntax highlighting for gleam files) - [gleam](https://github.com/gleam-lang/gleam.vim) (Syntax highlighting for gleam files)
- [glsl](https://github.com/tikhomirov/vim-glsl) (GLSL syntax highlighting for glsl, fp, frag, frg, fs and 18 more 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) - [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) - [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) - [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) - [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) - [ion](https://github.com/vmchale/ion-vim) (Syntax highlighting for ion files)
- [javascript-sql](https://github.com/statico/vim-javascript-sql) - [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) - [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (Syntax highlighting for jenkinsfile and Jenkinsfile files)
- [jq](https://github.com/vito-c/jq.vim) (JSONiq syntax highlighting for jq files) - [jq](https://github.com/vito-c/jq.vim) (JSONiq syntax highlighting for jq files)
- [json5](https://github.com/GutenYe/json5.vim) (JSON5 syntax highlighting for json5 files) - [json5](https://github.com/GutenYe/json5.vim) (JSON5 syntax highlighting for json5 files)
- [json](https://github.com/elzr/vim-json) (JSON syntax highlighting for json, avsc, geojson, gltf, har and 13 more files) - [json](https://github.com/elzr/vim-json) (JSON syntax highlighting for json, 4DForm, 4DProject, avsc, geojson and 15 more files)
- [jsonc](https://github.com/neoclide/jsonc.vim) (Syntax highlighting for cjson and jsonc files) - [jsonc](https://github.com/neoclide/jsonc.vim) (Syntax highlighting for cjson and jsonc files)
- [jsonnet](https://github.com/google/vim-jsonnet) (Jsonnet syntax highlighting for jsonnet and libsonnet files) - [jsonnet](https://github.com/google/vim-jsonnet) (Jsonnet syntax highlighting for jsonnet and libsonnet files)
- [jst](https://github.com/briancollins/vim-jst) (EJS syntax highlighting for ejs, ect, ejs.t and jst files) - [jst](https://github.com/briancollins/vim-jst) (EJS syntax highlighting for ejs, ect, ejs.t and jst files)
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (Syntax highlighting for jsx 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) - [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) - [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) - [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) - [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) - [log](https://github.com/MTDL9/vim-log-highlighting) (Syntax highlighting for log and LOG files)
- [lua](https://github.com/tbastos/vim-lua) (Lua syntax highlighting for lua, fcgi, nse, p8, rbxs, rockspec and wlua files) - [lua](https://github.com/tbastos/vim-lua) (Lua syntax highlighting for lua, fcgi, nse, p8, rbxs, rockspec and wlua files)
- [mako](https://github.com/sophacles/vim-bundle-mako) (Mako syntax highlighting for mako and mao files) - [mako](https://github.com/sophacles/vim-bundle-mako) (Mako syntax highlighting for mako and mao files)
- [markdown](https://github.com/plasticboy/vim-markdown) (Markdown syntax highlighting for md, markdown, mdown, mdwn, mkd, mkdn, mkdown, ronn, scd and workbook files) - [markdown](https://github.com/plasticboy/vim-markdown) (Markdown syntax highlighting for md, livemd, markdown, mdown, mdwn and 6 more files)
- [mathematica](https://github.com/voldikss/vim-mma) (Mathematica syntax highlighting for mathematica, cdf, m, ma, mt and 6 more files) - [mathematica](https://github.com/voldikss/vim-mma) (Mathematica syntax highlighting for mathematica, cdf, m, ma, mt and 6 more files)
- [mdx](https://github.com/jxnblk/vim-mdx-js) (Syntax highlighting for mdx files) - [mdx](https://github.com/jxnblk/vim-mdx-js) (Syntax highlighting for mdx files)
- [mermaid](https://github.com/mracos/mermaid.vim/tree/main) (Syntax highlighting for mermaid, mm and mmd files) - [mermaid](https://github.com/mracos/mermaid.vim/tree/main) (Syntax highlighting for mermaid, mm and mmd files)
@@ -147,12 +145,12 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
- [opencl](https://github.com/petRUShka/vim-opencl) (OpenCL syntax highlighting for cl and opencl files) - [opencl](https://github.com/petRUShka/vim-opencl) (OpenCL syntax highlighting for cl and opencl files)
- [openscad](https://github.com/sirtaj/vim-openscad) (Syntax highlighting for scad files) - [openscad](https://github.com/sirtaj/vim-openscad) (Syntax highlighting for scad files)
- [org](https://github.com/axvr/org.vim) (Syntax highlighting for org files) - [org](https://github.com/axvr/org.vim) (Syntax highlighting for org files)
- [perl](https://github.com/vim-perl/vim-perl) (Perl syntax highlighting for pl, al, cgi, fcgi, perl and 12 more files) - [perl](https://github.com/vim-perl/vim-perl) (Perl syntax highlighting for pl, al, cgi, fcgi, perl and 13 more files)
- [pest](https://github.com/pest-parser/pest.vim) (Syntax highlighting for pest files) - [pest](https://github.com/pest-parser/pest.vim) (Syntax highlighting for pest files)
- [pgsql](https://github.com/lifepillar/pgsql.vim) (PLpgSQL syntax highlighting for pgsql files) - [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) - [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) - [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/wsdjeg/vim-pony) (Pony syntax highlighting for pony files)
- [powershell](https://github.com/PProvost/vim-ps1) (PowerShell syntax highlighting for ps1, psd1, psm1, pssc and ps1xml files) - [powershell](https://github.com/PProvost/vim-ps1) (PowerShell syntax highlighting for ps1, psd1, psm1, pssc and ps1xml files)
- [protobuf](https://github.com/uarun/vim-protobuf) (Protocol Buffer syntax highlighting for proto 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) - [pug](https://github.com/digitaltoad/vim-pug) (Pug syntax highlighting for jade and pug files)
@@ -160,7 +158,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
- [purescript](https://github.com/purescript-contrib/purescript-vim) (PureScript syntax highlighting for purs 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-compiler](https://github.com/aliev/vim-compiler-python)
- [python-indent](https://github.com/Vimjas/vim-python-pep8-indent) - [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) - [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) - [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) - [r-lang](https://github.com/vim-scripts/R.vim) (R syntax highlighting for r, rsx, s, S and rd files)
@@ -197,7 +195,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
- [toml](https://github.com/cespare/vim-toml/tree/main) (TOML syntax highlighting for toml files) - [toml](https://github.com/cespare/vim-toml/tree/main) (TOML syntax highlighting for toml files)
- [tptp](https://github.com/c-cube/vim-tptp) (Syntax highlighting for p, tptp and ax files) - [tptp](https://github.com/c-cube/vim-tptp) (Syntax highlighting for p, tptp and ax files)
- [twig](https://github.com/lumiliet/vim-twig) (Twig syntax highlighting for twig and xml.twig files) - [twig](https://github.com/lumiliet/vim-twig) (Twig syntax highlighting for twig and xml.twig files)
- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (TypeScript and TSX syntax highlighting for ts and tsx files) - [typescript](https://github.com/HerringtonDarkholme/yats.vim) (TypeScript and TSX syntax highlighting for ts, cts, mts and tsx files)
- [unison](https://github.com/unisonweb/unison/tree/trunk/editor-support/vim) (Syntax highlighting for u and uu files) - [unison](https://github.com/unisonweb/unison/tree/trunk/editor-support/vim) (Syntax highlighting for u and uu files)
- [v](https://github.com/ollykel/v-vim) (V syntax highlighting for v, vv and vsh files) - [v](https://github.com/ollykel/v-vim) (V syntax highlighting for v, vv and vsh files)
- [vala](https://github.com/arrufat/vala.vim) (Vala syntax highlighting for vala, vapi and valadoc files) - [vala](https://github.com/arrufat/vala.vim) (Vala syntax highlighting for vala, vapi and valadoc files)
@@ -206,7 +204,7 @@ On top of all language packs from [vim repository](https://github.com/vim/vim/tr
- [velocity](https://github.com/lepture/vim-velocity) (Syntax highlighting for vm files) - [velocity](https://github.com/lepture/vim-velocity) (Syntax highlighting for vm files)
- [vue](https://github.com/posva/vim-vue) (Vue syntax highlighting for vue and wpy files) - [vue](https://github.com/posva/vim-vue) (Vue syntax highlighting for vue and wpy files)
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax) (Syntax highlighting for xdc files) - [xdc](https://github.com/amal-khailtash/vim-xdc-syntax) (Syntax highlighting for xdc files)
- [xml](https://github.com/amadeus/vim-xml) (XML syntax highlighting for xml, adml, admx, ant, axaml and 96 more files) - [xml](https://github.com/amadeus/vim-xml) (XML syntax highlighting for xml, adml, admx, ant, axaml and 99 more files)
- [xsl](https://github.com/vim-scripts/XSLT-syntax) (XSLT syntax highlighting for xslt and xsl files) - [xsl](https://github.com/vim-scripts/XSLT-syntax) (XSLT syntax highlighting for xslt and xsl files)
- [yard](https://github.com/noprompt/vim-yardoc) - [yard](https://github.com/noprompt/vim-yardoc)
- [zephir](https://github.com/xwsoul/vim-zephir) (Zephir syntax highlighting for zep files) - [zephir](https://github.com/xwsoul/vim-zephir) (Zephir syntax highlighting for zep files)

View File

@@ -1,71 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'tex', 'after/compiler/tex.vim')
finish
endif
" Vim compiler file
" Compiler: TeX
" Maintainer: Artem Chuprina <ran@ran.pp.ru>
" Last Change: 2012 Apr 30
if exists("current_compiler")
finish
endif
let s:keepcpo= &cpo
set cpo&vim
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
" If makefile exists and we are not asked to ignore it, we use standard make
" (do not redefine makeprg)
if exists('b:tex_ignore_makefile') || exists('g:tex_ignore_makefile') ||
\(!filereadable('Makefile') && !filereadable('makefile'))
" If buffer-local variable 'tex_flavor' exists, it defines TeX flavor,
" otherwise the same for global variable with same name, else it will be
" LaTeX
if exists("b:tex_flavor")
let current_compiler = b:tex_flavor
elseif exists("g:tex_flavor")
let current_compiler = g:tex_flavor
else
let current_compiler = "latex"
endif
let &l:makeprg=current_compiler.' -interaction=nonstopmode'
else
let current_compiler = 'make'
endif
" Value errorformat are taken from vim help, see :help errorformat-LaTeX, with
" addition from Srinath Avadhanula <srinath@fastmail.fm>
CompilerSet errorformat=%E!\ LaTeX\ %trror:\ %m,
\%E!\ %m,
\%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%#,
\%+W%.%#\ at\ lines\ %l--%*\\d,
\%WLaTeX\ %.%#Warning:\ %m,
\%Cl.%l\ %m,
\%+C\ \ %m.,
\%+C%.%#-%.%#,
\%+C%.%#[]%.%#,
\%+C[]%.%#,
\%+C%.%#%[{}\\]%.%#,
\%+C<%.%#>%.%#,
\%C\ \ %m,
\%-GSee\ the\ LaTeX%m,
\%-GType\ \ H\ <return>%m,
\%-G\ ...%.%#,
\%-G%.%#\ (C)\ %.%#,
\%-G(see\ the\ transcript%.%#),
\%-G\\s%#,
\%+O(%*[^()])%r,
\%+O%*[^()](%*[^()])%r,
\%+P(%f%r,
\%+P\ %\\=(%f%r,
\%+P%*[^()](%f%r,
\%+P[%\\d%[^()]%#(%f%r,
\%+Q)%r,
\%+Q%*[^()])%r,
\%+Q[%\\d%*[^()])%r
let &cpo = s:keepcpo
unlet s:keepcpo

View File

@@ -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+=-

View File

@@ -1,50 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'tex', 'after/ftplugin/tex.vim')
finish
endif
" LaTeX filetype plugin
" Language: LaTeX (ft=tex)
" Maintainer: Benji Fisher, Ph.D. <benji@member.AMS.org>
" Version: 1.4
" Last Change: Wed 19 Apr 2006
" URL: http://www.vim.org/script.php?script_id=411
" Only do this when not done yet for this buffer.
if exists("b:did_ftplugin")
finish
endif
" Start with plain TeX. This will also define b:did_ftplugin .
source $VIMRUNTIME/ftplugin/plaintex.vim
" Avoid problems if running in 'compatible' mode.
let s:save_cpo = &cpo
set cpo&vim
let b:undo_ftplugin .= "| setl inex<"
" Allow "[d" to be used to find a macro definition:
" Recognize plain TeX \def as well as LaTeX \newcommand and \renewcommand .
" I may as well add the AMS-LaTeX DeclareMathOperator as well.
let &l:define .= '\|\\\(re\)\=new\(boolean\|command\|counter\|environment\|font'
\ . '\|if\|length\|savebox\|theorem\(style\)\=\)\s*\*\=\s*{\='
\ . '\|DeclareMathOperator\s*{\=\s*'
" Tell Vim how to recognize LaTeX \include{foo} and plain \input bar :
let &l:include .= '\|\\include{'
" On some file systems, "{" and "}" are included in 'isfname'. In case the
" TeX file has \include{fname} (LaTeX only), strip everything except "fname".
let &l:includeexpr = "substitute(v:fname, '^.\\{-}{\\|}.*', '', 'g')"
" The following lines enable the macros/matchit.vim plugin for
" extended matching with the % key.
" ftplugin/plaintex.vim already defines b:match_skip and b:match_ignorecase
" and matches \(, \), \[, \], \{, and \} .
if exists("loaded_matchit")
let b:match_words .= ',\\begin\s*\({\a\+\*\=}\):\\end\s*\1'
endif " exists("loaded_matchit")
let &cpo = s:save_cpo
unlet s:save_cpo
" vim:sts=2:sw=2:

View File

@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/indent/javas
finish finish
endif 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 " Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to " of this software and associated documentation files (the "Software"), to

View File

@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/indent/php.v
finish finish
endif 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 " Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to " of this software and associated documentation files (the "Software"), to

View File

@@ -1,427 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'tex', 'after/indent/tex.vim')
finish
endif
" Vim indent file
" Language: LaTeX
" Maintainer: Yichao Zhou <broken.zhou AT gmail.com>
" Created: Sat, 16 Feb 2002 16:50:19 +0100
" Version: 1.0.0
" Please email me if you found something I can do. Comments, bug report and
" feature request are welcome.
" Last Update: {{{
" 25th Sep 2002, by LH :
" (*) better support for the option
" (*) use some regex instead of several '||'.
" Oct 9th, 2003, by JT:
" (*) don't change indentation of lines starting with '%'
" 2005/06/15, Moshe Kaminsky <kaminsky AT math.huji.ac.il>
" (*) New variables:
" g:tex_items, g:tex_itemize_env, g:tex_noindent_env
" 2011/3/6, by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Don't change indentation of lines starting with '%'
" I don't see any code with '%' and it doesn't work properly
" so I add some code.
" (*) New features: Add smartindent-like indent for "{}" and "[]".
" (*) New variables: g:tex_indent_brace
" 2011/9/25, by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Bug fix: smartindent-like indent for "[]"
" (*) New features: Align with "&".
" (*) New variable: g:tex_indent_and.
" 2011/10/23 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Bug fix: improve the smartindent-like indent for "{}" and
" "[]".
" 2012/02/27 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Bug fix: support default folding marker.
" (*) Indent with "&" is not very handy. Make it not enable by
" default.
" 2012/03/06 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Modify "&" behavior and make it default again. Now "&"
" won't align when there are more then one "&" in the previous
" line.
" (*) Add indent "\left(" and "\right)"
" (*) Trust user when in "verbatim" and "lstlisting"
" 2012/03/11 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Modify "&" so that only indent when current line start with
" "&".
" 2012/03/12 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Modify indentkeys.
" 2012/03/18 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Add &cpo
" 2013/05/02 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Fix problem about GetTeXIndent checker. Thank Albert Netymk
" for reporting this.
" 2014/06/23 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Remove the feature g:tex_indent_and because it is buggy.
" (*) If there is not any obvious indentation hints, we do not
" alert our user's current indentation.
" (*) g:tex_indent_brace now only works if the open brace is the
" last character of that line.
" 2014/08/03 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Indent current line if last line has larger indentation
" 2016/11/08 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Fix problems for \[ and \]. Thanks Bruno for reporting.
" 2017/04/30 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Fix a bug between g:tex_noindent_env and g:tex_indent_items
" Now g:tex_noindent_env='document\|verbatim\|itemize' (Emacs
" style) is supported. Thanks Miles Wheeler for reporting.
" 2018/02/07 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Make indentation more smart in the normal mode
" 2020/04/26 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Fix a bug related to \[ & \]. Thanks Manuel Boni for
" reporting.
"
" }}}
" Document: {{{
"
" For proper latex experience, please put
" let g:tex_flavor = "latex"
" into your vimrc.
"
" * g:tex_indent_brace
"
" If this variable is unset or non-zero, it will use smartindent-like style
" for "{}" and "[]". Now this only works if the open brace is the last
" character of that line.
"
" % Example 1
" \usetikzlibrary{
" external
" }
"
" % Example 2
" \tikzexternalize[
" prefix=tikz]
"
" * g:tex_indent_items
"
" If this variable is set, item-environments are indented like Emacs does
" it, i.e., continuation lines are indented with a shiftwidth.
"
" set unset
" ------------------------------------------------------
" \begin{itemize} \begin{itemize}
" \item blablabla \item blablabla
" bla bla bla bla bla bla
" \item blablabla \item blablabla
" bla bla bla bla bla bla
" \end{itemize} \end{itemize}
"
"
" * g:tex_items
"
" A list of tokens to be considered as commands for the beginning of an item
" command. The tokens should be separated with '\|'. The initial '\' should
" be escaped. The default is '\\bibitem\|\\item'.
"
" * g:tex_itemize_env
"
" A list of environment names, separated with '\|', where the items (item
" commands matching g:tex_items) may appear. The default is
" 'itemize\|description\|enumerate\|thebibliography'.
"
" * g:tex_noindent_env
"
" A list of environment names. separated with '\|', where no indentation is
" required. The default is 'document\|verbatim'.
" }}}
" Only define the function once
if exists("b:did_indent")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
" Define global variable {{{
let b:did_indent = 1
if !exists("g:tex_indent_items")
let g:tex_indent_items = 1
endif
if !exists("g:tex_indent_brace")
let g:tex_indent_brace = 1
endif
if !exists("g:tex_max_scan_line")
let g:tex_max_scan_line = 60
endif
if g:tex_indent_items
if !exists("g:tex_itemize_env")
let g:tex_itemize_env = 'itemize\|description\|enumerate\|thebibliography'
endif
if !exists('g:tex_items')
let g:tex_items = '\\bibitem\|\\item'
endif
else
let g:tex_items = ''
endif
if !exists("g:tex_noindent_env")
let g:tex_noindent_env = 'document\|verbatim\|lstlisting'
endif "}}}
" VIM Setting " {{{
setlocal autoindent
setlocal nosmartindent
setlocal indentexpr=GetTeXIndent()
setlocal indentkeys&
exec 'setlocal indentkeys+=[,(,{,),},],\&' . substitute(g:tex_items, '^\|\(\\|\)', ',=', 'g')
let g:tex_items = '^\s*' . substitute(g:tex_items, '^\(\^\\s\*\)*', '', '')
" }}}
function! GetTeXIndent() " {{{
" Find a non-blank line above the current line.
let lnum = prevnonblank(v:lnum - 1)
let cnum = v:lnum
" Comment line is not what we need.
while lnum != 0 && getline(lnum) =~ '^\s*%'
let lnum = prevnonblank(lnum - 1)
endwhile
" At the start of the file use zero indent.
if lnum == 0
return 0
endif
let line = substitute(getline(lnum), '\s*%.*', '','g') " last line
let cline = substitute(getline(v:lnum), '\s*%.*', '', 'g') " current line
let ccol = 1
while cline[ccol] =~ '\s'
let ccol += 1
endwhile
" We are in verbatim, so do what our user what.
if synIDattr(synID(v:lnum, ccol, 1), "name") == "texZone"
if empty(cline)
return indent(lnum)
else
return indent(v:lnum)
endif
endif
if lnum == 0
return 0
endif
let ind = indent(lnum)
let stay = 1
" New code for comment: retain the indent of current line
if cline =~ '^\s*%'
return indent(v:lnum)
endif
" Add a 'shiftwidth' after beginning of environments.
" Don't add it for \begin{document} and \begin{verbatim}
" if line =~ '^\s*\\begin{\(.*\)}' && line !~ 'verbatim'
" LH modification : \begin does not always start a line
" ZYC modification : \end after \begin won't cause wrong indent anymore
if line =~ '\\begin{.*}'
if line !~ g:tex_noindent_env
let ind = ind + shiftwidth()
let stay = 0
endif
if g:tex_indent_items
" Add another sw for item-environments
if line =~ g:tex_itemize_env
let ind = ind + shiftwidth()
let stay = 0
endif
endif
endif
if cline =~ '\\end{.*}'
let retn = s:GetEndIndentation(v:lnum)
if retn != -1
return retn
endif
end
" Subtract a 'shiftwidth' when an environment ends
if cline =~ '\\end{.*}'
\ && cline !~ g:tex_noindent_env
\ && cline !~ '\\begin{.*}.*\\end{.*}'
if g:tex_indent_items
" Remove another sw for item-environments
if cline =~ g:tex_itemize_env
let ind = ind - shiftwidth()
let stay = 0
endif
endif
let ind = ind - shiftwidth()
let stay = 0
endif
if g:tex_indent_brace
if line =~ '[[{]$'
let ind += shiftwidth()
let stay = 0
endif
if cline =~ '^\s*\\\?[\]}]' && s:CheckPairedIsLastCharacter(v:lnum, ccol)
let ind -= shiftwidth()
let stay = 0
endif
if line !~ '^\s*\\\?[\]}]'
for i in range(1, strlen(line)-1)
let char = line[i]
if char == ']' || char == '}'
if s:CheckPairedIsLastCharacter(lnum, i)
let ind -= shiftwidth()
let stay = 0
endif
endif
endfor
endif
endif
" Special treatment for 'item'
" ----------------------------
if g:tex_indent_items
" '\item' or '\bibitem' itself:
if cline =~ g:tex_items
let ind = ind - shiftwidth()
let stay = 0
endif
" lines following to '\item' are indented once again:
if line =~ g:tex_items
let ind = ind + shiftwidth()
let stay = 0
endif
endif
if stay && mode() == 'i'
" If there is no obvious indentation hint, and indentation is triggered
" in insert mode, we trust our user.
if empty(cline)
return ind
else
return max([indent(v:lnum), s:GetLastBeginIndentation(v:lnum)])
endif
else
return ind
endif
endfunction "}}}
function! s:GetLastBeginIndentation(lnum) " {{{
let matchend = 1
for lnum in range(a:lnum-1, max([a:lnum - g:tex_max_scan_line, 1]), -1)
let line = getline(lnum)
if line =~ '\\end{.*}'
let matchend += 1
endif
if line =~ '\\begin{.*}'
let matchend -= 1
endif
if matchend == 0
if line =~ g:tex_noindent_env
return indent(lnum)
endif
if line =~ g:tex_itemize_env
return indent(lnum) + 2 * shiftwidth()
endif
return indent(lnum) + shiftwidth()
endif
endfor
return -1
endfunction
function! s:GetEndIndentation(lnum) " {{{
if getline(a:lnum) =~ '\\begin{.*}.*\\end{.*}'
return -1
endif
let min_indent = 100
let matchend = 1
for lnum in range(a:lnum-1, max([a:lnum-g:tex_max_scan_line, 1]), -1)
let line = getline(lnum)
if line =~ '\\end{.*}'
let matchend += 1
endif
if line =~ '\\begin{.*}'
let matchend -= 1
endif
if matchend == 0
return indent(lnum)
endif
if !empty(line)
let min_indent = min([min_indent, indent(lnum)])
endif
endfor
return min_indent - shiftwidth()
endfunction
" Most of the code is from matchparen.vim
function! s:CheckPairedIsLastCharacter(lnum, col) "{{{
let c_lnum = a:lnum
let c_col = a:col+1
let line = getline(c_lnum)
if line[c_col-1] == '\'
let c_col = c_col + 1
endif
let c = line[c_col-1]
let plist = split(&matchpairs, '.\zs[:,]')
let i = index(plist, c)
if i < 0
return 0
endif
" Figure out the arguments for searchpairpos().
if i % 2 == 0
let s_flags = 'nW'
let c2 = plist[i + 1]
else
let s_flags = 'nbW'
let c2 = c
let c = plist[i - 1]
endif
if c == '['
let c = '\['
let c2 = '\]'
endif
" Find the match. When it was just before the cursor move it there for a
" moment.
let save_cursor = winsaveview()
call cursor(c_lnum, c_col)
" When not in a string or comment ignore matches inside them.
" We match "escape" for special items, such as lispEscapeSpecial.
let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' .
\ '=~? "string\\|character\\|singlequote\\|escape\\|comment"'
execute 'if' s_skip '| let s_skip = 0 | endif'
let stopline = max([0, c_lnum - g:tex_max_scan_line])
" Limit the search time to 300 msec to avoid a hang on very long lines.
" This fails when a timeout is not supported.
try
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, 100)
catch /E118/
endtry
call winrestview(save_cursor)
if m_lnum > 0
let line = getline(m_lnum)
return strlen(line) == m_col
endif
return 0
endfunction "}}}
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: set sw=4 textwidth=80:

View File

@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/indent/types
finish finish
endif 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 " Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to " of this software and associated documentation files (the "Software"), to

View File

@@ -8,7 +8,7 @@ endif
" Original Author: Jon Haggblad <https://github.com/octol> " Original Author: Jon Haggblad <https://github.com/octol>
" Maintainer: bfrg <https://github.com/bfrg> " Maintainer: bfrg <https://github.com/bfrg>
" Website: https://github.com/bfrg/vim-cpp-modern " Website: https://github.com/bfrg/vim-cpp-modern
" Last Change: Nov 23, 2020 " Last Change: Sep 15, 2022
" "
" This syntax file is based on: " This syntax file is based on:
" https://github.com/octol/vim-cpp-enhanced-highlight " https://github.com/octol/vim-cpp-enhanced-highlight
@@ -70,7 +70,7 @@ if !exists('cpp_no_cpp11')
syntax keyword cppSTLnamespace chrono this_thread syntax keyword cppSTLnamespace chrono this_thread
syntax keyword cppSTLtype syntax keyword cppSTLtype
\ array atomic atomic_bool atomic_char atomic_flag atomic_int atomic_llong atomic_long atomic_schar atomic_short atomic_uchar atomic_uint atomic_ullong atomic_ulong atomic_ushort duration duration_values high_resolution_clock hours microseconds milliseconds minutes nanoseconds seconds steady_clock system_clock time_point treat_as_floating_point condition_variable exception_ptr nested_exception hash is_bind_expression is_placeholder reference_wrapper forward_list future packaged_task promise shared_future initializer_list codecvt_mode codecvt_utf16 codecvt_utf8 codecvt_utf8_utf16 wbuffer_convert wstring_convert allocator_traits allocator_type default_delete enable_shared_from_this is_always_equal owner_less pointer_safety pointer_traits propagate_on_container_copy_assignment propagate_on_container_move_assignment propagate_on_container_swap rebind_alloc rebind_traits shared_ptr unique_ptr uses_allocator void_pointer const_void_pointer weak_ptr condition_variable_any lock_guard mutex once_flag recursive_mutex recursive_timed_mutex timed_mutex unique_lock bernoulli_distribution binomial_distribution cauchy_distribution chi_squared_distribution default_random_engine discard_block_engine discrete_distribution exponential_distribution extreme_value_distribution fisher_f_distribution gamma_distribution geometric_distribution independent_bits_engine knuth_b linear_congruential_engine lognormal_distribution mersenne_twister_engine minstd_rand minstd_rand0 mt19937 mt19937_64 negative_binomial_distribution normal_distribution piecewise_constant_distribution piecewise_linear_distribution poisson_distribution random_device ranlux24 ranlux24_base ranlux48 ranlux48_base seed_seq shuffle_order_engine student_t_distribution subtract_with_carry_engine uniform_int_distribution uniform_real_distribution weibull_distribution atto centi deca deci exa femto giga hecto kilo mega micro milli nano peta pico ratio ratio_add ratio_divide ratio_equal ratio_greater ratio_greater_equal ratio_less ratio_less_equal ratio_multiply ratio_not_equal ratio_subtract tera yocto yotta zepto zetta basic_regex match_results regex_traits sub_match syntax_option_type match_flag_type error_type scoped_allocator_adaptor outer_allocator_type inner_allocator_type error_code error_condition error_category is_error_code_enum is_error_condition_enum thread tuple tuple_size tuple_element type_index add_const add_cv add_lvalue_reference add_pointer add_rvalue_reference add_volatile aligned_storage aligned_union alignment_of common_type conditional decay enable_if extent false_type has_virtual_destructor integral_constant is_abstract is_arithmetic is_array is_assignable is_base_of is_class is_compound is_const is_constructible is_convertible is_copy_assignable is_copy_constructible is_default_constructible is_destructible is_empty is_enum is_floating_point is_function is_fundamental is_integral is_literal_type is_lvalue_reference is_member_function_pointer is_member_object_pointer is_member_pointer is_move_assignable is_move_constructible is_nothrow_assignable is_nothrow_constructible is_nothrow_copy_assignable is_nothrow_copy_constructible is_nothrow_default_constructible is_nothrow_destructible is_nothrow_move_assignable is_nothrow_move_constructible is_object is_pod is_pointer is_polymorphic is_reference is_rvalue_reference is_same is_scalar is_signed is_standard_layout is_trivial is_trivially_assignable is_trivially_constructible is_trivially_copy_assignable is_trivially_copy_constructible is_trivially_copyable is_trivially_default_constructible is_trivially_destructible is_trivially_move_assignable is_trivially_move_constructible is_union is_unsigned is_void is_volatile make_signed make_unsigned rank remove_all_extents remove_const remove_cv remove_extent remove_pointer remove_reference remove_volatile result_of true_type underlying_type hasher key_equal unordered_map unordered_multimap unordered_multiset unordered_set function \ array atomic atomic_bool atomic_char atomic_flag atomic_int atomic_llong atomic_long atomic_schar atomic_short atomic_uchar atomic_uint atomic_ullong atomic_ulong atomic_ushort duration duration_values high_resolution_clock hours microseconds milliseconds minutes nanoseconds seconds steady_clock system_clock time_point treat_as_floating_point condition_variable exception_ptr nested_exception hash is_bind_expression is_placeholder reference_wrapper forward_list future packaged_task promise shared_future initializer_list codecvt_mode codecvt_utf16 codecvt_utf8 codecvt_utf8_utf16 wbuffer_convert wstring_convert allocator_traits allocator_type default_delete enable_shared_from_this is_always_equal owner_less pointer_safety pointer_traits propagate_on_container_copy_assignment propagate_on_container_move_assignment propagate_on_container_swap rebind_alloc rebind_traits shared_ptr unique_ptr uses_allocator void_pointer const_void_pointer weak_ptr condition_variable_any lock_guard mutex once_flag recursive_mutex recursive_timed_mutex timed_mutex unique_lock bernoulli_distribution binomial_distribution cauchy_distribution chi_squared_distribution default_random_engine discard_block_engine discrete_distribution exponential_distribution extreme_value_distribution fisher_f_distribution gamma_distribution geometric_distribution independent_bits_engine knuth_b linear_congruential_engine lognormal_distribution mersenne_twister_engine minstd_rand minstd_rand0 mt19937 mt19937_64 negative_binomial_distribution normal_distribution piecewise_constant_distribution piecewise_linear_distribution poisson_distribution random_device ranlux24 ranlux24_base ranlux48 ranlux48_base seed_seq shuffle_order_engine student_t_distribution subtract_with_carry_engine uniform_int_distribution uniform_real_distribution weibull_distribution atto centi deca deci exa femto giga hecto kilo mega micro milli nano peta pico ratio ratio_add ratio_divide ratio_equal ratio_greater ratio_greater_equal ratio_less ratio_less_equal ratio_multiply ratio_not_equal ratio_subtract tera yocto yotta zepto zetta basic_regex regex wregex match_results regex_traits sub_match syntax_option_type match_flag_type error_type scoped_allocator_adaptor outer_allocator_type inner_allocator_type error_code error_condition error_category is_error_code_enum is_error_condition_enum thread tuple tuple_size tuple_element type_index add_const add_cv add_lvalue_reference add_pointer add_rvalue_reference add_volatile aligned_storage aligned_union alignment_of common_type conditional decay enable_if extent false_type has_virtual_destructor integral_constant is_abstract is_arithmetic is_array is_assignable is_base_of is_class is_compound is_const is_constructible is_convertible is_copy_assignable is_copy_constructible is_default_constructible is_destructible is_empty is_enum is_floating_point is_function is_fundamental is_integral is_literal_type is_lvalue_reference is_member_function_pointer is_member_object_pointer is_member_pointer is_move_assignable is_move_constructible is_nothrow_assignable is_nothrow_constructible is_nothrow_copy_assignable is_nothrow_copy_constructible is_nothrow_default_constructible is_nothrow_destructible is_nothrow_move_assignable is_nothrow_move_constructible is_object is_pod is_pointer is_polymorphic is_reference is_rvalue_reference is_same is_scalar is_signed is_standard_layout is_trivial is_trivially_assignable is_trivially_constructible is_trivially_copy_assignable is_trivially_copy_constructible is_trivially_copyable is_trivially_default_constructible is_trivially_destructible is_trivially_move_assignable is_trivially_move_constructible is_union is_unsigned is_void is_volatile make_signed make_unsigned rank remove_all_extents remove_const remove_cv remove_extent remove_pointer remove_reference remove_volatile result_of true_type underlying_type hasher key_equal unordered_map unordered_multimap unordered_multiset unordered_set function
syntax keyword cppSTLtypedef syntax keyword cppSTLtypedef
\ atomic_char16_t atomic_char32_t atomic_int_fast16_t atomic_int_fast32_t atomic_int_fast64_t atomic_int_fast8_t atomic_int_least16_t atomic_int_least32_t atomic_int_least64_t atomic_int_least8_t atomic_intmax_t atomic_intptr_t atomic_ptrdiff_t atomic_size_t atomic_uint_fast16_t atomic_uint_fast32_t atomic_uint_fast64_t atomic_uint_fast8_t atomic_uint_least16_t atomic_uint_least32_t atomic_uint_least64_t atomic_uint_least8_t atomic_uintmax_t atomic_uintptr_t atomic_wchar_t nullptr_t max_align_t allocator_arg_t adopt_lock_t defer_lock_t try_to_lock_t piecewise_construct_t \ atomic_char16_t atomic_char32_t atomic_int_fast16_t atomic_int_fast32_t atomic_int_fast64_t atomic_int_fast8_t atomic_int_least16_t atomic_int_least32_t atomic_int_least64_t atomic_int_least8_t atomic_intmax_t atomic_intptr_t atomic_ptrdiff_t atomic_size_t atomic_uint_fast16_t atomic_uint_fast32_t atomic_uint_fast64_t atomic_uint_fast8_t atomic_uint_least16_t atomic_uint_least32_t atomic_uint_least64_t atomic_uint_least8_t atomic_uintmax_t atomic_uintptr_t atomic_wchar_t nullptr_t max_align_t allocator_arg_t adopt_lock_t defer_lock_t try_to_lock_t piecewise_construct_t
@@ -92,7 +92,6 @@ if !exists('cpp_no_cpp11')
syntax keyword cppSTLexception syntax keyword cppSTLexception
\ bad_function_call future_error regex_error system_error bad_weak_ptr bad_array_new_length \ bad_function_call future_error regex_error system_error bad_weak_ptr bad_array_new_length
" syntax keyword cppSTLiterator contained
syntax keyword cppSTLiterator syntax keyword cppSTLiterator
\ move_iterator regex_iterator regex_token_iterator const_local_iterator local_iterator \ move_iterator regex_iterator regex_token_iterator const_local_iterator local_iterator
@@ -120,7 +119,7 @@ if !exists('cpp_no_cpp17')
syntax keyword cppSTLnamespace filesystem execution string_view_literals syntax keyword cppSTLnamespace filesystem execution string_view_literals
syntax keyword cppSTLtype syntax keyword cppSTLtype
\ any byte is_execution_policy parallel_policy parallel_unsequenced_policy sequenced_policy directory_entry directory_iterator file_status file_time_type path recursive_directory_iterator space_info default_order default_searcher boyer_moore_searcher boyer_moore_horspool_searcher memory_resource monotonic_buffer_resource polymorphic_allocator pool_options synchronized_pool_resource unsynchronized_pool_resource scoped_lock optional shared_mutex basic_string_view string_view u16string_view u32string_view wstring_view bool_constant conjunction disjunction has_unique_object_representations invoke_result is_aggregate is_callable is_invocable is_invocable_r is_nothrow_invocable is_nothrow_invocable_r is_nothrow_swappable is_nothrow_swappable_with is_nowthrow_callable is_swappable is_swappable_with negation node_type insert_return_type in_place_tag monostate variant variant_size variant_alternative \ any byte is_execution_policy parallel_policy parallel_unsequenced_policy sequenced_policy directory_entry directory_iterator file_status file_time_type path recursive_directory_iterator space_info default_order default_searcher boyer_moore_searcher boyer_moore_horspool_searcher memory_resource monotonic_buffer_resource polymorphic_allocator pool_options synchronized_pool_resource unsynchronized_pool_resource scoped_lock optional shared_mutex basic_string_view string_view u16string_view u32string_view wstring_view bool_constant conjunction disjunction has_unique_object_representations invoke_result is_aggregate is_callable is_invocable is_invocable_r is_nothrow_invocable is_nothrow_invocable_r is_nothrow_swappable is_nothrow_swappable_with is_nowthrow_callable is_swappable is_swappable_with negation node_type insert_return_type in_place_tag monostate variant variant_size variant_alternative from_chars_result to_chars_result chars_format
syntax keyword cppSTLtypedef syntax keyword cppSTLtypedef
\ invoke_result_t default_order_t nullopt_t void_t in_place_t in_place_type_t in_place_index_t variant_alternative_t \ invoke_result_t default_order_t nullopt_t void_t in_place_t in_place_type_t in_place_index_t variant_alternative_t
@@ -157,12 +156,13 @@ if !exists('cpp_no_cpp20')
syntax keyword cppSTLnamespace ranges views syntax keyword cppSTLnamespace ranges views
syntax keyword cppSTLconstant dynamic_extent syntax keyword cppSTLconstant dynamic_extent
syntax keyword cppSTLvariable default_sentinel unreachable_sentinel syntax keyword cppSTLvariable default_sentinel unreachable_sentinel
syntax keyword cppSTLexception format_error
syntax keyword cppSTLtype syntax keyword cppSTLtype
\ atomic_ref endian weak_ordering strong_ordering partial_ordering weak_equality strong_equality common_comparison_category contract_violation coroutine_traits coroutine_handle noop_coroutine_handle noop_coroutine_promise suspend_never suspend_always remove_cvref is_bounded_array is_layout_compatible is_unbounded_array is_nothrow_convertible has_strong_structural_equality is_pointer_interconvertible_base_of unwrap_reference unwrap_ref_decay basic_common_reference common_reference dangling ref_view filter_view transform_view iota_view join_view empty_view single_view split_view common_view reverse_view view_interface span basic_syncbuf basic_osyncstream syncbuf wsyncbuf osyncstream wosyncstream jthread latch barrier stop_token stop_source stop_callback counting_semaphore binary_semaphore source_location compare_three_way_result contiguous_iterator_tag incrementable_traits indirectly_readable_traits move_sentinel common_iterator counted_iterator projected type_identity \ atomic_ref endian weak_ordering strong_ordering partial_ordering weak_equality strong_equality common_comparison_category contract_violation coroutine_traits coroutine_handle noop_coroutine_handle noop_coroutine_promise suspend_never suspend_always remove_cvref is_bounded_array is_layout_compatible is_unbounded_array is_nothrow_convertible has_strong_structural_equality is_pointer_interconvertible_base_of unwrap_reference unwrap_ref_decay basic_common_reference common_reference dangling ref_view filter_view transform_view iota_view join_view empty_view single_view split_view common_view reverse_view view_interface span basic_syncbuf basic_osyncstream syncbuf wsyncbuf osyncstream wosyncstream jthread latch barrier stop_token stop_source stop_callback counting_semaphore binary_semaphore source_location compare_three_way_result contiguous_iterator_tag incrementable_traits indirectly_readable_traits move_sentinel common_iterator counted_iterator projected type_identity formatter basic_format_context basic_format_args basic_format_string basic_format_parse_context
syntax keyword cppSTLtypedef syntax keyword cppSTLtypedef
\ common_comparison_category_t remove_cvref_t unwrap_reference_t unwrap_ref_decay_t common_reference_t iterator_t sentinel_t safe_iterator_t safe_subrange_t compare_three_way_result_t iter_value_t iter_reference_t iter_difference_t iter_rvalue_reference_t iter_common_reference_t default_sentinel_t unreachable_sentinel_t indirect_result_t type_identity_t \ common_comparison_category_t remove_cvref_t unwrap_reference_t unwrap_ref_decay_t common_reference_t iterator_t sentinel_t safe_iterator_t safe_subrange_t compare_three_way_result_t iter_value_t iter_reference_t iter_difference_t iter_rvalue_reference_t iter_common_reference_t default_sentinel_t unreachable_sentinel_t indirect_result_t type_identity_t format_context wformat_context format_args wformat_args format_string wformat_string format_parse_context wformat_parse_context
syntax keyword cppSTLfunction syntax keyword cppSTLfunction
\ make_unique_default_init make_shared_default_init allocate_shared_default_init uses_allocator_construction_args make_obj_using_allocator is_corresponding_member subspan in_range is_pointer_interconvertible_with_class \ make_unique_default_init make_shared_default_init allocate_shared_default_init uses_allocator_construction_args make_obj_using_allocator is_corresponding_member subspan in_range is_pointer_interconvertible_with_class
@@ -175,6 +175,17 @@ if !exists('cpp_no_cpp20')
endif endif
" C++23 extensions {{{1
if !exists('cpp_no_cpp23')
syntax keyword cppSTLtype basic_stacktrace stacktrace_entry is_scoped_enum
syntax keyword cppSTLtypedef stacktrace
syntax keyword cppSTLbool is_scoped_enum_v
syntax keyword cppSTLfunction invoke_r
syntax keyword cppSTLtype expected unexpected unexpect_t bad_expected_access
syntax keyword cppSTLvariable unexpect
endif
" Boost {{{1 " Boost {{{1
if !exists('cpp_no_boost') if !exists('cpp_no_boost')
syntax keyword cppSTLnamespace boost syntax keyword cppSTLnamespace boost

View File

@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/javas
finish finish
endif 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 " Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to " of this software and associated documentation files (the "Software"), to

View File

@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/php/g
finish finish
endif 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 " Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to " of this software and associated documentation files (the "Software"), to

View File

@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/reaso
finish finish
endif 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 " Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to " 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 let b:current_syntax = s:current_syntax
endif endif
syntax region graphqlExtensionPoint start=+\[%graphql+ end=+\]+ contains=graphqlExtensionPointS syntax region graphqlExtensionPoint start=+\[%\(graphql\|relay\)+ end=+\]+ contains=graphqlExtensionPointS
syntax region graphqlExtensionPointS matchgroup=String start=+{|+ end=+|}+ contains=@GraphQLSyntax contained syntax region graphqlExtensionPointS matchgroup=String start=+{|+ end=+|}+ contains=@GraphQLSyntax contained

View File

@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/rescr
finish finish
endif 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 " Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to " 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 let b:current_syntax = s:current_syntax
endif endif
syntax region graphqlExtensionPoint start=+%graphql(+ end=+)+ contains=graphqlExtensionPointS syntax region graphqlExtensionPoint start=+%\(graphql\|relay\)(+ end=+)+ contains=graphqlExtensionPointS
syntax region graphqlExtensionPointS matchgroup=String start=+`+ end=+`+ contains=@GraphQLSyntax contained syntax region graphqlExtensionPointS matchgroup=String start=+`+ end=+`+ contains=@GraphQLSyntax contained

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'after/syntax/types
finish finish
endif 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 " Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to " of this software and associated documentation files (the "Software"), to

View File

@@ -82,7 +82,7 @@ syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(param\)"+ skip=+\\"
\ contains=ZinitIceDoubleQuoteParam \ contains=ZinitIceDoubleQuoteParam
" added by the existing annexes " added by the existing annexes
syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(fbin\|sbin\|gem\|node\|pip\|fmod\|fsrc\|ferc\)"+ skip=+\\"+ end=+"+ skipwhite contained syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(fbin\|lbin\|sbin\|gem\|node\|pip\|fmod\|fsrc\|ferc\)"+ skip=+\\"+ end=+"+ skipwhite contained
\ nextgroup=@ZinitLine,ZinitContinue \ nextgroup=@ZinitLine,ZinitContinue
\ contains=ZinitIceDoubleQuoteParam \ contains=ZinitIceDoubleQuoteParam
syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(dl\|patch\|submods\|cargo\|dlink\|dlink0\)"+ skip=+\\"+ end=+"+ skipwhite contained syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(dl\|patch\|submods\|cargo\|dlink\|dlink0\)"+ skip=+\\"+ end=+"+ skipwhite contained
@@ -118,7 +118,7 @@ syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(param\)'+ skip=+\\'
\ contains=ZinitIceSingleQuoteParam \ contains=ZinitIceSingleQuoteParam
" added by the existing annexes " added by the existing annexes
syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(fbin\|sbin\|gem\|node\|pip\|fmod\|fsrc\|ferc\)'+ skip=+\\'+ end=+'+ skipwhite contained syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(fbin\|lbin\|sbin\|gem\|node\|pip\|fmod\|fsrc\|ferc\)'+ skip=+\\'+ end=+'+ skipwhite contained
\ nextgroup=@ZinitLine,ZinitContinue \ nextgroup=@ZinitLine,ZinitContinue
\ contains=ZinitIceSingleQuoteParam \ contains=ZinitIceSingleQuoteParam
syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(dl\|patch\|submods\|cargo\|dlink\|dlink0\)'+ skip=+\\'+ end=+'+ skipwhite contained syn region ZinitIceWithParam matchgroup=ZinitIce start=+\s\%(dl\|patch\|submods\|cargo\|dlink\|dlink0\)'+ skip=+\\'+ end=+'+ skipwhite contained

View File

@@ -348,7 +348,7 @@ endfunction
" It returns the previous maparg dictionary, so that the previous mapping can " It returns the previous maparg dictionary, so that the previous mapping can
" be reinstated if needed. " be reinstated if needed.
function! s:L2U_SetFallbackMapping(s, k) function! s:L2U_SetFallbackMapping(s, k)
let mmdict = maparg(a:s, 'i', 0, 1) let mmdict = maparg(a:s, 'i', 0, 1)
if empty(mmdict) || !has_key(mmdict, "rhs") if empty(mmdict) || !has_key(mmdict, "rhs")
exe 'inoremap <buffer> ' . a:k . ' ' . a:s exe 'inoremap <buffer> ' . a:k . ' ' . a:s
return mmdict return mmdict

View File

@@ -1,641 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'ada', 'autoload/ada.vim')
finish
endif
"------------------------------------------------------------------------------
" Description: Perform Ada specific completion & tagging.
" Language: Ada (2005)
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
" Maintainer: Mathias Brousset <mathiasb17@gmail.com>
" Martin Krischik <krischik@users.sourceforge.net>
" Taylor Venable <taylor@metasyntax.net>
" Neil Bird <neil@fnxweb.com>
" Ned Okie <nokie@radford.edu>
" $Author: krischik $
" $Date: 2017-01-31 20:20:05 +0200 (Mon, 01 Jan 2017) $
" Version: 4.6
" $Revision: 887 $
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $
" History: 24.05.2006 MK Unified Headers
" 26.05.2006 MK ' should not be in iskeyword.
" 16.07.2006 MK Ada-Mode as vim-ball
" 02.10.2006 MK Better folding.
" 15.10.2006 MK Bram's suggestion for runtime integration
" 05.11.2006 MK Bram suggested not to use include protection for
" autoload
" 05.11.2006 MK Bram suggested to save on spaces
" 08.07.2007 TV fix mapleader problems.
" 09.05.2007 MK Session just won't work no matter how much
" tweaking is done
" 19.09.2007 NO still some mapleader problems
" 31.01.2017 MB fix more mapleader problems
" Help Page: ft-ada-functions
"------------------------------------------------------------------------------
if version < 700
finish
endif
let s:keepcpo= &cpo
set cpo&vim
" Section: Constants {{{1
"
let g:ada#DotWordRegex = '\a\w*\(\_s*\.\_s*\a\w*\)*'
let g:ada#WordRegex = '\a\w*'
let g:ada#Comment = "\\v^(\"[^\"]*\"|'.'|[^\"']){-}\\zs\\s*--.*"
let g:ada#Keywords = []
" Section: g:ada#Keywords {{{1
"
" Section: add Ada keywords {{{2
"
for Item in ['abort', 'else', 'new', 'return', 'abs', 'elsif', 'not', 'reverse', 'abstract', 'end', 'null', 'accept', 'entry', 'select', 'access', 'exception', 'of', 'separate', 'aliased', 'exit', 'or', 'subtype', 'all', 'others', 'synchronized', 'and', 'for', 'out', 'array', 'function', 'overriding', 'tagged', 'at', 'task', 'generic', 'package', 'terminate', 'begin', 'goto', 'pragma', 'then', 'body', 'private', 'type', 'if', 'procedure', 'case', 'in', 'protected', 'until', 'constant', 'interface', 'use', 'is', 'raise', 'declare', 'range', 'when', 'delay', 'limited', 'record', 'while', 'delta', 'loop', 'rem', 'with', 'digits', 'renames', 'do', 'mod', 'requeue', 'xor']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'keyword',
\ 'info': 'Ada keyword.',
\ 'kind': 'k',
\ 'icase': 1}]
endfor
" Section: GNAT Project Files {{{3
"
if exists ('g:ada_with_gnat_project_files')
for Item in ['project']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'keyword',
\ 'info': 'GNAT projectfile keyword.',
\ 'kind': 'k',
\ 'icase': 1}]
endfor
endif
" Section: add standard exception {{{2
"
for Item in ['Constraint_Error', 'Program_Error', 'Storage_Error', 'Tasking_Error', 'Status_Error', 'Mode_Error', 'Name_Error', 'Use_Error', 'Device_Error', 'End_Error', 'Data_Error', 'Layout_Error', 'Length_Error', 'Pattern_Error', 'Index_Error', 'Translation_Error', 'Time_Error', 'Argument_Error', 'Tag_Error', 'Picture_Error', 'Terminator_Error', 'Conversion_Error', 'Pointer_Error', 'Dereference_Error', 'Update_Error']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'exception',
\ 'info': 'Ada standard exception.',
\ 'kind': 'x',
\ 'icase': 1}]
endfor
" Section: add GNAT exception {{{3
"
if exists ('g:ada_gnat_extensions')
for Item in ['Assert_Failure']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'exception',
\ 'info': 'GNAT exception.',
\ 'kind': 'x',
\ 'icase': 1}]
endfor
endif
" Section: add Ada buildin types {{{2
"
for Item in ['Boolean', 'Integer', 'Natural', 'Positive', 'Float', 'Character', 'Wide_Character', 'Wide_Wide_Character', 'String', 'Wide_String', 'Wide_Wide_String', 'Duration']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'type',
\ 'info': 'Ada buildin type.',
\ 'kind': 't',
\ 'icase': 1}]
endfor
" Section: add GNAT buildin types {{{3
"
if exists ('g:ada_gnat_extensions')
for Item in ['Short_Integer', 'Short_Short_Integer', 'Long_Integer', 'Long_Long_Integer', 'Short_Float', 'Short_Short_Float', 'Long_Float', 'Long_Long_Float']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'type',
\ 'info': 'GNAT buildin type.',
\ 'kind': 't',
\ 'icase': 1}]
endfor
endif
" Section: add Ada Attributes {{{2
"
for Item in ['''Access', '''Address', '''Adjacent', '''Aft', '''Alignment', '''Base', '''Bit_Order', '''Body_Version', '''Callable', '''Caller', '''Ceiling', '''Class', '''Component_Size', '''Compose', '''Constrained', '''Copy_Sign', '''Count', '''Definite', '''Delta', '''Denorm', '''Digits', '''Emax', '''Exponent', '''External_Tag', '''Epsilon', '''First', '''First_Bit', '''Floor', '''Fore', '''Fraction', '''Identity', '''Image', '''Input', '''Large', '''Last', '''Last_Bit', '''Leading_Part', '''Length', '''Machine', '''Machine_Emax', '''Machine_Emin', '''Machine_Mantissa', '''Machine_Overflows', '''Machine_Radix', '''Machine_Rounding', '''Machine_Rounds', '''Mantissa', '''Max', '''Max_Size_In_Storage_Elements', '''Min', '''Mod', '''Model', '''Model_Emin', '''Model_Epsilon', '''Model_Mantissa', '''Model_Small', '''Modulus', '''Output', '''Partition_ID', '''Pos', '''Position', '''Pred', '''Priority', '''Range', '''Read', '''Remainder', '''Round', '''Rounding', '''Safe_Emax', '''Safe_First', '''Safe_Large', '''Safe_Last', '''Safe_Small', '''Scale', '''Scaling', '''Signed_Zeros', '''Size', '''Small', '''Storage_Pool', '''Storage_Size', '''Stream_Size', '''Succ', '''Tag', '''Terminated', '''Truncation', '''Unbiased_Rounding', '''Unchecked_Access', '''Val', '''Valid', '''Value', '''Version', '''Wide_Image', '''Wide_Value', '''Wide_Wide_Image', '''Wide_Wide_Value', '''Wide_Wide_Width', '''Wide_Width', '''Width', '''Write']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'attribute',
\ 'info': 'Ada attribute.',
\ 'kind': 'a',
\ 'icase': 1}]
endfor
" Section: add GNAT Attributes {{{3
"
if exists ('g:ada_gnat_extensions')
for Item in ['''Abort_Signal', '''Address_Size', '''Asm_Input', '''Asm_Output', '''AST_Entry', '''Bit', '''Bit_Position', '''Code_Address', '''Default_Bit_Order', '''Elaborated', '''Elab_Body', '''Elab_Spec', '''Emax', '''Enum_Rep', '''Epsilon', '''Fixed_Value', '''Has_Access_Values', '''Has_Discriminants', '''Img', '''Integer_Value', '''Machine_Size', '''Max_Interrupt_Priority', '''Max_Priority', '''Maximum_Alignment', '''Mechanism_Code', '''Null_Parameter', '''Object_Size', '''Passed_By_Reference', '''Range_Length', '''Storage_Unit', '''Target_Name', '''Tick', '''To_Address', '''Type_Class', '''UET_Address', '''Unconstrained_Array', '''Universal_Literal_String', '''Unrestricted_Access', '''VADS_Size', '''Value_Size', '''Wchar_T_Size', '''Word_Size']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'attribute',
\ 'info': 'GNAT attribute.',
\ 'kind': 'a',
\ 'icase': 1}]
endfor
endif
" Section: add Ada Pragmas {{{2
"
for Item in ['All_Calls_Remote', 'Assert', 'Assertion_Policy', 'Asynchronous', 'Atomic', 'Atomic_Components', 'Attach_Handler', 'Controlled', 'Convention', 'Detect_Blocking', 'Discard_Names', 'Elaborate', 'Elaborate_All', 'Elaborate_Body', 'Export', 'Import', 'Inline', 'Inspection_Point', 'Interface (Obsolescent)', 'Interrupt_Handler', 'Interrupt_Priority', 'Linker_Options', 'List', 'Locking_Policy', 'Memory_Size (Obsolescent)', 'No_Return', 'Normalize_Scalars', 'Optimize', 'Pack', 'Page', 'Partition_Elaboration_Policy', 'Preelaborable_Initialization', 'Preelaborate', 'Priority', 'Priority_Specific_Dispatching', 'Profile', 'Pure', 'Queueing_Policy', 'Relative_Deadline', 'Remote_Call_Interface', 'Remote_Types', 'Restrictions', 'Reviewable', 'Shared (Obsolescent)', 'Shared_Passive', 'Storage_Size', 'Storage_Unit (Obsolescent)', 'Suppress', 'System_Name (Obsolescent)', 'Task_Dispatching_Policy', 'Unchecked_Union', 'Unsuppress', 'Volatile', 'Volatile_Components']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'pragma',
\ 'info': 'Ada pragma.',
\ 'kind': 'p',
\ 'icase': 1}]
endfor
" Section: add GNAT Pragmas {{{3
"
if exists ('g:ada_gnat_extensions')
for Item in ['Abort_Defer', 'Ada_83', 'Ada_95', 'Ada_05', 'Annotate', 'Ast_Entry', 'C_Pass_By_Copy', 'Comment', 'Common_Object', 'Compile_Time_Warning', 'Complex_Representation', 'Component_Alignment', 'Convention_Identifier', 'CPP_Class', 'CPP_Constructor', 'CPP_Virtual', 'CPP_Vtable', 'Debug', 'Elaboration_Checks', 'Eliminate', 'Export_Exception', 'Export_Function', 'Export_Object', 'Export_Procedure', 'Export_Value', 'Export_Valued_Procedure', 'Extend_System', 'External', 'External_Name_Casing', 'Finalize_Storage_Only', 'Float_Representation', 'Ident', 'Import_Exception', 'Import_Function', 'Import_Object', 'Import_Procedure', 'Import_Valued_Procedure', 'Initialize_Scalars', 'Inline_Always', 'Inline_Generic', 'Interface_Name', 'Interrupt_State', 'Keep_Names', 'License', 'Link_With', 'Linker_Alias', 'Linker_Section', 'Long_Float', 'Machine_Attribute', 'Main_Storage', 'Obsolescent', 'Passive', 'Polling', 'Profile_Warnings', 'Propagate_Exceptions', 'Psect_Object', 'Pure_Function', 'Restriction_Warnings', 'Source_File_Name', 'Source_File_Name_Project', 'Source_Reference', 'Stream_Convert', 'Style_Checks', 'Subtitle', 'Suppress_All', 'Suppress_Exception_Locations', 'Suppress_Initialization', 'Task_Info', 'Task_Name', 'Task_Storage', 'Thread_Body', 'Time_Slice', 'Title', 'Unimplemented_Unit', 'Universal_Data', 'Unreferenced', 'Unreserve_All_Interrupts', 'Use_VADS_Size', 'Validity_Checks', 'Warnings', 'Weak_External']
let g:ada#Keywords += [{
\ 'word': Item,
\ 'menu': 'pragma',
\ 'info': 'GNAT pragma.',
\ 'kind': 'p',
\ 'icase': 1}]
endfor
endif
" 1}}}
" Section: g:ada#Ctags_Kinds {{{1
"
let g:ada#Ctags_Kinds = {
\ 'P': ["packspec", "package specifications"],
\ 'p': ["package", "packages"],
\ 'T': ["typespec", "type specifications"],
\ 't': ["type", "types"],
\ 'U': ["subspec", "subtype specifications"],
\ 'u': ["subtype", "subtypes"],
\ 'c': ["component", "record type components"],
\ 'l': ["literal", "enum type literals"],
\ 'V': ["varspec", "variable specifications"],
\ 'v': ["variable", "variables"],
\ 'f': ["formal", "generic formal parameters"],
\ 'n': ["constant", "constants"],
\ 'x': ["exception", "user defined exceptions"],
\ 'R': ["subprogspec", "subprogram specifications"],
\ 'r': ["subprogram", "subprograms"],
\ 'K': ["taskspec", "task specifications"],
\ 'k': ["task", "tasks"],
\ 'O': ["protectspec", "protected data specifications"],
\ 'o': ["protected", "protected data"],
\ 'E': ["entryspec", "task/protected data entry specifications"],
\ 'e': ["entry", "task/protected data entries"],
\ 'b': ["label", "labels"],
\ 'i': ["identifier", "loop/declare identifiers"],
\ 'a': ["autovar", "automatic variables"],
\ 'y': ["annon", "loops and blocks with no identifier"]}
" Section: ada#Word (...) {{{1
"
" Extract current Ada word across multiple lines
" AdaWord ([line, column])\
"
function ada#Word (...)
if a:0 > 1
let l:Line_Nr = a:1
let l:Column_Nr = a:2 - 1
else
let l:Line_Nr = line('.')
let l:Column_Nr = col('.') - 1
endif
let l:Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' )
" Cope with tag searching for items in comments; if we are, don't loop
" backwards looking for previous lines
if l:Column_Nr > strlen(l:Line)
" We were in a comment
let l:Line = getline(l:Line_Nr)
let l:Search_Prev_Lines = 0
else
let l:Search_Prev_Lines = 1
endif
" Go backwards until we find a match (Ada ID) that *doesn't* include our
" location - i.e., the previous ID. This is because the current 'correct'
" match will toggle matching/not matching as we traverse characters
" backwards. Thus, we have to find the previous unrelated match, exclude
" it, then use the next full match (ours).
" Remember to convert vim column 'l:Column_Nr' [1..n] to string offset [0..(n-1)]
" ... but start, here, one after the required char.
let l:New_Column = l:Column_Nr + 1
while 1
let l:New_Column = l:New_Column - 1
if l:New_Column < 0
" Have to include previous l:Line from file
let l:Line_Nr = l:Line_Nr - 1
if l:Line_Nr < 1 || !l:Search_Prev_Lines
" Start of file or matching in a comment
let l:Line_Nr = 1
let l:New_Column = 0
let l:Our_Match = match (l:Line, g:ada#WordRegex )
break
endif
" Get previous l:Line, and prepend it to our search string
let l:New_Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' )
let l:New_Column = strlen (l:New_Line) - 1
let l:Column_Nr = l:Column_Nr + l:New_Column
let l:Line = l:New_Line . l:Line
endif
" Check to see if this is a match excluding 'us'
let l:Match_End = l:New_Column +
\ matchend (strpart (l:Line,l:New_Column), g:ada#WordRegex ) - 1
if l:Match_End >= l:New_Column &&
\ l:Match_End < l:Column_Nr
" Yes
let l:Our_Match = l:Match_End+1 +
\ match (strpart (l:Line,l:Match_End+1), g:ada#WordRegex )
break
endif
endwhile
" Got anything?
if l:Our_Match < 0
return ''
else
let l:Line = strpart (l:Line, l:Our_Match)
endif
" Now simply add further lines until the match gets no bigger
let l:Match_String = matchstr (l:Line, g:ada#WordRegex)
let l:Last_Line = line ('$')
let l:Line_Nr = line ('.') + 1
while l:Line_Nr <= l:Last_Line
let l:Last_Match = l:Match_String
let l:Line = l:Line .
\ substitute (getline (l:Line_Nr), g:ada#Comment, '', '')
let l:Match_String = matchstr (l:Line, g:ada#WordRegex)
if l:Match_String == l:Last_Match
break
endif
endwhile
" Strip whitespace & return
return substitute (l:Match_String, '\s\+', '', 'g')
endfunction ada#Word
" Section: ada#List_Tag (...) {{{1
"
" List tags in quickfix window
"
function ada#List_Tag (...)
if a:0 > 1
let l:Tag_Word = ada#Word (a:1, a:2)
elseif a:0 > 0
let l:Tag_Word = a:1
else
let l:Tag_Word = ada#Word ()
endif
echo "Searching for" l:Tag_Word
let l:Pattern = '^' . l:Tag_Word . '$'
let l:Tag_List = taglist (l:Pattern)
let l:Error_List = []
"
" add symbols
"
for Tag_Item in l:Tag_List
if l:Tag_Item['kind'] == ''
let l:Tag_Item['kind'] = 's'
endif
let l:Error_List += [
\ l:Tag_Item['filename'] . '|' .
\ l:Tag_Item['cmd'] . '|' .
\ l:Tag_Item['kind'] . "\t" .
\ l:Tag_Item['name'] ]
endfor
set errorformat=%f\|%l\|%m
cexpr l:Error_List
cwindow
endfunction ada#List_Tag
" Section: ada#Jump_Tag (Word, Mode) {{{1
"
" Word tag - include '.' and if Ada make uppercase
"
function ada#Jump_Tag (Word, Mode)
if a:Word == ''
" Get current word
let l:Word = ada#Word()
if l:Word == ''
throw "NOT_FOUND: no identifier found."
endif
else
let l:Word = a:Word
endif
echo "Searching for " . l:Word
try
execute a:Mode l:Word
catch /.*:E426:.*/
let ignorecase = &ignorecase
set ignorecase
execute a:Mode l:Word
let &ignorecase = ignorecase
endtry
return
endfunction ada#Jump_Tag
" Section: ada#Insert_Backspace () {{{1
"
" Backspace at end of line after auto-inserted commentstring '-- ' wipes it
"
function ada#Insert_Backspace ()
let l:Line = getline ('.')
if col ('.') > strlen (l:Line) &&
\ match (l:Line, '-- $') != -1 &&
\ match (&comments,'--') != -1
return "\<bs>\<bs>\<bs>"
else
return "\<bs>"
endif
return
endfunction ada#InsertBackspace
" Section: Insert Completions {{{1
"
" Section: ada#User_Complete(findstart, base) {{{2
"
" This function is used for the 'complete' option.
"
function! ada#User_Complete(findstart, base)
if a:findstart == 1
"
" locate the start of the word
"
let line = getline ('.')
let start = col ('.') - 1
while start > 0 && line[start - 1] =~ '\i\|'''
let start -= 1
endwhile
return start
else
"
" look up matches
"
let l:Pattern = '^' . a:base . '.*$'
"
" add keywords
"
for Tag_Item in g:ada#Keywords
if l:Tag_Item['word'] =~? l:Pattern
if complete_add (l:Tag_Item) == 0
return []
endif
if complete_check ()
return []
endif
endif
endfor
return []
endif
endfunction ada#User_Complete
" Section: ada#Completion (cmd) {{{2
"
" Word completion (^N/^R/^X^]) - force '.' inclusion
function ada#Completion (cmd)
set iskeyword+=46
return a:cmd . "\<C-R>=ada#Completion_End ()\<CR>"
endfunction ada#Completion
" Section: ada#Completion_End () {{{2
"
function ada#Completion_End ()
set iskeyword-=46
return ''
endfunction ada#Completion_End
" Section: ada#Create_Tags {{{1
"
function ada#Create_Tags (option)
if a:option == 'file'
let l:Filename = fnamemodify (bufname ('%'), ':p')
elseif a:option == 'dir'
let l:Filename =
\ fnamemodify (bufname ('%'), ':p:h') . "*.ada " .
\ fnamemodify (bufname ('%'), ':p:h') . "*.adb " .
\ fnamemodify (bufname ('%'), ':p:h') . "*.ads"
else
let l:Filename = a:option
endif
execute '!ctags --excmd=number ' . l:Filename
endfunction ada#Create_Tags
" Section: ada#Switch_Session {{{1
"
function ada#Switch_Session (New_Session)
"
" you should not save to much date into the seession since they will
" be sourced
"
let l:sessionoptions=&sessionoptions
try
set sessionoptions=buffers,curdir,folds,globals,resize,slash,tabpages,tabpages,unix,winpos,winsize
if a:New_Session != v:this_session
"
" We actually got a new session - otherwise there
" is nothing to do.
"
if strlen (v:this_session) > 0
execute 'mksession! ' . v:this_session
endif
let v:this_session = a:New_Session
"if filereadable (v:this_session)
"execute 'source ' . v:this_session
"endif
augroup ada_session
autocmd!
autocmd VimLeavePre * execute 'mksession! ' . v:this_session
augroup END
"if exists ("g:Tlist_Auto_Open") && g:Tlist_Auto_Open
"TlistOpen
"endif
endif
finally
let &sessionoptions=l:sessionoptions
endtry
return
endfunction ada#Switch_Session
" Section: GNAT Pretty Printer folding {{{1
"
if exists('g:ada_folding') && g:ada_folding[0] == 'g'
"
" Lines consisting only of ')' ';' are due to a gnat pretty bug and
" have the same level as the line above (can't happen in the first
" line).
"
let s:Fold_Collate = '^\([;)]*$\|'
"
" some lone statements are folded with the line above
"
if stridx (g:ada_folding, 'i') >= 0
let s:Fold_Collate .= '\s\+\<is\>$\|'
endif
if stridx (g:ada_folding, 'b') >= 0
let s:Fold_Collate .= '\s\+\<begin\>$\|'
endif
if stridx (g:ada_folding, 'p') >= 0
let s:Fold_Collate .= '\s\+\<private\>$\|'
endif
if stridx (g:ada_folding, 'x') >= 0
let s:Fold_Collate .= '\s\+\<exception\>$\|'
endif
" We also handle empty lines and
" comments here.
let s:Fold_Collate .= '--\)'
function ada#Pretty_Print_Folding (Line) " {{{2
let l:Text = getline (a:Line)
if l:Text =~ s:Fold_Collate
"
" fold with line above
"
let l:Level = "="
elseif l:Text =~ '^\s\+('
"
" gnat outdents a line which stards with a ( by one characters so
" that parameters which follow are aligned.
"
let l:Level = (indent (a:Line) + 1) / &shiftwidth
else
let l:Level = indent (a:Line) / &shiftwidth
endif
return l:Level
endfunction ada#Pretty_Print_Folding " }}}2
endif
" Section: Options and Menus {{{1
"
" Section: ada#Switch_Syntax_Options {{{2
"
function ada#Switch_Syntax_Option (option)
syntax off
if exists ('g:ada_' . a:option)
unlet g:ada_{a:option}
echo a:option . 'now off'
else
let g:ada_{a:option}=1
echo a:option . 'now on'
endif
syntax on
endfunction ada#Switch_Syntax_Option
" Section: ada#Map_Menu {{{2
"
function ada#Map_Menu (Text, Keys, Command)
if a:Keys[0] == ':'
execute
\ "50amenu " .
\ "Ada." . escape(a:Text, ' ') .
\ "<Tab>" . a:Keys .
\ " :" . a:Command . "<CR>"
execute
\ "command -buffer " .
\ a:Keys[1:] .
\" :" . a:Command . "<CR>"
elseif a:Keys[0] == '<'
execute
\ "50amenu " .
\ "Ada." . escape(a:Text, ' ') .
\ "<Tab>" . a:Keys .
\ " :" . a:Command . "<CR>"
execute
\ "nnoremap <buffer> " .
\ a:Keys .
\" :" . a:Command . "<CR>"
execute
\ "inoremap <buffer> " .
\ a:Keys .
\" <C-O>:" . a:Command . "<CR>"
else
if exists("g:mapleader")
let l:leader = g:mapleader
else
let l:leader = '\'
endif
execute
\ "50amenu " .
\ "Ada." . escape(a:Text, ' ') .
\ "<Tab>" . escape(l:leader . "a" . a:Keys , '\') .
\ " :" . a:Command . "<CR>"
execute
\ "nnoremap <buffer>" .
\ " <Leader>a" . a:Keys .
\" :" . a:Command
execute
\ "inoremap <buffer>" .
\ " <Leader>a" . a:Keys .
\" <C-O>:" . a:Command
endif
return
endfunction
" Section: ada#Map_Popup {{{2
"
function ada#Map_Popup (Text, Keys, Command)
if exists("g:mapleader")
let l:leader = g:mapleader
else
let l:leader = '\'
endif
execute
\ "50amenu " .
\ "PopUp." . escape(a:Text, ' ') .
\ "<Tab>" . escape(l:leader . "a" . a:Keys , '\') .
\ " :" . a:Command . "<CR>"
call ada#Map_Menu (a:Text, a:Keys, a:Command)
return
endfunction ada#Map_Popup
" }}}1
lockvar g:ada#WordRegex
lockvar g:ada#DotWordRegex
lockvar g:ada#Comment
lockvar! g:ada#Keywords
lockvar! g:ada#Ctags_Kinds
let &cpo = s:keepcpo
unlet s:keepcpo
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker

File diff suppressed because one or more lines are too long

View File

@@ -96,7 +96,7 @@ lockvar g:crystal#indent#block_regex
" Regex that defines the beginning of a hanging expression. " Regex that defines the beginning of a hanging expression.
let g:crystal#indent#hanging_assignment_regex = let g:crystal#indent#hanging_assignment_regex =
\ '\%('.g:crystal#indent#operator_regex.'\s*\)\@<=' . \ '\%('.g:crystal#indent#operator_regex.'\s*\)\@<=' .
\ '\.\@1<!\<\%(if\||unless\|case\|begin\)\>' \ '\.\@1<!\<\%(if\||unless\|case\|begin\|select\)\>'
lockvar g:crystal#indent#hanging_assignment_regex lockvar g:crystal#indent#hanging_assignment_regex
" Regex that defines the start-match for the 'end' keyword. " Regex that defines the start-match for the 'end' keyword.
@@ -107,7 +107,7 @@ let g:crystal#indent#end_start_regex =
\ '\%(\<\%(private\|protected\)\s\+\)\=' . \ '\%(\<\%(private\|protected\)\s\+\)\=' .
\ '\%(\<\%(abstract\s\+\)\=\%(class\|struct\)\>\|\<\%(def\|module\|macro\|lib\|enum\|annotation\)\>\)' . \ '\%(\<\%(abstract\s\+\)\=\%(class\|struct\)\>\|\<\%(def\|module\|macro\|lib\|enum\|annotation\)\>\)' .
\ '\|' . \ '\|' .
\ '\<\%(if\|unless\|while\|until\|case\|begin\|union\)\>' . \ '\<\%(if\|unless\|while\|until\|case\|begin\|union\|select\)\>' .
\ '\)' . \ '\)' .
\ '\|' . \ '\|' .
\ g:crystal#indent#hanging_assignment_regex . \ g:crystal#indent#hanging_assignment_regex .
@@ -1042,4 +1042,4 @@ endfunction
" }}}1 " }}}1
" vim:sw=2 sts=2 ts=8 fdm=marker et: " vim:sw=2 sts=2 ts=8 fdm=marker et:

View File

@@ -224,11 +224,11 @@ endfu
fu! csv#RemoveAutoHighlight() "{{{3 fu! csv#RemoveAutoHighlight() "{{{3
exe "aug CSV_HI".bufnr('') exe "aug CSV_HI".bufnr('')
exe "au! CursorMoved <buffer=".bufnr('').">" exe "au! "
aug end aug end
exe "aug! CSV_HI".bufnr('') exe "aug! CSV_HI".bufnr('')
" Remove any existing highlighting " Remove any existing highlighting
HiColumn! call csv#HiCol('', 1)
endfu endfu
fu! csv#DoAutoCommands() "{{{3 fu! csv#DoAutoCommands() "{{{3
@@ -246,9 +246,8 @@ fu! csv#DoAutoCommands() "{{{3
endif endif
" undo autocommand: " undo autocommand:
let b:undo_ftplugin .= '| exe "sil! au! CSV_HI'.bufnr('').' CursorMoved <buffer> "' 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 let b:undo_ftplugin = 'exe "sil! HiColumn!" |' . b:undo_ftplugin
if has("gui_running") && !exists("#CSV_Menu#FileType") if has("gui_running") && !exists("#CSV_Menu#FileType")
augroup CSV_Menu augroup CSV_Menu
au! au!
@@ -443,10 +442,14 @@ fu! csv#HiCol(colnr, bang) "{{{3
if exists("s:matchid") if exists("s:matchid")
" ignore errors, that come from already deleted matches " ignore errors, that come from already deleted matches
sil! call matchdelete(s:matchid) sil! call matchdelete(s:matchid)
if a:bang
unlet! s:matchid
return
endif
endif endif
" Additionally, filter all matches, that could have been used earlier " Additionally, filter all matches, that could have been used earlier
let matchlist=getmatches() let matchlist=getmatches()
call filter(matchlist, 'v:val["group"] !~ s:hiGroup') call filter(matchlist, 'v:val["group"] !~? s:hiGroup')
call setmatches(matchlist) call setmatches(matchlist)
if a:bang if a:bang
return return
@@ -455,6 +458,10 @@ fu! csv#HiCol(colnr, bang) "{{{3
elseif !a:bang elseif !a:bang
exe ":2match " . s:hiGroup . ' /' . pat . '/' exe ":2match " . s:hiGroup . ' /' . pat . '/'
endif 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 endfu
fu! csv#GetDelimiter(first, last, ...) "{{{3 fu! csv#GetDelimiter(first, last, ...) "{{{3
" This depends on the locale. Hopefully it works " 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 " :silent :s does not work with lazyredraw
let _lz = &lz let _lz = &lz
set nolz set nolz
" substitute without output when cmdheight=0
let _cmdheight = &cmdheight
set cmdheight=1
for i in values(Delim) for i in values(Delim)
redir => temp[i] redir => temp[i]
" use very non-magic " use very non-magic
exe ":silent! :". first. ",". last. 's/\V' . i . "/&/nge" exe ":silent! :". first. ",". last. 's/\V' . i . "/&/nge"
redir END redir END
endfor endfor
let &cmdheight = _cmdheight
let &lz = _lz let &lz = _lz
let Delim = map(temp, 'matchstr(substitute(v:val, "\n", "", ""), "^\\s*\\d\\+")') let Delim = map(temp, 'matchstr(substitute(v:val, "\n", "", ""), "^\\s*\\d\\+")')
let Delim = filter(temp, 'v:val=~''\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 " does not work with fixed width columns
" row for the row for which to calculate the width " row for the row for which to calculate the width
let b:col_width=[] let b:col_width=[]
let vts_save=""
if has( 'vartabs' ) && b:delimiter == "\t" if has( 'vartabs' ) && b:delimiter == "\t"
if &l:vts
let vts_save=&vts
endif
setlocal vts= setlocal vts=
endif endif
try try
@@ -800,6 +815,9 @@ fu! csv#CalculateColumnWidth(row, silent) "{{{3
" delete buffer content in variable b:csv_list, " delete buffer content in variable b:csv_list,
" this was only necessary for calculating the max width " this was only necessary for calculating the max width
unlet! b:csv_list s:columnize_count s:decimal_column unlet! b:csv_list s:columnize_count s:decimal_column
if vts_save
let &l:vts=vts_save
endif
endfu endfu
fu! csv#Columnize(field) "{{{3 fu! csv#Columnize(field) "{{{3
" Internal function, not called from external, " Internal function, not called from external,
@@ -826,8 +844,8 @@ fu! csv#Columnize(field) "{{{3
let colnr = s:columnize_count % s:max_cols let colnr = s:columnize_count % s:max_cols
let width = get(b:col_width, colnr, 20) let width = get(b:col_width, colnr, 20)
let align = 'r' let align = 'r'
if exists('b:csv_arrange_align') if exists('b:csv_arrange_align') || exists('g:csv_arrange_align')
let align=b:csv_arrange_align let align=get(b:, 'csv_arrange_align', g:csv_arrange_align)
let indx=match(align, '\*') let indx=match(align, '\*')
if indx > 0 if indx > 0
let align = align[0:(indx-1)]. repeat(align[indx-1], len(b:col_width)-indx) let align = align[0:(indx-1)]. repeat(align[indx-1], len(b:col_width)-indx)
@@ -934,6 +952,11 @@ fu! csv#GetColPat(colnr, zs_flag) "{{{3
endfu endfu
fu! csv#SetupAutoCmd(window,bufnr) "{{{3 fu! csv#SetupAutoCmd(window,bufnr) "{{{3
" Setup QuitPre autocommand to quit cleanly " Setup QuitPre autocommand to quit cleanly
if a:bufnr == 0
" something went wrong,
" how can this happen?
return
endif
aug CSV_QuitPre aug CSV_QuitPre
au! au!
exe "au QuitPre * call CSV_CloseBuffer(".winbufnr(a:window).")" exe "au QuitPre * call CSV_CloseBuffer(".winbufnr(a:window).")"
@@ -1024,7 +1047,7 @@ fu! csv#SplitHeaderLine(lines, bang, hor) "{{{3
" disable airline " disable airline
let w:airline_disabled = 1 let w:airline_disabled = 1
let win = winnr() let win = winnr()
setl scrollbind buftype=nowrite bufhidden=wipe noswapfile nobuflisted setl scrollbind buftype=nofile bufhidden=wipe noswapfile nobuflisted
noa wincmd p noa wincmd p
let b:csv_SplitWindow = win let b:csv_SplitWindow = win
aug CSV_Preview aug CSV_Preview

View File

@@ -92,9 +92,9 @@ endfunction
" Finds the path to `uri`. " Finds the path to `uri`.
" "
" If the file is a package: uri, looks for a .packages file to resolve the path. " If the file is a package: uri, looks for a package_config.json or .packages
" If the path cannot be resolved, or is not a package: uri, returns the " file to resolve the path. If the path cannot be resolved, or is not a
" original. " package: uri, returns the original.
function! dart#resolveUri(uri) abort function! dart#resolveUri(uri) abort
if a:uri !~# 'package:' if a:uri !~# 'package:'
return a:uri return a:uri
@@ -102,7 +102,7 @@ function! dart#resolveUri(uri) abort
let package_name = substitute(a:uri, 'package:\(\w\+\)\/.*', '\1', '') let package_name = substitute(a:uri, 'package:\(\w\+\)\/.*', '\1', '')
let [found, package_map] = s:PackageMap() let [found, package_map] = s:PackageMap()
if !found if !found
call s:error('cannot find .packages file') call s:error('cannot find .packages or package_config.json file')
return a:uri return a:uri
endif endif
if !has_key(package_map, package_name) if !has_key(package_map, package_name)
@@ -116,37 +116,63 @@ function! dart#resolveUri(uri) abort
\ '') \ '')
endfunction endfunction
" A map from package name to lib directory parse from a '.packages' file. " A map from package name to lib directory parse from a 'package_config.json'
" or '.packages' file.
" "
" Returns [found, package_map] " Returns [found, package_map]
function! s:PackageMap() abort function! s:PackageMap() abort
let [found, dot_packages] = s:DotPackagesFile() let [found, package_config] = s:FindFile('.dart_tool/package_config.json')
if !found if found
return [v:false, {}] let dart_tool_dir = fnamemodify(package_config, ':p:h')
endif let content = join(readfile(package_config), "\n")
let dot_packages_dir = fnamemodify(dot_packages, ':p:h') let packages_dict = json_decode(content)
let lines = readfile(dot_packages) if packages_dict['configVersion'] != '2'
let map = {} s:error('Unsupported version of package_config.json')
for line in lines return [v:false, {}]
if line =~# '\s*#'
continue
endif endif
let package = substitute(line, ':.*$', '', '') let map = {}
let lib_dir = substitute(line, '^[^:]*:', '', '') for package in packages_dict['packages']
if lib_dir =~# 'file:/' let name = package['name']
let lib_dir = substitute(lib_dir, 'file://', '', '') let uri = package['rootUri']
if lib_dir =~# '/[A-Z]:/' let package_uri = package['packageUri']
let lib_dir = lib_dir[1:] 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 endif
else let map[name] = lib_dir
let lib_dir = resolve(dot_packages_dir.'/'.lib_dir) endfor
endif return [v:true, map]
if lib_dir =~# '/$' endif
let lib_dir = lib_dir[:len(lib_dir) - 2]
endif let [found, dot_packages] = s:FindFile('.packages')
let map[package] = lib_dir if found
endfor let dot_packages_dir = fnamemodify(dot_packages, ':p:h')
return [v:true, map] 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 endfunction
" Toggle whether dartfmt is run on save or not. " Toggle whether dartfmt is run on save or not.
@@ -158,17 +184,17 @@ function! dart#ToggleFormatOnSave() abort
let g:dart_format_on_save = 1 let g:dart_format_on_save = 1
endfunction endfunction
" Finds a file name '.packages' in the cwd, or in any directory above the open " Finds a file named [a:path] in the cwd, or in any directory above the open
" file. " file.
" "
" Returns [found, file]. " Returns [found, file]
function! s:DotPackagesFile() abort function! s:FindFile(path) abort
if filereadable('.packages') if filereadable(a:path)
return [v:true, '.packages'] return [v:true, a:path]
endif endif
let dir_path = expand('%:p:h') let dir_path = expand('%:p:h')
while v:true while v:true
let file_path = dir_path.'/.packages' let file_path = dir_path.'/'.a:path
if filereadable(file_path) if filereadable(file_path)
return [v:true, file_path] return [v:true, file_path]
endif endif

View File

@@ -71,8 +71,6 @@ function! fish#Indent()
let l:prevline = getline(l:prevlnum) let l:prevline = getline(l:prevlnum)
let l:previndent = indent(l:prevlnum) let l:previndent = indent(l:prevlnum)
if s:IsContinuedLine(v:lnum) 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) let l:previndent = indent(v:lnum - 1)
if s:IsContinuedLine(v:lnum - 1) if s:IsContinuedLine(v:lnum - 1)
return l:previndent return l:previndent
@@ -81,7 +79,7 @@ function! fish#Indent()
elseif exists('g:indent_cont') elseif exists('g:indent_cont')
return l:previndent + g:indent_cont return l:previndent + g:indent_cont
else else
return l:previndent + 3 return l:previndent + l:shiftwidth
endif endif
endif endif
if l:prevline =~# '\v^\s*%(begin|if|else|while|for|function|case|switch)>' if l:prevline =~# '\v^\s*%(begin|if|else|while|for|function|case|switch)>'
@@ -155,5 +153,5 @@ function! fish#Complete(findstart, base)
endfunction endfunction
function! fish#errorformat() function! fish#errorformat()
return '%Afish: %m,%-G%*\\ ^,%-Z%f (line %l):%s' return '%E%f (line %l):%m,%C%p^%.%#,%-C%.%#'
endfunction endfunction

View File

@@ -1,45 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'freebasic', 'autoload/freebasic.vim')
finish
endif
" Vim filetype plugin file
" Language: FreeBASIC
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2021 Mar 16
" Dialects can be one of fb, qb, fblite, or deprecated
" Precedence is forcelang > #lang > lang
function! freebasic#GetDialect() abort
if exists("g:freebasic_forcelang")
return g:freebasic_forcelang
endif
if exists("g:freebasic_lang")
let dialect = g:freebasic_lang
else
let dialect = "fb"
endif
" override with #lang directive or metacommand
let skip = "has('syntax_items') && synIDattr(synID(line('.'), col('.'), 1), 'name') =~ 'Comment$'"
let pat = '\c^\s*\%(#\s*lang\s\+\|''\s*$lang\s*:\s*\)"\([^"]*\)"'
let save_cursor = getcurpos()
call cursor(1, 1)
let lnum = search(pat, 'n', '', '', skip)
call setpos('.', save_cursor)
if lnum
let word = matchlist(getline(lnum), pat)[1]
if word =~? '\%(fb\|deprecated\|fblite\|qb\)'
let dialect = word
else
echomsg "freebasic#GetDialect: Invalid lang, found '" .. word .. "' at line " .. lnum .. " " .. getline(lnum)
endif
endif
return dialect
endfunction
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:

View File

@@ -238,7 +238,7 @@ function! fsharp#loadConfig()
endif endif
if !exists('g:fsharp#fsautocomplete_command') if !exists('g:fsharp#fsautocomplete_command')
let g:fsharp#fsautocomplete_command = ['fsautocomplete', '--background-service-enabled'] let g:fsharp#fsautocomplete_command = ['fsautocomplete']
endif endif
if !exists('g:fsharp#use_recommended_server_config') if !exists('g:fsharp#use_recommended_server_config')
let g:fsharp#use_recommended_server_config = 1 let g:fsharp#use_recommended_server_config = 1
@@ -251,7 +251,7 @@ function! fsharp#loadConfig()
let g:fsharp#automatic_reload_workspace = 1 let g:fsharp#automatic_reload_workspace = 1
endif endif
if !exists('g:fsharp#show_signature_on_cursor_move') if !exists('g:fsharp#show_signature_on_cursor_move')
let g:fsharp#show_signature_on_cursor_move = 1 let g:fsharp#show_signature_on_cursor_move = 0
endif endif
if !exists('g:fsharp#fsi_command') if !exists('g:fsharp#fsi_command')
let g:fsharp#fsi_command = "dotnet fsi" let g:fsharp#fsi_command = "dotnet fsi"
@@ -584,7 +584,7 @@ function! fsharp#openFsi(returnFocus)
if a:returnFocus | call s:win_gotoid_safe(current_win) | endif if a:returnFocus | call s:win_gotoid_safe(current_win) | endif
return s:fsi_buffer return s:fsi_buffer
else else
echom "[FSAC] Your (neo)vim does not support terminal". echom "[FSAC] Your (neo)vim does not support terminal."
return 0 return 0
endif endif
endif endif

View File

@@ -2,7 +2,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'graphql', 'autoload/graphql.v
finish finish
endif 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 " Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to " of this software and associated documentation files (the "Software"), to

30
autoload/jq.vim Normal file
View File

@@ -0,0 +1,30 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'jq', 'autoload/jq.vim')
finish
endif
""
" Refer https://github.com/vim/vim/blob/75e27d78f5370e7d2e0898326d9b080937e7b090/runtime/scripts.vim#L33-L71
function! jq#shebang() abort
let s:line1 = getline(1)
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 =~# '^jq'
set ft=jq
endif
endif
endfunction
" vim: et sw=4 ts=4 sts=4:

View File

@@ -109,9 +109,11 @@ function! jsonnet#Format()
call setfperm(expand('%'), l:originalFPerm) call setfperm(expand('%'), l:originalFPerm)
endif endif
" the file has been changed outside of vim, enable reedit " the file has been changed outside of vim, enable reedit
mkview
silent edit! silent edit!
let &fileformat = l:originalFileFormat let &fileformat = l:originalFileFormat
let &syntax = &syntax let &syntax = &syntax
silent loadview
elseif g:jsonnet_fmt_fail_silently == 0 elseif g:jsonnet_fmt_fail_silently == 0
" FixMe: We could leverage the errors coming from the `jsonnetfmt` and " FixMe: We could leverage the errors coming from the `jsonnetfmt` and
" give immediate feedback to the user at every save time. " give immediate feedback to the user at every save time.
@@ -126,4 +128,63 @@ function! jsonnet#Format()
call winrestview(l:curw) call winrestview(l:curw)
endfunction 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

View File

@@ -117,8 +117,8 @@ function! s:unmap(function)
return return
endif endif
let mapids = a:function =~# "^move" ? ["n", "x", "o"] : let mapids = a:function =~# "^move" ? ["n", "x", "o"] :
\ a:function =~# "^select" ? ["x", "o"] : \ a:function =~# "^select" ? ["x", "o"] :
\ ["n"] \ ["n"]
let fn = "julia_blocks#" . a:function let fn = "julia_blocks#" . a:function
let cmd = "<buffer> " . chars let cmd = "<buffer> " . chars
for m in mapids for m in mapids
@@ -355,10 +355,10 @@ function! s:move_before_begin()
endfunction endfunction
function! s:cycle_until_end() function! s:cycle_until_end()
let pos = getpos('.') let c = 0
while !s:on_end() while !s:on_end()
let pos = getpos('.')
call s:matchit() call s:matchit()
let c = 0
if getpos('.') == pos || c > 1000 if getpos('.') == pos || c > 1000
" shouldn't happen, but let's avoid infinite loops anyway " shouldn't happen, but let's avoid infinite loops anyway
return 0 return 0
@@ -384,12 +384,12 @@ function! s:moveto_block_delim(toend, backwards, ...)
while 1 while 1
let searchret = search('\C' . pattern, flags) let searchret = search('\C' . pattern, flags)
if !searchret if !searchret
return ret return ret
endif endif
exe "let skip = " . b:match_skip exe "let skip = " . b:match_skip
if !skip if !skip
let ret = 1 let ret = 1
break break
endif endif
endwhile endwhile
endfor endfor
@@ -495,15 +495,15 @@ function! julia_blocks#moveblock_N()
let start1_pos = ret_start ? getpos('.') : [0,0,0,0] let start1_pos = ret_start ? getpos('.') : [0,0,0,0]
call setpos('.', save_pos) call setpos('.', save_pos)
if s:on_end() if s:on_end()
normal! h normal! h
endif endif
let ret_end = s:moveto_block_delim(1, 0, 1) let ret_end = s:moveto_block_delim(1, 0, 1)
let end1_pos = ret_end ? getpos('.') : [0,0,0,0] let end1_pos = ret_end ? getpos('.') : [0,0,0,0]
if ret_start && (!ret_end || s:compare_pos(start1_pos, end1_pos) < 0) if ret_start && (!ret_end || s:compare_pos(start1_pos, end1_pos) < 0)
call setpos('.', start1_pos) call setpos('.', start1_pos)
else else
call setpos('.', save_pos) call setpos('.', save_pos)
endif endif
endif endif
@@ -564,7 +564,7 @@ function! julia_blocks#moveblock_p()
if s:on_begin() if s:on_begin()
call s:move_before_begin() call s:move_before_begin()
if s:on_end() if s:on_end()
normal! l normal! l
endif endif
let save_pos = getpos('.') let save_pos = getpos('.')
let ret_start = s:moveto_block_delim(0, 1, 1) 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] let end1_pos = ret_end ? getpos('.') : [0,0,0,0]
if ret_end && (!ret_start || s:compare_pos(start1_pos, end1_pos) < 0) if ret_end && (!ret_start || s:compare_pos(start1_pos, end1_pos) < 0)
call setpos('.', end1_pos) call setpos('.', end1_pos)
else else
call setpos('.', save_pos) call setpos('.', save_pos)
endif endif
endif endif
@@ -700,7 +700,7 @@ function! s:find_block(current_mode)
endfunction endfunction
function! s:repeated_find(ai_mode) 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) for c in range(repeat)
let current_mode = (c < repeat - 1 ? 'a' : a:ai_mode) let current_mode = (c < repeat - 1 ? 'a' : a:ai_mode)
let ret_find_block = s:find_block(current_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 let b:jlblk_doing_select = 1
" CursorMove is only triggered if end_pos " CursorMoved is only triggered if end_pos
" end_pos is different than the staring position; " is different than the staring position;
" so when starting from the 'd' in 'end' we need to " so when starting from the 'd' in 'end' we need to
" force it " force it
if current_pos == end_pos if current_pos == end_pos
@@ -746,6 +746,39 @@ function! julia_blocks#select_a(...)
return [start_pos, end_pos] return [start_pos, end_pos]
endfunction 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() function! julia_blocks#select_i()
call s:get_save_pos(!b:jlblk_did_select) call s:get_save_pos(!b:jlblk_did_select)
let current_pos = getpos('.') let current_pos = getpos('.')
@@ -759,19 +792,32 @@ function! julia_blocks#select_i()
return s:abort() return s:abort()
endif endif
call setpos('.', end_pos)
let b:jlblk_doing_select = 1 let b:jlblk_doing_select = 1
let start_pos[1] += 1
call setpos('.', start_pos) 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 start_pos = getpos('.')
let end_pos[1] -= 1
let end_pos[2] = len(getline(end_pos[1]))
" CursorMove is only triggered if end_pos call setpos('.', end_pos)
" end_pos is different than the staring position; 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 " so when starting from the 'd' in 'end' we need to
" force it " force it
if current_pos == end_pos if current_pos == end_pos

View File

@@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'julia', 'autoload/julia_latex
endif endif
" This file is autogenerated from the script 'generate_latex_symbols_table.jl' " 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.11.0-DEV.14
scriptencoding utf-8 scriptencoding utf-8
@@ -17,6 +17,7 @@ function! julia_latex_symbols#get_dict()
\ '\copyright': '©', \ '\copyright': '©',
\ '\:copyright:': '©', \ '\:copyright:': '©',
\ '\ordfeminine': 'ª', \ '\ordfeminine': 'ª',
\ '\guillemotleft': '«',
\ '\neg': '¬', \ '\neg': '¬',
\ '\circledR': '®', \ '\circledR': '®',
\ '\:registered:': '®', \ '\:registered:': '®',
@@ -29,6 +30,7 @@ function! julia_latex_symbols#get_dict()
\ '\cdotp': '·', \ '\cdotp': '·',
\ '\^1': '¹', \ '\^1': '¹',
\ '\ordmasculine': 'º', \ '\ordmasculine': 'º',
\ '\guillemotright': '»',
\ '\1/4': '¼', \ '\1/4': '¼',
\ '\1/2': '½', \ '\1/2': '½',
\ '\3/4': '¾', \ '\3/4': '¾',
@@ -267,7 +269,7 @@ function! julia_latex_symbols#get_dict()
\ '\^c': 'ᶜ', \ '\^c': 'ᶜ',
\ '\^f': 'ᶠ', \ '\^f': 'ᶠ',
\ '\^iota': 'ᶥ', \ '\^iota': 'ᶥ',
\ '\^Phi': 'ᶲ', \ '\^ltphi': 'ᶲ',
\ '\^z': 'ᶻ', \ '\^z': 'ᶻ',
\ '\^theta': 'ᶿ', \ '\^theta': 'ᶿ',
\ '\enspace': '', \ '\enspace': '',
@@ -281,8 +283,8 @@ function! julia_latex_symbols#get_dict()
\ '\lq': '', \ '\lq': '',
\ '\rq': '', \ '\rq': '',
\ '\reapos': '', \ '\reapos': '',
\ '\quotedblleft': '“', \ '\ldq': '“',
\ '\quotedblright': '”', \ '\rdq': '”',
\ '\dagger': '†', \ '\dagger': '†',
\ '\ddagger': '‡', \ '\ddagger': '‡',
\ '\bullet': '•', \ '\bullet': '•',
@@ -374,10 +376,12 @@ function! julia_latex_symbols#get_dict()
\ '\scrH': '', \ '\scrH': '',
\ '\frakH': '', \ '\frakH': '',
\ '\bbH': '', \ '\bbH': '',
\ '\ith': '',
\ '\planck': '', \ '\planck': '',
\ '\hslash': 'ℏ', \ '\hslash': 'ℏ',
\ '\scrI': '', \ '\scrI': '',
\ '\Im': '', \ '\Im': '',
\ '\frakI': '',
\ '\scrL': '', \ '\scrL': '',
\ '\ell': '', \ '\ell': '',
\ '\bbN': '', \ '\bbN': '',
@@ -387,6 +391,7 @@ function! julia_latex_symbols#get_dict()
\ '\bbQ': '', \ '\bbQ': '',
\ '\scrR': '', \ '\scrR': '',
\ '\Re': '', \ '\Re': '',
\ '\frakR': '',
\ '\bbR': '', \ '\bbR': '',
\ '\xrat': '℞', \ '\xrat': '℞',
\ '\trademark': '™', \ '\trademark': '™',
@@ -656,6 +661,7 @@ function! julia_latex_symbols#get_dict()
\ '\measeq': '≞', \ '\measeq': '≞',
\ '\questeq': '≟', \ '\questeq': '≟',
\ '\ne': '≠', \ '\ne': '≠',
\ '\neq': '≠',
\ '\equiv': '≡', \ '\equiv': '≡',
\ '\nequiv': '≢', \ '\nequiv': '≢',
\ '\Equiv': '≣', \ '\Equiv': '≣',
@@ -759,7 +765,9 @@ function! julia_latex_symbols#get_dict()
\ '\veebar': '⊻', \ '\veebar': '⊻',
\ '\xor': '⊻', \ '\xor': '⊻',
\ '\barwedge': '⊼', \ '\barwedge': '⊼',
\ '\nand': '⊼',
\ '\barvee': '⊽', \ '\barvee': '⊽',
\ '\nor': '⊽',
\ '\rightanglearc': '⊾', \ '\rightanglearc': '⊾',
\ '\varlrtriangle': '⊿', \ '\varlrtriangle': '⊿',
\ '\bigwedge': '⋀', \ '\bigwedge': '⋀',
@@ -799,7 +807,7 @@ function! julia_latex_symbols#get_dict()
\ '\nsqsubseteq': '⋢', \ '\nsqsubseteq': '⋢',
\ '\nsqsupseteq': '⋣', \ '\nsqsupseteq': '⋣',
\ '\sqsubsetneq': '⋤', \ '\sqsubsetneq': '⋤',
\ '\sqspne': '⋥', \ '\sqsupsetneq': '⋥',
\ '\lnsim': '⋦', \ '\lnsim': '⋦',
\ '\gnsim': '⋧', \ '\gnsim': '⋧',
\ '\precnsim': '⋨', \ '\precnsim': '⋨',
@@ -1009,6 +1017,7 @@ function! julia_latex_symbols#get_dict()
\ '\astrosun': '☉', \ '\astrosun': '☉',
\ '\:phone:': '☎', \ '\:phone:': '☎',
\ '\:ballot_box_with_check:': '☑', \ '\:ballot_box_with_check:': '☑',
\ '\:umbrella_with_rain_drops:': '☔',
\ '\:umbrella:': '☔', \ '\:umbrella:': '☔',
\ '\:coffee:': '☕', \ '\:coffee:': '☕',
\ '\:point_up:': '☝', \ '\:point_up:': '☝',
@@ -1097,6 +1106,7 @@ function! julia_latex_symbols#get_dict()
\ '\:soccer:': '⚽', \ '\:soccer:': '⚽',
\ '\:baseball:': '⚾', \ '\:baseball:': '⚾',
\ '\:snowman:': '⛄', \ '\:snowman:': '⛄',
\ '\:snowman_without_snow:': '⛄',
\ '\:partly_sunny:': '⛅', \ '\:partly_sunny:': '⛅',
\ '\:ophiuchus:': '⛎', \ '\:ophiuchus:': '⛎',
\ '\:no_entry:': '⛔', \ '\:no_entry:': '⛔',
@@ -1144,6 +1154,7 @@ function! julia_latex_symbols#get_dict()
\ '\threedangle': '⟀', \ '\threedangle': '⟀',
\ '\whiteinwhitetriangle': '⟁', \ '\whiteinwhitetriangle': '⟁',
\ '\perp': '⟂', \ '\perp': '⟂',
\ '\veedot': '⟇',
\ '\bsolhsub': '⟈', \ '\bsolhsub': '⟈',
\ '\suphsol': '⟉', \ '\suphsol': '⟉',
\ '\wedgedot': '⟑', \ '\wedgedot': '⟑',
@@ -1266,6 +1277,8 @@ function! julia_latex_symbols#get_dict()
\ '\UpEquilibrium': '⥮', \ '\UpEquilibrium': '⥮',
\ '\ReverseUpEquilibrium': '⥯', \ '\ReverseUpEquilibrium': '⥯',
\ '\RoundImplies': '⥰', \ '\RoundImplies': '⥰',
\ '\leftarrowless': '⥷',
\ '\leftarrowsubset': '⥺',
\ '\Vvert': '⦀', \ '\Vvert': '⦀',
\ '\Elroang': '⦆', \ '\Elroang': '⦆',
\ '\ddfnc': '⦙', \ '\ddfnc': '⦙',
@@ -1352,8 +1365,8 @@ function! julia_latex_symbols#get_dict()
\ '\intcup': '⨚', \ '\intcup': '⨚',
\ '\upint': '⨛', \ '\upint': '⨛',
\ '\lowint': '⨜', \ '\lowint': '⨜',
\ '\Join': '⨝',
\ '\join': '⨝', \ '\join': '⨝',
\ '\bbsemi': '⨟',
\ '\ringplus': '⨢', \ '\ringplus': '⨢',
\ '\plushat': '⨣', \ '\plushat': '⨣',
\ '\simplus': '⨤', \ '\simplus': '⨤',
@@ -1541,6 +1554,11 @@ function! julia_latex_symbols#get_dict()
\ '\forksnot': '⫝', \ '\forksnot': '⫝',
\ '\dashV': '⫣', \ '\dashV': '⫣',
\ '\Dashv': '⫤', \ '\Dashv': '⫤',
\ '\Top': '⫪',
\ '\downvDash': '⫪',
\ '\upvDash': '⫫',
\ '\Bot': '⫫',
\ '\indep': '⫫',
\ '\interleave': '⫴', \ '\interleave': '⫴',
\ '\tdcol': '⫶', \ '\tdcol': '⫶',
\ '\lllnest': '⫷', \ '\lllnest': '⫷',
@@ -1625,6 +1643,9 @@ function! julia_latex_symbols#get_dict()
\ '\:part_alternation_mark:': '〽', \ '\:part_alternation_mark:': '〽',
\ '\:congratulations:': '㊗', \ '\:congratulations:': '㊗',
\ '\:secret:': '㊙', \ '\:secret:': '㊙',
\ '\^uparrow': 'ꜛ',
\ '\^downarrow': 'ꜜ',
\ '\^!': 'ꜝ',
\ '\bfA': '𝐀', \ '\bfA': '𝐀',
\ '\bfB': '𝐁', \ '\bfB': '𝐁',
\ '\bfC': '𝐂', \ '\bfC': '𝐂',
@@ -2309,7 +2330,7 @@ function! julia_latex_symbols#get_dict()
\ '\bfbeta': '𝛃', \ '\bfbeta': '𝛃',
\ '\bfgamma': '𝛄', \ '\bfgamma': '𝛄',
\ '\bfdelta': '𝛅', \ '\bfdelta': '𝛅',
\ '\bfepsilon': '𝛆', \ '\bfvarepsilon': '𝛆',
\ '\bfzeta': '𝛇', \ '\bfzeta': '𝛇',
\ '\bfeta': '𝛈', \ '\bfeta': '𝛈',
\ '\bftheta': '𝛉', \ '\bftheta': '𝛉',
@@ -2331,7 +2352,7 @@ function! julia_latex_symbols#get_dict()
\ '\bfpsi': '𝛙', \ '\bfpsi': '𝛙',
\ '\bfomega': '𝛚', \ '\bfomega': '𝛚',
\ '\bfpartial': '𝛛', \ '\bfpartial': '𝛛',
\ '\bfvarepsilon': '𝛜', \ '\bfepsilon': '𝛜',
\ '\bfvartheta': '𝛝', \ '\bfvartheta': '𝛝',
\ '\bfvarkappa': '𝛞', \ '\bfvarkappa': '𝛞',
\ '\bfphi': '𝛟', \ '\bfphi': '𝛟',
@@ -2367,7 +2388,7 @@ function! julia_latex_symbols#get_dict()
\ '\itbeta': '𝛽', \ '\itbeta': '𝛽',
\ '\itgamma': '𝛾', \ '\itgamma': '𝛾',
\ '\itdelta': '𝛿', \ '\itdelta': '𝛿',
\ '\itepsilon': '𝜀', \ '\itvarepsilon': '𝜀',
\ '\itzeta': '𝜁', \ '\itzeta': '𝜁',
\ '\iteta': '𝜂', \ '\iteta': '𝜂',
\ '\ittheta': '𝜃', \ '\ittheta': '𝜃',
@@ -2384,15 +2405,15 @@ function! julia_latex_symbols#get_dict()
\ '\itsigma': '𝜎', \ '\itsigma': '𝜎',
\ '\ittau': '𝜏', \ '\ittau': '𝜏',
\ '\itupsilon': '𝜐', \ '\itupsilon': '𝜐',
\ '\itphi': '𝜑', \ '\itvarphi': '𝜑',
\ '\itchi': '𝜒', \ '\itchi': '𝜒',
\ '\itpsi': '𝜓', \ '\itpsi': '𝜓',
\ '\itomega': '𝜔', \ '\itomega': '𝜔',
\ '\itpartial': '𝜕', \ '\itpartial': '𝜕',
\ '\itvarepsilon': '𝜖', \ '\itepsilon': '𝜖',
\ '\itvartheta': '𝜗', \ '\itvartheta': '𝜗',
\ '\itvarkappa': '𝜘', \ '\itvarkappa': '𝜘',
\ '\itvarphi': '𝜙', \ '\itphi': '𝜙',
\ '\itvarrho': '𝜚', \ '\itvarrho': '𝜚',
\ '\itvarpi': '𝜛', \ '\itvarpi': '𝜛',
\ '\biAlpha': '𝜜', \ '\biAlpha': '𝜜',
@@ -2425,7 +2446,7 @@ function! julia_latex_symbols#get_dict()
\ '\bibeta': '𝜷', \ '\bibeta': '𝜷',
\ '\bigamma': '𝜸', \ '\bigamma': '𝜸',
\ '\bidelta': '𝜹', \ '\bidelta': '𝜹',
\ '\biepsilon': '𝜺', \ '\bivarepsilon': '𝜺',
\ '\bizeta': '𝜻', \ '\bizeta': '𝜻',
\ '\bieta': '𝜼', \ '\bieta': '𝜼',
\ '\bitheta': '𝜽', \ '\bitheta': '𝜽',
@@ -2442,15 +2463,15 @@ function! julia_latex_symbols#get_dict()
\ '\bisigma': '𝝈', \ '\bisigma': '𝝈',
\ '\bitau': '𝝉', \ '\bitau': '𝝉',
\ '\biupsilon': '𝝊', \ '\biupsilon': '𝝊',
\ '\biphi': '𝝋', \ '\bivarphi': '𝝋',
\ '\bichi': '𝝌', \ '\bichi': '𝝌',
\ '\bipsi': '𝝍', \ '\bipsi': '𝝍',
\ '\biomega': '𝝎', \ '\biomega': '𝝎',
\ '\bipartial': '𝝏', \ '\bipartial': '𝝏',
\ '\bivarepsilon': '𝝐', \ '\biepsilon': '𝝐',
\ '\bivartheta': '𝝑', \ '\bivartheta': '𝝑',
\ '\bivarkappa': '𝝒', \ '\bivarkappa': '𝝒',
\ '\bivarphi': '𝝓', \ '\biphi': '𝝓',
\ '\bivarrho': '𝝔', \ '\bivarrho': '𝝔',
\ '\bivarpi': '𝝕', \ '\bivarpi': '𝝕',
\ '\bsansAlpha': '𝝖', \ '\bsansAlpha': '𝝖',
@@ -2483,7 +2504,7 @@ function! julia_latex_symbols#get_dict()
\ '\bsansbeta': '𝝱', \ '\bsansbeta': '𝝱',
\ '\bsansgamma': '𝝲', \ '\bsansgamma': '𝝲',
\ '\bsansdelta': '𝝳', \ '\bsansdelta': '𝝳',
\ '\bsansepsilon': '𝝴', \ '\bsansvarepsilon': '𝝴',
\ '\bsanszeta': '𝝵', \ '\bsanszeta': '𝝵',
\ '\bsanseta': '𝝶', \ '\bsanseta': '𝝶',
\ '\bsanstheta': '𝝷', \ '\bsanstheta': '𝝷',
@@ -2500,15 +2521,15 @@ function! julia_latex_symbols#get_dict()
\ '\bsanssigma': '𝞂', \ '\bsanssigma': '𝞂',
\ '\bsanstau': '𝞃', \ '\bsanstau': '𝞃',
\ '\bsansupsilon': '𝞄', \ '\bsansupsilon': '𝞄',
\ '\bsansphi': '𝞅', \ '\bsansvarphi': '𝞅',
\ '\bsanschi': '𝞆', \ '\bsanschi': '𝞆',
\ '\bsanspsi': '𝞇', \ '\bsanspsi': '𝞇',
\ '\bsansomega': '𝞈', \ '\bsansomega': '𝞈',
\ '\bsanspartial': '𝞉', \ '\bsanspartial': '𝞉',
\ '\bsansvarepsilon': '𝞊', \ '\bsansepsilon': '𝞊',
\ '\bsansvartheta': '𝞋', \ '\bsansvartheta': '𝞋',
\ '\bsansvarkappa': '𝞌', \ '\bsansvarkappa': '𝞌',
\ '\bsansvarphi': '𝞍', \ '\bsansphi': '𝞍',
\ '\bsansvarrho': '𝞎', \ '\bsansvarrho': '𝞎',
\ '\bsansvarpi': '𝞏', \ '\bsansvarpi': '𝞏',
\ '\bisansAlpha': '𝞐', \ '\bisansAlpha': '𝞐',
@@ -2541,7 +2562,7 @@ function! julia_latex_symbols#get_dict()
\ '\bisansbeta': '𝞫', \ '\bisansbeta': '𝞫',
\ '\bisansgamma': '𝞬', \ '\bisansgamma': '𝞬',
\ '\bisansdelta': '𝞭', \ '\bisansdelta': '𝞭',
\ '\bisansepsilon': '𝞮', \ '\bisansvarepsilon': '𝞮',
\ '\bisanszeta': '𝞯', \ '\bisanszeta': '𝞯',
\ '\bisanseta': '𝞰', \ '\bisanseta': '𝞰',
\ '\bisanstheta': '𝞱', \ '\bisanstheta': '𝞱',
@@ -2558,15 +2579,15 @@ function! julia_latex_symbols#get_dict()
\ '\bisanssigma': '𝞼', \ '\bisanssigma': '𝞼',
\ '\bisanstau': '𝞽', \ '\bisanstau': '𝞽',
\ '\bisansupsilon': '𝞾', \ '\bisansupsilon': '𝞾',
\ '\bisansphi': '𝞿', \ '\bisansvarphi': '𝞿',
\ '\bisanschi': '𝟀', \ '\bisanschi': '𝟀',
\ '\bisanspsi': '𝟁', \ '\bisanspsi': '𝟁',
\ '\bisansomega': '𝟂', \ '\bisansomega': '𝟂',
\ '\bisanspartial': '𝟃', \ '\bisanspartial': '𝟃',
\ '\bisansvarepsilon': '𝟄', \ '\bisansepsilon': '𝟄',
\ '\bisansvartheta': '𝟅', \ '\bisansvartheta': '𝟅',
\ '\bisansvarkappa': '𝟆', \ '\bisansvarkappa': '𝟆',
\ '\bisansvarphi': '𝟇', \ '\bisansphi': '𝟇',
\ '\bisansvarrho': '𝟈', \ '\bisansvarrho': '𝟈',
\ '\bisansvarpi': '𝟉', \ '\bisansvarpi': '𝟉',
\ '\bfDigamma': '𝟊', \ '\bfDigamma': '𝟊',
@@ -2686,6 +2707,9 @@ function! julia_latex_symbols#get_dict()
\ '\:sun_with_face:': '🌞', \ '\:sun_with_face:': '🌞',
\ '\:star2:': '🌟', \ '\:star2:': '🌟',
\ '\:stars:': '🌠', \ '\:stars:': '🌠',
\ '\:hotdog:': '🌭',
\ '\:taco:': '🌮',
\ '\:burrito:': '🌯',
\ '\:chestnut:': '🌰', \ '\:chestnut:': '🌰',
\ '\:seedling:': '🌱', \ '\:seedling:': '🌱',
\ '\:evergreen_tree:': '🌲', \ '\:evergreen_tree:': '🌲',
@@ -2752,7 +2776,7 @@ function! julia_latex_symbols#get_dict()
\ '\:cake:': '🍰', \ '\:cake:': '🍰',
\ '\:bento:': '🍱', \ '\:bento:': '🍱',
\ '\:stew:': '🍲', \ '\:stew:': '🍲',
\ '\:egg:': '🍳', \ '\:fried_egg:': '🍳',
\ '\:fork_and_knife:': '🍴', \ '\:fork_and_knife:': '🍴',
\ '\:tea:': '🍵', \ '\:tea:': '🍵',
\ '\:sake:': '🍶', \ '\:sake:': '🍶',
@@ -2762,6 +2786,8 @@ function! julia_latex_symbols#get_dict()
\ '\:beer:': '🍺', \ '\:beer:': '🍺',
\ '\:beers:': '🍻', \ '\:beers:': '🍻',
\ '\:baby_bottle:': '🍼', \ '\:baby_bottle:': '🍼',
\ '\:champagne:': '🍾',
\ '\:popcorn:': '🍿',
\ '\:ribbon:': '🎀', \ '\:ribbon:': '🎀',
\ '\:gift:': '🎁', \ '\:gift:': '🎁',
\ '\:birthday:': '🎂', \ '\:birthday:': '🎂',
@@ -2819,11 +2845,17 @@ function! julia_latex_symbols#get_dict()
\ '\:snowboarder:': '🏂', \ '\:snowboarder:': '🏂',
\ '\:runner:': '🏃', \ '\:runner:': '🏃',
\ '\:surfer:': '🏄', \ '\:surfer:': '🏄',
\ '\:sports_medal:': '🏅',
\ '\:trophy:': '🏆', \ '\:trophy:': '🏆',
\ '\:horse_racing:': '🏇', \ '\:horse_racing:': '🏇',
\ '\:football:': '🏈', \ '\:football:': '🏈',
\ '\:rugby_football:': '🏉', \ '\:rugby_football:': '🏉',
\ '\:swimmer:': '🏊', \ '\:swimmer:': '🏊',
\ '\:cricket_bat_and_ball:': '🏏',
\ '\:volleyball:': '🏐',
\ '\:field_hockey_stick_and_ball:': '🏑',
\ '\:ice_hockey_stick_and_puck:': '🏒',
\ '\:table_tennis_paddle_and_ball:': '🏓',
\ '\:house:': '🏠', \ '\:house:': '🏠',
\ '\:house_with_garden:': '🏡', \ '\:house_with_garden:': '🏡',
\ '\:office:': '🏢', \ '\:office:': '🏢',
@@ -2841,6 +2873,10 @@ function! julia_latex_symbols#get_dict()
\ '\:izakaya_lantern:': '🏮', \ '\:izakaya_lantern:': '🏮',
\ '\:japanese_castle:': '🏯', \ '\:japanese_castle:': '🏯',
\ '\:european_castle:': '🏰', \ '\:european_castle:': '🏰',
\ '\:waving_black_flag:': '🏴',
\ '\:badminton_racquet_and_shuttlecock:': '🏸',
\ '\:bow_and_arrow:': '🏹',
\ '\:amphora:': '🏺',
\ '\:skin-tone-2:': '🏻', \ '\:skin-tone-2:': '🏻',
\ '\:skin-tone-3:': '🏼', \ '\:skin-tone-3:': '🏼',
\ '\:skin-tone-4:': '🏽', \ '\:skin-tone-4:': '🏽',
@@ -2876,7 +2912,7 @@ function! julia_latex_symbols#get_dict()
\ '\:bug:': '🐛', \ '\:bug:': '🐛',
\ '\:ant:': '🐜', \ '\:ant:': '🐜',
\ '\:bee:': '🐝', \ '\:bee:': '🐝',
\ '\:beetle:': '🐞', \ '\:ladybug:': '🐞',
\ '\:fish:': '🐟', \ '\:fish:': '🐟',
\ '\:tropical_fish:': '🐠', \ '\:tropical_fish:': '🐠',
\ '\:blowfish:': '🐡', \ '\:blowfish:': '🐡',
@@ -2952,6 +2988,7 @@ function! julia_latex_symbols#get_dict()
\ '\:woman:': '👩', \ '\:woman:': '👩',
\ '\:family:': '👪', \ '\:family:': '👪',
\ '\:couple:': '👫', \ '\:couple:': '👫',
\ '\:man_and_woman_holding_hands:': '👫',
\ '\:two_men_holding_hands:': '👬', \ '\:two_men_holding_hands:': '👬',
\ '\:two_women_holding_hands:': '👭', \ '\:two_women_holding_hands:': '👭',
\ '\:cop:': '👮', \ '\:cop:': '👮',
@@ -3070,6 +3107,7 @@ function! julia_latex_symbols#get_dict()
\ '\:pager:': '📟', \ '\:pager:': '📟',
\ '\:fax:': '📠', \ '\:fax:': '📠',
\ '\:satellite:': '📡', \ '\:satellite:': '📡',
\ '\:satellite_antenna:': '📡',
\ '\:loudspeaker:': '📢', \ '\:loudspeaker:': '📢',
\ '\:mega:': '📣', \ '\:mega:': '📣',
\ '\:outbox_tray:': '📤', \ '\:outbox_tray:': '📤',
@@ -3092,10 +3130,12 @@ function! julia_latex_symbols#get_dict()
\ '\:no_mobile_phones:': '📵', \ '\:no_mobile_phones:': '📵',
\ '\:signal_strength:': '📶', \ '\:signal_strength:': '📶',
\ '\:camera:': '📷', \ '\:camera:': '📷',
\ '\:camera_with_flash:': '📸',
\ '\:video_camera:': '📹', \ '\:video_camera:': '📹',
\ '\:tv:': '📺', \ '\:tv:': '📺',
\ '\:radio:': '📻', \ '\:radio:': '📻',
\ '\:vhs:': '📼', \ '\:vhs:': '📼',
\ '\:prayer_beads:': '📿',
\ '\:twisted_rightwards_arrows:': '🔀', \ '\:twisted_rightwards_arrows:': '🔀',
\ '\:repeat:': '🔁', \ '\:repeat:': '🔁',
\ '\:repeat_one:': '🔂', \ '\:repeat_one:': '🔂',
@@ -3158,6 +3198,10 @@ function! julia_latex_symbols#get_dict()
\ '\:small_red_triangle_down:': '🔻', \ '\:small_red_triangle_down:': '🔻',
\ '\:arrow_up_small:': '🔼', \ '\:arrow_up_small:': '🔼',
\ '\:arrow_down_small:': '🔽', \ '\:arrow_down_small:': '🔽',
\ '\:kaaba:': '🕋',
\ '\:mosque:': '🕌',
\ '\:synagogue:': '🕍',
\ '\:menorah_with_nine_branches:': '🕎',
\ '\:clock1:': '🕐', \ '\:clock1:': '🕐',
\ '\:clock2:': '🕑', \ '\:clock2:': '🕑',
\ '\:clock3:': '🕒', \ '\:clock3:': '🕒',
@@ -3182,6 +3226,10 @@ function! julia_latex_symbols#get_dict()
\ '\:clock1030:': '🕥', \ '\:clock1030:': '🕥',
\ '\:clock1130:': '🕦', \ '\:clock1130:': '🕦',
\ '\:clock1230:': '🕧', \ '\:clock1230:': '🕧',
\ '\:man_dancing:': '🕺',
\ '\:middle_finger:': '🖕',
\ '\:spock-hand:': '🖖',
\ '\:black_heart:': '🖤',
\ '\:mount_fuji:': '🗻', \ '\:mount_fuji:': '🗻',
\ '\:tokyo_tower:': '🗼', \ '\:tokyo_tower:': '🗼',
\ '\:statue_of_liberty:': '🗽', \ '\:statue_of_liberty:': '🗽',
@@ -3252,6 +3300,10 @@ function! julia_latex_symbols#get_dict()
\ '\:pouting_cat:': '😾', \ '\:pouting_cat:': '😾',
\ '\:crying_cat_face:': '😿', \ '\:crying_cat_face:': '😿',
\ '\:scream_cat:': '🙀', \ '\:scream_cat:': '🙀',
\ '\:slightly_frowning_face:': '🙁',
\ '\:slightly_smiling_face:': '🙂',
\ '\:upside_down_face:': '🙃',
\ '\:face_with_rolling_eyes:': '🙄',
\ '\:no_good:': '🙅', \ '\:no_good:': '🙅',
\ '\:ok_woman:': '🙆', \ '\:ok_woman:': '🙆',
\ '\:bow:': '🙇', \ '\:bow:': '🙇',
@@ -3332,5 +3384,328 @@ function! julia_latex_symbols#get_dict()
\ '\:passport_control:': '🛂', \ '\:passport_control:': '🛂',
\ '\:customs:': '🛃', \ '\:customs:': '🛃',
\ '\:baggage_claim:': '🛄', \ '\:baggage_claim:': '🛄',
\ '\:left_luggage:': '🛅'} \ '\:left_luggage:': '🛅',
\ '\:sleeping_accommodation:': '🛌',
\ '\:place_of_worship:': '🛐',
\ '\:octagonal_sign:': '🛑',
\ '\:shopping_trolley:': '🛒',
\ '\:hindu_temple:': '🛕',
\ '\:hut:': '🛖',
\ '\:elevator:': '🛗',
\ '\:airplane_departure:': '🛫',
\ '\:airplane_arriving:': '🛬',
\ '\:scooter:': '🛴',
\ '\:motor_scooter:': '🛵',
\ '\:canoe:': '🛶',
\ '\:sled:': '🛷',
\ '\:flying_saucer:': '🛸',
\ '\:skateboard:': '🛹',
\ '\:auto_rickshaw:': '🛺',
\ '\:pickup_truck:': '🛻',
\ '\:roller_skate:': '🛼',
\ '\:large_orange_circle:': '🟠',
\ '\:large_yellow_circle:': '🟡',
\ '\:large_green_circle:': '🟢',
\ '\:large_purple_circle:': '🟣',
\ '\:large_brown_circle:': '🟤',
\ '\:large_red_square:': '🟥',
\ '\:large_blue_square:': '🟦',
\ '\:large_orange_square:': '🟧',
\ '\:large_yellow_square:': '🟨',
\ '\:large_green_square:': '🟩',
\ '\:large_purple_square:': '🟪',
\ '\:large_brown_square:': '🟫',
\ '\:pinched_fingers:': '🤌',
\ '\:white_heart:': '🤍',
\ '\:brown_heart:': '🤎',
\ '\:pinching_hand:': '🤏',
\ '\:zipper_mouth_face:': '🤐',
\ '\:money_mouth_face:': '🤑',
\ '\:face_with_thermometer:': '🤒',
\ '\:nerd_face:': '🤓',
\ '\:thinking_face:': '🤔',
\ '\:face_with_head_bandage:': '🤕',
\ '\:robot_face:': '🤖',
\ '\:hugging_face:': '🤗',
\ '\:the_horns:': '🤘',
\ '\:call_me_hand:': '🤙',
\ '\:raised_back_of_hand:': '🤚',
\ '\:left-facing_fist:': '🤛',
\ '\:right-facing_fist:': '🤜',
\ '\:handshake:': '🤝',
\ '\:crossed_fingers:': '🤞',
\ '\:i_love_you_hand_sign:': '🤟',
\ '\:face_with_cowboy_hat:': '🤠',
\ '\:clown_face:': '🤡',
\ '\:nauseated_face:': '🤢',
\ '\:rolling_on_the_floor_laughing:': '🤣',
\ '\:drooling_face:': '🤤',
\ '\:lying_face:': '🤥',
\ '\:face_palm:': '🤦',
\ '\:sneezing_face:': '🤧',
\ '\:face_with_raised_eyebrow:': '🤨',
\ '\:star-struck:': '🤩',
\ '\:zany_face:': '🤪',
\ '\:shushing_face:': '🤫',
\ '\:face_with_symbols_on_mouth:': '🤬',
\ '\:face_with_hand_over_mouth:': '🤭',
\ '\:face_vomiting:': '🤮',
\ '\:exploding_head:': '🤯',
\ '\:pregnant_woman:': '🤰',
\ '\:breast-feeding:': '🤱',
\ '\:palms_up_together:': '🤲',
\ '\:selfie:': '🤳',
\ '\:prince:': '🤴',
\ '\:person_in_tuxedo:': '🤵',
\ '\:mrs_claus:': '🤶',
\ '\:shrug:': '🤷',
\ '\:person_doing_cartwheel:': '🤸',
\ '\:juggling:': '🤹',
\ '\:fencer:': '🤺',
\ '\:wrestlers:': '🤼',
\ '\:water_polo:': '🤽',
\ '\:handball:': '🤾',
\ '\:diving_mask:': '🤿',
\ '\:wilted_flower:': '🥀',
\ '\:drum_with_drumsticks:': '🥁',
\ '\:clinking_glasses:': '🥂',
\ '\:tumbler_glass:': '🥃',
\ '\:spoon:': '🥄',
\ '\:goal_net:': '🥅',
\ '\:first_place_medal:': '🥇',
\ '\:second_place_medal:': '🥈',
\ '\:third_place_medal:': '🥉',
\ '\:boxing_glove:': '🥊',
\ '\:martial_arts_uniform:': '🥋',
\ '\:curling_stone:': '🥌',
\ '\:lacrosse:': '🥍',
\ '\:softball:': '🥎',
\ '\:flying_disc:': '🥏',
\ '\:croissant:': '🥐',
\ '\:avocado:': '🥑',
\ '\:cucumber:': '🥒',
\ '\:bacon:': '🥓',
\ '\:potato:': '🥔',
\ '\:carrot:': '🥕',
\ '\:baguette_bread:': '🥖',
\ '\:green_salad:': '🥗',
\ '\:shallow_pan_of_food:': '🥘',
\ '\:stuffed_flatbread:': '🥙',
\ '\:egg:': '🥚',
\ '\:glass_of_milk:': '🥛',
\ '\:peanuts:': '🥜',
\ '\:kiwifruit:': '🥝',
\ '\:pancakes:': '🥞',
\ '\:dumpling:': '🥟',
\ '\:fortune_cookie:': '🥠',
\ '\:takeout_box:': '🥡',
\ '\:chopsticks:': '🥢',
\ '\:bowl_with_spoon:': '🥣',
\ '\:cup_with_straw:': '🥤',
\ '\:coconut:': '🥥',
\ '\:broccoli:': '🥦',
\ '\:pie:': '🥧',
\ '\:pretzel:': '🥨',
\ '\:cut_of_meat:': '🥩',
\ '\:sandwich:': '🥪',
\ '\:canned_food:': '🥫',
\ '\:leafy_green:': '🥬',
\ '\:mango:': '🥭',
\ '\:moon_cake:': '🥮',
\ '\:bagel:': '🥯',
\ '\:smiling_face_with_3_hearts:': '🥰',
\ '\:yawning_face:': '🥱',
\ '\:smiling_face_with_tear:': '🥲',
\ '\:partying_face:': '🥳',
\ '\:woozy_face:': '🥴',
\ '\:hot_face:': '🥵',
\ '\:cold_face:': '🥶',
\ '\:ninja:': '🥷',
\ '\:disguised_face:': '🥸',
\ '\:pleading_face:': '🥺',
\ '\:sari:': '🥻',
\ '\:lab_coat:': '🥼',
\ '\:goggles:': '🥽',
\ '\:hiking_boot:': '🥾',
\ '\:womans_flat_shoe:': '🥿',
\ '\:crab:': '🦀',
\ '\:lion_face:': '🦁',
\ '\:scorpion:': '🦂',
\ '\:turkey:': '🦃',
\ '\:unicorn_face:': '🦄',
\ '\:eagle:': '🦅',
\ '\:duck:': '🦆',
\ '\:bat:': '🦇',
\ '\:shark:': '🦈',
\ '\:owl:': '🦉',
\ '\:fox_face:': '🦊',
\ '\:butterfly:': '🦋',
\ '\:deer:': '🦌',
\ '\:gorilla:': '🦍',
\ '\:lizard:': '🦎',
\ '\:rhinoceros:': '🦏',
\ '\:shrimp:': '🦐',
\ '\:squid:': '🦑',
\ '\:giraffe_face:': '🦒',
\ '\:zebra_face:': '🦓',
\ '\:hedgehog:': '🦔',
\ '\:sauropod:': '🦕',
\ '\:t-rex:': '🦖',
\ '\:cricket:': '🦗',
\ '\:kangaroo:': '🦘',
\ '\:llama:': '🦙',
\ '\:peacock:': '🦚',
\ '\:hippopotamus:': '🦛',
\ '\:parrot:': '🦜',
\ '\:raccoon:': '🦝',
\ '\:lobster:': '🦞',
\ '\:mosquito:': '🦟',
\ '\:microbe:': '🦠',
\ '\:badger:': '🦡',
\ '\:swan:': '🦢',
\ '\:mammoth:': '🦣',
\ '\:dodo:': '🦤',
\ '\:sloth:': '🦥',
\ '\:otter:': '🦦',
\ '\:orangutan:': '🦧',
\ '\:skunk:': '🦨',
\ '\:flamingo:': '🦩',
\ '\:oyster:': '🦪',
\ '\:beaver:': '🦫',
\ '\:bison:': '🦬',
\ '\:seal:': '🦭',
\ '\:guide_dog:': '🦮',
\ '\:probing_cane:': '🦯',
\ '\:bone:': '🦴',
\ '\:leg:': '🦵',
\ '\:foot:': '🦶',
\ '\:tooth:': '🦷',
\ '\:superhero:': '🦸',
\ '\:supervillain:': '🦹',
\ '\:safety_vest:': '🦺',
\ '\:ear_with_hearing_aid:': '🦻',
\ '\:motorized_wheelchair:': '🦼',
\ '\:manual_wheelchair:': '🦽',
\ '\:mechanical_arm:': '🦾',
\ '\:mechanical_leg:': '🦿',
\ '\:cheese_wedge:': '🧀',
\ '\:cupcake:': '🧁',
\ '\:salt:': '🧂',
\ '\:beverage_box:': '🧃',
\ '\:garlic:': '🧄',
\ '\:onion:': '🧅',
\ '\:falafel:': '🧆',
\ '\:waffle:': '🧇',
\ '\:butter:': '🧈',
\ '\:mate_drink:': '🧉',
\ '\:ice_cube:': '🧊',
\ '\:bubble_tea:': '🧋',
\ '\:standing_person:': '🧍',
\ '\:kneeling_person:': '🧎',
\ '\:deaf_person:': '🧏',
\ '\:face_with_monocle:': '🧐',
\ '\:adult:': '🧑',
\ '\:child:': '🧒',
\ '\:older_adult:': '🧓',
\ '\:bearded_person:': '🧔',
\ '\:person_with_headscarf:': '🧕',
\ '\:person_in_steamy_room:': '🧖',
\ '\:person_climbing:': '🧗',
\ '\:person_in_lotus_position:': '🧘',
\ '\:mage:': '🧙',
\ '\:fairy:': '🧚',
\ '\:vampire:': '🧛',
\ '\:merperson:': '🧜',
\ '\:elf:': '🧝',
\ '\:genie:': '🧞',
\ '\:zombie:': '🧟',
\ '\:brain:': '🧠',
\ '\:orange_heart:': '🧡',
\ '\:billed_cap:': '🧢',
\ '\:scarf:': '🧣',
\ '\:gloves:': '🧤',
\ '\:coat:': '🧥',
\ '\:socks:': '🧦',
\ '\:red_envelope:': '🧧',
\ '\:firecracker:': '🧨',
\ '\:jigsaw:': '🧩',
\ '\:test_tube:': '🧪',
\ '\:petri_dish:': '🧫',
\ '\:dna:': '🧬',
\ '\:compass:': '🧭',
\ '\:abacus:': '🧮',
\ '\:fire_extinguisher:': '🧯',
\ '\:toolbox:': '🧰',
\ '\:bricks:': '🧱',
\ '\:magnet:': '🧲',
\ '\:luggage:': '🧳',
\ '\:lotion_bottle:': '🧴',
\ '\:thread:': '🧵',
\ '\:yarn:': '🧶',
\ '\:safety_pin:': '🧷',
\ '\:teddy_bear:': '🧸',
\ '\:broom:': '🧹',
\ '\:basket:': '🧺',
\ '\:roll_of_paper:': '🧻',
\ '\:soap:': '🧼',
\ '\:sponge:': '🧽',
\ '\:receipt:': '🧾',
\ '\:nazar_amulet:': '🧿',
\ '\:ballet_shoes:': '🩰',
\ '\:one-piece_swimsuit:': '🩱',
\ '\:briefs:': '🩲',
\ '\:shorts:': '🩳',
\ '\:thong_sandal:': '🩴',
\ '\:drop_of_blood:': '🩸',
\ '\:adhesive_bandage:': '🩹',
\ '\:stethoscope:': '🩺',
\ '\:yo-yo:': '🪀',
\ '\:kite:': '🪁',
\ '\:parachute:': '🪂',
\ '\:boomerang:': '🪃',
\ '\:magic_wand:': '🪄',
\ '\:pinata:': '🪅',
\ '\:nesting_dolls:': '🪆',
\ '\:ringed_planet:': '🪐',
\ '\:chair:': '🪑',
\ '\:razor:': '🪒',
\ '\:axe:': '🪓',
\ '\:diya_lamp:': '🪔',
\ '\:banjo:': '🪕',
\ '\:military_helmet:': '🪖',
\ '\:accordion:': '🪗',
\ '\:long_drum:': '🪘',
\ '\:coin:': '🪙',
\ '\:carpentry_saw:': '🪚',
\ '\:screwdriver:': '🪛',
\ '\:ladder:': '🪜',
\ '\:hook:': '🪝',
\ '\:mirror:': '🪞',
\ '\:window:': '🪟',
\ '\:plunger:': '🪠',
\ '\:sewing_needle:': '🪡',
\ '\:knot:': '🪢',
\ '\:bucket:': '🪣',
\ '\:mouse_trap:': '🪤',
\ '\:toothbrush:': '🪥',
\ '\:headstone:': '🪦',
\ '\:placard:': '🪧',
\ '\:rock:': '🪨',
\ '\:fly:': '🪰',
\ '\:worm:': '🪱',
\ '\:beetle:': '🪲',
\ '\:cockroach:': '🪳',
\ '\:potted_plant:': '🪴',
\ '\:wood:': '🪵',
\ '\:feather:': '🪶',
\ '\:anatomical_heart:': '🫀',
\ '\:lungs:': '🫁',
\ '\:people_hugging:': '🫂',
\ '\:blueberries:': '🫐',
\ '\:bell_pepper:': '🫑',
\ '\:olive:': '🫒',
\ '\:flatbread:': '🫓',
\ '\:tamale:': '🫔',
\ '\:fondue:': '🫕',
\ '\:teapot:': '🫖'}
endfunction endfunction

View File

@@ -3,6 +3,11 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'ledger', 'autoload/ledger.vim
endif endif
scriptencoding utf-8 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 " vim:ts=2:sw=2:sts=2:foldmethod=marker
function! ledger#transaction_state_toggle(lnum, ...) abort function! ledger#transaction_state_toggle(lnum, ...) abort
if a:0 == 1 if a:0 == 1
@@ -25,7 +30,7 @@ function! ledger#transaction_state_toggle(lnum, ...) abort
endf endf
function! ledger#transaction_state_set(lnum, char) abort function! ledger#transaction_state_set(lnum, char) abort
" modifies or sets the state of the transaction at the cursor, " modifies or sets the state of the transaction at the given line no.,
" removing the state altogether if a:char is empty " removing the state altogether if a:char is empty
let trans = s:transaction.from_lnum(a:lnum) let trans = s:transaction.from_lnum(a:lnum)
if empty(trans) || has_key(trans, 'expr') if empty(trans) || has_key(trans, 'expr')
@@ -130,7 +135,7 @@ function! ledger#transaction_post_state_set(lnum, char) abort
return return
endif endif
let line = getline('.') let line = getline(a:lnum)
if a:char =~# '^\s*$' if a:char =~# '^\s*$'
let newline = substitute(line, '\V' . state . '\m[ \t]', '', '') let newline = substitute(line, '\V' . state . '\m[ \t]', '', '')
elseif state ==# ' ' elseif state ==# ' '
@@ -457,10 +462,20 @@ endf
" Return character position of decimal separator (multibyte safe) " Return character position of decimal separator (multibyte safe)
function! s:decimalpos(expr) abort function! s:decimalpos(expr) abort
let pos = match(a:expr, '\V' . g:ledger_decimal_sep) " Remove trailing comments
if pos > 0 let l:expr = substitute(a:expr, '\v +;.*$', '', '')
let pos = strchars(a:expr[:pos]) - 1 " Find first or last possible decimal separator candidate
endif 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 return pos
endf endf
@@ -544,6 +559,10 @@ function! ledger#align_amount_at_cursor() abort
endif endif
endf endf
function! ledger#align_formatexpr(lnum, count) abort
execute a:lnum . ',' . (a:lnum + a:count - 1) . 'call ledger#align_commodity()'
endfunction
" Report generation {{{1 " Report generation {{{1
" Helper functions and variables {{{2 " Helper functions and variables {{{2
@@ -629,7 +648,7 @@ endf
" Build a ledger command to process the given file. " Build a ledger command to process the given file.
function! s:ledger_cmd(file, args) abort function! s:ledger_cmd(file, args) abort
let l:options = g:ledger_extra_options 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, let l:options = join([l:options, '--date-format', g:ledger_date_format,
\ '--input-date-format', g:ledger_date_format]) \ '--input-date-format', g:ledger_date_format])
endif endif
@@ -732,8 +751,6 @@ function! ledger#register(file, args) abort
endf endf
" Reconcile the given account. " Reconcile the given account.
" This function accepts a file path as a third optional argument.
" The default is to use the value of g:ledger_main.
" "
" Parameters: " Parameters:
" file The file to be processed " file The file to be processed

View 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
View 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

View File

@@ -169,6 +169,18 @@ let did_load_filetypes = 1
" DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE " DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE
" Filename and path matchers for natively-supported filetypes not in packages.yaml
au BufNewFile,BufRead cfengine.conf setf cfengine
au BufNewFile,BufRead cm3.cfg setf m3quake
au BufNewFile,BufRead m3makefile,m3overrides setf m3build
au BufNewFile,BufRead cabal.project,cabal.project.* setf cabalproject
au BufNewFile,BufRead $HOME/.cabal/config,cabal.config setf cabalconfig
au BufNewFile,BufRead */i3/config,*/sway/config,*/.i3/config,*/.sway/config setf i3config
if !has_key(g:polyglot_is_disabled, 'bicep')
au BufNewFile,BufRead *.bicep setf bicep
endif
if !has_key(g:polyglot_is_disabled, 'org') if !has_key(g:polyglot_is_disabled, 'org')
au BufNewFile,BufRead *.org setf org au BufNewFile,BufRead *.org setf org
endif endif
@@ -1328,10 +1340,6 @@ if !has_key(g:polyglot_is_disabled, 'hex')
au BufNewFile,BufRead *.h32,*.hex setf hex au BufNewFile,BufRead *.h32,*.hex setf hex
endif 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') if !has_key(g:polyglot_is_disabled, 'hastepreproc')
au BufNewFile,BufRead *.htpp setf hastepreproc au BufNewFile,BufRead *.htpp setf hastepreproc
endif endif
@@ -1771,11 +1779,11 @@ endif
if !has_key(g:polyglot_is_disabled, 'prolog') if !has_key(g:polyglot_is_disabled, 'prolog')
au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl() 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 endif
if !has_key(g:polyglot_is_disabled, 'bzl') if !has_key(g:polyglot_is_disabled, 'bzl')
au BufNewFile,BufRead *.BUILD,*.bazel,*.bzl,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE setf bzl au BufNewFile,BufRead *.BUILD,*.bazel,*.bzl,*.star,BUCK,BUILD,BUILD.bazel,MODULE.bazel,Tiltfile,WORKSPACE,WORKSPACE.bazel setf bzl
endif endif
if !has_key(g:polyglot_is_disabled, 'odin') if !has_key(g:polyglot_is_disabled, 'odin')
@@ -1783,7 +1791,7 @@ if !has_key(g:polyglot_is_disabled, 'odin')
endif endif
if !has_key(g:polyglot_is_disabled, 'dosini') if !has_key(g:polyglot_is_disabled, 'dosini')
au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties,*/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 php.ini-* call s:StarSetf('dosini')
au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini') au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
endif endif
@@ -1794,7 +1802,7 @@ endif
if !has_key(g:polyglot_is_disabled, 'visual-basic') if !has_key(g:polyglot_is_disabled, 'visual-basic')
au! BufNewFile,BufRead,BufWritePost *.bas call polyglot#detect#Bas() 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 endif
if !has_key(g:polyglot_is_disabled, 'basic') if !has_key(g:polyglot_is_disabled, 'basic')
@@ -1873,7 +1881,7 @@ if !has_key(g:polyglot_is_disabled, 'unison')
endif endif
if !has_key(g:polyglot_is_disabled, 'typescript') if !has_key(g:polyglot_is_disabled, 'typescript')
au BufNewFile,BufRead *.ts setf typescript au BufNewFile,BufRead *.cts,*.mts,*.ts setf typescript
au BufNewFile,BufRead *.tsx setf typescriptreact au BufNewFile,BufRead *.tsx setf typescriptreact
endif endif
@@ -1891,7 +1899,7 @@ if !has_key(g:polyglot_is_disabled, 'tptp')
endif endif
if !has_key(g:polyglot_is_disabled, 'toml') 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,Gopkg.lock,Pipfile,pdm.lock,poetry.lock setf toml
endif endif
if !has_key(g:polyglot_is_disabled, 'tmux') if !has_key(g:polyglot_is_disabled, 'tmux')
@@ -1957,7 +1965,7 @@ if !has_key(g:polyglot_is_disabled, 'slim')
endif endif
if !has_key(g:polyglot_is_disabled, 'sh') 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,{.,}flaskenv,{.,}kshrc,{.,}login,{.,}profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile setf sh
au BufNewFile,BufRead *.zsh,*/etc/zprofile,{.,}zfbfmarks,{.,}zlogin,{.,}zlogout,{.,}zprofile,{.,}zshenv,{.,}zshrc setf zsh 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 .zsh* call s:StarSetf('zsh')
au BufNewFile,BufRead .zlog* call s:StarSetf('zsh') au BufNewFile,BufRead .zlog* call s:StarSetf('zsh')
@@ -2033,7 +2041,7 @@ if !has_key(g:polyglot_is_disabled, 'requirements')
endif endif
if !has_key(g:polyglot_is_disabled, 'python') 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 endif
if !has_key(g:polyglot_is_disabled, 'purescript') if !has_key(g:polyglot_is_disabled, 'purescript')
@@ -2157,7 +2165,7 @@ if !has_key(g:polyglot_is_disabled, 'mako')
endif endif
if !has_key(g:polyglot_is_disabled, 'm4') if !has_key(g:polyglot_is_disabled, 'm4')
au BufNewFile,BufRead *.at,*.m4 setf m4 au BufNewFile,BufRead *.at,*.m4,*.mc setf m4
endif endif
if !has_key(g:polyglot_is_disabled, 'lua') if !has_key(g:polyglot_is_disabled, 'lua')
@@ -2216,8 +2224,9 @@ if !has_key(g:polyglot_is_disabled, 'perl')
au! BufNewFile,BufRead,BufWritePost *.t call polyglot#detect#T() au! BufNewFile,BufRead,BufWritePost *.t call polyglot#detect#T()
au! BufNewFile,BufRead,BufWritePost *.pm call polyglot#detect#Pm() au! BufNewFile,BufRead,BufWritePost *.pm call polyglot#detect#Pm()
au! BufNewFile,BufRead,BufWritePost *.pl call polyglot#detect#Pl() 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 *.pod setf pod
au! BufNewFile,BufRead,BufWritePost *.html call polyglot#detect#Html()
au BufNewFile,BufRead *.comp,*.mason,*.mhtml setf mason au BufNewFile,BufRead *.comp,*.mason,*.mhtml setf mason
au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2() au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2()
au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2() au! BufNewFile,BufRead,BufWritePost *.tt2 call polyglot#detect#Tt2()
@@ -2233,7 +2242,7 @@ if !has_key(g:polyglot_is_disabled, 'jsonnet')
endif endif
if !has_key(g:polyglot_is_disabled, 'json') if !has_key(g:polyglot_is_disabled, 'json')
au BufNewFile,BufRead *.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}arcconfig,{.,}auto-changelog,{.,}c8rc,{.,}htmlhintrc,{.,}imgbotconfig,{.,}nycrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,Pipfile.lock,composer.lock,mcmod.info setf json au BufNewFile,BufRead *.4DForm,*.4DProject,*.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,{.,}all-contributorsrc,{.,}arcconfig,{.,}auto-changelog,{.,}c8rc,{.,}htmlhintrc,{.,}imgbotconfig,{.,}nycrc,{.,}tern-config,{.,}tern-project,{.,}watchmanconfig,Pipfile.lock,composer.lock,flake.lock,mcmod.info setf json
endif endif
if !has_key(g:polyglot_is_disabled, 'json5') if !has_key(g:polyglot_is_disabled, 'json5')
@@ -2320,16 +2329,22 @@ endif
if !has_key(g:polyglot_is_disabled, 'javascript') if !has_key(g:polyglot_is_disabled, 'javascript')
au! BufNewFile,BufRead,BufWritePost *.frag call polyglot#detect#Frag() 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 au BufNewFile,BufRead *.flow setf flow
endif endif
if !has_key(g:polyglot_is_disabled, 'go') if !has_key(g:polyglot_is_disabled, 'go')
au BufNewFile,BufRead *.go setf go au BufNewFile,BufRead *.go setf go
au BufNewFile,BufRead go.mod setf gomod 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 au BufNewFile,BufRead *.tmpl setf gohtmltmpl
endif 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') if !has_key(g:polyglot_is_disabled, 'gnuplot')
au BufNewFile,BufRead *.gnu,*.gnuplot,*.gp,*.gpi,*.p,*.plot,*.plt setf gnuplot au BufNewFile,BufRead *.gnu,*.gnuplot,*.gp,*.gpi,*.p,*.plot,*.plt setf gnuplot
endif endif
@@ -2341,7 +2356,7 @@ endif
if !has_key(g:polyglot_is_disabled, 'glsl') if !has_key(g:polyglot_is_disabled, 'glsl')
au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs() au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs()
au! BufNewFile,BufRead,BufWritePost *.frag call polyglot#detect#Frag() 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 endif
if !has_key(g:polyglot_is_disabled, 'git') if !has_key(g:polyglot_is_disabled, 'git')
@@ -2352,10 +2367,6 @@ if !has_key(g:polyglot_is_disabled, 'git')
au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG setf gitcommit
endif endif
if !has_key(g:polyglot_is_disabled, 'gdscript')
au BufNewFile,BufRead *.gd setf gdscript3
endif
if !has_key(g:polyglot_is_disabled, 'fsharp') if !has_key(g:polyglot_is_disabled, 'fsharp')
au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs() au! BufNewFile,BufRead,BufWritePost *.fs call polyglot#detect#Fs()
au BufNewFile,BufRead *.fsi,*.fsx setf fsharp au BufNewFile,BufRead *.fsi,*.fsx setf fsharp
@@ -2458,7 +2469,7 @@ if !has_key(g:polyglot_is_disabled, 'coffee-script')
endif endif
if !has_key(g:polyglot_is_disabled, 'markdown') if !has_key(g:polyglot_is_disabled, 'markdown')
au BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr setf markdown au BufNewFile,BufRead *.livemd,*.markdown,*.md,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr setf markdown
endif endif
if !has_key(g:polyglot_is_disabled, 'cmake') if !has_key(g:polyglot_is_disabled, 'cmake')
@@ -2466,7 +2477,7 @@ if !has_key(g:polyglot_is_disabled, 'cmake')
endif endif
if !has_key(g:polyglot_is_disabled, 'clojure') if !has_key(g:polyglot_is_disabled, 'clojure')
au BufNewFile,BufRead *.boot,*.cl2,*.clj,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.edn,*.hic,build.boot,profile.boot,riemann.config setf clojure au BufNewFile,BufRead *.bb,*.boot,*.cl2,*.clj,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.edn,*.hic,build.boot,profile.boot,riemann.config setf clojure
endif endif
if !has_key(g:polyglot_is_disabled, 'carp') if !has_key(g:polyglot_is_disabled, 'carp')
@@ -2536,7 +2547,7 @@ endif
if !has_key(g:polyglot_is_disabled, 'c/c++') if !has_key(g:polyglot_is_disabled, 'c/c++')
au! BufNewFile,BufRead,BufWritePost *.h call polyglot#detect#H() 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,BufWritePost *.h call polyglot#detect#H()
au BufNewFile,BufRead *.c,*.cats,*.idc,*.qc,*enlightenment/*.cfg setf c au BufNewFile,BufRead *.c,*.cats,*.idc,*.qc,*enlightenment/*.cfg setf c
endif endif
@@ -2577,7 +2588,7 @@ if !has_key(g:polyglot_is_disabled, 'ant')
endif endif
if !has_key(g:polyglot_is_disabled, 'xml') if !has_key(g:polyglot_is_disabled, 'xml')
au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.tpm,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu,*fglrxrc,{.,}classpath,{.,}cproject,{.,}project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config setf xml au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.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 endif
if !has_key(g:polyglot_is_disabled, 'csv') if !has_key(g:polyglot_is_disabled, 'csv')
@@ -2671,6 +2682,43 @@ if !has_key(g:polyglot_is_disabled, '8th')
au BufNewFile,BufRead *.8th setf 8th au BufNewFile,BufRead *.8th setf 8th
endif endif
" Extension matchers for natively-supported filetypes not in packages.yaml
au BufNewFile,BufRead *.beancount setf beancount
au BufNewFile,BufRead *.quake setf m3quake
au BufNewFile,BufRead *.factor setf factor
au BufNewFile,BufRead *.fusion setf fusion
au BufNewFile,BufRead *.gd setf gdscript
au BufNewFile,BufRead *.tscn,*.tres setf gdresource
au BufNewFile,BufRead *.gmi,*.gemini setf gemtext
au BufNewFile,BufRead *.gift setf gift
au BufNewFile,BufRead *.hack,*.hackpartial setf hack
au BufNewFile,BufRead *.hbs setf handlebars
au BufNewFile,BufRead *.heex setf heex
au BufNewFile,BufRead *.htt,*.htb setf httest
au BufNewFile,BufRead *.man setf man
au BufNewFile,BufRead *.map setf map
au BufNewFile,BufRead *.fpc setf fpcmake
au BufNewFile,BufRead *.pcmk setf pcmk
au BufNewFile,BufRead *.prisma setf prisma
au BufNewFile,BufRead *.epp setf epuppet
au BufNewFile,BufRead *.pc setf proc
au BufNewFile,BufRead *.psl setf psl
au BufNewFile,BufRead *.pbtxt setf pbtxt
au BufNewFile,BufRead *.pk setf poke
au BufNewFile,BufRead *.arr setf pyret
au BufNewFile,BufRead *.ql,*.qll setf ql
au BufNewFile,BufRead *.rsc setf routeros
au BufNewFile,BufRead *.rbs setf rbs
au BufNewFile,BufRead *.scd setf scdoc
au BufNewFile,BufRead *.rq,*.sparql setf sparql
au BufNewFile,BufRead *.sln setf solution
au BufNewFile,BufRead *.nut setf squirrel
au BufNewFile,BufRead *.sface setf surface
au BufNewFile,BufRead *.tl setf teal
au BufNewFile,BufRead *.tla setf tla
au BufNewFile,BufRead *.twig setf twig
au BufNewFile,BufRead *.yang setf yang
au BufNewFile,BufRead *.zut setf zimbutempl
" DO NOT EDIT CODE ABOVE, IT IS GENERATED WITH MAKEFILE " DO NOT EDIT CODE ABOVE, IT IS GENERATED WITH MAKEFILE
@@ -3510,7 +3558,7 @@ au BufNewFile,BufRead .reminders* call s:StarSetf('remind')
au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog') au BufNewFile,BufRead sgml.catalog* call s:StarSetf('catalog')
" Shell scripts ending in a star " 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 .kshrc* call polyglot#ft#SetFileTypeSH("ksh")
au BufNewFile,BufRead .profile* call polyglot#ft#SetFileTypeSH(getline(1)) au BufNewFile,BufRead .profile* call polyglot#ft#SetFileTypeSH(getline(1))

View File

@@ -462,6 +462,7 @@ endfunc
let s:interpreters = { let s:interpreters = {
\ 'osascript': 'applescript', \ 'osascript': 'applescript',
\ 'tcc': 'c', \ 'tcc': 'c',
\ 'bb': 'clojure',
\ 'coffee': 'coffee', \ 'coffee': 'coffee',
\ 'crystal': 'crystal', \ 'crystal': 'crystal',
\ 'dart': 'dart', \ 'dart': 'dart',
@@ -486,6 +487,7 @@ let s:interpreters = {
\ 'julia': 'julia', \ 'julia': 'julia',
\ 'lua': 'lua', \ 'lua': 'lua',
\ 'moon': 'moon', \ 'moon': 'moon',
\ 'nft': 'nftables',
\ 'ocaml': 'ocaml', \ 'ocaml': 'ocaml',
\ 'ocamlrun': 'ocaml', \ 'ocamlrun': 'ocaml',
\ 'ocamlscript': 'ocaml', \ 'ocamlscript': 'ocaml',
@@ -498,6 +500,9 @@ let s:interpreters = {
\ 'python': 'python', \ 'python': 'python',
\ 'python2': 'python', \ 'python2': 'python',
\ 'python3': 'python', \ 'python3': 'python',
\ 'py': 'python',
\ 'pypy': 'python',
\ 'pypy3': 'python',
\ 'qmake': 'qmake', \ 'qmake': 'qmake',
\ 'Rscript': 'r', \ 'Rscript': 'r',
\ 'racket': 'racket', \ 'racket': 'racket',
@@ -509,6 +514,7 @@ let s:interpreters = {
\ 'rake': 'ruby', \ 'rake': 'ruby',
\ 'jruby': 'ruby', \ 'jruby': 'ruby',
\ 'rbx': 'ruby', \ 'rbx': 'ruby',
\ 'rust-script': 'rust',
\ 'scala': 'scala', \ 'scala': 'scala',
\ 'ash': 'sh', \ 'ash': 'sh',
\ 'bash': 'sh', \ 'bash': 'sh',

View File

@@ -48,13 +48,14 @@ let s:globs = {
\ 'bc': '*.bc', \ 'bc': '*.bc',
\ 'bdf': '*.bdf', \ 'bdf': '*.bdf',
\ 'bib': '*.bib', \ 'bib': '*.bib',
\ 'bicep': '*.bicep',
\ 'bindzone': 'named.root', \ 'bindzone': 'named.root',
\ 'blade': '*.blade,*.blade.php', \ 'blade': '*.blade,*.blade.php',
\ 'blank': '*.bl', \ 'blank': '*.bl',
\ 'brewfile': 'Brewfile', \ 'brewfile': 'Brewfile',
\ 'bsdl': '*.bsdl,*bsd', \ 'bsdl': '*.bsdl,*bsd',
\ 'bst': '*.bst', \ 'bst': '*.bst',
\ 'bzl': '*.bzl,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE', \ 'bzl': '*.bzl,*.star,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,MODULE.bazel,Tiltfile,WORKSPACE,WORKSPACE.bazel',
\ 'bzr': 'bzr_log.*', \ 'bzr': 'bzr_log.*',
\ 'c': '*.c,*.cats,*.h,*.idc,*.qc', \ 'c': '*.c,*.cats,*.h,*.idc,*.qc',
\ 'cabal': '*.cabal', \ 'cabal': '*.cabal',
@@ -74,7 +75,7 @@ let s:globs = {
\ 'chordpro': '*.chopro,*.crd,*.cho,*.crdpro,*.chordpro', \ 'chordpro': '*.chopro,*.crd,*.cho,*.crdpro,*.chordpro',
\ 'cl': '*.eni', \ 'cl': '*.eni',
\ 'clean': '*.dcl,*.icl', \ 'clean': '*.dcl,*.icl',
\ 'clojure': '*.clj,*.boot,*.cl2,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.hic,*.edn,riemann.config,build.boot,profile.boot', \ 'clojure': '*.clj,*.bb,*.boot,*.cl2,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.hic,*.edn,riemann.config,build.boot,profile.boot',
\ 'cmake': '*.cmake,*.cmake.in,CMakeLists.txt', \ 'cmake': '*.cmake,*.cmake.in,CMakeLists.txt',
\ 'cmod': '*.cmod', \ 'cmod': '*.cmod',
\ 'cmusrc': '', \ 'cmusrc': '',
@@ -85,7 +86,7 @@ let s:globs = {
\ 'conf': '*.conf,auto.master,config', \ 'conf': '*.conf,auto.master,config',
\ 'config': 'configure.in,configure.ac,Pipfile', \ 'config': 'configure.in,configure.ac,Pipfile',
\ 'context': '*.mkii,*.mkiv,*.mkvi', \ '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', \ 'cql': '*.cql',
\ 'crm': '*.crm', \ 'crm': '*.crm',
\ 'crontab': 'crontab,crontab.*', \ 'crontab': 'crontab,crontab.*',
@@ -129,7 +130,7 @@ let s:globs = {
\ 'dnsmasq': '', \ 'dnsmasq': '',
\ 'dockerfile': '*.Dockerfile,*.dock,Containerfile,Dockerfile,dockerfile,Dockerfile*', \ 'dockerfile': '*.Dockerfile,*.dock,Containerfile,Dockerfile,dockerfile,Dockerfile*',
\ 'dosbatch': '*.bat,*.sys', \ 'dosbatch': '*.bat,*.sys',
\ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,.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', \ 'dot': '*.dot,*.gv',
\ 'dracula': '*.drac,*.drc,*lvs,*lpe,drac.*', \ 'dracula': '*.drac,*.drc,*lvs,*lpe,drac.*',
\ 'dsdl': '*.sdl', \ 'dsdl': '*.sdl',
@@ -152,7 +153,7 @@ let s:globs = {
\ 'embeddedpuppet': '*.epp', \ 'embeddedpuppet': '*.epp',
\ 'ember-script': '*.em,*.emberscript', \ 'ember-script': '*.em,*.emberscript',
\ 'emblem': '*.emblem,*.em', \ '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', \ 'eruby': '*.erb,*.erb.deface,*.rhtml',
\ 'esmtprc': '*esmtprc', \ 'esmtprc': '*esmtprc',
\ 'esqlc': '*.ec,*.EC', \ 'esqlc': '*.ec,*.EC',
@@ -180,7 +181,6 @@ let s:globs = {
\ 'fvwm': '', \ 'fvwm': '',
\ 'gdb': '.gdbinit', \ 'gdb': '.gdbinit',
\ 'gdmo': '*.mo,*.gdmo', \ 'gdmo': '*.mo,*.gdmo',
\ 'gdscript3': '*.gd',
\ 'gedcom': '*.ged,lltxxxxx.txt', \ 'gedcom': '*.ged,lltxxxxx.txt',
\ 'gitcommit': 'COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG', \ 'gitcommit': 'COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG',
\ 'gitconfig': '*.gitconfig,.gitconfig,.gitmodules', \ 'gitconfig': '*.gitconfig,.gitconfig,.gitmodules',
@@ -190,13 +190,15 @@ let s:globs = {
\ 'gitsendemail': '.gitsendemail.*', \ 'gitsendemail': '.gitsendemail.*',
\ 'gkrellmrc': 'gkrellmrc,gkrellmrc_?', \ 'gkrellmrc': 'gkrellmrc,gkrellmrc_?',
\ 'gleam': '*.gleam', \ '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', \ 'gmpl': '*.mod',
\ 'gnash': 'gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc', \ 'gnash': 'gnashrc,.gnashrc,gnashpluginrc,.gnashpluginrc',
\ 'gnuplot': '*.gp,*.gnu,*.gnuplot,*.p,*.plot,*.plt,*.gpi', \ 'gnuplot': '*.gp,*.gnu,*.gnuplot,*.p,*.plot,*.plt,*.gpi',
\ 'go': '*.go', \ 'go': '*.go',
\ 'gohtmltmpl': '*.tmpl', \ 'gohtmltmpl': '*.tmpl',
\ 'gomod': 'go.mod', \ 'gomod': 'go.mod',
\ 'gosum': 'go.sum',
\ 'gowork': 'go.work',
\ 'gp': '*.gp,.gprc', \ 'gp': '*.gp,.gprc',
\ 'gpg': '', \ 'gpg': '',
\ 'grads': '*.gs', \ 'grads': '*.gs',
@@ -253,14 +255,14 @@ let s:globs = {
\ 'jam': '*.jpl,*.jpr,Prl*.*,JAM*.*', \ 'jam': '*.jpl,*.jpr,Prl*.*,JAM*.*',
\ 'java': '*.java,*.jav', \ 'java': '*.java,*.jav',
\ 'javacc': '*.jj,*.jjt', \ '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', \ 'javascriptreact': '*.jsx',
\ 'jess': '*.clp', \ 'jess': '*.clp',
\ 'jgraph': '*.jgr', \ 'jgraph': '*.jgr',
\ 'jovial': '*.jov,*.j73,*.jovial', \ 'jovial': '*.jov,*.j73,*.jovial',
\ 'jproperties': '*.properties,*.properties_??,*.properties_??_??,*.properties_??_??_*', \ 'jproperties': '*.properties,*.properties_??,*.properties_??_??,*.properties_??_??_*',
\ 'jq': '*.jq,.jqrc,.jqrc*', \ 'jq': '*.jq,.jqrc,.jqrc*',
\ 'json': '*.json,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.auto-changelog,.c8rc,.htmlhintrc,.imgbotconfig,.nycrc,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,mcmod.info', \ 'json': '*.json,*.4DForm,*.4DProject,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.all-contributorsrc,.arcconfig,.auto-changelog,.c8rc,.htmlhintrc,.imgbotconfig,.nycrc,.tern-config,.tern-project,.watchmanconfig,Pipfile.lock,composer.lock,flake.lock,mcmod.info',
\ 'json5': '*.json5', \ 'json5': '*.json5',
\ 'jsonc': '*.cjson,*.jsonc,coc-settings.json,.eslintrc.json,.babelrc,.jshintrc,.jslintrc,.mocharc.json,coffeelint.json,tsconfig.json,jsconfig.json', \ 'jsonc': '*.cjson,*.jsonc,coc-settings.json,.eslintrc.json,.babelrc,.jshintrc,.jslintrc,.mocharc.json,coffeelint.json,tsconfig.json,jsconfig.json',
\ 'jsonnet': '*.jsonnet,*.libsonnet', \ 'jsonnet': '*.jsonnet,*.libsonnet',
@@ -309,7 +311,7 @@ let s:globs = {
\ 'lss': '*.lss', \ 'lss': '*.lss',
\ 'lua': '*.lua,*.fcgi,*.nse,*.p8,*.pd_lua,*.rbxs,*.rockspec,*.wlua,.luacheckrc', \ 'lua': '*.lua,*.fcgi,*.nse,*.p8,*.pd_lua,*.rbxs,*.rockspec,*.wlua,.luacheckrc',
\ 'lynx': 'lynx.cfg', \ '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-*', \ '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': '', \ 'mailaliases': '',
\ 'mailcap': '.mailcap,mailcap', \ 'mailcap': '.mailcap,mailcap',
@@ -318,9 +320,9 @@ let s:globs = {
\ 'mallard': '*.page', \ 'mallard': '*.page',
\ 'manconf': 'man.config', \ 'manconf': 'man.config',
\ 'maple': '*.mv,*.mpl,*.mws', \ 'maple': '*.mv,*.mpl,*.mws',
\ 'markdown': '*.md,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr', \ 'markdown': '*.md,*.livemd,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.scd,*.workbook,contents.lr',
\ 'markdown.mdx': '*.mdx', \ 'markdown.mdx': '*.mdx',
\ 'mason': '*.mason,*.mhtml,*.comp', \ 'mason': '*.mason,*.mhtml,*.comp,*.html',
\ 'master': '*.mas,*.master', \ 'master': '*.mas,*.master',
\ 'mel': '*.mel', \ 'mel': '*.mel',
\ 'mermaid': '*.mermaid,*.mm,*.mmd', \ 'mermaid': '*.mermaid,*.mm,*.mmd',
@@ -391,7 +393,7 @@ let s:globs = {
\ 'passwd': '', \ 'passwd': '',
\ 'pccts': '*.g', \ 'pccts': '*.g',
\ 'pdf': '*.pdf', \ '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', \ 'pest': '*.pest',
\ 'pf': 'pf.conf', \ 'pf': 'pf.conf',
\ 'pfmain': 'main.cf', \ 'pfmain': 'main.cf',
@@ -415,7 +417,7 @@ let s:globs = {
\ 'ppwiz': '*.it,*.ih', \ 'ppwiz': '*.it,*.ih',
\ 'privoxy': '*.action', \ 'privoxy': '*.action',
\ 'procmail': '.procmail,.procmailrc', \ 'procmail': '.procmail,.procmailrc',
\ 'prolog': '*.pl,*.pro,*.prolog,*.yap,*.pdb', \ 'prolog': '*.pl,*.plt,*.pro,*.prolog,*.yap,*.pdb',
\ 'promela': '*.pml', \ 'promela': '*.pml',
\ 'proto': '*.proto', \ 'proto': '*.proto',
\ 'protocols': '', \ 'protocols': '',
@@ -426,7 +428,7 @@ let s:globs = {
\ 'puppet': '*.pp,Modulefile', \ 'puppet': '*.pp,Modulefile',
\ 'purescript': '*.purs', \ 'purescript': '*.purs',
\ 'pyrex': '*.pyx,*.pxd', \ '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', \ 'qmake': '*.pro,*.pri',
\ 'qml': '*.qml,*.qbs', \ 'qml': '*.qml,*.qbs',
\ 'quake': '', \ 'quake': '',
@@ -480,7 +482,7 @@ let s:globs = {
\ 'services': '', \ 'services': '',
\ 'setserial': '', \ 'setserial': '',
\ 'sexplib': '*.sexp', \ '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,.flaskenv,.kshrc,.login,.profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,kshrc,login,man,profile',
\ 'sieve': '*.siv,*.sieve', \ 'sieve': '*.siv,*.sieve',
\ 'sil': '*.sil', \ 'sil': '*.sil',
\ 'simula': '*.sim', \ 'simula': '*.sim',
@@ -552,7 +554,7 @@ let s:globs = {
\ 'tilde': '*.t.html', \ 'tilde': '*.t.html',
\ 'tli': '*.tli', \ 'tli': '*.tli',
\ 'tmux': '.tmux*.conf', \ 'tmux': '.tmux*.conf',
\ 'toml': '*.toml,Cargo.lock,Gopkg.lock,Pipfile,poetry.lock', \ 'toml': '*.toml,Cargo.lock,Gopkg.lock,Pipfile,pdm.lock,poetry.lock',
\ 'tpp': '*.tpp', \ 'tpp': '*.tpp',
\ 'tptp': '*.p,*.tptp,*.ax', \ 'tptp': '*.p,*.tptp,*.ax',
\ 'trasys': '*.inp', \ 'trasys': '*.inp',
@@ -565,7 +567,7 @@ let s:globs = {
\ 'tt2': '*.tt2', \ 'tt2': '*.tt2',
\ 'tt2html': '*.tt2', \ 'tt2html': '*.tt2',
\ 'tutor': '*.tutor', \ 'tutor': '*.tutor',
\ 'typescript': '*.ts', \ 'typescript': '*.ts,*.cts,*.mts',
\ 'typescriptreact': '*.tsx', \ 'typescriptreact': '*.tsx',
\ 'uc': '*.uc', \ 'uc': '*.uc',
\ 'udevconf': '', \ 'udevconf': '',
@@ -580,7 +582,7 @@ let s:globs = {
\ 'usserverlog': '*.usserver.log\c,usserver.log\c,usserver.*.log\c', \ 'usserverlog': '*.usserver.log\c,usserver.log\c,usserver.*.log\c',
\ 'usw2kagtlog': '*.usw2kagt.log\c,usw2kagt.log\c,usw2kagt.*.log\c', \ 'usw2kagtlog': '*.usw2kagt.log\c,usw2kagt.log\c,usw2kagt.*.log\c',
\ 'vala': '*.vala,*.vapi,*.valadoc', \ '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', \ 'vbnet': '*.vb,*.vbhtml',
\ 'vcl': '*.vcl', \ 'vcl': '*.vcl',
\ 'velocity': '*.vm', \ 'velocity': '*.vm',
@@ -611,7 +613,7 @@ let s:globs = {
\ 'xhtml': '*.xhtml,*.xht', \ 'xhtml': '*.xhtml,*.xht',
\ 'xinetd': '', \ 'xinetd': '',
\ 'xmath': '*.msc,*.msf', \ 'xmath': '*.msc,*.msf',
\ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xmp,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc', \ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axaml,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.hzp,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.qhelp,*.rdf,*.res,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.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', \ 'xml.twig': '*.xml.twig',
\ 'xmodmap': '*Xmodmap,*xmodmap*', \ 'xmodmap': '*Xmodmap,*xmodmap*',
\ 'xpm': '*.xpm,*.pm', \ 'xpm': '*.xpm,*.pm',

View File

@@ -2,35 +2,32 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'requirements', 'autoload/requ
finish finish
endif endif
" the Requirements File Format syntax support for Vim ""
" Version: 1.6.0 " Refer https://github.com/vim/vim/blob/75e27d78f5370e7d2e0898326d9b080937e7b090/runtime/scripts.vim#L33-L71
" Author: raimon <raimon49@hotmail.com>
" License: MIT LICENSE
" The MIT License (MIT)
" "
" Copyright (c) 2015 raimon " When a file's shebang is "pip install -r" or "pip-compile",
" " set its filetype to |requirements|.
" Permission is hereby granted, free of charge, to any person obtaining a copy function! requirements#shebang() abort
" of this software and associated documentation files (the "Software"), to deal let s:line1 = getline(1)
" in the Software without restriction, including without limitation the rights
" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
" copies of the Software, and to permit persons to whom the Software is
" furnished to do so, subject to the following conditions:
"
" The above copyright notice and this permission notice shall be included in all
" copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
" SOFTWARE.
let s:save_cpo = &cpo if s:line1 =~# "^#!"
set cpo&vim if s:line1 =~# '^#!\s*\S*\<env\s'
let s:line1 = substitute(s:line1, '\S\+=\S\+', '', 'g')
let &cpo = s:save_cpo let s:line1 = substitute(s:line1, '\(-[iS]\|--ignore-environment\|--split-string\)', '', '')
unlet s:save_cpo 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: " vim: et sw=4 ts=4 sts=4:

View File

@@ -6,7 +6,6 @@ endif
" Language: Ruby " Language: Ruby
" Maintainer: Mark Guzman <segfault@hasno.info> " Maintainer: Mark Guzman <segfault@hasno.info>
" URL: https://github.com/vim-ruby/vim-ruby " URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" ---------------------------------------------------------------------------- " ----------------------------------------------------------------------------
" "
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com) " Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
@@ -493,7 +492,7 @@ class VimRubyCompletion
trail = "%s%s" % [ dir, sub ] trail = "%s%s" % [ dir, sub ]
tcfg = "%sconfig" % trail tcfg = "%sconfig" % trail
if File.exists?( tcfg ) if File.exist?( tcfg )
rails_base = trail rails_base = trail
break break
end end
@@ -506,7 +505,7 @@ class VimRubyCompletion
bootfile = rails_base + "config/boot.rb" bootfile = rails_base + "config/boot.rb"
envfile = rails_base + "config/environment.rb" envfile = rails_base + "config/environment.rb"
if File.exists?( bootfile ) && File.exists?( envfile ) if File.exist?( bootfile ) && File.exist?( envfile )
begin begin
require bootfile require bootfile
require envfile require envfile

View File

@@ -3,14 +3,17 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'smt2', 'autoload/smt2/formatt
endif endif
" Formatting requires a rather recent Vim version " 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" const s:errmsg_oldvim = "Vim >= 8.2.2725 required for auto-formatting"
"Dummies "Dummies
function! smt2#formatter#FormatCurrentParagraph() function! smt2#formatter#FormatCurrentParagraph()
echoerr s:errmsg_oldvim echoerr s:errmsg_oldvim
endfunction endfunction
function! smt2#formatter#FormatAllParagraphs() function! smt2#formatter#FormatOutermostSExpr()
echoerr s:errmsg_oldvim
endfunction
function! smt2#formatter#FormatFile()
echoerr s:errmsg_oldvim echoerr s:errmsg_oldvim
endfunction endfunction
@@ -88,55 +91,75 @@ def Format(ast: dict<any>, indent = 0): string
call formatted->add(child->Format()) call formatted->add(child->Format())
endfor endfor
return formatted->join("\n") 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 endif
throw 'Cannot format AST node: ' .. string(ast) throw 'Cannot format AST node: ' .. string(ast)
return '' # Unreachable return '' # Unreachable
enddef 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 # Public functions
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
def smt2#formatter#FormatCurrentParagraph() def smt2#formatter#FormatCurrentParagraph()
const cursor = getpos('.')
const ast = smt2#parser#ParseCurrentParagraph() const ast = smt2#parser#ParseCurrentParagraph()
FormatInCurrentBuffer(ast)
# 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)
enddef enddef
def smt2#formatter#FormatAllParagraphs() def smt2#formatter#FormatOutermostSExpr()
const cursor = getpos('.') const ast = smt2#parser#ParseOutermostSExpr()
const asts = smt2#parser#ParseAllParagraphs() FormatInCurrentBuffer(ast)
enddef
# Clear buffer & insert formatted paragraphs
silent! :1,$delete def smt2#formatter#FormatFile()
for ast in asts const ast = smt2#parser#ParseFile()
const lines = split(Format(ast), '\n') + [''] FormatInCurrentBuffer(ast)
call append('$', lines)
endfor
# Remove first & trailing empty lines
silent! :1delete
silent! :$delete
# Restore cursor position
call setpos('.', cursor)
enddef enddef

View File

@@ -11,17 +11,37 @@ set maxfuncdepth=100000000 # SMT files tend to be highly nested
# TODO: Change Ast.kind type from string to enum/number? # 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 # Note: pos_from, pos_to and contains_comment allow for a fast FitsOneLine(ast)
# a fast FitsOneLine(ast) function in the formatter. # function in the formatter.
# Here, pos_from and pos_to refer to indices of characters -- not tokens # 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> def Ast(kind: string, value: any, pos_from: number, pos_to: number, contains_comment: bool, scanner: dict<any>): dict<any>
return {kind: kind, value: value, pos_from: pos_from, pos_to: pos_to, contains_comment: contains_comment} # 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 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 var contains_comment = false
for expr in exprs for expr in exprs
if expr.contains_comment if expr.contains_comment
@@ -29,10 +49,10 @@ def ParagraphAst(exprs: list<dict<any>>, pos_from: number, pos_to: number): dict
break break
endif endif
endfor endfor
return Ast('Paragraph', exprs, pos_from, pos_to, contains_comment) return Ast('Paragraph', exprs, pos_from, pos_to, contains_comment, scanner)
enddef 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 var contains_comment = false
for expr in exprs for expr in exprs
if expr.contains_comment if expr.contains_comment
@@ -40,15 +60,22 @@ def SExprAst(exprs: list<dict<any>>, pos_from: number, pos_to: number): dict<any
break break
endif endif
endfor endfor
return Ast('SExpr', exprs, pos_from, pos_to, contains_comment) return Ast('SExpr', exprs, pos_from, pos_to, contains_comment, scanner)
enddef enddef
def AtomAst(token: dict<any>): dict<any> def AtomAst(token: dict<any>, scanner: dict<any>): dict<any>
return Ast('Atom', token, token.pos, token.pos + len(token.lexeme), token.kind == 8) return Ast('Atom', token, token.pos, token.pos + len(token.lexeme), token.kind == 8, scanner)
enddef enddef
def PrintAst(ast: dict<any>, indent = 0) 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' if ast.kind ==# 'Atom'
echon ast.value.lexeme echon ast.value.lexeme
@@ -60,13 +87,18 @@ def PrintAst(ast: dict<any>, indent = 0)
for v in ast.value for v in ast.value
call PrintAst(v, indent + 1) call PrintAst(v, indent + 1)
endfor endfor
elseif ast.kind ==# 'File'
for v in ast.value
call PrintAst(v, indent + 1)
endfor
endif endif
enddef enddef
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Grammar # Grammar
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Paragraph ::= Expr+ # File ::= Paragraph+
# Paragraph ::= Expr+ EndOfParagraph
# Expr ::= SExpr | Atom # Expr ::= SExpr | Atom
# SExpr ::= '(' Expr* ')' # SExpr ::= '(' Expr* ')'
@@ -77,14 +109,16 @@ def AtStartOfLParen(scanner: dict<any>): bool
return scanner.cur_token.kind == 0 # token_lparen return scanner.cur_token.kind == 0 # token_lparen
enddef enddef
def ParseLParen(scanner: dict<any>) # consumes token; no return def ParseLParen(scanner: dict<any>): dict<any>
if debug if debug
scanner->smt2#scanner#Enforce(scanner->AtStartOfLParen(), scanner->smt2#scanner#Enforce(scanner->AtStartOfLParen(),
"ParseLParen called but not at start of LParen", "ParseLParen called but not at start of LParen",
scanner.cur_token.pos) scanner.cur_token.pos)
endif endif
const token = scanner.cur_token
scanner->smt2#scanner#NextToken() scanner->smt2#scanner#NextToken()
return token
enddef enddef
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@@ -94,14 +128,16 @@ def AtStartOfRParen(scanner: dict<any>): bool
return scanner.cur_token.kind == 1 # token_rparen return scanner.cur_token.kind == 1 # token_rparen
enddef enddef
def ParseRParen(scanner: dict<any>) # consumes token; no return def ParseRParen(scanner: dict<any>): dict<any>
if debug if debug
scanner->smt2#scanner#Enforce(scanner->AtStartOfRParen(), scanner->smt2#scanner#Enforce(scanner->AtStartOfRParen(),
"ParseRParen called but not at start of RParen", "ParseRParen called but not at start of RParen",
scanner.cur_token.pos) scanner.cur_token.pos)
endif endif
const token = scanner.cur_token
scanner->smt2#scanner#NextToken() scanner->smt2#scanner#NextToken()
return token
enddef enddef
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@@ -118,7 +154,7 @@ def ParseAtom(scanner: dict<any>): dict<any>
scanner.cur_token.pos) scanner.cur_token.pos)
endif endif
const ast = AtomAst(scanner.cur_token) const ast = AtomAst(scanner.cur_token, scanner)
scanner->smt2#scanner#NextToken() scanner->smt2#scanner#NextToken()
return ast return ast
enddef enddef
@@ -129,6 +165,7 @@ enddef
def AtStartOfExpr(scanner: dict<any>): bool def AtStartOfExpr(scanner: dict<any>): bool
return scanner->AtStartOfSExpr() || scanner->AtStartOfAtom() return scanner->AtStartOfSExpr() || scanner->AtStartOfAtom()
enddef enddef
def ParseExpr(scanner: dict<any>): dict<any> def ParseExpr(scanner: dict<any>): dict<any>
if debug if debug
scanner->smt2#scanner#Enforce(scanner->AtStartOfExpr(), scanner->smt2#scanner#Enforce(scanner->AtStartOfExpr(),
@@ -146,6 +183,7 @@ enddef
# SExpr # SExpr
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
const AtStartOfSExpr = funcref(AtStartOfLParen) const AtStartOfSExpr = funcref(AtStartOfLParen)
def ParseSExpr(scanner: dict<any>): dict<any> def ParseSExpr(scanner: dict<any>): dict<any>
const pos_from = scanner.cur_token.pos const pos_from = scanner.cur_token.pos
@@ -165,10 +203,10 @@ def ParseSExpr(scanner: dict<any>): dict<any>
scanner->smt2#scanner#Enforce(scanner->AtStartOfRParen(), scanner->smt2#scanner#Enforce(scanner->AtStartOfRParen(),
printf("Expected RParen but got %s", scanner.cur_token.kind->smt2#scanner#TokenKind2Str()), printf("Expected RParen but got %s", scanner.cur_token.kind->smt2#scanner#TokenKind2Str()),
scanner.cur_token.pos) scanner.cur_token.pos)
scanner->ParseRParen() const end_token = scanner->ParseRParen()
const pos_to = scanner.cur_token.pos const pos_to = end_token.pos + 1
return SExprAst(exprs, pos_from, pos_to) return SExprAst(exprs, pos_from, pos_to, scanner)
enddef enddef
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@@ -187,41 +225,132 @@ def ParseParagraph(scanner: dict<any>): dict<any>
exprs->add(scanner->ParseExpr()) exprs->add(scanner->ParseExpr())
endwhile endwhile
const pos_to = scanner.cur_token.pos const pos_to = exprs[-1].pos_to
return ParagraphAst(exprs, pos_from, 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 enddef
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Public functions # Public functions
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
def smt2#parser#ParseCurrentParagraph(): dict<any> 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('.') const cursor = getpos('.')
silent! normal! { MoveToStartOfCurrentParagraph()
const line_offset = line('.') const from = getpos('.')
const source = join(getline('.', '$'), "\n")
call setpos('.', cursor) 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() const ast = scanner->ParseParagraph()
if debug | ast->PrintAst() | endif if debug | ast->PrintAst() | endif
return ast return ast
enddef enddef
def smt2#parser#ParseAllParagraphs(): list<dict<any>> def smt2#parser#ParseOutermostSExpr(): dict<any>
# source = current buffer const cursor = getpos('.')
const source = join(getline(1, '$'), "\n") if ! MoveToOutermostSExpr()
throw "Cursor is not in an S-expression!"
endif
const from = getpos('.')
call setpos('.', cursor)
var scanner = smt2#scanner#Scanner(source) # source = [start of outermost SExpr, EOF]
var asts = [] # Note: This is needed since `silent! normal! %` is not guaranteed to jump
while scanner.cur_token.kind != 9 # token_eof # to the matching ')', e.g. if an unmatched '(' occurs in a comment.
const ast = scanner->ParseParagraph() const lines_to_format = getline(from[1], '$')
asts->add(ast) const source = join(lines_to_format, "\n")
if debug | ast->PrintAst() | endif var scanner = smt2#scanner#Scanner(source, from[1], from[2])
endwhile const ast = scanner->ParseSExpr()
return asts
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 enddef

View File

@@ -56,7 +56,7 @@ enddef
def PrettyPrint(scanner: dict<any>, token: dict<any>) def PrettyPrint(scanner: dict<any>, token: dict<any>)
const coord = scanner->Pos2Coord(token.pos) 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 enddef
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@@ -72,12 +72,14 @@ enddef
# TODO: Enforce restriction to ASCII? We should if we use the lookup table below # 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)? # 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 = { var scanner = {
chars: source->trim(" \t\n\r", 2)->split('\zs'), chars: source->trim(" \n\r\t", 2)->split('\zs'),
line_offset: line_offset, # start line of source string in buffer line_offset: start_line, # start line of source string in buffer
pos: 0, # pos in source string -- not column in line pos: start_col - 1, # pos in source string -- not column in line
at_new_paragraph: false} at_new_paragraph: false,
}
scanner.calcCoord = (pos: number): dict<number> => Pos2Coord(scanner, pos)
if scanner.chars->empty() if scanner.chars->empty()
scanner.at_eof = true scanner.at_eof = true

View File

@@ -9,6 +9,11 @@ set cpoptions&vim
let $TF_CLI_ARGS_fmt='' let $TF_CLI_ARGS_fmt=''
function! terraform#fmt() abort function! terraform#fmt() abort
silent execute 'w !'.g:terraform_binary_path.' fmt -check -'
if v:shell_error == 0
return
endif
" Save the view. " Save the view.
let curw = winsaveview() let curw = winsaveview()

View File

@@ -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:

View File

@@ -1,134 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'xsd', 'autoload/xml/xsd.vim')
finish
endif
" Author: Thomas Barthel
" Last change: 2007 May 8
let g:xmldata_xsd = {
\ 'schema': [
\ [ 'include', 'import', 'redefine', 'annotation', 'simpleType', 'complexType', 'element', 'attribute', 'attributeGroup', 'group', 'notation', 'annotation'],
\ { 'targetNamespace' : [], 'version' : [], 'xmlns' : [], 'finalDefault' : [], 'blockDefault' : [], 'id' : [], 'elementFormDefault' : [], 'attributeFormDefault' : [], 'xml:lang' : [] }],
\ 'redefine' : [
\ ['annotation', 'simpleType', 'complexType', 'attributeGroup', 'group'],
\ {'schemaLocation' : [], 'id' : []} ],
\ 'include' : [
\ ['annotation'],
\ {'namespace' : [], 'id' : []} ],
\ 'import' : [
\ ['annotation'],
\ {'namespace' : [], 'schemaLocation' : [], 'id' : []} ],
\ 'complexType' : [
\ ['annotation', 'simpleContent', 'complexContent', 'all', 'choice', 'sequence', 'group', 'attribute', 'attributeGroup', 'anyAttribute'],
\ {'name' : [], 'id' : [], 'abstract' : [], 'final' : [], 'block' : [], 'mixed' : []} ],
\ 'complexContent' : [
\ ['annotation', 'restriction', 'extension'],
\ {'mixed' : [], 'id' : [] } ],
\ 'simpleType' : [
\ ['annotation', 'restriction', 'list', 'union'],
\ {'name' : [], 'final' : [], 'id' : []} ],
\ 'simpleContent' : [
\ ['annotation', 'restriction', 'extension'],
\ {'id' : []} ],
\ 'element' : [
\ ['annotation', 'complexType', 'simpleType', 'unique', 'key', 'keyref'],
\ {'name' : [], 'id' : [], 'ref' : [], 'type' : [], 'minOccurs' : [], 'maxOccurs' : [], 'nillable' : [], 'substitutionGroup' : [], 'abstract' : [], 'final' : [], 'block' : [], 'default' : [], 'fixed' : [], 'form' : []} ],
\ 'attribute' : [
\ ['annotation', 'simpleType'],
\ {'name' : [], 'id' : [], 'ref' : [], 'type' : [], 'use' : [], 'default' : [], 'fixed' : [], 'form' : []} ],
\ 'group' : [
\ ['annotation', 'all', 'choice', 'sequence'],
\ {'name' : [], 'ref' : [], 'minOccurs' : [], 'maxOccurs' : [], 'id' : []} ],
\ 'choice' : [
\ ['annotation', 'element', 'group', 'choice', 'sequence', 'any'],
\ {'minOccurs' : [], 'maxOccurs' : [], 'id' : []} ],
\ 'sequence' : [
\ ['annotation', 'element', 'group', 'choice', 'sequence', 'any'],
\ {'minOccurs' : [], 'maxOccurs' : [], 'id' : []} ],
\ 'all' : [
\ ['annotation', 'element'],
\ {'minOccurs' : [], 'maxOccurs' : [], 'id' : []} ],
\ 'any' : [
\ ['annotation'],
\ {'namespace' : [], 'processContents' : [], 'minOccurs' : [], 'maxOccurs' : [], 'id' : []} ],
\ 'unique' : [
\ ['annotation', 'selector', 'field'],
\ {'name' : [], 'id' : []} ],
\ 'key' : [
\ ['annotation', 'selector', 'field'],
\ {'name' : [], 'id' : []} ],
\ 'keyref' : [
\ ['annotation', 'selector', 'field'],
\ {'name' : [], 'refer' : [], 'id' : []} ],
\ 'selector' : [
\ ['annotation'],
\ {'xpath' : [], 'id' : []} ],
\ 'field' : [
\ ['annotation'],
\ {'xpath' : [], 'id' : []} ],
\ 'restriction' : [
\ ['annotation', 'simpleType', 'minExclusive', 'maxExclusive', 'minInclusive', 'maxInclusive', 'totalDigits', 'fractionDigits', 'length', 'minLength', 'maxLength', 'enumeration', 'whiteSpace', 'pattern'],
\ {'base' : [], 'id' : []} ],
\ 'minExclusive' : [
\ ['annotation'],
\ {'value' : [], 'id' : [], 'fixed' : []}],
\ 'maxExclusive' : [
\ ['annotation'],
\ {'value' : [], 'id' : [], 'fixed' : []}],
\ 'minInclusive' : [
\ ['annotation'],
\ {'value' : [], 'id' : [], 'fixed' : []}],
\ 'maxInclusive' : [
\ ['annotation'],
\ {'value' : [], 'id' : [], 'fixed' : []}],
\ 'totalDigits' : [
\ ['annotation'],
\ {'value' : [], 'id' : [], 'fixed' : []}],
\ 'fractionDigits' : [
\ ['annotation'],
\ {'value' : [], 'id' : [], 'fixed' : []}],
\ 'length' : [
\ ['annotation'],
\ {'value' : [], 'id' : [], 'fixed' : []}],
\ 'minLength' : [
\ ['annotation'],
\ {'value' : [], 'id' : [], 'fixed' : []}],
\ 'maxLength' : [
\ ['annotation'],
\ {'value' : [], 'id' : [], 'fixed' : []}],
\ 'enumeration' : [
\ ['annotation'],
\ {'value' : [], 'id' : []}],
\ 'whiteSpace' : [
\ ['annotation'],
\ {'value' : [], 'id' : [], 'fixed' : []}],
\ 'pattern' : [
\ ['annotation'],
\ {'value' : [], 'id' : []}],
\ 'extension' : [
\ ['annotation', 'all', 'choice', 'sequence', 'group', 'attribute', 'attributeGroup', 'anyAttribute'],
\ {'base' : [], 'id' : []} ],
\ 'attributeGroup' : [
\ ['annotation', 'attribute', 'attributeGroup', 'anyAttribute'],
\ {'name' : [], 'id' : [], 'ref' : []} ],
\ 'anyAttribute' : [
\ ['annotation'],
\ {'namespace' : [], 'processContents' : [], 'id' : []} ],
\ 'list' : [
\ ['annotation', 'simpleType'],
\ {'itemType' : [], 'id' : []} ],
\ 'union' : [
\ ['annotation', 'simpleType'],
\ {'id' : [], 'memberTypes' : []} ],
\ 'notation' : [
\ ['annotation'],
\ {'name' : [], 'id' : [], 'public' : [], 'system' : []} ],
\ 'annotation' : [
\ ['appinfo', 'documentation'],
\ {} ],
\ 'appinfo' : [
\ [],
\ {'source' : [], 'id' : []} ],
\ 'documentation' : [
\ [],
\ {'source' : [], 'id' : [], 'xml' : []} ]
\ }

View File

@@ -1,42 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'ant', 'compiler/ant.vim')
finish
endif
" Vim Compiler File
" Compiler: ant
" Maintainer: Johannes Zellner <johannes@zellner.org>
" Last Change: Mi, 13 Apr 2005 22:50:07 CEST
if exists("current_compiler")
finish
endif
let current_compiler = "ant"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=ant
" first line:
" ant with jikes +E, which assumes the following
" two property lines in your 'build.xml':
"
" <property name = "build.compiler" value = "jikes"/>
" <property name = "build.compiler.emacs" value = "true"/>
"
" second line:
" ant with javac
"
" note that this will work also for tasks like [wtkbuild]
"
CompilerSet errorformat=\ %#[%.%#]\ %#%f:%l:%v:%*\\d:%*\\d:\ %t%[%^:]%#:%m,
\%A\ %#[%.%#]\ %f:%l:\ %m,%-Z\ %#[%.%#]\ %p^,%C\ %#[%.%#]\ %#%m
" ,%-C%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1,26 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bdf', 'compiler/bdf.vim')
finish
endif
" Vim compiler file
" Compiler: BDF to PCF Conversion
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
if exists("current_compiler")
finish
endif
let current_compiler = "bdf"
let s:cpo_save = &cpo
set cpo-=C
setlocal makeprg=bdftopcf\ $*
setlocal errorformat=%ABDF\ %trror\ on\ line\ %l:\ %m,
\%-Z%p^,
\%Cbdftopcf:\ bdf\ input\\,\ %f\\,\ corrupt,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -38,10 +38,12 @@ augroup END
" Ignore general cargo progress messages " Ignore general cargo progress messages
CompilerSet errorformat+= CompilerSet errorformat+=
\%-G%\\s%#Downloading%.%#, \%-G%\\s%#Downloading%.%#,
\%-G%\\s%#Checking%.%#,
\%-G%\\s%#Compiling%.%#, \%-G%\\s%#Compiling%.%#,
\%-G%\\s%#Finished%.%#, \%-G%\\s%#Finished%.%#,
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#, \%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
\%-G%\\s%#To\ learn\ more\\,%.%#, \%-G%\\s%#To\ learn\ more\\,%.%#,
\%-G%\\s%#For\ more\ information\ about\ this\ error\\,%.%#,
\%-Gnote:\ Run\ with\ \`RUST_BACKTRACE=%.%#, \%-Gnote:\ Run\ with\ \`RUST_BACKTRACE=%.%#,
\%.%#panicked\ at\ \\'%m\\'\\,\ %f:%l:%c \%.%#panicked\ at\ \\'%m\\'\\,\ %f:%l:%c

View File

@@ -1,30 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'cs', 'compiler/cs.vim')
finish
endif
" Vim compiler file
" Compiler: Microsoft Visual Studio C#
" Maintainer: Yichao Zhou (broken.zhou@gmail.com)
" Previous Maintainer: Joseph H. Yao (hyao@sina.com)
" Last Change: Jul 22, 2019
if exists("current_compiler")
finish
endif
let current_compiler = "cs"
let s:keepcpo= &cpo
set cpo&vim
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
CompilerSet errorformat&
CompilerSet errorformat+=%f(%l\\,%v):\ %t%*[^:]:\ %m,
\%trror%*[^:]:\ %m,
\%tarning%*[^:]:\ %m
CompilerSet makeprg=csc\ %:S
let &cpo = s:keepcpo
unlet s:keepcpo

View File

@@ -1,19 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'dot', 'compiler/dot.vim')
finish
endif
" Vim compiler file
" Compiler: ATT dot
" Maintainer: Marcos Macedo <bar4ka@bol.com.br>
" Last Change: 2004 May 16
if exists("current_compiler")
finish
endif
let current_compiler = "dot"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
CompilerSet makeprg=dot\ -T$*\ \"%:p\"\ -o\ \"%:p:r.$*\"

View File

@@ -6,7 +6,6 @@ endif
" Language: eRuby " Language: eRuby
" Maintainer: Doug Kearns <dougkearns@gmail.com> " Maintainer: Doug Kearns <dougkearns@gmail.com>
" URL: https://github.com/vim-ruby/vim-ruby " URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
if exists("current_compiler") if exists("current_compiler")
finish finish

26
compiler/jq.vim Normal file
View File

@@ -0,0 +1,26 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'jq', 'compiler/jq.vim')
finish
endif
if exists('b:current_compiler')
finish
endif
let b:current_compiler = 'jq'
let s:save_cpoptions = &cpoptions
set cpoptions&vim
if exists(':CompilerSet') != 2
command -nargs=* CompilerSet setlocal <args>
endif
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

View File

@@ -23,7 +23,11 @@ if !exists('g:ledger_main')
let g:ledger_main = '%' let g:ledger_main = '%'
endif 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:..."): " Capture Ledger errors (%-C ignores all lines between "While parsing..." and "Error:..."):
CompilerSet errorformat=%EWhile\ parsing\ file\ \"%f\"\\,\ line\ %l:,%ZError:\ %m,%-C%.%# CompilerSet errorformat=%EWhile\ parsing\ file\ \"%f\"\\,\ line\ %l:,%ZError:\ %m,%-C%.%#
" Capture Ledger warnings: " Capture Ledger warnings:

View File

@@ -7,7 +7,7 @@ endif
" Maintainer: Heikki Junes <hjunes@cc.hut.fi> " Maintainer: Heikki Junes <hjunes@cc.hut.fi>
" License: This file is part of LilyPond, the GNU music typesetter. " 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 " LilyPond is free software: you can redistribute it and/or modify
" it under the terms of the GNU General Public License as published by " it under the terms of the GNU General Public License as published by

49
compiler/pip_compile.vim Normal file
View 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:

View File

@@ -6,7 +6,6 @@ endif
" Language: Rake " Language: Rake
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" URL: https://github.com/vim-ruby/vim-ruby " URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
if exists("current_compiler") if exists("current_compiler")
finish finish

View File

@@ -6,7 +6,6 @@ endif
" Language: RSpec " Language: RSpec
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" URL: https://github.com/vim-ruby/vim-ruby " URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
if exists("current_compiler") if exists("current_compiler")
finish finish

View File

@@ -7,7 +7,6 @@ endif
" Function: Syntax check and/or error reporting " Function: Syntax check and/or error reporting
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" URL: https://github.com/vim-ruby/vim-ruby " URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
if exists("current_compiler") if exists("current_compiler")
finish finish

View File

@@ -6,7 +6,6 @@ endif
" Language: Test::Unit - Ruby Unit Testing Framework " Language: Test::Unit - Ruby Unit Testing Framework
" Maintainer: Doug Kearns <dougkearns@gmail.com> " Maintainer: Doug Kearns <dougkearns@gmail.com>
" URL: https://github.com/vim-ruby/vim-ruby " URL: https://github.com/vim-ruby/vim-ruby
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
if exists("current_compiler") if exists("current_compiler")
finish finish

View File

@@ -1,34 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'sass', 'compiler/sass.vim')
finish
endif
" Vim compiler file
" Compiler: Sass
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2016 Aug 29
if exists("current_compiler")
finish
endif
let current_compiler = "sass"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo-=C
CompilerSet makeprg=sass
CompilerSet errorformat=
\%f:%l:%m\ (Sass::Syntax%trror),
\%ESyntax\ %trror:%m,
\%C%\\s%\\+on\ line\ %l\ of\ %f,
\%Z%.%#,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save
" vim:set sw=2 sts=2:

View File

@@ -1,32 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'sml', 'compiler/sml.vim')
finish
endif
" Vim compiler file
" Compiler: SML/NJ Compiler
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2020 Feb 10
if exists("current_compiler")
finish
endif
let current_compiler = "sml"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=sml
CompilerSet errorformat=%f:%l.%c-%\\d%\\+.%\\d%\\+\ %trror:\ %m,
\%f:%l.%c\ %trror:\ %m,
\%trror:\ %m
\%f:%l.%c-%\\d%\\+.%\\d%\\+\ %tarning:\ %m,
\%f:%l.%c\ %tarning:\ %m,
\%tarning:\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1,21 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'tcl', 'compiler/tcl.vim')
finish
endif
" Vim compiler file
" Compiler: tcl
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2004 Nov 27
if exists("current_compiler")
finish
endif
let current_compiler = "tcl"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
CompilerSet makeprg=tcl
CompilerSet errorformat=%EError:\ %m,%+Z\ %\\{4}(file\ \"%f\"\ line\ %l),%-G%.%#

View File

@@ -1,30 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'tidy', 'compiler/tidy.vim')
finish
endif
" Vim compiler file
" Compiler: HTML Tidy
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2020 Sep 4
if exists("current_compiler")
finish
endif
let current_compiler = "tidy"
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
command -nargs=* CompilerSet setlocal <args>
endif
let s:cpo_save = &cpo
set cpo&vim
CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes
CompilerSet errorformat=%f:%l:%c:\ %trror:\ %m,
\%f:%l:%c:\ %tarning:\ %m,
\%f:%l:%c:\ %tnfo:\ %m,
\%f:%l:%c:\ %m,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -22,4 +22,4 @@ endif
let &l:makeprg = g:typescript_compiler_binary . ' ' . g:typescript_compiler_options . ' $* %' 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

View File

@@ -1547,9 +1547,6 @@ au BufNewFile,BufRead *.r,*.R call polyglot#ft#FTr()
" Remind " Remind
au BufNewFile,BufRead .reminders,*.remind,*.rem setf remind au BufNewFile,BufRead .reminders,*.remind,*.rem setf remind
" ReScript
au BufNewFile,BufRead *.res,*.resi setf rescript
" Resolv.conf " Resolv.conf
au BufNewFile,BufRead resolv.conf setf resolv au BufNewFile,BufRead resolv.conf setf resolv
@@ -2509,7 +2506,7 @@ endif
" Function called for testing all functions defined here. These are " Function called for testing all functions defined here. These are
" script-local, thus need to be executed here. " script-local, thus need to be executed here.
" Returns a string with error messages (hopefully empty). " Returns a string with error messages (hopefully empty).
func! TestFiletypeFuncs(testlist) func! TestPolyglotFiletypeFuncs(testlist)
let output = '' let output = ''
for f in a:testlist for f in a:testlist
try try

View File

@@ -22,7 +22,8 @@ syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRe
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
syntax region jsDocTypeNoParam contained start="{" end="}" oneline syntax region jsDocTypeNoParam contained start="{" end="}" oneline
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.\{-}]\|=\)\+" syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\~\|\.\|:\|\/\|\[.\{-}]\|=\)\+"
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
if version >= 508 || !exists("did_javascript_syn_inits") if version >= 508 || !exists("did_javascript_syn_inits")

File diff suppressed because it is too large Load Diff

View File

@@ -1,31 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), '8th', 'ftplugin/8th.vim')
finish
endif
" Vim ftplugin file
" Language: 8th
" Version: any
" Last Change: 2021 Sep 20
" Last Change: 2021/09/20
" Maintainer: Ron Aaron <ron@aaron-tech.com>
" URL: https://8th-dev.com/
" Filetypes: *.8th
" NOTE: 8th allows any non-whitespace in a name, so you need to do:
" setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
" This goes with the syntax/8th.vim file.
" Only do this when not done yet for this buffer
if exists("b:did_8thplugin")
finish
endif
" Don't load another 8th plugin for this buffer
let b:did_8thplugin = 1
setlocal ts=2 sts=2 sw=2 et
setlocal com=s1:/*,mb:*,ex:*/,b:--,be:\\
setlocal fo=tcrqol
setlocal matchpairs+=\::;
setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
setlocal suffixesadd=.8th
let b:undo_ftplugin = "setlocal ts< sts< sw< et< com< fo< mps< isk< sua<"

View File

@@ -1,24 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'a2ps', 'ftplugin/a2ps.vim')
finish
endif
" Vim filetype plugin file
" Language: a2ps(1) configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< inc< fo<"
setlocal comments=:# commentstring=#\ %s include=^\\s*Include:
setlocal formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1,36 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'aap', 'ftplugin/aap.vim')
finish
endif
" Vim filetype plugin file
" Language: Aap recipe
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2021 Nov 14
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
" Reset 'formatoptions', 'comments', 'commentstring' and 'expandtab' to undo
" this plugin.
let b:undo_ftplugin = "setl fo< com< cms< et<"
" Set 'formatoptions' to break comment lines but not other lines,
" and insert the comment leader when hitting <CR> or using "o".
setlocal fo-=t fo+=croql
" Set 'comments' to format dashed lists in comments.
setlocal comments=s:#\ -,m:#\ \ ,e:#,n:#,fb:-
setlocal commentstring=#\ %s
" Expand tabs to spaces to avoid trouble.
setlocal expandtab
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "Aap Recipe Files (*.aap)\t*.aap\nAll Files (*.*)\t*.*\n"
let b:undo_ftplugin .= " | unlet! b:browsefilter"
endif

View File

@@ -1,33 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'abap', 'ftplugin/abap.vim')
finish
endif
" Vim filetype plugin file
" Language: ABAP
" Author: Steven Oliver <oliver.steven@gmail.com>
" Copyright: Copyright (c) 2013 Steven Oliver
" License: You may redistribute this under the same terms as Vim itself
" --------------------------------------------------------------------------
" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
setlocal softtabstop=2 shiftwidth=2
setlocal suffixesadd=.abap
" Windows allows you to filter the open file dialog
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "ABAP Source Files (*.abap)\t*.abap\n" .
\ "All Files (*.*)\t*.*\n"
endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: set sw=4 sts=4 et tw=80 :

View File

@@ -1,101 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'abaqus', 'ftplugin/abaqus.vim')
finish
endif
" Vim filetype plugin file
" Language: Abaqus finite element input file (www.abaqus.com)
" Maintainer: Carl Osterwisch <osterwischc@asme.org>
" Last Change: 2012 Apr 30
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin") | finish | endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
" Save the compatibility options and temporarily switch to vim defaults
let s:cpo_save = &cpoptions
set cpoptions&vim
" Set the format of the include file specification for Abaqus
" Used in :check gf ^wf [i and other commands
setlocal include=\\<\\cINPUT\\s*=
" Remove characters up to the first = when evaluating filenames
setlocal includeexpr=substitute(v:fname,'.\\{-}=','','')
" Remove comma from valid filename characters since it is used to
" separate keyword parameters
setlocal isfname-=,
" Define format of comment lines (see 'formatoptions' for uses)
setlocal comments=:**
setlocal commentstring=**%s
" Definitions start with a * and assign a NAME, NSET, or ELSET
" Used in [d ^wd and other commands
setlocal define=^\\*\\a.*\\c\\(NAME\\\|NSET\\\|ELSET\\)\\s*=
" Abaqus keywords and identifiers may include a - character
setlocal iskeyword+=-
let b:undo_ftplugin = "setlocal include< includeexpr< isfname<"
\ . " comments< commentstring< define< iskeyword<"
if has("folding")
" Fold all lines that do not begin with *
setlocal foldexpr=getline(v:lnum)[0]!=\"\*\"
setlocal foldmethod=expr
let b:undo_ftplugin .= " foldexpr< foldmethod<"
endif
" Set the file browse filter (currently only supported under Win32 gui)
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "Abaqus Input Files (*.inp *.inc)\t*.inp;*.inc\n" .
\ "Abaqus Results (*.dat)\t*.dat\n" .
\ "Abaqus Messages (*.pre *.msg *.sta)\t*.pre;*.msg;*.sta\n" .
\ "All Files (*.*)\t*.*\n"
let b:undo_ftplugin .= "|unlet! b:browsefilter"
endif
" Define patterns for the matchit plugin
if exists("loaded_matchit") && !exists("b:match_words")
let b:match_ignorecase = 1
let b:match_words =
\ '\*part:\*end\s*part,' .
\ '\*assembly:\*end\s*assembly,' .
\ '\*instance:\*end\s*instance,' .
\ '\*step:\*end\s*step'
let b:undo_ftplugin .= "|unlet! b:match_ignorecase b:match_words"
endif
" Define keys used to move [count] keywords backward or forward.
noremap <silent><buffer> [[ ?^\*\a<CR>:nohlsearch<CR>
noremap <silent><buffer> ]] /^\*\a<CR>:nohlsearch<CR>
" Define key to toggle commenting of the current line or range
noremap <silent><buffer> <LocalLeader><LocalLeader>
\ :call <SID>Abaqus_ToggleComment()<CR>j
function! <SID>Abaqus_ToggleComment() range
if strpart(getline(a:firstline), 0, 2) == "**"
" Un-comment all lines in range
silent execute a:firstline . ',' . a:lastline . 's/^\*\*//'
else
" Comment all lines in range
silent execute a:firstline . ',' . a:lastline . 's/^/**/'
endif
endfunction
let b:undo_ftplugin .= "|unmap <buffer> [[|unmap <buffer> ]]"
\ . "|unmap <buffer> <LocalLeader><LocalLeader>"
" Undo must be done in nocompatible mode for <LocalLeader>.
let b:undo_ftplugin = "let s:cpo_save = &cpoptions|"
\ . "set cpoptions&vim|"
\ . b:undo_ftplugin
\ . "|let &cpoptions = s:cpo_save"
\ . "|unlet s:cpo_save"
" Restore saved compatibility options
let &cpoptions = s:cpo_save
unlet s:cpo_save

View File

@@ -1,215 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'ada', 'ftplugin/ada.vim')
finish
endif
"------------------------------------------------------------------------------
" Description: Perform Ada specific completion & tagging.
" Language: Ada (2005)
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
" Taylor Venable <taylor@metasyntax.net>
" Neil Bird <neil@fnxweb.com>
" $Author: krischik $
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
" Version: 4.6 with patch from David Bürgin
" $Revision: 887 $
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/ftplugin/ada.vim $
" History: 24.05.2006 MK Unified Headers
" 26.05.2006 MK ' should not be in iskeyword.
" 16.07.2006 MK Ada-Mode as vim-ball
" 02.10.2006 MK Better folding.
" 15.10.2006 MK Bram's suggestion for runtime integration
" 05.11.2006 MK Bram suggested not to use include protection for
" autoload
" 05.11.2006 MK Bram suggested to save on spaces
" 08.07.2007 TV fix default compiler problems.
" Help Page: ft-ada-plugin
"------------------------------------------------------------------------------
" Provides mapping overrides for tag jumping that figure out the current
" Ada object and tag jump to that, not the 'simple' vim word.
" Similarly allows <Ctrl-N> matching of full-length ada entities from tags.
"------------------------------------------------------------------------------
" Only do this when not done yet for this buffer
if exists ("b:did_ftplugin") || version < 700
finish
endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 45
"
" Temporarily set cpoptions to ensure the script loads OK
"
let s:cpoptions = &cpoptions
set cpoptions-=C
" Section: Comments {{{1
"
setlocal comments=O:--,:--\ \
setlocal commentstring=--\ \ %s
setlocal complete=.,w,b,u,t,i
" Section: case {{{1
"
setlocal nosmartcase
setlocal ignorecase
" Section: formatoptions {{{1
"
setlocal formatoptions+=ron
" Section: Tagging {{{1
"
if exists ("g:ada_extended_tagging")
" Make local tag mappings for this buffer (if not already set)
if g:ada_extended_tagging == 'jump'
if mapcheck('<C-]>','n') == ''
nnoremap <unique> <buffer> <C-]> :call ada#Jump_Tag ('', 'tjump')<cr>
endif
if mapcheck('g<C-]>','n') == ''
nnoremap <unique> <buffer> g<C-]> :call ada#Jump_Tag ('','stjump')<cr>
endif
elseif g:ada_extended_tagging == 'list'
if mapcheck('<C-]>','n') == ''
nnoremap <unique> <buffer> <C-]> :call ada#List_Tag ()<cr>
endif
if mapcheck('g<C-]>','n') == ''
nnoremap <unique> <buffer> g<C-]> :call ada#List_Tag ()<cr>
endif
endif
endif
" Section: Completion {{{1
"
setlocal completefunc=ada#User_Complete
setlocal omnifunc=adacomplete#Complete
if exists ("g:ada_extended_completion")
if mapcheck ('<C-N>','i') == ''
inoremap <unique> <buffer> <C-N> <C-R>=ada#Completion("\<lt>C-N>")<cr>
endif
if mapcheck ('<C-P>','i') == ''
inoremap <unique> <buffer> <C-P> <C-R>=ada#Completion("\<lt>C-P>")<cr>
endif
if mapcheck ('<C-X><C-]>','i') == ''
inoremap <unique> <buffer> <C-X><C-]> <C-R>=<SID>ada#Completion("\<lt>C-X>\<lt>C-]>")<cr>
endif
if mapcheck ('<bs>','i') == ''
inoremap <silent> <unique> <buffer> <bs> <C-R>=ada#Insert_Backspace ()<cr>
endif
endif
" Section: Matchit {{{1
"
" Only do this when not done yet for this buffer & matchit is used
"
if !exists ("b:match_words") &&
\ exists ("loaded_matchit")
"
" The following lines enable the macros/matchit.vim plugin for
" Ada-specific extended matching with the % key.
"
let s:notend = '\%(\<end\s\+\)\@<!'
let b:match_words =
\ s:notend . '\<if\>:\<elsif\>:\<else\>:\<end\>\s\+\<if\>,' .
\ s:notend . '\<case\>:\<when\>:\<end\>\s\+\<case\>,' .
\ '\%(\<while\>.*\|\<for\>.*\|'.s:notend.'\)\<loop\>:\<end\>\s\+\<loop\>,' .
\ '\%(\<do\>\|\<begin\>\):\<exception\>:\<end\>\s*\%($\|[;A-Z]\),' .
\ s:notend . '\<record\>:\<end\>\s\+\<record\>'
endif
" Section: Compiler {{{1
"
if ! exists("g:ada_default_compiler")
if has("vms")
let g:ada_default_compiler = 'decada'
else
let g:ada_default_compiler = 'gnat'
endif
endif
if ! exists("current_compiler") ||
\ current_compiler != g:ada_default_compiler
execute "compiler " . g:ada_default_compiler
endif
" Section: Folding {{{1
"
if exists("g:ada_folding")
if g:ada_folding[0] == 'i'
setlocal foldmethod=indent
setlocal foldignore=--
setlocal foldnestmax=5
elseif g:ada_folding[0] == 'g'
setlocal foldmethod=expr
setlocal foldexpr=ada#Pretty_Print_Folding(v:lnum)
elseif g:ada_folding[0] == 's'
setlocal foldmethod=syntax
endif
setlocal tabstop=8
setlocal softtabstop=3
setlocal shiftwidth=3
endif
" Section: Abbrev {{{1
"
if exists("g:ada_abbrev")
iabbrev ret return
iabbrev proc procedure
iabbrev pack package
iabbrev func function
endif
" Section: Commands, Mapping, Menus {{{1
if !exists(':AdaTagFile')
call ada#Map_Popup (
\ 'Tag.List',
\ 'l',
\ 'call ada#List_Tag ()')
call ada#Map_Popup (
\'Tag.Jump',
\'j',
\'call ada#Jump_Tag ()')
call ada#Map_Menu (
\'Tag.Create File',
\':AdaTagFile',
\'call ada#Create_Tags (''file'')')
call ada#Map_Menu (
\'Tag.Create Dir',
\':AdaTagDir',
\'call ada#Create_Tags (''dir'')')
call ada#Map_Menu (
\'Highlight.Toggle Space Errors',
\ ':AdaSpaces',
\'call ada#Switch_Syntax_Option (''space_errors'')')
call ada#Map_Menu (
\'Highlight.Toggle Lines Errors',
\ ':AdaLines',
\'call ada#Switch_Syntax_Option (''line_errors'')')
call ada#Map_Menu (
\'Highlight.Toggle Rainbow Color',
\ ':AdaRainbow',
\'call ada#Switch_Syntax_Option (''rainbow_color'')')
call ada#Map_Menu (
\'Highlight.Toggle Standard Types',
\ ':AdaTypes',
\'call ada#Switch_Syntax_Option (''standard_types'')')
endif
" 1}}}
" Reset cpoptions
let &cpoptions = s:cpoptions
unlet s:cpoptions
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=78 nowrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker

View File

@@ -1,23 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'alsaconf', 'ftplugin/alsaconf.vim')
finish
endif
" Vim filetype plugin file
" Language: alsaconf(8) configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1,48 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'ant', 'ftplugin/ant.vim')
finish
endif
" Vim filetype plugin file
" Language: ant
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
" Last Changed: 20 Jan 2009
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
if exists("b:did_ftplugin") | finish | endif
" Make sure the continuation lines below do not cause problems in
" compatibility mode.
let s:save_cpo = &cpo
set cpo-=C
" Define some defaults in case the included ftplugins don't set them.
let s:undo_ftplugin = ""
let s:browsefilter = "XML Files (*.xml)\t*.xml\n" .
\ "All Files (*.*)\t*.*\n"
runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim
let b:did_ftplugin = 1
" Override our defaults if these were set by an included ftplugin.
if exists("b:undo_ftplugin")
let s:undo_ftplugin = b:undo_ftplugin
endif
if exists("b:browsefilter")
let s:browsefilter = b:browsefilter
endif
" Change the :browse e filter to primarily show Ant-related files.
if has("gui_win32")
let b:browsefilter = "Build Files (build.xml)\tbuild.xml\n" .
\ "Java Files (*.java)\t*.java\n" .
\ "Properties Files (*.prop*)\t*.prop*\n" .
\ "Manifest Files (*.mf)\t*.mf\n" .
\ s:browsefilter
endif
" Undo the stuff we changed.
let b:undo_ftplugin = "unlet! b:browsefilter | " . s:undo_ftplugin
" Restore the saved compatibility options.
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@@ -1,23 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'arch', 'ftplugin/arch.vim')
finish
endif
" Vim filetype plugin file
" Language: GNU Arch inventory file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1,19 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'art', 'ftplugin/art.vim')
finish
endif
" Vim filetype plugin
" Language: ART-IM and ART*Enterprise
" Maintainer: Dorai Sitaram <ds26@gte.com>
" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
" Last Change: Apr 2, 2003
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
run ftplugin/lisp.vim
setl lw-=if
setl lw+=def-art-fun,deffacts,defglobal,defrule,defschema,for,schema,while

View File

@@ -1,64 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'aspvbs', 'ftplugin/aspvbs.vim')
finish
endif
" Vim filetype plugin file
" Language: aspvbs
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
" Last Changed: 20 Jan 2009
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
if exists("b:did_ftplugin") | finish | endif
" Make sure the continuation lines below do not cause problems in
" compatibility mode.
let s:save_cpo = &cpo
set cpo-=C
" Define some defaults in case the included ftplugins don't set them.
let s:undo_ftplugin = ""
let s:browsefilter = "HTML Files (*.html, *.htm)\t*.htm*\n" .
\ "All Files (*.*)\t*.*\n"
let s:match_words = ""
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
let b:did_ftplugin = 1
" Override our defaults if these were set by an included ftplugin.
if exists("b:undo_ftplugin")
let s:undo_ftplugin = b:undo_ftplugin
endif
if exists("b:browsefilter")
let s:browsefilter = b:browsefilter
endif
if exists("b:match_words")
let s:match_words = b:match_words
endif
" ASP: Active Server Pages (with Visual Basic Script)
" thanks to Gontran BAERTS
if exists("loaded_matchit")
let s:notend = '\%(\<end\s\+\)\@<!'
let b:match_ignorecase = 1
let b:match_words =
\ s:notend . '\<if\>\%(.\{-}then\s\+\w\)\@!:\<elseif\>:^\s*\<else\>:\<end\s\+\<if\>,' .
\ s:notend . '\<select\s\+case\>:\<case\>:\<case\s\+else\>:\<end\s\+select\>,' .
\ '^\s*\<sub\>:\<end\s\+sub\>,' .
\ '^\s*\<function\>:\<end\s\+function\>,' .
\ '\<class\>:\<end\s\+class\>,' .
\ '^\s*\<do\>:\<loop\>,' .
\ '^\s*\<for\>:\<next\>,' .
\ '\<while\>:\<wend\>,' .
\ s:match_words
endif
" Change the :browse e filter to primarily show ASP-related files.
if has("gui_win32")
let b:browsefilter="ASP Files (*.asp)\t*.asp\n" . s:browsefilter
endif
let b:undo_ftplugin = "unlet! b:match_words b:match_ignorecase b:browsefilter | " . s:undo_ftplugin
" Restore the saved compatibility options.
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@@ -1,20 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'automake', 'ftplugin/automake.vim')
finish
endif
" Vim filetype plugin file
" Language: Automake
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
runtime! ftplugin/make.vim ftplugin/make_*.vim ftplugin/make/*.vim
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1,60 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'awk', 'ftplugin/awk.vim')
finish
endif
" Vim filetype plugin
" Language: awk, nawk, gawk, mawk
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: Antonio Colombo <azc100@gmail.com>
" Last Change: 2020 Sep 28
" This plugin was prepared by Mark Sikora
" This plugin was updated as proposed by Doug Kearns
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
setlocal comments=:#
setlocal commentstring=#\ %s
setlocal formatoptions-=t formatoptions+=croql
setlocal define=function
setlocal suffixesadd+=.awk
let b:undo_ftplugin = "setl fo< com< cms< def< sua<" .
\ " | unlet! b:browsefilter"
" TODO: set this in scripts.vim?
if exists("g:awk_is_gawk")
setlocal include=@include
setlocal suffixesadd+=.gawk
if has("unix") || has("win32unix")
setlocal formatprg=gawk\ -f-\ -o/dev/stdout
let b:undo_ftplugin .= " | setl fp<"
endif
let path = system("gawk 'BEGIN { printf ENVIRON[\"AWKPATH\"] }'")
let path = substitute(path, '^\.\=:\|:\.\=$\|:\.\=:', ',,', 'g') " POSIX cwd
let path = substitute(path, ':', ',', 'g')
let &l:path = path
let b:undo_ftplugin .= " | setl inc< path<"
endif
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "Awk Source Files (*.awk,*.gawk)\t*.awk;*.gawk\n" .
\ "All Files (*.*)\t*.*\n"
endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: nowrap sw=2 sts=2 ts=8

View File

@@ -1,60 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'basic', 'ftplugin/basic.vim')
finish
endif
" Vim filetype plugin file
" Language: BASIC (QuickBASIC 4.5)
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Last Change: 2021 Mar 16
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
setlocal comments=:REM\ ,:Rem\ ,:rem\ ,:'
setlocal commentstring='\ %s
setlocal formatoptions-=t formatoptions+=croql
" TODO: support exit ... as middle matches?
if exists("loaded_matchit") && !exists("b:match_words")
let s:line_start = '\%(^\s*\)\@<='
let s:not_end = '\%(end\s\+\)\@<!'
let s:not_end_or_exit = '\%(\%(end\|exit\)\s\+\)\@<!'
let b:match_ignorecase = 1
let b:match_words =
\ s:not_end_or_exit .. '\<def\s\+fn:\<end\s\+def\>,' ..
\ s:not_end_or_exit .. '\<function\>:\<end\s\+function\>,' ..
\ s:not_end_or_exit .. '\<sub\>:\<end\s\+sub\>,' ..
\ s:not_end .. '\<type\>:\<end\s\+type\>,' ..
\ s:not_end .. '\<select\>:\%(select\s\+\)\@<!\<case\%(\s\+\%(else\|is\)\)\=\>:\<end\s\+select\>,' ..
\ '\<do\>:\<loop\>,' ..
\ '\<for\>\%(\s\+\%(input\|output\|random\|append\|binary\)\)\@!:\<next\>,' ..
\ '\<while\>:\<wend\>,' ..
\ s:line_start .. 'if\%(.*\<then\s*\%($\|''\)\)\@=:\<\%(' .. s:line_start .. 'else\|elseif\)\>:\<end\s\+if\>,' ..
\ '\<lock\>:\<unlock\>'
let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string" || ' ..
\ 'strpart(getline("."), 0, col(".") ) =~? "\\<exit\\s\\+"'
unlet s:line_start s:not_end s:not_end_or_exit
endif
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" ..
\ "BASIC Include Files (*.bi, *.bm)\t*.bi;*.bm\n" ..
\ "All Files (*.*)\t*.*\n"
endif
let b:undo_ftplugin = "setl fo< com< cms<" ..
\ " | unlet! b:match_ignorecase b:match_skip b:match_words" ..
\ " | unlet! b:browsefilter"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:

View File

@@ -1,24 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bdf', 'ftplugin/bdf.vim')
finish
endif
" Vim filetype plugin file
" Language: BDF font definition
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=b:COMMENT commentstring=COMMENT\ %s
setlocal formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save

21
ftplugin/bicep.vim Normal file
View 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

View File

@@ -1,19 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bst', 'ftplugin/bst.vim')
finish
endif
" Vim filetype plugin file
" Language: bst
" Author: Tim Pope <vimNOSPAM@tpope.info>
" $Id: bst.vim,v 1.1 2007/05/05 17:37:57 vimboss Exp $
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal commentstring=%\ %s
setlocal comments=:%
setlocal fo-=t fo+=croql
let b:undo_ftplugin = "setlocal com< cms< fo<"

View File

@@ -1,100 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bzl', 'ftplugin/bzl.vim')
finish
endif
" Vim filetype plugin file
" Language: Bazel (http://bazel.io)
" Maintainer: David Barnett (https://github.com/google/vim-ft-bzl)
" Last Change: 2021 Jan 19
""
" @section Introduction, intro
" Core settings for the bzl filetype, used for BUILD and *.bzl files for the
" Bazel build system (http://bazel.io/).
if exists('b:did_ftplugin')
finish
endif
" Vim 7.4.051 has opinionated settings in ftplugin/python.vim that try to force
" PEP8 conventions on every python file, but these conflict with Google's
" indentation guidelines. As a workaround, we explicitly source the system
" ftplugin, but save indentation settings beforehand and restore them after.
let s:save_expandtab = &l:expandtab
let s:save_shiftwidth = &l:shiftwidth
let s:save_softtabstop = &l:softtabstop
let s:save_tabstop = &l:tabstop
" NOTE: Vim versions before 7.3.511 had a ftplugin/python.vim that was broken
" for compatible mode.
let s:save_cpo = &cpo
set cpo&vim
" Load base python ftplugin (also defines b:did_ftplugin).
source $VIMRUNTIME/ftplugin/python.vim
" NOTE: Vim versions before 7.4.104 and later set this in ftplugin/python.vim.
setlocal comments=b:#,fb:-
" Restore pre-existing indentation settings.
let &l:expandtab = s:save_expandtab
let &l:shiftwidth = s:save_shiftwidth
let &l:softtabstop = s:save_softtabstop
let &l:tabstop = s:save_tabstop
setlocal formatoptions-=t
" Make gf work with imports in BUILD files.
setlocal includeexpr=substitute(v:fname,'//','','')
" Enable syntax-based folding, if specified.
if get(g:, 'ft_bzl_fold', 0)
setlocal foldmethod=syntax
setlocal foldtext=BzlFoldText()
endif
if exists('*BzlFoldText')
let &cpo = s:save_cpo
unlet s:save_cpo
finish
endif
function BzlFoldText() abort
let l:start_num = nextnonblank(v:foldstart)
let l:end_num = prevnonblank(v:foldend)
if l:end_num <= l:start_num + 1
" If the fold is empty, don't print anything for the contents.
let l:content = ''
else
" Otherwise look for something matching the content regex.
" And if nothing matches, print an ellipsis.
let l:content = '...'
for l:line in getline(l:start_num + 1, l:end_num - 1)
let l:content_match = matchstr(l:line, '\m\C^\s*name = \zs.*\ze,$')
if !empty(l:content_match)
let l:content = l:content_match
break
endif
endfor
endif
" Enclose content with start and end
let l:start_text = getline(l:start_num)
let l:end_text = substitute(getline(l:end_num), '^\s*', '', '')
let l:text = l:start_text . ' ' . l:content . ' ' . l:end_text
" Compute the available width for the displayed text.
let l:width = winwidth(0) - &foldcolumn - (&number ? &numberwidth : 0)
let l:lines_folded = ' ' . string(1 + v:foldend - v:foldstart) . ' lines'
" Expand tabs, truncate, pad, and concatenate
let l:text = substitute(l:text, '\t', repeat(' ', &tabstop), 'g')
let l:text = strpart(l:text, 0, l:width - len(l:lines_folded))
let l:padding = repeat(' ', l:width - len(l:lines_folded) - len(l:text))
return l:text . l:padding . l:lines_folded
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@@ -2,8 +2,9 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'caddyfile', 'ftplugin/caddyfi
finish finish
endif endif
" Language: Caddyfile " Language: Caddyfile
" Author: Josh Glendenning <josh@isobit.io> " Maintainer: 0az <0az@afzhou.com>
" Original Author: Josh Glendenning <josh@isobit.io>
if exists('b:did_ftplugin') if exists('b:did_ftplugin')
finish finish
@@ -20,7 +21,7 @@ if exists('g:NERDDelimiterMap')
endif endif
elseif exists('g:NERDCustomDelimiters') elseif exists('g:NERDCustomDelimiters')
if !has_key(g:NERDCustomDelimiters, 'caddyfile') if !has_key(g:NERDCustomDelimiters, 'caddyfile')
let g:NERDDelimiterMap.caddyfile = s:delimiters let g:NERDCustomDelimiters.caddyfile = s:delimiters
endif endif
else else
let g:NERDCustomDelimiters = {'caddyfile': s:delimiters} let g:NERDCustomDelimiters = {'caddyfile': s:delimiters}

View File

@@ -1,24 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'calendar', 'ftplugin/calendar.vim')
finish
endif
" Vim filetype plugin file
" Language: calendar(1) input file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< inc< fo<"
setlocal comments=s1:/*,mb:*,ex:*/ commentstring& include&
setlocal formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1,22 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'cdrdaoconf', 'ftplugin/cdrdaoconf.vim')
finish
endif
" Vim filetype plugin file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2007-12-04
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1,23 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'cfg', 'ftplugin/cfg.vim')
finish
endif
" Vim filetype plugin file
" Language: Configuration File
" Maintainer: Christian Brabandt <cb@256bit.org>
" Latest Revision: 2018-12-24
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl cms< fo<"
setlocal commentstring=#\ %s formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1,21 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'ch', 'ftplugin/ch.vim')
finish
endif
" Vim filetype plugin file
" Language: Ch
" Maintainer: SoftIntegration, Inc. <info@softintegration.com>
" URL: http://www.softintegration.com/download/vim/ftplugin/ch.vim
" Last change: 2004 May 16
" Created based on cpp.vim
"
" Ch is a C/C++ interpreter with many high level extensions
"
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
" Behaves just like C
runtime! ftplugin/c.vim ftplugin/c_*.vim ftplugin/c/*.vim

View File

@@ -1,273 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'cobol', 'ftplugin/cobol.vim')
finish
endif
" Vim filetype plugin file
" Language: cobol
" Maintainer: Ankit Jain <ajatkj@yahoo.co.in>
" (formerly Tim Pope <vimNOSPAM@tpope.info>)
" Last Update: By Ankit Jain (add gtk support) on 15.08.2020
" Insert mode mappings: <C-T> <C-D> <Tab>
" Normal mode mappings: < > << >> [[ ]] [] ][
" Visual mode mappings: < >
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
setlocal commentstring=\ \ \ \ \ \ *%s
setlocal comments=:*
setlocal fo+=croqlt
setlocal expandtab
setlocal textwidth=72
" matchit support
if exists("loaded_matchit")
let s:ordot = '\|\ze\.\%( \@=\|$\)'
let b:match_ignorecase=1
"let b:match_skip = 'getline(".") =~ "^.\\{6\\}[*/C]"'
let b:match_words=
\ '\$if\>:$else\>:\$endif\>,' .
\ '[$-]\@<!\<if\>:\<\%(then\|else\)\>:\<end-if\>'.s:ordot.',' .
\ '-\@<!\<perform\s\+\%(\d\+\s\+times\|until\|varying\|with\s\+test\)\>:\<end-perform\>'.s:ordot . ',' .
\ '-\@<!\<\%(search\|evaluate\)\>:\<\%(when\)\>:\<end-\%(search\|evaluate\)\>' .s:ordot . ',' .
\ '-\@<!\<\%(add\|compute\|divide\|multiply\|subtract\)\>\%(.*\(\%$\|\%(\n\%(\%(\s*\|.\{6\}\)[*/].*\n\)*\)\=\s*\%(not\s\+\)\=on\s\+size\s\+error\>\)\)\@=:\%(\<not\s\+\)\@<!\<\%(not\s\+\)\=on\s\+size\s\+error\>:\<end-\%(add\|compute\|divide\|multiply\|subtract\)\>' .s:ordot . ',' .
\ '-\@<!\<\%(string\|unstring\|accept\|display\|call\)\>\%(.*\(\%$\|\%(\n\%(\%(\s*\|.\{6\}\)[*/].*\n\)*\)\=\s*\%(not\s\+\)\=on\s\+\%(overflow\|exception\)\>\)\)\@=:\%(\<not\s\+\)\@<!\<\%(not\s\+\)\=on\s\+\%(overflow\|exception\)\>:\<end-\%(string\|unstring\|accept\|display\|call\)\>' .s:ordot . ',' .
\ '-\@<!\<\%(delete\|rewrite\|start\|write\|read\)\>\%(.*\(\%$\|\%(\n\%(\%(\s*\|.\{6\}\)[*/].*\n\)*\)\=\s*\%(invalid\s\+key\|at\s\+end\|no\s\+data\|at\s\+end-of-page\)\>\)\)\@=:\%(\<not\s\+\)\@<!\<\%(not\s\+\)\=\%(invalid\s\+key\|at\s\+end\|no\s\+data\|at\s\+end-of-page\)\>:\<end-\%(delete\|rewrite\|start\|write\|read\)\>' .s:ordot
endif
" add gtk support
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "COBOL Source Files (*.cbl, *.cob)\t*.cbl;*.cob;*.lib\n".
\ "All Files (*.*)\t*.*\n"
endif
let b:undo_ftplugin = "setlocal com< cms< fo< et< tw<" .
\ " | unlet! b:browsefilter b:match_words b:match_ignorecase b:match_skip"
if !exists("g:no_plugin_maps") && !exists("g:no_cobol_maps")
let b:undo_ftplugin = b:undo_ftplugin .
\ " | sil! exe 'nunmap <buffer> <'" .
\ " | sil! exe 'nunmap <buffer> >'" .
\ " | sil! exe 'nunmap <buffer> <<'" .
\ " | sil! exe 'nunmap <buffer> >>'" .
\ " | sil! exe 'vunmap <buffer> <'" .
\ " | sil! exe 'vunmap <buffer> >'" .
\ " | sil! exe 'iunmap <buffer> <C-D>'" .
\ " | sil! exe 'iunmap <buffer> <C-T>'" .
\ " | sil! exe 'iunmap <buffer> <Tab>'" .
\ " | sil! exe 'nunmap <buffer> <Plug>Traditional'" .
\ " | sil! exe 'nunmap <buffer> <Plug>Comment'" .
\ " | sil! exe 'nunmap <buffer> <Plug>DeComment'" .
\ " | sil! exe 'vunmap <buffer> <Plug>VisualTraditional'" .
\ " | sil! exe 'vunmap <buffer> <Plug>VisualComment'" .
\ " | sil! exe 'iunmap <buffer> <Plug>VisualDeComment'" .
\ " | sil! exe 'unmap <buffer> [['" .
\ " | sil! exe 'unmap <buffer> ]]'" .
\ " | sil! exe 'unmap <buffer> []'" .
\ " | sil! exe 'unmap <buffer> ]['"
endif
if !exists("g:no_plugin_maps") && !exists("g:no_cobol_maps")
if version >= 700
nnoremap <silent> <buffer> > :set opfunc=<SID>IncreaseFunc<CR>g@
nnoremap <silent> <buffer> < :set opfunc=<SID>DecreaseFunc<CR>g@
endif
nnoremap <silent> <buffer> >> :call CobolIndentBlock(1)<CR>
nnoremap <silent> <buffer> << :call CobolIndentBlock(-1)<CR>
vnoremap <silent> <buffer> > :call CobolIndentBlock(v:count1)<CR>
vnoremap <silent> <buffer> < :call CobolIndentBlock(-v:count1)<CR>
inoremap <silent> <buffer> <C-T> <C-R>=<SID>IncreaseIndent()<CR><C-R>=<SID>RestoreShiftwidth()<CR>
inoremap <silent> <buffer> <C-D> <C-R>=<SID>DecreaseIndent()<CR><C-R>=<SID>RestoreShiftwidth()<CR>
if !maparg("<Tab>","i")
inoremap <silent> <buffer> <Tab> <C-R>=<SID>Tab()<CR><C-R>=<SID>RestoreShiftwidth()<CR>
endif
noremap <silent> <buffer> [[ m':call search('\c^\%(\s*\<Bar>.\{6\}\s\+\)\zs[A-Za-z0-9-]\+\s\+\%(division\<Bar>section\)\s*\.','bW')<CR>
noremap <silent> <buffer> ]] m':call search('\c^\%(\s*\<Bar>.\{6\}\s\+\)\zs[A-Za-z0-9-]\+\s\+\%(division\<Bar>section\)\.','W')<CR>
noremap <silent> <buffer> [] m':call <SID>toend('b')<CR>
noremap <silent> <buffer> ][ m':call <SID>toend('')<CR>
" For EnhancedCommentify
noremap <silent> <buffer> <Plug>Traditional :call <SID>Comment('t')<CR>
noremap <silent> <buffer> <Plug>Comment :call <SID>Comment('c')<CR>
noremap <silent> <buffer> <Plug>DeComment :call <SID>Comment('u')<CR>
noremap <silent> <buffer> <Plug>VisualTraditional :'<,'>call <SID>Comment('t')<CR>
noremap <silent> <buffer> <Plug>VisualComment :'<,'>call <SID>Comment('c')<CR>
noremap <silent> <buffer> <Plug>VisualDeComment :'<,'>call <SID>Comment('u')<CR>
endif
let &cpo = s:cpo_save
unlet s:cpo_save
if exists("g:did_cobol_ftplugin_functions")
finish
endif
let g:did_cobol_ftplugin_functions = 1
function! s:repeat(str,count)
let i = 0
let ret = ""
while i < a:count
let ret = ret . a:str
let i = i + 1
endwhile
return ret
endfunction
function! s:increase(...)
let lnum = '.'
let sw = shiftwidth()
let i = a:0 ? a:1 : indent(lnum)
if i >= 11
return sw - (i - 11) % sw
elseif i >= 7
return 11-i
elseif i == 6
return 1
else
return 6-i
endif
endfunction
function! s:decrease(...)
let lnum = '.'
let sw = shiftwidth()
let i = indent(a:0 ? a:1 : lnum)
if i >= 11 + sw
return 1 + (i + 12) % sw
elseif i > 11
return i-11
elseif i > 7
return i-7
elseif i == 7
return 1
else
return i
endif
endfunction
function! CobolIndentBlock(shift)
let head = strpart(getline('.'),0,7)
let tail = strpart(getline('.'),7)
let indent = match(tail,'[^ ]')
let sw = shiftwidth()
let shift = a:shift
if shift > 0
if indent < 4
let tail = s:repeat(" ",4-indent).tail
let shift = shift - 1
endif
let tail = s:repeat(" ",shift*sw).tail
let shift = 0
elseif shift < 0
if (indent-4) > -shift * sw
let tail = strpart(tail,-shift * sw)
elseif (indent-4) > (-shift-1) * sw
let tail = strpart(tail,indent - 4)
else
let tail = strpart(tail,indent)
endif
endif
call setline('.',head.tail)
endfunction
function! s:IncreaseFunc(type)
'[,']call CobolIndentBlock(1)
endfunction
function! s:DecreaseFunc(type)
'[,']call CobolIndentBlock(-1)
endfunction
function! s:IncreaseIndent()
let c = "\<C-T>"
if exists("*InsertCtrlTWrapper")
let key = InsertCtrlTWrapper()
if key != c
return key
endif
endif
let interval = s:increase()
let b:cobol_shiftwidth = &shiftwidth
let &shiftwidth = 1
let lastchar = strpart(getline('.'),col('.')-2,1)
if lastchar == '0' || lastchar == '^'
return "\<BS>".lastchar.c
else
return s:repeat(c,interval)
endif
endfunction
function! s:DecreaseIndent()
let c = "\<C-D>"
if exists("*InsertCtrlDWrapper")
" I hack Ctrl-D to delete when not at the end of the line.
let key = InsertCtrlDWrapper()
if key != c
return key
endif
endif
let interval = s:decrease()
let b:cobol_shiftwidth = &shiftwidth
let &shiftwidth = 1
return s:repeat(c,interval)
endfunction
function! s:RestoreShiftwidth()
if exists("b:cobol_shiftwidth")
let &shiftwidth=b:cobol_shiftwidth
unlet b:cobol_shiftwidth
endif
return ""
endfunction
function! s:Tab()
if (strpart(getline('.'),0,col('.')-1) =~ '^\s*$' && &sta)
return s:IncreaseIndent()
" &softtabstop < 0: &softtabstop follows &shiftwidth
elseif (&sts < 0 || &sts == shiftwidth()) && &sts != 8 && &et
return s:repeat(" ",s:increase(col('.')-1))
else
return "\<Tab>"
endif
endfunction
function! s:Comment(arg)
" For EnhancedCommentify
let line = getline('.')
if (line =~ '^.\{6\}[*/C]' || a:arg == 'c') && a:arg != 'u'
let line = substitute(line,'^.\{6\}\zs.',' ','')
else
let line = substitute(line,'^.\{6\}\zs.','*','')
endif
call setline('.',line)
endfunction
function! s:toend(direction)
let ignore = '^\(\s*\|.\{6\}\)\%([*/]\|\s*$\)'
let keep = line('.')
keepjumps +
while line('.') < line('$') && getline('.') =~ ignore
keepjumps +
endwhile
let res = search('\c^\%(\s*\|.\{6\}\s\+\)\zs[A-Za-z0-9-]\+\s\+\%(division\|section\)\s*\.',a:direction.'W')
if a:direction != 'b' && !res
let res = line('$')
keepjumps $
elseif res
keepjumps -
endif
if res
while line('.') > 1 && getline('.') =~ ignore
keepjumps -
endwhile
if line('.') == 1 && getline('.') =~ ignore
exe "keepjumps ".keep
endif
else
exe "keepjumps ".keep
endif
endfunction

View File

@@ -1,23 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'conf', 'ftplugin/conf.vim')
finish
endif
" Vim filetype plugin file
" Language: generic configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1,46 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'config', 'ftplugin/config.vim')
finish
endif
" Vim filetype plugin file
" Language: config
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
" Last Changed: 20 Jan 2009
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
if exists("b:did_ftplugin") | finish | endif
" Make sure the continuation lines below do not cause problems in
" compatibility mode.
let s:save_cpo = &cpo
set cpo-=C
" Define some defaults in case the included ftplugins don't set them.
let s:undo_ftplugin = ""
let s:browsefilter = "Bourne Shell Files (*.sh)\t*.sh\n" .
\ "All Files (*.*)\t*.*\n"
let s:match_words = ""
runtime! ftplugin/sh.vim ftplugin/sh_*.vim ftplugin/sh/*.vim
let b:did_ftplugin = 1
" Override our defaults if these were set by an included ftplugin.
if exists("b:undo_ftplugin")
let s:undo_ftplugin = b:undo_ftplugin
endif
if exists("b:browsefilter")
let s:browsefilter = b:browsefilter
endif
" Change the :browse e filter to primarily show configure-related files.
if has("gui_win32")
let b:browsefilter="Configure Scripts (configure.*, config.*)\tconfigure*;config.*\n" .
\ s:browsefilter
endif
" Undo the stuff we changed.
let b:undo_ftplugin = "unlet! b:browsefilter | " . b:undo_ftplugin
" Restore the saved compatibility options.
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@@ -1,23 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'crm', 'ftplugin/crm.vim')
finish
endif
" Vim filetype plugin file
" Language: CRM114
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -53,7 +53,7 @@ if get(g:, 'crystal_define_mappings', 1)
nmap <buffer>gsc <Plug>(crystal-spec-run-current) nmap <buffer>gsc <Plug>(crystal-spec-run-current)
endif endif
if &l:ofu ==# '' if &l:ofu ==# '' && get(g:, 'crystal_enable_completion', 1)
setlocal omnifunc=crystal_lang#complete setlocal omnifunc=crystal_lang#complete
endif endif
@@ -62,7 +62,7 @@ if exists('g:loaded_matchit') && !exists('b:match_words')
let b:match_ignorecase = 0 let b:match_ignorecase = 0
let b:match_words = 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\)\>' . \ '\<\%(else\|elsif\|ensure\|when\|in\|rescue\|break\|next\)\>' .
\ ':' . \ ':' .

View File

@@ -1,33 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'cs', 'ftplugin/cs.vim')
finish
endif
" Vim filetype plugin file
" Language: C#
" Maintainer: Johannes Zellner <johannes@zellner.org>
" Last Change: Tue, 09 Mar 2004 14:09:33 CET
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
let s:keepcpo= &cpo
set cpo&vim
" Set 'formatoptions' to break comment lines but not other lines,
" and insert the comment leader when hitting <CR> or using "o".
setlocal fo-=t fo+=croql
" Set 'comments' to format dashed lists in comments.
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "C# Source Files (*.cs)\t*.cs\n" .
\ "All Files (*.*)\t*.*\n"
endif
let &cpo = s:keepcpo
unlet s:keepcpo

View File

@@ -1,31 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'csc', 'ftplugin/csc.vim')
finish
endif
" Vim filetype plugin file
" Language: csc
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
" Last Changed: 20 Jan 2009
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1
" Make sure the continuation lines below do not cause problems in
" compatibility mode.
let s:save_cpo = &cpo
set cpo-=C
if exists("loaded_matchit")
let b:match_words=
\ '\<fix\>:\<endfix\>,' .
\ '\<if\>:\<else\%(if\)\=\>:\<endif\>,' .
\ '\<!loopondimensions\>\|\<!looponselected\>:\<!endloop\>'
endif
" Undo the stuff we changed.
let b:undo_ftplugin = "unlet! b:match_words"
" Restore the saved compatibility options.
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@@ -1,29 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'css', 'ftplugin/css.vim')
finish
endif
" Vim filetype plugin file
" Language: CSS
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Last Change: 2020 Dec 21
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< inc< fo< ofu< isk<"
setlocal comments=s1:/*,mb:*,ex:*/ commentstring&
setlocal formatoptions-=t formatoptions+=croql
setlocal omnifunc=csscomplete#CompleteCSS
setlocal iskeyword+=-
let &l:include = '^\s*@import\s\+\%(url(\)\='
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1,23 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'cvsrc', 'ftplugin/cvsrc.vim')
finish
endif
" Vim filetype plugin file
" Language: cvs(1) RC file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments= commentstring= formatoptions-=tcroql
let &cpo = s:cpo_save
unlet s:cpo_save

View File

@@ -1,387 +0,0 @@
if polyglot#init#is_disabled(expand('<sfile>:p'), 'debchangelog', 'ftplugin/debchangelog.vim')
finish
endif
" Vim filetype plugin file (GUI menu, folding and completion)
" Language: Debian Changelog
" Maintainer: Debian Vim Maintainers
" Former Maintainers: Michael Piefel <piefel@informatik.hu-berlin.de>
" Stefano Zacchiroli <zack@debian.org>
" Last Change: 2018-01-28
" License: Vim License
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debchangelog.vim
" Bug completion requires apt-listbugs installed for Debian packages or
" python-launchpadlib installed for Ubuntu packages
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin=1
" {{{1 Local settings (do on every load)
if exists('g:debchangelog_fold_enable')
setlocal foldmethod=expr
setlocal foldexpr=DebGetChangelogFold(v:lnum)
setlocal foldtext=DebChangelogFoldText()
endif
" Debian changelogs are not supposed to have any other text width,
" so the user cannot override this setting
setlocal tw=78
setlocal comments=f:*
" Clean unloading
let b:undo_ftplugin = 'setlocal tw< comments< foldmethod< foldexpr< foldtext<'
" }}}1
if exists('g:did_changelog_ftplugin')
finish
endif
" Don't load another plugin (this is global)
let g:did_changelog_ftplugin = 1
" {{{1 GUI menu
" Helper functions returning various data.
" Returns full name, either from $DEBFULLNAME or debianfullname.
" TODO Is there a way to determine name from anywhere else?
function <SID>FullName()
if exists('$DEBFULLNAME')
return $DEBFULLNAME
elseif exists('g:debianfullname')
return g:debianfullname
else
return 'Your Name'
endif
endfunction
" Returns email address, from $DEBEMAIL, $EMAIL or debianemail.
function <SID>Email()
if exists('$DEBEMAIL')
return $DEBEMAIL
elseif exists('$EMAIL')
return $EMAIL
elseif exists('g:debianemail')
return g:debianemail
else
return 'your@email.address'
endif
endfunction
" Returns date in RFC822 format.
function <SID>Date()
let savelang = v:lc_time
execute 'language time C'
let dateandtime = strftime('%a, %d %b %Y %X %z')
execute 'language time ' . savelang
return dateandtime
endfunction
function <SID>WarnIfNotUnfinalised()
if match(getline('.'), ' -- [[:alpha:]][[:alnum:].]')!=-1
echohl WarningMsg
echo 'The entry has not been unfinalised before editing.'
echohl None
return 1
endif
return 0
endfunction
function <SID>Finalised()
let savelinenum = line('.')
1
call search('^ -- ')
if match(getline('.'), ' -- [[:alpha:]][[:alnum:].]')!=-1
let returnvalue = 1
else
let returnvalue = 0
endif
execute savelinenum
return returnvalue
endfunction
" These functions implement the menus
function NewVersion()
" The new entry is unfinalised and shall be changed
amenu disable Changelog.New\ Version
amenu enable Changelog.Add\ Entry
amenu enable Changelog.Close\ Bug
amenu enable Changelog.Set\ Distribution
amenu enable Changelog.Set\ Urgency
amenu disable Changelog.Unfinalise
amenu enable Changelog.Finalise
call append(0, substitute(getline(1), '-\([[:digit:]]\+\))', '-$$\1)', ''))
call append(1, '')
call append(2, '')
call append(3, ' -- ')
call append(4, '')
call Urgency('low')
normal! 1G0
call search(')')
normal! h
normal! 
call setline(1, substitute(getline(1), '-\$\$', '-', ''))
if exists('g:debchangelog_fold_enable')
foldopen
endif
call AddEntry()
endfunction
function AddEntry()
1
call search('^ -- ')
.-2
call append('.', ' * ')
.+3
let warn=<SID>WarnIfNotUnfinalised()
.-2
if warn
echohl MoreMsg
call input('Hit ENTER')
echohl None
endif
startinsert!
endfunction
function CloseBug()
1
call search('^ -- ')
let warn=<SID>WarnIfNotUnfinalised()
.-2
call append('.', ' * (closes: #' . input('Bug number to close: ') . ')')
normal! j^ll
startinsert
endfunction
function Distribution(dist)
call setline(1, substitute(getline(1), ') *\%(UNRELEASED\|\l\+\);', ') ' . a:dist . ';', ''))
endfunction
function Urgency(urg)
call setline(1, substitute(getline(1), 'urgency=.*$', 'urgency=' . a:urg, ''))
endfunction
function <SID>UnfinaliseMenu()
" This means the entry shall be changed
amenu disable Changelog.New\ Version
amenu enable Changelog.Add\ Entry
amenu enable Changelog.Close\ Bug
amenu enable Changelog.Set\ Distribution
amenu enable Changelog.Set\ Urgency
amenu disable Changelog.Unfinalise
amenu enable Changelog.Finalise
endfunction
function Unfinalise()
call <SID>UnfinaliseMenu()
1
call search('^ -- ')
call setline('.', ' -- ')
endfunction
function <SID>FinaliseMenu()
" This means the entry should not be changed anymore
amenu enable Changelog.New\ Version
amenu disable Changelog.Add\ Entry
amenu disable Changelog.Close\ Bug
amenu disable Changelog.Set\ Distribution
amenu disable Changelog.Set\ Urgency
amenu enable Changelog.Unfinalise
amenu disable Changelog.Finalise
endfunction
function Finalise()
call <SID>FinaliseMenu()
1
call search('^ -- ')
call setline('.', ' -- ' . <SID>FullName() . ' <' . <SID>Email() . '> ' . <SID>Date())
endfunction
function <SID>MakeMenu()
amenu &Changelog.&New\ Version :call NewVersion()<CR>
amenu Changelog.&Add\ Entry :call AddEntry()<CR>
amenu Changelog.&Close\ Bug :call CloseBug()<CR>
menu Changelog.-sep- <nul>
amenu Changelog.Set\ &Distribution.&unstable :call Distribution("unstable")<CR>
amenu Changelog.Set\ Distribution.&frozen :call Distribution("frozen")<CR>
amenu Changelog.Set\ Distribution.&stable :call Distribution("stable")<CR>
menu Changelog.Set\ Distribution.-sep- <nul>
amenu Changelog.Set\ Distribution.frozen\ unstable :call Distribution("frozen unstable")<CR>
amenu Changelog.Set\ Distribution.stable\ unstable :call Distribution("stable unstable")<CR>
amenu Changelog.Set\ Distribution.stable\ frozen :call Distribution("stable frozen")<CR>
amenu Changelog.Set\ Distribution.stable\ frozen\ unstable :call Distribution("stable frozen unstable")<CR>
amenu Changelog.Set\ &Urgency.&low :call Urgency("low")<CR>
amenu Changelog.Set\ Urgency.&medium :call Urgency("medium")<CR>
amenu Changelog.Set\ Urgency.&high :call Urgency("high")<CR>
menu Changelog.-sep- <nul>
amenu Changelog.U&nfinalise :call Unfinalise()<CR>
amenu Changelog.&Finalise :call Finalise()<CR>
if <SID>Finalised()
call <SID>FinaliseMenu()
else
call <SID>UnfinaliseMenu()
endif
endfunction
augroup changelogMenu
au BufEnter * if &filetype == "debchangelog" | call <SID>MakeMenu() | endif
au BufLeave * if &filetype == "debchangelog" | silent! aunmenu Changelog | endif
augroup END
" }}}
" {{{1 folding
" look for an author name in the [zonestart zoneend] lines searching backward
function! s:getAuthor(zonestart, zoneend)
let linepos = a:zoneend
while linepos >= a:zonestart
let line = getline(linepos)
if line =~# '^ --'
return substitute(line, '^ --\s*\([^<]\+\)\s*.*', '\1', '')
endif
let linepos -= 1
endwhile
return '[unknown]'
endfunction
" Look for a package source name searching backward from the givenline and
" returns it. Return the empty string if the package name can't be found
function! DebGetPkgSrcName(lineno)
let lineidx = a:lineno
let pkgname = ''
while lineidx > 0
let curline = getline(lineidx)
if curline =~# '^\S'
let pkgname = matchlist(curline, '^\(\S\+\).*$')[1]
break
endif
let lineidx = lineidx - 1
endwhile
return pkgname
endfunction
function! DebChangelogFoldText()
if v:folddashes ==# '-' " changelog entry fold
return foldtext() . ' -- ' . s:getAuthor(v:foldstart, v:foldend) . ' '
endif
return foldtext()
endfunction
function! DebGetChangelogFold(lnum)
let line = getline(a:lnum)
if line =~# '^\w\+'
return '>1' " beginning of a changelog entry
endif
if line =~# '^\s\+\[.*\]'
return '>2' " beginning of an author-specific chunk
endif
if line =~# '^ --'
return '1'
endif
return '='
endfunction
if exists('g:debchangelog_fold_enable')
silent! foldopen! " unfold the entry the cursor is on (usually the first one)
endif
" }}}
" {{{1 omnicompletion for Closes: #
if !exists('g:debchangelog_listbugs_severities')
let g:debchangelog_listbugs_severities = 'critical,grave,serious,important,normal,minor,wishlist'
endif
fun! DebCompleteBugs(findstart, base)
if a:findstart
let line = getline('.')
" try to detect whether this is closes: or lp:
let g:debchangelog_complete_mode = 'debbugs'
let try_colidx = col('.') - 1
let colidx = -1 " default to no-completion-possible
while try_colidx > 0 && line[try_colidx - 1] =~# '\s\|\d\|#\|,\|:'
let try_colidx = try_colidx - 1
if line[try_colidx] ==# '#' && colidx == -1
" found hash, where we complete from:
let colidx = try_colidx
elseif line[try_colidx] ==# ':'
if try_colidx > 1 && strpart(line, try_colidx - 2, 3) =~? '\clp:'
let g:debchangelog_complete_mode = 'lp'
endif
break
endif
endwhile
return colidx
else " return matches:
let bug_lines = []
if g:debchangelog_complete_mode ==? 'lp'
if ! has('python')
echoerr 'vim must be built with Python support to use LP bug completion'
return
endif
let pkgsrc = DebGetPkgSrcName(line('.'))
python << EOF
import vim
try:
from launchpadlib.launchpad import Launchpad
from lazr.restfulclient.errors import HTTPError
# login anonymously
lp = Launchpad.login_anonymously('debchangelog.vim', 'production')
ubuntu = lp.distributions['ubuntu']
try:
sp = ubuntu.getSourcePackage(name=vim.eval('pkgsrc'))
status = ('New', 'Incomplete', 'Confirmed', 'Triaged',
'In Progress', 'Fix Committed')
tasklist = sp.searchTasks(status=status, order_by='id')
liststr = '['
for task in tasklist:
bug = task.bug
liststr += "'#%d - %s'," % (bug.id, bug.title.replace('\'', '\'\''))
liststr += ']'
vim.command('silent let bug_lines = %s' % liststr.encode('utf-8'))
except HTTPError:
pass
except ImportError:
vim.command('echoerr \'python-launchpadlib >= 1.5.4 needs to be installed to use Launchpad bug completion\'')
EOF
else
if ! filereadable('/usr/sbin/apt-listbugs')
echoerr 'apt-listbugs not found, you should install it to use Closes bug completion'
return
endif
let pkgsrc = DebGetPkgSrcName(line('.'))
let listbugs_output = system('/usr/sbin/apt-listbugs -s ' . g:debchangelog_listbugs_severities . ' list ' . pkgsrc . ' | grep "^ #" 2> /dev/null')
let bug_lines = split(listbugs_output, '\n')
endif
let completions = []
for line in bug_lines
let parts = matchlist(line, '^\s*\(#\S\+\)\s*-\s*\(.*\)$')
" filter only those which match a:base:
if parts[1] !~ '^' . a:base
continue
endif
let completion = {}
let completion['word'] = parts[1]
let completion['menu'] = parts[2]
let completion['info'] = parts[0]
let completions += [completion]
endfor
return completions
endif
endfun
setlocal omnifunc=DebCompleteBugs
" }}}
" vim: set foldmethod=marker:

Some files were not shown because too many files have changed in this diff Show More