mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-09 03:53:52 -05:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
233a817f05 | ||
|
|
c3e825027d | ||
|
|
3618414fad | ||
|
|
88cae16fca | ||
|
|
6d7f437b84 | ||
|
|
bb27d0efbf | ||
|
|
8a790ac7bf | ||
|
|
c9f2aa9ae0 | ||
|
|
1fc249bafd | ||
|
|
518d733369 | ||
|
|
0021384259 | ||
|
|
af3ebda710 | ||
|
|
6b663ec330 | ||
|
|
6b9625ecd5 | ||
|
|
3383046210 | ||
|
|
8f9e5ac70b | ||
|
|
23d7b0931d | ||
|
|
3ee6ab9d13 | ||
|
|
cd919c0039 |
274
README.md
274
README.md
@@ -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-->
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cpp-modern') ==
|
||||
" http://www.vim.org/scripts/script.php?script_id=3064
|
||||
" Maintainer: bfrg <bfrg@users.noreply.github.com>
|
||||
" Website: https://github.com/bfrg/vim-cpp-modern
|
||||
" Last Change: Oct 4, 2020
|
||||
" Last Change: Oct 17, 2020
|
||||
"
|
||||
" Extended C syntax highlighting including highlighting of user-defined
|
||||
" functions.
|
||||
@@ -28,6 +28,21 @@ if !get(g:, 'cpp_no_function_highlight', 0)
|
||||
endif
|
||||
|
||||
|
||||
" Highlight struct/class member variables
|
||||
if get(g:, 'cpp_member_highlight', 0)
|
||||
syn match cMemberAccess "\.\|->" nextgroup=cStructMember,cppTemplateKeyword
|
||||
syn match cStructMember "\<\h\w*\>\%((\|<\)\@!" contained
|
||||
syn cluster cParenGroup add=cStructMember
|
||||
syn cluster cPreProcGroup add=cStructMember
|
||||
hi def link cStructMember Identifier
|
||||
|
||||
if &filetype ==# 'cpp'
|
||||
syn keyword cppTemplateKeyword template
|
||||
hi def link cppTemplateKeyword cppStructure
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
" Common ANSI-standard Names
|
||||
syn keyword cAnsiName
|
||||
\ PRId8 PRIi16 PRIo32 PRIu64 PRId16 PRIi32 PRIo64 PRIuLEAST8 PRId32 PRIi64 PRIoLEAST8 PRIuLEAST16 PRId64 PRIiLEAST8 PRIoLEAST16 PRIuLEAST32 PRIdLEAST8 PRIiLEAST16 PRIoLEAST32 PRIuLEAST64 PRIdLEAST16 PRIiLEAST32 PRIoLEAST64 PRIuFAST8 PRIdLEAST32 PRIiLEAST64 PRIoFAST8 PRIuFAST16 PRIdLEAST64 PRIiFAST8 PRIoFAST16 PRIuFAST32 PRIdFAST8 PRIiFAST16 PRIoFAST32 PRIuFAST64 PRIdFAST16 PRIiFAST32 PRIoFAST64 PRIuMAX PRIdFAST32 PRIiFAST64 PRIoMAX PRIuPTR PRIdFAST64 PRIiMAX PRIoPTR PRIx8 PRIdMAX PRIiPTR PRIu8 PRIx16 PRIdPTR PRIo8 PRIu16 PRIx32 PRIi8 PRIo16 PRIu32 PRIx64 PRIxLEAST8 SCNd8 SCNiFAST32 SCNuLEAST32 PRIxLEAST16 SCNd16 SCNiFAST64 SCNuLEAST64 PRIxLEAST32 SCNd32 SCNiMAX SCNuFAST8 PRIxLEAST64 SCNd64 SCNiPTR SCNuFAST16 PRIxFAST8 SCNdLEAST8 SCNo8 SCNuFAST32 PRIxFAST16 SCNdLEAST16 SCNo16 SCNuFAST64 PRIxFAST32 SCNdLEAST32 SCNo32 SCNuMAX PRIxFAST64 SCNdLEAST64 SCNo64 SCNuPTR PRIxMAX SCNdFAST8 SCNoLEAST8 SCNx8 PRIxPTR SCNdFAST16 SCNoLEAST16 SCNx16 PRIX8 SCNdFAST32 SCNoLEAST32 SCNx32 PRIX16 SCNdFAST64 SCNoLEAST64 SCNx64 PRIX32 SCNdMAX SCNoFAST8 SCNxLEAST8 PRIX64 SCNdPTR SCNoFAST16 SCNxLEAST16 PRIXLEAST8 SCNi8 SCNoFAST32 SCNxLEAST32 PRIXLEAST16 SCNi16 SCNoFAST64 SCNxLEAST64 PRIXLEAST32 SCNi32 SCNoMAX SCNxFAST8 PRIXLEAST64 SCNi64 SCNoPTR SCNxFAST16 PRIXFAST8 SCNiLEAST8 SCNu8 SCNxFAST32 PRIXFAST16 SCNiLEAST16 SCNu16 SCNxFAST64 PRIXFAST32 SCNiLEAST32 SCNu32 SCNxMAX PRIXFAST64 SCNiLEAST64 SCNu64 SCNxPTR PRIXMAX SCNiFAST8 SCNuLEAST8 PRIXPTR SCNiFAST16 SCNuLEAST16 STDC CX_LIMITED_RANGE STDC FENV_ACCESS STDC FP_CONTRACT
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
@@ -574,10 +574,21 @@ function! go#config#GoplsEnabled() abort
|
||||
return get(g:, 'go_gopls_enabled', 1)
|
||||
endfunction
|
||||
|
||||
" TODO(bc): remove support for g:go_diagnostics_enabled;
|
||||
" g:go_diagnostics_level is the replacement.
|
||||
function! go#config#DiagnosticsEnabled() abort
|
||||
return get(g:, 'go_diagnostics_enabled', 0)
|
||||
endfunction
|
||||
|
||||
function! go#config#DiagnosticsLevel() abort
|
||||
let l:default = 0
|
||||
if has_key(g:, 'go_diagnostics_enabled') && g:go_diagnostics_enabled
|
||||
let l:default = 2
|
||||
endif
|
||||
|
||||
return get(g:, 'go_diagnostics_level', l:default)
|
||||
endfunction
|
||||
|
||||
function! go#config#GoplsOptions() abort
|
||||
return get(g:, 'go_gopls_options', ['-remote=auto'])
|
||||
endfunction
|
||||
@@ -586,6 +597,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
|
||||
|
||||
@@ -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
|
||||
|
||||
106
autoload/nim.vim
106
autoload/nim.vim
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nim') == -1
|
||||
let g:nim_log = []
|
||||
let s:plugin_path = escape(expand('<sfile>:p:h'), '\')
|
||||
|
||||
if !exists("g:nim_caas_enabled")
|
||||
if !exists('g:nim_caas_enabled')
|
||||
let g:nim_caas_enabled = 0
|
||||
endif
|
||||
|
||||
@@ -11,27 +11,25 @@ if !executable('nim')
|
||||
echoerr "the Nim compiler must be in your system's PATH"
|
||||
endif
|
||||
|
||||
if has("python3")
|
||||
exe 'py3file ' . fnameescape(s:plugin_path) . '/nim_vim.py'
|
||||
elseif has("python")
|
||||
exe 'pyfile ' . fnameescape(s:plugin_path) . '/nim_vim.py'
|
||||
if has('pythonx')
|
||||
exe 'pyxfile ' . fnameescape(s:plugin_path) . '/nim_vim.py'
|
||||
endif
|
||||
|
||||
fun! nim#init()
|
||||
let cmd = printf("nim --dump.format:json --verbosity:0 dump %s", s:CurrentNimFile())
|
||||
fun! nim#init() abort
|
||||
let cmd = printf('nim --dump.format:json --verbosity:0 dump %s', s:CurrentNimFile())
|
||||
let raw_dumpdata = system(cmd)
|
||||
if !v:shell_error && expand("%:e") == "nim"
|
||||
if !v:shell_error && expand('%:e') ==# 'nim'
|
||||
let false = 0 " Needed for eval of json
|
||||
let true = 1 " Needed for eval of json
|
||||
let dumpdata = eval(substitute(raw_dumpdata, "\n", "", "g"))
|
||||
let dumpdata = eval(substitute(raw_dumpdata, "\n", '', 'g'))
|
||||
|
||||
let b:nim_project_root = dumpdata['project_path']
|
||||
let b:nim_defined_symbols = dumpdata['defined_symbols']
|
||||
let b:nim_caas_enabled = g:nim_caas_enabled || index(dumpdata['defined_symbols'], 'forcecaas') != -1
|
||||
|
||||
for path in dumpdata['lib_paths']
|
||||
if finddir(path) == path
|
||||
let &l:path = path . "," . &l:path
|
||||
if finddir(path) ==# path
|
||||
let &l:path = path . ',' . &l:path
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
@@ -39,7 +37,7 @@ fun! nim#init()
|
||||
endif
|
||||
endf
|
||||
|
||||
fun! s:UpdateNimLog()
|
||||
fun! s:UpdateNimLog() abort
|
||||
setlocal buftype=nofile
|
||||
setlocal bufhidden=hide
|
||||
setlocal noswapfile
|
||||
@@ -56,32 +54,32 @@ endf
|
||||
augroup NimVim
|
||||
au!
|
||||
au BufEnter log://nim call s:UpdateNimLog()
|
||||
if has("python3") || has("python")
|
||||
" au QuitPre * :py nimTerminateAll()
|
||||
au VimLeavePre * :py nimTerminateAll()
|
||||
if has('pythonx')
|
||||
" au QuitPre * :pyx nimTerminateAll()
|
||||
au VimLeavePre * :pyx nimTerminateAll()
|
||||
endif
|
||||
augroup END
|
||||
|
||||
command! NimLog :e log://nim
|
||||
|
||||
command! NimTerminateService
|
||||
\ :exe printf("py nimTerminateService('%s')", b:nim_project_root)
|
||||
\ :exe printf("pyx nimTerminateService('%s')", b:nim_project_root)
|
||||
|
||||
command! NimRestartService
|
||||
\ :exe printf("py nimRestartService('%s')", b:nim_project_root)
|
||||
\ :exe printf("pyx nimRestartService('%s')", b:nim_project_root)
|
||||
|
||||
fun! s:CurrentNimFile()
|
||||
fun! s:CurrentNimFile() abort
|
||||
let save_cur = getpos('.')
|
||||
call cursor(0, 0, 0)
|
||||
|
||||
let PATTERN = "\\v^\\#\\s*included from \\zs.*\\ze"
|
||||
let l = search(PATTERN, "n")
|
||||
let PATTERN = '\v^\#\s*included from \zs.*\ze'
|
||||
let l = search(PATTERN, 'n')
|
||||
|
||||
if l != 0
|
||||
let f = matchstr(getline(l), PATTERN)
|
||||
let l:to_check = expand('%:h') . "/" . f
|
||||
let l:to_check = expand('%:h') . '/' . f
|
||||
else
|
||||
let l:to_check = expand("%")
|
||||
let l:to_check = expand('%')
|
||||
endif
|
||||
|
||||
call setpos('.', save_cur)
|
||||
@@ -108,42 +106,42 @@ let g:nim_symbol_types = {
|
||||
\ 'skEnumField': 'v',
|
||||
\ }
|
||||
|
||||
fun! NimExec(op)
|
||||
let isDirty = getbufvar(bufnr('%'), "&modified")
|
||||
fun! NimExec(op) abort
|
||||
let isDirty = getbufvar(bufnr('%'), '&modified')
|
||||
if isDirty
|
||||
let tmp = tempname() . bufname("%") . "_dirty.nim"
|
||||
silent! exe ":w " . tmp
|
||||
let tmp = tempname() . bufname('%') . '_dirty.nim'
|
||||
silent! exe ':w ' . tmp
|
||||
|
||||
let cmd = printf("idetools %s --trackDirty:\"%s,%s,%d,%d\" \"%s\"",
|
||||
let cmd = printf('idetools %s --trackDirty:"%s,%s,%d,%d" "%s"',
|
||||
\ a:op, tmp, expand('%:p'), line('.'), col('.')-1, s:CurrentNimFile())
|
||||
else
|
||||
let cmd = printf("idetools %s --track:\"%s,%d,%d\" \"%s\"",
|
||||
let cmd = printf('idetools %s --track:"%s,%d,%d" "%s"',
|
||||
\ a:op, expand('%:p'), line('.'), col('.')-1, s:CurrentNimFile())
|
||||
endif
|
||||
|
||||
if b:nim_caas_enabled
|
||||
exe printf("py nimExecCmd('%s', '%s', False)", b:nim_project_root, cmd)
|
||||
let output = l:py_res
|
||||
exe printf("pyx nimExecCmd('%s', '%s', False)", b:nim_project_root, cmd)
|
||||
let output = get(l:, 'py_res', '')
|
||||
else
|
||||
let output = system("nim " . cmd)
|
||||
let output = system('nim ' . cmd)
|
||||
endif
|
||||
|
||||
call add(g:nim_log, "nim " . cmd . "\n" . output)
|
||||
call add(g:nim_log, 'nim ' . cmd . "\n" . output)
|
||||
return output
|
||||
endf
|
||||
|
||||
fun! NimExecAsync(op, Handler)
|
||||
fun! NimExecAsync(op, Handler) abort
|
||||
let result = NimExec(a:op)
|
||||
call a:Handler(result)
|
||||
endf
|
||||
|
||||
fun! NimComplete(findstart, base)
|
||||
if b:nim_caas_enabled == 0
|
||||
fun! NimComplete(findstart, base) abort
|
||||
if b:nim_caas_enabled ==# 0
|
||||
return -1
|
||||
endif
|
||||
|
||||
if a:findstart
|
||||
if synIDattr(synIDtrans(synID(line("."),col("."),1)), "name") == 'Comment'
|
||||
if synIDattr(synIDtrans(synID(line('.'),col('.'),1)), 'name') ==# 'Comment'
|
||||
return -1
|
||||
endif
|
||||
let line = getline('.')
|
||||
@@ -154,10 +152,10 @@ fun! NimComplete(findstart, base)
|
||||
return start
|
||||
else
|
||||
let result = []
|
||||
let sugOut = NimExec("--suggest")
|
||||
let sugOut = NimExec('--suggest')
|
||||
for line in split(sugOut, '\n')
|
||||
let lineData = split(line, '\t')
|
||||
if len(lineData) > 0 && lineData[0] == "sug"
|
||||
if len(lineData) > 0 && lineData[0] ==# 'sug'
|
||||
let word = split(lineData[2], '\.')[-1]
|
||||
if a:base ==? '' || word =~# '^' . a:base
|
||||
let kind = get(g:nim_symbol_types, lineData[1], '')
|
||||
@@ -170,7 +168,7 @@ fun! NimComplete(findstart, base)
|
||||
endif
|
||||
endf
|
||||
|
||||
if !exists("g:neocomplcache_omni_patterns")
|
||||
if !exists('g:neocomplcache_omni_patterns')
|
||||
let g:neocomplcache_omni_patterns = {}
|
||||
endif
|
||||
let g:neocomplcache_omni_patterns['nim'] = '[^. *\t]\.\w*'
|
||||
@@ -182,7 +180,7 @@ let g:neocomplete#sources#omni#input_patterns['nim'] = '[^. *\t]\.\w*'
|
||||
|
||||
let g:nim_completion_callbacks = {}
|
||||
|
||||
fun! NimAsyncCmdComplete(cmd, output)
|
||||
fun! NimAsyncCmdComplete(cmd, output) abort
|
||||
call add(g:nim_log, a:output)
|
||||
echom g:nim_completion_callbacks
|
||||
if has_key(g:nim_completion_callbacks, a:cmd)
|
||||
@@ -190,52 +188,52 @@ fun! NimAsyncCmdComplete(cmd, output)
|
||||
call Callback(a:output)
|
||||
" remove(g:nim_completion_callbacks, a:cmd)
|
||||
else
|
||||
echom "ERROR, Unknown Command: " . a:cmd
|
||||
echom 'ERROR, Unknown Command: ' . a:cmd
|
||||
endif
|
||||
return 1
|
||||
endf
|
||||
|
||||
fun! GotoDefinition_nim_ready(def_output)
|
||||
fun! GotoDefinition_nim_ready(def_output) abort
|
||||
if v:shell_error
|
||||
echo "nim was unable to locate the definition. exit code: " . v:shell_error
|
||||
echo 'nim was unable to locate the definition. exit code: ' . v:shell_error
|
||||
" echoerr a:def_output
|
||||
return 0
|
||||
endif
|
||||
|
||||
let rawDef = matchstr(a:def_output, 'def\t\([^\n]*\)')
|
||||
if rawDef == ""
|
||||
echo "the current cursor position does not match any definitions"
|
||||
if rawDef == ''
|
||||
echo 'the current cursor position does not match any definitions'
|
||||
return 0
|
||||
endif
|
||||
|
||||
let defBits = split(rawDef, '\t')
|
||||
let file = defBits[4]
|
||||
let line = defBits[5]
|
||||
exe printf("e +%d %s", line, file)
|
||||
exe printf('e +%d %s', line, file)
|
||||
return 1
|
||||
endf
|
||||
|
||||
fun! GotoDefinition_nim()
|
||||
call NimExecAsync("--def", function("GotoDefinition_nim_ready"))
|
||||
fun! GotoDefinition_nim() abort
|
||||
call NimExecAsync('--def', function('GotoDefinition_nim_ready'))
|
||||
endf
|
||||
|
||||
fun! FindReferences_nim()
|
||||
setloclist()
|
||||
fun! FindReferences_nim() abort
|
||||
"setloclist()
|
||||
endf
|
||||
|
||||
" Syntastic syntax checking
|
||||
fun! SyntaxCheckers_nim_nim_GetLocList()
|
||||
fun! SyntaxCheckers_nim_nim_GetLocList() abort
|
||||
let makeprg = 'nim check --hints:off --listfullpaths ' . s:CurrentNimFile()
|
||||
let errorformat = &errorformat
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endf
|
||||
|
||||
function! SyntaxCheckers_nim_nim_IsAvailable()
|
||||
return executable("nim")
|
||||
function! SyntaxCheckers_nim_nim_IsAvailable() abort
|
||||
return executable('nim')
|
||||
endfunction
|
||||
|
||||
if exists("g:SyntasticRegistry")
|
||||
if exists('g:SyntasticRegistry')
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'nim',
|
||||
\ 'name': 'nim'})
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
" Restore 'cpoptions'
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" DO NOT EDIT CODE BELOW, IT IS GENERATED WITH MAKEFILE
|
||||
|
||||
let s:globs = {
|
||||
\ '8th': '*.8th',
|
||||
\ 'Jenkinsfile': '*.jenkinsfile,*.Jenkinsfile,Jenkinsfile,Jenkinsfile*',
|
||||
@@ -79,6 +85,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 +128,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 +315,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 +391,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 +458,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 +610,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',
|
||||
@@ -619,6 +630,13 @@ let s:globs = {
|
||||
\ 'zsh': '*.zsh,.zshrc,.zshenv,.zlogin,.zprofile,.zlogout,.zlog*,.zcompdump*,.zfbfmarks,.zsh*',
|
||||
\}
|
||||
|
||||
|
||||
" DO NOT EDIT CODE ABOVE, IT IS GENERATED WITH MAKEFILE
|
||||
|
||||
func! polyglot#sleuth#GlobForFiletype(type)
|
||||
return get(s:globs, a:type, '')
|
||||
endfunc
|
||||
|
||||
" Restore 'cpoptions'
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nim') == -1
|
||||
|
||||
if exists("current_compiler")
|
||||
if exists('current_compiler')
|
||||
finish
|
||||
endif
|
||||
|
||||
let current_compiler = "nim"
|
||||
let current_compiler = 'nim'
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
if exists(':CompilerSet') != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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'*
|
||||
|
||||
@@ -1902,8 +1902,12 @@ When it is `v:null`, `gopls`' default will be used. By default it is `v:null`.
|
||||
|
||||
*'g:go_gopls_local'*
|
||||
|
||||
Specifies the prefix for imports that `gopls` should consider group
|
||||
separately.
|
||||
Specifies the prefix for imports that `gopls` should group separately.
|
||||
|
||||
The value can either be a string or a dictionary. When it is a string, all
|
||||
workspaces will use the same value. When it is a dictionary, the key should be
|
||||
the absolute path of the workspace and the value is the prefix to use for
|
||||
local imports within that workspace.
|
||||
|
||||
When it is `v:null`, `gopls`' default will be used. By default it is `v:null`.
|
||||
>
|
||||
@@ -1933,14 +1937,21 @@ default it is `v:null`.
|
||||
<
|
||||
*'g:go_diagnostics_enabled'*
|
||||
|
||||
Specifies whether `gopls` diagnostics are enabled. Only the diagnostics for
|
||||
the current buffer will be processed when it is not set; all others will be
|
||||
ignored.
|
||||
|
||||
By default it is disabled.
|
||||
Deprecated. See `'g:go_diagnostics_level'`. Specifies whether `gopls`
|
||||
diagnostics are enabled. Only the diagnostics for the current buffer will be
|
||||
processed when it is not set; all others will be ignored. By default it is
|
||||
disabled.
|
||||
>
|
||||
let g:go_diagnostics_enabled = 0
|
||||
<
|
||||
*'g:go_diagnostics_level'*
|
||||
|
||||
Specifies the `gopls` diagnostics level. Valid values are 0, 1, and 2. 0
|
||||
ignores `gopls` diagnostics, 1 is for errors only, and 2 is for errors and
|
||||
warnings. By default it is 0.
|
||||
>
|
||||
let g:go_diagnostics_level = 0
|
||||
<
|
||||
|
||||
*'g:go_template_autocreate'*
|
||||
|
||||
@@ -2490,7 +2501,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.
|
||||
|
||||
2257
extras/filetype.vim
Normal file
2257
extras/filetype.vim
Normal file
File diff suppressed because it is too large
Load Diff
1
filetype.vim
Normal file
1
filetype.vim
Normal file
@@ -0,0 +1 @@
|
||||
runtime! ftdetect/polyglot.vim
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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
20
ftplugin/dockerfile.vim
Normal 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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
143
indent/julia.vim
143
indent/julia.vim
@@ -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
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nim') == -1
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
@@ -14,7 +14,7 @@ setlocal indentexpr=GetNimIndent(v:lnum)
|
||||
setlocal indentkeys=!^F,o,O,<:>,0),0],0},=elif
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetNimIndent")
|
||||
if exists('*GetNimIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -40,7 +40,7 @@ function! GetNimIndent(lnum)
|
||||
endif
|
||||
|
||||
" If the start of the line is in a string don't change the indent.
|
||||
if has('syntax_items') && synIDattr(synID(a:lnum, 1, 1), "name") =~ "String$"
|
||||
if has('syntax_items') && synIDattr(synID(a:lnum, 1, 1), 'name') =~# 'String$'
|
||||
return -1
|
||||
endif
|
||||
|
||||
@@ -56,12 +56,12 @@ function! GetNimIndent(lnum)
|
||||
" If the last character in the line is a comment, do a binary search for
|
||||
" the start of the comment. synID() is slow, a linear search would take
|
||||
" too long on a long line.
|
||||
if synIDattr(synID(plnum, pline_len, 1), "name") =~ "Comment$"
|
||||
if synIDattr(synID(plnum, pline_len, 1), 'name') =~# 'Comment$'
|
||||
let min = 1
|
||||
let max = pline_len
|
||||
while min < max
|
||||
let col = (min + max) / 2
|
||||
if synIDattr(synID(plnum, col, 1), "name") =~ "Comment$"
|
||||
if synIDattr(synID(plnum, col, 1), 'name') =~# 'Comment$'
|
||||
let max = col
|
||||
else
|
||||
let min = col + 1
|
||||
@@ -80,16 +80,16 @@ function! GetNimIndent(lnum)
|
||||
endwhile
|
||||
endif
|
||||
|
||||
if cline =~ '^\s*\(if\|when\|for\|while\|case\|of\|try\)\>'
|
||||
if cline =~# '^\s*\(if\|when\|for\|while\|case\|of\|try\)\>'
|
||||
" This is a benign line, do nothing
|
||||
return -1
|
||||
endif
|
||||
|
||||
" If the current line begins with a keyword that lines up with "try"
|
||||
if cline =~ '^\s*\(except\|finally\)\>'
|
||||
if cline =~# '^\s*\(except\|finally\)\>'
|
||||
let lnum = a:lnum - 1
|
||||
while lnum >= 1
|
||||
if getline(lnum) =~ '^\s*\(try\|except\)\>'
|
||||
if getline(lnum) =~# '^\s*\(try\|except\)\>'
|
||||
let ind = indent(lnum)
|
||||
if ind >= clindent
|
||||
return -1 " indent is already less than this
|
||||
@@ -102,31 +102,31 @@ function! GetNimIndent(lnum)
|
||||
endif
|
||||
|
||||
" If the current line begins with a header keyword, dedent
|
||||
if cline =~ '^\s*\(elif\|else\)\>'
|
||||
if cline =~# '^\s*\(elif\|else\)\>'
|
||||
return s:FindStartLine(a:lnum, '^\s*\(if\|when\|elif\|of\)')
|
||||
endif
|
||||
|
||||
if pline =~ ':\s*$'
|
||||
if pline =~# ':\s*$'
|
||||
"return s:FindStartLine(plnum, '(^\s*\(if\|when\|else\|elif\|case\|of\|try\|except\|finally\)\>)\|\<do\>') + &sw
|
||||
return s:FindStartLine(plnum, '^\s*\(if\|when\|else\|elif\|for\|while\|case\|of\|try\|except\|finally\)\>') + &sw
|
||||
endif
|
||||
|
||||
if pline =~ '=\s*$'
|
||||
if pline =~# '=\s*$'
|
||||
return s:FindStartLine(plnum, '^\s*\(proc\|template\|macro\|iterator\)\>') + &sw
|
||||
endif
|
||||
|
||||
" if we got here, this should be the begging of a multi-line if expression for example
|
||||
if pline =~ '^\s*\(if\|when\|proc\|iterator\|macro\|template\|for\|while\)[^:]*$'
|
||||
if pline =~# '^\s*\(if\|when\|proc\|iterator\|macro\|template\|for\|while\)[^:]*$'
|
||||
return plindent + &sw
|
||||
endif
|
||||
|
||||
if pline =~ '\(type\|import\|const\|var\|let\)\s*$'
|
||||
\ || pline =~ '=\s*\(object\|enum\|tuple\|concept\)'
|
||||
if pline =~# '\(type\|import\|const\|var\|let\)\s*$'
|
||||
\ || pline =~# '=\s*\(object\|enum\|tuple\|concept\)'
|
||||
return plindent + &sw
|
||||
endif
|
||||
|
||||
" If the previous line was a stop-execution statement...
|
||||
if pline =~ '^\s*\(break\|continue\|raise\|return\)\>'
|
||||
if pline =~# '^\s*\(break\|continue\|raise\|return\)\>'
|
||||
" See if the user has already dedented
|
||||
if indent(a:lnum) > plindent - &sw
|
||||
" If not, recommend one dedent
|
||||
|
||||
@@ -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,31 @@ filetypes:
|
||||
- name: xf86conf
|
||||
patterns:
|
||||
- pattern: "XF86Config-4*,XF86Config*,*/xorg.conf.d/*.conf,xorg.conf,xorg.conf-4"
|
||||
---
|
||||
name: man
|
||||
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
|
||||
filetypes:
|
||||
- name: context
|
||||
patterns:
|
||||
- pattern: '*.mkii,*.mkiv,*.mkvi'
|
||||
description: ConTeXt
|
||||
|
||||
@@ -1,3 +1,137 @@
|
||||
if !exists("did_load_polyglot")
|
||||
runtime! ftdetect/polyglot.vim
|
||||
" Turn on filetype plugins (:help filetype-plugin).
|
||||
if has('autocmd') && !(exists("did_load_filetypes") && exists("did_indent_on"))
|
||||
filetype plugin indent on
|
||||
endif
|
||||
|
||||
" Enable syntax highlighting.
|
||||
if has('syntax') && !exists('g:syntax_on')
|
||||
syntax enable
|
||||
endif
|
||||
|
||||
" No need to duplicate work
|
||||
if exists('g:loaded_sensible')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Code taken from https://github.com/tpope/vim-sensible
|
||||
" and (mostly comments) from https://github.com/sheerun/vimrc
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sensible')
|
||||
" Autoindent when starting new line, or using `o` or `O`.
|
||||
set autoindent
|
||||
|
||||
" Allow backspace in insert mode.
|
||||
set backspace=indent,eol,start
|
||||
|
||||
" Don't scan included files. The .tags file is more performant.
|
||||
set complete-=i
|
||||
|
||||
" Use 'shiftwidth' when using `<Tab>` in front of a line.
|
||||
" By default it's used only for shift commands (`<`, `>`).
|
||||
set smarttab
|
||||
|
||||
" Disable octal format for number processing.
|
||||
set nrformats-=octal
|
||||
|
||||
" Allow for mappings including `Esc`, while preserving
|
||||
" zero timeout after pressing it manually.
|
||||
" (only vim needs a fix for this)
|
||||
if !has('nvim') && &ttimeoutlen == -1
|
||||
set ttimeout
|
||||
set ttimeoutlen=100
|
||||
endif
|
||||
|
||||
" Enable highlighted case-insensitive incremential search.
|
||||
set incsearch
|
||||
|
||||
" Use <C-L> to clear the highlighting of :set hlsearch.
|
||||
if maparg('<C-L>', 'n') ==# ''
|
||||
nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
|
||||
endif
|
||||
|
||||
" Always show window statuses, even if there's only one.
|
||||
set laststatus=2
|
||||
|
||||
" Show the line and column number of the cursor position.
|
||||
set ruler
|
||||
|
||||
" Autocomplete commands using nice menu in place of window status.
|
||||
" Enable `Ctrl-N` and `Ctrl-P` to scroll through matches.
|
||||
set wildmenu
|
||||
|
||||
" Keep 5 columns next to the cursor when scrolling horizontally.
|
||||
if !&scrolloff
|
||||
set scrolloff=1
|
||||
endif
|
||||
if !&sidescrolloff
|
||||
set sidescrolloff=5
|
||||
endif
|
||||
|
||||
" When 'wrap' is on, display last line even if it doesn't fit.
|
||||
set display+=lastline
|
||||
|
||||
" Force utf-8 encoding
|
||||
set encoding=utf-8
|
||||
|
||||
" Set default whitespace characters when using `:set list`
|
||||
if &listchars ==# 'eol:$'
|
||||
set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
|
||||
endif
|
||||
|
||||
" Delete comment character when joining commented lines
|
||||
if v:version > 703 || v:version == 703 && has("patch541")
|
||||
set formatoptions+=j
|
||||
endif
|
||||
|
||||
" Search upwards for tags file instead only locally
|
||||
if has('path_extra')
|
||||
setglobal tags-=./tags tags-=./tags; tags^=./tags;
|
||||
endif
|
||||
|
||||
" Fix issues with fish shell
|
||||
" https://github.com/tpope/vim-sensible/issues/50
|
||||
if &shell =~# 'fish$' && (v:version < 704 || v:version == 704 && !has('patch276'))
|
||||
set shell=/usr/bin/env\ bash
|
||||
endif
|
||||
|
||||
" Reload unchanged files automatically.
|
||||
set autoread
|
||||
|
||||
" Increase history size to 1000 items.
|
||||
if &history < 1000
|
||||
set history=1000
|
||||
endif
|
||||
|
||||
" Allow for up to 50 opened tabs on Vim start.
|
||||
if &tabpagemax < 50
|
||||
set tabpagemax=50
|
||||
endif
|
||||
|
||||
" Always save upper case variables to viminfo file.
|
||||
if !empty(&viminfo)
|
||||
set viminfo^=!
|
||||
endif
|
||||
|
||||
" Don't save options in sessions and views
|
||||
set sessionoptions-=options
|
||||
set viewoptions-=options
|
||||
|
||||
" Allow color schemes to do bright colors without forcing bold.
|
||||
if &t_Co == 8 && $TERM !~# '^Eterm'
|
||||
set t_Co=16
|
||||
endif
|
||||
|
||||
" Load matchit.vim, but only if the user hasn't installed a newer version.
|
||||
if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# ''
|
||||
runtime! macros/matchit.vim
|
||||
endif
|
||||
|
||||
" `Ctrl-U` in insert mode deletes a lot. Use `Ctrl-G` u to first break undo,
|
||||
" so that you can undo `Ctrl-U` without undoing what you typed before it.
|
||||
if empty(mapcheck('<C-U>', 'i'))
|
||||
inoremap <C-U> <C-G>u<C-U>
|
||||
endif
|
||||
|
||||
if empty(mapcheck('<C-W>', 'i'))
|
||||
inoremap <C-W> <C-G>u<C-W>
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -128,6 +128,10 @@ def load_data()
|
||||
|
||||
for package in packages
|
||||
for filetype in package["filetypes"]
|
||||
if ["context", "man"].include?(filetype["name"]) && package["remote"]
|
||||
puts "context and man packages caused issues in past, are you sure?"
|
||||
exit 1
|
||||
end
|
||||
if filetype["patterns"]
|
||||
for pattern in filetype["patterns"]
|
||||
for p in comma_expanson(pattern["pattern"])
|
||||
@@ -257,9 +261,8 @@ def parse_remote(remote)
|
||||
[match[:repo], match[:branch] || "master", match[:path], dir]
|
||||
end
|
||||
|
||||
def copy_file(package, src, dest)
|
||||
def copy_file(name, src, dest)
|
||||
FileUtils.mkdir_p(File.dirname(dest))
|
||||
name = package.fetch("name")
|
||||
|
||||
if dest.end_with?(".vim")
|
||||
header = '" Polyglot metafile'
|
||||
@@ -509,11 +512,11 @@ def extract(packages)
|
||||
globs.each do |glob|
|
||||
Dir.glob("#{subdir}/#{glob}", base: subtree).each do |p|
|
||||
next unless File.file?("#{subtree}#{p}")
|
||||
copy_file(package, "#{subtree}#{p}", p)
|
||||
copy_file(package["name"], "#{subtree}#{p}", p)
|
||||
end
|
||||
end
|
||||
elsif File.exist?(subpath)
|
||||
copy_file(package, subpath, subdir)
|
||||
copy_file(package["name"], subpath, subdir)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -529,6 +532,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 +573,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')
|
||||
|
||||
@@ -812,15 +848,7 @@ def generate_plugins(packages)
|
||||
end
|
||||
output << " \\}\n\n"
|
||||
|
||||
|
||||
output << <<~EOS
|
||||
func! polyglot#sleuth#GlobForFiletype(type)
|
||||
return get(s:globs, a:type, '')
|
||||
endfunc
|
||||
EOS
|
||||
|
||||
|
||||
File.write('autoload/polyglot/sleuth.vim', output)
|
||||
inject_code('autoload/polyglot/sleuth.vim', output)
|
||||
end
|
||||
|
||||
def process_list(list, extras)
|
||||
@@ -856,6 +884,19 @@ def show_warnings(all_filetypes, expected_filetypes)
|
||||
end
|
||||
end
|
||||
|
||||
def generate_fallback
|
||||
filetype_content = File.read('tmp/vim/vim/runtime/filetype.vim')
|
||||
filetype_content.gsub!('runtime! ftdetect/*.vim', '')
|
||||
filetype_content.gsub!(/^au BufNewFile,BufRead \*\n.+?runtime!.+?endif/m) {}
|
||||
filetype_content.gsub!(/^au StdinReadPost \* .+?runtime!.+?endif/m) {}
|
||||
filetype_content.gsub!(/^au filetypedetect BufNewFile,BufRead,StdinReadPost \*\n.+?endif/m) {}
|
||||
File.write('extras/filetype.vim', filetype_content)
|
||||
|
||||
autoload_content = File.read('tmp/vim/vim/runtime/autoload/dist/ft.vim')
|
||||
autoload_content.gsub!('dist#ft#', 'polyglot#ft#')
|
||||
File.write('autoload/polyglot/ft.vim', autoload_content)
|
||||
end
|
||||
|
||||
|
||||
if __FILE__ == $0
|
||||
if !ENV["DEV"]
|
||||
@@ -867,6 +908,7 @@ if __FILE__ == $0
|
||||
packages, heuristics = load_data()
|
||||
download(packages)
|
||||
extract(packages)
|
||||
generate_fallback()
|
||||
generate_ftdetect(packages, heuristics)
|
||||
generate_plugins(packages)
|
||||
generate_tests(packages)
|
||||
|
||||
@@ -7,7 +7,6 @@ def run_script(src)
|
||||
end
|
||||
|
||||
def run_vimscript(src)
|
||||
|
||||
wrapper = <<~EOF
|
||||
vim --clean --not-a-term -u <(cat <<- "EOM"
|
||||
set nocompatible
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -651,7 +651,7 @@ endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: ts=8
|
||||
|
||||
|
||||
endif
|
||||
|
||||
@@ -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
49
syntax/dockerfile.vim
Normal 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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -2,30 +2,30 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nim') == -1
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
if version < 600
|
||||
if v:version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
elseif exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Keep user-supplied options
|
||||
if !exists("nim_highlight_numbers")
|
||||
if !exists('nim_highlight_numbers')
|
||||
let nim_highlight_numbers = 1
|
||||
endif
|
||||
if !exists("nim_highlight_builtins")
|
||||
if !exists('nim_highlight_builtins')
|
||||
let nim_highlight_builtins = 1
|
||||
endif
|
||||
if !exists("nim_highlight_exceptions")
|
||||
if !exists('nim_highlight_exceptions')
|
||||
let nim_highlight_exceptions = 1
|
||||
endif
|
||||
if !exists("nim_highlight_space_errors")
|
||||
if !exists('nim_highlight_space_errors')
|
||||
let nim_highlight_space_errors = 1
|
||||
endif
|
||||
if !exists("nim_highlight_special_vars")
|
||||
if !exists('nim_highlight_special_vars')
|
||||
let nim_highlight_special_vars = 1
|
||||
endif
|
||||
|
||||
if exists("nim_highlight_all")
|
||||
if exists('nim_highlight_all')
|
||||
let nim_highlight_numbers = 1
|
||||
let nim_highlight_builtins = 1
|
||||
let nim_highlight_exceptions = 1
|
||||
@@ -158,8 +158,8 @@ syn sync match nimSync grouphere NONE "):$"
|
||||
syn sync maxlines=200
|
||||
syn sync minlines=2000
|
||||
|
||||
if version >= 508 || !exists("did_nim_syn_inits")
|
||||
if version <= 508
|
||||
if v:version >= 508 || !exists('did_nim_syn_inits')
|
||||
if v:version <= 508
|
||||
let did_nim_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
@@ -202,7 +202,7 @@ if version >= 508 || !exists("did_nim_syn_inits")
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "nim"
|
||||
let b:current_syntax = 'nim'
|
||||
|
||||
|
||||
endif
|
||||
|
||||
@@ -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
142
syntax/xpm.vim
Normal 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
157
syntax/xpm2.vim
Normal 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
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user