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 | |
|---|---|---|---|
|
|
30bef582ba | ||
|
|
74d940cda3 | ||
|
|
54d2386262 | ||
|
|
a47c315b01 | ||
|
|
ff0ada0dc3 | ||
|
|
e194de5875 | ||
|
|
012cf89210 | ||
|
|
ac71777dc2 | ||
|
|
23defeb610 | ||
|
|
114a93bb7c | ||
|
|
f3ab28a287 | ||
|
|
bc3b36088e | ||
|
|
5d0150e326 | ||
|
|
cf8e31ff7f | ||
|
|
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 |
21
.github/workflows/test.yml
vendored
Normal file
21
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: Vim Polyglot CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '0 0 * * 0' # weekly
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Vim
|
||||
run: |
|
||||
sudo add-apt-repository ppa:jonathonf/vim -y
|
||||
sudo apt-get update -q
|
||||
sudo apt-get install -y vim
|
||||
vim --version
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run Tests
|
||||
run: scripts/test
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
/tmp
|
||||
!*ctags*
|
||||
tags
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
language: vim
|
||||
before_script:
|
||||
- sudo add-apt-repository ppa:jonathonf/vim -y
|
||||
- sudo apt-get update -q
|
||||
- sudo apt-get install -y vim
|
||||
- vim --version
|
||||
script: ./test
|
||||
43
README.md
43
README.md
@@ -1,22 +1,19 @@
|
||||

|
||||
|
||||
[![Build Status][travis-img-url]][travis-url] []()
|
||||
|
||||
[travis-img-url]: https://travis-ci.org/sheerun/vim-polyglot.svg
|
||||
[travis-url]: https://travis-ci.org/sheerun/vim-polyglot
|
||||
 []()
