Compare commits

..

8 Commits

Author SHA1 Message Date
Adam Stankiewicz
af3ebda710 Fix tests 2020-10-17 14:17:55 +02:00
Adam Stankiewicz
6b663ec330 Change implementation of observing, fixes #584 2020-10-17 13:49:45 +02:00
Adam Stankiewicz
6b9625ecd5 Fix detecting indentation, closes #590 2020-10-17 11:52:39 +02:00
Adam Stankiewicz
3383046210 Handle most warnings 2020-10-16 20:15:30 +02:00
Adam Stankiewicz
8f9e5ac70b Add extensions to the readme 2020-10-16 14:08:54 +02:00
Adam Stankiewicz
23d7b0931d Use language names instead of filetype names 2020-10-16 13:49:57 +02:00
Adam Stankiewicz
3ee6ab9d13 Update 2020-10-16 13:41:54 +02:00
Adam Stankiewicz
cd919c0039 Mention filetypes in the readme 2020-10-16 13:40:50 +02:00
38 changed files with 1819 additions and 1673 deletions

274
README.md
View File

@@ -7,7 +7,7 @@ A collection of language packs for Vim.
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
- It **installs and updates 120+ times faster** than the <!--Package Count-->593<!--/Package Count--> packages it consists of.
- It **installs and updates 120+ times faster** than the <!--Package Count-->598<!--/Package Count--> packages it consists of.
- It is more secure because scripts loaded for all extensions are generated by vim-polyglot (ftdetect).
- Solid syntax and indentation support (other features skipped). Only the best language packs.
- All unnecessary files are ignored (like enormous documentation from php support).
@@ -44,159 +44,159 @@ If you need full functionality of any plugin, please use it directly with your p
On top of all language packs from [vim repository](https://github.com/vim/vim/tree/master/runtime), vim-polyglot includes:
<!--Language Packs-->
- [acpiasl](https://github.com/martinlroth/vim-acpi-asl)
- [acpiasl](https://github.com/martinlroth/vim-acpi-asl) (Syntax highlighting for asl and dsl files)
- [ansible](https://github.com/pearofducks/ansible-vim)
- [apiblueprint](https://github.com/kylef/apiblueprint.vim)
- [applescript](https://github.com/mityu/vim-applescript)
- [arduino](https://github.com/sudar/vim-arduino-syntax)
- [asciidoc](https://github.com/asciidoc/vim-asciidoc)
- [autohotkey](https://github.com/hnamikaw/vim-autohotkey)
- [blade](https://github.com/jwalton512/vim-blade)
- [apiblueprint](https://github.com/kylef/apiblueprint.vim) (API Blueprint syntax highlighting for apib files)
- [applescript](https://github.com/mityu/vim-applescript) (AppleScript syntax highlighting for applescript and scpt 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)
- [autohotkey](https://github.com/hnamikaw/vim-autohotkey) (AutoHotkey syntax highlighting for ahk and ahkl files)
- [blade](https://github.com/jwalton512/vim-blade) (Blade syntax highlighting for blade and blade.php files)
- [brewfile](https://github.com/bfontaine/Brewfile.vim)
- [c/c++](https://github.com/vim-jp/vim-cpp)
- [c/c++](https://github.com/vim-jp/vim-cpp) (C++ and C syntax highlighting for cpp, c++, cc, cp, cxx and 17 more files)
- [caddyfile](https://github.com/isobit/vim-caddyfile)
- [carp](https://github.com/hellerve/carp-vim)
- [carp](https://github.com/hellerve/carp-vim) (Syntax highlighting for carp files)
- [cjsx](https://github.com/mtscout6/vim-cjsx)
- [clojure](https://github.com/guns/vim-clojure-static)
- [cmake](https://github.com/pboettch/vim-cmake-syntax)
- [coffee-script](https://github.com/kchmck/vim-coffee-script)
- [clojure](https://github.com/guns/vim-clojure-static) (Clojure syntax highlighting for clj, boot, cl2, cljc, cljs, cljs.hl, cljscm, cljx, hic and edn 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, litcoffee and coffee.md files)
- [cpp-modern](https://github.com/bfrg/vim-cpp-modern)
- [cql](https://github.com/elubow/cql-vim)
- [cryptol](https://github.com/victoredwardocallaghan/cryptol.vim)
- [crystal](https://github.com/rhysd/vim-crystal)
- [csv](https://github.com/chrisbra/csv.vim)
- [cucumber](https://github.com/tpope/vim-cucumber)
- [cue](https://github.com/mgrabovsky/vim-cuesheet)
- [dart](https://github.com/dart-lang/dart-vim-plugin)
- [dhall](https://github.com/vmchale/dhall-vim)
- [dlang](https://github.com/JesseKPhillips/d.vim)
- [dockerfile](https://github.com/ekalinin/Dockerfile.vim)
- [elixir](https://github.com/elixir-lang/vim-elixir)
- [elm](https://github.com/andys8/vim-elm-syntax)
- [emberscript](https://github.com/yalesov/vim-ember-script)
- [emblem](https://github.com/yalesov/vim-emblem)
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime)
- [fennel](https://github.com/bakpakin/fennel.vim)
- [ferm](https://github.com/vim-scripts/ferm.vim)
- [fish](https://github.com/georgewitteman/vim-fish)
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers)
- [fsharp](https://github.com/ionide/Ionide-vim)
- [gdscript](https://github.com/calviken/vim-gdscript3)
- [git](https://github.com/tpope/vim-git)
- [cql](https://github.com/elubow/cql-vim) (Syntax highlighting for cql files)
- [cryptol](https://github.com/victoredwardocallaghan/cryptol.vim) (Syntax highlighting for cry, cyl, lcry and lcyl files)
- [crystal](https://github.com/rhysd/vim-crystal) (Crystal and HTML+ECR syntax highlighting for cr and ecr files)
- [csv](https://github.com/chrisbra/csv.vim) (CSV syntax highlighting for csv, tsv and tab files)
- [cucumber](https://github.com/tpope/vim-cucumber) (Gherkin syntax highlighting for feature and story files)
- [cue](https://github.com/mgrabovsky/vim-cuesheet) (Syntax highlighting for cue files)
- [dart](https://github.com/dart-lang/dart-vim-plugin) (Dart syntax highlighting for dart and drt files)
- [dhall](https://github.com/vmchale/dhall-vim) (Dhall syntax highlighting for dhall files)
- [dlang](https://github.com/JesseKPhillips/d.vim) (D syntax highlighting for d, di, lst, dd, ddoc and sdl files)
- [docker-compose](https://github.com/ekalinin/Dockerfile.vim)
- [elixir](https://github.com/elixir-lang/vim-elixir) (Elixir and HTML+EEX syntax highlighting for ex, exs, eex and leex 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)
- [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)
- [fennel](https://github.com/bakpakin/fennel.vim) (Syntax highlighting for fnl files)
- [ferm](https://github.com/vim-scripts/ferm.vim) (Syntax highlighting for ferm files)
- [fish](https://github.com/georgewitteman/vim-fish) (fish syntax highlighting for fish files)
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers) (Syntax highlighting for fbs files)
- [fsharp](https://github.com/ionide/Ionide-vim) (F# syntax highlighting for fs, fsi and fsx files)
- [gdscript](https://github.com/calviken/vim-gdscript3) (GDScript syntax highlighting for gd files)
- [git](https://github.com/tpope/vim-git) (Git Config syntax highlighting for gitconfig files)
- [gitignore](https://github.com/fszymanski/fzf-gitignore)
- [glsl](https://github.com/tikhomirov/vim-glsl)
- [gmpl](https://github.com/maelvalais/gmpl.vim)
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting)
- [go](https://github.com/fatih/vim-go)
- [glsl](https://github.com/tikhomirov/vim-glsl) (GLSL syntax highlighting for glsl, fp, frag, frg, fs and 16 more files)
- [gmpl](https://github.com/maelvalais/gmpl.vim) (Syntax highlighting for mod files)
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting) (Gnuplot syntax highlighting for gp, gnu, gnuplot, p, plot, plt and gpi files)
- [go](https://github.com/fatih/vim-go) (Go syntax highlighting for go and tmpl files)
- [gradle](https://github.com/tfnico/vim-gradle)
- [graphql](https://github.com/jparise/vim-graphql)
- [haml](https://github.com/tpope/vim-haml)
- [handlebars](https://github.com/mustache/vim-mustache-handlebars)
- [haproxy](https://github.com/CH-DanReif/haproxy.vim)
- [haskell](https://github.com/neovimhaskell/haskell-vim)
- [haxe](https://github.com/yaymukund/vim-haxe)
- [hcl](https://github.com/b4b4r07/vim-hcl)
- [graphql](https://github.com/jparise/vim-graphql) (GraphQL syntax highlighting for graphql, gql and graphqls files)
- [haml](https://github.com/tpope/vim-haml) (Haml syntax highlighting for haml, haml.deface, hamlc and hamlbars files)
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (Mustache and Handlebars syntax highlighting for mustache, hogan, hulk, hjs, handlebars, hbs, hdbs and hb files)
- [haproxy](https://github.com/CH-DanReif/haproxy.vim) (HAProxy syntax highlighting)
- [haskell](https://github.com/neovimhaskell/haskell-vim) (Haskell syntax highlighting for hs, hs-boot, hsc, bpk and hsig files)
- [haxe](https://github.com/yaymukund/vim-haxe) (Haxe syntax highlighting for hx and hxsl files)
- [hcl](https://github.com/b4b4r07/vim-hcl) (HCL syntax highlighting for hcl, nomad and workflow files)
- [helm](https://github.com/towolf/vim-helm)
- [help](https://github.com/neovim/neovim/tree/master/runtime)
- [hive](https://github.com/zebradil/hive.vim)
- [hive](https://github.com/zebradil/hive.vim) (HiveQL syntax highlighting for q, hql and ql files)
- [html5](https://github.com/sheerun/html5.vim)
- [i3](https://github.com/mboughaba/i3config.vim)
- [icalendar](https://github.com/chutzpah/icalendar.vim)
- [idris2](https://github.com/edwinb/idris2-vim)
- [idris](https://github.com/idris-hackers/idris-vim)
- [ion](https://github.com/vmchale/ion-vim)
- [i3](https://github.com/mboughaba/i3config.vim) (Syntax highlighting for i3.config and i3config files)
- [icalendar](https://github.com/chutzpah/icalendar.vim) (Syntax highlighting for ics files)
- [idris2](https://github.com/edwinb/idris2-vim) (Syntax highlighting for idr, ipkg 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)
- [javascript-sql](https://github.com/statico/vim-javascript-sql)
- [javascript](https://github.com/pangloss/vim-javascript)
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax)
- [jq](https://github.com/vito-c/jq.vim)
- [json5](https://github.com/GutenYe/json5.vim)
- [json](https://github.com/elzr/vim-json)
- [jsonnet](https://github.com/google/vim-jsonnet)
- [jst](https://github.com/briancollins/vim-jst)
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty)
- [julia](https://github.com/JuliaEditorSupport/julia-vim)
- [kotlin](https://github.com/udalov/kotlin-vim)
- [ledger](https://github.com/ledger/vim-ledger)
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond)
- [livescript](https://github.com/gkz/vim-ls)
- [llvm](https://github.com/rhysd/vim-llvm)
- [log](https://github.com/MTDL9/vim-log-highlighting)
- [lua](https://github.com/tbastos/vim-lua)
- [mako](https://github.com/sophacles/vim-bundle-mako)
- [markdown](https://github.com/plasticboy/vim-markdown)
- [mathematica](https://github.com/voldikss/vim-mma)
- [mdx](https://github.com/jxnblk/vim-mdx-js)
- [meson](https://github.com/mesonbuild/meson/tree/master/data/syntax-highlighting/vim)
- [moonscript](https://github.com/leafo/moonscript-vim)
- [nginx](https://github.com/chr4/nginx.vim)
- [nim](https://github.com/zah/nim.vim)
- [nix](https://github.com/LnL7/vim-nix)
- [objc](https://github.com/b4winckler/vim-objc)
- [ocaml](https://github.com/rgrinberg/vim-ocaml)
- [octave](https://github.com/McSinyx/vim-octave)
- [odin](https://github.com/Tetralux/odin.vim)
- [opencl](https://github.com/petRUShka/vim-opencl)
- [perl](https://github.com/vim-perl/vim-perl)
- [pgsql](https://github.com/lifepillar/pgsql.vim)
- [php](https://github.com/StanAngeloff/php.vim)
- [plantuml](https://github.com/aklt/plantuml-syntax)
- [pony](https://github.com/jakwings/vim-pony)
- [powershell](https://github.com/PProvost/vim-ps1)
- [protobuf](https://github.com/uarun/vim-protobuf)
- [pug](https://github.com/digitaltoad/vim-pug)
- [puppet](https://github.com/rodjek/vim-puppet)
- [purescript](https://github.com/purescript-contrib/purescript-vim)
- [javascript](https://github.com/pangloss/vim-javascript) (JavaScript syntax highlighting for js, bones, cjs, es, es6 and 17 more files)
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (Syntax highlighting for jenkinsfile and Jenkinsfile files)
- [jq](https://github.com/vito-c/jq.vim) (JSONiq syntax highlighting for jq files)
- [json5](https://github.com/GutenYe/json5.vim) (JSON5 syntax highlighting for json5 files)
- [json](https://github.com/elzr/vim-json) (JSON syntax highlighting for json, avsc, geojson, gltf, har and 13 more files)
- [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 and jst files)
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (JSX syntax highlighting for jsx files)
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (Julia syntax highlighting for jl files)
- [kotlin](https://github.com/udalov/kotlin-vim) (Kotlin syntax highlighting for kt, ktm and kts files)
- [ledger](https://github.com/ledger/vim-ledger) (Syntax highlighting for ldg, ledger and journal files)
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond) (LilyPond syntax highlighting for ly and ily files)
- [livescript](https://github.com/gkz/vim-ls) (LiveScript syntax highlighting for ls files)
- [llvm](https://github.com/rhysd/vim-llvm) (LLVM syntax highlighting for ll and td 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)
- [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 and workbook 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)
- [meson](https://github.com/mesonbuild/meson/tree/master/data/syntax-highlighting/vim) (Meson syntax highlighting for wrap files)
- [moonscript](https://github.com/leafo/moonscript-vim) (MoonScript syntax highlighting for moon files)
- [nginx](https://github.com/chr4/nginx.vim) (Nginx syntax highlighting for nginx, nginxconf and vhost files)
- [nim](https://github.com/zah/nim.vim) (Nim syntax highlighting for nim, nim.cfg, nimble, nimrod and nims files)
- [nix](https://github.com/LnL7/vim-nix) (Nix syntax highlighting for nix files)
- [objc](https://github.com/b4winckler/vim-objc) (Objective-C syntax highlighting for m and h files)
- [ocaml](https://github.com/rgrinberg/vim-ocaml) (OCaml syntax highlighting for ml, eliom, eliomi, ml4, mli and 13 more files)
- [octave](https://github.com/McSinyx/vim-octave) (Syntax highlighting for oct and m files)
- [odin](https://github.com/Tetralux/odin.vim) (Odin syntax highlighting for odin files)
- [opencl](https://github.com/petRUShka/vim-opencl) (OpenCL syntax highlighting for cl and opencl files)
- [perl](https://github.com/vim-perl/vim-perl) (Perl syntax highlighting for pl, al, cgi, fcgi, perl and 12 more 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)
- [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)
- [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)
- [pug](https://github.com/digitaltoad/vim-pug) (Pug syntax highlighting for jade and pug files)
- [puppet](https://github.com/rodjek/vim-puppet) (Puppet syntax highlighting for pp and epp files)
- [purescript](https://github.com/purescript-contrib/purescript-vim) (PureScript syntax highlighting for purs files)
- [python-compiler](https://github.com/aliev/vim-compiler-python)
- [python-indent](https://github.com/Vimjas/vim-python-pep8-indent)
- [python](https://github.com/vim-python/python-syntax)
- [qmake](https://github.com/artoj/qmake-syntax-vim)
- [qml](https://github.com/peterhoeg/vim-qml)
- [r-lang](https://github.com/vim-scripts/R.vim)
- [racket](https://github.com/wlangstroth/vim-racket)
- [ragel](https://github.com/jneen/ragel.vim)
- [raku](https://github.com/Raku/vim-raku)
- [raml](https://github.com/IN3D/vim-raml)
- [razor](https://github.com/adamclerk/vim-razor)
- [reason](https://github.com/reasonml-editor/vim-reason-plus)
- [requirements](https://github.com/raimon49/requirements.txt.vim)
- [python](https://github.com/vim-python/python-syntax) (Python syntax highlighting for py, cgi, fcgi, gyp, gypi and 14 more files)
- [qmake](https://github.com/artoj/qmake-syntax-vim) (QMake syntax highlighting for pro and pri files)
- [qml](https://github.com/peterhoeg/vim-qml) (QML syntax highlighting for qml and qbs files)
- [r-lang](https://github.com/vim-scripts/R.vim) (R syntax highlighting for r, rsx, s, S and rd files)
- [racket](https://github.com/wlangstroth/vim-racket) (Racket syntax highlighting for rkt, rktd, rktl and scrbl files)
- [ragel](https://github.com/jneen/ragel.vim) (Ragel syntax highlighting for rl files)
- [raku](https://github.com/Raku/vim-raku) (Raku syntax highlighting for 6pl, 6pm, nqp, p6, p6l and 12 more files)
- [raml](https://github.com/IN3D/vim-raml) (RAML syntax highlighting for raml files)
- [razor](https://github.com/adamclerk/vim-razor) (HTML+Razor syntax highlighting for cshtml and razor files)
- [reason](https://github.com/reasonml-editor/vim-reason-plus) (Reason syntax highlighting for re and rei files)
- [requirements](https://github.com/raimon49/requirements.txt.vim) (Syntax highlighting for pip files)
- [rspec](https://github.com/keith/rspec.vim)
- [rst](https://github.com/marshallward/vim-restructuredtext)
- [ruby](https://github.com/vim-ruby/vim-ruby)
- [rust](https://github.com/rust-lang/rust.vim)
- [scala](https://github.com/derekwyatt/vim-scala)
- [scss](https://github.com/cakebaker/scss-syntax.vim)
- [sh](https://github.com/arzg/vim-sh)
- [slim](https://github.com/slim-template/vim-slim)
- [slime](https://github.com/slime-lang/vim-slime-syntax)
- [smt2](https://github.com/bohlender/vim-smt2)
- [solidity](https://github.com/tomlion/vim-solidity)
- [stylus](https://github.com/wavded/vim-stylus)
- [svelte](https://github.com/evanleck/vim-svelte/tree/main)
- [rst](https://github.com/marshallward/vim-restructuredtext) (reStructuredText syntax highlighting for rst, rest, rest.txt and rst.txt files)
- [ruby](https://github.com/vim-ruby/vim-ruby) (Ruby and HTML+ERB syntax highlighting for rb, builder, eye, fcgi, gemspec and 25 more files)
- [rust](https://github.com/rust-lang/rust.vim) (Rust syntax highlighting for rs and rs.in files)
- [scala](https://github.com/derekwyatt/vim-scala) (Scala syntax highlighting for scala, kojo and sc files)
- [scss](https://github.com/cakebaker/scss-syntax.vim) (SCSS syntax highlighting for scss files)
- [sh](https://github.com/arzg/vim-sh) (Shell syntax highlighting for sh, bash, bats, cgi, command and 7 more files)
- [slim](https://github.com/slim-template/vim-slim) (Slim syntax highlighting for slim files)
- [slime](https://github.com/slime-lang/vim-slime-syntax) (Syntax highlighting for slime files)
- [smt2](https://github.com/bohlender/vim-smt2) (SMT syntax highlighting for smt2 and smt files)
- [solidity](https://github.com/tomlion/vim-solidity) (Solidity syntax highlighting for sol files)
- [stylus](https://github.com/wavded/vim-stylus) (Stylus syntax highlighting for styl and stylus files)
- [svelte](https://github.com/evanleck/vim-svelte/tree/main) (Svelte syntax highlighting for svelte files)
- [svg-indent](https://github.com/jasonshell/vim-svg-indent)
- [svg](https://github.com/vim-scripts/svg.vim)
- [swift](https://github.com/keith/swift.vim)
- [sxhkd](https://github.com/baskerville/vim-sxhkdrc)
- [systemd](https://github.com/wgwoods/vim-systemd-syntax)
- [textile](https://github.com/timcharper/textile.vim)
- [thrift](https://github.com/solarnz/thrift.vim)
- [svg](https://github.com/vim-scripts/svg.vim) (SVG syntax highlighting for svg files)
- [swift](https://github.com/keith/swift.vim) (Swift syntax highlighting for swift files)
- [sxhkd](https://github.com/baskerville/vim-sxhkdrc) (Syntax highlighting for sxhkdrc files)
- [systemd](https://github.com/wgwoods/vim-systemd-syntax) (Syntax highlighting for automount, dnssd, link, mount, netdev and 9 more files)
- [textile](https://github.com/timcharper/textile.vim) (Textile syntax highlighting for textile files)
- [thrift](https://github.com/solarnz/thrift.vim) (Thrift syntax highlighting for thrift files)
- [tmux](https://github.com/ericpruitt/tmux.vim/tree/master/vim)
- [toml](https://github.com/cespare/vim-toml)
- [tptp](https://github.com/c-cube/vim-tptp)
- [twig](https://github.com/lumiliet/vim-twig)
- [typescript](https://github.com/HerringtonDarkholme/yats.vim)
- [unison](https://github.com/unisonweb/unison/tree/trunk/editor-support/vim)
- [v](https://github.com/ollykel/v-vim)
- [vala](https://github.com/arrufat/vala.vim)
- [vbnet](https://github.com/vim-scripts/vbnet.vim)
- [vcl](https://github.com/smerrill/vcl-vim-plugin)
- [velocity](https://github.com/lepture/vim-velocity)
- [vue](https://github.com/posva/vim-vue)
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax)
- [xml](https://github.com/amadeus/vim-xml)
- [xsl](https://github.com/vim-scripts/XSLT-syntax)
- [toml](https://github.com/cespare/vim-toml) (TOML syntax highlighting for toml files)
- [tptp](https://github.com/c-cube/vim-tptp) (Syntax highlighting for p, tptp and ax files)
- [twig](https://github.com/lumiliet/vim-twig) (Twig syntax highlighting for twig and xml.twig files)
- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (TypeScript and TSX syntax highlighting for ts and tsx files)
- [unison](https://github.com/unisonweb/unison/tree/trunk/editor-support/vim) (Syntax highlighting for u and uu files)
- [v](https://github.com/ollykel/v-vim) (V syntax highlighting for v, vv and vsh files)
- [vala](https://github.com/arrufat/vala.vim) (Vala syntax highlighting for vala, vapi and valadoc files)
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (Visual Basic .NET syntax highlighting for vb and vbhtml files)
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (VCL syntax highlighting for vcl 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)
- [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, axml and 93 more files)
- [xsl](https://github.com/vim-scripts/XSLT-syntax) (XSLT syntax highlighting for xslt and xsl files)
- [yard](https://github.com/noprompt/vim-yardoc)
- [zephir](https://github.com/xwsoul/vim-zephir)
- [zig](https://github.com/ziglang/zig.vim)
- [zephir](https://github.com/xwsoul/vim-zephir) (Zephir syntax highlighting for zep files)
- [zig](https://github.com/ziglang/zig.vim) (Zig syntax highlighting for zir, zig and zir files)
- [zinit](https://github.com/zinit-zsh/zplugin-vim-syntax)
<!--/Language Packs-->

188
autoload/context.vim Normal file
View File

@@ -0,0 +1,188 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'context') == -1
" Language: ConTeXt typesetting engine
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
" Latest Revision: 2016 Oct 21
let s:keepcpo= &cpo
set cpo&vim
" Helper functions {{{
function! s:context_echo(message, mode)
redraw
echo "\r"
execute 'echohl' a:mode
echomsg '[ConTeXt]' a:message
echohl None
endf
function! s:sh()
return has('win32') || has('win64') || has('win16') || has('win95')
\ ? ['cmd.exe', '/C']
\ : ['/bin/sh', '-c']
endfunction
" For backward compatibility
if exists('*win_getid')
function! s:win_getid()
return win_getid()
endf
function! s:win_id2win(winid)
return win_id2win(a:winid)
endf
else
function! s:win_getid()
return winnr()
endf
function! s:win_id2win(winnr)
return a:winnr
endf
endif
" }}}
" ConTeXt jobs {{{
if has('job')
let g:context_jobs = []
" Print the status of ConTeXt jobs
function! context#job_status()
let l:jobs = filter(g:context_jobs, 'job_status(v:val) == "run"')
let l:n = len(l:jobs)
call s:context_echo(
\ 'There '.(l:n == 1 ? 'is' : 'are').' '.(l:n == 0 ? 'no' : l:n)
\ .' job'.(l:n == 1 ? '' : 's').' running'
\ .(l:n == 0 ? '.' : ' (' . join(l:jobs, ', ').').'),
\ 'ModeMsg')
endfunction
" Stop all ConTeXt jobs
function! context#stop_jobs()
let l:jobs = filter(g:context_jobs, 'job_status(v:val) == "run"')
for job in l:jobs
call job_stop(job)
endfor
sleep 1
let l:tmp = []
for job in l:jobs
if job_status(job) == "run"
call add(l:tmp, job)
endif
endfor
let g:context_jobs = l:tmp
if empty(g:context_jobs)
call s:context_echo('Done. No jobs running.', 'ModeMsg')
else
call s:context_echo('There are still some jobs running. Please try again.', 'WarningMsg')
endif
endfunction
function! context#callback(path, job, status)
if index(g:context_jobs, a:job) != -1 && job_status(a:job) != 'run' " just in case
call remove(g:context_jobs, index(g:context_jobs, a:job))
endif
call s:callback(a:path, a:job, a:status)
endfunction
function! context#close_cb(channel)
call job_status(ch_getjob(a:channel)) " Trigger exit_cb's callback for faster feedback
endfunction
function! s:typeset(path)
call add(g:context_jobs,
\ job_start(add(s:sh(), context#command() . ' ' . shellescape(fnamemodify(a:path, ":t"))), {
\ 'close_cb' : 'context#close_cb',
\ 'exit_cb' : function(get(b:, 'context_callback', get(g:, 'context_callback', 'context#callback')),
\ [a:path]),
\ 'in_io' : 'null'
\ }))
endfunction
else " No jobs
function! context#job_status()
call s:context_echo('Not implemented', 'WarningMsg')
endfunction!
function! context#stop_jobs()
call s:context_echo('Not implemented', 'WarningMsg')
endfunction
function! context#callback(path, job, status)
call s:callback(a:path, a:job, a:status)
endfunction
function! s:typeset(path)
execute '!' . context#command() . ' ' . shellescape(fnamemodify(a:path, ":t"))
call call(get(b:, 'context_callback', get(g:, 'context_callback', 'context#callback')),
\ [a:path, 0, v:shell_error])
endfunction
endif " has('job')
function! s:callback(path, job, status) abort
if a:status < 0 " Assume the job was terminated
return
endif
" Get info about the current window
let l:winid = s:win_getid() " Save window id
let l:efm = &l:errorformat " Save local errorformat
let l:cwd = fnamemodify(getcwd(), ":p") " Save local working directory
" Set errorformat to parse ConTeXt errors
execute 'setl efm=' . escape(b:context_errorformat, ' ')
try " Set cwd to expand error file correctly
execute 'lcd' fnameescape(fnamemodify(a:path, ':h'))
catch /.*/
execute 'setl efm=' . escape(l:efm, ' ')
throw v:exception
endtry
try
execute 'cgetfile' fnameescape(fnamemodify(a:path, ':r') . '.log')
botright cwindow
finally " Restore cwd and errorformat
execute s:win_id2win(l:winid) . 'wincmd w'
execute 'lcd ' . fnameescape(l:cwd)
execute 'setl efm=' . escape(l:efm, ' ')
endtry
if a:status == 0
call s:context_echo('Success!', 'ModeMsg')
else
call s:context_echo('There are errors. ', 'ErrorMsg')
endif
endfunction
function! context#command()
return get(b:, 'context_mtxrun', get(g:, 'context_mtxrun', 'mtxrun'))
\ . ' --script context --autogenerate --nonstopmode'
\ . ' --synctex=' . (get(b:, 'context_synctex', get(g:, 'context_synctex', 0)) ? '1' : '0')
\ . ' ' . get(b:, 'context_extra_options', get(g:, 'context_extra_options', ''))
endfunction
" Accepts an optional path (useful for big projects, when the file you are
" editing is not the project's root document). If no argument is given, uses
" the path of the current buffer.
function! context#typeset(...) abort
let l:path = fnamemodify(strlen(a:000[0]) > 0 ? a:1 : expand("%"), ":p")
let l:cwd = fnamemodify(getcwd(), ":p") " Save local working directory
call s:context_echo('Typesetting...', 'ModeMsg')
execute 'lcd' fnameescape(fnamemodify(l:path, ":h"))
try
call s:typeset(l:path)
finally " Restore local working directory
execute 'lcd ' . fnameescape(l:cwd)
endtry
endfunction!
"}}}
let &cpo = s:keepcpo
unlet s:keepcpo
" vim: sw=2 fdm=marker
endif

View File

@@ -330,7 +330,7 @@ function! s:download(branch)
let zip = s:script_root_dir . "fsac.zip"
call system(
\ 'curl -fLo ' . zip . ' --create-dirs ' .
\ '"https://ci.appveyor.com/api/projects/fsautocomplete/fsautocomplete/artifacts/bin/pkgs/fsautocomplete.netcore.zip?branch=' . a:branch . '"'
\ '"https://github.com/fsharp/FsAutoComplete/releases/latest/download/fsautocomplete.netcore.zip"'
\ )
if v:shell_error == 0
call system('unzip -o -d ' . s:script_root_dir . "/fsac " . zip)

View File

@@ -524,7 +524,7 @@ function! go#config#ReferrersMode() abort
endfunction
function! go#config#ImplementsMode() abort
return get(g:, 'go_implements_mode', 'guru')
return get(g:, 'go_implements_mode', 'gopls')
endfunction
function! go#config#GoplsCompleteUnimported() abort
@@ -586,6 +586,21 @@ function! go#config#FillStructMode() abort
return get(g:, 'go_fillstruct_mode', 'fillstruct')
endfunction
function! go#config#DebugMappings() abort
let l:default = {
\ '(go-debug-continue)': {'key': '<F5>'},
\ '(go-debug-print)': {'key': '<F6>'},
\ '(go-debug-breakpoint)': {'key': '<F9>'},
\ '(go-debug-next)': {'key': '<F10>'},
\ '(go-debug-step)': {'key': '<F11>'},
\ '(go-debug-halt)': {'key': '<F8>'},
\ }
let l:user = deepcopy(get(g:, 'go_debug_mappings', {}))
return extend(l:user, l:default, 'keep')
endfunction
" Set the default value. A value of "1" is a shortcut for this, for
" compatibility reasons.
if exists("g:go_gorename_prefill") && g:go_gorename_prefill == 1

View File

@@ -37,7 +37,7 @@ let s:NODOCPATTERN = '\C\VNo documentation found.'
function! julia#doc#lookup(keyword, ...) abort
let juliapath = get(a:000, 0, g:julia#doc#juliapath)
let keyword = escape(a:keyword, '"\')
let cmd = printf('%s -E "@doc %s"', juliapath, keyword)
let cmd = printf('%s --compile=min --optimize=0 -E "@doc %s"', juliapath, keyword)
return systemlist(cmd)
endfunction
@@ -238,7 +238,7 @@ endfunction
function! s:likely(str) abort
" escape twice
let str = escape(escape(a:str, '"\'), '"\')
let cmd = printf('%s -E "%s(\"%s\")"', g:julia#doc#juliapath, s:REPL_SEARCH, str)
let cmd = printf('%s --compile=min --optimize=0 -E "%s(\"%s\")"', g:julia#doc#juliapath, s:REPL_SEARCH, str)
let output = systemlist(cmd)
return split(matchstr(output[0], '\C^search: \zs.*'))
endfunction

View File

@@ -79,6 +79,7 @@ let s:globs = {
\ 'conaryrecipe': '*.recipe',
\ 'conf': '*.conf,auto.master,config',
\ 'config': 'configure.in,configure.ac,Pipfile',
\ 'context': '*.mkii,*.mkiv,*.mkvi',
\ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.tcc,*.tpp,*.moc,*.tlh',
\ 'cql': '*.cql',
\ 'crm': '*.crm',
@@ -121,6 +122,7 @@ let s:globs = {
\ 'diff': '*.diff,*.rej',
\ 'dircolors': '.dir_colors,.dircolors',
\ 'dnsmasq': '',
\ 'dockerfile': '*.Dockerfile,*.dock,Containerfile,Dockerfile,dockerfile,Dockerfile*',
\ 'dosbatch': '*.bat,*.sys',
\ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,buildozer.spec,.editorconfig,.npmrc,php.ini-*',
\ 'dot': '*.dot,*.gv',
@@ -307,6 +309,7 @@ let s:globs = {
\ 'make': '*.mak,*.dsp,*.mk,*[mM]akefile',
\ 'mako': '*.mako,*.mao',
\ 'mallard': '*.page',
\ 'man': '*.1,*.1in,*.1m,*.1x,*.2,*.3,*.3in,*.3m,*.3p,*.3pm,*.3qt,*.3x,*.4,*.5,*.6,*.7,*.8,*.9,*.man,*.mdoc',
\ 'manconf': 'man.config',
\ 'map': '*.map',
\ 'maple': '*.mv,*.mpl,*.mws',
@@ -382,7 +385,7 @@ let s:globs = {
\ 'perl': '*.pl,*.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.pm,*.psgi,*.t,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc,.gitolite.rc',
\ 'pf': 'pf.conf',
\ 'pfmain': 'main.cf',
\ 'php': '*.php,*.aw,*.ctp,*.fcgi,*.inc,*.php3,*.php4,*.php5,*.phps,*.phpt,*.phtml,.php,.php_cs,.php_cs.dist,Phakefile',
\ 'php': '*.php,*.aw,*.ctp,*.fcgi,*.inc,*.php3,*.php4,*.php5,*.phps,*.phpt,*.phtml,*.php9,.php,.php_cs,.php_cs.dist,Phakefile',
\ 'pike': '*.pike,*.pmod',
\ 'pilrc': '*.rcp',
\ 'pine': '.pinerc,pinerc,.pinercex,pinercex',
@@ -449,7 +452,7 @@ let s:globs = {
\ 'rrst': '*.rrst,*.srst',
\ 'rst': '*.rst,*.rest,*.rest.txt,*.rst.txt',
\ 'rtf': '*.rtf',
\ 'ruby': '*.rb,*.builder,*.eye,*.fcgi,*.gemspec,*.god,*.jbuilder,*.mspec,*.pluginspec,*.podspec,*.rabl,*.rake,*.rbi,*.rbuild,*.rbw,*.rbx,*.ru,*.ruby,*.spec,*.thor,*.watchr,*.rxml,*.rjs,*.rant,*.axlsx,*.cap,*.opal,.irbrc,.pryrc,.simplecov,Appraisals,Berksfile,Buildfile,Capfile,Dangerfile,Deliverfile,Fastfile,Gemfile,Gemfile.lock,Guardfile,Jarfile,Mavenfile,Podfile,Puppetfile,Rakefile,Snapfile,Thorfile,Vagrantfile,buildfile,Rantfile,.autotest,Cheffile,KitchenSink,Routefile,.Guardfile,.Brewfile,vagrantfile,[Rr]akefile*,*_spec.rb',
\ 'ruby': '*.rb,*.builder,*.eye,*.fcgi,*.gemspec,*.god,*.jbuilder,*.mspec,*.pluginspec,*.podspec,*.rabl,*.rake,*.rbi,*.rbuild,*.rbw,*.rbx,*.ru,*.ruby,*.spec,*.thor,*.watchr,*.rxml,*.rjs,*.rant,*.axlsx,*.cap,*.opal,.irbrc,.pryrc,.simplecov,Appraisals,Berksfile,Buildfile,Capfile,Dangerfile,Deliverfile,Fastfile,Gemfile,Gemfile.lock,Guardfile,Jarfile,Mavenfile,Podfile,Puppetfile,Rakefile,Snapfile,Thorfile,Vagrantfile,buildfile,[Rr]antfile,.autotest,Cheffile,KitchenSink,Routefile,.Guardfile,.Brewfile,vagrantfile,[Rr]akefile*,*_spec.rb',
\ 'rust': '*.rs,*.rs.in',
\ 'samba': 'smb.conf',
\ 'sas': '*.sas',
@@ -601,6 +604,8 @@ let s:globs = {
\ 'xml': '*.xml,*.adml,*.admx,*.ant,*.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,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mm,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.psc1,*.pt,*.rdf,*.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,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc',
\ 'xml.twig': '*.xml.twig',
\ 'xmodmap': '*Xmodmap,*xmodmap*',
\ 'xpm': '*.xpm,*.pm',
\ 'xpm2': '*.xpm2',
\ 'xquery': '*.xq,*.xql,*.xqm,*.xquery,*.xqy',
\ 'xs': '*.xs',
\ 'xsd': '*.xsd',

58
compiler/context.vim Normal file
View File

@@ -0,0 +1,58 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'context') == -1
" Vim compiler file
" Compiler: ConTeXt typesetting engine
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
" Last Change: 2016 Oct 21
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 get(b:, 'context_ignore_makefile', get(g:, 'context_ignore_makefile', 0)) ||
\ (!filereadable('Makefile') && !filereadable('makefile'))
let current_compiler = 'context'
" The following assumes that the current working directory is set to the
" directory of the file to be typeset
let &l:makeprg = get(b:, 'context_mtxrun', get(g:, 'context_mtxrun', 'mtxrun'))
\ . ' --script context --autogenerate --nonstopmode --synctex='
\ . (get(b:, 'context_synctex', get(g:, 'context_synctex', 0)) ? '1' : '0')
\ . ' ' . get(b:, 'context_extra_options', get(g:, 'context_extra_options', ''))
\ . ' ' . shellescape(expand('%:p:t'))
else
let current_compiler = 'make'
endif
let b:context_errorformat = ''
\ . '%-Popen source%.%#> %f,'
\ . '%-Qclose source%.%#> %f,'
\ . "%-Popen source%.%#name '%f',"
\ . "%-Qclose source%.%#name '%f',"
\ . '%Etex %trror%.%#mp error on line %l in file %f:%.%#,'
\ . 'tex %trror%.%#error on line %l in file %f: %m,'
\ . '%Elua %trror%.%#error on line %l in file %f:,'
\ . '%+Emetapost %#> error: %#,'
\ . '! error: %#%m,'
\ . '%-C %#,'
\ . '%C! %m,'
\ . '%Z[ctxlua]%m,'
\ . '%+C<*> %.%#,'
\ . '%-C%.%#,'
\ . '%Z...%m,'
\ . '%-Zno-error,'
\ . '%-G%.%#' " Skip remaining lines
execute 'CompilerSet errorformat=' . escape(b:context_errorformat, ' ')
let &cpo = s:keepcpo
unlet s:keepcpo
endif

View File

@@ -349,7 +349,7 @@ julia#function_assign2block()
statements are removed; if the result is empty, `nothing` is
substituted. Leading macros (e.g. `@inline` or `@compat`) are
recognized and preserved by the transformation.
In order to make this functionality practical, it is advisable
to map it to some key combination, e.g.:
>
@@ -386,6 +386,91 @@ g:julia_highlight_operators
Determines whether to apply syntax highlighting to operators.
Default: on (set to `1`).
*g:julia_indent_align_import*
g:julia_indent_align_import
In a multi-line import/using/export statment, the lines after
the first one use some special alignment rules by default,
e.g.:
>
import X: one,
two,
three
export four,
five,
six
<
When `g:julia_indent_align_import` is `0` instead, the usual
indentation is used:
>
import X: one,
two,
three
export four,
five,
six
*g:julia_indent_align_brackets*
g:julia_indent_align_brackets
In a multi-line bracketed expression (except for function
arguments, see |g:julia_indent_align_funcargs|), the lines
after the first one use some special alignment rules by
default, e.g.:
>
matrix = [1 2 3;
4 5 6]
tpl = (
abc = Dict(a=>1,
b=>2),
def = [1 2;
3 4],
xyz = SubArray{eltype(P),
N, P, I,
false}
)
<
When `g:julia_indent_align_brackets` is `0` instead, an extra
indent is used:
>
matrix = [1 2 3;
4 5 6]
tpl = (
abc = Dict(a=>1,
b=>2),
def = [1 2;
3 4],
xyz = SubArray{eltype(P),
N, P, I,
false}
)
<
*g:julia_indent_align_funcargs*
g:julia_indent_align_funcargs
In a function definition, when the arguments span multiple
lines, the lines after the first one get an extra indentation
step by default, e.g.:
>
function functionanme(
arg1, arg2,
arg3, arg4
)
# function body
end
<
By setting `g:julia_indent_align_funcargs` to `1`, the
arguments are aligned to the bracket instead (they work as any
other bracket with the default value of
|g:julia_indent_align_brackets|):
>
function functionanme(arg1, arg2,
arg3, arg4
)
# function body
end
<
==============================================================================
ABOUT *julia-vim-about*

View File

@@ -1498,9 +1498,9 @@ other packages. Valid options are `gopls` and `guru`. By default it's `gopls`.
Use this option to define the command to be used for |:GoImplements|.
The Implements feature in gopls is still new and being worked upon.
Valid options are `gopls` and `guru`. By default it's `guru`.
Valid options are `gopls` and `guru`. By default it's `gopls`.
>
let g:go_implements_mode = 'guru'
let g:go_implements_mode = 'gopls'
<
*'g:go_def_mapping_enabled'*
@@ -2490,7 +2490,52 @@ Show only variables on the right-hand side: >
let g:go_debug_windows = {
\ 'vars': 'rightbelow 60vnew',
\ }
*'g:go_debug_mappings'*
Contains custom key mapping information to customize the active mappings
when debugging.
Only the customizations desired need to be provided; the debugger will use its
default key mappings for any mapping not defined here.
This value should be a dictionary whose keys are the plugin mapping commands
(e.g. `(go-debug-continue)`). The values are dictionaries with two keys.
`key` and `attributes`.
`key` is expected to be the key to map (i.e. it's the `lhs` in a mapping).
`key` can be empty or missing to prevent a key mapping from being applied for
one the named mappings.
`arguments` is the string of `map-arguments` for the mapping (e.g.
`<nowait>`).
The first item must be the `lhs` to use for the mapping. The optional
second item is for `:map-arguments`. All mappings will always be `:map-local`,
so there is never a need to include `"<buffer>"` in the the arguments.
>
let g:go_debug_mappings = {
\ '(go-debug-continue)': {'key': 'c', 'arguments': '<nowait>'],
\ '(go-debug-stop)': {'key': 'q'},
\ '(go-debug-next)': {'key': 'n', 'arguments': '<nowait>'},
\ '(go-debug-step)': {'key': 's'},
\}
<
Defaults are equivalent to:
>
let g:go_debug_mappings = {
\ '(go-debug-continue)': {'key': '<F5>'},
\ '(go-debug-print)': {'key': '<F6>'},
\ '(go-debug-breakpoint)': {'key': '<F9>'},
\ '(go-debug-next)': {'key': '<F10>'},
\ '(go-debug-step)': {'key': '<F11>'},
\ '(go-debug-halt)': {'key': '<F8>'},
\ }
<
Your user specified settings will be merged with the defaults.
*'g:go_debug_address'*
Server address `dlv` will listen on; must be in `hostname:port` format.

File diff suppressed because it is too large Load Diff

106
ftplugin/context.vim Normal file
View File

@@ -0,0 +1,106 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'context') == -1
" Vim filetype plugin file
" Language: ConTeXt typesetting engine
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
" Former Maintainers: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2016 Oct 30
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
if !exists('current_compiler')
compiler context
endif
let b:undo_ftplugin = "setl com< cms< def< inc< sua< fo< ofu<"
\ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
setlocal comments=b:%D,b:%C,b:%M,:% commentstring=%\ %s formatoptions+=tjcroql2
if get(b:, 'context_metapost', get(g:, 'context_metapost', 1))
setlocal omnifunc=contextcomplete#Complete
let g:omni_syntax_group_include_context = 'mf\w\+,mp\w\+'
let g:omni_syntax_group_exclude_context = 'mfTodoComment'
endif
let &l:define='\\\%([egx]\|char\|mathchar\|count\|dimen\|muskip\|skip\|toks\)\='
\ . 'def\|\\font\|\\\%(future\)\=let'
\ . '\|\\new\%(count\|dimen\|skip\|muskip\|box\|toks\|read\|write'
\ . '\|fam\|insert\|if\)'
let &l:include = '^\s*\\\%(input\|component\|product\|project\|environment\)'
setlocal suffixesadd=.tex
if exists("loaded_matchit")
let b:match_ignorecase = 0
let b:match_skip = 'r:\\\@<!\%(\\\\\)*%'
let b:match_words = '(:),\[:],{:},\\(:\\),\\\[:\\],' .
\ '\\start\(\a\+\):\\stop\1'
endif
let s:context_regex = {
\ 'beginsection' : '\\\%(start\)\=\%(\%(sub\)*section\|\%(sub\)*subject\|chapter\|part\|component\|product\|title\)\>',
\ 'endsection' : '\\\%(stop\)\=\%(\%(sub\)*section\|\%(sub\)*subject\|chapter\|part\|component\|product\|title\)\>',
\ 'beginblock' : '\\\%(start\|setup\|define\)',
\ 'endblock' : '\\\%(stop\|setup\|define\)'
\ }
function! s:move_around(count, what, flags, visual)
if a:visual
exe "normal! gv"
endif
call search(s:context_regex[a:what], a:flags.'s') " 's' sets previous context mark
call map(range(2, a:count), 'search(s:context_regex[a:what], a:flags)')
endfunction
" Move around macros.
nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR>
vnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:true) <CR>
nnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:false) <CR>
vnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:true) <CR>
nnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:false) <CR>
vnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:true) <CR>
nnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:false) <CR>
vnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:true) <CR>
nnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:false) <CR>
vnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:true) <CR>
nnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:false) <CR>
vnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:true) <CR>
" Other useful mappings
if get(g:, 'context_mappings', 1)
let s:tp_regex = '?^$\|^\s*\\\(item\|start\|stop\|blank\|\%(sub\)*section\|chapter\|\%(sub\)*subject\|title\|part\)'
fun! s:tp()
call cursor(search(s:tp_regex, 'bcW') + 1, 1)
normal! V
call cursor(search(s:tp_regex, 'W') - 1, 1)
endf
" Reflow paragraphs with commands like gqtp ("gq TeX paragraph")
onoremap <silent><buffer> tp :<c-u>call <sid>tp()<cr>
" Select TeX paragraph
vnoremap <silent><buffer> tp <esc>:<c-u>call <sid>tp()<cr>
" $...$ text object
onoremap <silent><buffer> i$ :<c-u>normal! T$vt$<cr>
onoremap <silent><buffer> a$ :<c-u>normal! F$vf$<cr>
vnoremap <buffer> i$ T$ot$
vnoremap <buffer> a$ F$of$
endif
" Commands for asynchronous typesetting
command! -buffer -nargs=? -complete=file ConTeXt call context#typeset(<q-args>)
command! -nargs=0 ConTeXtJobStatus call context#job_status()
command! -nargs=0 ConTeXtStopJobs call context#stop_jobs()
let &cpo = s:cpo_save
unlet s:cpo_save
endif

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'docker-compose') == -1
" Define comment string
setlocal commentstring=#\ %s

20
ftplugin/dockerfile.vim Normal file
View File

@@ -0,0 +1,20 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
" Vim filetype plugin
" Language: Dockerfile
" Maintainer: Honza Pokorny <http://honza.ca>
" Last Change: 2014 Aug 29
" 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 b:undo_ftplugin = "setl commentstring<"
setlocal commentstring=#\ %s
endif

View File

@@ -5,6 +5,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'falcon') == -1
" Author: Steven Oliver <oliver.steven@gmail.com>
" Copyright: Copyright (c) 2009-2013 Steven Oliver
" License: You may redistribute this under the same terms as Vim itself
" Last Update: 2020 Oct 10
" --------------------------------------------------------------------------
" Only do this when not done yet for this buffer

View File

@@ -2,14 +2,14 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fortran') == -1
" Vim settings file
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, 77, 66)
" Version: 0.50
" Last Change: 2020 Apr 20
" Patched By: Eisuke Kawashima
" Version: (v52) 2020 October 07
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
" Usage: For instructions, do :help fortran-plugin from Vim
" Credits:
" Useful suggestions were made by Stefano Zacchiroli, Hendrik Merx, Ben
" Fritz, and David Barnett.
" Version 0.1 was created in September 2000 by Ajit Thakkar.
" Since then, useful suggestions and contributions have been made, in order, by:
" Stefano Zacchiroli, Hendrik Merx, Ben Fritz, David Barnett, Eisuke Kawashima,
" and Doug Kearns.
" Only do these settings when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -121,7 +121,7 @@ if !exists("b:match_words")
endif
" File filters for :browse e
if has("gui_win32") && !exists("b:browsefilter")
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "Fortran Files (*.f;*.for;*.f77;*.f90;*.f95;*.f03;*.f08;*.fpp;*.ftn)\t*.f;*.for;*.f77;*.f90;*.f95;*.f03;*.f08;*.fpp;*.ftn\n" .
\ "All Files (*.*)\t*.*\n"
endif

254
ftplugin/man.vim Normal file
View File

@@ -0,0 +1,254 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'man') == -1
" Vim filetype plugin file
" Language: man
" Maintainer: Jason Franklin <vim@justemail.net>
" Maintainer: SungHyun Nam <goweol@gmail.com>
" Last Change: 2020 Jun 01
" To make the ":Man" command available before editing a manual page, source
" this script from your startup vimrc file.
" If 'filetype' isn't "man", we must have been called to only define ":Man".
if &filetype == "man"
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
endif
let s:cpo_save = &cpo
set cpo-=C
if &filetype == "man"
" allow dot and dash in manual page name.
setlocal iskeyword+=\.,-
let b:undo_ftplugin = "setlocal iskeyword<"
" Add mappings, unless the user didn't want this.
if !exists("no_plugin_maps") && !exists("no_man_maps")
if !hasmapto('<Plug>ManBS')
nmap <buffer> <LocalLeader>h <Plug>ManBS
let b:undo_ftplugin = b:undo_ftplugin
\ . '|silent! nunmap <buffer> <LocalLeader>h'
endif
nnoremap <buffer> <Plug>ManBS :%s/.\b//g<CR>:setl nomod<CR>''
nnoremap <buffer> <silent> <c-]> :call <SID>PreGetPage(v:count)<CR>
nnoremap <buffer> <silent> <c-t> :call <SID>PopPage()<CR>
nnoremap <buffer> <silent> q :q<CR>
" Add undo commands for the maps
let b:undo_ftplugin = b:undo_ftplugin
\ . '|silent! nunmap <buffer> <Plug>ManBS'
\ . '|silent! nunmap <buffer> <c-]>'
\ . '|silent! nunmap <buffer> <c-t>'
\ . '|silent! nunmap <buffer> q'
endif
if exists('g:ft_man_folding_enable') && (g:ft_man_folding_enable == 1)
setlocal foldmethod=indent foldnestmax=1 foldenable
let b:undo_ftplugin = b:undo_ftplugin
\ . '|silent! setl fdm< fdn< fen<'
endif
endif
if exists(":Man") != 2
com -nargs=+ -complete=shellcmd Man call s:GetPage(<q-mods>, <f-args>)
nmap <Leader>K :call <SID>PreGetPage(0)<CR>
nmap <Plug>ManPreGetPage :call <SID>PreGetPage(0)<CR>
endif
" Define functions only once.
if !exists("s:man_tag_depth")
let s:man_tag_depth = 0
let s:man_sect_arg = ""
let s:man_find_arg = "-w"
try
if !has("win32") && $OSTYPE !~ 'cygwin\|linux' && system('uname -s') =~ "SunOS" && system('uname -r') =~ "^5"
let s:man_sect_arg = "-s"
let s:man_find_arg = "-l"
endif
catch /E145:/
" Ignore the error in restricted mode
endtry
func <SID>PreGetPage(cnt)
if a:cnt == 0
let old_isk = &iskeyword
if &ft == 'man'
setl iskeyword+=(,)
endif
let str = expand("<cword>")
let &l:iskeyword = old_isk
let page = substitute(str, '(*\(\k\+\).*', '\1', '')
let sect = substitute(str, '\(\k\+\)(\([^()]*\)).*', '\2', '')
if match(sect, '^[0-9 ]\+$') == -1
let sect = ""
endif
if sect == page
let sect = ""
endif
else
let sect = a:cnt
let page = expand("<cword>")
endif
call s:GetPage('', sect, page)
endfunc
func <SID>GetCmdArg(sect, page)
if a:sect == ''
return a:page
endif
return s:man_sect_arg.' '.a:sect.' '.a:page
endfunc
func <SID>FindPage(sect, page)
let where = system("man ".s:man_find_arg.' '.s:GetCmdArg(a:sect, a:page))
if where !~ "^/"
if matchstr(where, " [^ ]*$") !~ "^ /"
return 0
endif
endif
return 1
endfunc
func <SID>GetPage(cmdmods, ...)
if a:0 >= 2
let sect = a:1
let page = a:2
elseif a:0 >= 1
let sect = ""
let page = a:1
else
return
endif
" To support: nmap K :Man <cword>
if page == '<cword>'
let page = expand('<cword>')
endif
if !exists('g:ft_man_no_sect_fallback') || (g:ft_man_no_sect_fallback == 0)
if sect != "" && s:FindPage(sect, page) == 0
let sect = ""
endif
endif
if s:FindPage(sect, page) == 0
let msg = 'man.vim: no manual entry for "' . page . '"'
if !empty(sect)
let msg .= ' in section ' . sect
endif
echomsg msg
return
endif
exec "let s:man_tag_buf_".s:man_tag_depth." = ".bufnr("%")
exec "let s:man_tag_lin_".s:man_tag_depth." = ".line(".")
exec "let s:man_tag_col_".s:man_tag_depth." = ".col(".")
let s:man_tag_depth = s:man_tag_depth + 1
let open_cmd = 'edit'
" Use an existing "man" window if it exists, otherwise open a new one.
if &filetype != "man"
let thiswin = winnr()
exe "norm! \<C-W>b"
if winnr() > 1
exe "norm! " . thiswin . "\<C-W>w"
while 1
if &filetype == "man"
break
endif
exe "norm! \<C-W>w"
if thiswin == winnr()
break
endif
endwhile
endif
if &filetype != "man"
if exists("g:ft_man_open_mode")
if g:ft_man_open_mode == 'vert'
let open_cmd = 'vsplit'
elseif g:ft_man_open_mode == 'tab'
let open_cmd = 'tabedit'
else
let open_cmd = 'split'
endif
else
let open_cmd = a:cmdmods . ' split'
endif
endif
endif
silent execute open_cmd . " $HOME/" . page . '.' . sect . '~'
" Avoid warning for editing the dummy file twice
setl buftype=nofile noswapfile
setl fdc=0 ma nofen nonu nornu
%delete _
let unsetwidth = 0
if empty($MANWIDTH)
let $MANWIDTH = winwidth(0)
let unsetwidth = 1
endif
" Ensure Vim is not recursively invoked (man-db does this) when doing ctrl-[
" on a man page reference by unsetting MANPAGER.
" Some versions of env(1) do not support the '-u' option, and in such case
" we set MANPAGER=cat.
if !exists('s:env_has_u')
call system('env -u x true')
let s:env_has_u = (v:shell_error == 0)
endif
let env_cmd = s:env_has_u ? 'env -u MANPAGER' : 'env MANPAGER=cat'
let env_cmd .= ' GROFF_NO_SGR=1'
let man_cmd = env_cmd . ' man ' . s:GetCmdArg(sect, page) . ' | col -b'
silent exec "r !" . man_cmd
if unsetwidth
let $MANWIDTH = ''
endif
" Remove blank lines from top and bottom.
while line('$') > 1 && getline(1) =~ '^\s*$'
1delete _
endwhile
while line('$') > 1 && getline('$') =~ '^\s*$'
$delete _
endwhile
1
setl ft=man nomod
setl bufhidden=hide
setl nobuflisted
setl noma
endfunc
func <SID>PopPage()
if s:man_tag_depth > 0
let s:man_tag_depth = s:man_tag_depth - 1
exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth
exec "let s:man_tag_lin=s:man_tag_lin_".s:man_tag_depth
exec "let s:man_tag_col=s:man_tag_col_".s:man_tag_depth
exec s:man_tag_buf."b"
exec s:man_tag_lin
exec "norm! ".s:man_tag_col."|"
exec "unlet s:man_tag_buf_".s:man_tag_depth
exec "unlet s:man_tag_lin_".s:man_tag_depth
exec "unlet s:man_tag_col_".s:man_tag_depth
unlet s:man_tag_buf s:man_tag_lin s:man_tag_col
endif
endfunc
endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: set sw=2 ts=8 noet:
endif

View File

@@ -524,7 +524,7 @@ endfunction
"c. link this stuff with what the user wants
" ie. get the expression selected/under the cursor
let s:ocaml_word_char = '\w|[\u00ac-\uffff]|'''
let s:ocaml_word_char = '\w|[\xc0-\xff]|'''
"In: the current mode (eg. "visual", "normal", etc.)
"Out: the borders of the expression we are looking for the type

40
indent/context.vim Normal file
View File

@@ -0,0 +1,40 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'context') == -1
" ConTeXt indent file
" Language: ConTeXt typesetting engine
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
" Last Change: 2016 Oct 15
if exists("b:did_indent")
finish
endif
if !get(b:, 'context_metapost', get(g:, 'context_metapost', 1))
finish
endif
" Load MetaPost indentation script
runtime! indent/mp.vim
let s:keepcpo= &cpo
set cpo&vim
setlocal indentexpr=GetConTeXtIndent()
let b:undo_indent = "setl indentexpr<"
function! GetConTeXtIndent()
" Use MetaPost rules inside MetaPost graphic environments
if len(synstack(v:lnum, 1)) > 0 &&
\ synIDattr(synstack(v:lnum, 1)[0], "name") ==# 'contextMPGraphic'
return GetMetaPostIndent()
endif
return -1
endfunc
let &cpo = s:keepcpo
unlet s:keepcpo
" vim:sw=2
endif

View File

@@ -2,14 +2,14 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fortran') == -1
" Vim indent file
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
" Version: 47
" Last Change: 2020 Apr 20
" Patched By: Eisuke Kawashima
" Version: (v48) 2020 October 07
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
" Usage: For instructions, do :help fortran-indent from Vim
" Credits:
" Useful suggestions were made, in chronological order, by:
" Albert Oliver Serra, Takuya Fujiwara and Philipp Edelmann.
" Version 0.1 was created in September 2000 by Ajit Thakkar.
" Since then, useful suggestions and contributions have been made, in order, by:
" Albert Oliver Serra, Takuya Fujiwara, Philipp Edelmann, Eisuke Kawashima,
" and Louis Cochen.
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -148,7 +148,7 @@ function FortranGetIndent(lnum)
\. 'type\|forall\|associate\|enum\|block\)\)\>'
let ind = ind - shiftwidth()
" Fix indent for case statement immediately after select
if prevstat =~? '\<select\s\+\(case\|type\)\>'
if prevstat =~? '\<select\s*\(case\|type\)\>'
let ind = ind + shiftwidth()
endif
endif

View File

@@ -21,7 +21,7 @@ if exists("*GetJuliaIndent")
finish
endif
let s:skipPatterns = '\<julia\%(Comprehension\%(For\|If\)\|RangeKeyword\|Comment[LM]\|\%([bsv]\|ip\|big\|MIME\|Shell\|Printf\|Doc\)\=String\|RegEx\|SymbolS\?\)\>'
let s:skipPatterns = '\<julia\%(Comprehension\%(For\|If\)\|RangeKeyword\|Comment\%([LM]\|Delim\)\|\%([bsv]\|ip\|big\|MIME\|Shell\|Printf\|Doc\)\=String\|RegEx\|SymbolS\?\)\>'
function JuliaMatch(lnum, str, regex, st, ...)
let s = a:st
@@ -51,7 +51,7 @@ function GetJuliaNestingStruct(lnum, ...)
let blocks_stack = []
let num_closed_blocks = 0
while 1
let fb = JuliaMatch(a:lnum, line, '@\@<!\<\%(if\|else\%(if\)\?\|while\|for\|try\|catch\|finally\|\%(staged\)\?function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|immutable\|let\|\%(bare\)\?module\|quote\|do\)\>', s, e)
let fb = JuliaMatch(a:lnum, line, '@\@<!\<\%(if\|else\%(if\)\?\|while\|for\|try\|catch\|finally\|\%(staged\)\?function\|macro\|begin\|mutable\s\+struct\|\%(mutable\s\+\)\@<!struct\|\%(abstract\|primitive\)\s\+type\|let\|\%(bare\)\?module\|quote\|do\)\>', s, e)
let fe = JuliaMatch(a:lnum, line, '@\@<!\<end\>', s, e)
if fb < 0 && fe < 0
@@ -255,14 +255,18 @@ function GetJuliaNestingBrackets(lnum, c)
endwhile
let first_open_bracket = -1
let last_open_bracket = -1
let infuncargs = 0
if len(brackets_stack) > 0
let first_open_bracket = brackets_stack[0][1]
let last_open_bracket = brackets_stack[-1][1]
if brackets_stack[-1][0] == 'par' && IsFunctionArgPar(a:lnum, last_open_bracket)
let infuncargs = 1
endif
endif
return [first_open_bracket, last_open_bracket, last_closed_bracket]
return [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs]
endfunction
let s:bracketBlocks = '\<julia\%(\%(\%(Printf\)\?Par\|SqBra\|CurBra\)Block\|ParBlockInRange\|StringVars\%(Par\|SqBra\|CurBra\)\|Dollar\%(Par\|SqBra\)\|QuotedParBlockS\?\)\>'
let s:bracketBlocks = '\<julia\%(\%(\%(Printf\)\?Par\|SqBra\%(Idx\)\?\|CurBra\)Block\|ParBlockInRange\|StringVars\%(Par\|SqBra\|CurBra\)\|Dollar\%(Par\|SqBra\)\|QuotedParBlockS\?\)\>'
function IsInBrackets(lnum, c)
let stack = map(synstack(a:lnum, a:c), 'synIDattr(v:val, "name")')
@@ -272,10 +276,40 @@ endfunction
function IsInDocString(lnum)
let stack = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
call filter(stack, 'v:val =~# "\\<juliaDocString\\>"')
call filter(stack, 'v:val =~# "\\<juliaDocString\\(Delim\\)\\?\\>"')
return len(stack) > 0
endfunction
function IsInContinuationImportLine(lnum)
let stack = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
call filter(stack, 'v:val =~# "\\<juliaImportLine\\>"')
if len(stack) == 0
return 0
endif
return JuliaMatch(a:lnum, getline(a:lnum), '\<\%(import\|using\|export\)\>', indent(a:lnum)) == -1
endfunction
function IsFunctionArgPar(lnum, c)
if a:c == 0
return 0
endif
let stack = map(synstack(a:lnum, a:c-1), 'synIDattr(v:val, "name")')
return stack[-1] == 'juliaFunctionBlock'
endfunction
function JumpToMatch(lnum, last_closed_bracket)
" we use the % command to skip back (tries to ues matchit if possible,
" otherwise resorts to vim's default, which is buggy but better than
" nothing)
call cursor(a:lnum, a:last_closed_bracket)
let percmap = maparg("%", "n")
if exists("g:loaded_matchit") && percmap =~# 'Match\%(it\|_wrapper\)'
normal %
else
normal! %
end
endfunction
" Auxiliary function to find a line which does not start in the middle of a
" multiline bracketed expression, to be used as reference for block
" indentation.
@@ -314,30 +348,29 @@ function GetJuliaIndent()
let lim = -1
" Multiline bracketed expressions take precedence
let align_brackets = get(g:, "julia_indent_align_brackets", 1)
let align_funcargs = get(g:, "julia_indent_align_funcargs", 0)
let c = len(getline(lnum)) + 1
while IsInBrackets(lnum, c)
let [first_open_bracket, last_open_bracket, last_closed_bracket] = GetJuliaNestingBrackets(lnum, c)
let [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs] = GetJuliaNestingBrackets(lnum, c)
" First scenario: the previous line has a hanging open bracket:
" set the indentation to match the opening bracket (plus an extra space)
" unless we're in a function arguments list or alignment is disabled, in
" which case we just add an extra indent
if last_open_bracket != -1
let st = last_open_bracket
let ind = virtcol([lnum, st + 1])
if (!infuncargs && align_brackets) || (infuncargs && align_funcargs)
let st = last_open_bracket
let ind = virtcol([lnum, st + 1])
else
let ind = indent(lnum) + shiftwidth()
endif
" Second scenario: some multiline bracketed expression was closed in the
" previous line. But since we know we are still in a bracketed expression,
" we need to find the line where the bracket was open
" we need to find the line where the bracket was opened
elseif last_closed_bracket != -1
" we use the % command to skip back (tries to ues matchit if possible,
" otherwise resorts to vim's default, which is buggy but better than
" nothing)
call cursor(lnum, last_closed_bracket)
let percmap = maparg("%", "n")
if exists("g:loaded_matchit") && percmap =~# 'Match\%(it\|_wrapper\)'
normal %
else
normal! %
end
call JumpToMatch(lnum, last_closed_bracket)
if line(".") == lnum
" something wrong here, give up
let ind = indent(lnum)
@@ -354,15 +387,28 @@ function GetJuliaIndent()
endif
endif
" Third scenario: nothing special, or matchit not available: keep the indentation
" Third scenario: nothing special: keep the indentation
else
let ind = indent(lnum)
endif
" In case the current line starts with a closing bracket, we align it with
" the opening one.
" Does the current line starts with a closing bracket? Then depending on
" the situation we align it with the opening one, or we let the rest of
" the code figure it out (the case in which we're closing a function
" argument list is special-cased)
if JuliaMatch(v:lnum, getline(v:lnum), '[])}]', indent(v:lnum)) == indent(v:lnum) && ind > 0
return ind - 1
if !align_brackets && !align_funcargs
let ind = -1
elseif (align_brackets && getline(v:lnum)[indent(v:lnum)] != ')') || align_funcargs
return ind - 1
else " must be a ')' and align_brackets==1 and align_funcargs==0
call JumpToMatch(v:lnum, indent(v:lnum))
if IsFunctionArgPar(line("."), col("."))
let ind = -1
else
return ind - 1
endif
endif
endif
break
@@ -374,7 +420,7 @@ function GetJuliaIndent()
let [lnum,ind] = LastBlockIndent(lnum)
let c = len(getline(lnum)) + 1
if IsInBrackets(lnum, c)
let [first_open_bracket, last_open_bracket, last_closed_bracket] = GetJuliaNestingBrackets(lnum, c)
let [first_open_bracket, last_open_bracket, last_closed_bracket, infuncargs] = GetJuliaNestingBrackets(lnum, c)
let lim = first_open_bracket
endif
end
@@ -389,6 +435,55 @@ function GetJuliaIndent()
" Decrease indentation for each closed block in the current line
let ind -= shiftwidth() * num_closed_blocks
" Additional special case: multiline import/using/export statements
let prevline = getline(lnum)
" Are we in a multiline import/using/export statement, right below the
" opening line?
if IsInContinuationImportLine(v:lnum) && !IsInContinuationImportLine(lnum)
if get(g:, 'julia_indent_align_import', 1)
" if the opening line has a colon followed by non-comments, use it as
" reference point
let cind = JuliaMatch(lnum, prevline, ':', indent(lnum), lim)
" echo "cind=".string(cind) | sleep 1
if cind >= 0
let nonwhiteind = JuliaMatch(lnum, prevline, '\S', cind+1)
if nonwhiteind >= 0
" return match(prevline, '\S', cind+1) " a bit overkill...
return cind + 2
endif
else
" if the opening line is not a naked import/using/export statement, use
" it as reference
let iind = JuliaMatch(lnum, prevline, '\<import\|using\|export\>', indent(lnum), lim)
if iind >= 0
" assuming whitespace after using... so no `using(XYZ)` please!
let nonwhiteind = JuliaMatch(lnum, prevline, '\S', iind+6)
if nonwhiteind >= 0
return match(prevline, '\S', iind+6)
endif
endif
endif
endif
let ind += shiftwidth()
" Or did we just close a multiline import/using/export statement?
elseif !IsInContinuationImportLine(v:lnum) && IsInContinuationImportLine(lnum)
" find the starting line of the statement
let ilnum = 0
for iln in range(lnum-1, 1, -1)
if !IsInContinuationImportLine(iln)
let ilnum = iln
break
endif
endfor
if ilnum == 0
" something went horribly wrong, give up
let ind = indent(lnum)
endif
let ind = indent(ilnum)
endif
return ind
endfunction

View File

@@ -498,7 +498,7 @@ filetypes:
extensions:
- sdl
---
name: dockerfile
name: docker-compose
remote: ekalinin/Dockerfile.vim
glob: '**/docker-compose.vim'
filetypes:
@@ -1227,6 +1227,7 @@ filetypes:
linguist: PHP
extra_extensions:
- phtml
- php9
---
name: blade
remote: jwalton512/vim-blade
@@ -1417,7 +1418,7 @@ filetypes:
- cap
- opal
extra_filenames:
- Rantfile
- '[Rr]antfile'
- ".autotest"
- Cheffile
- KitchenSink
@@ -2228,7 +2229,7 @@ glob: "**/debchangelog.vim"
filetypes:
- name: debchangelog
patterns:
- pattern: changelog.Debian,changelog.dch,NEWS.Debian,NEWS.dch
- pattern: changelog.Debian,changelog.dch,NEWS.Debian,NEWS.dch,*/debian/changelog
---
name: chill
remote: vim/vim:runtime
@@ -5506,3 +5507,35 @@ filetypes:
- name: xf86conf
patterns:
- pattern: "XF86Config-4*,XF86Config*,*/xorg.conf.d/*.conf,xorg.conf,xorg.conf-4"
---
name: man
remote: vim/vim:runtime
glob: "**/man.vim"
filetypes:
- name: man
linguist: Roff Manpage
---
name: xpm
remote: vim/vim:runtime
glob: "**/xpm.vim"
filetypes:
- name: xpm
linguist: X PixMap
---
name: xpm2
remote: vim/vim:runtime
glob: "**/xpm2.vim"
filetypes:
- name: xpm2
patterns:
- pattern: '*.xpm2'
description: X PixMap 2
---
name: context
remote: vim/vim:runtime
glob: "**/context.vim"
filetypes:
- name: context
patterns:
- pattern: '*.mkii,*.mkiv,*.mkvi'
description: ConTeXt

View File

@@ -529,6 +529,29 @@ def extract(packages)
else
output << "- [#{package["name"]}](https://github.com/#{repo})"
end
names = nil
langs = package["filetypes"].map { |f| f["linguist"] }.compact
if langs.size > 0
names = print_and(langs)
end
files = nil
extensions = package["filetypes"].flat_map { |f| f["extensions"].reject { |e| e.match?(/_/) } }.compact
if extensions.size > 0
files = print_and(extensions)
end
if names && files
output[-1] << " (#{names} syntax highlighting for #{files} files)"
elsif names
output[-1] << " (#{names} syntax highlighting)"
elsif files
output[-1] << " (Syntax highlighting for #{files} files)"
end
progress
end
@@ -547,6 +570,16 @@ def extract(packages)
File.write('README.md', readme)
end
def print_and(list)
if list.size == 1
list[0]
elsif list.size > 10
list[0...5].join(", ") + " and #{list.size - 5} more"
else
list[0..-2].join(", ") + " and " + list[-1]
end
end
def generate_ftdetect(packages, heuristics)
FileUtils.mkdir_p('autoload/polyglot')

View File

@@ -5,7 +5,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'apache') == -1
" Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
" License: This file can be redistribued and/or modified under the same terms
" as Vim itself.
" Last Change: 2018-12-06
" Last Change: 2020 Oct 07
" Notes: Last synced with apache-2.2.3, version 1.x is no longer supported
" TODO: see particular FIXME's scattered through the file
" make it really linewise?
@@ -44,6 +44,8 @@ syn keyword apacheOption user group
syn match apacheOption "\<valid-user\>"
syn case match
syn keyword apacheMethodOption GET POST PUT DELETE CONNECT OPTIONS TRACE PATCH PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK contained
" Added as suggested by Mikko Koivunalho
syn keyword apacheMethodOption BASELINE-CONTROL CHECKIN CHECKOUT LABEL MERGE MKACTIVITY MKWORKSPACE REPORT UNCHECKOUT UPDATE VERSION-CONTROL contained
syn case ignore
syn match apacheSection "<\/\=\(Directory\|DirectoryMatch\|Files\|FilesMatch\|IfModule\|IfDefine\|Location\|LocationMatch\|VirtualHost\)[^>]*>" contains=apacheAnything
syn match apacheLimitSection "<\/\=\(Limit\|LimitExcept\)[^>]*>" contains=apacheLimitSectionKeyword,apacheMethodOption,apacheError

View File

@@ -21,7 +21,7 @@ syn match asteriskComment ";.*" contains=asteriskTodo
syn match asteriskContext "\[.\{-}\]"
syn match asteriskExten "^\s*\zsexten\s*=>\?\s*[^,]\+\ze," contains=asteriskPattern nextgroup=asteriskPriority
syn match asteriskExten "^\s*\zssame\s*=>\?\s*\ze" nextgroup=asteriskPriority
syn match asteriskExten "^\s*\(register\|channel\|ignorepat\|include\|\(no\)\?load\)\s*=>\?"
syn match asteriskExten "^\s*\(register\|channel\|ignorepat\|include\|l\?e\?switch\|\(no\)\?load\)\s*=>\?"
syn match asteriskPattern "_\(\[[[:alnum:]#*\-]\+\]\|[[:alnum:]#*]\)*\.\?" contained
syn match asteriskPattern "[^A-Za-z0-9,]\zs[[:alnum:]#*]\+\ze" contained
syn match asteriskApp ",\zs[a-zA-Z]\+\ze$"
@@ -41,7 +41,7 @@ syn match asteriskVarLen "\${_\{0,2}[[:alpha:]][[:alnum:]_]*(.*)}
syn match asteriskVarLen "(\zs[[:alpha:]][[:alnum:]_]*(.\{-})\ze=" contains=asteriskVar,asteriskVarLen,asteriskExp
syn match asteriskExp "\$\[.\{-}\]" contains=asteriskVar,asteriskVarLen,asteriskExp
syn match asteriskCodecsPermit "^\s*\(allow\|disallow\)\s*=\s*.*$" contains=asteriskCodecs
syn match asteriskCodecs "\(g723\|gsm\|ulaw\|alaw\|g726\|adpcm\|slin\|lpc10\|g729\|speex\|ilbc\|all\s*$\)"
syn match asteriskCodecs "\(vp9\|vp8\|h264\|h263p\|h263\|h261\|jpeg\|opus\|g722\|g723\|gsm\|ulaw\|alaw\|g719\|g726\|g726aal2\|siren7\|siren14\|adpcm\|slin\|lpc10\|g729\|speex\|ilbc\|wav\|all\s*$\)"
syn match asteriskError "^\(type\|auth\|permit\|deny\|bindaddr\|host\)\s*=.*$"
syn match asteriskType "^\zstype=\ze\<\(peer\|user\|friend\)\>$" contains=asteriskTypeType
syn match asteriskTypeType "\<\(peer\|user\|friend\)\>" contained

View File

@@ -6,7 +6,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cabal') == -1
" Maintainer: Marcin Szamotulski <profunctor@pm.me>
" Previous Maintainer: Vincent Berthoux <twinside@gmail.com>
" File Types: .cabal
" Last Change: 15 May 2018
" Last Change: 3 Oct 2020
" v1.5: Incorporated changes from
" https://github.com/sdiehl/haskell-vim-proto/blob/master/vim/syntax/cabal.vim
" Use `syn keyword` instead of `syn match`.
@@ -64,11 +64,12 @@ syn keyword cabalCategory contained
\ source-repository
\ flag
\ custom-setup
\ common
syn match cabalCategoryTitle contained /[^{]*\ze{\?/
syn match cabalCategoryRegion
\ contains=cabalCategory,cabalCategoryTitle
\ nextgroup=cabalCategory skipwhite
\ /^\c\s*\(contained\|executable\|library\|benchmark\|test-suite\|source-repository\|flag\|custom-setup\)\+\s*\%(.*$\|$\)/
\ /^\c\s*\(contained\|executable\|library\|benchmark\|test-suite\|source-repository\|flag\|custom-setup\|common\)\+\s*\%(.*$\|$\)/
syn keyword cabalTruth true false
" cabalStatementRegion which limits the scope of cabalStatement keywords, this
@@ -78,6 +79,7 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion
\ default-language
\ default-extensions
\ author
\ autogen-modules
\ branch
\ bug-reports
\ build-depends
@@ -112,6 +114,7 @@ syn keyword cabalStatement contained containedin=cabalStatementRegion
\ homepage
\ hs-source-dirs
\ hugs-options
\ import
\ include-dirs
\ includes
\ install-includes

145
syntax/context.vim Normal file
View File

@@ -0,0 +1,145 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'context') == -1
" Vim syntax file
" Language: ConTeXt typesetting engine
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
" Former Maintainers: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2016 Oct 16
if exists("b:current_syntax")
finish
endif
runtime! syntax/plaintex.vim
unlet b:current_syntax
let s:cpo_save = &cpo
set cpo&vim
" Dictionary of (filetype, group) pairs to highlight between \startGROUP \stopGROUP.
let s:context_include = get(b:, 'context_include', get(g:, 'context_include', {'xml': 'XML'}))
" For backward compatibility (g:context_include used to be a List)
if type(s:context_include) ==# type([])
let g:context_metapost = (index(s:context_include, 'mp') != -1)
let s:context_include = filter(
\ {'c': 'C', 'javascript': 'JS', 'ruby': 'Ruby', 'xml': 'XML'},
\ { k,_ -> index(s:context_include, k) != -1 }
\ )
endif
syn iskeyword @,48-57,a-z,A-Z,192-255
syn spell toplevel
" ConTeXt options, i.e., [...] blocks
syn region contextOptions matchgroup=contextDelimiter start='\[' end=']\|\ze\\stop' skip='\\\[\|\\\]' contains=ALLBUT,contextBeginEndLua,@Spell
" Highlight braces
syn match contextDelimiter '[{}]'
" Comments
syn match contextComment '\\\@<!\%(\\\\\)*\zs%.*$' display contains=initexTodo
syn match contextComment '^\s*%[CDM].*$' display contains=initexTodo
syn match contextBlockDelim '\\\%(start\|stop\)\a\+' contains=@NoSpell
syn region contextEscaped matchgroup=contextPreProc start='\\type\%(\s*\|\n\)*\z([^A-Za-z%]\)' end='\z1'
syn region contextEscaped matchgroup=contextPreProc start='\\type\=\%(\s\|\n\)*{' end='}'
syn region contextEscaped matchgroup=contextPreProc start='\\type\=\%(\s*\|\n\)*<<' end='>>'
syn region contextEscaped matchgroup=contextPreProc
\ start='\\start\z(\a*\%(typing\|typen\)\)'
\ end='\\stop\z1' contains=plaintexComment keepend
syn region contextEscaped matchgroup=contextPreProc start='\\\h\+Type\%(\s\|\n\)*{' end='}'
syn region contextEscaped matchgroup=contextPreProc start='\\Typed\h\+\%(\s\|\n\)*{' end='}'
syn match contextBuiltin display contains=@NoSpell
\ '\\\%(unprotect\|protect\|unexpanded\)\>'
syn match contextPreProc '^\s*\\\%(start\|stop\)\=\%(component\|environment\|project\|product\)\>'
\ contains=@NoSpell
if get(b:, 'context_metapost', get(g:, 'context_metapost', 1))
let b:mp_metafun_macros = 1 " Highlight MetaFun keywords
syn include @mpTop syntax/mp.vim
unlet b:current_syntax
syn region contextMPGraphic matchgroup=contextBlockDelim
\ start='\\start\z(MP\%(clip\|code\|definitions\|drawing\|environment\|extensions\|inclusions\|initializations\|page\|\)\)\>.*$'
\ end='\\stop\z1'
\ contains=@mpTop,@NoSpell
syn region contextMPGraphic matchgroup=contextBlockDelim
\ start='\\start\z(\%(\%[re]usable\|use\|unique\|static\)MPgraphic\|staticMPfigure\|uniqueMPpagegraphic\)\>.*$'
\ end='\\stop\z1'
\ contains=@mpTop,@NoSpell
endif
if get(b:, 'context_lua', get(g:, 'context_lua', 1))
syn include @luaTop syntax/lua.vim
unlet b:current_syntax
syn region contextLuaCode matchgroup=contextBlockDelim
\ start='\\startluacode\>'
\ end='\\stopluacode\>' keepend
\ contains=@luaTop,@NoSpell
syn match contextDirectLua "\\\%(directlua\|ctxlua\)\>\%(\s*%.*$\)\="
\ nextgroup=contextBeginEndLua skipwhite skipempty
\ contains=initexComment
syn region contextBeginEndLua matchgroup=contextSpecial
\ start="{" end="}" skip="\\[{}]"
\ contained contains=@luaTop,@NoSpell
endif
for synname in keys(s:context_include)
execute 'syn include @' . synname . 'Top' 'syntax/' . synname . '.vim'
unlet b:current_syntax
execute 'syn region context' . s:context_include[synname] . 'Code'
\ 'matchgroup=contextBlockDelim'
\ 'start=+\\start' . s:context_include[synname] . '+'
\ 'end=+\\stop' . s:context_include[synname] . '+'
\ 'contains=@' . synname . 'Top,@NoSpell'
endfor
syn match contextSectioning '\\\%(start\|stop\)\=\%(\%(sub\)*section\|\%(sub\)*subject\|chapter\|part\|component\|product\|title\)\>'
\ contains=@NoSpell
syn match contextSpecial '\\crlf\>\|\\par\>\|-\{2,3}\||[<>/]\=|'
\ contains=@NoSpell
syn match contextSpecial /\\[`'"]/
syn match contextSpecial +\\char\%(\d\{1,3}\|'\o\{1,3}\|"\x\{1,2}\)\>+
\ contains=@NoSpell
syn match contextSpecial '\^\^.'
syn match contextSpecial '`\%(\\.\|\^\^.\|.\)'
syn match contextStyle '\\\%(em\|ss\|hw\|cg\|mf\)\>'
\ contains=@NoSpell
syn match contextFont '\\\%(CAP\|Cap\|cap\|Caps\|kap\|nocap\)\>'
\ contains=@NoSpell
syn match contextFont '\\\%(Word\|WORD\|Words\|WORDS\)\>'
\ contains=@NoSpell
syn match contextFont '\\\%(vi\{1,3}\|ix\|xi\{0,2}\)\>'
\ contains=@NoSpell
syn match contextFont '\\\%(tf\|b[si]\|s[cl]\|os\)\%(xx\|[xabcd]\)\=\>'
\ contains=@NoSpell
hi def link contextOptions Typedef
hi def link contextComment Comment
hi def link contextBlockDelim Keyword
hi def link contextBuiltin Keyword
hi def link contextDelimiter Delimiter
hi def link contextEscaped String
hi def link contextPreProc PreProc
hi def link contextSectioning PreProc
hi def link contextSpecial Special
hi def link contextType Type
hi def link contextStyle contextType
hi def link contextFont contextType
hi def link contextDirectLua Keyword
let b:current_syntax = "context"
let &cpo = s:cpo_save
unlet s:cpo_save
endif

View File

@@ -141,7 +141,7 @@ syn match crystalFloat "\<\d[[:digit:]_]*\%(\.\d[[:digit:]_]*\)\=\%([eE][-+]
syn match crystalInvalidInteger "\%(\.\|[eE][+-]\)\@2<!\<0\d\+\>" contained containedin=crystalFloat,crystalInteger display
" Identifiers
syn match crystalLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
syn match crystalLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display
syn match crystalBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent
syn match crystalTypeName "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained

View File

@@ -651,7 +651,7 @@ endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8
endif

View File

@@ -1,4 +1,4 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'docker-compose') == -1
" Vim syntax file
" Language: Dockerfile

49
syntax/dockerfile.vim Normal file
View File

@@ -0,0 +1,49 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
" dockerfile.vim - Syntax highlighting for Dockerfiles
" Maintainer: Honza Pokorny <https://honza.ca>
" Last Change: 2020 Feb 11
" License: BSD
" https://docs.docker.com/engine/reference/builder/
if exists("b:current_syntax")
finish
endif
syntax include @JSON syntax/json.vim
unlet b:current_syntax
syntax include @Shell syntax/sh.vim
unlet b:current_syntax
syntax case ignore
syntax match dockerfileLinePrefix /\v^\s*(ONBUILD\s+)?\ze\S/ contains=dockerfileKeyword nextgroup=dockerfileInstruction skipwhite
syntax region dockerfileFrom matchgroup=dockerfileKeyword start=/\v^\s*(FROM)\ze(\s|$)/ skip=/\v\\\_./ end=/\v((^|\s)AS(\s|$)|$)/ contains=dockerfileOption
syntax keyword dockerfileKeyword contained ADD ARG CMD COPY ENTRYPOINT ENV EXPOSE HEALTHCHECK LABEL MAINTAINER ONBUILD RUN SHELL STOPSIGNAL USER VOLUME WORKDIR
syntax match dockerfileOption contained /\v(^|\s)\zs--\S+/
syntax match dockerfileInstruction contained /\v<(\S+)>(\s+--\S+)*/ contains=dockerfileKeyword,dockerfileOption skipwhite nextgroup=dockerfileValue
syntax match dockerfileInstruction contained /\v<(ADD|COPY)>(\s+--\S+)*/ contains=dockerfileKeyword,dockerfileOption skipwhite nextgroup=dockerfileJSON
syntax match dockerfileInstruction contained /\v<(HEALTHCHECK)>(\s+--\S+)*/ contains=dockerfileKeyword,dockerfileOption skipwhite nextgroup=dockerfileInstruction
syntax match dockerfileInstruction contained /\v<(CMD|ENTRYPOINT|RUN)>/ contains=dockerfileKeyword skipwhite nextgroup=dockerfileShell
syntax match dockerfileInstruction contained /\v<(CMD|ENTRYPOINT|RUN)>\ze\s+\[/ contains=dockerfileKeyword skipwhite nextgroup=dockerfileJSON
syntax match dockerfileInstruction contained /\v<(SHELL|VOLUME)>/ contains=dockerfileKeyword skipwhite nextgroup=dockerfileJSON
syntax region dockerfileString contained start=/\v"/ skip=/\v\\./ end=/\v"/
syntax region dockerfileJSON contained keepend start=/\v\[/ skip=/\v\\\_./ end=/\v$/ contains=@JSON
syntax region dockerfileShell contained keepend start=/\v/ skip=/\v\\\_./ end=/\v$/ contains=@Shell
syntax region dockerfileValue contained keepend start=/\v/ skip=/\v\\\_./ end=/\v$/ contains=dockerfileString
syntax region dockerfileComment start=/\v^\s*#/ end=/\v$/
set commentstring=#\ %s
hi def link dockerfileString String
hi def link dockerfileKeyword Keyword
hi def link dockerfileComment Comment
hi def link dockerfileOption Special
let b:current_syntax = "dockerfile"
endif

View File

@@ -2,19 +2,18 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fortran') == -1
" Vim syntax file
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
" Version: 102
" Last Change: 2020 Apr 20
" Patched By: Eisuke Kawashima
" Version: (v103) 2020 October 07
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
" Usage: For instructions, do :help fortran-syntax from Vim
" Credits:
" Version 0.1 for Fortran 95 was created (April 2000) by Ajit Thakkar from the
" Fortran 77 syntax file by Mario Eusebio and Preben Guldberg.
" Version 0.1 for Fortran 95 was created in April 2000 by Ajit Thakkar from an
" older Fortran 77 syntax file by Mario Eusebio and Preben Guldberg.
" Since then, useful suggestions and contributions have been made, in order, by:
" Andrej Panjkov, Bram Moolenaar, Thomas Olsen, Michael Sternberg, Christian Reile,
" Walter Dieudonné, Alexander Wagner, Roman Bertle, Charles Rendleman,
" Andrew Griffiths, Joe Krahn, Hendrik Merx, Matt Thompson, Jan Hermann,
" Stefano Zaghi, Vishnu V. Krishnan, Judicaël Grasset, and Takuma Yoshida
" Stefano Zaghi, Vishnu V. Krishnan, Judicaël Grasset, Takuma Yoshida,
" Eisuke Kawashima, and André Chalella.`
if exists("b:current_syntax")
finish
@@ -104,6 +103,8 @@ syn match fortranUnitHeader "\<end\>"
syn match fortranType "\<character\>"
syn match fortranType "\<complex\>"
syn match fortranType "\<integer\>"
syn match fortranType "\<real\>"
syn match fortranType "\<logical\>"
syn keyword fortranType intrinsic
syn match fortranType "\<implicit\>"
syn keyword fortranStructure dimension
@@ -151,11 +152,9 @@ syn keyword fortranExtraIntrinsic algama cdabs cdcos cdexp cdlog cdsin cdsqrt cq
syn keyword fortranIntrinsic abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log log10 max min nint sign sin sinh sqrt tan tanh
syn match fortranIntrinsic "\<len\s*[(,]"me=s+3
syn match fortranIntrinsic "\<real\s*("me=s+4
syn match fortranType "\<implicit\s\+real"
syn match fortranType "^\s*real\>"
syn match fortranIntrinsic "\<logical\s*("me=s+7
syn match fortranType "\<implicit\s\+logical"
syn match fortranType "^\s*logical\>"
syn match fortranType "\<implicit\s\+real\>"
syn match fortranType "\<implicit\s\+logical\>"
"Numbers of various sorts
" Integers
@@ -170,6 +169,12 @@ syn match fortranFloatIll display "\<\d\+\.\([deq][-+]\=\d\+\)\=\(_\a\w*\)\=\>"
syn match fortranFloatIll display "\<\d\+\.\d\+\([dq][-+]\=\d\+\)\=\(_\a\w*\)\=\>"
" floating point number
syn match fortranFloat display "\<\d\+\.\d\+\(e[-+]\=\d\+\)\=\(_\a\w*\)\=\>"
" binary number
syn match fortranBinary display "b["'][01]\+["']"
" octal number
syn match fortranOctal display "o["'][0-7]\+["']"
" hexadecimal number
syn match fortranHex display "z["'][0-9A-F]\+["']"
" Numbers in formats
syn match fortranFormatSpec display "\d*f\d\+\.\d\+"
syn match fortranFormatSpec display "\d*e[sn]\=\d\+\.\d\+\(e\d+\>\)\="
@@ -217,7 +222,6 @@ syn match fortranUnitHeader "\<submodule\>"
syn keyword fortranUnitHeader use only contains
syn keyword fortranUnitHeader result operator assignment
syn match fortranUnitHeader "\<interface\>"
syn match fortranUnitHeader "\<recursive\>"
syn keyword fortranKeyword allocate deallocate nullify cycle exit
syn match fortranConditional "\<select\>"
syn keyword fortranConditional case default where elsewhere
@@ -276,6 +280,7 @@ syn keyword fortranIntrinsic null cpu_time
syn match fortranType "\<elemental\>"
syn match fortranType "\<pure\>"
syn match fortranType "\<impure\>"
syn match fortranType "\<recursive\>"
if exists("fortran_more_precise")
syn match fortranConstructName "\(\<end\s*forall\s\+\)\@15<=\a\w*\>"
endif
@@ -455,6 +460,9 @@ hi def link fortranTodo Todo
hi def link fortranContinueMark Special
hi def link fortranString String
hi def link fortranNumber Number
hi def link fortranBinary Number
hi def link fortranOctal Number
hi def link fortranHex Number
hi def link fortranOperator Operator
hi def link fortranBoolean Boolean
hi def link fortranLabelError Error

View File

@@ -76,7 +76,7 @@ syntax cluster juliaExpressions contains=@juliaParItems,@juliaStringItems,@juli
syntax cluster juliaExprsPrintf contains=@juliaExpressions,@juliaPrintfItems
syntax cluster juliaParItems contains=juliaParBlock,juliaSqBraIdxBlock,juliaSqBraBlock,juliaCurBraBlock,juliaQuotedParBlock,juliaQuotedQMarkPar
syntax cluster juliaKeywordItems contains=juliaKeyword,juliaInfixKeyword,juliaRepKeyword,juliaTypedef
syntax cluster juliaKeywordItems contains=juliaKeyword,juliaImportLine,juliaInfixKeyword,juliaRepKeyword
syntax cluster juliaBlocksItems contains=juliaConditionalBlock,juliaWhileBlock,juliaForBlock,juliaBeginBlock,juliaFunctionBlock,juliaMacroBlock,juliaQuoteBlock,juliaTypeBlock,juliaImmutableBlock,juliaExceptionBlock,juliaLetBlock,juliaDoBlock,juliaModuleBlock,juliaStructBlock,juliaMutableStructBlock,juliaAbstractBlock,juliaPrimitiveBlock
syntax cluster juliaTypesItems contains=juliaBaseTypeBasic,juliaBaseTypeNum,juliaBaseTypeC,juliaBaseTypeError,juliaBaseTypeIter,juliaBaseTypeString,juliaBaseTypeArray,juliaBaseTypeDict,juliaBaseTypeSet,juliaBaseTypeIO,juliaBaseTypeProcess,juliaBaseTypeRange,juliaBaseTypeRegex,juliaBaseTypeFact,juliaBaseTypeFact,juliaBaseTypeSort,juliaBaseTypeRound,juliaBaseTypeSpecial,juliaBaseTypeRandom,juliaBaseTypeDisplay,juliaBaseTypeTime,juliaBaseTypeOther
@@ -126,8 +126,14 @@ syntax region juliaSqBraIdxBlock matchgroup=juliaParDelim start="\[" end="\]" c
exec 'syntax region juliaSqBraBlock matchgroup=juliaParDelim start="\%(^\|\s\|' . s:operators . '\)\@'.s:d(3).'<=\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS'
syntax region juliaCurBraBlock matchgroup=juliaParDelim start="{" end="}" contains=@juliaExpressions
exec 'syntax match juliaKeyword display "'.s:nodot.'\<\%(return\|local\|global\|import\%(all\)\?\|export\|using\|const\|where\)\>"'
exec 'syntax match juliaKeyword display "'.s:nodot.'\<\%(return\|local\|global\|const\|where\)\>"'
syntax match juliaInfixKeyword display "\%(=\s*\)\@<!\<\%(in\|isa\)\>\S\@!\%(\s*=\)\@!"
" The import/export/using keywords introduce a sort of special parsing
" environment with its own rules
exec 'syntax region juliaImportLine matchgroup=juliaKeyword excludenl start="'.s:nodot.'\<\%(import\|using\|export\)\>" skip="\%(\%(\<\%(import\|using\|export\)\>\)\|^\)\@'.s:d(6).'<=$" end="$" end="\%([])}]\)\@=" contains=@juliaExpressions,juliaAsKeyword,@juliaContinuationItems,juliaMacroName'
syntax match juliaAsKeyword display contained "\<as\>"
exec 'syntax match juliaRepKeyword display "'.s:nodot.'\<\%(break\|continue\)\>"'
exec 'syntax region juliaConditionalBlock matchgroup=juliaConditional start="'.s:nodot.'\<if\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock fold'
exec 'syntax region juliaConditionalEIBlock matchgroup=juliaConditional transparent contained start="'.s:nodot.'\<elseif\>" end="'.s:nodot.'\<\%(end\|else\|elseif\)\>"me=s-1 contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock'
@@ -139,17 +145,16 @@ exec 'syntax region juliaFunctionBlock matchgroup=juliaBlKeyword start="'.s:nod
exec 'syntax region juliaMacroBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<macro\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
exec 'syntax region juliaQuoteBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<quote\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
exec 'syntax region juliaStructBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<struct\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
exec 'syntax region juliaMutableStructBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<mutable struct\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
exec 'syntax region juliaMutableStructBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<mutable\s\+struct\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
exec 'syntax region juliaLetBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<let\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
exec 'syntax region juliaDoBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<do\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions fold'
exec 'syntax region juliaModuleBlock matchgroup=juliaBlKeyword start="\%(\%(\.\s*\)\@'.s:d(6).'<!\|\%(@\s*\.\s*\)\@'.s:d(6).'<=\)\<\%(bare\)\?module\>" end="\<end\>" contains=@juliaExpressions fold'
exec 'syntax region juliaExceptionBlock matchgroup=juliaException start="'.s:nodot.'\<try\>" end="'.s:nodot.'\<end\>" contains=@juliaExpressions,juliaCatchBlock,juliaFinallyBlock fold'
exec 'syntax region juliaCatchBlock matchgroup=juliaException transparent contained start="'.s:nodot.'\<catch\>" end="'.s:nodot.'\<end\>"me=s-1 contains=@juliaExpressions,juliaFinallyBlock'
exec 'syntax region juliaFinallyBlock matchgroup=juliaException transparent contained start="'.s:nodot.'\<finally\>" end="'.s:nodot.'\<end\>"me=s-1 contains=@juliaExpressions'
exec 'syntax match juliaTypedef "'.s:nodot.'\<\%(abstract\|typealias\|bitstype\)\>"'
" AbstractBlock needs to come after to take precedence
exec 'syntax region juliaAbstractBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<abstract type\>" end="'.s:nodot.'\<end\>" fold contains=@juliaExpressions'
exec 'syntax region juliaPrimitiveBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<primitive type\>" end="'.s:nodot.'\<end\>" fold contains=@juliaExpressions'
exec 'syntax region juliaAbstractBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<abstract\s\+type\>" end="'.s:nodot.'\<end\>" fold contains=@juliaExpressions'
exec 'syntax region juliaPrimitiveBlock matchgroup=juliaBlKeyword start="'.s:nodot.'\<primitive\s\+type\>" end="'.s:nodot.'\<end\>" fold contains=@juliaExpressions'
exec 'syntax region juliaComprehensionFor matchgroup=juliaComprehensionFor transparent contained start="\%([^[:space:],;:({[]\_s*\)\@'.s:d(80).'<=\<for\>" end="\ze[]);]" contains=@juliaExpressions,juliaComprehensionIf,juliaComprehensionFor'
exec 'syntax match juliaComprehensionIf contained "'.s:nodot.'\<if\>"'
@@ -275,7 +280,7 @@ syntax region juliatextString matchgroup=juliaStringDelim start=+\<text\z("\("
syntax region juliahtmlString matchgroup=juliaStringDelim start=+\<html\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialCharsRaw
syntax region juliaint128String matchgroup=juliaStringDelim start=+\<u\?int128\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialCharsRaw
syntax region juliaDocString matchgroup=juliaDocStringDelim start=+^"""+ skip=+\%(\\\\\)*\\"+ end=+"""+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckDocStrings
syntax region juliaDocString matchgroup=juliaDocStringDelim fold start=+^"""+ skip=+\%(\\\\\)*\\"+ end=+"""+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckDocStrings
exec 'syntax region juliaPrintfMacro contained transparent start="@s\?printf(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaPrintfParBlock'
syntax region juliaPrintfMacro contained transparent start="@s\?printf\s\+" end="\ze\%([])};#]\|$\|\<for\>\)" contains=@juliaExprsPrintf,juliaMacro,juliaSymbolS,juliaQuotedParBlockS
@@ -333,13 +338,25 @@ exec 'syntax region juliaQuotedParBlock matchgroup=juliaQParDelim start="' . s
exec 'syntax match juliaQuotedQMarkPar "' . s:quoting_colon . '(\s*?\s*)" contains=juliaQuotedQMark'
exec 'syntax region juliaQuotedParBlockS matchgroup=juliaQParDelim contained start="' . s:quoting_colonS . '(" end=")" contains=@juliaExpressions'
" force precedence over Symbols
syntax match juliaOperator display "::"
syntax region juliaCommentL matchgroup=juliaCommentDelim start="#\ze\%([^=]\|$\)" end="$" keepend contains=juliaTodo,@juliaSpellcheckComments
syntax region juliaCommentM matchgroup=juliaCommentDelim start="#=\ze\%([^#]\|$\)" end="=#" contains=juliaTodo,juliaCommentM,@juliaSpellcheckComments
syntax region juliaCommentL matchgroup=juliaCommentDelim excludenl start="#\ze\%([^=]\|$\)" end="$" contains=juliaTodo,juliaCommentM,@juliaSpellcheckComments
syntax region juliaCommentM matchgroup=juliaCommentDelim fold start="#=\ze\%([^#]\|$\)" end="=#" contains=juliaTodo,juliaCommentM,@juliaSpellcheckComments
syntax keyword juliaTodo contained TODO FIXME XXX
" detect an end-of-line with only whitespace or comments before it
let s:eol = '\s*\%(\%(\%(#=\%(=#\@!\|[^=]\|\n\)\{-}=#\)\s*\)\+\)\?\%(#=\@!.*\)\?\n'
" a trailing comma, or colon, or an empty line in an import/using/export
" multi-line command. Used to recognize the as keyword, and for indentation
" (this needs to take precedence over normal commas and colons, and comments)
syntax cluster juliaContinuationItems contains=juliaContinuationComma,juliaContinuationColon,juliaContinuationNone
exec 'syntax region juliaContinuationComma matchgroup=juliaComma contained start=",\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems'
exec 'syntax region juliaContinuationColon matchgroup=juliaColon contained start=":\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems'
exec 'syntax region juliaContinuationNone matchgroup=NONE contained start="\%(\<\%(import\|using\|export\)\>\|^\)\@'.s:d(6).'<=\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems,juliaAsKeyword'
exec 'syntax match juliaMacroName "@' . s:idregex . '\%(\.' . s:idregex . '\)*"'
" the following are disabled by default, but
" can be enabled by entering e.g.
@@ -350,15 +367,17 @@ hi def link juliaComma juliaNone
hi def link juliaColon juliaOperator
hi def link juliaMacroName juliaMacro
hi def link juliaKeyword Keyword
hi def link juliaInfixKeyword Keyword
hi def link juliaAsKeyword Keyword
hi def link juliaRepKeyword Keyword
hi def link juliaBlKeyword Keyword
hi def link juliaConditional Conditional
hi def link juliaRepeat Repeat
hi def link juliaException Exception
hi def link juliaTypedef Keyword
hi def link juliaOuter Keyword
hi def link juliaBaseTypeBasic Type
hi def link juliaBaseTypeNum Type

View File

@@ -4,14 +4,13 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
" Language: less
" Maintainer: Alessandro Vioni <jenoma@gmail.com>
" URL: https://github.com/genoma/vim-less
" Last Change: 2014 November 24
" Last Change: 2020 Sep 29
if exists("b:current_syntax")
finish
endif
runtime! syntax/css.vim
runtime! after/syntax/css.vim
syn case ignore

60
syntax/man.vim Normal file
View File

@@ -0,0 +1,60 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'man') == -1
" Vim syntax file
" Language: Man page
" Maintainer: Jason Franklin <vim@justemail.net>
" Previous Maintainer: SungHyun Nam <goweol@gmail.com>
" Previous Maintainer: Gautam H. Mudunuri <gmudunur@informatica.com>
" Version Info:
" Last Change: 2020 Sep 19
" Additional highlighting by Johannes Tanzler <johannes.tanzler@aon.at>:
" * manSubHeading
" * manSynopsis (only for sections 2 and 3)
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
" Get the CTRL-H syntax to handle backspaced text
runtime! syntax/ctrlh.vim
syn case ignore
syn match manReference "\f\+([1-9][a-z]\=)"
syn match manSectionHeading "^\a.*$"
syn match manSubHeading "^\s\{3\}\a.*$"
syn match manOptionDesc "^\s*[+-][a-z0-9]\S*"
syn match manLongOptionDesc "^\s*--[a-z0-9-]\S*"
" syn match manHistory "^[a-z].*last change.*$"
syn match manHeader '\%1l.*'
exe 'syn match manFooter ''\%' . line('$') . 'l.*'''
if getline(1) =~ '^[a-zA-Z_]\+([23])'
syntax include @cCode <sfile>:p:h/c.vim
syn match manCFuncDefinition display "\<\h\w*\>\s*("me=e-1 contained
syn region manSynopsis start="^SYNOPSIS"hs=s+8 end="^\u\+\s*$"me=e-12 keepend contains=manSectionHeading,@cCode,manCFuncDefinition
endif
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
hi def link manHeader Title
hi def link manFooter PreProc
hi def link manSectionHeading Statement
hi def link manOptionDesc Constant
hi def link manLongOptionDesc Constant
hi def link manReference PreProc
hi def link manSubHeading Function
hi def link manCFuncDefinition Function
let b:current_syntax = "man"
" vim:ts=8 sts=2 sw=2:
endif

View File

@@ -63,7 +63,7 @@ syn keyword qmlLabel case default
syn keyword qmlException try catch finally throw
syn keyword qmlMessage alert confirm prompt status
syn keyword qmlGlobal self
syn keyword qmlDeclaration property signal readonly
syn keyword qmlDeclaration property signal component readonly required
syn keyword qmlReserved abstract boolean byte char class const debugger enum export extends final float goto implements import interface long native package pragma private protected public short static super synchronized throws transient volatile
if get(g:, 'qml_fold', 0)

142
syntax/xpm.vim Normal file
View File

@@ -0,0 +1,142 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'xpm') == -1
" Vim syntax file
" Language: X Pixmap
" Maintainer: Ronald Schild <rs@scutum.de>
" Last Change: 2017 Feb 01
" Version: 5.4n.1
" Jemma Nelson added termguicolors support
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
syn keyword xpmType char
syn keyword xpmStorageClass static
syn keyword xpmTodo TODO FIXME XXX contained
syn region xpmComment start="/\*" end="\*/" contains=xpmTodo
syn region xpmPixelString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@xpmColors
if has("gui_running") || has("termguicolors") && &termguicolors
let color = ""
let chars = ""
let colors = 0
let cpp = 0
let n = 0
let i = 1
while i <= line("$") " scanning all lines
let s = matchstr(getline(i), '".\{-1,}"')
if s != "" " does line contain a string?
if n == 0 " first string is the Values string
" get the 3rd value: colors = number of colors
let colors = substitute(s, '"\s*\d\+\s\+\d\+\s\+\(\d\+\).*"', '\1', '')
" get the 4th value: cpp = number of character per pixel
let cpp = substitute(s, '"\s*\d\+\s\+\d\+\s\+\d\+\s\+\(\d\+\).*"', '\1', '')
if cpp =~ '[^0-9]'
break " if cpp is not made of digits there must be something wrong
endif
" Highlight the Values string as normal string (no pixel string).
" Only when there is no slash, it would terminate the pattern.
if s !~ '/'
exe 'syn match xpmValues /' . s . '/'
endif
hi link xpmValues String
let n = 1 " n = color index
elseif n <= colors " string is a color specification
" get chars = <cpp> length string representing the pixels
" (first incl. the following whitespace)
let chars = substitute(s, '"\(.\{'.cpp.'}\s\).*"', '\1', '')
" now get color, first try 'c' key if any (color visual)
let color = substitute(s, '".*\sc\s\+\(.\{-}\)\s*\(\(g4\=\|[ms]\)\s.*\)*\s*"', '\1', '')
if color == s
" no 'c' key, try 'g' key (grayscale with more than 4 levels)
let color = substitute(s, '".*\sg\s\+\(.\{-}\)\s*\(\(g4\|[ms]\)\s.*\)*\s*"', '\1', '')
if color == s
" next try: 'g4' key (4-level grayscale)
let color = substitute(s, '".*\sg4\s\+\(.\{-}\)\s*\([ms]\s.*\)*\s*"', '\1', '')
if color == s
" finally try 'm' key (mono visual)
let color = substitute(s, '".*\sm\s\+\(.\{-}\)\s*\(s\s.*\)*\s*"', '\1', '')
if color == s
let color = ""
endif
endif
endif
endif
" Vim cannot handle RGB codes with more than 6 hex digits
if color =~ '#\x\{10,}$'
let color = substitute(color, '\(\x\x\)\x\x', '\1', 'g')
elseif color =~ '#\x\{7,}$'
let color = substitute(color, '\(\x\x\)\x', '\1', 'g')
" nor with 3 digits
elseif color =~ '#\x\{3}$'
let color = substitute(color, '\(\x\)\(\x\)\(\x\)', '0\10\20\3', '')
endif
" escape meta characters in patterns
let s = escape(s, '/\*^$.~[]')
let chars = escape(chars, '/\*^$.~[]')
" now create syntax items
" highlight the color string as normal string (no pixel string)
exe 'syn match xpmCol'.n.'Def /'.s.'/ contains=xpmCol'.n.'inDef'
exe 'hi link xpmCol'.n.'Def String'
" but highlight the first whitespace after chars in its color
exe 'syn match xpmCol'.n.'inDef /"'.chars.'/hs=s+'.(cpp+1).' contained'
exe 'hi link xpmCol'.n.'inDef xpmColor'.n
" remove the following whitespace from chars
let chars = substitute(chars, '.$', '', '')
" and create the syntax item contained in the pixel strings
exe 'syn match xpmColor'.n.' /'.chars.'/ contained'
exe 'syn cluster xpmColors add=xpmColor'.n
" if no color or color = "None" show background
if color == "" || substitute(color, '.*', '\L&', '') == 'none'
exe 'hi xpmColor'.n.' guifg=bg'
exe 'hi xpmColor'.n.' guibg=NONE'
elseif color !~ "'"
exe 'hi xpmColor'.n." guifg='".color."'"
exe 'hi xpmColor'.n." guibg='".color."'"
endif
let n = n + 1
else
break " no more color string
endif
endif
let i = i + 1
endwhile
unlet color chars colors cpp n i s
endif " has("gui_running") || has("termguicolors") && &termguicolors
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
hi def link xpmType Type
hi def link xpmStorageClass StorageClass
hi def link xpmTodo Todo
hi def link xpmComment Comment
hi def link xpmPixelString String
let b:current_syntax = "xpm"
" vim: ts=8:sw=3:noet:
endif

157
syntax/xpm2.vim Normal file
View File

@@ -0,0 +1,157 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'xpm2') == -1
" Vim syntax file
" Language: X Pixmap v2
" Maintainer: Steve Wall (hitched97@velnet.com)
" Last Change: 2017 Feb 01
" (Dominique Pelle added @Spell)
" Version: 5.8
" Jemma Nelson added termguicolors support
"
" Made from xpm.vim by Ronald Schild <rs@scutum.de>
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
syn region xpm2PixelString start="^" end="$" contains=@xpm2Colors
syn keyword xpm2Todo TODO FIXME XXX contained
syn match xpm2Comment "\!.*$" contains=@Spell,xpm2Todo
command -nargs=+ Hi hi def <args>
if has("gui_running") || has("termguicolors") && &termguicolors
let color = ""
let chars = ""
let colors = 0
let cpp = 0
let n = 0
let i = 1
while i <= line("$") " scanning all lines
let s = getline(i)
if match(s,"\!.*$") != -1
let s = matchstr(s, "^[^\!]*")
endif
if s != "" " does line contain a string?
if n == 0 " first string is the Values string
" get the 3rd value: colors = number of colors
let colors = substitute(s, '\s*\d\+\s\+\d\+\s\+\(\d\+\).*', '\1', '')
" get the 4th value: cpp = number of character per pixel
let cpp = substitute(s, '\s*\d\+\s\+\d\+\s\+\d\+\s\+\(\d\+\).*', '\1', '')
if cpp =~ '[^0-9]'
break " if cpp is not made of digits there must be something wrong
endif
" Highlight the Values string as normal string (no pixel string).
" Only when there is no slash, it would terminate the pattern.
if s !~ '/'
exe 'syn match xpm2Values /' . s . '/'
endif
hi def link xpm2Values Statement
let n = 1 " n = color index
elseif n <= colors " string is a color specification
" get chars = <cpp> length string representing the pixels
" (first incl. the following whitespace)
let chars = substitute(s, '\(.\{'.cpp.'}\s\+\).*', '\1', '')
" now get color, first try 'c' key if any (color visual)
let color = substitute(s, '.*\sc\s\+\(.\{-}\)\s*\(\(g4\=\|[ms]\)\s.*\)*\s*', '\1', '')
if color == s
" no 'c' key, try 'g' key (grayscale with more than 4 levels)
let color = substitute(s, '.*\sg\s\+\(.\{-}\)\s*\(\(g4\|[ms]\)\s.*\)*\s*', '\1', '')
if color == s
" next try: 'g4' key (4-level grayscale)
let color = substitute(s, '.*\sg4\s\+\(.\{-}\)\s*\([ms]\s.*\)*\s*', '\1', '')
if color == s
" finally try 'm' key (mono visual)
let color = substitute(s, '.*\sm\s\+\(.\{-}\)\s*\(s\s.*\)*\s*', '\1', '')
if color == s
let color = ""
endif
endif
endif
endif
" Vim cannot handle RGB codes with more than 6 hex digits
if color =~ '#\x\{10,}$'
let color = substitute(color, '\(\x\x\)\x\x', '\1', 'g')
elseif color =~ '#\x\{7,}$'
let color = substitute(color, '\(\x\x\)\x', '\1', 'g')
" nor with 3 digits
elseif color =~ '#\x\{3}$'
let color = substitute(color, '\(\x\)\(\x\)\(\x\)', '0\10\20\3', '')
endif
" escape meta characters in patterns
let s = escape(s, '/\*^$.~[]')
let chars = escape(chars, '/\*^$.~[]')
" change whitespace to "\s\+"
let s = substitute(s, "[ \t][ \t]*", "\\\\s\\\\+", "g")
let chars = substitute(chars, "[ \t][ \t]*", "\\\\s\\\\+", "g")
" now create syntax items
" highlight the color string as normal string (no pixel string)
exe 'syn match xpm2Col'.n.'Def /'.s.'/ contains=xpm2Col'.n.'inDef'
exe 'hi def link xpm2Col'.n.'Def Constant'
" but highlight the first whitespace after chars in its color
exe 'syn match xpm2Col'.n.'inDef /^'.chars.'/hs=s+'.(cpp).' contained'
exe 'hi def link xpm2Col'.n.'inDef xpm2Color'.n
" remove the following whitespace from chars
let chars = substitute(chars, '\\s\\+$', '', '')
" and create the syntax item contained in the pixel strings
exe 'syn match xpm2Color'.n.' /'.chars.'/ contained'
exe 'syn cluster xpm2Colors add=xpm2Color'.n
" if no color or color = "None" show background
if color == "" || substitute(color, '.*', '\L&', '') == 'none'
exe 'Hi xpm2Color'.n.' guifg=bg guibg=NONE'
elseif color !~ "'"
exe 'Hi xpm2Color'.n." guifg='".color."' guibg='".color."'"
endif
let n = n + 1
else
break " no more color string
endif
endif
let i = i + 1
endwhile
unlet color chars colors cpp n i s
endif " has("gui_running") || has("termguicolors") && &termguicolors
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
" The default highlighting.
hi def link xpm2Type Type
hi def link xpm2StorageClass StorageClass
hi def link xpm2Todo Todo
hi def link xpm2Comment Comment
hi def link xpm2PixelString String
delcommand Hi
let b:current_syntax = "xpm2"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8:sw=2:noet:
endif

View File

@@ -296,6 +296,7 @@ call TestFiletype('coco')
call TestFiletype('cf')
call TestFiletype('config')
call TestFiletype('cuda')
call TestFiletype('dockerfile')
call TestFiletype('dcd')
call TestFiletype('eterm')
call TestFiletype('lynx')
@@ -637,6 +638,10 @@ call TestFiletype('svn')
call TestFiletype('text')
call TestFiletype('pullrequest')
call TestFiletype('xf86conf')
call TestFiletype('man')
call TestFiletype('xpm')
call TestFiletype('xpm2')
call TestFiletype('context')
" DO NOT EDIT CODE ABOVE, IT IS GENERATED WITH MAKEFILE