mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Compare commits
55 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
271679272c | ||
|
|
d43d269bed | ||
|
|
4314841aa4 | ||
|
|
5308fab3e9 | ||
|
|
c842cbcb59 | ||
|
|
314621a395 | ||
|
|
ca8818e8ed | ||
|
|
947e6853aa | ||
|
|
05ff14bfda | ||
|
|
9243367ba3 | ||
|
|
1eed30b2af | ||
|
|
be092d6f43 | ||
|
|
fb7cf8a9ab | ||
|
|
19a69cf77d | ||
|
|
4f7a4036eb | ||
|
|
0ff5d451b0 | ||
|
|
49840b1893 | ||
|
|
2dc954d6fa | ||
|
|
2369cd5d22 | ||
|
|
46affb6153 | ||
|
|
a4cc3f64f9 | ||
|
|
2fe310256e | ||
|
|
2e1a980632 | ||
|
|
cecfb5dd10 | ||
|
|
a4a9481d37 | ||
|
|
5e5d127eb8 | ||
|
|
002573265a | ||
|
|
a4b91124a8 | ||
|
|
46040f3ffd | ||
|
|
48254ec7ad | ||
|
|
cd2fded0e0 | ||
|
|
255345bf95 | ||
|
|
3169f80169 | ||
|
|
e9b3bcd5e1 | ||
|
|
d9ee362537 | ||
|
|
57badea2dc | ||
|
|
3baafd5c33 | ||
|
|
b0124dc880 | ||
|
|
99166bd51f | ||
|
|
48b4f233c5 | ||
|
|
556ba05cee | ||
|
|
262960fa22 | ||
|
|
b2640b5b76 | ||
|
|
c30ba66d22 | ||
|
|
4df00e6574 | ||
|
|
48f59577c8 | ||
|
|
96179c95ba | ||
|
|
520389bbfd | ||
|
|
7123e97498 | ||
|
|
63119f09d1 | ||
|
|
f2ef4cedec | ||
|
|
45c1923f43 | ||
|
|
8dd0474feb | ||
|
|
e166f741ef | ||
|
|
d4fcef1aa8 |
12
.github/ISSUE_TEMPLATE/add-language.md
vendored
12
.github/ISSUE_TEMPLATE/add-language.md
vendored
@@ -2,17 +2,23 @@
|
||||
name: Add language
|
||||
about: Add support for new language
|
||||
title: ''
|
||||
labels: ''
|
||||
labels: 'enhancement'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--- vim-polyglot accepts only lightweight, maintained github-hosted vim plugins -->
|
||||
**What is the name of this language in Linguist?**
|
||||
|
||||
<!-- https://github.com/github/linguist/blob/master/lib/linguist/languages.yml -->
|
||||
|
||||
**Link to GitHub repository of Vim plugin**
|
||||
|
||||
**GitHub repository url**
|
||||
|
||||
|
||||
**Is this plugin well maintained?**
|
||||
|
||||
|
||||
|
||||
**Is this plugin lightweight? (no advanced functionality, just indent and syntax support)**
|
||||
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
name: Add support for language
|
||||
about: ''
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
run: |
|
||||
sudo add-apt-repository ppa:jonathonf/vim -y
|
||||
sudo apt-get update -q
|
||||
sudo apt-get install -y vim
|
||||
sudo apt-get install -y vim expect
|
||||
vim --version
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run Tests
|
||||
|
||||
5
Makefile
5
Makefile
@@ -1,7 +1,10 @@
|
||||
.PHONY: all
|
||||
.PHONY: all test dev
|
||||
|
||||
all:
|
||||
@ scripts/build
|
||||
|
||||
test:
|
||||
@ scripts/test
|
||||
|
||||
dev:
|
||||
@ echo "packages.yaml\nheuristics.yaml\nscripts/test\nscripts/build\nscripts/test_extensions.vim" | DEV=1 entr bash -c 'make && make test'
|
||||
|
||||
367
README.md
367
README.md
@@ -7,14 +7,14 @@ 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-->155<!--/Package Count--> packages it consists of.
|
||||
- It **installs and updates 120+ times faster** than the <!--Package Count-->196<!--/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).
|
||||
- No support for esoteric languages, only most popular ones (modern too, like `slim`).
|
||||
- Automatically detect indentation (includes performance-optimized version of [vim-sleuth](https://github.com/tpope/vim-sleuth))
|
||||
- Each build is tested by automated vimrunner script on CI. See `spec` directory.
|
||||
|
||||
\*To be completely honest, optimized `ftdetect` script takes around `19ms` to load.
|
||||
\*To be completely honest, optimized `ftdetect` script takes around `20ms` to load.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -43,161 +43,202 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
## Language packs
|
||||
|
||||
<!--Language Packs-->
|
||||
- [acpiasl](https://github.com/martinlroth/vim-acpi-asl) (syntax)
|
||||
- [ansible](https://github.com/pearofducks/ansible-vim) (syntax, indent, ftplugin)
|
||||
- [apiblueprint](https://github.com/sheerun/apiblueprint.vim) (syntax, ctags)
|
||||
- [applescript](https://github.com/mityu/vim-applescript) (syntax, indent)
|
||||
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent)
|
||||
- [asciidoc](https://github.com/asciidoc/vim-asciidoc) (syntax)
|
||||
- [autohotkey](https://github.com/hnamikaw/vim-autohotkey) (indent)
|
||||
- [blade](https://github.com/jwalton512/vim-blade) (syntax, indent, ftplugin)
|
||||
- [brewfile](https://github.com/bfontaine/Brewfile.vim) (syntax)
|
||||
- [c++11](https://github.com/octol/vim-cpp-enhanced-highlight) (syntax)
|
||||
- [c/c++](https://github.com/vim-jp/vim-cpp) (syntax)
|
||||
- [caddyfile](https://github.com/isobit/vim-caddyfile) (syntax, indent, ftplugin)
|
||||
- [carp](https://github.com/hellerve/carp-vim) (syntax)
|
||||
- [cjsx](https://github.com/mtscout6/vim-cjsx) (syntax, ftplugin)
|
||||
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, doc, autoload, ftplugin)
|
||||
- [cmake](https://github.com/pboettch/vim-cmake-syntax) (syntax, indent)
|
||||
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, doc, compiler, autoload, ftplugin)
|
||||
- [cql](https://github.com/elubow/cql-vim) (syntax)
|
||||
- [cryptol](https://github.com/victoredwardocallaghan/cryptol.vim) (syntax, doc, compiler, ftplugin)
|
||||
- [crystal](https://github.com/rhysd/vim-crystal) (syntax, indent, autoload, ftplugin)
|
||||
- [csv](https://github.com/chrisbra/csv.vim) (syntax, doc, autoload, ftplugin)
|
||||
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin)
|
||||
- [cue](https://github.com/mgrabovsky/vim-cuesheet) (syntax)
|
||||
- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, doc, autoload, ftplugin)
|
||||
- [dhall](https://github.com/vmchale/dhall-vim) (syntax, doc, ftplugin)
|
||||
- [dlang](https://github.com/JesseKPhillips/d.vim) (syntax, indent)
|
||||
- [dockerfile](https://github.com/ekalinin/Dockerfile.vim) (syntax, indent, ftplugin)
|
||||
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, doc, compiler, autoload, ftplugin)
|
||||
- [elm](https://github.com/andys8/vim-elm-syntax) (syntax, indent)
|
||||
- [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin)
|
||||
- [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin)
|
||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent)
|
||||
- [fennel](https://github.com/bakpakin/fennel.vim) (syntax, indent, ftplugin)
|
||||
- [ferm](https://github.com/vim-scripts/ferm.vim) (syntax)
|
||||
- [fish](https://github.com/georgewitteman/vim-fish) (syntax, indent, compiler, autoload, ftplugin)
|
||||
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers) (syntax)
|
||||
- [fsharp](https://github.com/ionide/Ionide-vim) (syntax, indent, doc, autoload)
|
||||
- [gdscript](https://github.com/calviken/vim-gdscript3) (syntax, indent)
|
||||
- [git](https://github.com/tpope/vim-git) (syntax, indent, doc, ftplugin)
|
||||
- [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent)
|
||||
- [gmpl](https://github.com/maelvalais/gmpl.vim) (syntax)
|
||||
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting) (syntax)
|
||||
- [go](https://github.com/fatih/vim-go) (syntax, indent, doc, compiler)
|
||||
- [gradle](https://github.com/tfnico/vim-gradle) (compiler)
|
||||
- [graphql](https://github.com/jparise/vim-graphql) (syntax, indent, autoload, ftplugin, after, doc)
|
||||
- [haml](https://github.com/sheerun/vim-haml) (syntax, indent, compiler, ftplugin)
|
||||
- [handlebars](https://github.com/sheerun/vim-mustache-handlebars) (syntax, indent, ftplugin)
|
||||
- [haproxy](https://github.com/CH-DanReif/haproxy.vim) (syntax)
|
||||
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, doc, ftplugin)
|
||||
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax)
|
||||
- [hcl](https://github.com/b4b4r07/vim-hcl) (syntax, indent, ftplugin)
|
||||
- [helm](https://github.com/towolf/vim-helm) (syntax)
|
||||
- [hive](https://github.com/zebradil/hive.vim) (syntax, ftplugin)
|
||||
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
|
||||
- [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin)
|
||||
- [icalendar](https://github.com/chutzpah/icalendar.vim) (syntax)
|
||||
- [idris](https://github.com/idris-hackers/idris-vim) (syntax, indent, doc, ftplugin)
|
||||
- [ion](https://github.com/vmchale/ion-vim) (syntax, ftplugin)
|
||||
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, ftplugin, extras)
|
||||
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent)
|
||||
- [jinja](https://github.com/lepture/vim-jinja) (syntax, indent)
|
||||
- [jq](https://github.com/vito-c/jq.vim) (syntax, ftplugin)
|
||||
- [json5](https://github.com/GutenYe/json5.vim) (syntax)
|
||||
- [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin)
|
||||
- [jsonnet](https://github.com/google/vim-jsonnet) (syntax, doc, autoload, ftplugin)
|
||||
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent)
|
||||
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (autoload, after, doc)
|
||||
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (syntax, indent, doc, autoload, ftplugin)
|
||||
- [kotlin](https://github.com/udalov/kotlin-vim) (syntax, indent, ftplugin)
|
||||
- [ledger](https://github.com/ledger/vim-ledger) (syntax, indent, doc, compiler, autoload)
|
||||
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin)
|
||||
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond) (syntax, indent, compiler, ftplugin)
|
||||
- [livescript](https://github.com/gkz/vim-ls) (syntax, indent, compiler, ftplugin)
|
||||
- [llvm](https://github.com/rhysd/vim-llvm) (syntax, indent, ftplugin)
|
||||
- [log](https://github.com/MTDL9/vim-log-highlighting) (syntax, doc)
|
||||
- [lua](https://github.com/tbastos/vim-lua) (syntax, indent)
|
||||
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin)
|
||||
- [markdown](https://github.com/plasticboy/vim-markdown) (syntax, indent, doc, ftplugin)
|
||||
- [mathematica](https://github.com/voldikss/vim-mma) (syntax, ftplugin)
|
||||
- [mdx](https://github.com/jxnblk/vim-mdx-js) (syntax)
|
||||
- [meson](https://github.com/mesonbuild/meson) (syntax, indent, ftplugin)
|
||||
- [moonscript](https://github.com/leafo/moonscript-vim) (syntax, indent, ftplugin)
|
||||
- [nginx](https://github.com/chr4/nginx.vim) (syntax, indent, ftplugin)
|
||||
- [nim](https://github.com/zah/nim.vim) (syntax, indent, compiler, autoload)
|
||||
- [nix](https://github.com/LnL7/vim-nix) (syntax, indent, compiler, ftplugin)
|
||||
- [objc](https://github.com/b4winckler/vim-objc) (ftplugin, syntax, indent)
|
||||
- [ocaml](https://github.com/rgrinberg/vim-ocaml) (syntax, indent, doc, compiler, ftplugin)
|
||||
- [octave](https://github.com/McSinyx/vim-octave) (syntax, indent)
|
||||
- [opencl](https://github.com/petRUShka/vim-opencl) (syntax, indent, ftplugin)
|
||||
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin)
|
||||
- [pgsql](https://github.com/lifepillar/pgsql.vim) (syntax, indent, doc)
|
||||
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
||||
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, indent, ftplugin)
|
||||
- [pony](https://github.com/jakwings/vim-pony) (syntax, indent, autoload, ftplugin)
|
||||
- [powershell](https://github.com/PProvost/vim-ps1) (syntax, indent, doc, compiler, ftplugin)
|
||||
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent)
|
||||
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin)
|
||||
- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, autoload, ftplugin, ctags)
|
||||
- [purescript](https://github.com/purescript-contrib/purescript-vim) (syntax, indent, ftplugin)
|
||||
- [python-compiler](https://github.com/aliev/vim-compiler-python) (compiler, autoload)
|
||||
- [python-indent](https://github.com/Vimjas/vim-python-pep8-indent) (indent)
|
||||
- [python](https://github.com/vim-python/python-syntax) (syntax, doc)
|
||||
- [qmake](https://github.com/artoj/qmake-syntax-vim) (syntax)
|
||||
- [qml](https://github.com/peterhoeg/vim-qml) (syntax, indent, ftplugin)
|
||||
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax)
|
||||
- [racket](https://github.com/wlangstroth/vim-racket) (syntax, indent, ftplugin)
|
||||
- [ragel](https://github.com/jneen/ragel.vim) (syntax)
|
||||
- [raku](https://github.com/Raku/vim-raku) (syntax, indent, ftplugin)
|
||||
- [raml](https://github.com/IN3D/vim-raml) (syntax, doc, ftplugin)
|
||||
- [razor](https://github.com/adamclerk/vim-razor) (syntax, indent, ftplugin)
|
||||
- [reason](https://github.com/reasonml-editor/vim-reason-plus) (syntax, indent, doc)
|
||||
- [requirements](https://github.com/raimon49/requirements.txt.vim) (syntax, autoload)
|
||||
- [rspec](https://github.com/keith/rspec.vim) (syntax)
|
||||
- [rst](https://github.com/marshallward/vim-restructuredtext) (syntax, indent, autoload, ftplugin)
|
||||
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, doc, compiler, autoload, ftplugin)
|
||||
- [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, doc, compiler, autoload, ftplugin, ctags)
|
||||
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax)
|
||||
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, doc, compiler, ftplugin, ctags)
|
||||
- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, indent, ftplugin)
|
||||
- [sh](https://github.com/arzg/vim-sh) (syntax)
|
||||
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin)
|
||||
- [slime](https://github.com/slime-lang/vim-slime-syntax) (syntax, indent)
|
||||
- [smt2](https://github.com/bohlender/vim-smt2) (syntax, autoload, ftplugin)
|
||||
- [solidity](https://github.com/tomlion/vim-solidity) (syntax, indent, ftplugin)
|
||||
- [sql](https://github.com/shmup/vim-sql-syntax) (syntax)
|
||||
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin)
|
||||
- [svelte](https://github.com/evanleck/vim-svelte) (syntax, indent, ftplugin)
|
||||
- [svg-indent](https://github.com/jasonshell/vim-svg-indent) (indent)
|
||||
- [svg](https://github.com/vim-scripts/svg.vim) (syntax)
|
||||
- [swift](https://github.com/keith/swift.vim) (syntax, indent, compiler, ftplugin, ctags)
|
||||
- [sxhkd](https://github.com/baskerville/vim-sxhkdrc) (syntax)
|
||||
- [systemd](https://github.com/wgwoods/vim-systemd-syntax) (syntax, ftplugin)
|
||||
- [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, doc, autoload, ftplugin)
|
||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, doc, ftplugin)
|
||||
- [thrift](https://github.com/solarnz/thrift.vim) (syntax)
|
||||
- [tmux](https://github.com/ericpruitt/tmux.vim) (syntax, ftplugin)
|
||||
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin)
|
||||
- [tptp](https://github.com/c-cube/vim-tptp) (syntax)
|
||||
- [twig](https://github.com/lumiliet/vim-twig) (syntax, indent, ftplugin)
|
||||
- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (syntax, indent, compiler, ftplugin, ctags)
|
||||
- [unison](https://github.com/unisonweb/unison) (syntax)
|
||||
- [v](https://github.com/ollykel/v-vim) (syntax, indent, ftplugin)
|
||||
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent, ftplugin)
|
||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax)
|
||||
- [velocity](https://github.com/lepture/vim-velocity) (syntax, indent)
|
||||
- [vue](https://github.com/posva/vim-vue) (syntax, indent, ftplugin)
|
||||
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax) (syntax)
|
||||
- [xml](https://github.com/amadeus/vim-xml) (syntax)
|
||||
- [xsl](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
||||
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)
|
||||
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
||||
- [zephir](https://github.com/xwsoul/vim-zephir) (syntax)
|
||||
- [zig](https://github.com/ziglang/zig.vim) (syntax, indent, autoload, ftplugin)
|
||||
- [zinit](https://github.com/zinit-zsh/zplugin-vim-syntax) (syntax)
|
||||
- [8th](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [a2ps](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [a65](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [aap](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [abap](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [abaqus](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [abc](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [abel](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [acedb](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [acpiasl](https://github.com/martinlroth/vim-acpi-asl)
|
||||
- [ada](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [ahdl](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [aidl](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [alsaconf](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [aml](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [ampl](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [ansible](https://github.com/pearofducks/ansible-vim)
|
||||
- [ant](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [apache](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [apiblueprint](https://github.com/sheerun/apiblueprint.vim)
|
||||
- [applescript](https://github.com/mityu/vim-applescript)
|
||||
- [aptconf](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [arch](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [arduino](https://github.com/sudar/vim-arduino-syntax)
|
||||
- [art](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [asciidoc](https://github.com/asciidoc/vim-asciidoc)
|
||||
- [asn](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [aspperl](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [aspvbs](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [atlas](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [autohotkey](https://github.com/hnamikaw/vim-autohotkey)
|
||||
- [autoit](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [automake](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [ave](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [awk](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [basic](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [blade](https://github.com/jwalton512/vim-blade)
|
||||
- [brewfile](https://github.com/bfontaine/Brewfile.vim)
|
||||
- [c/c++](https://github.com/vim-jp/vim-cpp)
|
||||
- [caddyfile](https://github.com/isobit/vim-caddyfile)
|
||||
- [carp](https://github.com/hellerve/carp-vim)
|
||||
- [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)
|
||||
- [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)
|
||||
- [dosini](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [elf](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [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)
|
||||
- [forth](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [fsharp](https://github.com/ionide/Ionide-vim)
|
||||
- [gdscript](https://github.com/calviken/vim-gdscript3)
|
||||
- [git](https://github.com/tpope/vim-git)
|
||||
- [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)
|
||||
- [gradle](https://github.com/tfnico/vim-gradle)
|
||||
- [graphql](https://github.com/jparise/vim-graphql)
|
||||
- [groovy](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [grub](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [haml](https://github.com/sheerun/vim-haml)
|
||||
- [handlebars](https://github.com/sheerun/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)
|
||||
- [helm](https://github.com/towolf/vim-helm)
|
||||
- [help](https://github.com/neovim/neovim/tree/master/runtime)
|
||||
- [hive](https://github.com/zebradil/hive.vim)
|
||||
- [html5](https://github.com/othree/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)
|
||||
- [javascript-sql](https://github.com/statico/vim-javascript-sql)
|
||||
- [javascript](https://github.com/pangloss/vim-javascript)
|
||||
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax)
|
||||
- [jinja](https://github.com/lepture/vim-jinja)
|
||||
- [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)
|
||||
- [less](https://github.com/groenewege/vim-less)
|
||||
- [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)
|
||||
- [m4](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [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)
|
||||
- [murphi](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [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)
|
||||
- [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)
|
||||
- [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)
|
||||
- [sbt](https://github.com/derekwyatt/vim-sbt)
|
||||
- [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)
|
||||
- [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)
|
||||
- [terraform](https://github.com/hashivim/vim-terraform)
|
||||
- [textile](https://github.com/timcharper/textile.vim)
|
||||
- [thrift](https://github.com/solarnz/thrift.vim)
|
||||
- [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)
|
||||
- [trasys](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [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)
|
||||
- [visual-basic](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [vmasm](https://github.com/vim/vim/tree/master/runtime)
|
||||
- [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)
|
||||
- [yaml](https://github.com/vim/vim/tree/df44a27b53586fccfc6a3aedc89061fdd9a515ff/runtime)
|
||||
- [yard](https://github.com/sheerun/vim-yardoc)
|
||||
- [zephir](https://github.com/xwsoul/vim-zephir)
|
||||
- [zig](https://github.com/ziglang/zig.vim)
|
||||
- [zinit](https://github.com/zinit-zsh/zplugin-vim-syntax)
|
||||
<!--/Language Packs-->
|
||||
|
||||
## Updating
|
||||
@@ -210,7 +251,7 @@ Please make sure you have `syntax on` in your `.vimrc` (or use something like [s
|
||||
|
||||
Individual language packs can be disabled by setting `g:polyglot_disabled` as follows:
|
||||
|
||||
```viml
|
||||
```vim
|
||||
let g:polyglot_disabled = ['css']
|
||||
```
|
||||
|
||||
@@ -218,11 +259,17 @@ let g:polyglot_disabled = ['css']
|
||||
|
||||
Please note that disabling a language won't make in your vim startup any faster / slower (only for specific this specific filetype). All plugins are loaded lazily, on demand.
|
||||
|
||||
Vim Polyglot tries to automatically detect indentation settings (just like vim-sleuth). If this feature is not working for you for some reason, please file an issue and disable it temporarily with:
|
||||
|
||||
```vim
|
||||
let g:polyglot_disabled = ['autoindent']
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Language packs are periodically updated using automated `scripts/build` script.
|
||||
|
||||
Feel free to add your language to `packages.yaml`, and send pull-request. Please don't run `make` and include that in your PR, send just changes to `packages.yaml` and build scripts if really necessary. You can run `make test` to run rough tests.
|
||||
Feel free to add your language to `packages.yaml` + `heuristics.yaml`, and send pull-request. You can run `make test` to run rough tests. And `make dev` for easy development.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
5
after/ftplugin/idris2.vim
Normal file
5
after/ftplugin/idris2.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'idris2') == -1
|
||||
|
||||
setlocal iskeyword+='
|
||||
|
||||
endif
|
||||
16
after/ftplugin/javascript-1.vim
Normal file
16
after/ftplugin/javascript-1.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: JavaScript
|
||||
" Maintainer: vim-javascript community
|
||||
" URL: https://github.com/pangloss/vim-javascript
|
||||
|
||||
setlocal iskeyword+=$ suffixesadd+=.js
|
||||
|
||||
if exists('b:undo_ftplugin')
|
||||
let b:undo_ftplugin .= ' | setlocal iskeyword< suffixesadd<'
|
||||
else
|
||||
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
|
||||
endif
|
||||
|
||||
endif
|
||||
9
after/ftplugin/javascript-2.vim
Normal file
9
after/ftplugin/javascript-2.vim
Normal file
@@ -0,0 +1,9 @@
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
if get(g:, 'vim_jsx_pretty_disable_js', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
source <sfile>:h/jsx.vim
|
||||
|
||||
endif
|
||||
@@ -1,51 +1,3 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: JavaScript
|
||||
" Maintainer: vim-javascript community
|
||||
" URL: https://github.com/pangloss/vim-javascript
|
||||
|
||||
setlocal iskeyword+=$ suffixesadd+=.js
|
||||
|
||||
if exists('b:undo_ftplugin')
|
||||
let b:undo_ftplugin .= ' | setlocal iskeyword< suffixesadd<'
|
||||
else
|
||||
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
|
||||
endif
|
||||
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim ftplugin file
|
||||
"
|
||||
" Language: javascript.jsx
|
||||
" Maintainer: MaxMEllon <maxmellon1994@gmail.com>
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" modified from html.vim
|
||||
" For matchit plugin
|
||||
if exists("loaded_matchit")
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_words = '(:),\[:\],{:},<:>,' .
|
||||
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
||||
endif
|
||||
|
||||
" For andymass/vim-matchup plugin
|
||||
if exists("loaded_matchup")
|
||||
setlocal matchpairs=(:),{:},[:],<:>
|
||||
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
|
||||
let b:match_skip = 's:comment\|string'
|
||||
endif
|
||||
|
||||
let b:jsx_pretty_old_cms = &l:commentstring
|
||||
|
||||
augroup jsx_comment
|
||||
autocmd! CursorMoved <buffer>
|
||||
autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:jsx_pretty_old_cms)
|
||||
augroup end
|
||||
|
||||
setlocal suffixesadd+=.jsx
|
||||
|
||||
endif
|
||||
" Polyglot metafile
|
||||
source <sfile>:h/javascript-1.vim
|
||||
source <sfile>:h/javascript-2.vim
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
source <sfile>:h/javascript.vim
|
||||
source <sfile>:h/jsx.vim
|
||||
|
||||
endif
|
||||
|
||||
35
after/ftplugin/jsx.vim
Normal file
35
after/ftplugin/jsx.vim
Normal file
@@ -0,0 +1,35 @@
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim ftplugin file
|
||||
"
|
||||
" Language: javascript.jsx
|
||||
" Maintainer: MaxMEllon <maxmellon1994@gmail.com>
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" modified from html.vim
|
||||
" For matchit plugin
|
||||
if exists("loaded_matchit")
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_words = '(:),\[:\],{:},<:>,' .
|
||||
\ '<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
|
||||
endif
|
||||
|
||||
" For andymass/vim-matchup plugin
|
||||
if exists("loaded_matchup")
|
||||
setlocal matchpairs=(:),{:},[:],<:>
|
||||
let b:match_words = '<\@<=\([^/][^ \t>]*\)\g{hlend}[^>]*\%(/\@<!>\|$\):<\@<=/\1>'
|
||||
let b:match_skip = 's:comment\|string'
|
||||
endif
|
||||
|
||||
let b:jsx_pretty_old_cms = &l:commentstring
|
||||
|
||||
augroup jsx_comment
|
||||
autocmd! CursorMoved <buffer>
|
||||
autocmd CursorMoved <buffer> call jsx_pretty#comment#update_commentstring(b:jsx_pretty_old_cms)
|
||||
augroup end
|
||||
|
||||
setlocal suffixesadd+=.jsx
|
||||
|
||||
endif
|
||||
@@ -1,4 +1,4 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
" modified from html.vim
|
||||
" For matchit plugin
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
source <sfile>:h/tsx.vim
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: Yaml
|
||||
" Author: Henrique Barcelos
|
||||
" Date: 2014-10-08
|
||||
" URL: https://github.com/hjpbarcelos
|
||||
setlocal autoindent sw=2 ts=2 expandtab
|
||||
" vim:set sw=2:
|
||||
|
||||
endif
|
||||
@@ -1,33 +1,9 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim indent file
|
||||
"
|
||||
" Language: javascript.jsx
|
||||
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
if exists('b:did_indent')
|
||||
let s:did_indent = b:did_indent
|
||||
unlet b:did_indent
|
||||
if get(g:, 'vim_jsx_pretty_disable_js', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists('s:did_indent')
|
||||
let b:did_indent = s:did_indent
|
||||
endif
|
||||
|
||||
setlocal indentexpr=GetJsxIndent()
|
||||
setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
|
||||
|
||||
function! GetJsxIndent()
|
||||
return jsx_pretty#indent#get(function('GetJavascriptIndent'))
|
||||
endfunction
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
source <sfile>:h/jsx.vim
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
source <sfile>:h/javascript.vim
|
||||
source <sfile>:h/jsx.vim
|
||||
|
||||
endif
|
||||
|
||||
33
after/indent/jsx.vim
Normal file
33
after/indent/jsx.vim
Normal file
@@ -0,0 +1,33 @@
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim indent file
|
||||
"
|
||||
" Language: javascript.jsx
|
||||
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
if exists('b:did_indent')
|
||||
let s:did_indent = b:did_indent
|
||||
unlet b:did_indent
|
||||
endif
|
||||
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists('s:did_indent')
|
||||
let b:did_indent = s:did_indent
|
||||
endif
|
||||
|
||||
setlocal indentexpr=GetJsxIndent()
|
||||
setlocal indentkeys=0.,0{,0},0),0],0?,0\*,0\,,!^F,:,<:>,o,O,e,<>>,=*/
|
||||
|
||||
function! GetJsxIndent()
|
||||
return jsx_pretty#indent#get(function('GetJavascriptIndent'))
|
||||
endfunction
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
endif
|
||||
@@ -1,4 +1,4 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim indent file
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
source <sfile>:h/tsx.vim
|
||||
|
||||
|
||||
@@ -1,321 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c++11') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: C Additions
|
||||
" Maintainer: Jon Haggblad <jon@haeggblad.com>
|
||||
" Contributor: Mikhail Wolfson <mywolfson@gmail.com>
|
||||
" URL: http://www.haeggblad.com
|
||||
" Last Change: 6 Sep 2014
|
||||
" Version: 0.3
|
||||
" Changelog:
|
||||
" 0.3 - integration of aftersyntaxc.vim
|
||||
" 0.2 - Cleanup
|
||||
" 0.1 - initial version.
|
||||
"
|
||||
" Syntax highlighting for functions in C.
|
||||
"
|
||||
" Based on:
|
||||
" http://stackoverflow.com/questions/736701/class-function-names-highlighting-in-vim
|
||||
|
||||
" -----------------------------------------------------------------------------
|
||||
" Highlight function names.
|
||||
" -----------------------------------------------------------------------------
|
||||
if !exists('g:cpp_no_function_highlight')
|
||||
syn match cCustomParen transparent "(" contains=cParen contains=cCppParen
|
||||
syn match cCustomFunc "\w\+\s*(\@=" contains=cCustomParen
|
||||
hi def link cCustomFunc Function
|
||||
endif
|
||||
|
||||
" -----------------------------------------------------------------------------
|
||||
" Highlight member variable names.
|
||||
" -----------------------------------------------------------------------------
|
||||
if exists('g:cpp_member_variable_highlight') && g:cpp_member_variable_highlight
|
||||
syn match cCustomDot "\." contained
|
||||
syn match cCustomPtr "->" contained
|
||||
syn match cCustomMemVar "\(\.\|->\)\h\w*" contains=cCustomDot,cCustomPtr
|
||||
hi def link cCustomMemVar Function
|
||||
endif
|
||||
|
||||
" -----------------------------------------------------------------------------
|
||||
" Highlight POSIX functions.
|
||||
" -----------------------------------------------------------------------------
|
||||
if exists('g:cpp_posix_standard') && g:cpp_posix_standard
|
||||
syn keyword cPOSIXFunction socket accept bind connect getsockname
|
||||
syn keyword cPOSIXFunction listen recv recvfrom recvmsg
|
||||
syn keyword cPOSIXFunction send sendto sendmsg setsockopt socketpair
|
||||
syn keyword cPOSIXFunction htonl htons ntohl ntohs
|
||||
syn keyword cPOSIXFunction inet_ntop inet_pton getaddrinfo
|
||||
syn keyword cPOSIXFunction poll select pselect
|
||||
hi def link cPOSIXFunction Function
|
||||
endif
|
||||
|
||||
" -----------------------------------------------------------------------------
|
||||
" Source: aftersyntaxc.vim
|
||||
" -----------------------------------------------------------------------------
|
||||
|
||||
" Common ANSI-standard functions
|
||||
syn keyword cAnsiFunction MULU_ DIVU_ MODU_ MUL_ DIV_ MOD_
|
||||
syn keyword cAnsiFunction main typeof
|
||||
syn keyword cAnsiFunction open close read write lseek dup dup2
|
||||
syn keyword cAnsiFunction fcntl ioctl
|
||||
syn keyword cAnsiFunction wctrans towctrans towupper
|
||||
syn keyword cAnsiFunction towlower wctype iswctype
|
||||
syn keyword cAnsiFunction iswxdigit iswupper iswspace
|
||||
syn keyword cAnsiFunction iswpunct iswprint iswlower
|
||||
syn keyword cAnsiFunction iswgraph iswdigit iswcntrl
|
||||
syn keyword cAnsiFunction iswalpha iswalnum wcsrtombs
|
||||
syn keyword cAnsiFunction mbsrtowcs wcrtomb mbrtowc
|
||||
syn keyword cAnsiFunction mbrlen mbsinit wctob
|
||||
syn keyword cAnsiFunction btowc wcsfxtime wcsftime
|
||||
syn keyword cAnsiFunction wmemset wmemmove wmemcpy
|
||||
syn keyword cAnsiFunction wmemcmp wmemchr wcstok
|
||||
syn keyword cAnsiFunction wcsstr wcsspn wcsrchr
|
||||
syn keyword cAnsiFunction wcspbrk wcslen wcscspn
|
||||
syn keyword cAnsiFunction wcschr wcsxfrm wcsncmp
|
||||
syn keyword cAnsiFunction wcscoll wcscmp wcsncat
|
||||
syn keyword cAnsiFunction wcscat wcsncpy wcscpy
|
||||
syn keyword cAnsiFunction wcstoull wcstoul wcstoll
|
||||
syn keyword cAnsiFunction wcstol wcstold wcstof
|
||||
syn keyword cAnsiFunction wcstod ungetwc putwchar
|
||||
syn keyword cAnsiFunction putwc getwchar getwc
|
||||
syn keyword cAnsiFunction fwide fputws fputwc
|
||||
syn keyword cAnsiFunction fgetws fgetwc wscanf
|
||||
syn keyword cAnsiFunction wprintf vwscanf vwprintf
|
||||
syn keyword cAnsiFunction vswscanf vswprintf vfwscanf
|
||||
syn keyword cAnsiFunction vfwprintf swscanf swprintf
|
||||
syn keyword cAnsiFunction fwscanf fwprintf zonetime
|
||||
syn keyword cAnsiFunction strfxtime strftime localtime
|
||||
syn keyword cAnsiFunction gmtime ctime asctime
|
||||
syn keyword cAnsiFunction time mkxtime mktime
|
||||
syn keyword cAnsiFunction difftime clock strlen
|
||||
syn keyword cAnsiFunction strerror memset strtok
|
||||
syn keyword cAnsiFunction strstr strspn strrchr
|
||||
syn keyword cAnsiFunction strpbrk strcspn strchr
|
||||
syn keyword cAnsiFunction memchr strxfrm strncmp
|
||||
syn keyword cAnsiFunction strcoll strcmp memcmp
|
||||
syn keyword cAnsiFunction strncat strcat strncpy
|
||||
syn keyword cAnsiFunction strcpy memmove memcpy
|
||||
syn keyword cAnsiFunction wcstombs mbstowcs wctomb
|
||||
syn keyword cAnsiFunction mbtowc mblen lldiv
|
||||
syn keyword cAnsiFunction ldiv div llabs
|
||||
syn keyword cAnsiFunction labs abs qsort
|
||||
"syn keyword cAnsiFunction bsearch system getenv
|
||||
syn keyword cAnsiFunction bsearch getenv
|
||||
syn keyword cAnsiFunction exit atexit abort
|
||||
syn keyword cAnsiFunction realloc malloc free
|
||||
syn keyword cAnsiFunction calloc srand rand
|
||||
syn keyword cAnsiFunction strtoull strtoul strtoll
|
||||
syn keyword cAnsiFunction strtol strtold strtof
|
||||
syn keyword cAnsiFunction strtod atoll atol
|
||||
syn keyword cAnsiFunction atoi atof perror
|
||||
syn keyword cAnsiFunction ferror feof clearerr
|
||||
syn keyword cAnsiFunction rewind ftell fsetpos
|
||||
syn keyword cAnsiFunction fseek fgetpos fwrite
|
||||
syn keyword cAnsiFunction fread ungetc puts
|
||||
syn keyword cAnsiFunction putchar putc gets
|
||||
syn keyword cAnsiFunction getchar getc fputs
|
||||
syn keyword cAnsiFunction fputc fgets fgetc
|
||||
syn keyword cAnsiFunction vsscanf vsprintf vsnprintf
|
||||
syn keyword cAnsiFunction vscanf vprintf vfscanf
|
||||
syn keyword cAnsiFunction vfprintf sscanf sprintf
|
||||
syn keyword cAnsiFunction snprintf scanf printf
|
||||
syn keyword cAnsiFunction fscanf fprintf setvbuf
|
||||
syn keyword cAnsiFunction setbuf freopen fopen
|
||||
syn keyword cAnsiFunction fflush fclose tmpnam
|
||||
syn keyword cAnsiFunction tmpfile rename remove
|
||||
syn keyword cAnsiFunction offsetof va_start va_end
|
||||
syn keyword cAnsiFunction va_copy va_arg raise signal
|
||||
syn keyword cAnsiFunction longjmp setjmp isunordered
|
||||
syn keyword cAnsiFunction islessgreater islessequal isless
|
||||
syn keyword cAnsiFunction isgreaterequal isgreater fmal
|
||||
syn keyword cAnsiFunction fmaf fma fminl
|
||||
syn keyword cAnsiFunction fminf fmin fmaxl
|
||||
syn keyword cAnsiFunction fmaxf fmax fdiml
|
||||
syn keyword cAnsiFunction fdimf fdim nextafterxl
|
||||
syn keyword cAnsiFunction nextafterxf nextafterx nextafterl
|
||||
syn keyword cAnsiFunction nextafterf nextafter nanl
|
||||
syn keyword cAnsiFunction nanf nan copysignl
|
||||
syn keyword cAnsiFunction copysignf copysign remquol
|
||||
syn keyword cAnsiFunction remquof remquo remainderl
|
||||
syn keyword cAnsiFunction remainderf remainder fmodl
|
||||
syn keyword cAnsiFunction fmodf fmod truncl
|
||||
syn keyword cAnsiFunction truncf trunc llroundl
|
||||
syn keyword cAnsiFunction llroundf llround lroundl
|
||||
syn keyword cAnsiFunction lroundf lround roundl
|
||||
syn keyword cAnsiFunction roundf round llrintl
|
||||
syn keyword cAnsiFunction llrintf llrint lrintl
|
||||
syn keyword cAnsiFunction lrintf lrint rintl
|
||||
syn keyword cAnsiFunction rintf rint nearbyintl
|
||||
syn keyword cAnsiFunction nearbyintf nearbyint floorl
|
||||
syn keyword cAnsiFunction floorf floor ceill
|
||||
syn keyword cAnsiFunction ceilf ceil tgammal
|
||||
syn keyword cAnsiFunction tgammaf tgamma lgammal
|
||||
syn keyword cAnsiFunction lgammaf lgamma erfcl
|
||||
syn keyword cAnsiFunction erfcf erfc erfl
|
||||
syn keyword cAnsiFunction erff erf sqrtl
|
||||
syn keyword cAnsiFunction sqrtf sqrt powl
|
||||
syn keyword cAnsiFunction powf pow hypotl
|
||||
syn keyword cAnsiFunction hypotf hypot fabsl
|
||||
syn keyword cAnsiFunction fabsf fabs cbrtl
|
||||
syn keyword cAnsiFunction cbrtf cbrt scalblnl
|
||||
syn keyword cAnsiFunction scalblnf scalbln scalbnl
|
||||
syn keyword cAnsiFunction scalbnf scalbn modfl
|
||||
syn keyword cAnsiFunction modff modf logbl
|
||||
syn keyword cAnsiFunction logbf logb log2l
|
||||
syn keyword cAnsiFunction log2f log2 log1pl
|
||||
syn keyword cAnsiFunction log1pf log1p log10l
|
||||
syn keyword cAnsiFunction log10f log10 logl
|
||||
syn keyword cAnsiFunction logf log ldexpl
|
||||
syn keyword cAnsiFunction ldexpf ldexp ilogbl
|
||||
syn keyword cAnsiFunction ilogbf ilogb frexpl
|
||||
syn keyword cAnsiFunction frexpf frexp expm1l
|
||||
syn keyword cAnsiFunction expm1f expm1 exp2l
|
||||
syn keyword cAnsiFunction exp2f exp2 expl
|
||||
syn keyword cAnsiFunction expf exp tanhl
|
||||
syn keyword cAnsiFunction tanhf tanh sinhl
|
||||
syn keyword cAnsiFunction sinhf sinh coshl
|
||||
syn keyword cAnsiFunction coshf cosh atanhl
|
||||
syn keyword cAnsiFunction atanhf atanh asinhl
|
||||
syn keyword cAnsiFunction asinhf asinh acoshl
|
||||
syn keyword cAnsiFunction acoshf acosh tanl
|
||||
syn keyword cAnsiFunction tanf tan sinl
|
||||
syn keyword cAnsiFunction sinf sin cosl
|
||||
syn keyword cAnsiFunction cosf cos atan2l
|
||||
syn keyword cAnsiFunction atan2f atan2 atanl
|
||||
syn keyword cAnsiFunction atanf atan asinl
|
||||
syn keyword cAnsiFunction asinf asin acosl
|
||||
syn keyword cAnsiFunction acosf acos signbit
|
||||
syn keyword cAnsiFunction isnormal isnan isinf
|
||||
syn keyword cAnsiFunction isfinite fpclassify localeconv
|
||||
syn keyword cAnsiFunction setlocale wcstoumax wcstoimax
|
||||
syn keyword cAnsiFunction strtoumax strtoimax feupdateenv
|
||||
syn keyword cAnsiFunction fesetenv feholdexcept fegetenv
|
||||
syn keyword cAnsiFunction fesetround fegetround fetestexcept
|
||||
syn keyword cAnsiFunction fesetexceptflag feraiseexcept fegetexceptflag
|
||||
syn keyword cAnsiFunction feclearexcept toupper tolower
|
||||
syn keyword cAnsiFunction isxdigit isupper isspace
|
||||
syn keyword cAnsiFunction ispunct isprint islower
|
||||
syn keyword cAnsiFunction isgraph isdigit iscntrl
|
||||
syn keyword cAnsiFunction isalpha isalnum creall
|
||||
syn keyword cAnsiFunction crealf creal cprojl
|
||||
syn keyword cAnsiFunction cprojf cproj conjl
|
||||
syn keyword cAnsiFunction conjf conj cimagl
|
||||
syn keyword cAnsiFunction cimagf cimag cargl
|
||||
syn keyword cAnsiFunction cargf carg csqrtl
|
||||
syn keyword cAnsiFunction csqrtf csqrt cpowl
|
||||
syn keyword cAnsiFunction cpowf cpow cabsl
|
||||
syn keyword cAnsiFunction cabsf cabs clogl
|
||||
syn keyword cAnsiFunction clogf clog cexpl
|
||||
syn keyword cAnsiFunction cexpf cexp ctanhl
|
||||
syn keyword cAnsiFunction ctanhf ctanh csinhl
|
||||
syn keyword cAnsiFunction csinhf csinh ccoshl
|
||||
syn keyword cAnsiFunction ccoshf ccosh catanhl
|
||||
syn keyword cAnsiFunction catanhf catanh casinhl
|
||||
syn keyword cAnsiFunction casinhf casinh cacoshl
|
||||
syn keyword cAnsiFunction cacoshf cacosh ctanl
|
||||
syn keyword cAnsiFunction ctanf ctan csinl
|
||||
syn keyword cAnsiFunction csinf csin ccosl
|
||||
syn keyword cAnsiFunction ccosf ccos catanl
|
||||
syn keyword cAnsiFunction catanf catan casinl
|
||||
syn keyword cAnsiFunction casinf casin cacosl
|
||||
syn keyword cAnsiFunction cacosf cacos assert
|
||||
syn keyword cAnsiFunction UINTMAX_C INTMAX_C UINT64_C
|
||||
syn keyword cAnsiFunction UINT32_C UINT16_C UINT8_C
|
||||
syn keyword cAnsiFunction INT64_C INT32_C INT16_C INT8_C
|
||||
|
||||
" Common ANSI-standard Names
|
||||
syn keyword cAnsiName PRId8 PRIi16 PRIo32 PRIu64
|
||||
syn keyword cAnsiName PRId16 PRIi32 PRIo64 PRIuLEAST8
|
||||
syn keyword cAnsiName PRId32 PRIi64 PRIoLEAST8 PRIuLEAST16
|
||||
syn keyword cAnsiName PRId64 PRIiLEAST8 PRIoLEAST16 PRIuLEAST32
|
||||
syn keyword cAnsiName PRIdLEAST8 PRIiLEAST16 PRIoLEAST32 PRIuLEAST64
|
||||
syn keyword cAnsiName PRIdLEAST16 PRIiLEAST32 PRIoLEAST64 PRIuFAST8
|
||||
syn keyword cAnsiName PRIdLEAST32 PRIiLEAST64 PRIoFAST8 PRIuFAST16
|
||||
syn keyword cAnsiName PRIdLEAST64 PRIiFAST8 PRIoFAST16 PRIuFAST32
|
||||
syn keyword cAnsiName PRIdFAST8 PRIiFAST16 PRIoFAST32 PRIuFAST64
|
||||
syn keyword cAnsiName PRIdFAST16 PRIiFAST32 PRIoFAST64 PRIuMAX
|
||||
syn keyword cAnsiName PRIdFAST32 PRIiFAST64 PRIoMAX PRIuPTR
|
||||
syn keyword cAnsiName PRIdFAST64 PRIiMAX PRIoPTR PRIx8
|
||||
syn keyword cAnsiName PRIdMAX PRIiPTR PRIu8 PRIx16
|
||||
syn keyword cAnsiName PRIdPTR PRIo8 PRIu16 PRIx32
|
||||
syn keyword cAnsiName PRIi8 PRIo16 PRIu32 PRIx64
|
||||
|
||||
syn keyword cAnsiName PRIxLEAST8 SCNd8 SCNiFAST32 SCNuLEAST32
|
||||
syn keyword cAnsiName PRIxLEAST16 SCNd16 SCNiFAST64 SCNuLEAST64
|
||||
syn keyword cAnsiName PRIxLEAST32 SCNd32 SCNiMAX SCNuFAST8
|
||||
syn keyword cAnsiName PRIxLEAST64 SCNd64 SCNiPTR SCNuFAST16
|
||||
syn keyword cAnsiName PRIxFAST8 SCNdLEAST8 SCNo8 SCNuFAST32
|
||||
syn keyword cAnsiName PRIxFAST16 SCNdLEAST16 SCNo16 SCNuFAST64
|
||||
syn keyword cAnsiName PRIxFAST32 SCNdLEAST32 SCNo32 SCNuMAX
|
||||
syn keyword cAnsiName PRIxFAST64 SCNdLEAST64 SCNo64 SCNuPTR
|
||||
syn keyword cAnsiName PRIxMAX SCNdFAST8 SCNoLEAST8 SCNx8
|
||||
syn keyword cAnsiName PRIxPTR SCNdFAST16 SCNoLEAST16 SCNx16
|
||||
syn keyword cAnsiName PRIX8 SCNdFAST32 SCNoLEAST32 SCNx32
|
||||
syn keyword cAnsiName PRIX16 SCNdFAST64 SCNoLEAST64 SCNx64
|
||||
syn keyword cAnsiName PRIX32 SCNdMAX SCNoFAST8 SCNxLEAST8
|
||||
syn keyword cAnsiName PRIX64 SCNdPTR SCNoFAST16 SCNxLEAST16
|
||||
syn keyword cAnsiName PRIXLEAST8 SCNi8 SCNoFAST32 SCNxLEAST32
|
||||
syn keyword cAnsiName PRIXLEAST16 SCNi16 SCNoFAST64 SCNxLEAST64
|
||||
syn keyword cAnsiName PRIXLEAST32 SCNi32 SCNoMAX SCNxFAST8
|
||||
syn keyword cAnsiName PRIXLEAST64 SCNi64 SCNoPTR SCNxFAST16
|
||||
syn keyword cAnsiName PRIXFAST8 SCNiLEAST8 SCNu8 SCNxFAST32
|
||||
syn keyword cAnsiName PRIXFAST16 SCNiLEAST16 SCNu16 SCNxFAST64
|
||||
syn keyword cAnsiName PRIXFAST32 SCNiLEAST32 SCNu32 SCNxMAX
|
||||
syn keyword cAnsiName PRIXFAST64 SCNiLEAST64 SCNu64 SCNxPTR
|
||||
syn keyword cAnsiName PRIXMAX SCNiFAST8 SCNuLEAST8
|
||||
syn keyword cAnsiName PRIXPTR SCNiFAST16 SCNuLEAST16
|
||||
|
||||
syn keyword cAnsiName errno environ
|
||||
|
||||
syn keyword cAnsiName STDC CX_LIMITED_RANGE
|
||||
syn keyword cAnsiName STDC FENV_ACCESS
|
||||
syn keyword cAnsiName STDC FP_CONTRACT
|
||||
|
||||
syn keyword cAnsiName and bitor not_eq xor
|
||||
syn keyword cAnsiName and_eq compl or xor_eq
|
||||
syn keyword cAnsiName bitand not or_eq
|
||||
|
||||
hi def link cAnsiFunction cFunction
|
||||
hi def link cAnsiName cIdentifier
|
||||
hi def link cFunction Function
|
||||
hi def link cIdentifier Identifier
|
||||
|
||||
" Booleans
|
||||
syn keyword cBoolean true false TRUE FALSE
|
||||
hi def link cBoolean Boolean
|
||||
|
||||
" -----------------------------------------------------------------------------
|
||||
" Additional optional highlighting
|
||||
" -----------------------------------------------------------------------------
|
||||
|
||||
" Operators
|
||||
"syn match cOperator "\(<<\|>>\|[-+*/%&^|<>!=]\)="
|
||||
"syn match cOperator "<<\|>>\|&&\|||\|++\|--\|->"
|
||||
"syn match cOperator "[.!~*&%<>^|=,+-]"
|
||||
"syn match cOperator "/[^/*=]"me=e-1
|
||||
"syn match cOperator "/$"
|
||||
"syn match cOperator "&&\|||"
|
||||
"syn match cOperator "[][]"
|
||||
"
|
||||
"" Preprocs
|
||||
"syn keyword cDefined defined contained containedin=cDefine
|
||||
"hi def link cDefined cDefine
|
||||
|
||||
"" Functions
|
||||
"syn match cUserFunction "\<\h\w*\>\(\s\|\n\)*("me=e-1 contains=cType,cDelimiter,cDefine
|
||||
"syn match cUserFunctionPointer "(\s*\*\s*\h\w*\s*)\(\s\|\n\)*(" contains=cDelimiter,cOperator
|
||||
"
|
||||
"hi def link cUserFunction cFunction
|
||||
"hi def link cUserFunctionPointer cFunction
|
||||
"
|
||||
"" Delimiters
|
||||
"syn match cDelimiter "[();\\]"
|
||||
"" foldmethod=syntax fix, courtesy of Ivan Freitas
|
||||
"syn match cBraces display "[{}]"
|
||||
|
||||
" Links
|
||||
"hi def link cDelimiter Delimiter
|
||||
" foldmethod=syntax fix, courtesy of Ivan Freitas
|
||||
"hi def link cBraces Delimiter
|
||||
|
||||
endif
|
||||
2297
after/syntax/cpp.vim
2297
after/syntax/cpp.vim
File diff suppressed because it is too large
Load Diff
82
after/syntax/idris2.vim
Normal file
82
after/syntax/idris2.vim
Normal file
@@ -0,0 +1,82 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'idris2') == -1
|
||||
|
||||
" This script allows for unicode concealing of certain characters
|
||||
" For instance -> goes to →
|
||||
"
|
||||
" It needs vim >= 7.3, set nocompatible, set enc=utf-8
|
||||
"
|
||||
" If you want to turn this on, let g:idris_conceal = 1
|
||||
|
||||
if !exists('g:idris_conceal') || !has('conceal') || &enc != 'utf-8'
|
||||
finish
|
||||
endif
|
||||
|
||||
" vim: set fenc=utf-8:
|
||||
syntax match idrNiceOperator "\\\ze[[:alpha:][:space:]_([]" conceal cchar=λ
|
||||
syntax match idrNiceOperator "<-" conceal cchar=←
|
||||
syntax match idrNiceOperator "->" conceal cchar=→
|
||||
syntax match idrNiceOperator "\<sum\>" conceal cchar=∑
|
||||
syntax match idrNiceOperator "\<product\>" conceal cchar=∏
|
||||
syntax match idrNiceOperator "\<sqrt\>" conceal cchar=√
|
||||
syntax match idrNiceOperator "\<pi\>" conceal cchar=π
|
||||
syntax match idrNiceOperator "==" conceal cchar=≡
|
||||
syntax match idrNiceOperator "\/=" conceal cchar=≠
|
||||
|
||||
|
||||
let s:extraConceal = 1
|
||||
|
||||
let s:doubleArrow = 1
|
||||
" Set this to 0 to use the more technically correct arrow from bar
|
||||
|
||||
" Some windows font don't support some of the characters,
|
||||
" so if they are the main font, we don't load them :)
|
||||
if has("win32")
|
||||
let s:incompleteFont = [ 'Consolas'
|
||||
\ , 'Lucida Console'
|
||||
\ , 'Courier New'
|
||||
\ ]
|
||||
let s:mainfont = substitute( &guifont, '^\([^:,]\+\).*', '\1', '')
|
||||
for s:fontName in s:incompleteFont
|
||||
if s:mainfont ==? s:fontName
|
||||
let s:extraConceal = 0
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
if s:extraConceal
|
||||
syntax match idrNiceOperator "Void" conceal cchar=⊥
|
||||
|
||||
" Match greater than and lower than w/o messing with Kleisli composition
|
||||
syntax match idrNiceOperator "<=\ze[^<]" conceal cchar=≤
|
||||
syntax match idrNiceOperator ">=\ze[^>]" conceal cchar=≥
|
||||
|
||||
if s:doubleArrow
|
||||
syntax match idrNiceOperator "=>" conceal cchar=⇒
|
||||
else
|
||||
syntax match idrNiceOperator "=>" conceal cchar=↦
|
||||
endif
|
||||
|
||||
syntax match idrNiceOperator "=\zs<<" conceal cchar=«
|
||||
|
||||
syntax match idrNiceOperator "++" conceal cchar=⧺
|
||||
syntax match idrNiceOperator "::" conceal cchar=∷
|
||||
syntax match idrNiceOperator "-<" conceal cchar=↢
|
||||
syntax match idrNiceOperator ">-" conceal cchar=↣
|
||||
syntax match idrNiceOperator "-<<" conceal cchar=⤛
|
||||
syntax match idrNiceOperator ">>-" conceal cchar=⤜
|
||||
|
||||
" Only replace the dot, avoid taking spaces around.
|
||||
syntax match idrNiceOperator /\s\.\s/ms=s+1,me=e-1 conceal cchar=∘
|
||||
syntax match idrNiceOperator "\.\." conceal cchar=‥
|
||||
|
||||
syntax match idrNiceOperator "`elem`" conceal cchar=∈
|
||||
syntax match idrNiceOperator "`notElem`" conceal cchar=∉
|
||||
endif
|
||||
|
||||
hi link idrNiceOperator Operator
|
||||
hi! link Conceal Operator
|
||||
setlocal conceallevel=2
|
||||
|
||||
|
||||
endif
|
||||
@@ -1,59 +1,9 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim syntax file
|
||||
"
|
||||
" Language: javascript.jsx
|
||||
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
let s:jsx_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syntax case match
|
||||
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax = b:current_syntax
|
||||
unlet b:current_syntax
|
||||
if get(g:, 'vim_jsx_pretty_disable_js', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists('s:current_syntax')
|
||||
let b:current_syntax = s:current_syntax
|
||||
endif
|
||||
|
||||
if hlexists("jsDebugger") || hlexists("jsNoise") " yuezk/vim-js or pangloss/vim-javascript
|
||||
syntax cluster jsExpression add=jsxRegion
|
||||
elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
|
||||
" refine the javascript line comment
|
||||
syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
|
||||
syntax cluster javascriptValue add=jsxRegion
|
||||
syntax cluster javascriptNoReserved add=jsxElement,jsxTag
|
||||
else " build-in javascript syntax
|
||||
" refine the javascript line comment
|
||||
syntax region javaScriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
|
||||
|
||||
" refine the template string syntax
|
||||
syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr
|
||||
|
||||
" add a javaScriptBlock group for build-in syntax
|
||||
syntax region javaScriptBlock
|
||||
\ matchgroup=javaScriptBraces
|
||||
\ start="{"
|
||||
\ end="}"
|
||||
\ contained
|
||||
\ extend
|
||||
\ contains=javaScriptBlock,@javaScriptEmbededExpr,javaScript.*
|
||||
\ fold
|
||||
|
||||
syntax cluster javaScriptEmbededExpr add=jsxRegion,javaScript.*
|
||||
endif
|
||||
|
||||
runtime syntax/jsx_pretty.vim
|
||||
|
||||
let b:current_syntax = 'javascript.jsx'
|
||||
|
||||
let &cpo = s:jsx_cpo
|
||||
unlet s:jsx_cpo
|
||||
source <sfile>:h/jsx.vim
|
||||
|
||||
endif
|
||||
|
||||
26
after/syntax/javascript/sql.vim
Normal file
26
after/syntax/javascript/sql.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript-sql') == -1
|
||||
|
||||
" Vim plugin
|
||||
" Language: JavaScript
|
||||
" Maintainer: Ian Langworth <ian@langworth.com>
|
||||
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax = b:current_syntax
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
|
||||
exec 'syntax include @SQLSyntax syntax/' . g:javascript_sql_dialect . '.vim'
|
||||
if exists('s:current_syntax')
|
||||
let b:current_syntax = s:current_syntax
|
||||
endif
|
||||
|
||||
syntax region sqlTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=@SQLSyntax,jsTemplateExpression,jsSpecial extend
|
||||
exec 'syntax match sqlTaggedTemplate +\%(SQL\)\%(`\)\@=+ nextgroup=sqlTemplateString'
|
||||
|
||||
hi def link sqlTemplateString jsTemplateString
|
||||
hi def link sqlTaggedTemplate jsTaggedTemplate
|
||||
|
||||
syn cluster jsExpression add=sqlTaggedTemplate
|
||||
syn cluster sqlTaggedTemplate add=sqlTemplateString
|
||||
|
||||
endif
|
||||
@@ -1,5 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
source <sfile>:h/javascript.vim
|
||||
source <sfile>:h/jsx.vim
|
||||
|
||||
endif
|
||||
|
||||
59
after/syntax/jsx.vim
Normal file
59
after/syntax/jsx.vim
Normal file
@@ -0,0 +1,59 @@
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim syntax file
|
||||
"
|
||||
" Language: javascript.jsx
|
||||
" Maintainer: MaxMellon <maxmellon1994@gmail.com>
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
let s:jsx_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syntax case match
|
||||
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax = b:current_syntax
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
|
||||
if exists('s:current_syntax')
|
||||
let b:current_syntax = s:current_syntax
|
||||
endif
|
||||
|
||||
if hlexists("jsDebugger") || hlexists("jsNoise") " yuezk/vim-js or pangloss/vim-javascript
|
||||
syntax cluster jsExpression add=jsxRegion
|
||||
elseif hlexists("javascriptOpSymbols") " othree/yajs.vim
|
||||
" refine the javascript line comment
|
||||
syntax region javascriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
|
||||
syntax cluster javascriptValue add=jsxRegion
|
||||
syntax cluster javascriptNoReserved add=jsxElement,jsxTag
|
||||
else " build-in javascript syntax
|
||||
" refine the javascript line comment
|
||||
syntax region javaScriptLineComment start=+//+ end=/$/ contains=@Spell,javascriptCommentTodo extend keepend
|
||||
|
||||
" refine the template string syntax
|
||||
syntax region javaScriptEmbed matchgroup=javaScriptEmbedBraces start=+\${+ end=+}+ contained contains=@javaScriptEmbededExpr
|
||||
|
||||
" add a javaScriptBlock group for build-in syntax
|
||||
syntax region javaScriptBlock
|
||||
\ matchgroup=javaScriptBraces
|
||||
\ start="{"
|
||||
\ end="}"
|
||||
\ contained
|
||||
\ extend
|
||||
\ contains=javaScriptBlock,@javaScriptEmbededExpr,javaScript.*
|
||||
\ fold
|
||||
|
||||
syntax cluster javaScriptEmbededExpr add=jsxRegion,javaScript.*
|
||||
endif
|
||||
|
||||
runtime syntax/jsx_pretty.vim
|
||||
|
||||
let b:current_syntax = 'javascript.jsx'
|
||||
|
||||
let &cpo = s:jsx_cpo
|
||||
unlet s:jsx_cpo
|
||||
|
||||
endif
|
||||
@@ -1,4 +1,4 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
let s:highlight_close_tag = get(g:, 'vim_jsx_pretty_highlight_close_tag', 0)
|
||||
|
||||
|
||||
@@ -32,6 +32,6 @@ if exists('s:current_syntax')
|
||||
let b:current_syntax = s:current_syntax
|
||||
endif
|
||||
|
||||
syntax region graphqlMultilineString matchgroup=reasonMultilineString start=+graphql\_s*\zs{|+ end=+|}+ contains=@GraphQLSyntax,reasonEscape,reasonEscapeUnicode,reasonEscapeError,reasonStringContinuation keepend
|
||||
syntax region graphqlExtensionPoint matchgroup=Noise start=+\[%graphql\_s*{|+lc=10 end=+|}\_s*]+he=s+1 contains=@GraphQLSyntax keepend
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim syntax file
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
source <sfile>:h/tsx.vim
|
||||
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
|
||||
|
||||
" To make this file do stuff, add something like the following (without the
|
||||
" leading ") to your ~/.vimrc:
|
||||
" au BufNewFile,BufRead *.yaml,*.yml so ~/src/PyYaml/YAML.vim
|
||||
|
||||
" Vim syntax/macro file
|
||||
" Language: YAML
|
||||
" Author: Igor Vergeichik <iverg@mail.ru>
|
||||
" Sponsor: Tom Sawyer <transami@transami.net>
|
||||
" Stayven: Ryan King <jking@panoptic.com>
|
||||
" Copyright (c) 2002 Tom Saywer
|
||||
|
||||
" Add an item to a gangly list:
|
||||
"map , o<bs><bs><bs><bs>-<esc>o
|
||||
" Convert to Canonical form:
|
||||
"map \c :%!python -c 'from yaml.redump import redump; import sys; print redump(sys.stdin.read()).rstrip()'
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
endif
|
||||
syntax clear
|
||||
|
||||
syn match yamlInline "[\[\]\{\}]"
|
||||
syn match yamlBlock "[>|]\d\?[+-]"
|
||||
|
||||
syn region yamlComment start="\#" end="$"
|
||||
syn match yamlIndicator "#YAML:\S\+"
|
||||
|
||||
syn region yamlString start="\(^\|\s\|\[\|\,\|\-\)\@<='" end="'" skip="\\'"
|
||||
syn region yamlString start='"' end='"' skip='\\"' contains=yamlEscape
|
||||
syn region yamlString matchgroup=yamlBlock start=/[>|]\s*\n\+\z(\s\+\)\S/rs=s+1 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1
|
||||
syn region yamlString matchgroup=yamlBlock start=/[>|]\(\d\|[+-]\)\s*\n\+\z(\s\+\)\S/rs=s+2 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1
|
||||
syn region yamlString matchgroup=yamlBlock start=/[>|]\d\(\d\|[+-]\)\s*\n\+\z(\s\+\)\S/rs=s+3 skip=/^\%(\z1\S\|^$\)/ end=/^\z1\@!.*/me=s-1
|
||||
syn match yamlEscape +\\[abfnrtv'"\\]+ contained
|
||||
syn match yamlEscape "\\\o\o\=\o\=" contained
|
||||
syn match yamlEscape "\\x\x\+" contained
|
||||
|
||||
syn match yamlType "!\S\+"
|
||||
|
||||
syn keyword yamlConstant NULL Null null NONE None none NIL Nil nil
|
||||
syn keyword yamlConstant TRUE True true YES Yes yes ON On on
|
||||
syn keyword yamlConstant FALSE False false NO No no OFF Off off
|
||||
|
||||
syn match yamlKey "^\s*\zs[^ \t\"\'#]\+\ze\s*:"
|
||||
syn match yamlKey "^\s*-\s*\zs[^ \t\"\'#]\+\ze\s*:"
|
||||
syn match yamlAnchor "&\S\+"
|
||||
syn match yamlAlias "*\S\+"
|
||||
|
||||
" Setup the highlighting links
|
||||
|
||||
hi link yamlConstant Keyword
|
||||
hi link yamlIndicator PreCondit
|
||||
hi link yamlAnchor Function
|
||||
hi link yamlAlias Function
|
||||
hi link yamlKey Identifier
|
||||
hi link yamlType Type
|
||||
|
||||
hi link yamlComment Comment
|
||||
hi link yamlInline Operator
|
||||
hi link yamlBlock Operator
|
||||
hi link yamlString String
|
||||
hi link yamlEscape Special
|
||||
|
||||
endif
|
||||
641
autoload/ada.vim
Normal file
641
autoload/ada.vim
Normal file
@@ -0,0 +1,641 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ada') == -1
|
||||
|
||||
"------------------------------------------------------------------------------
|
||||
" Description: Perform Ada specific completion & tagging.
|
||||
" Language: Ada (2005)
|
||||
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Maintainer: Mathias Brousset <mathiasb17@gmail.com>
|
||||
" Martin Krischik <krischik@users.sourceforge.net>
|
||||
" Taylor Venable <taylor@metasyntax.net>
|
||||
" Neil Bird <neil@fnxweb.com>
|
||||
" Ned Okie <nokie@radford.edu>
|
||||
" $Author: krischik $
|
||||
" $Date: 2017-01-31 20:20:05 +0200 (Mon, 01 Jan 2017) $
|
||||
" Version: 4.6
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $
|
||||
" History: 24.05.2006 MK Unified Headers
|
||||
" 26.05.2006 MK ' should not be in iskeyword.
|
||||
" 16.07.2006 MK Ada-Mode as vim-ball
|
||||
" 02.10.2006 MK Better folding.
|
||||
" 15.10.2006 MK Bram's suggestion for runtime integration
|
||||
" 05.11.2006 MK Bram suggested not to use include protection for
|
||||
" autoload
|
||||
" 05.11.2006 MK Bram suggested to save on spaces
|
||||
" 08.07.2007 TV fix mapleader problems.
|
||||
" 09.05.2007 MK Session just won't work no matter how much
|
||||
" tweaking is done
|
||||
" 19.09.2007 NO still some mapleader problems
|
||||
" 31.01.2017 MB fix more mapleader problems
|
||||
" Help Page: ft-ada-functions
|
||||
"------------------------------------------------------------------------------
|
||||
|
||||
if version < 700
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Section: Constants {{{1
|
||||
"
|
||||
let g:ada#DotWordRegex = '\a\w*\(\_s*\.\_s*\a\w*\)*'
|
||||
let g:ada#WordRegex = '\a\w*'
|
||||
let g:ada#Comment = "\\v^(\"[^\"]*\"|'.'|[^\"']){-}\\zs\\s*--.*"
|
||||
let g:ada#Keywords = []
|
||||
|
||||
" Section: g:ada#Keywords {{{1
|
||||
"
|
||||
" Section: add Ada keywords {{{2
|
||||
"
|
||||
for Item in ['abort', 'else', 'new', 'return', 'abs', 'elsif', 'not', 'reverse', 'abstract', 'end', 'null', 'accept', 'entry', 'select', 'access', 'exception', 'of', 'separate', 'aliased', 'exit', 'or', 'subtype', 'all', 'others', 'synchronized', 'and', 'for', 'out', 'array', 'function', 'overriding', 'tagged', 'at', 'task', 'generic', 'package', 'terminate', 'begin', 'goto', 'pragma', 'then', 'body', 'private', 'type', 'if', 'procedure', 'case', 'in', 'protected', 'until', 'constant', 'interface', 'use', 'is', 'raise', 'declare', 'range', 'when', 'delay', 'limited', 'record', 'while', 'delta', 'loop', 'rem', 'with', 'digits', 'renames', 'do', 'mod', 'requeue', 'xor']
|
||||
let g:ada#Keywords += [{
|
||||
\ 'word': Item,
|
||||
\ 'menu': 'keyword',
|
||||
\ 'info': 'Ada keyword.',
|
||||
\ 'kind': 'k',
|
||||
\ 'icase': 1}]
|
||||
endfor
|
||||
|
||||
" Section: GNAT Project Files {{{3
|
||||
"
|
||||
if exists ('g:ada_with_gnat_project_files')
|
||||
for Item in ['project']
|
||||
let g:ada#Keywords += [{
|
||||
\ 'word': Item,
|
||||
\ 'menu': 'keyword',
|
||||
\ 'info': 'GNAT projectfile keyword.',
|
||||
\ 'kind': 'k',
|
||||
\ 'icase': 1}]
|
||||
endfor
|
||||
endif
|
||||
|
||||
" Section: add standart exception {{{2
|
||||
"
|
||||
for Item in ['Constraint_Error', 'Program_Error', 'Storage_Error', 'Tasking_Error', 'Status_Error', 'Mode_Error', 'Name_Error', 'Use_Error', 'Device_Error', 'End_Error', 'Data_Error', 'Layout_Error', 'Length_Error', 'Pattern_Error', 'Index_Error', 'Translation_Error', 'Time_Error', 'Argument_Error', 'Tag_Error', 'Picture_Error', 'Terminator_Error', 'Conversion_Error', 'Pointer_Error', 'Dereference_Error', 'Update_Error']
|
||||
let g:ada#Keywords += [{
|
||||
\ 'word': Item,
|
||||
\ 'menu': 'exception',
|
||||
\ 'info': 'Ada standart exception.',
|
||||
\ 'kind': 'x',
|
||||
\ 'icase': 1}]
|
||||
endfor
|
||||
|
||||
" Section: add GNAT exception {{{3
|
||||
"
|
||||
if exists ('g:ada_gnat_extensions')
|
||||
for Item in ['Assert_Failure']
|
||||
let g:ada#Keywords += [{
|
||||
\ 'word': Item,
|
||||
\ 'menu': 'exception',
|
||||
\ 'info': 'GNAT exception.',
|
||||
\ 'kind': 'x',
|
||||
\ 'icase': 1}]
|
||||
endfor
|
||||
endif
|
||||
|
||||
" Section: add Ada buildin types {{{2
|
||||
"
|
||||
for Item in ['Boolean', 'Integer', 'Natural', 'Positive', 'Float', 'Character', 'Wide_Character', 'Wide_Wide_Character', 'String', 'Wide_String', 'Wide_Wide_String', 'Duration']
|
||||
let g:ada#Keywords += [{
|
||||
\ 'word': Item,
|
||||
\ 'menu': 'type',
|
||||
\ 'info': 'Ada buildin type.',
|
||||
\ 'kind': 't',
|
||||
\ 'icase': 1}]
|
||||
endfor
|
||||
|
||||
" Section: add GNAT buildin types {{{3
|
||||
"
|
||||
if exists ('g:ada_gnat_extensions')
|
||||
for Item in ['Short_Integer', 'Short_Short_Integer', 'Long_Integer', 'Long_Long_Integer', 'Short_Float', 'Short_Short_Float', 'Long_Float', 'Long_Long_Float']
|
||||
let g:ada#Keywords += [{
|
||||
\ 'word': Item,
|
||||
\ 'menu': 'type',
|
||||
\ 'info': 'GNAT buildin type.',
|
||||
\ 'kind': 't',
|
||||
\ 'icase': 1}]
|
||||
endfor
|
||||
endif
|
||||
|
||||
" Section: add Ada Attributes {{{2
|
||||
"
|
||||
for Item in ['''Access', '''Address', '''Adjacent', '''Aft', '''Alignment', '''Base', '''Bit_Order', '''Body_Version', '''Callable', '''Caller', '''Ceiling', '''Class', '''Component_Size', '''Compose', '''Constrained', '''Copy_Sign', '''Count', '''Definite', '''Delta', '''Denorm', '''Digits', '''Emax', '''Exponent', '''External_Tag', '''Epsilon', '''First', '''First_Bit', '''Floor', '''Fore', '''Fraction', '''Identity', '''Image', '''Input', '''Large', '''Last', '''Last_Bit', '''Leading_Part', '''Length', '''Machine', '''Machine_Emax', '''Machine_Emin', '''Machine_Mantissa', '''Machine_Overflows', '''Machine_Radix', '''Machine_Rounding', '''Machine_Rounds', '''Mantissa', '''Max', '''Max_Size_In_Storage_Elements', '''Min', '''Mod', '''Model', '''Model_Emin', '''Model_Epsilon', '''Model_Mantissa', '''Model_Small', '''Modulus', '''Output', '''Partition_ID', '''Pos', '''Position', '''Pred', '''Priority', '''Range', '''Read', '''Remainder', '''Round', '''Rounding', '''Safe_Emax', '''Safe_First', '''Safe_Large', '''Safe_Last', '''Safe_Small', '''Scale', '''Scaling', '''Signed_Zeros', '''Size', '''Small', '''Storage_Pool', '''Storage_Size', '''Stream_Size', '''Succ', '''Tag', '''Terminated', '''Truncation', '''Unbiased_Rounding', '''Unchecked_Access', '''Val', '''Valid', '''Value', '''Version', '''Wide_Image', '''Wide_Value', '''Wide_Wide_Image', '''Wide_Wide_Value', '''Wide_Wide_Width', '''Wide_Width', '''Width', '''Write']
|
||||
let g:ada#Keywords += [{
|
||||
\ 'word': Item,
|
||||
\ 'menu': 'attribute',
|
||||
\ 'info': 'Ada attribute.',
|
||||
\ 'kind': 'a',
|
||||
\ 'icase': 1}]
|
||||
endfor
|
||||
|
||||
" Section: add GNAT Attributes {{{3
|
||||
"
|
||||
if exists ('g:ada_gnat_extensions')
|
||||
for Item in ['''Abort_Signal', '''Address_Size', '''Asm_Input', '''Asm_Output', '''AST_Entry', '''Bit', '''Bit_Position', '''Code_Address', '''Default_Bit_Order', '''Elaborated', '''Elab_Body', '''Elab_Spec', '''Emax', '''Enum_Rep', '''Epsilon', '''Fixed_Value', '''Has_Access_Values', '''Has_Discriminants', '''Img', '''Integer_Value', '''Machine_Size', '''Max_Interrupt_Priority', '''Max_Priority', '''Maximum_Alignment', '''Mechanism_Code', '''Null_Parameter', '''Object_Size', '''Passed_By_Reference', '''Range_Length', '''Storage_Unit', '''Target_Name', '''Tick', '''To_Address', '''Type_Class', '''UET_Address', '''Unconstrained_Array', '''Universal_Literal_String', '''Unrestricted_Access', '''VADS_Size', '''Value_Size', '''Wchar_T_Size', '''Word_Size']
|
||||
let g:ada#Keywords += [{
|
||||
\ 'word': Item,
|
||||
\ 'menu': 'attribute',
|
||||
\ 'info': 'GNAT attribute.',
|
||||
\ 'kind': 'a',
|
||||
\ 'icase': 1}]
|
||||
endfor
|
||||
endif
|
||||
|
||||
" Section: add Ada Pragmas {{{2
|
||||
"
|
||||
for Item in ['All_Calls_Remote', 'Assert', 'Assertion_Policy', 'Asynchronous', 'Atomic', 'Atomic_Components', 'Attach_Handler', 'Controlled', 'Convention', 'Detect_Blocking', 'Discard_Names', 'Elaborate', 'Elaborate_All', 'Elaborate_Body', 'Export', 'Import', 'Inline', 'Inspection_Point', 'Interface (Obsolescent)', 'Interrupt_Handler', 'Interrupt_Priority', 'Linker_Options', 'List', 'Locking_Policy', 'Memory_Size (Obsolescent)', 'No_Return', 'Normalize_Scalars', 'Optimize', 'Pack', 'Page', 'Partition_Elaboration_Policy', 'Preelaborable_Initialization', 'Preelaborate', 'Priority', 'Priority_Specific_Dispatching', 'Profile', 'Pure', 'Queueing_Policy', 'Relative_Deadline', 'Remote_Call_Interface', 'Remote_Types', 'Restrictions', 'Reviewable', 'Shared (Obsolescent)', 'Shared_Passive', 'Storage_Size', 'Storage_Unit (Obsolescent)', 'Suppress', 'System_Name (Obsolescent)', 'Task_Dispatching_Policy', 'Unchecked_Union', 'Unsuppress', 'Volatile', 'Volatile_Components']
|
||||
let g:ada#Keywords += [{
|
||||
\ 'word': Item,
|
||||
\ 'menu': 'pragma',
|
||||
\ 'info': 'Ada pragma.',
|
||||
\ 'kind': 'p',
|
||||
\ 'icase': 1}]
|
||||
endfor
|
||||
|
||||
" Section: add GNAT Pragmas {{{3
|
||||
"
|
||||
if exists ('g:ada_gnat_extensions')
|
||||
for Item in ['Abort_Defer', 'Ada_83', 'Ada_95', 'Ada_05', 'Annotate', 'Ast_Entry', 'C_Pass_By_Copy', 'Comment', 'Common_Object', 'Compile_Time_Warning', 'Complex_Representation', 'Component_Alignment', 'Convention_Identifier', 'CPP_Class', 'CPP_Constructor', 'CPP_Virtual', 'CPP_Vtable', 'Debug', 'Elaboration_Checks', 'Eliminate', 'Export_Exception', 'Export_Function', 'Export_Object', 'Export_Procedure', 'Export_Value', 'Export_Valued_Procedure', 'Extend_System', 'External', 'External_Name_Casing', 'Finalize_Storage_Only', 'Float_Representation', 'Ident', 'Import_Exception', 'Import_Function', 'Import_Object', 'Import_Procedure', 'Import_Valued_Procedure', 'Initialize_Scalars', 'Inline_Always', 'Inline_Generic', 'Interface_Name', 'Interrupt_State', 'Keep_Names', 'License', 'Link_With', 'Linker_Alias', 'Linker_Section', 'Long_Float', 'Machine_Attribute', 'Main_Storage', 'Obsolescent', 'Passive', 'Polling', 'Profile_Warnings', 'Propagate_Exceptions', 'Psect_Object', 'Pure_Function', 'Restriction_Warnings', 'Source_File_Name', 'Source_File_Name_Project', 'Source_Reference', 'Stream_Convert', 'Style_Checks', 'Subtitle', 'Suppress_All', 'Suppress_Exception_Locations', 'Suppress_Initialization', 'Task_Info', 'Task_Name', 'Task_Storage', 'Thread_Body', 'Time_Slice', 'Title', 'Unimplemented_Unit', 'Universal_Data', 'Unreferenced', 'Unreserve_All_Interrupts', 'Use_VADS_Size', 'Validity_Checks', 'Warnings', 'Weak_External']
|
||||
let g:ada#Keywords += [{
|
||||
\ 'word': Item,
|
||||
\ 'menu': 'pragma',
|
||||
\ 'info': 'GNAT pragma.',
|
||||
\ 'kind': 'p',
|
||||
\ 'icase': 1}]
|
||||
endfor
|
||||
endif
|
||||
" 1}}}
|
||||
|
||||
" Section: g:ada#Ctags_Kinds {{{1
|
||||
"
|
||||
let g:ada#Ctags_Kinds = {
|
||||
\ 'P': ["packspec", "package specifications"],
|
||||
\ 'p': ["package", "packages"],
|
||||
\ 'T': ["typespec", "type specifications"],
|
||||
\ 't': ["type", "types"],
|
||||
\ 'U': ["subspec", "subtype specifications"],
|
||||
\ 'u': ["subtype", "subtypes"],
|
||||
\ 'c': ["component", "record type components"],
|
||||
\ 'l': ["literal", "enum type literals"],
|
||||
\ 'V': ["varspec", "variable specifications"],
|
||||
\ 'v': ["variable", "variables"],
|
||||
\ 'f': ["formal", "generic formal parameters"],
|
||||
\ 'n': ["constant", "constants"],
|
||||
\ 'x': ["exception", "user defined exceptions"],
|
||||
\ 'R': ["subprogspec", "subprogram specifications"],
|
||||
\ 'r': ["subprogram", "subprograms"],
|
||||
\ 'K': ["taskspec", "task specifications"],
|
||||
\ 'k': ["task", "tasks"],
|
||||
\ 'O': ["protectspec", "protected data specifications"],
|
||||
\ 'o': ["protected", "protected data"],
|
||||
\ 'E': ["entryspec", "task/protected data entry specifications"],
|
||||
\ 'e': ["entry", "task/protected data entries"],
|
||||
\ 'b': ["label", "labels"],
|
||||
\ 'i': ["identifier", "loop/declare identifiers"],
|
||||
\ 'a': ["autovar", "automatic variables"],
|
||||
\ 'y': ["annon", "loops and blocks with no identifier"]}
|
||||
|
||||
" Section: ada#Word (...) {{{1
|
||||
"
|
||||
" Extract current Ada word across multiple lines
|
||||
" AdaWord ([line, column])\
|
||||
"
|
||||
function ada#Word (...)
|
||||
if a:0 > 1
|
||||
let l:Line_Nr = a:1
|
||||
let l:Column_Nr = a:2 - 1
|
||||
else
|
||||
let l:Line_Nr = line('.')
|
||||
let l:Column_Nr = col('.') - 1
|
||||
endif
|
||||
|
||||
let l:Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' )
|
||||
|
||||
" Cope with tag searching for items in comments; if we are, don't loop
|
||||
" backards looking for previous lines
|
||||
if l:Column_Nr > strlen(l:Line)
|
||||
" We were in a comment
|
||||
let l:Line = getline(l:Line_Nr)
|
||||
let l:Search_Prev_Lines = 0
|
||||
else
|
||||
let l:Search_Prev_Lines = 1
|
||||
endif
|
||||
|
||||
" Go backwards until we find a match (Ada ID) that *doesn't* include our
|
||||
" location - i.e., the previous ID. This is because the current 'correct'
|
||||
" match will toggle matching/not matching as we traverse characters
|
||||
" backwards. Thus, we have to find the previous unrelated match, exclude
|
||||
" it, then use the next full match (ours).
|
||||
" Remember to convert vim column 'l:Column_Nr' [1..n] to string offset [0..(n-1)]
|
||||
" ... but start, here, one after the required char.
|
||||
let l:New_Column = l:Column_Nr + 1
|
||||
while 1
|
||||
let l:New_Column = l:New_Column - 1
|
||||
if l:New_Column < 0
|
||||
" Have to include previous l:Line from file
|
||||
let l:Line_Nr = l:Line_Nr - 1
|
||||
if l:Line_Nr < 1 || !l:Search_Prev_Lines
|
||||
" Start of file or matching in a comment
|
||||
let l:Line_Nr = 1
|
||||
let l:New_Column = 0
|
||||
let l:Our_Match = match (l:Line, g:ada#WordRegex )
|
||||
break
|
||||
endif
|
||||
" Get previous l:Line, and prepend it to our search string
|
||||
let l:New_Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' )
|
||||
let l:New_Column = strlen (l:New_Line) - 1
|
||||
let l:Column_Nr = l:Column_Nr + l:New_Column
|
||||
let l:Line = l:New_Line . l:Line
|
||||
endif
|
||||
" Check to see if this is a match excluding 'us'
|
||||
let l:Match_End = l:New_Column +
|
||||
\ matchend (strpart (l:Line,l:New_Column), g:ada#WordRegex ) - 1
|
||||
if l:Match_End >= l:New_Column &&
|
||||
\ l:Match_End < l:Column_Nr
|
||||
" Yes
|
||||
let l:Our_Match = l:Match_End+1 +
|
||||
\ match (strpart (l:Line,l:Match_End+1), g:ada#WordRegex )
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Got anything?
|
||||
if l:Our_Match < 0
|
||||
return ''
|
||||
else
|
||||
let l:Line = strpart (l:Line, l:Our_Match)
|
||||
endif
|
||||
|
||||
" Now simply add further lines until the match gets no bigger
|
||||
let l:Match_String = matchstr (l:Line, g:ada#WordRegex)
|
||||
let l:Last_Line = line ('$')
|
||||
let l:Line_Nr = line ('.') + 1
|
||||
while l:Line_Nr <= l:Last_Line
|
||||
let l:Last_Match = l:Match_String
|
||||
let l:Line = l:Line .
|
||||
\ substitute (getline (l:Line_Nr), g:ada#Comment, '', '')
|
||||
let l:Match_String = matchstr (l:Line, g:ada#WordRegex)
|
||||
if l:Match_String == l:Last_Match
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Strip whitespace & return
|
||||
return substitute (l:Match_String, '\s\+', '', 'g')
|
||||
endfunction ada#Word
|
||||
|
||||
" Section: ada#List_Tag (...) {{{1
|
||||
"
|
||||
" List tags in quickfix window
|
||||
"
|
||||
function ada#List_Tag (...)
|
||||
if a:0 > 1
|
||||
let l:Tag_Word = ada#Word (a:1, a:2)
|
||||
elseif a:0 > 0
|
||||
let l:Tag_Word = a:1
|
||||
else
|
||||
let l:Tag_Word = ada#Word ()
|
||||
endif
|
||||
|
||||
echo "Searching for" l:Tag_Word
|
||||
|
||||
let l:Pattern = '^' . l:Tag_Word . '$'
|
||||
let l:Tag_List = taglist (l:Pattern)
|
||||
let l:Error_List = []
|
||||
"
|
||||
" add symbols
|
||||
"
|
||||
for Tag_Item in l:Tag_List
|
||||
if l:Tag_Item['kind'] == ''
|
||||
let l:Tag_Item['kind'] = 's'
|
||||
endif
|
||||
|
||||
let l:Error_List += [
|
||||
\ l:Tag_Item['filename'] . '|' .
|
||||
\ l:Tag_Item['cmd'] . '|' .
|
||||
\ l:Tag_Item['kind'] . "\t" .
|
||||
\ l:Tag_Item['name'] ]
|
||||
endfor
|
||||
set errorformat=%f\|%l\|%m
|
||||
cexpr l:Error_List
|
||||
cwindow
|
||||
endfunction ada#List_Tag
|
||||
|
||||
" Section: ada#Jump_Tag (Word, Mode) {{{1
|
||||
"
|
||||
" Word tag - include '.' and if Ada make uppercase
|
||||
"
|
||||
function ada#Jump_Tag (Word, Mode)
|
||||
if a:Word == ''
|
||||
" Get current word
|
||||
let l:Word = ada#Word()
|
||||
if l:Word == ''
|
||||
throw "NOT_FOUND: no identifier found."
|
||||
endif
|
||||
else
|
||||
let l:Word = a:Word
|
||||
endif
|
||||
|
||||
echo "Searching for " . l:Word
|
||||
|
||||
try
|
||||
execute a:Mode l:Word
|
||||
catch /.*:E426:.*/
|
||||
let ignorecase = &ignorecase
|
||||
set ignorecase
|
||||
execute a:Mode l:Word
|
||||
let &ignorecase = ignorecase
|
||||
endtry
|
||||
|
||||
return
|
||||
endfunction ada#Jump_Tag
|
||||
|
||||
" Section: ada#Insert_Backspace () {{{1
|
||||
"
|
||||
" Backspace at end of line after auto-inserted commentstring '-- ' wipes it
|
||||
"
|
||||
function ada#Insert_Backspace ()
|
||||
let l:Line = getline ('.')
|
||||
if col ('.') > strlen (l:Line) &&
|
||||
\ match (l:Line, '-- $') != -1 &&
|
||||
\ match (&comments,'--') != -1
|
||||
return "\<bs>\<bs>\<bs>"
|
||||
else
|
||||
return "\<bs>"
|
||||
endif
|
||||
|
||||
return
|
||||
endfunction ada#InsertBackspace
|
||||
|
||||
" Section: Insert Completions {{{1
|
||||
"
|
||||
" Section: ada#User_Complete(findstart, base) {{{2
|
||||
"
|
||||
" This function is used for the 'complete' option.
|
||||
"
|
||||
function! ada#User_Complete(findstart, base)
|
||||
if a:findstart == 1
|
||||
"
|
||||
" locate the start of the word
|
||||
"
|
||||
let line = getline ('.')
|
||||
let start = col ('.') - 1
|
||||
while start > 0 && line[start - 1] =~ '\i\|'''
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
"
|
||||
" look up matches
|
||||
"
|
||||
let l:Pattern = '^' . a:base . '.*$'
|
||||
"
|
||||
" add keywords
|
||||
"
|
||||
for Tag_Item in g:ada#Keywords
|
||||
if l:Tag_Item['word'] =~? l:Pattern
|
||||
if complete_add (l:Tag_Item) == 0
|
||||
return []
|
||||
endif
|
||||
if complete_check ()
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
return []
|
||||
endif
|
||||
endfunction ada#User_Complete
|
||||
|
||||
" Section: ada#Completion (cmd) {{{2
|
||||
"
|
||||
" Word completion (^N/^R/^X^]) - force '.' inclusion
|
||||
function ada#Completion (cmd)
|
||||
set iskeyword+=46
|
||||
return a:cmd . "\<C-R>=ada#Completion_End ()\<CR>"
|
||||
endfunction ada#Completion
|
||||
|
||||
" Section: ada#Completion_End () {{{2
|
||||
"
|
||||
function ada#Completion_End ()
|
||||
set iskeyword-=46
|
||||
return ''
|
||||
endfunction ada#Completion_End
|
||||
|
||||
" Section: ada#Create_Tags {{{1
|
||||
"
|
||||
function ada#Create_Tags (option)
|
||||
if a:option == 'file'
|
||||
let l:Filename = fnamemodify (bufname ('%'), ':p')
|
||||
elseif a:option == 'dir'
|
||||
let l:Filename =
|
||||
\ fnamemodify (bufname ('%'), ':p:h') . "*.ada " .
|
||||
\ fnamemodify (bufname ('%'), ':p:h') . "*.adb " .
|
||||
\ fnamemodify (bufname ('%'), ':p:h') . "*.ads"
|
||||
else
|
||||
let l:Filename = a:option
|
||||
endif
|
||||
execute '!ctags --excmd=number ' . l:Filename
|
||||
endfunction ada#Create_Tags
|
||||
|
||||
" Section: ada#Switch_Session {{{1
|
||||
"
|
||||
function ada#Switch_Session (New_Session)
|
||||
"
|
||||
" you should not save to much date into the seession since they will
|
||||
" be sourced
|
||||
"
|
||||
let l:sessionoptions=&sessionoptions
|
||||
|
||||
try
|
||||
set sessionoptions=buffers,curdir,folds,globals,resize,slash,tabpages,tabpages,unix,winpos,winsize
|
||||
|
||||
if a:New_Session != v:this_session
|
||||
"
|
||||
" We actually got a new session - otherwise there
|
||||
" is nothing to do.
|
||||
"
|
||||
if strlen (v:this_session) > 0
|
||||
execute 'mksession! ' . v:this_session
|
||||
endif
|
||||
|
||||
let v:this_session = a:New_Session
|
||||
|
||||
"if filereadable (v:this_session)
|
||||
"execute 'source ' . v:this_session
|
||||
"endif
|
||||
|
||||
augroup ada_session
|
||||
autocmd!
|
||||
autocmd VimLeavePre * execute 'mksession! ' . v:this_session
|
||||
augroup END
|
||||
|
||||
"if exists ("g:Tlist_Auto_Open") && g:Tlist_Auto_Open
|
||||
"TlistOpen
|
||||
"endif
|
||||
|
||||
endif
|
||||
finally
|
||||
let &sessionoptions=l:sessionoptions
|
||||
endtry
|
||||
|
||||
return
|
||||
endfunction ada#Switch_Session
|
||||
|
||||
" Section: GNAT Pretty Printer folding {{{1
|
||||
"
|
||||
if exists('g:ada_folding') && g:ada_folding[0] == 'g'
|
||||
"
|
||||
" Lines consisting only of ')' ';' are due to a gnat pretty bug and
|
||||
" have the same level as the line above (can't happen in the first
|
||||
" line).
|
||||
"
|
||||
let s:Fold_Collate = '^\([;)]*$\|'
|
||||
|
||||
"
|
||||
" some lone statements are folded with the line above
|
||||
"
|
||||
if stridx (g:ada_folding, 'i') >= 0
|
||||
let s:Fold_Collate .= '\s\+\<is\>$\|'
|
||||
endif
|
||||
if stridx (g:ada_folding, 'b') >= 0
|
||||
let s:Fold_Collate .= '\s\+\<begin\>$\|'
|
||||
endif
|
||||
if stridx (g:ada_folding, 'p') >= 0
|
||||
let s:Fold_Collate .= '\s\+\<private\>$\|'
|
||||
endif
|
||||
if stridx (g:ada_folding, 'x') >= 0
|
||||
let s:Fold_Collate .= '\s\+\<exception\>$\|'
|
||||
endif
|
||||
|
||||
" We also handle empty lines and
|
||||
" comments here.
|
||||
let s:Fold_Collate .= '--\)'
|
||||
|
||||
function ada#Pretty_Print_Folding (Line) " {{{2
|
||||
let l:Text = getline (a:Line)
|
||||
|
||||
if l:Text =~ s:Fold_Collate
|
||||
"
|
||||
" fold with line above
|
||||
"
|
||||
let l:Level = "="
|
||||
elseif l:Text =~ '^\s\+('
|
||||
"
|
||||
" gnat outdents a line which stards with a ( by one characters so
|
||||
" that parameters which follow are aligned.
|
||||
"
|
||||
let l:Level = (indent (a:Line) + 1) / &shiftwidth
|
||||
else
|
||||
let l:Level = indent (a:Line) / &shiftwidth
|
||||
endif
|
||||
|
||||
return l:Level
|
||||
endfunction ada#Pretty_Print_Folding " }}}2
|
||||
endif
|
||||
|
||||
" Section: Options and Menus {{{1
|
||||
"
|
||||
" Section: ada#Switch_Syntax_Options {{{2
|
||||
"
|
||||
function ada#Switch_Syntax_Option (option)
|
||||
syntax off
|
||||
if exists ('g:ada_' . a:option)
|
||||
unlet g:ada_{a:option}
|
||||
echo a:option . 'now off'
|
||||
else
|
||||
let g:ada_{a:option}=1
|
||||
echo a:option . 'now on'
|
||||
endif
|
||||
syntax on
|
||||
endfunction ada#Switch_Syntax_Option
|
||||
|
||||
" Section: ada#Map_Menu {{{2
|
||||
"
|
||||
function ada#Map_Menu (Text, Keys, Command)
|
||||
if a:Keys[0] == ':'
|
||||
execute
|
||||
\ "50amenu " .
|
||||
\ "Ada." . escape(a:Text, ' ') .
|
||||
\ "<Tab>" . a:Keys .
|
||||
\ " :" . a:Command . "<CR>"
|
||||
execute
|
||||
\ "command -buffer " .
|
||||
\ a:Keys[1:] .
|
||||
\" :" . a:Command . "<CR>"
|
||||
elseif a:Keys[0] == '<'
|
||||
execute
|
||||
\ "50amenu " .
|
||||
\ "Ada." . escape(a:Text, ' ') .
|
||||
\ "<Tab>" . a:Keys .
|
||||
\ " :" . a:Command . "<CR>"
|
||||
execute
|
||||
\ "nnoremap <buffer> " .
|
||||
\ a:Keys .
|
||||
\" :" . a:Command . "<CR>"
|
||||
execute
|
||||
\ "inoremap <buffer> " .
|
||||
\ a:Keys .
|
||||
\" <C-O>:" . a:Command . "<CR>"
|
||||
else
|
||||
if exists("g:mapleader")
|
||||
let l:leader = g:mapleader
|
||||
else
|
||||
let l:leader = '\'
|
||||
endif
|
||||
execute
|
||||
\ "50amenu " .
|
||||
\ "Ada." . escape(a:Text, ' ') .
|
||||
\ "<Tab>" . escape(l:leader . "a" . a:Keys , '\') .
|
||||
\ " :" . a:Command . "<CR>"
|
||||
execute
|
||||
\ "nnoremap <buffer>" .
|
||||
\ " <Leader>a" . a:Keys .
|
||||
\" :" . a:Command
|
||||
execute
|
||||
\ "inoremap <buffer>" .
|
||||
\ " <Leader>a" . a:Keys .
|
||||
\" <C-O>:" . a:Command
|
||||
endif
|
||||
return
|
||||
endfunction
|
||||
|
||||
" Section: ada#Map_Popup {{{2
|
||||
"
|
||||
function ada#Map_Popup (Text, Keys, Command)
|
||||
if exists("g:mapleader")
|
||||
let l:leader = g:mapleader
|
||||
else
|
||||
let l:leader = '\'
|
||||
endif
|
||||
execute
|
||||
\ "50amenu " .
|
||||
\ "PopUp." . escape(a:Text, ' ') .
|
||||
\ "<Tab>" . escape(l:leader . "a" . a:Keys , '\') .
|
||||
\ " :" . a:Command . "<CR>"
|
||||
|
||||
call ada#Map_Menu (a:Text, a:Keys, a:Command)
|
||||
return
|
||||
endfunction ada#Map_Popup
|
||||
|
||||
" }}}1
|
||||
|
||||
lockvar g:ada#WordRegex
|
||||
lockvar g:ada#DotWordRegex
|
||||
lockvar g:ada#Comment
|
||||
lockvar! g:ada#Keywords
|
||||
lockvar! g:ada#Ctags_Kinds
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
finish " 1}}}
|
||||
|
||||
"------------------------------------------------------------------------------
|
||||
" Copyright (C) 2006 Martin Krischik
|
||||
"
|
||||
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
|
||||
"------------------------------------------------------------------------------
|
||||
" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
|
||||
" vim: foldmethod=marker
|
||||
|
||||
endif
|
||||
@@ -1,7 +1,8 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
function! cargo#quickfix#CmdPre() abort
|
||||
if &filetype ==# 'rust' && get(b:, 'current_compiler', '') ==# 'cargo'
|
||||
if &filetype ==# 'rust' && get(b:, 'current_compiler', '') ==# 'cargo' &&
|
||||
\ &makeprg =~ '\V\^cargo\ \.\*'
|
||||
" Preserve the current directory, and 'lcd' to the nearest Cargo file.
|
||||
let b:rust_compiler_cargo_qf_has_lcd = haslocaldir()
|
||||
let b:rust_compiler_cargo_qf_prev_cd = getcwd()
|
||||
|
||||
111
autoload/csv.vim
111
autoload/csv.vim
@@ -1450,7 +1450,7 @@ fu! csv#SumColumn(list) "{{{3
|
||||
let b:csv_result = '0'
|
||||
return 0
|
||||
else
|
||||
let sum = has("float") ? 0.0 : 0
|
||||
let sum = 0.0
|
||||
for item in a:list
|
||||
if empty(item)
|
||||
continue
|
||||
@@ -1460,33 +1460,25 @@ fu! csv#SumColumn(list) "{{{3
|
||||
let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d'
|
||||
try
|
||||
let nr = substitute(nr, format1, '', '')
|
||||
if has("float") && s:nr_format[1] != '.'
|
||||
if s:nr_format[1] != '.'
|
||||
let nr = substitute(nr, format2, '.', '')
|
||||
endif
|
||||
catch
|
||||
let nr = 0
|
||||
let nr = '0'
|
||||
endtry
|
||||
let sum += (has("float") ? str2float(nr) : (nr + 0))
|
||||
let sum += str2float(nr)
|
||||
endfor
|
||||
if has("float")
|
||||
let b:csv_result = string(float2nr(sum))
|
||||
if float2nr(sum) == sum
|
||||
return float2nr(sum)
|
||||
else
|
||||
return printf("%.2f", sum)
|
||||
endif
|
||||
endif
|
||||
let b:csv_result = string(sum)
|
||||
return sum
|
||||
let b:csv_result = sum
|
||||
return printf("%.2f", sum)
|
||||
endif
|
||||
endfu
|
||||
fu! csv#AvgColumn(list) "{{{3
|
||||
if empty(a:list)
|
||||
let b:csv_result = '0'
|
||||
return 0
|
||||
return 0.0
|
||||
else
|
||||
let cnt = 0
|
||||
let sum = has("float") ? 0.0 : 0
|
||||
let sum = 0.0
|
||||
for item in a:list
|
||||
if empty(item)
|
||||
continue
|
||||
@@ -1496,30 +1488,25 @@ fu! csv#AvgColumn(list) "{{{3
|
||||
let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d'
|
||||
try
|
||||
let nr = substitute(nr, format1, '', '')
|
||||
if has("float") && s:nr_format[1] != '.'
|
||||
if s:nr_format[1] != '.'
|
||||
let nr = substitute(nr, format2, '.', '')
|
||||
endif
|
||||
catch
|
||||
let nr = 0
|
||||
let nr ='0'
|
||||
endtry
|
||||
let sum += (has("float") ? str2float(nr) : (nr + 0))
|
||||
let sum += str2float(nr)
|
||||
let cnt += 1
|
||||
endfor
|
||||
if has("float")
|
||||
let b:csv_result = printf("%.2f", sum/cnt)
|
||||
return str2float(b:csv_result)
|
||||
else
|
||||
let b:csv_result = printf("%s", sum/cnt)
|
||||
return b:csv_result + 0
|
||||
endif
|
||||
let b:csv_result = printf("%.2f", sum/cnt)
|
||||
return sum/cnt
|
||||
endif
|
||||
endfu
|
||||
fu! csv#VarianceColumn(list, is_population) "{{{3
|
||||
if empty(a:list)
|
||||
return 0
|
||||
return 0.0
|
||||
else
|
||||
let cnt = 0
|
||||
let sum = has("float") ? 0.0 : 0
|
||||
let sum = 0.0
|
||||
let avg = csv#AvgColumn(a:list)
|
||||
for item in a:list
|
||||
if empty(item)
|
||||
@@ -1530,64 +1517,64 @@ fu! csv#VarianceColumn(list, is_population) "{{{3
|
||||
let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d'
|
||||
try
|
||||
let nr = substitute(nr, format1, '', '')
|
||||
if has("float") && s:nr_format[1] != '.'
|
||||
if s:nr_format[1] != '.'
|
||||
let nr = substitute(nr, format2, '.', '')
|
||||
endif
|
||||
catch
|
||||
let nr = 0
|
||||
let nr = '0'
|
||||
endtry
|
||||
let sum += pow((has("float") ? (str2float(nr)-avg) : ((nr + 0)-avg)), 2)
|
||||
let nr = str2float(nr)
|
||||
let sum += pow((nr-avg), 2)
|
||||
let cnt += 1
|
||||
endfor
|
||||
if(a:is_population == 0)
|
||||
let cnt = cnt-1
|
||||
endif
|
||||
if has("float")
|
||||
let b:csv_result = printf("%." . get(b:, 'csv_accuracy', get(g:, 'csv_accuracy', 2)) . "f", sum/cnt)
|
||||
return b:csv_result
|
||||
else
|
||||
let b:csv_result = printf("%s", sum/cnt)
|
||||
return sum/(cnt)
|
||||
endif
|
||||
let b:csv_result = sum/cnt
|
||||
return b:csv_result
|
||||
endif
|
||||
endfu
|
||||
|
||||
fu! csv#SmplVarianceColumn(list) "{{{2
|
||||
unlet! b:csv_result
|
||||
if empty(a:list)
|
||||
let b:csv_result = '0'
|
||||
return 0
|
||||
let b:csv_result = 0.0
|
||||
return 0.0
|
||||
else
|
||||
return csv#VarianceColumn(a:list, 0)
|
||||
endif
|
||||
endfu
|
||||
|
||||
fu! csv#PopVarianceColumn(list) "{{{2
|
||||
unlet! b:csv_result
|
||||
if empty(a:list)
|
||||
let b:csv_result = '0'
|
||||
return 0
|
||||
let b:csv_result = 0.0
|
||||
return 0.0
|
||||
else
|
||||
return csv#VarianceColumn(a:list, 1)
|
||||
endif
|
||||
endfu
|
||||
|
||||
fu! csv#SmplStdDevColumn(list) "{{{2
|
||||
unlet! b:csv_result
|
||||
if empty(a:list)
|
||||
let b:csv_result = '0'
|
||||
return 0
|
||||
let b:csv_result = 0.0
|
||||
return 0.0
|
||||
else
|
||||
let result = sqrt(str2float(csv#VarianceColumn(a:list, 0)))
|
||||
let b:csv_result = string(result)
|
||||
let result = sqrt(csv#VarianceColumn(a:list, 0))
|
||||
let b:csv_result = result
|
||||
return result
|
||||
endif
|
||||
endfu
|
||||
|
||||
fu! csv#PopStdDevColumn(list) "{{{2
|
||||
unlet! b:csv_result
|
||||
if empty(a:list)
|
||||
let b:csv_result = '0'
|
||||
return 0
|
||||
let b:csv_result = 0.0
|
||||
return 0.0
|
||||
else
|
||||
let result = sqrt(str2float(csv#VarianceColumn(a:list, 1)))
|
||||
let b:csv_result = string(result)
|
||||
let result = sqrt(csv#VarianceColumn(a:list, 1))
|
||||
let b:csv_result = result
|
||||
return result
|
||||
endif
|
||||
endfu
|
||||
@@ -1610,13 +1597,13 @@ fu! csv#MaxColumn(list) "{{{3
|
||||
let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d'
|
||||
try
|
||||
let nr = substitute(nr, format1, '', '')
|
||||
if has("float") && s:nr_format[1] != '.'
|
||||
if s:nr_format[1] != '.'
|
||||
let nr = substitute(nr, format2, '.', '')
|
||||
endif
|
||||
catch
|
||||
let nr = 0
|
||||
let nr = '0'
|
||||
endtry
|
||||
call add(result, has("float") ? str2float(nr) : nr+0)
|
||||
call add(result, str2float(nr))
|
||||
endfor
|
||||
let result = sort(result, s:csv_numeric_sort ? 'n' : 'csv#CSVSortValues')
|
||||
let ind = len(result) > 9 ? 9 : len(result)
|
||||
@@ -1995,10 +1982,7 @@ fu! csv#AnalyzeColumn(...) "{{{3
|
||||
call filter(res, 'v:val =~ ''^''.join(max_items, ''\|'').''$''')
|
||||
endif
|
||||
|
||||
if has("float")
|
||||
let title="Nr\tCount\t % \tValue"
|
||||
else
|
||||
let title="Nr\tCount\tValue"
|
||||
let title="Nr\tCount\t % \tValue"
|
||||
endif
|
||||
echohl Title
|
||||
echo printf("%s", title)
|
||||
@@ -2014,12 +1998,8 @@ fu! csv#AnalyzeColumn(...) "{{{3
|
||||
else
|
||||
let k = key
|
||||
endif
|
||||
if has("float")
|
||||
echo printf("%02d\t%02d\t%2.0f%%\t%.50s", i, res[key],
|
||||
\ ((res[key] + 0.0)/qty)*100, k)
|
||||
else
|
||||
echo printf("%02d\t%02d\t%.50s", i, res[key], k)
|
||||
endif
|
||||
echo printf("%02d\t%02d\t%2.0f%%\t%.50s", i, res[key],
|
||||
\ ((res[key] + 0.0)/qty)*100, k)
|
||||
call remove(res,key)
|
||||
let i+=1
|
||||
else
|
||||
@@ -2950,6 +2930,11 @@ fu! csv#EvalColumn(nr, func, first, last, ...) range "{{{3
|
||||
call csv#Warn("File is no CSV file!")
|
||||
return
|
||||
endif
|
||||
" Need a Vim with floating point feature
|
||||
if !has("float")
|
||||
call csv#Warn("Your Vim is missing floating point feature!")
|
||||
return
|
||||
endif
|
||||
let save = winsaveview()
|
||||
call csv#CheckHeaderLine()
|
||||
let nr = matchstr(a:nr, '^\-\?\d\+')
|
||||
|
||||
@@ -55,6 +55,10 @@ function! go#config#TermCloseOnExit() abort
|
||||
return get(g:, 'go_term_close_on_exit', 1)
|
||||
endfunction
|
||||
|
||||
function! go#config#TermReuse() abort
|
||||
return get(g:, 'go_term_reuse', 0)
|
||||
endfunction
|
||||
|
||||
function! go#config#SetTermCloseOnExit(value) abort
|
||||
let g:go_term_close_on_exit = a:value
|
||||
endfunction
|
||||
@@ -548,6 +552,14 @@ function! go#config#GoplsLocal() abort
|
||||
return get(g:, 'go_gopls_local', v:null)
|
||||
endfunction
|
||||
|
||||
function! go#config#GoplsGofumpt() abort
|
||||
return get(g:, 'go_gopls_gofumpt', v:null)
|
||||
endfunction
|
||||
|
||||
function! go#config#GoplsSettings() abort
|
||||
return get(g:, 'go_gopls_settings', v:null)
|
||||
endfunction
|
||||
|
||||
function! go#config#GoplsEnabled() abort
|
||||
return get(g:, 'go_gopls_enabled', 1)
|
||||
endfunction
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
function! jsx_pretty#comment#update_commentstring(original)
|
||||
let line = getline(".")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
if exists('*shiftwidth')
|
||||
function! s:sw()
|
||||
|
||||
301
autoload/polyglot.vim
Normal file
301
autoload/polyglot.vim
Normal file
@@ -0,0 +1,301 @@
|
||||
" Line continuation is used here, remove 'C' from 'cpoptions'
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" We need it because scripts.vim in vim uses "set ft=" which cannot be
|
||||
" overridden with setf (and we can't use set ft= so our scripts.vim work)
|
||||
func! s:Setf(ft)
|
||||
if &filetype !~# '<'.a:ft.'>'
|
||||
let &filetype = a:ft
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func! polyglot#Heuristics()
|
||||
" Try to detect filetype from shebang
|
||||
let l:filetype = polyglot#Shebang()
|
||||
if l:filetype != ""
|
||||
exec "setf " . l:filetype
|
||||
return 1
|
||||
endif
|
||||
|
||||
return 0
|
||||
endfunc
|
||||
|
||||
let s:interpreters = {
|
||||
\ 'osascript': 'applescript',
|
||||
\ 'tcc': 'c',
|
||||
\ 'coffee': 'coffee',
|
||||
\ 'crystal': 'crystal',
|
||||
\ 'dart': 'dart',
|
||||
\ 'elixir': 'elixir',
|
||||
\ 'escript': 'erlang',
|
||||
\ 'fish': 'fish',
|
||||
\ 'gnuplot': 'gnuplot',
|
||||
\ 'groovy': 'groovy',
|
||||
\ 'runhaskell': 'haskell',
|
||||
\ 'chakra': 'javascript',
|
||||
\ 'd8': 'javascript',
|
||||
\ 'gjs': 'javascript',
|
||||
\ 'js': 'javascript',
|
||||
\ 'node': 'javascript',
|
||||
\ 'nodejs': 'javascript',
|
||||
\ 'qjs': 'javascript',
|
||||
\ 'rhino': 'javascript',
|
||||
\ 'v8': 'javascript',
|
||||
\ 'v8-shell': 'javascript',
|
||||
\ 'julia': 'julia',
|
||||
\ 'lua': 'lua',
|
||||
\ 'moon': 'moon',
|
||||
\ 'ocaml': 'ocaml',
|
||||
\ 'ocamlrun': 'ocaml',
|
||||
\ 'ocamlscript': 'ocaml',
|
||||
\ 'cperl': 'perl',
|
||||
\ 'perl': 'perl',
|
||||
\ 'php': 'php',
|
||||
\ 'pwsh': 'ps1',
|
||||
\ 'python': 'python',
|
||||
\ 'python2': 'python',
|
||||
\ 'python3': 'python',
|
||||
\ 'qmake': 'qmake',
|
||||
\ 'Rscript': 'r',
|
||||
\ 'racket': 'racket',
|
||||
\ 'perl6': 'raku',
|
||||
\ 'raku': 'raku',
|
||||
\ 'rakudo': 'raku',
|
||||
\ 'ruby': 'ruby',
|
||||
\ 'macruby': 'ruby',
|
||||
\ 'rake': 'ruby',
|
||||
\ 'jruby': 'ruby',
|
||||
\ 'rbx': 'ruby',
|
||||
\ 'scala': 'scala',
|
||||
\ 'ash': 'sh',
|
||||
\ 'bash': 'sh',
|
||||
\ 'dash': 'sh',
|
||||
\ 'ksh': 'sh',
|
||||
\ 'mksh': 'sh',
|
||||
\ 'pdksh': 'sh',
|
||||
\ 'rc': 'sh',
|
||||
\ 'sh': 'sh',
|
||||
\ 'zsh': 'sh',
|
||||
\ 'boolector': 'smt2',
|
||||
\ 'cvc4': 'smt2',
|
||||
\ 'mathsat5': 'smt2',
|
||||
\ 'opensmt': 'smt2',
|
||||
\ 'smtinterpol': 'smt2',
|
||||
\ 'smt-rat': 'smt2',
|
||||
\ 'stp': 'smt2',
|
||||
\ 'verit': 'smt2',
|
||||
\ 'yices2': 'smt2',
|
||||
\ 'z3': 'smt2',
|
||||
\ 'deno': 'typescript',
|
||||
\ 'ts-node': 'typescript',
|
||||
\ }
|
||||
|
||||
let s:r_hashbang = '^#!\s*\(\S\+\)\s*\(.*\)\s*'
|
||||
let s:r_envflag = '%(\S\+=\S\+\|-[iS]\|--ignore-environment\|--split-string\)'
|
||||
let s:r_env = '^\%(\' . s:r_envflag . '\s\+\)*\(\S\+\)'
|
||||
|
||||
func! polyglot#Shebang()
|
||||
let l:line1 = getline(1)
|
||||
|
||||
if l:line1 !~# "^#!"
|
||||
return
|
||||
endif
|
||||
|
||||
let l:pathrest = matchlist(l:line1, s:r_hashbang)
|
||||
|
||||
if len(l:pathrest) == 0
|
||||
return
|
||||
endif
|
||||
|
||||
let [_, l:path, l:rest; __] = l:pathrest
|
||||
|
||||
let l:script = split(l:path, "/")[-1]
|
||||
|
||||
if l:script == "env"
|
||||
let l:argspath = matchlist(l:rest, s:r_env)
|
||||
if len(l:argspath) == 0
|
||||
return
|
||||
endif
|
||||
|
||||
let l:script = l:argspath[1]
|
||||
endif
|
||||
|
||||
if has_key(s:interpreters, l:script)
|
||||
return s:interpreters[l:script]
|
||||
endif
|
||||
|
||||
for interpreter in keys(s:interpreters)
|
||||
if l:script =~# '^' . interpreter
|
||||
return s:interpreters[interpreter]
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
func! polyglot#DetectInpFiletype()
|
||||
let line = getline(1)
|
||||
if line =~# '^\*'
|
||||
call s:Setf('abaqus') | return
|
||||
endif
|
||||
for lnum in range(1, min([line("$"), 500]))
|
||||
let line = getline(lnum)
|
||||
if line =~? '^header surface data'
|
||||
call s:Setf('trasys') | return
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
func! polyglot#DetectAsaFiletype()
|
||||
if exists("g:filetype_asa")
|
||||
call s:Setf(g:filetype_asa) | return
|
||||
endif
|
||||
call s:Setf('aspvbs') | return
|
||||
endfunc
|
||||
|
||||
func! polyglot#DetectAspFiletype()
|
||||
if exists("g:filetype_asp")
|
||||
call s:Setf(g:filetype_asp) | return
|
||||
endif
|
||||
for lnum in range(1, min([line("$"), 3]))
|
||||
let line = getline(lnum)
|
||||
if line =~? 'perlscript'
|
||||
call s:Setf('aspperl') | return
|
||||
endif
|
||||
endfor
|
||||
call s:Setf('aspvbs') | return
|
||||
endfunc
|
||||
|
||||
func! polyglot#DetectHFiletype()
|
||||
for lnum in range(1, min([line("$"), 200]))
|
||||
let line = getline(lnum)
|
||||
if line =~# '^\s*\(@\(interface\|class\|protocol\|property\|end\|synchronised\|selector\|implementation\)\(\<\|\>\)\|#import\s\+.\+\.h[">]\)'
|
||||
if exists("g:c_syntax_for_h")
|
||||
call s:Setf('objc') | return
|
||||
endif
|
||||
call s:Setf('objcpp') | return
|
||||
endif
|
||||
endfor
|
||||
if exists("g:c_syntax_for_h")
|
||||
call s:Setf('c') | return
|
||||
endif
|
||||
if exists("g:ch_syntax_for_h")
|
||||
call s:Setf('ch') | return
|
||||
endif
|
||||
call s:Setf('cpp') | return
|
||||
endfunc
|
||||
|
||||
func! polyglot#DetectMFiletype()
|
||||
let saw_comment = 0
|
||||
for lnum in range(1, min([line("$"), 100]))
|
||||
let line = getline(lnum)
|
||||
if line =~# '^\s*/\*'
|
||||
let saw_comment = 1
|
||||
endif
|
||||
if line =~# '^\s*\(@\(interface\|class\|protocol\|property\|end\|synchronised\|selector\|implementation\)\(\<\|\>\)\|#import\s\+.\+\.h[">]\)'
|
||||
call s:Setf('objc') | return
|
||||
endif
|
||||
if line =~# '^\s*%'
|
||||
call s:Setf('octave') | return
|
||||
endif
|
||||
if line =~# '^\s*(\*'
|
||||
call s:Setf('mma') | return
|
||||
endif
|
||||
if line =~? '^\s*\(\(type\|var\)\(\<\|\>\)\|--\)'
|
||||
call s:Setf('murphi') | return
|
||||
endif
|
||||
endfor
|
||||
if saw_comment
|
||||
call s:Setf('objc') | return
|
||||
endif
|
||||
if exists("g:filetype_m")
|
||||
call s:Setf(g:filetype_m) | return
|
||||
endif
|
||||
call s:Setf('octave') | return
|
||||
endfunc
|
||||
|
||||
func! polyglot#DetectFsFiletype()
|
||||
for lnum in range(1, min([line("$"), 50]))
|
||||
let line = getline(lnum)
|
||||
if line =~# '^\(: \|new-device\)'
|
||||
call s:Setf('forth') | return
|
||||
endif
|
||||
if line =~# '^\s*\(#light\|import\|let\|module\|namespace\|open\|type\)'
|
||||
call s:Setf('fsharp') | return
|
||||
endif
|
||||
if line =~# '\s*\(#version\|precision\|uniform\|varying\|vec[234]\)'
|
||||
call s:Setf('glsl') | return
|
||||
endif
|
||||
endfor
|
||||
if exists("g:filetype_fs")
|
||||
call s:Setf(g:filetype_fs) | return
|
||||
endif
|
||||
call s:Setf('forth') | return
|
||||
endfunc
|
||||
|
||||
func! polyglot#DetectReFiletype()
|
||||
for lnum in range(1, min([line("$"), 50]))
|
||||
let line = getline(lnum)
|
||||
if line =~# '^\s*#\%(\%(if\|ifdef\|define\|pragma\)\s\+\w\|\s*include\s\+[<"]\|template\s*<\)'
|
||||
call s:Setf('cpp') | return
|
||||
endif
|
||||
call s:Setf('reason') | return
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
func! polyglot#DetectIdrFiletype()
|
||||
for lnum in range(1, min([line("$"), 5]))
|
||||
let line = getline(lnum)
|
||||
if line =~# '^\s*--.*[Ii]dris \=1'
|
||||
call s:Setf('idris') | return
|
||||
endif
|
||||
if line =~# '^\s*--.*[Ii]dris \=2'
|
||||
call s:Setf('idris2') | return
|
||||
endif
|
||||
endfor
|
||||
for lnum in range(1, min([line("$"), 30]))
|
||||
let line = getline(lnum)
|
||||
if line =~# '^pkgs =.*'
|
||||
call s:Setf('idris') | return
|
||||
endif
|
||||
if line =~# '^depends =.*'
|
||||
call s:Setf('idris2') | return
|
||||
endif
|
||||
if line =~# '^%language \(TypeProviders\|ElabReflection\)'
|
||||
call s:Setf('idris') | return
|
||||
endif
|
||||
if line =~# '^%language PostfixProjections'
|
||||
call s:Setf('idris2') | return
|
||||
endif
|
||||
if line =~# '^%access .*'
|
||||
call s:Setf('idris') | return
|
||||
endif
|
||||
if exists("g:filetype_idr")
|
||||
call s:Setf(g:filetype_idr) | return
|
||||
endif
|
||||
endfor
|
||||
call s:Setf('idris2') | return
|
||||
endfunc
|
||||
|
||||
func! polyglot#DetectLidrFiletype()
|
||||
for lnum in range(1, min([line("$"), 200]))
|
||||
let line = getline(lnum)
|
||||
if line =~# '^>\s*--.*[Ii]dris \=1'
|
||||
call s:Setf('lidris') | return
|
||||
endif
|
||||
endfor
|
||||
call s:Setf('lidris2') | return
|
||||
endfunc
|
||||
|
||||
func! polyglot#DetectBasFiletype()
|
||||
for lnum in range(1, min([line("$"), 5]))
|
||||
let line = getline(lnum)
|
||||
if line =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
|
||||
call s:Setf('vb') | return
|
||||
endif
|
||||
endfor
|
||||
call s:Setf('basic') | return
|
||||
endfunc
|
||||
|
||||
" Restore 'cpoptions'
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -65,12 +65,12 @@ endfunction
|
||||
function! s:RustfmtConfigOptions()
|
||||
let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';')
|
||||
if l:rustfmt_toml !=# ''
|
||||
return '--config-path '.fnamemodify(l:rustfmt_toml, ":p")
|
||||
return '--config-path '.shellescape(fnamemodify(l:rustfmt_toml, ":p"))
|
||||
endif
|
||||
|
||||
let l:_rustfmt_toml = findfile('.rustfmt.toml', expand('%:p:h') . ';')
|
||||
if l:_rustfmt_toml !=# ''
|
||||
return '--config-path '.fnamemodify(l:_rustfmt_toml, ":p")
|
||||
return '--config-path '.shellescape(fnamemodify(l:_rustfmt_toml, ":p"))
|
||||
endif
|
||||
|
||||
" Default to edition 2018 in case no rustfmt.toml was found.
|
||||
|
||||
226
autoload/sleuth.vim
Normal file
226
autoload/sleuth.vim
Normal file
@@ -0,0 +1,226 @@
|
||||
let s:globs = {
|
||||
\ '8th': '*.8th',
|
||||
\ 'Dockerfile': '*.dockerfile,*.dock,*.Dockerfile,Dockerfile,dockerfile,Dockerfile*',
|
||||
\ 'Jenkinsfile': '*.jenkinsfile,*.Jenkinsfile,Jenkinsfile,Jenkinsfile*',
|
||||
\ 'a2ps': 'a2psrc',
|
||||
\ 'a65': '*.a65',
|
||||
\ 'aap': '*.aap',
|
||||
\ 'abap': '*.abap',
|
||||
\ 'abaqus': '*.inp',
|
||||
\ 'abc': '*.abc',
|
||||
\ 'abel': '*.abl',
|
||||
\ 'acedb': '*.wrm',
|
||||
\ 'ada': '*.adb,*.ads,*.ada,*.adc,*.gpr,*.ada_m',
|
||||
\ 'ahdl': '*.tdf',
|
||||
\ 'aidl': '*.aidl',
|
||||
\ 'alsaconf': '',
|
||||
\ 'aml': '*.aml',
|
||||
\ 'ampl': '*.run',
|
||||
\ 'ant': 'build.xml',
|
||||
\ 'apache': 'access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf*',
|
||||
\ 'apiblueprint': '*.apib',
|
||||
\ 'applescript': '*.applescript,*.scpt',
|
||||
\ 'aptconf': 'apt.conf',
|
||||
\ 'arch': '=tagging-method',
|
||||
\ 'arduino': '*.pde,*.ino',
|
||||
\ 'art': '*.art',
|
||||
\ 'asciidoc': '*.asciidoc,*.adoc,*.asc',
|
||||
\ 'asl': '*.asl,*.dsl',
|
||||
\ 'asn': '*.asn,*.asn1',
|
||||
\ 'aspperl': '*.asp',
|
||||
\ 'aspvbs': '*.asa,*.asp',
|
||||
\ 'atlas': '*.atl,*.as',
|
||||
\ 'autohotkey': '*.ahk,*.ahkl',
|
||||
\ 'autoit': '*.au3',
|
||||
\ 'automake': '[Mm]akefile.am,GNUmakefile.am',
|
||||
\ 'ave': '*.ave',
|
||||
\ 'awk': '*.awk,*.gawk',
|
||||
\ 'basic': '*.basic',
|
||||
\ 'blade': '*.blade,*.blade.php',
|
||||
\ 'brewfile': 'Brewfile',
|
||||
\ 'c': '*.c,*.cats,*.h,*.idc,*.qc',
|
||||
\ 'caddyfile': 'Caddyfile',
|
||||
\ 'carp': '*.carp',
|
||||
\ 'clojure': '*.clj,*.boot,*.cl2,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.hic,*.edn,riemann.config,build.boot,profile.boot',
|
||||
\ 'cmake': '*.cmake,*.cmake.in,CMakeLists.txt',
|
||||
\ 'coffee': '*.coffee,*._coffee,*.cake,*.cjsx,*.iced,*.coffeekup,Cakefile',
|
||||
\ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.tcc,*.tpp,*.moc,*.tlh',
|
||||
\ 'cql': '*.cql',
|
||||
\ 'cryptol': '*.cry,*.cyl,*.lcry,*.lcyl',
|
||||
\ 'crystal': '*.cr,Projectfile',
|
||||
\ 'csv': '*.csv,*.tsv,*.tab',
|
||||
\ 'cucumber': '*.feature,*.story',
|
||||
\ 'cuesheet': '*.cue',
|
||||
\ 'd': '*.d,*.di',
|
||||
\ 'dart': '*.dart,*.drt',
|
||||
\ 'dcov': '*.lst',
|
||||
\ 'dd': '*.dd',
|
||||
\ 'ddoc': '*.ddoc',
|
||||
\ 'dhall': '*.dhall',
|
||||
\ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,buildozer.spec,php.ini-*',
|
||||
\ 'dsdl': '*.sdl',
|
||||
\ 'dune': 'jbuild,dune,dune-project,dune-workspace',
|
||||
\ 'ecrystal': '*.ecr',
|
||||
\ 'eelixir': '*.eex,*.leex',
|
||||
\ 'elf': '*.am',
|
||||
\ 'elixir': '*.ex,*.exs,mix.lock',
|
||||
\ 'elm': '*.elm',
|
||||
\ 'embeddedpuppet': '*.epp',
|
||||
\ 'ember-script': '*.em,*.emberscript',
|
||||
\ 'emblem': '*.emblem,*.em',
|
||||
\ 'erlang': '*.erl,*.app.src,*.es,*.escript,*.hrl,*.xrl,*.yrl,*.app,*.yaws,Emakefile,rebar.config,rebar.config.lock,rebar.lock',
|
||||
\ 'eruby': '*.erb,*.erb.deface,*.rhtml',
|
||||
\ 'fbs': '*.fbs',
|
||||
\ 'fennel': '*.fnl',
|
||||
\ 'ferm': '*.ferm,ferm.conf',
|
||||
\ 'fish': '*.fish',
|
||||
\ 'flow': '*.flow',
|
||||
\ 'forth': '*.fs,*.ft,*.fth',
|
||||
\ 'fsharp': '*.fs,*.fsi,*.fsx',
|
||||
\ 'gdscript3': '*.gd',
|
||||
\ 'gitcommit': 'COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG',
|
||||
\ 'gitconfig': '*.gitconfig',
|
||||
\ 'gitrebase': 'git-rebase-todo',
|
||||
\ 'gitsendemail': '',
|
||||
\ 'glsl': '*.glsl,*.fp,*.frag,*.frg,*.fs,*.fsh,*.fshader,*.geo,*.geom,*.glslf,*.glslv,*.gs,*.gshader,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader,*.comp',
|
||||
\ 'gmpl': '*.mod',
|
||||
\ 'gnuplot': '*.gp,*.gnu,*.gnuplot,*.p,*.plot,*.plt,*.gpi',
|
||||
\ 'go': '*.go',
|
||||
\ 'gohtmltmpl': '*.tmpl',
|
||||
\ 'gomod': 'go.mod',
|
||||
\ 'graphql': '*.graphql,*.gql,*.graphqls',
|
||||
\ 'groovy': '*.groovy,*.grt,*.gtpl,*.gvy,*.gradle,Jenkinsfile',
|
||||
\ 'grub': '',
|
||||
\ 'haml': '*.haml,*.haml.deface,*.hamlc,*.hamlbars',
|
||||
\ 'haproxy': '*.cfg,haproxy.cfg,haproxy*.c*',
|
||||
\ 'haskell': '*.hs,*.hs-boot,*.hsc,*.bpk,*.hsig',
|
||||
\ 'haxe': '*.hx,*.hxsl',
|
||||
\ 'hcl': '*.hcl,*.nomad,*.workflow,Appfile',
|
||||
\ 'helm': '',
|
||||
\ 'help': '',
|
||||
\ 'hive': '*.q,*.hql,*.ql',
|
||||
\ 'html': '*.html,*.htm,*.html.hl,*.inc,*.st,*.xht,*.xhtml',
|
||||
\ 'html.twig': '*.twig',
|
||||
\ 'i3config': '*.i3.config,*.i3config,i3.config,i3config',
|
||||
\ 'icalendar': '*.ics',
|
||||
\ 'idris': '*.idr,*.lidr,idris-response',
|
||||
\ 'idris2': '*.idr,*.ipkg,idris-response',
|
||||
\ 'ion': '*.ion',
|
||||
\ 'javascript': '*.js,*._js,*.bones,*.cjs,*.es,*.es6,*.frag,*.gs,*.jake,*.jsb,*.jscad,*.jsfl,*.jsm,*.jss,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib,Jakefile',
|
||||
\ 'javascriptreact': '*.jsx',
|
||||
\ 'jinja.html': '*.jinja,*.j2,*.jinja2',
|
||||
\ 'jq': '*.jq',
|
||||
\ 'json': '*.json,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,composer.lock,mcmod.info,Pipfile.lock',
|
||||
\ 'json5': '*.json5',
|
||||
\ 'jsonnet': '*.jsonnet,*.libsonnet',
|
||||
\ 'jst': '*.ejs,*.ect,*.jst',
|
||||
\ 'julia': '*.jl',
|
||||
\ 'kotlin': '*.kt,*.ktm,*.kts',
|
||||
\ 'ledger': '*.ldg,*.ledger,*.journal',
|
||||
\ 'less': '*.less',
|
||||
\ 'lidris2': '*.lidr',
|
||||
\ 'lilypond': '*.ly,*.ily',
|
||||
\ 'litcoffee': '*.litcoffee,*.coffee.md',
|
||||
\ 'livescript': '*.ls,*._ls,Slakefile',
|
||||
\ 'llvm': '*.ll',
|
||||
\ 'log': '*.log,*.LOG,*_log,*_LOG',
|
||||
\ 'lua': '*.lua,*.fcgi,*.nse,*.p8,*.pd_lua,*.rbxs,*.rockspec,*.wlua',
|
||||
\ 'm4': '*.m4,*.at',
|
||||
\ 'mako': '*.mako,*.mao',
|
||||
\ 'markdown': '*.md,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.workbook,contents.lr',
|
||||
\ 'markdown.mdx': '*.mdx',
|
||||
\ 'meson': 'meson.build,meson_options.txt',
|
||||
\ 'mma': '*.mathematica,*.cdf,*.m,*.ma,*.mt,*.nb,*.nbp,*.wl,*.wlt,*.wls,*.mma',
|
||||
\ 'moon': '*.moon',
|
||||
\ 'murphi': '*.m',
|
||||
\ 'mustache': '*.handlebars,*.hbs,*.hulk,*.hjs,*.mustache,*.njk,*.hogan,*.hdbs,*.hb',
|
||||
\ 'nginx': '*.nginx,*.nginxconf,*.vhost,nginx.conf,nginx*.conf,*nginx.conf',
|
||||
\ 'nim': '*.nim,*.nim.cfg,*.nimble,*.nimrod,*.nims,nim.cfg',
|
||||
\ 'nix': '*.nix',
|
||||
\ 'oasis': '_oasis',
|
||||
\ 'objc': '*.m,*.h',
|
||||
\ 'ocaml': '*.ml,*.eliom,*.eliomi,*.ml4,*.mli,*.mll,*.mly,*.mlt,*.mlp,*.mlip,*.mli.cppo,*.ml.cppo',
|
||||
\ 'ocamlbuild_tags': '_tags',
|
||||
\ 'ocpbuild': '*.ocp',
|
||||
\ 'ocpbuildroot': '*.root',
|
||||
\ 'octave': '*.oct,*.m',
|
||||
\ 'odin': '*.odin',
|
||||
\ 'omake': '*.om,OMakefile,OMakeroot,OMakeroot.in',
|
||||
\ 'opam': '*.opam,*.opam.template,opam',
|
||||
\ 'opencl': '*.cl,*.opencl',
|
||||
\ 'perl': '*.pl,*.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.pm,*.psgi,*.t,Makefile.PL,Rexfile,ack,cpanfile',
|
||||
\ 'php': '*.php,*.aw,*.ctp,*.fcgi,*.inc,*.php3,*.php4,*.php5,*.phps,*.phpt,Phakefile',
|
||||
\ 'plantuml': '*.puml,*.iuml,*.plantuml,*.uml,*.pu',
|
||||
\ 'pony': '*.pony',
|
||||
\ 'proto': '*.proto',
|
||||
\ 'ps1': '*.ps1,*.psd1,*.psm1,*.pssc',
|
||||
\ 'ps1xml': '*.ps1xml',
|
||||
\ 'pug': '*.jade,*.pug',
|
||||
\ 'puppet': '*.pp,Modulefile',
|
||||
\ 'purescript': '*.purs',
|
||||
\ 'python': '*.py,*.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.smk,*.spec,*.tac,*.wsgi,*.xpy,DEPS,SConscript,SConstruct,Snakefile,wscript',
|
||||
\ 'qmake': '*.pro,*.pri',
|
||||
\ 'qml': '*.qml,*.qbs',
|
||||
\ 'r': '*.r,*.rsx,*.s,*.S,expr-dist',
|
||||
\ 'racket': '*.rkt,*.rktd,*.rktl,*.scrbl',
|
||||
\ 'ragel': '*.rl',
|
||||
\ 'raku': '*.6pl,*.6pm,*.nqp,*.p6,*.p6l,*.p6m,*.pl,*.pl6,*.pm,*.pm6,*.t,*.rakudoc,*.rakutest,*.raku,*.rakumod,*.pod6,*.t6',
|
||||
\ 'raml': '*.raml',
|
||||
\ 'razor': '*.cshtml,*.razor',
|
||||
\ 'reason': '*.re,*.rei',
|
||||
\ 'requirements': '*.pip,*requirements.{txt,in},*require.{txt,in},constraints.{txt,in}',
|
||||
\ 'rhelp': '*.rd',
|
||||
\ 'rst': '*.rst,*.rest,*.rest.txt,*.rst.txt',
|
||||
\ '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,Appraisals,Berksfile,Buildfile,Capfile,Dangerfile,Deliverfile,Fastfile,Gemfile,Gemfile.lock,Guardfile,Jarfile,Mavenfile,Podfile,Puppetfile,Rakefile,Snapfile,Thorfile,Vagrantfile,buildfile,Rantfile,Cheffile,KitchenSink,Routefile,vagrantfile,[Rr]akefile*,*_spec.rb',
|
||||
\ 'rust': '*.rs,*.rs.in',
|
||||
\ 'sbt.scala': '*.sbt',
|
||||
\ 'scala': '*.scala,*.kojo,*.sc',
|
||||
\ 'scss': '*.scss',
|
||||
\ 'sexplib': '*.sexp',
|
||||
\ 'sh': '*.sh,*.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh.in,*.tmux,*.tool,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,login,man,profile',
|
||||
\ 'slim': '*.slim',
|
||||
\ 'slime': '*.slime',
|
||||
\ 'smt2': '*.smt2,*.smt',
|
||||
\ 'solidity': '*.sol',
|
||||
\ 'sql': '*.pgsql',
|
||||
\ 'stylus': '*.styl,*.stylus',
|
||||
\ 'svelte': '*.svelte',
|
||||
\ 'svg': '*.svg',
|
||||
\ 'swift': '*.swift',
|
||||
\ 'sxhkdrc': '*.sxhkdrc,sxhkdrc',
|
||||
\ 'systemd': '*.automount,*.mount,*.path,*.service,*.socket,*.swap,*.target,*.timer',
|
||||
\ 'tablegen': '*.td',
|
||||
\ 'terraform': '*.hcl,*.nomad,*.tf,*.tfvars,*.workflow',
|
||||
\ 'textile': '*.textile',
|
||||
\ 'thrift': '*.thrift',
|
||||
\ 'tmux': '',
|
||||
\ 'toml': '*.toml,Cargo.lock,Gopkg.lock,poetry.lock,Pipfile',
|
||||
\ 'tptp': '*.p,*.tptp,*.ax',
|
||||
\ 'trasys': '*.inp',
|
||||
\ 'typescript': '*.ts',
|
||||
\ 'typescriptreact': '*.tsx',
|
||||
\ 'unison': '*.u,*.uu',
|
||||
\ 'v': '*.v',
|
||||
\ 'vala': '*.vala,*.vapi,*.valadoc',
|
||||
\ 'vb': '*.bas,*.cls,*.frm,*.frx,*.vba,*.vbs,*.dsm,*.ctl,*.sba',
|
||||
\ 'vbnet': '*.vb,*.vbhtml',
|
||||
\ 'vcl': '*.vcl',
|
||||
\ 'velocity': '*.vm',
|
||||
\ 'vmasm': '*.mar',
|
||||
\ 'vue': '*.vue,*.wpy',
|
||||
\ 'xdc': '*.xdc',
|
||||
\ '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,*.ps1xml,*.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,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config',
|
||||
\ 'xml.twig': '*.xml.twig',
|
||||
\ 'xsl': '*.xslt,*.xsl',
|
||||
\ 'yaml': '*.yml,*.mir,*.reek,*.rviz,*.sublime-syntax,*.syntax,*.yaml,*.yaml-tmlanguage,*.yaml.sed,*.yml.mysql,glide.lock,yarn.lock,fish_history,fish_read_history',
|
||||
\ 'yaml.ansible': 'playbook.y{a,}ml,site.y{a,}ml,main.y{a,}ml,local.y{a,}ml,requirements.y{a,}ml,tasks.*.y{a,}ml,roles.*.y{a,}ml,handlers.*.y{a,}ml',
|
||||
\ 'yaml.docker-compose': 'docker-compose*.yaml,docker-compose*.yml',
|
||||
\ 'zephir': '*.zep',
|
||||
\ 'zig': '*.zig,*.zir',
|
||||
\ 'zir': '*.zir',
|
||||
\ 'zsh': '*.zsh',
|
||||
\}
|
||||
|
||||
func! sleuth#GlobForFiletype(type)
|
||||
return get(s:globs, a:type, '')
|
||||
endfunc
|
||||
42
compiler/ant.vim
Normal file
42
compiler/ant.vim
Normal file
@@ -0,0 +1,42 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ant') == -1
|
||||
|
||||
" Vim Compiler File
|
||||
" Compiler: ant
|
||||
" Maintainer: Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: Mi, 13 Apr 2005 22:50:07 CEST
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "ant"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
CompilerSet makeprg=ant
|
||||
|
||||
" first line:
|
||||
" ant with jikes +E, which assumes the following
|
||||
" two property lines in your 'build.xml':
|
||||
"
|
||||
" <property name = "build.compiler" value = "jikes"/>
|
||||
" <property name = "build.compiler.emacs" value = "true"/>
|
||||
"
|
||||
" second line:
|
||||
" ant with javac
|
||||
"
|
||||
" note that this will work also for tasks like [wtkbuild]
|
||||
"
|
||||
CompilerSet errorformat=\ %#[%.%#]\ %#%f:%l:%v:%*\\d:%*\\d:\ %t%[%^:]%#:%m,
|
||||
\%A\ %#[%.%#]\ %f:%l:\ %m,%-Z\ %#[%.%#]\ %p^,%C\ %#[%.%#]\ %#%m
|
||||
|
||||
" ,%-C%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
@@ -969,8 +969,7 @@ The result is also available in the buffer-local variable `b:csv_result`.
|
||||
|
||||
See also |csv-aggregate-functions|
|
||||
|
||||
*MinCol_CSV*
|
||||
3.27 Maximum/Minimum value of a Column *MaxCol_CSV*
|
||||
3.27 Maximum/Minimum value of a Column *MaxCol_CSV* *MinCol_CSV*
|
||||
---------------------------------------
|
||||
You can let Vim output the 10 maximum/minimum values of a column using the
|
||||
`:CSVMaxCol` command >
|
||||
@@ -984,6 +983,7 @@ given, this calculates the sum for the column the cursor is on. Note, that the
|
||||
delimiter will be stripped away from each value and also empty values won't be
|
||||
considered.
|
||||
|
||||
*format_number_csv*
|
||||
By default, Vim uses the a numerical format that uses the '.' as decimal
|
||||
separator while there is no thousands separator. If youre file contains
|
||||
the numbers in a different format, you can use the /format/ option to specify
|
||||
@@ -1003,10 +1003,6 @@ uses the Space as thousands separator and the '.' as decimal separator.
|
||||
|
||||
If [distinct] is given, only returns the number of distinct values.
|
||||
|
||||
Note, if you Vim is compiled without floating point number format (|+float|),
|
||||
Vim will only aggregate the integer part and therefore won't use the 'y'
|
||||
argument in the /format/ specifier.
|
||||
|
||||
The result is also available in the buffer-local variable `b:csv_result`.
|
||||
|
||||
3.28 Average value of a Column *AvgCol_CSV*
|
||||
@@ -1021,19 +1017,21 @@ given, this calculates the sum for the column the cursor is on. Note, that the
|
||||
delimiter will be stripped away from each value and also empty values won't be
|
||||
considered.
|
||||
|
||||
For the [/format/] part, see |MaxCol_CSV|.
|
||||
For the [/format/] part, see |format_number_csv|.
|
||||
|
||||
The result is also available in the buffer-local variable `b:csv_result`.
|
||||
|
||||
See also |csv-aggregate-functions|
|
||||
|
||||
3.29 Variance of a Column *VarCol_CSV*
|
||||
3.29 Variance of a Column *VarCol_CSV* *SmplVarCol* *PopVarCol*
|
||||
_________________________
|
||||
|
||||
:[range]PopVarCol [nr] [/format/]
|
||||
|
||||
:[range]SmplVarCol [nr] [/format/]
|
||||
|
||||
Calculate the Population or Sample Variance for the specified column.
|
||||
|
||||
This outputs the result of the column `<nr>` within the range given. If no range
|
||||
is given, this will calculate the statistical variance of the whole column. If <nr> is not
|
||||
given, this calculates the variance for the column the cursor is on. Note, that the delimiter
|
||||
@@ -1041,13 +1039,17 @@ will be stripped away from each value and also empty values won't be considered.
|
||||
|
||||
The result is also available in the buffer-local variable `b:csv_result`.
|
||||
|
||||
3.30 Standard Deviation of a Column *StdDevCol_CSV*
|
||||
For the [/format/] part, see |format_number_csv|.
|
||||
|
||||
3.30 Standard Deviation of a Column *StdDevCol_CSV* *PopStdCol* *SmplStdCol*
|
||||
___________________________________
|
||||
|
||||
:[range]PopStdCol [nr] [/format/]
|
||||
|
||||
:[range]SmplStdCol [nr] [/format/]
|
||||
|
||||
Calculate the Population or Sample Standard Deviation for the specified column.
|
||||
|
||||
This outputs the result of the column `<nr>` within the range given. If no range
|
||||
is given, this will calculate the standard deviation of the whole column. If <nr> is not
|
||||
given, this calculates the standard deviation for the column the cursor is on. Note, that
|
||||
@@ -1055,6 +1057,8 @@ the delimiter will be stripped away from each value and also empty values won't
|
||||
|
||||
The result is also available in the buffer-local variable `b:csv_result`.
|
||||
|
||||
For the [/format/] part, see |format_number_csv|.
|
||||
|
||||
*:CSVDupColumn*
|
||||
3.31 Duplicate columns *DupColumn_CSV*
|
||||
----------------------
|
||||
@@ -1089,7 +1093,7 @@ This outputs the sum of the row [range]. If no range is given, this will
|
||||
calculate the sum for the current row. Note, that the delimiter will be
|
||||
stripped away from each value and also empty values won't be considered.
|
||||
|
||||
For the [/format/] part, see |MaxCol_CSV|.
|
||||
For the [/format/] part, see |format_number_csv|
|
||||
==============================================================================
|
||||
4. CSV Configuration *csv-configuration*
|
||||
|
||||
|
||||
@@ -46,8 +46,7 @@ the list of recognized template tag names.
|
||||
REASONML *graphql-reasonml*
|
||||
|
||||
GraphQL syntax support inside of ReasonML template strings using graphql-ppx
|
||||
is available when vim-reasonml (https://github.com/jordwalke/vim-reasonml) is
|
||||
also installed.
|
||||
is available.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
vim:tw=78:ft=help:norl:
|
||||
|
||||
@@ -802,7 +802,7 @@ CTRL-t
|
||||
You can define a constant value instead of the default field based value.
|
||||
For example the following command will add ``valid:"1"`` to all fields.
|
||||
>
|
||||
:GoAddTags valid=1
|
||||
:GoAddTags valid:1
|
||||
<
|
||||
*:GoRemoveTags*
|
||||
:[range]GoRemoveTags [key],[option] [key1],[option1] ...
|
||||
@@ -1718,6 +1718,13 @@ The default command used to open a new terminal for go commands such as
|
||||
Applicable to Neovim and Vim with `terminal` feature only.
|
||||
>
|
||||
let g:go_term_mode = "vsplit"
|
||||
<
|
||||
*'g:go_term_reuse'*
|
||||
|
||||
Reuse the terminal window when |'g:go_term_enabled'| is set. By default it's
|
||||
disabled.
|
||||
>
|
||||
let g:go_term_reuse = 0
|
||||
<
|
||||
*'g:go_term_height'*
|
||||
*'g:go_term_width'*
|
||||
@@ -1869,6 +1876,24 @@ is `v:null`.
|
||||
let g:go_gopls_local = v:null
|
||||
<
|
||||
|
||||
*'g:go_gopls_gofumpt'*
|
||||
|
||||
Specifies whether `gopls` should use `gofumpt` for formatting. When it is
|
||||
`v:null`, `gopls`' default will be used. By default it is `v:null`.
|
||||
>
|
||||
let g:go_gopls_gofumpt = v:null
|
||||
<
|
||||
|
||||
*'g:go_gopls_settings'*
|
||||
|
||||
Specifies `gopls` workspace settings for `gopls` that are not yet officially
|
||||
supported by vim-go. Any value in the dictionary will be overridden by values
|
||||
provided in the specific options supported by vim-go (e.g.
|
||||
g:go_gopls_staticcheck) or settings statically configured by vim-go to ensure
|
||||
expected behavior. By default it is `v:null`.
|
||||
>
|
||||
let g:go_gopls_settings = v:null
|
||||
<
|
||||
*'g:go_diagnostics_enabled'*
|
||||
|
||||
Specifies whether `gopls` diagnostics are enabled. Only the diagnostics for
|
||||
@@ -2242,6 +2267,8 @@ The program will halt on the breakpoint, at which point you can inspect the
|
||||
program state. You can go to the next line with |:GoDebugNext| (<F10>) or step
|
||||
in with |:GoDebugStep| (<F11>).
|
||||
|
||||
The program can also be halted with `:GoDebugHalt` (<F6>).
|
||||
|
||||
The variable window in the bottom left (`GODEBUG_VARIABLES`) will display all
|
||||
local variables. Struct values are displayed as `{...}`, array/slices as
|
||||
`[4]`. Use <CR> on the variable name to expand the values.
|
||||
@@ -2258,10 +2285,21 @@ the `dlv` process, or |:GoDebugRestart| to recompile the code.
|
||||
*go-debug-commands*
|
||||
DEBUGGER COMMANDS~
|
||||
|
||||
Only |:GoDebugStart|, `:GoDebugTest`, and |:GoDebugBreakpoint| are available
|
||||
by default. `:GoDebugContinue` becomes available after running `:GoDebugStart`
|
||||
or `:GoDebugTest`. The rest of the commands and mappings become available
|
||||
after executing `:GoDebugContinue`.
|
||||
Only |:GoDebugAttach|, |:GoDebugStart|, |:GoDebugTest|, and
|
||||
|:GoDebugBreakpoint| are available by default. |:GoDebugContinue| becomes
|
||||
available after running |:GoDebugAttach|, |:GoDebugStart| or |:GoDebugTest|.
|
||||
The rest of the commands and mappings become available after executing
|
||||
|:GoDebugContinue|.
|
||||
|
||||
*:GoDebugAttach*
|
||||
:GoDebugAttach pid
|
||||
|
||||
Start the debug mode for pid; this does several things:
|
||||
|
||||
* Setup the debug windows according to |'g:go_debug_windows'|.
|
||||
* Make the `:GoDebug*` commands and `(go-debug-*)` mappings available.
|
||||
|
||||
Use |:GoDebugStop| to stop `dlv` and exit debugging mode.
|
||||
|
||||
*:GoDebugStart*
|
||||
:GoDebugStart [pkg] [program-args]
|
||||
@@ -2291,6 +2329,14 @@ after executing `:GoDebugContinue`.
|
||||
Stop the program (if running) and restart `dlv` to recompile the package.
|
||||
The current window layout and breakpoints will be left intact.
|
||||
|
||||
*:GoDebugHalt*
|
||||
*(go-debug-halt)*
|
||||
:GoDebugHalt
|
||||
|
||||
Halt the program.
|
||||
|
||||
Mapped to <F6> by default.
|
||||
|
||||
*:GoDebugStop*
|
||||
*(go-debug-stop)*
|
||||
:GoDebugStop
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
||||
if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)
|
||||
|
||||
vim-jsx-pretty is syntax highlight for JSX (React.js).
|
||||
(https://github.com/MaxMEllon/vim-jsx-pretty)
|
||||
@@ -46,6 +46,7 @@ CONFIG *vim-jsx-pretty-config*
|
||||
|---------------------------------------|---------|----------------------|
|
||||
| g:vim_jsx_pretty_enable_jsx_highlight | 1 | jsx highlight flag |
|
||||
| g:vim_jsx_pretty_colorful_config | 0 | colorful config flag |
|
||||
| g:vim_jsx_pretty_disable_js | 0 | js toggle flag |
|
||||
<
|
||||
|
||||
- *g:vim_jsx_pretty_enable_jsx_highlight*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
29
ftplugin/8th.vim
Normal file
29
ftplugin/8th.vim
Normal file
@@ -0,0 +1,29 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '8th') == -1
|
||||
|
||||
" Vim ftplugin file
|
||||
" Language: 8th
|
||||
" Version: any
|
||||
" Last Change: 2015/11/08
|
||||
" Maintainer: Ron Aaron <ron@aaron-tech.com>
|
||||
" URL: https://8th-dev.com/
|
||||
" Filetypes: *.8th
|
||||
" NOTE: 8th allows any non-whitespace in a name, so you need to do:
|
||||
" setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
|
||||
" This goes with the syntax/8th.vim file.
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_8thplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_8thplugin = 1
|
||||
|
||||
setlocal ts=2 sts=2 sw=2 et
|
||||
setlocal com=s1:/*,mb:*,ex:*/,:\|,:\\
|
||||
setlocal fo=tcrqol
|
||||
setlocal matchpairs+=\::;
|
||||
setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
|
||||
setlocal suffixesadd=.8th
|
||||
|
||||
endif
|
||||
24
ftplugin/a2ps.vim
Normal file
24
ftplugin/a2ps.vim
Normal file
@@ -0,0 +1,24 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'a2ps') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: a2ps(1) configuration file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< inc< fo<"
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s include=^\\s*Include:
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
29
ftplugin/aap.vim
Normal file
29
ftplugin/aap.vim
Normal file
@@ -0,0 +1,29 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'aap') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: Aap recipe
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2013 Apr 05
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Reset 'formatoptions', 'comments' and 'expandtab' to undo this plugin.
|
||||
let b:undo_ftplugin = "setl fo< com< et<"
|
||||
|
||||
" Set 'formatoptions' to break comment lines but not other lines,
|
||||
" and insert the comment leader when hitting <CR> or using "o".
|
||||
setlocal fo-=t fo+=croql
|
||||
|
||||
" Set 'comments' to format dashed lists in comments.
|
||||
setlocal comments=s:#\ -,m:#\ \ ,e:#,n:#,fb:-
|
||||
|
||||
" Expand tabs to spaces to avoid trouble.
|
||||
setlocal expandtab
|
||||
|
||||
endif
|
||||
33
ftplugin/abap.vim
Normal file
33
ftplugin/abap.vim
Normal file
@@ -0,0 +1,33 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'abap') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: ABAP
|
||||
" Author: Steven Oliver <oliver.steven@gmail.com>
|
||||
" Copyright: Copyright (c) 2013 Steven Oliver
|
||||
" License: You may redistribute this under the same terms as Vim itself
|
||||
" --------------------------------------------------------------------------
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal softtabstop=2 shiftwidth=2
|
||||
setlocal suffixesadd=.abap
|
||||
|
||||
" Windows allows you to filter the open file dialog
|
||||
if has("gui_win32") && !exists("b:browsefilter")
|
||||
let b:browsefilter = "ABAP Source Files (*.abap)\t*.abap\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: set sw=4 sts=4 et tw=80 :
|
||||
|
||||
endif
|
||||
101
ftplugin/abaqus.vim
Normal file
101
ftplugin/abaqus.vim
Normal file
@@ -0,0 +1,101 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'abaqus') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: Abaqus finite element input file (www.abaqus.com)
|
||||
" Maintainer: Carl Osterwisch <osterwischc@asme.org>
|
||||
" Last Change: 2012 Apr 30
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Save the compatibility options and temporarily switch to vim defaults
|
||||
let s:cpo_save = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
" Set the format of the include file specification for Abaqus
|
||||
" Used in :check gf ^wf [i and other commands
|
||||
setlocal include=\\<\\cINPUT\\s*=
|
||||
|
||||
" Remove characters up to the first = when evaluating filenames
|
||||
setlocal includeexpr=substitute(v:fname,'.\\{-}=','','')
|
||||
|
||||
" Remove comma from valid filename characters since it is used to
|
||||
" separate keyword parameters
|
||||
setlocal isfname-=,
|
||||
|
||||
" Define format of comment lines (see 'formatoptions' for uses)
|
||||
setlocal comments=:**
|
||||
setlocal commentstring=**%s
|
||||
|
||||
" Definitions start with a * and assign a NAME, NSET, or ELSET
|
||||
" Used in [d ^wd and other commands
|
||||
setlocal define=^\\*\\a.*\\c\\(NAME\\\|NSET\\\|ELSET\\)\\s*=
|
||||
|
||||
" Abaqus keywords and identifiers may include a - character
|
||||
setlocal iskeyword+=-
|
||||
|
||||
let b:undo_ftplugin = "setlocal include< includeexpr< isfname<"
|
||||
\ . " comments< commentstring< define< iskeyword<"
|
||||
|
||||
if has("folding")
|
||||
" Fold all lines that do not begin with *
|
||||
setlocal foldexpr=getline(v:lnum)[0]!=\"\*\"
|
||||
setlocal foldmethod=expr
|
||||
let b:undo_ftplugin .= " foldexpr< foldmethod<"
|
||||
endif
|
||||
|
||||
" Set the file browse filter (currently only supported under Win32 gui)
|
||||
if has("gui_win32") && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Abaqus Input Files (*.inp *.inc)\t*.inp;*.inc\n" .
|
||||
\ "Abaqus Results (*.dat)\t*.dat\n" .
|
||||
\ "Abaqus Messages (*.pre *.msg *.sta)\t*.pre;*.msg;*.sta\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
let b:undo_ftplugin .= "|unlet! b:browsefilter"
|
||||
endif
|
||||
|
||||
" Define patterns for the matchit plugin
|
||||
if exists("loaded_matchit") && !exists("b:match_words")
|
||||
let b:match_ignorecase = 1
|
||||
let b:match_words =
|
||||
\ '\*part:\*end\s*part,' .
|
||||
\ '\*assembly:\*end\s*assembly,' .
|
||||
\ '\*instance:\*end\s*instance,' .
|
||||
\ '\*step:\*end\s*step'
|
||||
let b:undo_ftplugin .= "|unlet! b:match_ignorecase b:match_words"
|
||||
endif
|
||||
|
||||
" Define keys used to move [count] keywords backward or forward.
|
||||
noremap <silent><buffer> [[ ?^\*\a<CR>:nohlsearch<CR>
|
||||
noremap <silent><buffer> ]] /^\*\a<CR>:nohlsearch<CR>
|
||||
|
||||
" Define key to toggle commenting of the current line or range
|
||||
noremap <silent><buffer> <LocalLeader><LocalLeader>
|
||||
\ :call <SID>Abaqus_ToggleComment()<CR>j
|
||||
function! <SID>Abaqus_ToggleComment() range
|
||||
if strpart(getline(a:firstline), 0, 2) == "**"
|
||||
" Un-comment all lines in range
|
||||
silent execute a:firstline . ',' . a:lastline . 's/^\*\*//'
|
||||
else
|
||||
" Comment all lines in range
|
||||
silent execute a:firstline . ',' . a:lastline . 's/^/**/'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let b:undo_ftplugin .= "|unmap <buffer> [[|unmap <buffer> ]]"
|
||||
\ . "|unmap <buffer> <LocalLeader><LocalLeader>"
|
||||
|
||||
" Undo must be done in nocompatible mode for <LocalLeader>.
|
||||
let b:undo_ftplugin = "let s:cpo_save = &cpoptions|"
|
||||
\ . "set cpoptions&vim|"
|
||||
\ . b:undo_ftplugin
|
||||
\ . "|let &cpoptions = s:cpo_save"
|
||||
\ . "|unlet s:cpo_save"
|
||||
|
||||
" Restore saved compatibility options
|
||||
let &cpoptions = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
214
ftplugin/ada.vim
Normal file
214
ftplugin/ada.vim
Normal file
@@ -0,0 +1,214 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ada') == -1
|
||||
|
||||
"------------------------------------------------------------------------------
|
||||
" Description: Perform Ada specific completion & tagging.
|
||||
" Language: Ada (2005)
|
||||
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
|
||||
" Taylor Venable <taylor@metasyntax.net>
|
||||
" Neil Bird <neil@fnxweb.com>
|
||||
" $Author: krischik $
|
||||
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
|
||||
" Version: 4.6 with patch from David Bürgin
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/ftplugin/ada.vim $
|
||||
" History: 24.05.2006 MK Unified Headers
|
||||
" 26.05.2006 MK ' should not be in iskeyword.
|
||||
" 16.07.2006 MK Ada-Mode as vim-ball
|
||||
" 02.10.2006 MK Better folding.
|
||||
" 15.10.2006 MK Bram's suggestion for runtime integration
|
||||
" 05.11.2006 MK Bram suggested not to use include protection for
|
||||
" autoload
|
||||
" 05.11.2006 MK Bram suggested to save on spaces
|
||||
" 08.07.2007 TV fix default compiler problems.
|
||||
" Help Page: ft-ada-plugin
|
||||
"------------------------------------------------------------------------------
|
||||
" Provides mapping overrides for tag jumping that figure out the current
|
||||
" Ada object and tag jump to that, not the 'simple' vim word.
|
||||
" Similarly allows <Ctrl-N> matching of full-length ada entities from tags.
|
||||
"------------------------------------------------------------------------------
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists ("b:did_ftplugin") || version < 700
|
||||
finish
|
||||
endif
|
||||
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 45
|
||||
|
||||
"
|
||||
" Temporarily set cpoptions to ensure the script loads OK
|
||||
"
|
||||
let s:cpoptions = &cpoptions
|
||||
set cpoptions-=C
|
||||
|
||||
" Section: Comments {{{1
|
||||
"
|
||||
setlocal comments=O:--,:--\ \
|
||||
setlocal commentstring=--\ \ %s
|
||||
setlocal complete=.,w,b,u,t,i
|
||||
|
||||
" Section: case {{{1
|
||||
"
|
||||
setlocal nosmartcase
|
||||
setlocal ignorecase
|
||||
|
||||
" Section: formatoptions {{{1
|
||||
"
|
||||
setlocal formatoptions+=ron
|
||||
|
||||
" Section: Tagging {{{1
|
||||
"
|
||||
if exists ("g:ada_extended_tagging")
|
||||
" Make local tag mappings for this buffer (if not already set)
|
||||
if g:ada_extended_tagging == 'jump'
|
||||
if mapcheck('<C-]>','n') == ''
|
||||
nnoremap <unique> <buffer> <C-]> :call ada#Jump_Tag ('', 'tjump')<cr>
|
||||
endif
|
||||
if mapcheck('g<C-]>','n') == ''
|
||||
nnoremap <unique> <buffer> g<C-]> :call ada#Jump_Tag ('','stjump')<cr>
|
||||
endif
|
||||
elseif g:ada_extended_tagging == 'list'
|
||||
if mapcheck('<C-]>','n') == ''
|
||||
nnoremap <unique> <buffer> <C-]> :call ada#List_Tag ()<cr>
|
||||
endif
|
||||
if mapcheck('g<C-]>','n') == ''
|
||||
nnoremap <unique> <buffer> g<C-]> :call ada#List_Tag ()<cr>
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" Section: Completion {{{1
|
||||
"
|
||||
setlocal completefunc=ada#User_Complete
|
||||
setlocal omnifunc=adacomplete#Complete
|
||||
|
||||
if exists ("g:ada_extended_completion")
|
||||
if mapcheck ('<C-N>','i') == ''
|
||||
inoremap <unique> <buffer> <C-N> <C-R>=ada#Completion("\<lt>C-N>")<cr>
|
||||
endif
|
||||
if mapcheck ('<C-P>','i') == ''
|
||||
inoremap <unique> <buffer> <C-P> <C-R>=ada#Completion("\<lt>C-P>")<cr>
|
||||
endif
|
||||
if mapcheck ('<C-X><C-]>','i') == ''
|
||||
inoremap <unique> <buffer> <C-X><C-]> <C-R>=<SID>ada#Completion("\<lt>C-X>\<lt>C-]>")<cr>
|
||||
endif
|
||||
if mapcheck ('<bs>','i') == ''
|
||||
inoremap <silent> <unique> <buffer> <bs> <C-R>=ada#Insert_Backspace ()<cr>
|
||||
endif
|
||||
endif
|
||||
|
||||
" Section: Matchit {{{1
|
||||
"
|
||||
" Only do this when not done yet for this buffer & matchit is used
|
||||
"
|
||||
if !exists ("b:match_words") &&
|
||||
\ exists ("loaded_matchit")
|
||||
"
|
||||
" The following lines enable the macros/matchit.vim plugin for
|
||||
" Ada-specific extended matching with the % key.
|
||||
"
|
||||
let s:notend = '\%(\<end\s\+\)\@<!'
|
||||
let b:match_words =
|
||||
\ s:notend . '\<if\>:\<elsif\>:\<else\>:\<end\>\s\+\<if\>,' .
|
||||
\ s:notend . '\<case\>:\<when\>:\<end\>\s\+\<case\>,' .
|
||||
\ '\%(\<while\>.*\|\<for\>.*\|'.s:notend.'\)\<loop\>:\<end\>\s\+\<loop\>,' .
|
||||
\ '\%(\<do\>\|\<begin\>\):\<exception\>:\<end\>\s*\%($\|[;A-Z]\),' .
|
||||
\ s:notend . '\<record\>:\<end\>\s\+\<record\>'
|
||||
endif
|
||||
|
||||
|
||||
" Section: Compiler {{{1
|
||||
"
|
||||
if ! exists("g:ada_default_compiler")
|
||||
if has("vms")
|
||||
let g:ada_default_compiler = 'decada'
|
||||
else
|
||||
let g:ada_default_compiler = 'gnat'
|
||||
endif
|
||||
endif
|
||||
|
||||
if ! exists("current_compiler") ||
|
||||
\ current_compiler != g:ada_default_compiler
|
||||
execute "compiler " . g:ada_default_compiler
|
||||
endif
|
||||
|
||||
" Section: Folding {{{1
|
||||
"
|
||||
if exists("g:ada_folding")
|
||||
if g:ada_folding[0] == 'i'
|
||||
setlocal foldmethod=indent
|
||||
setlocal foldignore=--
|
||||
setlocal foldnestmax=5
|
||||
elseif g:ada_folding[0] == 'g'
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=ada#Pretty_Print_Folding(v:lnum)
|
||||
elseif g:ada_folding[0] == 's'
|
||||
setlocal foldmethod=syntax
|
||||
endif
|
||||
setlocal tabstop=8
|
||||
setlocal softtabstop=3
|
||||
setlocal shiftwidth=3
|
||||
endif
|
||||
|
||||
" Section: Abbrev {{{1
|
||||
"
|
||||
if exists("g:ada_abbrev")
|
||||
iabbrev ret return
|
||||
iabbrev proc procedure
|
||||
iabbrev pack package
|
||||
iabbrev func function
|
||||
endif
|
||||
|
||||
" Section: Commands, Mapping, Menus {{{1
|
||||
"
|
||||
call ada#Map_Popup (
|
||||
\ 'Tag.List',
|
||||
\ 'l',
|
||||
\ 'call ada#List_Tag ()')
|
||||
call ada#Map_Popup (
|
||||
\'Tag.Jump',
|
||||
\'j',
|
||||
\'call ada#Jump_Tag ()')
|
||||
call ada#Map_Menu (
|
||||
\'Tag.Create File',
|
||||
\':AdaTagFile',
|
||||
\'call ada#Create_Tags (''file'')')
|
||||
call ada#Map_Menu (
|
||||
\'Tag.Create Dir',
|
||||
\':AdaTagDir',
|
||||
\'call ada#Create_Tags (''dir'')')
|
||||
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Space Errors',
|
||||
\ ':AdaSpaces',
|
||||
\'call ada#Switch_Syntax_Option (''space_errors'')')
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Lines Errors',
|
||||
\ ':AdaLines',
|
||||
\'call ada#Switch_Syntax_Option (''line_errors'')')
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Rainbow Color',
|
||||
\ ':AdaRainbow',
|
||||
\'call ada#Switch_Syntax_Option (''rainbow_color'')')
|
||||
call ada#Map_Menu (
|
||||
\'Highlight.Toggle Standard Types',
|
||||
\ ':AdaTypes',
|
||||
\'call ada#Switch_Syntax_Option (''standard_types'')')
|
||||
|
||||
" 1}}}
|
||||
" Reset cpoptions
|
||||
let &cpoptions = s:cpoptions
|
||||
unlet s:cpoptions
|
||||
|
||||
finish " 1}}}
|
||||
|
||||
"------------------------------------------------------------------------------
|
||||
" Copyright (C) 2006 Martin Krischik
|
||||
"
|
||||
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
|
||||
"------------------------------------------------------------------------------
|
||||
" vim: textwidth=78 nowrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
|
||||
" vim: foldmethod=marker
|
||||
|
||||
endif
|
||||
23
ftplugin/alsaconf.vim
Normal file
23
ftplugin/alsaconf.vim
Normal file
@@ -0,0 +1,23 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'alsaconf') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: alsaconf(8) configuration file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
48
ftplugin/ant.vim
Normal file
48
ftplugin/ant.vim
Normal file
@@ -0,0 +1,48 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ant') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: ant
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
" Make sure the continuation lines below do not cause problems in
|
||||
" compatibility mode.
|
||||
let s:save_cpo = &cpo
|
||||
set cpo-=C
|
||||
|
||||
" Define some defaults in case the included ftplugins don't set them.
|
||||
let s:undo_ftplugin = ""
|
||||
let s:browsefilter = "XML Files (*.xml)\t*.xml\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
|
||||
runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Override our defaults if these were set by an included ftplugin.
|
||||
if exists("b:undo_ftplugin")
|
||||
let s:undo_ftplugin = b:undo_ftplugin
|
||||
endif
|
||||
if exists("b:browsefilter")
|
||||
let s:browsefilter = b:browsefilter
|
||||
endif
|
||||
|
||||
" Change the :browse e filter to primarily show Ant-related files.
|
||||
if has("gui_win32")
|
||||
let b:browsefilter = "Build Files (build.xml)\tbuild.xml\n" .
|
||||
\ "Java Files (*.java)\t*.java\n" .
|
||||
\ "Properties Files (*.prop*)\t*.prop*\n" .
|
||||
\ "Manifest Files (*.mf)\t*.mf\n" .
|
||||
\ s:browsefilter
|
||||
endif
|
||||
|
||||
" Undo the stuff we changed.
|
||||
let b:undo_ftplugin = "unlet! b:browsefilter | " . s:undo_ftplugin
|
||||
|
||||
" Restore the saved compatibility options.
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
endif
|
||||
23
ftplugin/arch.vim
Normal file
23
ftplugin/arch.vim
Normal file
@@ -0,0 +1,23 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'arch') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: GNU Arch inventory file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
19
ftplugin/art.vim
Normal file
19
ftplugin/art.vim
Normal file
@@ -0,0 +1,19 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'art') == -1
|
||||
|
||||
" Vim filetype plugin
|
||||
" Language: ART-IM and ART*Enterprise
|
||||
" Maintainer: Dorai Sitaram <ds26@gte.com>
|
||||
" URL: http://www.ccs.neu.edu/~dorai/vimplugins/vimplugins.html
|
||||
" Last Change: Apr 2, 2003
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
run ftplugin/lisp.vim
|
||||
|
||||
setl lw-=if
|
||||
setl lw+=def-art-fun,deffacts,defglobal,defrule,defschema,for,schema,while
|
||||
|
||||
endif
|
||||
20
ftplugin/automake.vim
Normal file
20
ftplugin/automake.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'automake') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: Automake
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
runtime! ftplugin/make.vim ftplugin/make_*.vim ftplugin/make/*.vim
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
22
ftplugin/awk.vim
Normal file
22
ftplugin/awk.vim
Normal file
@@ -0,0 +1,22 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'awk') == -1
|
||||
|
||||
" Vim filetype plugin
|
||||
" Language: awk, nawk, gawk, mawk
|
||||
" Maintainer: Antonio Colombo <azc100@gmail.com>
|
||||
" Last Change: 2017 Feb 17
|
||||
|
||||
" This plugin was prepared by Mark Sikora
|
||||
|
||||
" 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
|
||||
@@ -37,8 +37,9 @@ nnoremap <buffer><Plug>(crystal-spec-run-all) :<C-u>CrystalSpecRunAll<CR>
|
||||
nnoremap <buffer><Plug>(crystal-spec-run-current) :<C-u>CrystalSpecRunCurrent<CR>
|
||||
nnoremap <buffer><Plug>(crystal-format) :<C-u>CrystalFormat<CR>
|
||||
|
||||
" autocmd is setup per buffer. Please do not use :autocmd!. It refreshes
|
||||
" augroup hence removes autocmds for other buffers (#105)
|
||||
augroup plugin-ft-crystal
|
||||
autocmd!
|
||||
autocmd BufWritePre <buffer> if g:crystal_auto_format && &filetype ==# 'crystal' | call crystal_lang#format('', 1) | endif
|
||||
augroup END
|
||||
|
||||
|
||||
23
ftplugin/dosini.vim
Normal file
23
ftplugin/dosini.vim
Normal file
@@ -0,0 +1,23 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dosini') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: Configuration File (ini file) for MSDOS/MS Windows
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
|
||||
setlocal comments=:; commentstring=;\ %s formatoptions-=t formatoptions+=croql
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
23
ftplugin/groovy.vim
Normal file
23
ftplugin/groovy.vim
Normal file
@@ -0,0 +1,23 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'groovy') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: groovy
|
||||
" Maintainer: Justin M. Keyes <justinkz@gmail.com>
|
||||
" Last Change: 2016 May 22
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
let b:undo_ftplugin = 'setlocal commentstring<'
|
||||
|
||||
setlocal commentstring=//%s
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
23
ftplugin/grub.vim
Normal file
23
ftplugin/grub.vim
Normal file
@@ -0,0 +1,23 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'grub') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: grub(8) configuration file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
101
ftplugin/help.vim
Normal file
101
ftplugin/help.vim
Normal file
@@ -0,0 +1,101 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'help') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: Vim help file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2018-12-29
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl fo< tw< cole< cocu< keywordprg<"
|
||||
|
||||
setlocal formatoptions+=tcroql textwidth=78
|
||||
if has("conceal")
|
||||
setlocal cole=2 cocu=nc
|
||||
endif
|
||||
|
||||
" Prefer Vim help instead of manpages.
|
||||
setlocal keywordprg=:help
|
||||
|
||||
if !exists('g:no_plugin_maps')
|
||||
function! s:show_toc() abort
|
||||
let bufname = bufname('%')
|
||||
let info = getloclist(0, {'winid': 1})
|
||||
if !empty(info) && getwinvar(info.winid, 'qf_toc') ==# bufname
|
||||
lopen
|
||||
return
|
||||
endif
|
||||
|
||||
let toc = []
|
||||
let lnum = 2
|
||||
let last_line = line('$') - 1
|
||||
let last_added = 0
|
||||
let has_section = 0
|
||||
let has_sub_section = 0
|
||||
|
||||
while lnum && lnum <= last_line
|
||||
let level = 0
|
||||
let add_text = ''
|
||||
let text = getline(lnum)
|
||||
|
||||
if text =~# '^=\+$' && lnum + 1 < last_line
|
||||
" A de-facto section heading. Other headings are inferred.
|
||||
let has_section = 1
|
||||
let has_sub_section = 0
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
let text = getline(lnum)
|
||||
let add_text = text
|
||||
while add_text =~# '\*[^*]\+\*\s*$'
|
||||
let add_text = matchstr(add_text, '.*\ze\*[^*]\+\*\s*$')
|
||||
endwhile
|
||||
elseif text =~# '^[A-Z0-9][-A-ZA-Z0-9 .][-A-Z0-9 .():]*\%([ \t]\+\*.\+\*\)\?$'
|
||||
" Any line that's yelling is important.
|
||||
let has_sub_section = 1
|
||||
let level = has_section
|
||||
let add_text = matchstr(text, '.\{-}\ze\s*\%([ \t]\+\*.\+\*\)\?$')
|
||||
elseif text =~# '\~$'
|
||||
\ && matchstr(text, '^\s*\zs.\{-}\ze\s*\~$') !~# '\t\|\s\{2,}'
|
||||
\ && getline(lnum - 1) =~# '^\s*<\?$\|^\s*\*.*\*$'
|
||||
\ && getline(lnum + 1) =~# '^\s*>\?$\|^\s*\*.*\*$'
|
||||
" These lines could be headers or code examples. We only want the
|
||||
" ones that have subsequent lines at the same indent or more.
|
||||
let l = nextnonblank(lnum + 1)
|
||||
if getline(l) =~# '\*[^*]\+\*$'
|
||||
" Ignore tag lines
|
||||
let l = nextnonblank(l + 1)
|
||||
endif
|
||||
|
||||
if indent(lnum) <= indent(l)
|
||||
let level = has_section + has_sub_section
|
||||
let add_text = matchstr(text, '\S.*')
|
||||
endif
|
||||
endif
|
||||
|
||||
let add_text = substitute(add_text, '\s\+$', '', 'g')
|
||||
if !empty(add_text) && last_added != lnum
|
||||
let last_added = lnum
|
||||
call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum,
|
||||
\ 'text': repeat(' ', level) . add_text})
|
||||
endif
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
endwhile
|
||||
|
||||
call setloclist(0, toc, ' ')
|
||||
call setloclist(0, [], 'a', {'title': 'Help TOC'})
|
||||
lopen
|
||||
let w:qf_toc = bufname
|
||||
endfunction
|
||||
|
||||
nnoremap <silent><buffer> gO :call <sid>show_toc()<cr>
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
334
ftplugin/idris2.vim
Normal file
334
ftplugin/idris2.vim
Normal file
@@ -0,0 +1,334 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'idris2') == -1
|
||||
|
||||
if bufname('%') == "idris-response"
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
setlocal shiftwidth=2
|
||||
setlocal tabstop=2
|
||||
if !exists("g:idris_allow_tabchar") || g:idris_allow_tabchar == 0
|
||||
setlocal expandtab
|
||||
endif
|
||||
setlocal comments=s1:{-,mb:-,ex:-},:\|\|\|,:--
|
||||
setlocal commentstring=--%s
|
||||
setlocal iskeyword+=?
|
||||
setlocal wildignore+=*.ibc
|
||||
|
||||
let idris_response = 0
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Text near cursor position that needs to be passed to a command.
|
||||
" Refinment of `expand(<cword>)` to accomodate differences between
|
||||
" a (n)vim word and what Idris requires.
|
||||
function! s:currentQueryObject()
|
||||
let word = expand("<cword>")
|
||||
if word =~ '^?'
|
||||
" Cut off '?' that introduces a hole identifier.
|
||||
let word = strpart(word, 1)
|
||||
endif
|
||||
return word
|
||||
endfunction
|
||||
|
||||
function! s:IdrisCommand(...)
|
||||
let idriscmd = shellescape(join(a:000))
|
||||
" echo("idris2 " . expand ('%:p') . " --client " . idriscmd)
|
||||
return system("idris2 --find-ipkg " . shellescape(expand('%:p')) . " --client " . idriscmd)
|
||||
endfunction
|
||||
|
||||
function! IdrisDocFold(lineNum)
|
||||
let line = getline(a:lineNum)
|
||||
|
||||
if line =~ "^\s*|||"
|
||||
return "1"
|
||||
endif
|
||||
|
||||
return "0"
|
||||
endfunction
|
||||
|
||||
function! IdrisFold(lineNum)
|
||||
return IdrisDocFold(a:lineNum)
|
||||
endfunction
|
||||
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=IdrisFold(v:lnum)
|
||||
|
||||
function! IdrisResponseWin()
|
||||
if (!bufexists("idris-response"))
|
||||
botright 10split
|
||||
badd idris-response
|
||||
b idris-response
|
||||
let g:idris_respwin = "active"
|
||||
set buftype=nofile
|
||||
wincmd k
|
||||
elseif (bufexists("idris-response") && g:idris_respwin == "hidden")
|
||||
botright 10split
|
||||
b idris-response
|
||||
let g:idris_respwin = "active"
|
||||
wincmd k
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! IdrisHideResponseWin()
|
||||
let g:idris_respwin = "hidden"
|
||||
endfunction
|
||||
|
||||
function! IdrisShowResponseWin()
|
||||
let g:idris_respwin = "active"
|
||||
endfunction
|
||||
|
||||
function! IWrite(str)
|
||||
if (bufexists("idris-response"))
|
||||
let save_cursor = getcurpos()
|
||||
b idris-response
|
||||
%delete
|
||||
let resp = split(a:str, '\n')
|
||||
call append(1, resp)
|
||||
b #
|
||||
call setpos('.', save_cursor)
|
||||
else
|
||||
echo a:str
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! IdrisReload(q)
|
||||
w
|
||||
let file = expand('%:p')
|
||||
let tc = system("idris2 --find-ipkg " . shellescape(file) . " --client ''")
|
||||
if (! (tc is ""))
|
||||
call IWrite(tc)
|
||||
else
|
||||
if (a:q==0)
|
||||
call IWrite("Successfully reloaded " . file)
|
||||
endif
|
||||
endif
|
||||
return tc
|
||||
endfunction
|
||||
|
||||
function! IdrisReloadToLine(cline)
|
||||
return IdrisReload(1)
|
||||
"w
|
||||
"let file = expand("%:p")
|
||||
"let tc = s:IdrisCommand(":lto", a:cline, file)
|
||||
"if (! (tc is ""))
|
||||
" call IWrite(tc)
|
||||
"endif
|
||||
"return tc
|
||||
endfunction
|
||||
|
||||
function! IdrisShowType()
|
||||
w
|
||||
let word = s:currentQueryObject()
|
||||
let cline = line(".")
|
||||
let ccol = col(".")
|
||||
let ty = s:IdrisCommand(":t", word)
|
||||
call IWrite(ty)
|
||||
endfunction
|
||||
|
||||
function! IdrisShowDoc()
|
||||
w
|
||||
let word = expand("<cword>")
|
||||
let ty = s:IdrisCommand(":doc", word)
|
||||
call IWrite(ty)
|
||||
endfunction
|
||||
|
||||
function! IdrisProofSearch(hint)
|
||||
let view = winsaveview()
|
||||
w
|
||||
let cline = line(".")
|
||||
let word = s:currentQueryObject()
|
||||
|
||||
if (a:hint==0)
|
||||
let hints = ""
|
||||
else
|
||||
let hints = input ("Hints: ")
|
||||
endif
|
||||
|
||||
let result = s:IdrisCommand(":ps!", cline, word, hints)
|
||||
if (! (result is ""))
|
||||
call IWrite(result)
|
||||
else
|
||||
e
|
||||
call winrestview(view)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! IdrisGenerateDef()
|
||||
let view = winsaveview()
|
||||
w
|
||||
let cline = line(".")
|
||||
let word = s:currentQueryObject()
|
||||
|
||||
let result = s:IdrisCommand(":gd!", cline, word)
|
||||
if (! (result is ""))
|
||||
call IWrite(result)
|
||||
else
|
||||
e
|
||||
call winrestview(view)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! IdrisMakeLemma()
|
||||
let view = winsaveview()
|
||||
w
|
||||
let cline = line(".")
|
||||
let word = s:currentQueryObject()
|
||||
|
||||
let result = s:IdrisCommand(":ml!", cline, word)
|
||||
if (! (result is ""))
|
||||
call IWrite(result)
|
||||
else
|
||||
e
|
||||
call winrestview(view)
|
||||
call search(word, "b")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! IdrisRefine()
|
||||
let view = winsaveview()
|
||||
w
|
||||
let cline = line(".")
|
||||
let word = expand("<cword>")
|
||||
let name = input ("Name: ")
|
||||
|
||||
let result = s:IdrisCommand(":ref!", cline, word, name)
|
||||
if (! (result is ""))
|
||||
call IWrite(result)
|
||||
else
|
||||
e
|
||||
call winrestview(view)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! IdrisAddMissing()
|
||||
let view = winsaveview()
|
||||
w
|
||||
let cline = line(".")
|
||||
let word = expand("<cword>")
|
||||
|
||||
let result = s:IdrisCommand(":am!", cline, word)
|
||||
if (! (result is ""))
|
||||
call IWrite(result)
|
||||
else
|
||||
e
|
||||
call winrestview(view)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! IdrisCaseSplit()
|
||||
w
|
||||
let view = winsaveview()
|
||||
let cline = line(".")
|
||||
let ccol = col(".")
|
||||
let word = expand("<cword>")
|
||||
let result = s:IdrisCommand(":cs!", cline, ccol, word)
|
||||
if (! (result is ""))
|
||||
call IWrite(result)
|
||||
else
|
||||
e
|
||||
call winrestview(view)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! IdrisMakeWith()
|
||||
let view = winsaveview()
|
||||
w
|
||||
let cline = line(".")
|
||||
let word = s:currentQueryObject()
|
||||
let tc = IdrisReload(1)
|
||||
|
||||
let result = s:IdrisCommand(":mw!", cline, word)
|
||||
if (! (result is ""))
|
||||
call IWrite(result)
|
||||
else
|
||||
e
|
||||
call winrestview(view)
|
||||
call search("_")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! IdrisMakeCase()
|
||||
let view = winsaveview()
|
||||
w
|
||||
let cline = line(".")
|
||||
let word = s:currentQueryObject()
|
||||
|
||||
let result = s:IdrisCommand(":mc!", cline, word)
|
||||
if (! (result is ""))
|
||||
call IWrite(result)
|
||||
else
|
||||
e
|
||||
call winrestview(view)
|
||||
call search("_")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! IdrisAddClause(proof)
|
||||
let view = winsaveview()
|
||||
w
|
||||
let cline = line(".")
|
||||
let word = expand("<cword>")
|
||||
|
||||
if (a:proof==0)
|
||||
let fn = ":ac!"
|
||||
else
|
||||
let fn = ":apc!"
|
||||
endif
|
||||
|
||||
let result = s:IdrisCommand(fn, cline, word)
|
||||
if (! (result is ""))
|
||||
call IWrite(result)
|
||||
else
|
||||
e
|
||||
call winrestview(view)
|
||||
call search(word)
|
||||
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! IdrisEval()
|
||||
w
|
||||
let expr = input ("Expression: ")
|
||||
let result = s:IdrisCommand(expr)
|
||||
call IWrite(" = " . result)
|
||||
endfunction
|
||||
|
||||
nnoremap <buffer> <silent> <LocalLeader>t :call IdrisShowType()<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>r :call IdrisReload(0)<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>c :call IdrisCaseSplit()<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>a 0:call search(":")<ENTER>b:call IdrisAddClause(0)<ENTER>w
|
||||
nnoremap <buffer> <silent> <LocalLeader>d 0:call search(":")<ENTER>b:call IdrisAddClause(0)<ENTER>w
|
||||
nnoremap <buffer> <silent> <LocalLeader>b 0:call IdrisAddClause(0)<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>m :call IdrisAddMissing()<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>md 0:call search(":")<ENTER>b:call IdrisAddClause(1)<ENTER>w
|
||||
nnoremap <buffer> <silent> <LocalLeader>f :call IdrisRefine()<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>o :call IdrisProofSearch(0)<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>s :call IdrisProofSearch(0)<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>g :call IdrisGenerateDef()<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>p :call IdrisProofSearch(1)<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>l :call IdrisMakeLemma()<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>e :call IdrisEval()<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>w 0:call IdrisMakeWith()<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>mc :call IdrisMakeCase()<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>i 0:call IdrisResponseWin()<ENTER>
|
||||
nnoremap <buffer> <silent> <LocalLeader>h :call IdrisShowDoc()<ENTER>
|
||||
|
||||
menu Idris.Reload <LocalLeader>r
|
||||
menu Idris.Show\ Type <LocalLeader>t
|
||||
menu Idris.Evaluate <LocalLeader>e
|
||||
menu Idris.-SEP0- :
|
||||
menu Idris.Add\ Clause <LocalLeader>a
|
||||
menu Idris.Generate\ Definition <LocalLeader>g
|
||||
menu Idris.Add\ with <LocalLeader>w
|
||||
menu Idris.Case\ Split <LocalLeader>c
|
||||
menu Idris.Add\ missing\ cases <LocalLeader>m
|
||||
menu Idris.Proof\ Search <LocalLeader>s
|
||||
menu Idris.Proof\ Search\ with\ hints <LocalLeader>p
|
||||
|
||||
au BufHidden idris-response call IdrisHideResponseWin()
|
||||
au BufEnter idris-response call IdrisShowResponseWin()
|
||||
|
||||
endif
|
||||
24
ftplugin/m4.vim
Normal file
24
ftplugin/m4.vim
Normal file
@@ -0,0 +1,24 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'm4') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: m4
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
|
||||
setlocal comments=:#,:dnl commentstring=dnl\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
49
ftplugin/vb.vim
Normal file
49
ftplugin/vb.vim
Normal file
@@ -0,0 +1,49 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'visual-basic') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: VisualBasic (ft=vb)
|
||||
" Maintainer: Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: Thu, 22 Nov 2001 12:56:14 W. Europe Standard Time
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal com=sr:'\ -,mb:'\ \ ,el:'\ \ ,:'
|
||||
|
||||
" we need this wrapper, as call doesn't allow a count
|
||||
fun! <SID>VbSearch(pattern, flags)
|
||||
let cnt = v:count1
|
||||
while cnt > 0
|
||||
call search(a:pattern, a:flags)
|
||||
let cnt = cnt - 1
|
||||
endwhile
|
||||
endfun
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" NOTE the double escaping \\|
|
||||
nnoremap <buffer> <silent> [[ :call <SID>VbSearch('^\s*\(\(private\|public\)\s\+\)\=\(function\\|sub\)', 'bW')<cr>
|
||||
nnoremap <buffer> <silent> ]] :call <SID>VbSearch('^\s*\(\(private\|public\)\s\+\)\=\(function\\|sub\)', 'W')<cr>
|
||||
nnoremap <buffer> <silent> [] :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'bW')<cr>
|
||||
nnoremap <buffer> <silent> ][ :call <SID>VbSearch('^\s*\<end\>\s\+\(function\\|sub\)', 'W')<cr>
|
||||
|
||||
" matchit support
|
||||
if exists("loaded_matchit")
|
||||
let b:match_ignorecase=1
|
||||
let b:match_words=
|
||||
\ '\%(^\s*\)\@<=\<if\>.*\<then\>\s*$:\%(^\s*\)\@<=\<else\>:\%(^\s*\)\@<=\<elseif\>:\%(^\s*\)\@<=\<end\>\s\+\<if\>,' .
|
||||
\ '\%(^\s*\)\@<=\<for\>:\%(^\s*\)\@<=\<next\>,' .
|
||||
\ '\%(^\s*\)\@<=\<while\>:\%(^\s*\)\@<=\<wend\>,' .
|
||||
\ '\%(^\s*\)\@<=\<do\>:\%(^\s*\)\@<=\<loop\>\s\+\<while\>,' .
|
||||
\ '\%(^\s*\)\@<=\<select\>\s\+\<case\>:\%(^\s*\)\@<=\<case\>:\%(^\s*\)\@<=\<end\>\s\+\<select\>,' .
|
||||
\ '\%(^\s*\)\@<=\<enum\>:\%(^\s*\)\@<=\<end\>\s\<enum\>,' .
|
||||
\ '\%(^\s*\)\@<=\<with\>:\%(^\s*\)\@<=\<end\>\s\<with\>,' .
|
||||
\ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<function\>\s\+\([^ \t(]\+\):\%(^\s*\)\@<=\<\1\>\s*=:\%(^\s*\)\@<=\<end\>\s\+\<function\>,' .
|
||||
\ '\%(^\s*\)\@<=\%(\<\%(private\|public\)\>\s\+\)\=\<sub\>\s\+:\%(^\s*\)\@<=\<end\>\s\+\<sub\>'
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
29
ftplugin/yaml.vim
Normal file
29
ftplugin/yaml.vim
Normal file
@@ -0,0 +1,29 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: YAML (YAML Ain't Markup Language)
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> (inactive)
|
||||
" Last Change: 2020 Mar 02
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< et< fo<"
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s expandtab
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
if !exists("g:yaml_recommended_style") || g:yaml_recommended_style != 0
|
||||
let b:undo_ftplugin .= " sw< sts<"
|
||||
setlocal shiftwidth=2 softtabstop=2
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
@@ -1,24 +1,44 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_orig = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Recomended code style, no tabs and 4-space indentation
|
||||
setlocal expandtab
|
||||
setlocal tabstop=4
|
||||
setlocal tabstop=8
|
||||
setlocal softtabstop=4
|
||||
setlocal shiftwidth=4
|
||||
|
||||
setlocal suffixesadd=.zig
|
||||
setlocal suffixesadd=.zir
|
||||
setlocal commentstring=//\ %s
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
setlocal suffixesadd=.zig,.zir
|
||||
setlocal makeprg=zig\ build
|
||||
|
||||
if (has("comments"))
|
||||
set comments=:///,://,:\\\\
|
||||
set formatoptions=tcqor
|
||||
if has("comments")
|
||||
setlocal comments=:///,://!,://,:\\\\
|
||||
setlocal commentstring=//\ %s
|
||||
endif
|
||||
|
||||
if has('find_in_path')
|
||||
let &l:includeexpr='substitute(v:fname, "^([^.])$", "\1.zig", "")'
|
||||
let &l:include='\v(\@import>|\@cInclude>|^\s*\#\s*include)'
|
||||
let &l:define='\v(<fn>|<const>|<var>|^\s*\#\s*define)'
|
||||
endif
|
||||
|
||||
if has('eval')
|
||||
execute 'setlocal path+=' . json_decode(system('zig env'))['std_dir']
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl et< ts< sts< sw< fo< sua< mp< com< cms<"
|
||||
|
||||
let &cpo = s:cpo_orig
|
||||
unlet s:cpo_orig
|
||||
|
||||
endif
|
||||
|
||||
117
heuristics.yaml
Normal file
117
heuristics.yaml
Normal file
@@ -0,0 +1,117 @@
|
||||
---
|
||||
extensions: [inp]
|
||||
rules:
|
||||
- lines: 1
|
||||
pattern: '^\*'
|
||||
filetype: abaqus
|
||||
- lines: 500
|
||||
pattern: '^header surface data'
|
||||
ignore_case: true
|
||||
filetype: trasys
|
||||
---
|
||||
extensions: [asa]
|
||||
rules:
|
||||
- override: "g:filetype_asa"
|
||||
- filetype: aspvbs
|
||||
---
|
||||
extensions: [asp]
|
||||
rules:
|
||||
- override: "g:filetype_asp"
|
||||
- lines: 3
|
||||
pattern: 'perlscript'
|
||||
ignore_case: true
|
||||
filetype: aspperl
|
||||
- filetype: aspvbs
|
||||
---
|
||||
extensions: [h]
|
||||
rules:
|
||||
- lines: 200
|
||||
pattern: '^\s*(@(interface|class|protocol|property|end|synchronised|selector|implementation)\b|#import\s+.+\.h[">])'
|
||||
rules:
|
||||
- if_exists: "g:c_syntax_for_h"
|
||||
filetype: objc
|
||||
- filetype: objcpp
|
||||
- if_exists: "g:c_syntax_for_h"
|
||||
filetype: c
|
||||
- if_exists: "g:ch_syntax_for_h"
|
||||
filetype: ch
|
||||
- filetype: cpp
|
||||
---
|
||||
extensions: [m]
|
||||
rules:
|
||||
- lines: 100
|
||||
rules:
|
||||
- pattern: '^\s*/\*'
|
||||
set: 'saw_comment'
|
||||
- pattern: '^\s*(@(interface|class|protocol|property|end|synchronised|selector|implementation)\b|#import\s+.+\.h[">])'
|
||||
filetype: objc
|
||||
- pattern: '^\s*%'
|
||||
filetype: octave
|
||||
- pattern: '^\s*\(\*'
|
||||
filetype: mma
|
||||
- pattern: '^\s*((type|var)\b|--)'
|
||||
ignore_case: true
|
||||
filetype: murphi
|
||||
- if_set: "saw_comment"
|
||||
filetype: objc
|
||||
- override: "g:filetype_m"
|
||||
- filetype: octave
|
||||
---
|
||||
extensions: [fs]
|
||||
rules:
|
||||
- lines: 50
|
||||
rules:
|
||||
- pattern: '^(: |new-device)'
|
||||
filetype: forth
|
||||
- pattern: '^\s*(#light|import|let|module|namespace|open|type)'
|
||||
filetype: fsharp
|
||||
- pattern: '\s*(#version|precision|uniform|varying|vec[234])'
|
||||
filetype: glsl
|
||||
- override: "g:filetype_fs"
|
||||
- filetype: forth
|
||||
---
|
||||
extensions: [re]
|
||||
rules:
|
||||
- lines: 50
|
||||
rules:
|
||||
- pattern: '^\s*#(?:(?:if|ifdef|define|pragma)\s+\w|\s*include\s+[<"]|template\s*<)'
|
||||
filetype: cpp
|
||||
- filetype: reason
|
||||
---
|
||||
extensions: [idr]
|
||||
rules:
|
||||
- lines: 5
|
||||
rules:
|
||||
- pattern: '^\s*--.*[Ii]dris ?1'
|
||||
filetype: idris
|
||||
- pattern: '^\s*--.*[Ii]dris ?2'
|
||||
filetype: idris2
|
||||
- lines: 30
|
||||
rules:
|
||||
- pattern: '^pkgs =.*'
|
||||
filetype: idris
|
||||
- pattern: '^depends =.*'
|
||||
filetype: idris2
|
||||
- pattern: '^%language (TypeProviders|ElabReflection)'
|
||||
filetype: idris
|
||||
- pattern: '^%language PostfixProjections'
|
||||
filetype: idris2
|
||||
- pattern: '^%access .*'
|
||||
filetype: idris
|
||||
- override: 'g:filetype_idr'
|
||||
- filetype: idris2
|
||||
---
|
||||
extensions: [lidr]
|
||||
rules:
|
||||
- lines: 200
|
||||
pattern: '^>\s*--.*[Ii]dris ?1'
|
||||
filetype: lidris
|
||||
- filetype: lidris2
|
||||
---
|
||||
extensions: [bas]
|
||||
rules:
|
||||
- lines: 5
|
||||
pattern: 'VB_Name|Begin VB\.(Form|MDIForm|UserControl)'
|
||||
filetype: vb
|
||||
ignore_case: true
|
||||
- filetype: basic
|
||||
16
indent/aap.vim
Normal file
16
indent/aap.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'aap') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: Aap recipe
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2005 Jun 24
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Works mostly like Python.
|
||||
runtime! indent/python.vim
|
||||
|
||||
endif
|
||||
312
indent/ada.vim
Normal file
312
indent/ada.vim
Normal file
@@ -0,0 +1,312 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ada') == -1
|
||||
|
||||
"------------------------------------------------------------------------------
|
||||
" Description: Vim Ada indent file
|
||||
" Language: Ada (2005)
|
||||
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Copyright: Copyright (C) 2006 Martin Krischik
|
||||
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
|
||||
" Neil Bird <neil@fnxweb.com>
|
||||
" Ned Okie <nokie@radford.edu>
|
||||
" $Author: krischik $
|
||||
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
|
||||
" Version: 4.6
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/indent/ada.vim $
|
||||
" History: 24.05.2006 MK Unified Headers
|
||||
" 16.07.2006 MK Ada-Mode as vim-ball
|
||||
" 15.10.2006 MK Bram's suggestion for runtime integration
|
||||
" 05.11.2006 MK Bram suggested to save on spaces
|
||||
" 19.09.2007 NO g: missing before ada#Comment
|
||||
" Help Page: ft-vim-indent
|
||||
"------------------------------------------------------------------------------
|
||||
" ToDo:
|
||||
" Verify handling of multi-line exprs. and recovery upon the final ';'.
|
||||
" Correctly find comments given '"' and "" ==> " syntax.
|
||||
" Combine the two large block-indent functions into one?
|
||||
"------------------------------------------------------------------------------
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent") || version < 700
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_indent = 45
|
||||
|
||||
setlocal indentexpr=GetAdaIndent()
|
||||
setlocal indentkeys-=0{,0}
|
||||
setlocal indentkeys+=0=~then,0=~end,0=~elsif,0=~when,0=~exception,0=~begin,0=~is,0=~record
|
||||
|
||||
" Only define the functions once.
|
||||
if exists("*GetAdaIndent")
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists("g:ada_with_gnat_project_files")
|
||||
let s:AdaBlockStart = '^\s*\(if\>\|while\>\|else\>\|elsif\>\|loop\>\|for\>.*\<\(loop\|use\)\>\|declare\>\|begin\>\|type\>.*\<is\>[^;]*$\|\(type\>.*\)\=\<record\>\|procedure\>\|function\>\|accept\>\|do\>\|task\>\|package\>\|project\>\|then\>\|when\>\|is\>\)'
|
||||
else
|
||||
let s:AdaBlockStart = '^\s*\(if\>\|while\>\|else\>\|elsif\>\|loop\>\|for\>.*\<\(loop\|use\)\>\|declare\>\|begin\>\|type\>.*\<is\>[^;]*$\|\(type\>.*\)\=\<record\>\|procedure\>\|function\>\|accept\>\|do\>\|task\>\|package\>\|then\>\|when\>\|is\>\)'
|
||||
endif
|
||||
|
||||
" Section: s:MainBlockIndent {{{1
|
||||
"
|
||||
" Try to find indent of the block we're in
|
||||
" prev_indent = the previous line's indent
|
||||
" prev_lnum = previous line (to start looking on)
|
||||
" blockstart = expr. that indicates a possible start of this block
|
||||
" stop_at = if non-null, if a matching line is found, gives up!
|
||||
" No recursive previous block analysis: simply look for a valid line
|
||||
" with a lesser or equal indent than we currently (on prev_lnum) have.
|
||||
" This shouldn't work as well as it appears to with lines that are currently
|
||||
" nowhere near the correct indent (e.g., start of line)!
|
||||
" Seems to work OK as it 'starts' with the indent of the /previous/ line.
|
||||
function s:MainBlockIndent (prev_indent, prev_lnum, blockstart, stop_at)
|
||||
let lnum = a:prev_lnum
|
||||
let line = substitute( getline(lnum), g:ada#Comment, '', '' )
|
||||
while lnum > 1
|
||||
if a:stop_at != '' && line =~ '^\s*' . a:stop_at && indent(lnum) < a:prev_indent
|
||||
return a:prev_indent
|
||||
elseif line =~ '^\s*' . a:blockstart
|
||||
let ind = indent(lnum)
|
||||
if ind < a:prev_indent
|
||||
return ind
|
||||
endif
|
||||
endif
|
||||
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
" Get previous non-blank/non-comment-only line
|
||||
while 1
|
||||
let line = substitute( getline(lnum), g:ada#Comment, '', '' )
|
||||
if line !~ '^\s*$' && line !~ '^\s*#'
|
||||
break
|
||||
endif
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
if lnum <= 0
|
||||
return a:prev_indent
|
||||
endif
|
||||
endwhile
|
||||
endwhile
|
||||
" Fallback - just move back one
|
||||
return a:prev_indent - shiftwidth()
|
||||
endfunction MainBlockIndent
|
||||
|
||||
" Section: s:EndBlockIndent {{{1
|
||||
"
|
||||
" Try to find indent of the block we're in (and about to complete),
|
||||
" including handling of nested blocks. Works on the 'end' of a block.
|
||||
" prev_indent = the previous line's indent
|
||||
" prev_lnum = previous line (to start looking on)
|
||||
" blockstart = expr. that indicates a possible start of this block
|
||||
" blockend = expr. that indicates a possible end of this block
|
||||
function s:EndBlockIndent( prev_indent, prev_lnum, blockstart, blockend )
|
||||
let lnum = a:prev_lnum
|
||||
let line = getline(lnum)
|
||||
let ends = 0
|
||||
while lnum > 1
|
||||
if getline(lnum) =~ '^\s*' . a:blockstart
|
||||
let ind = indent(lnum)
|
||||
if ends <= 0
|
||||
if ind < a:prev_indent
|
||||
return ind
|
||||
endif
|
||||
else
|
||||
let ends = ends - 1
|
||||
endif
|
||||
elseif getline(lnum) =~ '^\s*' . a:blockend
|
||||
let ends = ends + 1
|
||||
endif
|
||||
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
" Get previous non-blank/non-comment-only line
|
||||
while 1
|
||||
let line = getline(lnum)
|
||||
let line = substitute( line, g:ada#Comment, '', '' )
|
||||
if line !~ '^\s*$'
|
||||
break
|
||||
endif
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
if lnum <= 0
|
||||
return a:prev_indent
|
||||
endif
|
||||
endwhile
|
||||
endwhile
|
||||
" Fallback - just move back one
|
||||
return a:prev_indent - shiftwidth()
|
||||
endfunction EndBlockIndent
|
||||
|
||||
" Section: s:StatementIndent {{{1
|
||||
"
|
||||
" Return indent of previous statement-start
|
||||
" (after we've indented due to multi-line statements).
|
||||
" This time, we start searching on the line *before* the one given (which is
|
||||
" the end of a statement - we want the previous beginning).
|
||||
function s:StatementIndent( current_indent, prev_lnum )
|
||||
let lnum = a:prev_lnum
|
||||
while lnum > 0
|
||||
let prev_lnum = lnum
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
" Get previous non-blank/non-comment-only line
|
||||
while 1
|
||||
let line = substitute( getline(lnum), g:ada#Comment, '', '' )
|
||||
|
||||
if line !~ '^\s*$' && line !~ '^\s*#'
|
||||
break
|
||||
endif
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
if lnum <= 0
|
||||
return a:current_indent
|
||||
endif
|
||||
endwhile
|
||||
" Leave indent alone if our ';' line is part of a ';'-delineated
|
||||
" aggregate (e.g., procedure args.) or first line after a block start.
|
||||
if line =~ s:AdaBlockStart || line =~ '(\s*$'
|
||||
return a:current_indent
|
||||
endif
|
||||
if line !~ '[.=(]\s*$'
|
||||
let ind = indent(prev_lnum)
|
||||
if ind < a:current_indent
|
||||
return ind
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
" Fallback - just use current one
|
||||
return a:current_indent
|
||||
endfunction StatementIndent
|
||||
|
||||
|
||||
" Section: GetAdaIndent {{{1
|
||||
"
|
||||
" Find correct indent of a new line based upon what went before
|
||||
"
|
||||
function GetAdaIndent()
|
||||
" Find a non-blank line above the current line.
|
||||
let lnum = prevnonblank(v:lnum - 1)
|
||||
let ind = indent(lnum)
|
||||
let package_line = 0
|
||||
|
||||
" Get previous non-blank/non-comment-only/non-cpp line
|
||||
while 1
|
||||
let line = substitute( getline(lnum), g:ada#Comment, '', '' )
|
||||
if line !~ '^\s*$' && line !~ '^\s*#'
|
||||
break
|
||||
endif
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
if lnum <= 0
|
||||
return ind
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Get default indent (from prev. line)
|
||||
let ind = indent(lnum)
|
||||
let initind = ind
|
||||
|
||||
" Now check what's on the previous line
|
||||
if line =~ s:AdaBlockStart || line =~ '(\s*$'
|
||||
" Check for false matches to AdaBlockStart
|
||||
let false_match = 0
|
||||
if line =~ '^\s*\(procedure\|function\|package\)\>.*\<is\s*new\>'
|
||||
" Generic instantiation
|
||||
let false_match = 1
|
||||
elseif line =~ ')\s*;\s*$' || line =~ '^\([^(]*([^)]*)\)*[^(]*;\s*$'
|
||||
" forward declaration
|
||||
let false_match = 1
|
||||
endif
|
||||
" Move indent in
|
||||
if ! false_match
|
||||
let ind = ind + shiftwidth()
|
||||
endif
|
||||
elseif line =~ '^\s*\(case\|exception\)\>'
|
||||
" Move indent in twice (next 'when' will move back)
|
||||
let ind = ind + 2 * shiftwidth()
|
||||
elseif line =~ '^\s*end\s*record\>'
|
||||
" Move indent back to tallying 'type' preceeding the 'record'.
|
||||
" Allow indent to be equal to 'end record's.
|
||||
let ind = s:MainBlockIndent( ind+shiftwidth(), lnum, 'type\>', '' )
|
||||
elseif line =~ '\(^\s*new\>.*\)\@<!)\s*[;,]\s*$'
|
||||
" Revert to indent of line that started this parenthesis pair
|
||||
exe lnum
|
||||
exe 'normal! $F)%'
|
||||
if getline('.') =~ '^\s*('
|
||||
" Dire layout - use previous indent (could check for g:ada#Comment here)
|
||||
let ind = indent( prevnonblank( line('.')-1 ) )
|
||||
else
|
||||
let ind = indent('.')
|
||||
endif
|
||||
exe v:lnum
|
||||
elseif line =~ '[.=(]\s*$'
|
||||
" A statement continuation - move in one
|
||||
let ind = ind + shiftwidth()
|
||||
elseif line =~ '^\s*new\>'
|
||||
" Multiple line generic instantiation ('package blah is\nnew thingy')
|
||||
let ind = s:StatementIndent( ind - shiftwidth(), lnum )
|
||||
elseif line =~ ';\s*$'
|
||||
" Statement end (but not 'end' ) - try to find current statement-start indent
|
||||
let ind = s:StatementIndent( ind, lnum )
|
||||
endif
|
||||
|
||||
" Check for potential argument list on next line
|
||||
let continuation = (line =~ '[A-Za-z0-9_]\s*$')
|
||||
|
||||
|
||||
" Check current line; search for simplistic matching start-of-block
|
||||
let line = getline(v:lnum)
|
||||
if line =~ '^\s*#'
|
||||
" Start of line for ada-pp
|
||||
let ind = 0
|
||||
elseif continuation && line =~ '^\s*('
|
||||
" Don't do this if we've already indented due to the previous line
|
||||
if ind == initind
|
||||
let ind = ind + shiftwidth()
|
||||
endif
|
||||
elseif line =~ '^\s*\(begin\|is\)\>'
|
||||
let ind = s:MainBlockIndent( ind, lnum, '\(procedure\|function\|declare\|package\|task\)\>', 'begin\>' )
|
||||
elseif line =~ '^\s*record\>'
|
||||
let ind = s:MainBlockIndent( ind, lnum, 'type\>\|for\>.*\<use\>', '' ) + shiftwidth()
|
||||
elseif line =~ '^\s*\(else\|elsif\)\>'
|
||||
let ind = s:MainBlockIndent( ind, lnum, 'if\>', '' )
|
||||
elseif line =~ '^\s*when\>'
|
||||
" Align 'when' one /in/ from matching block start
|
||||
let ind = s:MainBlockIndent( ind, lnum, '\(case\|exception\)\>', '' ) + shiftwidth()
|
||||
elseif line =~ '^\s*end\>\s*\<if\>'
|
||||
" End of if statements
|
||||
let ind = s:EndBlockIndent( ind, lnum, 'if\>', 'end\>\s*\<if\>' )
|
||||
elseif line =~ '^\s*end\>\s*\<loop\>'
|
||||
" End of loops
|
||||
let ind = s:EndBlockIndent( ind, lnum, '\(\(while\|for\)\>.*\)\?\<loop\>', 'end\>\s*\<loop\>' )
|
||||
elseif line =~ '^\s*end\>\s*\<record\>'
|
||||
" End of records
|
||||
let ind = s:EndBlockIndent( ind, lnum, '\(type\>.*\)\=\<record\>', 'end\>\s*\<record\>' )
|
||||
elseif line =~ '^\s*end\>\s*\<procedure\>'
|
||||
" End of procedures
|
||||
let ind = s:EndBlockIndent( ind, lnum, 'procedure\>.*\<is\>', 'end\>\s*\<procedure\>' )
|
||||
elseif line =~ '^\s*end\>\s*\<case\>'
|
||||
" End of case statement
|
||||
let ind = s:EndBlockIndent( ind, lnum, 'case\>.*\<is\>', 'end\>\s*\<case\>' )
|
||||
elseif line =~ '^\s*end\>'
|
||||
" General case for end
|
||||
let ind = s:MainBlockIndent( ind, lnum, '\(if\|while\|for\|loop\|accept\|begin\|record\|case\|exception\|package\)\>', '' )
|
||||
elseif line =~ '^\s*exception\>'
|
||||
let ind = s:MainBlockIndent( ind, lnum, 'begin\>', '' )
|
||||
elseif line =~ '^\s*then\>'
|
||||
let ind = s:MainBlockIndent( ind, lnum, 'if\>', '' )
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction GetAdaIndent
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
finish " 1}}}
|
||||
|
||||
"------------------------------------------------------------------------------
|
||||
" Copyright (C) 2006 Martin Krischik
|
||||
"
|
||||
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
|
||||
"------------------------------------------------------------------------------
|
||||
" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
|
||||
" vim: foldmethod=marker
|
||||
|
||||
endif
|
||||
16
indent/ant.vim
Normal file
16
indent/ant.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ant') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: ANT files
|
||||
" Maintainer: David Fishburn <fishburn@ianywhere.com>
|
||||
" Last Change: Thu May 15 2003 10:02:54 PM
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Use XML formatting rules
|
||||
runtime! indent/xml.vim
|
||||
|
||||
endif
|
||||
15
indent/automake.vim
Normal file
15
indent/automake.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'automake') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: automake
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2006-04-19
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
" same as makefile indenting for now.
|
||||
runtime! indent/make.vim
|
||||
|
||||
endif
|
||||
236
indent/awk.vim
Normal file
236
indent/awk.vim
Normal file
@@ -0,0 +1,236 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'awk') == -1
|
||||
|
||||
" vim: set sw=3 sts=3:
|
||||
|
||||
" Awk indent script. It can handle multi-line statements and expressions.
|
||||
" It works up to the point where the distinction between correct/incorrect
|
||||
" and personal taste gets fuzzy. Drop me an e-mail for bug reports and
|
||||
" reasonable style suggestions.
|
||||
"
|
||||
" Bugs:
|
||||
" =====
|
||||
" - Some syntax errors may cause erratic indentation.
|
||||
" - Same for very unusual but syntacticly correct use of { }
|
||||
" - In some cases it's confused by the use of ( and { in strings constants
|
||||
" - This version likes the closing brace of a multiline pattern-action be on
|
||||
" character position 1 before the following pattern-action combination is
|
||||
" formatted
|
||||
|
||||
" Author:
|
||||
" =======
|
||||
" Erik Janssen, ejanssen@itmatters.nl
|
||||
"
|
||||
" History:
|
||||
" ========
|
||||
" 26-04-2002 Got initial version working reasonably well
|
||||
" 29-04-2002 Fixed problems in function headers and max line width
|
||||
" Added support for two-line if's without curly braces
|
||||
" Fixed hang: 2011 Aug 31
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetAwkIndent()
|
||||
" Mmm, copied from the tcl indent program. Is this okay?
|
||||
setlocal indentkeys-=:,0#
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetAwkIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
" This function contains a lot of exit points. It checks for simple cases
|
||||
" first to get out of the function as soon as possible, thereby reducing the
|
||||
" number of possibilities later on in the difficult parts
|
||||
|
||||
function! GetAwkIndent()
|
||||
|
||||
" Find previous line and get its indentation
|
||||
let prev_lineno = s:Get_prev_line( v:lnum )
|
||||
if prev_lineno == 0
|
||||
return 0
|
||||
endif
|
||||
let prev_data = getline( prev_lineno )
|
||||
let ind = indent( prev_lineno )
|
||||
|
||||
" Increase indent if the previous line contains an opening brace. Search
|
||||
" for this brace the hard way to prevent errors if the previous line is a
|
||||
" 'pattern { action }' (simple check match on /{/ increases the indent then)
|
||||
|
||||
if s:Get_brace_balance( prev_data, '{', '}' ) > 0
|
||||
return ind + shiftwidth()
|
||||
endif
|
||||
|
||||
let brace_balance = s:Get_brace_balance( prev_data, '(', ')' )
|
||||
|
||||
" If prev line has positive brace_balance and starts with a word (keyword
|
||||
" or function name), align the current line on the first '(' of the prev
|
||||
" line
|
||||
|
||||
if brace_balance > 0 && s:Starts_with_word( prev_data )
|
||||
return s:Safe_indent( ind, s:First_word_len(prev_data), getline(v:lnum))
|
||||
endif
|
||||
|
||||
" If this line starts with an open brace bail out now before the line
|
||||
" continuation checks.
|
||||
|
||||
if getline( v:lnum ) =~ '^\s*{'
|
||||
return ind
|
||||
endif
|
||||
|
||||
" If prev line seems to be part of multiline statement:
|
||||
" 1. Prev line is first line of a multiline statement
|
||||
" -> attempt to indent on first ' ' or '(' of prev line, just like we
|
||||
" indented the positive brace balance case above
|
||||
" 2. Prev line is not first line of a multiline statement
|
||||
" -> copy indent of prev line
|
||||
|
||||
let continue_mode = s:Seems_continuing( prev_data )
|
||||
if continue_mode > 0
|
||||
if s:Seems_continuing( getline(s:Get_prev_line( prev_lineno )) )
|
||||
" Case 2
|
||||
return ind
|
||||
else
|
||||
" Case 1
|
||||
if continue_mode == 1
|
||||
" Need continuation due to comma, backslash, etc
|
||||
return s:Safe_indent( ind, s:First_word_len(prev_data), getline(v:lnum))
|
||||
else
|
||||
" if/for/while without '{'
|
||||
return ind + shiftwidth()
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" If the previous line doesn't need continuation on the current line we are
|
||||
" on the start of a new statement. We have to make sure we align with the
|
||||
" previous statement instead of just the previous line. This is a bit
|
||||
" complicated because the previous statement might be multi-line.
|
||||
"
|
||||
" The start of a multiline statement can be found by:
|
||||
"
|
||||
" 1 If the previous line contains closing braces and has negative brace
|
||||
" balance, search backwards until cumulative brace balance becomes zero,
|
||||
" take indent of that line
|
||||
" 2 If the line before the previous needs continuation search backward
|
||||
" until that's not the case anymore. Take indent of one line down.
|
||||
|
||||
" Case 1
|
||||
if prev_data =~ ')' && brace_balance < 0
|
||||
while brace_balance != 0 && prev_lineno > 0
|
||||
let prev_lineno = s:Get_prev_line( prev_lineno )
|
||||
let prev_data = getline( prev_lineno )
|
||||
let brace_balance=brace_balance+s:Get_brace_balance(prev_data,'(',')' )
|
||||
endwhile
|
||||
let ind = indent( prev_lineno )
|
||||
else
|
||||
" Case 2
|
||||
if s:Seems_continuing( getline( prev_lineno - 1 ) )
|
||||
let prev_lineno = prev_lineno - 2
|
||||
let prev_data = getline( prev_lineno )
|
||||
while prev_lineno > 0 && (s:Seems_continuing( prev_data ) > 0)
|
||||
let prev_lineno = s:Get_prev_line( prev_lineno )
|
||||
let prev_data = getline( prev_lineno )
|
||||
endwhile
|
||||
let ind = indent( prev_lineno + 1 )
|
||||
endif
|
||||
endif
|
||||
|
||||
" Decrease indent if this line contains a '}'.
|
||||
if getline(v:lnum) =~ '^\s*}'
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
" Find the open and close braces in this line and return how many more open-
|
||||
" than close braces there are. It's also used to determine cumulative balance
|
||||
" across multiple lines.
|
||||
|
||||
function! s:Get_brace_balance( line, b_open, b_close )
|
||||
let line2 = substitute( a:line, a:b_open, "", "g" )
|
||||
let openb = strlen( a:line ) - strlen( line2 )
|
||||
let line3 = substitute( line2, a:b_close, "", "g" )
|
||||
let closeb = strlen( line2 ) - strlen( line3 )
|
||||
return openb - closeb
|
||||
endfunction
|
||||
|
||||
" Find out whether the line starts with a word (i.e. keyword or function
|
||||
" call). Might need enhancements here.
|
||||
|
||||
function! s:Starts_with_word( line )
|
||||
if a:line =~ '^\s*[a-zA-Z_0-9]\+\s*('
|
||||
return 1
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" Find the length of the first word in a line. This is used to be able to
|
||||
" align a line relative to the 'print ' or 'if (' on the previous line in case
|
||||
" such a statement spans multiple lines.
|
||||
" Precondition: only to be used on lines where 'Starts_with_word' returns 1.
|
||||
|
||||
function! s:First_word_len( line )
|
||||
let white_end = matchend( a:line, '^\s*' )
|
||||
if match( a:line, '^\s*func' ) != -1
|
||||
let word_end = matchend( a:line, '[a-z]\+\s\+[a-zA-Z_0-9]\+[ (]*' )
|
||||
else
|
||||
let word_end = matchend( a:line, '[a-zA-Z_0-9]\+[ (]*' )
|
||||
endif
|
||||
return word_end - white_end
|
||||
endfunction
|
||||
|
||||
" Determine if 'line' completes a statement or is continued on the next line.
|
||||
" This one is far from complete and accepts illegal code. Not important for
|
||||
" indenting, however.
|
||||
|
||||
function! s:Seems_continuing( line )
|
||||
" Unfinished lines
|
||||
if a:line =~ '\(--\|++\)\s*$'
|
||||
return 0
|
||||
endif
|
||||
if a:line =~ '[\\,\|\&\+\-\*\%\^]\s*$'
|
||||
return 1
|
||||
endif
|
||||
" if/for/while (cond) eol
|
||||
if a:line =~ '^\s*\(if\|while\|for\)\s*(.*)\s*$' || a:line =~ '^\s*else\s*'
|
||||
return 2
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" Get previous relevant line. Search back until a line is that is no
|
||||
" comment or blank and return the line number
|
||||
|
||||
function! s:Get_prev_line( lineno )
|
||||
let lnum = a:lineno - 1
|
||||
let data = getline( lnum )
|
||||
while lnum > 0 && (data =~ '^\s*#' || data =~ '^\s*$')
|
||||
let lnum = lnum - 1
|
||||
let data = getline( lnum )
|
||||
endwhile
|
||||
return lnum
|
||||
endfunction
|
||||
|
||||
" This function checks whether an indented line exceeds a maximum linewidth
|
||||
" (hardcoded 80). If so and it is possible to stay within 80 positions (or
|
||||
" limit num of characters beyond linewidth) by decreasing the indent (keeping
|
||||
" it > base_indent), do so.
|
||||
|
||||
function! s:Safe_indent( base, wordlen, this_line )
|
||||
let line_base = matchend( a:this_line, '^\s*' )
|
||||
let line_len = strlen( a:this_line ) - line_base
|
||||
let indent = a:base
|
||||
if (indent + a:wordlen + line_len) > 80
|
||||
" Simple implementation good enough for the time being
|
||||
let indent = indent + 3
|
||||
endif
|
||||
return indent + a:wordlen
|
||||
endfunction
|
||||
|
||||
endif
|
||||
@@ -6,7 +6,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1
|
||||
" Contributors: Edwin Fine <efine145_nospam01 at usa dot net>
|
||||
" Pawel 'kTT' Salata <rockplayer.pl@gmail.com>
|
||||
" Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||
" Last Update: 2017-Feb-28
|
||||
" Last Update: 2020-Jun-11
|
||||
" License: Vim license
|
||||
" URL: https://github.com/vim-erlang/vim-erlang-runtime
|
||||
|
||||
|
||||
@@ -23,18 +23,19 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||
" Language: GraphQL
|
||||
" Maintainer: Jon Parise <jon@indelible.org>
|
||||
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
" Set our local options if indentation hasn't already been set up.
|
||||
" This generally means we've been detected as the primary filetype.
|
||||
if !exists('b:did_indent')
|
||||
setlocal autoindent
|
||||
setlocal nocindent
|
||||
setlocal nolisp
|
||||
setlocal nosmartindent
|
||||
|
||||
setlocal indentexpr=GetGraphQLIndent()
|
||||
setlocal indentkeys=0{,0},0),0[,0],0#,!^F,o,O
|
||||
|
||||
let b:did_indent = 1
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal autoindent
|
||||
setlocal nocindent
|
||||
setlocal nolisp
|
||||
setlocal nosmartindent
|
||||
|
||||
setlocal indentexpr=GetGraphQLIndent()
|
||||
setlocal indentkeys=0{,0},0),0[,0],0#,!^F,o,O
|
||||
|
||||
" If our indentation function already exists, we have nothing more to do.
|
||||
if exists('*GetGraphQLIndent')
|
||||
@@ -44,9 +45,13 @@ endif
|
||||
let s:cpo_save = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
" searchpair() skip expression that matches in comments and strings.
|
||||
let s:pair_skip_expr =
|
||||
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "comment\\|string"'
|
||||
|
||||
" Check if the character at lnum:col is inside a string.
|
||||
function s:InString(lnum, col)
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') is# 'graphqlString'
|
||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') ==# 'graphqlString'
|
||||
endfunction
|
||||
|
||||
function GetGraphQLIndent()
|
||||
@@ -60,18 +65,18 @@ function GetGraphQLIndent()
|
||||
let l:line = getline(v:lnum)
|
||||
|
||||
" If this line contains just a closing bracket, find its matching opening
|
||||
" bracket and indent the closing backet to match.
|
||||
" bracket and indent the closing bracket to match.
|
||||
let l:col = matchend(l:line, '^\s*[]})]')
|
||||
if l:col > 0 && !s:InString(v:lnum, l:col)
|
||||
let l:bracket = l:line[l:col - 1]
|
||||
call cursor(v:lnum, l:col)
|
||||
|
||||
if l:bracket is# '}'
|
||||
let l:matched = searchpair('{', '', '}', 'bW')
|
||||
elseif l:bracket is# ']'
|
||||
let l:matched = searchpair('\[', '', '\]', 'bW')
|
||||
elseif l:bracket is# ')'
|
||||
let l:matched = searchpair('(', '', ')', 'bW')
|
||||
let l:bracket = l:line[l:col - 1]
|
||||
if l:bracket ==# '}'
|
||||
let l:matched = searchpair('{', '', '}', 'bW', s:pair_skip_expr)
|
||||
elseif l:bracket ==# ']'
|
||||
let l:matched = searchpair('\[', '', '\]', 'bW', s:pair_skip_expr)
|
||||
elseif l:bracket ==# ')'
|
||||
let l:matched = searchpair('(', '', ')', 'bW', s:pair_skip_expr)
|
||||
else
|
||||
let l:matched = -1
|
||||
endif
|
||||
@@ -84,9 +89,8 @@ function GetGraphQLIndent()
|
||||
return indent(v:lnum)
|
||||
endif
|
||||
|
||||
" If the previous line contained an opening bracket, and we are still in it,
|
||||
" add indent depending on the bracket type.
|
||||
if getline(l:prevlnum) =~# '[[{(]\s*$'
|
||||
" If the previous line ended with an opening bracket, indent this line.
|
||||
if getline(l:prevlnum) =~# '\%(#.*\)\@<![[{(]\s*$'
|
||||
return indent(l:prevlnum) + shiftwidth()
|
||||
endif
|
||||
|
||||
|
||||
148
indent/idris2.vim
Normal file
148
indent/idris2.vim
Normal file
@@ -0,0 +1,148 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'idris2') == -1
|
||||
|
||||
" indentation for idris (idris-lang.org)
|
||||
"
|
||||
" Based on haskell indentation by motemen <motemen@gmail.com>
|
||||
"
|
||||
" author: raichoo (raichoo@googlemail.com)
|
||||
"
|
||||
" Modify g:idris_indent_if and g:idris_indent_case to
|
||||
" change indentation for `if'(default 3) and `case'(default 5).
|
||||
" Example (in .vimrc):
|
||||
" > let g:idris_indent_if = 2
|
||||
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
if !exists('g:idris_indent_if')
|
||||
" if bool
|
||||
" >>>then ...
|
||||
" >>>else ...
|
||||
let g:idris_indent_if = 3
|
||||
endif
|
||||
|
||||
if !exists('g:idris_indent_case')
|
||||
" case xs of
|
||||
" >>>>>[] => ...
|
||||
" >>>>>(y::ys) => ...
|
||||
let g:idris_indent_case = 5
|
||||
endif
|
||||
|
||||
if !exists('g:idris_indent_let')
|
||||
" let x : Nat = O in
|
||||
" >>>>x
|
||||
let g:idris_indent_let = 4
|
||||
endif
|
||||
|
||||
if !exists('g:idris_indent_rewrite')
|
||||
" rewrite prf in expr
|
||||
" >>>>>>>>x
|
||||
let g:idris_indent_rewrite = 8
|
||||
endif
|
||||
|
||||
if !exists('g:idris_indent_where')
|
||||
" where f : Nat -> Nat
|
||||
" >>>>>>f x = x
|
||||
let g:idris_indent_where = 6
|
||||
endif
|
||||
|
||||
if !exists('g:idris_indent_do')
|
||||
" do x <- a
|
||||
" >>>y <- b
|
||||
let g:idris_indent_do = 3
|
||||
endif
|
||||
|
||||
setlocal indentexpr=GetIdrisIndent()
|
||||
setlocal indentkeys=!^F,o,O,}
|
||||
|
||||
function! GetIdrisIndent()
|
||||
let prevline = getline(v:lnum - 1)
|
||||
|
||||
if prevline =~ '\s\+(\s*.\+\s\+:\s\+.\+\s*)\s\+->\s*$'
|
||||
return match(prevline, '(')
|
||||
elseif prevline =~ '\s\+{\s*.\+\s\+:\s\+.\+\s*}\s\+->\s*$'
|
||||
return match(prevline, '{')
|
||||
endif
|
||||
|
||||
if prevline =~ '[!#$%&*+./<>?@\\^|~-]\s*$'
|
||||
let s = match(prevline, '[:=]')
|
||||
if s > 0
|
||||
return s + 2
|
||||
else
|
||||
return match(prevline, '\S')
|
||||
endif
|
||||
endif
|
||||
|
||||
if prevline =~ '[{([][^})\]]\+$'
|
||||
return match(prevline, '[{([]')
|
||||
endif
|
||||
|
||||
if prevline =~ '\<let\>\s\+.\+\<in\>\s*$'
|
||||
return match(prevline, '\<let\>') + g:idris_indent_let
|
||||
endif
|
||||
|
||||
if prevline =~ '\<rewrite\>\s\+.\+\<in\>\s*$'
|
||||
return match(prevline, '\<rewrite\>') + g:idris_indent_rewrite
|
||||
endif
|
||||
|
||||
if prevline !~ '\<else\>'
|
||||
let s = match(prevline, '\<if\>.*\&.*\zs\<then\>')
|
||||
if s > 0
|
||||
return s
|
||||
endif
|
||||
|
||||
let s = match(prevline, '\<if\>')
|
||||
if s > 0
|
||||
return s + g:idris_indent_if
|
||||
endif
|
||||
endif
|
||||
|
||||
if prevline =~ '\(\<where\>\|\<do\>\|=\|[{([]\)\s*$'
|
||||
return match(prevline, '\S') + &shiftwidth
|
||||
endif
|
||||
|
||||
if prevline =~ '\<where\>\s\+\S\+.*$'
|
||||
return match(prevline, '\<where\>') + g:idris_indent_where
|
||||
endif
|
||||
|
||||
if prevline =~ '\<do\>\s\+\S\+.*$'
|
||||
return match(prevline, '\<do\>') + g:idris_indent_do
|
||||
endif
|
||||
|
||||
if prevline =~ '^\s*\<\(co\)\?data\>\s\+[^=]\+\s\+=\s\+\S\+.*$'
|
||||
return match(prevline, '=')
|
||||
endif
|
||||
|
||||
if prevline =~ '\<with\>\s\+([^)]*)\s*$'
|
||||
return match(prevline, '\S') + &shiftwidth
|
||||
endif
|
||||
|
||||
if prevline =~ '\<case\>\s\+.\+\<of\>\s*$'
|
||||
return match(prevline, '\<case\>') + g:idris_indent_case
|
||||
endif
|
||||
|
||||
if prevline =~ '^\s*\(\<namespace\>\|\<\(co\)\?data\>\)\s\+\S\+\s*$'
|
||||
return match(prevline, '\(\<namespace\>\|\<\(co\)\?data\>\)') + &shiftwidth
|
||||
endif
|
||||
|
||||
if prevline =~ '^\s*\(\<using\>\|\<parameters\>\)\s*([^(]*)\s*$'
|
||||
return match(prevline, '\(\<using\>\|\<parameters\>\)') + &shiftwidth
|
||||
endif
|
||||
|
||||
if prevline =~ '^\s*\<mutual\>\s*$'
|
||||
return match(prevline, '\<mutual\>') + &shiftwidth
|
||||
endif
|
||||
|
||||
let line = getline(v:lnum)
|
||||
|
||||
if (line =~ '^\s*}\s*' && prevline !~ '^\s*;')
|
||||
return match(prevline, '\S') - &shiftwidth
|
||||
endif
|
||||
|
||||
return match(prevline, '\S')
|
||||
endfunction
|
||||
|
||||
endif
|
||||
41
indent/odin.vim
Normal file
41
indent/odin.vim
Normal file
@@ -0,0 +1,41 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'odin') == -1
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal nosmartindent
|
||||
setlocal nolisp
|
||||
setlocal autoindent
|
||||
|
||||
setlocal indentexpr=GetOdinIndent(v:lnum)
|
||||
|
||||
if exists("*GetOdinIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
function! GetOdinIndent(lnum)
|
||||
let prev = prevnonblank(a:lnum-1)
|
||||
|
||||
if prev == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let prevline = getline(prev)
|
||||
let line = getline(a:lnum)
|
||||
|
||||
let ind = indent(prev)
|
||||
|
||||
if prevline =~ '[({]\s*$'
|
||||
let ind += &sw
|
||||
endif
|
||||
|
||||
if line =~ '^\s*[)}]'
|
||||
let ind -= &sw
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
endif
|
||||
82
indent/vb.vim
Normal file
82
indent/vb.vim
Normal file
@@ -0,0 +1,82 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'visual-basic') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: VisualBasic (ft=vb) / Basic (ft=basic) / SaxBasic (ft=vb)
|
||||
" Author: Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: Fri, 18 Jun 2004 07:22:42 CEST
|
||||
" Small update 2010 Jul 28 by Maxim Kim
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal autoindent
|
||||
setlocal indentexpr=VbGetIndent(v:lnum)
|
||||
setlocal indentkeys&
|
||||
setlocal indentkeys+==~else,=~elseif,=~end,=~wend,=~case,=~next,=~select,=~loop,<:>
|
||||
|
||||
let b:undo_indent = "set ai< indentexpr< indentkeys<"
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*VbGetIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
fun! VbGetIndent(lnum)
|
||||
" labels and preprocessor get zero indent immediately
|
||||
let this_line = getline(a:lnum)
|
||||
let LABELS_OR_PREPROC = '^\s*\(\<\k\+\>:\s*$\|#.*\)'
|
||||
if this_line =~? LABELS_OR_PREPROC
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Find a non-blank line above the current line.
|
||||
" Skip over labels and preprocessor directives.
|
||||
let lnum = a:lnum
|
||||
while lnum > 0
|
||||
let lnum = prevnonblank(lnum - 1)
|
||||
let previous_line = getline(lnum)
|
||||
if previous_line !~? LABELS_OR_PREPROC
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Hit the start of the file, use zero indent.
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ind = indent(lnum)
|
||||
|
||||
" Add
|
||||
if previous_line =~? '^\s*\<\(begin\|\%(\%(private\|public\|friend\)\s\+\)\=\%(function\|sub\|property\)\|select\|case\|default\|if\|else\|elseif\|do\|for\|while\|enum\|with\)\>'
|
||||
let ind = ind + shiftwidth()
|
||||
endif
|
||||
|
||||
" Subtract
|
||||
if this_line =~? '^\s*\<end\>\s\+\<select\>'
|
||||
if previous_line !~? '^\s*\<select\>'
|
||||
let ind = ind - 2 * shiftwidth()
|
||||
else
|
||||
" this case is for an empty 'select' -- 'end select'
|
||||
" (w/o any case statements) like:
|
||||
"
|
||||
" select case readwrite
|
||||
" end select
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
elseif this_line =~? '^\s*\<\(end\|else\|elseif\|until\|loop\|next\|wend\)\>'
|
||||
let ind = ind - shiftwidth()
|
||||
elseif this_line =~? '^\s*\<\(case\|default\)\>'
|
||||
if previous_line !~? '^\s*\<select\>'
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfun
|
||||
|
||||
" vim:sw=4
|
||||
|
||||
endif
|
||||
159
indent/yaml.vim
Normal file
159
indent/yaml.vim
Normal file
@@ -0,0 +1,159 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: YAML
|
||||
" Maintainer: Nikolai Pavlov <zyx.vim@gmail.com>
|
||||
" Last Change: 2019 Sep 28
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetYAMLIndent(v:lnum)
|
||||
setlocal indentkeys=!^F,o,O,0#,0},0],<:>,0-
|
||||
setlocal nosmartindent
|
||||
|
||||
let b:undo_indent = 'setlocal indentexpr< indentkeys< smartindent<'
|
||||
|
||||
" Only define the function once.
|
||||
if exists('*GetYAMLIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
function s:FindPrevLessIndentedLine(lnum, ...)
|
||||
let prevlnum = prevnonblank(a:lnum-1)
|
||||
let curindent = a:0 ? a:1 : indent(a:lnum)
|
||||
while prevlnum
|
||||
\&& indent(prevlnum) >= curindent
|
||||
\&& getline(prevlnum) !~# '^\s*#'
|
||||
let prevlnum = prevnonblank(prevlnum-1)
|
||||
endwhile
|
||||
return prevlnum
|
||||
endfunction
|
||||
|
||||
function s:FindPrevLEIndentedLineMatchingRegex(lnum, regex)
|
||||
let plilnum = s:FindPrevLessIndentedLine(a:lnum, indent(a:lnum)+1)
|
||||
while plilnum && getline(plilnum) !~# a:regex
|
||||
let plilnum = s:FindPrevLessIndentedLine(plilnum)
|
||||
endwhile
|
||||
return plilnum
|
||||
endfunction
|
||||
|
||||
let s:mapkeyregex='\v^\s*\#@!\S@=%(\''%([^'']|\''\'')*\'''.
|
||||
\ '|\"%([^"\\]|\\.)*\"'.
|
||||
\ '|%(%(\:\ )@!.)*)\:%(\ |$)'
|
||||
let s:liststartregex='\v^\s*%(\-%(\ |$))'
|
||||
|
||||
let s:c_ns_anchor_char = '\v%([\n\r\uFEFF \t,[\]{}]@!\p)'
|
||||
let s:c_ns_anchor_name = s:c_ns_anchor_char.'+'
|
||||
let s:c_ns_anchor_property = '\v\&'.s:c_ns_anchor_name
|
||||
|
||||
let s:ns_word_char = '\v[[:alnum:]_\-]'
|
||||
let s:ns_tag_char = '\v%(%\x\x|'.s:ns_word_char.'|[#/;?:@&=+$.~*''()])'
|
||||
let s:c_named_tag_handle = '\v\!'.s:ns_word_char.'+\!'
|
||||
let s:c_secondary_tag_handle = '\v\!\!'
|
||||
let s:c_primary_tag_handle = '\v\!'
|
||||
let s:c_tag_handle = '\v%('.s:c_named_tag_handle.
|
||||
\ '|'.s:c_secondary_tag_handle.
|
||||
\ '|'.s:c_primary_tag_handle.')'
|
||||
let s:c_ns_shorthand_tag = '\v'.s:c_tag_handle . s:ns_tag_char.'+'
|
||||
let s:c_non_specific_tag = '\v\!'
|
||||
let s:ns_uri_char = '\v%(%\x\x|'.s:ns_word_char.'\v|[#/;?:@&=+$,.!~*''()[\]])'
|
||||
let s:c_verbatim_tag = '\v\!\<'.s:ns_uri_char.'+\>'
|
||||
let s:c_ns_tag_property = '\v'.s:c_verbatim_tag.
|
||||
\ '\v|'.s:c_ns_shorthand_tag.
|
||||
\ '\v|'.s:c_non_specific_tag
|
||||
|
||||
let s:block_scalar_header = '\v[|>]%([+-]?[1-9]|[1-9]?[+-])?'
|
||||
|
||||
function GetYAMLIndent(lnum)
|
||||
if a:lnum == 1 || !prevnonblank(a:lnum-1)
|
||||
return 0
|
||||
endif
|
||||
|
||||
let prevlnum = prevnonblank(a:lnum-1)
|
||||
let previndent = indent(prevlnum)
|
||||
|
||||
let line = getline(a:lnum)
|
||||
if line =~# '^\s*#' && getline(a:lnum-1) =~# '^\s*#'
|
||||
" Comment blocks should have identical indent
|
||||
return previndent
|
||||
elseif line =~# '^\s*[\]}]'
|
||||
" Lines containing only closing braces should have previous indent
|
||||
return indent(s:FindPrevLessIndentedLine(a:lnum))
|
||||
endif
|
||||
|
||||
" Ignore comment lines when calculating indent
|
||||
while getline(prevlnum) =~# '^\s*#'
|
||||
let prevlnum = prevnonblank(prevlnum-1)
|
||||
if !prevlnum
|
||||
return previndent
|
||||
endif
|
||||
endwhile
|
||||
|
||||
let prevline = getline(prevlnum)
|
||||
let previndent = indent(prevlnum)
|
||||
|
||||
" Any examples below assume that shiftwidth=2
|
||||
if prevline =~# '\v[{[:]$|[:-]\ [|>][+\-]?%(\s+\#.*|\s*)$'
|
||||
" Mapping key:
|
||||
" nested mapping: ...
|
||||
"
|
||||
" - {
|
||||
" key: [
|
||||
" list value
|
||||
" ]
|
||||
" }
|
||||
"
|
||||
" - |-
|
||||
" Block scalar without indentation indicator
|
||||
return previndent+shiftwidth()
|
||||
elseif prevline =~# '\v[:-]\ [|>]%(\d+[+\-]?|[+\-]?\d+)%(\#.*|\s*)$'
|
||||
" - |+2
|
||||
" block scalar with indentation indicator
|
||||
"#^^ indent+2, not indent+shiftwidth
|
||||
return previndent + str2nr(matchstr(prevline,
|
||||
\'\v([:-]\ [|>])@<=[+\-]?\d+%([+\-]?%(\s+\#.*|\s*)$)@='))
|
||||
elseif prevline =~# '\v\"%([^"\\]|\\.)*\\$'
|
||||
" "Multiline string \
|
||||
" with escaped end"
|
||||
let qidx = match(prevline, '\v\"%([^"\\]|\\.)*\\')
|
||||
return virtcol([prevlnum, qidx+1])
|
||||
elseif line =~# s:liststartregex
|
||||
" List line should have indent equal to previous list line unless it was
|
||||
" caught by one of the previous rules
|
||||
return indent(s:FindPrevLEIndentedLineMatchingRegex(a:lnum,
|
||||
\ s:liststartregex))
|
||||
elseif line =~# s:mapkeyregex
|
||||
" Same for line containing mapping key
|
||||
let prevmapline = s:FindPrevLEIndentedLineMatchingRegex(a:lnum,
|
||||
\ s:mapkeyregex)
|
||||
if getline(prevmapline) =~# '^\s*- '
|
||||
return indent(prevmapline) + 2
|
||||
else
|
||||
return indent(prevmapline)
|
||||
endif
|
||||
elseif prevline =~# '^\s*- '
|
||||
" - List with
|
||||
" multiline scalar
|
||||
return previndent+2
|
||||
elseif prevline =~# s:mapkeyregex . '\v\s*%(%('.s:c_ns_tag_property.
|
||||
\ '\v|'.s:c_ns_anchor_property.
|
||||
\ '\v|'.s:block_scalar_header.
|
||||
\ '\v)%(\s+|\s*%(\#.*)?$))*'
|
||||
" Mapping with: value
|
||||
" that is multiline scalar
|
||||
return previndent+shiftwidth()
|
||||
endif
|
||||
return previndent
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
|
||||
endif
|
||||
551
packages.yaml
551
packages.yaml
@@ -1,4 +1,81 @@
|
||||
---
|
||||
name: 8th
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/8th.vim'
|
||||
filetypes:
|
||||
- name: 8th
|
||||
extensions:
|
||||
- 8th
|
||||
---
|
||||
name: a2ps
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/a2ps.vim'
|
||||
after:
|
||||
- haproxy
|
||||
filetypes:
|
||||
- name: a2ps
|
||||
filenames:
|
||||
- '*/etc/a2ps.cfg'
|
||||
- '*/etc/a2ps/*.cfg'
|
||||
- a2psrc
|
||||
- .a2psrc
|
||||
---
|
||||
name: a65
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/a65.vim'
|
||||
filetypes:
|
||||
- name: a65
|
||||
extensions:
|
||||
- a65
|
||||
---
|
||||
name: aap
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/aap.vim'
|
||||
filetypes:
|
||||
- name: aap
|
||||
extensions:
|
||||
- aap
|
||||
---
|
||||
name: abap
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/abap.vim'
|
||||
filetypes:
|
||||
- name: abap
|
||||
extensions:
|
||||
- abap
|
||||
---
|
||||
name: abaqus
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/abaqus.vim'
|
||||
filetypes:
|
||||
- name: abaqus
|
||||
extensions:
|
||||
- inp
|
||||
---
|
||||
name: abc
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/abc.vim'
|
||||
filetypes:
|
||||
- name: abc
|
||||
extensions:
|
||||
- abc
|
||||
---
|
||||
name: abel
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/abel.vim'
|
||||
filetypes:
|
||||
- name: abel
|
||||
extensions:
|
||||
- abl
|
||||
---
|
||||
name: acedb
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/acedb.vim'
|
||||
filetypes:
|
||||
- name: acedb
|
||||
extensions:
|
||||
- wrm
|
||||
---
|
||||
name: acpiasl
|
||||
remote: martinlroth/vim-acpi-asl
|
||||
filetypes:
|
||||
@@ -7,6 +84,90 @@ filetypes:
|
||||
- asl
|
||||
- dsl
|
||||
---
|
||||
name: ada
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/ada.vim'
|
||||
filetypes:
|
||||
- name: ada
|
||||
extensions:
|
||||
- adb
|
||||
- ads
|
||||
- ada
|
||||
- adc
|
||||
- gpr
|
||||
- ada_m
|
||||
---
|
||||
name: ahdl
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/ahdl.vim'
|
||||
filetypes:
|
||||
- name: ahdl
|
||||
extensions:
|
||||
- tdf
|
||||
---
|
||||
name: aidl
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/aidl.vim'
|
||||
filetypes:
|
||||
- name: aidl
|
||||
extensions:
|
||||
- aidl
|
||||
---
|
||||
name: alsaconf
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/alsaconf.vim'
|
||||
filetypes:
|
||||
- name: alsaconf
|
||||
filenames:
|
||||
- .asoundrc
|
||||
- '*/usr/share/alsa/alsa.conf'
|
||||
- '*/etc/asound.conf'
|
||||
---
|
||||
name: aml
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/aml.vim'
|
||||
filetypes:
|
||||
- name: aml
|
||||
extensions:
|
||||
- aml
|
||||
---
|
||||
name: ampl
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/ampl.vim'
|
||||
filetypes:
|
||||
- name: ampl
|
||||
extensions:
|
||||
- run
|
||||
---
|
||||
name: ant
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/ant.vim'
|
||||
after: xml
|
||||
filetypes:
|
||||
- name: ant
|
||||
filenames:
|
||||
- build.xml
|
||||
---
|
||||
name: apache
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/apache.vim'
|
||||
filetypes:
|
||||
- name: apache
|
||||
filenames:
|
||||
- .htaccess
|
||||
- '*/etc/httpd/*.conf'
|
||||
- '*/etc/apache2/sites-*/*.com'
|
||||
- 'access.conf*'
|
||||
- 'apache.conf*'
|
||||
- 'apache2.conf*'
|
||||
- 'httpd.conf*'
|
||||
- 'srm.conf*'
|
||||
- '*/etc/apache2/*.conf*'
|
||||
- '*/etc/apache2/conf.*/*'
|
||||
- '*/etc/apache2/mods-*/*'
|
||||
- '*/etc/apache2/sites-*/*'
|
||||
- '*/etc/httpd/conf.d/*.conf*'
|
||||
---
|
||||
name: apiblueprint
|
||||
remote: sheerun/apiblueprint.vim
|
||||
filetypes:
|
||||
@@ -15,19 +176,55 @@ filetypes:
|
||||
---
|
||||
name: applescript
|
||||
remote: mityu/vim-applescript
|
||||
dirs: :syntax
|
||||
dirs:
|
||||
- syntax
|
||||
- indent
|
||||
filetypes:
|
||||
- name: applescript
|
||||
linguist: AppleScript
|
||||
---
|
||||
name: aptconf
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/aptconf.vim'
|
||||
filetypes:
|
||||
- name: aptconf
|
||||
filenames:
|
||||
- apt.conf
|
||||
- '*/.aptitude/config'
|
||||
- '*/etc/apt/apt.conf.d/[^.]*'
|
||||
- '*/etc/apt/apt.conf.d/*.conf'
|
||||
ignored_warnings:
|
||||
# some kind of bugs in filetype detection algorithm
|
||||
- '*/etc/apt/apt.conf.d/{[-_[:alnum:]]\+,[-_.[:alnum:]]\+.conf}'
|
||||
- '*/etc/apt/apt.conf.d/]\+'
|
||||
- '*/etc/apt/apt.conf.d/]\+.conf'
|
||||
---
|
||||
name: arch
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/arch.vim'
|
||||
filetypes:
|
||||
- name: arch
|
||||
filenames:
|
||||
- .arch-inventory
|
||||
- =tagging-method
|
||||
---
|
||||
name: arduino
|
||||
remote: sudar/vim-arduino-syntax
|
||||
after: c/c++
|
||||
filetypes:
|
||||
- name: arduino
|
||||
linguist: Processing
|
||||
extra_extensions:
|
||||
- ino
|
||||
---
|
||||
name: art
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/art.vim'
|
||||
filetypes:
|
||||
- name: art
|
||||
extensions:
|
||||
- art
|
||||
---
|
||||
name: asciidoc
|
||||
remote: asciidoc/vim-asciidoc
|
||||
filetypes:
|
||||
@@ -40,21 +237,106 @@ filetypes:
|
||||
- name: autohotkey
|
||||
linguist: AutoHotkey
|
||||
---
|
||||
name: automake
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/automake.vim'
|
||||
after: elf
|
||||
filetypes:
|
||||
- name: automake
|
||||
filenames:
|
||||
- '[Mm]akefile.am'
|
||||
- GNUmakefile.am
|
||||
---
|
||||
name: asn
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/asn.vim'
|
||||
filetypes:
|
||||
- name: asn
|
||||
extensions:
|
||||
- asn
|
||||
- asn1
|
||||
---
|
||||
name: aspvbs
|
||||
remote: vim/vim:runtime
|
||||
globs:
|
||||
- '**/aspvbs.vim'
|
||||
dependencies:
|
||||
filetypes:
|
||||
- name: aspvbs
|
||||
extensions:
|
||||
- asa
|
||||
- asp
|
||||
---
|
||||
name: aspperl
|
||||
remote: vim/vim:runtime
|
||||
globs:
|
||||
- '**/aspperl.vim'
|
||||
dependencies:
|
||||
filetypes:
|
||||
- name: aspperl
|
||||
extensions:
|
||||
- asp
|
||||
---
|
||||
name: atlas
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/atlas.vim'
|
||||
filetypes:
|
||||
- name: atlas
|
||||
extensions:
|
||||
- atl
|
||||
- as
|
||||
---
|
||||
name: autoit
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/autoit.vim'
|
||||
filetypes:
|
||||
- name: autoit
|
||||
extensions:
|
||||
- au3
|
||||
---
|
||||
name: ave
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/ave.vim'
|
||||
filetypes:
|
||||
- name: ave
|
||||
extensions:
|
||||
- ave
|
||||
---
|
||||
name: awk
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/awk.vim'
|
||||
filetypes:
|
||||
- name: awk
|
||||
extensions:
|
||||
- awk
|
||||
- gawk
|
||||
---
|
||||
name: c/c++
|
||||
remote: vim-jp/vim-cpp
|
||||
filetypes:
|
||||
- name: c
|
||||
linguist: C
|
||||
- name: cpp
|
||||
linguist: C++
|
||||
extra_extensions:
|
||||
- moc
|
||||
# TLH files are C++ headers generated by Visual C++'s #import from typelibs
|
||||
- tlh
|
||||
ignored_extensions:
|
||||
# conflicts with more popular reason, remove after heuristics work
|
||||
- re
|
||||
---
|
||||
name: c++11
|
||||
remote: octol/vim-cpp-enhanced-highlight
|
||||
# It just adds after files for c / c++
|
||||
filetypes: []
|
||||
# implemented by arduino
|
||||
- ino
|
||||
ignored_warnings:
|
||||
# TODO: fix these
|
||||
- C
|
||||
- H
|
||||
- name: c
|
||||
linguist: C
|
||||
extra_extensions:
|
||||
# Quake C
|
||||
- qc
|
||||
extra_filenames:
|
||||
# Enlightenment configuration file
|
||||
- '*enlightenment/*.cfg'
|
||||
---
|
||||
name: caddyfile
|
||||
remote: isobit/vim-caddyfile
|
||||
@@ -98,14 +380,13 @@ filetypes:
|
||||
extra_extensions:
|
||||
# 17 results: https://github.com/search?q=extension%3Acoffeekup+html&type=Code
|
||||
- coffeekup
|
||||
ignored_extensions:
|
||||
ignored_warnings:
|
||||
# Probably mistake
|
||||
- '*Cakefile'
|
||||
# Used by C#
|
||||
- csx
|
||||
# Used by Chuck
|
||||
- ck
|
||||
ignored_filenames:
|
||||
# Probably mistake
|
||||
- '*Cakefile'
|
||||
- name: litcoffee
|
||||
linguist: Literate CoffeeScript
|
||||
extra_extensions:
|
||||
@@ -145,7 +426,7 @@ filetypes:
|
||||
extra_extensions:
|
||||
- tsv
|
||||
- tab
|
||||
ignored_extensions:
|
||||
ignored_warnings:
|
||||
# This is definitely not csv-only, maybe re-enable when heuristics done
|
||||
- dat
|
||||
---
|
||||
@@ -170,6 +451,8 @@ remote: dart-lang/dart-vim-plugin
|
||||
filetypes:
|
||||
- name: dart
|
||||
linguist: Dart
|
||||
extra_extensions:
|
||||
- drt
|
||||
---
|
||||
name: dhall
|
||||
remote: vmchale/dhall-vim
|
||||
@@ -183,19 +466,15 @@ filetypes:
|
||||
- name: d
|
||||
linguist: D
|
||||
- name: dcov
|
||||
linguist: D
|
||||
extensions:
|
||||
- lst
|
||||
- name: dd
|
||||
linguist: D
|
||||
extensions:
|
||||
- dd
|
||||
- name: ddoc
|
||||
linguist: D
|
||||
extensions:
|
||||
- ddoc
|
||||
- name: dsdl
|
||||
linguist: D
|
||||
extensions:
|
||||
- sdl
|
||||
---
|
||||
@@ -214,11 +493,19 @@ filetypes:
|
||||
filenames:
|
||||
- 'docker-compose*.yaml'
|
||||
- 'docker-compose*.yml'
|
||||
ignored_filenames:
|
||||
ignored_warnings:
|
||||
# Probably mistakes?
|
||||
- 'docker-compose*.yaml*'
|
||||
- 'docker-compose*.yml*'
|
||||
---
|
||||
name: elf
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/elf.vim'
|
||||
filetypes:
|
||||
- name: elf
|
||||
extensions:
|
||||
- am
|
||||
---
|
||||
name: elixir
|
||||
remote: elixir-lang/vim-elixir
|
||||
filetypes:
|
||||
@@ -247,8 +534,7 @@ filetypes:
|
||||
- name: emblem
|
||||
extensions:
|
||||
- emblem
|
||||
extra_extensions:
|
||||
- em
|
||||
- em
|
||||
---
|
||||
name: erlang
|
||||
remote: vim-erlang/vim-erlang-runtime
|
||||
@@ -288,17 +574,30 @@ filetypes:
|
||||
extensions:
|
||||
- fbs
|
||||
---
|
||||
name: forth
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/forth.vim'
|
||||
filetypes:
|
||||
- name: forth
|
||||
extensions:
|
||||
- fs
|
||||
- ft
|
||||
- fth
|
||||
---
|
||||
name: fsharp
|
||||
remote: ionide/Ionide-vim
|
||||
ignored_dirs:
|
||||
- ftplugin
|
||||
after: glsl
|
||||
filetypes:
|
||||
- name: fsharp
|
||||
linguist: F#
|
||||
---
|
||||
name: gdscript
|
||||
remote: calviken/vim-gdscript3
|
||||
dirs: :syntax
|
||||
dirs:
|
||||
- syntax
|
||||
- indent
|
||||
filetypes:
|
||||
- name: gdscript3
|
||||
linguist: GDScript
|
||||
@@ -311,16 +610,27 @@ filetypes:
|
||||
extra_filenames:
|
||||
- "*.git/config"
|
||||
- "*/.config/git/config"
|
||||
- "*.git/modules/*/config"
|
||||
- "*/git/config"
|
||||
- "*/{.,}gitconfig.d/*"
|
||||
ignored_warnings:
|
||||
- '/etc/gitconfig'
|
||||
- '$XDG_CONFIG_HOME/git/config'
|
||||
- "*.git/modules/**/config"
|
||||
- '.gitmodules'
|
||||
- "*.git/modules/**/config"
|
||||
- "/etc/gitconfig.d/*"
|
||||
- name: gitrebase
|
||||
filenames:
|
||||
- git-rebase-todo
|
||||
- name: gitsendemail
|
||||
filenames:
|
||||
- ".gitsendemail.*"
|
||||
ignored_warnings:
|
||||
- '.gitsendemail.msg.??????'
|
||||
- name: gitcommit
|
||||
filenames:
|
||||
- 'COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG'
|
||||
ignored_warnings:
|
||||
- '*.git/{,modules/**/,worktrees/*/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG'
|
||||
---
|
||||
name: glsl
|
||||
@@ -346,6 +656,9 @@ remote: vim-scripts/gnuplot-syntax-highlighting
|
||||
filetypes:
|
||||
- name: gnuplot
|
||||
linguist: Gnuplot
|
||||
extra_extensions:
|
||||
# Gnuplot scripts
|
||||
- gpi
|
||||
---
|
||||
name: go
|
||||
remote: fatih/vim-go
|
||||
@@ -366,16 +679,40 @@ filetypes:
|
||||
---
|
||||
name: graphql
|
||||
remote: jparise/vim-graphql
|
||||
dirs: :all
|
||||
after: [javascript, jsx]
|
||||
ignored_dirs:
|
||||
# TODO: remove after bug is fixed:
|
||||
# https://github.com/jparise/vim-graphql/issues/62
|
||||
- after/indent
|
||||
filetypes:
|
||||
- name: graphql
|
||||
linguist: GraphQL
|
||||
---
|
||||
name: gradle
|
||||
remote: tfnico/vim-gradle
|
||||
after: groovy
|
||||
# Just adds compiler
|
||||
filetypes: []
|
||||
---
|
||||
name: groovy
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/groovy.vim'
|
||||
filetypes:
|
||||
- name: groovy
|
||||
linguist: Gradle
|
||||
linguist: Groovy
|
||||
extra_extensions:
|
||||
- gradle
|
||||
---
|
||||
name: grub
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/grub.vim'
|
||||
after: dlang
|
||||
filetypes:
|
||||
- name: grub
|
||||
filenames:
|
||||
- '*/boot/grub/menu.lst'
|
||||
- '*/boot/grub/grub.conf'
|
||||
- '*/etc/grub.conf'
|
||||
---
|
||||
name: haml
|
||||
remote: sheerun/vim-haml
|
||||
@@ -479,6 +816,21 @@ filetypes:
|
||||
extra_filenames:
|
||||
- idris-response
|
||||
---
|
||||
name: idris2
|
||||
remote: edwinb/idris2-vim
|
||||
ignored_dirs:
|
||||
- doc
|
||||
filetypes:
|
||||
- name: idris2
|
||||
extensions:
|
||||
- idr
|
||||
- ipkg
|
||||
filenames:
|
||||
- idris-response
|
||||
- name: lidris2
|
||||
extensions:
|
||||
- lidr
|
||||
---
|
||||
name: ion
|
||||
remote: vmchale/ion-vim
|
||||
filetypes:
|
||||
@@ -493,9 +845,6 @@ remote: pangloss/vim-javascript
|
||||
ignored_dirs:
|
||||
# we don't want eslint compiler, see #521
|
||||
- compiler
|
||||
extra_dirs:
|
||||
# Used by ftplugins there
|
||||
- extras
|
||||
filetypes:
|
||||
- name: javascript
|
||||
linguist: JavaScript
|
||||
@@ -503,6 +852,11 @@ filetypes:
|
||||
extensions:
|
||||
- flow
|
||||
---
|
||||
name: javascript-sql
|
||||
remote: statico/vim-javascript-sql
|
||||
after: javascript
|
||||
filetypes: []
|
||||
---
|
||||
name: jenkins
|
||||
remote: martinda/Jenkinsfile-vim-syntax
|
||||
filetypes:
|
||||
@@ -522,8 +876,10 @@ filetypes:
|
||||
extra_extensions:
|
||||
- j2
|
||||
ignored_extensions:
|
||||
- mustache
|
||||
- njk
|
||||
ignore_warnings:
|
||||
# handled by mustache plugin
|
||||
- mustache
|
||||
---
|
||||
name: jq
|
||||
remote: vito-c/jq.vim
|
||||
@@ -532,7 +888,6 @@ filetypes:
|
||||
linguist: JSONiq
|
||||
extra_filenames:
|
||||
- ".jqrc"
|
||||
ignored_filenames:
|
||||
- ".jqrc*"
|
||||
---
|
||||
name: json5
|
||||
@@ -549,6 +904,8 @@ filetypes:
|
||||
extra_extensions:
|
||||
- jsonp
|
||||
- template
|
||||
extra_filenames:
|
||||
- Pipfile.lock
|
||||
---
|
||||
name: jsonnet
|
||||
remote: google/vim-jsonnet
|
||||
@@ -564,14 +921,14 @@ filetypes:
|
||||
extra_extensions:
|
||||
- jst
|
||||
- ect
|
||||
ignored_extensions:
|
||||
# I haven't found reference to them
|
||||
ignored_warnings:
|
||||
# I haven't found reference to them on github
|
||||
- djs
|
||||
- hamljs
|
||||
---
|
||||
name: jsx
|
||||
remote: MaxMEllon/vim-jsx-pretty
|
||||
dirs: :all
|
||||
after: javascript
|
||||
filetypes:
|
||||
- name: javascriptreact
|
||||
linguist: JSX
|
||||
@@ -635,8 +992,10 @@ filetypes:
|
||||
- name: log
|
||||
extensions:
|
||||
- log
|
||||
- LOG
|
||||
filenames:
|
||||
- '*_log'
|
||||
- '*_LOG'
|
||||
---
|
||||
name: lua
|
||||
remote: tbastos/vim-lua
|
||||
@@ -644,6 +1003,16 @@ filetypes:
|
||||
- name: lua
|
||||
linguist: Lua
|
||||
---
|
||||
name: m4
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/m4.vim'
|
||||
filetypes:
|
||||
- name: m4
|
||||
linguist: M4
|
||||
extra_extensions:
|
||||
# Autotest .at files are actually m4
|
||||
- at
|
||||
---
|
||||
name: mako
|
||||
remote: sophacles/vim-bundle-mako
|
||||
filetypes:
|
||||
@@ -658,6 +1027,7 @@ filetypes:
|
||||
linguist: Mathematica
|
||||
extra_extensions:
|
||||
- wls
|
||||
- mma
|
||||
---
|
||||
name: markdown
|
||||
remote: plasticboy/vim-markdown
|
||||
@@ -670,6 +1040,7 @@ filetypes:
|
||||
ignored_extensions:
|
||||
# Handled by mdx extension
|
||||
- mdx
|
||||
ignored_warnings:
|
||||
- '{md,mdx,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx}'
|
||||
---
|
||||
name: mdx
|
||||
@@ -681,7 +1052,6 @@ filetypes:
|
||||
---
|
||||
name: meson
|
||||
remote: mesonbuild/meson:data/syntax-highlighting/vim
|
||||
dirs: :all
|
||||
filetypes:
|
||||
- name: meson
|
||||
linguist: Meson
|
||||
@@ -695,6 +1065,14 @@ filetypes:
|
||||
- name: moon
|
||||
linguist: MoonScript
|
||||
---
|
||||
name: murphi
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/murphi.vim'
|
||||
filetypes:
|
||||
- name: murphi
|
||||
extensions:
|
||||
- m
|
||||
---
|
||||
name: nginx
|
||||
remote: chr4/nginx.vim
|
||||
filetypes:
|
||||
@@ -779,10 +1157,12 @@ filetypes:
|
||||
---
|
||||
name: octave
|
||||
remote: McSinyx/vim-octave
|
||||
after: mathematica
|
||||
filetypes:
|
||||
- name: octave
|
||||
extensions:
|
||||
- oct
|
||||
- m
|
||||
---
|
||||
name: opencl
|
||||
remote: petRUShka/vim-opencl
|
||||
@@ -796,17 +1176,6 @@ filetypes:
|
||||
- name: perl
|
||||
linguist: Perl
|
||||
---
|
||||
name: sql
|
||||
remote: shmup/vim-sql-syntax
|
||||
filetypes:
|
||||
- name: sql
|
||||
linguist: PLSQL
|
||||
ignored_extensions:
|
||||
# Handled by cql plugin
|
||||
- cql
|
||||
# Handled by pgsql plugin
|
||||
- pgsql
|
||||
---
|
||||
name: pgsql
|
||||
remote: lifepillar/pgsql.vim
|
||||
filetypes:
|
||||
@@ -828,10 +1197,10 @@ remote: StanAngeloff/php.vim
|
||||
filetypes:
|
||||
- name: php
|
||||
linguist: PHP
|
||||
# Needs to be after .php (can be .blade.php)
|
||||
---
|
||||
name: blade
|
||||
remote: jwalton512/vim-blade
|
||||
after: php
|
||||
filetypes:
|
||||
- name: blade
|
||||
linguist: Blade
|
||||
@@ -853,8 +1222,9 @@ filetypes:
|
||||
---
|
||||
name: powershell
|
||||
remote: PProvost/vim-ps1
|
||||
after: xml
|
||||
filetypes:
|
||||
- name: powershell
|
||||
- name: ps1
|
||||
linguist: PowerShell
|
||||
extra_extensions:
|
||||
- pssc
|
||||
@@ -990,6 +1360,7 @@ filetypes:
|
||||
---
|
||||
name: reason
|
||||
remote: reasonml-editor/vim-reason-plus
|
||||
after: c/c++
|
||||
filetypes:
|
||||
- name: reason
|
||||
linguist: Reason
|
||||
@@ -1217,7 +1588,6 @@ filetypes:
|
||||
---
|
||||
name: tmux
|
||||
remote: ericpruitt/tmux.vim:vim
|
||||
dirs: :all
|
||||
filetypes:
|
||||
- name: tmux
|
||||
filenames:
|
||||
@@ -1247,9 +1617,9 @@ remote: lumiliet/vim-twig
|
||||
filetypes:
|
||||
- name: html.twig
|
||||
linguist: Twig
|
||||
ignored_extensions:
|
||||
ignored_warnings:
|
||||
# handled by other extension
|
||||
- xml.twig
|
||||
ignored_extensions:
|
||||
# already covered by .twig
|
||||
- html.twig
|
||||
- name: xml.twig
|
||||
@@ -1266,7 +1636,6 @@ filetypes:
|
||||
---
|
||||
name: unison
|
||||
remote: unisonweb/unison@trunk:editor-support/vim
|
||||
dirs: :all
|
||||
filetypes:
|
||||
- name: unison
|
||||
extensions:
|
||||
@@ -1306,6 +1675,14 @@ filetypes:
|
||||
extensions:
|
||||
- vm
|
||||
---
|
||||
name: vmasm
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/vmasm.vim'
|
||||
filetypes:
|
||||
- name: vmasm
|
||||
extensions:
|
||||
- mar
|
||||
---
|
||||
name: vue
|
||||
remote: posva/vim-vue
|
||||
filetypes:
|
||||
@@ -1339,19 +1716,22 @@ filetypes:
|
||||
linguist: XSLT
|
||||
---
|
||||
name: yaml
|
||||
remote: stephpy/vim-yaml
|
||||
# Fixes indentation issue: https://github.com/vim/vim/issues/6417
|
||||
remote: vim/vim@df44a27b53586fccfc6a3aedc89061fdd9a515ff:runtime
|
||||
glob: '**/yaml.vim'
|
||||
filetypes:
|
||||
- name: yaml
|
||||
linguist: YAML
|
||||
extra_filenames:
|
||||
- fish_history
|
||||
- fish_read_history
|
||||
ignored_filenames:
|
||||
ignored_warnings:
|
||||
- '~/.config/fish/fish_{read_,}history'
|
||||
# Ansible needs to be after YAML
|
||||
---
|
||||
name: ansible
|
||||
remote: pearofducks/ansible-vim
|
||||
after: yaml
|
||||
filetypes:
|
||||
- name: yaml.ansible
|
||||
filenames:
|
||||
@@ -1375,6 +1755,14 @@ filetypes:
|
||||
- "*/templates/*.yaml"
|
||||
- "*/templates/*.tpl"
|
||||
---
|
||||
name: help
|
||||
remote: neovim/neovim:runtime
|
||||
glob: '**/help.vim'
|
||||
filetypes:
|
||||
- name: help
|
||||
filenames:
|
||||
- '$VIMRUNTIME/doc/*.txt'
|
||||
---
|
||||
name: zephir
|
||||
remote: xwsoul/vim-zephir
|
||||
filetypes:
|
||||
@@ -1384,10 +1772,65 @@ filetypes:
|
||||
name: zig
|
||||
remote: ziglang/zig.vim
|
||||
filetypes:
|
||||
- name: zir
|
||||
extensions:
|
||||
- zir
|
||||
- name: zig
|
||||
linguist: Zig
|
||||
extra_extensions:
|
||||
- zir
|
||||
- name: zir
|
||||
---
|
||||
name: trasys
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/trasys.vim'
|
||||
filetypes:
|
||||
- name: trasys
|
||||
extensions:
|
||||
- zir
|
||||
- inp
|
||||
---
|
||||
name: basic
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/basic.vim'
|
||||
filetypes:
|
||||
- name: basic
|
||||
extensions:
|
||||
- basic
|
||||
---
|
||||
name: visual-basic
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/vb.vim'
|
||||
filetypes:
|
||||
- name: vb
|
||||
linguist: VBA
|
||||
extra_extensions:
|
||||
- vbs
|
||||
- dsm
|
||||
- ctl
|
||||
# SaxBasic is close to Visual Basic
|
||||
- sba
|
||||
ignored_warnings:
|
||||
- vb
|
||||
---
|
||||
name: dosini
|
||||
remote: vim/vim:runtime
|
||||
glob: '**/dosini.vim'
|
||||
filetypes:
|
||||
- name: dosini
|
||||
linguist: INI
|
||||
extra_filenames:
|
||||
- .editorconfig
|
||||
- .npmrc
|
||||
- '*/etc/pacman.conf'
|
||||
- 'php.ini-*'
|
||||
- '*/etc/yum.conf'
|
||||
- '*/etc/yum.repos.d/*'
|
||||
ignored_extensions:
|
||||
- cfg
|
||||
ignored_warnings:
|
||||
- php.ini
|
||||
---
|
||||
name: odin
|
||||
remote: Tetralux/odin.vim
|
||||
filetypes:
|
||||
- name: odin
|
||||
linguist: Odin
|
||||
|
||||
3
scripts/Gemfile
Normal file
3
scripts/Gemfile
Normal file
@@ -0,0 +1,3 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "jasherai-oniguruma"
|
||||
738
scripts/build
738
scripts/build
@@ -6,49 +6,96 @@ require 'yaml'
|
||||
require 'fileutils'
|
||||
require 'set'
|
||||
require 'json'
|
||||
require 'tsort'
|
||||
|
||||
Dir.chdir(File.dirname(__dir__))
|
||||
|
||||
PACKAGES = YAML.load_stream(File.read('packages.yaml'))
|
||||
|
||||
BASE_URL = 'https://raw.githubusercontent.com/github/linguist/master'
|
||||
|
||||
DIRS = {
|
||||
default: %w(syntax indent doc compiler autoload ftplugin ctags after/syntax after/indent after/ftplugin),
|
||||
all: %w(syntax indent compiler autoload ftplugin after extras ctags doc),
|
||||
syntax: %w(syntax indent after/syntax after/indent)
|
||||
}
|
||||
|
||||
def parallel(*procs)
|
||||
threads = procs.map { |p| Thread.new { method(p).call } }
|
||||
threads.map(&:join).map(&:value)
|
||||
def camelize(str)
|
||||
str.split(/[-_\.]/).map { |a| a.capitalize }.join("")
|
||||
end
|
||||
|
||||
def read_strings(data, keys, print=false)
|
||||
if data.is_a?(Hash)
|
||||
data.flat_map do |key, val|
|
||||
read_strings(val, keys, keys.include?(key))
|
||||
def except(hash, *keys)
|
||||
h = hash.dup
|
||||
keys.each { |k| h.delete(k) }
|
||||
h
|
||||
end
|
||||
|
||||
def load_data()
|
||||
packages = Hash[YAML.load_stream(File.read('packages.yaml'))
|
||||
.group_by { |a| a.fetch("name") }
|
||||
.map { |a, b| [a, b.first] }]
|
||||
|
||||
deps = Hash.new { |h, k| h[k] = [] }
|
||||
|
||||
each_node = lambda {|&b| packages.keys.each(&b) }
|
||||
each_child = lambda {|n, &b| [packages[n].fetch("after", [])].flatten.each(&b) }
|
||||
|
||||
languages = load_languages
|
||||
|
||||
# Reason can have ocaml as interpreter but let's not depend on it...
|
||||
languages["Reason"]["interpreters"] -= ["ocaml"]
|
||||
|
||||
packages = TSort.tsort(each_node, each_child).map { |a| packages[a] }
|
||||
|
||||
for package in packages
|
||||
for filetype in package["filetypes"]
|
||||
if filetype["linguist"]
|
||||
if filetype["extensions"]
|
||||
raise "#{package["name"]} #{filetype["name"]}: extensions can't be set when linguist is defined"
|
||||
end
|
||||
|
||||
if filetype["filenames"]
|
||||
raise "#{package["name"]} #{filetype["name"]}: filenames can't be set when linguist is defined"
|
||||
end
|
||||
|
||||
linguist = languages.fetch(filetype["linguist"])
|
||||
|
||||
filetype["extensions"] = (linguist["extensions"] || []).map { |e| e[1..-1] } |
|
||||
filetype.fetch("extra_extensions", [])
|
||||
|
||||
extra_ignored_extensions = filetype.fetch("ignored_extensions", []) - filetype["extensions"]
|
||||
if extra_ignored_extensions.size > 0
|
||||
raise StandardError.new("[#{filetype["name"]}]: Unnecessary ignored extensions: #{extra_ignored_extensions.join(", ")}")
|
||||
end
|
||||
|
||||
filetype["extensions"] -= filetype.fetch("ignored_extensions", [])
|
||||
|
||||
filetype["filenames"] = ((
|
||||
(linguist["filenames"] || []) |
|
||||
filetype.fetch("extra_filenames", [])
|
||||
) - filetype.fetch("ignored_filenames", [])).uniq
|
||||
|
||||
filetype["interpreters"] = ((
|
||||
(linguist["interpreters"] || []) |
|
||||
filetype.fetch("extra_interpreters", [])
|
||||
) - filetype.fetch("ignored_interpreters", []).uniq)
|
||||
else
|
||||
filetype["extensions"] ||= []
|
||||
filetype["filenames"] ||= []
|
||||
filetype["interpreters"] ||= []
|
||||
|
||||
filetype.keys.each do |key|
|
||||
if key.start_with?("extra_")
|
||||
raise "[#{filetype["name"]}]: #{key} is not allowed if linguist is not used"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
elsif data.is_a?(Array)
|
||||
data.flat_map { |d| read_strings(d, keys, print) }
|
||||
elsif data.is_a?(String)
|
||||
print ? [data] : []
|
||||
else
|
||||
[]
|
||||
end
|
||||
|
||||
heuristics = YAML.load_stream(File.read('heuristics.yaml'))
|
||||
|
||||
[packages, transform_patterns(heuristics)]
|
||||
end
|
||||
|
||||
def transform_with(data, keys, transfrom=false, &block)
|
||||
if data.is_a?(Hash)
|
||||
Hash[data.map do |key, val|
|
||||
[key, transform_with(val, keys, keys.include?(key), &block)]
|
||||
end]
|
||||
elsif data.is_a?(Array)
|
||||
data.map { |d| transform_with(d, keys, transfrom, &block) }
|
||||
elsif data.is_a?(String)
|
||||
transfrom ? yield(data) : data
|
||||
else
|
||||
data
|
||||
def patterns_to_vim_patterns(patterns)
|
||||
stdin, stdout, stderr = Open3.popen3('vim', '-V', '--clean', '/dev/stdin', '-es', '-c', "echo expand('%:p:h') | source #{__dir__}/eregex.vim", '-c', "for line in range(0, line('$')) | call setline(line, ExtendedRegex2VimRegex(getline(line))) | endfor", '-c', ':wq! /dev/stdout', chdir: __dir__)
|
||||
stdin.write(patterns.join("\n"))
|
||||
stdin.close
|
||||
stdout.readlines.map(&:chomp).map do |r|
|
||||
r.gsub('\b', '\(\<\|\>\)')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -63,70 +110,97 @@ def each_hash(data, &block)
|
||||
end
|
||||
end
|
||||
|
||||
def patterns_to_vim_patterns(patterns)
|
||||
stdin, stdout, stderr = Open3.popen3('vim', '-V', '--clean', '/dev/stdin', '-es', '-c', "echo expand('%:p:h') | source #{__dir__}/scripts/eregex.vim", '-c', "for line in range(0, line('$')) | call setline(line, ExtendedRegex2VimRegex(getline(line))) | endfor", '-c', ':wq! /dev/stdout', chdir: __dir__)
|
||||
stdin.write(patterns.join("\n"))
|
||||
stdin.close
|
||||
stdout.readlines
|
||||
end
|
||||
|
||||
def transform_patterns(data)
|
||||
patterns = read_strings(data, ["pattern", "patterns"])
|
||||
patterns_mapping = Hash[patterns.zip(patterns_to_vim_patterns(patterns))]
|
||||
transform_with(data, ["pattern", "patterns"]) { |a| patterns_mapping[a] }
|
||||
end
|
||||
|
||||
def load_heuristics
|
||||
url = "#{BASE_URL}/lib/linguist/heuristics.yml"
|
||||
data = URI.open(url) { |io| YAML.load(io.read) }
|
||||
each_hash(data["disambiguations"]) do |h|
|
||||
if h.has_key?("named_pattern")
|
||||
h["pattern"] = data["named_patterns"].fetch(h["named_pattern"])
|
||||
h.delete("named_pattern")
|
||||
def transform_patterns(heuristics)
|
||||
patterns = []
|
||||
each_hash(heuristics) do |h|
|
||||
if h.has_key?("pattern")
|
||||
patterns << h["pattern"]
|
||||
end
|
||||
end
|
||||
transform_patterns(data["disambiguations"])
|
||||
patterns_mapping = Hash[patterns.zip(patterns_to_vim_patterns(patterns))]
|
||||
each_hash(heuristics) do |h|
|
||||
if h.has_key?("pattern")
|
||||
h["pattern"] = patterns_mapping.fetch(h["pattern"])
|
||||
end
|
||||
end
|
||||
heuristics
|
||||
end
|
||||
|
||||
def load_languages
|
||||
url = "#{BASE_URL}/lib/linguist/languages.yml"
|
||||
data = URI.open(url) { |io| YAML.load(io.read) }
|
||||
file = 'tmp/languages.yml'
|
||||
|
||||
unless File.exist?(file)
|
||||
url = "#{BASE_URL}/lib/linguist/languages.yml"
|
||||
data = URI.open(url) { |io| io.read }
|
||||
File.write(file, data)
|
||||
end
|
||||
|
||||
YAML.load(File.read(file))
|
||||
end
|
||||
|
||||
def parse_remote(remote)
|
||||
match = remote.match(/(?<repo>[^@:]+)(?:@(?<branch>[^:]+))?(?::(?<path>.*))?/)
|
||||
[match[:repo], match[:branch] || "master", match[:path]]
|
||||
dir = "tmp/" + match[:repo] + (match[:branch] ? "-#{match[:branch]}" : "")
|
||||
[match[:repo], match[:branch] || "master", match[:path], dir]
|
||||
end
|
||||
|
||||
def copy_file(package, src, dest)
|
||||
return unless [".vim", ".ctags", ".vital", ".txt"].include?(File.extname(src))
|
||||
FileUtils.mkdir_p(File.dirname(dest))
|
||||
name = package.fetch("name")
|
||||
|
||||
if dest.end_with?(".vim")
|
||||
header = '" Polyglot metafile'
|
||||
if File.exist?(dest)
|
||||
meta_dest = dest
|
||||
new_dest = dest
|
||||
i = 0
|
||||
while File.exist?(new_dest)
|
||||
i += 1
|
||||
new_dest = "#{dest.gsub(/\.vim$/, '')}-#{i}.vim"
|
||||
end
|
||||
|
||||
if File.read(dest).include?(header)
|
||||
dest = new_dest
|
||||
else
|
||||
FileUtils.mv(dest, new_dest)
|
||||
File.write(meta_dest, "#{header}\n")
|
||||
open(meta_dest, "a+") do |output|
|
||||
output << "source <sfile>:h/#{File.basename(new_dest)}\n"
|
||||
end
|
||||
dest = "#{dest.gsub(/\.vim$/, '')}-#{i+1}.vim"
|
||||
end
|
||||
open(meta_dest, "a+") do |output|
|
||||
output << "source <sfile>:h/#{File.basename(dest)}\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
open(src, "r") do |input|
|
||||
open(dest, "a+") do |output|
|
||||
open(dest, "w") do |output|
|
||||
if name == "jsx"
|
||||
output << "if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)\n\n"
|
||||
output << "if !exists('g:polyglot_disabled') || (index(g:polyglot_disabled, 'javascript') == -1 && index(g:polyglot_disabled, 'jsx') == -1)\n\n"
|
||||
else
|
||||
output << "if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '#{name}') == -1\n\n"
|
||||
end
|
||||
IO.copy_stream(input, output)
|
||||
contents = File.read(input)
|
||||
contents.gsub!(' ..= ', ' .= ')
|
||||
output << contents
|
||||
output << "\nendif\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def download
|
||||
FileUtils.rm_rf('tmp')
|
||||
|
||||
PACKAGES.each_slice(20) do |batch|
|
||||
batch.map do |package|
|
||||
def download(packages)
|
||||
packages.map { |p| p["remote"] or raise "No remote for: " + p["name"] }.uniq.each_slice(20) do |remotes|
|
||||
remotes.map do |remote|
|
||||
Thread.new do
|
||||
repo, branch, path = parse_remote(package.fetch("remote"))
|
||||
dir = "tmp/" + repo.split('/')[1]
|
||||
FileUtils.mkdir_p(dir)
|
||||
url = "https://codeload.github.com/#{repo}/tar.gz/#{branch}"
|
||||
`curl --silent -fL #{url} | tar -zx -C "#{dir}" --strip 1`
|
||||
repo, branch, path, dir = parse_remote(remote)
|
||||
unless File.exist?(dir)
|
||||
FileUtils.mkdir_p(dir)
|
||||
url = "https://codeload.github.com/#{repo}/tar.gz/#{branch}"
|
||||
`curl --silent -fL #{url} | tar -zx -C "#{dir}" --strip 1`
|
||||
end
|
||||
progress
|
||||
end
|
||||
end.map(&:join)
|
||||
@@ -147,15 +221,131 @@ def progress
|
||||
end
|
||||
end
|
||||
|
||||
def extract
|
||||
FileUtils.rm_rf(DIRS[:all])
|
||||
def indent(str, amount)
|
||||
str.gsub(/^(?!$)/, " " * amount).gsub(/\s+$/, "").gsub(/^ +\n/, "")
|
||||
end
|
||||
|
||||
def pattern_to_condition(rule)
|
||||
if rule.has_key?("or")
|
||||
return rule["or"].map { |p| pattern_to_condition(p) }.join(" || ")
|
||||
end
|
||||
|
||||
if rule.has_key?("or")
|
||||
return rule["and"].map { |p| pattern_to_condition(p) }.join(" && ")
|
||||
end
|
||||
|
||||
operator = (rule["negative"] ? "!" : "=") + "~" + (rule["ignore_case"] ? "?" : "#")
|
||||
|
||||
return "line #{operator} '#{rule["pattern"]}'"
|
||||
end
|
||||
|
||||
def rules_to_code(rules)
|
||||
output = ""
|
||||
|
||||
vars = []
|
||||
each_hash(rules) do |h|
|
||||
if h.has_key?("set")
|
||||
vars << h["set"]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if vars.size > 0
|
||||
output << vars.uniq.sort.map do |var|
|
||||
"let #{var} = 0"
|
||||
end.join("\n") + "\n"
|
||||
end
|
||||
|
||||
output << rule_to_code(rules)
|
||||
end
|
||||
|
||||
def rule_to_code(rule)
|
||||
if rule.has_key?("lines")
|
||||
if rule["lines"] == 1
|
||||
return <<~EOS
|
||||
let line = getline(1)
|
||||
|
||||
#{indent(rule_to_code(except(rule, "lines")), 0)}
|
||||
EOS
|
||||
else
|
||||
return <<~EOS
|
||||
for lnum in range(1, min([line("$"), #{rule["lines"]}]))
|
||||
let line = getline(lnum)
|
||||
|
||||
#{indent(rule_to_code(except(rule, "lines")), 2)}
|
||||
endfor
|
||||
EOS
|
||||
end
|
||||
end
|
||||
|
||||
if rule.has_key?("pattern") || rule.has_key?("or") || rule.has_key?("and")
|
||||
return <<~EOS
|
||||
if #{pattern_to_condition(rule)}
|
||||
#{indent(rule_to_code(except(rule, "pattern", "or", "and", "ignore_case", "negative")), 2)}
|
||||
endif
|
||||
EOS
|
||||
end
|
||||
|
||||
if rule.has_key?("rules")
|
||||
return rule["rules"].map { |r| indent(rule_to_code(r), 0) }.join("\n")
|
||||
end
|
||||
|
||||
if rule.has_key?("if_set")
|
||||
return <<~EOS
|
||||
if #{rule["negative"] ? "!" : ""}#{rule["if_set"]}
|
||||
#{indent(rule_to_code(except(rule, "if_set", "negative")), 2)}
|
||||
endif
|
||||
EOS
|
||||
end
|
||||
|
||||
if rule.has_key?("if_exists")
|
||||
return <<~EOS
|
||||
if #{rule["negative"] ? "!" : ""}exists("#{rule["if_exists"]}")
|
||||
#{indent(rule_to_code(except(rule, "if_exists", "negative")), 2)}
|
||||
endif
|
||||
EOS
|
||||
end
|
||||
|
||||
if rule.has_key?("set")
|
||||
return <<~EOS
|
||||
let #{rule["set"]} = 1
|
||||
#{indent(rule_to_code(except(rule, "set")), 0)}
|
||||
EOS
|
||||
end
|
||||
|
||||
if (rule.keys - ["filetype", "override", "set"]).size > 0
|
||||
raise "Unknown rule: #{JSON.generate(rule)}"
|
||||
end
|
||||
|
||||
if rule.has_key?("override")
|
||||
return <<~EOS
|
||||
if exists("#{rule["override"]}")
|
||||
call s:Setf(#{rule["override"]}) | return
|
||||
endif
|
||||
EOS
|
||||
end
|
||||
|
||||
if rule.has_key?("filetype")
|
||||
return "call s:Setf('#{rule["filetype"]}') | return"
|
||||
end
|
||||
|
||||
return ""
|
||||
end
|
||||
|
||||
def extract(packages)
|
||||
all_dirs = %w(syntax indent doc compiler autoload ftplugin ctags extras after)
|
||||
|
||||
default_dirs = %w(
|
||||
syntax indent doc compiler autoload ftplugin ctags extras
|
||||
after/syntax after/indent after/ftplugin
|
||||
)
|
||||
|
||||
FileUtils.rm_rf(all_dirs)
|
||||
|
||||
output = []
|
||||
PACKAGES.map do |package|
|
||||
repo, branch, path = parse_remote(package["remote"])
|
||||
dir = "tmp/" + repo.split('/')[1]
|
||||
subdirs = []
|
||||
dirs = DIRS.fetch(package.fetch("dirs", "default").to_sym)
|
||||
packages.map do |package|
|
||||
repo, branch, path, dir = parse_remote(package["remote"])
|
||||
dirs = package.fetch("dirs", default_dirs)
|
||||
ignored_dirs = package.fetch("ignored_dirs", [])
|
||||
if ignored_dirs.size > 0
|
||||
dirs = dirs.reject { |d| ignored_dirs.any? { |id| d.start_with?(id) } }
|
||||
@@ -165,18 +355,31 @@ def extract
|
||||
subtree = "#{dir}/#{path ? path + "/" : ""}"
|
||||
subpath = "#{subtree}#{subdir}"
|
||||
if FileTest.directory?(subpath)
|
||||
Dir.glob("#{subdir}/**/*", base: subtree).each do |p|
|
||||
if repo == "vim/vim" && (["glob", "globs"] & package.keys).size == 0
|
||||
raise "Package from vim/vim should define glob or globs: #{package["name"]}"
|
||||
end
|
||||
glob = package.fetch("glob", package.fetch('globs', '**/*.{vim,ctags,vital,txt}'))
|
||||
Dir.glob("#{subdir}/#{glob}", base: subtree).each do |p|
|
||||
next unless File.file?("#{subtree}/#{p}")
|
||||
if p.include?("samba")
|
||||
raise package["name"]
|
||||
end
|
||||
copy_file(package, "#{subtree}/#{p}", p)
|
||||
end
|
||||
|
||||
subdirs << subdir.split("/").last
|
||||
elsif File.exist?(subpath)
|
||||
copy_file(package, subpath, subdir)
|
||||
end
|
||||
end
|
||||
|
||||
output << "- [#{package["name"]}](https://github.com/#{repo}) (#{subdirs.uniq.join(", ")})"
|
||||
if branch != "master" || path
|
||||
if path
|
||||
output << "- [#{package["name"]}](https://github.com/#{repo}/tree/#{branch}/#{path})"
|
||||
else
|
||||
output << "- [#{package["name"]}](https://github.com/#{repo}/tree/#{branch})"
|
||||
end
|
||||
else
|
||||
output << "- [#{package["name"]}](https://github.com/#{repo})"
|
||||
end
|
||||
progress
|
||||
end
|
||||
|
||||
@@ -195,115 +398,91 @@ def extract
|
||||
File.write('README.md', readme)
|
||||
end
|
||||
|
||||
def generate_ftdetect
|
||||
heuristics, languages = parallel(:load_heuristics, :load_languages)
|
||||
def generate_ftdetect(packages, heuristics)
|
||||
output = "\n"
|
||||
|
||||
output = <<~EOS
|
||||
" don't spam the user when Vim is started in Vi compatibility mode
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
extensions = Hash.new { |h, k| h[k] = [] }
|
||||
|
||||
if !exists('g:polyglot_disabled')
|
||||
let g:polyglot_disabled = []
|
||||
endif
|
||||
|
||||
function! s:SetDefault(name, value)
|
||||
if !exists(a:name)
|
||||
let {a:name} = a:value
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call s:SetDefault('g:markdown_enable_spell_checking', 0)
|
||||
call s:SetDefault('g:markdown_enable_input_abbreviations', 0)
|
||||
call s:SetDefault('g:markdown_enable_mappings', 0)
|
||||
|
||||
" Enable jsx syntax by default
|
||||
call s:SetDefault('g:jsx_ext_required', 0)
|
||||
|
||||
" Make csv loading faster
|
||||
call s:SetDefault('g:csv_start', 1)
|
||||
call s:SetDefault('g:csv_end', 2)
|
||||
|
||||
" Disable json concealing by default
|
||||
call s:SetDefault('g:vim_json_syntax_conceal', 0)
|
||||
|
||||
call s:SetDefault('g:filetype_euphoria', 'elixir')
|
||||
|
||||
if !exists('g:python_highlight_all')
|
||||
call s:SetDefault('g:python_highlight_builtins', 1)
|
||||
call s:SetDefault('g:python_highlight_builtin_objs', 1)
|
||||
call s:SetDefault('g:python_highlight_builtin_types', 1)
|
||||
call s:SetDefault('g:python_highlight_builtin_funcs', 1)
|
||||
call s:SetDefault('g:python_highlight_builtin_funcs_kwarg', 1)
|
||||
call s:SetDefault('g:python_highlight_exceptions', 1)
|
||||
call s:SetDefault('g:python_highlight_string_formatting', 1)
|
||||
call s:SetDefault('g:python_highlight_string_format', 1)
|
||||
call s:SetDefault('g:python_highlight_string_templates', 1)
|
||||
call s:SetDefault('g:python_highlight_indent_errors', 1)
|
||||
call s:SetDefault('g:python_highlight_space_errors', 1)
|
||||
call s:SetDefault('g:python_highlight_doctests', 1)
|
||||
call s:SetDefault('g:python_highlight_func_calls', 1)
|
||||
call s:SetDefault('g:python_highlight_class_vars', 1)
|
||||
call s:SetDefault('g:python_highlight_operators', 1)
|
||||
call s:SetDefault('g:python_highlight_file_headers_as_comments', 1)
|
||||
call s:SetDefault('g:python_slow_sync', 1)
|
||||
endif
|
||||
|
||||
EOS
|
||||
|
||||
ambiguous_extensions = PACKAGES.flat_map { |e| e["filetypes"] }.flat_map do |e|
|
||||
if e["linguist"]
|
||||
((languages[e["linguist"]]["extensions"] || []).map { |e| e[1..-1] } | e.fetch("extra_extensions", [])) - e.fetch("ignored_extensions", [])
|
||||
else
|
||||
e.fetch("extensions", [])
|
||||
for package in packages
|
||||
for filetype in package["filetypes"]
|
||||
for ext in filetype["extensions"]
|
||||
extensions[ext] << filetype["name"]
|
||||
end
|
||||
end
|
||||
end.group_by(&:itself).transform_values(&:count).select { |a, b| b > 1 }.keys.to_set
|
||||
end
|
||||
|
||||
expected_filetypes = detect_filetypes
|
||||
ambiguous_extensions = extensions
|
||||
.select { |a, b| b.uniq.size > 1 }.keys.sort
|
||||
|
||||
for package in PACKAGES
|
||||
all_filetypes = packages.flat_map { |f| f["filetypes"] || [] }
|
||||
filetype_names = Set.new(all_filetypes.map { |f| f["name"] })
|
||||
|
||||
native_filetypes = detect_filetypes('tmp/vim/vim/runtime/filetype.vim')
|
||||
expected_filetypes = detect_filetypes('tmp/**/ftdetect/*.vim') + native_filetypes
|
||||
|
||||
expected_filetypes = expected_filetypes.select { |e| filetype_names.include?(e["name"]) }
|
||||
|
||||
native_extensions = Set.new(native_filetypes.flat_map { |f| f["extensions"] || [] })
|
||||
|
||||
for package in packages
|
||||
name = package.fetch("name")
|
||||
output << if name == "jsx"
|
||||
"if !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)\n"
|
||||
else
|
||||
"if index(g:polyglot_disabled, '#{name}') == -1\n"
|
||||
end
|
||||
|
||||
filetypes = package["filetypes"] or raise "Unknown filetype for: #{package["name"]}"
|
||||
to_disable = []
|
||||
|
||||
for filetype in filetypes
|
||||
name = filetype.fetch("name")
|
||||
syntax = filetype["syntax"] ? " syntax=#{filetype["syntax"]}" : ""
|
||||
set_command = package.fetch("custom_set", "set ft=#{name}#{syntax}")
|
||||
|
||||
linguist = filetype["linguist"] ? languages.fetch(filetype["linguist"]) : {}
|
||||
extensions = filetype["extensions"] || linguist.fetch("extensions", []).map { |e| e[1..] }
|
||||
extensions = (extensions | filetype.fetch("extra_extensions", [])) - filetype.fetch("ignored_extensions", [])
|
||||
|
||||
filenames = filetype["filenames"] || linguist.fetch("filenames", [])
|
||||
filenames = (filenames | filetype.fetch("extra_filenames", [])) - filetype.fetch("ignored_filenames", [])
|
||||
|
||||
if expected_filetypes[name] && !filetype["syntax"]
|
||||
for e in expected_filetypes.fetch(name)[:extensions] - extensions - expand_all(filetype.fetch("ignored_extensions", []))
|
||||
puts "Probable missing extension for #{name}: #{e}"
|
||||
end
|
||||
|
||||
for e in expand_all(expected_filetypes.fetch(name)[:filenames]) - expand_all(filenames).flat_map { |e| [e, e.gsub(/^\./, '')] } - expand_all(filetype.fetch("ignored_filenames", [])) - ['*']
|
||||
puts "Probable missing filename for #{name}: #{e}"
|
||||
for filetype in package["filetypes"]
|
||||
for extension in filetype["extensions"]
|
||||
if native_extensions.include?(extension)
|
||||
to_disable << "*." + extension
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if to_disable.size > 0
|
||||
output << "if !has_key(s:disabled_packages, '#{name}')\n"
|
||||
output << " au! BufRead,BufNewFile #{to_disable.join(",")}\n"
|
||||
output << "endif\n\n"
|
||||
end
|
||||
end
|
||||
|
||||
for package in packages
|
||||
filetypes = package["filetypes"] or raise "Unknown filetype for: #{package["name"]}"
|
||||
|
||||
package_heuristics = []
|
||||
|
||||
autocommands = ""
|
||||
for filetype in filetypes
|
||||
name = filetype.fetch("name")
|
||||
syntax = filetype["syntax"] ? " | set syntax=#{filetype["syntax"]}" : ""
|
||||
|
||||
set_command = "call s:Setf('#{name}')"
|
||||
|
||||
if filetype["syntax"]
|
||||
set_command = "if !did_filetype() | set ft=#{name} syntax=#{filetype["syntax"]} | endif"
|
||||
end
|
||||
|
||||
if filetype["custom_set"]
|
||||
set_command = filetype["custom_set"]
|
||||
end
|
||||
|
||||
extensions = filetype["extensions"]
|
||||
filenames = filetype["filenames"]
|
||||
|
||||
for extension in extensions.sort
|
||||
outer_filetype = filetype["outer_filetype"]
|
||||
if outer_filetype
|
||||
output << " au BufNewFile *.*.#{extension} execute \"do BufNewFile filetypedetect \" . expand(\"<afile>:r\") | #{outer_filetype}\n"
|
||||
output << " au BufReadPre *.*#{extension} execute \"do BufRead filetypedetect \" . expand(\"<afile>:r\") | #{outer_filetype}\n"
|
||||
autocommands << " au BufNewFile *.*.#{extension} execute \"do BufNewFile filetypedetect \" . expand(\"<afile>:r\") | #{outer_filetype}\n"
|
||||
autocommands << " au BufReadPre *.*.#{extension} execute \"do BufRead filetypedetect \" . expand(\"<afile>:r\") | #{outer_filetype}\n"
|
||||
end
|
||||
|
||||
if ambiguous_extensions.include?(extension)
|
||||
output << " au BufNewFile,BufRead *.#{extension} setf #{filetype["name"]}\n"
|
||||
heuristic = heuristics.find { |h| h["extensions"].include?(extension) }
|
||||
if heuristic
|
||||
package_heuristics << heuristic
|
||||
else
|
||||
output << " au BufNewFile,BufRead *.#{extension} #{set_command}\n"
|
||||
# if ambiguous_extensions.include?(extension)
|
||||
# puts "Ambiguous extension without heuristic: #{extension} => #{filetype["name"]}"
|
||||
# end
|
||||
#
|
||||
autocommands << " au BufNewFile,BufRead *.#{extension} #{set_command}\n"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -311,29 +490,145 @@ def generate_ftdetect
|
||||
if filename[0] == "."
|
||||
filename = "{.,}" + filename[1..]
|
||||
end
|
||||
output << " au BufNewFile,BufRead #{filename} #{set_command}\n"
|
||||
if filename[-1] == "*"
|
||||
autocommands << " au BufNewFile,BufRead #{filename} call s:StarSetf('#{name}')\n"
|
||||
else
|
||||
autocommands << " au BufNewFile,BufRead #{filename} #{set_command}\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
output << "endif\n\n"
|
||||
for heuristic in package_heuristics.uniq
|
||||
extensions = heuristic["extensions"].map { |e| "*.#{e}" }
|
||||
autocommands << " au! BufNewFile,BufRead #{extensions.join(",")} call polyglot#Detect#{camelize(heuristic["extensions"].first)}Filetype()\n"
|
||||
end
|
||||
|
||||
if autocommands != ""
|
||||
output << "if !has_key(s:disabled_packages, '#{package["name"]}')\n"
|
||||
output << autocommands
|
||||
output << "endif\n\n"
|
||||
end
|
||||
end
|
||||
|
||||
defined_extensions = all_filetypes.flat_map { |f| expand_all(f["extensions"] || []).map { |e| [f["name"], e] } }
|
||||
expected_extensions = expected_filetypes.flat_map { |f| expand_all(f["extensions"] || []).map { |e| [f["name"], e] } }
|
||||
ignored_extensions = all_filetypes.flat_map { |f| expand_all(f.fetch("ignored_extensions", [])).map { |e| [f["name"], e] } }
|
||||
|
||||
defined_filenames = all_filetypes.flat_map { |f| expand_all(f["filenames"] || []).map { |e| [f["name"], e] } }
|
||||
expected_filenames = expected_filetypes.flat_map { |f| expand_all(f["filenames"] || []).map { |e| [f["name"], e] } }
|
||||
ignored_filenames = all_filetypes.flat_map { |f| expand_all(f.fetch("ignored_filenames", [])).map { |e| [f["name"], e] } }
|
||||
|
||||
ignored_warnings = all_filetypes.flat_map { |f| expand_all(f.fetch("ignored_warnings", [])).map { |e| [f["name"], e] } + [f, "*"] }
|
||||
|
||||
for name, e in expected_extensions - defined_extensions - ignored_extensions - ignored_warnings
|
||||
puts "Missing extension for #{name}: #{e}"
|
||||
end
|
||||
|
||||
for name, e in expected_filenames - defined_filenames - ignored_filenames - ignored_warnings
|
||||
puts "Missing filename for #{name}: #{e}"
|
||||
end
|
||||
|
||||
ftdetect = File.read('ftdetect/polyglot.vim')
|
||||
File.write('ftdetect/polyglot.vim', ftdetect.gsub(/(?<=" filetypes\n).*(?=\n" end filetypes)/m, output))
|
||||
|
||||
output = <<~EOS
|
||||
" Line continuation is used here, remove 'C' from 'cpoptions'
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" We need it because scripts.vim in vim uses "set ft=" which cannot be
|
||||
" overridden with setf (and we can't use set ft= so our scripts.vim work)
|
||||
func! s:Setf(ft)
|
||||
if &filetype !~# '\<'.a:ft.'\>'
|
||||
let &filetype = a:ft
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func! polyglot#Heuristics()
|
||||
" Try to detect filetype from shebang
|
||||
let l:filetype = polyglot#Shebang()
|
||||
if l:filetype != ""
|
||||
exec "setf " . l:filetype
|
||||
return 1
|
||||
endif
|
||||
|
||||
return 0
|
||||
endfunc
|
||||
|
||||
let s:interpreters = {
|
||||
EOS
|
||||
|
||||
for filetype in packages.flat_map { |p| p.fetch("filetypes", []) }.sort_by { |a| a["name"] }
|
||||
for interpreter in filetype["interpreters"]
|
||||
output << " \\ '#{interpreter}': '#{filetype["name"]}',\n"
|
||||
end
|
||||
end
|
||||
|
||||
output << <<~EOS
|
||||
\\ }
|
||||
|
||||
let s:r_hashbang = '^#!\\s*\\(\\S\\+\\)\\s*\\(.*\\)\\s*'
|
||||
let s:r_envflag = '%(\\S\\+=\\S\\+\\|-[iS]\\|--ignore-environment\\|--split-string\\)'
|
||||
let s:r_env = '^\\%(\\' . s:r_envflag . '\\s\\+\\)*\\(\\S\\+\\)'
|
||||
|
||||
func! polyglot#Shebang()
|
||||
let l:line1 = getline(1)
|
||||
|
||||
if l:line1 !~# "^#!"
|
||||
return
|
||||
endif
|
||||
|
||||
let l:pathrest = matchlist(l:line1, s:r_hashbang)
|
||||
|
||||
if len(l:pathrest) == 0
|
||||
return
|
||||
endif
|
||||
|
||||
let [_, l:path, l:rest; __] = l:pathrest
|
||||
|
||||
let l:script = split(l:path, "/")[-1]
|
||||
|
||||
if l:script == "env"
|
||||
let l:argspath = matchlist(l:rest, s:r_env)
|
||||
if len(l:argspath) == 0
|
||||
return
|
||||
endif
|
||||
|
||||
let l:script = l:argspath[1]
|
||||
endif
|
||||
|
||||
if has_key(s:interpreters, l:script)
|
||||
return s:interpreters[l:script]
|
||||
endif
|
||||
|
||||
for interpreter in keys(s:interpreters)
|
||||
if l:script =~# '^' . interpreter
|
||||
return s:interpreters[interpreter]
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
EOS
|
||||
|
||||
for heuristic in heuristics
|
||||
output << <<~EOS
|
||||
func! polyglot#Detect#{camelize(heuristic["extensions"].first)}Filetype()
|
||||
#{indent(rules_to_code(heuristic), 2)}
|
||||
endfunc
|
||||
|
||||
EOS
|
||||
end
|
||||
|
||||
output << <<~EOS
|
||||
" restore Vi compatibility settings
|
||||
" Restore 'cpoptions'
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
EOS
|
||||
|
||||
# filetypes = detect_filetypes
|
||||
#
|
||||
# for filetype in filetypes
|
||||
#
|
||||
# end
|
||||
|
||||
File.write('ftdetect/polyglot.vim', output)
|
||||
File.write('autoload/polyglot.vim', output)
|
||||
end
|
||||
|
||||
def generate_tests
|
||||
def generate_tests(packages)
|
||||
output = <<~EOS
|
||||
function! TestFiletype(filetype)
|
||||
try
|
||||
@@ -349,7 +644,7 @@ def generate_tests
|
||||
|
||||
EOS
|
||||
|
||||
for package in PACKAGES
|
||||
for package in packages
|
||||
for filetype in package.fetch("filetypes", [])
|
||||
output << "call TestFiletype('#{filetype["name"]}')\n"
|
||||
end
|
||||
@@ -406,8 +701,8 @@ def expand_all(pattern)
|
||||
end
|
||||
end
|
||||
|
||||
def detect_filetypes
|
||||
filetypes = Dir['tmp/*/ftdetect/*.vim'].flat_map do |file|
|
||||
def detect_filetypes(glob)
|
||||
filetypes = Dir[glob].flat_map do |file|
|
||||
contents = File.read(file).gsub(/^\s*au(tocmd)?!?\s*$/, '')
|
||||
results = contents.scan(/^\s*(?:au!|au|au[^g][^ ]*) +(?:\S+)\s+(\S+)[\s\\]+([^\n]+)/)
|
||||
results = results.map do |a, b|
|
||||
@@ -422,19 +717,66 @@ def detect_filetypes
|
||||
results
|
||||
end
|
||||
|
||||
Hash[filetypes.flat_map do |ext, filetype|
|
||||
filetypes.flat_map do |ext, filetype|
|
||||
expand_all(ext).map { |e| [filetype, e] }
|
||||
end.group_by { |a, b| a }.map { |a, b| [a, b.map { |c, d| d }] }.map { |a, b|
|
||||
[a, {
|
||||
extensions: b.select { |x| x.match(/^\*\.[^\/]+$/) }.map { |a| a.strip[2..] },
|
||||
filenames: b.select { |x| !x.match(/^\*\.[^\/]+$/) }
|
||||
}]
|
||||
}]
|
||||
{
|
||||
"name" => a,
|
||||
"extensions" => b.select { |x| x.match(/^\*\.[^\/]+$/) }.map { |a| a.strip[2..] },
|
||||
"filenames" => expand_all(b.select { |x| !x.match(/^\*\.[^\/]+$/) })
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
download
|
||||
extract
|
||||
generate_ftdetect
|
||||
generate_tests
|
||||
puts(" Bye! Have a wonderful time!")
|
||||
FileUtils.rm_rf("tmp")
|
||||
def generate_plugins(packages)
|
||||
FileUtils.mkdir_p('autoload/polyglot')
|
||||
|
||||
output = "let s:globs = {\n"
|
||||
|
||||
patterns = Hash.new { |h, k| h[k] = [] }
|
||||
|
||||
for package in packages
|
||||
for filetype in package["filetypes"]
|
||||
extensions = (filetype["extensions"] || []).map { |e| "*.#{e}" }
|
||||
files = (filetype["filenames"] || []).reject { |e| e.match(/\*\*|\//) || e[0] == "." }
|
||||
patterns[filetype["name"]].concat(extensions)
|
||||
patterns[filetype["name"]].concat(files)
|
||||
end
|
||||
end
|
||||
|
||||
for filetype in patterns.keys.sort
|
||||
output << " \\ '#{filetype}': '#{patterns[filetype].uniq.join(",")}',\n"
|
||||
end
|
||||
output << " \\}\n\n"
|
||||
|
||||
|
||||
output << <<~EOS
|
||||
func! sleuth#GlobForFiletype(type)
|
||||
return get(s:globs, a:type, '')
|
||||
endfunc
|
||||
EOS
|
||||
|
||||
|
||||
File.write('autoload/sleuth.vim', output)
|
||||
end
|
||||
|
||||
|
||||
if __FILE__ == $0
|
||||
if !ENV["DEV"]
|
||||
FileUtils.rm_rf("tmp")
|
||||
end
|
||||
|
||||
Dir.mkdir('tmp') unless File.exists?('tmp')
|
||||
|
||||
packages, heuristics = load_data()
|
||||
download(packages)
|
||||
extract(packages)
|
||||
generate_ftdetect(packages, heuristics)
|
||||
generate_plugins(packages)
|
||||
generate_tests(packages)
|
||||
puts(" Bye! Have a wonderful time!")
|
||||
|
||||
if !ENV["DEV"]
|
||||
FileUtils.rm_rf("tmp")
|
||||
end
|
||||
end
|
||||
|
||||
15
scripts/test
15
scripts/test
@@ -2,12 +2,15 @@
|
||||
|
||||
set -e
|
||||
|
||||
vim --clean -N --cmd "
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
vim --clean -N -u <(echo "
|
||||
let &rtp='$PWD,'.&rtp
|
||||
source ftdetect/polyglot.vim
|
||||
let g:polyglot_test = 1
|
||||
source scripts/test_extensions.vim
|
||||
source scripts/test_filetypes.vim
|
||||
exec ':q!'
|
||||
"
|
||||
qa!
|
||||
")
|
||||
|
||||
if ! expect -c 'set timeout 1' -c 'spawn vim -N --clean -c "set nomore | :helptags ./doc | q"' -c 'expect "ENTER" { exit 1 }' > /dev/null; then
|
||||
echo "Please ensure ':helptags ./doc' works properly"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1,16 +1,281 @@
|
||||
function! TestExtension(filetype, filename, content)
|
||||
try
|
||||
exec "e " . a:filename
|
||||
let g:message = ""
|
||||
exec "noautocmd n " . a:filename
|
||||
put =a:content
|
||||
1delete _
|
||||
filetype detect
|
||||
exec "if &filetype != '" . a:filetype . "' \nthrow &filetype\nendif"
|
||||
exec ":bw!"
|
||||
catch
|
||||
echo 'Filename "' . a:filename . '" does not resolve to extension "' . a:filetype . '"'
|
||||
echo ' instead received: "' . v:exception . '"'
|
||||
exec ':cq!'
|
||||
echo g:message
|
||||
echo "Filename '" . a:filename . "' does not resolve to extension '" . a:filetype . "'"
|
||||
echo " instead received: '" . v:exception . "'"
|
||||
exec ":cq!"
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
call TestExtension('blade', 'test.blade.php', '')
|
||||
call TestExtension('yaml.ansible', 'playbook.yml', '')
|
||||
call TestExtension('yaml.ansible', 'host_vars/foobar', '')
|
||||
call TestExtension('yaml.ansible', 'handlers.foo.yaml', '')
|
||||
call TestExtension('yaml.ansible', 'requirements.yaml', '')
|
||||
call TestExtension("sh", "bash1", "#!/bin/bash")
|
||||
call TestExtension("sh", "bash2", "#! /bin/bash")
|
||||
call TestExtension("sh", "bash3", "#! /bin/bash2.3")
|
||||
call TestExtension("sh", "bash4", "#!/usr/bin/env bash")
|
||||
call TestExtension("sh", "bash6", "#!/usr/bin/env -i -=split-string foo=bar bash -l foo")
|
||||
call TestExtension("sh", "bash1", "#!/bin/bash")
|
||||
|
||||
" Vim help file
|
||||
call TestExtension("help", $VIMRUNTIME . "/doc/foobar.txt", "")
|
||||
|
||||
" Abaqus or Trasys
|
||||
call TestExtension("abaqus", "foobar.inp", "*HEADING\nFoobar")
|
||||
call TestExtension("trasys", "foobar.inp", "MSC PATRAN\n* foobar\nHEADER SURFACE DATA\nBSC ENCLO1")
|
||||
|
||||
" 8th (Firth-derivative)
|
||||
call TestExtension("8th", "foobar.8th", "")
|
||||
call TestExtension("8th", "foobar.8th", "")
|
||||
|
||||
" A-A-P recipe
|
||||
call TestExtension("aap", "foobar.aap", "")
|
||||
|
||||
|
||||
" A2ps printing utility
|
||||
call TestExtension("a2ps", "/etc/a2ps.cfg", "")
|
||||
call TestExtension("a2ps", "/usr/local/etc/a2ps.cfg", "")
|
||||
call TestExtension("a2ps", "/etc/a2ps/foobar.cfg", "")
|
||||
call TestExtension("a2ps", "/usr/local/etc/a2ps/foobar.cfg", "")
|
||||
call TestExtension("a2ps", "/tmp/a2psrc", "")
|
||||
call TestExtension("a2ps", "/tmp/.a2psrc", "")
|
||||
|
||||
" ABAB/4
|
||||
call TestExtension("abap", "foobar.abap", "")
|
||||
|
||||
" ABC music notation
|
||||
call TestExtension("abc", "foobar.abc", "")
|
||||
|
||||
" ABEL
|
||||
call TestExtension("abel", "foobar.abl", "")
|
||||
|
||||
" AceDB
|
||||
call TestExtension("acedb", "foobar.wrm", "")
|
||||
|
||||
" Ada (83, 9X, 95)
|
||||
call TestExtension("ada", "foobar.adb", "")
|
||||
call TestExtension("ada", "foobar.ads", "")
|
||||
call TestExtension("ada", "foobar.ada", "")
|
||||
call TestExtension("ada", "foobar.gpr", "")
|
||||
|
||||
" AHDL
|
||||
call TestExtension("ahdl", "foobar.tdf", "")
|
||||
|
||||
" AIDL
|
||||
call TestExtension("aidl", "foobar.aidl", "")
|
||||
|
||||
" AMPL
|
||||
call TestExtension("ampl", "foobar.run", "")
|
||||
|
||||
" Ant
|
||||
call TestExtension("ant", "build.xml", "")
|
||||
|
||||
" Arduino
|
||||
call TestExtension("arduino", "foobar.ino", "")
|
||||
call TestExtension("arduino", "foobar.pde", "")
|
||||
|
||||
" Apache config file
|
||||
call TestExtension("apache", ".htaccess", "")
|
||||
call TestExtension("apache", "/etc/httpd/foobar.conf", "")
|
||||
call TestExtension("apache", "/etc/apache2/sites-foobar/foobar.com", "")
|
||||
call TestExtension("apache", "/usr/local/etc/httpd/foobar.conf", "")
|
||||
call TestExtension("apache", "/usr/local/etc/apache2/sites-foobar/foobar.com", "")
|
||||
|
||||
" XA65 MOS6510 cross assembler
|
||||
call TestExtension("a65", "foobar.a65", "")
|
||||
|
||||
" Applescript
|
||||
call TestExtension("applescript", "foobar.scpt", "")
|
||||
|
||||
" Applix ELF
|
||||
call TestExtension("elf", "foobar.am", "")
|
||||
call TestExtension("automake", "Makefile.am", "")
|
||||
call TestExtension("automake", "makefile.am", "")
|
||||
|
||||
" ALSA configuration
|
||||
call TestExtension("alsaconf", ".asoundrc", "")
|
||||
call TestExtension("alsaconf", "/usr/share/alsa/alsa.conf", "")
|
||||
call TestExtension("alsaconf", "/media/foo/usr/share/alsa/alsa.conf", "")
|
||||
call TestExtension("alsaconf", "/etc/asound.conf", "")
|
||||
call TestExtension("alsaconf", "/media/foo/etc/asound.conf", "")
|
||||
|
||||
" Arc Macro Language
|
||||
call TestExtension("aml", "foobar.aml", "")
|
||||
|
||||
" APT config file
|
||||
call TestExtension("aptconf", "apt.conf", "")
|
||||
call TestExtension("aptconf", "/root/.aptitude/config", "")
|
||||
call TestExtension("aptconf", "/etc/apt/apt.conf.d/foo_bar-12", "")
|
||||
call TestExtension("aptconf", "/etc/apt/apt.conf.d/foo_bar-12.conf", "")
|
||||
call TestExtension("", "/etc/apt/apt.conf.d/.gsdf", "")
|
||||
|
||||
" Arch Inventory file
|
||||
call TestExtension("arch", ".arch-inventory", "")
|
||||
call TestExtension("arch", "=tagging-method", "")
|
||||
|
||||
" ART*Enterprise (formerly ART-IM)
|
||||
call TestExtension("art", "foobar.art", "")
|
||||
|
||||
" AsciiDoc
|
||||
call TestExtension("asciidoc", "foobar.asciidoc", "")
|
||||
call TestExtension("asciidoc", "foobar.adoc", "")
|
||||
|
||||
" ASN.1
|
||||
call TestExtension("asn", "foobar.asn", "")
|
||||
call TestExtension("asn", "foobar.asn1", "")
|
||||
|
||||
" Active Server Pages (with Visual Basic Script)
|
||||
call TestExtension("aspvbs", "foobar.asa", "")
|
||||
let g:filetype_asa = "fizfuz"
|
||||
call TestExtension("fizfuz", "foobar.asa", "")
|
||||
|
||||
" Active Server Pages (with Perl or Visual Basic Script)
|
||||
call TestExtension("aspvbs", "vbs.asp", "")
|
||||
call TestExtension("aspperl", "perl.asp", "<Job ID=\"DropFiles\">\n<script language=\"PerlScript\">\n</script>\n</Job>")
|
||||
let g:filetype_asp = "fizfuz"
|
||||
call TestExtension("fizfuz", "fizfuz.asp", "")
|
||||
|
||||
|
||||
" Grub (must be before catch *.lst)
|
||||
call TestExtension("grub", "/boot/grub/menu.lst", "")
|
||||
call TestExtension("grub", "/media/foobar/boot/grub/menu.lst", "")
|
||||
call TestExtension("grub", "/boot/grub/grub.conf", "")
|
||||
call TestExtension("grub", "/media/foobar/boot/grub/grub.conf", "")
|
||||
call TestExtension("grub", "/etc/grub.conf", "")
|
||||
call TestExtension("grub", "/media/foobar/etc/grub.conf", "")
|
||||
|
||||
" Assembly (all kinds)
|
||||
" *.lst is not pure assembly, it has two extra columns (address, byte codes)
|
||||
|
||||
au BufNewFile,BufRead *.asm,*.[sS],*.[aA],*.mac,*.lst call dist#ft#FTasm()
|
||||
|
||||
" Macro (VAX)
|
||||
call TestExtension("vmasm", "foobar.mar", "")
|
||||
|
||||
" Atlas
|
||||
call TestExtension("atlas", "foobar.atl", "")
|
||||
call TestExtension("atlas", "foobar.as", "")
|
||||
|
||||
" Autoit v3
|
||||
call TestExtension("autoit", "foobar.au3", "")
|
||||
|
||||
" Autohotkey
|
||||
call TestExtension("autohotkey", "foobar.ahk", "")
|
||||
|
||||
" Automake
|
||||
call TestExtension("automake", "Makefile.am", "")
|
||||
call TestExtension("automake", "makefile.am", "")
|
||||
call TestExtension("automake", "GNUmakefile.am", "")
|
||||
|
||||
" Autotest .at files are actually m4
|
||||
call TestExtension("m4", "foobar.at", "")
|
||||
|
||||
" Avenue
|
||||
call TestExtension("ave", "foobar.ave", "")
|
||||
|
||||
" Awk
|
||||
call TestExtension("awk", "foobar.awk", "")
|
||||
|
||||
" C++
|
||||
call TestExtension("c", "foobar.c", "")
|
||||
call TestExtension("cpp", "foobar.cxx", "")
|
||||
call TestExtension("cpp", "foobar.c++", "")
|
||||
call TestExtension("cpp", "foobar.hh", "")
|
||||
call TestExtension("cpp", "foobar.hxx", "")
|
||||
call TestExtension("cpp", "foobar.hpp", "")
|
||||
call TestExtension("cpp", "foobar.ipp", "")
|
||||
call TestExtension("cpp", "foobar.moc", "")
|
||||
call TestExtension("cpp", "foobar.tcc", "")
|
||||
call TestExtension("cpp", "foobar.inl", "")
|
||||
|
||||
" vim-polyglot only
|
||||
call TestExtension("blade", "test.blade.php", "")
|
||||
call TestExtension("yaml.ansible", "playbook.yml", "")
|
||||
call TestExtension("yaml.ansible", "host_vars/foobar", "")
|
||||
call TestExtension("yaml.ansible", "handlers.foobar.yaml", "")
|
||||
call TestExtension("yaml.ansible", "requirements.yaml", "")
|
||||
call TestExtension("ps1xml", "foobar.ps1xml", "")
|
||||
call TestExtension("terraform", "terraform.tf", "")
|
||||
|
||||
call TestExtension("idris2", "foobar.idr", "")
|
||||
call TestExtension("idris", "foobar.idr", "pkgs : List String\npkgs = [\"NCurses\", \"Readline\"]")
|
||||
let g:filetype_idr = "fizfuz"
|
||||
call TestExtension("fizfuz", "fizfuz.idr", "")
|
||||
|
||||
" .m extension
|
||||
call TestExtension("octave", "matlab.m", "")
|
||||
call TestExtension("objc", "objc.m", "\n\n #import <Foundation/Foundation.h>")
|
||||
call TestExtension("octave", "objc.m", "results_ub_times=zeros(2,2,M);\n%results pour la lower bound")
|
||||
call TestExtension("mma", "mathematica.m", "newcase[ \"00003\" ];\n (* Hello world *)")
|
||||
call TestExtension("murphi", "murphi.m", "type\n square: 1 .. 9")
|
||||
call TestExtension("murphi", "murphi.m", "something\n--foobar")
|
||||
call TestExtension("octave", "percentcomment.m", "hello world\n%foobar")
|
||||
call TestExtension("objc", "comment.m", "\n/* Hello world */")
|
||||
let g:filetype_m = "fizfuz"
|
||||
call TestExtension("fizfuz", "fizfuz.m", "")
|
||||
|
||||
" .fs extension
|
||||
call TestExtension("forth", "empty.fs", "")
|
||||
call TestExtension("fsharp", "fsharp.fs", "let myInt = 5")
|
||||
call TestExtension("glsl", "glsl.fs", "//#version 120\nvoid main() {}")
|
||||
let g:filetype_fs = "fizfuz"
|
||||
call TestExtension("fizfuz", "fizfuz.fs", "")
|
||||
|
||||
" .re extension
|
||||
call TestExtension("reason", "empty.re", "")
|
||||
call TestExtension("cpp", "cpp.re", "#include \"config.h\"")
|
||||
call TestExtension("cpp", "cpp2.re", "#ifdef HAVE_CONFIG_H")
|
||||
call TestExtension("cpp", "cpp3.re", "#define YYCTYPE unsigned char")
|
||||
call TestExtension("reason", "react.re", "ReasonReact.Router.push('');")
|
||||
|
||||
" .bas extension
|
||||
call TestExtension("vbnet", "vb.vb", "")
|
||||
call TestExtension("basic", "empty.bas", "")
|
||||
call TestExtension("vb", "vb1.bas", "Attribute VB_Name = \"Class1\"")
|
||||
call TestExtension("vb", "vb2.bas", "VERSION 5.00\nBegin VB.Form Form1")
|
||||
call TestExtension("vb", "vb2.bas", "VERSION 5.00\nBegin VB.Form Form1")
|
||||
call TestExtension("vb", "vb.sba", "")
|
||||
call TestExtension("vb", "vb.vbs", "")
|
||||
call TestExtension("vb", "vb.dsm", "")
|
||||
call TestExtension("vb", "vb.dsm", "")
|
||||
call TestExtension("vb", "vb.ctl", "")
|
||||
|
||||
" .idr extension
|
||||
call TestExtension("idris", "lowercase.idr", "--idris1")
|
||||
call TestExtension("idris", "uppercase.idr", "--Idris1")
|
||||
call TestExtension("idris", "start-space-l.idr", "-- idris1")
|
||||
call TestExtension("idris", "start-space-u.idr", "-- Idris1")
|
||||
call TestExtension("idris", "two-spaces-l.idr", "-- idris 1")
|
||||
call TestExtension("idris", "two-spaces-u.idr", "-- Idris 1")
|
||||
"call TestExtension("idris", "mypkg.ipkg", "package mypkg\n\npkgs = pruviloj, lightyear")
|
||||
call TestExtension("idris", "use-type-prov.idr", "%language TypeProviders")
|
||||
call TestExtension("idris", "use-elab-refl.idr", "%language ElabReflection")
|
||||
call TestExtension("idris", "access-modifier.idr", "%access export\n\npublic export\nMyTest : Type-> Type\n\nfact : Nat -> Nat")
|
||||
call TestExtension("idris2", "lowercase.idr", "--idris2")
|
||||
call TestExtension("idris2", "uppercase.idr", "--Idris2")
|
||||
call TestExtension("idris2", "start-space-l.idr", "-- idris2")
|
||||
call TestExtension("idris2", "start-space-u.idr", "-- Idris2")
|
||||
call TestExtension("idris2", "two-spaces-l.idr", "-- idris 2")
|
||||
call TestExtension("idris2", "two-spaces-u.idr", "-- Idris 2")
|
||||
call TestExtension("idris2", "mypkg.ipkg", "package mypkg\n\ndepends = effects")
|
||||
call TestExtension("idris2", "use-post-proj.idr", "%language PostfixProjections")
|
||||
|
||||
" .lidr extension
|
||||
call TestExtension("lidris", "lidris-1.lidr", "Some test plaintext\n\n> --idris1\n> myfact : Nat -> Nat\n> myfact Z = 1\n> myfact (S k) = (S k) * myfact k\n\nMore plaintext")
|
||||
call TestExtension("lidris2", "lidris-2.lidr", "Some test plaintext\n\n> --idris2\n> myfact : Nat -> Nat\n> myfact Z = 1\n> myfact (S k) = (S k) * myfact k\n\nMore plaintext")
|
||||
|
||||
|
||||
" .h extension
|
||||
call TestExtension("objcpp", "foo.h", "@interface MTNavigationController : UINavigationController")
|
||||
call TestExtension("cpp", "foo.h", "")
|
||||
let g:c_syntax_for_h = 1
|
||||
call TestExtension("objc", "foo.h", "@interface MTNavigationController : UINavigationController")
|
||||
call TestExtension("c", "foo.h", "")
|
||||
unlet g:c_syntax_for_h
|
||||
let g:ch_syntax_for_h = 1
|
||||
call TestExtension("ch", "foo.h", "")
|
||||
|
||||
@@ -10,14 +10,45 @@ function! TestFiletype(filetype)
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
call TestFiletype('8th')
|
||||
call TestFiletype('haproxy')
|
||||
call TestFiletype('a2ps')
|
||||
call TestFiletype('a65')
|
||||
call TestFiletype('aap')
|
||||
call TestFiletype('abap')
|
||||
call TestFiletype('abaqus')
|
||||
call TestFiletype('abc')
|
||||
call TestFiletype('abel')
|
||||
call TestFiletype('acedb')
|
||||
call TestFiletype('asl')
|
||||
call TestFiletype('ada')
|
||||
call TestFiletype('ahdl')
|
||||
call TestFiletype('aidl')
|
||||
call TestFiletype('alsaconf')
|
||||
call TestFiletype('aml')
|
||||
call TestFiletype('ampl')
|
||||
call TestFiletype('xml')
|
||||
call TestFiletype('ant')
|
||||
call TestFiletype('apache')
|
||||
call TestFiletype('apiblueprint')
|
||||
call TestFiletype('applescript')
|
||||
call TestFiletype('aptconf')
|
||||
call TestFiletype('arch')
|
||||
call TestFiletype('cpp')
|
||||
call TestFiletype('c')
|
||||
call TestFiletype('arduino')
|
||||
call TestFiletype('art')
|
||||
call TestFiletype('asciidoc')
|
||||
call TestFiletype('autohotkey')
|
||||
call TestFiletype('c')
|
||||
call TestFiletype('cpp')
|
||||
call TestFiletype('elf')
|
||||
call TestFiletype('automake')
|
||||
call TestFiletype('asn')
|
||||
call TestFiletype('aspvbs')
|
||||
call TestFiletype('aspperl')
|
||||
call TestFiletype('atlas')
|
||||
call TestFiletype('autoit')
|
||||
call TestFiletype('ave')
|
||||
call TestFiletype('awk')
|
||||
call TestFiletype('caddyfile')
|
||||
call TestFiletype('carp')
|
||||
call TestFiletype('clojure')
|
||||
@@ -49,23 +80,27 @@ call TestFiletype('fennel')
|
||||
call TestFiletype('ferm')
|
||||
call TestFiletype('fish')
|
||||
call TestFiletype('fbs')
|
||||
call TestFiletype('forth')
|
||||
call TestFiletype('glsl')
|
||||
call TestFiletype('fsharp')
|
||||
call TestFiletype('gdscript3')
|
||||
call TestFiletype('gitconfig')
|
||||
call TestFiletype('gitrebase')
|
||||
call TestFiletype('gitsendemail')
|
||||
call TestFiletype('gitcommit')
|
||||
call TestFiletype('glsl')
|
||||
call TestFiletype('gmpl')
|
||||
call TestFiletype('gnuplot')
|
||||
call TestFiletype('go')
|
||||
call TestFiletype('gomod')
|
||||
call TestFiletype('gohtmltmpl')
|
||||
call TestFiletype('javascript')
|
||||
call TestFiletype('flow')
|
||||
call TestFiletype('javascriptreact')
|
||||
call TestFiletype('graphql')
|
||||
call TestFiletype('groovy')
|
||||
call TestFiletype('grub')
|
||||
call TestFiletype('haml')
|
||||
call TestFiletype('mustache')
|
||||
call TestFiletype('haproxy')
|
||||
call TestFiletype('haskell')
|
||||
call TestFiletype('haxe')
|
||||
call TestFiletype('hcl')
|
||||
@@ -74,9 +109,9 @@ call TestFiletype('html')
|
||||
call TestFiletype('i3config')
|
||||
call TestFiletype('icalendar')
|
||||
call TestFiletype('idris')
|
||||
call TestFiletype('idris2')
|
||||
call TestFiletype('lidris2')
|
||||
call TestFiletype('ion')
|
||||
call TestFiletype('javascript')
|
||||
call TestFiletype('flow')
|
||||
call TestFiletype('Jenkinsfile')
|
||||
call TestFiletype('jinja.html')
|
||||
call TestFiletype('jq')
|
||||
@@ -84,7 +119,6 @@ call TestFiletype('json5')
|
||||
call TestFiletype('json')
|
||||
call TestFiletype('jsonnet')
|
||||
call TestFiletype('jst')
|
||||
call TestFiletype('javascriptreact')
|
||||
call TestFiletype('julia')
|
||||
call TestFiletype('kotlin')
|
||||
call TestFiletype('ledger')
|
||||
@@ -95,6 +129,7 @@ call TestFiletype('llvm')
|
||||
call TestFiletype('tablegen')
|
||||
call TestFiletype('log')
|
||||
call TestFiletype('lua')
|
||||
call TestFiletype('m4')
|
||||
call TestFiletype('mako')
|
||||
call TestFiletype('mma')
|
||||
call TestFiletype('markdown')
|
||||
@@ -102,6 +137,7 @@ call TestFiletype('markdown.mdx')
|
||||
call TestFiletype('meson')
|
||||
call TestFiletype('dosini')
|
||||
call TestFiletype('moon')
|
||||
call TestFiletype('murphi')
|
||||
call TestFiletype('nginx')
|
||||
call TestFiletype('nim')
|
||||
call TestFiletype('nix')
|
||||
@@ -119,13 +155,12 @@ call TestFiletype('octave')
|
||||
call TestFiletype('opencl')
|
||||
call TestFiletype('perl')
|
||||
call TestFiletype('sql')
|
||||
call TestFiletype('sql')
|
||||
call TestFiletype('cql')
|
||||
call TestFiletype('php')
|
||||
call TestFiletype('blade')
|
||||
call TestFiletype('plantuml')
|
||||
call TestFiletype('pony')
|
||||
call TestFiletype('powershell')
|
||||
call TestFiletype('ps1')
|
||||
call TestFiletype('ps1xml')
|
||||
call TestFiletype('proto')
|
||||
call TestFiletype('pug')
|
||||
@@ -181,13 +216,19 @@ call TestFiletype('vala')
|
||||
call TestFiletype('vbnet')
|
||||
call TestFiletype('vcl')
|
||||
call TestFiletype('velocity')
|
||||
call TestFiletype('vmasm')
|
||||
call TestFiletype('vue')
|
||||
call TestFiletype('xdc')
|
||||
call TestFiletype('xml')
|
||||
call TestFiletype('xsl')
|
||||
call TestFiletype('yaml')
|
||||
call TestFiletype('yaml.ansible')
|
||||
call TestFiletype('helm')
|
||||
call TestFiletype('help')
|
||||
call TestFiletype('zephir')
|
||||
call TestFiletype('zig')
|
||||
call TestFiletype('zir')
|
||||
call TestFiletype('zig')
|
||||
call TestFiletype('trasys')
|
||||
call TestFiletype('basic')
|
||||
call TestFiletype('vb')
|
||||
call TestFiletype('dosini')
|
||||
call TestFiletype('odin')
|
||||
|
||||
339
syntax/8th.vim
Normal file
339
syntax/8th.vim
Normal file
@@ -0,0 +1,339 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '8th') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: 8th
|
||||
" Version: 19.01d
|
||||
" Maintainer: Ron Aaron <ron@aaron-tech.com>
|
||||
" URL: https://8th-dev.com/
|
||||
" Filetypes: *.8th
|
||||
" NOTE: You should also have the ftplugin/8th.vim file to set 'isk'
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
finish
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
syn clear
|
||||
" Synchronization method
|
||||
syn sync ccomment
|
||||
syn sync maxlines=100
|
||||
syn case match
|
||||
syn match eighthColonName "\S\+" contained
|
||||
syn match eighthColonDef ":\s\+\S\+" contains=eighthColonName
|
||||
|
||||
" new words
|
||||
syn match eighthClasses "\<\S\+:" contained
|
||||
syn match eighthClassWord "\<\S\+:.\+" contains=eighthClasses
|
||||
|
||||
syn keyword eighthEndOfColonDef ; i;
|
||||
syn keyword eighthDefine var var,
|
||||
|
||||
" Built in words
|
||||
com! -nargs=+ Builtin syn keyword eighthBuiltin <args>
|
||||
"Builtin ^ < <# <#> = > - -- ,# ; ;; ! ??? / . .# ' () @ * */ \
|
||||
|
||||
Builtin ! G:! #! G:#! ## G:## #> G:#> #if G:#if ' G:' ( G:( (* G:(* (:) G:(:) (code) G:(code) (getc) G:(getc)
|
||||
Builtin (gets) G:(gets) (interp) G:(interp) (needs) G:(needs) (putc) G:(putc) (puts) G:(puts) (putslim) G:(putslim)
|
||||
Builtin (say) G:(say) (stat) G:(stat) ) G:) +listener G:+listener +ref G:+ref ,# G:,# -- G:-- -----BEGIN G:-----BEGIN
|
||||
Builtin -Inf G:-Inf -Inf? G:-Inf? -listener G:-listener -ref G:-ref -rot G:-rot . G:. .# G:.# .needs G:.needs
|
||||
Builtin .r G:.r .s G:.s .stats G:.stats .ver G:.ver .with G:.with 0; G:0; 2dip G:2dip 2drop G:2drop
|
||||
Builtin 2dup G:2dup 2over G:2over 2swap G:2swap 3drop G:3drop 4drop G:4drop 8thdt? G:8thdt? 8thver? G:8thver?
|
||||
Builtin : G:: ; G:; ;; G:;; ;;; G:;;; ;then G:;then ;with G:;with <# G:<# <#> G:<#> >clip G:>clip >json G:>json
|
||||
Builtin >kind G:>kind >n G:>n >r G:>r >s G:>s ?: G:?: ??? G:??? @ G:@ Inf G:Inf Inf? G:Inf? NaN G:NaN
|
||||
Builtin NaN? G:NaN? SED-CHECK G:SED-CHECK SED: G:SED: SED: G:SED: \ G:\ ` G:` `` G:`` actor: G:actor:
|
||||
Builtin again G:again ahead G:ahead and G:and appname G:appname apropos G:apropos argc G:argc args G:args
|
||||
Builtin array? G:array? assert G:assert base G:base bi G:bi bits G:bits break G:break break? G:break?
|
||||
Builtin build? G:build? buildver? G:buildver? bye G:bye c# G:c# c/does G:c/does case G:case caseof G:caseof
|
||||
Builtin chdir G:chdir clip> G:clip> clone G:clone clone-shallow G:clone-shallow cold G:cold compat-level G:compat-level
|
||||
Builtin compile G:compile compile? G:compile? conflict G:conflict const G:const container? G:container?
|
||||
Builtin cr G:cr curlang G:curlang curry G:curry curry: G:curry: decimal G:decimal defer: G:defer: deg>rad G:deg>rad
|
||||
Builtin depth G:depth die G:die dip G:dip drop G:drop dstack G:dstack dump G:dump dup G:dup dup? G:dup?
|
||||
Builtin else G:else enum: G:enum: eval G:eval eval! G:eval! eval0 G:eval0 execnull G:execnull expect G:expect
|
||||
Builtin extra! G:extra! extra@ G:extra@ false G:false fnv G:fnv fourth G:fourth free G:free func: G:func:
|
||||
Builtin getc G:getc getcwd G:getcwd getenv G:getenv gets G:gets handler G:handler header G:header help G:help
|
||||
Builtin hex G:hex i: G:i: i; G:i; if G:if if; G:if; isa? G:isa? items-used G:items-used jcall G:jcall
|
||||
Builtin jclass G:jclass jmethod G:jmethod json-nesting G:json-nesting json-pretty G:json-pretty json-throw G:json-throw
|
||||
Builtin json> G:json> k32 G:k32 keep G:keep l: G:l: last G:last lib G:lib libbin G:libbin libc G:libc
|
||||
Builtin listener@ G:listener@ literal G:literal locals: G:locals: lock G:lock lock-to G:lock-to locked? G:locked?
|
||||
Builtin log G:log log-async G:log-async log-task G:log-task log-time G:log-time log-time-local G:log-time-local
|
||||
Builtin long-days G:long-days long-months G:long-months loop G:loop loop- G:loop- map? G:map? mark G:mark
|
||||
Builtin mark? G:mark? memfree G:memfree mobile? G:mobile? n# G:n# name>os G:name>os name>sem G:name>sem
|
||||
Builtin ndrop G:ndrop needs G:needs new G:new next-arg G:next-arg nip G:nip noop G:noop not G:not ns G:ns
|
||||
Builtin ns: G:ns: ns>ls G:ns>ls ns>s G:ns>s ns? G:ns? null G:null null; G:null; null? G:null? number? G:number?
|
||||
Builtin off G:off on G:on onexit G:onexit only G:only op! G:op! or G:or os G:os os-names G:os-names
|
||||
Builtin os>long-name G:os>long-name os>name G:os>name over G:over p: G:p: pack G:pack parse G:parse
|
||||
Builtin parsech G:parsech parseln G:parseln parsews G:parsews pick G:pick poke G:poke pool-clear G:pool-clear
|
||||
Builtin prior G:prior private G:private process-args G:process-args prompt G:prompt public G:public
|
||||
Builtin putc G:putc puts G:puts putslim G:putslim quote G:quote r! G:r! r> G:r> r@ G:r@ rad>deg G:rad>deg
|
||||
Builtin rand G:rand rand-pcg G:rand-pcg rand-pcg-seed G:rand-pcg-seed randbuf G:randbuf randbuf-pcg G:randbuf-pcg
|
||||
Builtin rdrop G:rdrop recurse G:recurse recurse-stack G:recurse-stack ref@ G:ref@ reg! G:reg! reg@ G:reg@
|
||||
Builtin regbin@ G:regbin@ remaining-args G:remaining-args repeat G:repeat reset G:reset roll G:roll
|
||||
Builtin rop! G:rop! rot G:rot rpick G:rpick rroll G:rroll rstack G:rstack rswap G:rswap rusage G:rusage
|
||||
Builtin s>ns G:s>ns same? G:same? scriptdir G:scriptdir scriptfile G:scriptfile sem G:sem sem-post G:sem-post
|
||||
Builtin sem-rm G:sem-rm sem-wait G:sem-wait sem-wait? G:sem-wait? sem>name G:sem>name semi-throw G:semi-throw
|
||||
Builtin set-wipe G:set-wipe setenv G:setenv settings! G:settings! settings![] G:settings![] settings@ G:settings@
|
||||
Builtin settings@? G:settings@? settings@[] G:settings@[] sh G:sh sh$ G:sh$ short-days G:short-days
|
||||
Builtin short-months G:short-months sleep G:sleep space G:space stack-check G:stack-check stack-size G:stack-size
|
||||
Builtin step G:step string? G:string? struct: G:struct: swap G:swap syslang G:syslang sysregion G:sysregion
|
||||
Builtin tab-hook G:tab-hook tell-conflict G:tell-conflict tempdir G:tempdir tempfilename G:tempfilename
|
||||
Builtin then G:then third G:third throw G:throw thrownull G:thrownull times G:times tlog G:tlog tri G:tri
|
||||
Builtin true G:true tuck G:tuck type-check G:type-check typeassert G:typeassert unlock G:unlock unpack G:unpack
|
||||
Builtin until G:until until! G:until! var G:var var, G:var, while G:while while! G:while! with: G:with:
|
||||
Builtin words G:words words-like G:words-like words/ G:words/ xchg G:xchg xor G:xor >auth HTTP:>auth
|
||||
Builtin sh I:sh tpush I:tpush trace-word I:trace-word call JSONRPC:call auth-string OAuth:auth-string
|
||||
Builtin gen-nonce OAuth:gen-nonce params OAuth:params call SOAP:call ! a:! + a:+ - a:- 2each a:2each
|
||||
Builtin 2map a:2map 2map+ a:2map+ 2map= a:2map= = a:= >map a:>map @ a:@ @@ a:@@ bsearch a:bsearch clear a:clear
|
||||
Builtin close a:close diff a:diff dot a:dot each a:each each-slice a:each-slice exists? a:exists? filter a:filter
|
||||
Builtin generate a:generate group a:group indexof a:indexof insert a:insert intersect a:intersect join a:join
|
||||
Builtin len a:len map a:map map+ a:map+ map= a:map= mean a:mean mean&variance a:mean&variance new a:new
|
||||
Builtin op a:op op! a:op! op= a:op= open a:open pop a:pop push a:push qsort a:qsort randeach a:randeach
|
||||
Builtin reduce a:reduce reduce+ a:reduce+ rev a:rev shift a:shift shuffle a:shuffle slice a:slice slice+ a:slice+
|
||||
Builtin slide a:slide sort a:sort union a:union when a:when when! a:when! x a:x x-each a:x-each xchg a:xchg
|
||||
Builtin y a:y zip a:zip 8thdir app:8thdir asset app:asset atrun app:atrun atrun app:atrun atrun app:atrun
|
||||
Builtin basedir app:basedir current app:current datadir app:datadir exename app:exename isgui app:isgui
|
||||
Builtin main app:main oncrash app:oncrash orientation app:orientation pid app:pid restart app:restart
|
||||
Builtin resumed app:resumed shared? app:shared? standalone app:standalone subdir app:subdir suspended app:suspended
|
||||
Builtin sysquit app:sysquit (here) asm:(here) >n asm:>n avail asm:avail c, asm:c, here! asm:here! n> asm:n>
|
||||
Builtin used asm:used w, asm:w, ! b:! + b:+ / b:/ = b:= >base64 b:>base64 >hex b:>hex >mpack b:>mpack
|
||||
Builtin @ b:@ append b:append base64> b:base64> bit! b:bit! bit@ b:bit@ clear b:clear compress b:compress
|
||||
Builtin conv b:conv each b:each each-slice b:each-slice expand b:expand fill b:fill getb b:getb hex> b:hex>
|
||||
Builtin len b:len mem> b:mem> move b:move mpack-date b:mpack-date mpack-ignore b:mpack-ignore mpack> b:mpack>
|
||||
Builtin new b:new op b:op rev b:rev search b:search shmem b:shmem slice b:slice splice b:splice ungetb b:ungetb
|
||||
Builtin writable b:writable xor b:xor +block bc:+block .blocks bc:.blocks add-block bc:add-block block-hash bc:block-hash
|
||||
Builtin block@ bc:block@ first-block bc:first-block hash bc:hash last-block bc:last-block load bc:load
|
||||
Builtin new bc:new save bc:save set-sql bc:set-sql validate bc:validate validate-block bc:validate-block
|
||||
Builtin add bloom:add filter bloom:filter in? bloom:in? accept bt:accept ch! bt:ch! ch@ bt:ch@ connect bt:connect
|
||||
Builtin disconnect bt:disconnect err? bt:err? leconnect bt:leconnect lescan bt:lescan listen bt:listen
|
||||
Builtin on? bt:on? read bt:read scan bt:scan service? bt:service? services? bt:services? write bt:write
|
||||
Builtin * c:* * c:* + c:+ + c:+ = c:= = c:= >ri c:>ri >ri c:>ri abs c:abs abs c:abs arg c:arg arg c:arg
|
||||
Builtin conj c:conj conj c:conj im c:im n> c:n> new c:new new c:new re c:re >aes128gcm cr:>aes128gcm
|
||||
Builtin >aes256gcm cr:>aes256gcm >cp cr:>cp >cpe cr:>cpe >decrypt cr:>decrypt >edbox cr:>edbox >encrypt cr:>encrypt
|
||||
Builtin >nbuf cr:>nbuf >rsabox cr:>rsabox >uuid cr:>uuid CBC cr:CBC CFB cr:CFB CTR cr:CTR ECB cr:ECB
|
||||
Builtin GCM cr:GCM OFB cr:OFB aad? cr:aad? aes128box-sig cr:aes128box-sig aes128gcm> cr:aes128gcm>
|
||||
Builtin aes256box-sig cr:aes256box-sig aes256gcm> cr:aes256gcm> aesgcm cr:aesgcm blakehash cr:blakehash
|
||||
Builtin chacha20box-sig cr:chacha20box-sig chachapoly cr:chachapoly cipher! cr:cipher! cipher@ cr:cipher@
|
||||
Builtin cp> cr:cp> cpe> cr:cpe> decrypt cr:decrypt decrypt+ cr:decrypt+ decrypt> cr:decrypt> dh-genkey cr:dh-genkey
|
||||
Builtin dh-secret cr:dh-secret dh-sign cr:dh-sign dh-verify cr:dh-verify ebox-sig cr:ebox-sig ecc-genkey cr:ecc-genkey
|
||||
Builtin ecc-secret cr:ecc-secret ecc-sign cr:ecc-sign ecc-verify cr:ecc-verify edbox-sig cr:edbox-sig
|
||||
Builtin edbox> cr:edbox> encrypt cr:encrypt encrypt+ cr:encrypt+ encrypt> cr:encrypt> ensurekey cr:ensurekey
|
||||
Builtin err? cr:err? gcm-tag-size cr:gcm-tag-size genkey cr:genkey hash cr:hash hash! cr:hash! hash+ cr:hash+
|
||||
Builtin hash>b cr:hash>b hash>s cr:hash>s hash@ cr:hash@ hmac cr:hmac hotp cr:hotp iv? cr:iv? mode cr:mode
|
||||
Builtin mode@ cr:mode@ randkey cr:randkey restore cr:restore root-certs cr:root-certs rsa_decrypt cr:rsa_decrypt
|
||||
Builtin rsa_encrypt cr:rsa_encrypt rsa_sign cr:rsa_sign rsa_verify cr:rsa_verify rsabox-sig cr:rsabox-sig
|
||||
Builtin rsabox> cr:rsabox> rsagenkey cr:rsagenkey save cr:save sbox-sig cr:sbox-sig sha1-hmac cr:sha1-hmac
|
||||
Builtin shard cr:shard tag? cr:tag? totp cr:totp totp-epoch cr:totp-epoch totp-time-step cr:totp-time-step
|
||||
Builtin unshard cr:unshard uuid cr:uuid uuid> cr:uuid> validate-pgp-sig cr:validate-pgp-sig (.hebrew) d:(.hebrew)
|
||||
Builtin (.islamic) d:(.islamic) + d:+ +day d:+day +hour d:+hour +min d:+min +msec d:+msec - d:- .hebrew d:.hebrew
|
||||
Builtin .islamic d:.islamic .time d:.time / d:/ = d:= >fixed d:>fixed >hebepoch d:>hebepoch >msec d:>msec
|
||||
Builtin >unix d:>unix >ymd d:>ymd Adar d:Adar Adar2 d:Adar2 Adar2 d:Adar2 Av d:Av Elul d:Elul Fri d:Fri
|
||||
Builtin Heshvan d:Heshvan Iyar d:Iyar Kislev d:Kislev Mon d:Mon Nissan d:Nissan Sat d:Sat Shevat d:Shevat
|
||||
Builtin Sivan d:Sivan Sun d:Sun Tammuz d:Tammuz Tevet d:Tevet Thu d:Thu Tishrei d:Tishrei Tue d:Tue
|
||||
Builtin Wed d:Wed adjust-dst d:adjust-dst between d:between d. d:d. dawn d:dawn days-in-hebrew-year d:days-in-hebrew-year
|
||||
Builtin displaying-hebrew d:displaying-hebrew do-dawn d:do-dawn do-dusk d:do-dusk do-rise d:do-rise
|
||||
Builtin doy d:doy dst? d:dst? dstquery d:dstquery dstzones? d:dstzones? dusk d:dusk elapsed-timer d:elapsed-timer
|
||||
Builtin elapsed-timer-seconds d:elapsed-timer-seconds first-dow d:first-dow fixed> d:fixed> fixed>dow d:fixed>dow
|
||||
Builtin fixed>hebrew d:fixed>hebrew fixed>islamic d:fixed>islamic format d:format hanukkah d:hanukkah
|
||||
Builtin hebrew-epoch d:hebrew-epoch hebrew>fixed d:hebrew>fixed hebrewtoday d:hebrewtoday hmonth-name d:hmonth-name
|
||||
Builtin islamic.epoch d:islamic.epoch islamic>fixed d:islamic>fixed islamictoday d:islamictoday join d:join
|
||||
Builtin last-day-of-hebrew-month d:last-day-of-hebrew-month last-dow d:last-dow last-month d:last-month
|
||||
Builtin last-week d:last-week last-year d:last-year latitude d:latitude longitude d:longitude longitude d:longitude
|
||||
Builtin msec d:msec msec> d:msec> new d:new next-dow d:next-dow next-month d:next-month next-week d:next-week
|
||||
Builtin next-year d:next-year number>hebrew d:number>hebrew omer d:omer parse d:parse pesach d:pesach
|
||||
Builtin prev-dow d:prev-dow purim d:purim rosh-chodesh? d:rosh-chodesh? rosh-hashanah d:rosh-hashanah
|
||||
Builtin shavuot d:shavuot start-timer d:start-timer sunrise d:sunrise taanit-esther d:taanit-esther
|
||||
Builtin ticks d:ticks ticks/sec d:ticks/sec timer d:timer tisha-beav d:tisha-beav tzadjust d:tzadjust
|
||||
Builtin unix> d:unix> updatetz d:updatetz year@ d:year@ ymd d:ymd ymd> d:ymd> yom-haatsmaut d:yom-haatsmaut
|
||||
Builtin yom-kippur d:yom-kippur add-func db:add-func bind db:bind close db:close col db:col col[] db:col[]
|
||||
Builtin col{} db:col{} err? db:err? errmsg db:errmsg exec db:exec exec-cb db:exec-cb key db:key mysql? db:mysql?
|
||||
Builtin odbc? db:odbc? open db:open open? db:open? prepare db:prepare query db:query query-all db:query-all
|
||||
Builtin rekey db:rekey sqlerrmsg db:sqlerrmsg bp dbg:bp except-task@ dbg:except-task@ go dbg:go line-info dbg:line-info
|
||||
Builtin prompt dbg:prompt stop dbg:stop trace dbg:trace trace-enter dbg:trace-enter trace-leave dbg:trace-leave
|
||||
Builtin abspath f:abspath append f:append associate f:associate atime f:atime canwrite? f:canwrite?
|
||||
Builtin chmod f:chmod close f:close copy f:copy copydir f:copydir create f:create ctime f:ctime dir? f:dir?
|
||||
Builtin dname f:dname eachbuf f:eachbuf eachline f:eachline enssep f:enssep eof? f:eof? err? f:err?
|
||||
Builtin exists? f:exists? flush f:flush fname f:fname getb f:getb getc f:getc getline f:getline getmod f:getmod
|
||||
Builtin glob f:glob glob-nocase f:glob-nocase include f:include launch f:launch link f:link link> f:link>
|
||||
Builtin link? f:link? mkdir f:mkdir mmap f:mmap mmap-range f:mmap-range mmap-range? f:mmap-range? mtime f:mtime
|
||||
Builtin mv f:mv open f:open open-ro f:open-ro popen f:popen print f:print read f:read relpath f:relpath
|
||||
Builtin rglob f:rglob rm f:rm rmdir f:rmdir seek f:seek sep f:sep show f:show size f:size slurp f:slurp
|
||||
Builtin stderr f:stderr stdin f:stdin stdout f:stdout tell f:tell times f:times trash f:trash ungetb f:ungetb
|
||||
Builtin ungetc f:ungetc unzip f:unzip unzip-entry f:unzip-entry watch f:watch write f:write writen f:writen
|
||||
Builtin zip+ f:zip+ zip@ f:zip@ zipentry f:zipentry zipnew f:zipnew zipopen f:zipopen zipsave f:zipsave
|
||||
Builtin bold font:bold face? font:face? glyph-path font:glyph-path glyph-pos font:glyph-pos info font:info
|
||||
Builtin italic font:italic ls font:ls measure font:measure new font:new pixels font:pixels pixels? font:pixels?
|
||||
Builtin points font:points points? font:points? styles font:styles styles? font:styles? underline font:underline
|
||||
Builtin +child g:+child +kind g:+kind +path g:+path -child g:-child /path g:/path >img g:>img >progress g:>progress
|
||||
Builtin add-items g:add-items adjustwidth g:adjustwidth allow-orient g:allow-orient arc g:arc arc2 g:arc2
|
||||
Builtin autohide g:autohide back g:back bezier g:bezier bg g:bg bg? g:bg? bounds g:bounds bounds? g:bounds?
|
||||
Builtin box-label g:box-label btn-font g:btn-font bubble g:bubble button-size g:button-size buttons-visible g:buttons-visible
|
||||
Builtin c-text g:c-text callout g:callout center g:center child g:child clear g:clear clearpath g:clearpath
|
||||
Builtin clr>n g:clr>n coleven g:coleven colordlg g:colordlg colwidth g:colwidth connectededges g:connectededges
|
||||
Builtin contrasting g:contrasting cp g:cp curmouse? g:curmouse? default-font g:default-font deselect-row g:deselect-row
|
||||
Builtin dismiss g:dismiss do g:do draw-fitted-text g:draw-fitted-text draw-text g:draw-text draw-text-at g:draw-text-at
|
||||
Builtin each g:each edit-on-double-click g:edit-on-double-click editable g:editable editdlg g:editdlg
|
||||
Builtin empty-text g:empty-text enable g:enable enabled? g:enabled? fade g:fade fb-files g:fb-files
|
||||
Builtin fcolor g:fcolor fg g:fg fg? g:fg? file-filter g:file-filter file-name g:file-name filedlg g:filedlg
|
||||
Builtin fill g:fill fillall g:fillall fit-text g:fit-text flex! g:flex! focus g:focus fontdlg g:fontdlg
|
||||
Builtin forward g:forward fullscreen g:fullscreen get-lasso-items g:get-lasso-items get-tab g:get-tab
|
||||
Builtin getclr g:getclr getfont g:getfont getimage g:getimage getpath g:getpath getroot g:getroot gradient g:gradient
|
||||
Builtin gui? g:gui? handle g:handle headerheight g:headerheight hide g:hide image g:image image-at g:image-at
|
||||
Builtin invalidate g:invalidate ix? g:ix? justify g:justify keyinfo g:keyinfo l-text g:l-text laf g:laf
|
||||
Builtin laf! g:laf! laf? g:laf? len g:len line-width g:line-width lineto g:lineto list+ g:list+ list- g:list-
|
||||
Builtin loadcontent g:loadcontent localize g:localize m! g:m! m@ g:m@ menu-font g:menu-font menu-update g:menu-update
|
||||
Builtin menuenabled g:menuenabled mouse? g:mouse? mousepos? g:mousepos? moveto g:moveto msgdlg g:msgdlg
|
||||
Builtin multi g:multi name g:name named-skin g:named-skin new g:new new-laf g:new-laf next g:next obj g:obj
|
||||
Builtin on g:on on? g:on? ontop g:ontop oshandle g:oshandle outlinethickness g:outlinethickness panel-size g:panel-size
|
||||
Builtin panel-size? g:panel-size? parent g:parent path g:path path>s g:path>s pie g:pie pix! g:pix!
|
||||
Builtin pop g:pop popmenu g:popmenu pos? g:pos? prev g:prev propval! g:propval! propval@ g:propval@
|
||||
Builtin push g:push qbezier g:qbezier quit g:quit r-text g:r-text readonly g:readonly rect g:rect refresh g:refresh
|
||||
Builtin restore g:restore root g:root root-item-visible g:root-item-visible rotate g:rotate rowheight g:rowheight
|
||||
Builtin rrect g:rrect s>path g:s>path save g:save say g:say scale g:scale scolor g:scolor scrollthickness g:scrollthickness
|
||||
Builtin sectionenable g:sectionenable select! g:select! select@ g:select@ selected-rows g:selected-rows
|
||||
Builtin set-lasso g:set-lasso set-long-press g:set-long-press set-popup-font g:set-popup-font set-range g:set-range
|
||||
Builtin set-swipe g:set-swipe set-value g:set-value setcursor g:setcursor setfont g:setfont setheader g:setheader
|
||||
Builtin sethtml g:sethtml setimage g:setimage setname g:setname setroot g:setroot settab g:settab show g:show
|
||||
Builtin show-line-numbers g:show-line-numbers show-pct g:show-pct showmenu g:showmenu showtooltip g:showtooltip
|
||||
Builtin size g:size size? g:size? skin g:skin skin-class g:skin-class stackix g:stackix state g:state
|
||||
Builtin state? g:state? stepsize g:stepsize stroke g:stroke stroke-fill g:stroke-fill style g:style
|
||||
Builtin tabname g:tabname text g:text text-box-style g:text-box-style text? g:text? textcolor g:textcolor
|
||||
Builtin textsize g:textsize timer! g:timer! timer@ g:timer@ toback g:toback tofront g:tofront toggle-row g:toggle-row
|
||||
Builtin tooltip g:tooltip top g:top transition g:transition translate g:translate tree-open g:tree-open
|
||||
Builtin triangle g:triangle update g:update updateitems g:updateitems url g:url user g:user user! g:user!
|
||||
Builtin vertical g:vertical view g:view visible? g:visible? vpos! g:vpos! vpos@ g:vpos@ waitcursor g:waitcursor
|
||||
Builtin winding g:winding xy g:xy xy? g:xy? +edge gr:+edge +edge+w gr:+edge+w +node gr:+node connect gr:connect
|
||||
Builtin edges gr:edges m! gr:m! m@ gr:m@ neighbors gr:neighbors new gr:new node-edges gr:node-edges
|
||||
Builtin nodes gr:nodes traverse gr:traverse + h:+ clear h:clear len h:len new h:new peek h:peek pop h:pop
|
||||
Builtin push h:push unique h:unique arm? hw:arm? camera hw:camera camera-fmt hw:camera-fmt camera-img hw:camera-img
|
||||
Builtin camera? hw:camera? cpu? hw:cpu? device? hw:device? displays? hw:displays? displaysize? hw:displaysize?
|
||||
Builtin err? hw:err? gpio hw:gpio gpio! hw:gpio! gpio-mmap hw:gpio-mmap gpio@ hw:gpio@ i2c hw:i2c i2c! hw:i2c!
|
||||
Builtin i2c!reg hw:i2c!reg i2c@ hw:i2c@ i2c@reg hw:i2c@reg isround? hw:isround? iswatch? hw:iswatch?
|
||||
Builtin mac? hw:mac? mem? hw:mem? poll hw:poll sensor hw:sensor start hw:start stop hw:stop fetch-full imap:fetch-full
|
||||
Builtin fetch-uid-mail imap:fetch-uid-mail login imap:login new imap:new select-inbox imap:select-inbox
|
||||
Builtin >file img:>file copy img:copy crop img:crop data img:data desat img:desat fill img:fill filter img:filter
|
||||
Builtin flip img:flip from-svg img:from-svg new img:new pix! img:pix! pix@ img:pix@ qr-gen img:qr-gen
|
||||
Builtin qr-parse img:qr-parse rotate img:rotate scale img:scale scroll img:scroll size img:size countries iso:countries
|
||||
Builtin find loc:find sort loc:sort ! m:! !? m:!? + m:+ +? m:+? - m:- @ m:@ @? m:@? @@ m:@@ clear m:clear
|
||||
Builtin data m:data each m:each exists? m:exists? iter m:iter iter-all m:iter-all keys m:keys len m:len
|
||||
Builtin map m:map new m:new op! m:op! open m:open vals m:vals xchg m:xchg ! mat:! * mat:* + mat:+ = mat:=
|
||||
Builtin @ mat:@ col mat:col data mat:data det mat:det dim? mat:dim? get-n mat:get-n ident mat:ident
|
||||
Builtin m. mat:m. minor mat:minor n* mat:n* new mat:new row mat:row same-size? mat:same-size? trans mat:trans
|
||||
Builtin ! n:! * n:* */ n:*/ + n:+ +! n:+! - n:- / n:/ /mod n:/mod 1+ n:1+ 1- n:1- < n:< = n:= > n:>
|
||||
Builtin BIGE n:BIGE BIGPI n:BIGPI E n:E PI n:PI ^ n:^ abs n:abs acos n:acos acos n:acos asin n:asin
|
||||
Builtin asin n:asin atan n:atan atan n:atan atan2 n:atan2 band n:band between n:between bfloat n:bfloat
|
||||
Builtin bic n:bic bint n:bint binv n:binv bnot n:bnot bor n:bor bxor n:bxor ceil n:ceil clamp n:clamp
|
||||
Builtin cmp n:cmp comb n:comb cos n:cos cosd n:cosd exp n:exp expmod n:expmod float n:float floor n:floor
|
||||
Builtin fmod n:fmod frac n:frac gcd n:gcd int n:int invmod n:invmod kind? n:kind? lcm n:lcm ln n:ln
|
||||
Builtin max n:max median n:median min n:min mod n:mod neg n:neg odd? n:odd? perm n:perm prime? n:prime?
|
||||
Builtin quantize n:quantize quantize! n:quantize! r+ n:r+ range n:range rot32l n:rot32l rot32r n:rot32r
|
||||
Builtin round n:round round2 n:round2 running-variance n:running-variance running-variance-finalize n:running-variance-finalize
|
||||
Builtin sgn n:sgn shl n:shl shr n:shr sin n:sin sind n:sind sqr n:sqr sqrt n:sqrt tan n:tan tand n:tand
|
||||
Builtin trunc n:trunc ~= n:~= ! net:! >url net:>url @ net:@ DGRAM net:DGRAM INET4 net:INET4 INET6 net:INET6
|
||||
Builtin PROTO_TCP net:PROTO_TCP PROTO_UDP net:PROTO_UDP STREAM net:STREAM accept net:accept addrinfo>o net:addrinfo>o
|
||||
Builtin again? net:again? alloc-and-read net:alloc-and-read alloc-buf net:alloc-buf bind net:bind browse net:browse
|
||||
Builtin close net:close connect net:connect err>s net:err>s err? net:err? get net:get getaddrinfo net:getaddrinfo
|
||||
Builtin getpeername net:getpeername head net:head ifaces? net:ifaces? listen net:listen net-socket net:net-socket
|
||||
Builtin opts net:opts port-is-ssl? net:port-is-ssl? post net:post proxy! net:proxy! read net:read recvfrom net:recvfrom
|
||||
Builtin s>url net:s>url sendto net:sendto server net:server setsockopt net:setsockopt socket net:socket
|
||||
Builtin tlshello net:tlshello url> net:url> user-agent net:user-agent wait net:wait write net:write
|
||||
Builtin MAX ns:MAX cast ptr:cast len ptr:len pack ptr:pack unpack ptr:unpack unpack_orig ptr:unpack_orig
|
||||
Builtin + q:+ clear q:clear len q:len new q:new notify q:notify overwrite q:overwrite peek q:peek pick q:pick
|
||||
Builtin pop q:pop push q:push shift q:shift size q:size slide q:slide throwing q:throwing wait q:wait
|
||||
Builtin ++match r:++match +/ r:+/ +match r:+match / r:/ @ r:@ err? r:err? len r:len match r:match new r:new
|
||||
Builtin rx r:rx str r:str ! s:! * s:* + s:+ - s:- / s:/ /scripts s:/scripts <+ s:<+ = s:= =ic s:=ic
|
||||
Builtin >base64 s:>base64 >ucs2 s:>ucs2 @ s:@ append s:append base64> s:base64> clear s:clear cmp s:cmp
|
||||
Builtin cmpi s:cmpi compress s:compress days! s:days! each s:each eachline s:eachline expand s:expand
|
||||
Builtin fill s:fill fmt s:fmt gershayim s:gershayim globmatch s:globmatch hexupr s:hexupr insert s:insert
|
||||
Builtin intl s:intl intl! s:intl! lang s:lang lc s:lc len s:len lsub s:lsub ltrim s:ltrim map s:map
|
||||
Builtin months! s:months! new s:new replace s:replace replace! s:replace! rev s:rev rsearch s:rsearch
|
||||
Builtin rsub s:rsub rtrim s:rtrim script? s:script? search s:search size s:size slice s:slice strfmap s:strfmap
|
||||
Builtin strfmt s:strfmt trim s:trim tsub s:tsub uc s:uc ucs2> s:ucs2> utf8? s:utf8? zt s:zt close sio:close
|
||||
Builtin enum sio:enum open sio:open opts! sio:opts! opts@ sio:opts@ read sio:read write sio:write new smtp:new
|
||||
Builtin send smtp:send apply-filter snd:apply-filter devices? snd:devices? end-record snd:end-record
|
||||
Builtin filter snd:filter formats? snd:formats? freq snd:freq gain snd:gain gain? snd:gain? len snd:len
|
||||
Builtin loop snd:loop mix snd:mix new snd:new pause snd:pause play snd:play played snd:played rate snd:rate
|
||||
Builtin record snd:record seek snd:seek stop snd:stop stopall snd:stopall unmix snd:unmix volume snd:volume
|
||||
Builtin volume? snd:volume? + st:+ . st:. clear st:clear len st:len ndrop st:ndrop new st:new op! st:op!
|
||||
Builtin peek st:peek pick st:pick pop st:pop push st:push roll st:roll shift st:shift size st:size
|
||||
Builtin slide st:slide swap st:swap throwing st:throwing >buf struct:>buf arr> struct:arr> buf struct:buf
|
||||
Builtin buf> struct:buf> byte struct:byte double struct:double field! struct:field! field@ struct:field@
|
||||
Builtin float struct:float ignore struct:ignore int struct:int long struct:long struct; struct:struct;
|
||||
Builtin word struct:word ! t:! @ t:@ assign t:assign curtask t:curtask def-queue t:def-queue def-stack t:def-stack
|
||||
Builtin done? t:done? err! t:err! err? t:err? getq t:getq guitask t:guitask handler t:handler kill t:kill
|
||||
Builtin list t:list main t:main name! t:name! name@ t:name@ notify t:notify pop t:pop priority t:priority
|
||||
Builtin push t:push push< t:push< q-notify t:q-notify q-wait t:q-wait qlen t:qlen result t:result task t:task
|
||||
Builtin task-n t:task-n task-stop t:task-stop wait t:wait ! w:! @ w:@ alias: w:alias: cb w:cb deprecate w:deprecate
|
||||
Builtin exec w:exec exec? w:exec? ffifail w:ffifail find w:find forget w:forget is w:is undo w:undo
|
||||
Builtin >s xml:>s >txt xml:>txt parse xml:parse parse-html xml:parse-html parse-stream xml:parse-stream
|
||||
Builtin getmsg[] zmq:getmsg[] sendmsg[] zmq:sendmsg[]
|
||||
" numbers
|
||||
syn keyword eighthMath decimal hex base@ base!
|
||||
syn match eighthInteger '\<-\=[0-9.]*[0-9.]\+\>'
|
||||
" recognize hex and binary numbers, the '$' and '%' notation is for eighth
|
||||
syn match eighthInteger '\<\$\x*\x\+\>' " *1* --- dont't mess
|
||||
syn match eighthInteger '\<\x*\d\x*\>' " *2* --- this order!
|
||||
syn match eighthInteger '\<%[0-1]*[0-1]\+\>'
|
||||
syn match eighthInteger "\<'.\>"
|
||||
|
||||
" Strings
|
||||
syn region eighthString start=+\.\?\"+ skip=+"+ end=+$+
|
||||
syn keyword jsonNull null
|
||||
syn keyword jsonBool /\(true\|false\)/
|
||||
syn region eighthString start=/\<"/ end=/"\>/
|
||||
syn match jsonObjEntry /"\"[^"]\+\"\ze\s*:/
|
||||
|
||||
"syn region jsonObject start=/{/ end=/}/ contained contains=jsonObjEntry,jsonArray,jsonObject, jsonBool, eighthString
|
||||
"syn region jsonArray start=/\[/ end=/\]/ contained contains=jsonArray,jsonObject, jsonBool, eighthString
|
||||
|
||||
" Include files
|
||||
" syn match eighthInclude '\<\(libinclude\|include\|needs\)\s\+\S\+'
|
||||
syn region eighthComment start="\zs\\" end="$" contains=eighthTodo
|
||||
|
||||
" Define the default highlighting.
|
||||
if !exists("did_eighth_syntax_inits")
|
||||
let did_eighth_syntax_inits=1
|
||||
" The default methods for highlighting. Can be overriden later.
|
||||
hi def link eighthTodo Todo
|
||||
hi def link eighthOperators Operator
|
||||
hi def link eighthMath Number
|
||||
hi def link eighthInteger Number
|
||||
hi def link eighthStack Special
|
||||
hi def link eighthFStack Special
|
||||
hi def link eighthSP Special
|
||||
hi def link eighthColonDef Define
|
||||
hi def link eighthColonName Operator
|
||||
hi def link eighthEndOfColonDef Define
|
||||
hi def link eighthDefine Define
|
||||
hi def link eighthDebug Debug
|
||||
hi def link eighthCharOps Character
|
||||
hi def link eighthConversion String
|
||||
hi def link eighthForth Statement
|
||||
hi def link eighthVocs Statement
|
||||
hi def link eighthString String
|
||||
hi def link eighthComment Comment
|
||||
hi def link eighthClassDef Define
|
||||
hi def link eighthEndOfClassDef Define
|
||||
hi def link eighthObjectDef Define
|
||||
hi def link eighthEndOfObjectDef Define
|
||||
hi def link eighthInclude Include
|
||||
hi def link eighthBuiltin Define
|
||||
hi def link eighthClasses Define
|
||||
hi def link eighthClassWord Keyword
|
||||
|
||||
hi def link jsonObject Delimiter
|
||||
hi def link jsonObjEntry Label
|
||||
hi def link jsonArray Special
|
||||
hi def link jsonNull Function
|
||||
hi def link jsonBool Boolean
|
||||
endif
|
||||
|
||||
let b:current_syntax = "8th"
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: ts=8:sw=4:nocindent:smartindent:
|
||||
|
||||
endif
|
||||
75
syntax/a2ps.vim
Normal file
75
syntax/a2ps.vim
Normal file
@@ -0,0 +1,75 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'a2ps') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: a2ps(1) configuration file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2006-04-19
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn keyword a2psPreProc Include
|
||||
\ nextgroup=a2psKeywordColon
|
||||
|
||||
syn keyword a2psMacro UserOption
|
||||
\ nextgroup=a2psKeywordColon
|
||||
|
||||
syn keyword a2psKeyword LibraryPath AppendLibraryPath PrependLibraryPath
|
||||
\ Options Medium Printer UnknownPrinter
|
||||
\ DefaultPrinter OutputFirstLine
|
||||
\ PageLabelFormat Delegation FileCommand
|
||||
\ nextgroup=a2psKeywordColon
|
||||
|
||||
syn match a2psKeywordColon contained display ':'
|
||||
|
||||
syn keyword a2psKeyword Variable nextgroup=a2psVariableColon
|
||||
|
||||
syn match a2psVariableColon contained display ':'
|
||||
\ nextgroup=a2psVariable skipwhite
|
||||
|
||||
syn match a2psVariable contained display '[^ \t:(){}]\+'
|
||||
\ contains=a2psVarPrefix
|
||||
|
||||
syn match a2psVarPrefix contained display
|
||||
\ '\<\%(del\|pro\|ps\|pl\|toc\|user\|\)\ze\.'
|
||||
|
||||
syn match a2psLineCont display '\\$'
|
||||
|
||||
syn match a2psSubst display '$\%(-\=.\=\d\+\)\=\h\d\='
|
||||
syn match a2psSubst display '#[?!]\=\w\d\='
|
||||
syn match a2psSubst display '#{[^}]\+}'
|
||||
|
||||
syn region a2psString display oneline start=+'+ end=+'+
|
||||
\ contains=a2psSubst
|
||||
|
||||
syn region a2psString display oneline start=+"+ end=+"+
|
||||
\ contains=a2psSubst
|
||||
|
||||
syn keyword a2psTodo contained TODO FIXME XXX NOTE
|
||||
|
||||
syn region a2psComment display oneline start='^\s*#' end='$'
|
||||
\ contains=a2psTodo,@Spell
|
||||
|
||||
hi def link a2psTodo Todo
|
||||
hi def link a2psComment Comment
|
||||
hi def link a2psPreProc PreProc
|
||||
hi def link a2psMacro Macro
|
||||
hi def link a2psKeyword Keyword
|
||||
hi def link a2psKeywordColon Delimiter
|
||||
hi def link a2psVariableColon Delimiter
|
||||
hi def link a2psVariable Identifier
|
||||
hi def link a2psVarPrefix Type
|
||||
hi def link a2psLineCont Special
|
||||
hi def link a2psSubst PreProc
|
||||
hi def link a2psString String
|
||||
|
||||
let b:current_syntax = "a2ps"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
157
syntax/a65.vim
Normal file
157
syntax/a65.vim
Normal file
@@ -0,0 +1,157 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'a65') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: xa 6502 cross assembler
|
||||
" Maintainer: Clemens Kirchgatterer <clemens@1541.org>
|
||||
" Last Change: 2016 Aug 31
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn case ignore
|
||||
|
||||
" Opcodes
|
||||
syn match a65Opcode "\<PHP\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<PLA\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<PLX\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<PLY\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<SEC\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<CLD\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<SED\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<CLI\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<BVC\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<BVS\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<BCS\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<BCC\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<DEY\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<DEC\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<CMP\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<CPX\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<BIT\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<ROL\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<ROR\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<ASL\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<TXA\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<TYA\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<TSX\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<TXS\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<LDA\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<LDX\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<LDY\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<STA\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<PLP\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<BRK\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<RTI\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<NOP\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<SEI\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<CLV\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<PHA\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<PHX\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<BRA\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<JMP\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<JSR\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<RTS\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<CPY\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<BNE\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<BEQ\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<BMI\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<LSR\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<INX\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<INY\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<INC\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<ADC\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<SBC\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<AND\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<ORA\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<STX\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<STY\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<STZ\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<EOR\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<DEX\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<BPL\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<CLC\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<PHY\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<TRB\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<BBR\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<BBS\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<RMB\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<SMB\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<TAY\($\|\s\)" nextgroup=a65Address
|
||||
syn match a65Opcode "\<TAX\($\|\s\)" nextgroup=a65Address
|
||||
|
||||
" Addresses
|
||||
syn match a65Address "\s*!\=$[0-9A-F]\{2}\($\|\s\)"
|
||||
syn match a65Address "\s*!\=$[0-9A-F]\{4}\($\|\s\)"
|
||||
syn match a65Address "\s*!\=$[0-9A-F]\{2},X\($\|\s\)"
|
||||
syn match a65Address "\s*!\=$[0-9A-F]\{4},X\($\|\s\)"
|
||||
syn match a65Address "\s*!\=$[0-9A-F]\{2},Y\($\|\s\)"
|
||||
syn match a65Address "\s*!\=$[0-9A-F]\{4},Y\($\|\s\)"
|
||||
syn match a65Address "\s*($[0-9A-F]\{2})\($\|\s\)"
|
||||
syn match a65Address "\s*($[0-9A-F]\{4})\($\|\s\)"
|
||||
syn match a65Address "\s*($[0-9A-F]\{2},X)\($\|\s\)"
|
||||
syn match a65Address "\s*($[0-9A-F]\{2}),Y\($\|\s\)"
|
||||
|
||||
" Numbers
|
||||
syn match a65Number "#\=[0-9]*\>"
|
||||
syn match a65Number "#\=$[0-9A-F]*\>"
|
||||
syn match a65Number "#\=&[0-7]*\>"
|
||||
syn match a65Number "#\=%[01]*\>"
|
||||
|
||||
syn case match
|
||||
|
||||
" Types
|
||||
syn match a65Type "\(^\|\s\)\.byt\($\|\s\)"
|
||||
syn match a65Type "\(^\|\s\)\.word\($\|\s\)"
|
||||
syn match a65Type "\(^\|\s\)\.asc\($\|\s\)"
|
||||
syn match a65Type "\(^\|\s\)\.dsb\($\|\s\)"
|
||||
syn match a65Type "\(^\|\s\)\.fopt\($\|\s\)"
|
||||
syn match a65Type "\(^\|\s\)\.text\($\|\s\)"
|
||||
syn match a65Type "\(^\|\s\)\.data\($\|\s\)"
|
||||
syn match a65Type "\(^\|\s\)\.bss\($\|\s\)"
|
||||
syn match a65Type "\(^\|\s\)\.zero\($\|\s\)"
|
||||
syn match a65Type "\(^\|\s\)\.align\($\|\s\)"
|
||||
|
||||
" Blocks
|
||||
syn match a65Section "\(^\|\s\)\.(\($\|\s\)"
|
||||
syn match a65Section "\(^\|\s\)\.)\($\|\s\)"
|
||||
|
||||
" Strings
|
||||
syn match a65String "\".*\""
|
||||
|
||||
" Programm Counter
|
||||
syn region a65PC start="\*=" end="\>" keepend
|
||||
|
||||
" HI/LO Byte
|
||||
syn region a65HiLo start="#[<>]" end="$\|\s" contains=a65Comment keepend
|
||||
|
||||
" Comments
|
||||
syn keyword a65Todo TODO XXX FIXME BUG contained
|
||||
syn match a65Comment ";.*"hs=s+1 contains=a65Todo
|
||||
syn region a65Comment start="/\*" end="\*/" contains=a65Todo,a65Comment
|
||||
|
||||
" Preprocessor
|
||||
syn region a65PreProc start="^#" end="$" contains=a65Comment,a65Continue
|
||||
syn match a65End excludenl /end$/ contained
|
||||
syn match a65Continue "\\$" contained
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
hi def link a65Section Special
|
||||
hi def link a65Address Special
|
||||
hi def link a65Comment Comment
|
||||
hi def link a65PreProc PreProc
|
||||
hi def link a65Number Number
|
||||
hi def link a65String String
|
||||
hi def link a65Type Statement
|
||||
hi def link a65Opcode Type
|
||||
hi def link a65PC Error
|
||||
hi def link a65Todo Todo
|
||||
hi def link a65HiLo Number
|
||||
|
||||
|
||||
let b:current_syntax = "a65"
|
||||
|
||||
endif
|
||||
162
syntax/aap.vim
Normal file
162
syntax/aap.vim
Normal file
@@ -0,0 +1,162 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'aap') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: A-A-P recipe
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2004 Jun 13
|
||||
|
||||
" Quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn include @aapPythonScript syntax/python.vim
|
||||
|
||||
syn match aapVariable /$[-+?*="'\\!]*[a-zA-Z0-9_.]*/
|
||||
syn match aapVariable /$[-+?*="'\\!]*([a-zA-Z0-9_.]*)/
|
||||
syn keyword aapTodo contained TODO Todo
|
||||
syn match aapString +'[^']\{-}'+
|
||||
syn match aapString +"[^"]\{-}"+
|
||||
|
||||
syn match aapCommand '^\s*:action\>'
|
||||
syn match aapCommand '^\s*:add\>'
|
||||
syn match aapCommand '^\s*:addall\>'
|
||||
syn match aapCommand '^\s*:asroot\>'
|
||||
syn match aapCommand '^\s*:assertpkg\>'
|
||||
syn match aapCommand '^\s*:attr\>'
|
||||
syn match aapCommand '^\s*:attribute\>'
|
||||
syn match aapCommand '^\s*:autodepend\>'
|
||||
syn match aapCommand '^\s*:buildcheck\>'
|
||||
syn match aapCommand '^\s*:cd\>'
|
||||
syn match aapCommand '^\s*:chdir\>'
|
||||
syn match aapCommand '^\s*:checkin\>'
|
||||
syn match aapCommand '^\s*:checkout\>'
|
||||
syn match aapCommand '^\s*:child\>'
|
||||
syn match aapCommand '^\s*:chmod\>'
|
||||
syn match aapCommand '^\s*:commit\>'
|
||||
syn match aapCommand '^\s*:commitall\>'
|
||||
syn match aapCommand '^\s*:conf\>'
|
||||
syn match aapCommand '^\s*:copy\>'
|
||||
syn match aapCommand '^\s*:del\>'
|
||||
syn match aapCommand '^\s*:deldir\>'
|
||||
syn match aapCommand '^\s*:delete\>'
|
||||
syn match aapCommand '^\s*:delrule\>'
|
||||
syn match aapCommand '^\s*:dll\>'
|
||||
syn match aapCommand '^\s*:do\>'
|
||||
syn match aapCommand '^\s*:error\>'
|
||||
syn match aapCommand '^\s*:execute\>'
|
||||
syn match aapCommand '^\s*:exit\>'
|
||||
syn match aapCommand '^\s*:export\>'
|
||||
syn match aapCommand '^\s*:fetch\>'
|
||||
syn match aapCommand '^\s*:fetchall\>'
|
||||
syn match aapCommand '^\s*:filetype\>'
|
||||
syn match aapCommand '^\s*:finish\>'
|
||||
syn match aapCommand '^\s*:global\>'
|
||||
syn match aapCommand '^\s*:import\>'
|
||||
syn match aapCommand '^\s*:include\>'
|
||||
syn match aapCommand '^\s*:installpkg\>'
|
||||
syn match aapCommand '^\s*:lib\>'
|
||||
syn match aapCommand '^\s*:local\>'
|
||||
syn match aapCommand '^\s*:log\>'
|
||||
syn match aapCommand '^\s*:ltlib\>'
|
||||
syn match aapCommand '^\s*:mkdir\>'
|
||||
syn match aapCommand '^\s*:mkdownload\>'
|
||||
syn match aapCommand '^\s*:move\>'
|
||||
syn match aapCommand '^\s*:pass\>'
|
||||
syn match aapCommand '^\s*:popdir\>'
|
||||
syn match aapCommand '^\s*:produce\>'
|
||||
syn match aapCommand '^\s*:program\>'
|
||||
syn match aapCommand '^\s*:progsearch\>'
|
||||
syn match aapCommand '^\s*:publish\>'
|
||||
syn match aapCommand '^\s*:publishall\>'
|
||||
syn match aapCommand '^\s*:pushdir\>'
|
||||
syn match aapCommand '^\s*:quit\>'
|
||||
syn match aapCommand '^\s*:recipe\>'
|
||||
syn match aapCommand '^\s*:refresh\>'
|
||||
syn match aapCommand '^\s*:remove\>'
|
||||
syn match aapCommand '^\s*:removeall\>'
|
||||
syn match aapCommand '^\s*:require\>'
|
||||
syn match aapCommand '^\s*:revise\>'
|
||||
syn match aapCommand '^\s*:reviseall\>'
|
||||
syn match aapCommand '^\s*:route\>'
|
||||
syn match aapCommand '^\s*:rule\>'
|
||||
syn match aapCommand '^\s*:start\>'
|
||||
syn match aapCommand '^\s*:symlink\>'
|
||||
syn match aapCommand '^\s*:sys\>'
|
||||
syn match aapCommand '^\s*:sysdepend\>'
|
||||
syn match aapCommand '^\s*:syspath\>'
|
||||
syn match aapCommand '^\s*:system\>'
|
||||
syn match aapCommand '^\s*:tag\>'
|
||||
syn match aapCommand '^\s*:tagall\>'
|
||||
syn match aapCommand '^\s*:toolsearch\>'
|
||||
syn match aapCommand '^\s*:totype\>'
|
||||
syn match aapCommand '^\s*:touch\>'
|
||||
syn match aapCommand '^\s*:tree\>'
|
||||
syn match aapCommand '^\s*:unlock\>'
|
||||
syn match aapCommand '^\s*:update\>'
|
||||
syn match aapCommand '^\s*:usetool\>'
|
||||
syn match aapCommand '^\s*:variant\>'
|
||||
syn match aapCommand '^\s*:verscont\>'
|
||||
|
||||
syn match aapCommand '^\s*:print\>' nextgroup=aapPipeEnd
|
||||
syn match aapPipeCmd '\s*:print\>' nextgroup=aapPipeEnd contained
|
||||
syn match aapCommand '^\s*:cat\>' nextgroup=aapPipeEnd
|
||||
syn match aapPipeCmd '\s*:cat\>' nextgroup=aapPipeEnd contained
|
||||
syn match aapCommand '^\s*:syseval\>' nextgroup=aapPipeEnd
|
||||
syn match aapPipeCmd '\s*:syseval\>' nextgroup=aapPipeEnd contained
|
||||
syn match aapPipeCmd '\s*:assign\>' contained
|
||||
syn match aapCommand '^\s*:eval\>' nextgroup=aapPipeEnd
|
||||
syn match aapPipeCmd '\s*:eval\>' nextgroup=aapPipeEndPy contained
|
||||
syn match aapPipeCmd '\s*:tee\>' nextgroup=aapPipeEnd contained
|
||||
syn match aapPipeCmd '\s*:log\>' nextgroup=aapPipeEnd contained
|
||||
syn match aapPipeEnd '[^|]*|' nextgroup=aapPipeCmd contained skipnl
|
||||
syn match aapPipeEndPy '[^|]*|' nextgroup=aapPipeCmd contained skipnl contains=@aapPythonScript
|
||||
syn match aapPipeStart '^\s*|' nextgroup=aapPipeCmd
|
||||
|
||||
"
|
||||
" A Python line starts with @. Can be continued with a trailing backslash.
|
||||
syn region aapPythonRegion start="\s*@" skip='\\$' end=+$+ contains=@aapPythonScript keepend
|
||||
"
|
||||
" A Python block starts with ":python" and continues so long as the indent is
|
||||
" bigger.
|
||||
syn region aapPythonRegion matchgroup=aapCommand start="\z(\s*\):python" skip='\n\z1\s\|\n\s*\n' end=+$+ contains=@aapPythonScript
|
||||
|
||||
" A Python expression is enclosed in backticks.
|
||||
syn region aapPythonRegion start="`" skip="``" end="`" contains=@aapPythonScript
|
||||
|
||||
" TODO: There is something wrong with line continuation.
|
||||
syn match aapComment '#.*' contains=aapTodo
|
||||
syn match aapComment '#.*\(\\\n.*\)' contains=aapTodo
|
||||
|
||||
syn match aapSpecial '$#'
|
||||
syn match aapSpecial '$\$'
|
||||
syn match aapSpecial '$(.)'
|
||||
|
||||
" A heredoc assignment.
|
||||
syn region aapHeredoc start="^\s*\k\+\s*$\=+\=?\=<<\s*\z(\S*\)"hs=e+1 end="^\s*\z1\s*$"he=s-1
|
||||
|
||||
" Syncing is needed for ":python" and "VAR << EOF". Don't use Python syncing
|
||||
syn sync clear
|
||||
syn sync fromstart
|
||||
|
||||
" The default highlighting.
|
||||
hi def link aapTodo Todo
|
||||
hi def link aapString String
|
||||
hi def link aapComment Comment
|
||||
hi def link aapSpecial Special
|
||||
hi def link aapVariable Identifier
|
||||
hi def link aapPipeCmd aapCommand
|
||||
hi def link aapCommand Statement
|
||||
hi def link aapHeredoc Constant
|
||||
|
||||
let b:current_syntax = "aap"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: ts=8
|
||||
|
||||
endif
|
||||
199
syntax/abap.vim
Normal file
199
syntax/abap.vim
Normal file
@@ -0,0 +1,199 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'abap') == -1
|
||||
|
||||
" Vim ABAP syntax file
|
||||
" Language: SAP - ABAP/R4
|
||||
" Maintainer: Marius Piedallu van Wyk <lailoken@gmail.com>
|
||||
" Last Change: 2018 Dec 12
|
||||
" Comment: Thanks to EPI-USE Labs for all your assistance. :)
|
||||
|
||||
" Quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Always ignore case
|
||||
syn case ignore
|
||||
|
||||
" Symbol Operators (space delimited)
|
||||
syn match abapSymbolOperator "\W+\W"
|
||||
syn match abapSymbolOperator "\W-\W"
|
||||
syn match abapSymbolOperator "\W/\W"
|
||||
syn match abapSymbolOperator "\W%\W"
|
||||
syn match abapSymbolOperator "\W=\W"
|
||||
syn match abapSymbolOperator "\W<\W"
|
||||
syn match abapSymbolOperator "\W>\W"
|
||||
syn match abapSymbolOperator "\W\*\W"
|
||||
syn match abapSymbolOperator "\W[<>]=\W"
|
||||
syn match abapSymbolOperator "\W<>\W"
|
||||
syn match abapSymbolOperator "\W\*\*\W"
|
||||
syn match abapSymbolOperator "\[\]"
|
||||
syn match abapSymbolOperator "->\*\?"
|
||||
syn match abapSymbolOperator "=>"
|
||||
syn match abapSymbolOperator "[()~:,\.&$]"
|
||||
|
||||
" Literals
|
||||
syn region abapCharString matchgroup=abapCharString start="'" end="'" contains=abapCharStringEscape
|
||||
syn match abapCharStringEscape contained "''"
|
||||
|
||||
syn region abapString matchgroup=abapString start="`" end="`" contains=abapStringEscape
|
||||
syn match abapStringEscape contained "``"
|
||||
|
||||
syn match abapNumber "\-\=\<\d\+\>"
|
||||
syn region abapHex matchgroup=abapHex start="X'" end="'"
|
||||
|
||||
setlocal iskeyword=48-57,_,A-Z,a-z,/
|
||||
|
||||
syn match abapNamespace "\</\w\+/"
|
||||
|
||||
" multi-word statements
|
||||
syn match abapComplexStatement "\<\(WITH\W\+\(HEADER\W\+LINE\|FRAME\|KEY\)\|WITH\)\>"
|
||||
syn match abapComplexStatement "\<NO\W\+STANDARD\W\+PAGE\W\+HEADING\>"
|
||||
syn match abapComplexStatement "\<\(EXIT\W\+FROM\W\+STEP\W\+LOOP\|EXIT\)\>"
|
||||
syn match abapComplexStatement "\<\(BEGIN\W\+OF\W\+\(BLOCK\|LINE\)\|BEGIN\W\+OF\)\>"
|
||||
syn match abapComplexStatement "\<\(END\W\+OF\W\+\(BLOCK\|LINE\)\|END\W\+OF\)\>"
|
||||
syn match abapComplexStatement "\<NO\W\+INTERVALS\>"
|
||||
syn match abapComplexStatement "\<RESPECTING\W\+BLANKS\>"
|
||||
syn match abapComplexStatement "\<SEPARATED\W\+BY\>"
|
||||
syn match abapComplexStatement "\<USING\(\W\+EDIT\W\+MASK\)\?\>"
|
||||
syn match abapComplexStatement "\<WHERE\(\W\+LINE\)\?\>"
|
||||
syn match abapComplexStatement "\<GET\W\+\(TIME\(\W\+STAMP\)\?\(\W\+FIELD\)\?\|PF-STATUS\|BADI\|BIT\|CONNECTION\|CURSOR\|REFERENCE\W\+OF\)\>"
|
||||
syn match abapComplexStatement "\<RADIOBUTTON\W\+GROUP\>"
|
||||
syn match abapComplexStatement "\<REF\W\+TO\>"
|
||||
syn match abapComplexStatement "\<\(PUBLIC\|PRIVATE\|PROTECTED\)\(\W\+SECTION\)\?\>"
|
||||
syn match abapComplexStatement "\<DELETING\W\+\(TRAILING\|LEADING\)\>"
|
||||
syn match abapComplexStatement "\<\(ALL\W\+OCCURRENCES\)\|\(\(FIRST\|LAST\)\W\+OCCURRENCE\)\>"
|
||||
syn match abapComplexStatement "\<INHERITING\W\+FROM\>"
|
||||
syn match abapComplexStatement "\<\(UP\W\+\)\?TO\>"
|
||||
|
||||
" hyphenated-word statements
|
||||
syn match abapComplexStatement "\<LINE-COUNT\>"
|
||||
syn match abapComplexStatement "\<ADD-CORRESPONDING\>"
|
||||
syn match abapComplexStatement "\<AUTHORITY-CHECK\>"
|
||||
syn match abapComplexStatement "\<BREAK-POINT\>"
|
||||
syn match abapComplexStatement "\<CLASS-DATA\>"
|
||||
syn match abapComplexStatement "\<CLASS-METHODS\>"
|
||||
syn match abapComplexStatement "\<CLASS-METHOD\>"
|
||||
syn match abapComplexStatement "\<DIVIDE-CORRESPONDING\>"
|
||||
syn match abapComplexStatement "\<EDITOR-CALL\>"
|
||||
syn match abapComplexStatement "\<END-OF-DEFINITION\>"
|
||||
syn match abapComplexStatement "\<END-OF-PAGE\>"
|
||||
syn match abapComplexStatement "\<END-OF-SELECTION\>"
|
||||
syn match abapComplexStatement "\<FIELD-GROUPS\>"
|
||||
syn match abapComplexStatement "\<FIELD-SYMBOLS\>"
|
||||
syn match abapComplexStatement "\<FUNCTION-POOL\>"
|
||||
syn match abapComplexStatement "\<IS\W\+\(NOT\W\+\)\?\(ASSIGNED\|BOUND\|INITIAL\|SUPPLIED\)\>"
|
||||
syn match abapComplexStatement "\<MOVE-CORRESPONDING\>"
|
||||
syn match abapComplexStatement "\<MULTIPLY-CORRESPONDING\>"
|
||||
syn match abapComplexStatement "\<NEW-LINE\>"
|
||||
syn match abapComplexStatement "\<NEW-PAGE\>"
|
||||
syn match abapComplexStatement "\<NEW-SECTION\>"
|
||||
syn match abapComplexStatement "\<PRINT-CONTROL\>"
|
||||
syn match abapComplexStatement "\<RP-PROVIDE-FROM-LAST\>"
|
||||
syn match abapComplexStatement "\<SELECT-OPTIONS\>"
|
||||
syn match abapComplexStatement "\<SELECTION-SCREEN\>"
|
||||
syn match abapComplexStatement "\<START-OF-SELECTION\>"
|
||||
syn match abapComplexStatement "\<SUBTRACT-CORRESPONDING\>"
|
||||
syn match abapComplexStatement "\<SYNTAX-CHECK\>"
|
||||
syn match abapComplexStatement "\<SYNTAX-TRACE\>"
|
||||
syn match abapComplexStatement "\<TOP-OF-PAGE\>"
|
||||
syn match abapComplexStatement "\<TYPE-POOL\>"
|
||||
syn match abapComplexStatement "\<TYPE-POOLS\>"
|
||||
syn match abapComplexStatement "\<LINE-SIZE\>"
|
||||
syn match abapComplexStatement "\<LINE-COUNT\>"
|
||||
syn match abapComplexStatement "\<MESSAGE-ID\>"
|
||||
syn match abapComplexStatement "\<DISPLAY-MODE\>"
|
||||
syn match abapComplexStatement "\<READ\(-ONLY\)\?\>"
|
||||
|
||||
" ABAP statements
|
||||
syn keyword abapStatement ADD ALIAS ALIASES ASSERT ASSIGN ASSIGNING AT
|
||||
syn keyword abapStatement BACK
|
||||
syn keyword abapStatement CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY
|
||||
syn keyword abapStatement DATA DEFINE DEFINITION DEFERRED DELETE DESCRIBE DETAIL DIVIDE DO
|
||||
syn keyword abapStatement ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT
|
||||
syn keyword abapStatement FETCH FIELDS FORM FORMAT FREE FROM FUNCTION
|
||||
syn keyword abapStatement GENERATE
|
||||
syn keyword abapStatement HIDE
|
||||
syn keyword abapStatement IF IMPORT IMPORTING INDEX INFOTYPES INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION
|
||||
syn keyword abapStatement LEAVE LIKE LINE LOAD LOCAL LOOP
|
||||
syn keyword abapStatement MESSAGE METHOD METHODS MODIFY MODULE MOVE MULTIPLY
|
||||
syn keyword abapStatement ON OVERLAY OPTIONAL OTHERS
|
||||
syn keyword abapStatement PACK PARAMETERS PERFORM POSITION PROGRAM PROVIDE PUT
|
||||
syn keyword abapStatement RAISE RANGES RECEIVE RECEIVING REDEFINITION REFERENCE REFRESH REJECT REPLACE REPORT RESERVE RESTORE RETURNING ROLLBACK
|
||||
syn keyword abapStatement SCAN SCROLL SEARCH SELECT SET SHIFT SKIP SORT SORTED SPLIT STANDARD STATICS STEP STOP SUBMIT SUBTRACT SUM SUMMARY SUPPRESS
|
||||
syn keyword abapStatement TABLES TIMES TRANSFER TRANSLATE TRY TYPE TYPES
|
||||
syn keyword abapStatement UNASSIGN ULINE UNPACK UPDATE
|
||||
syn keyword abapStatement WHEN WHILE WINDOW WRITE
|
||||
|
||||
" More statemets
|
||||
syn keyword abapStatement LINES
|
||||
syn keyword abapStatement INTO GROUP BY HAVING ORDER BY SINGLE
|
||||
syn keyword abapStatement APPENDING CORRESPONDING FIELDS OF TABLE
|
||||
syn keyword abapStatement LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER ROWS CONNECTING
|
||||
syn keyword abapStatement OCCURS STRUCTURE OBJECT PROPERTY
|
||||
syn keyword abapStatement CASTING APPEND RAISING VALUE COLOR
|
||||
syn keyword abapStatement CHANGING EXCEPTION EXCEPTIONS DEFAULT CHECKBOX COMMENT
|
||||
syn keyword abapStatement ID NUMBER FOR TITLE OUTPUT
|
||||
|
||||
" Special ABAP specific tables:
|
||||
syn match abapSpecialTables "\<\(sy\|\(hrp\|p\|pa\)\d\d\d\d\|t\d\d\d.\|innnn\)-"me=e-1 contained
|
||||
syn match abapStructure "\<\w\+-[^\>]"me=e-2 contains=abapSpecialTables,abapStatement,abapComplexStatement
|
||||
syn match abapField "-\w\+"ms=s+1
|
||||
|
||||
" Pointer
|
||||
syn match abapSpecial "<\w\+>"
|
||||
|
||||
" Abap common constants:
|
||||
syn keyword abapSpecial TRUE FALSE NULL SPACE
|
||||
|
||||
" Includes
|
||||
syn region abapInclude start="include" end="." contains=abapComment
|
||||
|
||||
" Types
|
||||
syn keyword abapTypes c n i int8 p f d t x string xstring decfloat16 decfloat34
|
||||
|
||||
" Atritmitic operators
|
||||
syn keyword abapOperator abs sign ceil floor trunc frac acos asin atan cos sin tan
|
||||
syn keyword abapOperator cosh sinh tanh exp log log10 sqrt
|
||||
|
||||
" String operators
|
||||
syn keyword abapStatement strlen xstrlen charlen numofchar dbmaxlen
|
||||
|
||||
syn keyword abapOperator EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN
|
||||
|
||||
" An error? Not strictly... but cannot think of reason this is intended.
|
||||
syn match abapError "\.\."
|
||||
|
||||
" Comments
|
||||
syn region abapComment start="^\*" end="$" contains=abapTodo
|
||||
syn match abapComment "\".*" contains=abapTodo
|
||||
syn keyword abapTodo contained TODO NOTE
|
||||
syn match abapTodo "\#EC\W\+\w\+"
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
hi def link abapError Error
|
||||
hi def link abapComment Comment
|
||||
hi def link abapInclude Include
|
||||
hi def link abapStatement Statement
|
||||
hi def link abapComplexStatement Statement
|
||||
hi def link abapSpecial Special
|
||||
hi def link abapNamespace Special
|
||||
hi def link abapSpecialTables Special
|
||||
hi def link abapSymbolOperator abapOperator
|
||||
hi def link abapOperator Operator
|
||||
hi def link abapCharString String
|
||||
hi def link abapString String
|
||||
hi def link abapFloat Float
|
||||
hi def link abapTypes Type
|
||||
hi def link abapSymbol Structure
|
||||
hi def link abapStructure Structure
|
||||
hi def link abapField Variable
|
||||
hi def link abapNumber Number
|
||||
hi def link abapHex Number
|
||||
|
||||
|
||||
let b:current_syntax = "abap"
|
||||
|
||||
" vim: ts=8 sw=2
|
||||
endif
|
||||
39
syntax/abaqus.vim
Normal file
39
syntax/abaqus.vim
Normal file
@@ -0,0 +1,39 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'abaqus') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: Abaqus finite element input file (www.hks.com)
|
||||
" Maintainer: Carl Osterwisch <osterwischc@asme.org>
|
||||
" Last Change: 2002 Feb 24
|
||||
" Remark: Huge improvement in folding performance--see filetype plugin
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Abaqus comment lines
|
||||
syn match abaqusComment "^\*\*.*$"
|
||||
|
||||
" Abaqus keyword lines
|
||||
syn match abaqusKeywordLine "^\*\h.*" contains=abaqusKeyword,abaqusParameter,abaqusValue display
|
||||
syn match abaqusKeyword "^\*\h[^,]*" contained display
|
||||
syn match abaqusParameter ",[^,=]\+"lc=1 contained display
|
||||
syn match abaqusValue "=\s*[^,]*"lc=1 contained display
|
||||
|
||||
" Illegal syntax
|
||||
syn match abaqusBadLine "^\s\+\*.*" display
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
" The default methods for highlighting. Can be overridden later
|
||||
hi def link abaqusComment Comment
|
||||
hi def link abaqusKeyword Statement
|
||||
hi def link abaqusParameter Identifier
|
||||
hi def link abaqusValue Constant
|
||||
hi def link abaqusBadLine Error
|
||||
|
||||
|
||||
let b:current_syntax = "abaqus"
|
||||
|
||||
endif
|
||||
55
syntax/abc.vim
Normal file
55
syntax/abc.vim
Normal file
@@ -0,0 +1,55 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'abc') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: abc music notation language
|
||||
" Maintainer: James Allwright <J.R.Allwright@westminster.ac.uk>
|
||||
" URL: http://perun.hscs.wmin.ac.uk/~jra/vim/syntax/abc.vim
|
||||
" Last Change: 27th April 2001
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" tags
|
||||
syn region abcGuitarChord start=+"[A-G]+ end=+"+ contained
|
||||
syn match abcNote "z[1-9]*[0-9]*" contained
|
||||
syn match abcNote "z[1-9]*[0-9]*/[248]\=" contained
|
||||
syn match abcNote "[=_\^]\{,2}[A-G],*[1-9]*[0-9]*" contained
|
||||
syn match abcNote "[=_\^]\{,2}[A-G],*[1-9]*[0-9]*/[248]\=" contained
|
||||
syn match abcNote "[=_\^]\{,2}[a-g]'*[1-9]*[0-9]*" contained
|
||||
syn match abcNote "[=_\^]\{,2}[a-g]'*[1-9]*[0-9]*/[248]\=" contained
|
||||
syn match abcBar "|" contained
|
||||
syn match abcBar "[:|][:|]" contained
|
||||
syn match abcBar ":|2" contained
|
||||
syn match abcBar "|1" contained
|
||||
syn match abcBar "\[[12]" contained
|
||||
syn match abcTuple "([1-9]\+:\=[0-9]*:\=[0-9]*" contained
|
||||
syn match abcBroken "<\|<<\|<<<\|>\|>>\|>>>" contained
|
||||
syn match abcTie "-"
|
||||
syn match abcHeadField "^[A-EGHIK-TVWXZ]:.*$" contained
|
||||
syn match abcBodyField "^[KLMPQWVw]:.*$" contained
|
||||
syn region abcHeader start="^X:" end="^K:.*$" contained contains=abcHeadField,abcComment keepend
|
||||
syn region abcTune start="^X:" end="^ *$" contains=abcHeader,abcComment,abcBar,abcNote,abcBodyField,abcGuitarChord,abcTuple,abcBroken,abcTie
|
||||
syn match abcComment "%.*$"
|
||||
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
hi def link abcComment Comment
|
||||
hi def link abcHeadField Type
|
||||
hi def link abcBodyField Special
|
||||
hi def link abcBar Statement
|
||||
hi def link abcTuple Statement
|
||||
hi def link abcBroken Statement
|
||||
hi def link abcTie Statement
|
||||
hi def link abcGuitarChord Identifier
|
||||
hi def link abcNote Constant
|
||||
|
||||
|
||||
let b:current_syntax = "abc"
|
||||
|
||||
" vim: ts=4
|
||||
|
||||
endif
|
||||
165
syntax/abel.vim
Normal file
165
syntax/abel.vim
Normal file
@@ -0,0 +1,165 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'abel') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: ABEL
|
||||
" Maintainer: John Cook <johncook3@gmail.com>
|
||||
" Last Change: 2011 Dec 27
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" this language is oblivious to case
|
||||
syn case ignore
|
||||
|
||||
" A bunch of keywords
|
||||
syn keyword abelHeader module title device options
|
||||
syn keyword abelSection declarations equations test_vectors end
|
||||
syn keyword abelDeclaration state truth_table state_diagram property
|
||||
syn keyword abelType pin node attribute constant macro library
|
||||
|
||||
syn keyword abelTypeId com reg neg pos buffer dc reg_d reg_t contained
|
||||
syn keyword abelTypeId reg_sr reg_jk reg_g retain xor invert contained
|
||||
|
||||
syn keyword abelStatement when then else if with endwith case endcase
|
||||
syn keyword abelStatement fuses expr trace
|
||||
|
||||
" option to omit obsolete statements
|
||||
if exists("abel_obsolete_ok")
|
||||
syn keyword abelStatement enable flag in
|
||||
else
|
||||
syn keyword abelError enable flag in
|
||||
endif
|
||||
|
||||
" directives
|
||||
syn match abelDirective "@alternate"
|
||||
syn match abelDirective "@standard"
|
||||
syn match abelDirective "@const"
|
||||
syn match abelDirective "@dcset"
|
||||
syn match abelDirective "@include"
|
||||
syn match abelDirective "@page"
|
||||
syn match abelDirective "@radix"
|
||||
syn match abelDirective "@repeat"
|
||||
syn match abelDirective "@irp"
|
||||
syn match abelDirective "@expr"
|
||||
syn match abelDirective "@if"
|
||||
syn match abelDirective "@ifb"
|
||||
syn match abelDirective "@ifnb"
|
||||
syn match abelDirective "@ifdef"
|
||||
syn match abelDirective "@ifndef"
|
||||
syn match abelDirective "@ifiden"
|
||||
syn match abelDirective "@ifniden"
|
||||
|
||||
syn keyword abelTodo contained TODO XXX FIXME
|
||||
|
||||
" wrap up type identifiers to differentiate them from normal strings
|
||||
syn region abelSpecifier start='istype' end=';' contains=abelTypeIdChar,abelTypeId,abelTypeIdEnd keepend
|
||||
syn match abelTypeIdChar "[,']" contained
|
||||
syn match abelTypeIdEnd ";" contained
|
||||
|
||||
" string contstants and special characters within them
|
||||
syn match abelSpecial contained "\\['\\]"
|
||||
syn region abelString start=+'+ skip=+\\"+ end=+'+ contains=abelSpecial
|
||||
|
||||
" valid integer number formats (decimal, binary, octal, hex)
|
||||
syn match abelNumber "\<[-+]\=[0-9]\+\>"
|
||||
syn match abelNumber "\^d[0-9]\+\>"
|
||||
syn match abelNumber "\^b[01]\+\>"
|
||||
syn match abelNumber "\^o[0-7]\+\>"
|
||||
syn match abelNumber "\^h[0-9a-f]\+\>"
|
||||
|
||||
" special characters
|
||||
" (define these after abelOperator so ?= overrides ?)
|
||||
syn match abelSpecialChar "[\[\](){},;:?]"
|
||||
|
||||
" operators
|
||||
syn match abelLogicalOperator "[!#&$]"
|
||||
syn match abelRangeOperator "\.\."
|
||||
syn match abelAlternateOperator "[/*+]"
|
||||
syn match abelAlternateOperator ":[+*]:"
|
||||
syn match abelArithmeticOperator "[-%]"
|
||||
syn match abelArithmeticOperator "<<"
|
||||
syn match abelArithmeticOperator ">>"
|
||||
syn match abelRelationalOperator "[<>!=]="
|
||||
syn match abelRelationalOperator "[<>]"
|
||||
syn match abelAssignmentOperator "[:?]\=="
|
||||
syn match abelAssignmentOperator "?:="
|
||||
syn match abelTruthTableOperator "->"
|
||||
|
||||
" signal extensions
|
||||
syn match abelExtension "\.aclr\>"
|
||||
syn match abelExtension "\.aset\>"
|
||||
syn match abelExtension "\.clk\>"
|
||||
syn match abelExtension "\.clr\>"
|
||||
syn match abelExtension "\.com\>"
|
||||
syn match abelExtension "\.fb\>"
|
||||
syn match abelExtension "\.[co]e\>"
|
||||
syn match abelExtension "\.l[eh]\>"
|
||||
syn match abelExtension "\.fc\>"
|
||||
syn match abelExtension "\.pin\>"
|
||||
syn match abelExtension "\.set\>"
|
||||
syn match abelExtension "\.[djksrtq]\>"
|
||||
syn match abelExtension "\.pr\>"
|
||||
syn match abelExtension "\.re\>"
|
||||
syn match abelExtension "\.a[pr]\>"
|
||||
syn match abelExtension "\.s[pr]\>"
|
||||
|
||||
" special constants
|
||||
syn match abelConstant "\.[ckudfpxz]\."
|
||||
syn match abelConstant "\.sv[2-9]\."
|
||||
|
||||
" one-line comments
|
||||
syn region abelComment start=+"+ end=+"\|$+ contains=abelNumber,abelTodo
|
||||
" option to prevent C++ style comments
|
||||
if !exists("abel_cpp_comments_illegal")
|
||||
syn region abelComment start=+//+ end=+$+ contains=abelNumber,abelTodo
|
||||
endif
|
||||
|
||||
syn sync minlines=1
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
" The default highlighting.
|
||||
hi def link abelHeader abelStatement
|
||||
hi def link abelSection abelStatement
|
||||
hi def link abelDeclaration abelStatement
|
||||
hi def link abelLogicalOperator abelOperator
|
||||
hi def link abelRangeOperator abelOperator
|
||||
hi def link abelAlternateOperator abelOperator
|
||||
hi def link abelArithmeticOperator abelOperator
|
||||
hi def link abelRelationalOperator abelOperator
|
||||
hi def link abelAssignmentOperator abelOperator
|
||||
hi def link abelTruthTableOperator abelOperator
|
||||
hi def link abelSpecifier abelStatement
|
||||
hi def link abelOperator abelStatement
|
||||
hi def link abelStatement Statement
|
||||
hi def link abelIdentifier Identifier
|
||||
hi def link abelTypeId abelType
|
||||
hi def link abelTypeIdChar abelType
|
||||
hi def link abelType Type
|
||||
hi def link abelNumber abelString
|
||||
hi def link abelString String
|
||||
hi def link abelConstant Constant
|
||||
hi def link abelComment Comment
|
||||
hi def link abelExtension abelSpecial
|
||||
hi def link abelSpecialChar abelSpecial
|
||||
hi def link abelTypeIdEnd abelSpecial
|
||||
hi def link abelSpecial Special
|
||||
hi def link abelDirective PreProc
|
||||
hi def link abelTodo Todo
|
||||
hi def link abelError Error
|
||||
|
||||
|
||||
let b:current_syntax = "abel"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim:ts=8
|
||||
|
||||
endif
|
||||
114
syntax/acedb.vim
Normal file
114
syntax/acedb.vim
Normal file
@@ -0,0 +1,114 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'acedb') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: AceDB model files
|
||||
" Maintainer: Stewart Morris (Stewart.Morris@ed.ac.uk)
|
||||
" Last change: Thu Apr 26 10:38:01 BST 2001
|
||||
" URL: http://www.ed.ac.uk/~swmorris/vim/acedb.vim
|
||||
|
||||
" Syntax file to handle all $ACEDB/wspec/*.wrm files, primarily models.wrm
|
||||
" AceDB software is available from http://www.acedb.org
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn keyword acedbXref XREF
|
||||
syn keyword acedbModifier UNIQUE REPEAT
|
||||
|
||||
syn case ignore
|
||||
syn keyword acedbModifier Constraints
|
||||
syn keyword acedbType DateType Int Text Float
|
||||
|
||||
" Magic tags from: http://genome.cornell.edu/acedocs/magic/summary.html
|
||||
syn keyword acedbMagic pick_me_to_call No_cache Non_graphic Title
|
||||
syn keyword acedbMagic Flipped Centre Extent View Default_view
|
||||
syn keyword acedbMagic From_map Minimal_view Main_Marker Map Includes
|
||||
syn keyword acedbMagic Mapping_data More_data Position Ends Left Right
|
||||
syn keyword acedbMagic Multi_Position Multi_Ends With Error Relative
|
||||
syn keyword acedbMagic Min Anchor Gmap Grid_map Grid Submenus Cambridge
|
||||
syn keyword acedbMagic No_buttons Columns Colour Surround_colour Tag
|
||||
syn keyword acedbMagic Scale_unit Cursor Cursor_on Cursor_unit
|
||||
syn keyword acedbMagic Locator Magnification Projection_lines_on
|
||||
syn keyword acedbMagic Marker_points Marker_intervals Contigs
|
||||
syn keyword acedbMagic Physical_genes Two_point Multi_point Likelihood
|
||||
syn keyword acedbMagic Point_query Point_yellow Point_width
|
||||
syn keyword acedbMagic Point_pne Point_pe Point_nne Point_ne
|
||||
syn keyword acedbMagic Derived_tags DT_query DT_width DT_no_duplicates
|
||||
syn keyword acedbMagic RH_data RH_query RH_spacing RH_show_all
|
||||
syn keyword acedbMagic Names_on Width Symbol Colours Pne Pe Nne pMap
|
||||
syn keyword acedbMagic Sequence Gridded FingerPrint In_Situ Cosmid_grid
|
||||
syn keyword acedbMagic Layout Lines_at Space_at No_stagger A1_labelling
|
||||
syn keyword acedbMagic DNA Structure From Source Source_Exons
|
||||
syn keyword acedbMagic Coding CDS Transcript Assembly_tags Allele
|
||||
syn keyword acedbMagic Display Colour Frame_sensitive Strand_sensitive
|
||||
syn keyword acedbMagic Score_bounds Percent Bumpable Width Symbol
|
||||
syn keyword acedbMagic Blixem_N Address E_mail Paper Reference Title
|
||||
syn keyword acedbMagic Point_1 Point_2 Calculation Full One_recombinant
|
||||
syn keyword acedbMagic Tested Selected_trans Backcross Back_one
|
||||
syn keyword acedbMagic Dom_semi Dom_let Direct Complex_mixed Calc
|
||||
syn keyword acedbMagic Calc_upper_conf Item_1 Item_2 Results A_non_B
|
||||
syn keyword acedbMagic Score Score_by_offset Score_by_width
|
||||
syn keyword acedbMagic Right_priority Blastn Blixem Blixem_X
|
||||
syn keyword acedbMagic Journal Year Volume Page Author
|
||||
syn keyword acedbMagic Selected One_all Recs_all One_let
|
||||
syn keyword acedbMagic Sex_full Sex_one Sex_cis Dom_one Dom_selected
|
||||
syn keyword acedbMagic Calc_distance Calc_lower_conf Canon_for_cosmid
|
||||
syn keyword acedbMagic Reversed_physical Points Positive Negative
|
||||
syn keyword acedbMagic Point_error_scale Point_segregate_ordered
|
||||
syn keyword acedbMagic Point_symbol Interval_JTM Interval_RD
|
||||
syn keyword acedbMagic EMBL_feature Homol Feature
|
||||
syn keyword acedbMagic DT_tag Spacer Spacer_colour Spacer_width
|
||||
syn keyword acedbMagic RH_positive RH_negative RH_contradictory Query
|
||||
syn keyword acedbMagic Clone Y_remark PCR_remark Hybridizes_to
|
||||
syn keyword acedbMagic Row Virtual_row Mixed In_pool Subpool B_non_A
|
||||
syn keyword acedbMagic Interval_SRK Point_show_marginal Subsequence
|
||||
syn keyword acedbMagic Visible Properties Transposon
|
||||
|
||||
syn match acedbClass "^?\w\+\|^#\w\+"
|
||||
syn match acedbComment "//.*"
|
||||
syn region acedbComment start="/\*" end="\*/"
|
||||
syn match acedbComment "^#\W.*"
|
||||
syn match acedbHelp "^\*\*\w\+$"
|
||||
syn match acedbTag "[^^]?\w\+\|[^^]#\w\+"
|
||||
syn match acedbBlock "//#.\+#$"
|
||||
syn match acedbOption "^_[DVH]\S\+"
|
||||
syn match acedbFlag "\s\+-\h\+"
|
||||
syn match acedbSubclass "^Class"
|
||||
syn match acedbSubtag "^Visible\|^Is_a_subclass_of\|^Filter\|^Hidden"
|
||||
syn match acedbNumber "\<\d\+\>"
|
||||
syn match acedbNumber "\<\d\+\.\d\+\>"
|
||||
syn match acedbHyb "\<Positive_\w\+\>\|\<Negative\w\+\>"
|
||||
syn region acedbString start=/"/ end=/"/ skip=/\\"/ oneline
|
||||
|
||||
" Rest of syntax highlighting rules start here
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
hi def link acedbMagic Special
|
||||
hi def link acedbHyb Special
|
||||
hi def link acedbType Type
|
||||
hi def link acedbOption Type
|
||||
hi def link acedbSubclass Type
|
||||
hi def link acedbSubtag Include
|
||||
hi def link acedbFlag Include
|
||||
hi def link acedbTag Include
|
||||
hi def link acedbClass Todo
|
||||
hi def link acedbHelp Todo
|
||||
hi def link acedbXref Identifier
|
||||
hi def link acedbModifier Label
|
||||
hi def link acedbComment Comment
|
||||
hi def link acedbBlock ModeMsg
|
||||
hi def link acedbNumber Number
|
||||
hi def link acedbString String
|
||||
|
||||
|
||||
let b:current_syntax = "acedb"
|
||||
|
||||
" The structure of the model.wrm file is sensitive to mixed tab and space
|
||||
" indentation and assumes tabs are 8 so...
|
||||
se ts=8
|
||||
|
||||
endif
|
||||
372
syntax/ada.vim
Normal file
372
syntax/ada.vim
Normal file
@@ -0,0 +1,372 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ada') == -1
|
||||
|
||||
"----------------------------------------------------------------------------
|
||||
" Description: Vim Ada syntax file
|
||||
" Language: Ada (2005)
|
||||
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Copyright: Copyright (C) 2006 Martin Krischik
|
||||
" Maintainer: Martin Krischik
|
||||
" David A. Wheeler <dwheeler@dwheeler.com>
|
||||
" Simon Bradley <simon.bradley@pitechnology.com>
|
||||
" Contributors: Preben Randhol.
|
||||
" $Author: krischik $
|
||||
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
|
||||
" Version: 4.6
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/syntax/ada.vim $
|
||||
" http://www.dwheeler.com/vim
|
||||
" History: 24.05.2006 MK Unified Headers
|
||||
" 26.05.2006 MK ' should not be in iskeyword.
|
||||
" 16.07.2006 MK Ada-Mode as vim-ball
|
||||
" 02.10.2006 MK Better folding.
|
||||
" 15.10.2006 MK Bram's suggestion for runtime integration
|
||||
" 05.11.2006 MK Spell check for comments and strings only
|
||||
" 05.11.2006 MK Bram suggested to save on spaces
|
||||
" Help Page: help ft-ada-syntax
|
||||
"------------------------------------------------------------------------------
|
||||
" The formal spec of Ada 2005 (ARM) is the "Ada 2005 Reference Manual".
|
||||
" For more Ada 2005 info, see http://www.gnuada.org and http://www.adapower.com.
|
||||
"
|
||||
" This vim syntax file works on vim 7.0 only and makes use of most of Voim 7.0
|
||||
" advanced features.
|
||||
"------------------------------------------------------------------------------
|
||||
|
||||
if exists("b:current_syntax") || version < 700
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:current_syntax = "ada"
|
||||
|
||||
" Section: Ada is entirely case-insensitive. {{{1
|
||||
"
|
||||
syntax case ignore
|
||||
|
||||
" Section: Highlighting commands {{{1
|
||||
"
|
||||
" There are 72 reserved words in total in Ada2005. Some keywords are
|
||||
" used in more than one way. For example:
|
||||
" 1. "end" is a general keyword, but "end if" ends a Conditional.
|
||||
" 2. "then" is a conditional, but "and then" is an operator.
|
||||
"
|
||||
for b:Item in g:ada#Keywords
|
||||
" Standard Exceptions (including I/O).
|
||||
" We'll highlight the standard exceptions, similar to vim's Python mode.
|
||||
" It's possible to redefine the standard exceptions as something else,
|
||||
" but doing so is very bad practice, so simply highlighting them makes sense.
|
||||
if b:Item['kind'] == "x"
|
||||
execute "syntax keyword adaException " . b:Item['word']
|
||||
endif
|
||||
if b:Item['kind'] == "a"
|
||||
execute 'syntax match adaAttribute "\V' . b:Item['word'] . '"'
|
||||
endif
|
||||
" We don't normally highlight types in package Standard
|
||||
" (Integer, Character, Float, etc.). I don't think it looks good
|
||||
" with the other type keywords, and many Ada programs define
|
||||
" so many of their own types that it looks inconsistent.
|
||||
" However, if you want this highlighting, turn on "ada_standard_types".
|
||||
" For package Standard's definition, see ARM section A.1.
|
||||
if b:Item['kind'] == "t" && exists ("g:ada_standard_types")
|
||||
execute "syntax keyword adaBuiltinType " . b:Item['word']
|
||||
endif
|
||||
endfor
|
||||
|
||||
" Section: others {{{1
|
||||
"
|
||||
syntax keyword adaLabel others
|
||||
|
||||
" Section: Operatoren {{{1
|
||||
"
|
||||
syntax keyword adaOperator abs mod not rem xor
|
||||
syntax match adaOperator "\<and\>"
|
||||
syntax match adaOperator "\<and\s\+then\>"
|
||||
syntax match adaOperator "\<or\>"
|
||||
syntax match adaOperator "\<or\s\+else\>"
|
||||
syntax match adaOperator "[-+*/<>&]"
|
||||
syntax keyword adaOperator **
|
||||
syntax match adaOperator "[/<>]="
|
||||
syntax keyword adaOperator =>
|
||||
syntax match adaOperator "\.\."
|
||||
syntax match adaOperator "="
|
||||
|
||||
" Section: <> {{{1
|
||||
"
|
||||
" Handle the box, <>, specially:
|
||||
"
|
||||
syntax keyword adaSpecial <>
|
||||
|
||||
" Section: rainbow color {{{1
|
||||
"
|
||||
if exists("g:ada_rainbow_color")
|
||||
syntax match adaSpecial "[:;.,]"
|
||||
call rainbow_parenthsis#LoadRound ()
|
||||
call rainbow_parenthsis#Activate ()
|
||||
else
|
||||
syntax match adaSpecial "[:;().,]"
|
||||
endif
|
||||
|
||||
" Section: := {{{1
|
||||
"
|
||||
" We won't map "adaAssignment" by default, but we need to map ":=" to
|
||||
" something or the "=" inside it will be mislabelled as an operator.
|
||||
" Note that in Ada, assignment (:=) is not considered an operator.
|
||||
"
|
||||
syntax match adaAssignment ":="
|
||||
|
||||
" Section: Numbers, including floating point, exponents, and alternate bases. {{{1
|
||||
"
|
||||
syntax match adaNumber "\<\d[0-9_]*\(\.\d[0-9_]*\)\=\([Ee][+-]\=\d[0-9_]*\)\=\>"
|
||||
syntax match adaNumber "\<\d\d\=#\x[0-9A-Fa-f_]*\(\.\x[0-9A-Fa-f_]*\)\=#\([Ee][+-]\=\d[0-9_]*\)\="
|
||||
|
||||
" Section: Identify leading numeric signs {{{1
|
||||
"
|
||||
" In "A-5" the "-" is an operator, " but in "A:=-5" the "-" is a sign. This
|
||||
" handles "A3+-5" (etc.) correctly. " This assumes that if you put a
|
||||
" don't put a space after +/- when it's used " as an operator, you won't
|
||||
" put a space before it either -- which is true " in code I've seen.
|
||||
"
|
||||
syntax match adaSign "[[:space:]<>=(,|:;&*/+-][+-]\d"lc=1,hs=s+1,he=e-1,me=e-1
|
||||
|
||||
" Section: Labels for the goto statement. {{{1
|
||||
"
|
||||
syntax region adaLabel start="<<" end=">>"
|
||||
|
||||
" Section: Boolean Constants {{{1
|
||||
" Boolean Constants.
|
||||
syntax keyword adaBoolean true false
|
||||
|
||||
" Section: Warn C/C++ {{{1
|
||||
"
|
||||
" Warn people who try to use C/C++ notation erroneously:
|
||||
"
|
||||
syntax match adaError "//"
|
||||
syntax match adaError "/\*"
|
||||
syntax match adaError "=="
|
||||
|
||||
|
||||
" Section: Space Errors {{{1
|
||||
"
|
||||
if exists("g:ada_space_errors")
|
||||
if !exists("g:ada_no_trail_space_error")
|
||||
syntax match adaSpaceError excludenl "\s\+$"
|
||||
endif
|
||||
if !exists("g:ada_no_tab_space_error")
|
||||
syntax match adaSpaceError " \+\t"me=e-1
|
||||
endif
|
||||
if !exists("g:ada_all_tab_usage")
|
||||
syntax match adaSpecial "\t"
|
||||
endif
|
||||
endif
|
||||
|
||||
" Section: end {{{1
|
||||
" Unless special ("end loop", "end if", etc.), "end" marks the end of a
|
||||
" begin, package, task etc. Assiging it to adaEnd.
|
||||
syntax match adaEnd /\<end\>/
|
||||
|
||||
syntax keyword adaPreproc pragma
|
||||
|
||||
syntax keyword adaRepeat exit for loop reverse while
|
||||
syntax match adaRepeat "\<end\s\+loop\>"
|
||||
|
||||
syntax keyword adaStatement accept delay goto raise requeue return
|
||||
syntax keyword adaStatement terminate
|
||||
syntax match adaStatement "\<abort\>"
|
||||
|
||||
" Section: Handle Ada's record keywords. {{{1
|
||||
"
|
||||
" 'record' usually starts a structure, but "with null record;" does not,
|
||||
" and 'end record;' ends a structure. The ordering here is critical -
|
||||
" 'record;' matches a "with null record", so make it a keyword (this can
|
||||
" match when the 'with' or 'null' is on a previous line).
|
||||
" We see the "end" in "end record" before the word record, so we match that
|
||||
" pattern as adaStructure (and it won't match the "record;" pattern).
|
||||
"
|
||||
syntax match adaStructure "\<record\>" contains=adaRecord
|
||||
syntax match adaStructure "\<end\s\+record\>" contains=adaRecord
|
||||
syntax match adaKeyword "\<record;"me=e-1
|
||||
|
||||
" Section: type classes {{{1
|
||||
"
|
||||
syntax keyword adaStorageClass abstract access aliased array at constant delta
|
||||
syntax keyword adaStorageClass digits limited of private range tagged
|
||||
syntax keyword adaStorageClass interface synchronized
|
||||
syntax keyword adaTypedef subtype type
|
||||
|
||||
" Section: Conditionals {{{1
|
||||
"
|
||||
" "abort" after "then" is a conditional of its own.
|
||||
"
|
||||
syntax match adaConditional "\<then\>"
|
||||
syntax match adaConditional "\<then\s\+abort\>"
|
||||
syntax match adaConditional "\<else\>"
|
||||
syntax match adaConditional "\<end\s\+if\>"
|
||||
syntax match adaConditional "\<end\s\+case\>"
|
||||
syntax match adaConditional "\<end\s\+select\>"
|
||||
syntax keyword adaConditional if case select
|
||||
syntax keyword adaConditional elsif when
|
||||
|
||||
" Section: other keywords {{{1
|
||||
syntax match adaKeyword "\<is\>" contains=adaRecord
|
||||
syntax keyword adaKeyword all do exception in new null out
|
||||
syntax keyword adaKeyword separate until overriding
|
||||
|
||||
" Section: begin keywords {{{1
|
||||
"
|
||||
" These keywords begin various constructs, and you _might_ want to
|
||||
" highlight them differently.
|
||||
"
|
||||
syntax keyword adaBegin begin body declare entry generic
|
||||
syntax keyword adaBegin protected renames task
|
||||
|
||||
syntax match adaBegin "\<function\>" contains=adaFunction
|
||||
syntax match adaBegin "\<procedure\>" contains=adaProcedure
|
||||
syntax match adaBegin "\<package\>" contains=adaPackage
|
||||
|
||||
if exists("ada_with_gnat_project_files")
|
||||
syntax keyword adaBegin project
|
||||
endif
|
||||
|
||||
" Section: with, use {{{1
|
||||
"
|
||||
if exists("ada_withuse_ordinary")
|
||||
" Don't be fancy. Display "with" and "use" as ordinary keywords in all cases.
|
||||
syntax keyword adaKeyword with use
|
||||
else
|
||||
" Highlight "with" and "use" clauses like C's "#include" when they're used
|
||||
" to reference other compilation units; otherwise they're ordinary keywords.
|
||||
" If we have vim 6.0 or later, we'll use its advanced pattern-matching
|
||||
" capabilities so that we won't match leading spaces.
|
||||
syntax match adaKeyword "\<with\>"
|
||||
syntax match adaKeyword "\<use\>"
|
||||
syntax match adaBeginWith "^\s*\zs\(\(with\(\s\+type\)\=\)\|\(use\)\)\>" contains=adaInc
|
||||
syntax match adaSemiWith ";\s*\zs\(\(with\(\s\+type\)\=\)\|\(use\)\)\>" contains=adaInc
|
||||
syntax match adaInc "\<with\>" contained contains=NONE
|
||||
syntax match adaInc "\<with\s\+type\>" contained contains=NONE
|
||||
syntax match adaInc "\<use\>" contained contains=NONE
|
||||
" Recognize "with null record" as a keyword (even the "record").
|
||||
syntax match adaKeyword "\<with\s\+null\s\+record\>"
|
||||
" Consider generic formal parameters of subprograms and packages as keywords.
|
||||
syntax match adaKeyword ";\s*\zswith\s\+\(function\|procedure\|package\)\>"
|
||||
syntax match adaKeyword "^\s*\zswith\s\+\(function\|procedure\|package\)\>"
|
||||
endif
|
||||
|
||||
" Section: String and character constants. {{{1
|
||||
"
|
||||
syntax region adaString contains=@Spell start=+"+ skip=+""+ end=+"+
|
||||
syntax match adaCharacter "'.'"
|
||||
|
||||
" Section: Todo (only highlighted in comments) {{{1
|
||||
"
|
||||
syntax keyword adaTodo contained TODO FIXME XXX NOTE
|
||||
|
||||
" Section: Comments. {{{1
|
||||
"
|
||||
syntax region adaComment
|
||||
\ oneline
|
||||
\ contains=adaTodo,adaLineError,@Spell
|
||||
\ start="--"
|
||||
\ end="$"
|
||||
|
||||
" Section: line errors {{{1
|
||||
"
|
||||
" Note: Line errors have become quite slow with Vim 7.0
|
||||
"
|
||||
if exists("g:ada_line_errors")
|
||||
syntax match adaLineError "\(^.\{79}\)\@<=." contains=ALL containedin=ALL
|
||||
endif
|
||||
|
||||
" Section: syntax folding {{{1
|
||||
"
|
||||
" Syntax folding is very tricky - for now I still suggest to use
|
||||
" indent folding
|
||||
"
|
||||
if exists("g:ada_folding") && g:ada_folding[0] == 's'
|
||||
if stridx (g:ada_folding, 'p') >= 0
|
||||
syntax region adaPackage
|
||||
\ start="\(\<package\s\+body\>\|\<package\>\)\s*\z(\k*\)"
|
||||
\ end="end\s\+\z1\s*;"
|
||||
\ keepend extend transparent fold contains=ALL
|
||||
endif
|
||||
if stridx (g:ada_folding, 'f') >= 0
|
||||
syntax region adaProcedure
|
||||
\ start="\<procedure\>\s*\z(\k*\)"
|
||||
\ end="\<end\>\s\+\z1\s*;"
|
||||
\ keepend extend transparent fold contains=ALL
|
||||
syntax region adaFunction
|
||||
\ start="\<procedure\>\s*\z(\k*\)"
|
||||
\ end="end\s\+\z1\s*;"
|
||||
\ keepend extend transparent fold contains=ALL
|
||||
endif
|
||||
if stridx (g:ada_folding, 'f') >= 0
|
||||
syntax region adaRecord
|
||||
\ start="\<is\s\+record\>"
|
||||
\ end="\<end\s\+record\>"
|
||||
\ keepend extend transparent fold contains=ALL
|
||||
endif
|
||||
endif
|
||||
|
||||
" Section: The default methods for highlighting. Can be overridden later. {{{1
|
||||
"
|
||||
highlight def link adaCharacter Character
|
||||
highlight def link adaComment Comment
|
||||
highlight def link adaConditional Conditional
|
||||
highlight def link adaKeyword Keyword
|
||||
highlight def link adaLabel Label
|
||||
highlight def link adaNumber Number
|
||||
highlight def link adaSign Number
|
||||
highlight def link adaOperator Operator
|
||||
highlight def link adaPreproc PreProc
|
||||
highlight def link adaRepeat Repeat
|
||||
highlight def link adaSpecial Special
|
||||
highlight def link adaStatement Statement
|
||||
highlight def link adaString String
|
||||
highlight def link adaStructure Structure
|
||||
highlight def link adaTodo Todo
|
||||
highlight def link adaType Type
|
||||
highlight def link adaTypedef Typedef
|
||||
highlight def link adaStorageClass StorageClass
|
||||
highlight def link adaBoolean Boolean
|
||||
highlight def link adaException Exception
|
||||
highlight def link adaAttribute Tag
|
||||
highlight def link adaInc Include
|
||||
highlight def link adaError Error
|
||||
highlight def link adaSpaceError Error
|
||||
highlight def link adaLineError Error
|
||||
highlight def link adaBuiltinType Type
|
||||
highlight def link adaAssignment Special
|
||||
|
||||
" Subsection: Begin, End {{{2
|
||||
"
|
||||
if exists ("ada_begin_preproc")
|
||||
" This is the old default display:
|
||||
highlight def link adaBegin PreProc
|
||||
highlight def link adaEnd PreProc
|
||||
else
|
||||
" This is the new default display:
|
||||
highlight def link adaBegin Keyword
|
||||
highlight def link adaEnd Keyword
|
||||
endif
|
||||
|
||||
|
||||
|
||||
" Section: sync {{{1
|
||||
"
|
||||
" We don't need to look backwards to highlight correctly;
|
||||
" this speeds things up greatly.
|
||||
syntax sync minlines=1 maxlines=1
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
finish " 1}}}
|
||||
|
||||
"------------------------------------------------------------------------------
|
||||
" Copyright (C) 2006 Martin Krischik
|
||||
"
|
||||
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
|
||||
"------------------------------------------------------------------------------
|
||||
"vim: textwidth=78 nowrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
|
||||
"vim: foldmethod=marker
|
||||
|
||||
endif
|
||||
85
syntax/ahdl.vim
Normal file
85
syntax/ahdl.vim
Normal file
@@ -0,0 +1,85 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ahdl') == -1
|
||||
|
||||
" Vim syn file
|
||||
" Language: Altera AHDL
|
||||
" Maintainer: John Cook <john.cook@kla-tencor.com>
|
||||
" Last Change: 2001 Apr 25
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
"this language is oblivious to case.
|
||||
syn case ignore
|
||||
|
||||
" a bunch of keywords
|
||||
syn keyword ahdlKeyword assert begin bidir bits buried case clique
|
||||
syn keyword ahdlKeyword connected_pins constant defaults define design
|
||||
syn keyword ahdlKeyword device else elsif end for function generate
|
||||
syn keyword ahdlKeyword gnd help_id if in include input is machine
|
||||
syn keyword ahdlKeyword node of options others output parameters
|
||||
syn keyword ahdlKeyword returns states subdesign table then title to
|
||||
syn keyword ahdlKeyword tri_state_node variable vcc when with
|
||||
|
||||
" a bunch of types
|
||||
syn keyword ahdlIdentifier carry cascade dffe dff exp global
|
||||
syn keyword ahdlIdentifier jkffe jkff latch lcell mcell memory opendrn
|
||||
syn keyword ahdlIdentifier soft srffe srff tffe tff tri wire x
|
||||
|
||||
syn keyword ahdlMegafunction lpm_and lpm_bustri lpm_clshift lpm_constant
|
||||
syn keyword ahdlMegafunction lpm_decode lpm_inv lpm_mux lpm_or lpm_xor
|
||||
syn keyword ahdlMegafunction busmux mux
|
||||
|
||||
syn keyword ahdlMegafunction divide lpm_abs lpm_add_sub lpm_compare
|
||||
syn keyword ahdlMegafunction lpm_counter lpm_mult
|
||||
|
||||
syn keyword ahdlMegafunction altdpram csfifo dcfifo scfifo csdpram lpm_ff
|
||||
syn keyword ahdlMegafunction lpm_latch lpm_shiftreg lpm_ram_dq lpm_ram_io
|
||||
syn keyword ahdlMegafunction lpm_rom lpm_dff lpm_tff clklock pll ntsc
|
||||
|
||||
syn keyword ahdlTodo contained TODO
|
||||
|
||||
" String contstants
|
||||
syn region ahdlString start=+"+ skip=+\\"+ end=+"+
|
||||
|
||||
" valid integer number formats (decimal, binary, octal, hex)
|
||||
syn match ahdlNumber '\<\d\+\>'
|
||||
syn match ahdlNumber '\<b"\(0\|1\|x\)\+"'
|
||||
syn match ahdlNumber '\<\(o\|q\)"\o\+"'
|
||||
syn match ahdlNumber '\<\(h\|x\)"\x\+"'
|
||||
|
||||
" operators
|
||||
syn match ahdlOperator "[!&#$+\-<>=?:\^]"
|
||||
syn keyword ahdlOperator not and nand or nor xor xnor
|
||||
syn keyword ahdlOperator mod div log2 used ceil floor
|
||||
|
||||
" one line and multi-line comments
|
||||
" (define these after ahdlOperator so -- overrides -)
|
||||
syn match ahdlComment "--.*" contains=ahdlNumber,ahdlTodo
|
||||
syn region ahdlComment start="%" end="%" contains=ahdlNumber,ahdlTodo
|
||||
|
||||
" other special characters
|
||||
syn match ahdlSpecialChar "[\[\]().,;]"
|
||||
|
||||
syn sync minlines=1
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
" The default highlighting.
|
||||
hi def link ahdlNumber ahdlString
|
||||
hi def link ahdlMegafunction ahdlIdentifier
|
||||
hi def link ahdlSpecialChar SpecialChar
|
||||
hi def link ahdlKeyword Statement
|
||||
hi def link ahdlString String
|
||||
hi def link ahdlComment Comment
|
||||
hi def link ahdlIdentifier Identifier
|
||||
hi def link ahdlOperator Operator
|
||||
hi def link ahdlTodo Todo
|
||||
|
||||
|
||||
let b:current_syntax = "ahdl"
|
||||
" vim:ts=8
|
||||
|
||||
endif
|
||||
27
syntax/aidl.vim
Normal file
27
syntax/aidl.vim
Normal file
@@ -0,0 +1,27 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'aidl') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: aidl (Android Interface Definition Language)
|
||||
" https://developer.android.com/guide/components/aidl
|
||||
" Maintainer: Dominique Pelle <dominique.pelle@tomtom.com>
|
||||
" LastChange: 2020/07/25
|
||||
|
||||
" Quit when a syntax file was already loaded.
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
source <sfile>:p:h/java.vim
|
||||
|
||||
syn keyword aidlParamDir in out inout
|
||||
syn keyword aidlKeyword oneway parcelable
|
||||
|
||||
" Needed for the 'in', 'out', 'inout' keywords to be highlighted.
|
||||
syn cluster javaTop add=aidlParamDir
|
||||
|
||||
hi def link aidlParamDir StorageClass
|
||||
hi def link aidlKeyword Keyword
|
||||
|
||||
let b:current_syntax = "aidl"
|
||||
|
||||
endif
|
||||
53
syntax/alsaconf.vim
Normal file
53
syntax/alsaconf.vim
Normal file
@@ -0,0 +1,53 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'alsaconf') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: alsaconf(8) configuration file
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2006-04-19
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn keyword alsoconfTodo contained FIXME TODO XXX NOTE
|
||||
|
||||
syn region alsaconfComment display oneline
|
||||
\ start='#' end='$'
|
||||
\ contains=alsaconfTodo,@Spell
|
||||
|
||||
syn match alsaconfSpecialChar contained display '\\[ntvbrf]'
|
||||
syn match alsaconfSpecialChar contained display '\\\o\+'
|
||||
|
||||
syn region alsaconfString start=+"+ skip=+\\$+ end=+"\|$+
|
||||
\ contains=alsaconfSpecialChar
|
||||
|
||||
syn match alsaconfSpecial contained display 'confdir:'
|
||||
|
||||
syn region alsaconfPreProc start='<' end='>' contains=alsaconfSpecial
|
||||
|
||||
syn match alsaconfMode display '[+?!-]'
|
||||
|
||||
syn keyword alsaconfKeyword card default device errors files func strings
|
||||
syn keyword alsaconfKeyword subdevice type vars
|
||||
|
||||
syn match alsaconfVariables display '@\(hooks\|func\|args\)'
|
||||
|
||||
hi def link alsoconfTodo Todo
|
||||
hi def link alsaconfComment Comment
|
||||
hi def link alsaconfSpecialChar SpecialChar
|
||||
hi def link alsaconfString String
|
||||
hi def link alsaconfSpecial Special
|
||||
hi def link alsaconfPreProc PreProc
|
||||
hi def link alsaconfMode Special
|
||||
hi def link alsaconfKeyword Keyword
|
||||
hi def link alsaconfVariables Identifier
|
||||
|
||||
let b:current_syntax = "alsaconf"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user