|
||||
|
||||
A collection of language packs for Vim.
|
||||
|
||||
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
||||
|
||||
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
|
||||
- It **installs and updates 120+ times faster** than the <!--Package Count-->151<!--/Package Count--> packages it consists of.
|
||||
- It **installs and updates 120+ times faster** than the <!--Package Count-->156<!--/Package Count--> packages it consists of.
|
||||
- Solid syntax and indentation support (other features skipped). Only the best language packs.
|
||||
- All unnecessary files are ignored (like enormous documentation from php support).
|
||||
- No support for esoteric languages, only most popular ones (modern too, like `slim`).
|
||||
- Each build is tested by automated vimrunner script on CI. See `spec` directory.
|
||||
|
||||
\*To be completely honest, optimized `ftdetect` script takes up to `19ms` to load.
|
||||
\*To be completely honest, optimized `ftdetect` script takes around `19ms` to load.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -38,7 +35,7 @@ mkdir -p ~/.vim/pack/default/start
|
||||
git clone https://github.com/sheerun/vim-polyglot ~/.vim/pack/default/start/vim-polyglot
|
||||
```
|
||||
|
||||
NOTE: Not all features of listed language packs are available. We strip them from functionality slowing vim startup in general (for example we ignore `plugins` folder that is loaded regardless of file type, use `ftplugin` instead).
|
||||
NOTE: Not all features of individual language packs are available. We strip them from functionality slowing vim startup (for example we ignore `plugins` folder that is loaded regardless of file type, instead we prefer `ftplugin` which is loaded lazily).
|
||||
|
||||
If you need full functionality of any plugin, please use it directly with your plugin manager.
|
||||
|
||||
@@ -77,6 +74,7 @@ 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)
|
||||
- [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin)
|
||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent)
|
||||
- [fennel](https://github.com/bakpakin/fennel.vim) (syntax, indent, ftplugin)
|
||||
- [ferm](https://github.com/vim-scripts/ferm.vim) (syntax)
|
||||
- [fish](https://github.com/georgewitteman/vim-fish) (syntax, indent, compiler, autoload, ftplugin)
|
||||
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers) (syntax)
|
||||
@@ -90,7 +88,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
- [gradle](https://github.com/tfnico/vim-gradle) (compiler)
|
||||
- [graphql](https://github.com/jparise/vim-graphql) (syntax, indent, autoload, ftplugin, after)
|
||||
- [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)
|
||||
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin)
|
||||
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax)
|
||||
@@ -99,14 +97,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)
|
||||
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
|
||||
- [i3](https://github.com/mboughaba/i3config.vim) (syntax, ftplugin)
|
||||
- [icalenadr](https://github.com/chutzpah/icalendar.vim) (syntax)
|
||||
- [icalendar](https://github.com/chutzpah/icalendar.vim) (syntax)
|
||||
- [idris](https://github.com/idris-hackers/idris-vim) (syntax, indent, ftplugin)
|
||||
- [ion](https://github.com/vmchale/ion-vim) (syntax, ftplugin)
|
||||
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, compiler, ftplugin, extras)
|
||||
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax) (syntax, indent)
|
||||
- [jinja](https://github.com/lepture/vim-jinja) (syntax, indent)
|
||||
- [jq](https://github.com/vito-c/jq.vim) (syntax, ftplugin)
|
||||
- [json5](https://github.com/GutenYe/json5.vim) (syntax)
|
||||
- [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin)
|
||||
- [jsonnet](https://github.com/google/vim-jsonnet) (syntax, autoload, ftplugin)
|
||||
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent)
|
||||
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (autoload, after)
|
||||
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (syntax, indent, autoload, ftplugin)
|
||||
@@ -153,6 +153,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)
|
||||
- [razor](https://github.com/adamclerk/vim-razor) (syntax, indent, ftplugin)
|
||||
- [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)
|
||||
- [rst](https://github.com/marshallward/vim-restructuredtext) (syntax, indent, autoload, ftplugin)
|
||||
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin)
|
||||
@@ -165,6 +166,7 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
- [slime](https://github.com/slime-lang/vim-slime-syntax) (syntax, indent)
|
||||
- [smt2](https://github.com/bohlender/vim-smt2) (syntax, autoload, ftplugin)
|
||||
- [solidity](https://github.com/tomlion/vim-solidity) (syntax, indent, ftplugin)
|
||||
- [sql](https://github.com/shmup/vim-sql-syntax) (syntax)
|
||||
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin)
|
||||
- [svelte](https://github.com/evanleck/vim-svelte) (syntax, indent, ftplugin)
|
||||
- [svg-indent](https://github.com/jasonshell/vim-svg-indent) (indent)
|
||||
@@ -176,31 +178,31 @@ If you need full functionality of any plugin, please use it directly with your p
|
||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin)
|
||||
- [thrift](https://github.com/solarnz/thrift.vim) (syntax)
|
||||
- [tmux](https://github.com/ericpruitt/tmux.vim) (syntax, ftplugin)
|
||||
- [tomdoc](https://github.com/wellbredgrapefruit/tomdoc.vim) (syntax)
|
||||
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin)
|
||||
- [tptp](https://github.com/c-cube/vim-tptp) (syntax)
|
||||
- [twig](https://github.com/lumiliet/vim-twig) (syntax, indent, ftplugin)
|
||||
- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (syntax, indent, compiler, ftplugin, ctags)
|
||||
- [unison](https://github.com/unisonweb/unison) (syntax)
|
||||
- [v](https://github.com/ollykel/v-vim) (syntax, indent, ftplugin)
|
||||
- [vala](https://github.com/arrufat/vala.vim) (syntax, indent, ftplugin)
|
||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax)
|
||||
- [velocity](https://github.com/lepture/vim-velocity) (syntax, indent)
|
||||
- [vifm](https://github.com/vifm/vifm.vim) (syntax, autoload, ftplugin)
|
||||
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent)
|
||||
- [vue](https://github.com/posva/vim-vue) (syntax, indent, ftplugin)
|
||||
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax) (syntax)
|
||||
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
||||
- [xml](https://github.com/amadeus/vim-xml) (syntax)
|
||||
- [xsl](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
||||
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)
|
||||
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
||||
- [zephir](https://github.com/xwsoul/vim-zephir) (syntax)
|
||||
- [zig](https://github.com/ziglang/zig.vim) (syntax, autoload, ftplugin)
|
||||
- [zig](https://github.com/ziglang/zig.vim) (syntax, indent, autoload, ftplugin)
|
||||
- [zinit](https://github.com/zinit-zsh/zplugin-vim-syntax) (syntax)
|
||||
<!--/Language Packs-->
|
||||
|
||||
## Updating
|
||||
|
||||
You can either wait for new patch release with updates or run the `./build` script by yourself.
|
||||
You can either wait for new patch release with updates or run the `scripts/build` script by yourself.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
@@ -213,19 +215,14 @@ Individual language packs can be disabled by setting `g:polyglot_disabled` as fo
|
||||
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.
|
||||
Please note that disabling a language won't make in your vim startup any faster / slower (only for specific this specific filetype). All plugins are loaded lazily, on demand.
|
||||
|
||||
## Contributing
|
||||
|
||||
Language packs are periodically updated using automated `build` script.
|
||||
Language packs are periodically updated using automated `scripts/build` script.
|
||||
|
||||
Feel free to add your language, and send pull-request. In your pull request, please include:
|
||||
1. How you chose the particular repo from which to pull support for this language.
|
||||
2. An updated https://github.com/sheerun/vim-polyglot/blob/master/build .
|
||||
3. If at all possible, absolutely nothing else (in particular, please don't run `build` and include that in your PR).
|
||||
|
||||
The easier it is to validate that the new language won't do anything wacky, the faster it'll be merged. In particular, languages that utilize global plugins (loaded for every filetype), or plugins with dangerous features (like `call` based on the contents of a file being edited), will never be merged, as they will be slow or dangerous, respectively.
|
||||
Feel free to add your language to `packages.yaml`, and send pull-request. Please don't run `scripts/build` and include that in your PR, send just changes to `packages.yaml` and `build` script if really necessary. You can run `scripts/test` to run rough tests.
|
||||
|
||||
## License
|
||||
|
||||
See linked repositories for detailed license information.
|
||||
See linked repositories for detailed license information. This repository is MIT-licensed.
|
||||
|
||||
@@ -4,7 +4,7 @@ let s:highlight_close_tag = get(g:, 'vim_jsx_pretty_highlight_close_tag', 0)
|
||||
|
||||
" detect jsx region
|
||||
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=++
|
||||
\ 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
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let s:V = vital#crystal#new()
|
||||
let s:P = s:V.import('Process')
|
||||
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, ''))
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: sw=2 sts=2 et:
|
||||
|
||||
endif
|
||||
|
||||
@@ -1507,10 +1507,10 @@ fu! csv#AvgColumn(list) "{{{3
|
||||
endfor
|
||||
if has("float")
|
||||
let b:csv_result = printf("%.2f", sum/cnt)
|
||||
return b:csv_result
|
||||
return str2float(b:csv_result)
|
||||
else
|
||||
let b:csv_result = printf("%s", sum/cnt)
|
||||
return sum/cnt
|
||||
return b:csv_result + 0
|
||||
endif
|
||||
endif
|
||||
endfu
|
||||
@@ -1543,7 +1543,7 @@ fu! csv#VarianceColumn(list, is_population) "{{{3
|
||||
let cnt = cnt-1
|
||||
endif
|
||||
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
|
||||
else
|
||||
let b:csv_result = printf("%s", sum/cnt)
|
||||
@@ -1956,8 +1956,12 @@ fu! csv#CheckHeaderLine() "{{{3
|
||||
endfu
|
||||
fu! csv#AnalyzeColumn(...) "{{{3
|
||||
let maxcolnr = csv#MaxColumns()
|
||||
if len(a:000) == 1
|
||||
let topn = 5
|
||||
if len(a:000) > 0
|
||||
let colnr = a:1
|
||||
if len(a:000) == 2
|
||||
let topn = a:2
|
||||
endif
|
||||
else
|
||||
let colnr = csv#WColumn()
|
||||
endif
|
||||
@@ -1985,8 +1989,8 @@ fu! csv#AnalyzeColumn(...) "{{{3
|
||||
let max_items = reverse(sort(values(res), s:csv_numeric_sort ? 'n' : 'csv#CSVSortValues'))
|
||||
" What about the minimum 5 items?
|
||||
let count_items = keys(res)
|
||||
if len(max_items) > 5
|
||||
call remove(max_items, 5, -1)
|
||||
if len(max_items) > topn
|
||||
call remove(max_items, topn, -1)
|
||||
call map(max_items, 'printf(''\V%s\m'', escape(v:val, ''\\''))')
|
||||
call filter(res, 'v:val =~ ''^''.join(max_items, ''\|'').''$''')
|
||||
endif
|
||||
@@ -2263,7 +2267,7 @@ fu! csv#CommandDefinitions() "{{{3
|
||||
\ ':echo csv#EvalColumn(<q-args>, "csv#SmplStdDevColumn", <line1>,<line2>)',
|
||||
\ '-nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
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')
|
||||
call csv#LocalCmd("UnArrangeColumn",
|
||||
\':call csv#PrepUnArrangeCol(<line1>, <line2>)',
|
||||
@@ -2311,8 +2315,8 @@ fu! csv#CommandDefinitions() "{{{3
|
||||
\ '-bang -nargs=? -range=%')
|
||||
call csv#LocalCmd("Filters", ':call csv#OutputFilters(<bang>0)',
|
||||
\ '-nargs=0 -bang')
|
||||
call csv#LocalCmd("Analyze", ':call csv#AnalyzeColumn(<args>)',
|
||||
\ '-nargs=?')
|
||||
call csv#LocalCmd("Analyze", ':call csv#AnalyzeColumn(<f-args>)',
|
||||
\ '-nargs=*' )
|
||||
call csv#LocalCmd("VertFold", ':call csv#Vertfold(<bang>0,<q-args>)',
|
||||
\ '-bang -nargs=? -range=% -complete=custom,csv#SortComplete')
|
||||
call csv#LocalCmd("CSVFixed", ':call csv#InitCSVFixedWidth()', '')
|
||||
|
||||
@@ -27,12 +27,16 @@ function! s:clearQfList(reason) abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! dart#fmt(q_args) abort
|
||||
let cmd = s:FindDartFmt()
|
||||
if type(cmd) != type('') | return | endif
|
||||
function! dart#fmt(...) abort
|
||||
let l:dartfmt = s:FindDartFmt()
|
||||
if type(l:dartfmt) != type('') | return | endif
|
||||
let buffer_content = getline(1, '$')
|
||||
let args = '--stdin-name '.expand('%').' '.a:q_args
|
||||
let lines = systemlist(printf('%s %s', cmd, args), join(buffer_content, "\n"))
|
||||
let l:cmd = [l:dartfmt, '--stdin-name', shellescape(expand('%'))]
|
||||
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
|
||||
" tool no longer emits this line on SDK upgrades.
|
||||
if lines[-1] ==# 'Isolate creation failed'
|
||||
|
||||
@@ -1,25 +1,43 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fish') == -1
|
||||
|
||||
function! fish#Indent()
|
||||
let l:shiftwidth = shiftwidth()
|
||||
let l:prevlnum = prevnonblank(v:lnum - 1)
|
||||
if l:prevlnum ==# 0
|
||||
return 0
|
||||
endif
|
||||
let l:indent = 0
|
||||
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)
|
||||
if l:line =~# '\v^\s*end>'
|
||||
return indent(l:prevlnum) - (l:indent ==# 0 ? l:shiftwidth : l:indent)
|
||||
elseif l:line =~# '\v^\s*%(case|else)>'
|
||||
return indent(l:prevlnum) - l:shiftwidth
|
||||
let l:shiftwidth = shiftwidth()
|
||||
let l:previndent = indent(l:prevlnum)
|
||||
let l:indent = l:previndent
|
||||
if l:prevline =~# '\v^\s*%(begin|if|else|while|for|function|switch|case)>'
|
||||
let l:indent += l:shiftwidth
|
||||
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
|
||||
|
||||
function! fish#Format()
|
||||
|
||||
@@ -371,7 +371,7 @@ function! go#config#RenameCommand() abort
|
||||
endfunction
|
||||
|
||||
function! go#config#GorenameBin() abort
|
||||
return get(g:, "go_gorename_bin", "gorename")
|
||||
return get(g:, "go_gorename_bin", "gopls")
|
||||
endfunction
|
||||
|
||||
function! go#config#GorenamePrefill() abort
|
||||
@@ -496,6 +496,10 @@ function! go#config#CodeCompletionEnabled() abort
|
||||
return get(g:, "go_code_completion_enabled", 1)
|
||||
endfunction
|
||||
|
||||
function! go#config#CodeCompletionIcase() abort
|
||||
return get(g:, "go_code_completion_icase", 0)
|
||||
endfunction
|
||||
|
||||
function! go#config#Updatetime() abort
|
||||
let go_updatetime = get(g:, 'go_updatetime', 800)
|
||||
return go_updatetime == 0 ? &updatetime : go_updatetime
|
||||
@@ -553,7 +557,7 @@ function! go#config#DiagnosticsEnabled() abort
|
||||
endfunction
|
||||
|
||||
function! go#config#GoplsOptions() abort
|
||||
return get(g:, 'go_gopls_options', [])
|
||||
return get(g:, 'go_gopls_options', ['-remote=auto'])
|
||||
endfunction
|
||||
|
||||
" 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',
|
||||
\ 'import',
|
||||
\ 'init',
|
||||
\ 'login',
|
||||
\ 'logout',
|
||||
\ 'output',
|
||||
\ 'plan',
|
||||
\ 'providers',
|
||||
|
||||
@@ -10,8 +10,6 @@ execute join(['function! vital#_crystal#ColorEcho#import() abort', printf("retur
|
||||
delfunction s:_SID
|
||||
" ___vital___
|
||||
scriptencoding utf-8
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! s:_is_available() abort
|
||||
if has('gui_running')
|
||||
@@ -185,7 +183,4 @@ function! s:echo(str) abort
|
||||
call echorizer.echo()
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
endif
|
||||
|
||||
@@ -11,9 +11,6 @@ delfunction s:_SID
|
||||
" ___vital___
|
||||
" Utilities for list.
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! s:pop(list) abort
|
||||
return remove(a:list, -1)
|
||||
endfunction
|
||||
@@ -460,9 +457,6 @@ function! s:combinations(list, r) abort
|
||||
return result
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||
|
||||
endif
|
||||
|
||||
@@ -11,9 +11,6 @@ delfunction s:_SID
|
||||
" ___vital___
|
||||
" Utilities for string.
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! s:_vital_loaded(V) abort
|
||||
let s:V = a:V
|
||||
let s:L = s:V.import('Data.List')
|
||||
@@ -624,8 +621,6 @@ function! s:split_posix_text(text, ...) abort
|
||||
return split(text, newline, 1)
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||
|
||||
endif
|
||||
|
||||
@@ -15,9 +15,6 @@ delfunction s:_SID
|
||||
" FIXME: This module name should be Vital.System ?
|
||||
" 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.
|
||||
" Because these variables are used when this script file is loaded.
|
||||
@@ -169,9 +166,6 @@ else
|
||||
endif
|
||||
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim:set et ts=2 sts=2 sw=2 tw=0:
|
||||
|
||||
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")
|
||||
delfunction s:_SID
|
||||
" ___vital___
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! s:_true() abort
|
||||
return 1
|
||||
@@ -174,9 +172,6 @@ function! s:_encode_dict(val, settings) abort
|
||||
endfunction
|
||||
" @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:
|
||||
|
||||
endif
|
||||
|
||||
@@ -131,6 +131,7 @@ let attributes_value = {
|
||||
\ 'label': ['Text', ''],
|
||||
\ 'lang': ['Lang Tag', ''],
|
||||
\ 'list': ['ID', ''],
|
||||
\ 'loading': ['eager/lazy', ''],
|
||||
\ 'loop': ['Bool', ''],
|
||||
\ 'low': ['Number', ''],
|
||||
\ 'manifest': ['URL', ''],
|
||||
@@ -588,11 +589,11 @@ let g:xmldata_html5 = {
|
||||
\ ],
|
||||
\ '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': [
|
||||
\ [],
|
||||
\ 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': [
|
||||
\ [],
|
||||
|
||||
302
build
302
build
@@ -1,302 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -E
|
||||
|
||||
DIRS="syntax indent compiler autoload ftplugin ctags after/syntax after/indent after/ftplugin"
|
||||
# shellcheck disable=SC2034
|
||||
DIRS_BASIC="syntax compiler indent after/syntax after/indent"
|
||||
# shellcheck disable=SC2034
|
||||
DIRS_ALL="syntax indent compiler autoload ftplugin after extras ctags"
|
||||
# shellcheck disable=SC2034
|
||||
DIRS_SYNTAX="syntax indent after/syntax after/indent"
|
||||
# shellcheck disable=SC2034
|
||||
DIRS_NOAFTER="syntax compiler indent autoload ftplugin"
|
||||
DIRS_JAVASCRIPT="${DIRS} extras"
|
||||
read -r -a DIRS_RM <<<"$DIRS_ALL"
|
||||
|
||||
OUTPUT=""
|
||||
|
||||
output() {
|
||||
OUTPUT="$OUTPUT$1"
|
||||
echo -n "$1"
|
||||
}
|
||||
|
||||
download() {
|
||||
for pack in $1; do
|
||||
path="$(cut -d ':' -f 2 <<<"$pack")"
|
||||
dir="tmp/$(cut -d '/' -f 2 <<<"$path")"
|
||||
repo="$(awk -F\# '{print $1}' <<<"$path")"
|
||||
branch="$(awk -F\# '{print $2}' <<<"$path")"
|
||||
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 '.') &
|
||||
done
|
||||
|
||||
wait
|
||||
}
|
||||
|
||||
extract() {
|
||||
echo
|
||||
|
||||
for pack in $1; do
|
||||
name="$(cut -d ':' -f 1 <<<"$pack")"
|
||||
path="$(cut -d ':' -f 2 <<<"$pack")"
|
||||
dir="tmp/$(cut -d '/' -f 2 <<<"$path")"
|
||||
directories="DIRS$(cut -d ':' -f 3 <<<"$pack")"
|
||||
subtree="$(cut -d ':' -f 4 <<<"$pack")"
|
||||
output "- [$name](https://github.com/$path) ("
|
||||
|
||||
subdirs=""
|
||||
for subdir in ${!directories}; do
|
||||
if [ -d "${dir}${subtree:-/}${subdir}" ]; then
|
||||
base="$(basename "$subdir")"
|
||||
if [[ "$subdirs" != *"$base"* ]]; then
|
||||
subdirs="$subdirs, $base"
|
||||
fi
|
||||
|
||||
copy_dir "${dir}${subtree}" "$subdir" "$name"
|
||||
fi
|
||||
done
|
||||
|
||||
# syntax for go.vim depends on autoload for go.vim, but we exclude the
|
||||
# autoload always and the ftplugin because it's too complex. FML.
|
||||
if [ "${pack%%:*}" = "go" ]; then
|
||||
copy_file "${dir}${subtree}" "${dir}${subtree}/autoload/go/config.vim" "${name}"
|
||||
fi
|
||||
|
||||
output "${subdirs##, })"$'\n'
|
||||
done
|
||||
|
||||
for pack in $1; do
|
||||
name="$(cut -d ':' -f 1 <<<"$pack")"
|
||||
path="$(cut -d ':' -f 2 <<<"$pack")"
|
||||
dir="tmp/$(cut -d '/' -f 2 <<<"$path")"
|
||||
subtree="$(cut -d ':' -f 4 <<<"$pack")"
|
||||
|
||||
if [ -d "$dir${subtree:-/}plugin" ]; then
|
||||
echo "Possible error (plugin directory exists): $path" >&2
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
copy_dir() {
|
||||
find "$1/$2" \( -name '*.vim' -o -name '*.vital' -o -name '*.ctags' \) -print0 | while read -r -d $'\0' file; do
|
||||
copy_file "$1" "$file" "$3"
|
||||
done
|
||||
}
|
||||
|
||||
copy_file() {
|
||||
## $1 is the build dir (e.g. tmp/vim-go)
|
||||
## $2 is the full file path, as returned by `find` (e.g. tmp/vim-go/indent/go.vim)
|
||||
## $3 is the name of the package (so that we can detect if it's disabled at runtime)
|
||||
local tmp_dir="$1"
|
||||
local file_in_tmp="$2"
|
||||
local file_basename="${2##*/}"
|
||||
local file_path="${file_in_tmp##$tmp_dir/}" # Just this file's (full) path
|
||||
file_path="${file_path%/*}" # Minus the actual name of the file
|
||||
local file_in_dst="${file_path}/${file_basename}" # Could also be ${file_in_tmp##$tmp_dir/}
|
||||
local package_name="$3"
|
||||
|
||||
if [ "${file_in_tmp##$tmp_dir/}" != "${file_in_dst}" ]; then
|
||||
echo "Failure in logic in build script; '${file_in_tmp##$tmp_dir/}' != '${file_in_dst}'. Bailing." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "${file_path}"
|
||||
touch "$file_in_dst"
|
||||
|
||||
# Use comma instead of / to handle cases like c/c++
|
||||
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"
|
||||
else
|
||||
sed -e "s,%%PACK%%,${package_name}," -e "/%%CONTENT%%/{r ${file_in_tmp}" -e "d;}" plugin_guard.vim.template >> "$file_in_dst"
|
||||
fi
|
||||
}
|
||||
|
||||
update_readme() {
|
||||
local tf of
|
||||
tf="$(mktemp)"
|
||||
of="$(mktemp)"
|
||||
LC_ALL=C sort <<<"$OUTPUT" | grep -vxE '[[:space:]]*' > "$of"
|
||||
|
||||
awk 'suppress == 0 {
|
||||
gsub(/<!--Package Count-->[^<]*<!--\/Package Count-->/,
|
||||
"<!--Package Count-->'"$(awk 'END {print NR}' "$of")"'<!--/Package Count-->");
|
||||
print;
|
||||
}
|
||||
/<!--Language Packs-->/ {
|
||||
suppress = 1;
|
||||
while ( ( getline line < "'"$of"'" ) > 0 ) {
|
||||
print line;
|
||||
}
|
||||
}
|
||||
/<!--\/Language Packs-->/ {
|
||||
suppress = 0;
|
||||
print;
|
||||
}' "README.md" >"$tf"
|
||||
mv "$tf" "README.md"
|
||||
}
|
||||
|
||||
PACKS="
|
||||
acpiasl:martinlroth/vim-acpi-asl
|
||||
ansible:pearofducks/ansible-vim
|
||||
apiblueprint:sheerun/apiblueprint.vim
|
||||
applescript:mityu/vim-applescript:_SYNTAX
|
||||
arduino:sudar/vim-arduino-syntax
|
||||
asciidoc:asciidoc/vim-asciidoc
|
||||
autohotkey:hnamikaw/vim-autohotkey
|
||||
blade:jwalton512/vim-blade
|
||||
brewfile:bfontaine/Brewfile.vim
|
||||
c++11:octol/vim-cpp-enhanced-highlight
|
||||
c/c++:vim-jp/vim-cpp
|
||||
caddyfile:isobit/vim-caddyfile
|
||||
carp:hellerve/carp-vim
|
||||
cjsx:mtscout6/vim-cjsx
|
||||
clojure:guns/vim-clojure-static
|
||||
cmake:pboettch/vim-cmake-syntax
|
||||
coffee-script:kchmck/vim-coffee-script:_NOAFTER
|
||||
cql:elubow/cql-vim
|
||||
cryptol:victoredwardocallaghan/cryptol.vim
|
||||
crystal:rhysd/vim-crystal
|
||||
csv:chrisbra/csv.vim
|
||||
cucumber:tpope/vim-cucumber
|
||||
cue:mgrabovsky/vim-cuesheet
|
||||
dart:dart-lang/dart-vim-plugin
|
||||
dhall:vmchale/dhall-vim
|
||||
dlang:JesseKPhillips/d.vim
|
||||
dockerfile:ekalinin/Dockerfile.vim
|
||||
elixir:elixir-lang/vim-elixir
|
||||
elm:andys8/vim-elm-syntax
|
||||
emberscript:yalesov/vim-ember-script
|
||||
emblem:yalesov/vim-emblem
|
||||
erlang:vim-erlang/vim-erlang-runtime
|
||||
ferm:vim-scripts/ferm.vim
|
||||
fish:georgewitteman/vim-fish
|
||||
flatbuffers:dcharbon/vim-flatbuffers
|
||||
fsharp:ionide/Ionide-vim:_BASIC
|
||||
gdscript:calviken/vim-gdscript3:_SYNTAX
|
||||
git:tpope/vim-git
|
||||
glsl:tikhomirov/vim-glsl:_NOAFTER
|
||||
gmpl:maelvalais/gmpl.vim
|
||||
gnuplot:vim-scripts/gnuplot-syntax-highlighting
|
||||
go:fatih/vim-go:_BASIC
|
||||
graphql:jparise/vim-graphql:_ALL
|
||||
gradle:tfnico/vim-gradle
|
||||
haml:sheerun/vim-haml
|
||||
handlebars:mustache/vim-mustache-handlebars
|
||||
haproxy:CH-DanReif/haproxy.vim
|
||||
haskell:neovimhaskell/haskell-vim
|
||||
haxe:yaymukund/vim-haxe
|
||||
hcl:b4b4r07/vim-hcl
|
||||
helm:towolf/vim-helm
|
||||
hive:zebradil/hive.vim
|
||||
html5:othree/html5.vim
|
||||
i3:mboughaba/i3config.vim
|
||||
icalenadr:chutzpah/icalendar.vim
|
||||
idris:idris-hackers/idris-vim
|
||||
ion:vmchale/ion-vim
|
||||
javascript:pangloss/vim-javascript:_JAVASCRIPT
|
||||
jenkins:martinda/Jenkinsfile-vim-syntax
|
||||
jinja:lepture/vim-jinja
|
||||
json5:GutenYe/json5.vim
|
||||
json:elzr/vim-json
|
||||
jst:briancollins/vim-jst
|
||||
jsx:MaxMEllon/vim-jsx-pretty:_ALL
|
||||
julia:JuliaEditorSupport/julia-vim
|
||||
kotlin:udalov/kotlin-vim
|
||||
ledger:ledger/vim-ledger:_BASIC
|
||||
less:groenewege/vim-less:_NOAFTER
|
||||
lilypond:anowlcalledjosh/vim-lilypond
|
||||
livescript:gkz/vim-ls
|
||||
llvm:rhysd/vim-llvm
|
||||
log:MTDL9/vim-log-highlighting
|
||||
lua:tbastos/vim-lua
|
||||
mako:sophacles/vim-bundle-mako
|
||||
markdown:plasticboy/vim-markdown:_NOAFTER
|
||||
mathematica:voldikss/vim-mma
|
||||
mdx:jxnblk/vim-mdx-js
|
||||
meson:mesonbuild/meson:_ALL:/data/syntax-highlighting/vim/
|
||||
moonscript:leafo/moonscript-vim
|
||||
nginx:chr4/nginx.vim
|
||||
nim:zah/nim.vim:_BASIC
|
||||
nix:LnL7/vim-nix
|
||||
objc:b4winckler/vim-objc
|
||||
ocaml:rgrinberg/vim-ocaml
|
||||
octave:McSinyx/vim-octave
|
||||
opencl:petRUShka/vim-opencl
|
||||
perl:vim-perl/vim-perl
|
||||
pgsql:lifepillar/pgsql.vim
|
||||
php:StanAngeloff/php.vim
|
||||
plantuml:aklt/plantuml-syntax
|
||||
pony:jakwings/vim-pony
|
||||
powershell:PProvost/vim-ps1
|
||||
protobuf:uarun/vim-protobuf
|
||||
pug:digitaltoad/vim-pug
|
||||
puppet:rodjek/vim-puppet
|
||||
purescript:purescript-contrib/purescript-vim
|
||||
python-compiler:aliev/vim-compiler-python
|
||||
python-indent:Vimjas/vim-python-pep8-indent
|
||||
python:vim-python/python-syntax
|
||||
qmake:artoj/qmake-syntax-vim
|
||||
qml:peterhoeg/vim-qml
|
||||
r-lang:vim-scripts/R.vim:_BASIC
|
||||
racket:wlangstroth/vim-racket
|
||||
ragel:jneen/ragel.vim
|
||||
raku:Raku/vim-raku
|
||||
raml:IN3D/vim-raml
|
||||
razor:adamclerk/vim-razor
|
||||
reason:reasonml-editor/vim-reason-plus
|
||||
rspec:keith/rspec.vim
|
||||
rst:marshallward/vim-restructuredtext
|
||||
ruby:vim-ruby/vim-ruby
|
||||
rust:rust-lang/rust.vim
|
||||
sbt:derekwyatt/vim-sbt
|
||||
scala:derekwyatt/vim-scala
|
||||
scss:cakebaker/scss-syntax.vim
|
||||
sh:arzg/vim-sh
|
||||
slim:slim-template/vim-slim
|
||||
slime:slime-lang/vim-slime-syntax
|
||||
smt2:bohlender/vim-smt2
|
||||
solidity:tomlion/vim-solidity
|
||||
stylus:wavded/vim-stylus
|
||||
svelte:evanleck/vim-svelte
|
||||
svg-indent:jasonshell/vim-svg-indent
|
||||
svg:vim-scripts/svg.vim
|
||||
swift:keith/swift.vim
|
||||
sxhkd:baskerville/vim-sxhkdrc
|
||||
systemd:wgwoods/vim-systemd-syntax
|
||||
terraform:hashivim/vim-terraform
|
||||
textile:timcharper/textile.vim
|
||||
thrift:solarnz/thrift.vim
|
||||
tmux:ericpruitt/tmux.vim:_ALL:/vim/
|
||||
tomdoc:wellbredgrapefruit/tomdoc.vim
|
||||
toml:cespare/vim-toml
|
||||
tptp:c-cube/vim-tptp
|
||||
twig:lumiliet/vim-twig
|
||||
typescript:HerringtonDarkholme/yats.vim
|
||||
v:ollykel/v-vim
|
||||
vala:arrufat/vala.vim
|
||||
vbnet:vim-scripts/vbnet.vim
|
||||
vcl:smerrill/vcl-vim-plugin
|
||||
vifm:vifm/vifm.vim
|
||||
vm:lepture/vim-velocity
|
||||
vue:posva/vim-vue
|
||||
xdc:amal-khailtash/vim-xdc-syntax
|
||||
xml:amadeus/vim-xml
|
||||
xls:vim-scripts/XSLT-syntax
|
||||
yaml:stephpy/vim-yaml
|
||||
yard:sheerun/vim-yardoc
|
||||
zephir:xwsoul/vim-zephir
|
||||
zig:ziglang/zig.vim
|
||||
zinit:zinit-zsh/zplugin-vim-syntax
|
||||
"
|
||||
|
||||
rm -rf tmp
|
||||
rm -rf "${DIRS_RM[@]}"
|
||||
mkdir tmp
|
||||
|
||||
printf "Downloading packs..."
|
||||
download "$(sed '/^#/d' <<<"$PACKS")"
|
||||
extract "$(sed '/^#/d' <<<"$PACKS")"
|
||||
update_readme
|
||||
|
||||
rm -rf tmp
|
||||
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
|
||||
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 commentstring=#\ %s
|
||||
setlocal suffixesadd=.cr
|
||||
@@ -66,7 +38,8 @@ nnoremap <buffer><Plug>(crystal-spec-run-current) :<C-u>CrystalSpecRunCurrent<
|
||||
nnoremap <buffer><Plug>(crystal-format) :<C-u>CrystalFormat<CR>
|
||||
|
||||
augroup plugin-ft-crystal
|
||||
autocmd BufWritePre <buffer> if g:crystal_auto_format | call crystal_lang#format('', 1) | endif
|
||||
autocmd!
|
||||
autocmd BufWritePre <buffer> if g:crystal_auto_format && &filetype ==# 'crystal' | call crystal_lang#format('', 1) | endif
|
||||
augroup END
|
||||
|
||||
if get(g:, 'crystal_define_mappings', 1)
|
||||
@@ -81,14 +54,33 @@ if &l:ofu ==# ''
|
||||
setlocal omnifunc=crystal_lang#complete
|
||||
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 = { '{%': '%}' }
|
||||
call extend(b:AutoPairs, g:AutoPairs, 'force')
|
||||
endif
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: sw=2 sts=2 et:
|
||||
|
||||
endif
|
||||
|
||||
@@ -11,9 +11,7 @@ set smarttab
|
||||
|
||||
if exists('g:dhall_use_ctags')
|
||||
if g:dhall_use_ctags == 1
|
||||
augroup dhall
|
||||
autocmd BufWritePost *.dhall silent !ctags -R .
|
||||
augroup END
|
||||
autocmd BufWritePost *.dhall silent !ctags -R .
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -26,9 +24,7 @@ endfunction
|
||||
|
||||
if exists('g:dhall_strip_whitespace')
|
||||
if g:dhall_strip_whitespace == 1
|
||||
augroup dhall
|
||||
au BufWritePre *.dhall silent! call StripTrailingWhitespace()
|
||||
augroup END
|
||||
au BufWritePre *.dhall silent! call StripTrailingWhitespace()
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -42,14 +38,10 @@ endfunction
|
||||
|
||||
if exists('g:dhall_format')
|
||||
if g:dhall_format == 1
|
||||
augroup dhall
|
||||
au BufWritePost *.dhall call DhallFormat()
|
||||
augroup END
|
||||
au BufWritePost *.dhall call DhallFormat()
|
||||
endif
|
||||
endif
|
||||
|
||||
augroup dhall
|
||||
au BufNewFile,BufRead *.dhall setl shiftwidth=2
|
||||
augroup END
|
||||
au BufNewFile,BufRead *.dhall setl shiftwidth=2
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
" Filetype plugin for https://crystal-lang.org/api/0.35.1/ECR.html
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -119,7 +119,7 @@ endif
|
||||
" TODO: comments=
|
||||
setlocal commentstring=<%#%s%>
|
||||
|
||||
let b:undo_ftplugin = "setl cms< "
|
||||
let b:undo_ftplugin = "setl cms< " .
|
||||
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
|
||||
|
||||
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
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Vim filetype plugin
|
||||
" Language: generic git output
|
||||
" 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
|
||||
if (exists("b:did_ftplugin"))
|
||||
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Vim filetype plugin
|
||||
" Language: git commit file
|
||||
" 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
|
||||
if (exists("b:did_ftplugin"))
|
||||
@@ -14,6 +14,7 @@ runtime! ftplugin/git.vim
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s
|
||||
setlocal include=^\+\+\+
|
||||
setlocal nomodeline tabstop=8 formatoptions+=tl textwidth=72
|
||||
setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=q formatoptions+=n
|
||||
setlocal formatlistpat+=\\\|^\\s*[-*+]\\s\\+
|
||||
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Vim filetype plugin
|
||||
" Language: git rebase --interactive
|
||||
" 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
|
||||
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
|
||||
13
ftplugin/jsonnet.vim
Normal file
13
ftplugin/jsonnet.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsonnet') == -1
|
||||
|
||||
|
||||
|
||||
|
||||
" -- fmt
|
||||
command! -nargs=0 JsonnetFmt call jsonnet#Format()
|
||||
|
||||
setlocal commentstring=//\ %s
|
||||
|
||||
|
||||
|
||||
endif
|
||||
@@ -25,6 +25,8 @@ let b:julia_vim_loaded = 1
|
||||
|
||||
let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<"
|
||||
\ . " define< fo< shiftwidth< expandtab< indentexpr< indentkeys< cinoptions< omnifunc<"
|
||||
\ . " | unlet! b:commentary_format"
|
||||
\ . " | unlet! b:smartcomment_force_linemode"
|
||||
\ . " | unlet! b:julia_vim_loaded"
|
||||
|
||||
" MatchIt plugin support
|
||||
@@ -94,6 +96,10 @@ if exists("loaded_matchit")
|
||||
|
||||
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")
|
||||
let b:browsefilter = "Julia Source Files (*.jl)\t*.jl\n"
|
||||
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
|
||||
" Maintainer: xaizek <xaizek@posteo.net>
|
||||
" Last Change: January 02, 2018
|
||||
" Last Change: June 22, 2020
|
||||
|
||||
" Insert attachment picked via vifm after 'Subject' header
|
||||
function! s:AddMailAttachments()
|
||||
@@ -43,9 +43,7 @@ endfunction
|
||||
|
||||
function! s:HandleRunResults(exitcode, listf)
|
||||
if a:exitcode != 0
|
||||
echohl WarningMsg
|
||||
echo 'Got non-zero code from vifm: ' . a:exitcode
|
||||
echohl None
|
||||
echoerr 'Got non-zero code from vifm: ' . a:exitcode
|
||||
call delete(a:listf)
|
||||
return
|
||||
endif
|
||||
|
||||
@@ -156,6 +156,58 @@ function! s:GetHeaderLevel(...)
|
||||
endif
|
||||
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.
|
||||
"
|
||||
" If there is no header at the given line, returns `0`.
|
||||
@@ -177,6 +229,7 @@ endfunction
|
||||
function! s:MoveToParentHeader()
|
||||
let l:linenum = s:GetParentHeaderLineNumber()
|
||||
if l:linenum != 0
|
||||
call setpos("''", getpos('.'))
|
||||
call cursor(l:linenum, 1)
|
||||
else
|
||||
echo 'no parent header'
|
||||
@@ -305,65 +358,38 @@ function! s:Toc(...)
|
||||
endif
|
||||
|
||||
|
||||
let l:bufnr = bufnr('%')
|
||||
let l:cursor_line = line('.')
|
||||
let l:cursor_header = 0
|
||||
let l:fenced_block = 0
|
||||
let l:front_matter = 0
|
||||
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)
|
||||
let l:header_list = s:GetHeaderList()
|
||||
let l:indented_header_list = []
|
||||
if len(l:header_list) == 0
|
||||
echom "Toc: No headers."
|
||||
return
|
||||
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'
|
||||
lopen
|
||||
@@ -371,7 +397,8 @@ function! s:Toc(...)
|
||||
vertical lopen
|
||||
" auto-fit toc window when possible to shrink it
|
||||
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
|
||||
execute 'vertical resize ' . (&columns/2)
|
||||
endif
|
||||
@@ -384,27 +411,84 @@ function! s:Toc(...)
|
||||
for i in range(1, line('$'))
|
||||
" this is the location-list data for the current item
|
||||
let d = getloclist(0)[i-1]
|
||||
" atx headers
|
||||
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)
|
||||
call setline(i, d.text)
|
||||
endfor
|
||||
setlocal nomodified
|
||||
setlocal nomodifiable
|
||||
execute 'normal! ' . l:cursor_header . 'G'
|
||||
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.
|
||||
"
|
||||
" Return the number of conversions.
|
||||
@@ -681,6 +765,8 @@ command! -buffer Toc call s:Toc()
|
||||
command! -buffer Toch call s:Toc('horizontal')
|
||||
command! -buffer Tocv call s:Toc('vertical')
|
||||
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/
|
||||
if exists('g:vim_markdown_fenced_languages')
|
||||
@@ -704,7 +790,7 @@ function! s:MarkdownHighlightSources(force)
|
||||
" Look for code blocks in the current file
|
||||
let filetypes = {}
|
||||
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
|
||||
endfor
|
||||
if !exists('b:mkd_known_filetypes')
|
||||
@@ -735,7 +821,7 @@ function! s:MarkdownHighlightSources(force)
|
||||
else
|
||||
let include = '@' . toupper(filetype)
|
||||
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('syntax cluster mkdNonListItem add=%s', group)
|
||||
|
||||
|
||||
@@ -4,6 +4,11 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'racket') == -1
|
||||
" Maintainer: Will Langstroth <will@langstroth.com>
|
||||
" URL: http://github.com/wlangstroth/vim-racket
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setl iskeyword+=#,%,^
|
||||
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
|
||||
@@ -37,7 +42,10 @@ setl makeprg=raco\ make\ --\ %
|
||||
" but then vim says:
|
||||
" "press ENTER or type a command to continue"
|
||||
" 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
|
||||
" selected text:
|
||||
@@ -53,9 +61,20 @@ function! s:Racket_visual_doc()
|
||||
endtry
|
||||
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\ \|#
|
||||
|
||||
" 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
|
||||
|
||||
@@ -11,6 +11,9 @@ if exists("b:did_ftplugin")
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setlocal comments< commentstring<"
|
||||
|
||||
setlocal comments=:#
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
endif
|
||||
|
||||
@@ -16,4 +16,9 @@ setlocal suffixesadd=.zir
|
||||
setlocal commentstring=//\ %s
|
||||
setlocal makeprg=zig\ build
|
||||
|
||||
if (has("comments"))
|
||||
set comments=:///,://,:\\\\
|
||||
set formatoptions=tcqor
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
" Initialization {{{1
|
||||
" ==============
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal nosmartindent
|
||||
|
||||
" Now, set up our indentation expression and keys that trigger it.
|
||||
setlocal indentexpr=GetCrystalIndent(v:lnum)
|
||||
setlocal indentkeys=0{,0},0),0],!^F,o,O,e,:,.
|
||||
setlocal indentkeys+==end,=else,=elsif,=when,=ensure,=rescue
|
||||
setlocal indentkeys+==private,=protected
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
setlocal indentkeys=0{,0},0),0],!^F,o,O,e,.
|
||||
setlocal indentkeys+==end,=else,=elsif,=when,=in,=ensure,=rescue
|
||||
|
||||
" Only define the function once.
|
||||
if exists('*GetCrystalIndent')
|
||||
@@ -26,7 +26,7 @@ endif
|
||||
if exists('*shiftwidth')
|
||||
let s:sw = function('shiftwidth')
|
||||
else
|
||||
function s:sw()
|
||||
function! s:sw()
|
||||
return &shiftwidth
|
||||
endfunction
|
||||
endif
|
||||
@@ -34,262 +34,81 @@ endif
|
||||
" GetCrystalIndent Function {{{1
|
||||
" =========================
|
||||
|
||||
function GetCrystalIndent(...)
|
||||
function! GetCrystalIndent(...) abort
|
||||
" Setup {{{2
|
||||
" -----
|
||||
|
||||
" For the current line, use the first argument if given, else v:lnum
|
||||
let clnum = a:0 ? a:1 : v:lnum
|
||||
let indent_info = {}
|
||||
|
||||
" Set up variables for restoring position in file
|
||||
let vcol = col('.')
|
||||
" The value of a single shift-width
|
||||
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
|
||||
" ------------------------
|
||||
|
||||
" Get the current line.
|
||||
let line = getline(clnum)
|
||||
let ind = -1
|
||||
for callback_name in g:crystal#indent#curr_line_callbacks
|
||||
let indent = call(function(callback_name), [indent_info])
|
||||
|
||||
" If we got a closing bracket on an empty line, find its match and indent
|
||||
" according to it. For parentheses we indent to its column - 1, for the
|
||||
" 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
|
||||
if indent >= 0
|
||||
return indent
|
||||
endif
|
||||
return ind
|
||||
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
|
||||
endfor
|
||||
|
||||
" Work on the previous line. {{{2
|
||||
" --------------------------
|
||||
|
||||
" Find a non-blank, non-multi-line string line above the current line.
|
||||
let lnum = crystal#indent#PrevNonBlankNonString(clnum - 1)
|
||||
" Special case: we don't need the real PrevNonBlank for an empty line
|
||||
" 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 line =~# '^\s*$' && lnum != prevnonblank(clnum - 1)
|
||||
return indent(prevnonblank(clnum))
|
||||
if indent >= 0
|
||||
return indent
|
||||
endif
|
||||
|
||||
" At the start of the file use zero indent.
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
" Previous line number
|
||||
let indent_info.plnum = crystal#indent#PrevNonBlank(indent_info.clnum - 1)
|
||||
let indent_info.pline = getline(indent_info.plnum)
|
||||
|
||||
" Set up variables for the previous line.
|
||||
let line = getline(lnum)
|
||||
let ind = indent(lnum)
|
||||
for callback_name in g:crystal#indent#prev_line_callbacks
|
||||
let indent = call(function(callback_name), [indent_info])
|
||||
|
||||
if crystal#indent#Match(lnum, g:crystal#indent#continuable_regex) &&
|
||||
\ crystal#indent#Match(lnum, g:crystal#indent#continuation_regex)
|
||||
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()
|
||||
if indent >= 0
|
||||
return indent
|
||||
endif
|
||||
return ind
|
||||
endif
|
||||
endfor
|
||||
|
||||
" If the previous line started with a leading operator, use its MSL's level
|
||||
" of indent
|
||||
if crystal#indent#Match(lnum, g:crystal#indent#leading_operator_regex)
|
||||
return indent(crystal#indent#GetMSL(lnum))
|
||||
endif
|
||||
" Work on the MSL. {{{2
|
||||
" ----------------
|
||||
|
||||
" If the previous line ended with the "*" of a splat, add a level of indent
|
||||
if line =~ g:crystal#indent#splat_regex
|
||||
return indent(lnum) + s:sw()
|
||||
endif
|
||||
" Most Significant line based on the previous one -- in case it's a
|
||||
" contination of something above
|
||||
let indent_info.plnum_msl = crystal#indent#GetMSL(indent_info.plnum)
|
||||
let indent_info.pline_msl = getline(indent_info.plnum_msl)
|
||||
|
||||
" If the previous line contained unclosed opening brackets and we are still
|
||||
" in them, find the rightmost one and add indent depending on the bracket
|
||||
" 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)
|
||||
for callback_name in g:crystal#indent#msl_callbacks
|
||||
let indent = call(function(callback_name), [indent_info])
|
||||
|
||||
if opening.pos != -1
|
||||
if opening.type ==# '(' && searchpair('(', '', ')', 'bW', g:crystal#indent#skip_expr)
|
||||
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
|
||||
if indent >= 0
|
||||
return indent
|
||||
endif
|
||||
end
|
||||
|
||||
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
|
||||
endfor
|
||||
|
||||
" }}}2
|
||||
|
||||
return ind
|
||||
" By default, just return the previous line's indent
|
||||
return indent(indent_info.plnum)
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim:set sw=2 sts=2 ts=8 et:
|
||||
" vim:sw=2 sts=2 ts=8 fdm=marker et:
|
||||
|
||||
endif
|
||||
|
||||
@@ -52,7 +52,7 @@ if b:ecrystal_indent_multiline
|
||||
endif
|
||||
|
||||
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
|
||||
|
||||
@@ -71,11 +71,10 @@ let s:ecr_control_open = '<%%\@!-\=[=#]\@!'
|
||||
let s:ecr_comment_open = '<%%\@!-\=#'
|
||||
|
||||
let s:ecr_indent_regex =
|
||||
\ '\<\%(if\|unless\|else\|elsif\|case\|for\|when\|while\|until\|begin\|do\|rescue\|ensure\|' .
|
||||
\ 'class\|module\|struct\|lib\|enum\|union\)\>'
|
||||
\ '\<\%(if\|unless\|else\|elsif\|case\|when\|in\|while\|until\|begin\|do\|rescue\|ensure\|\)\>'
|
||||
|
||||
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
|
||||
if exists('*shiftwidth')
|
||||
|
||||
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
|
||||
@@ -843,12 +843,11 @@ func! HtmlIndent_FindTagStart(lnum)
|
||||
" - a flag indicating whether we found the end of a tag.
|
||||
" This method is global so that HTML-like indenters can use it.
|
||||
" To avoid matching " > " or " < " inside a string require that the opening
|
||||
" "<" is followed by a word character and the closing ">" comes after a
|
||||
" non-white character.
|
||||
" "<" is followed by a word character
|
||||
let idx = match(getline(a:lnum), '\S>\s*$')
|
||||
if idx > 0
|
||||
call cursor(a:lnum, idx)
|
||||
let lnum = searchpair('<\w', '' , '\S>', 'bW', '', max([a:lnum - b:html_indent_line_limit, 0]))
|
||||
let lnum = searchpair('<\w', '' , '>', 'bW', '', max([a:lnum - b:html_indent_line_limit, 0]))
|
||||
if lnum > 0
|
||||
return [lnum, 1]
|
||||
endif
|
||||
|
||||
@@ -270,6 +270,12 @@ function IsInBrackets(lnum, c)
|
||||
return len(stack) > 0
|
||||
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
|
||||
" multiline bracketed expression, to be used as reference for block
|
||||
" indentation.
|
||||
@@ -290,6 +296,11 @@ function LastBlockIndent(lnum)
|
||||
endfunction
|
||||
|
||||
function GetJuliaIndent()
|
||||
" Do not alter doctrings indentation
|
||||
if IsInDocString(v:lnum)
|
||||
return -1
|
||||
endif
|
||||
|
||||
" Find a non-blank line above the current line.
|
||||
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_end = '\<end\%(\s*[)}]\)\+'
|
||||
|
||||
let s:chained_func_call = "^\\v\\s*[:.]\\w+[({\"']"
|
||||
|
||||
" Expression used to check whether we should skip a match with searchpair().
|
||||
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~# 'luaComment\\|luaString'"
|
||||
|
||||
@@ -100,6 +102,16 @@ function GetLuaIndent()
|
||||
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
|
||||
|
||||
" 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
|
||||
if i > 1 && contents_prev =~# s:anon_func_start
|
||||
let i = 1
|
||||
|
||||
@@ -77,7 +77,7 @@ endfunction
|
||||
function! s:getIncIndent() abort
|
||||
" Function to determine the s:incIndent pattern
|
||||
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*ref\>[^:]*$\|' .
|
||||
\ '^\s*[hr]\?note\>\%(\%("[^"]*" \<as\>\)\@![^:]\)*$\|' .
|
||||
|
||||
@@ -28,7 +28,12 @@ endif
|
||||
|
||||
if !exists('g:ruby_indent_block_style')
|
||||
" 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
|
||||
|
||||
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 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'
|
||||
let ind = indent(line('.'))
|
||||
else " g:ruby_indent_block_style == 'expression'
|
||||
@@ -548,7 +557,9 @@ function! s:AfterUnbalancedBracket(pline_info) abort
|
||||
let [opening, closing] = s:ExtraBrackets(info.plnum)
|
||||
|
||||
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('$')
|
||||
return indent(info.plnum) + info.sw
|
||||
else
|
||||
|
||||
@@ -49,6 +49,16 @@ function! TerraformIndent(lnum)
|
||||
let thisindent -= &shiftwidth
|
||||
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
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_st
|
||||
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
||||
|
||||
" 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.
|
||||
" TODO: this needs to deal with if ...: and so on
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vm') == -1
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'velocity') == -1
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
|
||||
@@ -15,6 +15,7 @@ setlocal nolisp
|
||||
setlocal autoindent
|
||||
setlocal indentexpr=VlangIndent(v:lnum)
|
||||
setlocal indentkeys+=<:>,0=},0=)
|
||||
setlocal noexpandtab
|
||||
|
||||
if exists("*VlangIndent")
|
||||
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
|
||||
1302
packages.yaml
Normal file
1302
packages.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
304
scripts/build
Executable file
304
scripts/build
Executable file
@@ -0,0 +1,304 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require 'open-uri'
|
||||
require 'open3'
|
||||
require 'yaml'
|
||||
require 'fileutils'
|
||||
|
||||
Dir.chdir(File.dirname(__dir__))
|
||||
|
||||
PACKAGES = YAML.load_stream(File.read('packages.yaml'))
|
||||
|
||||
BASE_URL = 'https://raw.githubusercontent.com/github/linguist/master'
|
||||
|
||||
DIRS = {
|
||||
default: %w(syntax indent compiler autoload ftplugin ctags after/syntax after/indent after/ftplugin),
|
||||
all: %w(syntax indent compiler autoload ftplugin after extras ctags),
|
||||
basic: %w(syntax compiler indent after/syntax after/indent),
|
||||
syntax: %w(syntax indent after/syntax after/indent),
|
||||
noafter: %w(syntax compiler indent autoload ftplugin),
|
||||
javascript: %w(syntax indent compiler autoload ftplugin ctags after/syntax after/indent after/ftplugin extras),
|
||||
go: %w(autoload/go/config.vim syntax compiler indent after/syntax after/indent)
|
||||
}
|
||||
|
||||
def parallel(*procs)
|
||||
threads = procs.map { |p| Thread.new { method(p).call } }
|
||||
threads.map(&:join).map(&:value)
|
||||
end
|
||||
|
||||
def read_strings(data, keys, print=false)
|
||||
if data.is_a?(Hash)
|
||||
data.flat_map do |key, val|
|
||||
read_strings(val, keys, keys.include?(key))
|
||||
end
|
||||
elsif data.is_a?(Array)
|
||||
data.flat_map { |d| read_strings(d, keys, print) }
|
||||
elsif data.is_a?(String)
|
||||
print ? [data] : []
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
|
||||
def transform_with(data, keys, transfrom=false, &block)
|
||||
if data.is_a?(Hash)
|
||||
Hash[data.map do |key, val|
|
||||
[key, transform_with(val, keys, keys.include?(key), &block)]
|
||||
end]
|
||||
elsif data.is_a?(Array)
|
||||
data.map { |d| transform_with(d, keys, transfrom, &block) }
|
||||
elsif data.is_a?(String)
|
||||
transfrom ? yield(data) : data
|
||||
else
|
||||
data
|
||||
end
|
||||
end
|
||||
|
||||
def each_hash(data, &block)
|
||||
if data.is_a?(Hash)
|
||||
yield data
|
||||
data.each do |key, val|
|
||||
each_hash(val, &block)
|
||||
end
|
||||
elsif data.is_a?(Array)
|
||||
data.map { |d| each_hash(d, &block) }
|
||||
end
|
||||
end
|
||||
|
||||
def patterns_to_vim_patterns(patterns)
|
||||
stdin, stdout, stderr = Open3.popen3('vim', '-V', '--clean', '/dev/stdin', '-es', '-c', "echo expand('%:p:h') | source #{__dir__}/scripts/eregex.vim", '-c', "for line in range(0, line('$')) | call setline(line, ExtendedRegex2VimRegex(getline(line))) | endfor", '-c', ':wq! /dev/stdout', chdir: __dir__)
|
||||
stdin.write(patterns.join("\n"))
|
||||
stdin.close
|
||||
stdout.readlines
|
||||
end
|
||||
|
||||
def transform_patterns(data)
|
||||
patterns = read_strings(data, ["pattern", "patterns"])
|
||||
patterns_mapping = Hash[patterns.zip(patterns_to_vim_patterns(patterns))]
|
||||
transform_with(data, ["pattern", "patterns"]) { |a| patterns_mapping[a] }
|
||||
end
|
||||
|
||||
def load_heuristics
|
||||
url = "#{BASE_URL}/lib/linguist/heuristics.yml"
|
||||
data = URI.open(url) { |io| YAML.load(io.read) }
|
||||
each_hash(data["disambiguations"]) do |h|
|
||||
if h.has_key?("named_pattern")
|
||||
h["pattern"] = data["named_patterns"].fetch(h["named_pattern"])
|
||||
h.delete("named_pattern")
|
||||
end
|
||||
end
|
||||
transform_patterns(data["disambiguations"])
|
||||
end
|
||||
|
||||
def load_languages
|
||||
url = "#{BASE_URL}/lib/linguist/languages.yml"
|
||||
data = URI.open(url) { |io| YAML.load(io.read) }
|
||||
end
|
||||
|
||||
def parse_remote(remote)
|
||||
match = remote.match(/(?<repo>[^@:]+)(?:@(?<branch>[^:]+))?(?::(?<path>.*))?/)
|
||||
[match[:repo], match[:branch] || "master", match[:path]]
|
||||
end
|
||||
|
||||
def copy_file(package, src, dest)
|
||||
return unless [".vim", ".ctags", ".vital"].include?(File.extname(src))
|
||||
FileUtils.mkdir_p(File.dirname(dest))
|
||||
name = package.fetch("name")
|
||||
|
||||
open(src, "r") do |input|
|
||||
open(dest, "a+") do |output|
|
||||
if name == "jsx"
|
||||
output << "if !exists('g:polyglot_disabled') || !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)\n\n"
|
||||
else
|
||||
output << "if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '#{name}') == -1\n\n"
|
||||
end
|
||||
IO.copy_stream(input, output)
|
||||
output << "\nendif\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def download
|
||||
FileUtils.rm_rf('tmp')
|
||||
|
||||
PACKAGES.each_slice(20) do |batch|
|
||||
batch.map do |package|
|
||||
Thread.new do
|
||||
repo, branch, path = parse_remote(package.fetch("remote"))
|
||||
dir = "tmp/" + repo.split('/')[1]
|
||||
FileUtils.mkdir_p(dir)
|
||||
url = "https://codeload.github.com/#{repo}/tar.gz/#{branch}"
|
||||
`curl --silent -fL #{url} | tar -zx -C "#{dir}" --strip 1`
|
||||
progress
|
||||
end
|
||||
end.map(&:join)
|
||||
end
|
||||
end
|
||||
|
||||
$i = 0
|
||||
LYRICS = "Never gonna give you up. Never gonna let you down. " +
|
||||
"Never gonna run around and desert you. " +
|
||||
"Never gonna make you cry. Never gonna say goodbye. " +
|
||||
"Never gonna tell a lie and hurt you."
|
||||
|
||||
$mutex = Mutex.new
|
||||
def progress
|
||||
$mutex.synchronize do
|
||||
$stdout.write(LYRICS[$i] || ".")
|
||||
$i += 1
|
||||
end
|
||||
end
|
||||
|
||||
def extract
|
||||
FileUtils.rm_rf(DIRS[:all])
|
||||
|
||||
output = []
|
||||
PACKAGES.map do |package|
|
||||
repo, branch, path = parse_remote(package["remote"])
|
||||
dir = "tmp/" + repo.split('/')[1]
|
||||
subdirs = []
|
||||
for subdir in DIRS.fetch(package.fetch("dirs", "default").to_sym)
|
||||
subtree = "#{dir}/#{path ? path + "/" : ""}"
|
||||
subpath = "#{subtree}#{subdir}"
|
||||
if FileTest.directory?(subpath)
|
||||
Dir.glob("#{subdir}/**/*", base: subtree).each do |p|
|
||||
next unless File.file?("#{subtree}/#{p}")
|
||||
copy_file(package, "#{subtree}/#{p}", p)
|
||||
end
|
||||
|
||||
subdirs << subdir.split("/").last
|
||||
elsif File.exist?(subpath)
|
||||
copy_file(package, subpath, subdir)
|
||||
end
|
||||
end
|
||||
|
||||
output << "- [#{package["name"]}](https://github.com/#{repo}) (#{subdirs.uniq.join(", ")})"
|
||||
progress
|
||||
end
|
||||
|
||||
readme = File.read('README.md')
|
||||
|
||||
readme.gsub!(
|
||||
%r{(?<=<!--Package Count-->).*?(?=<!--/Package Count-->)},
|
||||
output.size.to_s
|
||||
)
|
||||
|
||||
readme.gsub!(
|
||||
%r{(?<=<!--Language Packs-->).*?(?=<!--/Language Packs-->)}m,
|
||||
"\n" + output.sort.join("\n") + "\n"
|
||||
)
|
||||
|
||||
File.write('README.md', readme)
|
||||
end
|
||||
|
||||
def generate_ftdetect
|
||||
heuristics, languages = parallel(:load_heuristics, :load_languages)
|
||||
|
||||
output = <<~EOS
|
||||
" 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
|
||||
|
||||
EOS
|
||||
|
||||
for package in PACKAGES
|
||||
name = package.fetch("name")
|
||||
output << if name == "jsx"
|
||||
"if !(index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'typescript') != -1 || index(g:polyglot_disabled, 'jsx') != -1)\n"
|
||||
else
|
||||
"if index(g:polyglot_disabled, '#{name}') == -1\n"
|
||||
end
|
||||
|
||||
filetypes = package["filetypes"] or raise "Unknown filetype for: #{package["name"]}"
|
||||
|
||||
for filetype in filetypes
|
||||
syntax = filetype["syntax"] ? " syntax=#{filetype["syntax"]}" : ""
|
||||
set_command = package.fetch("custom_set", "set ft=#{filetype.fetch("name")}#{syntax}")
|
||||
|
||||
linguist = filetype["linguist"] ? languages.fetch(filetype["linguist"]) : {}
|
||||
extensions = filetype["extensions"] || linguist.fetch("extensions", []).map { |e| e[1..] }
|
||||
extensions = (extensions | filetype.fetch("extra_extensions", [])) - filetype.fetch("ignored_extensions", [])
|
||||
filenames = filetype["filenames"] || linguist.fetch("filenames", [])
|
||||
filenames = (filenames | filetype.fetch("extra_filenames", [])) - filetype.fetch("ignored_filenames", [])
|
||||
|
||||
|
||||
for extension in extensions.sort
|
||||
outer_filetype = filetype["outer_filetype"]
|
||||
if outer_filetype
|
||||
output << " au BufNewFile *.*.#{extension} execute \"do BufNewFile filetypedetect \" . expand(\"<afile>:r\") | #{outer_filetype}"
|
||||
output << " au BufReadPre *.*#{extension} execute \"do BufRead filetypedetect \" . expand(\"<afile>:r\") | #{outer_filetype}"
|
||||
end
|
||||
output << " au BufNewFile,BufRead *.#{extension} #{set_command}\n"
|
||||
end
|
||||
|
||||
for filename in filenames.sort
|
||||
if filename[0] == "."
|
||||
filename = "{.,}" + filename[1..]
|
||||
end
|
||||
output << " au BufNewFile,BufRead #{filename} #{set_command}\n"
|
||||
end
|
||||
end
|
||||
|
||||
output << "endif\n\n"
|
||||
end
|
||||
|
||||
output << <<~EOS
|
||||
" restore Vi compatibility settings
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
EOS
|
||||
|
||||
File.write('ftdetect/polyglot.vim', output)
|
||||
end
|
||||
|
||||
download
|
||||
extract
|
||||
generate_ftdetect
|
||||
puts(" Bye! Have a wonderful time!")
|
||||
FileUtils.rm_rf("tmp")
|
||||
1102
scripts/eregex.vim
Normal file
1102
scripts/eregex.vim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jenkins') == -1
|
||||
runtime syntax/groovy.vim
|
||||
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
|
||||
|
||||
@@ -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 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 scm
|
||||
syn keyword jenkinsfileCoreStep sh
|
||||
@@ -24,10 +24,10 @@ syn keyword jenkinsfileCoreStep step
|
||||
syn keyword jenkinsfileCoreStep tool
|
||||
|
||||
" 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 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 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 withKubeConfig withMaven withNPM withPod withPythonEnv withSCM withSandbox withSonarQubeEnv
|
||||
syn keyword jenkinsfilePipelineStep withTypetalk wrap writeFile writeJSON writeMavenPom writeProperties writeXml writeYaml
|
||||
syn keyword jenkinsfilePipelineStep ws xUnitImporter xUnitUploader xldCreatePackage xldDeploy xldPublishPackage xlrCreateRelease
|
||||
syn keyword jenkinsfilePipelineStep xrayScanBuild zip
|
||||
syn keyword jenkinsfilePipelineStep ws xUnitImporter xUnitUploader xunit xldCreatePackage xldDeploy xldPublishPackage
|
||||
syn keyword jenkinsfilePipelineStep xlrCreateRelease xrayScanBuild zip
|
||||
|
||||
hi link jenkinsfileSection Statement
|
||||
hi link jenkinsfileDirective jenkinsfileSection
|
||||
|
||||
@@ -103,6 +103,13 @@ else
|
||||
highlight default link ansible_with_keywords Statement
|
||||
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"
|
||||
|
||||
endif
|
||||
|
||||
@@ -51,7 +51,7 @@ endif
|
||||
syn keyword arduinoFunc Wire1
|
||||
"}}}
|
||||
"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 INTERNAL1V1 INTERNAL2V56
|
||||
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 typescriptFuncImpl contained start=/function/ end=/{/me=e-1
|
||||
syntax region typescriptFuncImpl contained start=/function\>/ end=/{/me=e-1
|
||||
\ contains=typescriptFuncKeyword
|
||||
\ nextgroup=typescriptBlock
|
||||
|
||||
|
||||
@@ -30,4 +30,54 @@ syntax region typescriptFuncCallArg contained matchgroup=typescriptPa
|
||||
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 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
|
||||
|
||||
@@ -29,16 +29,12 @@ syntax keyword typescriptIdentifier arguments this super
|
||||
\ nextgroup=@afterIdentifier
|
||||
|
||||
syntax keyword typescriptVariable let var
|
||||
\ nextgroup=typescriptVariableDeclaration
|
||||
\ skipwhite skipempty skipnl
|
||||
\ nextgroup=@typescriptVariableDeclarations
|
||||
\ skipwhite skipempty
|
||||
|
||||
syntax keyword typescriptVariable const
|
||||
\ nextgroup=typescriptEnum,typescriptVariableDeclaration
|
||||
\ skipwhite
|
||||
|
||||
syntax match typescriptVariableDeclaration /[A-Za-z_$]\k*/
|
||||
\ nextgroup=typescriptTypeAnnotation,typescriptAssign
|
||||
\ contained skipwhite skipempty skipnl
|
||||
\ nextgroup=typescriptEnum,@typescriptVariableDeclarations
|
||||
\ skipwhite skipempty
|
||||
|
||||
syntax region typescriptEnum matchgroup=typescriptEnumKeyword start=/enum / end=/\ze{/
|
||||
\ nextgroup=typescriptBlock
|
||||
|
||||
@@ -16,10 +16,12 @@ syntax match typescriptBinaryOp contained /===\?/ nextgroup=@typescriptValue s
|
||||
syntax match typescriptBinaryOp contained />\(>>=\|>>\|>=\|>\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 4: <<=, <<, <=, <
|
||||
syntax match typescriptBinaryOp contained /<\(<=\|<\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 3: ||, |=, |
|
||||
syntax match typescriptBinaryOp contained /|\(|\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 3: &&, &=, &
|
||||
syntax match typescriptBinaryOp contained /&\(&\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 3: ||, |=, |, ||=
|
||||
syntax match typescriptBinaryOp contained /||\?=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 4: &&, &=, &, &&=
|
||||
syntax match typescriptBinaryOp contained /&&\?=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 2: ??, ??=
|
||||
syntax match typescriptBinaryOp contained /??=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 2: *=, *
|
||||
syntax match typescriptBinaryOp contained /\*=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
||||
" 2: %=, %
|
||||
|
||||
@@ -94,9 +94,12 @@ syntax cluster typescriptTypeMember contains=
|
||||
\ typescriptIndexSignature,
|
||||
\ @typescriptMembers
|
||||
|
||||
syntax match typescriptTupleLable /\K\k*?\?:/
|
||||
\ contained
|
||||
|
||||
syntax region typescriptTupleType matchgroup=typescriptBraces
|
||||
\ start=/\[/ end=/\]/
|
||||
\ contains=@typescriptType,@typescriptComments
|
||||
\ contains=@typescriptType,@typescriptComments,typescriptRestOrSpread,typescriptTupleLable
|
||||
\ contained skipwhite
|
||||
|
||||
syntax cluster typescriptTypeOperator
|
||||
@@ -158,6 +161,7 @@ syntax match typescriptTypeAnnotation /:/
|
||||
syntax cluster typescriptParameterList contains=
|
||||
\ typescriptTypeAnnotation,
|
||||
\ typescriptAccessibilityModifier,
|
||||
\ typescriptReadonlyModifier,
|
||||
\ typescriptOptionalMark,
|
||||
\ typescriptRestOrSpread,
|
||||
\ typescriptFuncComma,
|
||||
|
||||
@@ -74,6 +74,7 @@ if exists("did_typescript_hilink")
|
||||
HiLink typescriptStringMember String
|
||||
HiLink typescriptTemplate String
|
||||
HiLink typescriptEventString String
|
||||
HiLink typescriptDestructureString String
|
||||
HiLink typescriptASCII Special
|
||||
HiLink typescriptTemplateSB Label
|
||||
HiLink typescriptRegexpString String
|
||||
@@ -87,6 +88,7 @@ if exists("did_typescript_hilink")
|
||||
HiLink typescriptBranch Conditional
|
||||
HiLink typescriptIdentifier Structure
|
||||
HiLink typescriptVariable Identifier
|
||||
HiLink typescriptDestructureVariable PreProc
|
||||
HiLink typescriptEnumKeyword Identifier
|
||||
HiLink typescriptRepeat Repeat
|
||||
HiLink typescriptForOperator Repeat
|
||||
@@ -100,7 +102,9 @@ if exists("did_typescript_hilink")
|
||||
HiLink typescriptNumber Number
|
||||
HiLink typescriptBoolean Boolean
|
||||
HiLink typescriptObjectLabel typescriptLabel
|
||||
HiLink typescriptDestructureLabel Function
|
||||
HiLink typescriptLabel Label
|
||||
HiLink typescriptTupleLable Label
|
||||
HiLink typescriptStringProperty String
|
||||
HiLink typescriptImport Special
|
||||
HiLink typescriptImportType Special
|
||||
|
||||
@@ -150,6 +150,7 @@ syn match crystalModuleName "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w
|
||||
syn match crystalStructName "\%(\%([.@$]\@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 crystalAnnotationName "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@=" contained
|
||||
syn match crystalConstant "\%(\%([.@$]\@1<!\.\)\@1<!\<\|::\)\_s*\zs\u\w*\%(\>\|::\)\@="
|
||||
syn match crystalClassVariable "@@\%(\h\|%\|[^\x00-\x7F]\)\%(\w\|%\|[^\x00-\x7F]\)*" display
|
||||
syn match crystalInstanceVariable "@\%(\h\|%\|[^\x00-\x7F]\)\%(\w\|%\|[^\x00-\x7F]\)*" display
|
||||
@@ -182,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*(\)\@!"
|
||||
|
||||
" 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
|
||||
|
||||
" Generalized Regular Expression
|
||||
@@ -247,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
|
||||
|
||||
" Module, Class, Method, and Alias Declarations
|
||||
syn match crystalAliasDeclaration "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable nextgroup=crystalAliasDeclaration2 skipwhite
|
||||
syn match crystalAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable
|
||||
syn match crystalMethodDeclaration "[^[:space:];#(]\+" contained contains=crystalConstant,crystalFunction,crystalBoolean,crystalPseudoVariable,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable
|
||||
syn match crystalFunctionDeclaration "[^[:space:];#(=]\+" contained contains=crystalFunction
|
||||
syn match crystalTypeDeclaration "[^[:space:];#=]\+" contained contains=crystalTypeName
|
||||
syn match crystalClassDeclaration "[^[:space:];#<]\+" contained contains=crystalClassName,crystalOperator
|
||||
syn match crystalModuleDeclaration "[^[:space:];#]\+" contained contains=crystalModuleName,crystalOperator
|
||||
syn match crystalStructDeclaration "[^[:space:];#<]\+" contained contains=crystalStructName,crystalOperator
|
||||
syn match crystalLibDeclaration "[^[:space:];#]\+" contained contains=crystalLibName,crystalOperator
|
||||
syn match crystalMacroDeclaration "[^[:space:];#(]\+" contained contains=crystalFunction
|
||||
syn match crystalEnumDeclaration "[^[:space:];#<\"]\+" contained contains=crystalEnumName
|
||||
syn match crystalAliasDeclaration "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable nextgroup=crystalAliasDeclaration2 skipwhite
|
||||
syn match crystalAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable
|
||||
syn match crystalMethodDeclaration "[^[:space:];#(]\+" contained contains=crystalConstant,crystalFunction,crystalBoolean,crystalPseudoVariable,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable
|
||||
syn match crystalFunctionDeclaration "[^[:space:];#(=]\+" contained contains=crystalFunction
|
||||
syn match crystalTypeDeclaration "[^[:space:];#=]\+" contained contains=crystalTypeName
|
||||
syn match crystalClassDeclaration "[^[:space:];#<]\+" contained contains=crystalClassName,crystalOperator
|
||||
syn match crystalModuleDeclaration "[^[:space:];#]\+" contained contains=crystalModuleName,crystalOperator
|
||||
syn match crystalStructDeclaration "[^[:space:];#<]\+" contained contains=crystalStructName,crystalOperator
|
||||
syn match crystalLibDeclaration "[^[:space:];#]\+" contained contains=crystalLibName,crystalOperator
|
||||
syn match crystalMacroDeclaration "[^[:space:];#(]\+" contained contains=crystalFunction
|
||||
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 "\%(\s\|^\)\@1<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2
|
||||
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
|
||||
" Note: the following keywords have already been defined:
|
||||
" begin case class def do end for if module unless until while
|
||||
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 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
|
||||
" based folding and special highlighting of module/class/method definitions
|
||||
if !exists('b:crystal_no_expensive') && !exists('g:crystal_no_expensive')
|
||||
syn match crystalDefine "\<alias\>" nextgroup=crystalAliasDeclaration skipwhite skipnl
|
||||
syn match crystalDefine "\<def\>" nextgroup=crystalMethodDeclaration skipwhite skipnl
|
||||
syn match crystalDefine "\<fun\>" nextgroup=crystalFunctionDeclaration 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 crystalClass "\<class\>" nextgroup=crystalClassDeclaration skipwhite skipnl
|
||||
syn match crystalModule "\<module\>" nextgroup=crystalModuleDeclaration skipwhite skipnl
|
||||
syn match crystalStruct "\<struct\>" nextgroup=crystalStructDeclaration skipwhite skipnl
|
||||
syn match crystalLib "\<lib\>" nextgroup=crystalLibDeclaration skipwhite skipnl
|
||||
syn match crystalMacro "\<macro\>" nextgroup=crystalMacroDeclaration skipwhite skipnl
|
||||
syn match crystalEnum "\<enum\>" nextgroup=crystalEnumDeclaration skipwhite skipnl
|
||||
syn match crystalDefine "\<alias\>" nextgroup=crystalAliasDeclaration skipwhite skipnl
|
||||
syn match crystalDefine "\<def\>" nextgroup=crystalMethodDeclaration skipwhite skipnl
|
||||
syn match crystalDefine "\<fun\>" nextgroup=crystalFunctionDeclaration 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 crystalClass "\<class\>" nextgroup=crystalClassDeclaration skipwhite skipnl
|
||||
syn match crystalModule "\<module\>" nextgroup=crystalModuleDeclaration skipwhite skipnl
|
||||
syn match crystalStruct "\<struct\>" nextgroup=crystalStructDeclaration skipwhite skipnl
|
||||
syn match crystalLib "\<lib\>" nextgroup=crystalLibDeclaration skipwhite skipnl
|
||||
syn match crystalMacro "\<macro\>" nextgroup=crystalMacroDeclaration 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 '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 '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 'enum' syn region crystalBlock start="\<enum\>" matchgroup=crystalEnum end="\<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 '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 '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 'annotation' syn region crystalBlock start="\<annotation\>" matchgroup=crystalAnnotation end="\<end\>" contains=TOP
|
||||
|
||||
" modifiers
|
||||
syn match crystalConditionalModifier "\<\%(if\|unless\|ifdef\)\>" display
|
||||
@@ -311,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 '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 "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=crystalConditionalExpression
|
||||
|
||||
@@ -326,15 +330,16 @@ if !exists('b:crystal_no_expensive') && !exists('g:crystal_no_expensive')
|
||||
exec 'syn sync minlines=' . g:crystal_minlines
|
||||
else
|
||||
" Non-expensive mode
|
||||
syn match crystalControl "\<def\>[?!]\@!" nextgroup=crystalMethodDeclaration skipwhite skipnl
|
||||
syn match crystalControl "\<fun\>[?!]\@!" nextgroup=crystalFunctionDeclaration skipwhite skipnl
|
||||
syn match crystalControl "\<class\>[?!]\@!" nextgroup=crystalClassDeclaration skipwhite skipnl
|
||||
syn match crystalControl "\<module\>[?!]\@!" nextgroup=crystalModuleDeclaration skipwhite skipnl
|
||||
syn match crystalControl "\<struct\>[?!]\@!" nextgroup=crystalStructDeclaration skipwhite skipnl
|
||||
syn match crystalControl "\<lib\>[?!]\@!" nextgroup=crystalLibDeclaration skipwhite skipnl
|
||||
syn match crystalControl "\<macro\>[?!]\@!" nextgroup=crystalMacroDeclaration 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 "\<def\>[?!]\@!" nextgroup=crystalMethodDeclaration skipwhite skipnl
|
||||
syn match crystalControl "\<fun\>[?!]\@!" nextgroup=crystalFunctionDeclaration skipwhite skipnl
|
||||
syn match crystalControl "\<class\>[?!]\@!" nextgroup=crystalClassDeclaration skipwhite skipnl
|
||||
syn match crystalControl "\<module\>[?!]\@!" nextgroup=crystalModuleDeclaration skipwhite skipnl
|
||||
syn match crystalControl "\<struct\>[?!]\@!" nextgroup=crystalStructDeclaration skipwhite skipnl
|
||||
syn match crystalControl "\<lib\>[?!]\@!" nextgroup=crystalLibDeclaration skipwhite skipnl
|
||||
syn match crystalControl "\<macro\>[?!]\@!" nextgroup=crystalMacroDeclaration skipwhite skipnl
|
||||
syn match crystalControl "\<enum\>[?!]\@!" nextgroup=crystalEnumDeclaration skipwhite skipnl
|
||||
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\)\>[?!]\@!"
|
||||
endif
|
||||
|
||||
@@ -358,8 +363,8 @@ endif
|
||||
|
||||
" Macro
|
||||
" 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="}}" 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="}}" display contains=TOP containedin=ALL
|
||||
|
||||
" Cluster for groups that can appear inside macro expressions
|
||||
syn cluster crystalMacroGroup contains=@crystalTop
|
||||
@@ -375,8 +380,7 @@ syn cluster crystalMacroGroup remove=@crystalExpensive
|
||||
" Some keywords will have to be redefined for them to be highlighted
|
||||
" properly
|
||||
syn keyword crystalMacroKeyword contained
|
||||
\ if else elsif end for in begin do case when while until loop
|
||||
\ rescue ensure
|
||||
\ if unless else elsif end for in do while until loop begin
|
||||
|
||||
syn cluster crystalMacroGroup add=crystalMacroKeyword
|
||||
|
||||
@@ -398,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*\%(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*\%(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 "\<\%(if\|ifdef\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE
|
||||
@@ -414,6 +418,7 @@ hi def link crystalModule crystalDefine
|
||||
hi def link crystalStruct crystalDefine
|
||||
hi def link crystalLib crystalDefine
|
||||
hi def link crystalEnum crystalDefine
|
||||
hi def link crystalAnnotation crystalDefine
|
||||
hi def link crystalMethodExceptional crystalDefine
|
||||
hi def link crystalDefine Define
|
||||
hi def link crystalFunction Function
|
||||
@@ -442,6 +447,7 @@ hi def link crystalModuleName crystalConstant
|
||||
hi def link crystalStructName crystalConstant
|
||||
hi def link crystalLibName crystalConstant
|
||||
hi def link crystalEnumName crystalConstant
|
||||
hi def link crystalAnnotationName crystalConstant
|
||||
hi def link crystalGlobalVariable crystalIdentifier
|
||||
hi def link crystalBlockParameter crystalIdentifier
|
||||
hi def link crystalInstanceVariable crystalIdentifier
|
||||
@@ -478,7 +484,7 @@ hi def link crystalRegexp crystalString
|
||||
hi def link crystalMacro PreProc
|
||||
hi def link crystalMacroDelim crystalMacro
|
||||
hi def link crystalMacroKeyword crystalKeyword
|
||||
hi def link crystalLinkAttrDelim crystalMacro
|
||||
hi def link crystalLinkAttrDelim crystalMacroDelim
|
||||
hi def link crystalError Error
|
||||
hi def link crystalInvalidVariable crystalError
|
||||
hi def link crystalSpaceError crystalError
|
||||
|
||||
@@ -54,10 +54,10 @@ syntax match dartMetadata "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a
|
||||
syntax match dartNumber "\<\d\+\(\.\d\+\)\=\>"
|
||||
|
||||
" User Types
|
||||
syntax match dartUserType "\<_\?\u[[:alnum:]_\$]*\>"
|
||||
syntax match dartUserType "\<[_$]*\u[a-zA-Z0-9_$]*\>"
|
||||
|
||||
" Function highlighting
|
||||
syntax match dartFunction "\zs\<\(_\?\l[[:alnum:]_\$]*\)\>*\s*\ze("
|
||||
syntax match dartFunction "\zs\<\([_$]*[a-z][a-zA-Z0-9_$]*\)\ze\(<\|(\|\s\+=>\)"
|
||||
|
||||
" SDK libraries
|
||||
syntax keyword dartSdkClass BidirectionalIterator Comparable DateTime
|
||||
|
||||
@@ -6,7 +6,7 @@ if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
syntax match dhallInterpolation "\v\$\{([^\}]|\\n)*\}"
|
||||
syntax match dhallInterpolation "\v\$\{([^\}]|\n)*\}"
|
||||
syntax keyword dhallTodo TODO FIXME
|
||||
syntax match dhallBrackets "[<>|]"
|
||||
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 dhallParens "(\|)\|\[\|\]\|,"
|
||||
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 dhallSingleSpecial +'''+
|
||||
syntax match dhallSingleSpecial +''${+
|
||||
|
||||
@@ -46,7 +46,7 @@ setlocal iskeyword+=$,@-@
|
||||
|
||||
" Comments
|
||||
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 keyword erlangTodo TODO FIXME XXX contained
|
||||
|
||||
@@ -94,7 +94,7 @@ syn match erlangBitType '\%(\/\%(\s\|\n\|%.*\n\)*\)\@<=\%(integer\|float\|binary
|
||||
|
||||
" Constants and Directives
|
||||
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 erlangRecordDef '^\s*-\%(\s\|\n\|%.*\n\)*record\>' 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
|
||||
" Language: generic git output
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2010 May 21
|
||||
" Last Change: 2019 Dec 05
|
||||
|
||||
if exists("b:current_syntax")
|
||||
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=/^\%(@@@@* -\)\@=/ end=/^\%(diff --\|$\)\@=/ contains=@gitDiff
|
||||
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=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 /^\%(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
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: *.git/COMMIT_EDITMSG
|
||||
" Last Change: 2016 Aug 29
|
||||
" Last Change: 2019 Dec 05
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -32,6 +32,7 @@ else
|
||||
syn match gitcommitComment "^#.*"
|
||||
endif
|
||||
|
||||
syn match gitcommitHash "\<\x\{40,}\>" contains=@NoSpell display
|
||||
syn match gitcommitHead "^\%(# .*\n\)\+#$" contained transparent
|
||||
syn match gitcommitOnBranch "\%(^# \)\@<=On 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 gitcommitSelected gitcommitComment
|
||||
hi def link gitcommitUnmerged gitcommitComment
|
||||
hi def link gitcommitHash Identifier
|
||||
hi def link gitcommitOnBranch Comment
|
||||
hi def link gitcommitBranch Special
|
||||
hi def link gitcommitNoBranch gitCommitBranch
|
||||
|
||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Language: git config file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: gitconfig, .gitconfig, *.git/config
|
||||
" Last Change: 2019 Sep 27
|
||||
" Last Change: 2019 Dec 05
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
|
||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Language: git rebase --interactive
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: git-rebase-todo
|
||||
" Last Change: 2016 Aug 29
|
||||
" Last Change: 2019 Dec 06
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -25,7 +25,7 @@ syn match gitrebaseDrop "\v^d%(rop)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseNoop "\v^noop>"
|
||||
syn match gitrebaseMerge "\v^m(erge)=>" nextgroup=gitrebaseMergeOption,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 gitrebaseCommand ".*" contained
|
||||
syn match gitrebaseComment "^\s*#.*" contains=gitrebaseHash
|
||||
|
||||
@@ -131,6 +131,8 @@ syn keyword htmlArg contained prefetch
|
||||
syn keyword htmlArg contained decoding
|
||||
" https://w3c.github.io/selection-api/#extensions-to-globaleventhandlers
|
||||
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
|
||||
" http://w3c.github.io/html/single-page.html#embedding-custom-non-visible-data-with-the-data-attributes
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'icalenadr') == -1
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'icalendar') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: icalendar <http://www.ietf.org/rfc/rfc2445.txt>
|
||||
|
||||
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 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 juliaErrorEnd display "\<end\>"
|
||||
syntax match juliaErrorElse display "\<\%(else\|elseif\)\>"
|
||||
syntax match juliaErrorCatch display "\<catch\>"
|
||||
syntax match juliaErrorFinally display "\<finally\>"
|
||||
exec 'syntax match juliaErrorEnd display "'.s:nodot.'\<end\>"'
|
||||
exec 'syntax match juliaErrorElse display "'.s:nodot.'\<\%(else\|elseif\)\>"'
|
||||
exec 'syntax match juliaErrorCatch display "'.s:nodot.'\<catch\>"'
|
||||
exec 'syntax match juliaErrorFinally display "'.s:nodot.'\<finally\>"'
|
||||
syntax match juliaErrorSemicol display contained ";"
|
||||
|
||||
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'
|
||||
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).'<!'
|
||||
|
||||
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*=\)\@!"
|
||||
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
|
||||
" Language: Kotlin
|
||||
" Maintainer: Alexander Udalov
|
||||
" Latest Revision: 26 May 2019
|
||||
" Latest Revision: 13 July 2020
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
@@ -18,7 +18,33 @@ syn keyword ktException try catch finally throw
|
||||
|
||||
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 ktStructure class object interface typealias fun val var constructor init
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'log') == -1
|
||||
" Vim syntax file
|
||||
" Language: Generic log file
|
||||
" Maintainer: MTDL9 <https://github.com/MTDL9>
|
||||
" Latest Revision: 2019-11-24
|
||||
" Latest Revision: 2020-08-23
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
@@ -15,7 +15,7 @@ set cpoptions&vim
|
||||
|
||||
" Operators
|
||||
"---------------------------------------------------------------------------
|
||||
syn match logOperator display '[;,\?\:\.\<=\>\~\/\@\&\!$\%\&\+\-\|\^(){}\*#]'
|
||||
syn match logOperator display '[;,\?\:\.\<=\>\~\/\@\!$\%&\+\-\|\^(){}\*#]'
|
||||
syn match logBrackets display '[\[\]]'
|
||||
syn match logEmptyLines display '-\{3,}'
|
||||
syn match logEmptyLines display '\*\{3,}'
|
||||
@@ -87,7 +87,7 @@ syn match logXmlAttribute contained "\(\n\|\s\)\(\(\w\|-\)\+:\)\?\(\w\|-\)\+\
|
||||
syn match logXmlNamespace contained "\(\w\|-\)\+:" contains=logOperator
|
||||
syn region logXmlComment start=/<!--/ end=/-->/
|
||||
syn match logXmlCData /<!\[CDATA\[.*\]\]>/
|
||||
syn match logXmlEntity /\&\w\+;/
|
||||
syn match logXmlEntity /&#\?\w\+;/
|
||||
|
||||
|
||||
" Levels
|
||||
|
||||
@@ -13,6 +13,11 @@ if !exists("main_syntax")
|
||||
let main_syntax = 'lua'
|
||||
endif
|
||||
|
||||
if exists('g:lua_syntax_fancynotequal') && !has('conceal')
|
||||
unlet g:lua_syntax_fancynotequal
|
||||
endif
|
||||
|
||||
|
||||
syntax sync fromstart
|
||||
|
||||
function! s:FoldableRegion(tag, name, expr)
|
||||
@@ -40,7 +45,11 @@ syntax region luaBracket transparent matchgroup=luaBrackets start="\[" end="\]"
|
||||
syntax match luaComma ","
|
||||
syntax match luaSemiCol ";"
|
||||
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
|
||||
syntax match luaEllipsis "\.\.\."
|
||||
|
||||
@@ -229,6 +238,7 @@ if version >= 508 || !exists("did_lua_syn_inits")
|
||||
HiLink luaLocal Type
|
||||
HiLink luaNumber Number
|
||||
HiLink luaSymbolOperator luaOperator
|
||||
HiLink luaNotEqOperator luaOperator
|
||||
HiLink luaOperator Operator
|
||||
HiLink luaRepeat Repeat
|
||||
HiLink luaSemiCol Delimiter
|
||||
@@ -240,6 +250,10 @@ if version >= 508 || !exists("did_lua_syn_inits")
|
||||
HiLink luaStringSpecial SpecialChar
|
||||
HiLink luaErrHand Exception
|
||||
|
||||
if exists('g:lua_syntax_fancynotequal')
|
||||
hi! link Conceal luaOperator
|
||||
endi
|
||||
|
||||
delcommand HiLink
|
||||
end
|
||||
|
||||
|
||||
@@ -72,10 +72,10 @@ execute 'syn region mkdLink matchgroup=mkdDelimiter start="\\\@<!!\?\[\ze[^]\n]
|
||||
" Autolink without angle brackets.
|
||||
" 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.
|
||||
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.
|
||||
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=/\(\([^\\]\|^\)\\\)\@<!\~\~/ 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="<pre[^>]*\\\@<!>" end="</pre>"' . s:concealcode
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<code[^>]*\\\@<!>" end="</code>"' . s:concealcode
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<pre\(\|\_s[^>]*\)\\\@<!>" end="</pre>"' . s:concealcode
|
||||
execute 'syn region mkdCode matchgroup=mkdCodeDelimiter start="<code\(\|\_s[^>]*\)\\\@<!>" end="</code>"' . s:concealcode
|
||||
syn region mkdFootnote start="\[^" end="\]"
|
||||
syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/
|
||||
syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
|
||||
|
||||
@@ -34,8 +34,9 @@ set cpo&vim
|
||||
|
||||
" http://mesonbuild.com/Syntax.html
|
||||
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 mesonStatement continue break
|
||||
|
||||
syn match mesonComment "#.*$" contains=mesonTodo,@Spell
|
||||
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
|
||||
|
||||
" 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
|
||||
|
||||
@@ -149,7 +149,7 @@ syn keyword nixNamespacedBuiltin contained
|
||||
\ removeAttrs replaceStrings scopedImport seq sort split splitVersion
|
||||
\ storeDir storePath stringLength sub substring tail throw toFile toJSON
|
||||
\ 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
|
||||
|
||||
|
||||
1878
syntax/pgsql.vim
1878
syntax/pgsql.vim
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
" 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
|
||||
|
||||
" Class
|
||||
@@ -140,11 +140,11 @@ syntax match plantumlActivityLabel /\%(^\%(#\S\+\)\?\)\@<=:\_[^;|<>/\]}]\+[;|<>/
|
||||
syntax match plantumlSequenceDivider /^\s*==[^=]\+==\s*$/
|
||||
syntax match plantumlSequenceSpace /^\s*|||\+\s*$/
|
||||
syntax match plantumlSequenceSpace /^\s*||\d\+||\+\s*$/
|
||||
syntax match plantumlSequenceDelay /^\.\{3}$/
|
||||
syntax region plantumlText oneline matchgroup=plantumlSequenceDelay start=/^\.\{3}/ end=/\.\{3}$/
|
||||
syntax match plantumlSequenceDelay /^\s*\.\{3}$/
|
||||
syntax region plantumlText oneline matchgroup=plantumlSequenceDelay start=/^\s*\.\{3}/ end=/\.\{3}$/
|
||||
|
||||
" Usecase diagram
|
||||
syntax match plantumlUsecaseActor /:.\{-1,}:/ contains=plantumlSpecialString
|
||||
syntax match plantumlUsecaseActor /^\s*:.\{-1,}:/ contains=plantumlSpecialString
|
||||
|
||||
|
||||
" Mindmap diagram
|
||||
|
||||
@@ -84,7 +84,7 @@ syn match ps1Type /\[[a-z_][a-z0-9_.,\[\]]\+\]/
|
||||
" Variable references
|
||||
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\+\(:\?[[:alnum:]_()]\+\)\?}/ contains=ps1ScopeModifier
|
||||
|
||||
" Operators
|
||||
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
|
||||
@@ -67,7 +67,7 @@ endfunction
|
||||
com! -nargs=* SynFold call s:run_syntax_fold(<q-args>)
|
||||
|
||||
" Not-Top Cluster {{{1
|
||||
syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,@rubyClassOperator,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyParentheses
|
||||
syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,@rubyExceptionHandler,@rubyClassOperator,rubyConditional,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyParentheses,@Spell
|
||||
|
||||
" Whitespace Errors {{{1
|
||||
if exists("ruby_space_errors")
|
||||
|
||||
@@ -232,6 +232,27 @@ syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError star
|
||||
|
||||
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
|
||||
" Trivial folding rules to begin with.
|
||||
" 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 rustAsync 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:
|
||||
" hi rustAttribute ctermfg=cyan
|
||||
|
||||
@@ -43,7 +43,8 @@ syn match slimTag "\w\+[><]*" contained contains=htmlTagName n
|
||||
syn match slimIdChar "#{\@!" contained nextgroup=slimId
|
||||
syn match slimId "\%(\w\|-\)\+" contained nextgroup=@slimComponent
|
||||
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 region slimWrappedAttrs matchgroup=slimWrappedAttrsDelimiter start="\s*{\s*" skip="}\s*\"" end="\s*}\s*" contained contains=slimAttr nextgroup=slimRuby
|
||||
|
||||
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
|
||||
endfunction
|
||||
|
||||
" Default tag definitions.
|
||||
let s:languages = [
|
||||
\ { 'name': 'less', 'tag': 'style' },
|
||||
\ { 'name': 'scss', 'tag': 'style' },
|
||||
@@ -94,12 +95,17 @@ let s:languages = [
|
||||
\ { '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
|
||||
let s:attr = '\(lang\|type\)=\("\|''\)[^\2]*' . s:language.name . '[^\2]*\2'
|
||||
let s:start = '<' . s:language.tag . '\>\_[^>]*' . s:attr . '\_[^>]*>'
|
||||
|
||||
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
|
||||
|
||||
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 sdInt contained nextgroup=sdErr /-\=\d\+/
|
||||
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\+\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]/
|
||||
@@ -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 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
|
||||
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 /^Documentation=/ nextgroup=sdDocURI
|
||||
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 /^OnFailureJobMode=/ nextgroup=sdFailJobMode,sdErr
|
||||
syn match sdUnitKey contained /^\%(StartLimitInterval\|StartLimitIntervalSec\|JobTimeoutSec\)=/ nextgroup=sdDuration,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\)=/
|
||||
" ConditionXXX. Note that they all have an optional '|' after the '='.
|
||||
syn match sdUnitKey contained /^Condition\(PathExists\|PathExistsGlob\|PathIsDirectory\|PathIsMountPoint\|PathIsReadWrite\|PathIsSymbolicLink\|DirectoryNotEmpty\|FileNotEmpty\|FileIsExecutable\)=|\=!\=/ contains=sdConditionFlag nextgroup=sdFilename,sdErr
|
||||
syn match sdUnitKey contained /^ConditionVirtualization=|\=!\=/ contains=sdConditionFlag nextgroup=sdVirtType,sdErr
|
||||
syn match sdUnitKey contained /^ConditionSecurity=|\=!\=/ contains=sdConditionFlag nextgroup=sdSecurityType,sdErr
|
||||
syn match sdUnitKey contained /^ConditionCapability=|\=!\=/ contains=sdConditionFlag nextgroup=sdAnyCapName,sdErr
|
||||
syn match sdUnitKey contained /^Condition\%(KernelCommandLine\|Host\)=|\=!\=/ contains=sdConditionFlag
|
||||
syn match sdUnitKey contained /^Condition\%(ACPower\|Null\|FirstBoot\)=|\=/ contains=sdConditionFlag nextgroup=sdBool,sdErr
|
||||
syn match sdUnitKey contained /^ConditionNeedsUpdate=|\=!\=/ contains=sdConditionFlag nextgroup=sdCondUpdateDir,sdErr
|
||||
syn match sdUnitKey contained /^RequiresMountsFor=/ nextgroup=sdFileList,sdErr
|
||||
" TODO: JobRunningTimeoutSec
|
||||
" ConditionXXX/AssertXXX. Note that they all have an optional '|' after the '='.
|
||||
syn match sdUnitKey contained /^\%(Condition\|Assert\)\(PathExists\|PathExistsGlob\|PathIsDirectory\|PathIsMountPoint\|PathIsReadWrite\|PathIsSymbolicLink\|DirectoryNotEmpty\|FileNotEmpty\|FileIsExecutable\)=|\=!\=/ contains=sdConditionFlag nextgroup=sdFilename,sdErr
|
||||
syn match sdUnitKey contained /^\%(Condition\|Assert\)Virtualization=|\=!\=/ contains=sdConditionFlag nextgroup=sdVirtType,sdErr
|
||||
syn match sdUnitKey contained /^\%(Condition\|Assert\)Security=|\=!\=/ contains=sdConditionFlag nextgroup=sdSecurityType,sdErr
|
||||
syn match sdUnitKey contained /^\%(Condition\|Assert\)Capability=|\=!\=/ contains=sdConditionFlag nextgroup=sdAnyCapName,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
|
||||
syn match sdUnitList contained /.*/ contains=sdUnitName,sdErr
|
||||
syn match sdConditionFlag contained /[!|]/
|
||||
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 sdSecurityType contained nextgroup=sdErr selinux
|
||||
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 apparmor tomoyo ima smack audit uefi-secureboot
|
||||
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 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
|
||||
|
||||
" [Install] {{{1
|
||||
" see systemd.unit(5)
|
||||
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 /^DefaultInstance=/ nextgroup=sdInstance
|
||||
" TODO: sdInstance - what's valid there? probably [^@/]\+, but that's a guess
|
||||
|
||||
" Execution options common to [Service|Socket|Mount|Swap] {{{1
|
||||
" see systemd.exec(5)
|
||||
syn match sdExecKey contained /^Exec\%(Start\%(Pre\|Post\|\)\|Reload\|Stop\|StopPost\)=/ nextgroup=sdExecFlag,sdExecFile,sdErr
|
||||
syn match sdExecKey contained /^\%(WorkingDirectory\|RootDirectory\|TTYPath\)=/ nextgroup=sdFilename,sdErr
|
||||
syn match sdExecKey contained /^Exec\%(Start\%(Pre\|Post\|\)\|Reload\|Stop\|StopPost\|Condition\)=/ nextgroup=sdExecFlag,sdExecFile,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
|
||||
" FIXME: some of these have moved to Resource Control
|
||||
" CPUAffinity is: list of uint
|
||||
" BlockIOWeight is: uint\|filename uint
|
||||
" 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 /^\%(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 /^\%(CPUSchedulingPriority\|TimerSlackNSec\)=/ nextgroup=sdUInt,sdErr
|
||||
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
|
||||
" see systemd.resource-control(5)
|
||||
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 /^\%(CPUShares\|StartupCPUShares\)=/ nextgroup=sdUInt,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 /^\%(RemainAfterExit\|GuessMainPID\|PermissionsStartOnly\|RootDirectoryStartOnly\|NonBlocking\|ControlGroupModify\)=/ nextgroup=sdBool,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 /^PIDFile=/ nextgroup=sdFilename,sdErr
|
||||
syn match sdServiceKey contained /^Type=/ nextgroup=sdServiceType,sdErr
|
||||
syn match sdServiceKey contained /^Restart=/ nextgroup=sdRestartType,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 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 /^\%(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 /^\%(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 /^Service=/ nextgroup=sdUnitList
|
||||
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 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 /^\%(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
|
||||
" TODO: sdCalendar
|
||||
|
||||
@@ -227,7 +285,7 @@ syn match sdAutomountKey contained /^DirectoryMode=/ nextgroup=sdOctal,sdErr
|
||||
|
||||
" [Mount]
|
||||
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\)=/
|
||||
|
||||
" [Swap]
|
||||
|
||||
5458
syntax/terraform.vim
5458
syntax/terraform.vim
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1
|
||||
|
||||
" Language: tmux(1) configuration file
|
||||
" Version: before-OpenBSD-lock (git-53c84fd4)
|
||||
" Version: 3.1b (git-769ae106)
|
||||
" URL: https://github.com/ericpruitt/tmux.vim/
|
||||
" Maintainer: Eric Pruitt <eric.pruitt@gmail.com>
|
||||
" License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause)
|
||||
@@ -32,10 +32,10 @@ syn match tmuxVariable /\w\+=/ display
|
||||
syn match tmuxVariableExpansion /\${\=\w\+}\=/ display
|
||||
syn match tmuxControl /%\(if\|elif\|else\|endif\)/
|
||||
|
||||
syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo
|
||||
syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo,@Spell
|
||||
|
||||
syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString
|
||||
syn region tmuxString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString
|
||||
syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString,@Spell
|
||||
syn region tmuxString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString,@Spell
|
||||
|
||||
" TODO: Figure out how escaping works inside of #(...) and #{...} blocks.
|
||||
syn region tmuxFormatString start=/#[#DFhHIPSTW]/ end=// contained keepend
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user