mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0df1bfa0c5 | ||
|
|
f7302d9262 | ||
|
|
7e38f4288a | ||
|
|
e521ba3ae2 | ||
|
|
ee4f51587d | ||
|
|
20a388cbc8 | ||
|
|
81e61a3c5d | ||
|
|
5670985b3a | ||
|
|
69eae22ea6 | ||
|
|
f8cee0172b | ||
|
|
c6936aeeb1 | ||
|
|
6bb111eaba | ||
|
|
dfecb63078 | ||
|
|
00015bd105 | ||
|
|
d821de3142 | ||
|
|
a3bdbcdb3c | ||
|
|
34e01b8b62 | ||
|
|
1e533e5982 | ||
|
|
56121b4e27 | ||
|
|
9c3c0bc082 | ||
|
|
8500ae8bb9 | ||
|
|
d09a56a494 | ||
|
|
abca7c2014 | ||
|
|
8b6c06e723 | ||
|
|
a86c0179eb | ||
|
|
22095febb7 | ||
|
|
ff066ee9f0 | ||
|
|
5b38663027 | ||
|
|
f0b38f2c1d | ||
|
|
6676d61f61 | ||
|
|
f0da1a9f4d | ||
|
|
298d6b6356 | ||
|
|
62f004c3da | ||
|
|
c73ea49ecb | ||
|
|
b2be47befc | ||
|
|
de38ccabbd | ||
|
|
f0f49cf0fa | ||
|
|
224a6348f9 | ||
|
|
00c3f02945 | ||
|
|
df34b4b4fa | ||
|
|
f3804b0892 |
7
.gitattributes
vendored
7
.gitattributes
vendored
@@ -1,7 +0,0 @@
|
|||||||
.gitignore export-ignore
|
|
||||||
.gitattributes export-ignore
|
|
||||||
README.md export-ignore
|
|
||||||
/spec export-ignore
|
|
||||||
Gemfile export-ignore
|
|
||||||
Gemfile.lock export-ignore
|
|
||||||
.travis.yml export-ignore
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
/tmp
|
/tmp
|
||||||
!*ctags*
|
!*ctags*
|
||||||
|
tags
|
||||||
|
|||||||
16
.travis.yml
16
.travis.yml
@@ -1,11 +1,7 @@
|
|||||||
language: ruby
|
language: vim
|
||||||
rvm:
|
|
||||||
- 2.6
|
|
||||||
sudo: false
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- vim-gtk
|
|
||||||
before_script:
|
before_script:
|
||||||
- "./build"
|
- sudo add-apt-repository ppa:jonathonf/vim -y
|
||||||
script: xvfb-run bundle exec rspec --format=documentation
|
- sudo apt-get update -q
|
||||||
|
- sudo apt-get install -y vim
|
||||||
|
- vim --version
|
||||||
|
script: ./test
|
||||||
|
|||||||
28
Gemfile.lock
28
Gemfile.lock
@@ -1,28 +0,0 @@
|
|||||||
GEM
|
|
||||||
remote: https://rubygems.org/
|
|
||||||
specs:
|
|
||||||
diff-lcs (1.3)
|
|
||||||
rspec (3.8.0)
|
|
||||||
rspec-core (~> 3.8.0)
|
|
||||||
rspec-expectations (~> 3.8.0)
|
|
||||||
rspec-mocks (~> 3.8.0)
|
|
||||||
rspec-core (3.8.0)
|
|
||||||
rspec-support (~> 3.8.0)
|
|
||||||
rspec-expectations (3.8.2)
|
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
|
||||||
rspec-support (~> 3.8.0)
|
|
||||||
rspec-mocks (3.8.0)
|
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
|
||||||
rspec-support (~> 3.8.0)
|
|
||||||
rspec-support (3.8.0)
|
|
||||||
vimrunner (0.3.4)
|
|
||||||
|
|
||||||
PLATFORMS
|
|
||||||
ruby
|
|
||||||
|
|
||||||
DEPENDENCIES
|
|
||||||
rspec
|
|
||||||
vimrunner
|
|
||||||
|
|
||||||
BUNDLED WITH
|
|
||||||
1.16.2
|
|
||||||
20
README.md
20
README.md
@@ -10,13 +10,13 @@ A collection of language packs for Vim.
|
|||||||
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
||||||
|
|
||||||
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
|
- 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-->149<!--/Package Count--> packages it consists of.
|
- It **installs and updates 120+ times faster** than the <!--Package Count-->157<!--/Package Count--> packages it consists of.
|
||||||
- Solid syntax and indentation support (other features skipped). Only the best language packs.
|
- Solid syntax and indentation support (other features skipped). Only the best language packs.
|
||||||
- All unnecessary files are ignored (like enormous documentation from php support).
|
- All unnecessary files are ignored (like enormous documentation from php support).
|
||||||
- No support for esoteric languages, only most popular ones (modern too, like `slim`).
|
- No support for esoteric languages, only most popular ones (modern too, like `slim`).
|
||||||
- Each build is tested by automated vimrunner script on CI. See `spec` directory.
|
- Each build is tested by automated vimrunner script on CI. See `spec` directory.
|
||||||
|
|
||||||
\*To be completely honest, concatenated `ftdetect` script takes up to `17ms` to load.
|
\*To be completely honest, optimized `ftdetect` script takes up to `19ms` to load.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -77,11 +77,12 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin)
|
- [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin)
|
||||||
- [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin)
|
- [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin)
|
||||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent)
|
- [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)
|
- [ferm](https://github.com/vim-scripts/ferm.vim) (syntax)
|
||||||
- [fish](https://github.com/georgewitteman/vim-fish) (syntax, indent, compiler, autoload, ftplugin)
|
- [fish](https://github.com/georgewitteman/vim-fish) (syntax, indent, compiler, autoload, ftplugin)
|
||||||
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers) (syntax)
|
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers) (syntax)
|
||||||
- [fsharp](https://github.com/ionide/Ionide-vim) (syntax, indent)
|
- [fsharp](https://github.com/ionide/Ionide-vim) (syntax, indent)
|
||||||
- [gdscript](https://github.com/calviken/vim-gdscript3) (syntax, indent, ftplugin)
|
- [gdscript](https://github.com/calviken/vim-gdscript3) (syntax, indent)
|
||||||
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin)
|
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin)
|
||||||
- [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent)
|
- [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent)
|
||||||
- [gmpl](https://github.com/maelvalais/gmpl.vim) (syntax)
|
- [gmpl](https://github.com/maelvalais/gmpl.vim) (syntax)
|
||||||
@@ -90,7 +91,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [gradle](https://github.com/tfnico/vim-gradle) (compiler)
|
- [gradle](https://github.com/tfnico/vim-gradle) (compiler)
|
||||||
- [graphql](https://github.com/jparise/vim-graphql) (syntax, indent, autoload, ftplugin, after)
|
- [graphql](https://github.com/jparise/vim-graphql) (syntax, indent, autoload, ftplugin, after)
|
||||||
- [haml](https://github.com/sheerun/vim-haml) (syntax, indent, compiler, ftplugin)
|
- [haml](https://github.com/sheerun/vim-haml) (syntax, indent, compiler, ftplugin)
|
||||||
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, indent, ftplugin)
|
- [handlebars](https://github.com/sheerun/vim-mustache-handlebars) (syntax, indent, ftplugin)
|
||||||
- [haproxy](https://github.com/CH-DanReif/haproxy.vim) (syntax)
|
- [haproxy](https://github.com/CH-DanReif/haproxy.vim) (syntax)
|
||||||
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin)
|
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin)
|
||||||
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax)
|
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax)
|
||||||
@@ -99,13 +100,16 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [hive](https://github.com/zebradil/hive.vim) (syntax, ftplugin)
|
- [hive](https://github.com/zebradil/hive.vim) (syntax, ftplugin)
|
||||||
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
|
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
|
||||||
- [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin)
|
- [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin)
|
||||||
|
- [icalenadr](https://github.com/chutzpah/icalendar.vim) (syntax)
|
||||||
- [idris](https://github.com/idris-hackers/idris-vim) (syntax, indent, ftplugin)
|
- [idris](https://github.com/idris-hackers/idris-vim) (syntax, indent, ftplugin)
|
||||||
- [ion](https://github.com/vmchale/ion-vim) (syntax, ftplugin)
|
- [ion](https://github.com/vmchale/ion-vim) (syntax, ftplugin)
|
||||||
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras)
|
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras)
|
||||||
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent)
|
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent)
|
||||||
- [jinja](https://github.com/lepture/vim-jinja) (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)
|
- [json5](https://github.com/GutenYe/json5.vim) (syntax)
|
||||||
- [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin)
|
- [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin)
|
||||||
|
- [jsonnet](https://github.com/google/vim-jsonnet) (syntax, autoload, ftplugin)
|
||||||
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent)
|
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent)
|
||||||
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (autoload, after)
|
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (autoload, after)
|
||||||
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (syntax, indent, autoload, ftplugin)
|
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (syntax, indent, autoload, ftplugin)
|
||||||
@@ -152,6 +156,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [raml](https://github.com/IN3D/vim-raml) (syntax, ftplugin)
|
- [raml](https://github.com/IN3D/vim-raml) (syntax, ftplugin)
|
||||||
- [razor](https://github.com/adamclerk/vim-razor) (syntax, indent, ftplugin)
|
- [razor](https://github.com/adamclerk/vim-razor) (syntax, indent, ftplugin)
|
||||||
- [reason](https://github.com/reasonml-editor/vim-reason-plus) (syntax, indent)
|
- [reason](https://github.com/reasonml-editor/vim-reason-plus) (syntax, indent)
|
||||||
|
- [requirements](https://github.com/raimon49/requirements.txt.vim) (syntax, autoload)
|
||||||
- [rspec](https://github.com/keith/rspec.vim) (syntax)
|
- [rspec](https://github.com/keith/rspec.vim) (syntax)
|
||||||
- [rst](https://github.com/marshallward/vim-restructuredtext) (syntax, indent, autoload, ftplugin)
|
- [rst](https://github.com/marshallward/vim-restructuredtext) (syntax, indent, autoload, ftplugin)
|
||||||
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin)
|
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin)
|
||||||
@@ -159,12 +164,14 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax)
|
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax)
|
||||||
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin, ctags)
|
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin, ctags)
|
||||||
- [scss](https://github.com/cakebaker/scss-syntax.vim) (syntax, indent, ftplugin)
|
- [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)
|
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin)
|
||||||
- [slime](https://github.com/slime-lang/vim-slime-syntax) (syntax, indent)
|
- [slime](https://github.com/slime-lang/vim-slime-syntax) (syntax, indent)
|
||||||
- [smt2](https://github.com/bohlender/vim-smt2) (syntax, autoload, ftplugin)
|
- [smt2](https://github.com/bohlender/vim-smt2) (syntax, autoload, ftplugin)
|
||||||
- [solidity](https://github.com/tomlion/vim-solidity) (syntax, indent, 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)
|
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin)
|
||||||
- [svelte](https://github.com/evanleck/vim-svelte) (syntax, indent, ftplugin)
|
- [svelte](https://github.com/evanleck/vim-svelte#main) (syntax, indent, ftplugin)
|
||||||
- [svg-indent](https://github.com/jasonshell/vim-svg-indent) (indent)
|
- [svg-indent](https://github.com/jasonshell/vim-svg-indent) (indent)
|
||||||
- [svg](https://github.com/vim-scripts/svg.vim) (syntax)
|
- [svg](https://github.com/vim-scripts/svg.vim) (syntax)
|
||||||
- [swift](https://github.com/keith/swift.vim) (syntax, indent, compiler, ftplugin, ctags)
|
- [swift](https://github.com/keith/swift.vim) (syntax, indent, compiler, ftplugin, ctags)
|
||||||
@@ -179,6 +186,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [tptp](https://github.com/c-cube/vim-tptp) (syntax)
|
- [tptp](https://github.com/c-cube/vim-tptp) (syntax)
|
||||||
- [twig](https://github.com/lumiliet/vim-twig) (syntax, indent, ftplugin)
|
- [twig](https://github.com/lumiliet/vim-twig) (syntax, indent, ftplugin)
|
||||||
- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (syntax, indent, compiler, ftplugin, ctags)
|
- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (syntax, indent, compiler, ftplugin, ctags)
|
||||||
|
- [unison](https://github.com/unisonweb/unison#trunk) (syntax)
|
||||||
- [v](https://github.com/ollykel/v-vim) (syntax, indent, ftplugin)
|
- [v](https://github.com/ollykel/v-vim) (syntax, indent, ftplugin)
|
||||||
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent, ftplugin)
|
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent, ftplugin)
|
||||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||||
@@ -192,7 +200,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
|||||||
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)
|
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)
|
||||||
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
||||||
- [zephir](https://github.com/xwsoul/vim-zephir) (syntax)
|
- [zephir](https://github.com/xwsoul/vim-zephir) (syntax)
|
||||||
- [zig](https://github.com/ziglang/zig.vim) (syntax, autoload, ftplugin)
|
- [zig](https://github.com/ziglang/zig.vim) (syntax, indent, autoload, ftplugin)
|
||||||
- [zinit](https://github.com/zinit-zsh/zplugin-vim-syntax) (syntax)
|
- [zinit](https://github.com/zinit-zsh/zplugin-vim-syntax) (syntax)
|
||||||
<!--/Language Packs-->
|
<!--/Language Packs-->
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ let s:highlight_close_tag = get(g:, 'vim_jsx_pretty_highlight_close_tag', 0)
|
|||||||
|
|
||||||
" detect jsx region
|
" detect jsx region
|
||||||
syntax region jsxRegion
|
syntax region jsxRegion
|
||||||
\ start=+\%(\%(\_[([,?:=+\-*/>{}]\|<\s\+\|&&\|||\|=>\|\<return\|\<default\|\<await\|\<yield\)\_s*\)\@<=<\_s*\%(>\|\z(\%(script\|T\s*>\s*(\)\@!\<[_$A-Za-z][-:._$A-Za-z0-9]*\>\)\%(\_s*\%([-+*)\]}&|?,]\|/\%([/*]\|\_s*>\)\@!\)\)\@!\)+
|
\ start=+\%(\%(\_[([,?:=+\-*/>{}]\|<\s\+\|&&\|||\|=>\|\<return\|\<default\|\<await\|\<yield\)\_s*\)\@<=<\_s*\%(>\|\z(\%(script\|\s*\<T\>\)\@!\<[_$A-Za-z][-:._$A-Za-z0-9]*\>\)\%(\_s*\%([-+*)\]}&|?,]\|/\%([/*]\|\_s*>\)\@!\)\)\@!\)+
|
||||||
\ end=++
|
\ end=++
|
||||||
\ contains=jsxElement
|
\ contains=jsxElement
|
||||||
|
|
||||||
|
|||||||
37
after/syntax/reason/graphql.vim
Normal file
37
after/syntax/reason/graphql.vim
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1
|
||||||
|
|
||||||
|
" Copyright (c) 2016-2020 Jon Parise <jon@indelible.org>
|
||||||
|
"
|
||||||
|
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
" of this software and associated documentation files (the "Software"), to
|
||||||
|
" deal in the Software without restriction, including without limitation the
|
||||||
|
" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
" sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
" furnished to do so, subject to the following conditions:
|
||||||
|
"
|
||||||
|
" The above copyright notice and this permission notice shall be included in
|
||||||
|
" all copies or substantial portions of the Software.
|
||||||
|
"
|
||||||
|
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
" IN THE SOFTWARE.
|
||||||
|
"
|
||||||
|
" Language: GraphQL
|
||||||
|
" Maintainer: Jon Parise <jon@indelible.org>
|
||||||
|
|
||||||
|
if exists('b:current_syntax')
|
||||||
|
let s:current_syntax = b:current_syntax
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
|
syn include @GraphQLSyntax syntax/graphql.vim
|
||||||
|
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
|
||||||
|
|
||||||
|
endif
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,5 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
let s:V = vital#crystal#new()
|
let s:V = vital#crystal#new()
|
||||||
let s:P = s:V.import('Process')
|
let s:P = s:V.import('Process')
|
||||||
let s:C = s:V.import('ColorEcho')
|
let s:C = s:V.import('ColorEcho')
|
||||||
@@ -365,9 +362,6 @@ function! crystal_lang#expand(file, pos, ...) abort
|
|||||||
return crystal_lang#tool('expand', a:file, a:pos, get(a:, 1, ''))
|
return crystal_lang#tool('expand', a:file, a:pos, get(a:, 1, ''))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: sw=2 sts=2 et:
|
" vim: sw=2 sts=2 et:
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ fu! csv#GetPat(colnr, maxcolnr, pat, allowmore) "{{{3
|
|||||||
" Allow space in front of the pattern, so that it works correctly
|
" Allow space in front of the pattern, so that it works correctly
|
||||||
" even if :Arrange Col has been used #100
|
" even if :Arrange Col has been used #100
|
||||||
return '^' . csv#GetColPat(a:colnr - 1,0) .
|
return '^' . csv#GetColPat(a:colnr - 1,0) .
|
||||||
\ '\s*\zs' . a:pat . '\ze' . (a:allowmore ? '' : '$')
|
\ '.*\zs' . a:pat . '\ze' . (a:allowmore ? '' : '$')
|
||||||
else
|
else
|
||||||
return '\%' . b:csv_fixed_width_cols[-1] .
|
return '\%' . b:csv_fixed_width_cols[-1] .
|
||||||
\ 'c\zs' . a:pat . '\ze' . (a:allowmore ? '' : '$')
|
\ 'c\zs' . a:pat . '\ze' . (a:allowmore ? '' : '$')
|
||||||
@@ -504,7 +504,7 @@ fu! csv#WColumn(...) "{{{3
|
|||||||
" Return on which column the cursor is
|
" Return on which column the cursor is
|
||||||
let _cur = getpos('.')
|
let _cur = getpos('.')
|
||||||
if !exists("b:csv_fixed_width_cols")
|
if !exists("b:csv_fixed_width_cols")
|
||||||
if line('.') > 1 && mode('') != 'n'
|
if line('.') > 1 && mode('') != 'n' && empty(getline('.')[0:col('.')-1])
|
||||||
" in insert mode, get line from above, just in case the current
|
" in insert mode, get line from above, just in case the current
|
||||||
" line is empty
|
" line is empty
|
||||||
let line = getline(line('.')-1)
|
let line = getline(line('.')-1)
|
||||||
@@ -1507,10 +1507,10 @@ fu! csv#AvgColumn(list) "{{{3
|
|||||||
endfor
|
endfor
|
||||||
if has("float")
|
if has("float")
|
||||||
let b:csv_result = printf("%.2f", sum/cnt)
|
let b:csv_result = printf("%.2f", sum/cnt)
|
||||||
return b:csv_result
|
return str2float(b:csv_result)
|
||||||
else
|
else
|
||||||
let b:csv_result = printf("%s", sum/cnt)
|
let b:csv_result = printf("%s", sum/cnt)
|
||||||
return sum/cnt
|
return b:csv_result + 0
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endfu
|
endfu
|
||||||
@@ -1543,7 +1543,7 @@ fu! csv#VarianceColumn(list, is_population) "{{{3
|
|||||||
let cnt = cnt-1
|
let cnt = cnt-1
|
||||||
endif
|
endif
|
||||||
if has("float")
|
if has("float")
|
||||||
let b:csv_result = printf("%.2f", sum/cnt)
|
let b:csv_result = printf("%." . get(b:, 'csv_accuracy', get(g:, 'csv_accuracy', 2)) . "f", sum/cnt)
|
||||||
return b:csv_result
|
return b:csv_result
|
||||||
else
|
else
|
||||||
let b:csv_result = printf("%s", sum/cnt)
|
let b:csv_result = printf("%s", sum/cnt)
|
||||||
@@ -1956,8 +1956,12 @@ fu! csv#CheckHeaderLine() "{{{3
|
|||||||
endfu
|
endfu
|
||||||
fu! csv#AnalyzeColumn(...) "{{{3
|
fu! csv#AnalyzeColumn(...) "{{{3
|
||||||
let maxcolnr = csv#MaxColumns()
|
let maxcolnr = csv#MaxColumns()
|
||||||
if len(a:000) == 1
|
let topn = 5
|
||||||
|
if len(a:000) > 0
|
||||||
let colnr = a:1
|
let colnr = a:1
|
||||||
|
if len(a:000) == 2
|
||||||
|
let topn = a:2
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
let colnr = csv#WColumn()
|
let colnr = csv#WColumn()
|
||||||
endif
|
endif
|
||||||
@@ -1985,8 +1989,8 @@ fu! csv#AnalyzeColumn(...) "{{{3
|
|||||||
let max_items = reverse(sort(values(res), s:csv_numeric_sort ? 'n' : 'csv#CSVSortValues'))
|
let max_items = reverse(sort(values(res), s:csv_numeric_sort ? 'n' : 'csv#CSVSortValues'))
|
||||||
" What about the minimum 5 items?
|
" What about the minimum 5 items?
|
||||||
let count_items = keys(res)
|
let count_items = keys(res)
|
||||||
if len(max_items) > 5
|
if len(max_items) > topn
|
||||||
call remove(max_items, 5, -1)
|
call remove(max_items, topn, -1)
|
||||||
call map(max_items, 'printf(''\V%s\m'', escape(v:val, ''\\''))')
|
call map(max_items, 'printf(''\V%s\m'', escape(v:val, ''\\''))')
|
||||||
call filter(res, 'v:val =~ ''^''.join(max_items, ''\|'').''$''')
|
call filter(res, 'v:val =~ ''^''.join(max_items, ''\|'').''$''')
|
||||||
endif
|
endif
|
||||||
@@ -2263,7 +2267,7 @@ fu! csv#CommandDefinitions() "{{{3
|
|||||||
\ ':echo csv#EvalColumn(<q-args>, "csv#SmplStdDevColumn", <line1>,<line2>)',
|
\ ':echo csv#EvalColumn(<q-args>, "csv#SmplStdDevColumn", <line1>,<line2>)',
|
||||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||||
call csv#LocalCmd("PopStdCol",
|
call csv#LocalCmd("PopStdCol",
|
||||||
\ ':echo csv#EvalColumn(<q-args>, "csv#SmplStdDevColumn", <line1>,<line2>)',
|
\ ':echo csv#EvalColumn(<q-args>, "csv#PopStdDevColumn", <line1>,<line2>)',
|
||||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||||
call csv#LocalCmd("UnArrangeColumn",
|
call csv#LocalCmd("UnArrangeColumn",
|
||||||
\':call csv#PrepUnArrangeCol(<line1>, <line2>)',
|
\':call csv#PrepUnArrangeCol(<line1>, <line2>)',
|
||||||
@@ -2311,8 +2315,8 @@ fu! csv#CommandDefinitions() "{{{3
|
|||||||
\ '-bang -nargs=? -range=%')
|
\ '-bang -nargs=? -range=%')
|
||||||
call csv#LocalCmd("Filters", ':call csv#OutputFilters(<bang>0)',
|
call csv#LocalCmd("Filters", ':call csv#OutputFilters(<bang>0)',
|
||||||
\ '-nargs=0 -bang')
|
\ '-nargs=0 -bang')
|
||||||
call csv#LocalCmd("Analyze", ':call csv#AnalyzeColumn(<args>)',
|
call csv#LocalCmd("Analyze", ':call csv#AnalyzeColumn(<f-args>)',
|
||||||
\ '-nargs=?')
|
\ '-nargs=*' )
|
||||||
call csv#LocalCmd("VertFold", ':call csv#Vertfold(<bang>0,<q-args>)',
|
call csv#LocalCmd("VertFold", ':call csv#Vertfold(<bang>0,<q-args>)',
|
||||||
\ '-bang -nargs=? -range=% -complete=custom,csv#SortComplete')
|
\ '-bang -nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||||
call csv#LocalCmd("CSVFixed", ':call csv#InitCSVFixedWidth()', '')
|
call csv#LocalCmd("CSVFixed", ':call csv#InitCSVFixedWidth()', '')
|
||||||
|
|||||||
@@ -27,12 +27,16 @@ function! s:clearQfList(reason) abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! dart#fmt(q_args) abort
|
function! dart#fmt(...) abort
|
||||||
let cmd = s:FindDartFmt()
|
let l:dartfmt = s:FindDartFmt()
|
||||||
if type(cmd) != type('') | return | endif
|
if type(l:dartfmt) != type('') | return | endif
|
||||||
let buffer_content = getline(1, '$')
|
let buffer_content = getline(1, '$')
|
||||||
let args = '--stdin-name '.expand('%').' '.a:q_args
|
let l:cmd = [l:dartfmt, '--stdin-name', shellescape(expand('%'))]
|
||||||
let lines = systemlist(printf('%s %s', cmd, args), join(buffer_content, "\n"))
|
if exists('g:dartfmt_options')
|
||||||
|
call extend(l:cmd, g:dartfmt_options)
|
||||||
|
endif
|
||||||
|
call extend(l:cmd, a:000)
|
||||||
|
let lines = systemlist(join(l:cmd), join(buffer_content, "\n"))
|
||||||
" TODO(https://github.com/dart-lang/sdk/issues/38507) - Remove once the
|
" TODO(https://github.com/dart-lang/sdk/issues/38507) - Remove once the
|
||||||
" tool no longer emits this line on SDK upgrades.
|
" tool no longer emits this line on SDK upgrades.
|
||||||
if lines[-1] ==# 'Isolate creation failed'
|
if lines[-1] ==# 'Isolate creation failed'
|
||||||
|
|||||||
@@ -1,25 +1,43 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fish') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fish') == -1
|
||||||
|
|
||||||
function! fish#Indent()
|
function! fish#Indent()
|
||||||
let l:shiftwidth = shiftwidth()
|
|
||||||
let l:prevlnum = prevnonblank(v:lnum - 1)
|
let l:prevlnum = prevnonblank(v:lnum - 1)
|
||||||
if l:prevlnum ==# 0
|
if l:prevlnum ==# 0
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
let l:indent = 0
|
|
||||||
let l:prevline = getline(l:prevlnum)
|
let l:prevline = getline(l:prevlnum)
|
||||||
if l:prevline =~# '\v^\s*switch>'
|
|
||||||
return indent(l:prevlnum) + l:shiftwidth
|
|
||||||
elseif l:prevline =~# '\v^\s*%(begin|if|else|while|for|function|case)>'
|
|
||||||
let l:indent = l:shiftwidth
|
|
||||||
endif
|
|
||||||
let l:line = getline(v:lnum)
|
let l:line = getline(v:lnum)
|
||||||
if l:line =~# '\v^\s*end>'
|
let l:shiftwidth = shiftwidth()
|
||||||
return indent(l:prevlnum) - (l:indent ==# 0 ? l:shiftwidth : l:indent)
|
let l:previndent = indent(l:prevlnum)
|
||||||
elseif l:line =~# '\v^\s*%(case|else)>'
|
let l:indent = l:previndent
|
||||||
return indent(l:prevlnum) - l:shiftwidth
|
if l:prevline =~# '\v^\s*%(begin|if|else|while|for|function|switch|case)>'
|
||||||
|
let l:indent += l:shiftwidth
|
||||||
endif
|
endif
|
||||||
return indent(l:prevlnum) + l:indent
|
if l:line =~# '\v^\s*end>'
|
||||||
|
let l:indent -= l:shiftwidth
|
||||||
|
" If we're inside a case, dedent twice because it ends the switch.
|
||||||
|
if l:prevline =~# '\v^\s*case>'
|
||||||
|
" Previous line starts the case.
|
||||||
|
let l:indent -= l:shiftwidth
|
||||||
|
else
|
||||||
|
" Scan back to a dedented line to find whether we're in a case.
|
||||||
|
let l:i = l:prevlnum
|
||||||
|
while l:i >= 1 && indent(l:i) >= l:previndent
|
||||||
|
let l:i = prevnonblank(l:i - 1)
|
||||||
|
endwhile
|
||||||
|
if indent(l:i) < l:previndent && getline(l:i) =~# '\v^\s*case>'
|
||||||
|
let l:indent -= l:shiftwidth
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
elseif l:line =~# '\v^\s*else>'
|
||||||
|
let l:indent -= l:shiftwidth
|
||||||
|
elseif l:prevline !~# '\v^\s*switch>' && l:line =~# '\v^\s*case>'
|
||||||
|
let l:indent -= l:shiftwidth
|
||||||
|
endif
|
||||||
|
if l:indent < 0
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
return l:indent
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fish#Format()
|
function! fish#Format()
|
||||||
|
|||||||
@@ -170,8 +170,8 @@ function! go#config#EchoCommandInfo() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#DocUrl() abort
|
function! go#config#DocUrl() abort
|
||||||
let godoc_url = get(g:, 'go_doc_url', 'https://godoc.org')
|
let godoc_url = get(g:, 'go_doc_url', 'https://pkg.go.dev')
|
||||||
if godoc_url isnot 'https://godoc.org'
|
if godoc_url isnot 'https://pkg.go.dev'
|
||||||
" strip last '/' character if available
|
" strip last '/' character if available
|
||||||
let last_char = strlen(godoc_url) - 1
|
let last_char = strlen(godoc_url) - 1
|
||||||
if godoc_url[last_char] == '/'
|
if godoc_url[last_char] == '/'
|
||||||
@@ -266,23 +266,11 @@ function! go#config#MetalinterCommand() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#MetalinterAutosaveEnabled() abort
|
function! go#config#MetalinterAutosaveEnabled() abort
|
||||||
let l:default_enabled = ["vet", "golint"]
|
return get(g:, "go_metalinter_autosave_enabled", ["govet", "golint"])
|
||||||
|
|
||||||
if go#config#MetalinterCommand() == "golangci-lint"
|
|
||||||
let l:default_enabled = ["govet", "golint"]
|
|
||||||
endif
|
|
||||||
|
|
||||||
return get(g:, "go_metalinter_autosave_enabled", default_enabled)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#MetalinterEnabled() abort
|
function! go#config#MetalinterEnabled() abort
|
||||||
let l:default_enabled = ["vet", "golint", "errcheck"]
|
return get(g:, "go_metalinter_enabled", ["vet", "golint", "errcheck"])
|
||||||
|
|
||||||
if go#config#MetalinterCommand() == "golangci-lint"
|
|
||||||
let l:default_enabled = ["govet", "golint"]
|
|
||||||
endif
|
|
||||||
|
|
||||||
return get(g:, "go_metalinter_enabled", default_enabled)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#GolintBin() abort
|
function! go#config#GolintBin() abort
|
||||||
@@ -383,7 +371,7 @@ function! go#config#RenameCommand() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#GorenameBin() abort
|
function! go#config#GorenameBin() abort
|
||||||
return get(g:, "go_gorename_bin", "gorename")
|
return get(g:, "go_gorename_bin", "gopls")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#GorenamePrefill() abort
|
function! go#config#GorenamePrefill() abort
|
||||||
@@ -508,6 +496,10 @@ function! go#config#CodeCompletionEnabled() abort
|
|||||||
return get(g:, "go_code_completion_enabled", 1)
|
return get(g:, "go_code_completion_enabled", 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! go#config#CodeCompletionIcase() abort
|
||||||
|
return get(g:, "go_code_completion_icase", 0)
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! go#config#Updatetime() abort
|
function! go#config#Updatetime() abort
|
||||||
let go_updatetime = get(g:, 'go_updatetime', 800)
|
let go_updatetime = get(g:, 'go_updatetime', 800)
|
||||||
return go_updatetime == 0 ? &updatetime : go_updatetime
|
return go_updatetime == 0 ? &updatetime : go_updatetime
|
||||||
@@ -565,7 +557,7 @@ function! go#config#DiagnosticsEnabled() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#GoplsOptions() abort
|
function! go#config#GoplsOptions() abort
|
||||||
return get(g:, 'go_gopls_options', [])
|
return get(g:, 'go_gopls_options', ['-remote=auto'])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Set the default value. A value of "1" is a shortcut for this, for
|
" Set the default value. A value of "1" is a shortcut for this, for
|
||||||
|
|||||||
129
autoload/jsonnet.vim
Normal file
129
autoload/jsonnet.vim
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsonnet') == -1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
" Options.
|
||||||
|
|
||||||
|
if !exists("g:jsonnet_command")
|
||||||
|
let g:jsonnet_command = "jsonnet"
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("g:jsonnet_fmt_command")
|
||||||
|
let g:jsonnet_fmt_command = "jsonnetfmt"
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:jsonnet_fmt_options')
|
||||||
|
let g:jsonnet_fmt_options = ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:jsonnet_fmt_fail_silently')
|
||||||
|
let g:jsonnet_fmt_fail_silently = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" System runs a shell command. It will reset the shell to /bin/sh for Unix-like
|
||||||
|
" systems if it is executable.
|
||||||
|
function! jsonnet#System(str, ...)
|
||||||
|
let l:shell = &shell
|
||||||
|
if executable('/bin/sh')
|
||||||
|
let &shell = '/bin/sh'
|
||||||
|
endif
|
||||||
|
|
||||||
|
try
|
||||||
|
let l:output = call("system", [a:str] + a:000)
|
||||||
|
return l:output
|
||||||
|
finally
|
||||||
|
let &shell = l:shell
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" CheckBinPath checks whether the given binary exists or not and returns the
|
||||||
|
" path of the binary. It returns an empty string if it doesn't exists.
|
||||||
|
function! jsonnet#CheckBinPath(binName)
|
||||||
|
|
||||||
|
if executable(a:binName)
|
||||||
|
if exists('*exepath')
|
||||||
|
let binPath = exepath(a:binName)
|
||||||
|
return binPath
|
||||||
|
else
|
||||||
|
return a:binName
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
echo "vim-jsonnet: could not find '" . a:binName . "'."
|
||||||
|
return ""
|
||||||
|
endif
|
||||||
|
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Format calls `jsonnetfmt ... ` on the file and replaces the file with the
|
||||||
|
" auto formatted version. Does some primitive error checking of the
|
||||||
|
" jsonnetfmt command too.
|
||||||
|
function! jsonnet#Format()
|
||||||
|
|
||||||
|
" Save cursor position and many other things.
|
||||||
|
let l:curw = winsaveview()
|
||||||
|
|
||||||
|
" Write current unsaved buffer to a temp file
|
||||||
|
let l:tmpname = tempname()
|
||||||
|
call writefile(getline(1, '$'), l:tmpname)
|
||||||
|
|
||||||
|
" get the command first so we can test it
|
||||||
|
let l:binName = g:jsonnet_fmt_command
|
||||||
|
|
||||||
|
" check if the user has installed command binary.
|
||||||
|
let l:binPath = jsonnet#CheckBinPath(l:binName)
|
||||||
|
if empty(l:binPath)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" Populate the final command.
|
||||||
|
let l:command = l:binPath
|
||||||
|
" The inplace modification is default. Makes file management easier
|
||||||
|
let l:command = l:command . ' -i '
|
||||||
|
let l:command = l:command . g:jsonnet_fmt_options
|
||||||
|
|
||||||
|
" Execute the compiled jsonnetfmt command and save the return value
|
||||||
|
let l:out = jsonnet#System(l:command . " " . l:tmpname)
|
||||||
|
let l:errorCode = v:shell_error
|
||||||
|
|
||||||
|
if l:errorCode == 0
|
||||||
|
" The format command succeeded Move the formatted temp file over the
|
||||||
|
" current file and restore other settings
|
||||||
|
|
||||||
|
" stop undo recording
|
||||||
|
try | silent undojoin | catch | endtry
|
||||||
|
|
||||||
|
let l:originalFileFormat = &fileformat
|
||||||
|
if exists("*getfperm")
|
||||||
|
" save old file permissions
|
||||||
|
let l:originalFPerm = getfperm(expand('%'))
|
||||||
|
endif
|
||||||
|
" Overwrite current file with the formatted temp file
|
||||||
|
call rename(l:tmpname, expand('%'))
|
||||||
|
|
||||||
|
if exists("*setfperm") && l:originalFPerm != ''
|
||||||
|
call setfperm(expand('%'), l:originalFPerm)
|
||||||
|
endif
|
||||||
|
" the file has been changed outside of vim, enable reedit
|
||||||
|
silent edit!
|
||||||
|
let &fileformat = l:originalFileFormat
|
||||||
|
let &syntax = &syntax
|
||||||
|
elseif g:jsonnet_fmt_fail_silently == 0
|
||||||
|
" FixMe: We could leverage the errors coming from the `jsonnetfmt` and
|
||||||
|
" give immediate feedback to the user at every save time.
|
||||||
|
" Our inspiration, vim-go, opens a new list below the current edit
|
||||||
|
" window and shows the errors (the output of the fmt command).
|
||||||
|
" We are not sure whether this is desired in the vim-jsonnet community
|
||||||
|
" or not. Nevertheless, this else block is a suitable place to benefit
|
||||||
|
" from the `jsonnetfmt` errors.
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Restore our cursor/windows positions.
|
||||||
|
call winrestview(l:curw)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
endif
|
||||||
36
autoload/requirements.vim
Normal file
36
autoload/requirements.vim
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'requirements') == -1
|
||||||
|
|
||||||
|
" the Requirements File Format syntax support for Vim
|
||||||
|
" Version: 1.5.3
|
||||||
|
" Author: raimon <raimon49@hotmail.com>
|
||||||
|
" License: MIT LICENSE
|
||||||
|
" The MIT License (MIT)
|
||||||
|
"
|
||||||
|
" Copyright (c) 2015 raimon
|
||||||
|
"
|
||||||
|
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
" of this software and associated documentation files (the "Software"), to deal
|
||||||
|
" in the Software without restriction, including without limitation the rights
|
||||||
|
" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
" copies of the Software, and to permit persons to whom the Software is
|
||||||
|
" furnished to do so, subject to the following conditions:
|
||||||
|
"
|
||||||
|
" The above copyright notice and this permission notice shall be included in all
|
||||||
|
" copies or substantial portions of the Software.
|
||||||
|
"
|
||||||
|
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
" SOFTWARE.
|
||||||
|
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
||||||
|
" vim: et sw=4 ts=4 sts=4:
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -55,6 +55,8 @@ function! terraform#commands(ArgLead, CmdLine, CursorPos) abort
|
|||||||
\ 'graph',
|
\ 'graph',
|
||||||
\ 'import',
|
\ 'import',
|
||||||
\ 'init',
|
\ 'init',
|
||||||
|
\ 'login',
|
||||||
|
\ 'logout',
|
||||||
\ 'output',
|
\ 'output',
|
||||||
\ 'plan',
|
\ 'plan',
|
||||||
\ 'providers',
|
\ 'providers',
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ execute join(['function! vital#_crystal#ColorEcho#import() abort', printf("retur
|
|||||||
delfunction s:_SID
|
delfunction s:_SID
|
||||||
" ___vital___
|
" ___vital___
|
||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! s:_is_available() abort
|
function! s:_is_available() abort
|
||||||
if has('gui_running')
|
if has('gui_running')
|
||||||
@@ -185,7 +183,4 @@ function! s:echo(str) abort
|
|||||||
call echorizer.echo()
|
call echorizer.echo()
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -11,9 +11,6 @@ delfunction s:_SID
|
|||||||
" ___vital___
|
" ___vital___
|
||||||
" Utilities for list.
|
" Utilities for list.
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! s:pop(list) abort
|
function! s:pop(list) abort
|
||||||
return remove(a:list, -1)
|
return remove(a:list, -1)
|
||||||
endfunction
|
endfunction
|
||||||
@@ -460,9 +457,6 @@ function! s:combinations(list, r) abort
|
|||||||
return result
|
return result
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -11,9 +11,6 @@ delfunction s:_SID
|
|||||||
" ___vital___
|
" ___vital___
|
||||||
" Utilities for string.
|
" Utilities for string.
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! s:_vital_loaded(V) abort
|
function! s:_vital_loaded(V) abort
|
||||||
let s:V = a:V
|
let s:V = a:V
|
||||||
let s:L = s:V.import('Data.List')
|
let s:L = s:V.import('Data.List')
|
||||||
@@ -624,8 +621,6 @@ function! s:split_posix_text(text, ...) abort
|
|||||||
return split(text, newline, 1)
|
return split(text, newline, 1)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ delfunction s:_SID
|
|||||||
" FIXME: This module name should be Vital.System ?
|
" FIXME: This module name should be Vital.System ?
|
||||||
" But the name has been already taken.
|
" But the name has been already taken.
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
|
|
||||||
" FIXME: Unfortunately, can't use s:_vital_loaded() for this purpose.
|
" FIXME: Unfortunately, can't use s:_vital_loaded() for this purpose.
|
||||||
" Because these variables are used when this script file is loaded.
|
" Because these variables are used when this script file is loaded.
|
||||||
@@ -169,9 +166,6 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ endfunction
|
|||||||
execute join(['function! vital#_crystal#Web#JSON#import() abort', printf("return map({'decode': '', '_vital_depends': '', '_vital_created': '', 'encode': '', '_vital_loaded': ''}, \"vital#_crystal#function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
|
execute join(['function! vital#_crystal#Web#JSON#import() abort', printf("return map({'decode': '', '_vital_depends': '', '_vital_created': '', 'encode': '', '_vital_loaded': ''}, \"vital#_crystal#function('<SNR>%s_' . v:key)\")", s:_SID()), 'endfunction'], "\n")
|
||||||
delfunction s:_SID
|
delfunction s:_SID
|
||||||
" ___vital___
|
" ___vital___
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! s:_true() abort
|
function! s:_true() abort
|
||||||
return 1
|
return 1
|
||||||
@@ -174,9 +172,6 @@ function! s:_encode_dict(val, settings) abort
|
|||||||
endfunction
|
endfunction
|
||||||
" @vimlint(EVL102, 0, l:ns)
|
" @vimlint(EVL102, 0, l:ns)
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ let attributes_value = {
|
|||||||
\ 'label': ['Text', ''],
|
\ 'label': ['Text', ''],
|
||||||
\ 'lang': ['Lang Tag', ''],
|
\ 'lang': ['Lang Tag', ''],
|
||||||
\ 'list': ['ID', ''],
|
\ 'list': ['ID', ''],
|
||||||
|
\ 'loading': ['eager/lazy', ''],
|
||||||
\ 'loop': ['Bool', ''],
|
\ 'loop': ['Bool', ''],
|
||||||
\ 'low': ['Number', ''],
|
\ 'low': ['Number', ''],
|
||||||
\ 'manifest': ['URL', ''],
|
\ 'manifest': ['URL', ''],
|
||||||
@@ -588,11 +589,11 @@ let g:xmldata_html5 = {
|
|||||||
\ ],
|
\ ],
|
||||||
\ 'iframe': [
|
\ 'iframe': [
|
||||||
\ [],
|
\ [],
|
||||||
\ extend(copy(global_attributes), {'src': [], 'srcdoc': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', ''], 'referrerpolicy': referrerpolicy, 'allowfullscreen': [], 'allowpaymentrequest': [], 'allowpresentation': [], 'allowusermedia': []})
|
\ extend(copy(global_attributes), {'src': [], 'srcdoc': [], 'name': [], 'width': [], 'height': [], 'sandbox': ['allow-same-origin', 'allow-forms', 'allow-scripts'], 'seamless': ['seamless', ''], 'referrerpolicy': referrerpolicy, 'allowfullscreen': [], 'allowpaymentrequest': [], 'allowpresentation': [], 'allowusermedia': [], 'loading': ['eager', 'lazy']})
|
||||||
\ ],
|
\ ],
|
||||||
\ 'img': [
|
\ 'img': [
|
||||||
\ [],
|
\ [],
|
||||||
\ extend(copy(global_attributes), {'src': [], 'alt': [], 'height': [], 'width': [], 'decoding': ['async', 'sync', 'auto'], 'usemap': [], 'ismap': ['ismap', ''], 'referrerpolicy': referrerpolicy, 'crossorigin': ['anonymous', 'use-credentials']})
|
\ extend(copy(global_attributes), {'src': [], 'alt': [], 'height': [], 'width': [], 'decoding': ['async', 'sync', 'auto'], 'usemap': [], 'ismap': ['ismap', ''], 'referrerpolicy': referrerpolicy, 'crossorigin': ['anonymous', 'use-credentials'], 'loading': ['eager', 'lazy']})
|
||||||
\ ],
|
\ ],
|
||||||
\ 'input': [
|
\ 'input': [
|
||||||
\ [],
|
\ [],
|
||||||
|
|||||||
38
build
38
build
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -E
|
set -eo pipefail
|
||||||
|
|
||||||
DIRS="syntax indent compiler autoload ftplugin ctags after/syntax after/indent after/ftplugin"
|
DIRS="syntax indent compiler autoload ftplugin ctags after/syntax after/indent after/ftplugin"
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
@@ -28,7 +28,7 @@ download() {
|
|||||||
repo="$(awk -F\# '{print $1}' <<<"$path")"
|
repo="$(awk -F\# '{print $1}' <<<"$path")"
|
||||||
branch="$(awk -F\# '{print $2}' <<<"$path")"
|
branch="$(awk -F\# '{print $2}' <<<"$path")"
|
||||||
rm -rf "$dir"
|
rm -rf "$dir"
|
||||||
(mkdir -p "$dir" && curl --silent -L "https://codeload.github.com/$repo/tar.gz/${branch:-master}" | tar -zx -C "$dir" --strip 1 && printf '.') &
|
(mkdir -p "$dir" && curl --silent -fL "https://codeload.github.com/$repo/tar.gz/${branch:-master}" | tar -zx -C "$dir" --strip 1 && printf '.' || echo "Failed to download: $repo") &
|
||||||
done
|
done
|
||||||
|
|
||||||
wait
|
wait
|
||||||
@@ -102,14 +102,16 @@ copy_file() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "${file_path}"
|
mkdir -p "${file_path}"
|
||||||
touch "$file_in_dst"
|
|
||||||
|
|
||||||
# Use comma instead of / to handle cases like c/c++
|
(
|
||||||
if [[ "${package_name}" == "jsx" ]]; then
|
if [[ "${package_name}" == "jsx" ]]; then
|
||||||
sed -e "s,%%PACK%%,${package_name}," -e "/%%CONTENT%%/{r ${file_in_tmp}" -e "d;}" plugin_guard_jsx.vim.template >> "$file_in_dst"
|
printf "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"
|
||||||
else
|
else
|
||||||
sed -e "s,%%PACK%%,${package_name}," -e "/%%CONTENT%%/{r ${file_in_tmp}" -e "d;}" plugin_guard.vim.template >> "$file_in_dst"
|
printf "if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '$package_name') == -1\n\n"
|
||||||
fi
|
fi
|
||||||
|
cat "$file_in_tmp"
|
||||||
|
printf "\nendif\n"
|
||||||
|
) >> "$file_in_dst"
|
||||||
}
|
}
|
||||||
|
|
||||||
update_readme() {
|
update_readme() {
|
||||||
@@ -169,11 +171,12 @@ PACKS="
|
|||||||
emberscript:yalesov/vim-ember-script
|
emberscript:yalesov/vim-ember-script
|
||||||
emblem:yalesov/vim-emblem
|
emblem:yalesov/vim-emblem
|
||||||
erlang:vim-erlang/vim-erlang-runtime
|
erlang:vim-erlang/vim-erlang-runtime
|
||||||
|
fennel:bakpakin/fennel.vim
|
||||||
ferm:vim-scripts/ferm.vim
|
ferm:vim-scripts/ferm.vim
|
||||||
fish:georgewitteman/vim-fish
|
fish:georgewitteman/vim-fish
|
||||||
flatbuffers:dcharbon/vim-flatbuffers
|
flatbuffers:dcharbon/vim-flatbuffers
|
||||||
fsharp:ionide/Ionide-vim:_BASIC
|
fsharp:ionide/Ionide-vim:_BASIC
|
||||||
gdscript:calviken/vim-gdscript3
|
gdscript:calviken/vim-gdscript3:_SYNTAX
|
||||||
git:tpope/vim-git
|
git:tpope/vim-git
|
||||||
glsl:tikhomirov/vim-glsl:_NOAFTER
|
glsl:tikhomirov/vim-glsl:_NOAFTER
|
||||||
gmpl:maelvalais/gmpl.vim
|
gmpl:maelvalais/gmpl.vim
|
||||||
@@ -182,7 +185,7 @@ PACKS="
|
|||||||
graphql:jparise/vim-graphql:_ALL
|
graphql:jparise/vim-graphql:_ALL
|
||||||
gradle:tfnico/vim-gradle
|
gradle:tfnico/vim-gradle
|
||||||
haml:sheerun/vim-haml
|
haml:sheerun/vim-haml
|
||||||
handlebars:mustache/vim-mustache-handlebars
|
handlebars:sheerun/vim-mustache-handlebars
|
||||||
haproxy:CH-DanReif/haproxy.vim
|
haproxy:CH-DanReif/haproxy.vim
|
||||||
haskell:neovimhaskell/haskell-vim
|
haskell:neovimhaskell/haskell-vim
|
||||||
haxe:yaymukund/vim-haxe
|
haxe:yaymukund/vim-haxe
|
||||||
@@ -191,13 +194,16 @@ PACKS="
|
|||||||
hive:zebradil/hive.vim
|
hive:zebradil/hive.vim
|
||||||
html5:othree/html5.vim
|
html5:othree/html5.vim
|
||||||
i3:mboughaba/i3config.vim
|
i3:mboughaba/i3config.vim
|
||||||
|
icalenadr:chutzpah/icalendar.vim
|
||||||
idris:idris-hackers/idris-vim
|
idris:idris-hackers/idris-vim
|
||||||
ion:vmchale/ion-vim
|
ion:vmchale/ion-vim
|
||||||
javascript:pangloss/vim-javascript:_JAVASCRIPT
|
javascript:pangloss/vim-javascript:_JAVASCRIPT
|
||||||
jenkins:martinda/Jenkinsfile-vim-syntax
|
jenkins:martinda/Jenkinsfile-vim-syntax
|
||||||
jinja:lepture/vim-jinja
|
jinja:lepture/vim-jinja
|
||||||
|
jq:vito-c/jq.vim
|
||||||
json5:GutenYe/json5.vim
|
json5:GutenYe/json5.vim
|
||||||
json:elzr/vim-json
|
json:elzr/vim-json
|
||||||
|
jsonnet:google/vim-jsonnet
|
||||||
jst:briancollins/vim-jst
|
jst:briancollins/vim-jst
|
||||||
jsx:MaxMEllon/vim-jsx-pretty:_ALL
|
jsx:MaxMEllon/vim-jsx-pretty:_ALL
|
||||||
julia:JuliaEditorSupport/julia-vim
|
julia:JuliaEditorSupport/julia-vim
|
||||||
@@ -244,6 +250,7 @@ PACKS="
|
|||||||
raml:IN3D/vim-raml
|
raml:IN3D/vim-raml
|
||||||
razor:adamclerk/vim-razor
|
razor:adamclerk/vim-razor
|
||||||
reason:reasonml-editor/vim-reason-plus
|
reason:reasonml-editor/vim-reason-plus
|
||||||
|
requirements:raimon49/requirements.txt.vim
|
||||||
rspec:keith/rspec.vim
|
rspec:keith/rspec.vim
|
||||||
rst:marshallward/vim-restructuredtext
|
rst:marshallward/vim-restructuredtext
|
||||||
ruby:vim-ruby/vim-ruby
|
ruby:vim-ruby/vim-ruby
|
||||||
@@ -251,12 +258,14 @@ PACKS="
|
|||||||
sbt:derekwyatt/vim-sbt
|
sbt:derekwyatt/vim-sbt
|
||||||
scala:derekwyatt/vim-scala
|
scala:derekwyatt/vim-scala
|
||||||
scss:cakebaker/scss-syntax.vim
|
scss:cakebaker/scss-syntax.vim
|
||||||
|
sh:arzg/vim-sh
|
||||||
slim:slim-template/vim-slim
|
slim:slim-template/vim-slim
|
||||||
slime:slime-lang/vim-slime-syntax
|
slime:slime-lang/vim-slime-syntax
|
||||||
smt2:bohlender/vim-smt2
|
smt2:bohlender/vim-smt2
|
||||||
solidity:tomlion/vim-solidity
|
solidity:tomlion/vim-solidity
|
||||||
|
sql:shmup/vim-sql-syntax
|
||||||
stylus:wavded/vim-stylus
|
stylus:wavded/vim-stylus
|
||||||
svelte:evanleck/vim-svelte
|
svelte:evanleck/vim-svelte#main
|
||||||
svg-indent:jasonshell/vim-svg-indent
|
svg-indent:jasonshell/vim-svg-indent
|
||||||
svg:vim-scripts/svg.vim
|
svg:vim-scripts/svg.vim
|
||||||
swift:keith/swift.vim
|
swift:keith/swift.vim
|
||||||
@@ -271,6 +280,7 @@ PACKS="
|
|||||||
tptp:c-cube/vim-tptp
|
tptp:c-cube/vim-tptp
|
||||||
twig:lumiliet/vim-twig
|
twig:lumiliet/vim-twig
|
||||||
typescript:HerringtonDarkholme/yats.vim
|
typescript:HerringtonDarkholme/yats.vim
|
||||||
|
unison:unisonweb/unison#trunk:_ALL:/editor-support/vim/
|
||||||
v:ollykel/v-vim
|
v:ollykel/v-vim
|
||||||
vala:arrufat/vala.vim
|
vala:arrufat/vala.vim
|
||||||
vbnet:vim-scripts/vbnet.vim
|
vbnet:vim-scripts/vbnet.vim
|
||||||
@@ -288,12 +298,14 @@ PACKS="
|
|||||||
zinit:zinit-zsh/zplugin-vim-syntax
|
zinit:zinit-zsh/zplugin-vim-syntax
|
||||||
"
|
"
|
||||||
|
|
||||||
|
python3 build.py
|
||||||
|
|
||||||
rm -rf tmp
|
rm -rf tmp
|
||||||
rm -rf "${DIRS_RM[@]}"
|
|
||||||
mkdir tmp
|
mkdir tmp
|
||||||
|
|
||||||
printf "Downloading packs..."
|
printf "Downloading packs..."
|
||||||
download "$(sed '/^#/d' <<<"$PACKS")"
|
download "$(sed '/^#/d' <<<"$PACKS")"
|
||||||
|
rm -rf "${DIRS_RM[@]}"
|
||||||
extract "$(sed '/^#/d' <<<"$PACKS")"
|
extract "$(sed '/^#/d' <<<"$PACKS")"
|
||||||
update_readme
|
update_readme
|
||||||
|
|
||||||
|
|||||||
269
build.py
Executable file
269
build.py
Executable file
@@ -0,0 +1,269 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
import urllib.request as request
|
||||||
|
|
||||||
|
url = 'https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml'
|
||||||
|
data = yaml.safe_load(request.urlopen(url))
|
||||||
|
|
||||||
|
lines = []
|
||||||
|
|
||||||
|
def language(name,
|
||||||
|
filetype=None,
|
||||||
|
polyglot=None,
|
||||||
|
extensions=None,
|
||||||
|
filenames=None,
|
||||||
|
syntax=None,
|
||||||
|
outer_filetype=None,
|
||||||
|
custom_set=None,
|
||||||
|
compound=False,
|
||||||
|
extra_extensions=[],
|
||||||
|
extra_filenames=[],
|
||||||
|
ignored_extensions=[]
|
||||||
|
):
|
||||||
|
language = data.get(name, {})
|
||||||
|
filetype_name = filetype or name.lower().replace(" ", "")
|
||||||
|
polyglot_name = polyglot or filetype_name
|
||||||
|
lines.append(f"if index(g:polyglot_disabled, '{polyglot_name}') == -1")
|
||||||
|
if syntax != None:
|
||||||
|
syntax = " syntax=" + syntax
|
||||||
|
else:
|
||||||
|
syntax = ""
|
||||||
|
if extensions == None:
|
||||||
|
extensions = language.get("extensions", [])
|
||||||
|
if filenames == None:
|
||||||
|
filenames = language.get("filenames", [])
|
||||||
|
if custom_set == None:
|
||||||
|
custom_set = f"set ft={filetype_name}{syntax}"
|
||||||
|
for ext in sorted(list(set(extensions + extra_extensions) - set(ignored_extensions))):
|
||||||
|
if outer_filetype != None:
|
||||||
|
lines.append(f" au BufNewFile *.*{ext} execute \"do BufNewFile filetypedetect \" . expand(\"<afile>:r\") | {outer_filetype}")
|
||||||
|
lines.append(f" au BufReadPre *.*{ext} execute \"do BufRead filetypedetect \" . expand(\"<afile>:r\") | {outer_filetype}")
|
||||||
|
lines.append(f" au BufNewFile,BufRead *{ext} {custom_set}")
|
||||||
|
for fn in sorted(filenames + extra_filenames):
|
||||||
|
if fn[0] == ".":
|
||||||
|
fn = "{.,}" + fn[1:]
|
||||||
|
lines.append(f" au BufNewFile,BufRead {fn} {custom_set}")
|
||||||
|
lines.append("endif")
|
||||||
|
lines.append("")
|
||||||
|
|
||||||
|
|
||||||
|
lines.append("""" don't spam the user when Vim is started in Vi compatibility mode
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
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
|
||||||
|
""")
|
||||||
|
|
||||||
|
language("ASL", polyglot="acpiasl", extensions=[".asl", ".dsl"])
|
||||||
|
language("API Blueprint")
|
||||||
|
language("AppleScript")
|
||||||
|
language("Processing", filetype="arduino", extra_extensions=[".ino"])
|
||||||
|
language("AsciiDoc")
|
||||||
|
language("Blade")
|
||||||
|
language("Caddyfile", extensions=["Caddyfile"])
|
||||||
|
language("Carp", extensions=[".carp"])
|
||||||
|
language("CoffeeScript", polyglot="coffee-script", filetype="coffee", extra_extensions=[".coffeekup", '.ck'])
|
||||||
|
language("Literate CoffeeScript", polyglot="coffee-script", filetype="litcoffee", extra_extensions=[".coffee.md"])
|
||||||
|
language("Clojure")
|
||||||
|
language("CQL", extensions=[".cql"])
|
||||||
|
language("Cryptol", extensions=[".cry", ".cyl", ".lcry", ".lcyl"])
|
||||||
|
language("Crystal", extra_filenames=["Projectfile"])
|
||||||
|
language("HTML+ECR", polyglot="crystal", filetype="ecrystal")
|
||||||
|
language("CSV", extra_extensions=[".tsv", ".dat", ".tab"])
|
||||||
|
language("Gherkin", filetype="cucumber", extra_extensions=[".story"])
|
||||||
|
language("Cue", filetype="cuesheet", extensions=[".cue"], polyglot="cue")
|
||||||
|
language("Dart")
|
||||||
|
language("Dhall")
|
||||||
|
language("D", polyglot="dlang")
|
||||||
|
language("D", polyglot="dlang", filetype="dcov", extensions=[".lst"])
|
||||||
|
language("D", polyglot="dlang", filetype="dd", extensions=[".dd"])
|
||||||
|
language("D", polyglot="dlang", filetype="ddoc", extensions=[".ddoc"])
|
||||||
|
language("D", polyglot="dlang", filetype="dsdl", extensions=[".sdl"])
|
||||||
|
language("Dockerfile", extra_extensions=[".dock", ".Dockerfile"], extra_filenames=["dockerfile", "Dockerfile*"], filetype="Dockerfile", polyglot="dockerfile")
|
||||||
|
language("Dockerfile", extensions=[], filenames=["docker-compose*.yaml", "docker-compose*.yml"], filetype="yaml.docker-compose", polyglot="dockerfile")
|
||||||
|
language("Elixir")
|
||||||
|
language("HTML+EEX", polyglot="elixir", filetype="elixir", extra_extensions=[".leex"])
|
||||||
|
language("Elm")
|
||||||
|
language("EmberScript", filetype="ember-script", polyglot="emberscript")
|
||||||
|
language("Emblem", extensions=[".emblem"], filetype="emblem")
|
||||||
|
language("Erlang", extra_extensions=[".app", ".yaws"])
|
||||||
|
language("Ferm", extensions=[".ferm"], filenames=["ferm.conf"], filetype="ferm")
|
||||||
|
language("fish")
|
||||||
|
language("YAML", extra_filenames=["fish_history", "fish_read_history"])
|
||||||
|
language("Flatbuffers", extensions=[".fbs"], filetype="fbs", polyglot="flatbuffers")
|
||||||
|
language("GDScript", filetype="gdscript3", polyglot="gdscript")
|
||||||
|
language("GLSL", extra_extensions=[".comp"])
|
||||||
|
language("F#", polyglot="fsharp", filetype="fsharp")
|
||||||
|
language("Git Config", polyglot="git", filetype="gitconfig", extra_filenames=["*.git/config", "*/.config/git/config", "*.git/modules/**/config", "gitconfig"])
|
||||||
|
language("Git Rebase", polyglot="git", filetype="gitrebase", filenames=["git-rebase-todo"])
|
||||||
|
language("Git Send Email", polyglot="git", filetype="gitsendemail", filenames=[".gitsendemail.*"])
|
||||||
|
language("Git Commit", polyglot="git", filetype="gitcommit", filenames=["COMMIT_EDIT_MSG", "TAG_EDIT_MSG", "MERGE_MSG", "MSG"])
|
||||||
|
language("Gnu MathProg", polyglot="gmpl", filetype="gmpl", extensions=[".mod"])
|
||||||
|
language("Go")
|
||||||
|
language("Go Mod", filetype="gomod", filenames=["go.mod"], polyglot="go")
|
||||||
|
language("Go Template", filetype="gohtmltmpl", extensions=[".tmpl"], polyglot="go")
|
||||||
|
language("Assembly", filetype="asm", polyglot="assembly")
|
||||||
|
language("GraphQL")
|
||||||
|
language("Gradle", filetype="groovy", polyglot="gradle")
|
||||||
|
language("Haml", extra_extensions=[".hamlc", ".hamlbars"])
|
||||||
|
language("Handlebars", filetype="mustache", polyglot="handlebars", extra_extensions=[".hulk", ".hjs", ".mustache", ".njk"])
|
||||||
|
language("HTML+Django", polyglot="jinja", filetype="jinja.html", ignored_extensions=[".mustache", ".njk"], extra_extensions=[".j2"])
|
||||||
|
language("HAProxy")
|
||||||
|
language("Haskell", extra_extensions=[".bpk", ".hsig"])
|
||||||
|
language("Haxe")
|
||||||
|
language("HCL", extra_extensions=[".nomad"], extra_filenames=["Appfile"])
|
||||||
|
language("Helm", extra_filenames=["*/templates/*.yaml", "*/templates/*.tpl"])
|
||||||
|
language("HiveQL", polyglot="hive", filetype="hive")
|
||||||
|
language("I3", extensions=[".i3.config"], filenames=["i3.config"], filetype="i3config", polyglot="i3")
|
||||||
|
language("HiveQL", polyglot="hive", filetype="hive")
|
||||||
|
language("iCalendar", polyglot="icalendar", filetype="icalendar", extensions=[".ics"])
|
||||||
|
language("Idris", extra_filenames=["idris-response"])
|
||||||
|
language("Ion", extensions=[".ion"], filenames=["~/.config/ion/initrc"])
|
||||||
|
language("JavaScript")
|
||||||
|
language("Flow", polyglot="javascript", filetype="flow", extensions=[".flow"])
|
||||||
|
language("Jenkinsfile", polyglot="jenkins", extensions=[".jenkinsfile", ".Jenkinsfile"], filenames=["Jenkinsfile*"], filetype="Jenkinsfile")
|
||||||
|
language("JSON5")
|
||||||
|
language("JSON", extra_extensions=[".jsonp", ".template"])
|
||||||
|
language("EJS", filetype="jst", extra_extensions=[".jst", ".djs", ".hamljs", ".ect"])
|
||||||
|
language("JSX", filetype="javascriptreact", polyglot="jsx")
|
||||||
|
language("Julia")
|
||||||
|
language("Kotlin")
|
||||||
|
language("Ledger", extensions=[".ldg", ".ledger", ".journal"])
|
||||||
|
language("Less")
|
||||||
|
language("LilyPond")
|
||||||
|
language("LiveScript")
|
||||||
|
language("LLVM")
|
||||||
|
language("Tablegen", polyglot="llvm", extensions=[".td"], filetype="tablegen")
|
||||||
|
language("Mako", outer_filetype="let b:mako_outer_lang = &filetype")
|
||||||
|
language("Log", extensions=[".log"], filenames=["*_log"])
|
||||||
|
language("Markdown", ignored_extensions=[".mdx"])
|
||||||
|
language("Mdx", extensions=[".mdx"], polyglot="mdx", filetype="markdown.mdx")
|
||||||
|
language("Mathematica", filetype="mma")
|
||||||
|
language("Meson")
|
||||||
|
language("Dosini", extensions=[".wrap"], filetype="dosini", polyglot="meson")
|
||||||
|
language("MoonScript", filetype="moon", polyglot="moon")
|
||||||
|
language("Nginx", extra_extensions=[".nginx"], extra_filenames=["*/etc/nginx/*", "*/usr/local/nginx/conf/*", "*/nginx/*.conf", "nginx*.conf", "*nginx.conf"])
|
||||||
|
language("Nim")
|
||||||
|
language("Nix")
|
||||||
|
language("OCaml", extra_extensions=[".mlt", ".mlp", ".mlip", ".mli.cppo", ".ml.cppo"])
|
||||||
|
language("OMake", extensions=[".om"], filenames=["OMakefile", "OMakeroot", "Omakeroot.in"], polyglot="ocaml", filetype="omake")
|
||||||
|
language("OPam", extensions=[".opam", ".opam.template"], filenames=["opam"], filetype="opam", polyglot="ocaml")
|
||||||
|
language("Oasis", filenames=["_oasis"], polyglot="ocaml", filetype="oasis")
|
||||||
|
language("OpenCL")
|
||||||
|
language("Perl")
|
||||||
|
language("PLpgSQL", filetype="sql", ignored_extensions=[".sql"], custom_set="let b:sql_type_override='pgsql' | set ft=sql", polyglot="pgsql")
|
||||||
|
language("PlantUML", extra_extensions=[".uml", ".pu"])
|
||||||
|
language("Pony")
|
||||||
|
language("PowerShell", extra_extensions=[".pssc"])
|
||||||
|
language("Ps1XML", extensions=[".ps1xml"], polyglot="powershell", filetype="ps1xml")
|
||||||
|
language("Protocol Buffer", polyglot="protobuf", filetype="proto")
|
||||||
|
language("Pug")
|
||||||
|
language("Puppet")
|
||||||
|
language("Embedded Puppet", polyglot="puppet", filetype="embeddedpuppet", extensions=[".epp"])
|
||||||
|
language("PureScript")
|
||||||
|
language("QMake")
|
||||||
|
language("QML")
|
||||||
|
language("Racket")
|
||||||
|
language("Raku", extra_extensions=[".rakudoc", ".rakutest", ".raku", ".rakumod", ".pod6", ".t6"])
|
||||||
|
language("RAML")
|
||||||
|
language("HTML+Razor", filetype="razor", polyglot="razor")
|
||||||
|
language("Reason")
|
||||||
|
language("Merlin", filetype="merlin", polyglot="razor", filenames=[".merlin"])
|
||||||
|
language("Ruby", extra_extensions=[".rxml", ".rjs", ".rant", ".axlsx", ".cap", ".opal"], extra_filenames=["Rantfile", ".autotest", "Cheffile", "KitchenSink", "Routefile"])
|
||||||
|
language("HTML+ERB", polyglot="ruby", filetype="eruby", extra_extensions=[".rhtml"])
|
||||||
|
# Needs to be after ruby
|
||||||
|
language("RSpec", filenames=["*_spec.rb"], polyglot="rspec", filetype="ruby", syntax="rspec")
|
||||||
|
language("Rust")
|
||||||
|
language("Scala", ignored_extensions=[".sbt"])
|
||||||
|
language("Scala SBT", filetype="sbt.scala", extensions=[".sbt"], polyglot="scala")
|
||||||
|
language("SCSS")
|
||||||
|
language("Slim")
|
||||||
|
language("Slime", extensions=[".slime"])
|
||||||
|
language("SMT", filetype="smt2")
|
||||||
|
language("Solidity", extra_extensions=[".sol"])
|
||||||
|
language("Stylus", extra_extensions=[".stylus"])
|
||||||
|
language("Svelte")
|
||||||
|
language("Swift")
|
||||||
|
language("Sxhkd", extensions=[".sxhkdrc"], filetype="sxhkdrc", polyglot="sxhkd")
|
||||||
|
language("Systemd", extensions=[".automount", ".mount", ".path", ".service", ".socket", ".swap", ".target", ".timer"])
|
||||||
|
language("HCL", filetype="terraform", polyglot="terraform")
|
||||||
|
language("Textile")
|
||||||
|
language("Thrift")
|
||||||
|
language("Tmux", filenames=[".tmux.conf"])
|
||||||
|
language("TOML", extra_filenames=["Pipfile", "*/.cargo/config", "*/.cargo/credentials"])
|
||||||
|
language("TPTP", extensions=[".p", ".tptp", ".ax"])
|
||||||
|
language("Twig", ignored_extensions=[".xml.twig"], filetype="html.twig", polyglot="twig")
|
||||||
|
language("Twig XML", extensions=[".xml.twig"], filetype="xml.twig", polyglot="twig")
|
||||||
|
language("TypeScript")
|
||||||
|
language("TSX", filetype="typescriptreact", polyglot="typescript")
|
||||||
|
language("XML", extra_extensions=[".cdxml"], ignored_extensions=[".ts", ".tsx"])
|
||||||
|
language("V")
|
||||||
|
language("Vala", extra_extensions=[".valadoc"])
|
||||||
|
language("Visual Basic .NET", filetype="vbnet", polyglot="vbnet")
|
||||||
|
language("VCL")
|
||||||
|
language("Vifm", extensions=[".vifm"], filenames=["vifmrc", "*vifm/colors/*"])
|
||||||
|
language("Vifm Rename", filetype="vifm-rename", filenames=["vifm.rename*"], polyglot="vifm")
|
||||||
|
language("Velocity", extensions=[".vm"], filetype="velocity")
|
||||||
|
language("Vue", extra_extensions=[".wpy"])
|
||||||
|
language("XDC", extensions=[".xdc"])
|
||||||
|
language("Zig", extra_extensions=[".zir"])
|
||||||
|
language("Zir", extensions=[".zir"], polyglot="zig", filetype="zir")
|
||||||
|
language("Jsonnet")
|
||||||
|
language("Fennel", extensions=[".fnl"])
|
||||||
|
language("mcfunction")
|
||||||
|
language("JSONiq", extra_filenames=[".jqrc"], filetype="jq", polyglot="jq")
|
||||||
|
language("Requirements", extensions=[".pip"], filenames=["*requirements.{txt,in}", "*require.{txt,in}", "constraints.{txt,in}"])
|
||||||
|
|
||||||
|
lines.append('" restore Vi compatibility settings')
|
||||||
|
lines.append('let &cpo = s:cpo_save')
|
||||||
|
lines.append('unlet s:cpo_save')
|
||||||
|
|
||||||
|
f = open("ftdetect/polyglot.vim", "w")
|
||||||
|
f.write("\n".join(lines))
|
||||||
|
f.close()
|
||||||
|
|
||||||
@@ -17,6 +17,10 @@ if exists(':CompilerSet') != 2
|
|||||||
command -nargs=* CompilerSet setlocal <args>
|
command -nargs=* CompilerSet setlocal <args>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:ledger_main')
|
||||||
|
let g:ledger_main = '%'
|
||||||
|
endif
|
||||||
|
|
||||||
if !g:ledger_is_hledger
|
if !g:ledger_is_hledger
|
||||||
" Capture Ledger errors (%-C ignores all lines between "While parsing..." and "Error:..."):
|
" Capture Ledger errors (%-C ignores all lines between "While parsing..." and "Error:..."):
|
||||||
CompilerSet errorformat=%EWhile\ parsing\ file\ \"%f\"\\,\ line\ %l:,%ZError:\ %m,%-C%.%#
|
CompilerSet errorformat=%EWhile\ parsing\ file\ \"%f\"\\,\ line\ %l:,%ZError:\ %m,%-C%.%#
|
||||||
@@ -24,9 +28,9 @@ if !g:ledger_is_hledger
|
|||||||
CompilerSet errorformat+=%tarning:\ \"%f\"\\,\ line\ %l:\ %m
|
CompilerSet errorformat+=%tarning:\ \"%f\"\\,\ line\ %l:\ %m
|
||||||
" Skip all other lines:
|
" Skip all other lines:
|
||||||
CompilerSet errorformat+=%-G%.%#
|
CompilerSet errorformat+=%-G%.%#
|
||||||
exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ %\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ source\ %'
|
exe 'CompilerSet makeprg='.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . shellescape(expand(g:ledger_main)) . '\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ source\ ' . shellescape(expand(g:ledger_main))
|
||||||
else
|
else
|
||||||
exe 'CompilerSet makeprg=('.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ %\ print\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ >\ /dev/null)'
|
exe 'CompilerSet makeprg=('.substitute(g:ledger_bin, ' ', '\\ ', 'g').'\ -f\ ' . shellescape(expand(g:ledger_main)) . '\ print\ '.substitute(g:ledger_extra_options, ' ', '\\ ', 'g').'\ >\ /dev/null)'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
25
doc/vim-polyglot.txt
Normal file
25
doc/vim-polyglot.txt
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
*vim-polyglot* Vim Polyglot
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
*vim-polyglot-introduction*
|
||||||
|
Introduction ~
|
||||||
|
|
||||||
|
Vim Polyglot is a solid language pack for vim. No configuration needed.
|
||||||
|
|
||||||
|
Please make sure you have `syntax on` in your `.vimrc`
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
DISABLING LANGUAGE PACKS *vim-polyglot-disabled*
|
||||||
|
|
||||||
|
|
||||||
|
Individual language packs can be disabled by setting `g:polyglot_disabled`:
|
||||||
|
|
||||||
|
>
|
||||||
|
" ~/.vimrc, declare this variable before polyglot is loaded let
|
||||||
|
g:polyglot_disabled = ['css']
|
||||||
|
<
|
||||||
|
|
||||||
|
Note that disabling languages won't make in general your vim startup any faster
|
||||||
|
/ slower (only for specific file type). Vim-polyglot is selection of language
|
||||||
|
plugins that are loaded only on demand.
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -5,34 +5,6 @@ if exists('b:did_ftplugin')
|
|||||||
endif
|
endif
|
||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
" This file is loaded on 'ecrystal' filetype
|
|
||||||
if &filetype !=# 'crystal'
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
if exists('loaded_matchit') && !exists('b:match_words')
|
|
||||||
let b:match_ignorecase = 0
|
|
||||||
|
|
||||||
let b:match_words =
|
|
||||||
\ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|struct\|lib\|macro\|ifdef\|def\|fun\|begin\|enum\)\>=\@!' .
|
|
||||||
\ ':' .
|
|
||||||
\ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
|
|
||||||
\ ':' .
|
|
||||||
\ '\<end\>' .
|
|
||||||
\ ',{:},\[:\],(:)'
|
|
||||||
|
|
||||||
let b:match_skip =
|
|
||||||
\ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" .
|
|
||||||
\ "\\<crystal\\%(String\\|StringDelimiter\\|ASCIICode\\|Escape\\|" .
|
|
||||||
\ "Interpolation\\|NoInterpolation\\|Comment\\|Documentation\\|" .
|
|
||||||
\ "ConditionalModifier\\|RepeatModifier\\|OptionalDo\\|" .
|
|
||||||
\ "Function\\|BlockArgument\\|KeywordAsMethod\\|ClassVariable\\|" .
|
|
||||||
\ "InstanceVariable\\|GlobalVariable\\|Symbol\\)\\>'"
|
|
||||||
endif
|
|
||||||
|
|
||||||
setlocal comments=:#
|
setlocal comments=:#
|
||||||
setlocal commentstring=#\ %s
|
setlocal commentstring=#\ %s
|
||||||
setlocal suffixesadd=.cr
|
setlocal suffixesadd=.cr
|
||||||
@@ -81,14 +53,33 @@ if &l:ofu ==# ''
|
|||||||
setlocal omnifunc=crystal_lang#complete
|
setlocal omnifunc=crystal_lang#complete
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists('AutoPairsLoaded')
|
" Options for vim-matchit
|
||||||
|
if exists('g:loaded_matchit') && !exists('b:match_words')
|
||||||
|
let b:match_ignorecase = 0
|
||||||
|
|
||||||
|
let b:match_words =
|
||||||
|
\ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|struct\|lib\|macro\|ifdef\|def\|begin\|enum\|annotation\)\>=\@!' .
|
||||||
|
\ ':' .
|
||||||
|
\ '\<\%(else\|elsif\|ensure\|when\|in\|rescue\|break\|next\)\>' .
|
||||||
|
\ ':' .
|
||||||
|
\ '\<end\>' .
|
||||||
|
\ ',{:},\[:\],(:)'
|
||||||
|
|
||||||
|
let b:match_skip =
|
||||||
|
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~# ''' .
|
||||||
|
\ '\<crystal\%(String\|StringDelimiter\|ASCIICode\|Escape\|' .
|
||||||
|
\ 'Interpolation\|NoInterpolation\|Comment\|Documentation\|' .
|
||||||
|
\ 'ConditionalModifier\|' .
|
||||||
|
\ 'Function\|BlockArgument\|KeywordAsMethod\|ClassVariable\|' .
|
||||||
|
\ 'InstanceVariable\|GlobalVariable\|Symbol\)\>'''
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Options for jiangmiao/auto-pairs
|
||||||
|
if exists('g:AutoPairsLoaded')
|
||||||
let b:AutoPairs = { '{%': '%}' }
|
let b:AutoPairs = { '{%': '%}' }
|
||||||
call extend(b:AutoPairs, g:AutoPairs, 'force')
|
call extend(b:AutoPairs, g:AutoPairs, 'force')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: sw=2 sts=2 et:
|
" vim: sw=2 sts=2 et:
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ set smarttab
|
|||||||
|
|
||||||
if exists('g:dhall_use_ctags')
|
if exists('g:dhall_use_ctags')
|
||||||
if g:dhall_use_ctags == 1
|
if g:dhall_use_ctags == 1
|
||||||
augroup dhall
|
autocmd BufWritePost *.dhall silent !ctags -R .
|
||||||
autocmd BufWritePost *.dhall silent !ctags -R .
|
|
||||||
augroup END
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -26,9 +24,7 @@ endfunction
|
|||||||
|
|
||||||
if exists('g:dhall_strip_whitespace')
|
if exists('g:dhall_strip_whitespace')
|
||||||
if g:dhall_strip_whitespace == 1
|
if g:dhall_strip_whitespace == 1
|
||||||
augroup dhall
|
au BufWritePre *.dhall silent! call StripTrailingWhitespace()
|
||||||
au BufWritePre *.dhall silent! call StripTrailingWhitespace()
|
|
||||||
augroup END
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -42,14 +38,10 @@ endfunction
|
|||||||
|
|
||||||
if exists('g:dhall_format')
|
if exists('g:dhall_format')
|
||||||
if g:dhall_format == 1
|
if g:dhall_format == 1
|
||||||
augroup dhall
|
au BufWritePost *.dhall call DhallFormat()
|
||||||
au BufWritePost *.dhall call DhallFormat()
|
|
||||||
augroup END
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
augroup dhall
|
au BufNewFile,BufRead *.dhall setl shiftwidth=2
|
||||||
au BufNewFile,BufRead *.dhall setl shiftwidth=2
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ endif
|
|||||||
" TODO: comments=
|
" TODO: comments=
|
||||||
setlocal commentstring=<%#%s%>
|
setlocal commentstring=<%#%s%>
|
||||||
|
|
||||||
let b:undo_ftplugin = "setl cms< "
|
let b:undo_ftplugin = "setl cms< " .
|
||||||
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
|
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
|
|||||||
30
ftplugin/fennel.vim
Normal file
30
ftplugin/fennel.vim
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fennel') == -1
|
||||||
|
|
||||||
|
" Vim filetype plugin file
|
||||||
|
" Language: FENNEL
|
||||||
|
" Maintainer: Calvin Rose
|
||||||
|
|
||||||
|
if exists("b:did_ftplugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
"setlocal iskeyword+=!,_,%,?,-,*,!,+,/,=,<,>,.,:,$,^
|
||||||
|
setlocal iskeyword=!,$,%,#,*,+,-,.,/,:,<,=,>,?,_,a-z,A-Z,48-57,128-247,124,126,38,94
|
||||||
|
|
||||||
|
" There will be false positives, but this is better than missing the whole set
|
||||||
|
" of user-defined def* definitions.
|
||||||
|
setlocal define=\\v[(/]def(ault)@!\\S*
|
||||||
|
|
||||||
|
" Remove 't' from 'formatoptions' to avoid auto-wrapping code.
|
||||||
|
setlocal formatoptions-=t
|
||||||
|
|
||||||
|
setlocal comments=n:;
|
||||||
|
setlocal commentstring=;\ %s
|
||||||
|
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'gdscript') == -1
|
|
||||||
|
|
||||||
setlocal commentstring=#\ %s
|
|
||||||
|
|
||||||
if exists("g:gdscript3_loaded")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
let g:gdscript3_loaded=1
|
|
||||||
|
|
||||||
if !has("python3") && !has("python")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
if has("python3")
|
|
||||||
let s:pyfile_cmd = "py3file"
|
|
||||||
let s:py_cmd = "py3"
|
|
||||||
else
|
|
||||||
let s:pyfile_cmd = "pyfile"
|
|
||||||
let s:py_cmd = "py"
|
|
||||||
endif
|
|
||||||
|
|
||||||
execute s:pyfile_cmd . " " . expand('<sfile>:p:h') . "/../python/init.py"
|
|
||||||
|
|
||||||
fun! GDScriptComplete(findstart, base)
|
|
||||||
if a:findstart == 1
|
|
||||||
let line = getline('.')
|
|
||||||
let start = col('.') - 1
|
|
||||||
" Treat '-' as part of the word when completing in a string.
|
|
||||||
if synIDattr(synID(line('.'), col('.')-1, 1), 'name') ==# "gdString"
|
|
||||||
let pattern = '[-a-zA-Z0-9_]'
|
|
||||||
else
|
|
||||||
let pattern = '[a-zA-Z0-9_]'
|
|
||||||
endif
|
|
||||||
while start > 0 && line[start - 1] =~ pattern
|
|
||||||
let start -= 1
|
|
||||||
endwhile
|
|
||||||
return start
|
|
||||||
else
|
|
||||||
execute s:py_cmd . " gdscript_complete()"
|
|
||||||
if exists("gdscript_completions")
|
|
||||||
return gdscript_completions
|
|
||||||
else
|
|
||||||
return []
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfun
|
|
||||||
set omnifunc=GDScriptComplete
|
|
||||||
|
|
||||||
" Configure for common completion frameworks.
|
|
||||||
|
|
||||||
" Deoplete
|
|
||||||
if &rtp =~ 'deoplete.nvim'
|
|
||||||
call deoplete#custom#option('sources', {
|
|
||||||
\ 'gdscript3': ['omni'],
|
|
||||||
\ })
|
|
||||||
call deoplete#custom#var('omni', 'input_patterns', {
|
|
||||||
\ 'gdscript3': [
|
|
||||||
\ '\.|\w+',
|
|
||||||
\ '\bextends\s+',
|
|
||||||
\ '\bexport\(',
|
|
||||||
\ '\bfunc\s+',
|
|
||||||
\ '"res://[^"]*'
|
|
||||||
\ ]
|
|
||||||
\ })
|
|
||||||
endif
|
|
||||||
|
|
||||||
" SuperTab
|
|
||||||
let g:SuperTabDefaultCompletionType = "<c-x><c-o>"
|
|
||||||
|
|
||||||
" YouCompleteMe
|
|
||||||
if !exists('g:ycm_semantic_triggers')
|
|
||||||
let g:ycm_semantic_triggers = {}
|
|
||||||
endif
|
|
||||||
let g:ycm_semantic_triggers.gdscript3 = [
|
|
||||||
\'re!\w+',
|
|
||||||
\'.',
|
|
||||||
\'re!\bextends\s+',
|
|
||||||
\'re!\bexport\(',
|
|
||||||
\'re!\bfunc\s+',
|
|
||||||
\'re!"res://[^"]*'
|
|
||||||
\]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" Configure echodoc
|
|
||||||
if &rtp =~ 'echodoc'
|
|
||||||
let s:echodoc_dict = { "name": "gdscript3", "rank": 9 }
|
|
||||||
fun! s:echodoc_dict.search(text)
|
|
||||||
execute s:py_cmd . " echodoc_search()"
|
|
||||||
if exists("echodoc_search_result")
|
|
||||||
return echodoc_search_result
|
|
||||||
else
|
|
||||||
return []
|
|
||||||
endif
|
|
||||||
endfun
|
|
||||||
call echodoc#register('gdscript3', s:echodoc_dict)
|
|
||||||
|
|
||||||
" Reset echodoc cache when exiting insert mode.
|
|
||||||
" This fixes an issue where the function signature wouldn't re-appear
|
|
||||||
" after exiting and re-entering insert mode.
|
|
||||||
au InsertLeave * let b:prev_echodoc = []
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Configure Syntastic checker
|
|
||||||
let g:syntastic_gdscript3_checkers = ['godot_server']
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: generic git output
|
" Language: generic git output
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2016 Aug 29
|
" Last Change: 2019 Dec 05
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if (exists("b:did_ftplugin"))
|
if (exists("b:did_ftplugin"))
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: git commit file
|
" Language: git commit file
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2016 Aug 29
|
" Last Change: 2019 Dec 05
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if (exists("b:did_ftplugin"))
|
if (exists("b:did_ftplugin"))
|
||||||
@@ -14,6 +14,7 @@ runtime! ftplugin/git.vim
|
|||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
setlocal comments=:# commentstring=#\ %s
|
setlocal comments=:# commentstring=#\ %s
|
||||||
|
setlocal include=^\+\+\+
|
||||||
setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72
|
setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72
|
||||||
setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n
|
setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n
|
||||||
setlocal formatlistpat+=\\\|^\\s*[-*+]\\s\\+
|
setlocal formatlistpat+=\\\|^\\s*[-*+]\\s\\+
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
|||||||
" Vim filetype plugin
|
" Vim filetype plugin
|
||||||
" Language: git rebase --interactive
|
" Language: git rebase --interactive
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2016 Aug 29
|
" Last Change: 2019 Dec 05
|
||||||
|
|
||||||
" Only do this when not done yet for this buffer
|
" Only do this when not done yet for this buffer
|
||||||
if (exists("b:did_ftplugin"))
|
if (exists("b:did_ftplugin"))
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '%%PACK%%') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jq') == -1
|
||||||
|
|
||||||
%%CONTENT%%
|
setlocal commentstring=#%s
|
||||||
|
|
||||||
endif
|
endif
|
||||||
@@ -1,5 +1,13 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'gdscript') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsonnet') == -1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
" -- fmt
|
||||||
|
command! -nargs=0 JsonnetFmt call jsonnet#Format()
|
||||||
|
|
||||||
setlocal commentstring=//\ %s
|
setlocal commentstring=//\ %s
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
@@ -25,6 +25,8 @@ let b:julia_vim_loaded = 1
|
|||||||
|
|
||||||
let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<"
|
let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<"
|
||||||
\ . " define< fo< shiftwidth< expandtab< indentexpr< indentkeys< cinoptions< omnifunc<"
|
\ . " define< fo< shiftwidth< expandtab< indentexpr< indentkeys< cinoptions< omnifunc<"
|
||||||
|
\ . " | unlet! b:commentary_format"
|
||||||
|
\ . " | unlet! b:smartcomment_force_linemode"
|
||||||
\ . " | unlet! b:julia_vim_loaded"
|
\ . " | unlet! b:julia_vim_loaded"
|
||||||
|
|
||||||
" MatchIt plugin support
|
" MatchIt plugin support
|
||||||
@@ -94,6 +96,10 @@ if exists("loaded_matchit")
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Some plugin-specific tweaks for commenting
|
||||||
|
let b:commentary_format = "# %s" " for tpope/vim-commentary
|
||||||
|
let b:smartcomment_force_linemode = 1 " for carlobaldassi/vim-smartcomment
|
||||||
|
|
||||||
if has("gui_win32")
|
if has("gui_win32")
|
||||||
let b:browsefilter = "Julia Source Files (*.jl)\t*.jl\n"
|
let b:browsefilter = "Julia Source Files (*.jl)\t*.jl\n"
|
||||||
let b:undo_ftplugin = b:undo_ftplugin . " | unlet! b:browsefilter"
|
let b:undo_ftplugin = b:undo_ftplugin . " | unlet! b:browsefilter"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vifm') == -1
|
|||||||
|
|
||||||
" Mail file type extension to pick files for attachments via vifm
|
" Mail file type extension to pick files for attachments via vifm
|
||||||
" Maintainer: xaizek <xaizek@posteo.net>
|
" Maintainer: xaizek <xaizek@posteo.net>
|
||||||
" Last Change: January 02, 2018
|
" Last Change: June 22, 2020
|
||||||
|
|
||||||
" Insert attachment picked via vifm after 'Subject' header
|
" Insert attachment picked via vifm after 'Subject' header
|
||||||
function! s:AddMailAttachments()
|
function! s:AddMailAttachments()
|
||||||
@@ -43,9 +43,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:HandleRunResults(exitcode, listf)
|
function! s:HandleRunResults(exitcode, listf)
|
||||||
if a:exitcode != 0
|
if a:exitcode != 0
|
||||||
echohl WarningMsg
|
echoerr 'Got non-zero code from vifm: ' . a:exitcode
|
||||||
echo 'Got non-zero code from vifm: ' . a:exitcode
|
|
||||||
echohl None
|
|
||||||
call delete(a:listf)
|
call delete(a:listf)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -156,6 +156,58 @@ function! s:GetHeaderLevel(...)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Return list of headers and their levels.
|
||||||
|
"
|
||||||
|
function! s:GetHeaderList()
|
||||||
|
let l:bufnr = bufnr('%')
|
||||||
|
let l:fenced_block = 0
|
||||||
|
let l:front_matter = 0
|
||||||
|
let l:header_list = []
|
||||||
|
let l:vim_markdown_frontmatter = get(g:, "vim_markdown_frontmatter", 0)
|
||||||
|
for i in range(1, line('$'))
|
||||||
|
let l:lineraw = getline(i)
|
||||||
|
let l:l1 = getline(i+1)
|
||||||
|
let l:line = substitute(l:lineraw, "#", "\\\#", "g")
|
||||||
|
" exclude lines in fenced code blocks
|
||||||
|
if l:line =~ '````*' || l:line =~ '\~\~\~\~*'
|
||||||
|
if l:fenced_block == 0
|
||||||
|
let l:fenced_block = 1
|
||||||
|
elseif l:fenced_block == 1
|
||||||
|
let l:fenced_block = 0
|
||||||
|
endif
|
||||||
|
" exclude lines in frontmatters
|
||||||
|
elseif l:vim_markdown_frontmatter == 1
|
||||||
|
if l:front_matter == 1
|
||||||
|
if l:line == '---'
|
||||||
|
let l:front_matter = 0
|
||||||
|
endif
|
||||||
|
elseif i == 1
|
||||||
|
if l:line == '---'
|
||||||
|
let l:front_matter = 1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
" match line against header regex
|
||||||
|
if join(getline(i, i + 1), "\n") =~ s:headersRegexp && l:line =~ '^\S'
|
||||||
|
let l:is_header = 1
|
||||||
|
else
|
||||||
|
let l:is_header = 0
|
||||||
|
endif
|
||||||
|
if l:is_header == 1 && l:fenced_block == 0 && l:front_matter == 0
|
||||||
|
" remove hashes from atx headers
|
||||||
|
if match(l:line, "^#") > -1
|
||||||
|
let l:line = substitute(l:line, '\v^#*[ ]*', '', '')
|
||||||
|
let l:line = substitute(l:line, '\v[ ]*#*$', '', '')
|
||||||
|
endif
|
||||||
|
" append line to list
|
||||||
|
let l:level = s:GetHeaderLevel(i)
|
||||||
|
let l:item = {'level': l:level, 'text': l:line, 'lnum': i, 'bufnr': bufnr}
|
||||||
|
let l:header_list = l:header_list + [l:item]
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
return l:header_list
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Returns the level of the header at the given line.
|
" Returns the level of the header at the given line.
|
||||||
"
|
"
|
||||||
" If there is no header at the given line, returns `0`.
|
" If there is no header at the given line, returns `0`.
|
||||||
@@ -177,6 +229,7 @@ endfunction
|
|||||||
function! s:MoveToParentHeader()
|
function! s:MoveToParentHeader()
|
||||||
let l:linenum = s:GetParentHeaderLineNumber()
|
let l:linenum = s:GetParentHeaderLineNumber()
|
||||||
if l:linenum != 0
|
if l:linenum != 0
|
||||||
|
call setpos("''", getpos('.'))
|
||||||
call cursor(l:linenum, 1)
|
call cursor(l:linenum, 1)
|
||||||
else
|
else
|
||||||
echo 'no parent header'
|
echo 'no parent header'
|
||||||
@@ -305,65 +358,38 @@ function! s:Toc(...)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
let l:bufnr = bufnr('%')
|
|
||||||
let l:cursor_line = line('.')
|
let l:cursor_line = line('.')
|
||||||
let l:cursor_header = 0
|
let l:cursor_header = 0
|
||||||
let l:fenced_block = 0
|
let l:header_list = s:GetHeaderList()
|
||||||
let l:front_matter = 0
|
let l:indented_header_list = []
|
||||||
let l:header_list = []
|
|
||||||
let l:header_max_len = 0
|
|
||||||
let l:vim_markdown_toc_autofit = get(g:, "vim_markdown_toc_autofit", 0)
|
|
||||||
let l:vim_markdown_frontmatter = get(g:, "vim_markdown_frontmatter", 0)
|
|
||||||
for i in range(1, line('$'))
|
|
||||||
let l:lineraw = getline(i)
|
|
||||||
let l:l1 = getline(i+1)
|
|
||||||
let l:line = substitute(l:lineraw, "#", "\\\#", "g")
|
|
||||||
if l:line =~ '````*' || l:line =~ '\~\~\~\~*'
|
|
||||||
if l:fenced_block == 0
|
|
||||||
let l:fenced_block = 1
|
|
||||||
elseif l:fenced_block == 1
|
|
||||||
let l:fenced_block = 0
|
|
||||||
endif
|
|
||||||
elseif l:vim_markdown_frontmatter == 1
|
|
||||||
if l:front_matter == 1
|
|
||||||
if l:line == '---'
|
|
||||||
let l:front_matter = 0
|
|
||||||
endif
|
|
||||||
elseif i == 1
|
|
||||||
if l:line == '---'
|
|
||||||
let l:front_matter = 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
if l:line =~ '^#\+' || (l:l1 =~ '^=\+\s*$' || l:l1 =~ '^-\+\s*$') && l:line =~ '^\S'
|
|
||||||
let l:is_header = 1
|
|
||||||
else
|
|
||||||
let l:is_header = 0
|
|
||||||
endif
|
|
||||||
if l:is_header == 1 && l:fenced_block == 0 && l:front_matter == 0
|
|
||||||
" append line to location list
|
|
||||||
let l:item = {'lnum': i, 'text': l:line, 'valid': 1, 'bufnr': l:bufnr, 'col': 1}
|
|
||||||
let l:header_list = l:header_list + [l:item]
|
|
||||||
" set header number of the cursor position
|
|
||||||
if l:cursor_header == 0
|
|
||||||
if i == l:cursor_line
|
|
||||||
let l:cursor_header = len(l:header_list)
|
|
||||||
elseif i > l:cursor_line
|
|
||||||
let l:cursor_header = len(l:header_list) - 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
" keep track of the longest header size (heading level + title)
|
|
||||||
let l:total_len = stridx(l:line, ' ') + strdisplaywidth(l:line)
|
|
||||||
if l:total_len > l:header_max_len
|
|
||||||
let l:header_max_len = l:total_len
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
call setloclist(0, l:header_list)
|
|
||||||
if len(l:header_list) == 0
|
if len(l:header_list) == 0
|
||||||
echom "Toc: No headers."
|
echom "Toc: No headers."
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
let l:header_max_len = 0
|
||||||
|
let l:vim_markdown_toc_autofit = get(g:, "vim_markdown_toc_autofit", 0)
|
||||||
|
for h in l:header_list
|
||||||
|
" set header number of the cursor position
|
||||||
|
if l:cursor_header == 0
|
||||||
|
let l:header_line = h.lnum
|
||||||
|
if l:header_line == l:cursor_line
|
||||||
|
let l:cursor_header = index(l:header_list, h) + 1
|
||||||
|
elseif l:header_line > l:cursor_line
|
||||||
|
let l:cursor_header = index(l:header_list, h)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
" indent header based on level
|
||||||
|
let l:text = repeat(' ', h.level-1) . h.text
|
||||||
|
" keep track of the longest header size (heading level + title)
|
||||||
|
let l:total_len = strdisplaywidth(l:text)
|
||||||
|
if l:total_len > l:header_max_len
|
||||||
|
let l:header_max_len = l:total_len
|
||||||
|
endif
|
||||||
|
" append indented line to list
|
||||||
|
let l:item = {'lnum': h.lnum, 'text': l:text, 'valid': 1, 'bufnr': h.bufnr, 'col': 1}
|
||||||
|
let l:indented_header_list = l:indented_header_list + [l:item]
|
||||||
|
endfor
|
||||||
|
call setloclist(0, l:indented_header_list)
|
||||||
|
|
||||||
if l:window_type ==# 'horizontal'
|
if l:window_type ==# 'horizontal'
|
||||||
lopen
|
lopen
|
||||||
@@ -371,7 +397,8 @@ function! s:Toc(...)
|
|||||||
vertical lopen
|
vertical lopen
|
||||||
" auto-fit toc window when possible to shrink it
|
" auto-fit toc window when possible to shrink it
|
||||||
if (&columns/2) > l:header_max_len && l:vim_markdown_toc_autofit == 1
|
if (&columns/2) > l:header_max_len && l:vim_markdown_toc_autofit == 1
|
||||||
execute 'vertical resize ' . (l:header_max_len + 1)
|
" header_max_len + 1 space for first header + 3 spaces for line numbers
|
||||||
|
execute 'vertical resize ' . (l:header_max_len + 1 + 3)
|
||||||
else
|
else
|
||||||
execute 'vertical resize ' . (&columns/2)
|
execute 'vertical resize ' . (&columns/2)
|
||||||
endif
|
endif
|
||||||
@@ -384,27 +411,84 @@ function! s:Toc(...)
|
|||||||
for i in range(1, line('$'))
|
for i in range(1, line('$'))
|
||||||
" this is the location-list data for the current item
|
" this is the location-list data for the current item
|
||||||
let d = getloclist(0)[i-1]
|
let d = getloclist(0)[i-1]
|
||||||
" atx headers
|
call setline(i, d.text)
|
||||||
if match(d.text, "^#") > -1
|
|
||||||
let l:level = len(matchstr(d.text, '#*', 'g'))-1
|
|
||||||
let d.text = substitute(d.text, '\v^#*[ ]*', '', '')
|
|
||||||
let d.text = substitute(d.text, '\v[ ]*#*$', '', '')
|
|
||||||
" setex headers
|
|
||||||
else
|
|
||||||
let l:next_line = getbufline(d.bufnr, d.lnum+1)
|
|
||||||
if match(l:next_line, "=") > -1
|
|
||||||
let l:level = 0
|
|
||||||
elseif match(l:next_line, "-") > -1
|
|
||||||
let l:level = 1
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
call setline(i, repeat(' ', l:level). d.text)
|
|
||||||
endfor
|
endfor
|
||||||
setlocal nomodified
|
setlocal nomodified
|
||||||
setlocal nomodifiable
|
setlocal nomodifiable
|
||||||
execute 'normal! ' . l:cursor_header . 'G'
|
execute 'normal! ' . l:cursor_header . 'G'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:InsertToc(format, ...)
|
||||||
|
if a:0 > 0
|
||||||
|
if type(a:1) != type(0)
|
||||||
|
echohl WarningMsg
|
||||||
|
echomsg '[vim-markdown] Invalid argument, must be an integer >= 2.'
|
||||||
|
echohl None
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
let l:max_level = a:1
|
||||||
|
if l:max_level < 2
|
||||||
|
echohl WarningMsg
|
||||||
|
echomsg '[vim-markdown] Maximum level cannot be smaller than 2.'
|
||||||
|
echohl None
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let l:max_level = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:toc = []
|
||||||
|
let l:header_list = s:GetHeaderList()
|
||||||
|
if len(l:header_list) == 0
|
||||||
|
echom "InsertToc: No headers."
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:format ==# 'numbers'
|
||||||
|
let l:h2_count = 0
|
||||||
|
for header in l:header_list
|
||||||
|
if header.level == 2
|
||||||
|
let l:h2_count += 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
let l:max_h2_number_len = strlen(string(l:h2_count))
|
||||||
|
else
|
||||||
|
let l:max_h2_number_len = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:h2_count = 0
|
||||||
|
for header in l:header_list
|
||||||
|
let l:level = header.level
|
||||||
|
if l:level == 1
|
||||||
|
" skip level-1 headers
|
||||||
|
continue
|
||||||
|
elseif l:max_level != 0 && l:level > l:max_level
|
||||||
|
" skip unwanted levels
|
||||||
|
continue
|
||||||
|
elseif l:level == 2
|
||||||
|
" list of level-2 headers can be bullets or numbers
|
||||||
|
if a:format ==# 'bullets'
|
||||||
|
let l:indent = ''
|
||||||
|
let l:marker = '* '
|
||||||
|
else
|
||||||
|
let l:h2_count += 1
|
||||||
|
let l:number_len = strlen(string(l:h2_count))
|
||||||
|
let l:indent = repeat(' ', l:max_h2_number_len - l:number_len)
|
||||||
|
let l:marker = l:h2_count . '. '
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let l:indent = repeat(' ', l:max_h2_number_len + 2 * (l:level - 2))
|
||||||
|
let l:marker = '* '
|
||||||
|
endif
|
||||||
|
let l:text = '[' . header.text . ']'
|
||||||
|
let l:link = '(#' . substitute(tolower(header.text), '\v[ ]+', '-', 'g') . ')'
|
||||||
|
let l:line = l:indent . l:marker . l:text . l:link
|
||||||
|
let l:toc = l:toc + [l:line]
|
||||||
|
endfor
|
||||||
|
|
||||||
|
call append(line('.'), l:toc)
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Convert Setex headers in range `line1 .. line2` to Atx.
|
" Convert Setex headers in range `line1 .. line2` to Atx.
|
||||||
"
|
"
|
||||||
" Return the number of conversions.
|
" Return the number of conversions.
|
||||||
@@ -681,6 +765,8 @@ command! -buffer Toc call s:Toc()
|
|||||||
command! -buffer Toch call s:Toc('horizontal')
|
command! -buffer Toch call s:Toc('horizontal')
|
||||||
command! -buffer Tocv call s:Toc('vertical')
|
command! -buffer Tocv call s:Toc('vertical')
|
||||||
command! -buffer Toct call s:Toc('tab')
|
command! -buffer Toct call s:Toc('tab')
|
||||||
|
command! -buffer -nargs=? InsertToc call s:InsertToc('bullets', <args>)
|
||||||
|
command! -buffer -nargs=? InsertNToc call s:InsertToc('numbers', <args>)
|
||||||
|
|
||||||
" Heavily based on vim-notes - http://peterodding.com/code/vim/notes/
|
" Heavily based on vim-notes - http://peterodding.com/code/vim/notes/
|
||||||
if exists('g:vim_markdown_fenced_languages')
|
if exists('g:vim_markdown_fenced_languages')
|
||||||
@@ -704,7 +790,7 @@ function! s:MarkdownHighlightSources(force)
|
|||||||
" Look for code blocks in the current file
|
" Look for code blocks in the current file
|
||||||
let filetypes = {}
|
let filetypes = {}
|
||||||
for line in getline(1, '$')
|
for line in getline(1, '$')
|
||||||
let ft = matchstr(line, '```\s*\zs[0-9A-Za-z_+-]*')
|
let ft = matchstr(line, '```\s*\zs[0-9A-Za-z_+-]*\ze.*')
|
||||||
if !empty(ft) && ft !~ '^\d*$' | let filetypes[ft] = 1 | endif
|
if !empty(ft) && ft !~ '^\d*$' | let filetypes[ft] = 1 | endif
|
||||||
endfor
|
endfor
|
||||||
if !exists('b:mkd_known_filetypes')
|
if !exists('b:mkd_known_filetypes')
|
||||||
@@ -735,7 +821,7 @@ function! s:MarkdownHighlightSources(force)
|
|||||||
else
|
else
|
||||||
let include = '@' . toupper(filetype)
|
let include = '@' . toupper(filetype)
|
||||||
endif
|
endif
|
||||||
let command = 'syntax region %s matchgroup=%s start="^\s*```\s*%s$" matchgroup=%s end="\s*```$" keepend contains=%s%s'
|
let command = 'syntax region %s matchgroup=%s start="^\s*```\s*%s.*$" matchgroup=%s end="\s*```$" keepend contains=%s%s'
|
||||||
execute printf(command, group, startgroup, ft, endgroup, include, has('conceal') && get(g:, 'vim_markdown_conceal', 1) && get(g:, 'vim_markdown_conceal_code_blocks', 1) ? ' concealends' : '')
|
execute printf(command, group, startgroup, ft, endgroup, include, has('conceal') && get(g:, 'vim_markdown_conceal', 1) && get(g:, 'vim_markdown_conceal_code_blocks', 1) ? ' concealends' : '')
|
||||||
execute printf('syntax cluster mkdNonListItem add=%s', group)
|
execute printf('syntax cluster mkdNonListItem add=%s', group)
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ let s:cposet=&cpoptions
|
|||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
" Comment string
|
" Comment string
|
||||||
setlocal comments=
|
setlocal comments=sr:(*\ ,mb:\ ,ex:*)
|
||||||
|
setlocal comments^=sr:(**,mb:\ \ ,ex:*)
|
||||||
setlocal commentstring=(*%s*)
|
setlocal commentstring=(*%s*)
|
||||||
|
|
||||||
" Add mappings, unless the user didn't want this.
|
" Add mappings, unless the user didn't want this.
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'racket') == -1
|
|||||||
" Maintainer: Will Langstroth <will@langstroth.com>
|
" Maintainer: Will Langstroth <will@langstroth.com>
|
||||||
" URL: http://github.com/wlangstroth/vim-racket
|
" URL: http://github.com/wlangstroth/vim-racket
|
||||||
|
|
||||||
|
if exists("b:did_ftplugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
setl iskeyword+=#,%,^
|
setl iskeyword+=#,%,^
|
||||||
setl lispwords+=module,module*,module+,parameterize,let-values,let*-values,letrec-values,local
|
setl lispwords+=module,module*,module+,parameterize,let-values,let*-values,letrec-values,local
|
||||||
setl lispwords+=define-values,opt-lambda,case-lambda,syntax-rules,with-syntax,syntax-case,syntax-parse
|
setl lispwords+=define-values,opt-lambda,case-lambda,syntax-rules,with-syntax,syntax-case,syntax-parse
|
||||||
@@ -37,7 +42,10 @@ setl makeprg=raco\ make\ --\ %
|
|||||||
" but then vim says:
|
" but then vim says:
|
||||||
" "press ENTER or type a command to continue"
|
" "press ENTER or type a command to continue"
|
||||||
" We avoid the annoyance of having to hit enter by remapping K directly.
|
" We avoid the annoyance of having to hit enter by remapping K directly.
|
||||||
nnoremap <buffer> K :silent !raco docs <cword><cr>:redraw!<cr>
|
nnoremap <buffer> <Plug>RacketDoc :silent !raco docs <cword><cr>:redraw!<cr>
|
||||||
|
if maparg("K", "n") == ""
|
||||||
|
nmap <buffer> K <Plug>RacketDoc
|
||||||
|
endif
|
||||||
|
|
||||||
" For the visual mode K mapping, it's slightly more convoluted to get the
|
" For the visual mode K mapping, it's slightly more convoluted to get the
|
||||||
" selected text:
|
" selected text:
|
||||||
@@ -53,9 +61,20 @@ function! s:Racket_visual_doc()
|
|||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
vnoremap <buffer> K :call <SID>Racket_visual_doc()<cr>
|
vnoremap <buffer> <Plug>RacketDoc :call <SID>Racket_visual_doc()<cr>
|
||||||
|
if maparg("K", "v") == ""
|
||||||
|
vmap <buffer> K <Plug>RacketDoc
|
||||||
|
endif
|
||||||
|
|
||||||
"setl commentstring=;;%s
|
"setl commentstring=;;%s
|
||||||
setl commentstring=#\|\ %s\ \|#
|
setl commentstring=#\|\ %s\ \|#
|
||||||
|
|
||||||
|
" Undo our settings when the filetype changes away from Racket
|
||||||
|
" (this should be amended if settings/mappings are added above!)
|
||||||
|
let b:undo_ftplugin =
|
||||||
|
\ "setl iskeyword< lispwords< lisp< comments< formatoptions<"
|
||||||
|
\. "| setl makeprg< commentstring<"
|
||||||
|
\. "| nunmap <buffer> K"
|
||||||
|
\. "| vunmap <buffer> K"
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -16,4 +16,9 @@ setlocal suffixesadd=.zir
|
|||||||
setlocal commentstring=//\ %s
|
setlocal commentstring=//\ %s
|
||||||
setlocal makeprg=zig\ build
|
setlocal makeprg=zig\ build
|
||||||
|
|
||||||
|
if (has("comments"))
|
||||||
|
set comments=:///,://,:\\\\
|
||||||
|
set formatoptions=tcqor
|
||||||
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||||
|
|
||||||
|
" Initialization {{{1
|
||||||
|
" ==============
|
||||||
|
|
||||||
" Only load this indent file when no other was loaded.
|
" Only load this indent file when no other was loaded.
|
||||||
if exists('b:did_indent')
|
if exists('b:did_indent')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
setlocal nosmartindent
|
setlocal nosmartindent
|
||||||
|
|
||||||
" Now, set up our indentation expression and keys that trigger it.
|
" Now, set up our indentation expression and keys that trigger it.
|
||||||
setlocal indentexpr=GetCrystalIndent(v:lnum)
|
setlocal indentexpr=GetCrystalIndent(v:lnum)
|
||||||
setlocal indentkeys=0{,0},0),0],!^F,o,O,e,:,.
|
setlocal indentkeys=0{,0},0),0],!^F,o,O,e,.
|
||||||
setlocal indentkeys+==end,=else,=elsif,=when,=ensure,=rescue
|
setlocal indentkeys+==end,=else,=elsif,=when,=in,=ensure,=rescue
|
||||||
setlocal indentkeys+==private,=protected
|
|
||||||
|
|
||||||
let s:cpo_save = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
" Only define the function once.
|
" Only define the function once.
|
||||||
if exists('*GetCrystalIndent')
|
if exists('*GetCrystalIndent')
|
||||||
@@ -26,7 +26,7 @@ endif
|
|||||||
if exists('*shiftwidth')
|
if exists('*shiftwidth')
|
||||||
let s:sw = function('shiftwidth')
|
let s:sw = function('shiftwidth')
|
||||||
else
|
else
|
||||||
function s:sw()
|
function! s:sw()
|
||||||
return &shiftwidth
|
return &shiftwidth
|
||||||
endfunction
|
endfunction
|
||||||
endif
|
endif
|
||||||
@@ -34,262 +34,81 @@ endif
|
|||||||
" GetCrystalIndent Function {{{1
|
" GetCrystalIndent Function {{{1
|
||||||
" =========================
|
" =========================
|
||||||
|
|
||||||
function GetCrystalIndent(...)
|
function! GetCrystalIndent(...) abort
|
||||||
" Setup {{{2
|
" Setup {{{2
|
||||||
" -----
|
" -----
|
||||||
|
|
||||||
" For the current line, use the first argument if given, else v:lnum
|
let indent_info = {}
|
||||||
let clnum = a:0 ? a:1 : v:lnum
|
|
||||||
|
|
||||||
" Set up variables for restoring position in file
|
" The value of a single shift-width
|
||||||
let vcol = col('.')
|
let indent_info.sw = s:sw()
|
||||||
|
|
||||||
|
" For the current line, use the first argument if given, else v:lnum
|
||||||
|
let indent_info.clnum = a:0 ? a:1 : v:lnum
|
||||||
|
let indent_info.cline = getline(indent_info.clnum)
|
||||||
|
|
||||||
|
" Set up variables for restoring position in file.
|
||||||
|
let indent_info.col = col('.')
|
||||||
|
|
||||||
" Work on the current line {{{2
|
" Work on the current line {{{2
|
||||||
" ------------------------
|
" ------------------------
|
||||||
|
|
||||||
" Get the current line.
|
for callback_name in g:crystal#indent#curr_line_callbacks
|
||||||
let line = getline(clnum)
|
let indent = call(function(callback_name), [indent_info])
|
||||||
let ind = -1
|
|
||||||
|
|
||||||
" If we got a closing bracket on an empty line, find its match and indent
|
if indent >= 0
|
||||||
" according to it. For parentheses we indent to its column - 1, for the
|
return indent
|
||||||
" others we indent to the containing line's MSL's level. Return -1 if fail.
|
|
||||||
let col = matchend(line, '^\s*[]})]')
|
|
||||||
if col > 0 && !crystal#indent#IsInStringOrComment(clnum, col)
|
|
||||||
call cursor(clnum, col)
|
|
||||||
let bs = strpart('(){}[]', stridx(')}]', line[col - 1]) * 2, 2)
|
|
||||||
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', g:crystal#indent#skip_expr)
|
|
||||||
if line[col-1] ==# ')' && col('.') != col('$') - 1
|
|
||||||
let ind = virtcol('.') - 1
|
|
||||||
else
|
|
||||||
let ind = indent(crystal#indent#GetMSL(line('.')))
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
return ind
|
endfor
|
||||||
endif
|
|
||||||
|
|
||||||
" If we have a deindenting keyword, find its match and indent to its level.
|
|
||||||
" TODO: this is messy
|
|
||||||
if crystal#indent#Match(clnum, g:crystal#indent#crystal_deindent_keywords)
|
|
||||||
call cursor(clnum, 1)
|
|
||||||
if searchpair(
|
|
||||||
\ g:crystal#indent#end_start_regex,
|
|
||||||
\ g:crystal#indent#end_middle_regex,
|
|
||||||
\ g:crystal#indent#end_end_regex,
|
|
||||||
\ 'bW', g:crystal#indent#skip_expr)
|
|
||||||
let msl = crystal#indent#GetMSL(line('.'))
|
|
||||||
let line = getline(line('.'))
|
|
||||||
|
|
||||||
if strpart(line, 0, col('.') - 1) =~# '=\s*$' &&
|
|
||||||
\ strpart(line, col('.') - 1, 2) !~# 'do'
|
|
||||||
" assignment to case/begin/etc, on the same line, hanging indent
|
|
||||||
let ind = virtcol('.') - 1
|
|
||||||
elseif getline(msl) =~# '=\s*\(#.*\)\=$'
|
|
||||||
" in the case of assignment to the msl, align to the starting line,
|
|
||||||
" not to the msl
|
|
||||||
let ind = indent(line('.'))
|
|
||||||
else
|
|
||||||
" align to the msl
|
|
||||||
let ind = indent(msl)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
return ind
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If we are in a multi-line string, don't do anything to it.
|
|
||||||
if crystal#indent#IsInString(clnum, matchend(line, '^\s*') + 1)
|
|
||||||
return indent('.')
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If we are at the closing delimiter of a "<<" heredoc-style string, set the
|
|
||||||
" indent to 0.
|
|
||||||
if line =~# '^\k\+\s*$'
|
|
||||||
\ && crystal#indent#IsInStringDelimiter(clnum, 1)
|
|
||||||
\ && search('\V<<'.line, 'nbW')
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the current line starts with a leading operator, add a level of indent.
|
|
||||||
if crystal#indent#Match(clnum, g:crystal#indent#leading_operator_regex)
|
|
||||||
return indent(crystal#indent#GetMSL(clnum)) + s:sw()
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Work on the previous line. {{{2
|
" Work on the previous line. {{{2
|
||||||
" --------------------------
|
" --------------------------
|
||||||
|
|
||||||
" Find a non-blank, non-multi-line string line above the current line.
|
" Special case: we don't need the real PrevNonBlank for an empty line
|
||||||
let lnum = crystal#indent#PrevNonBlankNonString(clnum - 1)
|
" inside a string. And that call can be quite expensive in that
|
||||||
|
" particular situation.
|
||||||
|
let indent = crystal#indent#EmptyInsideString(indent_info)
|
||||||
|
|
||||||
" If the line is empty and inside a string, use the previous line.
|
if indent >= 0
|
||||||
if line =~# '^\s*$' && lnum != prevnonblank(clnum - 1)
|
return indent
|
||||||
return indent(prevnonblank(clnum))
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" At the start of the file use zero indent.
|
" Previous line number
|
||||||
if lnum == 0
|
let indent_info.plnum = crystal#indent#PrevNonBlank(indent_info.clnum - 1)
|
||||||
return 0
|
let indent_info.pline = getline(indent_info.plnum)
|
||||||
endif
|
|
||||||
|
|
||||||
" Set up variables for the previous line.
|
for callback_name in g:crystal#indent#prev_line_callbacks
|
||||||
let line = getline(lnum)
|
let indent = call(function(callback_name), [indent_info])
|
||||||
let ind = indent(lnum)
|
|
||||||
|
|
||||||
if crystal#indent#Match(lnum, g:crystal#indent#continuable_regex) &&
|
if indent >= 0
|
||||||
\ crystal#indent#Match(lnum, g:crystal#indent#continuation_regex)
|
return indent
|
||||||
return indent(crystal#indent#GetMSL(lnum)) + s:sw() * 2
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the previous line ended with a block opening, add a level of indent.
|
|
||||||
if crystal#indent#Match(lnum, g:crystal#indent#block_regex)
|
|
||||||
let msl = crystal#indent#GetMSL(lnum)
|
|
||||||
|
|
||||||
if getline(msl) =~# '=\s*\(#.*\)\=$'
|
|
||||||
" in the case of assignment to the msl, align to the starting line,
|
|
||||||
" not to the msl
|
|
||||||
let ind = indent(lnum) + s:sw()
|
|
||||||
else
|
|
||||||
let ind = indent(msl) + s:sw()
|
|
||||||
endif
|
endif
|
||||||
return ind
|
endfor
|
||||||
endif
|
|
||||||
|
|
||||||
" If the previous line started with a leading operator, use its MSL's level
|
" Work on the MSL. {{{2
|
||||||
" of indent
|
" ----------------
|
||||||
if crystal#indent#Match(lnum, g:crystal#indent#leading_operator_regex)
|
|
||||||
return indent(crystal#indent#GetMSL(lnum))
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the previous line ended with the "*" of a splat, add a level of indent
|
" Most Significant line based on the previous one -- in case it's a
|
||||||
if line =~ g:crystal#indent#splat_regex
|
" contination of something above
|
||||||
return indent(lnum) + s:sw()
|
let indent_info.plnum_msl = crystal#indent#GetMSL(indent_info.plnum)
|
||||||
endif
|
let indent_info.pline_msl = getline(indent_info.plnum_msl)
|
||||||
|
|
||||||
" If the previous line contained unclosed opening brackets and we are still
|
for callback_name in g:crystal#indent#msl_callbacks
|
||||||
" in them, find the rightmost one and add indent depending on the bracket
|
let indent = call(function(callback_name), [indent_info])
|
||||||
" type.
|
|
||||||
"
|
|
||||||
" If it contained hanging closing brackets, find the rightmost one, find its
|
|
||||||
" match and indent according to that.
|
|
||||||
if line =~# '[[({]' || line =~# '[])]\s*\%(#.*\)\=$'
|
|
||||||
let [opening, closing] = crystal#indent#ExtraBrackets(lnum)
|
|
||||||
|
|
||||||
if opening.pos != -1
|
if indent >= 0
|
||||||
if opening.type ==# '(' && searchpair('(', '', ')', 'bW', g:crystal#indent#skip_expr)
|
return indent
|
||||||
if col('.') + 1 == col('$')
|
|
||||||
return ind + s:sw()
|
|
||||||
else
|
|
||||||
return virtcol('.')
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
let nonspace = matchend(line, '\S', opening.pos + 1) - 1
|
|
||||||
return nonspace > 0 ? nonspace : ind + s:sw()
|
|
||||||
endif
|
|
||||||
elseif closing.pos != -1
|
|
||||||
call cursor(lnum, closing.pos + 1)
|
|
||||||
keepjumps normal! %
|
|
||||||
|
|
||||||
if crystal#indent#Match(line('.'), g:crystal#indent#crystal_indent_keywords)
|
|
||||||
return indent('.') + s:sw()
|
|
||||||
else
|
|
||||||
return indent('.')
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
call cursor(clnum, vcol)
|
|
||||||
end
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the previous line ended with an "end", match that "end"s beginning's
|
|
||||||
" indent.
|
|
||||||
let col = crystal#indent#Match(lnum, g:crystal#indent#end_end_regex)
|
|
||||||
if col
|
|
||||||
call cursor(lnum, col)
|
|
||||||
if searchpair(
|
|
||||||
\ g:crystal#indent#end_start_regex,
|
|
||||||
\ g:crystal#indent#end_middle_regex,
|
|
||||||
\ g:crystal#indent#end_end_regex,
|
|
||||||
\ 'bW',
|
|
||||||
\ g:crystal#indent#skip_expr)
|
|
||||||
let n = line('.')
|
|
||||||
let ind = indent('.')
|
|
||||||
let msl = crystal#indent#GetMSL(n)
|
|
||||||
if msl != n
|
|
||||||
let ind = indent(msl)
|
|
||||||
end
|
|
||||||
return ind
|
|
||||||
endif
|
endif
|
||||||
end
|
endfor
|
||||||
|
|
||||||
let col = crystal#indent#Match(lnum, g:crystal#indent#crystal_indent_keywords)
|
|
||||||
if col
|
|
||||||
call cursor(lnum, col)
|
|
||||||
let ind = virtcol('.') - 1 + s:sw()
|
|
||||||
" TODO: make this better (we need to count them) (or, if a searchpair
|
|
||||||
" fails, we know that something is lacking an end and thus we indent a
|
|
||||||
" level
|
|
||||||
if crystal#indent#Match(lnum, g:crystal#indent#end_end_regex)
|
|
||||||
let ind = indent('.')
|
|
||||||
endif
|
|
||||||
return ind
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Work on the MSL line. {{{2
|
|
||||||
" ---------------------
|
|
||||||
|
|
||||||
" Set up variables to use and search for MSL to the previous line.
|
|
||||||
let p_lnum = lnum
|
|
||||||
let lnum = crystal#indent#GetMSL(lnum)
|
|
||||||
|
|
||||||
" If the previous line wasn't a MSL.
|
|
||||||
if p_lnum != lnum
|
|
||||||
" If previous line ends bracket and begins non-bracket continuation decrease indent by 1.
|
|
||||||
if crystal#indent#Match(p_lnum, g:crystal#indent#bracket_switch_continuation_regex)
|
|
||||||
return ind - 1
|
|
||||||
" If previous line is a continuation return its indent.
|
|
||||||
" TODO: the || crystal#indent#IsInString() thing worries me a bit.
|
|
||||||
elseif crystal#indent#Match(p_lnum, g:crystal#indent#non_bracket_continuation_regex) ||
|
|
||||||
\ crystal#indent#IsInString(p_lnum,strlen(line))
|
|
||||||
return ind
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Set up more variables, now that we know we wasn't continuation bound.
|
|
||||||
let line = getline(lnum)
|
|
||||||
let msl_ind = indent(lnum)
|
|
||||||
|
|
||||||
" If the MSL line had an indenting keyword in it, add a level of indent.
|
|
||||||
" TODO: this does not take into account contrived things such as
|
|
||||||
" module Foo; class Bar; end
|
|
||||||
if crystal#indent#Match(lnum, g:crystal#indent#crystal_indent_keywords)
|
|
||||||
let ind = msl_ind + s:sw()
|
|
||||||
if crystal#indent#Match(lnum, g:crystal#indent#end_end_regex)
|
|
||||||
let ind = ind - s:sw()
|
|
||||||
endif
|
|
||||||
return ind
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the previous line ended with an operator -- but wasn't a block
|
|
||||||
" ending, closing bracket, or type declaration -- indent one extra
|
|
||||||
" level.
|
|
||||||
if crystal#indent#Match(lnum, g:crystal#indent#non_bracket_continuation_regex) &&
|
|
||||||
\ !crystal#indent#Match(lnum, '^\s*\([\])}]\|end\)')
|
|
||||||
if lnum == p_lnum
|
|
||||||
let ind = msl_ind + s:sw()
|
|
||||||
else
|
|
||||||
let ind = msl_ind
|
|
||||||
endif
|
|
||||||
return ind
|
|
||||||
endif
|
|
||||||
|
|
||||||
" }}}2
|
" }}}2
|
||||||
|
|
||||||
return ind
|
" By default, just return the previous line's indent
|
||||||
|
return indent(indent_info.plnum)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" }}}1
|
" }}}1
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
" vim:sw=2 sts=2 ts=8 fdm=marker et:
|
||||||
unlet s:cpo_save
|
|
||||||
|
|
||||||
" vim:set sw=2 sts=2 ts=8 et:
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ if b:ecrystal_indent_multiline
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
setlocal indentexpr=GetEcrystalIndent()
|
setlocal indentexpr=GetEcrystalIndent()
|
||||||
setlocal indentkeys+=<>>,=end,=else,=elsif,=rescue,=ensure,=when
|
setlocal indentkeys+=<>>,=end,=else,=elsif,=rescue,=ensure,=when,=in
|
||||||
|
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
@@ -71,11 +71,10 @@ let s:ecr_control_open = '<%%\@!-\=[=#]\@!'
|
|||||||
let s:ecr_comment_open = '<%%\@!-\=#'
|
let s:ecr_comment_open = '<%%\@!-\=#'
|
||||||
|
|
||||||
let s:ecr_indent_regex =
|
let s:ecr_indent_regex =
|
||||||
\ '\<\%(if\|unless\|else\|elsif\|case\|for\|when\|while\|until\|begin\|do\|rescue\|ensure\|' .
|
\ '\<\%(if\|unless\|else\|elsif\|case\|when\|in\|while\|until\|begin\|do\|rescue\|ensure\|\)\>'
|
||||||
\ 'class\|module\|struct\|lib\|enum\|union\)\>'
|
|
||||||
|
|
||||||
let s:ecr_dedent_regex =
|
let s:ecr_dedent_regex =
|
||||||
\ '\<\%(end\|else\|elsif\|when\|rescue\|ensure\)\>'
|
\ '\<\%(end\|else\|elsif\|when\|in\|rescue\|ensure\)\>'
|
||||||
|
|
||||||
" Return the value of a single shift-width
|
" Return the value of a single shift-width
|
||||||
if exists('*shiftwidth')
|
if exists('*shiftwidth')
|
||||||
|
|||||||
@@ -835,7 +835,7 @@ function! s:ErlangCalcIndent2(lnum, stack)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
elseif stack == ['prev_term_plus']
|
elseif stack == ['prev_term_plus']
|
||||||
if token =~# '[a-zA-Z_@]' ||
|
if token =~# '[a-zA-Z_@#]' ||
|
||||||
\ token ==# '<string>' || token ==# '<string_start>' ||
|
\ token ==# '<string>' || token ==# '<string_start>' ||
|
||||||
\ token ==# '<quoted_atom>' || token ==# '<quoted_atom_start>'
|
\ token ==# '<quoted_atom>' || token ==# '<quoted_atom_start>'
|
||||||
call s:Log(' previous token found: curr_vcol + plus = ' .
|
call s:Log(' previous token found: curr_vcol + plus = ' .
|
||||||
|
|||||||
330
indent/fennel.vim
Normal file
330
indent/fennel.vim
Normal file
@@ -0,0 +1,330 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fennel') == -1
|
||||||
|
|
||||||
|
" Vim filetype plugin file
|
||||||
|
" Language: FENNEL
|
||||||
|
" Maintainer: Calvin Rose
|
||||||
|
"
|
||||||
|
" Modified from vim-clojure-static
|
||||||
|
" https://github.com/guns/vim-clojure-static/blob/master/indent/clojure.vim
|
||||||
|
" This should eventually be replaced by a more standard and performant
|
||||||
|
" indenter.
|
||||||
|
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
setlocal noautoindent nosmartindent
|
||||||
|
setlocal softtabstop=2 shiftwidth=2 expandtab
|
||||||
|
setlocal indentkeys=!,o,O
|
||||||
|
|
||||||
|
if exists("*searchpairpos")
|
||||||
|
|
||||||
|
if !exists('g:fennel_maxlines')
|
||||||
|
let g:fennel_maxlines = 100
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:fennel_fuzzy_indent')
|
||||||
|
let g:fennel_fuzzy_indent = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:fennel_fuzzy_indent_patterns')
|
||||||
|
let g:fennel_fuzzy_indent_patterns = ['^def', '^let', '^while', '^if', '^fn$', '^var$', '^case$', '^for$', '^each$', '^local$', '^global$', '^match$', '^macro', '^lambda$']
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:fennel_fuzzy_indent_blacklist')
|
||||||
|
let g:fennel_fuzzy_indent_blacklist = []
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:fennel_special_indent_words')
|
||||||
|
let g:fennel_special_indent_words = ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:fennel_align_multiline_strings')
|
||||||
|
let g:fennel_align_multiline_strings = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:fennel_align_subforms')
|
||||||
|
let g:fennel_align_subforms = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
function! s:syn_id_name()
|
||||||
|
return synIDattr(synID(line("."), col("."), 0), "name")
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:ignored_region()
|
||||||
|
return s:syn_id_name() =~? '\vstring|comment|character'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:current_char()
|
||||||
|
return getline('.')[col('.')-1]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:current_word()
|
||||||
|
return getline('.')[col('.')-1 : searchpos('\v>', 'n', line('.'))[1]-2]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:is_paren()
|
||||||
|
return s:current_char() =~# '\v[\(\)\[\]\{\}]' && !s:ignored_region()
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Returns 1 if string matches a pattern in 'patterns', which may be a
|
||||||
|
" list of patterns, or a comma-delimited string of implicitly anchored
|
||||||
|
" patterns.
|
||||||
|
function! s:match_one(patterns, string)
|
||||||
|
let list = type(a:patterns) == type([])
|
||||||
|
\ ? a:patterns
|
||||||
|
\ : map(split(a:patterns, ','), '"^" . v:val . "$"')
|
||||||
|
for pat in list
|
||||||
|
if a:string =~# pat | return 1 | endif
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:match_pairs(open, close, stopat)
|
||||||
|
" Stop only on vector and map [ resp. {. Ignore the ones in strings and
|
||||||
|
" comments.
|
||||||
|
if a:stopat == 0 && g:fennel_maxlines > 0
|
||||||
|
let stopat = max([line(".") - g:fennel_maxlines, 0])
|
||||||
|
else
|
||||||
|
let stopat = a:stopat
|
||||||
|
endif
|
||||||
|
|
||||||
|
let pos = searchpairpos(a:open, '', a:close, 'bWn', "!s:is_paren()", stopat)
|
||||||
|
return [pos[0], col(pos)]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:fennel_check_for_string_worker()
|
||||||
|
" Check whether there is the last character of the previous line is
|
||||||
|
" highlighted as a string. If so, we check whether it's a ". In this
|
||||||
|
" case we have to check also the previous character. The " might be the
|
||||||
|
" closing one. In case the we are still in the string, we search for the
|
||||||
|
" opening ". If this is not found we take the indent of the line.
|
||||||
|
let nb = prevnonblank(v:lnum - 1)
|
||||||
|
|
||||||
|
if nb == 0
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
call cursor(nb, 0)
|
||||||
|
call cursor(0, col("$") - 1)
|
||||||
|
if s:syn_id_name() !~? "string"
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" This will not work for a " in the first column...
|
||||||
|
if s:current_char() == '"' || s:current_char() == '`'
|
||||||
|
call cursor(0, col("$") - 2)
|
||||||
|
if s:syn_id_name() !~? "string"
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
if s:current_char() != '\'
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
call cursor(0, col("$") - 1)
|
||||||
|
endif
|
||||||
|
|
||||||
|
let p = searchpos('\(^\|[^\\]\)\zs"\`', 'bW')
|
||||||
|
|
||||||
|
if p != [0, 0]
|
||||||
|
return p[1] - 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
return indent(".")
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:check_for_string()
|
||||||
|
let pos = getpos('.')
|
||||||
|
try
|
||||||
|
let val = s:fennel_check_for_string_worker()
|
||||||
|
finally
|
||||||
|
call setpos('.', pos)
|
||||||
|
endtry
|
||||||
|
return val
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Returns 1 for opening brackets, -1 for _anything else_.
|
||||||
|
function! s:bracket_type(char)
|
||||||
|
return stridx('([{', a:char) > -1 ? 1 : -1
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Returns: [opening-bracket-lnum, indent]
|
||||||
|
function! s:fennel_indent_pos()
|
||||||
|
" Get rid of special case.
|
||||||
|
if line(".") == 1
|
||||||
|
return [0, 0]
|
||||||
|
endif
|
||||||
|
|
||||||
|
" We have to apply some heuristics here to figure out, whether to use
|
||||||
|
" normal lisp indenting or not.
|
||||||
|
let i = s:check_for_string()
|
||||||
|
if i > -1
|
||||||
|
return [0, i + !!g:fennel_align_multiline_strings]
|
||||||
|
endif
|
||||||
|
|
||||||
|
call cursor(0, 1)
|
||||||
|
|
||||||
|
" Find the next enclosing [ or {. We can limit the second search
|
||||||
|
" to the line, where the [ was found. If no [ was there this is
|
||||||
|
" zero and we search for an enclosing {.
|
||||||
|
let paren = s:match_pairs('(', ')', 0)
|
||||||
|
let bracket = s:match_pairs('\[', '\]', paren[0])
|
||||||
|
let curly = s:match_pairs('{', '}', bracket[0])
|
||||||
|
|
||||||
|
" In case the curly brace is on a line later then the [ or - in
|
||||||
|
" case they are on the same line - in a higher column, we take the
|
||||||
|
" curly indent.
|
||||||
|
if curly[0] > bracket[0] || curly[1] > bracket[1]
|
||||||
|
if curly[0] > paren[0] || curly[1] > paren[1]
|
||||||
|
return curly
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If the curly was not chosen, we take the bracket indent - if
|
||||||
|
" there was one.
|
||||||
|
if bracket[0] > paren[0] || bracket[1] > paren[1]
|
||||||
|
return bracket
|
||||||
|
endif
|
||||||
|
|
||||||
|
" There are neither { nor [ nor (, ie. we are at the toplevel.
|
||||||
|
if paren == [0, 0]
|
||||||
|
return paren
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Now we have to reimplement lispindent. This is surprisingly easy, as
|
||||||
|
" soon as one has access to syntax items.
|
||||||
|
"
|
||||||
|
" - Check whether we are in a special position after a word in
|
||||||
|
" g:fennel_special_indent_words. These are special cases.
|
||||||
|
" - Get the next keyword after the (.
|
||||||
|
" - If its first character is also a (, we have another sexp and align
|
||||||
|
" one column to the right of the unmatched (.
|
||||||
|
" - In case it is in lispwords, we indent the next line to the column of
|
||||||
|
" the ( + sw.
|
||||||
|
" - If not, we check whether it is last word in the line. In that case
|
||||||
|
" we again use ( + sw for indent.
|
||||||
|
" - In any other case we use the column of the end of the word + 2.
|
||||||
|
call cursor(paren)
|
||||||
|
|
||||||
|
" In case we are at the last character, we use the paren position.
|
||||||
|
if col("$") - 1 == paren[1]
|
||||||
|
return paren
|
||||||
|
endif
|
||||||
|
|
||||||
|
" In case after the paren is a whitespace, we search for the next word.
|
||||||
|
call cursor(0, col('.') + 1)
|
||||||
|
if s:current_char() == ' '
|
||||||
|
call search('\v\S', 'W')
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If we moved to another line, there is no word after the (. We
|
||||||
|
" use the ( position for indent.
|
||||||
|
if line(".") > paren[0]
|
||||||
|
return paren
|
||||||
|
endif
|
||||||
|
|
||||||
|
" We still have to check, whether the keyword starts with a (, [ or {.
|
||||||
|
" In that case we use the ( position for indent.
|
||||||
|
let w = s:current_word()
|
||||||
|
if s:bracket_type(w[0]) == 1
|
||||||
|
return paren
|
||||||
|
endif
|
||||||
|
|
||||||
|
let ww = w
|
||||||
|
|
||||||
|
if &lispwords =~# '\V\<' . ww . '\>'
|
||||||
|
return [paren[0], paren[1] + &shiftwidth - 1]
|
||||||
|
endif
|
||||||
|
|
||||||
|
if g:fennel_fuzzy_indent
|
||||||
|
\ && !s:match_one(g:fennel_fuzzy_indent_blacklist, ww)
|
||||||
|
\ && s:match_one(g:fennel_fuzzy_indent_patterns, ww)
|
||||||
|
return [paren[0], paren[1] + &shiftwidth - 1]
|
||||||
|
endif
|
||||||
|
|
||||||
|
call search('\v\_s', 'cW')
|
||||||
|
call search('\v\S', 'W')
|
||||||
|
if paren[0] < line(".")
|
||||||
|
return [paren[0], paren[1] + (g:fennel_align_subforms ? 0 : &shiftwidth - 1)]
|
||||||
|
endif
|
||||||
|
|
||||||
|
call search('\v\S', 'bW')
|
||||||
|
return [line('.'), col('.') + 1]
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! GetFennelIndent()
|
||||||
|
let lnum = line('.')
|
||||||
|
let orig_lnum = lnum
|
||||||
|
let orig_col = col('.')
|
||||||
|
let [opening_lnum, indent] = s:fennel_indent_pos()
|
||||||
|
|
||||||
|
" Account for multibyte characters
|
||||||
|
if opening_lnum > 0
|
||||||
|
let indent -= indent - virtcol([opening_lnum, indent])
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Return if there are no previous lines to inherit from
|
||||||
|
if opening_lnum < 1 || opening_lnum >= lnum - 1
|
||||||
|
call cursor(orig_lnum, orig_col)
|
||||||
|
return indent
|
||||||
|
endif
|
||||||
|
|
||||||
|
let bracket_count = 0
|
||||||
|
|
||||||
|
" Take the indent of the first previous non-white line that is
|
||||||
|
" at the same sexp level. cf. src/misc1.c:get_lisp_indent()
|
||||||
|
while 1
|
||||||
|
let lnum = prevnonblank(lnum - 1)
|
||||||
|
let col = 1
|
||||||
|
|
||||||
|
if lnum <= opening_lnum
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
|
||||||
|
call cursor(lnum, col)
|
||||||
|
|
||||||
|
" Handle bracket counting edge case
|
||||||
|
if s:is_paren()
|
||||||
|
let bracket_count += s:bracket_type(s:current_char())
|
||||||
|
endif
|
||||||
|
|
||||||
|
while 1
|
||||||
|
if search('\v[(\[{}\])]', '', lnum) < 1
|
||||||
|
break
|
||||||
|
elseif !s:ignored_region()
|
||||||
|
let bracket_count += s:bracket_type(s:current_char())
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
if bracket_count == 0
|
||||||
|
" Check if this is part of a multiline string
|
||||||
|
call cursor(lnum, 1)
|
||||||
|
if s:syn_id_name() !~? '\vString|Buffer'
|
||||||
|
call cursor(orig_lnum, orig_col)
|
||||||
|
return indent(lnum)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
call cursor(orig_lnum, orig_col)
|
||||||
|
return indent
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
setlocal indentexpr=GetFennelIndent()
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
" In case we have searchpairpos not available we fall back to
|
||||||
|
" normal lisp indenting.
|
||||||
|
setlocal indentexpr=
|
||||||
|
setlocal lisp
|
||||||
|
let b:undo_indent .= '| setlocal lisp<'
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet! s:save_cpo
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -270,6 +270,12 @@ function IsInBrackets(lnum, c)
|
|||||||
return len(stack) > 0
|
return len(stack) > 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function IsInDocString(lnum)
|
||||||
|
let stack = map(synstack(a:lnum, 1), 'synIDattr(v:val, "name")')
|
||||||
|
call filter(stack, 'v:val =~# "\\<juliaDocString\\>"')
|
||||||
|
return len(stack) > 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Auxiliary function to find a line which does not start in the middle of a
|
" Auxiliary function to find a line which does not start in the middle of a
|
||||||
" multiline bracketed expression, to be used as reference for block
|
" multiline bracketed expression, to be used as reference for block
|
||||||
" indentation.
|
" indentation.
|
||||||
@@ -290,6 +296,11 @@ function LastBlockIndent(lnum)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function GetJuliaIndent()
|
function GetJuliaIndent()
|
||||||
|
" Do not alter doctrings indentation
|
||||||
|
if IsInDocString(v:lnum)
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
" Find a non-blank line above the current line.
|
" Find a non-blank line above the current line.
|
||||||
let lnum = prevnonblank(v:lnum - 1)
|
let lnum = prevnonblank(v:lnum - 1)
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ let s:close_patt = '\C\%(\<\%(end\|until\)\>\|)\|}\)'
|
|||||||
let s:anon_func_start = '\S\+\s*[({].*\<function\s*(.*)\s*$'
|
let s:anon_func_start = '\S\+\s*[({].*\<function\s*(.*)\s*$'
|
||||||
let s:anon_func_end = '\<end\%(\s*[)}]\)\+'
|
let s:anon_func_end = '\<end\%(\s*[)}]\)\+'
|
||||||
|
|
||||||
|
let s:chained_func_call = "^\\v\\s*[:.]\\w+[({\"']"
|
||||||
|
|
||||||
" Expression used to check whether we should skip a match with searchpair().
|
" Expression used to check whether we should skip a match with searchpair().
|
||||||
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~# 'luaComment\\|luaString'"
|
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~# 'luaComment\\|luaString'"
|
||||||
|
|
||||||
@@ -100,6 +102,16 @@ function GetLuaIndent()
|
|||||||
let i += 1
|
let i += 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" if the current line chains a function call to previous unchained line
|
||||||
|
if contents_prev !~# s:chained_func_call && contents_cur =~# s:chained_func_call
|
||||||
|
let i += 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" if the current line chains a function call to previous unchained line
|
||||||
|
if contents_prev =~# s:chained_func_call && contents_cur !~# s:chained_func_call
|
||||||
|
let i -= 1
|
||||||
|
endif
|
||||||
|
|
||||||
" special case: call(with, {anon = function() -- should indent only once
|
" special case: call(with, {anon = function() -- should indent only once
|
||||||
if i > 1 && contents_prev =~# s:anon_func_start
|
if i > 1 && contents_prev =~# s:anon_func_start
|
||||||
let i = 1
|
let i = 1
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ setlocal nosmartindent
|
|||||||
" Comment formatting
|
" Comment formatting
|
||||||
if !exists("no_ocaml_comments")
|
if !exists("no_ocaml_comments")
|
||||||
if (has("comments"))
|
if (has("comments"))
|
||||||
setlocal comments=sr:(*,mb:*,ex:*)
|
setlocal comments=sr:(*\ ,mb:\ ,ex:*)
|
||||||
|
setlocal comments^=sr:(**,mb:\ \ ,ex:*)
|
||||||
setlocal fo=cqort
|
setlocal fo=cqort
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ endfunction
|
|||||||
function! s:getIncIndent() abort
|
function! s:getIncIndent() abort
|
||||||
" Function to determine the s:incIndent pattern
|
" Function to determine the s:incIndent pattern
|
||||||
return
|
return
|
||||||
\ '^\s*\%(class\|entity\|object\|interface\|partition\|rectangle\|enum\|namespace\|package\)\>.*{\s*$\|' .
|
\ '^\s*\%(artifact\|class\|cloud\|database\|entity\|enum\|file\|folder\|frame\|interface\|namespace\|node\|object\|package\|partition\|rectangle\|skinparam\|state\|storage\|together\)\>.*{\s*$\|' .
|
||||||
\ '^\s*\%(loop\|alt\|opt\|group\|critical\|else\|legend\|box\|if\|while\|fork\|split\)\>\|' .
|
\ '^\s*\%(loop\|alt\|opt\|group\|critical\|else\|legend\|box\|if\|while\|fork\|split\)\>\|' .
|
||||||
\ '^\s*ref\>[^:]*$\|' .
|
\ '^\s*ref\>[^:]*$\|' .
|
||||||
\ '^\s*[hr]\?note\>\%(\%("[^"]*" \<as\>\)\@![^:]\)*$\|' .
|
\ '^\s*[hr]\?note\>\%(\%("[^"]*" \<as\>\)\@![^:]\)*$\|' .
|
||||||
|
|||||||
@@ -28,7 +28,12 @@ endif
|
|||||||
|
|
||||||
if !exists('g:ruby_indent_block_style')
|
if !exists('g:ruby_indent_block_style')
|
||||||
" Possible values: "expression", "do"
|
" Possible values: "expression", "do"
|
||||||
let g:ruby_indent_block_style = 'expression'
|
let g:ruby_indent_block_style = 'do'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('g:ruby_indent_hanging_elements')
|
||||||
|
" Non-zero means hanging indents are enabled, zero means disabled
|
||||||
|
let g:ruby_indent_hanging_elements = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
setlocal nosmartindent
|
setlocal nosmartindent
|
||||||
@@ -323,7 +328,11 @@ function! s:ClosingBracketOnEmptyLine(cline_info) abort
|
|||||||
|
|
||||||
if searchpair(escape(bracket_pair[0], '\['), '', bracket_pair[1], 'bW', s:skip_expr) > 0
|
if searchpair(escape(bracket_pair[0], '\['), '', bracket_pair[1], 'bW', s:skip_expr) > 0
|
||||||
if closing_bracket == ')' && col('.') != col('$') - 1
|
if closing_bracket == ')' && col('.') != col('$') - 1
|
||||||
let ind = virtcol('.') - 1
|
if g:ruby_indent_hanging_elements
|
||||||
|
let ind = virtcol('.') - 1
|
||||||
|
else
|
||||||
|
let ind = indent(line('.'))
|
||||||
|
end
|
||||||
elseif g:ruby_indent_block_style == 'do'
|
elseif g:ruby_indent_block_style == 'do'
|
||||||
let ind = indent(line('.'))
|
let ind = indent(line('.'))
|
||||||
else " g:ruby_indent_block_style == 'expression'
|
else " g:ruby_indent_block_style == 'expression'
|
||||||
@@ -548,7 +557,9 @@ function! s:AfterUnbalancedBracket(pline_info) abort
|
|||||||
let [opening, closing] = s:ExtraBrackets(info.plnum)
|
let [opening, closing] = s:ExtraBrackets(info.plnum)
|
||||||
|
|
||||||
if opening.pos != -1
|
if opening.pos != -1
|
||||||
if opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
if !g:ruby_indent_hanging_elements
|
||||||
|
return indent(info.plnum) + info.sw
|
||||||
|
elseif opening.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
||||||
if col('.') + 1 == col('$')
|
if col('.') + 1 == col('$')
|
||||||
return indent(info.plnum) + info.sw
|
return indent(info.plnum) + info.sw
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -49,6 +49,16 @@ function! TerraformIndent(lnum)
|
|||||||
let thisindent -= &shiftwidth
|
let thisindent -= &shiftwidth
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" If the previous line starts a block comment /*, increase by one
|
||||||
|
if prevline =~# '/\*'
|
||||||
|
let thisindent += 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If the previous line ends a block comment */, decrease by one
|
||||||
|
if prevline =~# '\*/'
|
||||||
|
let thisindent -= 1
|
||||||
|
endif
|
||||||
|
|
||||||
return thisindent
|
return thisindent
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_st
|
|||||||
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
||||||
|
|
||||||
" Regex that defines continuation lines, not including (, {, or [.
|
" Regex that defines continuation lines, not including (, {, or [.
|
||||||
let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\|[^=]=[^=].*,\)' . s:line_term
|
let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\|[^=]=[^=]\)' . s:line_term
|
||||||
|
|
||||||
" Regex that defines continuation lines.
|
" Regex that defines continuation lines.
|
||||||
" TODO: this needs to deal with if ...: and so on
|
" TODO: this needs to deal with if ...: and so on
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ setlocal nolisp
|
|||||||
setlocal autoindent
|
setlocal autoindent
|
||||||
setlocal indentexpr=VlangIndent(v:lnum)
|
setlocal indentexpr=VlangIndent(v:lnum)
|
||||||
setlocal indentkeys+=<:>,0=},0=)
|
setlocal indentkeys+=<:>,0=},0=)
|
||||||
|
setlocal noexpandtab
|
||||||
|
|
||||||
if exists("*VlangIndent")
|
if exists("*VlangIndent")
|
||||||
finish
|
finish
|
||||||
|
|||||||
80
indent/zig.vim
Normal file
80
indent/zig.vim
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'zig') == -1
|
||||||
|
|
||||||
|
" indent/zig.vim
|
||||||
|
|
||||||
|
" Only load this indent file when no other was loaded.
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
if (!has("cindent") || !has("eval"))
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
setlocal cindent
|
||||||
|
|
||||||
|
" L0 -> 0 indent for jump labels (i.e. case statement in c).
|
||||||
|
" j1 -> indenting for "javascript object declarations"
|
||||||
|
" J1 -> see j1
|
||||||
|
" w1 -> starting a new line with `(` at the same indent as `(`
|
||||||
|
" m1 -> if `)` starts a line, match its indent with the first char of its
|
||||||
|
" matching `(` line
|
||||||
|
" (s -> use one indent, when starting a new line after a trailing `(`
|
||||||
|
setlocal cinoptions=L0,m1,(s,j1,J1,l1
|
||||||
|
|
||||||
|
" cinkeys: controls what keys trigger indent formatting
|
||||||
|
" 0{ -> {
|
||||||
|
" 0} -> }
|
||||||
|
" 0) -> )
|
||||||
|
" 0] -> ]
|
||||||
|
" !^F -> make CTRL-F (^F) reindent the current line when typed
|
||||||
|
" o -> when <CR> or `o` is used
|
||||||
|
" O -> when the `O` command is used
|
||||||
|
setlocal cinkeys=0{,0},0),0],!^F,o,O
|
||||||
|
|
||||||
|
setlocal indentexpr=GetZigIndent(v:lnum)
|
||||||
|
|
||||||
|
function! GetZigIndent(lnum)
|
||||||
|
let curretLineNum = a:lnum
|
||||||
|
let currentLine = getline(a:lnum)
|
||||||
|
|
||||||
|
" cindent doesn't handle multi-line strings properly, so force no indent
|
||||||
|
if currentLine =~ '^\s*\\\\.*'
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
let prevLineNum = prevnonblank(a:lnum-1)
|
||||||
|
let prevLine = getline(prevLineNum)
|
||||||
|
|
||||||
|
" for lines that look line
|
||||||
|
" },
|
||||||
|
" };
|
||||||
|
" try treat them the same as a }
|
||||||
|
if prevLine =~ '\v^\s*},$'
|
||||||
|
if currentLine =~ '\v^\s*};$' || currentLine =~ '\v^\s*}$'
|
||||||
|
return indent(prevLineNum) - 4
|
||||||
|
endif
|
||||||
|
return indent(prevLineNum-1) - 4
|
||||||
|
endif
|
||||||
|
if currentLine =~ '\v^\s*},$'
|
||||||
|
return indent(prevLineNum) - 4
|
||||||
|
endif
|
||||||
|
if currentLine =~ '\v^\s*};$'
|
||||||
|
return indent(prevLineNum) - 4
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" cindent doesn't handle this case correctly:
|
||||||
|
" switch (1): {
|
||||||
|
" 1 => true,
|
||||||
|
" ~
|
||||||
|
" ^---- indents to here
|
||||||
|
if prevLine =~ '.*=>.*,$' && currentLine !~ '.*}$'
|
||||||
|
return indent(prevLineNum)
|
||||||
|
endif
|
||||||
|
|
||||||
|
return cindent(a:lnum)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)
|
|
||||||
|
|
||||||
%%CONTENT%%
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
require 'spec_helper'
|
|
||||||
require 'timeout'
|
|
||||||
|
|
||||||
describe "My Vim plugin" do
|
|
||||||
|
|
||||||
extensions = `cat ftdetect/polyglot.vim | grep '^au' | tr "\t" ' ' | cut -d ' ' -f 3 | grep -v / | grep -v '^\*$' | grep -v '^$'`.strip
|
|
||||||
|
|
||||||
extensions.gsub!(/\[(.).+\]/) { $1 }.gsub!('*', 'test')
|
|
||||||
|
|
||||||
extensions = extensions.split(/[\n,]/)
|
|
||||||
|
|
||||||
extensions.sort!.uniq!.each do |ext|
|
|
||||||
if ext.match?(/^[a-z\.]+$/i)
|
|
||||||
it "should parse #{ext} file" do
|
|
||||||
Timeout::timeout(20) do
|
|
||||||
write_file "#{ext}", ""
|
|
||||||
vim.edit "#{ext}"
|
|
||||||
vim.insert "sample"
|
|
||||||
vim.write
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
after(:all) do
|
|
||||||
vim.kill
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
require 'vimrunner'
|
|
||||||
require 'vimrunner/rspec'
|
|
||||||
|
|
||||||
$plugin_path = File.expand_path('../..', __FILE__)
|
|
||||||
|
|
||||||
Vimrunner::RSpec.configure do |config|
|
|
||||||
config.reuse_server = false
|
|
||||||
|
|
||||||
# Decide how to start a Vim instance. In this block, an instance should be
|
|
||||||
# spawned and set up with anything project-specific.
|
|
||||||
config.start_vim do
|
|
||||||
vim = Vimrunner.start
|
|
||||||
|
|
||||||
# Setup your plugin in the Vim instance
|
|
||||||
vim.add_plugin($plugin_path)
|
|
||||||
|
|
||||||
# The returned value is the Client available in the tests.
|
|
||||||
vim
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jenkins') == -1
|
|||||||
runtime syntax/groovy.vim
|
runtime syntax/groovy.vim
|
||||||
syn keyword jenkinsfileBuiltInVariable currentBuild
|
syn keyword jenkinsfileBuiltInVariable currentBuild
|
||||||
|
|
||||||
syn keyword jenkinsfileSection pipeline agent stages steps
|
syn keyword jenkinsfileSection pipeline agent stages steps post
|
||||||
|
|
||||||
syn keyword jenkinsfileDirective environment options parameters triggers stage tools input when libraries
|
syn keyword jenkinsfileDirective environment options parameters triggers stage tools input when libraries
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ syn region jenkinsfileOptionParams contained start='(' end=')' transparent cont
|
|||||||
syn match jenkinsfileOptionO /[a-zA-Z]\+([^)]*)/ contains=jenkinsfileOption,jenkinsfileOptionParams transparent containedin=groovyParenT1
|
syn match jenkinsfileOptionO /[a-zA-Z]\+([^)]*)/ contains=jenkinsfileOption,jenkinsfileOptionParams transparent containedin=groovyParenT1
|
||||||
|
|
||||||
syn keyword jenkinsfileCoreStep checkout
|
syn keyword jenkinsfileCoreStep checkout
|
||||||
syn keyword jenkinsfileCoreStep docker skipwhite nextgroup=jenkinsFileDockerConfigBlock
|
syn keyword jenkinsfileCoreStep docker dockerfile skipwhite nextgroup=jenkinsFileDockerConfigBlock
|
||||||
syn keyword jenkinsfileCoreStep node
|
syn keyword jenkinsfileCoreStep node
|
||||||
syn keyword jenkinsfileCoreStep scm
|
syn keyword jenkinsfileCoreStep scm
|
||||||
syn keyword jenkinsfileCoreStep sh
|
syn keyword jenkinsfileCoreStep sh
|
||||||
@@ -24,10 +24,10 @@ syn keyword jenkinsfileCoreStep step
|
|||||||
syn keyword jenkinsfileCoreStep tool
|
syn keyword jenkinsfileCoreStep tool
|
||||||
|
|
||||||
" TODO: These should probably be broken out.
|
" TODO: These should probably be broken out.
|
||||||
syn keyword jenkinsfileCoreStep post always changed failure success unstable aborted
|
syn keyword jenkinsfileCoreStep always changed failure success unstable aborted unsuccessful regression fixed cleanup
|
||||||
|
|
||||||
syn region jenkinsFileDockerConfigBlock contained start='{' end='}' contains=groovyString,jenkinsfileDockerKeyword transparent
|
syn region jenkinsFileDockerConfigBlock contained start='{' end='}' contains=groovyString,jenkinsfileDockerKeyword transparent
|
||||||
syn keyword jenkinsFileDockerKeyword contained image args dockerfile additionalBuildArgs
|
syn keyword jenkinsFileDockerKeyword contained image args additionalBuildArgs label registryUrl registryCredentialsId alwaysPull filename dir
|
||||||
|
|
||||||
syn keyword jenkinsfilePipelineStep Applitools ArtifactoryGradleBuild Consul MavenDescriptorStep OneSky VersionNumber
|
syn keyword jenkinsfilePipelineStep Applitools ArtifactoryGradleBuild Consul MavenDescriptorStep OneSky VersionNumber
|
||||||
syn keyword jenkinsfilePipelineStep ViolationsToBitbucketServer ViolationsToGitHub ViolationsToGitLab _OcAction _OcContextInit
|
syn keyword jenkinsfilePipelineStep ViolationsToBitbucketServer ViolationsToGitHub ViolationsToGitLab _OcAction _OcContextInit
|
||||||
@@ -112,8 +112,8 @@ syn keyword jenkinsfilePipelineStep walk waptProReport warnings whitesource winR
|
|||||||
syn keyword jenkinsfilePipelineStep withCredentials withDockerContainer withDockerRegistry withDockerServer withEnv withKafkaLog
|
syn keyword jenkinsfilePipelineStep withCredentials withDockerContainer withDockerRegistry withDockerServer withEnv withKafkaLog
|
||||||
syn keyword jenkinsfilePipelineStep withKubeConfig withMaven withNPM withPod withPythonEnv withSCM withSandbox withSonarQubeEnv
|
syn keyword jenkinsfilePipelineStep withKubeConfig withMaven withNPM withPod withPythonEnv withSCM withSandbox withSonarQubeEnv
|
||||||
syn keyword jenkinsfilePipelineStep withTypetalk wrap writeFile writeJSON writeMavenPom writeProperties writeXml writeYaml
|
syn keyword jenkinsfilePipelineStep withTypetalk wrap writeFile writeJSON writeMavenPom writeProperties writeXml writeYaml
|
||||||
syn keyword jenkinsfilePipelineStep ws xUnitImporter xUnitUploader xldCreatePackage xldDeploy xldPublishPackage xlrCreateRelease
|
syn keyword jenkinsfilePipelineStep ws xUnitImporter xUnitUploader xunit xldCreatePackage xldDeploy xldPublishPackage
|
||||||
syn keyword jenkinsfilePipelineStep xrayScanBuild zip
|
syn keyword jenkinsfilePipelineStep xlrCreateRelease xrayScanBuild zip
|
||||||
|
|
||||||
hi link jenkinsfileSection Statement
|
hi link jenkinsfileSection Statement
|
||||||
hi link jenkinsfileDirective jenkinsfileSection
|
hi link jenkinsfileDirective jenkinsfileSection
|
||||||
|
|||||||
@@ -103,6 +103,13 @@ else
|
|||||||
highlight default link ansible_with_keywords Statement
|
highlight default link ansible_with_keywords Statement
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
execute 'syn keyword ansible_with_keywords loop containedin='.s:yamlKey.' contained'
|
||||||
|
if exists("g:ansible_with_keywords_highlight")
|
||||||
|
execute 'highlight link ansible_with_keywords '.g:ansible_with_keywords_highlight
|
||||||
|
else
|
||||||
|
highlight default link ansible_with_keywords Statement
|
||||||
|
endif
|
||||||
|
|
||||||
let b:current_syntax = "ansible"
|
let b:current_syntax = "ansible"
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ endif
|
|||||||
syn keyword arduinoFunc Wire1
|
syn keyword arduinoFunc Wire1
|
||||||
"}}}
|
"}}}
|
||||||
"C:/Program Files (x86)/Arduino\lib\keywords.txt{{{
|
"C:/Program Files (x86)/Arduino\lib\keywords.txt{{{
|
||||||
syn keyword arduinoConstant HIGH LOW INPUT INPUT_PULLUP OUTPUT DEC BIN HEX OCT PI
|
syn keyword arduinoConstant HIGH LOW INPUT INPUT_PULLUP INPUT_PULLDOWN OUTPUT DEC BIN HEX OCT PI
|
||||||
syn keyword arduinoConstant HALF_PI TWO_PI LSBFIRST MSBFIRST CHANGE FALLING RISING DEFAULT EXTERNAL INTERNAL
|
syn keyword arduinoConstant HALF_PI TWO_PI LSBFIRST MSBFIRST CHANGE FALLING RISING DEFAULT EXTERNAL INTERNAL
|
||||||
syn keyword arduinoConstant INTERNAL1V1 INTERNAL2V56
|
syn keyword arduinoConstant INTERNAL1V1 INTERNAL2V56
|
||||||
syn keyword arduinoType boolean break byte case char class const continue default do
|
syn keyword arduinoType boolean break byte case char class const continue default do
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ syntax region typescriptArrowFuncArg contained start=/<\|(/ end=/\ze=>
|
|||||||
syntax region typescriptReturnAnnotation contained start=/:/ end=/{/me=e-1 contains=@typescriptType nextgroup=typescriptBlock
|
syntax region typescriptReturnAnnotation contained start=/:/ end=/{/me=e-1 contains=@typescriptType nextgroup=typescriptBlock
|
||||||
|
|
||||||
|
|
||||||
syntax region typescriptFuncImpl contained start=/function/ end=/{/me=e-1
|
syntax region typescriptFuncImpl contained start=/function\>/ end=/{/me=e-1
|
||||||
\ contains=typescriptFuncKeyword
|
\ contains=typescriptFuncKeyword
|
||||||
\ nextgroup=typescriptBlock
|
\ nextgroup=typescriptBlock
|
||||||
|
|
||||||
|
|||||||
@@ -30,4 +30,54 @@ syntax region typescriptFuncCallArg contained matchgroup=typescriptPa
|
|||||||
syntax region typescriptEventFuncCallArg contained matchgroup=typescriptParens start=/(/ end=/)/ contains=@typescriptEventExpression
|
syntax region typescriptEventFuncCallArg contained matchgroup=typescriptParens start=/(/ end=/)/ contains=@typescriptEventExpression
|
||||||
syntax region typescriptEventString contained start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ contains=typescriptASCII,@events
|
syntax region typescriptEventString contained start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ contains=typescriptASCII,@events
|
||||||
|
|
||||||
|
syntax region typescriptDestructureString
|
||||||
|
\ start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/
|
||||||
|
\ contains=typescriptASCII
|
||||||
|
\ nextgroup=typescriptDestructureAs
|
||||||
|
\ contained skipwhite skipempty
|
||||||
|
|
||||||
|
syntax cluster typescriptVariableDeclarations
|
||||||
|
\ contains=typescriptVariableDeclaration,@typescriptDestructures
|
||||||
|
|
||||||
|
syntax match typescriptVariableDeclaration /[A-Za-z_$]\k*/
|
||||||
|
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
|
||||||
|
\ contained skipwhite skipempty
|
||||||
|
|
||||||
|
syntax cluster typescriptDestructureVariables contains=
|
||||||
|
\ typescriptRestOrSpread,
|
||||||
|
\ typescriptDestructureComma,
|
||||||
|
\ typescriptDestructureLabel,
|
||||||
|
\ typescriptDestructureVariable,
|
||||||
|
\ @typescriptDestructures
|
||||||
|
|
||||||
|
syntax match typescriptDestructureVariable /[A-Za-z_$]\k*/ contained
|
||||||
|
\ nextgroup=typescriptDefaultParam
|
||||||
|
\ contained skipwhite skipempty
|
||||||
|
|
||||||
|
syntax match typescriptDestructureLabel /[A-Za-z_$]\k*\ze\_s*:/
|
||||||
|
\ nextgroup=typescriptDestructureAs
|
||||||
|
\ contained skipwhite skipempty
|
||||||
|
|
||||||
|
syntax match typescriptDestructureAs /:/
|
||||||
|
\ nextgroup=typescriptDestructureVariable,@typescriptDestructures
|
||||||
|
\ contained skipwhite skipempty
|
||||||
|
|
||||||
|
syntax match typescriptDestructureComma /,/ contained
|
||||||
|
|
||||||
|
syntax cluster typescriptDestructures contains=
|
||||||
|
\ typescriptArrayDestructure,
|
||||||
|
\ typescriptObjectDestructure
|
||||||
|
|
||||||
|
syntax region typescriptArrayDestructure matchgroup=typescriptBraces
|
||||||
|
\ start=/\[/ end=/]/
|
||||||
|
\ contains=@typescriptDestructureVariables,@typescriptComments
|
||||||
|
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
|
||||||
|
\ transparent contained skipwhite skipempty fold
|
||||||
|
|
||||||
|
syntax region typescriptObjectDestructure matchgroup=typescriptBraces
|
||||||
|
\ start=/{/ end=/}/
|
||||||
|
\ contains=typescriptDestructureString,@typescriptDestructureVariables,@typescriptComments
|
||||||
|
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
|
||||||
|
\ transparent contained skipwhite skipempty fold
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -29,16 +29,12 @@ syntax keyword typescriptIdentifier arguments this super
|
|||||||
\ nextgroup=@afterIdentifier
|
\ nextgroup=@afterIdentifier
|
||||||
|
|
||||||
syntax keyword typescriptVariable let var
|
syntax keyword typescriptVariable let var
|
||||||
\ nextgroup=typescriptVariableDeclaration
|
\ nextgroup=@typescriptVariableDeclarations
|
||||||
\ skipwhite skipempty skipnl
|
\ skipwhite skipempty
|
||||||
|
|
||||||
syntax keyword typescriptVariable const
|
syntax keyword typescriptVariable const
|
||||||
\ nextgroup=typescriptEnum,typescriptVariableDeclaration
|
\ nextgroup=typescriptEnum,@typescriptVariableDeclarations
|
||||||
\ skipwhite
|
\ skipwhite skipempty
|
||||||
|
|
||||||
syntax match typescriptVariableDeclaration /[A-Za-z_$]\k*/
|
|
||||||
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
|
|
||||||
\ contained skipwhite skipempty skipnl
|
|
||||||
|
|
||||||
syntax region typescriptEnum matchgroup=typescriptEnumKeyword start=/enum / end=/\ze{/
|
syntax region typescriptEnum matchgroup=typescriptEnumKeyword start=/enum / end=/\ze{/
|
||||||
\ nextgroup=typescriptBlock
|
\ nextgroup=typescriptBlock
|
||||||
|
|||||||
@@ -16,10 +16,12 @@ syntax match typescriptBinaryOp contained /===\?/ nextgroup=@typescriptValue s
|
|||||||
syntax match typescriptBinaryOp contained />\(>>=\|>>\|>=\|>\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
syntax match typescriptBinaryOp contained />\(>>=\|>>\|>=\|>\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||||
" 4: <<=, <<, <=, <
|
" 4: <<=, <<, <=, <
|
||||||
syntax match typescriptBinaryOp contained /<\(<=\|<\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
syntax match typescriptBinaryOp contained /<\(<=\|<\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||||
" 3: ||, |=, |
|
" 3: ||, |=, |, ||=
|
||||||
syntax match typescriptBinaryOp contained /|\(|\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
syntax match typescriptBinaryOp contained /||\?=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||||
" 3: &&, &=, &
|
" 4: &&, &=, &, &&=
|
||||||
syntax match typescriptBinaryOp contained /&\(&\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
syntax match typescriptBinaryOp contained /&&\?=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||||
|
" 2: ??, ??=
|
||||||
|
syntax match typescriptBinaryOp contained /??=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||||
" 2: *=, *
|
" 2: *=, *
|
||||||
syntax match typescriptBinaryOp contained /\*=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
syntax match typescriptBinaryOp contained /\*=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||||
" 2: %=, %
|
" 2: %=, %
|
||||||
|
|||||||
@@ -94,9 +94,12 @@ syntax cluster typescriptTypeMember contains=
|
|||||||
\ typescriptIndexSignature,
|
\ typescriptIndexSignature,
|
||||||
\ @typescriptMembers
|
\ @typescriptMembers
|
||||||
|
|
||||||
|
syntax match typescriptTupleLable /\K\k*?\?:/
|
||||||
|
\ contained
|
||||||
|
|
||||||
syntax region typescriptTupleType matchgroup=typescriptBraces
|
syntax region typescriptTupleType matchgroup=typescriptBraces
|
||||||
\ start=/\[/ end=/\]/
|
\ start=/\[/ end=/\]/
|
||||||
\ contains=@typescriptType,@typescriptComments
|
\ contains=@typescriptType,@typescriptComments,typescriptRestOrSpread,typescriptTupleLable
|
||||||
\ contained skipwhite
|
\ contained skipwhite
|
||||||
|
|
||||||
syntax cluster typescriptTypeOperator
|
syntax cluster typescriptTypeOperator
|
||||||
@@ -158,6 +161,7 @@ syntax match typescriptTypeAnnotation /:/
|
|||||||
syntax cluster typescriptParameterList contains=
|
syntax cluster typescriptParameterList contains=
|
||||||
\ typescriptTypeAnnotation,
|
\ typescriptTypeAnnotation,
|
||||||
\ typescriptAccessibilityModifier,
|
\ typescriptAccessibilityModifier,
|
||||||
|
\ typescriptReadonlyModifier,
|
||||||
\ typescriptOptionalMark,
|
\ typescriptOptionalMark,
|
||||||
\ typescriptRestOrSpread,
|
\ typescriptRestOrSpread,
|
||||||
\ typescriptFuncComma,
|
\ typescriptFuncComma,
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ if exists("did_typescript_hilink")
|
|||||||
HiLink typescriptStringMember String
|
HiLink typescriptStringMember String
|
||||||
HiLink typescriptTemplate String
|
HiLink typescriptTemplate String
|
||||||
HiLink typescriptEventString String
|
HiLink typescriptEventString String
|
||||||
|
HiLink typescriptDestructureString String
|
||||||
HiLink typescriptASCII Special
|
HiLink typescriptASCII Special
|
||||||
HiLink typescriptTemplateSB Label
|
HiLink typescriptTemplateSB Label
|
||||||
HiLink typescriptRegexpString String
|
HiLink typescriptRegexpString String
|
||||||
@@ -87,6 +88,7 @@ if exists("did_typescript_hilink")
|
|||||||
HiLink typescriptBranch Conditional
|
HiLink typescriptBranch Conditional
|
||||||
HiLink typescriptIdentifier Structure
|
HiLink typescriptIdentifier Structure
|
||||||
HiLink typescriptVariable Identifier
|
HiLink typescriptVariable Identifier
|
||||||
|
HiLink typescriptDestructureVariable PreProc
|
||||||
HiLink typescriptEnumKeyword Identifier
|
HiLink typescriptEnumKeyword Identifier
|
||||||
HiLink typescriptRepeat Repeat
|
HiLink typescriptRepeat Repeat
|
||||||
HiLink typescriptForOperator Repeat
|
HiLink typescriptForOperator Repeat
|
||||||
@@ -100,7 +102,9 @@ if exists("did_typescript_hilink")
|
|||||||
HiLink typescriptNumber Number
|
HiLink typescriptNumber Number
|
||||||
HiLink typescriptBoolean Boolean
|
HiLink typescriptBoolean Boolean
|
||||||
HiLink typescriptObjectLabel typescriptLabel
|
HiLink typescriptObjectLabel typescriptLabel
|
||||||
|
HiLink typescriptDestructureLabel Function
|
||||||
HiLink typescriptLabel Label
|
HiLink typescriptLabel Label
|
||||||
|
HiLink typescriptTupleLable Label
|
||||||
HiLink typescriptStringProperty String
|
HiLink typescriptStringProperty String
|
||||||
HiLink typescriptImport Special
|
HiLink typescriptImport Special
|
||||||
HiLink typescriptImportType Special
|
HiLink typescriptImportType Special
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||||
|
|
||||||
" Language: Crystal
|
" Language: Crystal
|
||||||
" Maintainer: rhysd <https://rhysd.github.io>
|
" Maintainer:
|
||||||
|
" rhysd <https://rhysd.github.io>
|
||||||
|
" Jeffrey Crochet <jlcrochet@pm.me>
|
||||||
"
|
"
|
||||||
" Based on Ruby syntax highlight
|
" Based on Ruby syntax highlight
|
||||||
" which was made by Mirko Nasato and Doug Kearns
|
" which was made by Mirko Nasato and Doug Kearns
|
||||||
@@ -148,6 +150,7 @@ syn match crystalModuleName "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w
|
|||||||
syn match crystalStructName "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
syn match crystalStructName "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
||||||
syn match crystalLibName "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
syn match crystalLibName "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
||||||
syn match crystalEnumName "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
syn match crystalEnumName "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
||||||
|
syn match crystalAnnotationName "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
||||||
syn match crystalConstant "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@="
|
syn match crystalConstant "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@="
|
||||||
syn match crystalClassVariable "@@\%(\h\|%\|[^\x00-\x7F]\)\%(\w\|%\|[^\x00-\x7F]\)*" display
|
syn match crystalClassVariable "@@\%(\h\|%\|[^\x00-\x7F]\)\%(\w\|%\|[^\x00-\x7F]\)*" display
|
||||||
syn match crystalInstanceVariable "@\%(\h\|%\|[^\x00-\x7F]\)\%(\w\|%\|[^\x00-\x7F]\)*" display
|
syn match crystalInstanceVariable "@\%(\h\|%\|[^\x00-\x7F]\)\%(\w\|%\|[^\x00-\x7F]\)*" display
|
||||||
@@ -180,7 +183,7 @@ syn match crystalPredefinedConstant "\%(\%(\.\@1<!\.\)\@2<!\|::\)\_s*\zs\%(STDER
|
|||||||
syn match crystalPredefinedConstant "\%(\%(\.\@1<!\.\)\@2<!\|::\)\_s*\zs\%(crystal_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!"
|
syn match crystalPredefinedConstant "\%(\%(\.\@1<!\.\)\@2<!\|::\)\_s*\zs\%(crystal_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!"
|
||||||
|
|
||||||
" Normal Regular Expression
|
" Normal Regular Expression
|
||||||
SynFold '/' syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|ifdef\|when\|not\|then\|else\)\|[;\~=!|&(,[<>?:*+-]\)\s*\)\@<=/" end="/[imx]*" skip="\\\\\|\\/" contains=@crystalRegexpSpecial
|
SynFold '/' syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|ifdef\|when\|in\|not\|then\|else\)\|[;\~=!|&(,[<>?:*+-]\)\s*\)\@<=/" end="/[imx]*" skip="\\\\\|\\/" contains=@crystalRegexpSpecial
|
||||||
SynFold '/' syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=/]\@!" end="/[imx]*" skip="\\\\\|\\/" contains=@crystalRegexpSpecial
|
SynFold '/' syn region crystalRegexp matchgroup=crystalRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=/]\@!" end="/[imx]*" skip="\\\\\|\\/" contains=@crystalRegexpSpecial
|
||||||
|
|
||||||
" Generalized Regular Expression
|
" Generalized Regular Expression
|
||||||
@@ -245,53 +248,56 @@ SynFold '<<' syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\
|
|||||||
SynFold '<<' syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-`\z([^`]*\)`\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart,@crystalStringSpecial keepend
|
SynFold '<<' syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-`\z([^`]*\)`\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart,@crystalStringSpecial keepend
|
||||||
|
|
||||||
" Module, Class, Method, and Alias Declarations
|
" Module, Class, Method, and Alias Declarations
|
||||||
syn match crystalAliasDeclaration "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable nextgroup=crystalAliasDeclaration2 skipwhite
|
syn match crystalAliasDeclaration "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable nextgroup=crystalAliasDeclaration2 skipwhite
|
||||||
syn match crystalAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable
|
syn match crystalAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable
|
||||||
syn match crystalMethodDeclaration "[^[:space:];#(]\+" contained contains=crystalConstant,crystalFunction,crystalBoolean,crystalPseudoVariable,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable
|
syn match crystalMethodDeclaration "[^[:space:];#(]\+" contained contains=crystalConstant,crystalFunction,crystalBoolean,crystalPseudoVariable,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable
|
||||||
syn match crystalFunctionDeclaration "[^[:space:];#(=]\+" contained contains=crystalFunction
|
syn match crystalFunctionDeclaration "[^[:space:];#(=]\+" contained contains=crystalFunction
|
||||||
syn match crystalTypeDeclaration "[^[:space:];#=]\+" contained contains=crystalTypeName
|
syn match crystalTypeDeclaration "[^[:space:];#=]\+" contained contains=crystalTypeName
|
||||||
syn match crystalClassDeclaration "[^[:space:];#<]\+" contained contains=crystalClassName,crystalOperator
|
syn match crystalClassDeclaration "[^[:space:];#<]\+" contained contains=crystalClassName,crystalOperator
|
||||||
syn match crystalModuleDeclaration "[^[:space:];#]\+" contained contains=crystalModuleName,crystalOperator
|
syn match crystalModuleDeclaration "[^[:space:];#]\+" contained contains=crystalModuleName,crystalOperator
|
||||||
syn match crystalStructDeclaration "[^[:space:];#<]\+" contained contains=crystalStructName,crystalOperator
|
syn match crystalStructDeclaration "[^[:space:];#<]\+" contained contains=crystalStructName,crystalOperator
|
||||||
syn match crystalLibDeclaration "[^[:space:];#]\+" contained contains=crystalLibName,crystalOperator
|
syn match crystalLibDeclaration "[^[:space:];#]\+" contained contains=crystalLibName,crystalOperator
|
||||||
syn match crystalMacroDeclaration "[^[:space:];#(]\+" contained contains=crystalFunction
|
syn match crystalMacroDeclaration "[^[:space:];#(]\+" contained contains=crystalFunction
|
||||||
syn match crystalEnumDeclaration "[^[:space:];#<\"]\+" contained contains=crystalEnumName
|
syn match crystalEnumDeclaration "[^[:space:];#<\"]\+" contained contains=crystalEnumName
|
||||||
|
syn match crystalAnnotationDeclaration "[^[:space:];#]\+" contained contains=crystalAnnotationName
|
||||||
syn match crystalFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=crystalMethodDeclaration,crystalFunctionDeclaration
|
syn match crystalFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=crystalMethodDeclaration,crystalFunctionDeclaration
|
||||||
syn match crystalFunction "\%(\s\|^\)\@1<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2
|
syn match crystalFunction "\%(\s\|^\)\@1<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2
|
||||||
syn match crystalFunction "\%([[:space:].]\|^\)\@1<=\%(\[\][=?]\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2,crystalMethodDeclaration,crystalFunctionDeclaration
|
syn match crystalFunction "\%([[:space:].]\|^\)\@1<=\%(\[\][=?]\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2,crystalMethodDeclaration,crystalFunctionDeclaration
|
||||||
|
|
||||||
syn cluster crystalDeclaration contains=crystalAliasDeclaration,crystalAliasDeclaration2,crystalMethodDeclaration,crystalFunctionDeclaration,crystalModuleDeclaration,crystalClassDeclaration,crystalStructDeclaration,crystalLibDeclaration,crystalMacroDeclaration,crystalFunction,crystalBlockParameter,crystalTypeDeclaration,crystalEnumDeclaration
|
syn cluster crystalDeclaration contains=crystalAliasDeclaration,crystalAliasDeclaration2,crystalMethodDeclaration,crystalFunctionDeclaration,crystalModuleDeclaration,crystalClassDeclaration,crystalStructDeclaration,crystalLibDeclaration,crystalMacroDeclaration,crystalFunction,crystalBlockParameter,crystalTypeDeclaration,crystalEnumDeclaration,crystalAnnotationDeclaration
|
||||||
|
|
||||||
" Keywords
|
" Keywords
|
||||||
" Note: the following keywords have already been defined:
|
" Note: the following keywords have already been defined:
|
||||||
" begin case class def do end for if module unless until while
|
" begin case class def do end for if module unless until while
|
||||||
syn match crystalControl "\<\%(break\|next\|rescue\|return\)\>[?!]\@!"
|
syn match crystalControl "\<\%(break\|next\|rescue\|return\)\>[?!]\@!"
|
||||||
syn match crystalOperator "\<defined?" display
|
|
||||||
syn match crystalKeyword "\<\%(super\|previous_def\|yield\|of\|with\|uninitialized\|union\)\>[?!]\@!"
|
syn match crystalKeyword "\<\%(super\|previous_def\|yield\|of\|with\|uninitialized\|union\)\>[?!]\@!"
|
||||||
syn match crystalBoolean "\<\%(true\|false\)\>[?!]\@!"
|
syn match crystalBoolean "\<\%(true\|false\)\>[?!]\@!"
|
||||||
syn match crystalPseudoVariable "\<\%(nil\|self\|__DIR__\|__FILE__\|__LINE__\|__END_LINE__\)\>[?!]\@!" " TODO: reorganise
|
syn match crystalPseudoVariable "\<\%(nil\|__DIR__\|__FILE__\|__LINE__\|__END_LINE__\)\>[?!]\@!" " TODO: reorganise
|
||||||
|
syn match crystalPseudoVariable "\<self\>"
|
||||||
|
|
||||||
" Expensive Mode - match 'end' with the appropriate opening keyword for syntax
|
" Expensive Mode - match 'end' with the appropriate opening keyword for syntax
|
||||||
" based folding and special highlighting of module/class/method definitions
|
" based folding and special highlighting of module/class/method definitions
|
||||||
if !exists('b:crystal_no_expensive') && !exists('g:crystal_no_expensive')
|
if !exists('b:crystal_no_expensive') && !exists('g:crystal_no_expensive')
|
||||||
syn match crystalDefine "\<alias\>" nextgroup=crystalAliasDeclaration skipwhite skipnl
|
syn match crystalDefine "\<alias\>" nextgroup=crystalAliasDeclaration skipwhite skipnl
|
||||||
syn match crystalDefine "\<def\>" nextgroup=crystalMethodDeclaration skipwhite skipnl
|
syn match crystalDefine "\<def\>" nextgroup=crystalMethodDeclaration skipwhite skipnl
|
||||||
syn match crystalDefine "\<fun\>" nextgroup=crystalFunctionDeclaration skipwhite skipnl
|
syn match crystalDefine "\<fun\>" nextgroup=crystalFunctionDeclaration skipwhite skipnl
|
||||||
syn match crystalDefine "\<undef\>" nextgroup=crystalFunction skipwhite skipnl
|
syn match crystalDefine "\<undef\>" nextgroup=crystalFunction skipwhite skipnl
|
||||||
syn match crystalDefine "\<\%(type\|alias\)\>\%(\s*\h\w*\s*=\)\@=" nextgroup=crystalTypeDeclaration skipwhite skipnl
|
syn match crystalDefine "\<\%(type\|alias\)\>\%(\s*\h\w*\s*=\)\@=" nextgroup=crystalTypeDeclaration skipwhite skipnl
|
||||||
syn match crystalClass "\<class\>" nextgroup=crystalClassDeclaration skipwhite skipnl
|
syn match crystalClass "\<class\>" nextgroup=crystalClassDeclaration skipwhite skipnl
|
||||||
syn match crystalModule "\<module\>" nextgroup=crystalModuleDeclaration skipwhite skipnl
|
syn match crystalModule "\<module\>" nextgroup=crystalModuleDeclaration skipwhite skipnl
|
||||||
syn match crystalStruct "\<struct\>" nextgroup=crystalStructDeclaration skipwhite skipnl
|
syn match crystalStruct "\<struct\>" nextgroup=crystalStructDeclaration skipwhite skipnl
|
||||||
syn match crystalLib "\<lib\>" nextgroup=crystalLibDeclaration skipwhite skipnl
|
syn match crystalLib "\<lib\>" nextgroup=crystalLibDeclaration skipwhite skipnl
|
||||||
syn match crystalMacro "\<macro\>" nextgroup=crystalMacroDeclaration skipwhite skipnl
|
syn match crystalMacro "\<macro\>" nextgroup=crystalMacroDeclaration skipwhite skipnl
|
||||||
syn match crystalEnum "\<enum\>" nextgroup=crystalEnumDeclaration skipwhite skipnl
|
syn match crystalEnum "\<enum\>" nextgroup=crystalEnumDeclaration skipwhite skipnl
|
||||||
|
syn match crystalAnnotation "\<annotation\>" nextgroup=crystalAnnotationDeclaration skipwhite skipnl
|
||||||
|
|
||||||
SynFold 'def' syn region crystalMethodBlock start="\<\%(def\|macro\)\>" matchgroup=crystalDefine end="\%(\<\%(def\|macro\)\_s\+\)\@<!\<end\>" contains=TOP
|
SynFold 'def' syn region crystalMethodBlock start="\<\%(def\|macro\)\>" matchgroup=crystalDefine end="\%(\<\%(def\|macro\)\_s\+\)\@<!\<end\>" contains=TOP
|
||||||
SynFold 'class' syn region crystalBlock start="\<class\>" matchgroup=crystalClass end="\<end\>" contains=TOP
|
SynFold 'class' syn region crystalBlock start="\<class\>" matchgroup=crystalClass end="\<end\>" contains=TOP
|
||||||
SynFold 'module' syn region crystalBlock start="\<module\>" matchgroup=crystalModule end="\<end\>" contains=TOP
|
SynFold 'module' syn region crystalBlock start="\<module\>" matchgroup=crystalModule end="\<end\>" contains=TOP
|
||||||
SynFold 'struct' syn region crystalBlock start="\<struct\>" matchgroup=crystalStruct end="\<end\>" contains=TOP
|
SynFold 'struct' syn region crystalBlock start="\<struct\>" matchgroup=crystalStruct end="\<end\>" contains=TOP
|
||||||
SynFold 'lib' syn region crystalBlock start="\<lib\>" matchgroup=crystalLib end="\<end\>" contains=TOP
|
SynFold 'lib' syn region crystalBlock start="\<lib\>" matchgroup=crystalLib end="\<end\>" contains=TOP
|
||||||
SynFold 'enum' syn region crystalBlock start="\<enum\>" matchgroup=crystalEnum end="\<end\>" contains=TOP
|
SynFold 'enum' syn region crystalBlock start="\<enum\>" matchgroup=crystalEnum end="\<end\>" contains=TOP
|
||||||
|
SynFold 'annotation' syn region crystalBlock start="\<annotation\>" matchgroup=crystalAnnotation end="\<end\>" contains=TOP
|
||||||
|
|
||||||
" modifiers
|
" modifiers
|
||||||
syn match crystalConditionalModifier "\<\%(if\|unless\|ifdef\)\>" display
|
syn match crystalConditionalModifier "\<\%(if\|unless\|ifdef\)\>" display
|
||||||
@@ -309,7 +315,7 @@ if !exists('b:crystal_no_expensive') && !exists('g:crystal_no_expensive')
|
|||||||
SynFold 'select' syn region crystalSelectExpression matchgroup=crystalConditional start="\<select\>" end="\<end\>" contains=TOP
|
SynFold 'select' syn region crystalSelectExpression matchgroup=crystalConditional start="\<select\>" end="\<end\>" contains=TOP
|
||||||
SynFold 'if' syn region crystalConditionalExpression matchgroup=crystalConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|ifdef\|unless\)\>" end="\%(\%(\%(\.\@1<!\.\)\|::\)\s*\)\@<!\<end\>" contains=TOP
|
SynFold 'if' syn region crystalConditionalExpression matchgroup=crystalConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|ifdef\|unless\)\>" end="\%(\%(\%(\.\@1<!\.\)\|::\)\s*\)\@<!\<end\>" contains=TOP
|
||||||
|
|
||||||
syn match crystalConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=crystalCaseExpression
|
syn match crystalConditional "\<\%(then\|else\|when\|in\)\>[?!]\@!" contained containedin=crystalCaseExpression
|
||||||
syn match crystalConditional "\<\%(when\|else\)\>[?!]\@!" contained containedin=crystalSelectExpression
|
syn match crystalConditional "\<\%(when\|else\)\>[?!]\@!" contained containedin=crystalSelectExpression
|
||||||
syn match crystalConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=crystalConditionalExpression
|
syn match crystalConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=crystalConditionalExpression
|
||||||
|
|
||||||
@@ -324,15 +330,16 @@ if !exists('b:crystal_no_expensive') && !exists('g:crystal_no_expensive')
|
|||||||
exec 'syn sync minlines=' . g:crystal_minlines
|
exec 'syn sync minlines=' . g:crystal_minlines
|
||||||
else
|
else
|
||||||
" Non-expensive mode
|
" Non-expensive mode
|
||||||
syn match crystalControl "\<def\>[?!]\@!" nextgroup=crystalMethodDeclaration skipwhite skipnl
|
syn match crystalControl "\<def\>[?!]\@!" nextgroup=crystalMethodDeclaration skipwhite skipnl
|
||||||
syn match crystalControl "\<fun\>[?!]\@!" nextgroup=crystalFunctionDeclaration skipwhite skipnl
|
syn match crystalControl "\<fun\>[?!]\@!" nextgroup=crystalFunctionDeclaration skipwhite skipnl
|
||||||
syn match crystalControl "\<class\>[?!]\@!" nextgroup=crystalClassDeclaration skipwhite skipnl
|
syn match crystalControl "\<class\>[?!]\@!" nextgroup=crystalClassDeclaration skipwhite skipnl
|
||||||
syn match crystalControl "\<module\>[?!]\@!" nextgroup=crystalModuleDeclaration skipwhite skipnl
|
syn match crystalControl "\<module\>[?!]\@!" nextgroup=crystalModuleDeclaration skipwhite skipnl
|
||||||
syn match crystalControl "\<struct\>[?!]\@!" nextgroup=crystalStructDeclaration skipwhite skipnl
|
syn match crystalControl "\<struct\>[?!]\@!" nextgroup=crystalStructDeclaration skipwhite skipnl
|
||||||
syn match crystalControl "\<lib\>[?!]\@!" nextgroup=crystalLibDeclaration skipwhite skipnl
|
syn match crystalControl "\<lib\>[?!]\@!" nextgroup=crystalLibDeclaration skipwhite skipnl
|
||||||
syn match crystalControl "\<macro\>[?!]\@!" nextgroup=crystalMacroDeclaration skipwhite skipnl
|
syn match crystalControl "\<macro\>[?!]\@!" nextgroup=crystalMacroDeclaration skipwhite skipnl
|
||||||
syn match crystalControl "\<enum\>[?!]\@!" nextgroup=crystalEnumDeclaration skipwhite skipnl
|
syn match crystalControl "\<enum\>[?!]\@!" nextgroup=crystalEnumDeclaration skipwhite skipnl
|
||||||
syn match crystalControl "\<\%(case\|begin\|do\|if\|ifdef\|unless\|while\|until\|else\|elsif\|ensure\|then\|when\|end\)\>[?!]\@!"
|
syn match crystalControl "\<annotation\>[?!]\@!" nextgroup=crystalAnnotationDeclaration skipwhite skipnl
|
||||||
|
syn match crystalControl "\<\%(case\|begin\|do\|if\|ifdef\|unless\|while\|until\|else\|elsif\|ensure\|then\|when\|in\|end\)\>[?!]\@!"
|
||||||
syn match crystalKeyword "\<\%(alias\|undef\)\>[?!]\@!"
|
syn match crystalKeyword "\<\%(alias\|undef\)\>[?!]\@!"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -356,8 +363,8 @@ endif
|
|||||||
|
|
||||||
" Macro
|
" Macro
|
||||||
" Note: This definition must be put after crystalNestedCurlyBraces to give higher priority
|
" Note: This definition must be put after crystalNestedCurlyBraces to give higher priority
|
||||||
syn region crystalMacroRegion matchgroup=crystalMacroDelim start="\\\={%" end="%}" oneline display contains=@crystalMacroGroup containedin=ALL
|
syn region crystalMacroRegion matchgroup=crystalMacroDelim start="\\\={%" end="%}" display oneline contains=@crystalMacroGroup containedin=ALL
|
||||||
syn region crystalMacroRegion matchgroup=crystalMacroDelim start="\\\={{" end="}}" oneline display contains=@crystalMacroGroup containedin=ALL
|
syn region crystalMacroRegion matchgroup=crystalMacroDelim start="\\\={{" end="}}" display contains=TOP containedin=ALL
|
||||||
|
|
||||||
" Cluster for groups that can appear inside macro expressions
|
" Cluster for groups that can appear inside macro expressions
|
||||||
syn cluster crystalMacroGroup contains=@crystalTop
|
syn cluster crystalMacroGroup contains=@crystalTop
|
||||||
@@ -373,8 +380,7 @@ syn cluster crystalMacroGroup remove=@crystalExpensive
|
|||||||
" Some keywords will have to be redefined for them to be highlighted
|
" Some keywords will have to be redefined for them to be highlighted
|
||||||
" properly
|
" properly
|
||||||
syn keyword crystalMacroKeyword contained
|
syn keyword crystalMacroKeyword contained
|
||||||
\ if else elsif end for in begin do case when while until loop
|
\ if unless else elsif end for in do while until loop begin
|
||||||
\ rescue ensure
|
|
||||||
|
|
||||||
syn cluster crystalMacroGroup add=crystalMacroKeyword
|
syn cluster crystalMacroGroup add=crystalMacroKeyword
|
||||||
|
|
||||||
@@ -396,7 +402,7 @@ SynFold '#' syn region crystalMultilineComment start="\%(\%(^\s*#.*\n\)\@<!\%(^\
|
|||||||
syn match crystalKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%(alias\|begin\|break\|case\|class\|def\|defined\|do\|else\|select\)\>" transparent contains=NONE
|
syn match crystalKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%(alias\|begin\|break\|case\|class\|def\|defined\|do\|else\|select\)\>" transparent contains=NONE
|
||||||
syn match crystalKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%(elsif\|end\|ensure\|false\|for\|if\|ifdef\|in\|module\|next\|nil\)\>" transparent contains=NONE
|
syn match crystalKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%(elsif\|end\|ensure\|false\|for\|if\|ifdef\|in\|module\|next\|nil\)\>" transparent contains=NONE
|
||||||
syn match crystalKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%(rescue\|return\|self\|super\|previous_def\|then\|true\)\>" transparent contains=NONE
|
syn match crystalKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%(rescue\|return\|self\|super\|previous_def\|then\|true\)\>" transparent contains=NONE
|
||||||
syn match crystalKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%(undef\|unless\|until\|when\|while\|yield\|with\|__FILE__\|__LINE__\)\>" transparent contains=NONE
|
syn match crystalKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%(undef\|unless\|until\|when\|in\|while\|yield\|with\|__FILE__\|__LINE__\)\>" transparent contains=NONE
|
||||||
|
|
||||||
syn match crystalKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)[?!]" transparent contains=NONE
|
syn match crystalKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)[?!]" transparent contains=NONE
|
||||||
syn match crystalKeywordAsMethod "\<\%(if\|ifdef\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE
|
syn match crystalKeywordAsMethod "\<\%(if\|ifdef\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE
|
||||||
@@ -412,6 +418,7 @@ hi def link crystalModule crystalDefine
|
|||||||
hi def link crystalStruct crystalDefine
|
hi def link crystalStruct crystalDefine
|
||||||
hi def link crystalLib crystalDefine
|
hi def link crystalLib crystalDefine
|
||||||
hi def link crystalEnum crystalDefine
|
hi def link crystalEnum crystalDefine
|
||||||
|
hi def link crystalAnnotation crystalDefine
|
||||||
hi def link crystalMethodExceptional crystalDefine
|
hi def link crystalMethodExceptional crystalDefine
|
||||||
hi def link crystalDefine Define
|
hi def link crystalDefine Define
|
||||||
hi def link crystalFunction Function
|
hi def link crystalFunction Function
|
||||||
@@ -440,6 +447,7 @@ hi def link crystalModuleName crystalConstant
|
|||||||
hi def link crystalStructName crystalConstant
|
hi def link crystalStructName crystalConstant
|
||||||
hi def link crystalLibName crystalConstant
|
hi def link crystalLibName crystalConstant
|
||||||
hi def link crystalEnumName crystalConstant
|
hi def link crystalEnumName crystalConstant
|
||||||
|
hi def link crystalAnnotationName crystalConstant
|
||||||
hi def link crystalGlobalVariable crystalIdentifier
|
hi def link crystalGlobalVariable crystalIdentifier
|
||||||
hi def link crystalBlockParameter crystalIdentifier
|
hi def link crystalBlockParameter crystalIdentifier
|
||||||
hi def link crystalInstanceVariable crystalIdentifier
|
hi def link crystalInstanceVariable crystalIdentifier
|
||||||
@@ -476,7 +484,7 @@ hi def link crystalRegexp crystalString
|
|||||||
hi def link crystalMacro PreProc
|
hi def link crystalMacro PreProc
|
||||||
hi def link crystalMacroDelim crystalMacro
|
hi def link crystalMacroDelim crystalMacro
|
||||||
hi def link crystalMacroKeyword crystalKeyword
|
hi def link crystalMacroKeyword crystalKeyword
|
||||||
hi def link crystalLinkAttrDelim crystalMacro
|
hi def link crystalLinkAttrDelim crystalMacroDelim
|
||||||
hi def link crystalError Error
|
hi def link crystalError Error
|
||||||
hi def link crystalInvalidVariable crystalError
|
hi def link crystalInvalidVariable crystalError
|
||||||
hi def link crystalSpaceError crystalError
|
hi def link crystalSpaceError crystalError
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ syntax keyword dartOperator new is as in
|
|||||||
syntax match dartOperator "+=\=\|-=\=\|*=\=\|/=\=\|%=\=\|\~/=\=\|<<=\=\|>>=\=\|[<>]=\=\|===\=\|\!==\=\|&=\=\|\^=\=\||=\=\|||\|&&\|\[\]=\=\|=>\|!\|\~\|?\|:"
|
syntax match dartOperator "+=\=\|-=\=\|*=\=\|/=\=\|%=\=\|\~/=\=\|<<=\=\|>>=\=\|[<>]=\=\|===\=\|\!==\=\|&=\=\|\^=\=\||=\=\|||\|&&\|\[\]=\=\|=>\|!\|\~\|?\|:"
|
||||||
syntax keyword dartCoreType void var dynamic
|
syntax keyword dartCoreType void var dynamic
|
||||||
syntax keyword dartStatement return
|
syntax keyword dartStatement return
|
||||||
syntax keyword dartStorageClass static abstract final const factory
|
syntax keyword dartStorageClass static abstract final const factory late
|
||||||
syntax keyword dartExceptions throw rethrow try on catch finally
|
syntax keyword dartExceptions throw rethrow try on catch finally
|
||||||
syntax keyword dartAssert assert
|
syntax keyword dartAssert assert
|
||||||
syntax keyword dartClassDecl extends with implements
|
syntax keyword dartClassDecl extends with implements
|
||||||
syntax keyword dartBranch break continue nextgroup=dartUserLabelRef skipwhite
|
syntax keyword dartBranch break continue nextgroup=dartUserLabelRef skipwhite
|
||||||
syntax keyword dartKeyword get set operator call external async await
|
syntax keyword dartKeyword get set operator call external async await
|
||||||
\ yield sync native covariant
|
\ yield sync native covariant required
|
||||||
syntax match dartUserLabelRef "\k\+" contained
|
syntax match dartUserLabelRef "\k\+" contained
|
||||||
|
|
||||||
syntax region dartLabelRegion transparent matchgroup=dartLabel start="\<case\>" matchgroup=NONE end=":"
|
syntax region dartLabelRegion transparent matchgroup=dartLabel start="\<case\>" matchgroup=NONE end=":"
|
||||||
@@ -54,10 +54,10 @@ syntax match dartMetadata "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a
|
|||||||
syntax match dartNumber "\<\d\+\(\.\d\+\)\=\>"
|
syntax match dartNumber "\<\d\+\(\.\d\+\)\=\>"
|
||||||
|
|
||||||
" User Types
|
" User Types
|
||||||
syntax match dartUserType "\<_\?\u[[:alnum:]_\$]*\>"
|
syntax match dartUserType "\<[_$]*\u[a-zA-Z0-9_$]*\>"
|
||||||
|
|
||||||
" Function highlighting
|
" Function highlighting
|
||||||
syntax match dartFunction "\zs\<\(_\?\l[[:alnum:]_\$]*\)\>*\s*\ze("
|
syntax match dartFunction "\zs\<\([_$]*[a-z][a-zA-Z0-9_$]*\)\ze\(<\|(\|\s\+=>\)"
|
||||||
|
|
||||||
" SDK libraries
|
" SDK libraries
|
||||||
syntax keyword dartSdkClass BidirectionalIterator Comparable DateTime
|
syntax keyword dartSdkClass BidirectionalIterator Comparable DateTime
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ if exists('b:current_syntax')
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syntax match dhallInterpolation "\v\$\{([^\}]|\\n)*\}"
|
syntax match dhallInterpolation "\v\$\{([^\}]|\n)*\}"
|
||||||
syntax keyword dhallTodo TODO FIXME
|
syntax keyword dhallTodo TODO FIXME
|
||||||
syntax match dhallBrackets "[<>|]"
|
syntax match dhallBrackets "[<>|]"
|
||||||
syntax match dhallOperator "+\|*\|#"
|
syntax match dhallOperator "+\|*\|#"
|
||||||
@@ -24,7 +24,7 @@ syntax match dhallLabel "\v[a-z_][A-Za-z0-9\-]*"
|
|||||||
syntax match dhallType "\v[a-zA-Z]+\.[A-Z][a-z0-9A-Z_]*"
|
syntax match dhallType "\v[a-zA-Z]+\.[A-Z][a-z0-9A-Z_]*"
|
||||||
syntax match dhallParens "(\|)\|\[\|\]\|,"
|
syntax match dhallParens "(\|)\|\[\|\]\|,"
|
||||||
syntax match dhallRecord "{\|}\|:"
|
syntax match dhallRecord "{\|}\|:"
|
||||||
syntax keyword dhallKeyword let in forall constructors if then else merge env as
|
syntax keyword dhallKeyword let in forall constructors if then else merge env as with
|
||||||
syntax match dhallEsc +\\["\\abfnrtv$/]+
|
syntax match dhallEsc +\\["\\abfnrtv$/]+
|
||||||
syntax match dhallSingleSpecial +'''+
|
syntax match dhallSingleSpecial +'''+
|
||||||
syntax match dhallSingleSpecial +''${+
|
syntax match dhallSingleSpecial +''${+
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ setlocal iskeyword+=$,@-@
|
|||||||
|
|
||||||
" Comments
|
" Comments
|
||||||
syn match erlangComment '%.*$' contains=erlangCommentAnnotation,erlangTodo
|
syn match erlangComment '%.*$' contains=erlangCommentAnnotation,erlangTodo
|
||||||
syn match erlangCommentAnnotation ' \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|private\|equiv\|spec\|throws\)' contained
|
syn match erlangCommentAnnotation ' \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|param\|private\|equiv\|spec\|throws\)' contained
|
||||||
syn match erlangCommentAnnotation /`[^']*'/ contained
|
syn match erlangCommentAnnotation /`[^']*'/ contained
|
||||||
syn keyword erlangTodo TODO FIXME XXX contained
|
syn keyword erlangTodo TODO FIXME XXX contained
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ syn match erlangBitType '\%(\/\%(\s\|\n\|%.*\n\)*\)\@<=\%(integer\|float\|binary
|
|||||||
|
|
||||||
" Constants and Directives
|
" Constants and Directives
|
||||||
syn match erlangUnknownAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\l[[:alnum:]_@]*' contains=erlangComment
|
syn match erlangUnknownAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\l[[:alnum:]_@]*' contains=erlangComment
|
||||||
syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\)\>' contains=erlangComment
|
syn match erlangAttribute '^\s*-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\(_type\)\=\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\|optional_callbacks\)\>' contains=erlangComment
|
||||||
syn match erlangInclude '^\s*-\%(\s\|\n\|%.*\n\)*\%(include\|include_lib\)\>' contains=erlangComment
|
syn match erlangInclude '^\s*-\%(\s\|\n\|%.*\n\)*\%(include\|include_lib\)\>' contains=erlangComment
|
||||||
syn match erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment
|
syn match erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment
|
||||||
syn match erlangDefine '^\s*-\%(\s\|\n\|%.*\n\)*\%(define\|undef\)\>' contains=erlangComment
|
syn match erlangDefine '^\s*-\%(\s\|\n\|%.*\n\)*\%(define\|undef\)\>' contains=erlangComment
|
||||||
|
|||||||
287
syntax/fennel.vim
Normal file
287
syntax/fennel.vim
Normal file
@@ -0,0 +1,287 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fennel') == -1
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: FENNEL
|
||||||
|
" Maintainer: Calvin Rose
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:cpo_sav = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
if has("folding") && exists("g:fennel_fold") && g:fennel_fold > 0
|
||||||
|
setlocal foldmethod=syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
syntax keyword FennelCommentTodo contained FIXME XXX TODO FIXME: XXX: TODO:
|
||||||
|
|
||||||
|
" FENNEL comments
|
||||||
|
syn match FennelComment ";.*$" contains=FennelCommentTodo,@Spell
|
||||||
|
|
||||||
|
syntax match FennelStringEscape '\v\\%([abfnrtv'"\\]|x[[0-9a-fA-F]]\{2}|25[0-5]|2[0-4][0-9]|[0-1][0-9][0-9])' contained
|
||||||
|
syntax region FennelString matchgroup=FennelStringDelimiter start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=FennelStringEscape,@Spell
|
||||||
|
syntax region FennelString matchgroup=FennelStringDelimiter start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=FennelStringEscape,@Spell
|
||||||
|
|
||||||
|
syn keyword FennelConstant nil
|
||||||
|
|
||||||
|
syn keyword FennelBoolean true
|
||||||
|
syn keyword FennelBoolean false
|
||||||
|
|
||||||
|
" Fennel special forms
|
||||||
|
syn keyword FennelSpecialForm #
|
||||||
|
syn keyword FennelSpecialForm %
|
||||||
|
syn keyword FennelSpecialForm *
|
||||||
|
syn keyword FennelSpecialForm +
|
||||||
|
syn keyword FennelSpecialForm -
|
||||||
|
syn keyword FennelSpecialForm ->
|
||||||
|
syn keyword FennelSpecialForm ->>
|
||||||
|
syn keyword FennelSpecialForm -?>
|
||||||
|
syn keyword FennelSpecialForm -?>>
|
||||||
|
syn keyword FennelSpecialForm .
|
||||||
|
syn keyword FennelSpecialForm ..
|
||||||
|
syn keyword FennelSpecialForm /
|
||||||
|
syn keyword FennelSpecialForm //
|
||||||
|
syn keyword FennelSpecialForm :
|
||||||
|
syn keyword FennelSpecialForm <
|
||||||
|
syn keyword FennelSpecialForm <=
|
||||||
|
syn keyword FennelSpecialForm =
|
||||||
|
syn keyword FennelSpecialForm >
|
||||||
|
syn keyword FennelSpecialForm >=
|
||||||
|
syn keyword FennelSpecialForm ^
|
||||||
|
syn keyword FennelSpecialForm and
|
||||||
|
syn keyword FennelSpecialForm comment
|
||||||
|
syn keyword FennelSpecialForm do
|
||||||
|
syn keyword FennelSpecialForm doc
|
||||||
|
syn keyword FennelSpecialForm doto
|
||||||
|
syn keyword FennelSpecialForm each
|
||||||
|
syn keyword FennelSpecialForm eval-compiler
|
||||||
|
syn keyword FennelSpecialForm fn
|
||||||
|
syn keyword FennelSpecialForm for
|
||||||
|
syn keyword FennelSpecialForm global
|
||||||
|
syn keyword FennelSpecialForm hashfn
|
||||||
|
syn keyword FennelSpecialForm if
|
||||||
|
syn keyword FennelSpecialForm include
|
||||||
|
syn keyword FennelSpecialForm lambda
|
||||||
|
syn keyword FennelSpecialForm length
|
||||||
|
syn keyword FennelSpecialForm let
|
||||||
|
syn keyword FennelSpecialForm local
|
||||||
|
syn keyword FennelSpecialForm lua
|
||||||
|
syn keyword FennelSpecialForm macro
|
||||||
|
syn keyword FennelSpecialForm macros
|
||||||
|
syn keyword FennelSpecialForm match
|
||||||
|
syn keyword FennelSpecialForm not
|
||||||
|
syn keyword FennelSpecialForm not=
|
||||||
|
syn keyword FennelSpecialForm or
|
||||||
|
syn keyword FennelSpecialForm partial
|
||||||
|
syn keyword FennelSpecialForm quote
|
||||||
|
syn keyword FennelSpecialForm require-macros
|
||||||
|
syn keyword FennelSpecialForm set
|
||||||
|
syn keyword FennelSpecialForm set-forcibly!
|
||||||
|
syn keyword FennelSpecialForm tset
|
||||||
|
syn keyword FennelSpecialForm values
|
||||||
|
syn keyword FennelSpecialForm var
|
||||||
|
syn keyword FennelSpecialForm when
|
||||||
|
syn keyword FennelSpecialForm while
|
||||||
|
syn keyword FennelSpecialForm ~=
|
||||||
|
syn keyword FennelSpecialForm λ
|
||||||
|
|
||||||
|
" Lua keywords
|
||||||
|
syntax keyword LuaSpecialValue
|
||||||
|
\ _G
|
||||||
|
\ _VERSION
|
||||||
|
\ assert
|
||||||
|
\ collectgarbage
|
||||||
|
\ dofile
|
||||||
|
\ error
|
||||||
|
\ getmetatable
|
||||||
|
\ ipairs
|
||||||
|
\ load
|
||||||
|
\ loadfile
|
||||||
|
\ next
|
||||||
|
\ pairs
|
||||||
|
\ pcall
|
||||||
|
\ print
|
||||||
|
\ rawequal
|
||||||
|
\ rawget
|
||||||
|
\ rawlen
|
||||||
|
\ rawset
|
||||||
|
\ require
|
||||||
|
\ select
|
||||||
|
\ setmetatable
|
||||||
|
\ tonumber
|
||||||
|
\ tostring
|
||||||
|
\ type
|
||||||
|
\ xpcall
|
||||||
|
\ coroutine
|
||||||
|
\ coroutine.create
|
||||||
|
\ coroutine.isyieldable
|
||||||
|
\ coroutine.resume
|
||||||
|
\ coroutine.running
|
||||||
|
\ coroutine.status
|
||||||
|
\ coroutine.wrap
|
||||||
|
\ coroutine.yield
|
||||||
|
\ debug
|
||||||
|
\ debug.debug
|
||||||
|
\ debug.gethook
|
||||||
|
\ debug.getinfo
|
||||||
|
\ debug.getlocal
|
||||||
|
\ debug.getmetatable
|
||||||
|
\ debug.getregistry
|
||||||
|
\ debug.getupvalue
|
||||||
|
\ debug.getuservalue
|
||||||
|
\ debug.sethook
|
||||||
|
\ debug.setlocal
|
||||||
|
\ debug.setmetatable
|
||||||
|
\ debug.setupvalue
|
||||||
|
\ debug.setuservalue
|
||||||
|
\ debug.traceback
|
||||||
|
\ debug.upvalueid
|
||||||
|
\ debug.upvaluejoin
|
||||||
|
\ io
|
||||||
|
\ io.close
|
||||||
|
\ io.flush
|
||||||
|
\ io.input
|
||||||
|
\ io.lines
|
||||||
|
\ io.open
|
||||||
|
\ io.output
|
||||||
|
\ io.popen
|
||||||
|
\ io.read
|
||||||
|
\ io.stderr
|
||||||
|
\ io.stdin
|
||||||
|
\ io.stdout
|
||||||
|
\ io.tmpfile
|
||||||
|
\ io.type
|
||||||
|
\ io.write
|
||||||
|
\ math
|
||||||
|
\ math.abs
|
||||||
|
\ math.acos
|
||||||
|
\ math.asin
|
||||||
|
\ math.atan
|
||||||
|
\ math.ceil
|
||||||
|
\ math.cos
|
||||||
|
\ math.deg
|
||||||
|
\ math.exp
|
||||||
|
\ math.floor
|
||||||
|
\ math.fmod
|
||||||
|
\ math.huge
|
||||||
|
\ math.log
|
||||||
|
\ math.max
|
||||||
|
\ math.maxinteger
|
||||||
|
\ math.min
|
||||||
|
\ math.mininteger
|
||||||
|
\ math.modf
|
||||||
|
\ math.pi
|
||||||
|
\ math.rad
|
||||||
|
\ math.random
|
||||||
|
\ math.randomseed
|
||||||
|
\ math.sin
|
||||||
|
\ math.sqrt
|
||||||
|
\ math.tan
|
||||||
|
\ math.tointeger
|
||||||
|
\ math.type
|
||||||
|
\ math.ult
|
||||||
|
\ os
|
||||||
|
\ os.clock
|
||||||
|
\ os.date
|
||||||
|
\ os.difftime
|
||||||
|
\ os.execute
|
||||||
|
\ os.exit
|
||||||
|
\ os.getenv
|
||||||
|
\ os.remove
|
||||||
|
\ os.rename
|
||||||
|
\ os.setlocale
|
||||||
|
\ os.time
|
||||||
|
\ os.tmpname
|
||||||
|
\ package
|
||||||
|
\ package.config
|
||||||
|
\ package.cpath
|
||||||
|
\ package.loaded
|
||||||
|
\ package.loadlib
|
||||||
|
\ package.path
|
||||||
|
\ package.preload
|
||||||
|
\ package.searchers
|
||||||
|
\ package.searchpath
|
||||||
|
\ string
|
||||||
|
\ string.byte
|
||||||
|
\ string.char
|
||||||
|
\ string.dump
|
||||||
|
\ string.find
|
||||||
|
\ string.format
|
||||||
|
\ string.gmatch
|
||||||
|
\ string.gsub
|
||||||
|
\ string.len
|
||||||
|
\ string.lower
|
||||||
|
\ string.match
|
||||||
|
\ string.pack
|
||||||
|
\ string.packsize
|
||||||
|
\ string.rep
|
||||||
|
\ string.reverse
|
||||||
|
\ string.sub
|
||||||
|
\ string.unpack
|
||||||
|
\ string.upper
|
||||||
|
\ table
|
||||||
|
\ table.concat
|
||||||
|
\ table.insert
|
||||||
|
\ table.move
|
||||||
|
\ table.pack
|
||||||
|
\ table.remove
|
||||||
|
\ table.sort
|
||||||
|
\ table.unpack
|
||||||
|
\ utf8
|
||||||
|
\ utf8.char
|
||||||
|
\ utf8.charpattern
|
||||||
|
\ utf8.codepoint
|
||||||
|
\ utf8.codes
|
||||||
|
\ utf8.len
|
||||||
|
\ utf8.offset
|
||||||
|
|
||||||
|
" Fennel Symbols
|
||||||
|
let s:symcharnodig = '\!\$%\&\#\*\+\-./:<=>?A-Z^_a-z|\x80-\U10FFFF'
|
||||||
|
let s:symchar = '0-9' . s:symcharnodig
|
||||||
|
execute 'syn match FennelSymbol "\v<%([' . s:symcharnodig . '])%([' . s:symchar . '])*>"'
|
||||||
|
execute 'syn match FennelKeyword "\v<:%([' . s:symchar . '])*>"'
|
||||||
|
unlet! s:symchar s:symcharnodig
|
||||||
|
|
||||||
|
syn match FennelQuote "`"
|
||||||
|
syn match FennelQuote "@"
|
||||||
|
|
||||||
|
" FENNEL numbers
|
||||||
|
syntax match FennelNumber "\v\c<[-+]?\d*\.?\d*%([eE][-+]?\d+)?>"
|
||||||
|
syntax match FennelNumber "\v\c<[-+]?0x[0-9A-F]*\.?[0-9A-F]*>"
|
||||||
|
|
||||||
|
" Grammar root
|
||||||
|
syntax cluster FennelTop contains=@Spell,FennelComment,FennelConstant,FennelQuote,FennelKeyword,LuaSpecialValue,FennelSymbol,FennelNumber,FennelString,FennelList,FennelArray,FennelTable,FennelSpecialForm,FennelBoolean
|
||||||
|
|
||||||
|
syntax region FennelList matchgroup=FennelParen start="(" end=")" contains=@FennelTop fold
|
||||||
|
syntax region FennelArray matchgroup=FennelParen start="\[" end="]" contains=@FennelTop fold
|
||||||
|
syntax region FennelTable matchgroup=FennelParen start="{" end="}" contains=@FennelTop fold
|
||||||
|
|
||||||
|
" Highlight superfluous closing parens, brackets and braces.
|
||||||
|
syntax match FennelError "]\|}\|)"
|
||||||
|
|
||||||
|
syntax sync fromstart
|
||||||
|
|
||||||
|
" Highlighting
|
||||||
|
hi def link FennelComment Comment
|
||||||
|
hi def link FennelSymbol Identifier
|
||||||
|
hi def link FennelNumber Number
|
||||||
|
hi def link FennelConstant Constant
|
||||||
|
hi def link FennelKeyword Keyword
|
||||||
|
hi def link FennelSpecialForm Special
|
||||||
|
hi def link LuaSpecialValue Special
|
||||||
|
hi def link FennelString String
|
||||||
|
hi def link FennelBuffer String
|
||||||
|
hi def link FennelStringDelimiter String
|
||||||
|
hi def link FennelBoolean Boolean
|
||||||
|
|
||||||
|
hi def link FennelQuote SpecialChar
|
||||||
|
hi def link FennelParen Delimiter
|
||||||
|
|
||||||
|
let b:current_syntax = "fennel"
|
||||||
|
|
||||||
|
let &cpo = s:cpo_sav
|
||||||
|
unlet! s:cpo_sav
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: generic git output
|
" Language: generic git output
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Last Change: 2010 May 21
|
" Last Change: 2019 Dec 05
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
@@ -27,9 +27,9 @@ syn region gitDiff start=/^\%(@@ -\)\@=/ end=/^\%(diff --\%(git\|cc\|combined\)
|
|||||||
syn region gitDiffMerge start=/^\%(diff --\%(cc\|combined\) \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
|
syn region gitDiffMerge start=/^\%(diff --\%(cc\|combined\) \)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
|
||||||
syn region gitDiffMerge start=/^\%(@@@@* -\)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
|
syn region gitDiffMerge start=/^\%(@@@@* -\)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
|
||||||
syn match gitDiffAdded "^ \++.*" contained containedin=gitDiffMerge
|
syn match gitDiffAdded "^ \++.*" contained containedin=gitDiffMerge
|
||||||
syn match gitDiffAdded "{+.*+}" contained containedin=gitDiff
|
syn match gitDiffAdded "{+[^}]*+}" contained containedin=gitDiff
|
||||||
syn match gitDiffRemoved "^ \+-.*" contained containedin=gitDiffMerge
|
syn match gitDiffRemoved "^ \+-.*" contained containedin=gitDiffMerge
|
||||||
syn match gitDiffRemoved "\[-.*-\]" contained containedin=gitDiff
|
syn match gitDiffRemoved "\[-[^]]*-\]" contained containedin=gitDiff
|
||||||
|
|
||||||
syn match gitKeyword /^\%(object\|type\|tag\|commit\|tree\|parent\|encoding\)\>/ contained containedin=gitHead nextgroup=gitHash,gitType skipwhite
|
syn match gitKeyword /^\%(object\|type\|tag\|commit\|tree\|parent\|encoding\)\>/ contained containedin=gitHead nextgroup=gitHash,gitType skipwhite
|
||||||
syn match gitKeyword /^\%(tag\>\|ref:\)/ contained containedin=gitHead nextgroup=gitReference skipwhite
|
syn match gitKeyword /^\%(tag\>\|ref:\)/ contained containedin=gitHead nextgroup=gitReference skipwhite
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
|||||||
" Language: git commit file
|
" Language: git commit file
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Filenames: *.git/COMMIT_EDITMSG
|
" Filenames: *.git/COMMIT_EDITMSG
|
||||||
" Last Change: 2016 Aug 29
|
" Last Change: 2019 Dec 05
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
@@ -32,6 +32,7 @@ else
|
|||||||
syn match gitcommitComment "^#.*"
|
syn match gitcommitComment "^#.*"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
syn match gitcommitHash "\<\x\{40,}\>" contains=@NoSpell display
|
||||||
syn match gitcommitHead "^\%(# .*\n\)\+#$" contained transparent
|
syn match gitcommitHead "^\%(# .*\n\)\+#$" contained transparent
|
||||||
syn match gitcommitOnBranch "\%(^# \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
|
syn match gitcommitOnBranch "\%(^# \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
|
||||||
syn match gitcommitOnBranch "\%(^# \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
|
syn match gitcommitOnBranch "\%(^# \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
|
||||||
@@ -69,6 +70,7 @@ hi def link gitcommitUntracked gitcommitComment
|
|||||||
hi def link gitcommitDiscarded gitcommitComment
|
hi def link gitcommitDiscarded gitcommitComment
|
||||||
hi def link gitcommitSelected gitcommitComment
|
hi def link gitcommitSelected gitcommitComment
|
||||||
hi def link gitcommitUnmerged gitcommitComment
|
hi def link gitcommitUnmerged gitcommitComment
|
||||||
|
hi def link gitcommitHash Identifier
|
||||||
hi def link gitcommitOnBranch Comment
|
hi def link gitcommitOnBranch Comment
|
||||||
hi def link gitcommitBranch Special
|
hi def link gitcommitBranch Special
|
||||||
hi def link gitcommitNoBranch gitCommitBranch
|
hi def link gitcommitNoBranch gitCommitBranch
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
|||||||
" Language: git config file
|
" Language: git config file
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Filenames: gitconfig, .gitconfig, *.git/config
|
" Filenames: gitconfig, .gitconfig, *.git/config
|
||||||
" Last Change: 2019 Sep 27
|
" Last Change: 2019 Dec 05
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
|||||||
" Language: git rebase --interactive
|
" Language: git rebase --interactive
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||||
" Filenames: git-rebase-todo
|
" Filenames: git-rebase-todo
|
||||||
" Last Change: 2016 Aug 29
|
" Last Change: 2019 Dec 06
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
@@ -25,7 +25,7 @@ syn match gitrebaseDrop "\v^d%(rop)=>" nextgroup=gitrebaseCommit skipwhite
|
|||||||
syn match gitrebaseNoop "\v^noop>"
|
syn match gitrebaseNoop "\v^noop>"
|
||||||
syn match gitrebaseMerge "\v^m(erge)=>" nextgroup=gitrebaseMergeOption,gitrebaseName skipwhite
|
syn match gitrebaseMerge "\v^m(erge)=>" nextgroup=gitrebaseMergeOption,gitrebaseName skipwhite
|
||||||
syn match gitrebaseLabel "\v^l(abel)=>" nextgroup=gitrebaseName skipwhite
|
syn match gitrebaseLabel "\v^l(abel)=>" nextgroup=gitrebaseName skipwhite
|
||||||
syn match gitrebaseReset "\v^r(eset)=>" nextgroup=gitrebaseName skipwhite
|
syn match gitrebaseReset "\v^(t|reset)=>" nextgroup=gitrebaseName skipwhite
|
||||||
syn match gitrebaseSummary ".*" contains=gitrebaseHash contained
|
syn match gitrebaseSummary ".*" contains=gitrebaseHash contained
|
||||||
syn match gitrebaseCommand ".*" contained
|
syn match gitrebaseCommand ".*" contained
|
||||||
syn match gitrebaseComment "^\s*#.*" contains=gitrebaseHash
|
syn match gitrebaseComment "^\s*#.*" contains=gitrebaseHash
|
||||||
|
|||||||
@@ -131,6 +131,8 @@ syn keyword htmlArg contained prefetch
|
|||||||
syn keyword htmlArg contained decoding
|
syn keyword htmlArg contained decoding
|
||||||
" https://w3c.github.io/selection-api/#extensions-to-globaleventhandlers
|
" https://w3c.github.io/selection-api/#extensions-to-globaleventhandlers
|
||||||
syn keyword htmlArg contained onselectstart onselectionchange
|
syn keyword htmlArg contained onselectstart onselectionchange
|
||||||
|
" https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/loading
|
||||||
|
syn keyword htmlArg contained loading
|
||||||
|
|
||||||
" Custom Data Attributes
|
" Custom Data Attributes
|
||||||
" http://w3c.github.io/html/single-page.html#embedding-custom-non-visible-data-with-the-data-attributes
|
" http://w3c.github.io/html/single-page.html#embedding-custom-non-visible-data-with-the-data-attributes
|
||||||
|
|||||||
59
syntax/icalendar.vim
Normal file
59
syntax/icalendar.vim
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'icalenadr') == -1
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: icalendar <http://www.ietf.org/rfc/rfc2445.txt>
|
||||||
|
" Maintainer: Steven N. Severinghaus <sns@severinghaus.org>
|
||||||
|
" Last Modified: 2006-04-17
|
||||||
|
" Version: 0.3
|
||||||
|
|
||||||
|
" Quit if syntax file is already loaded
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
command! -nargs=+ IcalHiLink hi def link <args>
|
||||||
|
|
||||||
|
syntax case ignore
|
||||||
|
setlocal iskeyword+=-
|
||||||
|
|
||||||
|
syn match icalObject "^\(BEGIN\|END\)"
|
||||||
|
syn match icalObjectType ":\(VCALENDAR\|VEVENT\|VTODO\|VJOURNAL\|VFREEBUSY\|VTIMEZONE\|VALARM\)$"
|
||||||
|
syn match icalObjectType ":\(DAYLIGHT\|STANDARD\)$"
|
||||||
|
syn match icalProperty "^\(DTSTART\|PRODID\|VERSION\|CALSCALE\|METHOD\)"
|
||||||
|
syn match icalProperty "^\(DTEND\|DTSTAMP\|ORGANIZER\|UID\|CLASS\|CREATED\)"
|
||||||
|
syn match icalProperty "^\(LOCATION\|SEQUENCE\|STATUS\|SUMMARY\|COMMENT\)"
|
||||||
|
syn match icalProperty "^\(TRANSP\|ATTENDEE\|ATTACH\|FREEBUSY\|METHOD\|CONTACT\)"
|
||||||
|
syn match icalProperty "^\(DURATION\|RRULE\|EXDATE\|EXRULE\|URL\|DESCRIPTION\|ACTION\)"
|
||||||
|
syn match icalProperty "^\(LAST-MODIFIED\|RECURRENCE-ID\|TRIGGER\|RELATED-TO\|RDATE\)"
|
||||||
|
syn match icalProperty "^\(TZID\|TZOFFSETFROM\|TZOFFSETTO\|TZNAME\|TZURL\)"
|
||||||
|
syn match icalProperty "^\(PRIORITY\|DUE\|COMPLETED\|PERCENT-COMPLETE\|CATEGORIES\)"
|
||||||
|
syn match icalProperty "^\(RESOURCES\|REPEAT\|REQUEST-STATUS\)"
|
||||||
|
syn match icalCustom /^X-[A-Z-]\+/
|
||||||
|
syn match icalDate "\<\d\{8}\>"
|
||||||
|
syn match icalDate "[0-9]\{8}T[0-9]\{6}Z\="
|
||||||
|
syn match icalParameter "[A-Z0-9-]\+=[^;:]\+"
|
||||||
|
syn keyword icalSetValue CONFIRMED TENTATIVE CANCELLED DELEGATED OPAQUE
|
||||||
|
syn keyword icalSetValue NEEDS-ACTION ACCEPTED DECLINED IN-PROGRESS
|
||||||
|
syn keyword icalSetValue PRIVATE PUBLIC PUBLISH GREGORIAN DISPLAY
|
||||||
|
syn match icalSetValue /:COMPLETED$/
|
||||||
|
|
||||||
|
" Types: PreProc Keyword Type String Comment Special
|
||||||
|
IcalHiLink icalProperty PreProc
|
||||||
|
IcalHiLink icalObject Label
|
||||||
|
IcalHiLink icalObjectType Type
|
||||||
|
IcalHiLink icalDate String
|
||||||
|
IcalHiLink icalParameter Comment
|
||||||
|
IcalHiLink icalSetValue Special
|
||||||
|
IcalHiLink icalCustom Error
|
||||||
|
|
||||||
|
delcommand IcalHiLink
|
||||||
|
|
||||||
|
let b:current_syntax = "icalendar"
|
||||||
|
|
||||||
|
"EOF vim: tw=78:ft=vim:ts=8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
endif
|
||||||
134
syntax/jq.vim
Normal file
134
syntax/jq.vim
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jq') == -1
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: jq
|
||||||
|
" Maintainer: Vito C <vito.blog@gmail.com>
|
||||||
|
" Last Change: 2015 Nov 28
|
||||||
|
|
||||||
|
" Quit when a (custom) syntax file was already loaded
|
||||||
|
if exists('b:current_syntax')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" syn include @jqHtml syntax/html.vim " Doc comment HTML
|
||||||
|
|
||||||
|
" jqTodo
|
||||||
|
syntax keyword jqTodo contained TODO FIXME NOTE XXX
|
||||||
|
|
||||||
|
" jqKeywords
|
||||||
|
syntax keyword jqKeywords and or not empty
|
||||||
|
syntax keyword jqKeywords try catch
|
||||||
|
syntax keyword jqKeywords reduce as label break foreach
|
||||||
|
syntax keyword jqKeywords import include module modulemeta
|
||||||
|
syntax keyword jqKeywords env nth has in while error stderr debug
|
||||||
|
|
||||||
|
" jqConditional
|
||||||
|
syntax keyword jqConditional if then elif else end
|
||||||
|
|
||||||
|
" jqConditions
|
||||||
|
syntax keyword jqCondtions true false null
|
||||||
|
|
||||||
|
" jqSpecials
|
||||||
|
syntax keyword jqType type
|
||||||
|
syntax match jqType /[\|;]/ " not really a type I did this for coloring reasons though :help group-name
|
||||||
|
syntax region jqParentheses start=+(+ end=+)+ fold transparent
|
||||||
|
|
||||||
|
" jq Functions
|
||||||
|
syntax keyword jqFunction add all any arrays ascii_downcase floor
|
||||||
|
syntax keyword jqFunction ascii_upcase booleans bsearch builtins capture combinations
|
||||||
|
syntax keyword jqFunction \contains del delpaths endswith explode
|
||||||
|
syntax keyword jqFunction finites first flatten format from_entries
|
||||||
|
syntax keyword jqFunction fromdate fromdateiso8601 fromjson fromstream get_jq_origin
|
||||||
|
syntax keyword jqFunction get_prog_origin get_search_list getpath gmtime group_by
|
||||||
|
syntax keyword jqFunction gsub halt halt_error implode index indices infinite
|
||||||
|
syntax keyword jqFunction input input_filename input_line_number inputs inside
|
||||||
|
syntax keyword jqFunction isempty isfinite isinfinite isnan isnormal iterables
|
||||||
|
syntax keyword jqFunction join keys keys_unsorted last leaf_paths
|
||||||
|
syntax keyword jqFunction length limit localtime ltrimstr map map_values
|
||||||
|
syntax keyword jqFunction match max max_by min min_by
|
||||||
|
syntax keyword jqFunction mktime nan normals now
|
||||||
|
syntax keyword jqFunction nulls numbers objects path paths range
|
||||||
|
syntax keyword jqFunction recurse recurse_down repeat reverse rindex
|
||||||
|
syntax keyword jqFunction rtrimstr scalars scalars_or_empty scan select
|
||||||
|
syntax keyword jqFunction setpath sort sort_by split splits with_entries
|
||||||
|
syntax keyword jqFunction startswith strflocaltime strftime strings strptime sub
|
||||||
|
syntax keyword jqFunction test to_entries todate todateiso8601 tojson __loc__
|
||||||
|
syntax keyword jqFunction tonumber tostream tostring transpose truncate_stream
|
||||||
|
syntax keyword jqFunction unique unique_by until utf8bytelength values walk
|
||||||
|
" TODO: $__loc__ is going to be a pain
|
||||||
|
|
||||||
|
" jq Math Functions
|
||||||
|
syntax keyword jqFunction acos acosh asin asinh atan atanh cbrt ceil cos cosh
|
||||||
|
syntax keyword jqFunction erf erfc exp exp10 exp2 expm1 fabs floor gamma j0 j1
|
||||||
|
syntax keyword jqFunction lgamma lgamma_r log log10 log1p log2 logb nearbyint
|
||||||
|
syntax keyword jqFunction pow10 rint round significand sin sinh sqrt tan tanh
|
||||||
|
syntax keyword jqFunction tgamma trunc y0 y1
|
||||||
|
syntax keyword jqFunction atan2 copysign drem fdim fmax fmin fmod frexp hypot
|
||||||
|
syntax keyword jqFunction jn ldexp modf nextafter nexttoward pow remainder
|
||||||
|
syntax keyword jqFunction scalb scalbln yn
|
||||||
|
syntax keyword jqFunction fma
|
||||||
|
|
||||||
|
" jq SQL-style Operators
|
||||||
|
syntax keyword jqFunction INDEX JOIN IN
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syntax match jqComment "#.*" contains=jqTodo
|
||||||
|
|
||||||
|
" Variables
|
||||||
|
syn match jqVariables /$[_A-Za-z0-9]\+/
|
||||||
|
|
||||||
|
" Definition
|
||||||
|
syntax keyword jqKeywords def nextgroup=jqNameDefinition skipwhite
|
||||||
|
syn match jqNameDefinition /\<[_A-Za-z0-9]\+\>/ contained nextgroup=jqPostNameDefinition
|
||||||
|
syn match jqNameDefinition /`[^`]\+`/ contained nextgroup=jqPostNameDefinition
|
||||||
|
|
||||||
|
" Strings
|
||||||
|
syn region jqError start=+'+ end=+'\|$\|[;)]\@=+
|
||||||
|
syn region jqString matchgroup=jqQuote
|
||||||
|
\ start=+"+ skip=+\\"+ end=+"+
|
||||||
|
\ contains=@Spell,jqInterpolation
|
||||||
|
syn region jqInterpolation matchgroup=jqInterpolationDelimiter
|
||||||
|
\ start=+\%([^\\]\%(\\\\\)*\\\)\@<!\\(+ end=+)+
|
||||||
|
\ contained contains=TOP
|
||||||
|
|
||||||
|
" Operators
|
||||||
|
syn match jqOperator /:\|\([-+*/%<>=]\|\/\/\)=\?\|[!|]=\|?\/\//
|
||||||
|
"syn region jqRange matchgroup=jqSquareBracket start=+\[+ skip=+:+ end=+\]+
|
||||||
|
|
||||||
|
" Errors
|
||||||
|
syn keyword jqError _assign _flatten _modify _nwise _plus _negate _minus _multiply
|
||||||
|
syn keyword jqError _divide _mod _strindices _equal _notequal _less _greater _lesseq
|
||||||
|
syn keyword jqError _greatereq _sort_by_impl _group_by_impl _min_by_impl _max_by_impl _match_impl _input
|
||||||
|
" TODO: these errors should show up when doing def _flatten: as well
|
||||||
|
|
||||||
|
" Numbers
|
||||||
|
syn match jqNumber /\<0[dDfFlL]\?\>/ " Just a bare 0
|
||||||
|
syn match jqNumber /\<[1-9]\d*[dDfFlL]\?\>/ " A multi-digit number - octal numbers with leading 0's are deprecated in Scala
|
||||||
|
|
||||||
|
if !exists('jq_quote_highlight')
|
||||||
|
highlight link jqQuote String
|
||||||
|
else
|
||||||
|
highlight link jqQuote Type
|
||||||
|
endif
|
||||||
|
|
||||||
|
hi link jqCondtions Boolean
|
||||||
|
hi link jqVariables Identifier
|
||||||
|
hi link jqNameDefinition Function
|
||||||
|
hi link jqTodo Todo
|
||||||
|
hi link jqComment Comment
|
||||||
|
hi link jqKeywords Keyword
|
||||||
|
hi link jqType Type
|
||||||
|
hi link jqOperator Operator
|
||||||
|
hi link jqFunction Function
|
||||||
|
hi link jqError Error
|
||||||
|
hi link jqString String
|
||||||
|
hi link jqInterpolationDelimiter Delimiter
|
||||||
|
"hi link jqStatement Statement
|
||||||
|
hi link jqConditional Conditional
|
||||||
|
"hi link jqRepeat Repeat
|
||||||
|
"hi link jqException Exception
|
||||||
|
"hi link jqInclude Include
|
||||||
|
"hi link jqDecorator Define
|
||||||
|
hi link jqNumber Number
|
||||||
|
|
||||||
|
endif
|
||||||
138
syntax/jsonnet.vim
Normal file
138
syntax/jsonnet.vim
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsonnet') == -1
|
||||||
|
|
||||||
|
" Copyright 2014 Google Inc. All rights reserved.
|
||||||
|
"
|
||||||
|
" Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
" you may not use this file except in compliance with the License.
|
||||||
|
" You may obtain a copy of the License at
|
||||||
|
"
|
||||||
|
" http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
"
|
||||||
|
" Unless required by applicable law or agreed to in writing, software
|
||||||
|
" distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
" See the License for the specific language governing permissions and
|
||||||
|
" limitations under the License.
|
||||||
|
|
||||||
|
syntax match Number "\<\d*\([Ee][+-]\?\d\+\)\?\>"
|
||||||
|
syntax match Number "\<\d\+[.]\d*\([Ee][+-]\?\d\+\)\?\>"
|
||||||
|
syntax match Number "\<[.]\d\+\([Ee][+-]\?\d\+\)\?\>"
|
||||||
|
|
||||||
|
" builtins
|
||||||
|
syn match Constant "std.acos"
|
||||||
|
syn match Constant "std.asin"
|
||||||
|
syn match Constant "std.atan"
|
||||||
|
syn match Constant "std.ceil"
|
||||||
|
syn match Constant "std.char"
|
||||||
|
syn match Constant "std.codepoint"
|
||||||
|
syn match Constant "std.cos"
|
||||||
|
syn match Constant "std.exp"
|
||||||
|
syn match Constant "std.exponent"
|
||||||
|
syn match Constant "std.extVar"
|
||||||
|
syn match Constant "std.filter"
|
||||||
|
syn match Constant "std.floor"
|
||||||
|
syn match Constant "std.force"
|
||||||
|
syn match Constant "std.length"
|
||||||
|
syn match Constant "std.log"
|
||||||
|
syn match Constant "std.makeArray"
|
||||||
|
syn match Constant "std.mantissa"
|
||||||
|
syn match Constant "std.md5"
|
||||||
|
syn match Constant "std.modulo"
|
||||||
|
syn match Constant "std.native"
|
||||||
|
syn match Constant "std.objectFieldsEx"
|
||||||
|
syn match Constant "std.objectHasEx"
|
||||||
|
syn match Constant "std.pow"
|
||||||
|
syn match Constant "std.primitiveEquals"
|
||||||
|
syn match Constant "std.sin"
|
||||||
|
syn match Constant "std.sqrt"
|
||||||
|
syn match Constant "std.tan"
|
||||||
|
syn match Constant "std.thisFile"
|
||||||
|
syn match Constant "std.type"
|
||||||
|
|
||||||
|
" std.jsonnet
|
||||||
|
syn match Constant "std.abs"
|
||||||
|
syn match Constant "std.asciiLower"
|
||||||
|
syn match Constant "std.asciiUpper"
|
||||||
|
syn match Constant "std.assertEqual"
|
||||||
|
syn match Constant "std.base64"
|
||||||
|
syn match Constant "std.base64Decode"
|
||||||
|
syn match Constant "std.base64DecodeBytes"
|
||||||
|
syn match Constant "std.count"
|
||||||
|
syn match Constant "std.endsWith"
|
||||||
|
syn match Constant "std.equals"
|
||||||
|
syn match Constant "std.escapeStringBash"
|
||||||
|
syn match Constant "std.escapeStringDollars"
|
||||||
|
syn match Constant "std.escapeStringJson"
|
||||||
|
syn match Constant "std.escapeStringPython"
|
||||||
|
syn match Constant "std.filterMap"
|
||||||
|
syn match Constant "std.flattenArrays"
|
||||||
|
syn match Constant "std.foldl"
|
||||||
|
syn match Constant "std.foldr"
|
||||||
|
syn match Constant "std.format"
|
||||||
|
syn match Constant "std.join"
|
||||||
|
syn match Constant "std.lines"
|
||||||
|
syn match Constant "std.manifestIni"
|
||||||
|
syn match Constant "std.manifestJson"
|
||||||
|
syn match Constant "std.manifestJsonEx"
|
||||||
|
syn match Constant "std.manifestPython"
|
||||||
|
syn match Constant "std.manifestPythonVars"
|
||||||
|
syn match Constant "std.manifestYamlStream"
|
||||||
|
syn match Constant "std.map"
|
||||||
|
syn match Constant "std.mapWithIndex"
|
||||||
|
syn match Constant "std.max"
|
||||||
|
syn match Constant "std.mergePatch"
|
||||||
|
syn match Constant "std.min"
|
||||||
|
syn match Constant "std.mod"
|
||||||
|
syn match Constant "std.objectFields"
|
||||||
|
syn match Constant "std.objectFieldsAll"
|
||||||
|
syn match Constant "std.objectHas"
|
||||||
|
syn match Constant "std.objectHasAll"
|
||||||
|
syn match Constant "std.parseInt"
|
||||||
|
syn match Constant "std.prune"
|
||||||
|
syn match Constant "std.range"
|
||||||
|
syn match Constant "std.resolvePath"
|
||||||
|
syn match Constant "std.set"
|
||||||
|
syn match Constant "std.setDiff"
|
||||||
|
syn match Constant "std.setInter"
|
||||||
|
syn match Constant "std.setMember"
|
||||||
|
syn match Constant "std.setUnion"
|
||||||
|
syn match Constant "std.slice"
|
||||||
|
syn match Constant "std.sort"
|
||||||
|
syn match Constant "std.split"
|
||||||
|
syn match Constant "std.splitLimit"
|
||||||
|
syn match Constant "std.startsWith"
|
||||||
|
syn match Constant "std.stringChars"
|
||||||
|
syn match Constant "std.strReplace"
|
||||||
|
syn match Constant "std.substr"
|
||||||
|
syn match Constant "std.toString"
|
||||||
|
syn match Constant "std.uniq"
|
||||||
|
|
||||||
|
|
||||||
|
syn match Type "\$"
|
||||||
|
|
||||||
|
syn region String start='L\="' skip='\\\\\|\\"' end='"'
|
||||||
|
syn region String start='L\=\'' skip='\\\\\|\\\'' end='\''
|
||||||
|
syn region String start='|||\s*\n\+\z(\s*\)' end='^\z1\@!\s*|||'
|
||||||
|
|
||||||
|
" Highlight python style string formatting.
|
||||||
|
syn match Special "%\%(([^)]\+)\)\=[-#0 +]*\d*\%(\.\d\+\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=String
|
||||||
|
syn match Special "%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=String
|
||||||
|
|
||||||
|
syn region Comment start="/[*]" end="[*]/"
|
||||||
|
syn match Comment "//.*$"
|
||||||
|
syn match Comment "#.*$"
|
||||||
|
|
||||||
|
syn match Keyword "\<[a-zA-Z_][a-z0-9A-Z_]*\s*\(([^)]*)\)\?\s*+\?::\?:\?"
|
||||||
|
|
||||||
|
syn region Object start="{" end="}" fold transparent
|
||||||
|
|
||||||
|
syntax keyword Include import importstr
|
||||||
|
syntax keyword Type function self super
|
||||||
|
syntax keyword Statement assert if then else for in
|
||||||
|
syntax keyword Special local tailstrict
|
||||||
|
syntax keyword Constant true false null
|
||||||
|
syntax keyword Underlined error
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -109,11 +109,15 @@ syntax match juliaSemicolon display ";"
|
|||||||
syntax match juliaComma display ","
|
syntax match juliaComma display ","
|
||||||
syntax match juliaColon display ":"
|
syntax match juliaColon display ":"
|
||||||
|
|
||||||
|
" This is really ugly. It would be better to mask most keywords when a dot is
|
||||||
|
" found, introducing some kind of dot-environment
|
||||||
|
let s:nodot = '\%(\.\)\@'.s:d(1).'<!'
|
||||||
|
|
||||||
syntax match juliaErrorPar display "[])}]"
|
syntax match juliaErrorPar display "[])}]"
|
||||||
syntax match juliaErrorEnd display "\<end\>"
|
exec 'syntax match juliaErrorEnd display "'.s:nodot.'\<end\>"'
|
||||||
syntax match juliaErrorElse display "\<\%(else\|elseif\)\>"
|
exec 'syntax match juliaErrorElse display "'.s:nodot.'\<\%(else\|elseif\)\>"'
|
||||||
syntax match juliaErrorCatch display "\<catch\>"
|
exec 'syntax match juliaErrorCatch display "'.s:nodot.'\<catch\>"'
|
||||||
syntax match juliaErrorFinally display "\<finally\>"
|
exec 'syntax match juliaErrorFinally display "'.s:nodot.'\<finally\>"'
|
||||||
syntax match juliaErrorSemicol display contained ";"
|
syntax match juliaErrorSemicol display contained ";"
|
||||||
|
|
||||||
syntax region juliaParBlock matchgroup=juliaParDelim start="(" end=")" contains=@juliaExpressions,juliaComprehensionFor
|
syntax region juliaParBlock matchgroup=juliaParDelim start="(" end=")" contains=@juliaExpressions,juliaComprehensionFor
|
||||||
@@ -122,10 +126,6 @@ syntax region juliaSqBraIdxBlock matchgroup=juliaParDelim start="\[" end="\]" c
|
|||||||
exec 'syntax region juliaSqBraBlock matchgroup=juliaParDelim start="\%(^\|\s\|' . s:operators . '\)\@'.s:d(3).'<=\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS'
|
exec 'syntax region juliaSqBraBlock matchgroup=juliaParDelim start="\%(^\|\s\|' . s:operators . '\)\@'.s:d(3).'<=\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS'
|
||||||
syntax region juliaCurBraBlock matchgroup=juliaParDelim start="{" end="}" contains=@juliaExpressions
|
syntax region juliaCurBraBlock matchgroup=juliaParDelim start="{" end="}" contains=@juliaExpressions
|
||||||
|
|
||||||
" This is really ugly. It would be better to mask most keywords when a dot is
|
|
||||||
" found, introducing some kind of dot-environment
|
|
||||||
let s:nodot = '\%(\.\)\@'.s:d(1).'1<!'
|
|
||||||
|
|
||||||
exec 'syntax match juliaKeyword display "'.s:nodot.'\<\%(return\|local\|global\|import\%(all\)\?\|export\|using\|const\|where\)\>"'
|
exec 'syntax match juliaKeyword display "'.s:nodot.'\<\%(return\|local\|global\|import\%(all\)\?\|export\|using\|const\|where\)\>"'
|
||||||
syntax match juliaInfixKeyword display "\%(=\s*\)\@<!\<\%(in\|isa\)\>\S\@!\%(\s*=\)\@!"
|
syntax match juliaInfixKeyword display "\%(=\s*\)\@<!\<\%(in\|isa\)\>\S\@!\%(\s*=\)\@!"
|
||||||
exec 'syntax match juliaRepKeyword display "'.s:nodot.'\<\%(break\|continue\)\>"'
|
exec 'syntax match juliaRepKeyword display "'.s:nodot.'\<\%(break\|continue\)\>"'
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: Kotlin
|
" Language: Kotlin
|
||||||
" Maintainer: Alexander Udalov
|
" Maintainer: Alexander Udalov
|
||||||
" Latest Revision: 26 May 2019
|
" Latest Revision: 13 July 2020
|
||||||
|
|
||||||
if exists('b:current_syntax')
|
if exists('b:current_syntax')
|
||||||
finish
|
finish
|
||||||
@@ -18,7 +18,33 @@ syn keyword ktException try catch finally throw
|
|||||||
|
|
||||||
syn keyword ktInclude import package
|
syn keyword ktInclude import package
|
||||||
|
|
||||||
syn keyword ktType Any Boolean Byte Char Double Float Int Long Nothing Short Unit
|
" The following is generated by generate-stdlib-class-names.main.kts
|
||||||
|
syn keyword ktType AbstractCollection AbstractCoroutineContextElement AbstractCoroutineContextKey AbstractDoubleTimeSource AbstractIterator AbstractList AbstractLongTimeSource
|
||||||
|
syn keyword ktType AbstractMap AbstractMutableCollection AbstractMutableList AbstractMutableMap AbstractMutableSet AbstractSet AccessDeniedException Accessor Annotation
|
||||||
|
syn keyword ktType AnnotationRetention AnnotationTarget Any Appendable ArithmeticException Array ArrayDeque ArrayList AssertionError Boolean BooleanArray BooleanIterator
|
||||||
|
syn keyword ktType BuilderInference Byte ByteArray ByteIterator CallsInPlace CancellationException Char CharArray CharCategory CharDirectionality CharIterator CharProgression
|
||||||
|
syn keyword ktType CharRange CharSequence CharacterCodingException Charsets ClassCastException Cloneable ClosedFloatingPointRange ClosedRange Collection Comparable Comparator
|
||||||
|
syn keyword ktType ConcurrentModificationException ConditionalEffect Continuation ContinuationInterceptor ContractBuilder CoroutineContext DeepRecursiveFunction DeepRecursiveScope
|
||||||
|
syn keyword ktType Delegates Deprecated DeprecatedSinceKotlin DeprecationLevel Destructured Double DoubleArray DoubleIterator DslMarker Duration DurationUnit Effect Element
|
||||||
|
syn keyword ktType EmptyCoroutineContext Entry Enum Error Exception Experimental ExperimentalContracts ExperimentalJsExport ExperimentalMultiplatform ExperimentalStdlibApi
|
||||||
|
syn keyword ktType ExperimentalTime ExperimentalTypeInference ExperimentalUnsignedTypes ExtensionFunctionType FileAlreadyExistsException FileSystemException FileTreeWalk
|
||||||
|
syn keyword ktType FileWalkDirection Float FloatArray FloatIterator Function Function0 Function1 Function10 Function11 Function12 Function13 Function14 Function15 Function16
|
||||||
|
syn keyword ktType Function17 Function18 Function19 Function2 Function20 Function21 Function22 Function3 Function4 Function5 Function6 Function7 Function8 Function9 FunctionN
|
||||||
|
syn keyword ktType Getter Grouping HashMap HashSet IllegalArgumentException IllegalStateException IndexOutOfBoundsException IndexedValue Int IntArray IntIterator IntProgression
|
||||||
|
syn keyword ktType IntRange InvocationKind Iterable Iterator JsExport JsName JvmDefault JvmDefaultWithoutCompatibility JvmField JvmMultifileClass JvmName JvmOverloads JvmStatic
|
||||||
|
syn keyword ktType JvmSuppressWildcards JvmSynthetic JvmWildcard KAnnotatedElement KCallable KClass KClassifier KDeclarationContainer KFunction KMutableProperty KMutableProperty0
|
||||||
|
syn keyword ktType KMutableProperty1 KMutableProperty2 KParameter KProperty KProperty0 KProperty1 KProperty2 KType KTypeParameter KTypeProjection KVariance KVisibility Key Kind
|
||||||
|
syn keyword ktType KotlinNullPointerException KotlinReflectionNotSupportedError KotlinVersion Lazy LazyThreadSafetyMode Level LinkedHashMap LinkedHashSet List ListIterator Long
|
||||||
|
syn keyword ktType LongArray LongIterator LongProgression LongRange Map MatchGroup MatchGroupCollection MatchNamedGroupCollection MatchResult Metadata Monotonic MustBeDocumented
|
||||||
|
syn keyword ktType MutableCollection MutableEntry MutableIterable MutableIterator MutableList MutableListIterator MutableMap MutableSet NoSuchElementException NoSuchFileException
|
||||||
|
syn keyword ktType NoWhenBranchMatchedException NotImplementedError Nothing NullPointerException Number NumberFormatException ObservableProperty OnErrorAction OptIn
|
||||||
|
syn keyword ktType OptionalExpectation OverloadResolutionByLambdaReturnType Pair ParameterName PropertyDelegateProvider PublishedApi PurelyImplements Random RandomAccess
|
||||||
|
syn keyword ktType ReadOnlyProperty ReadWriteProperty Regex RegexOption Repeatable ReplaceWith RequiresOptIn RestrictsSuspension Result Retention Returns ReturnsNotNull
|
||||||
|
syn keyword ktType RuntimeException Sequence SequenceScope Set Setter SharedImmutable Short ShortArray ShortIterator SimpleEffect SinceKotlin Strictfp String StringBuilder Suppress
|
||||||
|
syn keyword ktType Synchronized Target TestTimeSource ThreadLocal Throwable Throws TimeMark TimeSource TimedValue Transient Triple TypeCastException Typography UByte UByteArray
|
||||||
|
syn keyword ktType UByteIterator UInt UIntArray UIntIterator UIntProgression UIntRange ULong ULongArray ULongIterator ULongProgression ULongRange UShort UShortArray UShortIterator
|
||||||
|
syn keyword ktType UninitializedPropertyAccessException Unit UnsafeVariance UnsupportedOperationException UseExperimental Volatile
|
||||||
|
|
||||||
syn keyword ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic expect actual
|
syn keyword ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic expect actual
|
||||||
syn keyword ktStructure class object interface typealias fun val var constructor init
|
syn keyword ktStructure class object interface typealias fun val var constructor init
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ if !exists("main_syntax")
|
|||||||
let main_syntax = 'lua'
|
let main_syntax = 'lua'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if exists('g:lua_syntax_fancynotequal') && !has('conceal')
|
||||||
|
unlet g:lua_syntax_fancynotequal
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
syntax sync fromstart
|
syntax sync fromstart
|
||||||
|
|
||||||
function! s:FoldableRegion(tag, name, expr)
|
function! s:FoldableRegion(tag, name, expr)
|
||||||
@@ -40,7 +45,11 @@ syntax region luaBracket transparent matchgroup=luaBrackets start="\[" end="\]"
|
|||||||
syntax match luaComma ","
|
syntax match luaComma ","
|
||||||
syntax match luaSemiCol ";"
|
syntax match luaSemiCol ";"
|
||||||
if !exists('g:lua_syntax_nosymboloperator')
|
if !exists('g:lua_syntax_nosymboloperator')
|
||||||
syntax match luaSymbolOperator "[#<>=~^&|*/%+-]\|\.\."
|
if exists('g:lua_syntax_fancynotequal')
|
||||||
|
syntax match luaNotEqOperator "\V~=" conceal cchar=≠
|
||||||
|
setlocal conceallevel=2
|
||||||
|
endi
|
||||||
|
syntax match luaSymbolOperator "[#<>=~^&|*/%+-]\|\.\." contains=luaNotEqOperator
|
||||||
endi
|
endi
|
||||||
syntax match luaEllipsis "\.\.\."
|
syntax match luaEllipsis "\.\.\."
|
||||||
|
|
||||||
@@ -229,6 +238,7 @@ if version >= 508 || !exists("did_lua_syn_inits")
|
|||||||
HiLink luaLocal Type
|
HiLink luaLocal Type
|
||||||
HiLink luaNumber Number
|
HiLink luaNumber Number
|
||||||
HiLink luaSymbolOperator luaOperator
|
HiLink luaSymbolOperator luaOperator
|
||||||
|
HiLink luaNotEqOperator luaOperator
|
||||||
HiLink luaOperator Operator
|
HiLink luaOperator Operator
|
||||||
HiLink luaRepeat Repeat
|
HiLink luaRepeat Repeat
|
||||||
HiLink luaSemiCol Delimiter
|
HiLink luaSemiCol Delimiter
|
||||||
@@ -240,6 +250,10 @@ if version >= 508 || !exists("did_lua_syn_inits")
|
|||||||
HiLink luaStringSpecial SpecialChar
|
HiLink luaStringSpecial SpecialChar
|
||||||
HiLink luaErrHand Exception
|
HiLink luaErrHand Exception
|
||||||
|
|
||||||
|
if exists('g:lua_syntax_fancynotequal')
|
||||||
|
hi! link Conceal luaOperator
|
||||||
|
endi
|
||||||
|
|
||||||
delcommand HiLink
|
delcommand HiLink
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -72,10 +72,10 @@ execute 'syn region mkdLink matchgroup=mkdDelimiter start="\\\@<!!\?\[\ze[^]\n]
|
|||||||
" Autolink without angle brackets.
|
" Autolink without angle brackets.
|
||||||
" mkd inline links: protocol optional user:pass@ sub/domain .com, .co.uk, etc optional port path/querystring/hash fragment
|
" mkd inline links: protocol optional user:pass@ sub/domain .com, .co.uk, etc optional port path/querystring/hash fragment
|
||||||
" ------------ _____________________ ----------------------------- _________________________ ----------------- __
|
" ------------ _____________________ ----------------------------- _________________________ ----------------- __
|
||||||
syn match mkdInlineURL /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/
|
syn match mkdInlineURL /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?[^] \t]*/
|
||||||
|
|
||||||
" Autolink with parenthesis.
|
" Autolink with parenthesis.
|
||||||
syn region mkdInlineURL matchgroup=mkdDelimiter start="(\(https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*)\)\@=" end=")"
|
syn region mkdInlineURL matchgroup=mkdDelimiter start="(\(https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?[^] \t]*)\)\@=" end=")"
|
||||||
|
|
||||||
" Autolink with angle brackets.
|
" Autolink with angle brackets.
|
||||||
syn region mkdInlineURL matchgroup=mkdDelimiter start="\\\@<!<\ze[a-z][a-z0-9,.-]\{1,22}:\/\/[^> ]*>" end=">"
|
syn region mkdInlineURL matchgroup=mkdDelimiter start="\\\@<!<\ze[a-z][a-z0-9,.-]\{1,22}:\/\/[^> ]*>" end=">"
|
||||||
@@ -105,8 +105,8 @@ execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\
|
|||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(`\{3,}\)[^`]*$/ end=/^\s*\z1`*\s*$/' . s:concealcode
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(`\{3,}\)[^`]*$/ end=/^\s*\z1`*\s*$/' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!\~\~/ end=/\(\([^\\]\|^\)\\\)\@<!\~\~/' . s:concealcode
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/\(\([^\\]\|^\)\\\)\@<!\~\~/ end=/\(\([^\\]\|^\)\\\)\@<!\~\~/' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(\~\{3,}\)\s*[0-9A-Za-z_+-]*\s*$/ end=/^\s*\z1\~*\s*$/' . s:concealcode
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start=/^\s*\z(\~\{3,}\)\s*[0-9A-Za-z_+-]*\s*$/ end=/^\s*\z1\~*\s*$/' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<pre[^>]*\\\@<!>" end="</pre>"' . s:concealcode
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<pre\(\|\_s[^>]*\)\\\@<!>" end="</pre>"' . s:concealcode
|
||||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<code[^>]*\\\@<!>" end="</code>"' . s:concealcode
|
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<code\(\|\_s[^>]*\)\\\@<!>" end="</code>"' . s:concealcode
|
||||||
syn region mkdFootnote start="\[^" end="\]"
|
syn region mkdFootnote start="\[^" end="\]"
|
||||||
syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/
|
syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/
|
||||||
syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
|
syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
|
||||||
|
|||||||
@@ -34,8 +34,9 @@ set cpo&vim
|
|||||||
|
|
||||||
" http://mesonbuild.com/Syntax.html
|
" http://mesonbuild.com/Syntax.html
|
||||||
syn keyword mesonConditional elif else if endif
|
syn keyword mesonConditional elif else if endif
|
||||||
syn keyword mesonRepeat foreach endforeach
|
syn keyword mesonRepeat foreach endforeach
|
||||||
syn keyword mesonOperator and not or in
|
syn keyword mesonOperator and not or in
|
||||||
|
syn keyword mesonStatement continue break
|
||||||
|
|
||||||
syn match mesonComment "#.*$" contains=mesonTodo,@Spell
|
syn match mesonComment "#.*$" contains=mesonTodo,@Spell
|
||||||
syn keyword mesonTodo FIXME NOTE NOTES TODO XXX contained
|
syn keyword mesonTodo FIXME NOTE NOTES TODO XXX contained
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ syn region nixFunctionArgument start="{\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)
|
|||||||
syn region nixFunctionArgument start="{\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*}\%(\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*@\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*[a-zA-Z_][a-zA-Z0-9_'-]*\)\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*:" end="}" contains=nixComment nextgroup=nixArgOperator
|
syn region nixFunctionArgument start="{\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*}\%(\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*@\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*[a-zA-Z_][a-zA-Z0-9_'-]*\)\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*:" end="}" contains=nixComment nextgroup=nixArgOperator
|
||||||
|
|
||||||
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||||
syn match nixSimpleFunctionArgument "[a-zA-Z_][a-zA-Z0-9_'-]*\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*:/\@!"
|
syn match nixSimpleFunctionArgument "[a-zA-Z_][a-zA-Z0-9_'-]*\ze\%(\s\|#.\{-\}\n\|\n\|/\*\_.\{-\}\*/\)*:\([\n ]\)\@="
|
||||||
|
|
||||||
syn region nixList matchgroup=nixListBracket start="\[" end="\]" contains=@nixExpr
|
syn region nixList matchgroup=nixListBracket start="\[" end="\]" contains=@nixExpr
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ syn keyword nixNamespacedBuiltin contained
|
|||||||
\ removeAttrs replaceStrings scopedImport seq sort split splitVersion
|
\ removeAttrs replaceStrings scopedImport seq sort split splitVersion
|
||||||
\ storeDir storePath stringLength sub substring tail throw toFile toJSON
|
\ storeDir storePath stringLength sub substring tail throw toFile toJSON
|
||||||
\ toPath toString toXML trace tryEval typeOf unsafeDiscardOutputDependency
|
\ toPath toString toXML trace tryEval typeOf unsafeDiscardOutputDependency
|
||||||
\ unsafeDiscardStringContext unsafeGetAttrPos valueSize
|
\ unsafeDiscardStringContext unsafeGetAttrPos valueSize fromTOML
|
||||||
|
|
||||||
syn match nixBuiltin "builtins\.[a-zA-Z']\+"he=s+9 contains=nixComment,nixNamespacedBuiltin
|
syn match nixBuiltin "builtins\.[a-zA-Z']\+"he=s+9 contains=nixComment,nixNamespacedBuiltin
|
||||||
|
|
||||||
|
|||||||
1878
syntax/pgsql.vim
1878
syntax/pgsql.vim
File diff suppressed because it is too large
Load Diff
@@ -189,7 +189,7 @@ endif
|
|||||||
|
|
||||||
" set default global php version
|
" set default global php version
|
||||||
if !exists('g:php_version_id')
|
if !exists('g:php_version_id')
|
||||||
let g:php_version_id = 70300
|
let g:php_version_id = 70300
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" set default buffer level php version
|
" set default buffer level php version
|
||||||
@@ -684,68 +684,68 @@ syn case match
|
|||||||
if version >= 704
|
if version >= 704
|
||||||
if b:php_version_id >= 70300
|
if b:php_version_id >= 70300
|
||||||
" @begin phpHereDoc
|
" @begin phpHereDoc
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\I\i*\)$" end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\s*\z(\I\i*\)$" end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@3<="\z(\I\i*\)"$+ end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@3<=\s*"\z(\I\i*\)"$+ end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
" including HTML,JavaScript,SQL if enabled via options
|
" including HTML,JavaScript,SQL if enabled via options
|
||||||
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
|
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\s*\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\s*\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_sql_heredoc") && php_sql_heredoc)
|
if (exists("php_sql_heredoc") && php_sql_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\s*\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_xml_heredoc") && php_xml_heredoc)
|
if (exists("php_xml_heredoc") && php_xml_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\s*\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
" @end phpHereDoc
|
" @end phpHereDoc
|
||||||
else
|
else
|
||||||
" @begin phpHereDoc
|
" @begin phpHereDoc
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\s*\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@3<="\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@3<=\s*"\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
" including HTML,JavaScript,SQL if enabled via options
|
" including HTML,JavaScript,SQL if enabled via options
|
||||||
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
|
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\s*\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\s*\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_sql_heredoc") && php_sql_heredoc)
|
if (exists("php_sql_heredoc") && php_sql_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\s*\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_xml_heredoc") && php_xml_heredoc)
|
if (exists("php_xml_heredoc") && php_xml_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@3<=\s*\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
" @end phpHereDoc
|
" @end phpHereDoc
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
if b:php_version_id >= 70300
|
if b:php_version_id >= 70300
|
||||||
" @copy phpHereDoc strip_maximum_size
|
" @copy phpHereDoc strip_maximum_size
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\I\i*\)$" end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<="\z(\I\i*\)"$+ end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<=\s*"\z(\I\i*\)"$+ end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
" including HTML,JavaScript,SQL if enabled via options
|
" including HTML,JavaScript,SQL if enabled via options
|
||||||
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
|
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_sql_heredoc") && php_sql_heredoc)
|
if (exists("php_sql_heredoc") && php_sql_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_xml_heredoc") && php_xml_heredoc)
|
if (exists("php_xml_heredoc") && php_xml_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
" @end phpHereDoc
|
" @end phpHereDoc
|
||||||
else
|
else
|
||||||
" @copy phpHereDoc strip_maximum_size
|
" @copy phpHereDoc strip_maximum_size
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<="\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<=\s*"\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
" including HTML,JavaScript,SQL if enabled via options
|
" including HTML,JavaScript,SQL if enabled via options
|
||||||
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
|
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_sql_heredoc") && php_sql_heredoc)
|
if (exists("php_sql_heredoc") && php_sql_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_xml_heredoc") && php_xml_heredoc)
|
if (exists("php_xml_heredoc") && php_xml_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
" @end phpHereDoc
|
" @end phpHereDoc
|
||||||
endif
|
endif
|
||||||
@@ -755,66 +755,66 @@ endif
|
|||||||
if version >= 704
|
if version >= 704
|
||||||
if b:php_version_id >= 70300
|
if b:php_version_id >= 70300
|
||||||
" @begin phpNowDoc
|
" @begin phpNowDoc
|
||||||
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\I\i*\)'$+ end="^\s*\z1\>" contained keepend extend
|
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<=\s*'\z(\I\i*\)'$+ end="^\s*\z1\>" contained keepend extend
|
||||||
" including HTML,JavaScript,SQL if enabled via options
|
" including HTML,JavaScript,SQL if enabled via options
|
||||||
if (exists("php_html_in_nowdoc") && php_html_in_nowdoc)
|
if (exists("php_html_in_nowdoc") && php_html_in_nowdoc)
|
||||||
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)'$+ end="^\s*\z1\>" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<=\s*'\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)'$+ end="^\s*\z1\>" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)'$+ end="^\s*\z1\>" contained contains=@htmlJavascript,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<=\s*'\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)'$+ end="^\s*\z1\>" contained contains=@htmlJavascript,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_sql_nowdoc") && php_sql_nowdoc)
|
if (exists("php_sql_nowdoc") && php_sql_nowdoc)
|
||||||
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)'$+ end="^\s*\z1\>" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<=\s*'\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)'$+ end="^\s*\z1\>" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_xml_nowdoc") && php_xml_nowdoc)
|
if (exists("php_xml_nowdoc") && php_xml_nowdoc)
|
||||||
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)'$+ end="^\s*\z1\>" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<=\s*'\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)'$+ end="^\s*\z1\>" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
" @end phpNowDoc
|
" @end phpNowDoc
|
||||||
else
|
else
|
||||||
" @begin phpNowDoc
|
" @begin phpNowDoc
|
||||||
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\I\i*\)'$+ end="^\z1\(;\=$\)\@=" contained keepend extend
|
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<=\s*'\z(\I\i*\)'$+ end="^\z1\(;\=$\)\@=" contained keepend extend
|
||||||
" including HTML,JavaScript,SQL if enabled via options
|
" including HTML,JavaScript,SQL if enabled via options
|
||||||
if (exists("php_html_in_nowdoc") && php_html_in_nowdoc)
|
if (exists("php_html_in_nowdoc") && php_html_in_nowdoc)
|
||||||
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<=\s*'\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<=\s*'\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_sql_nowdoc") && php_sql_nowdoc)
|
if (exists("php_sql_nowdoc") && php_sql_nowdoc)
|
||||||
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<=\s*'\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_xml_nowdoc") && php_xml_nowdoc)
|
if (exists("php_xml_nowdoc") && php_xml_nowdoc)
|
||||||
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<='\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpNowDoc matchgroup=Delimiter start=+\(<<<\)\@3<=\s*'\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)'$+ end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
" @end phpNowDoc
|
" @end phpNowDoc
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
if b:php_version_id >= 70300
|
if b:php_version_id >= 70300
|
||||||
" @copy phpHereDoc strip_maximum_size
|
" @copy phpHereDoc strip_maximum_size
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\I\i*\)$" end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<="\z(\I\i*\)"$+ end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<=\s*"\z(\I\i*\)"$+ end="^\s*\z1\>" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
" including HTML,JavaScript,SQL if enabled via options
|
" including HTML,JavaScript,SQL if enabled via options
|
||||||
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
|
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_sql_heredoc") && php_sql_heredoc)
|
if (exists("php_sql_heredoc") && php_sql_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_xml_heredoc") && php_xml_heredoc)
|
if (exists("php_xml_heredoc") && php_xml_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\s*\z1\>" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
" @end phpNowDoc
|
" @end phpNowDoc
|
||||||
else
|
else
|
||||||
" @copy phpHereDoc strip_maximum_size
|
" @copy phpHereDoc strip_maximum_size
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<="\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<=\s*"\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=@Spell,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
" including HTML,JavaScript,SQL if enabled via options
|
" including HTML,JavaScript,SQL if enabled via options
|
||||||
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
|
if (exists("php_html_in_heredoc") && php_html_in_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_sql_heredoc") && php_sql_heredoc)
|
if (exists("php_sql_heredoc") && php_sql_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
if (exists("php_xml_heredoc") && php_xml_heredoc)
|
if (exists("php_xml_heredoc") && php_xml_heredoc)
|
||||||
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
SynFold syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\s*\z(\(\I\i*\)\=\(xml\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@xmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend
|
||||||
endif
|
endif
|
||||||
" @end phpNowDoc
|
" @end phpNowDoc
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ syntax region plantumlText oneline start=/\[/ms=s+1 end=/\]/me=s-1 contained
|
|||||||
syntax match plantumlArrowDirectedLine /\([-.]\)\%(l\%[eft]\|r\%[ight]\|up\?\|d\%[own]\)\1/ contained
|
syntax match plantumlArrowDirectedLine /\([-.]\)\%(l\%[eft]\|r\%[ight]\|up\?\|d\%[own]\)\1/ contained
|
||||||
|
|
||||||
" Note and legend
|
" Note and legend
|
||||||
syntax region plantumlNoteMultiLine start=/\%(^\s*[rh]\?\%(note\|legend\)\)\@<=\s\%([^:"]\+$\)\@=/ end=/^\%(\s*end\s*[rh]\?\%(note\|legend\)$\)\|endlegend\@=/ contains=plantumlSpecialString,plantumlNoteMultiLineStart,plantumlTag
|
syntax region plantumlNoteMultiLine start=/\%(^\s*[rh]\?\%(note\|legend\)\)\@<=\s\%([^:"]\+$\)\@=/ end=/^\%(\s*\zeend\s*[rh]\?\%(note\|legend\)$\)\|endlegend\@=/ contains=plantumlSpecialString,plantumlNoteMultiLineStart,plantumlTag
|
||||||
syntax match plantumlNoteMultiLineStart /\%(^\s*[rh]\?\%(note\|legend\)\)\@<=\s\%([^:]\+$\)/ contained contains=plantumlKeyword,plantumlColor,plantumlString,plantumlTag
|
syntax match plantumlNoteMultiLineStart /\%(^\s*[rh]\?\%(note\|legend\)\)\@<=\s\%([^:]\+$\)/ contained contains=plantumlKeyword,plantumlColor,plantumlString,plantumlTag
|
||||||
|
|
||||||
" Class
|
" Class
|
||||||
@@ -140,11 +140,11 @@ syntax match plantumlActivityLabel /\%(^\%(#\S\+\)\?\)\@<=:\_[^;|<>/\]}]\+[;|<>/
|
|||||||
syntax match plantumlSequenceDivider /^\s*==[^=]\+==\s*$/
|
syntax match plantumlSequenceDivider /^\s*==[^=]\+==\s*$/
|
||||||
syntax match plantumlSequenceSpace /^\s*|||\+\s*$/
|
syntax match plantumlSequenceSpace /^\s*|||\+\s*$/
|
||||||
syntax match plantumlSequenceSpace /^\s*||\d\+||\+\s*$/
|
syntax match plantumlSequenceSpace /^\s*||\d\+||\+\s*$/
|
||||||
syntax match plantumlSequenceDelay /^\.\{3}$/
|
syntax match plantumlSequenceDelay /^\s*\.\{3}$/
|
||||||
syntax region plantumlText oneline matchgroup=plantumlSequenceDelay start=/^\.\{3}/ end=/\.\{3}$/
|
syntax region plantumlText oneline matchgroup=plantumlSequenceDelay start=/^\s*\.\{3}/ end=/\.\{3}$/
|
||||||
|
|
||||||
" Usecase diagram
|
" Usecase diagram
|
||||||
syntax match plantumlUsecaseActor /:.\{-1,}:/ contains=plantumlSpecialString
|
syntax match plantumlUsecaseActor /^\s*:.\{-1,}:/ contains=plantumlSpecialString
|
||||||
|
|
||||||
|
|
||||||
" Mindmap diagram
|
" Mindmap diagram
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ syn match ps1Type /\[[a-z_][a-z0-9_.,\[\]]\+\]/
|
|||||||
" Variable references
|
" Variable references
|
||||||
syn match ps1ScopeModifier /\(global:\|local:\|private:\|script:\)/ contained
|
syn match ps1ScopeModifier /\(global:\|local:\|private:\|script:\)/ contained
|
||||||
syn match ps1Variable /\$\w\+\(:\w\+\)\?/ contains=ps1ScopeModifier
|
syn match ps1Variable /\$\w\+\(:\w\+\)\?/ contains=ps1ScopeModifier
|
||||||
syn match ps1Variable /\${\w\+\(:\w\+\)\?}/ contains=ps1ScopeModifier
|
syn match ps1Variable /\${\w\+\(:\?[[:alnum:]_()]\+\)\?}/ contains=ps1ScopeModifier
|
||||||
|
|
||||||
" Operators
|
" Operators
|
||||||
syn keyword ps1Operator -eq -ne -ge -gt -lt -le -like -notlike -match -notmatch -replace -split -contains -notcontains
|
syn keyword ps1Operator -eq -ne -ge -gt -lt -le -like -notlike -match -notmatch -replace -split -contains -notcontains
|
||||||
|
|||||||
57
syntax/requirements.vim
Normal file
57
syntax/requirements.vim
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'requirements') == -1
|
||||||
|
|
||||||
|
" the Requirements File Format syntax support for Vim
|
||||||
|
" Version: 1.5.3
|
||||||
|
" Author: raimon <raimon49@hotmail.com>
|
||||||
|
" License: MIT LICENSE
|
||||||
|
" The MIT License (MIT)
|
||||||
|
"
|
||||||
|
" Copyright (c) 2015 raimon
|
||||||
|
"
|
||||||
|
" Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
" of this software and associated documentation files (the "Software"), to deal
|
||||||
|
" in the Software without restriction, including without limitation the rights
|
||||||
|
" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
" copies of the Software, and to permit persons to whom the Software is
|
||||||
|
" furnished to do so, subject to the following conditions:
|
||||||
|
"
|
||||||
|
" The above copyright notice and this permission notice shall be included in all
|
||||||
|
" copies or substantial portions of the Software.
|
||||||
|
"
|
||||||
|
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
" SOFTWARE.
|
||||||
|
|
||||||
|
if exists("b:current_syntax") && b:current_syntax == "requirements"
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn case match
|
||||||
|
|
||||||
|
syn region requirementsComment start="[ \t]*#" end="$"
|
||||||
|
syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?"
|
||||||
|
syn match requirementsVersionSpecifiers "\v(\=\=\=?|\<\=?|\>\=?|\~\=|\!\=)"
|
||||||
|
syn match requirementsPackageName "\v^([a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9])"
|
||||||
|
syn match requirementsExtras "\v\[\S+\]"
|
||||||
|
syn match requirementsVersionControls "\v(git\+?|hg\+|svn\+|bzr\+).*://.\S+"
|
||||||
|
syn match requirementsURLs "\v(\@\s)?(https?|ftp|gopher)://?[^\s/$.?#].\S*"
|
||||||
|
syn match requirementsEnvironmentMarkers "\v;\s[^#]+"
|
||||||
|
|
||||||
|
hi link requirementsComment Comment
|
||||||
|
hi link requirementsCommandOption Special
|
||||||
|
hi link requirementsVersionSpecifiers Boolean
|
||||||
|
hi link requirementsPackageName Identifier
|
||||||
|
hi link requirementsExtras Type
|
||||||
|
hi link requirementsVersionControls Underlined
|
||||||
|
hi link requirementsURLs Underlined
|
||||||
|
hi link requirementsEnvironmentMarkers Macro
|
||||||
|
|
||||||
|
let b:current_syntax = "requirements"
|
||||||
|
|
||||||
|
" vim: et sw=4 ts=4 sts=4:
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -232,6 +232,27 @@ syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError star
|
|||||||
|
|
||||||
syn keyword rustTodo contained TODO FIXME XXX NB NOTE
|
syn keyword rustTodo contained TODO FIXME XXX NB NOTE
|
||||||
|
|
||||||
|
" asm! macro {{{2
|
||||||
|
syn region rustAsmMacro matchgroup=rustMacro start="\<asm!\s*(" end=")" contains=rustAsmDirSpec,rustAsmSym,rustAsmConst,rustAsmOptionsGroup,rustComment.*,rustString.*
|
||||||
|
|
||||||
|
" Clobbered registers
|
||||||
|
syn keyword rustAsmDirSpec in out lateout inout inlateout contained nextgroup=rustAsmReg skipwhite skipempty
|
||||||
|
syn region rustAsmReg start="(" end=")" contained contains=rustString
|
||||||
|
|
||||||
|
" Symbol operands
|
||||||
|
syn keyword rustAsmSym sym contained nextgroup=rustAsmSymPath skipwhite skipempty
|
||||||
|
syn region rustAsmSymPath start="\S" end=",\|)"me=s-1 contained contains=rustComment.*,rustIdentifier
|
||||||
|
|
||||||
|
" Const
|
||||||
|
syn region rustAsmConstBalancedParens start="("ms=s+1 end=")" contained contains=@rustAsmConstExpr
|
||||||
|
syn cluster rustAsmConstExpr contains=rustComment.*,rust.*Number,rustString,rustAsmConstBalancedParens
|
||||||
|
syn region rustAsmConst start="const" end=",\|)"me=s-1 contained contains=rustStorage,@rustAsmConstExpr
|
||||||
|
|
||||||
|
" Options
|
||||||
|
syn region rustAsmOptionsGroup start="options\s*(" end=")" contained contains=rustAsmOptions,rustAsmOptionsKey
|
||||||
|
syn keyword rustAsmOptionsKey options contained
|
||||||
|
syn keyword rustAsmOptions pure nomem readonly preserves_flags noreturn nostack att_syntax contained
|
||||||
|
|
||||||
" Folding rules {{{2
|
" Folding rules {{{2
|
||||||
" Trivial folding rules to begin with.
|
" Trivial folding rules to begin with.
|
||||||
" FIXME: use the AST to make really good folding
|
" FIXME: use the AST to make really good folding
|
||||||
@@ -347,6 +368,10 @@ hi def link rustObsoleteExternMod Error
|
|||||||
hi def link rustQuestionMark Special
|
hi def link rustQuestionMark Special
|
||||||
hi def link rustAsync rustKeyword
|
hi def link rustAsync rustKeyword
|
||||||
hi def link rustAwait rustKeyword
|
hi def link rustAwait rustKeyword
|
||||||
|
hi def link rustAsmDirSpec rustKeyword
|
||||||
|
hi def link rustAsmSym rustKeyword
|
||||||
|
hi def link rustAsmOptions rustKeyword
|
||||||
|
hi def link rustAsmOptionsKey rustAttribute
|
||||||
|
|
||||||
" Other Suggestions:
|
" Other Suggestions:
|
||||||
" hi rustAttribute ctermfg=cyan
|
" hi rustAttribute ctermfg=cyan
|
||||||
|
|||||||
60
syntax/sh.vim
Normal file
60
syntax/sh.vim
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sh') == -1
|
||||||
|
|
||||||
|
" Shebang
|
||||||
|
syn match shShebang "^#!.*$" containedin=shComment
|
||||||
|
|
||||||
|
" Operators
|
||||||
|
syn match shOperator '||'
|
||||||
|
syn match shOperator '&&'
|
||||||
|
|
||||||
|
" Match semicolons as Delimiter rather than Operator
|
||||||
|
syn match shSemicolon ';' containedin=shOperator,zshOperator
|
||||||
|
|
||||||
|
" Highlight braces, brackets and parens as Delimiters in zsh
|
||||||
|
syn match zshDelim '\v(\(|\))' containedin=zshParentheses
|
||||||
|
syn match zshDelim '\v(\{|\})' containedin=zshBraces
|
||||||
|
syn match zshDelim '\v(\[|\])' containedin=zshParentheses
|
||||||
|
|
||||||
|
" Match command flags in zsh
|
||||||
|
syn match zshFlag "\v<-\w+" containedin=zshBrackets,zshParentheses
|
||||||
|
|
||||||
|
" Special files as Constants
|
||||||
|
syn match Constant "\v/dev/\w+"
|
||||||
|
\ containedin=shFunctionOne,shIf,shCmdParenRegion,shCommandSub
|
||||||
|
|
||||||
|
" Common commands
|
||||||
|
let commands = [ 'arch', 'awk', 'b2sum', 'base32', 'base64', 'basename', 'basenc', 'bash', 'brew', 'cat', 'chcon', 'chgrp', 'chown', 'chroot', 'cksum', 'comm', 'cp', 'csplit', 'curl', 'cut', 'date', 'dd', 'defaults', 'df', 'dir', 'dircolors', 'dirname', 'ed', 'env', 'expand', 'factor', 'fmt', 'fold', 'git', 'grep', 'groups', 'head', 'hexdump', 'hostid', 'hostname', 'hugo', 'id', 'install', 'join', 'killall', 'link', 'ln', 'logname', 'md5sum', 'mkdir', 'mkfifo', 'mknod', 'mktemp', 'nice', 'nl', 'nohup', 'npm', 'nproc', 'numfmt', 'od', 'open', 'paste', 'pathchk', 'pr', 'printenv', 'printf', 'ptx', 'readlink', 'realpath', 'rg', 'runcon', 'scutil', 'sed', 'seq', 'sha1sum', 'sha2', 'shred', 'shuf', 'split', 'stat', 'stdbuf', 'stty', 'sudo', 'sum', 'sync', 'tac', 'tee', 'terminfo', 'timeout', 'tmux', 'top', 'touch', 'tput', 'tr', 'truncate', 'tsort', 'tty', 'uname', 'unexpand', 'uniq', 'unlink', 'uptime', 'users', 'vdir', 'vim', 'wc', 'who', 'whoami', 'yabai', 'yes' ]
|
||||||
|
|
||||||
|
for i in commands
|
||||||
|
execute 'syn match shStatement "\v(\w|-)@<!'
|
||||||
|
\ . i
|
||||||
|
\ . '(\w|-)@!" containedin=shFunctionOne,shIf,shCmdParenRegion,shCommandSub,zshBrackets'
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" Fix default highlighting groups
|
||||||
|
hi def link bashSpecialVariables Identifier
|
||||||
|
hi def link shCmdSubRegion Delimiter
|
||||||
|
hi def link shDerefSimple Identifier
|
||||||
|
hi def link shFor Identifier
|
||||||
|
hi def link shFunctionKey Statement
|
||||||
|
hi def link shQuote StringDelimiter
|
||||||
|
hi def link shRange Delimiter
|
||||||
|
hi def link shSnglCase Delimiter
|
||||||
|
hi def link shStatement Statement
|
||||||
|
hi def link shTestOpr Operator
|
||||||
|
hi def link shVarAssign Operator
|
||||||
|
hi def link zshDeref Identifier
|
||||||
|
hi def link zshFunction Function
|
||||||
|
hi def link zshOperator Operator
|
||||||
|
hi def link zshStringDelimiter StringDelimiter
|
||||||
|
hi def link zshSubst Identifier
|
||||||
|
hi def link zshSubstDelim Delimiter
|
||||||
|
hi def link zshVariableDef Identifier
|
||||||
|
|
||||||
|
" Link custom groups
|
||||||
|
hi def link shSemicolon Delimiter
|
||||||
|
hi def link shShebang PreProc
|
||||||
|
hi def link zshDelim Delimiter
|
||||||
|
hi def link zshFlag Special
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -43,7 +43,8 @@ syn match slimTag "\w\+[><]*" contained contains=htmlTagName n
|
|||||||
syn match slimIdChar "#{\@!" contained nextgroup=slimId
|
syn match slimIdChar "#{\@!" contained nextgroup=slimId
|
||||||
syn match slimId "\%(\w\|-\)\+" contained nextgroup=@slimComponent
|
syn match slimId "\%(\w\|-\)\+" contained nextgroup=@slimComponent
|
||||||
syn match slimClassChar "\." contained nextgroup=slimClass
|
syn match slimClassChar "\." contained nextgroup=slimClass
|
||||||
syn match slimClass "\%(\w\|-\)\+" contained nextgroup=@slimComponent
|
syn match slimClass "\%(\w\|-\|\/\|:\(\w\|-\)\+\)\+" contained nextgroup=@slimComponent
|
||||||
|
|
||||||
syn match slimInlineTagChar "\s*:\s*" contained nextgroup=slimTag,slimClassChar,slimIdChar
|
syn match slimInlineTagChar "\s*:\s*" contained nextgroup=slimTag,slimClassChar,slimIdChar
|
||||||
|
|
||||||
syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*{\s*" skip="}\s*\"" end="\s*}\s*" contained contains=slimAttr nextgroup=slimRuby
|
syn region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*{\s*" skip="}\s*\"" end="\s*}\s*" contained contains=slimAttr nextgroup=slimRuby
|
||||||
@@ -73,6 +74,7 @@ syn region slimJavascriptFilter matchgroup=slimFilter start="^\z(\s*\)javascript
|
|||||||
syn region slimCoffeeFilter matchgroup=slimFilter start="^\z(\s*\)coffee:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@coffeeAll,slimInterpolation keepend
|
syn region slimCoffeeFilter matchgroup=slimFilter start="^\z(\s*\)coffee:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@coffeeAll,slimInterpolation keepend
|
||||||
syn region slimCSSFilter matchgroup=slimFilter start="^\z(\s*\)css:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlCss,slimInterpolation keepend
|
syn region slimCSSFilter matchgroup=slimFilter start="^\z(\s*\)css:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlCss,slimInterpolation keepend
|
||||||
syn region slimSassFilter matchgroup=slimFilter start="^\z(\s*\)sass:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlSassTop
|
syn region slimSassFilter matchgroup=slimFilter start="^\z(\s*\)sass:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlSassTop
|
||||||
|
syn region slimRubyFilter matchgroup=slimFilter start="^\z(\s*\)ruby:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@slimRubyTop keepend
|
||||||
|
|
||||||
syn region slimRuby matchgroup=slimRubyOutputChar start="\s*[=]\==[']\=" skip="\%\(,\s*\|\\\)$" end="$" contained contains=@slimRubyTop keepend
|
syn region slimRuby matchgroup=slimRubyOutputChar start="\s*[=]\==[']\=" skip="\%\(,\s*\|\\\)$" end="$" contained contains=@slimRubyTop keepend
|
||||||
syn region slimRuby matchgroup=slimRubyChar start="\s*-" skip="\%\(,\s*\|\\\)$" end="$" contained contains=@slimRubyTop keepend
|
syn region slimRuby matchgroup=slimRubyChar start="\s*-" skip="\%\(,\s*\|\\\)$" end="$" contained contains=@slimRubyTop keepend
|
||||||
|
|||||||
266
syntax/sql.vim
Normal file
266
syntax/sql.vim
Normal file
@@ -0,0 +1,266 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sql') == -1
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: SQL with SQLite and other additions.
|
||||||
|
" Maintainer: Jessica K McIntosh AT gmail DOT com
|
||||||
|
" Last Changed: Thu Jan 23 06:00 PM 2014 EST
|
||||||
|
|
||||||
|
" More complete SQL matching with error reporting.
|
||||||
|
" Only matches types inside 'CREATE TABLE ();'.
|
||||||
|
" Highlights functions. Unknown functions are an error.
|
||||||
|
" Based on the SQL syntax files that come with Vim.
|
||||||
|
|
||||||
|
" For version 5.x: Clear all syntax items
|
||||||
|
" For version 6.x: Quit when a syntax file was already loaded
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn case ignore
|
||||||
|
|
||||||
|
" All non-contained SQL syntax.
|
||||||
|
syn cluster sqlALL contains=TOP
|
||||||
|
|
||||||
|
" Various error conditions.
|
||||||
|
"syn match sqlError "\<\w\+(" " Not a known function.
|
||||||
|
syn match sqlError ")" " Lonely closing paren.
|
||||||
|
syn match sqlError ",\(\_\s*[;)]\)\@=" " Comma before a paren or semicolon.
|
||||||
|
syn match sqlError " $" " Space at the end of a line.
|
||||||
|
" Comma before certain words.
|
||||||
|
syn match sqlError ",\_\s*\(\<\(asc\|desc\|exists\|for\|from\)\>\)\@="
|
||||||
|
syn match sqlError ",\_\s*\(\<\(group by\|into\|limit\|order\)\>\)\@="
|
||||||
|
syn match sqlError ",\_\s*\(\<\(table\|using\|where\)\>\)\@="
|
||||||
|
|
||||||
|
" Special words.
|
||||||
|
syn keyword sqlSpecial false null true
|
||||||
|
|
||||||
|
" Keywords
|
||||||
|
syn keyword sqlKeyword access add after aggregate as asc authorization
|
||||||
|
syn keyword sqlKeyword begin by cache cascade check cluster collate
|
||||||
|
syn keyword sqlKeyword collation column compress conflict connect connection
|
||||||
|
syn keyword sqlKeyword constraint current cursor database debug decimal
|
||||||
|
syn keyword sqlKeyword default desc each else elsif escape exception
|
||||||
|
syn keyword sqlKeyword exclusive explain external file for foreign from function
|
||||||
|
syn keyword sqlKeyword group having identified if immediate increment index
|
||||||
|
syn keyword sqlKeyword initial inner into is join key left level loop
|
||||||
|
syn keyword sqlKeyword maxextents mode modify nocompress nowait object of
|
||||||
|
syn keyword sqlKeyword off offline on online option order outer pctfree
|
||||||
|
syn keyword sqlKeyword primary privileges procedure public references
|
||||||
|
syn keyword sqlKeyword referencing release resource return role row rowid
|
||||||
|
syn keyword sqlKeyword rowlabel rownum rows schema session share size
|
||||||
|
syn keyword sqlKeyword start successful synonym then to transaction trigger
|
||||||
|
syn keyword sqlKeyword uid user using validate values view virtual whenever
|
||||||
|
syn keyword sqlKeyword where with
|
||||||
|
syn match sqlKeyword "\<prompt\>"
|
||||||
|
syn match sqlKeyword "\<glob\>"
|
||||||
|
" Do special things with CREATE TABLE ( below.
|
||||||
|
syn match sqlKeyword "\<table\>"
|
||||||
|
|
||||||
|
" SQLite Pragmas - Treat them as keywords.
|
||||||
|
syn keyword sqlKeyword auto_vacuum automatic_index cache_size
|
||||||
|
syn keyword sqlKeyword case_sensitive_like checkpoint_fullfsync
|
||||||
|
syn keyword sqlKeyword collation_list compile_options count_changes
|
||||||
|
syn keyword sqlKeyword database_list default_cache_size
|
||||||
|
syn keyword sqlKeyword empty_result_callbacks encoding foreign_key_list
|
||||||
|
syn keyword sqlKeyword foreign_keys freelist_count full_column_names
|
||||||
|
syn keyword sqlKeyword fullfsync ignore_check_constraints
|
||||||
|
syn keyword sqlKeyword incremental_vacuum index_info index_list
|
||||||
|
syn keyword sqlKeyword integrity_check journal_mode journal_size_limit
|
||||||
|
syn keyword sqlKeyword legacy_file_format locking_mode max_page_count
|
||||||
|
syn keyword sqlKeyword page_count page_size parser_trace quick_check
|
||||||
|
syn keyword sqlKeyword read_uncommitted recursive_triggers
|
||||||
|
syn keyword sqlKeyword reverse_unordered_selects schema_version
|
||||||
|
syn keyword sqlKeyword secure_delete short_column_names synchronous
|
||||||
|
syn keyword sqlKeyword table_info temp_store temp_store_directory
|
||||||
|
syn keyword sqlKeyword user_version vdbe_listing vdbe_trace
|
||||||
|
syn keyword sqlKeyword wal_autocheckpoint wal_checkpoint writable_schema
|
||||||
|
|
||||||
|
" Operators
|
||||||
|
syn keyword sqlOperator all and any between case distinct elif else end
|
||||||
|
syn keyword sqlOperator exit exists if in intersect is like match matches
|
||||||
|
syn keyword sqlOperator minus not or out prior regexp some then union
|
||||||
|
syn keyword sqlOperator unique when
|
||||||
|
syn match sqlOperator "||\|:="
|
||||||
|
|
||||||
|
" Conditionals
|
||||||
|
syn match sqlConditional "=\|<\|>\|+\|-"
|
||||||
|
|
||||||
|
" Unknown functions.
|
||||||
|
syn match sqlUnknownFunc "\<\w\+(\@="
|
||||||
|
|
||||||
|
" Functions - Only valid with a '(' after them.
|
||||||
|
syn match sqlFunction "\<\(abs\|acos\|asin\|atan2\?\|avg\|cardinality\)(\@="
|
||||||
|
syn match sqlFunction "\<\(cast\|changes\|char_length\|character_length\)(\@="
|
||||||
|
syn match sqlFunction "\<\(coalesce\|concat\|cos\|count\|\(date\)\?\(time\)\?\)(\@="
|
||||||
|
syn match sqlFunction "\<\(exp\|filetoblob\|filetoclob\|floor\|glob\|group_concat\)(\@="
|
||||||
|
syn match sqlFunction "\<\(hex\|ifnull\|initcap\|isnull\|julianday\|last_insert_rowid\)(\@="
|
||||||
|
syn match sqlFunction "\<\(length\|log10\|logn\|lower\|lpad\|ltrin\|max\|min\)(\@="
|
||||||
|
syn match sqlFunction "\<\(mod\|nullif\|octet_length\|pow\|quote\|random\)(\@="
|
||||||
|
syn match sqlFunction "\<\(range\|replace\|root\|round\|rpad\|sin\|soundex\)(\@="
|
||||||
|
syn match sqlFunction "\<\(sqrtstdev\|strftime\|substr\|substring\|sum\|sysdate\|tan\)(\@="
|
||||||
|
syn match sqlFunction "\<\(to_char\|to_date\|to_number\|total\|trim\|trunc\|typeof\)(\@="
|
||||||
|
syn match sqlFunction "\<\(upper\|variance\)(\@="
|
||||||
|
|
||||||
|
" Oracle DBMS functions.
|
||||||
|
syn match sqlFunction "\<dbms_\w\+\.\w\+(\@="
|
||||||
|
|
||||||
|
" Oracle Exception Functions.
|
||||||
|
syn match sqlFunction "\<raise_application_error(\@="
|
||||||
|
|
||||||
|
" SQLite Functions
|
||||||
|
syn match sqlFunction "\<\(last_insert_rowid\|load_extension\|randomblob\)(\@="
|
||||||
|
syn match sqlFunction "\<\(sqlite_compileoption_get\|sqlite_compileoption_used\)(\@="
|
||||||
|
syn match sqlFunction "\<\(sqlite_source_id\|sqlite_version\|sqlite_version\)(\@="
|
||||||
|
syn match sqlFunction "\<\(zeroblob\|ltrim\|rtrim\)(\@="
|
||||||
|
|
||||||
|
" SQLite Command Line Client Functions
|
||||||
|
syn match sqlFunction "^\.\w\+"
|
||||||
|
|
||||||
|
" Statements
|
||||||
|
syn keyword sqlStatement alter analyze audit begin comment commit delete
|
||||||
|
syn keyword sqlStatement drop execute explain grant insert lock noaudit
|
||||||
|
syn keyword sqlStatement rename revoke rollback savepoint select
|
||||||
|
syn keyword sqlStatement truncate update vacuum
|
||||||
|
syn match sqlStatement "\<\(replace\|create\)\>"
|
||||||
|
|
||||||
|
" SQLite Statements
|
||||||
|
syn keyword sqlStatement attach detach indexed pragma reindex
|
||||||
|
|
||||||
|
" Types - Only matched inside 'CREATE TABLE ();'.
|
||||||
|
syn keyword sqlType contained bigint bit blob bool boolean byte char
|
||||||
|
syn keyword sqlType contained clob date datetime dec decimal enum
|
||||||
|
syn keyword sqlType contained float int int8 integer interval long
|
||||||
|
syn keyword sqlType contained longblob longtext lvarchar mediumblob
|
||||||
|
syn keyword sqlType contained mediumint mediumtext mlslabel money
|
||||||
|
syn keyword sqlType contained multiset nchar number numeric nvarchar
|
||||||
|
syn keyword sqlType contained raw real rowid serial serial8 set
|
||||||
|
syn keyword sqlType contained smallfloat smallint text time
|
||||||
|
syn keyword sqlType contained timestamp tinyblob tinyint tinytext
|
||||||
|
syn keyword sqlType contained varchar varchar2 varray year
|
||||||
|
syn match sqlType contained "\<\(character\|double\|varying\)\>"
|
||||||
|
syn match sqlType contained "\<character\s\+varying\>"
|
||||||
|
syn match sqlType contained "\<double\s\+precision\>"
|
||||||
|
|
||||||
|
" Oracle Variables
|
||||||
|
syn match sqlVariable "&\a\w\+"
|
||||||
|
syn match sqlVariable ":\w\+"
|
||||||
|
syn match sqlVariable "SQL%\w\+"
|
||||||
|
|
||||||
|
" Strings
|
||||||
|
syn region sqlString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=sqlVariable
|
||||||
|
syn region sqlString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=sqlVariable
|
||||||
|
syn region sqlString start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=sqlVariable
|
||||||
|
|
||||||
|
" Numbers
|
||||||
|
syn match sqlNumber "-\=\<[0-9]*\>"
|
||||||
|
syn match sqlNumber "-\=\<[0-9]*\.[0-9]*\>"
|
||||||
|
syn match sqlNumber "-\=\<[0-9][0-9]*e[+-]\=[0-9]*\>"
|
||||||
|
syn match sqlNumber "-\=\<[0-9]*\.[0-9]*e[+-]\=[0-9]*\>"
|
||||||
|
syn match sqlNumber "\<0x[abcdef0-9]*\>"
|
||||||
|
|
||||||
|
" Todo
|
||||||
|
syn keyword sqlTodo contained DEBUG FIXME NOTE TODO XXX
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syn region sqlComment start="/\*" end="\*/" contains=sqlTodo
|
||||||
|
syn match sqlComment "--.*$" contains=sqlTodo
|
||||||
|
syn match sqlComment "\(^\|\s\)rem.*$" contains=sqlTodo
|
||||||
|
|
||||||
|
" Mark correct paren use. Different colors for different purposes.
|
||||||
|
syn region sqlParens transparent matchgroup=sqlParen start="(" end=")"
|
||||||
|
syn match sqlParenEmpty "()"
|
||||||
|
syn region sqlParens transparent matchgroup=sqlParenFunc start="\(\<\w\+\>\)\@<=(" end=")"
|
||||||
|
|
||||||
|
" Highlight types correctly inside create table and procedure statements.
|
||||||
|
" All other SQL is properly highlighted as well.
|
||||||
|
syn region sqlTypeParens contained matchgroup=sqlType start="(" end=")" contains=@sqlALL
|
||||||
|
syn match sqlTypeMatch contained "\(\(^\|[,(]\)\s*\S\+\s\+\)\@<=\w\+\(\s*([^)]\+)\)\?" contains=sqlType,sqlTypeParens
|
||||||
|
syn match sqlTypeMatch contained "\(\(^\|[,(]\)\s*\S\+\s\+\)\@<=character\s\+varying\s*([^)]\+)" contains=sqlType,sqlTypeParens
|
||||||
|
syn region sqlTypeRegion matchgroup=sqlParen start="\(create\s\+table\s\+[^(]\+\s\+\)\@<=(" end=")" contains=@sqlALL,sqlTypeMatch
|
||||||
|
syn region sqlTypeRegion matchgroup=sqlParen start="\(create\s\+\(or\s\+replace\s\+\)\?procedure\s\+[^(]\+\s*\)\@<=(" end=")" contains=@sqlALL,sqlTypeMatch
|
||||||
|
|
||||||
|
" SQL Embedded in a statement.
|
||||||
|
syn region sqlquoteRegion matchgroup=sqlParen start="\(execute\s\+immediate\s*\)\@<=('" end="')" contains=@sqlALL
|
||||||
|
|
||||||
|
" Special Oracle Statements
|
||||||
|
syn match sqlStatement "^\s*\(prompt\|spool\)\>" nextgroup=sqlAnyString
|
||||||
|
syn match sqlStatement "^\s*accept\s\+" nextgroup=sqlAnyVariable
|
||||||
|
syn match sqlStatement "declare\s\+" nextgroup=sqlDeclare
|
||||||
|
syn region sqlDeclare contained matchgroup=sqlVariable start="\a\w\+" end="$" contains=@sqlALL,sqlType
|
||||||
|
syn match sqlOperator "^@" nextgroup=sqlAnyString
|
||||||
|
syn match sqlAnyVariable contained "\a\w\+"
|
||||||
|
syn match sqlAnyString contained ".*" contains=sqlVariable
|
||||||
|
|
||||||
|
syn region sqlSetRegion matchgroup=sqlStatement start="^\s*set\>" matchgroup=NONE end="$" contains=sqlSetOptions,sqlSetValues
|
||||||
|
syn keyword sqlSetOptions contained autorecovery colsep copytypecheck describe escchar flagger
|
||||||
|
syn keyword sqlSetOptions contained instance logsource long null recsep recsepchar
|
||||||
|
syn keyword sqlSetOptions contained
|
||||||
|
syn match sqlSetOptions contained "\<\(app\w*\|array\w*\|auto\w*\|autop\w*\)\>"
|
||||||
|
syn match sqlSetOptions contained "\<\(autot\w*\|blo\w*\|cmds\w*\|con\w*\|copyc\w*\)\>"
|
||||||
|
syn match sqlSetOptions contained "\<\(def\w*\|echo\|editf\w*\|emb\w*\|errorl\w*\|esc\w*\)\>"
|
||||||
|
syn match sqlSetOptions contained "\<\(feed\w*\|flu\w*\|hea\w*\|heads\w*\|lin\w*\)\>"
|
||||||
|
syn match sqlSetOptions contained "\<\(lobof\w*\|longc\w*\|mark\w*\|newp\w*\|numf\w*\)\>"
|
||||||
|
syn match sqlSetOptions contained "\<\(pages\w*\|pau\w*\|serverout\w*\|shift\w*\|show\w*\)\>"
|
||||||
|
syn match sqlSetOptions contained "\<\(sqlbl\w*\|sqlc\w*\|sqlco\w*\|sqln\w*\|sqlpluscompat\w*\)\>"
|
||||||
|
syn match sqlSetOptions contained "\<\(sqlpre\w*\|sqlp\w*\|sqlt\w*\|suf\w*\|tab\)\>"
|
||||||
|
syn match sqlSetOptions contained "\<\(term\w*\|timi\w*\|und\w*\|ver\w*\|wra\w\?\)\>"
|
||||||
|
syn match sqlSetOptions contained "\<\(xquery\s\+\(baseuri\|ordering\|node\|context\)\)\>"
|
||||||
|
syn keyword sqlSetValues contained all body byreference byvalue default
|
||||||
|
syn keyword sqlSetValues contained entry fill head html identifier indent
|
||||||
|
syn keyword sqlSetValues contained linenum local none off on size table truncate
|
||||||
|
syn match sqlSetValues contained "\<\(ea\w*\|wr\w*\|imm\w*\|trace\w*\|expl\w*\|stat\w*\)\>"
|
||||||
|
syn match sqlSetValues contained "\<\(intermed\w*\|pre\w*\|unl\w*\|for\w*\|wra\w*\|wor\w\?\)\>"
|
||||||
|
syn match sqlSetValues contained "\<\(vis\w*\|inv\w*\)\>"
|
||||||
|
syn match sqlSetValues contained "\<\(\(un\)\?ordered\)\>"
|
||||||
|
|
||||||
|
" Stolen from sh.vim.
|
||||||
|
if !exists("sh_minlines")
|
||||||
|
let sh_minlines = 200
|
||||||
|
endif
|
||||||
|
if !exists("sh_maxlines")
|
||||||
|
let sh_maxlines = 2 * sh_minlines
|
||||||
|
endif
|
||||||
|
exec "syn sync minlines=" . sh_minlines . " maxlines=" . sh_maxlines
|
||||||
|
|
||||||
|
" Define the default highlighting.
|
||||||
|
" For version 5.7 and earlier: only when not done already
|
||||||
|
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||||
|
if version >= 508 || !exists("did_sql_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_sql_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
HiLink sqlComment Comment
|
||||||
|
HiLink sqlError Error
|
||||||
|
HiLink sqlFunction Function
|
||||||
|
HiLink sqlUnknownFunc Exception
|
||||||
|
HiLink sqlKeyword Special
|
||||||
|
HiLink sqlConditional Conditional
|
||||||
|
HiLink sqlNumber Number
|
||||||
|
HiLink sqlOperator Operator
|
||||||
|
HiLink sqlParen Comment
|
||||||
|
HiLink sqlParenEmpty Operator
|
||||||
|
HiLink sqlParenFunc Function
|
||||||
|
HiLink sqlSpecial Keyword
|
||||||
|
HiLink sqlStatement Statement
|
||||||
|
HiLink sqlString String
|
||||||
|
HiLink sqlTodo Todo
|
||||||
|
HiLink sqlType Type
|
||||||
|
HiLink sqlVariable Identifier
|
||||||
|
|
||||||
|
HiLink sqlAnyString sqlString
|
||||||
|
HiLink sqlAnyVariable sqlVariable
|
||||||
|
HiLink sqlSetOptions Operator
|
||||||
|
HiLink sqlSetValues Special
|
||||||
|
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax = "sql"
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -86,6 +86,7 @@ function! s:enabled(language)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Default tag definitions.
|
||||||
let s:languages = [
|
let s:languages = [
|
||||||
\ { 'name': 'less', 'tag': 'style' },
|
\ { 'name': 'less', 'tag': 'style' },
|
||||||
\ { 'name': 'scss', 'tag': 'style' },
|
\ { 'name': 'scss', 'tag': 'style' },
|
||||||
@@ -94,12 +95,17 @@ let s:languages = [
|
|||||||
\ { 'name': 'typescript', 'tag': 'script' },
|
\ { 'name': 'typescript', 'tag': 'script' },
|
||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
|
" Add global tag definitions to our defaults.
|
||||||
|
if exists('g:svelte_preprocessor_tags') && type('g:svelte_preprocessor_tags') == v:t_list
|
||||||
|
let s:languages += g:svelte_preprocessor_tags
|
||||||
|
endif
|
||||||
|
|
||||||
for s:language in s:languages
|
for s:language in s:languages
|
||||||
let s:attr = '\(lang\|type\)=\("\|''\)[^\2]*' . s:language.name . '[^\2]*\2'
|
let s:attr = '\(lang\|type\)=\("\|''\)[^\2]*' . s:language.name . '[^\2]*\2'
|
||||||
let s:start = '<' . s:language.tag . '\>\_[^>]*' . s:attr . '\_[^>]*>'
|
let s:start = '<' . s:language.tag . '\>\_[^>]*' . s:attr . '\_[^>]*>'
|
||||||
|
|
||||||
if s:enabled(s:language.name)
|
if s:enabled(s:language.name)
|
||||||
execute 'syntax include @' . s:language.name . ' syntax/' . s:language.name . '.vim'
|
execute 'syntax include @' . s:language.name . ' syntax/' . get(s:language, 'as', s:language.name) . '.vim'
|
||||||
unlet! b:current_syntax
|
unlet! b:current_syntax
|
||||||
|
|
||||||
execute 'syntax region svelte_' . s:language.name
|
execute 'syntax region svelte_' . s:language.name
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ syn match sdFormatStr contained /%[bCEfhHiIjJLmnNpPsStTgGuUvV%]/ containedin=ALL
|
|||||||
syn match sdUInt contained nextgroup=sdErr /\d\+/
|
syn match sdUInt contained nextgroup=sdErr /\d\+/
|
||||||
syn match sdInt contained nextgroup=sdErr /-\=\d\+/
|
syn match sdInt contained nextgroup=sdErr /-\=\d\+/
|
||||||
syn match sdOctal contained nextgroup=sdErr /0\o\{3,4}/
|
syn match sdOctal contained nextgroup=sdErr /0\o\{3,4}/
|
||||||
" sdDuration: see systemd.time(7)
|
" sdDuration, sdCalendar: see systemd.time(7)
|
||||||
syn match sdDuration contained nextgroup=sdErr /\d\+/
|
syn match sdDuration contained nextgroup=sdErr /\d\+/
|
||||||
syn match sdDuration contained nextgroup=sdErr /\%(\d\+\s*\%(usec\|msec\|seconds\=\|minutes\=\|hours\=\|days\=\|weeks\=\|months\=\|years\=\|us\|ms\|sec\|min\|hr\|[smhdwMy]\)\s*\)\+/
|
syn match sdDuration contained nextgroup=sdErr /\%(\d\+\s*\%(usec\|msec\|seconds\=\|minutes\=\|hours\=\|days\=\|weeks\=\|months\=\|years\=\|us\|ms\|sec\|min\|hr\|[smhdwMy]\)\s*\)\+/
|
||||||
syn match sdDatasize contained nextgroup=sdErr /\d\+[KMGT]/
|
syn match sdDatasize contained nextgroup=sdErr /\d\+[KMGT]/
|
||||||
@@ -35,6 +35,29 @@ syn match sdPercent contained nextgroup=sdErr /\d\+%/
|
|||||||
syn keyword sdBool contained nextgroup=sdErr 1 yes true on 0 no false off
|
syn keyword sdBool contained nextgroup=sdErr 1 yes true on 0 no false off
|
||||||
syn match sdUnitName contained /\S\+\.\(automount\|mount\|swap\|socket\|service\|target\|path\|timer\|device\|slice\|scope\)\_s/
|
syn match sdUnitName contained /\S\+\.\(automount\|mount\|swap\|socket\|service\|target\|path\|timer\|device\|slice\|scope\)\_s/
|
||||||
|
|
||||||
|
" type identifiers used in `systemd --dump-config`, from most to least common:
|
||||||
|
" 189 OTHER
|
||||||
|
" 179 BOOLEAN
|
||||||
|
" 136 LIMIT
|
||||||
|
" 46 CONDITION
|
||||||
|
" 36 WEIGHT
|
||||||
|
" 30 MODE
|
||||||
|
" 27 PATH
|
||||||
|
" 25 PATH [...]
|
||||||
|
" 24 SECONDS, STRING
|
||||||
|
" 20 SIGNAL
|
||||||
|
" 15 UNIT [...]
|
||||||
|
" 12 BANDWIDTH, DEVICEWEIGHT, SHARES, UNSIGNED
|
||||||
|
" 11 PATH [ARGUMENT [...]]
|
||||||
|
" 8 BOUNDINGSET, LEVEL, OUTPUT, PATH[:PATH[:OPTIONS]] [...], SOCKET [...]
|
||||||
|
" 6 ACTION, DEVICE, DEVICELATENCY, POLICY, SLICE, TIMER
|
||||||
|
" 5 KILLMODE
|
||||||
|
" 4 ARCHS, CPUAFFINITY, CPUSCHEDPOLICY, CPUSCHEDPRIO, ENVIRON, ERRNO, FACILITY, FAMILIES, FILE, INPUT, IOCLASS, IOPRIORITY, LABEL, MOUNTFLAG [...], NAMESPACES, NANOSECONDS, NICE, NOTSUPPORTED, OOMSCOREADJUST, PERSONALITY, SECUREBITS, SYSCALLS
|
||||||
|
" 3 INTEGER, SIZE, STATUS
|
||||||
|
" 2 LONG, UNIT
|
||||||
|
" 1 ACCESS, NETWORKINTERFACE, SERVICE, SERVICERESTART, SERVICETYPE, SOCKETBIND, SOCKETS, TOS, URL
|
||||||
|
|
||||||
|
|
||||||
" .include
|
" .include
|
||||||
syn match sdInclude /^.include/ nextgroup=sdFilename
|
syn match sdInclude /^.include/ nextgroup=sdFilename
|
||||||
|
|
||||||
@@ -48,48 +71,76 @@ syn region sdUnitBlock matchgroup=sdHeader start=/^\[Unit\]/ end=/^\[/me=e-2 con
|
|||||||
syn match sdUnitKey contained /^Description=/
|
syn match sdUnitKey contained /^Description=/
|
||||||
syn match sdUnitKey contained /^Documentation=/ nextgroup=sdDocURI
|
syn match sdUnitKey contained /^Documentation=/ nextgroup=sdDocURI
|
||||||
syn match sdUnitKey contained /^SourcePath=/ nextgroup=sdFilename,sdErr
|
syn match sdUnitKey contained /^SourcePath=/ nextgroup=sdFilename,sdErr
|
||||||
syn match sdUnitKey contained /^\%(Requires\|RequiresOverridable\|Requisite\|RequisiteOverridable\|Wants\|Binds\=To\|PartOf\|Conflicts\|Before\|After\|OnFailure\|Names|PropagatesReloadTo\|ReloadPropagatedFrom\)=/ nextgroup=sdUnitList
|
syn match sdUnitKey contained /^\%(Requires\|RequiresOverridable\|Requisite\|RequisiteOverridable\|Wants\|Binds\=To\|PartOf\|Conflicts\|Before\|After\|OnFailure\|Names\|Propagates\=ReloadTo\|ReloadPropagatedFrom\|PropagateReloadFrom\|JoinsNamespaceOf\)=/ nextgroup=sdUnitList
|
||||||
syn match sdUnitKey contained /^\%(OnFailureIsolate\|IgnoreOnIsolate\|IgnoreOnSnapshot\|StopWhenUnneeded\|RefuseManualStart\|RefuseManualStop\|AllowIsolate\|DefaultDependencies\)=/ nextgroup=sdBool,sdErr
|
syn match sdUnitKey contained /^\%(OnFailureIsolate\|IgnoreOnIsolate\|IgnoreOnSnapshot\|StopWhenUnneeded\|RefuseManualStart\|RefuseManualStop\|AllowIsolate\|DefaultDependencies\)=/ nextgroup=sdBool,sdErr
|
||||||
syn match sdUnitKey contained /^OnFailureJobMode=/ nextgroup=sdFailJobMode,sdErr
|
syn match sdUnitKey contained /^OnFailureJobMode=/ nextgroup=sdFailJobMode,sdErr
|
||||||
syn match sdUnitKey contained /^\%(StartLimitInterval\|StartLimitIntervalSec\|JobTimeoutSec\)=/ nextgroup=sdDuration,sdErr
|
syn match sdUnitKey contained /^\%(StartLimitInterval\|StartLimitIntervalSec\|JobTimeoutSec\)=/ nextgroup=sdDuration,sdErr
|
||||||
syn match sdUnitKey contained /^\%(StartLimitAction\|JobTimeoutAction\)=/ nextgroup=sdLimitAction,sdErr
|
syn match sdUnitKey contained /^\%(StartLimitAction\|JobTimeoutAction\)=/ nextgroup=sdLimitAction,sdErr
|
||||||
|
syn match sdUnitKey contained /^StartLimitBurst=/ nextgroup=sdUInt,sdErr
|
||||||
|
syn match sdUnitKey contained /^\%(FailureAction\|SuccessAction\)=/ nextgroup=sdLimitAction,sdFailAction,sdErr
|
||||||
|
syn match sdUnitKey contained /^\%(FailureAction\|SuccessAction\)ExitStatus=/ nextgroup=sdExitStatus,sdErr
|
||||||
syn match sdUnitKey contained /^\%(RebootArgument\|JobTimeoutRebootArgument\)=/
|
syn match sdUnitKey contained /^\%(RebootArgument\|JobTimeoutRebootArgument\)=/
|
||||||
" ConditionXXX. Note that they all have an optional '|' after the '='.
|
syn match sdUnitKey contained /^RequiresMountsFor=/ nextgroup=sdFileList,sdErr
|
||||||
syn match sdUnitKey contained /^Condition\(PathExists\|PathExistsGlob\|PathIsDirectory\|PathIsMountPoint\|PathIsReadWrite\|PathIsSymbolicLink\|DirectoryNotEmpty\|FileNotEmpty\|FileIsExecutable\)=|\=!\=/ contains=sdConditionFlag nextgroup=sdFilename,sdErr
|
" TODO: JobRunningTimeoutSec
|
||||||
syn match sdUnitKey contained /^ConditionVirtualization=|\=!\=/ contains=sdConditionFlag nextgroup=sdVirtType,sdErr
|
" ConditionXXX/AssertXXX. Note that they all have an optional '|' after the '='.
|
||||||
syn match sdUnitKey contained /^ConditionSecurity=|\=!\=/ contains=sdConditionFlag nextgroup=sdSecurityType,sdErr
|
syn match sdUnitKey contained /^\%(Condition\|Assert\)\(PathExists\|PathExistsGlob\|PathIsDirectory\|PathIsMountPoint\|PathIsReadWrite\|PathIsSymbolicLink\|DirectoryNotEmpty\|FileNotEmpty\|FileIsExecutable\)=|\=!\=/ contains=sdConditionFlag nextgroup=sdFilename,sdErr
|
||||||
syn match sdUnitKey contained /^ConditionCapability=|\=!\=/ contains=sdConditionFlag nextgroup=sdAnyCapName,sdErr
|
syn match sdUnitKey contained /^\%(Condition\|Assert\)Virtualization=|\=!\=/ contains=sdConditionFlag nextgroup=sdVirtType,sdErr
|
||||||
syn match sdUnitKey contained /^Condition\%(KernelCommandLine\|Host\)=|\=!\=/ contains=sdConditionFlag
|
syn match sdUnitKey contained /^\%(Condition\|Assert\)Security=|\=!\=/ contains=sdConditionFlag nextgroup=sdSecurityType,sdErr
|
||||||
syn match sdUnitKey contained /^Condition\%(ACPower\|Null\|FirstBoot\)=|\=/ contains=sdConditionFlag nextgroup=sdBool,sdErr
|
syn match sdUnitKey contained /^\%(Condition\|Assert\)Capability=|\=!\=/ contains=sdConditionFlag nextgroup=sdAnyCapName,sdErr
|
||||||
syn match sdUnitKey contained /^ConditionNeedsUpdate=|\=!\=/ contains=sdConditionFlag nextgroup=sdCondUpdateDir,sdErr
|
syn match sdUnitKey contained /^\%(Condition\|Assert\)\%(KernelCommandLine\|Host\)=|\=!\=/ contains=sdConditionFlag
|
||||||
|
syn match sdUnitKey contained /^\%(Condition\|Assert\)\%(ACPower\|Null\|FirstBoot\)=|\=/ contains=sdConditionFlag nextgroup=sdBool,sdErr
|
||||||
|
syn match sdUnitKey contained /^\%(Condition\|Assert\)NeedsUpdate=|\=!\=/ contains=sdConditionFlag nextgroup=sdCondUpdateDir,sdErr
|
||||||
|
syn match sdUnitKey contained /^\%(Condition\|Assert\)Architecture=|\=!\=/ contains=sdConditionFlag nextgroup=sdArch,sdErr
|
||||||
|
syn match sdUnitKey contained /^\%(Condition\|Assert\)User=|\=/ contains=sdConditionFlag nextgroup=sdUser,sdCondUser,sdErr
|
||||||
|
syn match sdUnitKey contained /^\%(Condition\|Assert\)Group=|\=/ contains=sdConditionFlag nextgroup=sdUser,sdErr
|
||||||
|
syn match sdUnitKey contained /^\%(Condition\|Assert\)ControlGroupController=|\=/ contains=sdConditionFlag nextgroup=sdController,sdErr
|
||||||
|
syn match sdUnitKey contained /^\%(Condition\|Assert\)KernelVersion=|\=/ contains=sdConditionFlag nextgroup=sdKernelVersion,sdErr
|
||||||
|
|
||||||
" extra bits
|
" extra bits
|
||||||
syn match sdUnitList contained /.*/ contains=sdUnitName,sdErr
|
syn match sdUnitList contained /.*/ contains=sdUnitName,sdErr
|
||||||
syn match sdConditionFlag contained /[!|]/
|
syn match sdConditionFlag contained /[!|]/
|
||||||
syn match sdCondUpdateDir contained nextgroup=sdErr /\%(\/etc\|\/var\)/
|
syn match sdCondUpdateDir contained nextgroup=sdErr /\%(\/etc\|\/var\)/
|
||||||
syn keyword sdVirtType contained nextgroup=sdErr vm container qemu kvm vmware microsoft oracle xen bochs chroot openvz lxc lxc-libvirt systemd-nspawn
|
syn keyword sdVirtType contained nextgroup=sdErr vm container qemu kvm zvm vmware microsoft oracle xen bochs uml bhyve qnx openvz openvz lxc lxc-libvirt systemd-nspawn docker podman rkt wsl acrn private-users
|
||||||
syn keyword sdSecurityType contained nextgroup=sdErr selinux
|
syn keyword sdSecurityType contained nextgroup=sdErr selinux apparmor tomoyo ima smack audit uefi-secureboot
|
||||||
syn keyword sdFailJobMode contained nextgroup=sdErr fail replace replace-irreversibly
|
syn keyword sdFailJobMode contained nextgroup=sdErr fail replace replace-irreversibly
|
||||||
syn keyword sdLimitAction contained nextgroup=sdErr none reboot reboot-force reboot-immediate poweroff poweroff-force poweroff-immediate
|
syn keyword sdLimitAction contained nextgroup=sdErr none reboot reboot-force reboot-immediate poweroff poweroff-force poweroff-immediate
|
||||||
|
syn keyword sdFailAction contained nextgroup=sdErr exit exit-force
|
||||||
|
syn keyword sdArch contained nextgroup=sdErr x86 x86_64 ppc ppc-le ppc64 ppc64-le ia64 parisc parisc64 s390 s390x sparc sparc64 mips mips-le mips64 mips64-le alpha arm arm-be arm64 arm64-be sh sh64 m68k tilegx cris arc arc-be native
|
||||||
|
syn keyword sdController contained cpu cpuacct io blkio memory devices pids nextgroup=sdController,sdErr
|
||||||
|
syn match sdCondUser contained /@system/
|
||||||
|
syn match sdUser contained nextgroup=sdErr /\d\+\|[A-Za-z_][A-Za-z0-9_-]*/
|
||||||
|
syn match sdExitStatus contained nextgroup=sdErr /\d\|\d\d\|[01]\d\d\|2[0-4]\d\|25[0-5]/
|
||||||
syn match sdDocUri contained /\%(https\=:\/\/\|file:\|info:\|man:\)\S\+\s*/ nextgroup=sdDocUri,sdErr
|
syn match sdDocUri contained /\%(https\=:\/\/\|file:\|info:\|man:\)\S\+\s*/ nextgroup=sdDocUri,sdErr
|
||||||
|
|
||||||
" [Install] {{{1
|
" [Install] {{{1
|
||||||
" see systemd.unit(5)
|
" see systemd.unit(5)
|
||||||
syn region sdInstallBlock matchgroup=sdHeader start=/^\[Install\]/ end=/^\[/me=e-2 contains=sdInstallKey
|
syn region sdInstallBlock matchgroup=sdHeader start=/^\[Install\]/ end=/^\[/me=e-2 contains=sdInstallKey
|
||||||
syn match sdInstallKey contained /^\%(WantedBy\|Alias\|Also\|RequiredBy\)=/ nextgroup=sdUnitList
|
syn match sdInstallKey contained /^\%(WantedBy\|Alias\|Also\|RequiredBy\)=/ nextgroup=sdUnitList
|
||||||
|
syn match sdInstallKey contained /^DefaultInstance=/ nextgroup=sdInstance
|
||||||
|
" TODO: sdInstance - what's valid there? probably [^@/]\+, but that's a guess
|
||||||
|
|
||||||
" Execution options common to [Service|Socket|Mount|Swap] {{{1
|
" Execution options common to [Service|Socket|Mount|Swap] {{{1
|
||||||
" see systemd.exec(5)
|
" see systemd.exec(5)
|
||||||
syn match sdExecKey contained /^Exec\%(Start\%(Pre\|Post\|\)\|Reload\|Stop\|StopPost\)=/ nextgroup=sdExecFlag,sdExecFile,sdErr
|
syn match sdExecKey contained /^Exec\%(Start\%(Pre\|Post\|\)\|Reload\|Stop\|StopPost\|Condition\)=/ nextgroup=sdExecFlag,sdExecFile,sdErr
|
||||||
syn match sdExecKey contained /^\%(WorkingDirectory\|RootDirectory\|TTYPath\)=/ nextgroup=sdFilename,sdErr
|
syn match sdExecKey contained /^\%(WorkingDirectory\|RootDirectory\|TTYPath\|RootImage\)=/ nextgroup=sdFilename,sdErr
|
||||||
|
syn match sdExecKey contained /^\%(Runtime\|State\|Cache\|Logs\|Configuration\)Directory=/ nextgroup=sdFilename,sdErr
|
||||||
|
syn match sdExecKey contained /^\%(Runtime\|State\|Cache\|Logs\|Configuration\)DirectoryMode=/ nextgroup=sdOctal,sdErr
|
||||||
|
syn match sdExecKey contained /^User=/ nextgroup=sdUser,sdErr
|
||||||
|
syn match sdExecKey contained /^Group=/ nextgroup=sdUser,sdErr
|
||||||
|
" TODO: NUMAPolicy, NUMAMask
|
||||||
|
" TODO: Pass/UnsetEnvironment
|
||||||
|
" TODO: StandardInput\%(Text\|Data\)
|
||||||
|
" TODO: Generally everything from 'WorkingDirectory' on down
|
||||||
" TODO: handle some of these better
|
" TODO: handle some of these better
|
||||||
" FIXME: some of these have moved to Resource Control
|
" FIXME: some of these have moved to Resource Control
|
||||||
" CPUAffinity is: list of uint
|
" CPUAffinity is: list of uint
|
||||||
" BlockIOWeight is: uint\|filename uint
|
" BlockIOWeight is: uint\|filename uint
|
||||||
" BlockIO\%(Read\|Write\)Bandwidth is: filename datasize
|
" BlockIO\%(Read\|Write\)Bandwidth is: filename datasize
|
||||||
syn match sdExecKey contained /^\%(User\|Group\|SupplementaryGroups\|CPUAffinity\|SyslogIdentifier\|PAMName\|TCPWrapName\|ControlGroup\|ControlGroupAttribute\|UtmpIdentifier\)=/
|
syn match sdExecKey contained /^\%(SupplementaryGroups\|CPUAffinity\|SyslogIdentifier\|PAMName\|TCPWrapName\|ControlGroup\|ControlGroupAttribute\|UtmpIdentifier\)=/
|
||||||
syn match sdExecKey contained /^Limit\%(CPU\|FSIZE\|DATA\|STACK\|CORE\|RSS\|NOFILE\|AS\|NPROC\|MEMLOCK\|LOCKS\|SIGPENDING\|MSGQUEUE\|NICE\|RTPRIO\|RTTIME\)=/ nextgroup=sdRlimit
|
syn match sdExecKey contained /^Limit\%(CPU\|FSIZE\|DATA\|STACK\|CORE\|RSS\|NOFILE\|AS\|NPROC\|MEMLOCK\|LOCKS\|SIGPENDING\|MSGQUEUE\|NICE\|RTPRIO\|RTTIME\)=/ nextgroup=sdRlimit
|
||||||
syn match sdExecKey contained /^\%(CPUSchedulingResetOnFork\|TTYReset\|TTYVHangup\|TTYVTDisallocate\|SyslogLevelPrefix\|ControlGroupModify\|PrivateTmp\|PrivateNetwork\|PrivateDevices\)=/ nextgroup=sdBool,sdErr
|
syn match sdExecKey contained /^\%(CPUSchedulingResetOnFork\|TTYReset\|TTYVHangup\|TTYVTDisallocate\|SyslogLevelPrefix\|ControlGroupModify\|DynamicUser\|RemoveIPC\|NoNewPrivileges\|RestrictRealtime\|RestrictSUIDSGID\|LockPersonality\|MountAPIVFS\)=/ nextgroup=sdBool,sdErr
|
||||||
|
syn match sdExecKey contained /^Private\%(Tmp\|Network\|Devices\|Users\|Mounts\)=/ nextgroup=sdBool,sdErr
|
||||||
|
syn match sdExecKey contained /^Protect\%(KernelTunables\|KernelModules\|KernelLogs\|Clock\|ControlGroups\|Hostname\)=/ nextgroup=sdBool,sdErr
|
||||||
syn match sdExecKey contained /^\%(Nice\|OOMScoreAdjust\)=/ nextgroup=sdInt,sdErr
|
syn match sdExecKey contained /^\%(Nice\|OOMScoreAdjust\)=/ nextgroup=sdInt,sdErr
|
||||||
syn match sdExecKey contained /^\%(CPUSchedulingPriority\|TimerSlackNSec\)=/ nextgroup=sdUInt,sdErr
|
syn match sdExecKey contained /^\%(CPUSchedulingPriority\|TimerSlackNSec\)=/ nextgroup=sdUInt,sdErr
|
||||||
syn match sdExecKey contained /^\%(ReadWrite\|ReadOnly\|Inaccessible\)Directories=/ nextgroup=sdFileList
|
syn match sdExecKey contained /^\%(ReadWrite\|ReadOnly\|Inaccessible\)Directories=/ nextgroup=sdFileList
|
||||||
@@ -162,7 +213,7 @@ syn match sdKillMode contained nextgroup=sdErr /\%(control-group\|process\|
|
|||||||
" Resource Control options for [Service|Socket|Mount|Swap|Slice|Scope] {{{1
|
" Resource Control options for [Service|Socket|Mount|Swap|Slice|Scope] {{{1
|
||||||
" see systemd.resource-control(5)
|
" see systemd.resource-control(5)
|
||||||
syn match sdResCtlKey contained /^Slice=/ nextgroup=sdSliceName,sdErr
|
syn match sdResCtlKey contained /^Slice=/ nextgroup=sdSliceName,sdErr
|
||||||
syn match sdResCtlKey contained /^\%(CPUAccounting\|MemoryAccounting\|IOAccounting\|BlockIOAccounting\|TasksAccounting\|Delegate\)=/ nextgroup=sdBool,sdErr
|
syn match sdResCtlKey contained /^\%(CPUAccounting\|MemoryAccounting\|IOAccounting\|BlockIOAccounting\|TasksAccounting\|IPAccounting\|Delegate\)=/ nextgroup=sdBool,sdErr
|
||||||
syn match sdResCtlKey contained /^\%(CPUQuota\)=/ nextgroup=sdPercent,sdErr
|
syn match sdResCtlKey contained /^\%(CPUQuota\)=/ nextgroup=sdPercent,sdErr
|
||||||
syn match sdResCtlKey contained /^\%(CPUShares\|StartupCPUShares\)=/ nextgroup=sdUInt,sdErr
|
syn match sdResCtlKey contained /^\%(CPUShares\|StartupCPUShares\)=/ nextgroup=sdUInt,sdErr
|
||||||
syn match sdResCtlKey contained /^MemoryLow=/ nextgroup=sdDatasize,sdPercent,sdErr
|
syn match sdResCtlKey contained /^MemoryLow=/ nextgroup=sdDatasize,sdPercent,sdErr
|
||||||
@@ -185,13 +236,19 @@ syn region sdServiceBlock matchgroup=sdHeader start=/^\[Service\]/ end=/^\[/me=e
|
|||||||
syn match sdServiceKey contained /^BusName=/
|
syn match sdServiceKey contained /^BusName=/
|
||||||
syn match sdServiceKey contained /^\%(RemainAfterExit\|GuessMainPID\|PermissionsStartOnly\|RootDirectoryStartOnly\|NonBlocking\|ControlGroupModify\)=/ nextgroup=sdBool,sdErr
|
syn match sdServiceKey contained /^\%(RemainAfterExit\|GuessMainPID\|PermissionsStartOnly\|RootDirectoryStartOnly\|NonBlocking\|ControlGroupModify\)=/ nextgroup=sdBool,sdErr
|
||||||
syn match sdServiceKey contained /^\%(SysVStartPriority\|FsckPassNo\)=/ nextgroup=sdUInt,sdErr
|
syn match sdServiceKey contained /^\%(SysVStartPriority\|FsckPassNo\)=/ nextgroup=sdUInt,sdErr
|
||||||
syn match sdServiceKey contained /^\%(Restart\|Timeout\|TimeoutStart\|TimeoutStop\|Watchdog\|RuntimeMax\)Sec=/ nextgroup=sdDuration,sdErr
|
syn match sdServiceKey contained /^\%(Restart\|Timeout\|TimeoutStart\|TimeoutStop\|TimeoutAbort\|Watchdog\|RuntimeMax\)Sec=/ nextgroup=sdDuration,sdErr
|
||||||
syn match sdServiceKey contained /^Sockets=/ nextgroup=sdUnitList
|
syn match sdServiceKey contained /^Sockets=/ nextgroup=sdUnitList
|
||||||
syn match sdServiceKey contained /^PIDFile=/ nextgroup=sdFilename,sdErr
|
syn match sdServiceKey contained /^PIDFile=/ nextgroup=sdFilename,sdErr
|
||||||
syn match sdServiceKey contained /^Type=/ nextgroup=sdServiceType,sdErr
|
syn match sdServiceKey contained /^Type=/ nextgroup=sdServiceType,sdErr
|
||||||
syn match sdServiceKey contained /^Restart=/ nextgroup=sdRestartType,sdErr
|
syn match sdServiceKey contained /^Restart=/ nextgroup=sdRestartType,sdErr
|
||||||
syn match sdServiceKey contained /^NotifyAccess=/ nextgroup=sdNotifyType,sdErr
|
syn match sdServiceKey contained /^NotifyAccess=/ nextgroup=sdNotifyType,sdErr
|
||||||
syn keyword sdServiceType contained nextgroup=sdErr simple forking dbus oneshot notify idle
|
syn match sdServiceKey contained /^StartLimitInterval=/ nextgroup=sdDuration,sdErr
|
||||||
|
syn match sdServiceKey contained /^StartLimitAction=/ nextgroup=sdLimitAction,sdErr
|
||||||
|
syn match sdServiceKey contained /^StartLimitBurst=/ nextgroup=sdUInt,sdErr
|
||||||
|
syn match sdServiceKey contained /^FailureAction=/ nextgroup=sdLimitAction,sdFailAction,sdErr
|
||||||
|
syn match sdServiceKey contained /^\%(RestartPrevent\|RestartForce\|Success\)ExitStatus=/ nextgroup=sdExitStatus,sdErr
|
||||||
|
syn match sdServiceKey contained /^RebootArgument=/
|
||||||
|
syn keyword sdServiceType contained nextgroup=sdErr simple exec forking dbus oneshot notify idle
|
||||||
syn keyword sdRestartType contained nextgroup=sdErr no on-success on-failure on-abort always
|
syn keyword sdRestartType contained nextgroup=sdErr no on-success on-failure on-abort always
|
||||||
syn keyword sdNotifyType contained nextgroup=sdErr none main all
|
syn keyword sdNotifyType contained nextgroup=sdErr none main all
|
||||||
|
|
||||||
@@ -201,7 +258,7 @@ syn match sdSocketKey contained /^Listen\%(Stream\|Datagram\|SequentialPacket\|F
|
|||||||
syn match sdSocketKey contained /^Listen\%(FIFO\|Special\)=/ nextgroup=sdFilename,sdErr
|
syn match sdSocketKey contained /^Listen\%(FIFO\|Special\)=/ nextgroup=sdFilename,sdErr
|
||||||
syn match sdSocketKey contained /^\%(Socket\|Directory\)Mode=/ nextgroup=sdOctal,sdErr
|
syn match sdSocketKey contained /^\%(Socket\|Directory\)Mode=/ nextgroup=sdOctal,sdErr
|
||||||
syn match sdSocketKey contained /^\%(Backlog\|MaxConnections\|Priority\|ReceiveBuffer\|SendBuffer\|IPTTL\|Mark\|PipeSize\|MessageQueueMaxMessages\|MessageQueueMessageSize\)=/ nextgroup=sdUInt,sdErr
|
syn match sdSocketKey contained /^\%(Backlog\|MaxConnections\|Priority\|ReceiveBuffer\|SendBuffer\|IPTTL\|Mark\|PipeSize\|MessageQueueMaxMessages\|MessageQueueMessageSize\)=/ nextgroup=sdUInt,sdErr
|
||||||
syn match sdSocketKey contained /^\%(Accept\|KeepAlive\|FreeBind\|Transparent\|Broadcast\|Writable\|NoDelay\)=/ nextgroup=sdBool,sdErr
|
syn match sdSocketKey contained /^\%(Accept\|KeepAlive\|FreeBind\|Transparent\|Broadcast\|Writable\|NoDelay\|PassCredentials\|PassSecurity\|ReusePort\|RemoveOnStop\|SELinuxContextFromNet\)=/ nextgroup=sdBool,sdErr
|
||||||
syn match sdSocketKey contained /^BindToDevice=/
|
syn match sdSocketKey contained /^BindToDevice=/
|
||||||
syn match sdSocketKey contained /^Service=/ nextgroup=sdUnitList
|
syn match sdSocketKey contained /^Service=/ nextgroup=sdUnitList
|
||||||
syn match sdSocketKey contained /^BindIPv6Only=/ nextgroup=sdBindIPv6,sdErr
|
syn match sdSocketKey contained /^BindIPv6Only=/ nextgroup=sdBindIPv6,sdErr
|
||||||
@@ -216,7 +273,8 @@ syn keyword sdTCPCongest contained nextgroup=sdErr westwood veno cubic lp
|
|||||||
syn region sdTimerBlock matchgroup=sdHeader start=/^\[Timer\]/ end=/^\[/me=e-2 contains=sdTimerKey
|
syn region sdTimerBlock matchgroup=sdHeader start=/^\[Timer\]/ end=/^\[/me=e-2 contains=sdTimerKey
|
||||||
syn match sdTimerKey contained /^On\%(Active\|Boot\|Startup\|UnitActive\|UnitInactive\)Sec=/ nextgroup=sdDuration,sdErr
|
syn match sdTimerKey contained /^On\%(Active\|Boot\|Startup\|UnitActive\|UnitInactive\)Sec=/ nextgroup=sdDuration,sdErr
|
||||||
syn match sdTimerKey contained /^\%(Accuracy\|RandomizedDelay\)Sec=/ nextgroup=sdDuration,sdErr
|
syn match sdTimerKey contained /^\%(Accuracy\|RandomizedDelay\)Sec=/ nextgroup=sdDuration,sdErr
|
||||||
syn match sdTimerKey contained /^\%(Persistent\|WakeSystem\|RemainAfterElapse\)=/ nextgroup=sdBool,sdErr
|
syn match sdTimerKey contained /^\%(Persistent\|WakeSystem\|RemainAfterElapse\|OnClockChange\|OnTimezoneChange\)=/ nextgroup=sdBool,sdErr
|
||||||
|
syn match sdTimerKey contained /^OnCalendar=/ nextgroup=sdCalendar
|
||||||
syn match sdTimerKey contained /^Unit=/ nextgroup=sdUnitList
|
syn match sdTimerKey contained /^Unit=/ nextgroup=sdUnitList
|
||||||
" TODO: sdCalendar
|
" TODO: sdCalendar
|
||||||
|
|
||||||
@@ -227,7 +285,7 @@ syn match sdAutomountKey contained /^DirectoryMode=/ nextgroup=sdOctal,sdErr
|
|||||||
|
|
||||||
" [Mount]
|
" [Mount]
|
||||||
syn region sdMountBlock matchgroup=sdHeader start=/^\[Mount\]/ end=/^\[/me=e-2 contains=sdMountKey,sdAutomountKey,sdExecKey,sdKillKey,sdResCtlKey
|
syn region sdMountBlock matchgroup=sdHeader start=/^\[Mount\]/ end=/^\[/me=e-2 contains=sdMountKey,sdAutomountKey,sdExecKey,sdKillKey,sdResCtlKey
|
||||||
syn match sdMountKey contained /^SloppyOptions=/ nextgroup=sdBool,sdErr
|
syn match sdMountKey contained /^\%(SloppyOptions\|LazyUnmount\|ForceUnmount\)=/ nextgroup=sdBool,sdErr
|
||||||
syn match sdMountKey contained /^\%(What\|Type\|Options\)=/
|
syn match sdMountKey contained /^\%(What\|Type\|Options\)=/
|
||||||
|
|
||||||
" [Swap]
|
" [Swap]
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user