mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-09 12:03:53 -05:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3019afa721 | ||
|
|
cb574b283f | ||
|
|
b9ce3df4cd | ||
|
|
f028cfae59 | ||
|
|
041ab2d237 | ||
|
|
acd25ccf95 | ||
|
|
7dd62806a0 | ||
|
|
6a823fb3af | ||
|
|
11f34624aa | ||
|
|
1422f7a75c | ||
|
|
b17b5d4d9f | ||
|
|
bd824d9407 | ||
|
|
c3233deb70 | ||
|
|
bf188c4a51 | ||
|
|
a5857b81c2 | ||
|
|
7a32eec6d1 | ||
|
|
c69562f864 | ||
|
|
40c54bc12b | ||
|
|
44b3d860cb | ||
|
|
5a65ffe66d | ||
|
|
b9dae8fbab | ||
|
|
84593f2d7f | ||
|
|
22f6f3b6d3 | ||
|
|
8cd62b9eab |
38
README.md
38
README.md
@@ -1,4 +1,4 @@
|
|||||||
# vim-polyglot [![Build Status][travis-img-url]][travis-url]
|
# vim-polyglot [![Build Status][travis-img-url]][travis-url] []()
|
||||||
|
|
||||||
[travis-img-url]: https://travis-ci.org/sheerun/vim-polyglot.svg
|
[travis-img-url]: https://travis-ci.org/sheerun/vim-polyglot.svg
|
||||||
[travis-url]: https://travis-ci.org/sheerun/vim-polyglot
|
[travis-url]: https://travis-ci.org/sheerun/vim-polyglot
|
||||||
@@ -25,6 +25,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
|
|
||||||
## Language packs
|
## Language packs
|
||||||
|
|
||||||
|
- [applescript](https://github.com/vim-scripts/applescript.vim) (syntax)
|
||||||
- [ansible](https://github.com/pearofducks/ansible-vim) (syntax, indent, ftplugin, ftdetect)
|
- [ansible](https://github.com/pearofducks/ansible-vim) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent, ftdetect)
|
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent, ftdetect)
|
||||||
- [blade](https://github.com/jwalton512/vim-blade) (syntax, indent, ftplugin, ftdetect)
|
- [blade](https://github.com/jwalton512/vim-blade) (syntax, indent, ftplugin, ftdetect)
|
||||||
@@ -42,8 +43,8 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect)
|
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect)
|
||||||
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect)
|
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
- [elm](https://github.com/lambdatoast/elm.vim) (syntax, indent, autoload, ftplugin, ftdetect)
|
- [elm](https://github.com/lambdatoast/elm.vim) (syntax, indent, autoload, ftplugin, ftdetect)
|
||||||
- [emberscript](https://github.com/heartsentwined/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
|
- [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [emblem](https://github.com/heartsentwined/vim-emblem) (syntax, indent, ftplugin, ftdetect)
|
- [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent, ftdetect)
|
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent, ftdetect)
|
||||||
- [fish](https://github.com/dag/vim-fish) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
- [fish](https://github.com/dag/vim-fish) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||||
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
|
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
|
||||||
@@ -56,8 +57,8 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax, ftdetect)
|
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax, ftdetect)
|
||||||
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
|
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
|
||||||
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax, ftdetect)
|
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax, ftdetect)
|
||||||
- [javascript](https://github.com/sheerun/yajs.vim) (syntax, indent)
|
- [javascript](https://github.com/pangloss/vim-javascript) (syntax, indent, ftplugin, ftdetect, extras)
|
||||||
- [json](https://github.com/sheerun/vim-json) (syntax, indent, ftdetect)
|
- [json](https://github.com/elzr/vim-json) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent, ftdetect)
|
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent, ftdetect)
|
||||||
- [jsx](https://github.com/mxw/vim-jsx) (ftdetect, after)
|
- [jsx](https://github.com/mxw/vim-jsx) (ftdetect, after)
|
||||||
- [julia](https://github.com/dcjones/julia-minimalist-vim) (syntax, indent, ftdetect)
|
- [julia](https://github.com/dcjones/julia-minimalist-vim) (syntax, indent, ftdetect)
|
||||||
@@ -65,8 +66,11 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
||||||
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin, ftdetect)
|
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin, ftdetect)
|
- [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [markdown](https://github.com/tpope/vim-markdown) (syntax, ftplugin, ftdetect)
|
- [livescript](https://github.com/gkz/vim-ls) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
- [nginx](https://github.com/nginx/nginx) (syntax, indent, ftdetect)
|
- [lua](https://github.com/tbastos/vim-lua) (syntax, indent)
|
||||||
|
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin, ftdetect)
|
||||||
|
- [markdown](https://github.com/plasticboy/vim-markdown) (syntax, ftdetect)
|
||||||
|
- [nginx](https://github.com/othree/nginx-contrib-vim) (syntax, indent, ftdetect)
|
||||||
- [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent, ftdetect)
|
- [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent, ftdetect)
|
||||||
- [nix](https://github.com/spwhitt/vim-nix) (syntax, ftplugin, ftdetect)
|
- [nix](https://github.com/spwhitt/vim-nix) (syntax, ftplugin, ftdetect)
|
||||||
- [objc](https://github.com/b4winckler/vim-objc) (ftplugin, syntax, indent)
|
- [objc](https://github.com/b4winckler/vim-objc) (ftplugin, syntax, indent)
|
||||||
@@ -78,7 +82,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
||||||
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, ftplugin, ftdetect)
|
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, ftplugin, ftdetect)
|
||||||
- [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect)
|
- [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect)
|
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent, ftdetect)
|
||||||
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin, ftdetect)
|
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin, ftdetect)
|
- [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [purescript](https://github.com/raichoo/purescript-vim) (syntax, indent, ftdetect)
|
- [purescript](https://github.com/raichoo/purescript-vim) (syntax, indent, ftdetect)
|
||||||
@@ -91,14 +95,14 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
- [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
- [rust](https://github.com/rust-lang/rust.vim) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||||
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax, ftdetect)
|
- [sbt](https://github.com/derekwyatt/vim-sbt) (syntax, ftdetect)
|
||||||
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin, ftdetect)
|
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||||
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftdetect)
|
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [solidity](https://github.com/ethereum/vim-solidity) (syntax, indent, ftdetect)
|
- [solidity](https://github.com/ethereum/vim-solidity) (syntax, indent, ftdetect)
|
||||||
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin, ftdetect)
|
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [swift](https://github.com/keith/swift.vim) (syntax, indent, ftplugin, ftdetect)
|
- [swift](https://github.com/keith/swift.vim) (syntax, indent, ftplugin, ftdetect)
|
||||||
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect)
|
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect)
|
||||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
|
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
|
||||||
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
|
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
|
||||||
- [tmux](https://github.com/tejr/vim-tmux) (syntax, ftdetect)
|
- [tmux](https://github.com/keith/tmux.vim) (syntax, ftplugin, ftdetect)
|
||||||
- [tomdoc](https://github.com/wellbredgrapefruit/tomdoc.vim) (syntax)
|
- [tomdoc](https://github.com/wellbredgrapefruit/tomdoc.vim) (syntax)
|
||||||
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect)
|
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect)
|
||||||
- [twig](https://github.com/evidens/vim-twig) (syntax, ftplugin)
|
- [twig](https://github.com/evidens/vim-twig) (syntax, ftplugin)
|
||||||
@@ -111,9 +115,15 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
|||||||
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)
|
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)
|
||||||
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
||||||
|
|
||||||
## Disabling a language pack
|
## Updating
|
||||||
|
|
||||||
Individual language packs can be disabled by setting `g:polyglot_disabled`.
|
You can either wait for new patch release with updates or run the `./build` script by yourself.
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
Please make sure you have `syntax on` in your `.vimrc`, otherwise syntax files are not loaded at all.
|
||||||
|
|
||||||
|
Individual language packs can be disabled by setting `g:polyglot_disabled` as follows:
|
||||||
|
|
||||||
```viml
|
```viml
|
||||||
" ~/.vimrc
|
" ~/.vimrc
|
||||||
@@ -122,10 +132,6 @@ let g:polyglot_disabled = ['css']
|
|||||||
|
|
||||||
Note that disabiling 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.
|
Note that disabiling 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.
|
||||||
|
|
||||||
## Updating
|
|
||||||
|
|
||||||
You can either wait for new patch release with updates or run the `./build` script by yourself.
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Language packs are periodically updated using automated `build` script.
|
Language packs are periodically updated using automated `build` script.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
||||||
|
|
||||||
setlocal comments=s1fl:{-,mb:-,ex:-},:--
|
setlocal comments=s1fl:{-,mb:\ \ ,ex:-},:--
|
||||||
setlocal iskeyword+='
|
setlocal iskeyword+='
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -624,6 +624,7 @@ syntax keyword cppSTLtype const_mem_fun_ref_t
|
|||||||
syntax keyword cppSTLtype const_mem_fun_t
|
syntax keyword cppSTLtype const_mem_fun_t
|
||||||
syntax keyword cppSTLtype const_pointer
|
syntax keyword cppSTLtype const_pointer
|
||||||
syntax keyword cppSTLtype const_reference
|
syntax keyword cppSTLtype const_reference
|
||||||
|
syntax keyword cppSTLtype container_type
|
||||||
syntax keyword cppSTLtype deque
|
syntax keyword cppSTLtype deque
|
||||||
syntax keyword cppSTLtype difference_type
|
syntax keyword cppSTLtype difference_type
|
||||||
syntax keyword cppSTLtype div_t
|
syntax keyword cppSTLtype div_t
|
||||||
|
|||||||
@@ -28,8 +28,11 @@ endif
|
|||||||
|
|
||||||
hi link rustNiceOperator Operator
|
hi link rustNiceOperator Operator
|
||||||
|
|
||||||
if !exists('g:rust_conceal_mod_path') && g:rust_conceal_mod_path != 0
|
if !(exists('g:rust_conceal_mod_path') && g:rust_conceal_mod_path != 0)
|
||||||
hi! link Conceal Operator
|
hi! link Conceal Operator
|
||||||
|
|
||||||
|
" And keep it after a colorscheme change
|
||||||
|
au ColorScheme <buffer> hi! link Conceal Operator
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -348,7 +348,7 @@ function! s:RmDir(path)
|
|||||||
echoerr 'Attempted to delete protected path: ' . a:path
|
echoerr 'Attempted to delete protected path: ' . a:path
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
silent exe "!rm -rf " . shellescape(a:path)
|
return system("rm -rf " . shellescape(a:path))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
|
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
|
||||||
|
|||||||
@@ -29,9 +29,13 @@ function! rustfmt#Format()
|
|||||||
|
|
||||||
let command = g:rustfmt_command . " --write-mode=overwrite "
|
let command = g:rustfmt_command . " --write-mode=overwrite "
|
||||||
|
|
||||||
let out = systemlist(command . g:rustfmt_options . " " . shellescape(l:tmpname))
|
if exists("*systemlist")
|
||||||
|
let out = systemlist(command . g:rustfmt_options . " " . shellescape(l:tmpname))
|
||||||
|
else
|
||||||
|
let out = split(system(command . g:rustfmt_options . " " . shellescape(l:tmpname)), '\r\?\n')
|
||||||
|
endif
|
||||||
|
|
||||||
if v:shell_error == 0
|
if v:shell_error == 0 || v:shell_error == 3
|
||||||
" remove undo point caused via BufWritePre
|
" remove undo point caused via BufWritePre
|
||||||
try | silent undojoin | catch | endtry
|
try | silent undojoin | catch | endtry
|
||||||
|
|
||||||
|
|||||||
23
build
23
build
@@ -5,6 +5,8 @@ set -E
|
|||||||
DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect"
|
DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect"
|
||||||
DIRS_BASIC="syntax compiler indent ftdetect after/syntax after/indent after/ftdetect"
|
DIRS_BASIC="syntax compiler indent ftdetect after/syntax after/indent after/ftdetect"
|
||||||
DIRS_ALL="syntax indent compiler autoload ftplugin ftdetect after"
|
DIRS_ALL="syntax indent compiler autoload ftplugin ftdetect after"
|
||||||
|
DIRS_SYNTAX="syntax ftdetect after/syntax after/ftdetect"
|
||||||
|
DIRS_JAVASCRIPT="${DIRS} extras"
|
||||||
|
|
||||||
OUTPUT=""
|
OUTPUT=""
|
||||||
|
|
||||||
@@ -74,7 +76,8 @@ copy_dir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
concat_ftdetect() {
|
concat_ftdetect() {
|
||||||
cat ftdetect/* | grep -E '^[^"]' > tmp/polyglot.vim
|
cat config.vim >> tmp/polyglot.vim
|
||||||
|
for f in ftdetect/*; do (echo '" '"$f"; cat "${f}"; echo) >> tmp/polyglot.vim; done
|
||||||
rm -f ftdetect/*
|
rm -f ftdetect/*
|
||||||
mv tmp/polyglot.vim ftdetect/
|
mv tmp/polyglot.vim ftdetect/
|
||||||
}
|
}
|
||||||
@@ -96,6 +99,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
PACKS="
|
PACKS="
|
||||||
|
applescript:vim-scripts/applescript.vim
|
||||||
ansible:pearofducks/ansible-vim
|
ansible:pearofducks/ansible-vim
|
||||||
arduino:sudar/vim-arduino-syntax
|
arduino:sudar/vim-arduino-syntax
|
||||||
blade:jwalton512/vim-blade
|
blade:jwalton512/vim-blade
|
||||||
@@ -113,8 +117,8 @@ PACKS="
|
|||||||
dockerfile:honza/dockerfile.vim
|
dockerfile:honza/dockerfile.vim
|
||||||
elixir:elixir-lang/vim-elixir
|
elixir:elixir-lang/vim-elixir
|
||||||
elm:lambdatoast/elm.vim
|
elm:lambdatoast/elm.vim
|
||||||
emberscript:heartsentwined/vim-ember-script
|
emberscript:yalesov/vim-ember-script
|
||||||
emblem:heartsentwined/vim-emblem
|
emblem:yalesov/vim-emblem
|
||||||
erlang:vim-erlang/vim-erlang-runtime
|
erlang:vim-erlang/vim-erlang-runtime
|
||||||
fish:dag/vim-fish
|
fish:dag/vim-fish
|
||||||
git:tpope/vim-git
|
git:tpope/vim-git
|
||||||
@@ -127,8 +131,8 @@ PACKS="
|
|||||||
haxe:yaymukund/vim-haxe
|
haxe:yaymukund/vim-haxe
|
||||||
html5:othree/html5.vim
|
html5:othree/html5.vim
|
||||||
jasmine:glanotte/vim-jasmine
|
jasmine:glanotte/vim-jasmine
|
||||||
javascript:sheerun/yajs.vim
|
javascript:pangloss/vim-javascript:_JAVASCRIPT
|
||||||
json:sheerun/vim-json
|
json:elzr/vim-json
|
||||||
jst:briancollins/vim-jst
|
jst:briancollins/vim-jst
|
||||||
jsx:mxw/vim-jsx:_ALL
|
jsx:mxw/vim-jsx:_ALL
|
||||||
julia:dcjones/julia-minimalist-vim
|
julia:dcjones/julia-minimalist-vim
|
||||||
@@ -136,8 +140,11 @@ PACKS="
|
|||||||
latex:LaTeX-Box-Team/LaTeX-Box
|
latex:LaTeX-Box-Team/LaTeX-Box
|
||||||
less:groenewege/vim-less
|
less:groenewege/vim-less
|
||||||
liquid:tpope/vim-liquid
|
liquid:tpope/vim-liquid
|
||||||
markdown:tpope/vim-markdown
|
livescript:gkz/vim-ls
|
||||||
nginx:nginx/nginx::/contrib/vim/
|
lua:tbastos/vim-lua
|
||||||
|
mako:sophacles/vim-bundle-mako
|
||||||
|
markdown:plasticboy/vim-markdown:_SYNTAX
|
||||||
|
nginx:othree/nginx-contrib-vim
|
||||||
nim:zah/nim.vim:_BASIC
|
nim:zah/nim.vim:_BASIC
|
||||||
nix:spwhitt/vim-nix
|
nix:spwhitt/vim-nix
|
||||||
objc:b4winckler/vim-objc
|
objc:b4winckler/vim-objc
|
||||||
@@ -169,7 +176,7 @@ PACKS="
|
|||||||
systemd:kurayama/systemd-vim-syntax
|
systemd:kurayama/systemd-vim-syntax
|
||||||
textile:timcharper/textile.vim
|
textile:timcharper/textile.vim
|
||||||
thrift:solarnz/thrift.vim
|
thrift:solarnz/thrift.vim
|
||||||
tmux:tejr/vim-tmux
|
tmux:keith/tmux.vim
|
||||||
tomdoc:wellbredgrapefruit/tomdoc.vim
|
tomdoc:wellbredgrapefruit/tomdoc.vim
|
||||||
toml:cespare/vim-toml
|
toml:cespare/vim-toml
|
||||||
twig:evidens/vim-twig
|
twig:evidens/vim-twig
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ endif
|
|||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo-=C
|
set cpo-=C
|
||||||
if filereadable("makefile") || filereadable("Makefile")
|
if filereadable("makefile") || filereadable("Makefile")
|
||||||
CompilerSet makeprg=make
|
CompilerSet makeprg=make
|
||||||
else
|
else
|
||||||
CompilerSet makeprg=go\ build
|
CompilerSet makeprg=go\ build
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Define the patterns that will be recognized by QuickFix when parsing the
|
" Define the patterns that will be recognized by QuickFix when parsing the
|
||||||
@@ -40,6 +40,6 @@ CompilerSet errorformat+=%-G%.%# " All lines not matching a
|
|||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
|
|
||||||
" vim:ts=4:sw=4:et
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
78
compiler/ls.vim
Normal file
78
compiler/ls.vim
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'livescript') == -1
|
||||||
|
|
||||||
|
" Language: LiveScript
|
||||||
|
" Maintainer: George Zahariev
|
||||||
|
" URL: http://github.com/gkz/vim-ls
|
||||||
|
" License: WTFPL
|
||||||
|
|
||||||
|
if exists('current_compiler')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let current_compiler = 'ls'
|
||||||
|
" Pattern to check if livescript is the compiler
|
||||||
|
let s:pat = '^' . current_compiler
|
||||||
|
|
||||||
|
" Path to LiveScript compiler
|
||||||
|
if !exists('livescript_compiler')
|
||||||
|
let livescript_compiler = 'lsc'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('livescript_make_options')
|
||||||
|
let livescript_make_options = ''
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Get a `makeprg` for the current filename. This is needed to support filenames
|
||||||
|
" with spaces and quotes, but also not break generic `make`.
|
||||||
|
function! s:GetMakePrg()
|
||||||
|
return g:livescript_compiler . ' -c ' . g:livescript_make_options . ' $* '
|
||||||
|
\ . fnameescape(expand('%'))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Set `makeprg` and return 1 if coffee is still the compiler, else return 0.
|
||||||
|
function! s:SetMakePrg()
|
||||||
|
if &l:makeprg =~ s:pat
|
||||||
|
let &l:makeprg = s:GetMakePrg()
|
||||||
|
elseif &g:makeprg =~ s:pat
|
||||||
|
let &g:makeprg = s:GetMakePrg()
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
return 1
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Set a dummy compiler so we can check whether to set locally or globally.
|
||||||
|
CompilerSet makeprg=ls
|
||||||
|
call s:SetMakePrg()
|
||||||
|
|
||||||
|
CompilerSet errorformat=%EFailed\ at:\ %f,
|
||||||
|
\%ECan't\ find:\ %f,
|
||||||
|
\%CSyntaxError:\ %m\ on\ line\ %l,
|
||||||
|
\%CError:\ Parse\ error\ on\ line\ %l:\ %m,
|
||||||
|
\%C,%C\ %.%#
|
||||||
|
|
||||||
|
" Compile the current file.
|
||||||
|
command! -bang -bar -nargs=* LiveScriptMake make<bang> <args>
|
||||||
|
|
||||||
|
" Set `makeprg` on rename since we embed the filename in the setting.
|
||||||
|
augroup LiveScriptUpdateMakePrg
|
||||||
|
autocmd!
|
||||||
|
|
||||||
|
" Update `makeprg` if livescript is still the compiler, else stop running this
|
||||||
|
" function.
|
||||||
|
function! s:UpdateMakePrg()
|
||||||
|
if !s:SetMakePrg()
|
||||||
|
autocmd! LiveScriptUpdateMakePrg
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Set autocmd locally if compiler was set locally.
|
||||||
|
if &l:makeprg =~ s:pat
|
||||||
|
autocmd BufFilePost,BufWritePost <buffer> call s:UpdateMakePrg()
|
||||||
|
else
|
||||||
|
autocmd BufFilePost,BufWritePost call s:UpdateMakePrg()
|
||||||
|
endif
|
||||||
|
augroup END
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -13,7 +13,7 @@ endif
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo-=C
|
set cpo-=C
|
||||||
|
|
||||||
CompilerSet makeprg=nim\ c\ $*
|
CompilerSet makeprg=nim\ c\ --verbosity:0\ $*\ %:p
|
||||||
|
|
||||||
CompilerSet errorformat=
|
CompilerSet errorformat=
|
||||||
\%-GHint:\ %m,
|
\%-GHint:\ %m,
|
||||||
|
|||||||
9
config.vim
Normal file
9
config.vim
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
" Enable jsx syntax by default
|
||||||
|
if !exists('g:jsx_ext_required')
|
||||||
|
let g:jsx_ext_required = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Disable json concealing by default
|
||||||
|
if !exists('g:vim_json_syntax_conceal')
|
||||||
|
let g:vim_json_syntax_conceal = 0
|
||||||
|
endif
|
||||||
230
extras/flow.vim
Normal file
230
extras/flow.vim
Normal file
@@ -0,0 +1,230 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
syntax region jsFlowTypeStatement start=/type/ end=/=/ oneline skipwhite skipempty nextgroup=jsFlowTypeObject
|
||||||
|
syntax region jsFlowDeclareBlock start=/declare/ end=/[;\n]/ oneline contains=jsFlow,jsFlowDeclareKeyword,jsFlowStorageClass
|
||||||
|
syntax region jsFlow start=/:/ end=/\%(\%([),=;\n]\|{\%(.*}\)\@!\|\%({.*}\)\@<=\s*{\)\@=\|void\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock
|
||||||
|
syntax region jsFlowReturn contained start=/:/ end=/\%(\S\s*\%({\%(.*}\)\@!\)\@=\|\n\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock keepend
|
||||||
|
syntax region jsFlowTypeObject contained start=/{/ end=/}/ contains=jsFlowTypeKey skipwhite skipempty nextgroup=jsFunctionBlock extend
|
||||||
|
syntax match jsFlowTypeKey contained /\<[0-9a-zA-Z_$?]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsFlowTypeValue
|
||||||
|
syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/:/ end=/[,}]/ contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ oneline contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ oneline contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowArrow contained matchgroup=jsFlowNoise start=/(/ end=/)\s*=>/ oneline contains=@jsFlowCluster
|
||||||
|
syntax keyword jsFlowDeclareKeyword contained declare
|
||||||
|
syntax keyword jsFlowType contained boolean number string null void any mixed JSON array function object Array
|
||||||
|
syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlow
|
||||||
|
syntax match jsFlowNoise contained /[:;,<>]/
|
||||||
|
syntax cluster jsFlowCluster contains=jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise,jsFlowArrow
|
||||||
|
syntax keyword jsFlowStorageClass contained const var let
|
||||||
|
syntax region jsFlowParenRegion contained start=/:\s*(/ end=/)\%(\s*:\)\@=/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsObjectValue
|
||||||
|
syntax region jsFlowClass contained matchgroup=jsFlowNoise start=/</ end=/>/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_javascript_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
HiLink jsFlow PreProc
|
||||||
|
HiLink jsFlowReturn PreProc
|
||||||
|
HiLink jsFlowArray PreProc
|
||||||
|
HiLink jsFlowDeclareBlock PreProc
|
||||||
|
HiLink jsFlowObject PreProc
|
||||||
|
HiLink jsFlowParenRegion PreProc
|
||||||
|
HiLink jsFlowClass PreProc
|
||||||
|
HiLink jsFlowTypeObject PreProc
|
||||||
|
HiLink jsFlowTypeKey PreProc
|
||||||
|
HiLink jsFlowTypeValue PreProc
|
||||||
|
HiLink jsFlowClassProperty jsClassProperty
|
||||||
|
HiLink jsFlowType Type
|
||||||
|
HiLink jsFlowDeclareKeyword Type
|
||||||
|
HiLink jsFlowNoise Noise
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
syntax region jsFlowTypeStatement start=/type/ end=/=/ oneline skipwhite skipempty nextgroup=jsFlowTypeObject
|
||||||
|
syntax region jsFlowDeclareBlock start=/declare/ end=/[;\n]/ oneline contains=jsFlow,jsFlowDeclareKeyword,jsFlowStorageClass
|
||||||
|
syntax region jsFlow start=/:/ end=/\%(\%([),=;\n]\|{\%(.*}\)\@!\|\%({.*}\)\@<=\s*{\)\@=\|void\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock
|
||||||
|
syntax region jsFlowReturn contained start=/:/ end=/\%(\S\s*\%({\%(.*}\)\@!\)\@=\|\n\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock keepend
|
||||||
|
syntax region jsFlowTypeObject contained start=/{/ end=/}/ contains=jsFlowTypeKey skipwhite skipempty nextgroup=jsFunctionBlock extend
|
||||||
|
syntax match jsFlowTypeKey contained /\<[0-9a-zA-Z_$?]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsFlowTypeValue
|
||||||
|
syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/:/ end=/[,}]/ contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ oneline contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ oneline contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowArrow contained matchgroup=jsFlowNoise start=/(/ end=/)\s*=>/ oneline contains=@jsFlowCluster
|
||||||
|
syntax keyword jsFlowDeclareKeyword contained declare
|
||||||
|
syntax keyword jsFlowType contained boolean number string null void any mixed JSON array function object Array
|
||||||
|
syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlow
|
||||||
|
syntax match jsFlowNoise contained /[:;,<>]/
|
||||||
|
syntax cluster jsFlowCluster contains=jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise,jsFlowArrow
|
||||||
|
syntax keyword jsFlowStorageClass contained const var let
|
||||||
|
syntax region jsFlowParenRegion contained start=/:\s*(/ end=/)\%(\s*:\)\@=/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsObjectValue
|
||||||
|
syntax region jsFlowClass contained matchgroup=jsFlowNoise start=/</ end=/>/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_javascript_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
HiLink jsFlow PreProc
|
||||||
|
HiLink jsFlowReturn PreProc
|
||||||
|
HiLink jsFlowArray PreProc
|
||||||
|
HiLink jsFlowDeclareBlock PreProc
|
||||||
|
HiLink jsFlowObject PreProc
|
||||||
|
HiLink jsFlowParenRegion PreProc
|
||||||
|
HiLink jsFlowClass PreProc
|
||||||
|
HiLink jsFlowTypeObject PreProc
|
||||||
|
HiLink jsFlowTypeKey PreProc
|
||||||
|
HiLink jsFlowTypeValue PreProc
|
||||||
|
HiLink jsFlowClassProperty jsClassProperty
|
||||||
|
HiLink jsFlowType Type
|
||||||
|
HiLink jsFlowDeclareKeyword Type
|
||||||
|
HiLink jsFlowNoise Noise
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
syntax region jsFlowTypeStatement start=/type/ end=/=/ oneline skipwhite skipempty nextgroup=jsFlowTypeObject
|
||||||
|
syntax region jsFlowDeclareBlock start=/declare/ end=/[;\n]/ oneline contains=jsFlow,jsFlowDeclareKeyword,jsFlowStorageClass
|
||||||
|
syntax region jsFlow start=/:/ end=/\%(\%([),=;\n]\|{\%(.*}\)\@!\|\%({.*}\)\@<=\s*{\)\@=\|void\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock
|
||||||
|
syntax region jsFlowReturn contained start=/:/ end=/\%(\S\s*\%({\%(.*}\)\@!\)\@=\|\n\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock keepend
|
||||||
|
syntax region jsFlowTypeObject contained start=/{/ end=/}/ contains=jsFlowTypeKey skipwhite skipempty nextgroup=jsFunctionBlock extend
|
||||||
|
syntax match jsFlowTypeKey contained /\<[0-9a-zA-Z_$?]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsFlowTypeValue
|
||||||
|
syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/:/ end=/[,}]/ contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ oneline contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ oneline contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowArrow contained matchgroup=jsFlowNoise start=/(/ end=/)\s*=>/ oneline contains=@jsFlowCluster
|
||||||
|
syntax keyword jsFlowDeclareKeyword contained declare
|
||||||
|
syntax keyword jsFlowType contained boolean number string null void any mixed JSON array function object Array
|
||||||
|
syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlow
|
||||||
|
syntax match jsFlowNoise contained /[:;,<>]/
|
||||||
|
syntax cluster jsFlowCluster contains=jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise,jsFlowArrow
|
||||||
|
syntax keyword jsFlowStorageClass contained const var let
|
||||||
|
syntax region jsFlowParenRegion contained start=/:\s*(/ end=/)\%(\s*:\)\@=/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsObjectValue
|
||||||
|
syntax region jsFlowClass contained matchgroup=jsFlowNoise start=/</ end=/>/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_javascript_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
HiLink jsFlow PreProc
|
||||||
|
HiLink jsFlowReturn PreProc
|
||||||
|
HiLink jsFlowArray PreProc
|
||||||
|
HiLink jsFlowDeclareBlock PreProc
|
||||||
|
HiLink jsFlowObject PreProc
|
||||||
|
HiLink jsFlowParenRegion PreProc
|
||||||
|
HiLink jsFlowClass PreProc
|
||||||
|
HiLink jsFlowTypeObject PreProc
|
||||||
|
HiLink jsFlowTypeKey PreProc
|
||||||
|
HiLink jsFlowTypeValue PreProc
|
||||||
|
HiLink jsFlowClassProperty jsClassProperty
|
||||||
|
HiLink jsFlowType Type
|
||||||
|
HiLink jsFlowDeclareKeyword Type
|
||||||
|
HiLink jsFlowNoise Noise
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
syntax region jsFlowTypeStatement start=/type/ end=/=/ oneline skipwhite skipempty nextgroup=jsFlowTypeObject
|
||||||
|
syntax region jsFlowDeclareBlock start=/declare/ end=/[;\n]/ oneline contains=jsFlow,jsFlowDeclareKeyword,jsFlowStorageClass
|
||||||
|
syntax region jsFlow start=/:/ end=/\%(\%([),=;\n]\|{\%(.*}\)\@!\|\%({.*}\)\@<=\s*{\)\@=\|void\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock
|
||||||
|
syntax region jsFlowReturn contained start=/:/ end=/\%(\S\s*\%({\%(.*}\)\@!\)\@=\|\n\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock keepend
|
||||||
|
syntax region jsFlowTypeObject contained start=/{/ end=/}/ contains=jsFlowTypeKey skipwhite skipempty nextgroup=jsFunctionBlock extend
|
||||||
|
syntax match jsFlowTypeKey contained /\<[0-9a-zA-Z_$?]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsFlowTypeValue
|
||||||
|
syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/:/ end=/[,}]/ contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ oneline contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ oneline contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowArrow contained matchgroup=jsFlowNoise start=/(/ end=/)\s*=>/ oneline contains=@jsFlowCluster
|
||||||
|
syntax keyword jsFlowDeclareKeyword contained declare
|
||||||
|
syntax keyword jsFlowType contained boolean number string null void any mixed JSON array function object Array
|
||||||
|
syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlow
|
||||||
|
syntax match jsFlowNoise contained /[:;,<>]/
|
||||||
|
syntax cluster jsFlowCluster contains=jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise,jsFlowArrow
|
||||||
|
syntax keyword jsFlowStorageClass contained const var let
|
||||||
|
syntax region jsFlowParenRegion contained start=/:\s*(/ end=/)\%(\s*:\)\@=/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsObjectValue
|
||||||
|
syntax region jsFlowClass contained matchgroup=jsFlowNoise start=/</ end=/>/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_javascript_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
HiLink jsFlow PreProc
|
||||||
|
HiLink jsFlowReturn PreProc
|
||||||
|
HiLink jsFlowArray PreProc
|
||||||
|
HiLink jsFlowDeclareBlock PreProc
|
||||||
|
HiLink jsFlowObject PreProc
|
||||||
|
HiLink jsFlowParenRegion PreProc
|
||||||
|
HiLink jsFlowClass PreProc
|
||||||
|
HiLink jsFlowTypeObject PreProc
|
||||||
|
HiLink jsFlowTypeKey PreProc
|
||||||
|
HiLink jsFlowTypeValue PreProc
|
||||||
|
HiLink jsFlowClassProperty jsClassProperty
|
||||||
|
HiLink jsFlowType Type
|
||||||
|
HiLink jsFlowDeclareKeyword Type
|
||||||
|
HiLink jsFlowNoise Noise
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
syntax region jsFlowTypeStatement start=/type/ end=/=/ oneline skipwhite skipempty nextgroup=jsFlowTypeObject
|
||||||
|
syntax region jsFlowDeclareBlock start=/declare/ end=/[;\n]/ oneline contains=jsFlow,jsFlowDeclareKeyword,jsFlowStorageClass
|
||||||
|
syntax region jsFlow start=/:/ end=/\%(\%([),=;\n]\|{\%(.*}\)\@!\|\%({.*}\)\@<=\s*{\)\@=\|void\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock
|
||||||
|
syntax region jsFlowReturn contained start=/:/ end=/\%(\S\s*\%({\%(.*}\)\@!\)\@=\|\n\)/ contains=@jsFlowCluster oneline skipwhite skipempty nextgroup=jsFuncBlock keepend
|
||||||
|
syntax region jsFlowTypeObject contained start=/{/ end=/}/ contains=jsFlowTypeKey skipwhite skipempty nextgroup=jsFunctionBlock extend
|
||||||
|
syntax match jsFlowTypeKey contained /\<[0-9a-zA-Z_$?]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsFlowTypeValue
|
||||||
|
syntax region jsFlowTypeValue contained matchgroup=jsFlowNoise start=/:/ end=/[,}]/ contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowObject contained matchgroup=jsFlowNoise start=/{/ end=/}/ oneline contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowArray contained matchgroup=jsFlowNoise start=/\[/ end=/\]/ oneline contains=@jsFlowCluster
|
||||||
|
syntax region jsFlowArrow contained matchgroup=jsFlowNoise start=/(/ end=/)\s*=>/ oneline contains=@jsFlowCluster
|
||||||
|
syntax keyword jsFlowDeclareKeyword contained declare
|
||||||
|
syntax keyword jsFlowType contained boolean number string null void any mixed JSON array function object Array
|
||||||
|
syntax match jsFlowClassProperty contained /\<[0-9a-zA-Z_$]*\>:\@=/ skipwhite skipempty nextgroup=jsFlow
|
||||||
|
syntax match jsFlowNoise contained /[:;,<>]/
|
||||||
|
syntax cluster jsFlowCluster contains=jsFlowType,jsFlowArray,jsFlowObject,jsFlowNoise,jsFlowArrow
|
||||||
|
syntax keyword jsFlowStorageClass contained const var let
|
||||||
|
syntax region jsFlowParenRegion contained start=/:\s*(/ end=/)\%(\s*:\)\@=/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsObjectValue
|
||||||
|
syntax region jsFlowClass contained matchgroup=jsFlowNoise start=/</ end=/>/ oneline contains=@jsFlowCluster skipwhite skipempty nextgroup=jsClassBlock
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_javascript_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
HiLink jsFlow PreProc
|
||||||
|
HiLink jsFlowReturn PreProc
|
||||||
|
HiLink jsFlowArray PreProc
|
||||||
|
HiLink jsFlowDeclareBlock PreProc
|
||||||
|
HiLink jsFlowObject PreProc
|
||||||
|
HiLink jsFlowParenRegion PreProc
|
||||||
|
HiLink jsFlowClass PreProc
|
||||||
|
HiLink jsFlowTypeObject PreProc
|
||||||
|
HiLink jsFlowTypeKey PreProc
|
||||||
|
HiLink jsFlowTypeValue PreProc
|
||||||
|
HiLink jsFlowClassProperty jsClassProperty
|
||||||
|
HiLink jsFlowType Type
|
||||||
|
HiLink jsFlowDeclareKeyword Type
|
||||||
|
HiLink jsFlowNoise Noise
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
215
extras/jsdoc.vim
Normal file
215
extras/jsdoc.vim
Normal file
@@ -0,0 +1,215 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
"" syntax coloring for javadoc comments (HTML)
|
||||||
|
syntax region jsComment matchgroup=jsComment start="/\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
|
||||||
|
|
||||||
|
" tags containing a param
|
||||||
|
syntax match jsDocTags contained "@\(alias\|api\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam
|
||||||
|
" tags containing type and param
|
||||||
|
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\)\>" skipwhite nextgroup=jsDocType
|
||||||
|
" tags containing type but no param
|
||||||
|
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam
|
||||||
|
" tags containing references
|
||||||
|
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
|
||||||
|
" other tags (no extra syntax)
|
||||||
|
syntax match jsDocTags contained "@\(abstract\|access\|accessor\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|localdoc\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
|
||||||
|
|
||||||
|
syntax region jsDocType contained matchgroup=jsDocTypeBrackets start="{" end="}" contains=jsDocTypeRecord oneline skipwhite nextgroup=jsDocParam
|
||||||
|
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" skipwhite nextgroup=jsDocParam
|
||||||
|
syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRecord extend
|
||||||
|
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
|
||||||
|
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
|
||||||
|
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
||||||
|
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.{-}]\|=\)\+"
|
||||||
|
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_javascript_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
HiLink jsDocTags Special
|
||||||
|
HiLink jsDocSeeTag Function
|
||||||
|
HiLink jsDocType Type
|
||||||
|
HiLink jsDocTypeBrackets jsDocType
|
||||||
|
HiLink jsDocTypeRecord jsDocType
|
||||||
|
HiLink jsDocTypeNoParam Type
|
||||||
|
HiLink jsDocParam Label
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
"" syntax coloring for javadoc comments (HTML)
|
||||||
|
syntax region jsComment matchgroup=jsComment start="/\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
|
||||||
|
|
||||||
|
" tags containing a param
|
||||||
|
syntax match jsDocTags contained "@\(alias\|api\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam
|
||||||
|
" tags containing type and param
|
||||||
|
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\)\>" skipwhite nextgroup=jsDocType
|
||||||
|
" tags containing type but no param
|
||||||
|
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam
|
||||||
|
" tags containing references
|
||||||
|
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
|
||||||
|
" other tags (no extra syntax)
|
||||||
|
syntax match jsDocTags contained "@\(abstract\|access\|accessor\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|localdoc\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
|
||||||
|
|
||||||
|
syntax region jsDocType contained matchgroup=jsDocTypeBrackets start="{" end="}" contains=jsDocTypeRecord oneline skipwhite nextgroup=jsDocParam
|
||||||
|
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" skipwhite nextgroup=jsDocParam
|
||||||
|
syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRecord extend
|
||||||
|
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
|
||||||
|
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
|
||||||
|
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
||||||
|
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.{-}]\|=\)\+"
|
||||||
|
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_javascript_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
HiLink jsDocTags Special
|
||||||
|
HiLink jsDocSeeTag Function
|
||||||
|
HiLink jsDocType Type
|
||||||
|
HiLink jsDocTypeBrackets jsDocType
|
||||||
|
HiLink jsDocTypeRecord jsDocType
|
||||||
|
HiLink jsDocTypeNoParam Type
|
||||||
|
HiLink jsDocParam Label
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
"" syntax coloring for javadoc comments (HTML)
|
||||||
|
syntax region jsComment matchgroup=jsComment start="/\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
|
||||||
|
|
||||||
|
" tags containing a param
|
||||||
|
syntax match jsDocTags contained "@\(alias\|api\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam
|
||||||
|
" tags containing type and param
|
||||||
|
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\)\>" skipwhite nextgroup=jsDocType
|
||||||
|
" tags containing type but no param
|
||||||
|
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam
|
||||||
|
" tags containing references
|
||||||
|
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
|
||||||
|
" other tags (no extra syntax)
|
||||||
|
syntax match jsDocTags contained "@\(abstract\|access\|accessor\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|localdoc\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
|
||||||
|
|
||||||
|
syntax region jsDocType contained matchgroup=jsDocTypeBrackets start="{" end="}" contains=jsDocTypeRecord oneline skipwhite nextgroup=jsDocParam
|
||||||
|
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" skipwhite nextgroup=jsDocParam
|
||||||
|
syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRecord extend
|
||||||
|
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
|
||||||
|
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
|
||||||
|
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
||||||
|
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.{-}]\|=\)\+"
|
||||||
|
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_javascript_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
HiLink jsDocTags Special
|
||||||
|
HiLink jsDocSeeTag Function
|
||||||
|
HiLink jsDocType Type
|
||||||
|
HiLink jsDocTypeBrackets jsDocType
|
||||||
|
HiLink jsDocTypeRecord jsDocType
|
||||||
|
HiLink jsDocTypeNoParam Type
|
||||||
|
HiLink jsDocParam Label
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
"" syntax coloring for javadoc comments (HTML)
|
||||||
|
syntax region jsComment matchgroup=jsComment start="/\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
|
||||||
|
|
||||||
|
" tags containing a param
|
||||||
|
syntax match jsDocTags contained "@\(alias\|api\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam
|
||||||
|
" tags containing type and param
|
||||||
|
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\)\>" skipwhite nextgroup=jsDocType
|
||||||
|
" tags containing type but no param
|
||||||
|
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam
|
||||||
|
" tags containing references
|
||||||
|
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
|
||||||
|
" other tags (no extra syntax)
|
||||||
|
syntax match jsDocTags contained "@\(abstract\|access\|accessor\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|localdoc\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
|
||||||
|
|
||||||
|
syntax region jsDocType contained matchgroup=jsDocTypeBrackets start="{" end="}" contains=jsDocTypeRecord oneline skipwhite nextgroup=jsDocParam
|
||||||
|
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" skipwhite nextgroup=jsDocParam
|
||||||
|
syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRecord extend
|
||||||
|
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
|
||||||
|
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
|
||||||
|
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
||||||
|
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.{-}]\|=\)\+"
|
||||||
|
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_javascript_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
HiLink jsDocTags Special
|
||||||
|
HiLink jsDocSeeTag Function
|
||||||
|
HiLink jsDocType Type
|
||||||
|
HiLink jsDocTypeBrackets jsDocType
|
||||||
|
HiLink jsDocTypeRecord jsDocType
|
||||||
|
HiLink jsDocTypeNoParam Type
|
||||||
|
HiLink jsDocParam Label
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
"" syntax coloring for javadoc comments (HTML)
|
||||||
|
syntax region jsComment matchgroup=jsComment start="/\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
|
||||||
|
|
||||||
|
" tags containing a param
|
||||||
|
syntax match jsDocTags contained "@\(alias\|api\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam
|
||||||
|
" tags containing type and param
|
||||||
|
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\)\>" skipwhite nextgroup=jsDocType
|
||||||
|
" tags containing type but no param
|
||||||
|
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam
|
||||||
|
" tags containing references
|
||||||
|
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
|
||||||
|
" other tags (no extra syntax)
|
||||||
|
syntax match jsDocTags contained "@\(abstract\|access\|accessor\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|localdoc\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
|
||||||
|
|
||||||
|
syntax region jsDocType contained matchgroup=jsDocTypeBrackets start="{" end="}" contains=jsDocTypeRecord oneline skipwhite nextgroup=jsDocParam
|
||||||
|
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" skipwhite nextgroup=jsDocParam
|
||||||
|
syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRecord extend
|
||||||
|
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
|
||||||
|
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
|
||||||
|
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
||||||
|
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.{-}]\|=\)\+"
|
||||||
|
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
||||||
|
|
||||||
|
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_javascript_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
HiLink jsDocTags Special
|
||||||
|
HiLink jsDocSeeTag Function
|
||||||
|
HiLink jsDocType Type
|
||||||
|
HiLink jsDocTypeBrackets jsDocType
|
||||||
|
HiLink jsDocTypeRecord jsDocType
|
||||||
|
HiLink jsDocTypeNoParam Type
|
||||||
|
HiLink jsDocParam Label
|
||||||
|
delcommand HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
35
extras/ngdoc.vim
Normal file
35
extras/ngdoc.vim
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
syntax match jsDocTags contained /@\(link\|method[oO]f\|ngdoc\|ng[iI]nject\|restrict\)/ nextgroup=jsDocParam skipwhite
|
||||||
|
syntax match jsDocType contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
|
||||||
|
syntax match jsDocParam contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+"
|
||||||
|
|
||||||
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
syntax match jsDocTags contained /@\(link\|method[oO]f\|ngdoc\|ng[iI]nject\|restrict\)/ nextgroup=jsDocParam skipwhite
|
||||||
|
syntax match jsDocType contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
|
||||||
|
syntax match jsDocParam contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+"
|
||||||
|
|
||||||
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
syntax match jsDocTags contained /@\(link\|method[oO]f\|ngdoc\|ng[iI]nject\|restrict\)/ nextgroup=jsDocParam skipwhite
|
||||||
|
syntax match jsDocType contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
|
||||||
|
syntax match jsDocParam contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+"
|
||||||
|
|
||||||
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
syntax match jsDocTags contained /@\(link\|method[oO]f\|ngdoc\|ng[iI]nject\|restrict\)/ nextgroup=jsDocParam skipwhite
|
||||||
|
syntax match jsDocType contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
|
||||||
|
syntax match jsDocParam contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+"
|
||||||
|
|
||||||
|
endif
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
syntax match jsDocTags contained /@\(link\|method[oO]f\|ngdoc\|ng[iI]nject\|restrict\)/ nextgroup=jsDocParam skipwhite
|
||||||
|
syntax match jsDocType contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|\/\)\+" nextgroup=jsDocParam skipwhite
|
||||||
|
syntax match jsDocParam contained "\%(#\|\$\|\w\|\"\|-\|\.\|:\|{\|}\|\/\|\[\|]\|=\)\+"
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,3 +1,13 @@
|
|||||||
|
" Enable jsx syntax by default
|
||||||
|
if !exists('g:jsx_ext_required')
|
||||||
|
let g:jsx_ext_required = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Disable json concealing by default
|
||||||
|
if !exists('g:vim_json_syntax_conceal')
|
||||||
|
let g:vim_json_syntax_conceal = 0
|
||||||
|
endif
|
||||||
|
" ftdetect/ansible.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
|
||||||
|
|
||||||
function! s:isAnsible()
|
function! s:isAnsible()
|
||||||
@@ -6,129 +16,238 @@ function! s:isAnsible()
|
|||||||
if filepath =~ '\v/(tasks|roles|handlers)/.*\.ya?ml$' | return 1 | en
|
if filepath =~ '\v/(tasks|roles|handlers)/.*\.ya?ml$' | return 1 | en
|
||||||
if filepath =~ '\v/(group|host)_vars/' | return 1 | en
|
if filepath =~ '\v/(group|host)_vars/' | return 1 | en
|
||||||
if filename =~ '\v(playbook|site|main|local)\.ya?ml$' | return 1 | en
|
if filename =~ '\v(playbook|site|main|local)\.ya?ml$' | return 1 | en
|
||||||
|
|
||||||
let shebang = getline(1)
|
let shebang = getline(1)
|
||||||
if shebang =~# '^#!.*/bin/env\s\+ansible-playbook\>' | return 1 | en
|
if shebang =~# '^#!.*/bin/env\s\+ansible-playbook\>' | return 1 | en
|
||||||
if shebang =~# '^#!.*/bin/ansible-playbook\>' | return 1 | en
|
if shebang =~# '^#!.*/bin/ansible-playbook\>' | return 1 | en
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
:au BufNewFile,BufRead * if s:isAnsible() | set ft=ansible | en
|
:au BufNewFile,BufRead * if s:isAnsible() | set ft=ansible | en
|
||||||
:au BufNewFile,BufRead *.j2 set ft=ansible_template
|
:au BufNewFile,BufRead *.j2 set ft=ansible_template
|
||||||
:au BufNewFile,BufRead hosts set ft=ansible_hosts
|
:au BufNewFile,BufRead hosts set ft=ansible_hosts
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/arduino.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'arduino') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'arduino') == -1
|
||||||
|
|
||||||
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
|
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/blade.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'blade') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'blade') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.blade.php set filetype=blade
|
autocmd BufNewFile,BufRead *.blade.php set filetype=blade
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/cjsx.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cjsx') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cjsx') == -1
|
||||||
|
|
||||||
augroup CJSX
|
augroup CJSX
|
||||||
au!
|
au!
|
||||||
autocmd BufNewFile,BufRead *.csx,*.cjsx set filetype=coffee
|
autocmd BufNewFile,BufRead *.csx,*.cjsx set filetype=coffee
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/clojure.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc setlocal filetype=clojure
|
autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc setlocal filetype=clojure
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/coffee.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
|
||||||
|
|
||||||
|
" Language: CoffeeScript
|
||||||
|
" Maintainer: Mick Koch <mick@kochm.co>
|
||||||
|
" URL: http://github.com/kchmck/vim-coffee-script
|
||||||
|
" License: WTFPL
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
|
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
|
||||||
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
|
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
|
||||||
autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee
|
autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee
|
||||||
autocmd BufNewFile,BufRead *._coffee set filetype=coffee
|
autocmd BufNewFile,BufRead *._coffee set filetype=coffee
|
||||||
|
|
||||||
function! s:DetectCoffee()
|
function! s:DetectCoffee()
|
||||||
if getline(1) =~ '^#!.*\<coffee\>'
|
if getline(1) =~ '^#!.*\<coffee\>'
|
||||||
set filetype=coffee
|
set filetype=coffee
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead * call s:DetectCoffee()
|
autocmd BufNewFile,BufRead * call s:DetectCoffee()
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/cql.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cql') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cql') == -1
|
||||||
|
|
||||||
if has("autocmd")
|
if has("autocmd")
|
||||||
au BufNewFile,BufRead *.cql set filetype=cql
|
au BufNewFile,BufRead *.cql set filetype=cql
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/cryptol.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cryptol') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cryptol') == -1
|
||||||
|
|
||||||
|
" Copyright © 2013 Edward O'Callaghan. All Rights Reserved.
|
||||||
|
" Normal Cryptol Program;
|
||||||
au! BufRead,BufNewFile *.cry set filetype=cryptol
|
au! BufRead,BufNewFile *.cry set filetype=cryptol
|
||||||
au! BufRead,BufNewFile *.cyl set filetype=cryptol
|
au! BufRead,BufNewFile *.cyl set filetype=cryptol
|
||||||
|
" Literate Cryptol Program;
|
||||||
au! BufRead,BufNewFile *.lcry set filetype=cryptol
|
au! BufRead,BufNewFile *.lcry set filetype=cryptol
|
||||||
au! BufRead,BufNewFile *.lcyl set filetype=cryptol
|
au! BufRead,BufNewFile *.lcyl set filetype=cryptol
|
||||||
|
" Also in LaTeX *.tex which is outside our coverage scope.
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/crystal.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufReadPost *.cr setlocal filetype=crystal
|
autocmd BufNewFile,BufReadPost *.cr setlocal filetype=crystal
|
||||||
autocmd BufNewFile,BufReadPost Projectfile setlocal filetype=crystal
|
autocmd BufNewFile,BufReadPost Projectfile setlocal filetype=crystal
|
||||||
autocmd BufNewFile,BufReadPost *.ecr setlocal filetype=eruby
|
autocmd BufNewFile,BufReadPost *.ecr setlocal filetype=eruby
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/cucumber.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -1
|
||||||
|
|
||||||
|
" Cucumber
|
||||||
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
|
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/dart.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
|
||||||
|
|
||||||
autocmd BufRead,BufNewFile *.dart set filetype=dart
|
autocmd BufRead,BufNewFile *.dart set filetype=dart
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/dockerfile.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
|
||||||
|
|
||||||
au BufNewFile,BufRead Dockerfile set filetype=dockerfile
|
au BufNewFile,BufRead Dockerfile set filetype=dockerfile
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/elixir.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
|
||||||
|
|
||||||
au BufRead,BufNewFile *.ex,*.exs call s:setf('elixir')
|
au BufRead,BufNewFile *.ex,*.exs call s:setf('elixir')
|
||||||
au BufRead,BufNewFile *.eex call s:setf('eelixir')
|
au BufRead,BufNewFile *.eex call s:setf('eelixir')
|
||||||
au BufRead,BufNewFile * call s:DetectElixir()
|
au BufRead,BufNewFile * call s:DetectElixir()
|
||||||
|
|
||||||
au FileType elixir,eelixir setl sw=2 sts=2 et iskeyword+=!,?
|
au FileType elixir,eelixir setl sw=2 sts=2 et iskeyword+=!,?
|
||||||
|
|
||||||
function! s:setf(filetype) abort
|
function! s:setf(filetype) abort
|
||||||
let &filetype = a:filetype
|
let &filetype = a:filetype
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:DetectElixir()
|
function! s:DetectElixir()
|
||||||
if getline(1) =~ '^#!.*\<elixir\>'
|
if getline(1) =~ '^#!.*\<elixir\>'
|
||||||
call s:setf('elixir')
|
call s:setf('elixir')
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/elm.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
|
||||||
|
|
||||||
au BufNewFile,BufRead *.elm set filetype=elm
|
au BufNewFile,BufRead *.elm set filetype=elm
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/ember-script.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
|
||||||
|
|
||||||
|
" Language: ember-script
|
||||||
|
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
|
||||||
|
" URL: http://github.com/yalesov/vim-ember-script
|
||||||
|
" Version: 1.0.4
|
||||||
|
" Last Change: 2016 Jul 6
|
||||||
|
" License: ISC
|
||||||
|
|
||||||
|
if !exists('g:vim_ember_script')
|
||||||
|
let g:vim_ember_script = 1
|
||||||
|
endif
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.em set filetype=ember-script
|
autocmd BufNewFile,BufRead *.em set filetype=ember-script
|
||||||
autocmd FileType ember-script set tabstop=2|set shiftwidth=2|set expandtab
|
autocmd FileType ember-script set tabstop=2|set shiftwidth=2|set expandtab
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/emblem.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
|
" Language: emblem
|
||||||
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
|
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
|
||||||
|
" URL: http://github.com/yalesov/vim-emblem
|
||||||
|
" Version: 2.0.1
|
||||||
|
" Last Change: 2016 Jul 6
|
||||||
|
" License: ISC
|
||||||
|
|
||||||
|
if !exists('g:vim_emblem')
|
||||||
|
let g:vim_emblem = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if exists('g:vim_ember_script')
|
||||||
|
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
|
||||||
|
else
|
||||||
|
autocmd BufNewFile,BufRead *.em,*.emblem set filetype=emblem
|
||||||
|
endif
|
||||||
|
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
" ftdetect/erlang.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1
|
||||||
|
|
||||||
au BufNewFile,BufRead *.erl,*.hrl,rebar.config,*.app,*.app.src,*.yaws,*.xrl set ft=erlang
|
au BufNewFile,BufRead *.erl,*.hrl,rebar.config,*.app,*.app.src,*.yaws,*.xrl set ft=erlang
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/fish.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fish') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fish') == -1
|
||||||
|
|
||||||
autocmd BufRead,BufNewFile *.fish setfiletype fish
|
autocmd BufRead,BufNewFile *.fish setfiletype fish
|
||||||
|
|
||||||
|
" Detect fish scripts by the shebang line.
|
||||||
autocmd BufRead *
|
autocmd BufRead *
|
||||||
\ if getline(1) =~# '\v^#!%(\f*/|/usr/bin/env\s*<)fish>' |
|
\ if getline(1) =~# '\v^#!%(\f*/|/usr/bin/env\s*<)fish>' |
|
||||||
\ setlocal filetype=fish |
|
\ setlocal filetype=fish |
|
||||||
\ endif
|
\ endif
|
||||||
|
|
||||||
|
" Move cursor to first empty line when using funced.
|
||||||
autocmd BufRead fish_funced_*_*.fish call search('^$')
|
autocmd BufRead fish_funced_*_*.fish call search('^$')
|
||||||
|
|
||||||
|
" Fish histories are YAML documents.
|
||||||
autocmd BufRead,BufNewFile ~/.config/fish/fish_{read_,}history setfiletype yaml
|
autocmd BufRead,BufNewFile ~/.config/fish/fish_{read_,}history setfiletype yaml
|
||||||
|
|
||||||
|
" Universal variable storages should not be hand edited.
|
||||||
autocmd BufRead,BufNewFile ~/.config/fish/fishd.* setlocal readonly
|
autocmd BufRead,BufNewFile ~/.config/fish/fishd.* setlocal readonly
|
||||||
|
|
||||||
|
" Mimic `funced` when manually creating functions.
|
||||||
autocmd BufNewFile ~/.config/fish/functions/*.fish
|
autocmd BufNewFile ~/.config/fish/functions/*.fish
|
||||||
\ call append(0, ['function '.expand('%:t:r'),
|
\ call append(0, ['function '.expand('%:t:r'),
|
||||||
\'',
|
\'',
|
||||||
\'end']) |
|
\'end']) |
|
||||||
\ 2
|
\ 2
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/git.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||||
|
|
||||||
|
" Git
|
||||||
autocmd BufNewFile,BufRead *.git/{,modules/**/,worktrees/*/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
|
autocmd BufNewFile,BufRead *.git/{,modules/**/,worktrees/*/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
|
||||||
autocmd BufNewFile,BufRead *.git/config,.gitconfig,gitconfig,.gitmodules set ft=gitconfig
|
autocmd BufNewFile,BufRead *.git/config,.gitconfig,gitconfig,.gitmodules set ft=gitconfig
|
||||||
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
||||||
@@ -139,6 +258,8 @@ autocmd BufNewFile,BufRead *.git/**
|
|||||||
\ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
|
\ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
|
||||||
\ set ft=git |
|
\ set ft=git |
|
||||||
\ endif
|
\ endif
|
||||||
|
|
||||||
|
" This logic really belongs in scripts.vim
|
||||||
autocmd BufNewFile,BufRead,StdinReadPost *
|
autocmd BufNewFile,BufRead,StdinReadPost *
|
||||||
\ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' |
|
\ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' |
|
||||||
\ set ft=git |
|
\ set ft=git |
|
||||||
@@ -147,80 +268,154 @@ autocmd BufNewFile,BufRead *
|
|||||||
\ if getline(1) =~ '^From \x\{40\} Mon Sep 17 00:00:00 2001$' |
|
\ if getline(1) =~ '^From \x\{40\} Mon Sep 17 00:00:00 2001$' |
|
||||||
\ set filetype=gitsendemail |
|
\ set filetype=gitsendemail |
|
||||||
\ endif
|
\ endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/glsl.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
|
||||||
|
|
||||||
|
" Language: OpenGL Shading Language
|
||||||
|
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
|
||||||
|
|
||||||
autocmd! BufNewFile,BufRead *.glsl,*.geom,*.vert,*.frag,*.gsh,*.vsh,*.fsh,*.vs,*.fs,*.gs,*.tcs,*.tes set filetype=glsl
|
autocmd! BufNewFile,BufRead *.glsl,*.geom,*.vert,*.frag,*.gsh,*.vsh,*.fsh,*.vs,*.fs,*.gs,*.tcs,*.tes set filetype=glsl
|
||||||
|
|
||||||
|
" vim:set sts=2 sw=2 :
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/gofiletype.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||||
|
|
||||||
|
" We take care to preserve the user's fileencodings and fileformats,
|
||||||
|
" because those settings are global (not buffer local), yet we want
|
||||||
|
" to override them for loading Go files, which are defined to be UTF-8.
|
||||||
let s:current_fileformats = ''
|
let s:current_fileformats = ''
|
||||||
let s:current_fileencodings = ''
|
let s:current_fileencodings = ''
|
||||||
|
|
||||||
|
" define fileencodings to open as utf-8 encoding even if it's ascii.
|
||||||
function! s:gofiletype_pre(type)
|
function! s:gofiletype_pre(type)
|
||||||
let s:current_fileformats = &g:fileformats
|
let s:current_fileformats = &g:fileformats
|
||||||
let s:current_fileencodings = &g:fileencodings
|
let s:current_fileencodings = &g:fileencodings
|
||||||
set fileencodings=utf-8 fileformats=unix
|
set fileencodings=utf-8 fileformats=unix
|
||||||
let &l:filetype = a:type
|
let &l:filetype = a:type
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" restore fileencodings as others
|
||||||
function! s:gofiletype_post()
|
function! s:gofiletype_post()
|
||||||
let &g:fileformats = s:current_fileformats
|
let &g:fileformats = s:current_fileformats
|
||||||
let &g:fileencodings = s:current_fileencodings
|
let &g:fileencodings = s:current_fileencodings
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix
|
au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix
|
||||||
au BufRead *.go call s:gofiletype_pre("go")
|
au BufRead *.go call s:gofiletype_pre("go")
|
||||||
au BufReadPost *.go call s:gofiletype_post()
|
au BufReadPost *.go call s:gofiletype_post()
|
||||||
|
|
||||||
au BufNewFile *.s setfiletype asm | setlocal fileencoding=utf-8 fileformat=unix
|
au BufNewFile *.s setfiletype asm | setlocal fileencoding=utf-8 fileformat=unix
|
||||||
au BufRead *.s call s:gofiletype_pre("asm")
|
au BufRead *.s call s:gofiletype_pre("asm")
|
||||||
au BufReadPost *.s call s:gofiletype_post()
|
au BufReadPost *.s call s:gofiletype_post()
|
||||||
|
|
||||||
au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
|
au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
|
||||||
|
|
||||||
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/haml.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml
|
autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml
|
||||||
autocmd BufNewFile,BufRead *.sass setf sass
|
autocmd BufNewFile,BufRead *.sass setf sass
|
||||||
autocmd BufNewFile,BufRead *.scss setf scss
|
autocmd BufNewFile,BufRead *.scss setf scss
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/haskell.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
||||||
|
|
||||||
au BufRead,BufNewFile *.hsc set filetype=haskell
|
au BufRead,BufNewFile *.hsc set filetype=haskell
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/haxe.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haxe') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haxe') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.hx setf haxe
|
autocmd BufNewFile,BufRead *.hx setf haxe
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/jasmine.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *Spec.js,*_spec.js set filetype=jasmine.javascript syntax=jasmine
|
autocmd BufNewFile,BufRead *Spec.js,*_spec.js set filetype=jasmine.javascript syntax=jasmine
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
" ftdetect/javascript.vim
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
au BufNewFile,BufRead *.js setf javascript
|
||||||
|
au BufNewFile,BufRead *.jsm setf javascript
|
||||||
|
au BufNewFile,BufRead Jakefile setf javascript
|
||||||
|
|
||||||
|
fun! s:SelectJavascript()
|
||||||
|
if getline(1) =~# '^#!.*/bin/\%(env\s\+\)\?node\>'
|
||||||
|
set ft=javascript
|
||||||
|
endif
|
||||||
|
endfun
|
||||||
|
au BufNewFile,BufRead * call s:SelectJavascript()
|
||||||
|
|
||||||
endif
|
endif
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
|
||||||
|
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
" Vim ftdetect file
|
||||||
|
"
|
||||||
|
" Language: JSX (JavaScript)
|
||||||
|
" Maintainer: Max Wang <mxawng@gmail.com>
|
||||||
|
"
|
||||||
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|
||||||
|
" Whether the .jsx extension is required.
|
||||||
if !exists('g:jsx_ext_required')
|
if !exists('g:jsx_ext_required')
|
||||||
let g:jsx_ext_required = 1
|
let g:jsx_ext_required = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Whether the @jsx pragma is required.
|
||||||
if !exists('g:jsx_pragma_required')
|
if !exists('g:jsx_pragma_required')
|
||||||
let g:jsx_pragma_required = 0
|
let g:jsx_pragma_required = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if g:jsx_pragma_required
|
if g:jsx_pragma_required
|
||||||
" Look for the @jsx pragma. It must be included in a docblock comment before
|
" Look for the @jsx pragma. It must be included in a docblock comment before
|
||||||
" anything else in the file (except whitespace).
|
" anything else in the file (except whitespace).
|
||||||
let s:jsx_pragma_pattern = '\%^\_s*\/\*\*\%(\_.\%(\*\/\)\@!\)*@jsx\_.\{-}\*\/'
|
let s:jsx_pragma_pattern = '\%^\_s*\/\*\*\%(\_.\%(\*\/\)\@!\)*@jsx\_.\{-}\*\/'
|
||||||
let b:jsx_pragma_found = search(s:jsx_pragma_pattern, 'npw')
|
let b:jsx_pragma_found = search(s:jsx_pragma_pattern, 'npw')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Whether to set the JSX filetype on *.js files.
|
||||||
fu! <SID>EnableJSX()
|
fu! <SID>EnableJSX()
|
||||||
if g:jsx_pragma_required && !b:jsx_pragma_found | return 0 | endif
|
if g:jsx_pragma_required && !b:jsx_pragma_found | return 0 | endif
|
||||||
if g:jsx_ext_required && !exists('b:jsx_ext_found') | return 0 | endif
|
if g:jsx_ext_required && !exists('b:jsx_ext_found') | return 0 | endif
|
||||||
return 1
|
return 1
|
||||||
endfu
|
endfu
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.jsx let b:jsx_ext_found = 1
|
autocmd BufNewFile,BufRead *.jsx let b:jsx_ext_found = 1
|
||||||
autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx
|
autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx
|
||||||
autocmd BufNewFile,BufRead *.js
|
autocmd BufNewFile,BufRead *.js
|
||||||
\ if <SID>EnableJSX() | set filetype=javascript.jsx | endif
|
\ if <SID>EnableJSX() | set filetype=javascript.jsx | endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/json.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.json set filetype=json
|
autocmd BufNewFile,BufRead *.json setlocal filetype=json
|
||||||
autocmd BufNewFile,BufRead *.jsonp set filetype=json
|
autocmd BufNewFile,BufRead *.jsonp setlocal filetype=json
|
||||||
|
autocmd BufNewFile,BufRead *.geojson setlocal filetype=json
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/jst.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jst') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jst') == -1
|
||||||
|
|
||||||
au BufNewFile,BufRead *.ejs set filetype=jst
|
au BufNewFile,BufRead *.ejs set filetype=jst
|
||||||
@@ -228,24 +423,42 @@ au BufNewFile,BufRead *.jst set filetype=jst
|
|||||||
au BufNewFile,BufRead *.djs set filetype=jst
|
au BufNewFile,BufRead *.djs set filetype=jst
|
||||||
au BufNewFile,BufRead *.hamljs set filetype=jst
|
au BufNewFile,BufRead *.hamljs set filetype=jst
|
||||||
au BufNewFile,BufRead *.ect set filetype=jst
|
au BufNewFile,BufRead *.ect set filetype=jst
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/julia.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
||||||
|
|
||||||
|
" NOTE: this line fixes an issue with the default system-wide lisp ftplugin
|
||||||
|
" which doesn't define b:undo_ftplugin
|
||||||
|
" (*.jt files are recognized as lisp)
|
||||||
au BufRead,BufNewFile *.jl let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<"
|
au BufRead,BufNewFile *.jl let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<"
|
||||||
|
|
||||||
au BufRead,BufNewFile *.jl set filetype=julia
|
au BufRead,BufNewFile *.jl set filetype=julia
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/kotlin.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.kt setfiletype kotlin
|
autocmd BufNewFile,BufRead *.kt setfiletype kotlin
|
||||||
autocmd BufNewFile,BufRead *.kts setfiletype kotlin
|
autocmd BufNewFile,BufRead *.kts setfiletype kotlin
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/less.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.less setf less
|
autocmd BufNewFile,BufRead *.less setf less
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/liquid.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'liquid') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'liquid') == -1
|
||||||
|
|
||||||
|
" Liquid
|
||||||
au BufNewFile,BufRead *.liquid set ft=liquid
|
au BufNewFile,BufRead *.liquid set ft=liquid
|
||||||
|
|
||||||
au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html set ft=liquid
|
au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html set ft=liquid
|
||||||
au BufNewFile,BufRead *.html,*.xml,*.textile
|
au BufNewFile,BufRead *.html,*.xml,*.textile
|
||||||
\ if getline(1) == '---' | set ft=liquid | endif
|
\ if getline(1) == '---' | set ft=liquid | endif
|
||||||
@@ -254,168 +467,372 @@ au BufNewFile,BufRead *.markdown,*.mkd,*.mkdn,*.md
|
|||||||
\ let b:liquid_subtype = 'markdown' |
|
\ let b:liquid_subtype = 'markdown' |
|
||||||
\ set ft=liquid |
|
\ set ft=liquid |
|
||||||
\ endif
|
\ endif
|
||||||
|
|
||||||
|
" Set subtype for Shopify alternate templates
|
||||||
au BufNewFile,BufRead */templates/**.liquid,*/layout/**.liquid,*/snippets/**.liquid
|
au BufNewFile,BufRead */templates/**.liquid,*/layout/**.liquid,*/snippets/**.liquid
|
||||||
\ let b:liquid_subtype = 'html' |
|
\ let b:liquid_subtype = 'html' |
|
||||||
\ set ft=liquid |
|
\ set ft=liquid |
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/ls.vim
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'livescript') == -1
|
||||||
|
|
||||||
|
" Language: LiveScript
|
||||||
|
" Maintainer: George Zahariev
|
||||||
|
" URL: http://github.com/gkz/vim-ls
|
||||||
|
" License: WTFPL
|
||||||
|
"
|
||||||
|
autocmd BufNewFile,BufRead *.ls set filetype=ls
|
||||||
|
autocmd BufNewFile,BufRead *Slakefile set filetype=ls
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
" ftdetect/mako.vim
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mako') == -1
|
||||||
|
|
||||||
|
au BufRead,BufNewFile *.mako set filetype=mako
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
" ftdetect/markdown.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mkd,*.mkdn
|
" markdown filetype file
|
||||||
\ if &ft =~# '^\%(conf\|modula2\)$' |
|
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=markdown
|
||||||
\ set ft=markdown |
|
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx} set filetype=markdown
|
||||||
\ else |
|
|
||||||
\ setf markdown |
|
|
||||||
\ endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/mason-in-html.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
|
||||||
|
|
||||||
|
" Highlight .html files as Mason if they start with Mason tags
|
||||||
autocmd BufRead *.html
|
autocmd BufRead *.html
|
||||||
\ if getline(1) =~ '^\(%\|<[%&].*>\)' |
|
\ if getline(1) =~ '^\(%\|<[%&].*>\)' |
|
||||||
\ set filetype=mason |
|
\ set filetype=mason |
|
||||||
\ endif
|
\ endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/mustache.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1
|
||||||
|
|
||||||
if has("autocmd")
|
if has("autocmd")
|
||||||
au BufNewFile,BufRead *.mustache,*.hogan,*.hulk,*.hjs set filetype=html.mustache syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
|
au BufNewFile,BufRead *.mustache,*.hogan,*.hulk,*.hjs set filetype=html.mustache syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
|
||||||
au BufNewFile,BufRead *.handlebars,*.hbs set filetype=html.handlebars syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
|
au BufNewFile,BufRead *.handlebars,*.hbs set filetype=html.handlebars syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/nginx.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||||
|
|
||||||
au BufRead,BufNewFile *.nginx set ft=nginx
|
au BufRead,BufNewFile *.nginx set ft=nginx
|
||||||
au BufRead,BufNewFile */etc/nginx/* set ft=nginx
|
au BufRead,BufNewFile */etc/nginx/* set ft=nginx
|
||||||
au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx
|
au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx
|
||||||
au BufRead,BufNewFile nginx.conf set ft=nginx
|
au BufRead,BufNewFile nginx.conf set ft=nginx
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/nim.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nim') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nim') == -1
|
||||||
|
|
||||||
au BufNewFile,BufRead *.nim set filetype=nim
|
au BufNewFile,BufRead *.nim,*.nims set filetype=nim
|
||||||
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/nix.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nix') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nix') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.nix setfiletype nix
|
autocmd BufNewFile,BufRead *.nix setfiletype nix
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/opencl.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'opencl') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'opencl') == -1
|
||||||
|
|
||||||
au! BufRead,BufNewFile *.cl set filetype=opencl
|
au! BufRead,BufNewFile *.cl set filetype=opencl
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/perl11.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
|
||||||
|
|
||||||
function! s:DetectPerl6()
|
function! s:DetectPerl6()
|
||||||
let line_no = 1
|
let line_no = 1
|
||||||
let eof = line('$')
|
let eof = line('$')
|
||||||
let in_pod = 0
|
let in_pod = 0
|
||||||
|
|
||||||
while line_no <= eof
|
while line_no <= eof
|
||||||
let line = getline(line_no)
|
let line = getline(line_no)
|
||||||
let line_no = line_no + 1
|
let line_no = line_no + 1
|
||||||
|
|
||||||
if line =~ '^=\w'
|
if line =~ '^=\w'
|
||||||
let in_pod = 1
|
let in_pod = 1
|
||||||
elseif line =~ '^=\%(end\|cut\)'
|
elseif line =~ '^=\%(end\|cut\)'
|
||||||
let in_pod = 0
|
let in_pod = 0
|
||||||
elseif !in_pod
|
elseif !in_pod
|
||||||
let line = substitute(line, '#.*', '', '')
|
let line = substitute(line, '#.*', '', '')
|
||||||
|
|
||||||
if line =~ '^\s*$'
|
if line =~ '^\s*$'
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if line =~ '^\s*\%(use\s\+\)\=v6\%(\.\d\%(\.\d\)\=\)\=;'
|
if line =~ '^\s*\%(use\s\+\)\=v6\%(\.\d\%(\.\d\)\=\)\=;'
|
||||||
set filetype=perl6 " we matched a 'use v6' declaration
|
set filetype=perl6 " we matched a 'use v6' declaration
|
||||||
elseif line =~ '^\s*\%(\%(my\|our\)\s\+\)\=\%(unit\s\+\)\=\(module\|class\|role\|enum\|grammar\)'
|
elseif line =~ '^\s*\%(\%(my\|our\)\s\+\)\=\%(unit\s\+\)\=\(module\|class\|role\|enum\|grammar\)'
|
||||||
set filetype=perl6 " we found a class, role, module, enum, or grammar declaration
|
set filetype=perl6 " we found a class, role, module, enum, or grammar declaration
|
||||||
endif
|
endif
|
||||||
|
|
||||||
break " we either found what we needed, or we found a non-POD, non-comment,
|
break " we either found what we needed, or we found a non-POD, non-comment,
|
||||||
" non-Perl 6 indicating line, so bail out
|
" non-Perl 6 indicating line, so bail out
|
||||||
endif
|
endif
|
||||||
endwhile
|
endwhile
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6()
|
autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6()
|
||||||
autocmd BufNew,BufNewFile,BufRead *.nqp setf perl6
|
autocmd BufNew,BufNewFile,BufRead *.nqp setf perl6
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/pgsql.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pgsql') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pgsql') == -1
|
||||||
|
|
||||||
|
" postgreSQL
|
||||||
au BufNewFile,BufRead *.pgsql setf pgsql
|
au BufNewFile,BufRead *.pgsql setf pgsql
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/plantuml.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'plantuml') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'plantuml') == -1
|
||||||
|
|
||||||
|
" Vim ftdetect file
|
||||||
|
" Language: PlantUML
|
||||||
|
" Maintainer: Aaron C. Meadows < language name at shadowguarddev dot com>
|
||||||
|
" Last Change: 19-Jun-2012
|
||||||
|
" Version: 0.1
|
||||||
|
|
||||||
if did_filetype()
|
if did_filetype()
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
autocmd BufRead,BufNewFile * :if getline(1) =~ '^.*startuml.*$'| setfiletype plantuml | endif
|
|
||||||
autocmd BufRead,BufNewFile *.pu,*.uml,*.plantuml set filetype=plantuml
|
autocmd BufRead,BufNewFile * :if getline(1) =~ '^.*startuml.*$'| setfiletype plantuml | set filetype=plantuml | endif
|
||||||
|
autocmd BufRead,BufNewFile *.pu,*.uml,*.plantuml setfiletype plantuml | set filetype=plantuml
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/proto.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'protobuf') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'protobuf') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.proto setfiletype proto
|
autocmd BufNewFile,BufRead *.proto setfiletype proto
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/ps1.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1
|
||||||
|
|
||||||
|
" Vim ftdetect plugin file
|
||||||
|
" Language: Windows PowerShell
|
||||||
|
" Maintainer: Peter Provost <peter@provost.org>
|
||||||
|
" Version: 2.10
|
||||||
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||||
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327
|
||||||
|
"
|
||||||
au BufNewFile,BufRead *.ps1 set ft=ps1
|
au BufNewFile,BufRead *.ps1 set ft=ps1
|
||||||
au BufNewFile,BufRead *.psd1 set ft=ps1
|
au BufNewFile,BufRead *.psd1 set ft=ps1
|
||||||
au BufNewFile,BufRead *.psm1 set ft=ps1
|
au BufNewFile,BufRead *.psm1 set ft=ps1
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/ps1xml.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1
|
||||||
|
|
||||||
|
" Vim ftdetect plugin file
|
||||||
|
" Language: Windows PowerShell
|
||||||
|
" Maintainer: Peter Provost <peter@provost.org>
|
||||||
|
" Version: 2.10
|
||||||
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
||||||
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327
|
||||||
|
|
||||||
au BufNewFile,BufRead *.ps1xml set ft=ps1xml
|
au BufNewFile,BufRead *.ps1xml set ft=ps1xml
|
||||||
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/pug.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pug') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pug') == -1
|
||||||
|
|
||||||
|
" Pug
|
||||||
autocmd BufNewFile,BufReadPost *.pug set filetype=pug
|
autocmd BufNewFile,BufReadPost *.pug set filetype=pug
|
||||||
|
|
||||||
|
" Jade
|
||||||
autocmd BufNewFile,BufReadPost *.jade set filetype=pug
|
autocmd BufNewFile,BufReadPost *.jade set filetype=pug
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/puppet.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
|
||||||
|
|
||||||
au! BufRead,BufNewFile *.pp setfiletype puppet
|
au! BufRead,BufNewFile *.pp setfiletype puppet
|
||||||
au! BufRead,BufNewFile Puppetfile setfiletype ruby
|
au! BufRead,BufNewFile Puppetfile setfiletype ruby
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/purescript.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'purescript') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'purescript') == -1
|
||||||
|
|
||||||
au BufNewFile,BufRead *.purs setf purescript
|
au BufNewFile,BufRead *.purs setf purescript
|
||||||
au FileType purescript let &l:commentstring='{--%s--}'
|
au FileType purescript let &l:commentstring='{--%s--}'
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/qml.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
|
||||||
|
|
||||||
autocmd BufRead,BufNewFile *.qml setfiletype qml
|
autocmd BufRead,BufNewFile *.qml setfiletype qml
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/ruby.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
||||||
|
|
||||||
|
" Officially distributed filetypes
|
||||||
|
|
||||||
|
" Support functions {{{
|
||||||
function! s:setf(filetype) abort
|
function! s:setf(filetype) abort
|
||||||
if &filetype !=# a:filetype
|
if &filetype !=# a:filetype
|
||||||
let &filetype = a:filetype
|
let &filetype = a:filetype
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
au BufNewFile,BufRead *.rb,*.rbw,*.gemspec call s:setf('ruby')
|
|
||||||
au BufNewFile,BufRead *.builder,*.rxml,*.rjs,*.ruby call s:setf('ruby')
|
func! s:StarSetf(ft)
|
||||||
au BufNewFile,BufRead [rR]akefile,*.rake call s:setf('ruby')
|
if expand("<amatch>") !~ g:ft_ignore_pat
|
||||||
au BufNewFile,BufRead [rR]antfile,*.rant call s:setf('ruby')
|
exe 'setf ' . a:ft
|
||||||
au BufNewFile,BufRead .irbrc,irbrc call s:setf('ruby')
|
endif
|
||||||
au BufNewFile,BufRead .pryrc call s:setf('ruby')
|
endfunc
|
||||||
au BufNewFile,BufRead *.ru call s:setf('ruby')
|
" }}}
|
||||||
au BufNewFile,BufRead Capfile,*.cap call s:setf('ruby')
|
|
||||||
au BufNewFile,BufRead Gemfile call s:setf('ruby')
|
" HTML with Ruby - eRuby
|
||||||
au BufNewFile,BufRead Guardfile,.Guardfile call s:setf('ruby')
|
au BufNewFile,BufRead *.erb,*.rhtml call s:setf('eruby')
|
||||||
|
|
||||||
|
" Interactive Ruby shell
|
||||||
|
au BufNewFile,BufRead .irbrc,irbrc call s:setf('ruby')
|
||||||
|
|
||||||
|
" Ruby
|
||||||
|
au BufNewFile,BufRead *.rb,*.rbw,*.gemspec call s:setf('ruby')
|
||||||
|
|
||||||
|
" Rackup
|
||||||
|
au BufNewFile,BufRead *.ru call s:setf('ruby')
|
||||||
|
|
||||||
|
" Bundler
|
||||||
|
au BufNewFile,BufRead Gemfile call s:setf('ruby')
|
||||||
|
|
||||||
|
" Ruby on Rails
|
||||||
|
au BufNewFile,BufRead *.builder,*.rxml,*.rjs,*.ruby call s:setf('ruby')
|
||||||
|
|
||||||
|
" Rakefile
|
||||||
|
au BufNewFile,BufRead [rR]akefile,*.rake call s:setf('ruby')
|
||||||
|
au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby')
|
||||||
|
|
||||||
|
" TODO: does anyone still use Rantfiles? Remove for Vim 8?
|
||||||
|
" Rantfile
|
||||||
|
au BufNewFile,BufRead [rR]antfile,*.rant call s:setf('ruby')
|
||||||
|
|
||||||
|
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
" ftdetect/ruby_extra.vim
|
||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
||||||
|
|
||||||
|
" All other filetypes
|
||||||
|
|
||||||
|
" Support functions {{{
|
||||||
|
function! s:setf(filetype) abort
|
||||||
|
if &filetype !=# a:filetype
|
||||||
|
let &filetype = a:filetype
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
" }}}
|
||||||
|
|
||||||
|
" Appraisal
|
||||||
|
au BufNewFile,BufRead Appraisals call s:setf('ruby')
|
||||||
|
|
||||||
|
" Autotest
|
||||||
|
au BufNewFile,BufRead .autotest call s:setf('ruby')
|
||||||
|
|
||||||
|
" Buildr Buildfile
|
||||||
|
au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby')
|
||||||
|
|
||||||
|
" Capistrano
|
||||||
|
au BufNewFile,BufRead Capfile,*.cap call s:setf('ruby')
|
||||||
|
|
||||||
|
" Chef
|
||||||
au BufNewFile,BufRead Cheffile call s:setf('ruby')
|
au BufNewFile,BufRead Cheffile call s:setf('ruby')
|
||||||
au BufNewFile,BufRead Berksfile call s:setf('ruby')
|
au BufNewFile,BufRead Berksfile call s:setf('ruby')
|
||||||
au BufNewFile,BufRead [vV]agrantfile call s:setf('ruby')
|
|
||||||
au BufNewFile,BufRead .autotest call s:setf('ruby')
|
" CocoaPods
|
||||||
au BufNewFile,BufRead *.erb,*.rhtml call s:setf('eruby')
|
|
||||||
au BufNewFile,BufRead [tT]horfile,*.thor call s:setf('ruby')
|
|
||||||
au BufNewFile,BufRead *.rabl call s:setf('ruby')
|
|
||||||
au BufNewFile,BufRead *.jbuilder call s:setf('ruby')
|
|
||||||
au BufNewFile,BufRead Puppetfile call s:setf('ruby')
|
|
||||||
au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby')
|
|
||||||
au BufNewFile,BufRead Appraisals call s:setf('ruby')
|
|
||||||
au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
|
au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
|
||||||
|
|
||||||
|
" Guard
|
||||||
|
au BufNewFile,BufRead Guardfile,.Guardfile call s:setf('ruby')
|
||||||
|
|
||||||
|
" Jbuilder
|
||||||
|
au BufNewFile,BufRead *.jbuilder call s:setf('ruby')
|
||||||
|
|
||||||
|
" Kitchen Sink
|
||||||
|
au BufNewFile,BufRead KitchenSink call s:setf('ruby')
|
||||||
|
|
||||||
|
" Opal
|
||||||
|
au BufNewFile,BufRead *.opal call s:setf('ruby')
|
||||||
|
|
||||||
|
" Pry config
|
||||||
|
au BufNewFile,BufRead .pryrc call s:setf('ruby')
|
||||||
|
|
||||||
|
" Puppet librarian
|
||||||
|
au BufNewFile,BufRead Puppetfile call s:setf('ruby')
|
||||||
|
|
||||||
|
" Rabl
|
||||||
|
au BufNewFile,BufRead *.rabl call s:setf('ruby')
|
||||||
|
|
||||||
|
" Routefile
|
||||||
au BufNewFile,BufRead [rR]outefile call s:setf('ruby')
|
au BufNewFile,BufRead [rR]outefile call s:setf('ruby')
|
||||||
au BufNewFile,BufRead .simplecov set filetype=ruby
|
|
||||||
|
" SimpleCov
|
||||||
|
au BufNewFile,BufRead .simplecov call s:setf('ruby')
|
||||||
|
|
||||||
|
" Thor
|
||||||
|
au BufNewFile,BufRead [tT]horfile,*.thor call s:setf('ruby')
|
||||||
|
|
||||||
|
" Vagrant
|
||||||
|
au BufNewFile,BufRead [vV]agrantfile call s:setf('ruby')
|
||||||
|
|
||||||
|
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/rust.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||||
|
|
||||||
au BufRead,BufNewFile *.rs set filetype=rust
|
au BufRead,BufNewFile *.rs set filetype=rust
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/sbt.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sbt') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sbt') == -1
|
||||||
|
|
||||||
|
" Vim detect file
|
||||||
|
" Language: sbt
|
||||||
|
" Maintainer: Derek Wyatt <derek@{myfirstname}{mylastname}.org>
|
||||||
|
" Last Change: 2012 Jan 19
|
||||||
|
|
||||||
au BufRead,BufNewFile *.sbt set filetype=sbt.scala
|
au BufRead,BufNewFile *.sbt set filetype=sbt.scala
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/scala.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scala') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scala') == -1
|
||||||
|
|
||||||
fun! s:DetectScala()
|
fun! s:DetectScala()
|
||||||
@@ -423,23 +840,39 @@ fun! s:DetectScala()
|
|||||||
set filetype=scala
|
set filetype=scala
|
||||||
endif
|
endif
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
au BufRead,BufNewFile *.scala set filetype=scala
|
au BufRead,BufNewFile *.scala set filetype=scala
|
||||||
au BufRead,BufNewFile * call s:DetectScala()
|
au BufRead,BufNewFile * call s:DetectScala()
|
||||||
|
|
||||||
|
" Install vim-sbt for additional syntax highlighting.
|
||||||
au BufRead,BufNewFile *.sbt setfiletype sbt.scala
|
au BufRead,BufNewFile *.sbt setfiletype sbt.scala
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/slim.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.slim set filetype=slim
|
autocmd BufNewFile,BufRead *.slim setf slim
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/solidity.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'solidity') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'solidity') == -1
|
||||||
|
|
||||||
au BufNewFile,BufRead *.sol setf solidity
|
au BufNewFile,BufRead *.sol setf solidity
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/stylus.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'stylus') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'stylus') == -1
|
||||||
|
|
||||||
|
" Stylus
|
||||||
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
|
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
|
||||||
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
|
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/swift.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.swift set filetype=swift
|
autocmd BufNewFile,BufRead *.swift set filetype=swift
|
||||||
@@ -448,12 +881,16 @@ function! s:Swift()
|
|||||||
if !empty(&filetype)
|
if !empty(&filetype)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let line = getline(1)
|
let line = getline(1)
|
||||||
if line =~ "^#!.*swift"
|
if line =~ "^#!.*swift"
|
||||||
setfiletype swift
|
setfiletype swift
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/systemd.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'systemd') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'systemd') == -1
|
||||||
|
|
||||||
au BufNewFile,BufRead *.automount set filetype=systemd
|
au BufNewFile,BufRead *.automount set filetype=systemd
|
||||||
@@ -464,39 +901,74 @@ au BufNewFile,BufRead *.socket set filetype=systemd
|
|||||||
au BufNewFile,BufRead *.swap set filetype=systemd
|
au BufNewFile,BufRead *.swap set filetype=systemd
|
||||||
au BufNewFile,BufRead *.target set filetype=systemd
|
au BufNewFile,BufRead *.target set filetype=systemd
|
||||||
au BufNewFile,BufRead *.timer set filetype=systemd
|
au BufNewFile,BufRead *.timer set filetype=systemd
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/textile.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'textile') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'textile') == -1
|
||||||
|
|
||||||
|
" textile.vim
|
||||||
|
"
|
||||||
|
" Tim Harper (tim.theenchanter.com)
|
||||||
|
|
||||||
|
" Force filetype to be textile even if already set
|
||||||
|
" This will override the system ftplugin/changelog
|
||||||
|
" set on some distros
|
||||||
au BufRead,BufNewFile *.textile set filetype=textile
|
au BufRead,BufNewFile *.textile set filetype=textile
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/thrift.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'thrift') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'thrift') == -1
|
||||||
|
|
||||||
au BufNewFile,BufRead *.thrift setlocal filetype=thrift
|
au BufNewFile,BufRead *.thrift setlocal filetype=thrift
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/tmux.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal filetype=tmux
|
autocmd BufNewFile,BufRead {.,}tmux*.conf* setfiletype tmux
|
||||||
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal commentstring=#\ %s
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/toml.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.toml set filetype=toml
|
autocmd BufNewFile,BufRead *.toml set filetype=toml
|
||||||
|
|
||||||
|
" Rust uses Cargo.toml and Cargo.lock (both are toml files).
|
||||||
autocmd BufNewFile,BufRead Cargo.lock set filetype=toml
|
autocmd BufNewFile,BufRead Cargo.lock set filetype=toml
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/typescript.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.ts,*.tsx setlocal filetype=typescript
|
autocmd BufNewFile,BufRead *.ts,*.tsx setlocal filetype=typescript
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/vala.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1
|
||||||
|
|
||||||
autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
|
autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
|
||||||
au BufRead,BufNewFile *.vala,*.vapi setfiletype vala
|
au BufRead,BufNewFile *.vala,*.vapi setfiletype vala
|
||||||
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/vcl.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vcl') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vcl') == -1
|
||||||
|
|
||||||
au BufRead,BufNewFile *.vcl set filetype=vcl
|
au BufRead,BufNewFile *.vcl set filetype=vcl
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" ftdetect/velocity.vim
|
||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vm') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vm') == -1
|
||||||
|
|
||||||
au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity
|
au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,26 @@ endif
|
|||||||
runtime! ftplugin/html.vim
|
runtime! ftplugin/html.vim
|
||||||
let b:did_ftplugin = 1
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
setlocal iskeyword+=@-@
|
setlocal suffixesadd=.blade.php,.php
|
||||||
|
setlocal includeexpr=substitute(v:fname,'\\.','/','g')
|
||||||
|
setlocal path+=resources/views;
|
||||||
|
setlocal include=\\w\\@<!@\\%(include\\\|extends\\)
|
||||||
|
setlocal define=\\w\\@<!@\\%(yield\\\|stack\\)
|
||||||
|
|
||||||
|
setlocal commentstring={{--%s--}}
|
||||||
|
setlocal comments+=s:{{--,m:\ \ \ \ ,e:--}}
|
||||||
|
|
||||||
|
if exists('loaded_matchit') && exists('b:match_words')
|
||||||
|
" Append to html matchit words
|
||||||
|
let b:match_words .= ',' .
|
||||||
|
\ '@\%(section\|if\|unless\|foreach\|forelse\|for\|while\|push\|can\|cannot\|hasSection\|php\|verbatim\)\>' .
|
||||||
|
\ ':' .
|
||||||
|
\ '@\%(else\|elseif\|empty\|break\|continue\|elsecan\|elsecannot\)\>' .
|
||||||
|
\ ':' .
|
||||||
|
\ '@\%(end\w\+\|stop\|show\|append\|overwrite\)' .
|
||||||
|
\ ',{:},\[:\],(:)'
|
||||||
|
let b:match_skip = 'synIDattr(synID(line("."), col("."), 0), "name") !=# "bladeKeyword"'
|
||||||
|
let b:match_ignorecase = 0
|
||||||
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
|
||||||
|
|
||||||
" Vim filetype plugin file
|
" Vim filetype plugin file
|
||||||
" Language: Clojure
|
" Language: Clojure
|
||||||
" Author: Meikel Brandmeyer <mb@kotka.de>
|
" Author: Meikel Brandmeyer <mb@kotka.de>
|
||||||
"
|
"
|
||||||
" Maintainer: Sung Pae <self@sungpae.com>
|
" Maintainer: Sung Pae <self@sungpae.com>
|
||||||
" URL: https://github.com/guns/vim-clojure-static
|
" URL: https://github.com/guns/vim-clojure-static
|
||||||
" License: Same as Vim
|
" License: Same as Vim
|
||||||
" Last Change: %%RELEASE_DATE%%
|
" Last Change: %%RELEASE_DATE%%
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
@@ -84,9 +84,9 @@ endif
|
|||||||
" Win32 can filter files in the browse dialog
|
" Win32 can filter files in the browse dialog
|
||||||
if has("gui_win32") && !exists("b:browsefilter")
|
if has("gui_win32") && !exists("b:browsefilter")
|
||||||
let b:browsefilter = "Clojure Source Files (*.clj)\t*.clj\n" .
|
let b:browsefilter = "Clojure Source Files (*.clj)\t*.clj\n" .
|
||||||
\ "ClojureScript Source Files (*.cljs)\t*.cljs\n" .
|
\ "ClojureScript Source Files (*.cljs)\t*.cljs\n" .
|
||||||
\ "Java Source Files (*.java)\t*.java\n" .
|
\ "Java Source Files (*.java)\t*.java\n" .
|
||||||
\ "All Files (*.*)\t*.*\n"
|
\ "All Files (*.*)\t*.*\n"
|
||||||
let b:undo_ftplugin .= ' | unlet! b:browsefilter'
|
let b:undo_ftplugin .= ' | unlet! b:browsefilter'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ call coffee#CoffeeSetUpVariables()
|
|||||||
setlocal formatoptions-=t formatoptions+=croql
|
setlocal formatoptions-=t formatoptions+=croql
|
||||||
setlocal comments=:# commentstring=#\ %s
|
setlocal comments=:# commentstring=#\ %s
|
||||||
setlocal omnifunc=javascriptcomplete#CompleteJS
|
setlocal omnifunc=javascriptcomplete#CompleteJS
|
||||||
setlocal suffixesadd+=coffee
|
setlocal suffixesadd+=.coffee
|
||||||
|
|
||||||
" Create custom augroups.
|
" Create custom augroups.
|
||||||
augroup CoffeeBufUpdate | augroup END
|
augroup CoffeeBufUpdate | augroup END
|
||||||
|
|||||||
@@ -40,6 +40,30 @@ setlocal errorformat=
|
|||||||
\%C%p^,
|
\%C%p^,
|
||||||
\%-C%.%#
|
\%-C%.%#
|
||||||
|
|
||||||
|
let g:crystal_compiler_command = get(g:, 'crystal_compiler_command', 'crystal')
|
||||||
|
let g:crystal_auto_format = get(g:, 'crystal_auto_format', 0)
|
||||||
|
|
||||||
|
command! -buffer -nargs=* CrystalImpl echo crystal_lang#impl(expand('%'), getpos('.'), <q-args>).output
|
||||||
|
command! -buffer -nargs=0 CrystalDef call crystal_lang#jump_to_definition(expand('%'), getpos('.'))
|
||||||
|
command! -buffer -nargs=* CrystalContext echo crystal_lang#context(expand('%'), getpos('.'), <q-args>).output
|
||||||
|
command! -buffer -nargs=* CrystalHierarchy echo crystal_lang#type_hierarchy(expand('%'), <q-args>)
|
||||||
|
command! -buffer -nargs=? CrystalSpecSwitch call crystal_lang#switch_spec_file(<f-args>)
|
||||||
|
command! -buffer -nargs=? CrystalSpecRunAll call crystal_lang#run_all_spec(<f-args>)
|
||||||
|
command! -buffer -nargs=? CrystalSpecRunCurrent call crystal_lang#run_current_spec(<f-args>)
|
||||||
|
command! -buffer -nargs=* -bar CrystalFormat call crystal_lang#format(<q-args>)
|
||||||
|
|
||||||
|
nnoremap <Plug>(crystal-jump-to-definition) :<C-u>CrystalDef<CR>
|
||||||
|
nnoremap <Plug>(crystal-show-context) :<C-u>CrystalContext<CR>
|
||||||
|
nnoremap <Plug>(crystal-spec-switch) :<C-u>CrystalSpecSwitch<CR>
|
||||||
|
nnoremap <Plug>(crystal-spec-run-all) :<C-u>CrystalSpecRunAll<CR>
|
||||||
|
nnoremap <Plug>(crystal-spec-run-current) :<C-u>CrystalSpecRunCurrent<CR>
|
||||||
|
nnoremap <Plug>(crystal-format) :<C-u>CrystalFormat<CR>
|
||||||
|
|
||||||
|
augroup plugin-ft-crystal
|
||||||
|
autocmd!
|
||||||
|
autocmd BufWritePre <buffer> if g:crystal_auto_format | CrystalFormat | endif
|
||||||
|
augroup END
|
||||||
|
|
||||||
if get(g:, 'crystal_define_mappings', 1)
|
if get(g:, 'crystal_define_mappings', 1)
|
||||||
nmap <buffer>gd <Plug>(crystal-jump-to-definition)
|
nmap <buffer>gd <Plug>(crystal-jump-to-definition)
|
||||||
nmap <buffer>gc <Plug>(crystal-show-context)
|
nmap <buffer>gc <Plug>(crystal-show-context)
|
||||||
|
|||||||
@@ -56,6 +56,6 @@ let &l:path =
|
|||||||
setlocal includeexpr=GetElixirFilename(v:fname)
|
setlocal includeexpr=GetElixirFilename(v:fname)
|
||||||
setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl
|
setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl
|
||||||
|
|
||||||
setlocal formatoptions-=t formatoptions+=croqlj
|
silent! setlocal formatoptions-=t formatoptions+=croqlj
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
|
||||||
|
|
||||||
" Language: ember-script
|
" Language: ember-script
|
||||||
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
|
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
|
||||||
" URL: http://github.com/heartsentwined/vim-ember-script
|
" URL: http://github.com/yalesov/vim-ember-script
|
||||||
" Version: 1.0.1
|
" Version: 1.0.4
|
||||||
" Last Change: 2013 Apr 17
|
" Last Change: 2016 Jul 6
|
||||||
" License: GPL-3.0
|
" License: ISC
|
||||||
|
|
||||||
setlocal tabstop=2
|
setlocal tabstop=2
|
||||||
setlocal softtabstop=2
|
setlocal softtabstop=2
|
||||||
@@ -14,7 +14,11 @@ setlocal smarttab
|
|||||||
setlocal expandtab
|
setlocal expandtab
|
||||||
setlocal smartindent
|
setlocal smartindent
|
||||||
|
|
||||||
setlocal formatoptions-=t formatoptions+=croqlj
|
if v:version < 703
|
||||||
|
setlocal formatoptions-=t formatoptions+=croql
|
||||||
|
else
|
||||||
|
setlocal formatoptions-=t formatoptions+=croqlj
|
||||||
|
endif
|
||||||
setlocal comments=:#
|
setlocal comments=:#
|
||||||
setlocal commentstring=#\ %s
|
setlocal commentstring=#\ %s
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
||||||
|
|
||||||
" Language: emblem
|
" Language: emblem
|
||||||
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
|
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
|
||||||
" URL: http://github.com/heartsentwined/vim-emblem
|
" URL: http://github.com/yalesov/vim-emblem
|
||||||
" Version: 1.2.0
|
" Version: 2.0.1
|
||||||
" Last Change: 2013 Apr 22
|
" Last Change: 2016 Jul 6
|
||||||
" License: GPL-3.0
|
" License: ISC
|
||||||
|
|
||||||
setlocal tabstop=2
|
setlocal tabstop=2
|
||||||
setlocal softtabstop=2
|
setlocal softtabstop=2
|
||||||
|
|||||||
8
ftplugin/javascript.vim
Normal file
8
ftplugin/javascript.vim
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||||
|
|
||||||
|
setlocal suffixesadd+=.js
|
||||||
|
if (v:version < 704 || (v:version == 704 && !has('patch002'))) && exists('®expengine')
|
||||||
|
set re=1
|
||||||
|
end
|
||||||
|
|
||||||
|
endif
|
||||||
42
ftplugin/json.vim
Normal file
42
ftplugin/json.vim
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json') == -1
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: JSON
|
||||||
|
" Maintainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
|
||||||
|
" Last Change: 2014-05-20 added warning toggle
|
||||||
|
|
||||||
|
"uncomment to enable folding of `{...}` and `[...]` blocks
|
||||||
|
"setlocal foldmethod=syntax
|
||||||
|
|
||||||
|
"conceal by default
|
||||||
|
if !exists("g:vim_json_syntax_conceal")
|
||||||
|
let g:vim_json_syntax_conceal = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
"have warnings by default
|
||||||
|
if !exists("g:vim_json_warnings")
|
||||||
|
let g:vim_json_warnings = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
"set concealcursor blank by default
|
||||||
|
"this should turn off the concealing in the current line (where the cursor is at),
|
||||||
|
"on all modes (normal, visual, insert)
|
||||||
|
if !exists("g:vim_json_syntax_concealcursor")
|
||||||
|
let g:vim_json_syntax_concealcursor = ""
|
||||||
|
end
|
||||||
|
|
||||||
|
if has('conceal')
|
||||||
|
if (g:vim_json_syntax_conceal == 1)
|
||||||
|
"level 2 means concealed text gets completely hidden unless a
|
||||||
|
"replacement is defined (none is defined by us)
|
||||||
|
setlocal conceallevel=2
|
||||||
|
let &l:concealcursor = g:vim_json_syntax_concealcursor
|
||||||
|
else
|
||||||
|
"level 0 means text is shown normally = no concealing
|
||||||
|
setlocal conceallevel=0
|
||||||
|
endif
|
||||||
|
"maybe g:vim_json_syntax_conceal could be settable to 0,1,2 to map
|
||||||
|
"directly to vim's conceallevels? unsure if anyone cares
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
208
ftplugin/ls.vim
Normal file
208
ftplugin/ls.vim
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'livescript') == -1
|
||||||
|
|
||||||
|
" Language: LiveScript
|
||||||
|
" Maintainer: George Zahariev
|
||||||
|
" URL: http://github.com/gkz/vim-ls
|
||||||
|
" License: WTFPL
|
||||||
|
"
|
||||||
|
if exists("b:did_ftplugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
setlocal formatoptions-=t formatoptions+=croql
|
||||||
|
setlocal comments=:#
|
||||||
|
setlocal commentstring=#\ %s
|
||||||
|
setlocal omnifunc=javascriptcomplete#CompleteJS
|
||||||
|
|
||||||
|
" Enable LiveScriptMake if it won't overwrite any settings.
|
||||||
|
if !len(&l:makeprg)
|
||||||
|
compiler ls
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Check here too in case the compiler above isn't loaded.
|
||||||
|
if !exists('livescript_compiler')
|
||||||
|
let livescript_compiler = 'lsc'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Reset the LiveScriptCompile variables for the current buffer.
|
||||||
|
function! s:LiveScriptCompileResetVars()
|
||||||
|
" Compiled output buffer
|
||||||
|
let b:livescript_compile_buf = -1
|
||||||
|
let b:livescript_compile_pos = []
|
||||||
|
|
||||||
|
" If LiveScriptCompile is watching a buffer
|
||||||
|
let b:livescript_compile_watch = 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Clean things up in the source buffer.
|
||||||
|
function! s:LiveScriptCompileClose()
|
||||||
|
exec bufwinnr(b:livescript_compile_src_buf) 'wincmd w'
|
||||||
|
silent! autocmd! LiveScriptCompileAuWatch * <buffer>
|
||||||
|
call s:LiveScriptCompileResetVars()
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Update the LiveScriptCompile buffer given some input lines.
|
||||||
|
function! s:LiveScriptCompileUpdate(startline, endline)
|
||||||
|
let input = join(getline(a:startline, a:endline), "\n")
|
||||||
|
|
||||||
|
" Move to the LiveScriptCompile buffer.
|
||||||
|
exec bufwinnr(b:livescript_compile_buf) 'wincmd w'
|
||||||
|
|
||||||
|
" LiveScript doesn't like empty input.
|
||||||
|
if !len(input)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Compile input.
|
||||||
|
let output = system(g:livescript_compiler . ' -scb 2>&1', input)
|
||||||
|
|
||||||
|
" Be sure we're in the LiveScriptCompile buffer before overwriting.
|
||||||
|
if exists('b:livescript_compile_buf')
|
||||||
|
echoerr 'LiveScriptCompile buffers are messed up'
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Replace buffer contents with new output and delete the last empty line.
|
||||||
|
setlocal modifiable
|
||||||
|
exec '% delete _'
|
||||||
|
put! =output
|
||||||
|
exec '$ delete _'
|
||||||
|
setlocal nomodifiable
|
||||||
|
|
||||||
|
" Highlight as JavaScript if there is no compile error.
|
||||||
|
if v:shell_error
|
||||||
|
setlocal filetype=
|
||||||
|
else
|
||||||
|
setlocal filetype=javascript
|
||||||
|
endif
|
||||||
|
|
||||||
|
call setpos('.', b:livescript_compile_pos)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Update the LiveScriptCompile buffer with the whole source buffer.
|
||||||
|
function! s:LiveScriptCompileWatchUpdate()
|
||||||
|
call s:LiveScriptCompileUpdate(1, '$')
|
||||||
|
exec bufwinnr(b:livescript_compile_src_buf) 'wincmd w'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Peek at compiled LiveScript in a scratch buffer. We handle ranges like this
|
||||||
|
" to prevent the cursor from being moved (and its position saved) before the
|
||||||
|
" function is called.
|
||||||
|
function! s:LiveScriptCompile(startline, endline, args)
|
||||||
|
if !executable(g:livescript_compiler)
|
||||||
|
echoerr "Can't find LiveScript compiler `" . g:livescript_compiler . "`"
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If in the LiveScriptCompile buffer, switch back to the source buffer and
|
||||||
|
" continue.
|
||||||
|
if !exists('b:livescript_compile_buf')
|
||||||
|
exec bufwinnr(b:livescript_compile_src_buf) 'wincmd w'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Parse arguments.
|
||||||
|
let watch = a:args =~ '\<watch\>'
|
||||||
|
let unwatch = a:args =~ '\<unwatch\>'
|
||||||
|
let size = str2nr(matchstr(a:args, '\<\d\+\>'))
|
||||||
|
|
||||||
|
" Determine default split direction.
|
||||||
|
if exists('g:livescript_compile_vert')
|
||||||
|
let vert = 1
|
||||||
|
else
|
||||||
|
let vert = a:args =~ '\<vert\%[ical]\>'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Remove any watch listeners.
|
||||||
|
silent! autocmd! LiveScriptCompileAuWatch * <buffer>
|
||||||
|
|
||||||
|
" If just unwatching, don't compile.
|
||||||
|
if unwatch
|
||||||
|
let b:livescript_compile_watch = 0
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
if watch
|
||||||
|
let b:livescript_compile_watch = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Build the LiveScriptCompile buffer if it doesn't exist.
|
||||||
|
if bufwinnr(b:livescript_compile_buf) == -1
|
||||||
|
let src_buf = bufnr('%')
|
||||||
|
let src_win = bufwinnr(src_buf)
|
||||||
|
|
||||||
|
" Create the new window and resize it.
|
||||||
|
if vert
|
||||||
|
let width = size ? size : winwidth(src_win) / 2
|
||||||
|
|
||||||
|
belowright vertical new
|
||||||
|
exec 'vertical resize' width
|
||||||
|
else
|
||||||
|
" Try to guess the compiled output's height.
|
||||||
|
let height = size ? size : min([winheight(src_win) / 2,
|
||||||
|
\ a:endline - a:startline + 5])
|
||||||
|
|
||||||
|
belowright new
|
||||||
|
exec 'resize' height
|
||||||
|
endif
|
||||||
|
|
||||||
|
" We're now in the scratch buffer, so set it up.
|
||||||
|
setlocal bufhidden=wipe buftype=nofile
|
||||||
|
setlocal nobuflisted nomodifiable noswapfile nowrap
|
||||||
|
|
||||||
|
autocmd BufWipeout <buffer> call s:LiveScriptCompileClose()
|
||||||
|
" Save the cursor when leaving the LiveScriptCompile buffer.
|
||||||
|
autocmd BufLeave <buffer> let b:livescript_compile_pos = getpos('.')
|
||||||
|
|
||||||
|
nnoremap <buffer> <silent> q :hide<CR>
|
||||||
|
|
||||||
|
let b:livescript_compile_src_buf = src_buf
|
||||||
|
let buf = bufnr('%')
|
||||||
|
|
||||||
|
" Go back to the source buffer and set it up.
|
||||||
|
exec bufwinnr(b:livescript_compile_src_buf) 'wincmd w'
|
||||||
|
let b:livescript_compile_buf = buf
|
||||||
|
endif
|
||||||
|
|
||||||
|
if b:livescript_compile_watch
|
||||||
|
call s:LiveScriptCompileWatchUpdate()
|
||||||
|
|
||||||
|
augroup LiveScriptCompileAuWatch
|
||||||
|
autocmd InsertLeave <buffer> call s:LiveScriptCompileWatchUpdate()
|
||||||
|
autocmd BufWritePost <buffer> call s:LiveScriptCompileWatchUpdate()
|
||||||
|
augroup END
|
||||||
|
else
|
||||||
|
call s:LiveScriptCompileUpdate(a:startline, a:endline)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Complete arguments for the LiveScriptCompile command.
|
||||||
|
function! s:LiveScriptCompileComplete(arg, cmdline, cursor)
|
||||||
|
let args = ['unwatch', 'vertical', 'watch']
|
||||||
|
|
||||||
|
if !len(a:arg)
|
||||||
|
return args
|
||||||
|
endif
|
||||||
|
|
||||||
|
let match = '^' . a:arg
|
||||||
|
|
||||||
|
for arg in args
|
||||||
|
if arg =~ match
|
||||||
|
return [arg]
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Don't overwrite the CoffeeCompile variables.
|
||||||
|
if !exists("s:livescript_compile_buf")
|
||||||
|
call s:LiveScriptCompileResetVars()
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Peek at compiled LiveScript.
|
||||||
|
command! -range=% -bar -nargs=* -complete=customlist,s:LiveScriptCompileComplete
|
||||||
|
\ LiveScriptCompile call s:LiveScriptCompile(<line1>, <line2>, <q-args>)
|
||||||
|
" Run some LiveScript.
|
||||||
|
command! -range=% -bar LiveScriptRun <line1>,<line2>:w !lsc -sp
|
||||||
|
|
||||||
|
endif
|
||||||
15
ftplugin/mako.vim
Normal file
15
ftplugin/mako.vim
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mako') == -1
|
||||||
|
|
||||||
|
" Vim filetype plugin file
|
||||||
|
" Language: Mako
|
||||||
|
" Maintainer: Randy Stauner <randy@magnificent-tears.com>
|
||||||
|
" Last Change: 2014-02-07
|
||||||
|
" Version: 0.1
|
||||||
|
|
||||||
|
if exists("b:did_ftplugin") | finish | endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
setlocal comments=:##
|
||||||
|
setlocal commentstring=##%s
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
|
||||||
|
|
||||||
" Vim filetype plugin
|
|
||||||
" Language: Markdown
|
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
|
||||||
" Last Change: 2013 May 30
|
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
|
|
||||||
|
|
||||||
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=<!--%s-->
|
|
||||||
setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
|
|
||||||
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:
|
|
||||||
|
|
||||||
if exists('b:undo_ftplugin')
|
|
||||||
let b:undo_ftplugin .= "|setl cms< com< fo< flp<"
|
|
||||||
else
|
|
||||||
let b:undo_ftplugin = "setl cms< com< fo< flp<"
|
|
||||||
endif
|
|
||||||
|
|
||||||
function! MarkdownFold()
|
|
||||||
let line = getline(v:lnum)
|
|
||||||
|
|
||||||
" Regular headers
|
|
||||||
let depth = match(line, '\(^#\+\)\@<=\( .*$\)\@=')
|
|
||||||
if depth > 0
|
|
||||||
return ">" . depth
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Setext style headings
|
|
||||||
let nextline = getline(v:lnum + 1)
|
|
||||||
if (line =~ '^.\+$') && (nextline =~ '^=\+$')
|
|
||||||
return ">1"
|
|
||||||
endif
|
|
||||||
|
|
||||||
if (line =~ '^.\+$') && (nextline =~ '^-\+$')
|
|
||||||
return ">2"
|
|
||||||
endif
|
|
||||||
|
|
||||||
return "="
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
if has("folding") && exists("g:markdown_folding")
|
|
||||||
setlocal foldexpr=MarkdownFold()
|
|
||||||
setlocal foldmethod=expr
|
|
||||||
let b:undo_ftplugin .= " foldexpr< foldmethod<"
|
|
||||||
endif
|
|
||||||
|
|
||||||
" vim:set sw=2:
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -77,20 +77,20 @@ function! s:query_path(root) abort
|
|||||||
let prefix = ''
|
let prefix = ''
|
||||||
endif
|
endif
|
||||||
if &shellxquote == "'"
|
if &shellxquote == "'"
|
||||||
let path_check = prefix.'ruby -e "' . code . '"'
|
let path_check = prefix.'ruby -e --disable-gems"' . code . '"'
|
||||||
else
|
else
|
||||||
let path_check = prefix."ruby -e '" . code . "'"
|
let path_check = prefix."ruby -e --disable-gems'" . code . "'"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let cd = haslocaldir() ? 'lcd' : 'cd'
|
let cd = haslocaldir() ? 'lcd' : 'cd'
|
||||||
let cwd = getcwd()
|
let cwd = fnameescape(getcwd())
|
||||||
try
|
try
|
||||||
exe cd fnameescape(a:root)
|
exe cd fnameescape(a:root)
|
||||||
let path = split(system(path_check),',')
|
let path = split(system(path_check),',')
|
||||||
exe cd fnameescape(cwd)
|
exe cd cwd
|
||||||
return path
|
return path
|
||||||
finally
|
finally
|
||||||
exe cd fnameescape(cwd)
|
exe cd cwd
|
||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
|||||||
\."| sil! exe 'unmap <buffer> [[' | sil! exe 'unmap <buffer> ]]' | sil! exe 'unmap <buffer> []' | sil! exe 'unmap <buffer> ]['"
|
\."| sil! exe 'unmap <buffer> [[' | sil! exe 'unmap <buffer> ]]' | sil! exe 'unmap <buffer> []' | sil! exe 'unmap <buffer> ]['"
|
||||||
\."| sil! exe 'unmap <buffer> [m' | sil! exe 'unmap <buffer> ]m' | sil! exe 'unmap <buffer> [M' | sil! exe 'unmap <buffer> ]M'"
|
\."| sil! exe 'unmap <buffer> [m' | sil! exe 'unmap <buffer> ]m' | sil! exe 'unmap <buffer> [M' | sil! exe 'unmap <buffer> ]M'"
|
||||||
|
|
||||||
if maparg('im','n') == ''
|
if maparg('im','x') == '' && maparg('im','o') == '' && maparg('am','x') == '' && maparg('am','o') == ''
|
||||||
onoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
|
onoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
|
||||||
onoremap <silent> <buffer> am :<C-U>call <SID>wrap_a('[m',']M')<CR>
|
onoremap <silent> <buffer> am :<C-U>call <SID>wrap_a('[m',']M')<CR>
|
||||||
xnoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
|
xnoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
|
||||||
@@ -196,7 +196,7 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
|||||||
\."| sil! exe 'xunmap <buffer> im' | sil! exe 'xunmap <buffer> am'"
|
\."| sil! exe 'xunmap <buffer> im' | sil! exe 'xunmap <buffer> am'"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if maparg('iM','n') == ''
|
if maparg('iM','x') == '' && maparg('iM','o') == '' && maparg('aM','x') == '' && maparg('aM','o') == ''
|
||||||
onoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>
|
onoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>
|
||||||
onoremap <silent> <buffer> aM :<C-U>call <SID>wrap_a('[[','][')<CR>
|
onoremap <silent> <buffer> aM :<C-U>call <SID>wrap_a('[[','][')<CR>
|
||||||
xnoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>
|
xnoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
|||||||
" Description: Vim syntax file for Rust
|
" Description: Vim syntax file for Rust
|
||||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||||
" Maintainer: Kevin Ballard <kevin@sb.org>
|
" Maintainer: Kevin Ballard <kevin@sb.org>
|
||||||
" Last Change: January 29, 2015
|
" Last Change: June 08, 2016
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
@@ -14,6 +14,9 @@ let b:did_ftplugin = 1
|
|||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
|
augroup rust.vim
|
||||||
|
autocmd!
|
||||||
|
|
||||||
" Variables {{{1
|
" Variables {{{1
|
||||||
|
|
||||||
" The rust source code at present seems to typically omit a leader on /*!
|
" The rust source code at present seems to typically omit a leader on /*!
|
||||||
@@ -56,7 +59,33 @@ if exists("g:loaded_delimitMate")
|
|||||||
if exists("b:delimitMate_excluded_regions")
|
if exists("b:delimitMate_excluded_regions")
|
||||||
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
|
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
|
||||||
endif
|
endif
|
||||||
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
|
|
||||||
|
let s:delimitMate_extra_excluded_regions = ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
|
||||||
|
|
||||||
|
" For this buffer, when delimitMate issues the `User delimitMate_map`
|
||||||
|
" event in the autocommand system, add the above-defined extra excluded
|
||||||
|
" regions to delimitMate's state, if they have not already been added.
|
||||||
|
autocmd User <buffer>
|
||||||
|
\ if expand('<afile>') ==# 'delimitMate_map' && match(
|
||||||
|
\ delimitMate#Get("excluded_regions"),
|
||||||
|
\ s:delimitMate_extra_excluded_regions) == -1
|
||||||
|
\| let b:delimitMate_excluded_regions =
|
||||||
|
\ delimitMate#Get("excluded_regions")
|
||||||
|
\ . s:delimitMate_extra_excluded_regions
|
||||||
|
\|endif
|
||||||
|
|
||||||
|
" For this buffer, when delimitMate issues the `User delimitMate_unmap`
|
||||||
|
" event in the autocommand system, delete the above-defined extra excluded
|
||||||
|
" regions from delimitMate's state (the deletion being idempotent and
|
||||||
|
" having no effect if the extra excluded regions are not present in the
|
||||||
|
" targeted part of delimitMate's state).
|
||||||
|
autocmd User <buffer>
|
||||||
|
\ if expand('<afile>') ==# 'delimitMate_unmap'
|
||||||
|
\| let b:delimitMate_excluded_regions = substitute(
|
||||||
|
\ delimitMate#Get("excluded_regions"),
|
||||||
|
\ '\C\V' . s:delimitMate_extra_excluded_regions,
|
||||||
|
\ '', 'g')
|
||||||
|
\|endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
|
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
|
||||||
@@ -161,10 +190,13 @@ let b:undo_ftplugin = "
|
|||||||
\|ounmap <buffer> ]]
|
\|ounmap <buffer> ]]
|
||||||
\|set matchpairs-=<:>
|
\|set matchpairs-=<:>
|
||||||
\|unlet b:match_skip
|
\|unlet b:match_skip
|
||||||
|
\|augroup! rust.vim
|
||||||
\"
|
\"
|
||||||
|
|
||||||
" }}}1
|
" }}}1
|
||||||
|
|
||||||
|
augroup END
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
let &cpo = s:save_cpo
|
||||||
unlet s:save_cpo
|
unlet s:save_cpo
|
||||||
|
|
||||||
|
|||||||
13
ftplugin/slim.vim
Normal file
13
ftplugin/slim.vim
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1
|
||||||
|
|
||||||
|
if exists("b:did_ftplugin")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_ftplugin = 1
|
||||||
|
|
||||||
|
let b:undo_ftplugin = "setl isk<"
|
||||||
|
|
||||||
|
setlocal iskeyword+=-
|
||||||
|
setlocal commentstring=/%s
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1
|
||||||
|
|
||||||
|
setlocal commentstring=#\ %s
|
||||||
|
|
||||||
endif
|
endif
|
||||||
@@ -16,7 +16,7 @@ setlocal formatoptions=cl
|
|||||||
|
|
||||||
let s:comment = '\v^\s*#' " # comment
|
let s:comment = '\v^\s*#' " # comment
|
||||||
let s:array_entry = '\v^\s*-\s' " - foo
|
let s:array_entry = '\v^\s*-\s' " - foo
|
||||||
let s:named_module_entry = '\v^\s*-\s*(name|hosts):\s*\S' " - name: 'do stuff'
|
let s:named_module_entry = '\v^\s*-\s*(name|hosts|role):\s*\S' " - name: 'do stuff'
|
||||||
let s:dictionary_entry = '\v^\s*[^:-]+:\s*$' " with_items:
|
let s:dictionary_entry = '\v^\s*[^:-]+:\s*$' " with_items:
|
||||||
let s:key_value = '\v^\s*[^:-]+:\s*\S' " apt: name=package
|
let s:key_value = '\v^\s*[^:-]+:\s*\S' " apt: name=package
|
||||||
let s:scalar_value = '\v:\s*[>|\|]\s*$' " shell: >
|
let s:scalar_value = '\v:\s*[>|\|]\s*$' " shell: >
|
||||||
|
|||||||
@@ -7,13 +7,29 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'blade') == -1
|
|||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
runtime! indent/html.vim
|
runtime! indent/html.vim
|
||||||
|
let s:htmlindent = &indentexpr
|
||||||
unlet! b:did_indent
|
unlet! b:did_indent
|
||||||
|
|
||||||
|
runtime! indent/php.vim
|
||||||
|
let s:phpindent = &indentexpr
|
||||||
|
unlet! b:did_indent
|
||||||
|
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
" Doesn't include 'foreach' and 'forelse' because these already get matched by 'for'.
|
||||||
|
let s:directives_start = 'if\|else\|unless\|for\|while\|empty\|push\|section\|can\|hasSection\|verbatim'
|
||||||
|
let s:directives_end = 'else\|end\|empty\|show\|stop\|append\|overwrite'
|
||||||
|
|
||||||
|
if exists('g:blade_custom_directives_pairs')
|
||||||
|
let s:directives_start .= '\|' . join(keys(g:blade_custom_directives_pairs), '\|')
|
||||||
|
let s:directives_end .= '\|' . join(values(g:blade_custom_directives_pairs), '\|')
|
||||||
|
endif
|
||||||
|
|
||||||
setlocal autoindent
|
setlocal autoindent
|
||||||
setlocal indentexpr=GetBladeIndent()
|
setlocal indentexpr=GetBladeIndent()
|
||||||
setlocal indentkeys=o,O,*<Return>,<>>,!^F,=@else,=@end,=@empty,=@show
|
exe "setlocal indentkeys=o,O,<>>,!^F,0=}},0=!!},=@" . substitute(s:directives_end, '\\|', ',=@', 'g')
|
||||||
|
|
||||||
" Only define the function once.
|
" Only define the function once.
|
||||||
if exists("*GetBladeIndent")
|
if exists("*GetBladeIndent")
|
||||||
@@ -29,27 +45,35 @@ function! GetBladeIndent()
|
|||||||
let line = substitute(substitute(getline(lnum), '\s\+$', '', ''), '^\s\+', '', '')
|
let line = substitute(substitute(getline(lnum), '\s\+$', '', ''), '^\s\+', '', '')
|
||||||
let cline = substitute(substitute(getline(v:lnum), '\s\+$', '', ''), '^\s\+', '', '')
|
let cline = substitute(substitute(getline(v:lnum), '\s\+$', '', ''), '^\s\+', '', '')
|
||||||
let indent = indent(lnum)
|
let indent = indent(lnum)
|
||||||
let cindent = indent(v:lnum)
|
if cline =~# '@\%(' . s:directives_end . '\)' ||
|
||||||
if cline =~# '@\%(else\|elseif\|empty\|end\|show\)'
|
\ cline =~# '\%(<?.*\)\@<!?>\|\%({{.*\)\@<!}}\|\%({!!.*\)\@<!!!}'
|
||||||
let indent = indent - &sw
|
let indent = indent - &sw
|
||||||
|
elseif line =~# '<?\%(.*?>\)\@!\|@php\%(\s*(\)\@!'
|
||||||
|
let indent = indent + &sw
|
||||||
else
|
else
|
||||||
if exists("*GetBladeIndentCustom")
|
if exists("*GetBladeIndentCustom")
|
||||||
let hindent = GetBladeIndentCustom()
|
let hindent = GetBladeIndentCustom()
|
||||||
|
" Don't use PHP indentation if line is a comment
|
||||||
|
elseif line !~# '^\s*\%(#\|//\)\|\*/\s*$' && (
|
||||||
|
\ searchpair('@include\%(If\)\?\s*(', '', ')', 'bWr') ||
|
||||||
|
\ searchpair('{!!', '', '!!}', 'bWr') ||
|
||||||
|
\ searchpair('{{', '', '}}', 'bWr') ||
|
||||||
|
\ searchpair('<?', '', '?>', 'bWr') ||
|
||||||
|
\ searchpair('@php\%(\s*(\)\@!', '', '@endphp', 'bWr') )
|
||||||
|
execute 'let hindent = ' . s:phpindent
|
||||||
else
|
else
|
||||||
let hindent = HtmlIndent()
|
execute 'let hindent = ' . s:htmlindent
|
||||||
endif
|
endif
|
||||||
if hindent > -1
|
if hindent > -1
|
||||||
let indent = hindent
|
let indent = hindent
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
let increase = indent + &sw
|
let increase = indent + &sw
|
||||||
if indent = indent(lnum)
|
|
||||||
let indent = cindent <= indent ? -1 : increase
|
|
||||||
endif
|
|
||||||
|
|
||||||
if line =~# '@\%(section\)\%(.*\s*@end\)\@!' && line !~# '@\%(section\)\s*([^,]*)'
|
if line =~# '@\%(section\)\%(.*@end\)\@!' && line !~# '@\%(section\)\s*([^,]*)'
|
||||||
return indent
|
return indent
|
||||||
elseif line =~# '@\%(if\|elseif\|else\|unless\|foreach\|forelse\|for\|while\|empty\|push\|section\|can\)\%(.*\s*@end\)\@!'
|
elseif line =~# '@\%(' . s:directives_start . '\)\%(.*@end\|.*@stop\)\@!' ||
|
||||||
|
\ line =~# '{{\%(.*}}\)\@!' || line =~# '{!!\%(.*!!}\)\@!'
|
||||||
return increase
|
return increase
|
||||||
else
|
else
|
||||||
return indent
|
return indent
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
|
||||||
|
|
||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: Clojure
|
" Language: Clojure
|
||||||
" Author: Meikel Brandmeyer <mb@kotka.de>
|
" Author: Meikel Brandmeyer <mb@kotka.de>
|
||||||
" URL: http://kotka.de/projects/clojure/vimclojure.html
|
" URL: http://kotka.de/projects/clojure/vimclojure.html
|
||||||
"
|
"
|
||||||
" Maintainer: Sung Pae <self@sungpae.com>
|
" Maintainer: Sung Pae <self@sungpae.com>
|
||||||
" URL: https://github.com/guns/vim-clojure-static
|
" URL: https://github.com/guns/vim-clojure-static
|
||||||
" License: Same as Vim
|
" License: Same as Vim
|
||||||
" Last Change: %%RELEASE_DATE%%
|
" Last Change: %%RELEASE_DATE%%
|
||||||
|
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
@@ -79,8 +79,8 @@ if exists("*searchpairpos")
|
|||||||
" patterns.
|
" patterns.
|
||||||
function! s:match_one(patterns, string)
|
function! s:match_one(patterns, string)
|
||||||
let list = type(a:patterns) == type([])
|
let list = type(a:patterns) == type([])
|
||||||
\ ? a:patterns
|
\ ? a:patterns
|
||||||
\ : map(split(a:patterns, ','), '"^" . v:val . "$"')
|
\ : map(split(a:patterns, ','), '"^" . v:val . "$"')
|
||||||
for pat in list
|
for pat in list
|
||||||
if a:string =~# pat | return 1 | endif
|
if a:string =~# pat | return 1 | endif
|
||||||
endfor
|
endfor
|
||||||
@@ -189,6 +189,16 @@ if exists("*searchpairpos")
|
|||||||
return val
|
return val
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Check if form is a reader conditional, that is, it is prefixed by #?
|
||||||
|
" or @#?
|
||||||
|
function! s:is_reader_conditional_special_case(position)
|
||||||
|
if getline(a:position[0])[a:position[1] - 3 : a:position[1] - 2] == "#?"
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Returns 1 for opening brackets, -1 for _anything else_.
|
" Returns 1 for opening brackets, -1 for _anything else_.
|
||||||
function! s:bracket_type(char)
|
function! s:bracket_type(char)
|
||||||
return stridx('([{', a:char) > -1 ? 1 : -1
|
return stridx('([{', a:char) > -1 ? 1 : -1
|
||||||
@@ -256,6 +266,10 @@ if exists("*searchpairpos")
|
|||||||
return [paren[0], paren[1] + &shiftwidth - 1]
|
return [paren[0], paren[1] + &shiftwidth - 1]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if s:is_reader_conditional_special_case(paren)
|
||||||
|
return paren
|
||||||
|
endif
|
||||||
|
|
||||||
" In case we are at the last character, we use the paren position.
|
" In case we are at the last character, we use the paren position.
|
||||||
if col("$") - 1 == paren[1]
|
if col("$") - 1 == paren[1]
|
||||||
return paren
|
return paren
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
|
||||||
|
|
||||||
" Language: ember-script
|
" Language: ember-script
|
||||||
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
|
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
|
||||||
" URL: http://github.com/heartsentwined/vim-ember-script
|
" URL: http://github.com/yalesov/vim-ember-script
|
||||||
" Version: 1.0.1
|
" Version: 1.0.4
|
||||||
" Last Change: 2013 Apr 17
|
" Last Change: 2016 Jul 6
|
||||||
" License: GPL-3.0
|
" License: ISC
|
||||||
|
|
||||||
if exists('b:did_indent')
|
if exists('b:did_indent')
|
||||||
finish
|
finish
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
||||||
|
|
||||||
" Language: emblem
|
" Language: emblem
|
||||||
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
|
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
|
||||||
" URL: http://github.com/heartsentwined/vim-emblem
|
" URL: http://github.com/yalesov/vim-emblem
|
||||||
" Version: 1.2.0
|
" Version: 2.0.1
|
||||||
" Last Change: 2013 Apr 22
|
" Last Change: 2016 Jul 6
|
||||||
" License: GPL-3.0
|
" License: ISC
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
|||||||
" - general line splits (line ends in an operator)
|
" - general line splits (line ends in an operator)
|
||||||
|
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
@@ -23,60 +23,60 @@ setlocal indentexpr=GoIndent(v:lnum)
|
|||||||
setlocal indentkeys+=<:>,0=},0=)
|
setlocal indentkeys+=<:>,0=},0=)
|
||||||
|
|
||||||
if exists("*GoIndent")
|
if exists("*GoIndent")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" use shiftwidth function only if it's available
|
" use shiftwidth function only if it's available
|
||||||
if exists('*shiftwidth')
|
if exists('*shiftwidth')
|
||||||
func s:sw()
|
func s:sw()
|
||||||
return shiftwidth()
|
return shiftwidth()
|
||||||
endfunc
|
endfunc
|
||||||
else
|
else
|
||||||
func s:sw()
|
func s:sw()
|
||||||
return &sw
|
return &sw
|
||||||
endfunc
|
endfunc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! GoIndent(lnum)
|
function! GoIndent(lnum)
|
||||||
let prevlnum = prevnonblank(a:lnum-1)
|
let prevlnum = prevnonblank(a:lnum-1)
|
||||||
if prevlnum == 0
|
if prevlnum == 0
|
||||||
" top of file
|
" top of file
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" grab the previous and current line, stripping comments.
|
" grab the previous and current line, stripping comments.
|
||||||
let prevl = substitute(getline(prevlnum), '//.*$', '', '')
|
let prevl = substitute(getline(prevlnum), '//.*$', '', '')
|
||||||
let thisl = substitute(getline(a:lnum), '//.*$', '', '')
|
let thisl = substitute(getline(a:lnum), '//.*$', '', '')
|
||||||
let previ = indent(prevlnum)
|
let previ = indent(prevlnum)
|
||||||
|
|
||||||
let ind = previ
|
let ind = previ
|
||||||
|
|
||||||
if prevl =~ '[({]\s*$'
|
if prevl =~ '[({]\s*$'
|
||||||
" previous line opened a block
|
" previous line opened a block
|
||||||
let ind += s:sw()
|
let ind += s:sw()
|
||||||
endif
|
endif
|
||||||
if prevl =~# '^\s*\(case .*\|default\):$'
|
if prevl =~# '^\s*\(case .*\|default\):$'
|
||||||
" previous line is part of a switch statement
|
" previous line is part of a switch statement
|
||||||
let ind += s:sw()
|
let ind += s:sw()
|
||||||
endif
|
endif
|
||||||
" TODO: handle if the previous line is a label.
|
" TODO: handle if the previous line is a label.
|
||||||
|
|
||||||
if thisl =~ '^\s*[)}]'
|
if thisl =~ '^\s*[)}]'
|
||||||
" this line closed a block
|
" this line closed a block
|
||||||
let ind -= s:sw()
|
let ind -= s:sw()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Colons are tricky.
|
" Colons are tricky.
|
||||||
" We want to outdent if it's part of a switch ("case foo:" or "default:").
|
" We want to outdent if it's part of a switch ("case foo:" or "default:").
|
||||||
" We ignore trying to deal with jump labels because (a) they're rare, and
|
" We ignore trying to deal with jump labels because (a) they're rare, and
|
||||||
" (b) they're hard to disambiguate from a composite literal key.
|
" (b) they're hard to disambiguate from a composite literal key.
|
||||||
if thisl =~# '^\s*\(case .*\|default\):$'
|
if thisl =~# '^\s*\(case .*\|default\):$'
|
||||||
let ind -= s:sw()
|
let ind -= s:sw()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return ind
|
return ind
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" vim:ts=4:sw=4:et
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -45,4 +45,6 @@ function! GetGoHTMLTmplIndent(lnum)
|
|||||||
return ind
|
return ind
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -113,24 +113,22 @@ function! GetHaskellIndent()
|
|||||||
let l:hlstack = s:getHLStack()
|
let l:hlstack = s:getHLStack()
|
||||||
|
|
||||||
" do not indent in strings and quasiquotes
|
" do not indent in strings and quasiquotes
|
||||||
if index(l:hlstack, 'haskellString') > -1 || index(l:hlstack, 'haskellQuasiQuote') > -1
|
if index(l:hlstack, 'haskellQuasiQuote') > -1 || index(l:hlstack, 'haskellBlockComment') > -1
|
||||||
return -1
|
return -1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" blockcomment handling
|
|
||||||
if index(l:hlstack, 'haskellBlockComment') > -1
|
|
||||||
for l:c in range(v:lnum - 1, 0, -1)
|
|
||||||
let l:line = getline(l:c)
|
|
||||||
if l:line =~ '{-'
|
|
||||||
return 1 + match(l:line, '{-')
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
return 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:prevline = getline(v:lnum - 1)
|
let l:prevline = getline(v:lnum - 1)
|
||||||
let l:line = getline(v:lnum)
|
let l:line = getline(v:lnum)
|
||||||
|
|
||||||
|
" indent multiline strings
|
||||||
|
if index(l:hlstack, 'haskellString') > -1
|
||||||
|
if l:line =~ '^\s*\\'
|
||||||
|
return match(l:prevline, '["\\]')
|
||||||
|
else
|
||||||
|
return - 1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
" reset
|
" reset
|
||||||
if l:prevline =~ '^\s*$' && l:line !~ '^\s*\S'
|
if l:prevline =~ '^\s*$' && l:line !~ '^\s*\S'
|
||||||
return 0
|
return 0
|
||||||
@@ -319,7 +317,10 @@ function! GetHaskellIndent()
|
|||||||
" foo
|
" foo
|
||||||
" >>{
|
" >>{
|
||||||
if l:line =~ '^\s*{' && l:prevline !~ '^{'
|
if l:line =~ '^\s*{' && l:prevline !~ '^{'
|
||||||
return match(l:prevline, '\S') + &shiftwidth
|
let l:s = match(l:prevline, '\S')
|
||||||
|
if l:s >= 0
|
||||||
|
return l:s + &shiftwidth
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" in foo
|
" in foo
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ setlocal nosmartindent
|
|||||||
" Now, set up our indentation expression and keys that trigger it.
|
" Now, set up our indentation expression and keys that trigger it.
|
||||||
setlocal indentexpr=GetJavascriptIndent()
|
setlocal indentexpr=GetJavascriptIndent()
|
||||||
setlocal formatexpr=Fixedgq(v:lnum,v:count)
|
setlocal formatexpr=Fixedgq(v:lnum,v:count)
|
||||||
setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e
|
setlocal indentkeys=0{,0},0),0],0\,*<Return>,:,!^F,o,O,e
|
||||||
|
setlocal cinoptions+=j1,J1,c1
|
||||||
|
|
||||||
" Only define the function once.
|
" Only define the function once.
|
||||||
if exists("*GetJavascriptIndent")
|
if exists("*GetJavascriptIndent")
|
||||||
@@ -28,47 +29,75 @@ endif
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
|
" Get shiftwidth value
|
||||||
|
if exists('*shiftwidth')
|
||||||
|
func s:sw()
|
||||||
|
return shiftwidth()
|
||||||
|
endfunc
|
||||||
|
else
|
||||||
|
func s:sw()
|
||||||
|
return &sw
|
||||||
|
endfunc
|
||||||
|
endif
|
||||||
|
|
||||||
" 1. Variables {{{1
|
" 1. Variables {{{1
|
||||||
" ============
|
" ============
|
||||||
|
|
||||||
let s:js_keywords = '^\s*\(break\|case\|catch\|continue\|debugger\|default\|delete\|do\|else\|finally\|for\|function\|if\|in\|instanceof\|new\|return\|switch\|this\|throw\|try\|typeof\|var\|void\|while\|with\)'
|
let s:line_pre = '^\s*\%(\/\*.*\*\/\s*\)*'
|
||||||
|
let s:js_keywords = s:line_pre . '\%(break\|import\|export\|catch\|const\|continue\|debugger\|delete\|do\|else\|finally\|for\|function\|if\|in\|instanceof\|let\|new\|return\|switch\|this\|throw\|try\|typeof\|var\|void\|while\|with\)\>\C'
|
||||||
|
let s:expr_case = s:line_pre . '\%(\%(case\>.*\)\|default\)\s*:\C'
|
||||||
" Regex of syntax group names that are or delimit string or are comments.
|
" Regex of syntax group names that are or delimit string or are comments.
|
||||||
let s:syng_strcom = 'string\|regex\|comment\c'
|
let s:syng_strcom = '\%(string\|regex\|special\|doc\|comment\|template\)\c'
|
||||||
|
|
||||||
" Regex of syntax group names that are strings.
|
" Regex of syntax group names that are strings.
|
||||||
let s:syng_string = 'regex\c'
|
let s:syng_string = 'regex\c'
|
||||||
|
|
||||||
" Regex of syntax group names that are strings or documentation.
|
" Regex of syntax group names that are strings or documentation.
|
||||||
let s:syng_multiline = 'comment\c'
|
let s:syng_comment = '\%(comment\|doc\)\c'
|
||||||
|
|
||||||
" Regex of syntax group names that are line comment.
|
|
||||||
let s:syng_linecom = 'linecomment\c'
|
|
||||||
|
|
||||||
" Expression used to check whether we should skip a match with searchpair().
|
" Expression used to check whether we should skip a match with searchpair().
|
||||||
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'"
|
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ '".s:syng_strcom."'"
|
||||||
|
|
||||||
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
|
func s:lookForParens(start,end,flags,stop)
|
||||||
|
try
|
||||||
|
return searchpair(a:start,'',a:end,a:flags,s:skip_expr,a:stop,300)
|
||||||
|
catch /E118/
|
||||||
|
return searchpair(a:start,'',a:end,a:flags,0,a:stop)
|
||||||
|
endtry
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
let s:line_term = '\s*\%(\%(\/\/.*\)\=\|\%(\/\*.*\*\/\s*\)*\)$'
|
||||||
|
|
||||||
" Regex that defines continuation lines, not including (, {, or [.
|
" Regex that defines continuation lines, not including (, {, or [.
|
||||||
let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\|[^=]=[^=].*,\)' . s:line_term
|
let s:continuation_regex = '\%([*.?:]\|+\@<!+\|-\@<!-\|\*\@<!\/\|=\|||\|&&\)' . s:line_term
|
||||||
|
|
||||||
" Regex that defines continuation lines.
|
let s:one_line_scope_regex = '\%(\<else\>\|=>\)\C' . s:line_term
|
||||||
" TODO: this needs to deal with if ...: and so on
|
|
||||||
let s:msl_regex = s:continuation_regex
|
|
||||||
|
|
||||||
let s:one_line_scope_regex = '\<\%(if\|else\|for\|while\)\>[^{;]*' . s:line_term
|
function s:Onescope(lnum)
|
||||||
|
if getline(a:lnum) =~ s:one_line_scope_regex
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
let mypos = col('.')
|
||||||
|
call cursor(a:lnum, 1)
|
||||||
|
if search('.*\zs\<\%(while\|for\|if\)\>\s*(\C', 'ce', a:lnum) > 0 &&
|
||||||
|
\ s:lookForParens('(', ')', 'W', a:lnum) > 0 &&
|
||||||
|
\ col('.') == strlen(s:RemoveTrailingComments(getline(a:lnum)))
|
||||||
|
call cursor(a:lnum, mypos)
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
call cursor(a:lnum, mypos)
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Regex that defines blocks.
|
" Regex that defines blocks.
|
||||||
let s:block_regex = '\%([{[]\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
|
let s:block_regex = '[{([]' . s:line_term
|
||||||
|
|
||||||
let s:var_stmt = '^\s*var'
|
let s:operator_first = s:line_pre . '\%([,:?]\|\([-/.+*]\)\%(\1\|\*\|\/\)\@!\|||\|&&\)'
|
||||||
|
|
||||||
let s:comma_first = '^\s*,'
|
let s:var_stmt = s:line_pre . '\%(const\|let\|var\)\s\+\C'
|
||||||
let s:comma_last = ',\s*$'
|
|
||||||
|
|
||||||
let s:ternary = '^\s\+[?|:]'
|
let s:comma_last = ',' . s:line_term
|
||||||
let s:ternary_q = '^\s\+?'
|
|
||||||
|
|
||||||
" 2. Auxiliary Functions {{{1
|
" 2. Auxiliary Functions {{{1
|
||||||
" ======================
|
" ======================
|
||||||
@@ -84,32 +113,23 @@ function s:IsInString(lnum, col)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Check if the character at lnum:col is inside a multi-line comment.
|
" Check if the character at lnum:col is inside a multi-line comment.
|
||||||
function s:IsInMultilineComment(lnum, col)
|
function s:IsInComment(lnum, col)
|
||||||
return !s:IsLineComment(a:lnum, a:col) && synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_multiline
|
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_comment
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Check if the character at lnum:col is a line comment.
|
|
||||||
function s:IsLineComment(lnum, col)
|
|
||||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ s:syng_linecom
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Find line above 'lnum' that isn't empty, in a comment, or in a string.
|
" Find line above 'lnum' that isn't empty, in a comment, or in a string.
|
||||||
function s:PrevNonBlankNonString(lnum)
|
function s:PrevNonBlankNonString(lnum)
|
||||||
let in_block = 0
|
|
||||||
let lnum = prevnonblank(a:lnum)
|
let lnum = prevnonblank(a:lnum)
|
||||||
while lnum > 0
|
while lnum > 0
|
||||||
" Go in and out of blocks comments as necessary.
|
|
||||||
" If the line isn't empty (with opt. comment) or in a string, end search.
|
|
||||||
let line = getline(lnum)
|
let line = getline(lnum)
|
||||||
if line =~ '/\*'
|
let com = match(line, '\%(\/\*.*\)\@<!\*\/') + 1
|
||||||
if in_block
|
if s:IsInComment(lnum, com)
|
||||||
let in_block = 0
|
call cursor(lnum, com)
|
||||||
else
|
let parlnum = search('\%(\/\/.*\)\@<!\/\*', 'nbW')
|
||||||
break
|
if parlnum > 0
|
||||||
endif
|
let lnum = parlnum
|
||||||
elseif !in_block && line =~ '\*/'
|
end
|
||||||
let in_block = 1
|
elseif line !~ '^' . s:line_term && !s:IsInStringOrComment(lnum,1)
|
||||||
elseif !in_block && line !~ '^\s*\%(//\).*$' && !(s:IsInStringOrComment(lnum, 1) && s:IsInStringOrComment(lnum, strlen(line)))
|
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
let lnum = prevnonblank(lnum - 1)
|
let lnum = prevnonblank(lnum - 1)
|
||||||
@@ -122,87 +142,89 @@ function s:GetMSL(lnum, in_one_line_scope)
|
|||||||
" Start on the line we're at and use its indent.
|
" Start on the line we're at and use its indent.
|
||||||
let msl = a:lnum
|
let msl = a:lnum
|
||||||
let lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
let lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
||||||
while lnum > 0
|
while lnum > 0 && !s:Match(msl,s:line_pre . '[])}]')
|
||||||
" If we have a continuation line, or we're in a string, use line as MSL.
|
" If we have a continuation line, or we're in a string, use line as MSL.
|
||||||
" Otherwise, terminate search as we have found our MSL already.
|
" Otherwise, terminate search as we have found our MSL already.
|
||||||
let line = getline(lnum)
|
let line = getline(lnum)
|
||||||
let col = match(line, s:msl_regex) + 1
|
let line2 = getline(msl)
|
||||||
if (col > 0 && !s:IsInStringOrComment(lnum, col)) || s:IsInString(lnum, strlen(line))
|
if ((s:Match(lnum,s:continuation_regex) || s:Match(lnum, s:comma_last)) &&
|
||||||
|
\ !s:Match(lnum, s:expr_case)) || s:IsInString(lnum, strlen(line))
|
||||||
let msl = lnum
|
let msl = lnum
|
||||||
|
if s:Match(lnum, s:line_pre . '[]})]') && !a:in_one_line_scope
|
||||||
|
call cursor(lnum,1)
|
||||||
|
let parlnum = s:lookForParens('(\|{\|\[', ')\|}\|\]', 'nbW', 0)
|
||||||
|
if parlnum > 0
|
||||||
|
let lnum = parlnum
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
" Don't use lines that are part of a one line scope as msl unless the
|
" Don't use lines that are part of a one line scope as msl unless the
|
||||||
" flag in_one_line_scope is set to 1
|
" flag in_one_line_scope is set to 1
|
||||||
"
|
"
|
||||||
if a:in_one_line_scope
|
if a:in_one_line_scope
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
let msl_one_line = s:Match(lnum, s:one_line_scope_regex)
|
let msl_one_line = s:Onescope(lnum)
|
||||||
if msl_one_line == 0
|
if msl_one_line == 0
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
endif
|
end
|
||||||
let lnum = s:PrevNonBlankNonString(lnum - 1)
|
let lnum = s:PrevNonBlankNonString(lnum - 1)
|
||||||
endwhile
|
endwhile
|
||||||
return msl
|
return msl
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:RemoveTrailingComments(content)
|
function s:RemoveTrailingComments(content)
|
||||||
let single = '\/\/\(.*\)\s*$'
|
let single = '\/\/\%(.*\)\s*$'
|
||||||
let multi = '\/\*\(.*\)\*\/\s*$'
|
let multi = '\/\*\%(.*\)\*\/\s*$'
|
||||||
return substitute(substitute(a:content, single, '', ''), multi, '', '')
|
return substitute(substitute(substitute(a:content, single, '', ''), multi, '', ''), '\s\+$', '', '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Find if the string is inside var statement (but not the first string)
|
" Find if the string is inside var statement (but not the first string)
|
||||||
function s:InMultiVarStatement(lnum)
|
function s:InMultiVarStatement(lnum, cont, prev)
|
||||||
let lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
let lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
||||||
|
let cont = a:cont
|
||||||
|
let prev = a:prev
|
||||||
|
|
||||||
" let type = synIDattr(synID(lnum, indent(lnum) + 1, 0), 'name')
|
" let type = synIDattr(synID(lnum, indent(lnum) + 1, 0), 'name')
|
||||||
|
|
||||||
" loop through previous expressions to find a var statement
|
" loop through previous expressions to find a var statement
|
||||||
while lnum > 0
|
while lnum > 0 && (s:Match(lnum, s:comma_last) ||(cont && getline(lnum) =~ s:line_pre . '[]})]') ||
|
||||||
let line = getline(lnum)
|
\ s:Match(lnum,s:continuation_regex)) || (prev && (s:Match(prev, s:comma_last) ||
|
||||||
|
\ s:Match(prev,s:continuation_regex)))
|
||||||
" if the line is a js keyword
|
" if the line is a js keyword
|
||||||
if (line =~ s:js_keywords)
|
if cont
|
||||||
|
let cont = 0
|
||||||
|
call cursor(lnum,1)
|
||||||
|
let parlnum = s:lookForParens('(\|{\|\[', ')\|}\|\]', 'nbW', 0)
|
||||||
|
if parlnum > 0
|
||||||
|
let lnum = parlnum
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if s:Match(lnum, s:js_keywords)
|
||||||
" check if the line is a var stmt
|
" check if the line is a var stmt
|
||||||
" if the line has a comma first or comma last then we can assume that we
|
" if the line has a comma first or comma last then we can assume that we
|
||||||
" are in a multiple var statement
|
" are in a multiple var statement
|
||||||
if (line =~ s:var_stmt)
|
if s:Match(lnum, s:var_stmt) && (s:Match(lnum, s:comma_last)||s:Match(lnum,s:continuation_regex))
|
||||||
return lnum
|
return lnum
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" other js keywords, not a var
|
" other js keywords, not a var
|
||||||
return 0
|
if !s:Match(lnum, s:comma_last)||!s:Match(lnum,s:continuation_regex)
|
||||||
|
return 0
|
||||||
|
end
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let lnum = s:PrevNonBlankNonString(lnum - 1)
|
let lnum = s:PrevNonBlankNonString(lnum - 1)
|
||||||
|
let prev = prev && lnum > 0 ? prev : 0
|
||||||
endwhile
|
endwhile
|
||||||
|
|
||||||
" beginning of program, not a var
|
" beginning of program, not a var
|
||||||
return 0
|
return 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Find line above with beginning of the var statement or returns 0 if it's not
|
|
||||||
" this statement
|
|
||||||
function s:GetVarIndent(lnum)
|
|
||||||
let lvar = s:InMultiVarStatement(a:lnum)
|
|
||||||
let prev_lnum = s:PrevNonBlankNonString(a:lnum - 1)
|
|
||||||
|
|
||||||
if lvar
|
|
||||||
let line = s:RemoveTrailingComments(getline(prev_lnum))
|
|
||||||
|
|
||||||
" if the previous line doesn't end in a comma, return to regular indent
|
|
||||||
if (line !~ s:comma_last)
|
|
||||||
return indent(prev_lnum) - &sw
|
|
||||||
else
|
|
||||||
return indent(lvar) + &sw
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
return -1
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
" Check if line 'lnum' has more opening brackets than closing ones.
|
" Check if line 'lnum' has more opening brackets than closing ones.
|
||||||
function s:LineHasOpeningBrackets(lnum)
|
function s:LineHasOpeningBrackets(lnum)
|
||||||
let open_0 = 0
|
let open_0 = 0
|
||||||
@@ -221,7 +243,7 @@ function s:LineHasOpeningBrackets(lnum)
|
|||||||
endif
|
endif
|
||||||
let pos = match(line, '[][(){}]', pos + 1)
|
let pos = match(line, '[][(){}]', pos + 1)
|
||||||
endwhile
|
endwhile
|
||||||
return (open_0 > 0) . (open_2 > 0) . (open_4 > 0)
|
return (open_0 > 0 ? 1 : (open_0 == 0 ? 0 : 2)) . (open_2 > 0 ? 1 : (open_2 == 0 ? 0 : 2)) . (open_4 > 0 ? 1 : (open_4 == 0 ? 0 : 2))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:Match(lnum, regex)
|
function s:Match(lnum, regex)
|
||||||
@@ -253,7 +275,9 @@ function s:IndentWithContinuation(lnum, ind, width)
|
|||||||
return msl_ind + a:width
|
return msl_ind + a:width
|
||||||
else
|
else
|
||||||
return msl_ind
|
return msl_ind
|
||||||
endif
|
end
|
||||||
|
elseif s:InMultiVarStatement(p_lnum, 0, s:PrevNonBlankNonString(p_lnum - 1))
|
||||||
|
return indent(p_lnum) - s:sw()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return a:ind
|
return a:ind
|
||||||
@@ -261,7 +285,7 @@ endfunction
|
|||||||
|
|
||||||
function s:InOneLineScope(lnum)
|
function s:InOneLineScope(lnum)
|
||||||
let msl = s:GetMSL(a:lnum, 1)
|
let msl = s:GetMSL(a:lnum, 1)
|
||||||
if msl > 0 && s:Match(msl, s:one_line_scope_regex)
|
if msl > 0 && s:Onescope(msl)
|
||||||
return msl
|
return msl
|
||||||
endif
|
endif
|
||||||
return 0
|
return 0
|
||||||
@@ -271,11 +295,11 @@ function s:ExitingOneLineScope(lnum)
|
|||||||
let msl = s:GetMSL(a:lnum, 1)
|
let msl = s:GetMSL(a:lnum, 1)
|
||||||
if msl > 0
|
if msl > 0
|
||||||
" if the current line is in a one line scope ..
|
" if the current line is in a one line scope ..
|
||||||
if s:Match(msl, s:one_line_scope_regex)
|
if s:Onescope(msl)
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
let prev_msl = s:GetMSL(msl - 1, 1)
|
let prev_msl = s:GetMSL(msl - 1, 1)
|
||||||
if s:Match(prev_msl, s:one_line_scope_regex)
|
if s:Onescope(prev_msl)
|
||||||
return prev_msl
|
return prev_msl
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -287,13 +311,13 @@ endfunction
|
|||||||
" =========================
|
" =========================
|
||||||
|
|
||||||
function GetJavascriptIndent()
|
function GetJavascriptIndent()
|
||||||
" 3.1. Setup {{{2
|
" 3.1. Setup {{{1
|
||||||
" ----------
|
" ----------
|
||||||
|
|
||||||
" Set up variables for restoring position in file. Could use v:lnum here.
|
" Set up variables for restoring position in file. Could use v:lnum here.
|
||||||
|
" Avoid use of line('.')/col('.') type functions as the curpos can change
|
||||||
let vcol = col('.')
|
let vcol = col('.')
|
||||||
|
|
||||||
" 3.2. Work on the current line {{{2
|
" 3.2. Work on the current line {{{1
|
||||||
" -----------------------------
|
" -----------------------------
|
||||||
|
|
||||||
let ind = -1
|
let ind = -1
|
||||||
@@ -301,81 +325,108 @@ function GetJavascriptIndent()
|
|||||||
let line = getline(v:lnum)
|
let line = getline(v:lnum)
|
||||||
" previous nonblank line number
|
" previous nonblank line number
|
||||||
let prevline = prevnonblank(v:lnum - 1)
|
let prevline = prevnonblank(v:lnum - 1)
|
||||||
|
" previous line of code
|
||||||
|
let lnum = s:PrevNonBlankNonString(v:lnum - 1)
|
||||||
|
|
||||||
" If we got a closing bracket on an empty line, find its match and indent
|
" to not change multiline string values
|
||||||
" according to it. For parentheses we indent to its column - 1, for the
|
if line !~ '^[''"`]' && synIDattr(synID(v:lnum, 1, 1), 'name') =~? 'string\|template'
|
||||||
" others we indent to the containing line's MSL's level. Return -1 if fail.
|
return -1
|
||||||
let col = matchend(line, '^\s*[],})]')
|
|
||||||
if col > 0 && !s:IsInStringOrComment(v:lnum, col)
|
|
||||||
call cursor(v:lnum, col)
|
|
||||||
|
|
||||||
let lvar = s:InMultiVarStatement(v:lnum)
|
|
||||||
if lvar
|
|
||||||
let prevline_contents = s:RemoveTrailingComments(getline(prevline))
|
|
||||||
|
|
||||||
" check for comma first
|
|
||||||
if (line[col - 1] =~ ',')
|
|
||||||
" if the previous line ends in comma or semicolon don't indent
|
|
||||||
if (prevline_contents =~ '[;,]\s*$')
|
|
||||||
return indent(s:GetMSL(line('.'), 0))
|
|
||||||
" get previous line indent, if it's comma first return prevline indent
|
|
||||||
elseif (prevline_contents =~ s:comma_first)
|
|
||||||
return indent(prevline)
|
|
||||||
" otherwise we indent 1 level
|
|
||||||
else
|
|
||||||
return indent(lvar) + &sw
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
let bs = strpart('(){}[]', stridx(')}]', line[col - 1]) * 2, 2)
|
|
||||||
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
|
|
||||||
if line[col-1]==')' && col('.') != col('$') - 1
|
|
||||||
let ind = virtcol('.')-1
|
|
||||||
else
|
|
||||||
let ind = indent(s:GetMSL(line('.'), 0))
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
return ind
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the line is comma first, dedent 1 level
|
|
||||||
if (getline(prevline) =~ s:comma_first)
|
|
||||||
return indent(prevline) - &sw
|
|
||||||
endif
|
|
||||||
|
|
||||||
if (line =~ s:ternary)
|
|
||||||
if (getline(prevline) =~ s:ternary_q)
|
|
||||||
return indent(prevline)
|
|
||||||
else
|
|
||||||
return indent(prevline) + &sw
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" If we are in a multi-line comment, cindent does the right thing.
|
" If we are in a multi-line comment, cindent does the right thing.
|
||||||
if s:IsInMultilineComment(v:lnum, 1) && !s:IsLineComment(v:lnum, 1)
|
if line !~ '^\%(\/\*\|\s*\/\/\)' && s:IsInComment(v:lnum, 1)
|
||||||
return cindent(v:lnum)
|
return cindent(v:lnum)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Check for multiple var assignments
|
" single opening bracket will assume you want a c style of indenting
|
||||||
" let var_indent = s:GetVarIndent(v:lnum)
|
if line =~ s:line_pre . '{' && !s:Match(lnum,s:block_regex) &&
|
||||||
" if var_indent >= 0
|
\ !s:Match(lnum,s:comma_last)
|
||||||
" return var_indent
|
return cindent(v:lnum)
|
||||||
" endif
|
endif
|
||||||
|
|
||||||
" 3.3. Work on the previous line. {{{2
|
" cindent each line which has a switch label
|
||||||
|
if (line =~ s:expr_case)
|
||||||
|
let s:cpo_switch = &cpo
|
||||||
|
set cpo+=%
|
||||||
|
let ind = cindent(v:lnum)
|
||||||
|
let &cpo = s:cpo_switch
|
||||||
|
return ind
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If we got a closing bracket on an empty line, find its match and indent
|
||||||
|
" according to it.
|
||||||
|
let col = line =~ s:line_pre . '[]})]'
|
||||||
|
if col > 0
|
||||||
|
let parlnum = v:lnum
|
||||||
|
while col
|
||||||
|
call cursor(parlnum, 1)
|
||||||
|
let parlnum = s:lookForParens('(\|{\|\[', ')\|}\|\]', 'nbW', 0)
|
||||||
|
let col = s:Match(parlnum, s:line_pre . '[]})]')
|
||||||
|
if col
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
if parlnum > 0
|
||||||
|
let ind = s:InMultiVarStatement(parlnum, 0, 0)|| s:LineHasOpeningBrackets(parlnum) !~ '2' ?
|
||||||
|
\ indent(parlnum) : indent(s:GetMSL(parlnum, 0))
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
return ind
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" If line starts with an operator...
|
||||||
|
if (line =~ s:operator_first)
|
||||||
|
if (s:Match(lnum, s:operator_first) || (s:Match(lnum, s:line_pre . '[])}]') &&
|
||||||
|
\ !(s:Match(v:lnum,s:line_pre . '\.') && s:Match(lnum, ')' . s:line_term))))
|
||||||
|
" and so does previous line, don't indent
|
||||||
|
return indent(lnum)
|
||||||
|
end
|
||||||
|
let counts = s:LineHasOpeningBrackets(lnum)
|
||||||
|
if counts =~ '2'
|
||||||
|
call cursor(lnum, 1)
|
||||||
|
" Search for the opening tag
|
||||||
|
let parlnum = s:lookForParens('(\|{\|\[', ')\|}\|\]', 'nbW', 0)
|
||||||
|
if parlnum > 0
|
||||||
|
return !s:Match(parlnum, s:operator_first) &&
|
||||||
|
\ synIDattr(synID(v:lnum, 1, 1), 'name') !~? 'jsbracket\|jsparen\|jsobject' ?
|
||||||
|
\ indent(lnum) + s:sw() : indent(parlnum)
|
||||||
|
end
|
||||||
|
elseif synIDattr(synID(v:lnum, 1, 1), 'name') !~? 'jsbracket\|jsparen\|jsobject'
|
||||||
|
" otherwise, if not in an key/val;array item;param, indent 1 level
|
||||||
|
return indent(lnum) + s:sw()
|
||||||
|
end
|
||||||
|
|
||||||
|
" If previous line starts with an operator...
|
||||||
|
elseif (s:Match(lnum, s:operator_first) && !s:Match(lnum,s:continuation_regex)) ||
|
||||||
|
\ getline(lnum) =~ '[]})];\=' . s:line_term
|
||||||
|
let counts = s:LineHasOpeningBrackets(lnum)
|
||||||
|
if counts =~ '2' && !s:Match(lnum, s:operator_first)
|
||||||
|
call cursor(lnum, 1)
|
||||||
|
" Search for the opening tag
|
||||||
|
let mnum = s:lookForParens('(\|{\|\[', ')\|}\|\]', 'nbW', 0)
|
||||||
|
if mnum > 0 && (s:Match(mnum, s:operator_first) ||
|
||||||
|
\ (s:Onescope(s:PrevNonBlankNonString(mnum - 1))) && !s:Match(mnum, s:line_pre . '{'))
|
||||||
|
return indent(mnum) - s:sw()
|
||||||
|
end
|
||||||
|
elseif s:Match(lnum, s:operator_first)
|
||||||
|
if counts !~ '1'
|
||||||
|
return indent(lnum) - s:sw()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
" 3.3. Work on the previous line. {{{1
|
||||||
" -------------------------------
|
" -------------------------------
|
||||||
|
|
||||||
" If the line is empty and the previous nonblank line was a multi-line
|
" If the line is empty and the previous nonblank line was a multi-line
|
||||||
" comment, use that comment's indent. Deduct one char to account for the
|
" comment, use that comment's indent. Deduct one char to account for the
|
||||||
" space in ' */'.
|
" space in ' */'.
|
||||||
if line =~ '^\s*$' && s:IsInMultilineComment(prevline, 1)
|
if line =~ '^\s*$' && getline(prevline) =~ '\%(\%(^\s*\/\/\|\/\*\).*\)\@<!\*\/' &&
|
||||||
|
\ s:IsInComment(prevline, 1)
|
||||||
return indent(prevline) - 1
|
return indent(prevline) - 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Find a non-blank, non-multi-line string line above the current line.
|
" Find a non-blank, non-multi-line string line above the current line.
|
||||||
let lnum = s:PrevNonBlankNonString(v:lnum - 1)
|
|
||||||
|
|
||||||
" If the line is empty and inside a string, use the previous line.
|
" If the line is empty and inside a string, use the previous line.
|
||||||
if line =~ '^\s*$' && lnum != prevline
|
if line =~ '^\s*$' && lnum != prevline
|
||||||
@@ -387,48 +438,56 @@ function GetJavascriptIndent()
|
|||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" If the previous line ended with a block opening, add a level of indent.
|
||||||
|
if s:Match(lnum, s:block_regex)
|
||||||
|
return s:InMultiVarStatement(lnum, 0, 0) || s:LineHasOpeningBrackets(lnum) !~ '2' ?
|
||||||
|
\ indent(lnum) + s:sw() : indent(s:GetMSL(lnum, 0)) + s:sw()
|
||||||
|
endif
|
||||||
|
|
||||||
" Set up variables for current line.
|
" Set up variables for current line.
|
||||||
let line = getline(lnum)
|
let line = getline(lnum)
|
||||||
let ind = indent(lnum)
|
let ind = indent(lnum)
|
||||||
|
|
||||||
" If the previous line ended with a block opening, add a level of indent.
|
|
||||||
if s:Match(lnum, s:block_regex)
|
|
||||||
return indent(s:GetMSL(lnum, 0)) + &sw
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the previous line contained an opening bracket, and we are still in it,
|
" If the previous line contained an opening bracket, and we are still in it,
|
||||||
" add indent depending on the bracket type.
|
" add indent depending on the bracket type.
|
||||||
if line =~ '[[({]'
|
if s:Match(lnum, '[[({})\]]')
|
||||||
let counts = s:LineHasOpeningBrackets(lnum)
|
let counts = s:LineHasOpeningBrackets(lnum)
|
||||||
if counts[0] == '1' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
|
if counts =~ '2'
|
||||||
if col('.') + 1 == col('$')
|
call cursor(lnum,matchend(s:RemoveTrailingComments(line), '.*\zs[])}]'))
|
||||||
return ind + &sw
|
while s:lookForParens('(\|{\|\[', ')\|}\|\]', 'bW', 0) == lnum
|
||||||
else
|
call cursor(lnum, matchend(s:RemoveTrailingComments(strpart(line,0,col('.'))), '.*\zs[])}]'))
|
||||||
return virtcol('.')
|
endwhile
|
||||||
endif
|
let cur = line('.')
|
||||||
elseif counts[1] == '1' || counts[2] == '1'
|
if cur < lnum && !s:InMultiVarStatement(cur,0,0)
|
||||||
return ind + &sw
|
return indent(s:GetMSL(cur, 0))
|
||||||
else
|
end
|
||||||
call cursor(v:lnum, vcol)
|
elseif counts =~ '1' || s:Onescope(lnum)
|
||||||
|
return ind + s:sw()
|
||||||
end
|
end
|
||||||
endif
|
end
|
||||||
|
|
||||||
" 3.4. Work on the MSL line. {{{2
|
" 3.4. Work on the MSL line. {{{1
|
||||||
" --------------------------
|
" --------------------------
|
||||||
|
if s:Match(lnum, s:comma_last) && !s:Match(lnum, s:continuation_regex)
|
||||||
|
return s:Match(lnum, s:var_stmt) ? indent(lnum) + s:sw() : indent(lnum)
|
||||||
|
|
||||||
|
elseif s:Match(s:PrevNonBlankNonString(lnum - 1), s:comma_last)
|
||||||
|
if !s:Match(lnum, s:comma_last) && s:InMultiVarStatement(lnum,1,0)
|
||||||
|
return indent(lnum) - s:sw()
|
||||||
|
end
|
||||||
|
end
|
||||||
let ind_con = ind
|
let ind_con = ind
|
||||||
let ind = s:IndentWithContinuation(lnum, ind_con, &sw)
|
let ind = s:IndentWithContinuation(lnum, ind_con, s:sw())
|
||||||
|
|
||||||
" }}}2
|
" }}}2
|
||||||
"
|
"
|
||||||
"
|
"
|
||||||
let ols = s:InOneLineScope(lnum)
|
let ols = s:InOneLineScope(lnum)
|
||||||
if ols > 0
|
if ols > 0
|
||||||
let ind = ind + &sw
|
let ind = ind + s:sw()
|
||||||
else
|
else
|
||||||
let ols = s:ExitingOneLineScope(lnum)
|
let ols = s:ExitingOneLineScope(lnum)
|
||||||
while ols > 0 && ind > 0
|
while ols > 0 && ind > 0
|
||||||
let ind = ind - &sw
|
let ind = ind - s:sw()
|
||||||
let ols = s:InOneLineScope(ols - 1)
|
let ols = s:InOneLineScope(ols - 1)
|
||||||
endwhile
|
endwhile
|
||||||
endif
|
endif
|
||||||
@@ -440,66 +499,68 @@ endfunction
|
|||||||
|
|
||||||
let &cpo = s:cpo_save
|
let &cpo = s:cpo_save
|
||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
" gq{{{2
|
||||||
function! Fixedgq(lnum, count)
|
function! Fixedgq(lnum, count)
|
||||||
let l:tw = &tw ? &tw : 80;
|
let l:tw = &tw ? &tw : 80;
|
||||||
|
|
||||||
let l:count = a:count
|
let l:count = a:count
|
||||||
let l:first_char = indent(a:lnum) + 1
|
let l:first_char = indent(a:lnum) + 1
|
||||||
|
|
||||||
if mode() == 'i' " gq was not pressed, but tw was set
|
if mode() == 'i' " gq was not pressed, but tw was set
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" This gq is only meant to do code with strings, not comments
|
" This gq is only meant to do code with strings, not comments
|
||||||
if s:IsLineComment(a:lnum, l:first_char) || s:IsInMultilineComment(a:lnum, l:first_char)
|
if s:IsInComment(a:lnum, l:first_char)
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
|
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Put all the lines on one line and do normal spliting after that
|
" Put all the lines on one line and do normal spliting after that
|
||||||
if l:count > 1
|
if l:count > 1
|
||||||
while l:count > 1
|
while l:count > 1
|
||||||
let l:count -= 1
|
let l:count -= 1
|
||||||
normal J
|
normal J
|
||||||
endwhile
|
endwhile
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:winview = winsaveview()
|
let l:winview = winsaveview()
|
||||||
|
|
||||||
|
call cursor(a:lnum, l:tw + 1)
|
||||||
|
let orig_breakpoint = searchpairpos(' ', '', '\.', 'bcW', '', a:lnum)
|
||||||
|
call cursor(a:lnum, l:tw + 1)
|
||||||
|
let breakpoint = searchpairpos(' ', '', '\.', 'bcW', s:skip_expr, a:lnum)
|
||||||
|
|
||||||
|
" No need for special treatment, normal gq handles edgecases better
|
||||||
|
if breakpoint[1] == orig_breakpoint[1]
|
||||||
|
call winrestview(l:winview)
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Try breaking after string
|
||||||
|
if breakpoint[1] <= indent(a:lnum)
|
||||||
call cursor(a:lnum, l:tw + 1)
|
call cursor(a:lnum, l:tw + 1)
|
||||||
let orig_breakpoint = searchpairpos(' ', '', '\.', 'bcW', '', a:lnum)
|
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
|
||||||
call cursor(a:lnum, l:tw + 1)
|
endif
|
||||||
let breakpoint = searchpairpos(' ', '', '\.', 'bcW', s:skip_expr, a:lnum)
|
|
||||||
|
|
||||||
" No need for special treatment, normal gq handles edgecases better
|
|
||||||
if breakpoint[1] == orig_breakpoint[1]
|
|
||||||
call winrestview(l:winview)
|
|
||||||
return 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Try breaking after string
|
|
||||||
if breakpoint[1] <= indent(a:lnum)
|
|
||||||
call cursor(a:lnum, l:tw + 1)
|
|
||||||
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
if breakpoint[1] != 0
|
if breakpoint[1] != 0
|
||||||
call feedkeys("r\<CR>")
|
call feedkeys("r\<CR>")
|
||||||
else
|
else
|
||||||
let l:count = l:count - 1
|
let l:count = l:count - 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" run gq on new lines
|
" run gq on new lines
|
||||||
if l:count == 1
|
if l:count == 1
|
||||||
call feedkeys("gqq")
|
call feedkeys("gqq")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
endfunction
|
endfunction
|
||||||
|
"}}}
|
||||||
|
" vim: foldmethod=marker:foldlevel=1
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ let s:block_regex = '\%({\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)
|
|||||||
|
|
||||||
" Check if the character at lnum:col is inside a string.
|
" Check if the character at lnum:col is inside a string.
|
||||||
function s:IsInString(lnum, col)
|
function s:IsInString(lnum, col)
|
||||||
return synIDattr(synID(a:lnum, a:col, 1), 'name') == jsonString
|
return synIDattr(synID(a:lnum, a:col, 1), 'name') == "jsonString"
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Find line above 'lnum' that isn't empty, or in a string.
|
" Find line above 'lnum' that isn't empty, or in a string.
|
||||||
@@ -143,7 +143,11 @@ function GetJSONIndent()
|
|||||||
|
|
||||||
" If the previous line ended with a block opening, add a level of indent.
|
" If the previous line ended with a block opening, add a level of indent.
|
||||||
" if s:Match(lnum, s:block_regex)
|
" if s:Match(lnum, s:block_regex)
|
||||||
" return indent(lnum) + shiftwidth()
|
" if exists('*shiftwidth')
|
||||||
|
" return indent(lnum) + shiftwidth()
|
||||||
|
" else
|
||||||
|
" return indent(lnum) + &sw
|
||||||
|
" endif
|
||||||
" endif
|
" endif
|
||||||
|
|
||||||
" If the previous line contained an opening bracket, and we are still in it,
|
" If the previous line contained an opening bracket, and we are still in it,
|
||||||
@@ -151,7 +155,11 @@ function GetJSONIndent()
|
|||||||
if line =~ '[[({]'
|
if line =~ '[[({]'
|
||||||
let counts = s:LineHasOpeningBrackets(lnum)
|
let counts = s:LineHasOpeningBrackets(lnum)
|
||||||
if counts[0] == '1' || counts[1] == '1' || counts[2] == '1'
|
if counts[0] == '1' || counts[1] == '1' || counts[2] == '1'
|
||||||
return ind + shiftwidth()
|
if exists('*shiftwidth')
|
||||||
|
return ind + shiftwidth()
|
||||||
|
else
|
||||||
|
return ind + &sw
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
call cursor(v:lnum, vcol)
|
call cursor(v:lnum, vcol)
|
||||||
end
|
end
|
||||||
|
|||||||
268
indent/ls.vim
Normal file
268
indent/ls.vim
Normal file
@@ -0,0 +1,268 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'livescript') == -1
|
||||||
|
|
||||||
|
" Language: LiveScript
|
||||||
|
" Maintainer: George Zahariev
|
||||||
|
" URL: http://github.com/gkz/vim-ls
|
||||||
|
" License: WTFPL
|
||||||
|
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
setlocal autoindent
|
||||||
|
setlocal indentexpr=GetLiveScriptIndent(v:lnum)
|
||||||
|
" Make sure GetLiveScriptIndent is run when these are typed so they can be
|
||||||
|
" indented or outdented.
|
||||||
|
setlocal indentkeys+=0],0),0.,=else,=when,=catch,=finally
|
||||||
|
|
||||||
|
" Only define the function once.
|
||||||
|
if exists("*GetLiveScriptIndent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Keywords to indent after
|
||||||
|
let s:INDENT_AFTER_KEYWORD = '^\%(if\|unless\|else\|for\|while\|until\|'
|
||||||
|
\ . 'loop\|case\|default\|try\|catch\|finally\|'
|
||||||
|
\ . 'class\|do\|new\|let\|with\|function\)\>'
|
||||||
|
|
||||||
|
" Operators to indent after
|
||||||
|
let s:INDENT_AFTER_OPERATOR = '\%([([{:=]\|[-=]>\)$'
|
||||||
|
|
||||||
|
" Keywords and operators that continue a line
|
||||||
|
let s:CONTINUATION = '\<\%(is\|isnt\|and\|or\|do\)\>$'
|
||||||
|
\ . '\|'
|
||||||
|
\ . '\%(-\@<!-\|+\@<!+\|<\|[-~]\@<!>\|\*\|/\@<!/\|%\||\|'
|
||||||
|
\ . '&\|,\|\.\@<!\.\)$'
|
||||||
|
|
||||||
|
" Operators that block continuation indenting
|
||||||
|
let s:CONTINUATION_BLOCK = '[([{:=]$'
|
||||||
|
|
||||||
|
" A continuation dot access
|
||||||
|
let s:DOT_ACCESS = '^\.'
|
||||||
|
|
||||||
|
" Keywords to outdent after
|
||||||
|
let s:OUTDENT_AFTER = '^\%(return\|break\|continue\|throw\)\>'
|
||||||
|
|
||||||
|
" A compound assignment like `... = if ...`
|
||||||
|
let s:COMPOUND_ASSIGNMENT = '[:=]\s*\%(if\|unless\|for\|while\|until\|'
|
||||||
|
\ . 'try\|class\|do\|new\|let\|with\)\>'
|
||||||
|
|
||||||
|
" A postfix condition like `return ... if ...`.
|
||||||
|
let s:POSTFIX_CONDITION = '\S\s\+\zs\<\%(if\|unless\)\>'
|
||||||
|
|
||||||
|
" A single-line else statement like `else ...` but not `else if ...
|
||||||
|
let s:SINGLE_LINE_ELSE = '^else\s\+\%(\<\%(if\|unless\)\>\)\@!'
|
||||||
|
|
||||||
|
" Max lines to look back for a match
|
||||||
|
let s:MAX_LOOKBACK = 50
|
||||||
|
|
||||||
|
" Get the linked syntax name of a character.
|
||||||
|
function! s:SyntaxName(linenum, col)
|
||||||
|
return synIDattr(synIDtrans(synID(a:linenum, a:col, 1)), 'name')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Check if a character is in a comment.
|
||||||
|
function! s:IsComment(linenum, col)
|
||||||
|
return s:SyntaxName(a:linenum, a:col) == 'Comment'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Check if a character is in a string.
|
||||||
|
function! s:IsString(linenum, col)
|
||||||
|
return s:SyntaxName(a:linenum, a:col) == 'Constant'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Check if a character is in a comment or string.
|
||||||
|
function! s:IsCommentOrString(linenum, col)
|
||||||
|
return s:SyntaxName(a:linenum, a:col) =~ 'Comment\|Constant'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Check if a whole line is a comment.
|
||||||
|
function! s:IsCommentLine(linenum)
|
||||||
|
" Check the first non-whitespace character.
|
||||||
|
return s:IsComment(a:linenum, indent(a:linenum) + 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Repeatedly search a line for a regex until one is found outside a string or
|
||||||
|
" comment.
|
||||||
|
function! s:SmartSearch(linenum, regex)
|
||||||
|
" Start at the first column.
|
||||||
|
let col = 0
|
||||||
|
|
||||||
|
" Search until there are no more matches, unless a good match is found.
|
||||||
|
while 1
|
||||||
|
call cursor(a:linenum, col + 1)
|
||||||
|
let [_, col] = searchpos(a:regex, 'cn', a:linenum)
|
||||||
|
|
||||||
|
" No more matches.
|
||||||
|
if !col
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !s:IsCommentOrString(a:linenum, col)
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" No good match found.
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Skip a match if it's in a comment or string, is a single-line statement that
|
||||||
|
" isn't adjacent, or is a postfix condition.
|
||||||
|
function! s:ShouldSkip(startlinenum, linenum, col)
|
||||||
|
if s:IsCommentOrString(a:linenum, a:col)
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Check for a single-line statement that isn't adjacent.
|
||||||
|
if s:SmartSearch(a:linenum, '\<then\>') && a:startlinenum - a:linenum > 1
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:SmartSearch(a:linenum, s:POSTFIX_CONDITION) &&
|
||||||
|
\ !s:SmartSearch(a:linenum, s:COMPOUND_ASSIGNMENT)
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Find the farthest line to look back to, capped to line 1 (zero and negative
|
||||||
|
" numbers cause bad things).
|
||||||
|
function! s:MaxLookback(startlinenum)
|
||||||
|
return max([1, a:startlinenum - s:MAX_LOOKBACK])
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Get the skip expression for searchpair().
|
||||||
|
function! s:SkipExpr(startlinenum)
|
||||||
|
return "s:ShouldSkip(" . a:startlinenum . ", line('.'), col('.'))"
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Search for pairs of text.
|
||||||
|
function! s:SearchPair(start, end)
|
||||||
|
" The cursor must be in the first column for regexes to match.
|
||||||
|
call cursor(0, 1)
|
||||||
|
|
||||||
|
let startlinenum = line('.')
|
||||||
|
|
||||||
|
" Don't need the W flag since MaxLookback caps the search to line 1.
|
||||||
|
return searchpair(a:start, '', a:end, 'bcn',
|
||||||
|
\ s:SkipExpr(startlinenum),
|
||||||
|
\ s:MaxLookback(startlinenum))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Try to find a previous matching line.
|
||||||
|
function! s:GetMatch(curline)
|
||||||
|
let firstchar = a:curline[0]
|
||||||
|
|
||||||
|
if firstchar == '}'
|
||||||
|
return s:SearchPair('{', '}')
|
||||||
|
elseif firstchar == ')'
|
||||||
|
return s:SearchPair('(', ')')
|
||||||
|
elseif firstchar == ']'
|
||||||
|
return s:SearchPair('\[', '\]')
|
||||||
|
elseif a:curline =~ '^else\>'
|
||||||
|
return s:SearchPair('\<\%(if\|unless\|case\|when\)\>', '\<else\>')
|
||||||
|
elseif a:curline =~ '^catch\>'
|
||||||
|
return s:SearchPair('\<try\>', '\<catch\>')
|
||||||
|
elseif a:curline =~ '^finally\>'
|
||||||
|
return s:SearchPair('\<try\>', '\<finally\>')
|
||||||
|
endif
|
||||||
|
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Get the nearest previous line that isn't a comment.
|
||||||
|
function! s:GetPrevNormalLine(startlinenum)
|
||||||
|
let curlinenum = a:startlinenum
|
||||||
|
|
||||||
|
while curlinenum > 0
|
||||||
|
let curlinenum = prevnonblank(curlinenum - 1)
|
||||||
|
|
||||||
|
if !s:IsCommentLine(curlinenum)
|
||||||
|
return curlinenum
|
||||||
|
endif
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Get the contents of a line without leading or trailing whitespace.
|
||||||
|
function! s:GetTrimmedLine(linenum)
|
||||||
|
return substitute(substitute(getline(a:linenum), '^\s\+', '', ''),
|
||||||
|
\ '\s\+$', '', '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:GetLiveScriptIndent(curlinenum)
|
||||||
|
let prevlinenum = s:GetPrevNormalLine(a:curlinenum)
|
||||||
|
|
||||||
|
" Don't do anything if there's no previous line.
|
||||||
|
if !prevlinenum
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
let curline = s:GetTrimmedLine(a:curlinenum)
|
||||||
|
|
||||||
|
" Try to find a previous matching statement. This handles outdenting.
|
||||||
|
let matchlinenum = s:GetMatch(curline)
|
||||||
|
|
||||||
|
if matchlinenum
|
||||||
|
return indent(matchlinenum)
|
||||||
|
endif
|
||||||
|
|
||||||
|
let prevline = s:GetTrimmedLine(prevlinenum)
|
||||||
|
let previndent = indent(prevlinenum)
|
||||||
|
|
||||||
|
" Always indent after these operators.
|
||||||
|
if prevline =~ s:INDENT_AFTER_OPERATOR
|
||||||
|
return previndent + &shiftwidth
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Indent after a continuation if it's the first.
|
||||||
|
if prevline =~ s:CONTINUATION
|
||||||
|
let prevprevlinenum = s:GetPrevNormalLine(prevlinenum)
|
||||||
|
let prevprevline = s:GetTrimmedLine(prevprevlinenum)
|
||||||
|
|
||||||
|
if prevprevline !~ s:CONTINUATION && prevprevline !~ s:CONTINUATION_BLOCK
|
||||||
|
return previndent + &shiftwidth
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Indent after these keywords and compound assignments if they aren't a
|
||||||
|
" single-line statement.
|
||||||
|
if prevline =~ s:INDENT_AFTER_KEYWORD || prevline =~ s:COMPOUND_ASSIGNMENT
|
||||||
|
if !s:SmartSearch(prevlinenum, '\<then\>') && prevline !~ s:SINGLE_LINE_ELSE
|
||||||
|
return previndent + &shiftwidth
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Indent a dot access if it's the first.
|
||||||
|
if curline =~ s:DOT_ACCESS && prevline !~ s:DOT_ACCESS
|
||||||
|
return previndent + &shiftwidth
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Outdent after these keywords if they don't have a postfix condition and
|
||||||
|
" aren't a single-line statement.
|
||||||
|
if prevline =~ s:OUTDENT_AFTER
|
||||||
|
if !s:SmartSearch(prevlinenum, s:POSTFIX_CONDITION) ||
|
||||||
|
\ s:SmartSearch(prevlinenum, '\<then\>')
|
||||||
|
return previndent - &shiftwidth
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" No indenting or outdenting is needed.
|
||||||
|
return -1
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Wrap s:GetLiveScriptIndent to keep the cursor position.
|
||||||
|
function! GetLiveScriptIndent(curlinenum)
|
||||||
|
let oldcursor = getpos('.')
|
||||||
|
let indent = s:GetLiveScriptIndent(a:curlinenum)
|
||||||
|
call setpos('.', oldcursor)
|
||||||
|
|
||||||
|
return indent
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
126
indent/lua.vim
Normal file
126
indent/lua.vim
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'lua') == -1
|
||||||
|
|
||||||
|
" Vim indent file
|
||||||
|
" Language: Lua
|
||||||
|
" URL: https://github.com/tbastos/vim-lua
|
||||||
|
|
||||||
|
" Initialization ------------------------------------------{{{1
|
||||||
|
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
setlocal autoindent
|
||||||
|
setlocal nosmartindent
|
||||||
|
|
||||||
|
setlocal indentexpr=GetLuaIndent()
|
||||||
|
setlocal indentkeys+=0=end,0=until,0=elseif,0=else
|
||||||
|
|
||||||
|
" Only define the function once.
|
||||||
|
if exists("*GetLuaIndent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Variables -----------------------------------------------{{{1
|
||||||
|
|
||||||
|
let s:open_patt = '\%(\<\%(function\|if\|repeat\|do\)\>\|(\|{\)'
|
||||||
|
let s:middle_patt = '\<\%(else\|elseif\)\>'
|
||||||
|
let s:close_patt = '\%(\<\%(end\|until\)\>\|)\|}\)'
|
||||||
|
|
||||||
|
let s:anon_func_start = '\S\+\s*[({].*\<function\s*(.*)\s*$'
|
||||||
|
let s:anon_func_end = '\<end\%(\s*[)}]\)\+'
|
||||||
|
|
||||||
|
" Expression used to check whether we should skip a match with searchpair().
|
||||||
|
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),1),'name') =~ 'luaComment\\|luaString'"
|
||||||
|
|
||||||
|
" Auxiliary Functions -------------------------------------{{{1
|
||||||
|
|
||||||
|
function s:IsInCommentOrString(lnum, col)
|
||||||
|
return synIDattr(synID(a:lnum, a:col, 1), 'name') =~ 'luaCommentLong\|luaStringLong'
|
||||||
|
\ && !(getline(a:lnum) =~ '^\s*\%(--\)\?\[=*\[') " opening tag is not considered 'in'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Find line above 'lnum' that isn't blank, in a comment or string.
|
||||||
|
function s:PrevLineOfCode(lnum)
|
||||||
|
let lnum = prevnonblank(a:lnum)
|
||||||
|
while s:IsInCommentOrString(lnum, 1)
|
||||||
|
let lnum = prevnonblank(lnum - 1)
|
||||||
|
endwhile
|
||||||
|
return lnum
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Gets line contents, excluding trailing comments.
|
||||||
|
function s:GetContents(lnum)
|
||||||
|
return substitute(getline(a:lnum), '\v\m--.*$', '', '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" GetLuaIndent Function -----------------------------------{{{1
|
||||||
|
|
||||||
|
function GetLuaIndent()
|
||||||
|
" if the line is in a long comment or string, don't change the indent
|
||||||
|
if s:IsInCommentOrString(v:lnum, 1)
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
let prev_line = s:PrevLineOfCode(v:lnum - 1)
|
||||||
|
if prev_line == 0
|
||||||
|
" this is the first non-empty line
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
let contents_cur = s:GetContents(v:lnum)
|
||||||
|
let contents_prev = s:GetContents(prev_line)
|
||||||
|
|
||||||
|
let original_cursor_pos = getpos(".")
|
||||||
|
|
||||||
|
let i = 0
|
||||||
|
|
||||||
|
" check if the previous line opens blocks
|
||||||
|
call cursor(v:lnum, 1)
|
||||||
|
let num_pairs = searchpair(s:open_patt, s:middle_patt, s:close_patt,
|
||||||
|
\ 'mrb', s:skip_expr, prev_line)
|
||||||
|
if num_pairs > 0
|
||||||
|
let i += num_pairs
|
||||||
|
endif
|
||||||
|
|
||||||
|
" special case: call(with, {anon = function() -- should indent only once
|
||||||
|
if num_pairs > 1 && contents_prev =~ s:anon_func_start
|
||||||
|
let i = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" check if current line closes blocks
|
||||||
|
call cursor(prev_line, col([prev_line,'$']))
|
||||||
|
let num_pairs = searchpair(s:open_patt, s:middle_patt, s:close_patt,
|
||||||
|
\ 'mr', s:skip_expr, v:lnum)
|
||||||
|
if num_pairs > 0
|
||||||
|
let i -= num_pairs
|
||||||
|
endif
|
||||||
|
|
||||||
|
" special case: end}) -- end of call with anon func should unindent once
|
||||||
|
if num_pairs > 1 && contents_cur =~ s:anon_func_end
|
||||||
|
let i = -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" if the previous line closed a paren, unindent (except with anon funcs)
|
||||||
|
call cursor(prev_line - 1, col([prev_line - 1, '$']))
|
||||||
|
let num_pairs = searchpair('(', '', ')', 'mr', s:skip_expr, prev_line)
|
||||||
|
if num_pairs > 0 && contents_prev !~ s:anon_func_end
|
||||||
|
let i -= 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" if this line closed a paren, indent (except with anon funcs)
|
||||||
|
call cursor(prev_line, col([prev_line, '$']))
|
||||||
|
let num_pairs = searchpair('(', '', ')', 'mr', s:skip_expr, v:lnum)
|
||||||
|
if num_pairs > 0 && contents_cur !~ s:anon_func_end
|
||||||
|
let i += 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
" restore cursor
|
||||||
|
call setpos(".", original_cursor_pos)
|
||||||
|
|
||||||
|
return indent(prev_line) + (&sw * i)
|
||||||
|
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
endif
|
||||||
358
indent/mako.vim
Normal file
358
indent/mako.vim
Normal file
@@ -0,0 +1,358 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mako') == -1
|
||||||
|
|
||||||
|
" Vim indent file
|
||||||
|
" Language: Mako
|
||||||
|
" Author: Scott Torborg <storborg@mit.edu>
|
||||||
|
" Version: 0.4
|
||||||
|
" License: Do What The Fuck You Want To Public License (WTFPL)
|
||||||
|
"
|
||||||
|
" ---------------------------------------------------------------------------
|
||||||
|
"
|
||||||
|
" DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
|
" Version 2, December 2004
|
||||||
|
"
|
||||||
|
" Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||||
|
"
|
||||||
|
" Everyone is permitted to copy and distribute verbatim or modified
|
||||||
|
" copies of this license document, and changing it is allowed as long
|
||||||
|
" as the name is changed.
|
||||||
|
"
|
||||||
|
" DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
|
" TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
"
|
||||||
|
" 0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||||
|
"
|
||||||
|
" ---------------------------------------------------------------------------
|
||||||
|
"
|
||||||
|
" This script does more useful indenting for Mako HTML templates. It indents
|
||||||
|
" inside of control blocks, defs, etc. Note that this indenting style will
|
||||||
|
" sacrifice readability of the output text for the sake of readability of the
|
||||||
|
" template.
|
||||||
|
"
|
||||||
|
" We'll use HTML indenting globally, python inside <% %> blocks. Inspired by
|
||||||
|
" the excellent PHP + HTML indentation files such as php.vim by Pim Snel.
|
||||||
|
"
|
||||||
|
" Changelog:
|
||||||
|
" 0.4 - 5 March 2010
|
||||||
|
" - Added license information
|
||||||
|
" 0.3 - 15 September 2009
|
||||||
|
" - Added explicit indenting for ## comments, fixed unindenting count,
|
||||||
|
" thanks to Mike Lewis (@MikeRLewis) for this
|
||||||
|
" 0.2 - 15 June 2009
|
||||||
|
" - Fixed issue where opening and closing mako tags on the same line
|
||||||
|
" would cause incorrect indenting
|
||||||
|
" 0.1 - 06 June 2009
|
||||||
|
" - Initial public release of mako indent file
|
||||||
|
|
||||||
|
let sw=2 " default shiftwidth of 2 spaces
|
||||||
|
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
setlocal nosmartindent
|
||||||
|
setlocal noautoindent
|
||||||
|
setlocal nocindent
|
||||||
|
setlocal nolisp
|
||||||
|
|
||||||
|
setlocal indentexpr=GetMakoIndent()
|
||||||
|
setlocal indentkeys+=*<Return>,<>>,<bs>,end,:
|
||||||
|
|
||||||
|
" Only define the function once.
|
||||||
|
if exists("*GetMakoIndent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists('g:html_indent_tags')
|
||||||
|
unlet g:html_indent_tags
|
||||||
|
endif
|
||||||
|
|
||||||
|
function IsInsidePythonBlock(startline)
|
||||||
|
" Loop until we get a line that's either <% or %>
|
||||||
|
let lnum = a:startline
|
||||||
|
while getline(lnum) !~ '\(%>\|<%\)$' && lnum > 0
|
||||||
|
let lnum = lnum - 1
|
||||||
|
endwhile
|
||||||
|
|
||||||
|
" lnum points to the last control. If it's a <% then we're inside an
|
||||||
|
" embedded python block, otherwise we're not.
|
||||||
|
return getline(lnum) =~ '<%$'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function GetMakoIndent()
|
||||||
|
" Find a non-empty line above the current line
|
||||||
|
let lnum = prevnonblank(v:lnum - 1)
|
||||||
|
|
||||||
|
" Hit the start of the file, use zero indent.
|
||||||
|
if lnum == 0
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
let line = getline(lnum) " last line
|
||||||
|
let cline = getline(v:lnum) " current line
|
||||||
|
let pline = getline(lnum - 1) " previous to last line
|
||||||
|
let ind = indent(lnum)
|
||||||
|
if line =~ '^\s*##'
|
||||||
|
return indent(lnum)
|
||||||
|
end
|
||||||
|
|
||||||
|
let restore_ic=&ic
|
||||||
|
let &ic=1 " ignore case
|
||||||
|
|
||||||
|
let ind = <SID>HtmlIndentSum(lnum, -1)
|
||||||
|
let ind = <SID>HtmlIndentSum(lnum, -1)
|
||||||
|
let ind = ind + <SID>HtmlIndentSum(v:lnum, 0)
|
||||||
|
|
||||||
|
let &ic=restore_ic
|
||||||
|
|
||||||
|
let ind = indent(lnum) + (&sw * ind)
|
||||||
|
|
||||||
|
" Indent after %anything: or <%anything NOT ending in />
|
||||||
|
if line =~ '^\s*%.*:\s*$'
|
||||||
|
let ind = ind + &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Unindent before %end* or </%anything
|
||||||
|
if cline =~ '^\s*%\s*end'
|
||||||
|
let ind = ind - &sw
|
||||||
|
endif
|
||||||
|
"
|
||||||
|
" Unindent before %else, %except, and %elif
|
||||||
|
if cline =~ '^\s*%\s*else' || cline =~ '^\s*%\s*except' || cline =~ '^\s*%\s*elif'
|
||||||
|
let ind = ind - &sw
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Indent at the beginning of a python control block
|
||||||
|
if line =~ '<%$'
|
||||||
|
let ind = ind + &sw
|
||||||
|
endif
|
||||||
|
"
|
||||||
|
" Unindent at the end of the python block.
|
||||||
|
if cline =~ '^\s*%>$'
|
||||||
|
let scanlnum = lnum
|
||||||
|
" Scan backwards until we find the beginning of this python block.
|
||||||
|
while getline(scanlnum) !~ '<%$' && scanlnum > 0
|
||||||
|
let scanlnum = scanlnum - 1
|
||||||
|
endwhile
|
||||||
|
let ind = indent(scanlnum)
|
||||||
|
endif
|
||||||
|
|
||||||
|
" If we're inside a python block and the previous line ends in a colon,
|
||||||
|
" indent.
|
||||||
|
if IsInsidePythonBlock(lnum - 1)
|
||||||
|
" Indent after :
|
||||||
|
if line =~ '\:$'
|
||||||
|
let ind = ind + &sw
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return ind
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
" [-- helper function to assemble tag list --]
|
||||||
|
fun! <SID>HtmlIndentPush(tag)
|
||||||
|
if exists('g:html_indent_tags')
|
||||||
|
let g:html_indent_tags = g:html_indent_tags.'\|'.a:tag
|
||||||
|
else
|
||||||
|
let g:html_indent_tags = a:tag
|
||||||
|
endif
|
||||||
|
endfun
|
||||||
|
|
||||||
|
fun! <SID>MakoIndentPush(tag)
|
||||||
|
if exists('g:mako_indent_tags')
|
||||||
|
let g:mako_indent_tags = g:mako_indent_tags.'\|'.a:tag
|
||||||
|
else
|
||||||
|
let g:mako_indent_tags = a:tag
|
||||||
|
endif
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- <ELEMENT ? - - ...> --]
|
||||||
|
call <SID>HtmlIndentPush('a')
|
||||||
|
call <SID>HtmlIndentPush('abbr')
|
||||||
|
call <SID>HtmlIndentPush('acronym')
|
||||||
|
call <SID>HtmlIndentPush('address')
|
||||||
|
call <SID>HtmlIndentPush('b')
|
||||||
|
call <SID>HtmlIndentPush('bdo')
|
||||||
|
call <SID>HtmlIndentPush('big')
|
||||||
|
call <SID>HtmlIndentPush('blockquote')
|
||||||
|
call <SID>HtmlIndentPush('button')
|
||||||
|
call <SID>HtmlIndentPush('caption')
|
||||||
|
call <SID>HtmlIndentPush('center')
|
||||||
|
call <SID>HtmlIndentPush('cite')
|
||||||
|
call <SID>HtmlIndentPush('code')
|
||||||
|
call <SID>HtmlIndentPush('colgroup')
|
||||||
|
call <SID>HtmlIndentPush('del')
|
||||||
|
call <SID>HtmlIndentPush('dfn')
|
||||||
|
call <SID>HtmlIndentPush('dir')
|
||||||
|
call <SID>HtmlIndentPush('div')
|
||||||
|
call <SID>HtmlIndentPush('dl')
|
||||||
|
call <SID>HtmlIndentPush('em')
|
||||||
|
call <SID>HtmlIndentPush('fieldset')
|
||||||
|
call <SID>HtmlIndentPush('font')
|
||||||
|
call <SID>HtmlIndentPush('form')
|
||||||
|
call <SID>HtmlIndentPush('frameset')
|
||||||
|
call <SID>HtmlIndentPush('h1')
|
||||||
|
call <SID>HtmlIndentPush('h2')
|
||||||
|
call <SID>HtmlIndentPush('h3')
|
||||||
|
call <SID>HtmlIndentPush('h4')
|
||||||
|
call <SID>HtmlIndentPush('h5')
|
||||||
|
call <SID>HtmlIndentPush('h6')
|
||||||
|
call <SID>HtmlIndentPush('i')
|
||||||
|
call <SID>HtmlIndentPush('iframe')
|
||||||
|
call <SID>HtmlIndentPush('ins')
|
||||||
|
call <SID>HtmlIndentPush('kbd')
|
||||||
|
call <SID>HtmlIndentPush('label')
|
||||||
|
call <SID>HtmlIndentPush('legend')
|
||||||
|
call <SID>HtmlIndentPush('map')
|
||||||
|
call <SID>HtmlIndentPush('menu')
|
||||||
|
call <SID>HtmlIndentPush('noframes')
|
||||||
|
call <SID>HtmlIndentPush('noscript')
|
||||||
|
call <SID>HtmlIndentPush('object')
|
||||||
|
call <SID>HtmlIndentPush('ol')
|
||||||
|
call <SID>HtmlIndentPush('optgroup')
|
||||||
|
call <SID>HtmlIndentPush('pre')
|
||||||
|
call <SID>HtmlIndentPush('q')
|
||||||
|
call <SID>HtmlIndentPush('s')
|
||||||
|
call <SID>HtmlIndentPush('samp')
|
||||||
|
call <SID>HtmlIndentPush('script')
|
||||||
|
call <SID>HtmlIndentPush('select')
|
||||||
|
call <SID>HtmlIndentPush('small')
|
||||||
|
call <SID>HtmlIndentPush('span')
|
||||||
|
call <SID>HtmlIndentPush('strong')
|
||||||
|
call <SID>HtmlIndentPush('style')
|
||||||
|
call <SID>HtmlIndentPush('sub')
|
||||||
|
call <SID>HtmlIndentPush('sup')
|
||||||
|
call <SID>HtmlIndentPush('table')
|
||||||
|
call <SID>HtmlIndentPush('textarea')
|
||||||
|
call <SID>HtmlIndentPush('title')
|
||||||
|
call <SID>HtmlIndentPush('tt')
|
||||||
|
call <SID>HtmlIndentPush('u')
|
||||||
|
call <SID>HtmlIndentPush('ul')
|
||||||
|
call <SID>HtmlIndentPush('var')
|
||||||
|
|
||||||
|
" For some reason the default HTML indentation script doesn't consider these
|
||||||
|
" elements to be worthy of indentation.
|
||||||
|
call <SID>HtmlIndentPush('p')
|
||||||
|
call <SID>HtmlIndentPush('dt')
|
||||||
|
call <SID>HtmlIndentPush('dd')
|
||||||
|
|
||||||
|
|
||||||
|
" [-- <ELEMENT ? O O ...> --]
|
||||||
|
if !exists('g:html_indent_strict')
|
||||||
|
call <SID>HtmlIndentPush('body')
|
||||||
|
call <SID>HtmlIndentPush('head')
|
||||||
|
call <SID>HtmlIndentPush('html')
|
||||||
|
call <SID>HtmlIndentPush('tbody')
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" [-- <ELEMENT ? O - ...> --]
|
||||||
|
if !exists('g:html_indent_strict_table')
|
||||||
|
call <SID>HtmlIndentPush('th')
|
||||||
|
call <SID>HtmlIndentPush('td')
|
||||||
|
call <SID>HtmlIndentPush('tr')
|
||||||
|
call <SID>HtmlIndentPush('tfoot')
|
||||||
|
call <SID>HtmlIndentPush('thead')
|
||||||
|
endif
|
||||||
|
|
||||||
|
" [-- <Mako Elements> --]
|
||||||
|
call <SID>MakoIndentPush('%def')
|
||||||
|
call <SID>MakoIndentPush('%block')
|
||||||
|
call <SID>MakoIndentPush('%call')
|
||||||
|
call <SID>MakoIndentPush('%doc')
|
||||||
|
call <SID>MakoIndentPush('%text')
|
||||||
|
call <SID>MakoIndentPush('%.\+:.\+')
|
||||||
|
|
||||||
|
delfun <SID>HtmlIndentPush
|
||||||
|
delfun <SID>MakoIndentPush
|
||||||
|
|
||||||
|
set cpo-=C
|
||||||
|
|
||||||
|
" [-- get number of regex matches in a string --]
|
||||||
|
fun! <SID>MatchCount(expr, pat)
|
||||||
|
let mpos = 0
|
||||||
|
let mcount = 0
|
||||||
|
let expr = a:expr
|
||||||
|
while (mpos > -1)
|
||||||
|
let mend = matchend(expr, a:pat)
|
||||||
|
if mend > -1
|
||||||
|
let mcount = mcount + 1
|
||||||
|
endif
|
||||||
|
if mend == mpos
|
||||||
|
let mpos = mpos + 1
|
||||||
|
else
|
||||||
|
let mpos = mend
|
||||||
|
endif
|
||||||
|
let expr = strpart(expr, mpos)
|
||||||
|
endwhile
|
||||||
|
return mcount
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- count indent-increasing tags of line a:lnum --]
|
||||||
|
fun! <SID>HtmlIndentOpen(lnum)
|
||||||
|
let s = substitute('x'.getline(a:lnum),
|
||||||
|
\ '.\{-}\(\(<\)\('.g:html_indent_tags.'\)\>\)', "\1", 'g')
|
||||||
|
let s = substitute(s, "[^\1].*$", '', '')
|
||||||
|
return strlen(s)
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- count indent-decreasing tags of line a:lnum --]
|
||||||
|
fun! <SID>HtmlIndentClose(lnum)
|
||||||
|
let s = substitute('x'.getline(a:lnum),
|
||||||
|
\ '.\{-}\(\(<\)/\('.g:html_indent_tags.'\)\>>\)', "\1", 'g')
|
||||||
|
let s = substitute(s, "[^\1].*$", '', '')
|
||||||
|
return strlen(s)
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- count indent-increasing mako tags of line a:lnum --]
|
||||||
|
fun! <SID>MakoIndentOpen(lnum)
|
||||||
|
let s = substitute('x'.getline(a:lnum),
|
||||||
|
\ '.\{-}\(\(<\)\('.g:mako_indent_tags.'\)\>\)', "\1", 'g')
|
||||||
|
let s = substitute(s, "[^\1].*$", '', '')
|
||||||
|
return strlen(s)
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- count indent-decreasing mako tags of line a:lnum --]
|
||||||
|
fun! <SID>MakoIndentClose(lnum)
|
||||||
|
let mcount = <SID>MatchCount(getline(a:lnum), '</\('.g:mako_indent_tags.'\)>')
|
||||||
|
let mcount = mcount + <SID>MatchCount(getline(a:lnum), '<\('.g:mako_indent_tags.'\)[^>]*/>')
|
||||||
|
return mcount
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- count indent-increasing '{' of (java|css) line a:lnum --]
|
||||||
|
fun! <SID>HtmlIndentOpenAlt(lnum)
|
||||||
|
return strlen(substitute(getline(a:lnum), '[^{]\+', '', 'g'))
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- count indent-decreasing '}' of (java|css) line a:lnum --]
|
||||||
|
fun! <SID>HtmlIndentCloseAlt(lnum)
|
||||||
|
return strlen(substitute(getline(a:lnum), '[^}]\+', '', 'g'))
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" [-- return the sum of indents respecting the syntax of a:lnum --]
|
||||||
|
fun! <SID>HtmlIndentSum(lnum, style)
|
||||||
|
let open = <SID>HtmlIndentOpen(a:lnum) + <SID>MakoIndentOpen(a:lnum)
|
||||||
|
let close = <SID>HtmlIndentClose(a:lnum) + <SID>MakoIndentClose(a:lnum)
|
||||||
|
if a:style == match(getline(a:lnum), '^\s*</')
|
||||||
|
if a:style == match(getline(a:lnum), '^\s*</\('.g:html_indent_tags.'\|'.g:mako_indent_tags.'\)')
|
||||||
|
if 0 != open || 0 != close
|
||||||
|
return open - close
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
if '' != &syntax &&
|
||||||
|
\ synIDattr(synID(a:lnum, 1, 1), 'name') =~ '\(css\|java\).*' &&
|
||||||
|
\ synIDattr(synID(a:lnum, strlen(getline(a:lnum)) - 1, 1), 'name')
|
||||||
|
\ =~ '\(css\|java\).*'
|
||||||
|
if a:style == match(getline(a:lnum), '^\s*}')
|
||||||
|
return <SID>HtmlIndentOpenAlt(a:lnum) - <SID>HtmlIndentCloseAlt(a:lnum)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
return 0
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" vim: set ts=4 sw=4:
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -121,7 +121,7 @@ function! GetNimIndent(lnum)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if pline =~ '\(type\|import\|const\|var\)\s*$'
|
if pline =~ '\(type\|import\|const\|var\)\s*$'
|
||||||
\ || pline =~ '=\s*\(object\|enum\|tuple\|generic\)'
|
\ || pline =~ '=\s*\(object\|enum\|tuple\|concept\)'
|
||||||
return plindent + &sw
|
return plindent + &sw
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
21
indent/proto.vim
Normal file
21
indent/proto.vim
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'protobuf') == -1
|
||||||
|
|
||||||
|
" Vim indent file
|
||||||
|
" Language: Protobuf
|
||||||
|
" Maintainer: Johannes Zellner <johannes@zellner.org>
|
||||||
|
" Last Change: Fri, 15 Mar 2002 07:53:54 CET
|
||||||
|
|
||||||
|
" Only load this indent file when no other was loaded.
|
||||||
|
if exists("b:did_indent")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let b:did_indent = 1
|
||||||
|
|
||||||
|
" Protobuf is like indenting C
|
||||||
|
setlocal cindent
|
||||||
|
setlocal expandtab
|
||||||
|
setlocal shiftwidth=2
|
||||||
|
|
||||||
|
let b:undo_indent = "setl cin<"
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -20,6 +20,11 @@ if !exists('g:ruby_indent_access_modifier_style')
|
|||||||
let g:ruby_indent_access_modifier_style = 'normal'
|
let g:ruby_indent_access_modifier_style = 'normal'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:ruby_indent_block_style')
|
||||||
|
" Possible values: "expression", "do"
|
||||||
|
let g:ruby_indent_block_style = 'expression'
|
||||||
|
endif
|
||||||
|
|
||||||
setlocal nosmartindent
|
setlocal nosmartindent
|
||||||
|
|
||||||
" Now, set up our indentation expression and keys that trigger it.
|
" Now, set up our indentation expression and keys that trigger it.
|
||||||
@@ -219,15 +224,15 @@ function s:GetMSL(lnum)
|
|||||||
elseif s:Match(lnum, s:non_bracket_continuation_regex) &&
|
elseif s:Match(lnum, s:non_bracket_continuation_regex) &&
|
||||||
\ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex))
|
\ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex))
|
||||||
" If the current line is a bracket continuation or a block-starter, but
|
" If the current line is a bracket continuation or a block-starter, but
|
||||||
" the previous is a non-bracket one, respect the previous' indentation,
|
" the previous is a non-bracket one, keep going to see if the previous
|
||||||
" and stop here.
|
" line is a part of another continuation.
|
||||||
"
|
"
|
||||||
" Example:
|
" Example:
|
||||||
" method_call one,
|
" method_call one,
|
||||||
" two {
|
" two {
|
||||||
" three
|
" three
|
||||||
"
|
"
|
||||||
return lnum
|
let msl = lnum
|
||||||
elseif s:Match(lnum, s:bracket_continuation_regex) &&
|
elseif s:Match(lnum, s:bracket_continuation_regex) &&
|
||||||
\ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex))
|
\ (s:Match(msl, s:bracket_continuation_regex) || s:Match(msl, s:block_continuation_regex))
|
||||||
" If both lines are bracket continuations (the current may also be a
|
" If both lines are bracket continuations (the current may also be a
|
||||||
@@ -419,7 +424,9 @@ function GetRubyIndent(...)
|
|||||||
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
|
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
|
||||||
if line[col-1]==')' && col('.') != col('$') - 1
|
if line[col-1]==')' && col('.') != col('$') - 1
|
||||||
let ind = virtcol('.') - 1
|
let ind = virtcol('.') - 1
|
||||||
else
|
elseif g:ruby_indent_block_style == 'do'
|
||||||
|
let ind = indent(line('.'))
|
||||||
|
else " g:ruby_indent_block_style == 'expression'
|
||||||
let ind = indent(s:GetMSL(line('.')))
|
let ind = indent(s:GetMSL(line('.')))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -444,12 +451,15 @@ function GetRubyIndent(...)
|
|||||||
\ strpart(line, col('.') - 1, 2) !~ 'do'
|
\ strpart(line, col('.') - 1, 2) !~ 'do'
|
||||||
" assignment to case/begin/etc, on the same line, hanging indent
|
" assignment to case/begin/etc, on the same line, hanging indent
|
||||||
let ind = virtcol('.') - 1
|
let ind = virtcol('.') - 1
|
||||||
|
elseif g:ruby_indent_block_style == 'do'
|
||||||
|
" align to line of the "do", not to the MSL
|
||||||
|
let ind = indent(line('.'))
|
||||||
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
|
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
|
||||||
" in the case of assignment to the msl, align to the starting line,
|
" in the case of assignment to the MSL, align to the starting line,
|
||||||
" not to the msl
|
" not to the MSL
|
||||||
let ind = indent(line('.'))
|
let ind = indent(line('.'))
|
||||||
else
|
else
|
||||||
" align to the msl
|
" align to the MSL
|
||||||
let ind = indent(msl)
|
let ind = indent(msl)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -516,7 +526,10 @@ function GetRubyIndent(...)
|
|||||||
if s:Match(lnum, s:block_regex)
|
if s:Match(lnum, s:block_regex)
|
||||||
let msl = s:GetMSL(lnum)
|
let msl = s:GetMSL(lnum)
|
||||||
|
|
||||||
if getline(msl) =~ '=\s*\(#.*\)\=$'
|
if g:ruby_indent_block_style == 'do'
|
||||||
|
" don't align to the msl, align to the "do"
|
||||||
|
let ind = indent(lnum) + sw
|
||||||
|
elseif getline(msl) =~ '=\s*\(#.*\)\=$'
|
||||||
" in the case of assignment to the msl, align to the starting line,
|
" in the case of assignment to the msl, align to the starting line,
|
||||||
" not to the msl
|
" not to the msl
|
||||||
let ind = indent(lnum) + sw
|
let ind = indent(lnum) + sw
|
||||||
@@ -564,7 +577,7 @@ function GetRubyIndent(...)
|
|||||||
if s:Match(line('.'), s:ruby_indent_keywords)
|
if s:Match(line('.'), s:ruby_indent_keywords)
|
||||||
return indent('.') + sw
|
return indent('.') + sw
|
||||||
else
|
else
|
||||||
return indent('.')
|
return indent(s:GetMSL(line('.')))
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
call cursor(clnum, vcol)
|
call cursor(clnum, vcol)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
|||||||
" Vim indent file
|
" Vim indent file
|
||||||
" Language: Rust
|
" Language: Rust
|
||||||
" Author: Chris Morgan <me@chrismorgan.info>
|
" Author: Chris Morgan <me@chrismorgan.info>
|
||||||
" Last Change: 2014 Sep 13
|
" Last Change: 2016 Jul 15
|
||||||
|
|
||||||
" Only load this indent file when no other was loaded.
|
" Only load this indent file when no other was loaded.
|
||||||
if exists("b:did_indent")
|
if exists("b:did_indent")
|
||||||
@@ -134,6 +134,7 @@ function GetRustIndent(lnum)
|
|||||||
\ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]'
|
\ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]'
|
||||||
\ && prevline !~ '^\s*fn\s'
|
\ && prevline !~ '^\s*fn\s'
|
||||||
\ && prevline !~ '([^()]\+,$'
|
\ && prevline !~ '([^()]\+,$'
|
||||||
|
\ && s:get_line_trimmed(a:lnum) !~ '^\s*\S\+\s*=>'
|
||||||
" Oh ho! The previous line ended in a comma! I bet cindent will try to
|
" Oh ho! The previous line ended in a comma! I bet cindent will try to
|
||||||
" take this too far... For now, let's normally use the previous line's
|
" take this too far... For now, let's normally use the previous line's
|
||||||
" indent.
|
" indent.
|
||||||
@@ -158,6 +159,8 @@ function GetRustIndent(lnum)
|
|||||||
" if baz && (foo ||
|
" if baz && (foo ||
|
||||||
" bar) {
|
" bar) {
|
||||||
"
|
"
|
||||||
|
" Another case is when the current line is a new match arm.
|
||||||
|
"
|
||||||
" There are probably other cases where we don't want to do this as
|
" There are probably other cases where we don't want to do this as
|
||||||
" well. Add them as needed.
|
" well. Add them as needed.
|
||||||
return indent(prevlinenum)
|
return indent(prevlinenum)
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ let &cpo = s:cpo_save
|
|||||||
unlet s:cpo_save
|
unlet s:cpo_save
|
||||||
|
|
||||||
function! Fixedgq(lnum, count)
|
function! Fixedgq(lnum, count)
|
||||||
let l:tw = &tw ? &tw : 80;
|
let l:tw = &tw ? &tw : 80
|
||||||
|
|
||||||
let l:count = a:count
|
let l:count = a:count
|
||||||
let l:first_char = indent(a:lnum) + 1
|
let l:first_char = indent(a:lnum) + 1
|
||||||
|
|||||||
249
syntax/applescript.vim
Normal file
249
syntax/applescript.vim
Normal file
@@ -0,0 +1,249 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'applescript') == -1
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: AppleScript
|
||||||
|
" Maintainer: Jim Eberle <jim.eberle@fastnlight.com>
|
||||||
|
" Last Change: Mar 18, 2010
|
||||||
|
" URL: http://www.fastnlight.com/syntax/applescript.vim
|
||||||
|
|
||||||
|
" Use :syn w/in a buffer to see language element breakdown
|
||||||
|
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" --- Statement ---
|
||||||
|
syn keyword scptStmt get set count copy run global local prop property
|
||||||
|
syn keyword scptStmt close put delete duplicate exists
|
||||||
|
syn keyword scptStmt launch open print quit make move reopen save
|
||||||
|
syn keyword scptStmt saving into
|
||||||
|
hi def link scptStmt Statement
|
||||||
|
|
||||||
|
" --- Type ---
|
||||||
|
syn keyword scptType text string number integer real color date
|
||||||
|
hi def link scptType Type
|
||||||
|
|
||||||
|
" --- Operator ---
|
||||||
|
syn keyword scptOp div mod not and or as
|
||||||
|
syn match scptOp "[-+*/^&]"
|
||||||
|
" MacRoman single char :- (divide)
|
||||||
|
exec 'syn match scptOp "'.nr2char(214).'"'
|
||||||
|
syn match scptOp "\<\(a \)\?\(ref\( to\)\?\|reference to\)\>"
|
||||||
|
hi def link scptOp Operator
|
||||||
|
|
||||||
|
" Containment
|
||||||
|
syn match scptIN "\<starts\? with\>"
|
||||||
|
syn match scptIN "\<begins\? with\>"
|
||||||
|
syn match scptIN "\<ends\? with\>"
|
||||||
|
syn match scptIN "\<contains\>"
|
||||||
|
syn match scptIN "\<does not contain\>"
|
||||||
|
syn match scptIN "\<doesn't contain\>"
|
||||||
|
syn match scptIN "\<is in\>"
|
||||||
|
syn match scptIN "\<is contained by\>"
|
||||||
|
syn match scptIN "\<is not in\>"
|
||||||
|
syn match scptIN "\<is not contained by\>"
|
||||||
|
syn match scptIN "\<isn't contained by\>"
|
||||||
|
hi def link scptIN scptOp
|
||||||
|
|
||||||
|
" Equals
|
||||||
|
syn match scptEQ "="
|
||||||
|
syn match scptEQ "\<equal\>"
|
||||||
|
syn match scptEQ "\<equals\>"
|
||||||
|
syn match scptEQ "\<equal to\>"
|
||||||
|
syn match scptEQ "\<is\>"
|
||||||
|
syn match scptEQ "\<is equal to\>"
|
||||||
|
hi def link scptEQ scptOp
|
||||||
|
|
||||||
|
" Not Equals
|
||||||
|
syn match scptNE "\<does not equal\>"
|
||||||
|
syn match scptNE "\<doesn't equal\>"
|
||||||
|
syn match scptNE "\<is not\>"
|
||||||
|
syn match scptNE "\<is not equal\( to\)\?\>"
|
||||||
|
syn match scptNE "\<isn't\>"
|
||||||
|
syn match scptNE "\<isn't equal\( to\)\?\>"
|
||||||
|
hi def link scptNE scptOp
|
||||||
|
" MacRoman single char /=
|
||||||
|
exec 'syn match scptNE "'.nr2char(173).'"'
|
||||||
|
|
||||||
|
" Less Than
|
||||||
|
syn match scptLT "<"
|
||||||
|
syn match scptLT "\<comes before\>"
|
||||||
|
syn match scptLT "\(is \)\?less than"
|
||||||
|
syn match scptLT "\<is not greater than or equal\( to\)\?\>"
|
||||||
|
syn match scptLT "\<isn't greater than or equal\( to\)\?\>"
|
||||||
|
hi def link scptLT scptOp
|
||||||
|
|
||||||
|
" Greater Than
|
||||||
|
syn match scptGT ">"
|
||||||
|
syn match scptGT "\<comes after\>"
|
||||||
|
syn match scptGT "\(is \)\?greater than"
|
||||||
|
syn match scptGT "\<is not less than or equal\( to\)\?\>"
|
||||||
|
syn match scptGT "\<isn't less than or equal\( to\)\?\>"
|
||||||
|
hi def link scptGT scptOp
|
||||||
|
|
||||||
|
" Less Than or Equals
|
||||||
|
syn match scptLE "<="
|
||||||
|
syn match scptLE "\<does not come after\>"
|
||||||
|
syn match scptLE "\<doesn't come after\>"
|
||||||
|
syn match scptLE "\(is \)\?less than or equal\( to\)\?"
|
||||||
|
syn match scptLE "\<is not greater than\>"
|
||||||
|
syn match scptLE "\<isn't greater than\>"
|
||||||
|
hi def link scptLE scptOp
|
||||||
|
" MacRoman single char <=
|
||||||
|
exec 'syn match scptLE "'.nr2char(178).'"'
|
||||||
|
|
||||||
|
" Greater Than or Equals
|
||||||
|
syn match scptGE ">="
|
||||||
|
syn match scptGE "\<does not come before\>"
|
||||||
|
syn match scptGE "\<doesn't come before\>"
|
||||||
|
syn match scptGE "\(is \)\?greater than or equal\( to\)\?"
|
||||||
|
syn match scptGE "\<is not less than\>"
|
||||||
|
syn match scptGE "\<isn't less than\>"
|
||||||
|
hi def link scptGE scptOp
|
||||||
|
" MacRoman single char >=
|
||||||
|
exec 'syn match scptGE "'.nr2char(179).'"'
|
||||||
|
|
||||||
|
" --- Constant String ---
|
||||||
|
syn region scptString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||||
|
hi def link scptString String
|
||||||
|
|
||||||
|
" --- Constant Number ---
|
||||||
|
syn match scptNumber "\<-\?\d\+\>"
|
||||||
|
hi def link scptNumber Number
|
||||||
|
|
||||||
|
" --- Constant Float ---
|
||||||
|
syn match scptFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\="
|
||||||
|
syn match scptFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=\>"
|
||||||
|
syn match scptFloat display contained "\d\+e[-+]\>"
|
||||||
|
hi def link scptFloat Float
|
||||||
|
|
||||||
|
" --- Constant Boolean ---
|
||||||
|
syn keyword scptBoolean true false yes no ask
|
||||||
|
hi def link scptBoolean Boolean
|
||||||
|
|
||||||
|
" --- Other Constants ---
|
||||||
|
syn keyword scptConst it me version pi result space tab anything
|
||||||
|
syn match scptConst "\<missing value\>"
|
||||||
|
|
||||||
|
" Considering and Ignoring
|
||||||
|
syn match scptConst "\<application responses\>"
|
||||||
|
syn match scptConst "\<current application\>"
|
||||||
|
syn match scptConst "\<white space\>"
|
||||||
|
syn keyword scptConst case diacriticals expansion hyphens punctuation
|
||||||
|
hi def link scptConst Constant
|
||||||
|
|
||||||
|
" Style
|
||||||
|
syn match scptStyle "\<all caps\>"
|
||||||
|
syn match scptStyle "\<all lowercase\>"
|
||||||
|
syn match scptStyle "\<small caps\>"
|
||||||
|
syn keyword scptStyle bold condensed expanded hidden italic outline plain
|
||||||
|
syn keyword scptStyle shadow strikethrough subscript superscript underline
|
||||||
|
hi def link scptStyle scptConst
|
||||||
|
|
||||||
|
" Day
|
||||||
|
syn keyword scptDay Mon Tue Wed Thu Fri Sat Sun
|
||||||
|
syn keyword scptDay Monday Tuesday Wednesday Thursday Friday Saturday Sunday
|
||||||
|
syn keyword scptDay weekday
|
||||||
|
hi def link scptDay scptConst
|
||||||
|
|
||||||
|
" Month
|
||||||
|
syn keyword scptMonth Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
|
||||||
|
syn keyword scptMonth January February March
|
||||||
|
syn keyword scptMonth April May June
|
||||||
|
syn keyword scptMonth July August September
|
||||||
|
syn keyword scptMonth October November December
|
||||||
|
syn keyword scptMonth month
|
||||||
|
hi def link scptMonth scptConst
|
||||||
|
|
||||||
|
" Time
|
||||||
|
syn keyword scptTime minutes hours days weeks
|
||||||
|
hi def link scptTime scptConstant
|
||||||
|
|
||||||
|
" --- Conditional ---
|
||||||
|
syn keyword scptCond if then else
|
||||||
|
syn match scptCond "\<end if\>"
|
||||||
|
hi def link scptCond Conditional
|
||||||
|
|
||||||
|
" --- Repeat ---
|
||||||
|
syn keyword scptRepeat repeat with from to by continue
|
||||||
|
syn match scptRepeat "\<repeat while\>"
|
||||||
|
syn match scptRepeat "\<repeat until\>"
|
||||||
|
syn match scptRepeat "\<repeat with\>"
|
||||||
|
syn match scptRepeat "\<end repeat\>"
|
||||||
|
hi def link scptRepeat Repeat
|
||||||
|
|
||||||
|
" --- Exception ---
|
||||||
|
syn keyword scptException try error
|
||||||
|
syn match scptException "\<on error\>"
|
||||||
|
syn match scptException "\<end try\>"
|
||||||
|
syn match scptException "\<end error\>"
|
||||||
|
hi def link scptException Exception
|
||||||
|
|
||||||
|
" --- Keyword ---
|
||||||
|
syn keyword scptKeyword end tell times exit
|
||||||
|
syn keyword scptKeyword application file alias activate
|
||||||
|
syn keyword scptKeyword script on return without given
|
||||||
|
syn keyword scptKeyword considering ignoring items delimiters
|
||||||
|
syn keyword scptKeyword some each every whose where id index item its
|
||||||
|
syn keyword scptKeyword first second third fourth fifth sixth seventh
|
||||||
|
syn keyword scptKeyword eighth ninth tenth container
|
||||||
|
syn match scptKeyword "\d\+\(st\|nd\|rd\|th\)"
|
||||||
|
syn keyword scptKeyword last front back middle named thru through
|
||||||
|
syn keyword scptKeyword before after in of the
|
||||||
|
syn match scptKeyword "\<text \>"
|
||||||
|
syn match scptKeyword "\<partial result\>"
|
||||||
|
syn match scptKeyword "\<but ignoring\>"
|
||||||
|
syn match scptKeyword "\<but considering\>"
|
||||||
|
syn match scptKeyword "\<with timeout\>"
|
||||||
|
syn match scptKeyword "\<with transaction\>"
|
||||||
|
syn match scptKeyword "\<do script\>"
|
||||||
|
syn match scptKeyword "\<POSIX path\>"
|
||||||
|
syn match scptKeyword "\<quoted form\>"
|
||||||
|
syn match scptKeyword "'s"
|
||||||
|
hi def link scptKeyword Keyword
|
||||||
|
|
||||||
|
" US Units
|
||||||
|
syn keyword scptUnitUS quarts gallons ounces pounds inches feet yards miles
|
||||||
|
syn match scptUnitUS "\<square feet\>"
|
||||||
|
syn match scptUnitUS "\<square yards\>"
|
||||||
|
syn match scptUnitUS "\<square miles\>"
|
||||||
|
syn match scptUnitUS "\<cubic inches\>"
|
||||||
|
syn match scptUnitUS "\<cubic feet\>"
|
||||||
|
syn match scptUnitUS "\<cubic yards\>"
|
||||||
|
syn match scptUnitUS "\<degrees Fahrenheit\>"
|
||||||
|
hi def link scptUnitUS scptKey
|
||||||
|
|
||||||
|
" British Units
|
||||||
|
syn keyword scptUnitBT litres centimetres metres kilometres
|
||||||
|
syn match scptUnitBT "\<square metres\>"
|
||||||
|
syn match scptUnitBT "\<square kilometres\>"
|
||||||
|
syn match scptUnitBT "\<cubic centimetres\>"
|
||||||
|
syn match scptUnitBT "\<cubic metres\>"
|
||||||
|
hi def link scptUnitBT scptKey
|
||||||
|
|
||||||
|
" Metric Units
|
||||||
|
syn keyword scptUnitMT liters centimeters meters kilometers grams kilograms
|
||||||
|
syn match scptUnitMT "\<square meters\>"
|
||||||
|
syn match scptUnitMT "\<square kilometers\>"
|
||||||
|
syn match scptUnitMT "\<cubic centimeters\>"
|
||||||
|
syn match scptUnitMT "\<cubic meters\>"
|
||||||
|
syn match scptUnitMT "\<degrees Celsius\>"
|
||||||
|
syn match scptUnitMT "\<degrees Kelvin\>"
|
||||||
|
hi def link scptUnitMT scptKey
|
||||||
|
|
||||||
|
" --- Comment ---
|
||||||
|
syn match scptComment "--.*"
|
||||||
|
syn match scptComment "#.*"
|
||||||
|
syn region scptComment start="(\*" end="\*)"
|
||||||
|
hi def link scptComment Comment
|
||||||
|
|
||||||
|
" --- Todo ---
|
||||||
|
syn keyword scptTodo contained TODO FIXME XXX
|
||||||
|
hi def link scptTodo Todo
|
||||||
|
|
||||||
|
let b:current_syntax = "applescript"
|
||||||
|
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -21,21 +21,39 @@ unlet! b:current_syntax
|
|||||||
syn case match
|
syn case match
|
||||||
syn clear htmlError
|
syn clear htmlError
|
||||||
|
|
||||||
|
if has('patch-7.4.1142')
|
||||||
|
syn iskeyword @,48-57,_,192-255,@-@,:
|
||||||
|
else
|
||||||
|
setlocal iskeyword+=@-@
|
||||||
|
endif
|
||||||
|
|
||||||
syn region bladeEcho matchgroup=bladeDelimiter start="@\@<!{{" end="}}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
|
syn region bladeEcho matchgroup=bladeDelimiter start="@\@<!{{" end="}}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
|
||||||
syn region bladeEcho matchgroup=bladeDelimiter start="{!!" end="!!}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
|
syn region bladeEcho matchgroup=bladeDelimiter start="{!!" end="!!}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
|
||||||
syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" contains=bladeTodo containedin=ALLBUT,@bladeExempt keepend
|
syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" contains=bladeTodo containedin=ALLBUT,@bladeExempt keepend
|
||||||
|
|
||||||
syn keyword bladeKeyword @if @elseif @foreach @forelse @for @while @can @include @each @inject @extends @section @stack @push @unless @yield @parent @hasSection nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
|
syn keyword bladeKeyword @if @elseif @foreach @forelse @for @while @can @cannot @elsecan @elsecannot @include @includeIf @each @inject @extends @section @stack @push @unless @yield @parent @hasSection @break @continue @unset @lang @choice nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
|
||||||
syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @empty @endforelse @endwhile @endcan @stop @append @endsection @endpush @show containedin=ALLBUT,@bladeExempt
|
syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @empty @endforelse @endwhile @endcan @endcannot @stop @append @endsection @endpush @show @overwrite @verbatim @endverbatim containedin=ALLBUT,@bladeExempt
|
||||||
|
|
||||||
|
if exists('g:blade_custom_directives')
|
||||||
|
exe "syn keyword bladeKeyword @" . join(g:blade_custom_directives, ' @') . " nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt"
|
||||||
|
endif
|
||||||
|
if exists('g:blade_custom_directives_pairs')
|
||||||
|
exe "syn keyword bladeKeyword @" . join(keys(g:blade_custom_directives_pairs), ' @') . " nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt"
|
||||||
|
exe "syn keyword bladeKeyword @" . join(values(g:blade_custom_directives_pairs), ' @') . " containedin=ALLBUT,@bladeExempt"
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn region bladePhpRegion matchgroup=bladeKeyword start="\<@php\>\%(\s*(\)\@!" end="\<@endphp\>" contains=@bladePhp containedin=ALLBUT,@bladeExempt keepend
|
||||||
|
syn match bladeKeyword "@php\ze\s*(" nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
|
||||||
|
|
||||||
syn region bladePhpParenBlock matchgroup=bladeDelimiter start="\s*(" end=")" contains=@bladePhp,bladePhpParenBlock skipwhite contained
|
syn region bladePhpParenBlock matchgroup=bladeDelimiter start="\s*(" end=")" contains=@bladePhp,bladePhpParenBlock skipwhite contained
|
||||||
|
|
||||||
syn cluster bladePhp contains=@phpClTop
|
syn cluster bladePhp contains=@phpClTop
|
||||||
syn cluster bladeExempt contains=bladeComment,@htmlTop
|
syn cluster bladeExempt contains=bladeComment,bladePhpRegion,bladePhpParenBlock,@htmlTop
|
||||||
|
|
||||||
syn cluster htmlPreproc add=bladeEcho,bladeComment
|
syn cluster htmlPreproc add=bladeEcho,bladeComment,bladePhpRegion
|
||||||
|
|
||||||
syn keyword bladeTodo todo fixme xxx contained
|
syn case ignore
|
||||||
|
syn keyword bladeTodo todo fixme xxx note contained
|
||||||
|
|
||||||
hi def link bladeDelimiter PreProc
|
hi def link bladeDelimiter PreProc
|
||||||
hi def link bladeComment Comment
|
hi def link bladeComment Comment
|
||||||
|
|||||||
@@ -184,6 +184,11 @@ syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumbe
|
|||||||
syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
|
syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||||
"hex number
|
"hex number
|
||||||
syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
|
syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||||
|
if s:ft ==# 'cpp' && !exists("cpp_no_cpp14")
|
||||||
|
syn match cNumber display contained "\d\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
|
||||||
|
syn match cNumber display contained "0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
|
||||||
|
syn match cNumber display contained "0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
|
||||||
|
endif
|
||||||
" Flag the first zero of an octal number as something special
|
" Flag the first zero of an octal number as something special
|
||||||
syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
|
syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
|
||||||
syn match cOctalZero display contained "\<0"
|
syn match cOctalZero display contained "\<0"
|
||||||
@@ -297,7 +302,7 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
|
|||||||
syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN
|
syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN
|
||||||
syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX
|
syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX
|
||||||
if !exists("c_no_c99")
|
if !exists("c_no_c99")
|
||||||
syn keyword cConstant __func__
|
syn keyword cConstant __func__ __VA_ARGS__
|
||||||
syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX
|
syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX
|
||||||
syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN
|
syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN
|
||||||
syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX
|
syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -39,7 +39,7 @@ syn keyword cppConstant __cplusplus
|
|||||||
|
|
||||||
" C++ 11 extensions
|
" C++ 11 extensions
|
||||||
if !exists("cpp_no_cpp11")
|
if !exists("cpp_no_cpp11")
|
||||||
syn keyword cppModifier override final
|
syn keyword cppModifier override final auto
|
||||||
syn keyword cppType nullptr_t
|
syn keyword cppType nullptr_t
|
||||||
syn keyword cppExceptions noexcept
|
syn keyword cppExceptions noexcept
|
||||||
syn keyword cppStorageClass constexpr decltype thread_local
|
syn keyword cppStorageClass constexpr decltype thread_local
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ syn region cryString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=crySpecial
|
|||||||
syn region cryString start=+``+ skip=+\\\\\|\\"+ end=+``+ contains=hsSpecialChar
|
syn region cryString start=+``+ skip=+\\\\\|\\"+ end=+``+ contains=hsSpecialChar
|
||||||
syn match cryCharacter "[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=crySpecialChar,crySpecialCharError
|
syn match cryCharacter "[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=crySpecialChar,crySpecialCharError
|
||||||
syn match cryCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=crySpecialChar,crySpecialCharError
|
syn match cryCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=crySpecialChar,crySpecialCharError
|
||||||
syn match cryNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>"
|
syn match cryNumber "\<[0-9]\+\>\|\<0[b][01]\+\>\|\<0[x][0-9a-fA-F]\+\>\|\<0[o][0-7]\+\>"
|
||||||
|
|
||||||
" Keyword definitions.
|
" Keyword definitions.
|
||||||
|
|
||||||
@@ -61,10 +61,12 @@ syn keyword cryPrimitive error parity lg2 pmod pdiv pmult format
|
|||||||
syn keyword cryPrimitive join split groupBy take drop min max negate reverse
|
syn keyword cryPrimitive join split groupBy take drop min max negate reverse
|
||||||
syn keyword cryPrimitive project tail width
|
syn keyword cryPrimitive project tail width
|
||||||
syn keyword cryPrimitive ASSERT
|
syn keyword cryPrimitive ASSERT
|
||||||
|
syn keyword cryPrimitive module import private
|
||||||
|
|
||||||
" Comments
|
" Comments
|
||||||
syn match cryLineComment "//.*"
|
syn keyword cryTodo contained TODO FIXME XXX
|
||||||
syn region cryBlockComment start="/\*" end="\*/" contains=cryBlockComment
|
syn match cryLineComment "//.*" contains=cryTodo
|
||||||
|
syn region cryBlockComment start="/\*" end="\*/" contains=cryBlockComment,cryTodo
|
||||||
|
|
||||||
if !exists("cry_minlines")
|
if !exists("cry_minlines")
|
||||||
let cry_minlines = 50
|
let cry_minlines = 50
|
||||||
@@ -103,6 +105,7 @@ if version >= 508 || !exists("did_cry_syntax_inits")
|
|||||||
hi link cryBoolean Boolean
|
hi link cryBoolean Boolean
|
||||||
hi link cryType Type
|
hi link cryType Type
|
||||||
hi link cryProp Keyword
|
hi link cryProp Keyword
|
||||||
|
hi link cryTodo Todo
|
||||||
|
|
||||||
delcommand HiLink
|
delcommand HiLink
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ syntax keyword dartConditional if else switch
|
|||||||
syntax keyword dartRepeat do while for
|
syntax keyword dartRepeat do while for
|
||||||
syntax keyword dartBoolean true false
|
syntax keyword dartBoolean true false
|
||||||
syntax keyword dartConstant null
|
syntax keyword dartConstant null
|
||||||
syntax keyword dartTypedef this super class typedef
|
syntax keyword dartTypedef this super class typedef enum
|
||||||
syntax keyword dartOperator new is as in factory
|
syntax keyword dartOperator new is as in
|
||||||
syntax match dartOperator "+=\=\|-=\=\|*=\=\|/=\=\|%=\=\|\~/=\=\|<<=\=\|>>=\=\|[<>]=\=\|===\=\|\!==\=\|&=\=\|\^=\=\||=\=\|||\|&&\|\[\]=\=\|=>\|!\|\~\|?\|:"
|
syntax match dartOperator "+=\=\|-=\=\|*=\=\|/=\=\|%=\=\|\~/=\=\|<<=\=\|>>=\=\|[<>]=\=\|===\=\|\!==\=\|&=\=\|\^=\=\||=\=\|||\|&&\|\[\]=\=\|=>\|!\|\~\|?\|:"
|
||||||
syntax keyword dartType void var bool int double num dynamic
|
syntax keyword dartType void var bool int double num dynamic
|
||||||
syntax keyword dartStatement return
|
syntax keyword dartStatement return
|
||||||
syntax keyword dartStorageClass static abstract final const
|
syntax keyword dartStorageClass static abstract final const factory
|
||||||
syntax keyword dartExceptions throw rethrow try on catch finally
|
syntax keyword dartExceptions throw rethrow try on catch finally
|
||||||
syntax keyword dartAssert assert
|
syntax keyword dartAssert assert
|
||||||
syntax keyword dartClassDecl extends with implements
|
syntax keyword dartClassDecl extends with implements
|
||||||
@@ -39,11 +39,17 @@ syntax match dartUserLabelRef "\k\+" contained
|
|||||||
syntax region dartLabelRegion transparent matchgroup=dartLabel start="\<case\>" matchgroup=NONE end=":"
|
syntax region dartLabelRegion transparent matchgroup=dartLabel start="\<case\>" matchgroup=NONE end=":"
|
||||||
syntax keyword dartLabel default
|
syntax keyword dartLabel default
|
||||||
|
|
||||||
syntax match dartLibrary "^\(import\|part of\|part\|export\|library\|show\|hide\)\s"
|
syntax match dartLibrary "^\(import\|export\)\>" nextgroup=dartUri skipwhite
|
||||||
|
syntax region dartUri contained start=+r\=\z(["']\)+ end=+\z1+ nextgroup=dartCombinators skipwhite
|
||||||
|
syntax region dartCombinators contained start="" end=";" contains=dartCombinator
|
||||||
|
syntax keyword dartCombinator contained show hide deferred as
|
||||||
|
syntax match dartLibrary "^\(library\|part of\|part\)\>"
|
||||||
|
|
||||||
|
syntax match dartMetadata "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>"
|
||||||
|
|
||||||
" Comments
|
" Comments
|
||||||
syntax keyword dartTodo contained TODO FIXME XXX
|
syntax keyword dartTodo contained TODO FIXME XXX
|
||||||
syntax region dartComment start="/\*" end="\*/" contains=dartTodo,dartDocLink,@Spell
|
syntax region dartComment start="/\*" end="\*/" contains=dartComment,dartTodo,dartDocLink,@Spell
|
||||||
syntax match dartLineComment "//.*" contains=dartTodo,@Spell
|
syntax match dartLineComment "//.*" contains=dartTodo,@Spell
|
||||||
syntax match dartLineDocComment "///.*" contains=dartTodo,dartDocLink,@Spell
|
syntax match dartLineDocComment "///.*" contains=dartTodo,dartDocLink,@Spell
|
||||||
syntax region dartDocLink oneline contained start=+\[+ end=+\]+
|
syntax region dartDocLink oneline contained start=+\[+ end=+\]+
|
||||||
@@ -96,9 +102,12 @@ highlight default link dartInterpolation PreProc
|
|||||||
highlight default link dartDocLink SpecialComment
|
highlight default link dartDocLink SpecialComment
|
||||||
highlight default link dartSpecialChar SpecialChar
|
highlight default link dartSpecialChar SpecialChar
|
||||||
highlight default link dartLibrary Include
|
highlight default link dartLibrary Include
|
||||||
|
highlight default link dartUri String
|
||||||
|
highlight default link dartCombinator Keyword
|
||||||
highlight default link dartCoreClasses Type
|
highlight default link dartCoreClasses Type
|
||||||
highlight default link dartCoreTypedefs Typedef
|
highlight default link dartCoreTypedefs Typedef
|
||||||
highlight default link dartCoreExceptions Exception
|
highlight default link dartCoreExceptions Exception
|
||||||
|
highlight default link dartMetadata PreProc
|
||||||
|
|
||||||
let b:current_syntax = "dart"
|
let b:current_syntax = "dart"
|
||||||
let b:spell_options = "contained"
|
let b:spell_options = "contained"
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ syn region elixirRegex matchgroup=elixirRegexDelimiter start="%r/" end="/[uiomxf
|
|||||||
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation
|
syn cluster elixirRegexSpecial contains=elixirRegexEscape,elixirRegexCharClass,elixirRegexQuantifier,elixirRegexEscapePunctuation
|
||||||
syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
|
syn cluster elixirStringContained contains=elixirInterpolation,elixirRegexEscape,elixirRegexCharClass
|
||||||
|
|
||||||
syn region elixirString matchgroup=elixirStringDelimiter start="'" end="'" skip="\\'\|\\\\"
|
syn region elixirString matchgroup=elixirStringDelimiter start="'" end="'" skip="\\'\|\\\\" contains=@elixirStringContained
|
||||||
syn region elixirString matchgroup=elixirStringDelimiter start='"' end='"' skip='\\"' contains=@elixirStringContained
|
syn region elixirString matchgroup=elixirStringDelimiter start='"' end='"' skip='\\"' contains=@elixirStringContained
|
||||||
syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop
|
syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{" end="}" contained contains=ALLBUT,elixirComment,@elixirNotTop
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ syn keyword elixirCallbackDefine defcallback nextgroup=elixirCallbackDec
|
|||||||
syn keyword elixirStructDefine defstruct skipwhite skipnl
|
syn keyword elixirStructDefine defstruct skipwhite skipnl
|
||||||
|
|
||||||
" Declarations
|
" Declarations
|
||||||
syn match elixirModuleDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias nextgroup=elixirBlock skipwhite skipnl
|
syn match elixirModuleDeclaration "[^[:space:];#<]\+" contained nextgroup=elixirBlock skipwhite skipnl
|
||||||
syn match elixirFunctionDeclaration "[^[:space:];#<,()\[\]]\+" contained nextgroup=elixirArguments skipwhite skipnl
|
syn match elixirFunctionDeclaration "[^[:space:];#<,()\[\]]\+" contained nextgroup=elixirArguments skipwhite skipnl
|
||||||
syn match elixirProtocolDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
|
syn match elixirProtocolDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
|
||||||
syn match elixirImplDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
|
syn match elixirImplDeclaration "[^[:space:];#<]\+" contained contains=elixirAlias skipwhite skipnl
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
|
||||||
|
|
||||||
" Language: ember-script
|
" Language: ember-script
|
||||||
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
|
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
|
||||||
" URL: http://github.com/heartsentwined/vim-ember-script
|
" URL: http://github.com/yalesov/vim-ember-script
|
||||||
" Version: 1.0.1
|
" Version: 1.0.4
|
||||||
" Last Change: 2013 Apr 17
|
" Last Change: 2016 Jul 6
|
||||||
" License: GPL-3.0
|
" License: ISC
|
||||||
|
|
||||||
if exists('b:current_syntax') && b:current_syntax == 'ember-script'
|
if exists('b:current_syntax') && b:current_syntax == 'ember-script'
|
||||||
finish
|
finish
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
||||||
|
|
||||||
" Language: emblem
|
" Language: emblem
|
||||||
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
|
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
|
||||||
" URL: http://github.com/heartsentwined/vim-emblem
|
" URL: http://github.com/yalesov/vim-emblem
|
||||||
" Version: 1.2.0
|
" Version: 2.0.1
|
||||||
" Last Change: 2013 Apr 22
|
" Last Change: 2016 Jul 6
|
||||||
" License: GPL-3.0
|
" License: ISC
|
||||||
|
|
||||||
" Quit when a syntax file is already loaded.
|
" Quit when a syntax file is already loaded.
|
||||||
if exists('b:current_syntax') && b:current_syntax == 'emblem'
|
if exists('b:current_syntax') && b:current_syntax == 'emblem'
|
||||||
@@ -31,7 +31,7 @@ syn match eblClass '\v(\w|-)+' nextgroup=@eblComponent contained display
|
|||||||
hi def link eblIdOp eblId
|
hi def link eblIdOp eblId
|
||||||
hi def link eblClassOp eblClass
|
hi def link eblClassOp eblClass
|
||||||
|
|
||||||
syn region eblHbsAttrRegion matchgroup=eblHbsAttrRegionOp start='{' end='}' contains=@eblHbsHelpers nextgroup=@eblComponent keepend contained display
|
syn region eblHbsAttrRegion matchgroup=eblHbsAttrRegionOp start='{\|(\|\[' end='}\|)\|\]' contains=@eblHbsHelpers nextgroup=@eblComponent keepend contained display
|
||||||
hi def link eblHbsAttrRegionOp eblOperator
|
hi def link eblHbsAttrRegionOp eblOperator
|
||||||
|
|
||||||
syn match eblInlineText '\v\s+[^:]+.*$' contains=eblItpl contained display
|
syn match eblInlineText '\v\s+[^:]+.*$' contains=eblItpl contained display
|
||||||
@@ -40,7 +40,7 @@ hi def link eblInlineText eblRaw
|
|||||||
syn cluster eblHbsComponent contains=eblHbsArg,eblHbsAttr,eblHbsTextOp,eblLineOp
|
syn cluster eblHbsComponent contains=eblHbsArg,eblHbsAttr,eblHbsTextOp,eblLineOp
|
||||||
|
|
||||||
syn match eblHbsOp '\v\s*\=+' nextgroup=@eblHbsHelpers skipwhite contained display
|
syn match eblHbsOp '\v\s*\=+' nextgroup=@eblHbsHelpers skipwhite contained display
|
||||||
syn match eblHbsHelper '\v\w(\w|-|\.)*' nextgroup=@eblHbsComponent skipwhite contained display
|
syn match eblHbsHelper '\v\w(\w|-|\.|\/)*' nextgroup=@eblHbsComponent skipwhite contained display
|
||||||
syn match eblHbsTextOp '|' nextgroup=eblHbsText contained display
|
syn match eblHbsTextOp '|' nextgroup=eblHbsText contained display
|
||||||
syn match eblHbsText '.*' contained display
|
syn match eblHbsText '.*' contained display
|
||||||
hi def link eblHbsOp eblOperator
|
hi def link eblHbsOp eblOperator
|
||||||
@@ -48,24 +48,38 @@ hi def link eblHbsHelper eblFunction
|
|||||||
hi def link eblHbsTextOp eblOperator
|
hi def link eblHbsTextOp eblOperator
|
||||||
hi def link eblHbsText eblRaw
|
hi def link eblHbsText eblRaw
|
||||||
|
|
||||||
syn cluster eblHbsHelpers contains=eblHbsHelper,eblHbsCtrlFlowHelper,eblHbsEachHelper
|
syn cluster eblHbsHelpers contains=eblHbsHelper,eblHbsCtrlFlowHelper,eblHbsEachHelper,eblHbsWithHelper
|
||||||
|
|
||||||
syn match eblHbsCtrlFlowHelper '\v<(if|unless|else|with)>' nextgroup=@eblHbsComponent skipwhite contained display
|
syn match eblHbsCtrlFlowHelper '\v<(else if|if|unless|else)>' nextgroup=@eblHbsComponent skipwhite contained display
|
||||||
syn match eblHbsEachHelper '\v<each>' nextgroup=eblHbsEachArg skipwhite contained display
|
syn match eblHbsEachHelper '\v<each>' nextgroup=eblHbsEachArg skipwhite contained display
|
||||||
syn match eblHbsEachArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsIn,eblLineOp skipwhite contained display
|
syn match eblHbsEachArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsIn,eblLineOp skipwhite contained display
|
||||||
syn match eblHbsIn '\v<in>' nextgroup=eblHbsInArg skipwhite contained display
|
syn match eblHbsIn '\v<in>' nextgroup=eblHbsInArg skipwhite contained display
|
||||||
syn match eblHbsInArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblLineOp skipwhite contained display
|
syn match eblHbsInArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblLineOp skipwhite contained display
|
||||||
hi def link eblHbsCtrlFlowHelper eblKeyword
|
syn match eblHbsWithHelper '\v<with>' nextgroup=eblHbsWithArg skipwhite contained display
|
||||||
hi def link eblHbsEachHelper eblKeyword
|
syn match eblHbsWithArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsAs skipwhite contained display
|
||||||
hi def link eblHbsEachArg eblLiteral
|
syn match eblHbsAs '\v<as>' nextgroup=eblHbsAsBlockStartArg skipwhite contained display
|
||||||
hi def link eblHbsIn eblKeyword
|
syn match eblHbsAsBlockStartArg /\v\|/ nextgroup=eblHbsAsBlockFirstArg skipwhite contained display
|
||||||
hi def link eblHbsInArg eblLiteral
|
syn match eblHbsAsBlockFirstArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsAsBlockSecondArg,eblHbsAsBlockEndArg skipwhite contained display
|
||||||
|
syn match eblHbsAsBlockSecondArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsAsBlockEndArg skipwhite contained display
|
||||||
|
syn match eblHbsAsBlockEndArg /\v\|/ nextgroup=eblLineOp skipwhite contained display
|
||||||
|
hi def link eblHbsCtrlFlowHelper eblKeyword
|
||||||
|
hi def link eblHbsEachHelper eblKeyword
|
||||||
|
hi def link eblHbsEachArg eblLiteral
|
||||||
|
hi def link eblHbsIn eblKeyword
|
||||||
|
hi def link eblHbsInArg eblLiteral
|
||||||
|
hi def link eblHbsWithHelper eblKeyword
|
||||||
|
hi def link eblHbsWithArg eblLiteral
|
||||||
|
hi def link eblHbsAs eblKeyword
|
||||||
|
hi def link eblHbsAsBlockStartArg eblOperator
|
||||||
|
hi def link eblHbsAsBlockFirstArg eblLiteral
|
||||||
|
hi def link eblHbsAsBlockSecondArg eblLiteral
|
||||||
|
hi def link eblHbsAsBlockEndArg eblOperator
|
||||||
|
|
||||||
syn match eblHbsArg /\v\s*((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=@eblHbsComponent skipwhite contained display
|
syn match eblHbsArg /\v\s*((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=@eblHbsComponent skipwhite contained display
|
||||||
syn match eblHbsAttr '\v\s*(\w|-)+\=@=' contains=eblHbsAttrBind nextgroup=eblHbsAttrOp contained display
|
syn match eblHbsAttr '\v\s*(\w|-)+\=@=' contains=eblHbsAttrBind nextgroup=eblHbsAttrOp contained display
|
||||||
syn match eblHbsAttrBind /\v<(\w|-)+Bind>/ contained display
|
syn match eblHbsAttrBind /\v<(\w|-)+Bind>/ contained display
|
||||||
syn match eblHbsAttrOp '=' nextgroup=eblHbsAttrLit contained display
|
syn match eblHbsAttrOp '=' nextgroup=eblHbsAttrLit contained display
|
||||||
syn match eblHbsAttrLit /\v(["'])[^\1]{-}\1|[^: ]+/ contains=eblItpl nextgroup=@eblHbsComponent skipwhite contained display
|
syn match eblHbsAttrLit /\v(["'])[^\1]{-}\1|[^\.: ]+/ contains=eblItpl nextgroup=@eblHbsComponent skipwhite contained display
|
||||||
hi def link eblHbsArg eblLiteral
|
hi def link eblHbsArg eblLiteral
|
||||||
hi def link eblHbsAttr eblAttr
|
hi def link eblHbsAttr eblAttr
|
||||||
hi def link eblhbsAttrBind eblBind
|
hi def link eblhbsAttrBind eblBind
|
||||||
@@ -106,6 +120,7 @@ hi def link eblKnownEvent eblEvent
|
|||||||
|
|
||||||
syn region eblItpl matchgroup=eblItplOp start='#{' end='}' contains=@eblHbsHelpers,eblHbsPartialOp keepend contained display
|
syn region eblItpl matchgroup=eblItplOp start='#{' end='}' contains=@eblHbsHelpers,eblHbsPartialOp keepend contained display
|
||||||
syn region eblItpl matchgroup=eblItplOp start='{{' end='}}' contains=@eblHbsHelpers,eblHbsPartialOp keepend contained display
|
syn region eblItpl matchgroup=eblItplOp start='{{' end='}}' contains=@eblHbsHelpers,eblHbsPartialOp keepend contained display
|
||||||
|
syn region eblItpl matchgroup=eblItplOp start='(' end=')' contains=@eblHbsHelpers,eblHbsPartialOp keepend contained display
|
||||||
hi def link eblItplOp eblOperator
|
hi def link eblItplOp eblOperator
|
||||||
|
|
||||||
syn match eblHbsPartialOp '\s*>' nextgroup=@eblHbsHelpers skipwhite contained display
|
syn match eblHbsPartialOp '\s*>' nextgroup=@eblHbsHelpers skipwhite contained display
|
||||||
|
|||||||
124
syntax/go.vim
124
syntax/go.vim
@@ -69,12 +69,12 @@ if !exists("g:go_highlight_methods")
|
|||||||
let g:go_highlight_methods = 0
|
let g:go_highlight_methods = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("g:go_highlight_structs")
|
if !exists("g:go_highlight_fields")
|
||||||
let g:go_highlight_structs = 0
|
let g:go_highlight_fields = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("g:go_highlight_interfaces")
|
if !exists("g:go_highlight_types")
|
||||||
let g:go_highlight_interfaces = 0
|
let g:go_highlight_types = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("g:go_highlight_build_constraints")
|
if !exists("g:go_highlight_build_constraints")
|
||||||
@@ -96,12 +96,10 @@ endif
|
|||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
syn keyword goDirective package import
|
syn keyword goDirective package import
|
||||||
syn keyword goDeclaration var const type
|
syn keyword goDeclaration var const
|
||||||
syn keyword goDeclType struct interface
|
|
||||||
|
|
||||||
hi def link goDirective Statement
|
hi def link goDirective Statement
|
||||||
hi def link goDeclaration Keyword
|
hi def link goDeclaration Keyword
|
||||||
hi def link goDeclType Keyword
|
|
||||||
|
|
||||||
" Keywords within functions
|
" Keywords within functions
|
||||||
syn keyword goStatement defer go goto return break continue fallthrough
|
syn keyword goStatement defer go goto return break continue fallthrough
|
||||||
@@ -127,10 +125,6 @@ hi def link goUnsignedInts Type
|
|||||||
hi def link goFloats Type
|
hi def link goFloats Type
|
||||||
hi def link goComplexes Type
|
hi def link goComplexes Type
|
||||||
|
|
||||||
" Treat func specially: it's a declaration at the start of a line, but a type
|
|
||||||
" elsewhere. Order matters here.
|
|
||||||
syn match goDeclaration /\<func\>/
|
|
||||||
|
|
||||||
|
|
||||||
" Predefined functions and values
|
" Predefined functions and values
|
||||||
syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/
|
syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/
|
||||||
@@ -294,71 +288,93 @@ if g:go_highlight_operators != 0
|
|||||||
syn match goOperator /:=\|||\|<-\|++\|--/
|
syn match goOperator /:=\|||\|<-\|++\|--/
|
||||||
" match ...
|
" match ...
|
||||||
syn match goOperator /\.\.\./
|
syn match goOperator /\.\.\./
|
||||||
|
|
||||||
|
hi def link goPointerOperator Operator
|
||||||
endif
|
endif
|
||||||
hi def link goOperator Operator
|
hi def link goOperator Operator
|
||||||
|
|
||||||
" Functions;
|
" Functions;
|
||||||
if g:go_highlight_functions != 0
|
if g:go_highlight_functions != 0
|
||||||
syn match goFunction /\(func\s\+\)\@<=\w\+\((\)\@=/
|
syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction skipwhite skipnl
|
||||||
syn match goFunction /\()\s\+\)\@<=\w\+\((\)\@=/
|
syn match goReceiver /(\(\w\|[ *]\)\+)/ contained nextgroup=goFunction contains=goReceiverVar skipwhite skipnl
|
||||||
|
syn match goReceiverVar /\w\+/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained
|
||||||
|
syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
|
||||||
|
syn match goReceiverType /\w\+/ contained
|
||||||
|
syn match goFunction /\w\+/ contained
|
||||||
|
else
|
||||||
|
syn keyword goDeclaration func
|
||||||
endif
|
endif
|
||||||
hi def link goFunction Function
|
hi def link goFunction Function
|
||||||
|
|
||||||
" Methods;
|
" Methods;
|
||||||
if g:go_highlight_methods != 0
|
if g:go_highlight_methods != 0
|
||||||
syn match goMethod /\(\.\)\@<=\w\+\((\)\@=/
|
syn match goMethod /\.\w\+\ze(/hs=s+1
|
||||||
endif
|
endif
|
||||||
hi def link goMethod Type
|
hi def link goMethod Type
|
||||||
|
|
||||||
" Structs;
|
" Fields;
|
||||||
if g:go_highlight_structs != 0
|
if g:go_highlight_fields != 0
|
||||||
syn match goStruct /\(.\)\@<=\w\+\({\)\@=/
|
syn match goVarArgs /\.\.\.\w\+\>/
|
||||||
syn match goStructDef /\(type\s\+\)\@<=\w\+\(\s\+struct\s\+{\)\@=/
|
syn match goField /\.\a\+\([\ \n\r\:\)\[]\)\@=/hs=s+1
|
||||||
endif
|
endif
|
||||||
hi def link goStruct Function
|
hi def link goField Identifier
|
||||||
hi def link goStructDef Function
|
|
||||||
|
|
||||||
" Interfaces;
|
" Structs & Interfaces;
|
||||||
if g:go_highlight_interfaces != 0
|
if g:go_highlight_types != 0
|
||||||
syn match goInterface /\(.\)\@<=\w\+\({\)\@=/
|
syn match goTypeConstructor /\<\w\+{/he=e-1
|
||||||
syn match goInterfaceDef /\(type\s\+\)\@<=\w\+\(\s\+interface\s\+{\)\@=/
|
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
|
||||||
|
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
|
||||||
|
syn match goDeclType /\<interface\|struct\>/ contained skipwhite skipnl
|
||||||
|
hi def link goReceiverType Type
|
||||||
|
else
|
||||||
|
syn keyword goDeclType struct interface
|
||||||
|
syn keyword goDeclaration type
|
||||||
endif
|
endif
|
||||||
hi def link goInterface Function
|
hi def link goTypeConstructor Type
|
||||||
hi def link goInterfaceDef Function
|
hi def link goTypeName Type
|
||||||
|
hi def link goTypeDecl Keyword
|
||||||
|
hi def link goDeclType Keyword
|
||||||
|
|
||||||
" Build Constraints
|
" Build Constraints
|
||||||
if g:go_highlight_build_constraints != 0
|
if g:go_highlight_build_constraints != 0
|
||||||
syn match goBuildKeyword display contained "+build"
|
syn match goBuildKeyword display contained "+build"
|
||||||
" Highlight the known values of GOOS, GOARCH, and other +build options.
|
" Highlight the known values of GOOS, GOARCH, and other +build options.
|
||||||
syn keyword goBuildDirectives contained
|
syn keyword goBuildDirectives contained
|
||||||
\ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
|
\ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
|
||||||
\ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64
|
\ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64
|
||||||
\ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc
|
\ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc
|
||||||
\ s390 s390x sparc sparc64 cgo ignore race
|
\ s390 s390x sparc sparc64 cgo ignore race
|
||||||
|
|
||||||
" Other words in the build directive are build tags not listed above, so
|
" Other words in the build directive are build tags not listed above, so
|
||||||
" avoid highlighting them as comments by using a matchgroup just for the
|
" avoid highlighting them as comments by using a matchgroup just for the
|
||||||
" start of the comment.
|
" start of the comment.
|
||||||
" The rs=s+2 option lets the \s*+build portion be part of the inner region
|
" The rs=s+2 option lets the \s*+build portion be part of the inner region
|
||||||
" instead of the matchgroup so it will be highlighted as a goBuildKeyword.
|
" instead of the matchgroup so it will be highlighted as a goBuildKeyword.
|
||||||
syn region goBuildComment matchgroup=goBuildCommentStart
|
syn region goBuildComment matchgroup=goBuildCommentStart
|
||||||
\ start="//\s*+build\s"rs=s+2 end="$"
|
\ start="//\s*+build\s"rs=s+2 end="$"
|
||||||
\ contains=goBuildKeyword,goBuildDirectives
|
\ contains=goBuildKeyword,goBuildDirectives
|
||||||
hi def link goBuildCommentStart Comment
|
hi def link goBuildCommentStart Comment
|
||||||
hi def link goBuildDirectives Type
|
hi def link goBuildDirectives Type
|
||||||
hi def link goBuildKeyword PreProc
|
hi def link goBuildKeyword PreProc
|
||||||
|
|
||||||
" One or more line comments that are followed immediately by a "package"
|
" One or more line comments that are followed immediately by a "package"
|
||||||
" declaration are treated like package documentation, so these must be
|
" declaration are treated like package documentation, so these must be
|
||||||
" matched as comments to avoid looking like working build constraints.
|
" matched as comments to avoid looking like working build constraints.
|
||||||
" The he, me, and re options let the "package" itself be highlighted by
|
" The he, me, and re options let the "package" itself be highlighted by
|
||||||
" the usual rules.
|
" the usual rules.
|
||||||
syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/
|
syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/
|
||||||
\ end=/\v\n\s*package/he=e-7,me=e-7,re=e-7
|
\ end=/\v\n\s*package/he=e-7,me=e-7,re=e-7
|
||||||
\ contains=@goCommentGroup,@Spell
|
\ contains=@goCommentGroup,@Spell
|
||||||
hi def link goPackageComment Comment
|
hi def link goPackageComment Comment
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" :GoSameIds
|
||||||
|
hi def goSameId term=bold cterm=bold ctermbg=white ctermfg=black
|
||||||
|
|
||||||
|
" :GoCoverage commands
|
||||||
|
hi def link goCoverageNormalText Comment
|
||||||
|
hi def goCoverageCovered ctermfg=green
|
||||||
|
hi def goCoverageUncover ctermfg=red
|
||||||
|
|
||||||
" Search backwards for a global declaration to start processing the syntax.
|
" Search backwards for a global declaration to start processing the syntax.
|
||||||
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
|
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
|
||||||
@@ -369,4 +385,6 @@ syn sync minlines=500
|
|||||||
|
|
||||||
let b:current_syntax = "go"
|
let b:current_syntax = "go"
|
||||||
|
|
||||||
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn match godefStackComment '^".*'
|
syn match godefStackComment '^".*'
|
||||||
@@ -19,4 +19,6 @@ hi def link godefStackCurrentPosition Special
|
|||||||
hi def link godefStackFilename Directory
|
hi def link godefStackFilename Directory
|
||||||
hi def link godefStackEntryLocationNumber LineNr
|
hi def link godefStackEntryLocationNumber LineNr
|
||||||
|
|
||||||
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists("main_syntax")
|
if !exists("main_syntax")
|
||||||
let main_syntax = 'html'
|
let main_syntax = 'html'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
runtime! syntax/gotexttmpl.vim
|
runtime! syntax/gotexttmpl.vim
|
||||||
@@ -14,6 +14,6 @@ unlet b:current_syntax
|
|||||||
|
|
||||||
let b:current_syntax = "gohtmltmpl"
|
let b:current_syntax = "gohtmltmpl"
|
||||||
|
|
||||||
" vim:ts=4:sw=4:et
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
|||||||
|
|
||||||
" Quit when a (custom) syntax file was already loaded
|
" Quit when a (custom) syntax file was already loaded
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
@@ -84,6 +84,6 @@ hi def link goTplComment Comment
|
|||||||
|
|
||||||
let b:current_syntax = "gotexttmpl"
|
let b:current_syntax = "gotexttmpl"
|
||||||
|
|
||||||
" vim:ts=4:sw=4:et
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ elseif exists("b:current_syntax")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
syn spell notoplevel
|
||||||
syn match haskellRecordField contained containedin=haskellBlock
|
syn match haskellRecordField contained containedin=haskellBlock
|
||||||
\ "[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)"
|
\ "[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)"
|
||||||
\ contains=
|
\ contains=
|
||||||
@@ -60,9 +61,9 @@ syn keyword haskellConditional if then else
|
|||||||
syn match haskellNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>\|\<0[bB][10]\+\>"
|
syn match haskellNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>\|\<0[bB][10]\+\>"
|
||||||
syn match haskellFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
|
syn match haskellFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
|
||||||
syn match haskellSeparator "[,;]"
|
syn match haskellSeparator "[,;]"
|
||||||
syn region haskellParens matchgroup=haskellDelimiter start="(" end=")" contains=TOP,haskellTypeSig
|
syn region haskellParens matchgroup=haskellDelimiter start="(" end=")" contains=TOP,haskellTypeSig,@Spell
|
||||||
syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contains=TOP,haskellTypeSig
|
syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contains=TOP,haskellTypeSig,@Spell
|
||||||
syn region haskellBlock matchgroup=haskellDelimiter start="{" end="}" contains=TOP
|
syn region haskellBlock matchgroup=haskellDelimiter start="{" end="}" contains=TOP,@Spell
|
||||||
syn keyword haskellInfix infix infixl infixr
|
syn keyword haskellInfix infix infixl infixr
|
||||||
syn keyword haskellBottom undefined error
|
syn keyword haskellBottom undefined error
|
||||||
syn match haskellOperators "[-!#$%&\*\+/<=>\?@\\^|~:.]\+\|\<_\>"
|
syn match haskellOperators "[-!#$%&\*\+/<=>\?@\\^|~:.]\+\|\<_\>"
|
||||||
|
|||||||
@@ -12,27 +12,72 @@ syntax case match
|
|||||||
|
|
||||||
" keywords
|
" keywords
|
||||||
syntax keyword jasmineSuite describe it beforeEach afterEach
|
syntax keyword jasmineSuite describe it beforeEach afterEach
|
||||||
|
syntax keyword jasmine jasmine
|
||||||
|
|
||||||
|
" special
|
||||||
|
syntax match jasmineSpecial /\.Ajax/
|
||||||
|
syntax match jasmineSpecial /\.addMatcher/
|
||||||
|
syntax match jasmineSpecial /\.getEnv/
|
||||||
|
syntax match jasmineSpecial /\.loadConfigFile/
|
||||||
|
syntax match jasmineSpecial /\.onComplete/
|
||||||
|
syntax match jasmineSpecial /\.QueryString/
|
||||||
|
syntax match jasmineSpecial /\.HtmlSpecFilter/
|
||||||
|
syntax match jasmineSpecial /\.addCustomEqualityTester/
|
||||||
|
syntax match jasmineSpecial /\.configureDefaultReporter/
|
||||||
|
syntax match jasmineSpecial /\.execute/
|
||||||
|
|
||||||
|
" clock
|
||||||
|
syntax match jasmineClock /\.Timer/
|
||||||
|
syntax match jasmineClock /\.clock/
|
||||||
|
syntax match jasmineClock /\.tick/
|
||||||
|
syntax match jasmineClock /\.mockDate/
|
||||||
|
|
||||||
|
" disabled
|
||||||
syntax keyword jasmineDisabled xdescribe xit
|
syntax keyword jasmineDisabled xdescribe xit
|
||||||
|
|
||||||
|
" expectation
|
||||||
syntax keyword jasmineExpectation expect
|
syntax keyword jasmineExpectation expect
|
||||||
|
|
||||||
|
" not
|
||||||
syntax region jasmineNot start=/not/ end=/\.to/me=s-1
|
syntax region jasmineNot start=/not/ end=/\.to/me=s-1
|
||||||
|
|
||||||
|
" matchers
|
||||||
syntax match jasmineMatcher /\.to\h\+/
|
syntax match jasmineMatcher /\.to\h\+/
|
||||||
|
syntax match jasmineMatcher /\.objectContaining/
|
||||||
|
syntax match jasmineMatcher /\.arrayContaining/
|
||||||
|
syntax match jasmineMatcher /\.anything/
|
||||||
|
syntax match jasmineMatcher /\.any/
|
||||||
syntax keyword jasmineSpy spyOn
|
syntax keyword jasmineSpy spyOn
|
||||||
|
syntax match jasmineSpy /\.createSpy/
|
||||||
syntax match jasmineSpyMatcher /and\h\+/
|
syntax match jasmineSpyMatcher /and\h\+/
|
||||||
|
|
||||||
" jasmine is a subset of the javascript language, thus we need to activate
|
" jasmine is a subset of the javascript language, thus we need to activate
|
||||||
" javascript syntax highlighting and add new jasmin group names to the
|
" javascript syntax highlighting and add new jasmin group names to the
|
||||||
" JavaScriptAll cluster which is defined there
|
" JavaScriptAll cluster which is defined there
|
||||||
runtime! syntax/javascript.vim
|
runtime! syntax/javascript.vim
|
||||||
syntax cluster JavaScriptAll add=jasmineSuite,jasmineDisabled,jasmineExpectation,jasmineNot,jasmineMatcher,jasmineSpy,jasmineSpyMatcher
|
syntax cluster JavaScriptAll add=
|
||||||
|
\ jasmine,
|
||||||
|
\ jasmineClock,
|
||||||
|
\ jasmineDisabled,
|
||||||
|
\ jasmineExpectation,
|
||||||
|
\ jasmineMatcher,
|
||||||
|
\ jasmineNot,
|
||||||
|
\ jasmineSpecial,
|
||||||
|
\ jasmineSpy,
|
||||||
|
\ jasmineSpyMatcher,
|
||||||
|
\ jasmineSuite
|
||||||
|
|
||||||
let b:current_syntax = "jasmine"
|
let b:current_syntax = "jasmine"
|
||||||
|
|
||||||
hi def link jasmineSuite Statement
|
hi def link jasmine Special
|
||||||
|
hi def link jasmineClock Special
|
||||||
hi def link jasmineDisabled Error
|
hi def link jasmineDisabled Error
|
||||||
hi def link jasmineExpectation Statement
|
hi def link jasmineExpectation Statement
|
||||||
hi def link jasmineNot Special
|
|
||||||
hi def link jasmineMatcher Statement
|
hi def link jasmineMatcher Statement
|
||||||
|
hi def link jasmineNot Special
|
||||||
|
hi def link jasmineSpecial Special
|
||||||
hi def link jasmineSpy Special
|
hi def link jasmineSpy Special
|
||||||
hi def link jasmineSpyMatcher Statement
|
hi def link jasmineSpyMatcher Statement
|
||||||
|
hi def link jasmineSuite Statement
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -2,21 +2,9 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') ==
|
|||||||
|
|
||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: JavaScript
|
" Language: JavaScript
|
||||||
" Maintainer: Kao Wei-Ko(othree) <othree@gmail.com>
|
" Maintainer: vim-javascript community
|
||||||
" Last Change: 2015-05-11
|
" URL: https://github.com/pangloss/vim-javascript
|
||||||
" Version: 1.5
|
|
||||||
" Changes: Go to https://github.com/othree/yajs.vim for recent changes.
|
|
||||||
" Origin: https://github.com/jelera/vim-javascript-syntax
|
|
||||||
" Credits: Jose Elera Campana, Zhao Yi, Claudio Fleiner, Scott Shattuck
|
|
||||||
" (This file is based on their hard work), gumnos (From the #vim
|
|
||||||
" IRC Channel in Freenode)
|
|
||||||
|
|
||||||
|
|
||||||
" if exists("b:yajs_loaded")
|
|
||||||
" finish
|
|
||||||
" else
|
|
||||||
" let b:yajs_loaded = 1
|
|
||||||
" endif
|
|
||||||
if !exists("main_syntax")
|
if !exists("main_syntax")
|
||||||
if version < 600
|
if version < 600
|
||||||
syntax clear
|
syntax clear
|
||||||
@@ -26,371 +14,324 @@ if !exists("main_syntax")
|
|||||||
let main_syntax = 'javascript'
|
let main_syntax = 'javascript'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:javascript_conceal')
|
||||||
|
let g:javascript_conceal = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Dollar sign is permittd anywhere in an identifier
|
||||||
|
setlocal iskeyword+=$
|
||||||
|
|
||||||
|
syntax sync fromstart
|
||||||
|
" TODO: Figure out what type of casing I need
|
||||||
|
" syntax case ignore
|
||||||
|
syntax case match
|
||||||
|
|
||||||
|
syntax match jsNoise /[:,\;\.]\{1}/
|
||||||
|
syntax match jsFuncCall /\k\+\%(\s*(\)\@=/
|
||||||
|
syntax match jsParensError /[)}\]]/
|
||||||
|
|
||||||
|
" Program Keywords
|
||||||
|
syntax keyword jsStorageClass const var let skipwhite skipempty nextgroup=jsDestructuringBlock,jsDestructuringArray
|
||||||
|
syntax keyword jsOperator delete instanceof typeof void new in of
|
||||||
|
syntax match jsOperator /[\!\|\&\+\-\<\>\=\%\/\*\~\^]\{1}/
|
||||||
|
syntax keyword jsBooleanTrue true
|
||||||
|
syntax keyword jsBooleanFalse false
|
||||||
|
|
||||||
|
" Modules
|
||||||
|
syntax keyword jsModuleKeywords contained import
|
||||||
|
syntax keyword jsModuleKeywords contained export skipwhite skipempty nextgroup=jsExportBlock,jsModuleDefault
|
||||||
|
syntax keyword jsModuleOperators contained from
|
||||||
|
syntax keyword jsModuleOperators contained as
|
||||||
|
syntax region jsModuleGroup contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise,jsComment
|
||||||
|
syntax match jsModuleAsterisk contained /*/
|
||||||
|
syntax keyword jsModuleDefault contained default skipwhite kipempty nextgroup=@jsExpression
|
||||||
|
syntax region jsImportContainer start=/\<import\> / end="\%(;\|$\)" contains=jsModuleKeywords,jsModuleOperators,jsComment,jsString,jsTemplateString,jsNoise,jsModuleGroup,jsModuleAsterisk
|
||||||
|
syntax region jsExportContainer start=/\<export\> / end="\%(;\|$\)" contains=jsModuleKeywords,jsModuleOperators,jsStorageClass,jsModuleDefault,@jsExpression
|
||||||
|
syntax region jsExportBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise,jsComment
|
||||||
|
|
||||||
|
" Strings, Templates, Numbers
|
||||||
|
syntax region jsString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend
|
||||||
|
syntax region jsString start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend
|
||||||
|
syntax region jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=jsTemplateVar,jsSpecial extend
|
||||||
|
syntax match jsTaggedTemplate /\k\+\%(`\)\@=/ nextgroup=jsTemplateString
|
||||||
|
syntax match jsNumber /\<-\=\d\+\(L\|[eE][+-]\=\d\+\)\=\>\|\<0[xX]\x\+\>/
|
||||||
|
syntax keyword jsNumber Infinity
|
||||||
|
syntax match jsFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
|
||||||
|
|
||||||
|
" Regular Expressions
|
||||||
|
syntax match jsSpecial contained "\v\\%(0|\\x\x\{2\}\|\\u\x\{4\}\|\c[A-Z]|.)"
|
||||||
|
syntax region jsTemplateVar contained matchgroup=jsTemplateBraces start=+${+ end=+}+ contains=@jsExpression
|
||||||
|
syntax region jsRegexpCharClass contained start=+\[+ skip=+\\.+ end=+\]+
|
||||||
|
syntax match jsRegexpBoundary contained "\v%(\<@![\^$]|\\[bB])"
|
||||||
|
syntax match jsRegexpBackRef contained "\v\\[1-9][0-9]*"
|
||||||
|
syntax match jsRegexpQuantifier contained "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??"
|
||||||
|
syntax match jsRegexpOr contained "\v\<@!\|"
|
||||||
|
syntax match jsRegexpMod contained "\v\(@<=\?[:=!>]"
|
||||||
|
syntax region jsRegexpGroup contained start="\\\@<!(" skip="\\.\|\[\(\\.\|[^]]\)*\]" end="\\\@<!)" contains=jsRegexpCharClass,@jsRegexpSpecial keepend
|
||||||
|
if v:version > 703 || v:version == 603 && has("patch1088")
|
||||||
|
syntax region jsRegexpString start=+\%(\%(\%(return\|case\)\s\+\)\@50<=\|\%(\%([)\]"']\|\d\|\w\)\s*\)\@50<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\%(\\.\|[^]]\)*\]+ end=+/[gimy]\{,4}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial oneline keepend extend
|
||||||
|
else
|
||||||
|
syntax region jsRegexpString start=+\%(\%(\%(return\|case\)\s\+\)\@<=\|\%(\%([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\%(\\.\|[^]]\)*\]+ end=+/[gimy]\{,4}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial oneline keepend extend
|
||||||
|
endif
|
||||||
|
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
|
||||||
|
|
||||||
|
syntax match jsObjectKey contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue,jsFlowParenRegion
|
||||||
|
syntax region jsObjectKeyString contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
|
||||||
|
syntax region jsObjectKeyString contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
|
||||||
|
syntax region jsObjectKeyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsObjectValue,jsFuncArgs extend
|
||||||
|
syntax match jsObjectSeparator contained /,/
|
||||||
|
syntax region jsObjectValue contained start=/:/ end=/\%(,\|}\)\@=/ contains=@jsExpression extend
|
||||||
|
syntax match jsObjectFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>[\r\n\t ]*(\@=/ skipwhite skipempty nextgroup=jsFuncArgs
|
||||||
|
syntax match jsFunctionKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/
|
||||||
|
syntax match jsObjectMethodType contained /\%(get\|set\|static\|async\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsObjectFuncName
|
||||||
|
syntax region jsObjectStringKey contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue
|
||||||
|
syntax region jsObjectStringKey contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue
|
||||||
|
|
||||||
|
exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '')
|
||||||
|
exe 'syntax keyword jsReturn return contained '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '')
|
||||||
|
exe 'syntax keyword jsUndefined undefined '.(exists('g:javascript_conceal_undefined') ? 'conceal cchar='.g:javascript_conceal_undefined : '')
|
||||||
|
exe 'syntax keyword jsNan NaN '.(exists('g:javascript_conceal_NaN') ? 'conceal cchar='.g:javascript_conceal_NaN : '')
|
||||||
|
exe 'syntax keyword jsPrototype prototype '.(exists('g:javascript_conceal_prototype') ? 'conceal cchar='.g:javascript_conceal_prototype : '')
|
||||||
|
exe 'syntax keyword jsThis this contained '.(exists('g:javascript_conceal_this') ? 'conceal cchar='.g:javascript_conceal_this : '')
|
||||||
|
exe 'syntax keyword jsSuper super contained '.(exists('g:javascript_conceal_super') ? 'conceal cchar='.g:javascript_conceal_super : '')
|
||||||
|
|
||||||
|
" Statement Keywords
|
||||||
|
syntax keyword jsStatement contained break continue with yield debugger
|
||||||
|
syntax keyword jsConditional if else skipwhite skipempty nextgroup=jsParenIfElse,jsBlock
|
||||||
|
syntax keyword jsConditional switch skipwhite skipempty nextgroup=jsParenSwitch
|
||||||
|
syntax keyword jsRepeat while for skipwhite skipempty nextgroup=jsParenRepeat
|
||||||
|
syntax keyword jsRepeat do skipwhite skipempty nextgroup=jsBlock
|
||||||
|
syntax keyword jsLabel contained case default
|
||||||
|
syntax keyword jsTry try skipwhite skipempty nextgroup=jsTryCatchBlock
|
||||||
|
syntax keyword jsFinally contained finally skipwhite skipempty nextgroup=jsBlock
|
||||||
|
syntax keyword jsCatch contained catch skipwhite skipempty nextgroup=jsParenCatch
|
||||||
|
syntax keyword jsException throw
|
||||||
|
syntax keyword jsAsyncKeyword async await
|
||||||
|
syntax match jsSwitchColon contained /:/ skipwhite skipempty nextgroup=jsBlock
|
||||||
|
|
||||||
|
" Keywords
|
||||||
|
syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat
|
||||||
|
syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError
|
||||||
|
syntax keyword jsBuiltins decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval
|
||||||
|
" DISCUSS: How imporant is this, really? Perhaps it should be linked to an error because I assume the keywords are reserved?
|
||||||
|
syntax keyword jsFutureKeys abstract enum int short boolean interface byte long char final native synchronized float package throws goto private transient implements protected volatile double public
|
||||||
|
|
||||||
|
" DISCUSS: Should we really be matching stuff like this?
|
||||||
|
" DOM2 Objects
|
||||||
|
syntax keyword jsGlobalObjects DOMImplementation DocumentFragment Document Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction
|
||||||
|
syntax keyword jsExceptions DOMException
|
||||||
|
|
||||||
|
" DISCUSS: Should we really be matching stuff like this?
|
||||||
|
" DOM2 CONSTANT
|
||||||
|
syntax keyword jsDomErrNo INDEX_SIZE_ERR DOMSTRING_SIZE_ERR HIERARCHY_REQUEST_ERR WRONG_DOCUMENT_ERR INVALID_CHARACTER_ERR NO_DATA_ALLOWED_ERR NO_MODIFICATION_ALLOWED_ERR NOT_FOUND_ERR NOT_SUPPORTED_ERR INUSE_ATTRIBUTE_ERR INVALID_STATE_ERR SYNTAX_ERR INVALID_MODIFICATION_ERR NAMESPACE_ERR INVALID_ACCESS_ERR
|
||||||
|
syntax keyword jsDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECTION_NODE ENTITY_REFERENCE_NODE ENTITY_NODE PROCESSING_INSTRUCTION_NODE COMMENT_NODE DOCUMENT_NODE DOCUMENT_TYPE_NODE DOCUMENT_FRAGMENT_NODE NOTATION_NODE
|
||||||
|
|
||||||
|
" DISCUSS: Should we really be special matching on these props?
|
||||||
|
" HTML events and internal variables
|
||||||
|
syntax keyword jsHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize
|
||||||
|
|
||||||
|
"" Code blocks
|
||||||
|
syntax region jsBracket matchgroup=jsBrackets start=/\[/ end=/\]/ contains=@jsExpression extend fold
|
||||||
|
syntax region jsParen matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll extend fold
|
||||||
|
syntax region jsParenIfElse contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsBlock extend fold
|
||||||
|
syntax region jsParenRepeat contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsBlock extend fold
|
||||||
|
syntax region jsParenSwitch contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold
|
||||||
|
syntax region jsParenCatch contained matchgroup=jsParens start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock extend fold
|
||||||
|
syntax region jsFuncArgs contained matchgroup=jsFuncParens start=/(/ end=/)/ contains=jsFuncArgCommas,jsComment,jsFuncArgExpression,jsDestructuringBlock,jsRestExpression,jsFlow skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn extend fold
|
||||||
|
syntax region jsClassBlock contained matchgroup=jsClassBraces start=/{/ end=/}/ contains=jsClassFuncName,jsClassMethodType,jsOperator,jsArrowFunction,jsArrowFuncArgs,jsComment,jsGenerator,jsDecorator,jsClassProperty,jsClassPropertyComputed,jsClassStringKey,jsNoise,jsFlowClassProperty extend fold
|
||||||
|
syntax region jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll extend fold
|
||||||
|
syntax region jsBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll extend fold
|
||||||
|
syntax region jsTryCatchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold
|
||||||
|
syntax region jsSwitchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsLabel,jsSwitchColon extend fold
|
||||||
|
syntax region jsDestructuringBlock contained matchgroup=jsDestructuringBraces start=/{/ end=/}/ contains=jsDestructuringProperty,jsDestructuringAssignment,jsDestructuringNoise,jsDestructuringPropertyComputed,jsSpreadExpression extend fold
|
||||||
|
syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsNoise,jsDestructuringProperty,jsSpreadExpression extend fold
|
||||||
|
syntax region jsObject matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression extend fold
|
||||||
|
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression
|
||||||
|
syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression
|
||||||
|
syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/
|
||||||
|
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression
|
||||||
|
|
||||||
|
syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs
|
||||||
|
syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>/ skipwhite skipempty nextgroup=jsFuncArgs
|
||||||
|
syntax region jsFuncArgExpression contained matchgroup=jsFuncArgOperator start=/=/ end=/[,)]\@=/ contains=@jsExpression extend
|
||||||
|
syntax match jsFuncArgCommas contained ','
|
||||||
|
syntax keyword jsArguments contained arguments
|
||||||
|
|
||||||
|
" Matches a single keyword argument with no parens
|
||||||
|
syntax match jsArrowFuncArgs /\k\+\s*\%(=>\)\@=/ skipwhite contains=jsFuncArgs skipwhite skipempty nextgroup=jsArrowFunction extend
|
||||||
|
" Matches a series of arguments surrounded in parens
|
||||||
|
syntax match jsArrowFuncArgs /([^()]*)\s*\(=>\)\@=/ contains=jsFuncArgs skipempty skipwhite nextgroup=jsArrowFunction extend
|
||||||
|
|
||||||
|
exe 'syntax match jsFunction /\<function\>/ skipwhite skipempty nextgroup=jsGenerator,jsFuncName,jsFuncArgs skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
|
||||||
|
exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFuncBlock contains=jsFuncBraces '.(exists('g:javascript_conceal_arrow_function') ? 'conceal cchar='.g:javascript_conceal_arrow_function : '')
|
||||||
|
|
||||||
|
syntax keyword jsClassKeywords contained extends class
|
||||||
|
syntax match jsClassNoise contained /\./
|
||||||
|
syntax match jsClassMethodType contained /\%(get\|set\|static\|async\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsFuncName,jsClassProperty
|
||||||
|
syntax match jsClassDefinition /\<class\>\%( [a-zA-Z_$][0-9a-zA-Z_$ \n.]*\)*/ contains=jsClassKeywords,jsClassNoise skipwhite skipempty nextgroup=jsClassBlock,jsFlowClass
|
||||||
|
syntax match jsDecorator contained "@" nextgroup=jsDecoratorFunction
|
||||||
|
syntax match jsDecoratorFunction contained "[a-zA-Z_][a-zA-Z0-9_.]*"
|
||||||
|
syntax match jsClassProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsClassValue
|
||||||
|
syntax region jsClassValue contained start=/=/ end=/\%(;\|}\|\n\)\@=/ contains=@jsExpression
|
||||||
|
syntax region jsClassPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsFuncArgs,jsClassValue extend
|
||||||
|
syntax match jsClassFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\%(\s*(\)\@=/ skipwhite skipempty nextgroup=jsFuncArgs
|
||||||
|
syntax region jsClassStringKey contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs
|
||||||
|
syntax region jsClassStringKey contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs
|
||||||
|
|
||||||
|
" Destructuring
|
||||||
|
syntax match jsDestructuringPropertyValue contained /\<[0-9a-zA-Z_$]*\>/
|
||||||
|
syntax match jsDestructuringProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsDestructuringValue
|
||||||
|
syntax match jsDestructuringAssignment contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsDestructuringValueAssignment
|
||||||
|
syntax region jsDestructuringValue contained start=/=/ end=/[,}\]]\@=/ contains=@jsExpression extend
|
||||||
|
syntax region jsDestructuringValueAssignment contained start=/:/ end=/[,}=]\@=/ contains=jsDestructuringPropertyValue,jsDestructuringBlock,jsNoise,jsDestructuringNoise skipwhite skipempty nextgroup=jsDestructuringValue extend
|
||||||
|
syntax match jsDestructuringNoise contained /[,\[\]]/
|
||||||
|
syntax region jsDestructuringPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsDestructuringValue,jsDestructuringNoise extend fold
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syntax keyword jsCommentTodo contained TODO FIXME XXX TBD
|
||||||
|
syntax region jsComment start=/\/\// end=/$/ contains=jsCommentTodo,@Spell extend keepend
|
||||||
|
syntax region jsComment start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell fold extend keepend
|
||||||
|
syntax region jsEnvComment start=/\%^#!/ end=/$/ display
|
||||||
|
|
||||||
|
if exists("javascript_plugin_jsdoc")
|
||||||
|
runtime extras/jsdoc.vim
|
||||||
|
" NGDoc requires JSDoc
|
||||||
|
if exists("javascript_plugin_ngdoc")
|
||||||
|
runtime extras/ngdoc.vim
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists("javascript_plugin_flow")
|
||||||
|
runtime extras/flow.vim
|
||||||
|
endif
|
||||||
|
|
||||||
|
syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsBlock,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper
|
||||||
|
syntax cluster jsAll contains=@jsExpression,jsExportContainer,jsImportContainer,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsStatement,jsException,jsTry,jsAsyncKeyword
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" For version 5.7 and earlier: only when not done already
|
" 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
|
" For version 5.8 and later: only when an item doesn't have highlighting yet
|
||||||
if version >= 508 || !exists("did_javascript_syn_inits")
|
if version >= 508 || !exists("did_javascript_syn_inits")
|
||||||
let did_javascript_hilink = 1
|
|
||||||
if version < 508
|
if version < 508
|
||||||
let did_javascript_syn_inits = 1
|
let did_javascript_syn_inits = 1
|
||||||
command -nargs=+ HiLink hi link <args>
|
command -nargs=+ HiLink hi link <args>
|
||||||
else
|
else
|
||||||
command -nargs=+ HiLink hi def link <args>
|
command -nargs=+ HiLink hi def link <args>
|
||||||
endif
|
endif
|
||||||
else
|
HiLink jsComment Comment
|
||||||
finish
|
HiLink jsEnvComment PreProc
|
||||||
endif
|
HiLink jsCommentTodo Todo
|
||||||
|
HiLink jsString String
|
||||||
|
HiLink jsObjectKeyString String
|
||||||
|
HiLink jsTemplateString String
|
||||||
|
HiLink jsObjectStringKey String
|
||||||
|
HiLink jsClassStringKey String
|
||||||
|
HiLink jsTaggedTemplate StorageClass
|
||||||
|
HiLink jsTernaryIfOperator Operator
|
||||||
|
HiLink jsRegexpString String
|
||||||
|
HiLink jsRegexpBoundary SpecialChar
|
||||||
|
HiLink jsRegexpQuantifier SpecialChar
|
||||||
|
HiLink jsRegexpOr Conditional
|
||||||
|
HiLink jsRegexpMod SpecialChar
|
||||||
|
HiLink jsRegexpBackRef SpecialChar
|
||||||
|
HiLink jsRegexpGroup jsRegexpString
|
||||||
|
HiLink jsRegexpCharClass Character
|
||||||
|
HiLink jsCharacter Character
|
||||||
|
HiLink jsPrototype Special
|
||||||
|
HiLink jsConditional Conditional
|
||||||
|
HiLink jsBranch Conditional
|
||||||
|
HiLink jsLabel Label
|
||||||
|
HiLink jsReturn Statement
|
||||||
|
HiLink jsRepeat Repeat
|
||||||
|
HiLink jsStatement Statement
|
||||||
|
HiLink jsException Exception
|
||||||
|
HiLink jsTry Exception
|
||||||
|
HiLink jsFinally Exception
|
||||||
|
HiLink jsCatch Exception
|
||||||
|
HiLink jsAsyncKeyword Keyword
|
||||||
|
HiLink jsArrowFunction Type
|
||||||
|
HiLink jsFunction Type
|
||||||
|
HiLink jsGenerator jsFunction
|
||||||
|
HiLink jsArrowFuncArgs jsFuncArgs
|
||||||
|
HiLink jsFuncName Function
|
||||||
|
HiLink jsClassFuncName jsFuncName
|
||||||
|
HiLink jsObjectFuncName Function
|
||||||
|
HiLink jsArguments Special
|
||||||
|
HiLink jsError Error
|
||||||
|
HiLink jsParensError Error
|
||||||
|
HiLink jsOperator Operator
|
||||||
|
HiLink jsOf Operator
|
||||||
|
HiLink jsStorageClass StorageClass
|
||||||
|
HiLink jsClassKeywords Structure
|
||||||
|
HiLink jsThis Special
|
||||||
|
HiLink jsSuper Special
|
||||||
|
HiLink jsNan Number
|
||||||
|
HiLink jsNull Type
|
||||||
|
HiLink jsUndefined Type
|
||||||
|
HiLink jsNumber Number
|
||||||
|
HiLink jsFloat Float
|
||||||
|
HiLink jsBooleanTrue Boolean
|
||||||
|
HiLink jsBooleanFalse Boolean
|
||||||
|
HiLink jsNoise Noise
|
||||||
|
HiLink jsBrackets Noise
|
||||||
|
HiLink jsParens Noise
|
||||||
|
HiLink jsBraces Noise
|
||||||
|
HiLink jsFuncBraces Noise
|
||||||
|
HiLink jsFuncParens Noise
|
||||||
|
HiLink jsClassBraces Noise
|
||||||
|
HiLink jsClassNoise Noise
|
||||||
|
HiLink jsObjectBraces Noise
|
||||||
|
HiLink jsObjectSeparator Noise
|
||||||
|
HiLink jsSpecial Special
|
||||||
|
HiLink jsTemplateVar Special
|
||||||
|
HiLink jsTemplateBraces jsBraces
|
||||||
|
HiLink jsGlobalObjects Special
|
||||||
|
HiLink jsExceptions Special
|
||||||
|
HiLink jsBuiltins Special
|
||||||
|
HiLink jsModuleKeywords Include
|
||||||
|
HiLink jsModuleOperators Include
|
||||||
|
HiLink jsModuleDefault Include
|
||||||
|
HiLink jsDecorator Special
|
||||||
|
HiLink jsDecoratorFunction Special
|
||||||
|
HiLink jsFuncArgOperator jsFuncArgs
|
||||||
|
HiLink jsModuleAsterisk Noise
|
||||||
|
HiLink jsClassProperty jsObjectKey
|
||||||
|
HiLink jsSpreadOperator Operator
|
||||||
|
HiLink jsRestOperator Operator
|
||||||
|
HiLink jsRestExpression jsFuncArgs
|
||||||
|
HiLink jsSwitchColon Noise
|
||||||
|
HiLink jsClassMethodType Type
|
||||||
|
HiLink jsObjectMethodType Type
|
||||||
|
|
||||||
"Dollar sign is permitted anywhere in an identifier
|
HiLink jsDestructuringBraces Noise
|
||||||
setlocal iskeyword-=$
|
HiLink jsDestructuringProperty jsFuncArgs
|
||||||
if &filetype =~ 'javascript'
|
HiLink jsDestructuringAssignment jsObjectKey
|
||||||
setlocal iskeyword+=$
|
HiLink jsDestructuringNoise Noise
|
||||||
syntax cluster htmlJavaScript contains=TOP
|
|
||||||
endif
|
|
||||||
|
|
||||||
syntax sync fromstart
|
HiLink jsDomErrNo Constant
|
||||||
|
HiLink jsDomNodeConsts Constant
|
||||||
|
HiLink jsDomElemAttrs Label
|
||||||
|
HiLink jsDomElemFuncs PreProc
|
||||||
|
|
||||||
"Syntax coloring for Node.js shebang line
|
HiLink jsHtmlEvents Special
|
||||||
syntax match shellbang "^#!.*node\>"
|
HiLink jsHtmlElemAttrs Label
|
||||||
syntax match shellbang "^#!.*iojs\>"
|
HiLink jsHtmlElemFuncs PreProc
|
||||||
|
|
||||||
syntax match javascriptOpSymbols /:\ze\_[^+\-*/%\^=!<>&|?:]/ nextgroup=@javascriptStatement,javascriptCase skipwhite skipempty
|
HiLink jsCssStyles Label
|
||||||
syntax match javascriptOpSymbols /[+\-*/%\^=!<>&|?:]\+/ contains=javascriptOpSymbol nextgroup=@javascriptExpression skipwhite skipempty
|
|
||||||
|
|
||||||
"JavaScript comments
|
|
||||||
syntax keyword javascriptCommentTodo contained TODO FIXME XXX TBD
|
|
||||||
syntax match javascriptLineComment "//.*" contains=@Spell,javascriptCommentTodo
|
|
||||||
syntax region javascriptComment start="/\*" end="\*/" contains=@Spell,javascriptCommentTodo extend
|
|
||||||
syntax cluster javascriptComments contains=javascriptDocComment,javascriptComment,javascriptLineComment
|
|
||||||
|
|
||||||
"JSDoc
|
|
||||||
syntax case ignore
|
|
||||||
|
|
||||||
syntax region javascriptDocComment start="/\*\*" end="\*/" contains=javascriptDocNotation,javascriptCommentTodo,@Spell fold keepend
|
|
||||||
syntax match javascriptDocNotation contained / @/ nextgroup=javascriptDocTags
|
|
||||||
|
|
||||||
syntax keyword javascriptDocTags contained constant constructor constructs function ignore inner private public readonly static
|
|
||||||
syntax keyword javascriptDocTags contained const dict expose inheritDoc interface nosideeffects override protected struct
|
|
||||||
syntax keyword javascriptDocTags contained example global
|
|
||||||
|
|
||||||
" syntax keyword javascriptDocTags contained ngdoc nextgroup=javascriptDocNGDirective
|
|
||||||
syntax keyword javascriptDocTags contained ngdoc scope priority animations
|
|
||||||
syntax keyword javascriptDocTags contained ngdoc restrict methodOf propertyOf eventOf eventType nextgroup=javascriptDocParam skipwhite
|
|
||||||
syntax keyword javascriptDocNGDirective contained overview service object function method property event directive filter inputType error
|
|
||||||
|
|
||||||
syntax keyword javascriptDocTags contained abstract virtual access augments
|
|
||||||
|
|
||||||
syntax keyword javascriptDocTags contained arguments callback lends memberOf name type kind link mixes mixin tutorial nextgroup=javascriptDocParam skipwhite
|
|
||||||
syntax keyword javascriptDocTags contained variation nextgroup=javascriptDocNumParam skipwhite
|
|
||||||
|
|
||||||
syntax keyword javascriptDocTags contained author class classdesc copyright default defaultvalue nextgroup=javascriptDocDesc skipwhite
|
|
||||||
syntax keyword javascriptDocTags contained deprecated description external host nextgroup=javascriptDocDesc skipwhite
|
|
||||||
syntax keyword javascriptDocTags contained file fileOverview overview namespace requires since version nextgroup=javascriptDocDesc skipwhite
|
|
||||||
syntax keyword javascriptDocTags contained summary todo license preserve nextgroup=javascriptDocDesc skipwhite
|
|
||||||
|
|
||||||
syntax keyword javascriptDocTags contained borrows exports nextgroup=javascriptDocA skipwhite
|
|
||||||
syntax keyword javascriptDocTags contained param arg argument property prop module nextgroup=javascriptDocNamedParamType,javascriptDocParamName skipwhite
|
|
||||||
syntax keyword javascriptDocTags contained type nextgroup=javascriptDocParamType skipwhite
|
|
||||||
syntax keyword javascriptDocTags contained define enum extends implements this typedef nextgroup=javascriptDocParamType skipwhite
|
|
||||||
syntax keyword javascriptDocTags contained return returns throws exception nextgroup=javascriptDocParamType,javascriptDocParamName skipwhite
|
|
||||||
syntax keyword javascriptDocTags contained see nextgroup=javascriptDocRef skipwhite
|
|
||||||
|
|
||||||
"syntax for event firing
|
|
||||||
syntax keyword javascriptDocTags contained emits fires nextgroup=javascriptDocEventRef skipwhite
|
|
||||||
|
|
||||||
syntax keyword javascriptDocTags contained function func method nextgroup=javascriptDocName skipwhite
|
|
||||||
syntax match javascriptDocName contained /\h\w*/
|
|
||||||
|
|
||||||
syntax keyword javascriptDocTags contained fires event nextgroup=javascriptDocEventRef skipwhite
|
|
||||||
syntax match javascriptDocEventRef contained /\h\w*#\(\h\w*\:\)\?\h\w*/
|
|
||||||
|
|
||||||
syntax match javascriptDocNamedParamType contained /{.\+}/ nextgroup=javascriptDocParamName skipwhite
|
|
||||||
syntax match javascriptDocParamName contained /\[\?[0-9a-zA-Z_\.]\+=\?[0-9a-zA-Z_\.]*\]\?/ nextgroup=javascriptDocDesc skipwhite
|
|
||||||
syntax match javascriptDocParamType contained /{.\+}/ nextgroup=javascriptDocDesc skipwhite
|
|
||||||
syntax match javascriptDocA contained /\%(#\|\w\|\.\|:\|\/\)\+/ nextgroup=javascriptDocAs skipwhite
|
|
||||||
syntax match javascriptDocAs contained /\s*as\s*/ nextgroup=javascriptDocB skipwhite
|
|
||||||
syntax match javascriptDocB contained /\%(#\|\w\|\.\|:\|\/\)\+/
|
|
||||||
syntax match javascriptDocParam contained /\%(#\|\w\|\.\|:\|\/\|-\)\+/
|
|
||||||
syntax match javascriptDocNumParam contained /\d\+/
|
|
||||||
syntax match javascriptDocRef contained /\%(#\|\w\|\.\|:\|\/\)\+/
|
|
||||||
syntax region javascriptDocLinkTag contained matchgroup=javascriptDocLinkTag start=/{/ end=/}/ contains=javascriptDocTags
|
|
||||||
|
|
||||||
syntax cluster javascriptDocs contains=javascriptDocParamType,javascriptDocNamedParamType,javascriptDocParam
|
|
||||||
|
|
||||||
if main_syntax == "javascript"
|
|
||||||
syntax sync clear
|
|
||||||
syntax sync ccomment javascriptComment minlines=200
|
|
||||||
endif
|
|
||||||
|
|
||||||
syntax case match
|
|
||||||
|
|
||||||
syntax cluster javascriptAfterIdentifier contains=javascriptDotNotation,javascriptFuncCallArg,javascriptComputedProperty,javascriptWSymbols,@javascriptSymbols
|
|
||||||
|
|
||||||
syntax match javascriptIdentifierName /\<[^=<>!?+\-*\/%|&,;:. ~@#`"'\[\]\(\)\{\}\^0-9][^=<>!?+\-*\/%|&,;:. ~@#`"'\[\]\(\)\{\}\^]*/ nextgroup=@javascriptAfterIdentifier contains=@_semantic
|
|
||||||
|
|
||||||
"Block VariableStatement EmptyStatement ExpressionStatement IfStatement IterationStatement ContinueStatement BreakStatement ReturnStatement WithStatement LabelledStatement SwitchStatement ThrowStatement TryStatement DebuggerStatement
|
|
||||||
|
|
||||||
syntax cluster javascriptStatement contains=javascriptBlock,javascriptVariable,@javascriptExpression,javascriptConditional,javascriptRepeat,javascriptBranch,javascriptLabel,javascriptStatementKeyword,javascriptTry,javascriptDebugger
|
|
||||||
|
|
||||||
"Syntax in the JavaScript code
|
|
||||||
" syntax match javascriptASCII contained /\\\d\d\d/
|
|
||||||
syntax region javascriptTemplateSubstitution contained matchgroup=javascriptTemplateSB start=/\${/ end=/}/ contains=javascriptTemplateSBlock,javascriptTemplateSString
|
|
||||||
syntax region javascriptTemplateSBlock contained start=/{/ end=/}/ contains=javascriptTemplateSBlock,javascriptTemplateSString transparent
|
|
||||||
syntax region javascriptTemplateSString contained start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ extend contains=javascriptTemplateSStringRB transparent
|
|
||||||
syntax match javascriptTemplateSStringRB /}/ contained
|
|
||||||
syntax region javascriptString start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ nextgroup=@javascriptSymbols skipwhite skipempty
|
|
||||||
syntax region javascriptTemplate start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/ contains=javascriptTemplateSubstitution nextgroup=@javascriptSymbols skipwhite skipempty
|
|
||||||
" syntax match javascriptTemplateTag /\k\+/ nextgroup=javascriptTemplate
|
|
||||||
syntax region javascriptArray matchgroup=javascriptBraces start=/\[/ end=/]/ contains=@javascriptValue,javascriptForComprehension,@javascriptComments nextgroup=@javascriptSymbols,@javascriptComments skipwhite skipempty
|
|
||||||
|
|
||||||
syntax match javascriptNumber /\<0[bB][01]\+\>/ nextgroup=@javascriptSymbols skipwhite skipempty
|
|
||||||
syntax match javascriptNumber /\<0[oO][0-7]\+\>/ nextgroup=@javascriptSymbols skipwhite skipempty
|
|
||||||
syntax match javascriptNumber /\<0[xX][0-9a-fA-F]\+\>/ nextgroup=@javascriptSymbols skipwhite skipempty
|
|
||||||
syntax match javascriptNumber /[+-]\=\%(\d\+\.\d\+\|\d\+\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/ nextgroup=@javascriptSymbols skipwhite skipempty
|
|
||||||
|
|
||||||
syntax cluster javascriptTypes contains=javascriptString,javascriptTemplate,javascriptRegexpString,javascriptNumber,javascriptBoolean,javascriptNull,javascriptArray
|
|
||||||
syntax cluster javascriptValue contains=@javascriptTypes,@javascriptExpression,javascriptFuncKeyword,javascriptClassKeyword,javascriptObjectLiteral,javascriptIdentifier,javascriptIdentifierName,javascriptOperator,@javascriptSymbols
|
|
||||||
|
|
||||||
syntax match javascriptLabel /[a-zA-Z_$]\k*\_s*:/he=e-1 nextgroup=@javascriptValue,@javascriptStatement skipwhite skipempty
|
|
||||||
syntax match javascriptObjectLabel contained /\k\+\_s*:/he=e-1 contains=javascriptObjectLabelColon nextgroup=@javascriptValue,@javascriptStatement skipwhite skipempty
|
|
||||||
syntax match javascriptObjectLabelColon contained /:/ nextgroup=@javascriptValue,@javascriptStatement skipwhite skipempty
|
|
||||||
" syntax match javascriptPropertyName contained /"[^"]\+"\s*:/he=e-1 nextgroup=@javascriptValue skipwhite skipempty
|
|
||||||
" syntax match javascriptPropertyName contained /'[^']\+'\s*:/he=e-1 nextgroup=@javascriptValue skipwhite skipempty
|
|
||||||
syntax region javascriptPropertyName contained start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ nextgroup=javascriptObjectLabelColon skipwhite skipempty
|
|
||||||
syntax region javascriptComputedPropertyName contained matchgroup=javascriptPropertyName start=/\[/rs=s+1 end=/]/ contains=@javascriptValue nextgroup=javascriptObjectLabelColon skipwhite skipempty
|
|
||||||
syntax region javascriptComputedProperty contained matchgroup=javascriptProperty start=/\[/rs=s+1 end=/]/ contains=@javascriptValue,@javascriptSymbols nextgroup=@javascriptAfterIdentifier skipwhite skipempty
|
|
||||||
" Value for object, statement for label statement
|
|
||||||
|
|
||||||
syntax cluster javascriptTemplates contains=javascriptTemplate,javascriptTemplateSubstitution,javascriptTemplateSBlock,javascriptTemplateSString,javascriptTemplateSStringRB,javascriptTemplateSB
|
|
||||||
syntax cluster javascriptStrings contains=javascriptProp,javascriptString,@javascriptTemplates,@javascriptComments,javascriptDocComment,javascriptRegexpString,javascriptPropertyName
|
|
||||||
|
|
||||||
"this
|
|
||||||
|
|
||||||
"JavaScript Prototype
|
|
||||||
syntax keyword javascriptPrototype prototype
|
|
||||||
|
|
||||||
"Program Keywords
|
|
||||||
syntax keyword javascriptIdentifier arguments this nextgroup=@javascriptAfterIdentifier
|
|
||||||
syntax keyword javascriptVariable let var const
|
|
||||||
syntax keyword javascriptOperator delete new instanceof typeof void in nextgroup=@javascriptValue,@javascriptTypes skipwhite skipempty
|
|
||||||
syntax keyword javascriptForOperator contained in of
|
|
||||||
syntax keyword javascriptBoolean true false nextgroup=@javascriptSymbols skipwhite skipempty
|
|
||||||
syntax keyword javascriptNull null undefined nextgroup=@javascriptSymbols skipwhite skipempty
|
|
||||||
syntax keyword javascriptMessage alert confirm prompt status
|
|
||||||
syntax keyword javascriptGlobal self top parent
|
|
||||||
|
|
||||||
"Statement Keywords
|
|
||||||
syntax keyword javascriptConditional if else switch
|
|
||||||
syntax keyword javascriptConditionalElse else
|
|
||||||
syntax keyword javascriptRepeat do while for nextgroup=javascriptLoopParen skipwhite skipempty
|
|
||||||
syntax keyword javascriptBranch break continue
|
|
||||||
syntax keyword javascriptCase case nextgroup=@javascriptTypes skipwhite
|
|
||||||
syntax keyword javascriptDefault default
|
|
||||||
syntax keyword javascriptStatementKeyword return with yield
|
|
||||||
syntax keyword javascriptReturn return nextgroup=@javascriptValue skipwhite
|
|
||||||
syntax keyword javascriptYield yield
|
|
||||||
|
|
||||||
syntax keyword javascriptTry try
|
|
||||||
syntax keyword javascriptExceptions catch throw finally
|
|
||||||
syntax keyword javascriptDebugger debugger
|
|
||||||
|
|
||||||
syntax match javascriptProp contained /[a-zA-Z_$][a-zA-Z0-9_$]*/ contains=@props,@_semantic transparent nextgroup=@javascriptAfterIdentifier
|
|
||||||
syntax match javascriptMethod contained /[a-zA-Z_$][a-zA-Z0-9_$]*\ze(/ contains=@props transparent nextgroup=javascriptFuncCallArg
|
|
||||||
syntax match javascriptDotNotation /\./ nextgroup=javascriptProp,javascriptMethod
|
|
||||||
syntax match javascriptDotStyleNotation /\.style\./ nextgroup=javascriptDOMStyle transparent
|
|
||||||
|
|
||||||
runtime syntax/yajs/javascript.vim
|
|
||||||
runtime syntax/yajs/es6-number.vim
|
|
||||||
runtime syntax/yajs/es6-string.vim
|
|
||||||
runtime syntax/yajs/es6-array.vim
|
|
||||||
runtime syntax/yajs/es6-object.vim
|
|
||||||
runtime syntax/yajs/es6-symbol.vim
|
|
||||||
runtime syntax/yajs/es6-function.vim
|
|
||||||
runtime syntax/yajs/es6-math.vim
|
|
||||||
runtime syntax/yajs/es6-date.vim
|
|
||||||
runtime syntax/yajs/es6-json.vim
|
|
||||||
runtime syntax/yajs/es6-regexp.vim
|
|
||||||
runtime syntax/yajs/es6-map.vim
|
|
||||||
runtime syntax/yajs/es6-set.vim
|
|
||||||
runtime syntax/yajs/es6-proxy.vim
|
|
||||||
runtime syntax/yajs/es6-promise.vim
|
|
||||||
runtime syntax/yajs/node.vim
|
|
||||||
runtime syntax/yajs/web.vim
|
|
||||||
|
|
||||||
let javascript_props = 1
|
|
||||||
|
|
||||||
runtime syntax/yajs/event.vim
|
|
||||||
syntax region javascriptEventString contained start=/\z(["']\)/ skip=/\\\\\|\\\z1\|\\\n/ end=/\z1\|$/ contains=javascriptASCII,@events
|
|
||||||
|
|
||||||
"Import
|
|
||||||
syntax region javascriptImportDef start=/import/ end=/;\|\n/ contains=javascriptImport,javascriptString,javascriptEndColons
|
|
||||||
syntax keyword javascriptImport contained from as import
|
|
||||||
syntax keyword javascriptExport export module
|
|
||||||
|
|
||||||
syntax region javascriptBlock matchgroup=javascriptBraces start=/\([\^:]\s\*\)\=\zs{/ end=/}/ contains=@htmlJavaScript
|
|
||||||
|
|
||||||
syntax region javascriptMethodDef contained start=/\(\(\(set\|get\)\_s\+\)\?\)[a-zA-Z_$]\k*\_s*(/ end=/)/ contains=javascriptMethodAccessor,javascriptMethodName,javascriptFuncArg nextgroup=javascriptBlock skipwhite keepend
|
|
||||||
syntax region javascriptMethodArgs contained start=/(/ end=/)/ contains=javascriptFuncArg,@javascriptComments nextgroup=javascriptBlock skipwhite keepend
|
|
||||||
syntax match javascriptMethodName contained /[a-zA-Z_$]\k*/ nextgroup=javascriptMethodArgs skipwhite skipempty
|
|
||||||
syntax match javascriptMethodAccessor contained /\(set\|get\)\s\+\ze\k/ contains=javascriptMethodAccessorWords
|
|
||||||
syntax keyword javascriptMethodAccessorWords contained get set
|
|
||||||
syntax region javascriptMethodName contained matchgroup=javascriptPropertyName start=/\[/ end=/]/ contains=@javascriptValue nextgroup=javascriptMethodArgs skipwhite skipempty
|
|
||||||
|
|
||||||
syntax keyword javascriptAsyncFuncKeyword async await
|
|
||||||
" syntax keyword javascriptFuncKeyword function nextgroup=javascriptFuncName,javascriptFuncArg skipwhite
|
|
||||||
syntax keyword javascriptFuncKeyword function nextgroup=javascriptAsyncFunc,javascriptSyncFunc
|
|
||||||
syntax match javascriptSyncFunc contained // nextgroup=javascriptFuncName,javascriptFuncArg skipwhite skipempty
|
|
||||||
syntax match javascriptAsyncFunc contained /\s*\*\s*/ nextgroup=javascriptFuncName,javascriptFuncArg skipwhite skipempty
|
|
||||||
syntax match javascriptFuncName contained /[a-zA-Z_$]\k*/ nextgroup=javascriptFuncArg skipwhite
|
|
||||||
syntax match javascriptFuncArg contained /(\_[^()]*)/ contains=javascriptParens,javascriptFuncKeyword,javascriptFuncComma nextgroup=javascriptBlock skipwhite skipwhite skipempty
|
|
||||||
syntax match javascriptFuncComma contained /,/
|
|
||||||
|
|
||||||
|
|
||||||
"Class
|
|
||||||
syntax keyword javascriptClassKeyword class nextgroup=javascriptClassName skipwhite
|
|
||||||
syntax keyword javascriptClassSuper super
|
|
||||||
syntax match javascriptClassName contained /\k\+/ nextgroup=javascriptClassBlock,javascriptClassExtends skipwhite
|
|
||||||
syntax match javascriptClassSuperName contained /[a-zA-Z_$][a-zA-Z_$\[\]\.]*/ nextgroup=javascriptClassBlock skipwhite
|
|
||||||
syntax keyword javascriptClassExtends contained extends nextgroup=javascriptClassSuperName skipwhite
|
|
||||||
syntax region javascriptClassBlock contained matchgroup=javascriptBraces start=/{/ end=/}/ contains=javascriptMethodName,javascriptMethodAccessor,javascriptClassStatic,@javascriptComments
|
|
||||||
syntax keyword javascriptClassStatic contained static nextgroup=javascriptMethodName,javascriptMethodAccessor skipwhite
|
|
||||||
|
|
||||||
|
|
||||||
syntax keyword javascriptForComprehension contained for nextgroup=javascriptForComprehensionTail skipwhite skipempty
|
|
||||||
syntax region javascriptForComprehensionTail contained matchgroup=javascriptParens start=/(/ end=/)/ contains=javascriptOfComprehension,@javascriptExpression nextgroup=javascriptForComprehension,javascriptIfComprehension,@javascriptExpression skipwhite skipempty
|
|
||||||
syntax keyword javascriptOfComprehension contained of
|
|
||||||
syntax keyword javascriptIfComprehension contained if nextgroup=javascriptIfComprehensionTail
|
|
||||||
syntax region javascriptIfComprehensionTail contained matchgroup=javascriptParens start=/(/ end=/)/ contains=javascriptExpression nextgroup=javascriptForComprehension,javascriptIfComprehension skipwhite skipempty
|
|
||||||
|
|
||||||
syntax region javascriptObjectLiteral contained matchgroup=javascriptBraces start=/{/ end=/}/ contains=@javascriptComments,javascriptObjectLabel,javascriptPropertyName,javascriptMethodDef,javascriptComputedPropertyName,@javascriptValue
|
|
||||||
|
|
||||||
" syntax match javascriptBraces /[\[\]]/
|
|
||||||
syntax match javascriptParens /[()]/
|
|
||||||
" syntax match javascriptOpSymbols /[^+\-*/%\^=!<>&|?]\@<=\(<\|>\|<=\|>=\|==\|!=\|===\|!==\|+\|-\|*\|%\|++\|--\|<<\|>>\|>>>\|&\||\|^\|!\|\~\|&&\|||\|?\|=\|+=\|-=\|*=\|%=\|<<=\|>>=\|>>>=\|&=\||=\|^=\|\/\|\/=\)\ze\_[^+\-*/%\^=!<>&|?]/ nextgroup=@javascriptExpression skipwhite
|
|
||||||
" syntax match javascriptInvalidOp contained /[+\-*/%\^=!<>&|?:]\+/
|
|
||||||
syntax match javascriptOpSymbol contained /\(<\|>\|<=\|>=\|==\|!=\|===\|!==\|+\|*\|%\|++\|--\|<<\|>>\|>>>\|&\||\|^\|!\|\~\|&&\|||\|?\|=\|+=\|-=\|*=\|%=\|<<=\|>>=\|>>>=\|&=\||=\|^=\|\/\|\/=\)\ze\_[^+\-*/%\^=!<>&|?:]/ nextgroup=javascriptInvalidOp skipwhite skipempty
|
|
||||||
syn region htmlScriptTag contained start=+<script+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
|
|
||||||
syntax match javascriptWOpSymbols contained /\_s\+/ nextgroup=javascriptOpSymbols
|
|
||||||
syntax match javascriptEndColons /[;,]/
|
|
||||||
syntax match javascriptLogicSymbols /[^&|]\@<=\(&&\|||\)\ze\_[^&|]/ nextgroup=@javascriptExpression skipwhite skipempty
|
|
||||||
syntax cluster javascriptSymbols contains=javascriptOpSymbols,javascriptLogicSymbols
|
|
||||||
syntax match javascriptWSymbols contained /\_s\+/ nextgroup=@javascriptSymbols
|
|
||||||
|
|
||||||
syntax region javascriptRegexpString start="\(^\|&\||\|=\|(\|{\|;\|:\|\[\|!\)\@<=\_s*/[^/*]"me=e-1 skip="\\\\\|[^\\]\@<=\\/" end="/[gimy]\{0,2\}" oneline
|
|
||||||
|
|
||||||
syntax cluster javascriptEventTypes contains=javascriptEventString,javascriptTemplate,javascriptNumber,javascriptBoolean,javascriptNull
|
|
||||||
syntax cluster javascriptOps contains=javascriptOpSymbols,javascriptLogicSymbols,javascriptOperator
|
|
||||||
syntax region javascriptParenExp matchgroup=javascriptParens start=/(/ end=/)/ contains=@javascriptExpression nextgroup=@javascriptSymbols skipwhite skipempty
|
|
||||||
syntax cluster javascriptExpression contains=javascriptArrowFuncDef,javascriptParenExp,@javascriptValue,javascriptObjectLiteral,javascriptFuncKeyword,javascriptYield,javascriptIdentifierName,javascriptRegexpString,@javascriptTypes,@javascriptOps,javascriptGlobal,jsxRegion
|
|
||||||
syntax cluster javascriptEventExpression contains=javascriptArrowFuncDef,javascriptParenExp,@javascriptValue,javascriptObjectLiteral,javascriptFuncKeyword,javascriptIdentifierName,javascriptRegexpString,@javascriptEventTypes,@javascriptOps,javascriptGlobal,jsxRegion
|
|
||||||
|
|
||||||
syntax region javascriptLoopParen contained matchgroup=javascriptParens start=/(/ end=/)/ contains=javascriptVariable,javascriptForOperator,javascriptEndColons,@javascriptExpression nextgroup=javascriptBlock skipwhite skipempty
|
|
||||||
|
|
||||||
" syntax match javascriptFuncCall contained /[a-zA-Z]\k*\ze(/ nextgroup=javascriptFuncCallArg
|
|
||||||
syntax region javascriptFuncCallArg contained matchgroup=javascriptParens start=/(/ end=/)/ contains=@javascriptExpression,@javascriptComments nextgroup=@javascriptAfterIdentifier
|
|
||||||
syntax cluster javascriptSymbols contains=javascriptOpSymbols,javascriptLogicSymbols
|
|
||||||
syntax match javascriptWSymbols contained /\_s\+/ nextgroup=@javascriptSymbols
|
|
||||||
syntax region javascriptEventFuncCallArg contained matchgroup=javascriptParens start=/(/ end=/)/ contains=@javascriptEventExpression,@javascriptComments
|
|
||||||
|
|
||||||
syntax match javascriptArrowFuncDef contained /([^)]*)\_s*=>/ contains=javascriptFuncArg,javascriptArrowFunc nextgroup=javascriptBlock skipwhite skipempty
|
|
||||||
syntax match javascriptArrowFuncDef contained /[a-zA-Z_$][a-zA-Z0-9_$]*\_s*=>/ contains=javascriptArrowFuncArg,javascriptArrowFunc nextgroup=javascriptBlock skipwhite skipempty
|
|
||||||
syntax match javascriptArrowFunc /=>/
|
|
||||||
syntax match javascriptArrowFuncArg contained /[a-zA-Z_$]\k*/
|
|
||||||
|
|
||||||
runtime syntax/semhl.vim
|
|
||||||
|
|
||||||
if exists("did_javascript_hilink")
|
|
||||||
HiLink javascriptEndColons Exception
|
|
||||||
HiLink javascriptOpSymbols Normal
|
|
||||||
HiLink javascriptLogicSymbols Boolean
|
|
||||||
HiLink javascriptBraces Function
|
|
||||||
HiLink javascriptParens Normal
|
|
||||||
HiLink javascriptComment Comment
|
|
||||||
HiLink javascriptLineComment Comment
|
|
||||||
HiLink javascriptDocComment Comment
|
|
||||||
HiLink javascriptCommentTodo Todo
|
|
||||||
HiLink javascriptDocNotation SpecialComment
|
|
||||||
HiLink javascriptDocTags SpecialComment
|
|
||||||
HiLink javascriptDocNGParam javascriptDocParam
|
|
||||||
HiLink javascriptDocParam Function
|
|
||||||
HiLink javascriptDocNumParam Function
|
|
||||||
HiLink javascriptDocEventRef Function
|
|
||||||
HiLink javascriptDocNamedParamType Type
|
|
||||||
HiLink javascriptDocParamName Type
|
|
||||||
HiLink javascriptDocParamType Type
|
|
||||||
HiLink javascriptString String
|
|
||||||
HiLink javascriptTemplate String
|
|
||||||
HiLink javascriptEventString String
|
|
||||||
HiLink javascriptASCII Label
|
|
||||||
HiLink javascriptTemplateSubstitution Label
|
|
||||||
" HiLink javascriptTemplateSBlock Label
|
|
||||||
" HiLink javascriptTemplateSString Label
|
|
||||||
HiLink javascriptTemplateSStringRB javascriptTemplateSubstitution
|
|
||||||
HiLink javascriptTemplateSB javascriptTemplateSubstitution
|
|
||||||
HiLink javascriptRegexpString String
|
|
||||||
HiLink javascriptGlobal Constant
|
|
||||||
HiLink javascriptCharacter Character
|
|
||||||
HiLink javascriptPrototype Type
|
|
||||||
HiLink javascriptConditional Conditional
|
|
||||||
HiLink javascriptConditionalElse Conditional
|
|
||||||
HiLink javascriptCase Conditional
|
|
||||||
HiLink javascriptDefault javascriptCase
|
|
||||||
HiLink javascriptBranch Conditional
|
|
||||||
HiLink javascriptIdentifier Structure
|
|
||||||
HiLink javascriptVariable Identifier
|
|
||||||
HiLink javascriptRepeat Repeat
|
|
||||||
HiLink javascriptForComprehension Repeat
|
|
||||||
HiLink javascriptIfComprehension Repeat
|
|
||||||
HiLink javascriptOfComprehension Repeat
|
|
||||||
HiLink javascriptForOperator Repeat
|
|
||||||
HiLink javascriptStatementKeyword Statement
|
|
||||||
HiLink javascriptReturn Statement
|
|
||||||
HiLink javascriptYield Statement
|
|
||||||
HiLink javascriptMessage Keyword
|
|
||||||
HiLink javascriptOperator Identifier
|
|
||||||
" HiLink javascriptType Type
|
|
||||||
HiLink javascriptNull Boolean
|
|
||||||
HiLink javascriptNumber Number
|
|
||||||
HiLink javascriptBoolean Boolean
|
|
||||||
HiLink javascriptObjectLabel javascriptLabel
|
|
||||||
HiLink javascriptLabel Label
|
|
||||||
HiLink javascriptPropertyName Label
|
|
||||||
HiLink javascriptImport Special
|
|
||||||
HiLink javascriptExport Special
|
|
||||||
HiLink javascriptTry Special
|
|
||||||
HiLink javascriptExceptions Special
|
|
||||||
|
|
||||||
HiLink javascriptMethodName Function
|
|
||||||
HiLink javascriptMethodAccessor Operator
|
|
||||||
|
|
||||||
HiLink javascriptAsyncFuncKeyword Keyword
|
|
||||||
HiLink javascriptFuncKeyword Keyword
|
|
||||||
HiLink javascriptAsyncFunc Keyword
|
|
||||||
HiLink javascriptArrowFunc Type
|
|
||||||
HiLink javascriptFuncName Function
|
|
||||||
HiLink javascriptFuncArg Special
|
|
||||||
HiLink javascriptArrowFuncArg javascriptFuncArg
|
|
||||||
HiLink javascriptFuncComma Operator
|
|
||||||
|
|
||||||
HiLink javascriptClassKeyword Keyword
|
|
||||||
HiLink javascriptClassExtends Keyword
|
|
||||||
HiLink javascriptClassName Function
|
|
||||||
HiLink javascriptClassSuperName Function
|
|
||||||
HiLink javascriptClassStatic StorageClass
|
|
||||||
HiLink javascriptClassSuper keyword
|
|
||||||
|
|
||||||
HiLink shellbang Comment
|
|
||||||
|
|
||||||
highlight link javaScript NONE
|
|
||||||
|
|
||||||
delcommand HiLink
|
delcommand HiLink
|
||||||
unlet did_javascript_hilink
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Define the htmlJavaScript for HTML syntax html.vim
|
||||||
|
syntax cluster htmlJavaScript contains=@jsAll
|
||||||
|
syntax cluster javaScriptExpression contains=@jsAll
|
||||||
|
|
||||||
|
" Vim's default html.vim highlights all javascript as 'Special'
|
||||||
|
hi! def link javaScript NONE
|
||||||
|
|
||||||
let b:current_syntax = "javascript"
|
let b:current_syntax = "javascript"
|
||||||
if main_syntax == 'javascript'
|
if main_syntax == 'javascript'
|
||||||
unlet main_syntax
|
unlet main_syntax
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json') == -1
|
|||||||
" Maintainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
|
" Maintainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
|
||||||
" Last Change: 2014-12-20 Load ftplugin/json.vim
|
" Last Change: 2014-12-20 Load ftplugin/json.vim
|
||||||
|
|
||||||
|
" Reload the definition of g:vim_json_syntax_conceal
|
||||||
|
" see https://github.com/elzr/vim-json/issues/42
|
||||||
|
runtime! ftplugin/json.vim
|
||||||
|
|
||||||
if !exists("main_syntax")
|
if !exists("main_syntax")
|
||||||
if version < 600
|
if version < 600
|
||||||
syntax clear
|
syntax clear
|
||||||
@@ -16,10 +20,16 @@ endif
|
|||||||
|
|
||||||
syntax match jsonNoise /\%(:\|,\)/
|
syntax match jsonNoise /\%(:\|,\)/
|
||||||
|
|
||||||
|
" NOTE that for the concealing to work your conceallevel should be set to 2
|
||||||
|
|
||||||
" Syntax: Strings
|
" Syntax: Strings
|
||||||
" Separated into a match and region because a region by itself is always greedy
|
" Separated into a match and region because a region by itself is always greedy
|
||||||
syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
|
syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
|
||||||
syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ concealends contains=jsonEscape contained
|
if has('conceal') && g:vim_json_syntax_conceal == 1
|
||||||
|
syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ concealends contains=jsonEscape contained
|
||||||
|
else
|
||||||
|
syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=jsonEscape contained
|
||||||
|
endif
|
||||||
|
|
||||||
" Syntax: JSON does not allow strings with single quotes, unlike JavaScript.
|
" Syntax: JSON does not allow strings with single quotes, unlike JavaScript.
|
||||||
syn region jsonStringSQError oneline start=+'+ skip=+\\\\\|\\"+ end=+'+
|
syn region jsonStringSQError oneline start=+'+ skip=+\\\\\|\\"+ end=+'+
|
||||||
@@ -27,7 +37,11 @@ syn region jsonStringSQError oneline start=+'+ skip=+\\\\\|\\"+ end=+'+
|
|||||||
" Syntax: JSON Keywords
|
" Syntax: JSON Keywords
|
||||||
" Separated into a match and region because a region by itself is always greedy
|
" Separated into a match and region because a region by itself is always greedy
|
||||||
syn match jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword
|
syn match jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword
|
||||||
syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ contains=jsonEscape contained
|
if has('conceal') && g:vim_json_syntax_conceal == 1
|
||||||
|
syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ concealends contains=jsonEscape contained
|
||||||
|
else
|
||||||
|
syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ contains=jsonEscape contained
|
||||||
|
endif
|
||||||
|
|
||||||
" Syntax: Escape sequences
|
" Syntax: Escape sequences
|
||||||
syn match jsonEscape "\\["\\/bfnrt]" contained
|
syn match jsonEscape "\\["\\/bfnrt]" contained
|
||||||
@@ -37,31 +51,33 @@ syn match jsonEscape "\\u\x\{4}" contained
|
|||||||
syn match jsonNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>\ze[[:blank:]\r\n]*[,}\]]"
|
syn match jsonNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>\ze[[:blank:]\r\n]*[,}\]]"
|
||||||
|
|
||||||
" ERROR WARNINGS **********************************************
|
" ERROR WARNINGS **********************************************
|
||||||
" Syntax: Strings should always be enclosed with quotes.
|
if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1)
|
||||||
syn match jsonNoQuotesError "\<[[:alpha:]][[:alnum:]]*\>"
|
" Syntax: Strings should always be enclosed with quotes.
|
||||||
syn match jsonTripleQuotesError /"""/
|
syn match jsonNoQuotesError "\<[[:alpha:]][[:alnum:]]*\>"
|
||||||
|
syn match jsonTripleQuotesError /"""/
|
||||||
|
|
||||||
" Syntax: An integer part of 0 followed by other digits is not allowed.
|
" Syntax: An integer part of 0 followed by other digits is not allowed.
|
||||||
syn match jsonNumError "-\=\<0\d\.\d*\>"
|
syn match jsonNumError "-\=\<0\d\.\d*\>"
|
||||||
|
|
||||||
" Syntax: Decimals smaller than one should begin with 0 (so .1 should be 0.1).
|
" Syntax: Decimals smaller than one should begin with 0 (so .1 should be 0.1).
|
||||||
syn match jsonNumError "\:\@<=[[:blank:]\r\n]*\zs\.\d\+"
|
syn match jsonNumError "\:\@<=[[:blank:]\r\n]*\zs\.\d\+"
|
||||||
|
|
||||||
" Syntax: No comments in JSON, see http://stackoverflow.com/questions/244777/can-i-comment-a-json-file
|
" Syntax: No comments in JSON, see http://stackoverflow.com/questions/244777/can-i-comment-a-json-file
|
||||||
syn match jsonCommentError "//.*"
|
syn match jsonCommentError "//.*"
|
||||||
syn match jsonCommentError "\(/\*\)\|\(\*/\)"
|
syn match jsonCommentError "\(/\*\)\|\(\*/\)"
|
||||||
|
|
||||||
" Syntax: No semicolons in JSON
|
" Syntax: No semicolons in JSON
|
||||||
syn match jsonSemicolonError ";"
|
syn match jsonSemicolonError ";"
|
||||||
|
|
||||||
" Syntax: No trailing comma after the last element of arrays or objects
|
" Syntax: No trailing comma after the last element of arrays or objects
|
||||||
syn match jsonTrailingCommaError ",\_s*[}\]]"
|
syn match jsonTrailingCommaError ",\_s*[}\]]"
|
||||||
|
|
||||||
" Syntax: Watch out for missing commas between elements
|
" Syntax: Watch out for missing commas between elements
|
||||||
syn match jsonMissingCommaError /\("\|\]\|\d\)\zs\_s\+\ze"/
|
syn match jsonMissingCommaError /\("\|\]\|\d\)\zs\_s\+\ze"/
|
||||||
syn match jsonMissingCommaError /\(\]\|\}\)\_s\+\ze"/ "arrays/objects as values
|
syn match jsonMissingCommaError /\(\]\|\}\)\_s\+\ze"/ "arrays/objects as values
|
||||||
syn match jsonMissingCommaError /}\_s\+\ze{/ "objects as elements in an array
|
syn match jsonMissingCommaError /}\_s\+\ze{/ "objects as elements in an array
|
||||||
syn match jsonMissingCommaError /\(true\|false\)\_s\+\ze"/ "true/false as value
|
syn match jsonMissingCommaError /\(true\|false\)\_s\+\ze"/ "true/false as value
|
||||||
|
endif
|
||||||
|
|
||||||
" ********************************************** END OF ERROR WARNINGS
|
" ********************************************** END OF ERROR WARNINGS
|
||||||
" Allowances for JSONP: function call at the beginning of the file,
|
" Allowances for JSONP: function call at the beginning of the file,
|
||||||
@@ -87,20 +103,22 @@ if version >= 508 || !exists("did_json_syn_inits")
|
|||||||
hi def link jsonString String
|
hi def link jsonString String
|
||||||
hi def link jsonTest Label
|
hi def link jsonTest Label
|
||||||
hi def link jsonEscape Special
|
hi def link jsonEscape Special
|
||||||
hi def link jsonNumber Number
|
hi def link jsonNumber Delimiter
|
||||||
hi def link jsonBraces Delimiter
|
hi def link jsonBraces Delimiter
|
||||||
hi def link jsonNull Function
|
hi def link jsonNull Function
|
||||||
hi def link jsonBoolean Boolean
|
hi def link jsonBoolean Delimiter
|
||||||
hi def link jsonKeyword Label
|
hi def link jsonKeyword Label
|
||||||
|
|
||||||
hi def link jsonNumError Error
|
if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1)
|
||||||
hi def link jsonCommentError Error
|
hi def link jsonNumError Error
|
||||||
hi def link jsonSemicolonError Error
|
hi def link jsonCommentError Error
|
||||||
hi def link jsonTrailingCommaError Error
|
hi def link jsonSemicolonError Error
|
||||||
hi def link jsonMissingCommaError Error
|
hi def link jsonTrailingCommaError Error
|
||||||
hi def link jsonStringSQError Error
|
hi def link jsonMissingCommaError Error
|
||||||
hi def link jsonNoQuotesError Error
|
hi def link jsonStringSQError Error
|
||||||
hi def link jsonTripleQuotesError Error
|
hi def link jsonNoQuotesError Error
|
||||||
|
hi def link jsonTripleQuotesError Error
|
||||||
|
endif
|
||||||
hi def link jsonQuote Quote
|
hi def link jsonQuote Quote
|
||||||
hi def link jsonNoise Noise
|
hi def link jsonNoise Noise
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: Kotlin
|
" Language: Kotlin
|
||||||
" Maintainer: Alexander Udalov
|
" Maintainer: Alexander Udalov
|
||||||
" Latest Revision: 24 February 2016
|
" Latest Revision: 4 July 2016
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
@@ -22,14 +22,14 @@ syn keyword ktInclude import package
|
|||||||
|
|
||||||
syn keyword ktType Any Boolean Byte Char Double Float Int Long Nothing Short Unit
|
syn keyword ktType Any Boolean Byte Char Double Float Int Long Nothing Short Unit
|
||||||
syn keyword ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic
|
syn keyword ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic
|
||||||
syn keyword ktStructure class object interface fun val var constructor init
|
syn keyword ktStructure class object interface typealias fun val var constructor init
|
||||||
|
|
||||||
syn keyword ktReservedKeyword async typealias typeof yield
|
syn keyword ktReservedKeyword typeof
|
||||||
|
|
||||||
syn keyword ktBoolean true false
|
syn keyword ktBoolean true false
|
||||||
syn keyword ktConstant null
|
syn keyword ktConstant null
|
||||||
|
|
||||||
syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix
|
syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix coroutine suspend
|
||||||
|
|
||||||
syn keyword ktTodo TODO FIXME XXX contained
|
syn keyword ktTodo TODO FIXME XXX contained
|
||||||
syn match ktShebang "\v^#!.*$"
|
syn match ktShebang "\v^#!.*$"
|
||||||
|
|||||||
140
syntax/ls.vim
Normal file
140
syntax/ls.vim
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'livescript') == -1
|
||||||
|
|
||||||
|
" Language: LiveScript "
|
||||||
|
" Maintainer: George Zahariev
|
||||||
|
" URL: http://github.com/gkz/vim-ls
|
||||||
|
" License: WTFPL
|
||||||
|
|
||||||
|
if exists('b:current_syntax') && b:current_syntax == 'livescript'
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax = "ls"
|
||||||
|
|
||||||
|
" Highlight long strings.
|
||||||
|
syntax sync minlines=100
|
||||||
|
|
||||||
|
setlocal iskeyword=48-57,A-Z,$,a-z,_,-
|
||||||
|
|
||||||
|
syntax match lsIdentifier /[$A-Za-z_]\k*\(-[a-zA-Z]\+\)*/
|
||||||
|
highlight default link lsIdentifier Identifier
|
||||||
|
|
||||||
|
" These are 'matches' rather than 'keywords' because vim's highlighting priority
|
||||||
|
" for keywords (the highest) causes them to be wrongly highlighted when used as
|
||||||
|
" dot-properties.
|
||||||
|
syntax match lsStatement /\<\%(return\|break\|continue\|throw\)\>/
|
||||||
|
highlight default link lsStatement Statement
|
||||||
|
|
||||||
|
syntax match lsRepeat /\<\%(for\%( own\| ever\)\?\|while\|until\)\>/
|
||||||
|
highlight default link lsRepeat Repeat
|
||||||
|
|
||||||
|
syntax match lsConditional /\<\%(if\|else\|unless\|switch\|case\|when\|default\|match\)\>/
|
||||||
|
highlight default link lsConditional Conditional
|
||||||
|
|
||||||
|
syntax match lsException /\<\%(try\|catch\|finally\)\>/
|
||||||
|
highlight default link lsException Exception
|
||||||
|
|
||||||
|
syntax match lsKeyword /\<\%(new\|in\%(stanceof\)\?\|typeof\|delete\|and\|o[fr]\|not\|xor\|is\|isnt\|imp\%(ort\%( all\)\?\|lements\)\|extends\|loop\|from\|to\|til\|by\|do\|then\|function\|class\|let\|with\|export\|const\|var\|eval\|super\|fallthrough\|debugger\|where\|yield\)\>/
|
||||||
|
highlight default link lsKeyword Keyword
|
||||||
|
|
||||||
|
syntax match lsBoolean /\<\%(true\|false\|yes\|no\|on\|off\|null\|void\)\>/
|
||||||
|
highlight default link lsBoolean Boolean
|
||||||
|
|
||||||
|
" Matches context variables.
|
||||||
|
syntax match lsContext /\<\%(this\|arguments\|it\|that\|constructor\|prototype\|superclass\)\>/
|
||||||
|
highlight default link lsContext Type
|
||||||
|
|
||||||
|
" Keywords reserved by the language
|
||||||
|
syntax cluster lsReserved contains=lsStatement,lsRepeat,lsConditional,
|
||||||
|
\ lsException,lsOperator,lsKeyword,lsBoolean
|
||||||
|
|
||||||
|
" Matches ECMAScript 5 built-in globals.
|
||||||
|
syntax match lsGlobal /\<\%(Array\|Boolean\|Date\|Function\|JSON\|Math\|Number\|Object\|RegExp\|String\|\%(Syntax\|Type\|URI\)\?Error\|is\%(NaN\|Finite\)\|parse\%(Int\|Float\)\|\%(en\|de\)codeURI\%(Component\)\?\)\>/
|
||||||
|
highlight default link lsGlobal Structure
|
||||||
|
|
||||||
|
syntax region lsString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=@lsInterpString
|
||||||
|
syntax region lsString start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=@lsSimpleString
|
||||||
|
highlight default link lsString String
|
||||||
|
|
||||||
|
" Matches decimal/floating-point numbers like 10.42e-8.
|
||||||
|
syntax match lsFloat
|
||||||
|
\ /\%(\<-\?\|-\)\zs\d[0-9_]*\%(\.\d[0-9_]*\)\?\%(e[+-]\?\d[0-9_]*\)\?\%([a-zA-Z$][$a-zA-Z0-9_]*\)\?/
|
||||||
|
\ contains=lsNumberComment
|
||||||
|
highlight default link lsFloat Float
|
||||||
|
syntax match lsNumberComment /\d\+\zs\%(e[+-]\?\d\)\@![a-zA-Z$][$a-zA-Z0-9_]*/ contained
|
||||||
|
highlight default link lsNumberComment Comment
|
||||||
|
" Matches hex numbers like 0xfff, 0x000.
|
||||||
|
syntax match lsNumber /\%(\<-\?\|-\)\zs0x\x\+/
|
||||||
|
" Matches N radix numbers like 2@1010.
|
||||||
|
syntax match lsNumber
|
||||||
|
\ /\%(\<-\?\|-\)\zs\%(\d*\)\~[0-9A-Za-z][0-9A-Za-z_]*/
|
||||||
|
highlight default link lsNumber Number
|
||||||
|
|
||||||
|
" Displays an error for reserved words.
|
||||||
|
syntax match lsReservedError /\<\%(enum\|interface\|package\|private\|protected\|public\|static\)\>/
|
||||||
|
highlight default link lsReservedError Error
|
||||||
|
|
||||||
|
syntax keyword lsTodo TODO FIXME XXX contained
|
||||||
|
highlight default link lsTodo Todo
|
||||||
|
|
||||||
|
syntax match lsComment /#.*/ contains=@Spell,lsTodo
|
||||||
|
syntax region lsComment start=/\/\*/ end=/\*\// contains=@Spell,lsTodo
|
||||||
|
highlight default link lsComment Comment
|
||||||
|
|
||||||
|
syntax region lsInfixFunc start=/`/ end=/`/
|
||||||
|
highlight default link lsInfixFunc Identifier
|
||||||
|
|
||||||
|
syntax region lsInterpolation matchgroup=lsInterpDelim
|
||||||
|
\ start=/\#{/ end=/}/
|
||||||
|
\ contained contains=TOP
|
||||||
|
highlight default link lsInterpDelim Delimiter
|
||||||
|
|
||||||
|
" Matches escape sequences like \000, \x00, \u0000, \n.
|
||||||
|
syntax match lsEscape /\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\./ contained
|
||||||
|
highlight default link lsEscape SpecialChar
|
||||||
|
|
||||||
|
syntax match lsVarInterpolation /#[$A-Za-z_]\k*\(-[a-zA-Z]\+\)*/ contained
|
||||||
|
highlight default link lsVarInterpolation Identifier
|
||||||
|
|
||||||
|
" What is in a non-interpolated string
|
||||||
|
syntax cluster lsSimpleString contains=@Spell,lsEscape
|
||||||
|
" What is in an interpolated string
|
||||||
|
syntax cluster lsInterpString contains=@lsSimpleString,
|
||||||
|
\ lsInterpolation,lsVarInterpolation
|
||||||
|
|
||||||
|
syntax region lsRegex start=/\%(\%()\|\i\@<!\d\)\s*\|\i\)\@<!\/\*\@!/
|
||||||
|
\ skip=/\[[^]]\{-}\/[^]]\{-}\]/
|
||||||
|
\ end=/\/[gimy$]\{,4}/
|
||||||
|
\ oneline contains=@lsSimpleString
|
||||||
|
syntax region lsHeregex start=/\/\// end=/\/\/[gimy$?]\{,4}/ contains=@lsInterpString,lsComment,lsSpaceError fold
|
||||||
|
highlight default link lsHeregex lsRegex
|
||||||
|
highlight default link lsRegex String
|
||||||
|
|
||||||
|
syntax region lsHeredoc start=/"""/ end=/"""/ contains=@lsInterpString fold
|
||||||
|
syntax region lsHeredoc start=/'''/ end=/'''/ contains=@lsSimpleString fold
|
||||||
|
highlight default link lsHeredoc String
|
||||||
|
|
||||||
|
syntax match lsWord /\\\S[^ \t\r,;)}\]]*/
|
||||||
|
highlight default link lsWord String
|
||||||
|
|
||||||
|
syntax region lsWords start=/<\[/ end=/\]>/ contains=fold
|
||||||
|
highlight default link lsWords String
|
||||||
|
|
||||||
|
" Reserved words can be used as property names.
|
||||||
|
syntax match lsProp /[$A-Za-z_]\k*[ \t]*:[:=]\@!/
|
||||||
|
highlight default link lsProp Label
|
||||||
|
|
||||||
|
syntax match lsKey
|
||||||
|
\ /\%(\.\@<!\.\%(=\?\s*\|\.\)\|[]})@?]\|::\)\zs\k\+/
|
||||||
|
\ transparent
|
||||||
|
\ contains=ALLBUT,lsNumberComment,lsIdentifier,lsContext,lsGlobal,lsReservedError,@lsReserved
|
||||||
|
|
||||||
|
" Displays an error for trailing whitespace.
|
||||||
|
syntax match lsSpaceError /\s\+$/ display
|
||||||
|
highlight default link lsSpaceError Error
|
||||||
|
|
||||||
|
if !exists('b:current_syntax')
|
||||||
|
let b:current_syntax = 'livescript'
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
216
syntax/lua.vim
Normal file
216
syntax/lua.vim
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'lua') == -1
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: Lua
|
||||||
|
" URL: https://github.com/tbastos/vim-lua
|
||||||
|
|
||||||
|
if !exists("main_syntax")
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let main_syntax = 'lua'
|
||||||
|
endif
|
||||||
|
|
||||||
|
syntax sync fromstart
|
||||||
|
|
||||||
|
" Clusters
|
||||||
|
syntax cluster luaBase contains=luaComment,luaCommentLong,luaConstant,luaNumber,luaString,luaStringLong,luaBuiltIn
|
||||||
|
syntax cluster luaExpr contains=@luaBase,luaTable,luaParen,luaBracket,luaSpecialTable,luaSpecialValue,luaOperator,luaEllipsis,luaComma,luaFunc,luaFuncCall,luaError
|
||||||
|
syntax cluster luaStat contains=@luaExpr,luaIfThen,luaBlock,luaLoop,luaGoto,luaLabel,luaLocal,luaStatement,luaSemiCol
|
||||||
|
|
||||||
|
syntax match luaNoise /\%(\.\|,\|:\|\;\)/
|
||||||
|
|
||||||
|
" Symbols
|
||||||
|
syntax region luaTable transparent matchgroup=luaBraces start="{" end="}" contains=@luaExpr fold
|
||||||
|
syntax region luaParen transparent matchgroup=luaParens start='(' end=')' contains=@luaExpr
|
||||||
|
syntax region luaBracket transparent matchgroup=luaBrackets start="\[" end="\]" contains=@luaExpr
|
||||||
|
syntax match luaComma ","
|
||||||
|
syntax match luaSemiCol ";"
|
||||||
|
syntax match luaOperator "[#<>=~^&|*/%+-]\|\.\."
|
||||||
|
syntax match luaEllipsis "\.\.\."
|
||||||
|
|
||||||
|
" Catch errors caused by unbalanced brackets and keywords
|
||||||
|
syntax match luaError ")"
|
||||||
|
syntax match luaError "}"
|
||||||
|
syntax match luaError "\]"
|
||||||
|
syntax match luaError "\<\%(end\|else\|elseif\|then\|until\)\>"
|
||||||
|
|
||||||
|
" Shebang at the start
|
||||||
|
syntax match luaComment "\%^#!.*"
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syntax keyword luaCommentTodo contained TODO FIXME XXX TBD
|
||||||
|
syntax match luaComment "--.*$" contains=luaCommentTodo,luaDocTag,@Spell
|
||||||
|
syntax region luaCommentLong matchgroup=luaCommentLongTag start="--\[\z(=*\)\[" end="\]\z1\]" contains=luaCommentTodo,luaDocTag,@Spell fold
|
||||||
|
syntax match luaDocTag contained "\s@\k\+"
|
||||||
|
|
||||||
|
" Function calls
|
||||||
|
syntax match luaFuncCall /\k\+\%(\s*[{('"]\)\@=/
|
||||||
|
|
||||||
|
" Functions
|
||||||
|
syntax region luaFunc transparent matchgroup=luaFuncKeyword start="\<function\>" end="\<end\>" contains=@luaStat,luaFuncSig fold
|
||||||
|
syntax region luaFuncSig contained transparent start="\(\<function\>\)\@<=" end=")" contains=luaFuncId,luaFuncArgs keepend
|
||||||
|
syntax match luaFuncId contained "[^(]*(\@=" contains=luaFuncTable,luaFuncName
|
||||||
|
syntax match luaFuncTable contained /\k\+\%(\s*[.:]\)\@=/
|
||||||
|
syntax match luaFuncName contained "[^(.:]*(\@="
|
||||||
|
syntax region luaFuncArgs contained transparent matchgroup=luaFuncParens start=/(/ end=/)/ contains=@luaBase,luaFuncArgName,luaFuncArgComma,luaEllipsis
|
||||||
|
syntax match luaFuncArgName contained /\k\+/
|
||||||
|
syntax match luaFuncArgComma contained /,/
|
||||||
|
|
||||||
|
" if ... then
|
||||||
|
syntax region luaIfThen transparent matchgroup=luaCond start="\<if\>" end="\<then\>"me=e-4 contains=@luaExpr nextgroup=luaThenEnd skipwhite skipempty
|
||||||
|
|
||||||
|
" then ... end
|
||||||
|
syntax region luaThenEnd contained transparent matchgroup=luaCond start="\<then\>" end="\<end\>" contains=@luaStat,luaElseifThen,luaElse fold
|
||||||
|
|
||||||
|
" elseif ... then
|
||||||
|
syntax region luaElseifThen contained transparent matchgroup=luaCond start="\<elseif\>" end="\<then\>" contains=@luaExpr
|
||||||
|
|
||||||
|
" else
|
||||||
|
syntax keyword luaElse contained else
|
||||||
|
|
||||||
|
" do ... end
|
||||||
|
syntax region luaBlock transparent matchgroup=luaRepeat start="\<do\>" end="\<end\>" contains=@luaStat fold
|
||||||
|
|
||||||
|
" repeat ... until
|
||||||
|
syntax region luaLoop transparent matchgroup=luaRepeat start="\<repeat\>" end="\<until\>" contains=@luaStat nextgroup=@luaExpr fold
|
||||||
|
|
||||||
|
" while ... do
|
||||||
|
syntax region luaLoop transparent matchgroup=luaRepeat start="\<while\>" end="\<do\>"me=e-2 contains=@luaExpr nextgroup=luaBlock skipwhite skipempty fold
|
||||||
|
|
||||||
|
" for ... do and for ... in ... do
|
||||||
|
syntax region luaLoop transparent matchgroup=luaRepeat start="\<for\>" end="\<do\>"me=e-2 contains=@luaExpr,luaIn nextgroup=luaBlock skipwhite skipempty
|
||||||
|
syntax keyword luaIn contained in
|
||||||
|
|
||||||
|
" goto and labels
|
||||||
|
syntax keyword luaGoto goto nextgroup=luaGotoLabel skipwhite
|
||||||
|
syntax match luaGotoLabel "\k\+" contained
|
||||||
|
syntax match luaLabel "::\k\+::"
|
||||||
|
|
||||||
|
" Other Keywords
|
||||||
|
syntax keyword luaConstant nil true false
|
||||||
|
syntax keyword luaBuiltIn _ENV self
|
||||||
|
syntax keyword luaLocal local
|
||||||
|
syntax keyword luaOperator and or not
|
||||||
|
syntax keyword luaStatement break return
|
||||||
|
|
||||||
|
" Strings
|
||||||
|
syntax match luaStringSpecial contained #\\[\\abfnrtvz'"]\|\\x[[:xdigit:]]\{2}\|\\[[:digit:]]\{,3}#
|
||||||
|
syntax region luaStringLong matchgroup=luaStringLongTag start="\[\z(=*\)\[" end="\]\z1\]" contains=@Spell
|
||||||
|
syntax region luaString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=luaStringSpecial,@Spell
|
||||||
|
syntax region luaString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=luaStringSpecial,@Spell
|
||||||
|
|
||||||
|
" Decimal constant
|
||||||
|
syntax match luaNumber "\<\d\+\>"
|
||||||
|
" Hex constant
|
||||||
|
syntax match luaNumber "\<0[xX][[:xdigit:].]\+\%([pP][-+]\=\d\+\)\=\>"
|
||||||
|
" Floating point constant, with dot, optional exponent
|
||||||
|
syntax match luaFloat "\<\d\+\.\d*\%([eE][-+]\=\d\+\)\=\>"
|
||||||
|
" Floating point constant, starting with a dot, optional exponent
|
||||||
|
syntax match luaFloat "\.\d\+\%([eE][-+]\=\d\+\)\=\>"
|
||||||
|
" Floating point constant, without dot, with exponent
|
||||||
|
syntax match luaFloat "\<\d\+[eE][-+]\=\d\+\>"
|
||||||
|
|
||||||
|
" Special names from the Standard Library
|
||||||
|
syntax keyword luaSpecialTable
|
||||||
|
\ bit32
|
||||||
|
\ coroutine
|
||||||
|
\ debug
|
||||||
|
\ io
|
||||||
|
\ math
|
||||||
|
\ os
|
||||||
|
\ package
|
||||||
|
\ string
|
||||||
|
\ table
|
||||||
|
\ utf8
|
||||||
|
|
||||||
|
syntax keyword luaSpecialValue
|
||||||
|
\ _G
|
||||||
|
\ _VERSION
|
||||||
|
\ assert
|
||||||
|
\ collectgarbage
|
||||||
|
\ dofile
|
||||||
|
\ error
|
||||||
|
\ getfenv
|
||||||
|
\ getmetatable
|
||||||
|
\ ipairs
|
||||||
|
\ load
|
||||||
|
\ loadfile
|
||||||
|
\ loadstring
|
||||||
|
\ module
|
||||||
|
\ next
|
||||||
|
\ pairs
|
||||||
|
\ pcall
|
||||||
|
\ print
|
||||||
|
\ rawequal
|
||||||
|
\ rawget
|
||||||
|
\ rawlen
|
||||||
|
\ rawset
|
||||||
|
\ require
|
||||||
|
\ select
|
||||||
|
\ setfenv
|
||||||
|
\ setmetatable
|
||||||
|
\ tonumber
|
||||||
|
\ tostring
|
||||||
|
\ type
|
||||||
|
\ unpack
|
||||||
|
\ xpcall
|
||||||
|
|
||||||
|
" 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_lua_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_lua_syn_inits = 1
|
||||||
|
command -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
command -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
HiLink luaParens Noise
|
||||||
|
HiLink luaBraces Structure
|
||||||
|
HiLink luaBrackets Noise
|
||||||
|
HiLink luaBuiltIn Special
|
||||||
|
HiLink luaComment Comment
|
||||||
|
HiLink luaCommentLong luaComment
|
||||||
|
HiLink luaCommentTodo Todo
|
||||||
|
HiLink luaCond Conditional
|
||||||
|
HiLink luaConstant Boolean
|
||||||
|
HiLink luaDocTag Underlined
|
||||||
|
HiLink luaEllipsis StorageClass
|
||||||
|
HiLink luaElse Conditional
|
||||||
|
HiLink luaError Error
|
||||||
|
HiLink luaFloat Float
|
||||||
|
HiLink luaFuncTable Function
|
||||||
|
HiLink luaFuncArgName Noise
|
||||||
|
HiLink luaFuncCall PreProc
|
||||||
|
HiLink luaFuncId Function
|
||||||
|
HiLink luaFuncKeyword Type
|
||||||
|
HiLink luaFuncName Function
|
||||||
|
HiLink luaFuncParens Noise
|
||||||
|
HiLink luaGoto luaStatement
|
||||||
|
HiLink luaGotoLabel Noise
|
||||||
|
HiLink luaIn Repeat
|
||||||
|
HiLink luaLabel Label
|
||||||
|
HiLink luaLocal Type
|
||||||
|
HiLink luaNumber Number
|
||||||
|
HiLink luaOperator Operator
|
||||||
|
HiLink luaRepeat Repeat
|
||||||
|
HiLink luaSemiCol Delimiter
|
||||||
|
HiLink luaSpecialTable Special
|
||||||
|
HiLink luaSpecialValue PreProc
|
||||||
|
HiLink luaStatement Statement
|
||||||
|
HiLink luaString String
|
||||||
|
HiLink luaStringLong luaString
|
||||||
|
HiLink luaStringSpecial SpecialChar
|
||||||
|
|
||||||
|
delcommand HiLink
|
||||||
|
end
|
||||||
|
|
||||||
|
let b:current_syntax = "lua"
|
||||||
|
if main_syntax == 'lua'
|
||||||
|
unlet main_syntax
|
||||||
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
96
syntax/mako.vim
Normal file
96
syntax/mako.vim
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mako') == -1
|
||||||
|
|
||||||
|
" Vim syntax file
|
||||||
|
" Language: Mako
|
||||||
|
" Maintainer: Armin Ronacher <armin.ronacher@active-4.com>
|
||||||
|
" URL: http://lucumr.pocoo.org/
|
||||||
|
" Last Change: 2013-05-01
|
||||||
|
" Version: 0.6.1+
|
||||||
|
"
|
||||||
|
" Thanks to Brine Rue <brian@lolapps.com> who noticed a bug in the
|
||||||
|
" delimiter handling.
|
||||||
|
"
|
||||||
|
" Known Limitations
|
||||||
|
" the <%text> block does not have correct attributes
|
||||||
|
|
||||||
|
" 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
|
||||||
|
|
||||||
|
if !exists("main_syntax")
|
||||||
|
let main_syntax = "html"
|
||||||
|
endif
|
||||||
|
|
||||||
|
"Source the html syntax file
|
||||||
|
ru! syntax/html.vim
|
||||||
|
unlet b:current_syntax
|
||||||
|
|
||||||
|
" tell html.vim what syntax groups should take precedence (see :help html.vim)
|
||||||
|
syn cluster htmlPreproc add=makoLine,makoVariable,makoTag,makoDocComment,makoDefEnd,makoText,makoDelim,makoEnd,makoComment,makoEscape
|
||||||
|
|
||||||
|
"Put the python syntax file in @pythonTop
|
||||||
|
syn include @pythonTop syntax/python.vim
|
||||||
|
|
||||||
|
" End keywords
|
||||||
|
syn keyword makoEnd contained endfor endwhile endif endtry enddef
|
||||||
|
|
||||||
|
" Block rules
|
||||||
|
syn region makoLine matchgroup=makoDelim start=#^\s*%# end=#$# keepend contains=@pythonTop,makoEnd
|
||||||
|
syn region makoBlock matchgroup=makoDelim start=#<%!\?# end=#%># keepend contains=@pythonTop,makoEnd
|
||||||
|
|
||||||
|
" Variables
|
||||||
|
syn region makoNested start="{" end="}" transparent display contained contains=makoNested,@pythonTop
|
||||||
|
syn region makoVariable matchgroup=makoDelim start=#\${# end=#}# contains=makoNested,@pythonTop
|
||||||
|
|
||||||
|
" Comments
|
||||||
|
syn region makoComment start="^\s*##" end="$"
|
||||||
|
syn region makoDocComment matchgroup=makoDelim start="<%doc>" end="</%doc>" keepend
|
||||||
|
|
||||||
|
" Literal Blocks
|
||||||
|
syn region makoText matchgroup=makoDelim start="<%text[^>]*>" end="</%text>"
|
||||||
|
|
||||||
|
" Attribute Sublexing
|
||||||
|
syn match makoAttributeKey containedin=makoTag contained "[a-zA-Z_][a-zA-Z0-9_]*="
|
||||||
|
syn region makoAttributeValue containedin=makoTag contained start=/"/ skip=/\\"/ end=/"/
|
||||||
|
syn region makoAttributeValue containedin=MakoTag contained start=/'/ skip=/\\'/ end=/'/
|
||||||
|
|
||||||
|
" Tags
|
||||||
|
syn region makoTag matchgroup=makoDelim start="<%\(def\|call\|page\|include\|namespace\|inherit\|block\|[a-zA-Z_][a-zA-Z0-9_]*:[a-zA-Z_][a-zA-Z0-9_]*\)\>" end="/\?>"
|
||||||
|
syn match makoDelim "</%\(def\|call\|namespace\|block\|[a-zA-Z_][a-zA-Z0-9_]*:[a-zA-Z_][a-zA-Z0-9_]*\)>"
|
||||||
|
|
||||||
|
syn region makoJavaScript matchgroup=makoDelim start=+<%block .*js.*>+ keepend end=+</%block>+ contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc,makoLine,makoBlock,makoVariable
|
||||||
|
syn region makoCssStyle matchgroup=makoDelim start=+<%block .*css.*>+ keepend end=+</%block>+ contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc,makoLine,makoBlock,makoVariable
|
||||||
|
|
||||||
|
" Newline Escapes
|
||||||
|
syn match makoEscape /\\$/
|
||||||
|
|
||||||
|
" Default highlighting links
|
||||||
|
if version >= 508 || !exists("did_mako_syn_inits")
|
||||||
|
if version < 508
|
||||||
|
let did_mako_syn_inits = 1
|
||||||
|
com -nargs=+ HiLink hi link <args>
|
||||||
|
else
|
||||||
|
com -nargs=+ HiLink hi def link <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
HiLink makoDocComment makoComment
|
||||||
|
HiLink makoDefEnd makoDelim
|
||||||
|
|
||||||
|
HiLink makoAttributeKey Type
|
||||||
|
HiLink makoAttributeValue String
|
||||||
|
HiLink makoText Normal
|
||||||
|
HiLink makoDelim Preproc
|
||||||
|
HiLink makoEnd Keyword
|
||||||
|
HiLink makoComment Comment
|
||||||
|
HiLink makoEscape Special
|
||||||
|
|
||||||
|
delc HiLink
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:current_syntax = "html"
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -1,161 +1,176 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
||||||
|
|
||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: Markdown
|
" Language: Markdown
|
||||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
" Maintainer: Ben Williams <benw@plasticboy.com>
|
||||||
" Filenames: *.markdown
|
" URL: http://plasticboy.com/markdown-vim-mode/
|
||||||
" Last Change: 2013 May 30
|
" Remark: Uses HTML syntax file
|
||||||
|
" TODO: Handle stuff contained within stuff (e.g. headings within blockquotes)
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
|
||||||
|
" Read the HTML syntax to start with
|
||||||
|
if version < 600
|
||||||
|
so <sfile>:p:h/html.vim
|
||||||
|
else
|
||||||
|
runtime! syntax/html.vim
|
||||||
|
|
||||||
|
if exists('b:current_syntax')
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
if version < 600
|
||||||
|
syntax clear
|
||||||
|
elseif exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !exists('main_syntax')
|
" don't use standard HiLink, it will not work with included syntax files
|
||||||
let main_syntax = 'markdown'
|
if version < 508
|
||||||
|
command! -nargs=+ HtmlHiLink hi link <args>
|
||||||
|
else
|
||||||
|
command! -nargs=+ HtmlHiLink hi def link <args>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
runtime! syntax/html.vim
|
syn spell toplevel
|
||||||
unlet! b:current_syntax
|
|
||||||
|
|
||||||
if !exists('g:markdown_fenced_languages')
|
|
||||||
let g:markdown_fenced_languages = []
|
|
||||||
endif
|
|
||||||
let s:done_include = {}
|
|
||||||
for s:type in map(copy(g:markdown_fenced_languages),'matchstr(v:val,"[^=]*$")')
|
|
||||||
if has_key(s:done_include, matchstr(s:type,'[^.]*'))
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
if s:type =~ '\.'
|
|
||||||
let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*')
|
|
||||||
endif
|
|
||||||
exe 'syn include @markdownHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim'
|
|
||||||
unlet! b:current_syntax
|
|
||||||
let s:done_include[matchstr(s:type,'[^.]*')] = 1
|
|
||||||
endfor
|
|
||||||
unlet! s:type
|
|
||||||
unlet! s:done_include
|
|
||||||
|
|
||||||
syn sync minlines=10
|
|
||||||
syn case ignore
|
syn case ignore
|
||||||
|
syn sync linebreaks=1
|
||||||
|
|
||||||
syn match markdownValid '[<>]\c[a-z/$!]\@!'
|
let s:conceal = ''
|
||||||
syn match markdownValid '&\%(#\=\w*;\)\@!'
|
let s:concealends = ''
|
||||||
|
if has('conceal') && get(g:, 'vim_markdown_conceal', 1)
|
||||||
syn match markdownLineStart "^[<@]\@!" nextgroup=@markdownBlock,htmlSpecialChar
|
let s:conceal = ' conceal'
|
||||||
|
let s:concealends = ' concealends'
|
||||||
syn cluster markdownBlock contains=markdownH1,markdownH2,markdownH3,markdownH4,markdownH5,markdownH6,markdownBlockquote,markdownListMarker,markdownOrderedListMarker,markdownCodeBlock,markdownRule
|
|
||||||
syn cluster markdownInline contains=markdownLineBreak,markdownLinkText,markdownItalic,markdownBold,markdownCode,markdownEscape,@htmlTop,markdownError
|
|
||||||
|
|
||||||
syn match markdownH1 "^.\+\n=\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink
|
|
||||||
syn match markdownH2 "^.\+\n-\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink
|
|
||||||
|
|
||||||
syn match markdownHeadingRule "^[=-]\+$" contained
|
|
||||||
|
|
||||||
syn region markdownH1 matchgroup=markdownHeadingDelimiter start="##\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
|
|
||||||
syn region markdownH2 matchgroup=markdownHeadingDelimiter start="###\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
|
|
||||||
syn region markdownH3 matchgroup=markdownHeadingDelimiter start="####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
|
|
||||||
syn region markdownH4 matchgroup=markdownHeadingDelimiter start="#####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
|
|
||||||
syn region markdownH5 matchgroup=markdownHeadingDelimiter start="######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
|
|
||||||
syn region markdownH6 matchgroup=markdownHeadingDelimiter start="#######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
|
|
||||||
|
|
||||||
syn match markdownBlockquote ">\%(\s\|$\)" contained nextgroup=@markdownBlock
|
|
||||||
|
|
||||||
syn region markdownCodeBlock start=" \|\t" end="$" contained
|
|
||||||
|
|
||||||
" TODO: real nesting
|
|
||||||
syn match markdownListMarker "\%(\t\| \{0,4\}\)[-*+]\%(\s\+\S\)\@=" contained
|
|
||||||
syn match markdownOrderedListMarker "\%(\t\| \{0,4}\)\<\d\+\.\%(\s\+\S\)\@=" contained
|
|
||||||
|
|
||||||
syn match markdownRule "\* *\* *\*[ *]*$" contained
|
|
||||||
syn match markdownRule "- *- *-[ -]*$" contained
|
|
||||||
|
|
||||||
syn match markdownLineBreak " \{2,\}$"
|
|
||||||
|
|
||||||
syn region markdownIdDeclaration matchgroup=markdownLinkDelimiter start="^ \{0,3\}!\=\[" end="\]:" oneline keepend nextgroup=markdownUrl skipwhite
|
|
||||||
syn match markdownUrl "\S\+" nextgroup=markdownUrlTitle skipwhite contained
|
|
||||||
syn region markdownUrl matchgroup=markdownUrlDelimiter start="<" end=">" oneline keepend nextgroup=markdownUrlTitle skipwhite contained
|
|
||||||
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+"+ keepend contained
|
|
||||||
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained
|
|
||||||
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained
|
|
||||||
|
|
||||||
syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart
|
|
||||||
syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained
|
|
||||||
syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained
|
|
||||||
syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline
|
|
||||||
|
|
||||||
let s:concealends = has('conceal') ? ' concealends' : ''
|
|
||||||
exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart' . s:concealends
|
|
||||||
exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart' . s:concealends
|
|
||||||
exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends
|
|
||||||
exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends
|
|
||||||
exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=markdownLineStart' . s:concealends
|
|
||||||
exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend contains=markdownLineStart' . s:concealends
|
|
||||||
|
|
||||||
syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart
|
|
||||||
syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart
|
|
||||||
syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*```*.*$" end="^\s*```*\ze\s*$" keepend
|
|
||||||
|
|
||||||
syn match markdownFootnote "\[^[^\]]\+\]"
|
|
||||||
syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:"
|
|
||||||
|
|
||||||
if main_syntax ==# 'markdown'
|
|
||||||
let s:done_include = {}
|
|
||||||
for s:type in g:markdown_fenced_languages
|
|
||||||
if has_key(s:done_include, matchstr(s:type,'[^.]*'))
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*```*\s*'.matchstr(s:type,'[^=]*').'\>.*$" end="^\s*```*\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g')
|
|
||||||
let s:done_include[matchstr(s:type,'[^.]*')] = 1
|
|
||||||
endfor
|
|
||||||
unlet! s:type
|
|
||||||
unlet! s:done_include
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]"
|
" additions to HTML groups
|
||||||
syn match markdownError "\w\@<=_\w\@="
|
if get(g:, 'vim_markdown_emphasis_multiline', 1)
|
||||||
|
let s:oneline = ''
|
||||||
|
else
|
||||||
|
let s:oneline = ' oneline'
|
||||||
|
endif
|
||||||
|
execute 'syn region htmlItalic start="\%(^\|\s\)\zs\*\ze[^\\\*\t ]\%(\%([^*]\|\\\*\|\n\)*[^\\\*\t ]\)\?\*\_W" end="[^\\\*\t ]\zs\*\ze\_W" keepend' . s:oneline
|
||||||
|
execute 'syn region htmlItalic start="\%(^\|\s\)\zs_\ze[^\\_\t ]" end="[^\\_\t ]\zs_\ze\_W" keepend' . s:oneline
|
||||||
|
execute 'syn region htmlBold start="\%(^\|\s\)\*\*\ze\S" end="\S\zs\*\*" keepend' . s:oneline
|
||||||
|
execute 'syn region htmlBold start="\%(^\|\s\)\zs__\ze\S" end="\S\zs__" keepend' . s:oneline
|
||||||
|
execute 'syn region htmlBoldItalic start="\%(^\|\s\)\zs\*\*\*\ze\S" end="\S\zs\*\*\*" keepend' . s:oneline
|
||||||
|
execute 'syn region htmlBoldItalic start="\%(^\|\s\)\zs___\ze\S" end="\S\zs___" keepend' . s:oneline
|
||||||
|
|
||||||
hi def link markdownH1 htmlH1
|
" [link](URL) | [link][id] | [link][] | 
|
||||||
hi def link markdownH2 htmlH2
|
syn region mkdFootnotes matchgroup=mkdDelimiter start="\[^" end="\]"
|
||||||
hi def link markdownH3 htmlH3
|
execute 'syn region mkdID matchgroup=mkdDelimiter start="\[" end="\]" contained oneline' . s:conceal
|
||||||
hi def link markdownH4 htmlH4
|
execute 'syn region mkdURL matchgroup=mkdDelimiter start="(" end=")" contained oneline' . s:conceal
|
||||||
hi def link markdownH5 htmlH5
|
execute 'syn region mkdLink matchgroup=mkdDelimiter start="\\\@<!!\?\[" end="\n\{-,1}[^]]\{-}\zs\]\ze[[(]" contains=@mkdNonListItem,@Spell nextgroup=mkdURL,mkdID skipwhite oneline' . s:concealends
|
||||||
hi def link markdownH6 htmlH6
|
|
||||||
hi def link markdownHeadingRule markdownRule
|
|
||||||
hi def link markdownHeadingDelimiter Delimiter
|
|
||||||
hi def link markdownOrderedListMarker markdownListMarker
|
|
||||||
hi def link markdownListMarker htmlTagName
|
|
||||||
hi def link markdownBlockquote Comment
|
|
||||||
hi def link markdownRule PreProc
|
|
||||||
|
|
||||||
hi def link markdownFootnote Typedef
|
" Autolink without angle brackets.
|
||||||
hi def link markdownFootnoteDefinition Typedef
|
" 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*/
|
||||||
|
|
||||||
hi def link markdownLinkText htmlLink
|
" Autolink with parenthesis.
|
||||||
hi def link markdownIdDeclaration Typedef
|
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=")"
|
||||||
hi def link markdownId Type
|
|
||||||
hi def link markdownAutomaticLink markdownUrl
|
|
||||||
hi def link markdownUrl Float
|
|
||||||
hi def link markdownUrlTitle String
|
|
||||||
hi def link markdownIdDelimiter markdownLinkDelimiter
|
|
||||||
hi def link markdownUrlDelimiter htmlTag
|
|
||||||
hi def link markdownUrlTitleDelimiter Delimiter
|
|
||||||
|
|
||||||
hi def link markdownItalic htmlItalic
|
" Autolink with angle brackets.
|
||||||
hi def link markdownItalicDelimiter markdownItalic
|
syn region mkdInlineURL matchgroup=mkdDelimiter start="\\\@<!<\ze[a-z][a-z0-9,.-]\{1,22}:\/\/[^> ]*>" end=">"
|
||||||
hi def link markdownBold htmlBold
|
|
||||||
hi def link markdownBoldDelimiter markdownBold
|
|
||||||
hi def link markdownBoldItalic htmlBoldItalic
|
|
||||||
hi def link markdownBoldItalicDelimiter markdownBoldItalic
|
|
||||||
hi def link markdownCodeDelimiter Delimiter
|
|
||||||
|
|
||||||
hi def link markdownEscape Special
|
" Link definitions: [id]: URL (Optional Title)
|
||||||
hi def link markdownError Error
|
syn region mkdLinkDef matchgroup=mkdDelimiter start="^ \{,3}\zs\[" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite
|
||||||
|
syn region mkdLinkDefTarget start="<\?\zs\S" excludenl end="\ze[>[:space:]\n]" contained nextgroup=mkdLinkTitle,mkdLinkDef skipwhite skipnl oneline
|
||||||
|
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+"+ end=+"+ contained
|
||||||
|
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+ end=+'+ contained
|
||||||
|
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+ end=+)+ contained
|
||||||
|
|
||||||
let b:current_syntax = "markdown"
|
"HTML headings
|
||||||
if main_syntax ==# 'markdown'
|
syn region htmlH1 start="^\s*#" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||||
unlet main_syntax
|
syn region htmlH2 start="^\s*##" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||||
|
syn region htmlH3 start="^\s*###" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||||
|
syn region htmlH4 start="^\s*####" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||||
|
syn region htmlH5 start="^\s*#####" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||||
|
syn region htmlH6 start="^\s*######" end="$" contains=mkdLink,mkdInlineURL,@Spell
|
||||||
|
syn match htmlH1 /^.\+\n=\+$/ contains=mkdLink,mkdInlineURL,@Spell
|
||||||
|
syn match htmlH2 /^.\+\n-\+$/ contains=mkdLink,mkdInlineURL,@Spell
|
||||||
|
|
||||||
|
"define Markdown groups
|
||||||
|
syn match mkdLineBreak / \+$/
|
||||||
|
syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell
|
||||||
|
syn region mkdCode start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/\(\([^\\]\|^\)\\\)\@<!`/
|
||||||
|
syn region mkdCode start=/\s*``[^`]*/ end=/[^`]*``\s*/
|
||||||
|
syn region mkdCode start=/^\s*\z(`\{3,}\)[^`]*$/ end=/^\s*\z1`*\s*$/
|
||||||
|
syn region mkdCode start=/\s*\~\~[^\~]*/ end=/[^\~]*\~\~\s*/
|
||||||
|
syn region mkdCode start=/^\s*\z(\~\{3,}\)\s*[0-9A-Za-z_+-]*\s*$/ end=/^\s*\z1\~*\s*$/
|
||||||
|
syn region mkdCode start="<pre[^>]*\\\@<!>" end="</pre>"
|
||||||
|
syn region mkdCode start="<code[^>]*\\\@<!>" end="</code>"
|
||||||
|
syn region mkdFootnote start="\[^" end="\]"
|
||||||
|
syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/
|
||||||
|
syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
|
||||||
|
syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ contained
|
||||||
|
syn match mkdListItem /^\s*\%([-*+]\|\d\+\.\)\s\+/ contained
|
||||||
|
syn region mkdListItemLine start="^\s*\%([-*+]\|\d\+\.\)\s\+" end="$" oneline contains=@mkdNonListItem,mkdListItem,@Spell
|
||||||
|
syn region mkdNonListItemBlock start="\(\%^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@!\|\n\(\_^\_$\|\s\{4,}[^ ]\|\t+[^\t]\)\@!\)" end="^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@=" contains=@mkdNonListItem,@Spell
|
||||||
|
syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*$/
|
||||||
|
syn match mkdRule /^\s*-\s\{0,1}-\s\{0,1}-$/
|
||||||
|
syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_$/
|
||||||
|
syn match mkdRule /^\s*-\{3,}$/
|
||||||
|
syn match mkdRule /^\s*\*\{3,5}$/
|
||||||
|
|
||||||
|
" YAML frontmatter
|
||||||
|
if get(g:, 'vim_markdown_frontmatter', 0)
|
||||||
|
syn include @yamlTop syntax/yaml.vim
|
||||||
|
syn region Comment matchgroup=mkdDelimiter start="\%^---$" end="^---$" contains=@yamlTop keepend
|
||||||
|
unlet! b:current_syntax
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" vim:set sw=2:
|
if get(g:, 'vim_markdown_toml_frontmatter', 0)
|
||||||
|
try
|
||||||
|
syn include @tomlTop syntax/toml.vim
|
||||||
|
syn region Comment matchgroup=mkdDelimiter start="\%^+++$" end="^+++$" transparent contains=@tomlTop keepend
|
||||||
|
unlet! b:current_syntax
|
||||||
|
catch /E484/
|
||||||
|
syn region Comment matchgroup=mkdDelimiter start="\%^+++$" end="^+++$"
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get(g:, 'vim_markdown_json_frontmatter', 0)
|
||||||
|
try
|
||||||
|
syn include @jsonTop syntax/json.vim
|
||||||
|
syn region Comment matchgroup=mkdDelimiter start="\%^{$" end="^}$" contains=@jsonTop keepend
|
||||||
|
unlet! b:current_syntax
|
||||||
|
catch /E484/
|
||||||
|
syn region Comment matchgroup=mkdDelimiter start="\%^{$" end="^}$"
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
|
||||||
|
if get(g:, 'vim_markdown_math', 0)
|
||||||
|
syn include @tex syntax/tex.vim
|
||||||
|
syn region mkdMath start="\\\@<!\$" end="\$" contains=@tex keepend
|
||||||
|
syn region mkdMath start="\\\@<!\$\$" end="\$\$" contains=@tex keepend
|
||||||
|
endif
|
||||||
|
|
||||||
|
syn cluster mkdNonListItem contains=@htmlTop,htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdInlineURL,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,mkdMath
|
||||||
|
|
||||||
|
"highlighting for Markdown groups
|
||||||
|
HtmlHiLink mkdString String
|
||||||
|
HtmlHiLink mkdCode String
|
||||||
|
HtmlHiLink mkdCodeStart String
|
||||||
|
HtmlHiLink mkdCodeEnd String
|
||||||
|
HtmlHiLink mkdFootnote Comment
|
||||||
|
HtmlHiLink mkdBlockquote Comment
|
||||||
|
HtmlHiLink mkdListItem Identifier
|
||||||
|
HtmlHiLink mkdRule Identifier
|
||||||
|
HtmlHiLink mkdLineBreak Visual
|
||||||
|
HtmlHiLink mkdFootnotes htmlLink
|
||||||
|
HtmlHiLink mkdLink htmlLink
|
||||||
|
HtmlHiLink mkdURL htmlString
|
||||||
|
HtmlHiLink mkdInlineURL htmlLink
|
||||||
|
HtmlHiLink mkdID Identifier
|
||||||
|
HtmlHiLink mkdLinkDef mkdID
|
||||||
|
HtmlHiLink mkdLinkDefTarget mkdURL
|
||||||
|
HtmlHiLink mkdLinkTitle htmlString
|
||||||
|
HtmlHiLink mkdDelimiter Delimiter
|
||||||
|
|
||||||
|
let b:current_syntax = "mkd"
|
||||||
|
|
||||||
|
delcommand HtmlHiLink
|
||||||
|
" vim: ts=8
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
141
syntax/nginx.vim
141
syntax/nginx.vim
@@ -12,28 +12,32 @@ setlocal iskeyword+=/
|
|||||||
setlocal iskeyword+=:
|
setlocal iskeyword+=:
|
||||||
|
|
||||||
syn match ngxVariable '\$\(\w\+\|{\w\+}\)'
|
syn match ngxVariable '\$\(\w\+\|{\w\+}\)'
|
||||||
syn match ngxVariableBlock '\$\(\w\+\|{\w\+}\)' contained
|
|
||||||
syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained
|
syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained
|
||||||
syn region ngxBlock start=+^+ end=+{+ skip=+\${+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline
|
|
||||||
syn region ngxString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString
|
|
||||||
syn match ngxComment ' *#.*$'
|
syn match ngxComment ' *#.*$'
|
||||||
|
syn match ngxRewriteURI /\S\+/ contained contains=ngxVariableString nextgroup=ngxURI skipwhite
|
||||||
|
syn match ngxURI /\S\+/ contained contains=ngxVariableString skipwhite
|
||||||
|
syn match ngxLocationPath /[^ {]\+/ contained
|
||||||
|
syn region ngxString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString
|
||||||
|
|
||||||
syn keyword ngxBoolean on
|
syn keyword ngxBoolean on
|
||||||
syn keyword ngxBoolean off
|
syn keyword ngxBoolean off
|
||||||
|
|
||||||
syn keyword ngxDirectiveBlock http contained
|
|
||||||
syn keyword ngxDirectiveBlock mail contained
|
syn keyword ngxDirectiveBlock http
|
||||||
syn keyword ngxDirectiveBlock events contained
|
syn keyword ngxDirectiveBlock mail
|
||||||
syn keyword ngxDirectiveBlock server contained
|
syn keyword ngxDirectiveBlock events
|
||||||
syn keyword ngxDirectiveBlock types contained
|
syn keyword ngxDirectiveBlock server
|
||||||
syn keyword ngxDirectiveBlock location contained
|
syn keyword ngxDirectiveBlock types
|
||||||
syn keyword ngxDirectiveBlock upstream contained
|
syn match ngxLocationOperator /\(=\|\~\*\|\^\~\|\~\)/ contained nextgroup=ngxLocationPath,ngxString skipwhite
|
||||||
syn keyword ngxDirectiveBlock charset_map contained
|
syn match ngxLocationNamedLoc /@\w\+/
|
||||||
syn keyword ngxDirectiveBlock limit_except contained
|
syn keyword ngxDirectiveBlock location nextgroup=ngxLocationNamedLoc,ngxLocationOperator,ngxLocationPath,ngxString skipwhite
|
||||||
syn keyword ngxDirectiveBlock if contained
|
syn keyword ngxDirectiveBlock upstream
|
||||||
syn keyword ngxDirectiveBlock geo contained
|
syn keyword ngxDirectiveBlock charset_map
|
||||||
syn keyword ngxDirectiveBlock map contained
|
syn keyword ngxDirectiveBlock limit_except
|
||||||
syn keyword ngxDirectiveBlock split_clients contained
|
syn keyword ngxDirectiveBlock if
|
||||||
|
syn keyword ngxDirectiveBlock geo
|
||||||
|
syn keyword ngxDirectiveBlock map
|
||||||
|
syn keyword ngxDirectiveBlock split_clients
|
||||||
|
|
||||||
syn keyword ngxDirectiveImportant include
|
syn keyword ngxDirectiveImportant include
|
||||||
syn keyword ngxDirectiveImportant root
|
syn keyword ngxDirectiveImportant root
|
||||||
@@ -50,16 +54,17 @@ syn keyword ngxDirectiveImportant try_files
|
|||||||
|
|
||||||
syn keyword ngxDirectiveControl break
|
syn keyword ngxDirectiveControl break
|
||||||
syn keyword ngxDirectiveControl return
|
syn keyword ngxDirectiveControl return
|
||||||
syn keyword ngxDirectiveControl rewrite
|
syn keyword ngxDirectiveControl rewrite nextgroup=ngxRewriteURI skipwhite
|
||||||
syn keyword ngxDirectiveControl set
|
syn keyword ngxDirectiveControl set
|
||||||
|
|
||||||
|
syn keyword ngxRewriteFlag last break redirect permanent
|
||||||
|
|
||||||
syn keyword ngxDirectiveError error_page
|
syn keyword ngxDirectiveError error_page
|
||||||
syn keyword ngxDirectiveError post_action
|
syn keyword ngxDirectiveError post_action
|
||||||
|
|
||||||
syn keyword ngxDirectiveDeprecated connections
|
syn keyword ngxDirectiveDeprecated connections
|
||||||
syn keyword ngxDirectiveDeprecated imap
|
syn keyword ngxDirectiveDeprecated imap
|
||||||
syn keyword ngxDirectiveDeprecated limit_zone
|
syn keyword ngxDirectiveDeprecated limit_zone
|
||||||
syn keyword ngxDirectiveDeprecated mysql_test
|
|
||||||
syn keyword ngxDirectiveDeprecated open_file_cache_retest
|
syn keyword ngxDirectiveDeprecated open_file_cache_retest
|
||||||
syn keyword ngxDirectiveDeprecated optimize_server_names
|
syn keyword ngxDirectiveDeprecated optimize_server_names
|
||||||
syn keyword ngxDirectiveDeprecated satisfy_any
|
syn keyword ngxDirectiveDeprecated satisfy_any
|
||||||
@@ -131,10 +136,12 @@ syn keyword ngxDirective fastcgi_cache
|
|||||||
syn keyword ngxDirective fastcgi_cache_bypass
|
syn keyword ngxDirective fastcgi_cache_bypass
|
||||||
syn keyword ngxDirective fastcgi_cache_key
|
syn keyword ngxDirective fastcgi_cache_key
|
||||||
syn keyword ngxDirective fastcgi_cache_lock
|
syn keyword ngxDirective fastcgi_cache_lock
|
||||||
|
syn keyword ngxDirective fastcgi_cache_lock_age
|
||||||
syn keyword ngxDirective fastcgi_cache_lock_timeout
|
syn keyword ngxDirective fastcgi_cache_lock_timeout
|
||||||
syn keyword ngxDirective fastcgi_cache_methods
|
syn keyword ngxDirective fastcgi_cache_methods
|
||||||
syn keyword ngxDirective fastcgi_cache_min_uses
|
syn keyword ngxDirective fastcgi_cache_min_uses
|
||||||
syn keyword ngxDirective fastcgi_cache_path
|
syn keyword ngxDirective fastcgi_cache_path
|
||||||
|
syn keyword ngxDirective fastcgi_cache_purge
|
||||||
syn keyword ngxDirective fastcgi_cache_revalidate
|
syn keyword ngxDirective fastcgi_cache_revalidate
|
||||||
syn keyword ngxDirective fastcgi_cache_use_stale
|
syn keyword ngxDirective fastcgi_cache_use_stale
|
||||||
syn keyword ngxDirective fastcgi_cache_valid
|
syn keyword ngxDirective fastcgi_cache_valid
|
||||||
@@ -147,6 +154,7 @@ syn keyword ngxDirective fastcgi_ignore_headers
|
|||||||
syn keyword ngxDirective fastcgi_index
|
syn keyword ngxDirective fastcgi_index
|
||||||
syn keyword ngxDirective fastcgi_intercept_errors
|
syn keyword ngxDirective fastcgi_intercept_errors
|
||||||
syn keyword ngxDirective fastcgi_keep_conn
|
syn keyword ngxDirective fastcgi_keep_conn
|
||||||
|
syn keyword ngxDirective fastcgi_limit_rate
|
||||||
syn keyword ngxDirective fastcgi_max_temp_file_size
|
syn keyword ngxDirective fastcgi_max_temp_file_size
|
||||||
syn keyword ngxDirective fastcgi_next_upstream
|
syn keyword ngxDirective fastcgi_next_upstream
|
||||||
syn keyword ngxDirective fastcgi_next_upstream_timeout
|
syn keyword ngxDirective fastcgi_next_upstream_timeout
|
||||||
@@ -157,6 +165,7 @@ syn keyword ngxDirective fastcgi_pass_header
|
|||||||
syn keyword ngxDirective fastcgi_pass_request_body
|
syn keyword ngxDirective fastcgi_pass_request_body
|
||||||
syn keyword ngxDirective fastcgi_pass_request_headers
|
syn keyword ngxDirective fastcgi_pass_request_headers
|
||||||
syn keyword ngxDirective fastcgi_read_timeout
|
syn keyword ngxDirective fastcgi_read_timeout
|
||||||
|
syn keyword ngxDirective fastcgi_request_buffering
|
||||||
syn keyword ngxDirective fastcgi_send_lowat
|
syn keyword ngxDirective fastcgi_send_lowat
|
||||||
syn keyword ngxDirective fastcgi_send_timeout
|
syn keyword ngxDirective fastcgi_send_timeout
|
||||||
syn keyword ngxDirective fastcgi_split_path_info
|
syn keyword ngxDirective fastcgi_split_path_info
|
||||||
@@ -187,6 +196,7 @@ syn keyword ngxDirective gzip_types
|
|||||||
syn keyword ngxDirective gzip_vary
|
syn keyword ngxDirective gzip_vary
|
||||||
syn keyword ngxDirective gzip_window
|
syn keyword ngxDirective gzip_window
|
||||||
syn keyword ngxDirective hash
|
syn keyword ngxDirective hash
|
||||||
|
syn keyword ngxDirective http2 " Not a real directive
|
||||||
syn keyword ngxDirective if_modified_since
|
syn keyword ngxDirective if_modified_since
|
||||||
syn keyword ngxDirective ignore_invalid_headers
|
syn keyword ngxDirective ignore_invalid_headers
|
||||||
syn keyword ngxDirective image_filter
|
syn keyword ngxDirective image_filter
|
||||||
@@ -201,6 +211,8 @@ syn keyword ngxDirective imap_client_buffer
|
|||||||
syn keyword ngxDirective index
|
syn keyword ngxDirective index
|
||||||
syn keyword ngxDirective iocp_threads
|
syn keyword ngxDirective iocp_threads
|
||||||
syn keyword ngxDirective ip_hash
|
syn keyword ngxDirective ip_hash
|
||||||
|
syn keyword ngxDirective js_run
|
||||||
|
syn keyword ngxDirective js_set
|
||||||
syn keyword ngxDirective keepalive
|
syn keyword ngxDirective keepalive
|
||||||
syn keyword ngxDirective keepalive_disable
|
syn keyword ngxDirective keepalive_disable
|
||||||
syn keyword ngxDirective keepalive_requests
|
syn keyword ngxDirective keepalive_requests
|
||||||
@@ -246,9 +258,12 @@ syn keyword ngxDirective modern_browser_value
|
|||||||
syn keyword ngxDirective mp4
|
syn keyword ngxDirective mp4
|
||||||
syn keyword ngxDirective mp4_buffer_size
|
syn keyword ngxDirective mp4_buffer_size
|
||||||
syn keyword ngxDirective mp4_max_buffer_size
|
syn keyword ngxDirective mp4_max_buffer_size
|
||||||
|
syn keyword ngxDirective mp4_limit_rate
|
||||||
|
syn keyword ngxDirective mp4_limit_rate_after
|
||||||
syn keyword ngxDirective msie_padding
|
syn keyword ngxDirective msie_padding
|
||||||
syn keyword ngxDirective msie_refresh
|
syn keyword ngxDirective msie_refresh
|
||||||
syn keyword ngxDirective multi_accept
|
syn keyword ngxDirective multi_accept
|
||||||
|
syn keyword ngxDirective mysql_test
|
||||||
syn keyword ngxDirective open_file_cache
|
syn keyword ngxDirective open_file_cache
|
||||||
syn keyword ngxDirective open_file_cache_errors
|
syn keyword ngxDirective open_file_cache_errors
|
||||||
syn keyword ngxDirective open_file_cache_events
|
syn keyword ngxDirective open_file_cache_events
|
||||||
@@ -269,7 +284,8 @@ syn keyword ngxDirective port_in_redirect
|
|||||||
syn keyword ngxDirective post_acceptex
|
syn keyword ngxDirective post_acceptex
|
||||||
syn keyword ngxDirective postpone_gzipping
|
syn keyword ngxDirective postpone_gzipping
|
||||||
syn keyword ngxDirective postpone_output
|
syn keyword ngxDirective postpone_output
|
||||||
syn keyword ngxDirective protocol
|
syn keyword ngxDirective protocol nextgroup=ngxMailProtocol skipwhite
|
||||||
|
syn keyword ngxMailProtocol imap pop3 smtp
|
||||||
syn keyword ngxDirective proxy
|
syn keyword ngxDirective proxy
|
||||||
syn keyword ngxDirective proxy_bind
|
syn keyword ngxDirective proxy_bind
|
||||||
syn keyword ngxDirective proxy_buffer
|
syn keyword ngxDirective proxy_buffer
|
||||||
@@ -473,6 +489,7 @@ syn keyword ngxDirective uwsgi_cache
|
|||||||
syn keyword ngxDirective uwsgi_cache_bypass
|
syn keyword ngxDirective uwsgi_cache_bypass
|
||||||
syn keyword ngxDirective uwsgi_cache_key
|
syn keyword ngxDirective uwsgi_cache_key
|
||||||
syn keyword ngxDirective uwsgi_cache_lock
|
syn keyword ngxDirective uwsgi_cache_lock
|
||||||
|
syn keyword ngxDirective uwsgi_cache_lock_age
|
||||||
syn keyword ngxDirective uwsgi_cache_lock_timeout
|
syn keyword ngxDirective uwsgi_cache_lock_timeout
|
||||||
syn keyword ngxDirective uwsgi_cache_methods
|
syn keyword ngxDirective uwsgi_cache_methods
|
||||||
syn keyword ngxDirective uwsgi_cache_min_uses
|
syn keyword ngxDirective uwsgi_cache_min_uses
|
||||||
@@ -494,14 +511,19 @@ syn keyword ngxDirective uwsgi_next_upstream_timeout
|
|||||||
syn keyword ngxDirective uwsgi_next_upstream_tries
|
syn keyword ngxDirective uwsgi_next_upstream_tries
|
||||||
syn keyword ngxDirective uwsgi_no_cache
|
syn keyword ngxDirective uwsgi_no_cache
|
||||||
syn keyword ngxDirective uwsgi_param
|
syn keyword ngxDirective uwsgi_param
|
||||||
|
syn keyword ngxDirective uwsgi_pass
|
||||||
syn keyword ngxDirective uwsgi_pass_header
|
syn keyword ngxDirective uwsgi_pass_header
|
||||||
syn keyword ngxDirective uwsgi_pass_request_body
|
syn keyword ngxDirective uwsgi_pass_request_body
|
||||||
syn keyword ngxDirective uwsgi_pass_request_headers
|
syn keyword ngxDirective uwsgi_pass_request_headers
|
||||||
syn keyword ngxDirective uwsgi_read_timeout
|
syn keyword ngxDirective uwsgi_read_timeout
|
||||||
|
syn keyword ngxDirective uwsgi_request_buffering
|
||||||
syn keyword ngxDirective uwsgi_send_timeout
|
syn keyword ngxDirective uwsgi_send_timeout
|
||||||
|
syn keyword ngxDirective uwsgi_ssl_certificate
|
||||||
|
syn keyword ngxDirective uwsgi_ssl_certificate_key
|
||||||
syn keyword ngxDirective uwsgi_ssl_ciphers
|
syn keyword ngxDirective uwsgi_ssl_ciphers
|
||||||
syn keyword ngxDirective uwsgi_ssl_crl
|
syn keyword ngxDirective uwsgi_ssl_crl
|
||||||
syn keyword ngxDirective uwsgi_ssl_name
|
syn keyword ngxDirective uwsgi_ssl_name
|
||||||
|
syn keyword ngxDirective uwsgi_ssl_password_file
|
||||||
syn keyword ngxDirective uwsgi_ssl_protocols
|
syn keyword ngxDirective uwsgi_ssl_protocols
|
||||||
syn keyword ngxDirective uwsgi_ssl_server_name
|
syn keyword ngxDirective uwsgi_ssl_server_name
|
||||||
syn keyword ngxDirective uwsgi_ssl_session_reuse
|
syn keyword ngxDirective uwsgi_ssl_session_reuse
|
||||||
@@ -553,6 +575,16 @@ syn keyword ngxDirectiveThirdParty accesskey_signature
|
|||||||
syn keyword ngxDirectiveThirdParty auth_pam
|
syn keyword ngxDirectiveThirdParty auth_pam
|
||||||
syn keyword ngxDirectiveThirdParty auth_pam_service_name
|
syn keyword ngxDirectiveThirdParty auth_pam_service_name
|
||||||
|
|
||||||
|
" Brotli Module <https://github.com/google/ngx_brotli>
|
||||||
|
" Nginx module for Brotli compression
|
||||||
|
syn keyword ngxDirectiveThirdParty brotli_static
|
||||||
|
syn keyword ngxDirectiveThirdParty brotli
|
||||||
|
syn keyword ngxDirectiveThirdParty brotli_types
|
||||||
|
syn keyword ngxDirectiveThirdParty brotli_buffers
|
||||||
|
syn keyword ngxDirectiveThirdParty brotli_comp_level
|
||||||
|
syn keyword ngxDirectiveThirdParty brotli_window
|
||||||
|
syn keyword ngxDirectiveThirdParty brotli_min_length
|
||||||
|
|
||||||
" Cache Purge Module <http://labs.frickle.com/nginx_ngx_cache_purge/>
|
" Cache Purge Module <http://labs.frickle.com/nginx_ngx_cache_purge/>
|
||||||
" Module adding ability to purge content from FastCGI and proxy caches.
|
" Module adding ability to purge content from FastCGI and proxy caches.
|
||||||
syn keyword ngxDirectiveThirdParty fastcgi_cache_purge
|
syn keyword ngxDirectiveThirdParty fastcgi_cache_purge
|
||||||
@@ -606,7 +638,7 @@ syn keyword ngxDirectiveThirdParty echo_subrequest
|
|||||||
syn keyword ngxDirectiveThirdParty echo_subrequest_async
|
syn keyword ngxDirectiveThirdParty echo_subrequest_async
|
||||||
|
|
||||||
" Events Module <http://docs.dutov.org/nginx_modules_events_en.html>
|
" Events Module <http://docs.dutov.org/nginx_modules_events_en.html>
|
||||||
" Provides options for start/stop events.
|
" Privides options for start/stop events.
|
||||||
syn keyword ngxDirectiveThirdParty on_start
|
syn keyword ngxDirectiveThirdParty on_start
|
||||||
syn keyword ngxDirectiveThirdParty on_stop
|
syn keyword ngxDirectiveThirdParty on_stop
|
||||||
|
|
||||||
@@ -671,6 +703,70 @@ syn keyword ngxDirectiveThirdParty js_utf8
|
|||||||
syn keyword ngxDirectiveThirdParty log_request_speed_filter
|
syn keyword ngxDirectiveThirdParty log_request_speed_filter
|
||||||
syn keyword ngxDirectiveThirdParty log_request_speed_filter_timeout
|
syn keyword ngxDirectiveThirdParty log_request_speed_filter_timeout
|
||||||
|
|
||||||
|
|
||||||
|
" Lua Module <https://github.com/openresty/lua-nginx-module>
|
||||||
|
" Embed the Power of Lua into NGINX HTTP servers
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_use_default_type
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_code_cache
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_regex_cache_max_entries
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_regex_match_limit
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_package_path
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_package_cpath
|
||||||
|
syn keyword ngxDirectiveThirdParty init_by_lua
|
||||||
|
syn keyword ngxDirectiveThirdParty init_by_lua_block
|
||||||
|
syn keyword ngxDirectiveThirdParty init_by_lua_file
|
||||||
|
syn keyword ngxDirectiveThirdParty init_worker_by_lua
|
||||||
|
syn keyword ngxDirectiveThirdParty init_worker_by_lua_block
|
||||||
|
syn keyword ngxDirectiveThirdParty init_worker_by_lua_file
|
||||||
|
syn keyword ngxDirectiveThirdParty set_by_lua
|
||||||
|
syn keyword ngxDirectiveThirdParty set_by_lua_block
|
||||||
|
syn keyword ngxDirectiveThirdParty set_by_lua_file
|
||||||
|
syn keyword ngxDirectiveThirdParty content_by_lua
|
||||||
|
syn keyword ngxDirectiveThirdParty content_by_lua_block
|
||||||
|
syn keyword ngxDirectiveThirdParty content_by_lua_file
|
||||||
|
syn keyword ngxDirectiveThirdParty rewrite_by_lua
|
||||||
|
syn keyword ngxDirectiveThirdParty rewrite_by_lua_block
|
||||||
|
syn keyword ngxDirectiveThirdParty rewrite_by_lua_file
|
||||||
|
syn keyword ngxDirectiveThirdParty access_by_lua
|
||||||
|
syn keyword ngxDirectiveThirdParty access_by_lua_block
|
||||||
|
syn keyword ngxDirectiveThirdParty access_by_lua_file
|
||||||
|
syn keyword ngxDirectiveThirdParty header_filter_by_lua
|
||||||
|
syn keyword ngxDirectiveThirdParty header_filter_by_lua_block
|
||||||
|
syn keyword ngxDirectiveThirdParty header_filter_by_lua_file
|
||||||
|
syn keyword ngxDirectiveThirdParty body_filter_by_lua
|
||||||
|
syn keyword ngxDirectiveThirdParty body_filter_by_lua_block
|
||||||
|
syn keyword ngxDirectiveThirdParty body_filter_by_lua_file
|
||||||
|
syn keyword ngxDirectiveThirdParty log_by_lua
|
||||||
|
syn keyword ngxDirectiveThirdParty log_by_lua_block
|
||||||
|
syn keyword ngxDirectiveThirdParty log_by_lua_file
|
||||||
|
syn keyword ngxDirectiveThirdParty balancer_by_lua_block
|
||||||
|
syn keyword ngxDirectiveThirdParty balancer_by_lua_file
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_need_request_body
|
||||||
|
syn keyword ngxDirectiveThirdParty ssl_certificate_by_lua_block
|
||||||
|
syn keyword ngxDirectiveThirdParty ssl_certificate_by_lua_file
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_shared_dict
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_socket_connect_timeout
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_socket_send_timeout
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_socket_send_lowat
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_socket_read_timeout
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_socket_buffer_size
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_socket_pool_size
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_socket_keepalive_timeout
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_socket_log_errors
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_ssl_ciphers
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_ssl_crl
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_ssl_protocols
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_ssl_trusted_certificate
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_ssl_verify_depth
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_http10_buffering
|
||||||
|
syn keyword ngxDirectiveThirdParty rewrite_by_lua_no_postpone
|
||||||
|
syn keyword ngxDirectiveThirdParty access_by_lua_no_postpone
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_transform_underscores_in_response_headers
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_check_client_abort
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_max_pending_timers
|
||||||
|
syn keyword ngxDirectiveThirdParty lua_max_running_timers
|
||||||
|
|
||||||
|
|
||||||
" Memc Module <http://wiki.nginx.org/NginxHttpMemcModule>
|
" Memc Module <http://wiki.nginx.org/NginxHttpMemcModule>
|
||||||
" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.
|
" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.
|
||||||
syn keyword ngxDirectiveThirdParty memc_buffer_size
|
syn keyword ngxDirectiveThirdParty memc_buffer_size
|
||||||
@@ -821,12 +917,13 @@ syn keyword ngxDirectiveThirdParty xss_output_type
|
|||||||
|
|
||||||
hi link ngxComment Comment
|
hi link ngxComment Comment
|
||||||
hi link ngxVariable Identifier
|
hi link ngxVariable Identifier
|
||||||
hi link ngxVariableBlock Identifier
|
|
||||||
hi link ngxVariableString PreProc
|
hi link ngxVariableString PreProc
|
||||||
hi link ngxBlock Normal
|
|
||||||
hi link ngxString String
|
hi link ngxString String
|
||||||
|
hi link ngxLocationPath String
|
||||||
|
hi link ngxLocationNamedLoc Identifier
|
||||||
|
|
||||||
hi link ngxBoolean Boolean
|
hi link ngxBoolean Boolean
|
||||||
|
hi link ngxRewriteFlag Boolean
|
||||||
hi link ngxDirectiveBlock Statement
|
hi link ngxDirectiveBlock Statement
|
||||||
hi link ngxDirectiveImportant Type
|
hi link ngxDirectiveImportant Type
|
||||||
hi link ngxDirectiveControl Keyword
|
hi link ngxDirectiveControl Keyword
|
||||||
|
|||||||
@@ -21,25 +21,29 @@ endif
|
|||||||
if !exists("nim_highlight_space_errors")
|
if !exists("nim_highlight_space_errors")
|
||||||
let nim_highlight_space_errors = 1
|
let nim_highlight_space_errors = 1
|
||||||
endif
|
endif
|
||||||
|
if !exists("nim_highlight_special_vars")
|
||||||
|
let nim_highlight_special_vars = 1
|
||||||
|
endif
|
||||||
|
|
||||||
if exists("nim_highlight_all")
|
if exists("nim_highlight_all")
|
||||||
let nim_highlight_numbers = 1
|
let nim_highlight_numbers = 1
|
||||||
let nim_highlight_builtins = 1
|
let nim_highlight_builtins = 1
|
||||||
let nim_highlight_exceptions = 1
|
let nim_highlight_exceptions = 1
|
||||||
let nim_highlight_space_errors = 1
|
let nim_highlight_space_errors = 1
|
||||||
|
let nim_highlight_special_vars = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syn region nimBrackets contained extend keepend matchgroup=Bold start=+\(\\\)\@<!\[+ end=+]\|$+ skip=+\\\s*$\|\(\\\)\@<!\\]+ contains=@tclCommandCluster
|
syn region nimBrackets contained extend keepend matchgroup=Bold start=+\(\\\)\@<!\[+ end=+]\|$+ skip=+\\\s*$\|\(\\\)\@<!\\]+ contains=@tclCommandCluster
|
||||||
|
|
||||||
syn keyword nimKeyword addr and as asm atomic
|
syn keyword nimKeyword addr and as asm atomic
|
||||||
syn keyword nimKeyword bind block break
|
syn keyword nimKeyword bind block break
|
||||||
syn keyword nimKeyword case cast const continue converter
|
syn keyword nimKeyword case cast concept const continue converter
|
||||||
syn keyword nimKeyword discard distinct div do
|
syn keyword nimKeyword defer discard distinct div do
|
||||||
syn keyword nimKeyword elif else end enum except export
|
syn keyword nimKeyword elif else end enum except export
|
||||||
syn keyword nimKeyword finally for from
|
syn keyword nimKeyword finally for from func
|
||||||
syn keyword nimKeyword generic
|
syn keyword nimKeyword generic
|
||||||
syn keyword nimKeyword if import in include interface is isnot iterator
|
syn keyword nimKeyword if import in include interface is isnot iterator
|
||||||
syn keyword nimKeyword lambda let
|
syn keyword nimKeyword let
|
||||||
syn keyword nimKeyword mixin using mod
|
syn keyword nimKeyword mixin using mod
|
||||||
syn keyword nimKeyword nil not notin
|
syn keyword nimKeyword nil not notin
|
||||||
syn keyword nimKeyword object of or out
|
syn keyword nimKeyword object of or out
|
||||||
@@ -59,6 +63,7 @@ syn keyword nimRepeat for while
|
|||||||
syn keyword nimConditional if elif else case of
|
syn keyword nimConditional if elif else case of
|
||||||
syn keyword nimOperator and in is not or xor shl shr div
|
syn keyword nimOperator and in is not or xor shl shr div
|
||||||
syn match nimComment "#.*$" contains=nimTodo,@Spell
|
syn match nimComment "#.*$" contains=nimTodo,@Spell
|
||||||
|
syn region nimComment start="#\[" end="\]#" contains=nimTodo,@Spell
|
||||||
syn keyword nimTodo TODO FIXME XXX contained
|
syn keyword nimTodo TODO FIXME XXX contained
|
||||||
syn keyword nimBoolean true false
|
syn keyword nimBoolean true false
|
||||||
|
|
||||||
@@ -89,11 +94,9 @@ if nim_highlight_builtins == 1
|
|||||||
" builtin functions, types and objects, not really part of the syntax
|
" builtin functions, types and objects, not really part of the syntax
|
||||||
syn keyword nimBuiltin int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float float32 float64 bool
|
syn keyword nimBuiltin int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float float32 float64 bool
|
||||||
syn keyword nimBuiltin char string cstring pointer range array openarray seq
|
syn keyword nimBuiltin char string cstring pointer range array openarray seq
|
||||||
syn keyword nimBuiltin set Byte Natural Positive TObject PObject Conversion TResult TAddress
|
syn keyword nimBuiltin set Byte Natural Positive Conversion
|
||||||
syn keyword nimBuiltin BiggestInt BiggestFloat cchar cschar cshort cint csize cuchar cushort
|
syn keyword nimBuiltin BiggestInt BiggestFloat cchar cschar cshort cint csize cuchar cushort
|
||||||
syn keyword nimBuiltin clong clonglong cfloat cdouble clongdouble cuint culong culonglong cchar
|
syn keyword nimBuiltin clong clonglong cfloat cdouble clongdouble cuint culong culonglong cchar
|
||||||
syn keyword nimBuiltin cstringArray TEndian PFloat32 PFloat64 PInt64 PInt32
|
|
||||||
syn keyword nimBuiltin TGC_Strategy TFile TFileMode TFileHandle isMainModule
|
|
||||||
syn keyword nimBuiltin CompileDate CompileTime nimVersion nimMajor
|
syn keyword nimBuiltin CompileDate CompileTime nimVersion nimMajor
|
||||||
syn keyword nimBuiltin nimMinor nimPatch cpuEndian hostOS hostCPU inf
|
syn keyword nimBuiltin nimMinor nimPatch cpuEndian hostOS hostCPU inf
|
||||||
syn keyword nimBuiltin neginf nan QuitSuccess QuitFailure dbgLineHook stdin
|
syn keyword nimBuiltin neginf nan QuitSuccess QuitFailure dbgLineHook stdin
|
||||||
@@ -107,7 +110,7 @@ if nim_highlight_builtins == 1
|
|||||||
syn keyword nimBuiltin swap getRefcount getCurrentException Msg
|
syn keyword nimBuiltin swap getRefcount getCurrentException Msg
|
||||||
syn keyword nimBuiltin getOccupiedMem getFreeMem getTotalMem isNil seqToPtr
|
syn keyword nimBuiltin getOccupiedMem getFreeMem getTotalMem isNil seqToPtr
|
||||||
syn keyword nimBuiltin find pop GC_disable GC_enable GC_fullCollect
|
syn keyword nimBuiltin find pop GC_disable GC_enable GC_fullCollect
|
||||||
syn keyword nimBuiltin GC_setStrategy GC_enableMarkAnd Sweep
|
syn keyword nimBuiltin GC_setStrategy GC_enableMarkAndSweep GC_Strategy
|
||||||
syn keyword nimBuiltin GC_disableMarkAnd Sweep GC_getStatistics GC_ref
|
syn keyword nimBuiltin GC_disableMarkAnd Sweep GC_getStatistics GC_ref
|
||||||
syn keyword nimBuiltin GC_ref GC_ref GC_unref GC_unref GC_unref quit
|
syn keyword nimBuiltin GC_ref GC_ref GC_unref GC_unref GC_unref quit
|
||||||
syn keyword nimBuiltin OpenFile OpenFile CloseFile EndOfFile readChar
|
syn keyword nimBuiltin OpenFile OpenFile CloseFile EndOfFile readChar
|
||||||
@@ -115,6 +118,7 @@ if nim_highlight_builtins == 1
|
|||||||
syn keyword nimBuiltin getFileSize ReadBytes ReadChars readBuffer writeBytes
|
syn keyword nimBuiltin getFileSize ReadBytes ReadChars readBuffer writeBytes
|
||||||
syn keyword nimBuiltin writeChars writeBuffer setFilePos getFilePos
|
syn keyword nimBuiltin writeChars writeBuffer setFilePos getFilePos
|
||||||
syn keyword nimBuiltin fileHandle countdown countup items lines
|
syn keyword nimBuiltin fileHandle countdown countup items lines
|
||||||
|
syn keyword nimBuiltin FileMode File RootObj FileHandle ByteAddress Endianness
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if nim_highlight_exceptions == 1
|
if nim_highlight_exceptions == 1
|
||||||
@@ -139,6 +143,10 @@ if nim_highlight_space_errors == 1
|
|||||||
syn match nimSpaceError display "\t"
|
syn match nimSpaceError display "\t"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if nim_highlight_special_vars
|
||||||
|
syn keyword nimSpecialVar result
|
||||||
|
endif
|
||||||
|
|
||||||
syn sync match nimSync grouphere NONE "):$"
|
syn sync match nimSync grouphere NONE "):$"
|
||||||
syn sync maxlines=200
|
syn sync maxlines=200
|
||||||
syn sync minlines=2000
|
syn sync minlines=2000
|
||||||
@@ -166,6 +174,7 @@ if version >= 508 || !exists("did_nim_syn_inits")
|
|||||||
HiLink nimComment Comment
|
HiLink nimComment Comment
|
||||||
HiLink nimTodo Todo
|
HiLink nimTodo Todo
|
||||||
HiLink nimDecorator Define
|
HiLink nimDecorator Define
|
||||||
|
HiLink nimSpecialVar Identifier
|
||||||
|
|
||||||
if nim_highlight_numbers == 1
|
if nim_highlight_numbers == 1
|
||||||
HiLink nimNumber Number
|
HiLink nimNumber Number
|
||||||
|
|||||||
@@ -68,17 +68,11 @@ set cpo&vim
|
|||||||
syn match p6Identifier display "\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)"
|
syn match p6Identifier display "\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)"
|
||||||
|
|
||||||
let s:keywords = {
|
let s:keywords = {
|
||||||
\ "p6DeclareRoutine": [
|
|
||||||
\ "macro sub submethod method multi proto only category unit",
|
|
||||||
\ ],
|
|
||||||
\ "p6Module": [
|
|
||||||
\ "module class role package enum grammar slang subset",
|
|
||||||
\ ],
|
|
||||||
\ "p6Include": [
|
\ "p6Include": [
|
||||||
\ "use require",
|
\ "use require unit",
|
||||||
\ ],
|
\ ],
|
||||||
\ "p6Conditional": [
|
\ "p6Conditional": [
|
||||||
\ "if else elsif unless",
|
\ "if else elsif unless with orwith without",
|
||||||
\ ],
|
\ ],
|
||||||
\ "p6VarStorage": [
|
\ "p6VarStorage": [
|
||||||
\ "let my our state temp has constant",
|
\ "let my our state temp has constant",
|
||||||
@@ -144,7 +138,7 @@ let s:alpha_metaops_or = join(s:temp, "\\|")
|
|||||||
" than matches/regions, which would prevent these words from matching as
|
" than matches/regions, which would prevent these words from matching as
|
||||||
" autoquoted strings before "=>" or "p5=>".
|
" autoquoted strings before "=>" or "p5=>".
|
||||||
syn match p6KeywordStart display "\%(\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\)\@!\)\@=[A-Za-z_\xC0-\xFF0-9]\@1<!\%([A-Za-z_\xC0-\xFF][-']\)\@2<!"
|
syn match p6KeywordStart display "\%(\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\)\@!\)\@=[A-Za-z_\xC0-\xFF0-9]\@1<!\%([A-Za-z_\xC0-\xFF][-']\)\@2<!"
|
||||||
\ nextgroup=p6Attention,p6DeclareRoutine,p6Module,p6Variable,p6Include,p6Conditional,p6VarStorage,p6Repeat,p6FlowControl,p6ClosureTrait,p6Exception,p6Number,p6Pragma,p6Type,p6Operator,p6Identifier
|
\ nextgroup=p6Attention,p6Variable,p6Include,p6Conditional,p6VarStorage,p6Repeat,p6FlowControl,p6ClosureTrait,p6Exception,p6Number,p6Pragma,p6Type,p6Operator,p6Identifier
|
||||||
|
|
||||||
for [group, words] in items(s:keywords)
|
for [group, words] in items(s:keywords)
|
||||||
let s:words_space = join(words, " ")
|
let s:words_space = join(words, " ")
|
||||||
@@ -159,6 +153,10 @@ let s:words = join(s:temp, "\\|")
|
|||||||
exec "syn match p6Type display \"\\%(". s:words . "\\)\\%([A-Za-z_\\xC0-\\xFF0-9]\\|[-'][A-Za-z_\\xC0-\\xFF]\\)\\@!\" contained"
|
exec "syn match p6Type display \"\\%(". s:words . "\\)\\%([A-Za-z_\\xC0-\\xFF0-9]\\|[-'][A-Za-z_\\xC0-\\xFF]\\)\\@!\" contained"
|
||||||
unlet s:keywords s:types s:words_space s:temp s:words
|
unlet s:keywords s:types s:words_space s:temp s:words
|
||||||
|
|
||||||
|
syn match p6PreDeclare display "[.^]\@1<!\<\%(multi\|proto\|only\)\>" nextgroup=p6Declare,p6Identifier skipwhite skipempty
|
||||||
|
syn match p6Declare display "[.^]\@1<!\<\%(macro\|sub\|submethod\|method\|category\|module\|class\|role\|package\|enum\|grammar\|slang\|subset\)\>" nextgroup=p6Identifier skipwhite skipempty
|
||||||
|
syn match p6DeclareRegex display "[.^]\@1<!\<\%(regex\|rule\|token\)\>" nextgroup=p6RegexName skipwhite skipempty
|
||||||
|
|
||||||
syn match p6TypeConstraint display "\%([.^]\|^\s*\)\@<!\a\@=\%(does\|as\|but\|trusts\|of\|returns\|handles\|where\|augment\|supersede\)\>"
|
syn match p6TypeConstraint display "\%([.^]\|^\s*\)\@<!\a\@=\%(does\|as\|but\|trusts\|of\|returns\|handles\|where\|augment\|supersede\)\>"
|
||||||
syn match p6TypeConstraint display "\%([.^]\|^\s*\)\@<![A-Za-z_\xC0-\xFF0-9]\@1<!\%([A-Za-z_\xC0-\xFF][-']\)\@2<!is\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\)\@!" skipwhite skipempty nextgroup=p6Property
|
syn match p6TypeConstraint display "\%([.^]\|^\s*\)\@<![A-Za-z_\xC0-\xFF0-9]\@1<!\%([A-Za-z_\xC0-\xFF][-']\)\@2<!is\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\)\@!" skipwhite skipempty nextgroup=p6Property
|
||||||
syn match p6Property display "\a\@=\%(signature\|context\|also\|shape\|prec\|irs\|ofs\|ors\|export\|deep\|binary\|unary\|reparsed\|rw\|parsed\|cached\|readonly\|defequiv\|will\|ref\|copy\|inline\|tighter\|looser\|equiv\|assoc\|required\)" contained
|
syn match p6Property display "\a\@=\%(signature\|context\|also\|shape\|prec\|irs\|ofs\|ors\|export\|deep\|binary\|unary\|reparsed\|rw\|parsed\|cached\|readonly\|defequiv\|will\|ref\|copy\|inline\|tighter\|looser\|equiv\|assoc\|required\)" contained
|
||||||
@@ -188,7 +186,7 @@ syn match p6ReduceOp display "\%(^\|\s\|(\)\@1<=!*\%([RSXZ\[]\)*[&RSXZ]\?\[\+(\?
|
|||||||
syn match p6SetOp display "R\?(\%([-^.+|&]\|[<>][=+]\?\|cont\|elem\))"
|
syn match p6SetOp display "R\?(\%([-^.+|&]\|[<>][=+]\?\|cont\|elem\))"
|
||||||
|
|
||||||
" Reverse, cross, and zip metaoperators
|
" Reverse, cross, and zip metaoperators
|
||||||
exec "syn match p6RSXZOp display \"[RSXZ]:\\@!\\%(\\a\\@=\\%(". s:alpha_metaops_or . "\\)\\>\\|[[:alnum:]]\\@!\\%([.,]\\|[^[,.[:space:]]\\)\\+\\|\\s\\@=\\|$\\)\""
|
exec "syn match p6RSXZOp display \"[RSXZ]:\\@!\\%(\\a\\@=\\%(". s:alpha_metaops_or . "\\)\\>\\|[[:alnum:]]\\@!\\%([.,]\\|[^[,.[:alnum:][:space:]]\\)\\+\\|\\s\\@=\\|$\\)\""
|
||||||
|
|
||||||
syn match p6BlockLabel display "^\s*\zs\h\w*\s*::\@!\_s\@="
|
syn match p6BlockLabel display "^\s*\zs\h\w*\s*::\@!\_s\@="
|
||||||
|
|
||||||
@@ -362,12 +360,12 @@ syn region p6Adverb
|
|||||||
" * Followed by [-=] (e.g. <--, <=, <==, <->)
|
" * Followed by [-=] (e.g. <--, <=, <==, <->)
|
||||||
syn region p6StringAngle
|
syn region p6StringAngle
|
||||||
\ matchgroup=p6Quote
|
\ matchgroup=p6Quote
|
||||||
\ start="\%(\<\%(enum\|for\|any\|all\|none\)\>\s*(\?\s*\)\@<=<\%(<\|=>\|[-=]\{1,2}>\@!\)\@!"
|
\ start="\%(\<\%(enum\|for\|any\|all\|none\)\>\s*(\?\s*\)\@<=<\%(<\|=>\|\%([=-]\{1,2}>\|[=-]\{2}\)\)\@!"
|
||||||
\ start="\%(\s\|[<+~=!]\)\@<!<\%(<\|=>\|[-=]\{1,2}>\@!\)\@!"
|
\ start="\%(\s\|[<+~=!]\)\@<!<\%(<\|=>\|\%([=-]\{1,2}>\|[=-]\{2}\)\)\@!"
|
||||||
\ start="[<+~=!]\@1<!<\%(\s\|<\|=>\|[-=]\{1,2}\)\@!"
|
\ start="[<+~=!]\@1<!<\%(\s\|<\|=>\|\%([=-]\{1,2}>\|[=-]\{2}\)\)\@!"
|
||||||
\ start="\%(^\s*\)\@<=<\%(<\|=>\|[-=]\{1,2}>\@!\)\@!"
|
\ start="\%(^\s*\)\@<=<\%(<\|=>\|\%([=-]\{1,2}>\|[=-]\{2}\)\)\@!"
|
||||||
\ start="[<+~=!]\@1<!<\%(\s*$\)\@="
|
\ start="[<+~=!]\@1<!<\%(\s*$\)\@="
|
||||||
\ start="\%((\s*\|=\s\+\)\@<=<\%(<\|=>\|[-=]\{1,2}>\@!\)\@!"
|
\ start="\%((\s*\|=\s\+\)\@<=<\%(<\|=>\|\%([=-]\{1,2}>\|[=-]\{2}\)\)\@!"
|
||||||
\ start="<\%(\s*>\)\@="
|
\ start="<\%(\s*>\)\@="
|
||||||
\ skip="\\\@1<!\\>"
|
\ skip="\\\@1<!\\>"
|
||||||
\ end=">"
|
\ end=">"
|
||||||
@@ -450,11 +448,12 @@ syn region p6StringDQ
|
|||||||
|
|
||||||
" Q// and friends
|
" Q// and friends
|
||||||
|
|
||||||
syn match p6QuoteQStart display "\%(:\|\%(sub\|role\)\s\)\@5<![Qq]\@=" nextgroup=p6QuoteQ,p6QuoteQ_q,p6QuoteQ_qww,p6QuoteQ_qq,p6QuoteQ_qto,p6QuoteQ_qqto,p6Identifier
|
syn match p6QuoteQStart display "\%(:\|\%(sub\|role\)\s\)\@5<![Qq]\@=" nextgroup=p6QuoteQ,p6QuoteQ_q,p6QuoteQ_qww,p6QuoteQ_qq,p6QuoteQ_to,p6QuoteQ_qto,p6QuoteQ_qqto,p6Identifier
|
||||||
syn match p6QuoteQ display "Q\%(qq\|ww\|[abcfhpsqvwx]\)\?[A-Za-z(]\@!" nextgroup=p6PairsQ skipwhite skipempty contained
|
syn match p6QuoteQ display "Q\%(qq\|ww\|[abcfhpsqvwx]\)\?[A-Za-z(]\@!" nextgroup=p6PairsQ skipwhite skipempty contained
|
||||||
syn match p6QuoteQ_q display "q[abcfhpsvwx]\?[A-Za-z(]\@!" nextgroup=p6PairsQ_q skipwhite skipempty contained
|
syn match p6QuoteQ_q display "q[abcfhpsvwx]\?[A-Za-z(]\@!" nextgroup=p6PairsQ_q skipwhite skipempty contained
|
||||||
syn match p6QuoteQ_qww display "qww[A-Za-z(]\@!" nextgroup=p6PairsQ_qww skipwhite skipempty contained
|
syn match p6QuoteQ_qww display "qww[A-Za-z(]\@!" nextgroup=p6PairsQ_qww skipwhite skipempty contained
|
||||||
syn match p6QuoteQ_qq display "qq[pwx]\?[A-Za-z(]\@!" nextgroup=p6PairsQ_qq skipwhite skipempty contained
|
syn match p6QuoteQ_qq display "qq[pwx]\?[A-Za-z(]\@!" nextgroup=p6PairsQ_qq skipwhite skipempty contained
|
||||||
|
syn match p6QuoteQ_to display "Qto[A-Za-z(]\@!" nextgroup=p6StringQ_to skipwhite skipempty contained
|
||||||
syn match p6QuoteQ_qto display "qto[A-Za-z(]\@!" nextgroup=p6StringQ_qto skipwhite skipempty contained
|
syn match p6QuoteQ_qto display "qto[A-Za-z(]\@!" nextgroup=p6StringQ_qto skipwhite skipempty contained
|
||||||
syn match p6QuoteQ_qqto display "qqto[A-Za-z(]\@!" nextgroup=p6StringQ_qqto skipwhite skipempty contained
|
syn match p6QuoteQ_qqto display "qqto[A-Za-z(]\@!" nextgroup=p6StringQ_qqto skipwhite skipempty contained
|
||||||
syn match p6QuoteQ_qto display "q\_s*\%(\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*:\%(to\|heredoc\)\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*(\@!\)\@=" nextgroup=p6PairsQ_qto skipwhite skipempty contained
|
syn match p6QuoteQ_qto display "q\_s*\%(\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*:\%(to\|heredoc\)\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*(\@!\)\@=" nextgroup=p6PairsQ_qto skipwhite skipempty contained
|
||||||
@@ -494,10 +493,11 @@ let s:bracketing_delims = [
|
|||||||
let s:all_delims = s:plain_delims + s:bracketing_delims
|
let s:all_delims = s:plain_delims + s:bracketing_delims
|
||||||
|
|
||||||
for [name, start_delim, end_delim, end_group, skip] in s:all_delims
|
for [name, start_delim, end_delim, end_group, skip] in s:all_delims
|
||||||
exec "syn region p6StringQ matchgroup=p6Quote start=\"".start_delim."\" skip=\"".skip."\" end=\"".end_delim."\" contains=".end_group." contained"
|
exec "syn region p6StringQ matchgroup=p6Quote start=\"".start_delim."\" end=\"".end_delim."\" contained"
|
||||||
exec "syn region p6StringQ_q matchgroup=p6Quote start=\"".start_delim."\" skip=\"".skip."\" end=\"".end_delim."\" contains=@p6Interp_q,".end_group." contained"
|
exec "syn region p6StringQ_q matchgroup=p6Quote start=\"".start_delim."\" skip=\"".skip."\" end=\"".end_delim."\" contains=@p6Interp_q,".end_group." contained"
|
||||||
exec "syn region p6StringQ_qww matchgroup=p6Quote start=\"".start_delim."\" skip=\"".skip."\" end=\"".end_delim."\" contains=@p6Interp_q,p6StringSQ,p6StringDQ".end_group." contained"
|
exec "syn region p6StringQ_qww matchgroup=p6Quote start=\"".start_delim."\" skip=\"".skip."\" end=\"".end_delim."\" contains=@p6Interp_q,p6StringSQ,p6StringDQ".end_group." contained"
|
||||||
exec "syn region p6StringQ_qq matchgroup=p6Quote start=\"".start_delim."\" skip=\"".skip."\" end=\"".end_delim."\" contains=@p6Interp_qq,".end_group." contained"
|
exec "syn region p6StringQ_qq matchgroup=p6Quote start=\"".start_delim."\" skip=\"".skip."\" end=\"".end_delim."\" contains=@p6Interp_qq,".end_group." contained"
|
||||||
|
exec "syn region p6StringQ_to matchgroup=p6Quote start=\"".start_delim."\\z([^".end_delim."]\\+\\)".end_delim."\" end=\"^\\s*\\z1$\" contained"
|
||||||
exec "syn region p6StringQ_qto matchgroup=p6Quote start=\"".start_delim."\\z([^".end_delim."]\\+\\)".end_delim."\" skip=\"".skip."\" end=\"^\\s*\\z1$\" contains=@p6Interp_q,".end_group." contained"
|
exec "syn region p6StringQ_qto matchgroup=p6Quote start=\"".start_delim."\\z([^".end_delim."]\\+\\)".end_delim."\" skip=\"".skip."\" end=\"^\\s*\\z1$\" contains=@p6Interp_q,".end_group." contained"
|
||||||
exec "syn region p6StringQ_qqto matchgroup=p6Quote start=\"".start_delim."\\z(\[^".end_delim."]\\+\\)".end_delim."\" skip=\"".skip."\" end=\"^\\s*\\z1$\" contains=@p6Interp_qq,".end_group." contained"
|
exec "syn region p6StringQ_qqto matchgroup=p6Quote start=\"".start_delim."\\z(\[^".end_delim."]\\+\\)".end_delim."\" skip=\"".skip."\" end=\"^\\s*\\z1$\" contains=@p6Interp_qq,".end_group." contained"
|
||||||
|
|
||||||
@@ -513,7 +513,6 @@ syn match p6Key display "\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Z
|
|||||||
|
|
||||||
" Regexes and grammars
|
" Regexes and grammars
|
||||||
|
|
||||||
syn match p6DeclareRegex display "\%(regex\|rule\|token\)" nextgroup=p6RegexName skipwhite skipempty
|
|
||||||
syn match p6RegexName display "\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\?" nextgroup=p6RegexBlockCrap skipwhite skipempty contained
|
syn match p6RegexName display "\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\?" nextgroup=p6RegexBlockCrap skipwhite skipempty contained
|
||||||
syn match p6RegexBlockCrap "[^{]*" nextgroup=p6RegexBlock skipwhite skipempty transparent contained
|
syn match p6RegexBlockCrap "[^{]*" nextgroup=p6RegexBlock skipwhite skipempty transparent contained
|
||||||
|
|
||||||
@@ -724,7 +723,7 @@ syn match p6PackageScope display "\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\
|
|||||||
" Perl 6 regex regions
|
" Perl 6 regex regions
|
||||||
|
|
||||||
syn match p6MatchStart_m display "\.\@1<!\<\%(mm\?\|rx\)\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\)\@!" skipwhite skipempty nextgroup=p6MatchAdverbs_m
|
syn match p6MatchStart_m display "\.\@1<!\<\%(mm\?\|rx\)\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\)\@!" skipwhite skipempty nextgroup=p6MatchAdverbs_m
|
||||||
syn match p6MatchStart_s display "\.\@1<!\<s\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\)\@!" skipwhite skipempty nextgroup=p6MatchAdverbs_s
|
syn match p6MatchStart_s display "\.\@1<!\<[sS]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\)\@!" skipwhite skipempty nextgroup=p6MatchAdverbs_s
|
||||||
syn match p6MatchStart_tr display "\.\@1<!\<tr\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\)\@!" skipwhite skipempty nextgroup=p6MatchAdverbs_tr
|
syn match p6MatchStart_tr display "\.\@1<!\<tr\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\)\@!" skipwhite skipempty nextgroup=p6MatchAdverbs_tr
|
||||||
syn match p6MatchAdverbs_m "\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*" contained transparent skipwhite skipempty nextgroup=p6Match
|
syn match p6MatchAdverbs_m "\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*" contained transparent skipwhite skipempty nextgroup=p6Match
|
||||||
syn match p6MatchAdverbs_s "\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*" contained transparent skipwhite skipempty nextgroup=p6Substitution
|
syn match p6MatchAdverbs_s "\%(\_s*:!\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(([^)]*)\)\?\)*" contained transparent skipwhite skipempty nextgroup=p6Substitution
|
||||||
@@ -1100,10 +1099,10 @@ syn region p6BracketComment
|
|||||||
syn match p6Shebang display "\%^#!.*"
|
syn match p6Shebang display "\%^#!.*"
|
||||||
|
|
||||||
" => and p5=> autoquoting
|
" => and p5=> autoquoting
|
||||||
syn match p6StringP5Auto display "\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\ze\s\+p5=>"
|
syn match p6StringP5Auto display "\.\@1<!\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\ze\s\+p5=>"
|
||||||
syn match p6StringAuto display "\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\ze\%(p5\)\@2<![RSXZ]\@1<!=>"
|
syn match p6StringAuto display "\.\@1<!\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\ze\%(p5\)\@2<![RSXZ]\@1<!=>"
|
||||||
syn match p6StringAuto display "\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\ze\s\+=>"
|
syn match p6StringAuto display "\.\@1<!\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\ze\s\+=>"
|
||||||
syn match p6StringAuto display "\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)p5\ze=>"
|
syn match p6StringAuto display "\.\@1<!\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)p5\ze=>"
|
||||||
|
|
||||||
" Pod
|
" Pod
|
||||||
|
|
||||||
@@ -1759,6 +1758,7 @@ if version >= 508 || !exists("did_perl6_syntax_inits")
|
|||||||
HiLink p6StringQ_q p6String
|
HiLink p6StringQ_q p6String
|
||||||
HiLink p6StringQ_qww p6String
|
HiLink p6StringQ_qww p6String
|
||||||
HiLink p6StringQ_qq p6String
|
HiLink p6StringQ_qq p6String
|
||||||
|
HiLink p6StringQ_to p6String
|
||||||
HiLink p6StringQ_qto p6String
|
HiLink p6StringQ_qto p6String
|
||||||
HiLink p6StringQ_qqto p6String
|
HiLink p6StringQ_qqto p6String
|
||||||
HiLink p6RxStringSQ p6String
|
HiLink p6RxStringSQ p6String
|
||||||
@@ -1796,6 +1796,7 @@ if version >= 508 || !exists("did_perl6_syntax_inits")
|
|||||||
HiLink p6QuoteQ_q p6Quote
|
HiLink p6QuoteQ_q p6Quote
|
||||||
HiLink p6QuoteQ_qww p6Quote
|
HiLink p6QuoteQ_qww p6Quote
|
||||||
HiLink p6QuoteQ_qq p6Quote
|
HiLink p6QuoteQ_qq p6Quote
|
||||||
|
HiLink p6QuoteQ_to p6Quote
|
||||||
HiLink p6QuoteQ_qto p6Quote
|
HiLink p6QuoteQ_qto p6Quote
|
||||||
HiLink p6QuoteQ_qqto p6Quote
|
HiLink p6QuoteQ_qqto p6Quote
|
||||||
HiLink p6QuoteQ_PIR p6Quote
|
HiLink p6QuoteQ_PIR p6Quote
|
||||||
@@ -1875,8 +1876,8 @@ if version >= 508 || !exists("did_perl6_syntax_inits")
|
|||||||
HiLink p6String String
|
HiLink p6String String
|
||||||
HiLink p6Repeat Repeat
|
HiLink p6Repeat Repeat
|
||||||
HiLink p6Pragma Keyword
|
HiLink p6Pragma Keyword
|
||||||
HiLink p6Module Keyword
|
HiLink p6PreDeclare Keyword
|
||||||
HiLink p6DeclareRoutine Keyword
|
HiLink p6Declare Keyword
|
||||||
HiLink p6DeclareRegex Keyword
|
HiLink p6DeclareRegex Keyword
|
||||||
HiLink p6VarStorage Special
|
HiLink p6VarStorage Special
|
||||||
HiLink p6FlowControl Special
|
HiLink p6FlowControl Special
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ syn match pgsqlKeyword "\<for\_s\+\(search\|order\_s\+by\)\>"
|
|||||||
syn match pgsqlKeyword "\<\(no\_s\+\)\?inherit\>"
|
syn match pgsqlKeyword "\<\(no\_s\+\)\?inherit\>"
|
||||||
syn match pgsqlKeyword "\<\(not\_s\+\)\?of\>"
|
syn match pgsqlKeyword "\<\(not\_s\+\)\?of\>"
|
||||||
syn match pgsqlKeyword "\<primary\_s\+key\>"
|
syn match pgsqlKeyword "\<primary\_s\+key\>"
|
||||||
|
syn match pgsqlKeyword "\<foreign\_s\+key\>"
|
||||||
syn match pgsqlKeyword "\<replica\_s\+identity\>"
|
syn match pgsqlKeyword "\<replica\_s\+identity\>"
|
||||||
syn match pgsqlKeyword "\<using\(\_s\+index\(\_s\+tablespace\)\?\)\?\>"
|
syn match pgsqlKeyword "\<using\(\_s\+index\(\_s\+tablespace\)\?\)\?\>"
|
||||||
syn match pgsqlKeyword "\<with\(out\)\?\_s\+function\>"
|
syn match pgsqlKeyword "\<with\(out\)\?\_s\+function\>"
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ syn cluster pugTop contains=pugBegin,pugComment,pugHtmlComment,pugJavascript
|
|||||||
syn match pugBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=pugTag,pugClassChar,pugIdChar,pugPlainChar,pugJavascript,pugScriptConditional,pugScriptStatement,pugPipedText
|
syn match pugBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=pugTag,pugClassChar,pugIdChar,pugPlainChar,pugJavascript,pugScriptConditional,pugScriptStatement,pugPipedText
|
||||||
syn match pugTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@pugComponent
|
syn match pugTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@pugComponent
|
||||||
syn cluster pugComponent contains=pugAttributes,pugIdChar,pugBlockExpansionChar,pugClassChar,pugPlainChar,pugJavascript,pugTagBlockChar,pugTagInlineText
|
syn cluster pugComponent contains=pugAttributes,pugIdChar,pugBlockExpansionChar,pugClassChar,pugPlainChar,pugJavascript,pugTagBlockChar,pugTagInlineText
|
||||||
syn match pugComment '\s*\/\/.*$'
|
syn match pugComment '\(\s\+\|^\)\/\/.*$'
|
||||||
syn region pugCommentBlock start="\z(\s*\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" keepend
|
syn region pugCommentBlock start="\z(\s\+\|^\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" keepend
|
||||||
syn region pugHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
|
syn region pugHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
|
||||||
syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,pugHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent
|
syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,pugHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent
|
||||||
syn match pugClassChar "\." contained nextgroup=pugClass
|
syn match pugClassChar "\." contained nextgroup=pugClass
|
||||||
|
|||||||
379
syntax/ruby.vim
379
syntax/ruby.vim
@@ -11,16 +11,41 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
|||||||
" Thanks to perl.vim authors, and to Reimer Behrends. :-) (MN)
|
" Thanks to perl.vim authors, and to Reimer Behrends. :-) (MN)
|
||||||
" ----------------------------------------------------------------------------
|
" ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
" Prelude {{{1
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Folding Config {{{1
|
||||||
if has("folding") && exists("ruby_fold")
|
if has("folding") && exists("ruby_fold")
|
||||||
setlocal foldmethod=syntax
|
setlocal foldmethod=syntax
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let s:foldable_groups = split(
|
||||||
|
\ get(
|
||||||
|
\ b:,
|
||||||
|
\ 'ruby_foldable_groups',
|
||||||
|
\ get(g:, 'ruby_foldable_groups', 'ALL')
|
||||||
|
\ )
|
||||||
|
\ )
|
||||||
|
|
||||||
|
function! s:foldable(...) abort
|
||||||
|
if index(s:foldable_groups, 'ALL') > -1
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
for l:i in a:000
|
||||||
|
if index(s:foldable_groups, l:i) > -1
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return 0
|
||||||
|
endfunction " }}}
|
||||||
|
|
||||||
syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo
|
syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo
|
||||||
|
|
||||||
|
" Whitespace Errors {{{1
|
||||||
if exists("ruby_space_errors")
|
if exists("ruby_space_errors")
|
||||||
if !exists("ruby_no_trail_space_error")
|
if !exists("ruby_no_trail_space_error")
|
||||||
syn match rubySpaceError display excludenl "\s\+$"
|
syn match rubySpaceError display excludenl "\s\+$"
|
||||||
@@ -30,14 +55,14 @@ if exists("ruby_space_errors")
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Operators
|
" Operators {{{1
|
||||||
if exists("ruby_operators")
|
if exists("ruby_operators")
|
||||||
syn match rubyOperator "[~!^|*/%+-]\|&\.\@!\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::"
|
syn match rubyOperator "[~!^|*/%+-]\|&\.\@!\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@1<!>\|\*\*\|\.\.\.\|\.\.\|::"
|
||||||
syn match rubyOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!="
|
syn match rubyOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!="
|
||||||
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop
|
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@2<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Expression Substitution and Backslash Notation
|
" Expression Substitution and Backslash Notation {{{1
|
||||||
syn match rubyStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display
|
syn match rubyStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display
|
||||||
syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display
|
syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display
|
||||||
syn match rubyQuoteEscape "\\[\\']" contained display
|
syn match rubyQuoteEscape "\\[\\']" contained display
|
||||||
@@ -47,18 +72,19 @@ syn match rubyInterpolation "#\%(\$\|@@\=\)\w\+" display contained con
|
|||||||
syn match rubyInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained
|
syn match rubyInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained
|
||||||
syn match rubyInterpolation "#\$\%(-\w\|\W\)" display contained contains=rubyInterpolationDelimiter,rubyPredefinedVariable,rubyInvalidVariable
|
syn match rubyInterpolation "#\$\%(-\w\|\W\)" display contained contains=rubyInterpolationDelimiter,rubyPredefinedVariable,rubyInvalidVariable
|
||||||
syn match rubyInterpolationDelimiter "#\ze\$\%(-\w\|\W\)" display contained
|
syn match rubyInterpolationDelimiter "#\ze\$\%(-\w\|\W\)" display contained
|
||||||
syn region rubyNoInterpolation start="\\#{" end="}" contained
|
syn region rubyNoInterpolation start="\\#{" end="}" contained
|
||||||
syn match rubyNoInterpolation "\\#{" display contained
|
syn match rubyNoInterpolation "\\#{" display contained
|
||||||
syn match rubyNoInterpolation "\\#\%(\$\|@@\=\)\w\+" display contained
|
syn match rubyNoInterpolation "\\#\%(\$\|@@\=\)\w\+" display contained
|
||||||
syn match rubyNoInterpolation "\\#\$\W" display contained
|
syn match rubyNoInterpolation "\\#\$\W" display contained
|
||||||
|
|
||||||
syn match rubyDelimEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE
|
syn match rubyDelimiterEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE
|
||||||
|
|
||||||
syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained
|
syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained
|
||||||
syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained
|
syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained
|
||||||
syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained
|
syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained
|
||||||
syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained
|
syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained
|
||||||
|
|
||||||
|
" Regular Expression Metacharacters {{{1
|
||||||
" These are mostly Oniguruma ready
|
" These are mostly Oniguruma ready
|
||||||
syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\)" end=")" contained
|
syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\)" end=")" contained
|
||||||
syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\)" end=")" contained transparent contains=@rubyRegexpSpecial
|
syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\)" end=")" contained transparent contains=@rubyRegexpSpecial
|
||||||
@@ -81,8 +107,8 @@ syn cluster rubyStringSpecial contains=rubyInterpolation,rubyNoInterpolati
|
|||||||
syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets
|
syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets
|
||||||
syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment
|
syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment
|
||||||
|
|
||||||
" Numbers and ASCII Codes
|
" Numbers and ASCII Codes {{{1
|
||||||
syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)"
|
syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@1<!\%(?\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\=\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)\)"
|
||||||
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*r\=i\=\>" display
|
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*r\=i\=\>" display
|
||||||
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)r\=i\=\>" display
|
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)r\=i\=\>" display
|
||||||
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*r\=i\=\>" display
|
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*r\=i\=\>" display
|
||||||
@@ -90,20 +116,26 @@ syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)
|
|||||||
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*r\=i\=\>" display
|
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*r\=i\=\>" display
|
||||||
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)r\=i\=\>" display
|
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)r\=i\=\>" display
|
||||||
|
|
||||||
" Identifiers
|
" Identifiers {{{1
|
||||||
syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
|
syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
|
||||||
syn match rubyBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent
|
syn match rubyBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent
|
||||||
|
|
||||||
syn match rubyConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!"
|
syn match rubyConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!"
|
||||||
syn match rubyClassVariable "@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display
|
syn match rubyClassVariable "@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display
|
||||||
syn match rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display
|
syn match rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display
|
||||||
syn match rubyGlobalVariable "$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)"
|
syn match rubyGlobalVariable "$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)"
|
||||||
syn match rubySymbol "[]})\"':]\@<!:\%(\^\|\~@\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!@\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)"
|
syn match rubySymbol "[]})\"':]\@1<!:\%(\^\|\~@\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!@\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)"
|
||||||
syn match rubySymbol "[]})\"':]\@<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)"
|
syn match rubySymbol "[]})\"':]\@1<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)"
|
||||||
syn match rubySymbol "[]})\"':]\@<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*"
|
syn match rubySymbol "[]})\"':]\@1<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*"
|
||||||
syn match rubySymbol "[]})\"':]\@<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\="
|
syn match rubySymbol "[]})\"':]\@1<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\="
|
||||||
syn region rubySymbol start="[]})\"':]\@<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
|
|
||||||
syn region rubySymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
|
if s:foldable(':')
|
||||||
|
syn region rubySymbol start="[]})\"':]\@1<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
|
||||||
|
syn region rubySymbol start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
|
||||||
|
else
|
||||||
|
syn region rubySymbol start="[]})\"':]\@1<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape
|
||||||
|
syn region rubySymbol start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial
|
||||||
|
endif
|
||||||
|
|
||||||
syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)*\s*(\@="
|
syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)*\s*(\@="
|
||||||
|
|
||||||
@@ -120,96 +152,172 @@ syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOADED_FEATURES\|L
|
|||||||
syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(ARGF\|ARGV\|ENV\|DATA\|FALSE\|NIL\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>\%(\s*(\)\@!"
|
syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(ARGF\|ARGV\|ENV\|DATA\|FALSE\|NIL\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>\%(\s*(\)\@!"
|
||||||
syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(RUBY_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!"
|
syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(RUBY_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!"
|
||||||
|
|
||||||
" Normal Regular Expression
|
" Normal Regular Expression {{{1
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold
|
if s:foldable('/')
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold
|
||||||
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold
|
||||||
|
else
|
||||||
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial
|
||||||
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial
|
||||||
|
endif
|
||||||
|
|
||||||
" Generalized Regular Expression
|
" Generalized Regular Expression {{{1
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold
|
if s:foldable('%')
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape fold
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold
|
||||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z(\s\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold
|
||||||
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z(\s\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold
|
||||||
|
else
|
||||||
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial
|
||||||
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial
|
||||||
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape
|
||||||
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial
|
||||||
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial
|
||||||
|
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z(\s\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial
|
||||||
|
endif
|
||||||
|
|
||||||
" Normal String
|
" Normal String {{{1
|
||||||
let s:spell_cluster = exists('ruby_spellcheck_strings') ? ',@Spell' : ''
|
let s:spell_cluster = exists('ruby_spellcheck_strings') ? ',@Spell' : ''
|
||||||
exe 'syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" fold contains=@rubyStringSpecial' . s:spell_cluster
|
exe 'syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" ' .
|
||||||
exe 'syn region rubyString matchgroup=rubyStringDelimiter start="''" end="''" skip="\\\\\|\\''" fold contains=rubyQuoteEscape' . s:spell_cluster
|
\ (s:foldable('%') ? 'fold' : '') . ' contains=@rubyStringSpecial' . s:spell_cluster
|
||||||
|
exe 'syn region rubyString matchgroup=rubyStringDelimiter start="''" end="''" skip="\\\\\|\\''" ' .
|
||||||
|
\ (s:foldable('%') ? 'fold' : '') . ' contains=rubyQuoteEscape' . s:spell_cluster
|
||||||
|
|
||||||
" Shell Command Output
|
" Shell Command Output {{{1
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold
|
if s:foldable('%')
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold
|
||||||
|
else
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial
|
||||||
|
endif
|
||||||
|
|
||||||
" Generalized Single Quoted String, Symbol and Array of Strings
|
" Generalized Single Quoted String, Symbol and Array of Strings {{{1
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
if s:foldable('%')
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%q\z(\s\)" end="\z1" skip="\\\\\|\\\z1" fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimiterEscape
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%q\z(\s\)" end="\z1" skip="\\\\\|\\\z1" fold
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%s\z(\s\)" end="\z1" skip="\\\\\|\\\z1" fold
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimiterEscape
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%s\z(\s\)" end="\z1" skip="\\\\\|\\\z1" fold
|
||||||
|
else
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1"
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" contains=rubyNestedCurlyBraces,rubyDelimiterEscape
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" contains=rubyNestedAngleBrackets,rubyDelimiterEscape
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" contains=rubyNestedSquareBrackets,rubyDelimiterEscape
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" contains=rubyNestedParentheses,rubyDelimiterEscape
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%q\z(\s\)" end="\z1" skip="\\\\\|\\\z1"
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1"
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" contains=rubyNestedCurlyBraces,rubyDelimiterEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" contains=rubyNestedAngleBrackets,rubyDelimiterEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" contains=rubyNestedSquareBrackets,rubyDelimiterEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" contains=rubyNestedParentheses,rubyDelimiterEscape
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%s\z(\s\)" end="\z1" skip="\\\\\|\\\z1"
|
||||||
|
endif
|
||||||
|
|
||||||
" Generalized Double Quoted String and Array of Strings and Shell Command Output
|
" Generalized Double Quoted String and Array of Strings and Shell Command Output {{{1
|
||||||
" Note: %= is not matched here as the beginning of a double quoted string
|
" Note: %= is not matched here as the beginning of a double quoted string
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
if s:foldable('%')
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape fold
|
||||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx]\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape fold
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx]\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
||||||
|
else
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape
|
||||||
|
syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx]\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial
|
||||||
|
endif
|
||||||
|
|
||||||
" Array of Symbols
|
" Array of Symbols {{{1
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
if s:foldable('%')
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
|
" Array of Symbols
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimiterEscape
|
||||||
|
|
||||||
" Array of interpolated Symbols
|
" Array of interpolated Symbols
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I{" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I{" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape fold
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape fold
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape fold
|
||||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape fold
|
||||||
|
else
|
||||||
|
" Array of Symbols
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1"
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i{" end="}" skip="\\\\\|\\}" contains=rubyNestedCurlyBraces,rubyDelimiterEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i<" end=">" skip="\\\\\|\\>" contains=rubyNestedAngleBrackets,rubyDelimiterEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\[" end="\]" skip="\\\\\|\\\]" contains=rubyNestedSquareBrackets,rubyDelimiterEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i(" end=")" skip="\\\\\|\\)" contains=rubyNestedParentheses,rubyDelimiterEscape
|
||||||
|
|
||||||
" Here Document
|
" Array of interpolated Symbols
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I{" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape
|
||||||
|
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Here Document {{{1
|
||||||
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<[-~]\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<[-~]\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<[-~]\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<[-~]\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<[-~]\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<[-~]\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<[-~]\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<[-~]\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
||||||
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend
|
if s:foldable('<<')
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc fold keepend
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc fold keepend
|
||||||
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend
|
||||||
|
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart fold keepend
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart fold keepend
|
||||||
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial fold keepend
|
||||||
|
else
|
||||||
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend
|
||||||
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend
|
||||||
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc keepend
|
||||||
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial keepend
|
||||||
|
|
||||||
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend
|
||||||
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]"\z([^"]*\)"\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend
|
||||||
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]'\z([^']*\)'\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart keepend
|
||||||
|
syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<[-~]`\z([^`]*\)`\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+3 matchgroup=rubyStringDelimiter end=+^\s*\zs\z1$+ contains=rubyHeredocStart,@rubyStringSpecial keepend
|
||||||
|
endif
|
||||||
|
|
||||||
|
" eRuby Config {{{1
|
||||||
if exists('main_syntax') && main_syntax == 'eruby'
|
if exists('main_syntax') && main_syntax == 'eruby'
|
||||||
let b:ruby_no_expensive = 1
|
let b:ruby_no_expensive = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
" Module, Class, Method and Alias Declarations {{{1
|
||||||
syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable nextgroup=rubyAliasDeclaration2 skipwhite
|
syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable nextgroup=rubyAliasDeclaration2 skipwhite
|
||||||
syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable
|
syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable
|
||||||
syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable
|
syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable
|
||||||
syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator
|
syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator
|
||||||
syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator
|
syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator
|
||||||
syn match rubyFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=rubyMethodDeclaration
|
syn match rubyFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=rubyMethodDeclaration
|
||||||
syn match rubyFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2
|
syn match rubyFunction "\%(\s\|^\)\@1<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2
|
||||||
syn match rubyFunction "\%([[:space:].]\|^\)\@<=\%(\[\]=\=\|\*\*\|[-+!~]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration
|
syn match rubyFunction "\%([[:space:].]\|^\)\@2<=\%(\[\]=\=\|\*\*\|[-+!~]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration
|
||||||
|
|
||||||
syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter
|
syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter
|
||||||
|
|
||||||
" Keywords
|
" Keywords {{{1
|
||||||
" Note: the following keywords have already been defined:
|
" Note: the following keywords have already been defined:
|
||||||
" begin case class def do end for if module unless until while
|
" begin case class def do end for if module unless until while
|
||||||
syn match rubyControl "\<\%(and\|break\|in\|next\|not\|or\|redo\|rescue\|retry\|return\)\>[?!]\@!"
|
syn match rubyControl "\<\%(and\|break\|in\|next\|not\|or\|redo\|rescue\|retry\|return\)\>[?!]\@!"
|
||||||
@@ -219,8 +327,9 @@ syn match rubyBoolean "\<\%(true\|false\)\>[?!]\@!"
|
|||||||
syn match rubyPseudoVariable "\<\%(nil\|self\|__ENCODING__\|__dir__\|__FILE__\|__LINE__\|__callee__\|__method__\)\>[?!]\@!" " TODO: reorganise
|
syn match rubyPseudoVariable "\<\%(nil\|self\|__ENCODING__\|__dir__\|__FILE__\|__LINE__\|__callee__\|__method__\)\>[?!]\@!" " TODO: reorganise
|
||||||
syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>[?!]\@!"
|
syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>[?!]\@!"
|
||||||
|
|
||||||
" Expensive Mode - match 'end' with the appropriate opening keyword for syntax
|
" Expensive Mode {{{1
|
||||||
" based folding and special highlighting of module/class/method definitions
|
" Match 'end' with the appropriate opening keyword for syntax based folding
|
||||||
|
" and special highlighting of module/class/method definitions
|
||||||
if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
|
if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
|
||||||
syn match rubyDefine "\<alias\>" nextgroup=rubyAliasDeclaration skipwhite skipnl
|
syn match rubyDefine "\<alias\>" nextgroup=rubyAliasDeclaration skipwhite skipnl
|
||||||
syn match rubyDefine "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl
|
syn match rubyDefine "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl
|
||||||
@@ -228,23 +337,66 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
|
|||||||
syn match rubyClass "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl
|
syn match rubyClass "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl
|
||||||
syn match rubyModule "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl
|
syn match rubyModule "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl
|
||||||
|
|
||||||
syn region rubyMethodBlock start="\<def\>" matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold
|
if s:foldable('def')
|
||||||
syn region rubyBlock start="\<class\>" matchgroup=rubyClass end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
syn region rubyMethodBlock start="\<def\>" matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||||
syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
else
|
||||||
|
syn region rubyMethodBlock start="\<def\>" matchgroup=rubyDefine end="\%(\<def\_s\+\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:foldable('class')
|
||||||
|
syn region rubyBlock start="\<class\>" matchgroup=rubyClass end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||||
|
else
|
||||||
|
syn region rubyBlock start="\<class\>" matchgroup=rubyClass end="\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:foldable('module')
|
||||||
|
syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||||
|
else
|
||||||
|
syn region rubyBlock start="\<module\>" matchgroup=rubyModule end="\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
|
endif
|
||||||
|
|
||||||
" modifiers
|
" modifiers
|
||||||
syn match rubyConditionalModifier "\<\%(if\|unless\)\>" display
|
syn match rubyLineContinuation "\\$" nextgroup=rubyConditionalModifier,rubyRepeatModifier skipwhite skipnl
|
||||||
syn match rubyRepeatModifier "\<\%(while\|until\)\>" display
|
syn match rubyConditionalModifier "\<\%(if\|unless\)\>"
|
||||||
|
syn match rubyRepeatModifier "\<\%(while\|until\)\>"
|
||||||
|
|
||||||
|
if s:foldable('do')
|
||||||
|
syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||||
|
else
|
||||||
|
syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
|
endif
|
||||||
|
|
||||||
syn region rubyDoBlock matchgroup=rubyControl start="\<do\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
|
||||||
" curly bracket block or hash literal
|
" curly bracket block or hash literal
|
||||||
syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop fold
|
if s:foldable('{')
|
||||||
syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@rubyNotTop fold
|
syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop fold
|
||||||
|
else
|
||||||
|
syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:foldable('[')
|
||||||
|
syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@rubyNotTop fold
|
||||||
|
else
|
||||||
|
syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@rubyNotTop
|
||||||
|
endif
|
||||||
|
|
||||||
" statements without 'do'
|
" statements without 'do'
|
||||||
syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
if s:foldable('begin')
|
||||||
syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||||
syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(\\\n\s*\)\@<!\%(if\|unless\)\>" end="\%(\%(\%(\.\@<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold
|
else
|
||||||
|
syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:foldable('case')
|
||||||
|
syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||||
|
else
|
||||||
|
syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:foldable('if')
|
||||||
|
syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@1<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||||
|
else
|
||||||
|
syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@1<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop
|
||||||
|
endif
|
||||||
|
|
||||||
syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression
|
syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression
|
||||||
syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression
|
syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression
|
||||||
@@ -254,7 +406,12 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
|
|||||||
|
|
||||||
" statements with optional 'do'
|
" statements with optional 'do'
|
||||||
syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop
|
syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop
|
||||||
syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine fold
|
|
||||||
|
if s:foldable('for')
|
||||||
|
syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine fold
|
||||||
|
else
|
||||||
|
syn region rubyRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=rubyRepeat end="\<end\>" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists("ruby_minlines")
|
if !exists("ruby_minlines")
|
||||||
let ruby_minlines = 500
|
let ruby_minlines = 500
|
||||||
@@ -269,7 +426,7 @@ else
|
|||||||
syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!"
|
syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Special Methods
|
" Special Methods {{{1
|
||||||
if !exists("ruby_no_special_methods")
|
if !exists("ruby_no_special_methods")
|
||||||
syn keyword rubyAccess public protected private public_class_method private_class_method public_constant private_constant module_function
|
syn keyword rubyAccess public protected private public_class_method private_class_method public_constant private_constant module_function
|
||||||
" attr is a common variable name
|
" attr is a common variable name
|
||||||
@@ -284,41 +441,36 @@ if !exists("ruby_no_special_methods")
|
|||||||
syn keyword rubyKeyword callcc caller lambda proc
|
syn keyword rubyKeyword callcc caller lambda proc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Comments and Documentation
|
" Comments and Documentation {{{1
|
||||||
syn match rubySharpBang "\%^#!.*" display
|
syn match rubySharpBang "\%^#!.*" display
|
||||||
syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained
|
syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained
|
||||||
syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell
|
syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell
|
||||||
if !exists("ruby_no_comment_fold")
|
if !exists("ruby_no_comment_fold") && s:foldable('#')
|
||||||
syn region rubyMultilineComment start="^\s*#.*\n\%(^\s*#\)\@=" end="^\s*#.*\n\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend
|
syn region rubyMultilineComment start="^\s*#.*\n\%(^\s*#\)\@=" end="^\s*#.*\n\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend
|
||||||
syn region rubyDocumentation start="^=begin\ze\%(\s.*\)\=$" end="^=end\%(\s.*\)\=$" contains=rubySpaceError,rubyTodo,@Spell fold
|
syn region rubyDocumentation start="^=begin\ze\%(\s.*\)\=$" end="^=end\%(\s.*\)\=$" contains=rubySpaceError,rubyTodo,@Spell fold
|
||||||
else
|
else
|
||||||
syn region rubyDocumentation start="^=begin\s*$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell
|
syn region rubyDocumentation start="^=begin\s*$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Keyword Nobbling {{{1
|
||||||
" Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver
|
" Note: this is a hack to prevent 'keywords' being highlighted as such when called as methods with an explicit receiver
|
||||||
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(alias\|and\|begin\|break\|case\|class\|def\|defined\|do\|else\)\>" transparent contains=NONE
|
syn match rubyKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%([_[:lower:]][_[:alnum:]]*\|\<\%(BEGIN\|END\)\>\)" transparent contains=NONE
|
||||||
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(elsif\|end\|ensure\|false\|for\|if\|in\|module\|next\|nil\)\>" transparent contains=NONE
|
syn match rubyKeywordAsMethod "\(defined?\|exit!\)\@!\<[_[:lower:]][_[:alnum:]]*[?!]" transparent contains=NONE
|
||||||
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(not\|or\|redo\|refine\|rescue\|retry\|return\|self\|super\|then\|true\)\>" transparent contains=NONE
|
|
||||||
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(undef\|unless\|until\|when\|while\|yield\|BEGIN\|END\|__FILE__\|__LINE__\)\>" transparent contains=NONE
|
|
||||||
|
|
||||||
syn match rubyKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)[?!]" transparent contains=NONE
|
" More Symbols {{{1
|
||||||
syn match rubyKeywordAsMethod "\<\%(if\|module\|refine\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE
|
syn match rubySymbol "\%([{(,]\_s*\)\zs\l\w*[!?]\=::\@!"he=e-1
|
||||||
|
syn match rubySymbol "[]})\"':]\@1<!\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="he=e-1
|
||||||
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(abort\|at_exit\|attr\|attr_accessor\|attr_reader\)\>" transparent contains=NONE
|
syn match rubySymbol "\%([{(,]\_s*\)\zs[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1
|
||||||
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(attr_writer\|autoload\|callcc\|catch\|caller\)\>" transparent contains=NONE
|
|
||||||
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(eval\|class_eval\|instance_eval\|module_eval\|exit\)\>" transparent contains=NONE
|
|
||||||
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fail\|fork\|include\|lambda\)\>" transparent contains=NONE
|
|
||||||
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(load\|loop\|prepend\|private\|proc\|protected\)\>" transparent contains=NONE
|
|
||||||
syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(public\|require\|require_relative\|raise\|throw\|trap\|using\)\>" transparent contains=NONE
|
|
||||||
|
|
||||||
syn match rubySymbol "\%([{(,]\_s*\)\@<=\l\w*[!?]\=::\@!"he=e-1
|
|
||||||
syn match rubySymbol "[]})\"':]\@<!\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="he=e-1
|
|
||||||
syn match rubySymbol "\%([{(,]\_s*\)\@<=[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1
|
|
||||||
syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="hs=s+1,he=e-1
|
syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="hs=s+1,he=e-1
|
||||||
|
|
||||||
" __END__ Directive
|
" __END__ Directive {{{1
|
||||||
syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold
|
if s:foldable('__END__')
|
||||||
|
syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold
|
||||||
|
else
|
||||||
|
syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$"
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Default Highlighting {{{1
|
||||||
hi def link rubyClass rubyDefine
|
hi def link rubyClass rubyDefine
|
||||||
hi def link rubyModule rubyDefine
|
hi def link rubyModule rubyDefine
|
||||||
hi def link rubyMethodExceptional rubyDefine
|
hi def link rubyMethodExceptional rubyDefine
|
||||||
@@ -389,8 +541,9 @@ hi def link rubyInvalidVariable Error
|
|||||||
hi def link rubyError Error
|
hi def link rubyError Error
|
||||||
hi def link rubySpaceError rubyError
|
hi def link rubySpaceError rubyError
|
||||||
|
|
||||||
|
" Postscript {{{1
|
||||||
let b:current_syntax = "ruby"
|
let b:current_syntax = "ruby"
|
||||||
|
|
||||||
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ hi link scalaKeywordModifier Function
|
|||||||
syn keyword scalaSpecial this true false ne eq
|
syn keyword scalaSpecial this true false ne eq
|
||||||
syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite
|
syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite
|
||||||
syn match scalaSpecial "\%(=>\|⇒\|<-\|←\|->\|→\)"
|
syn match scalaSpecial "\%(=>\|⇒\|<-\|←\|->\|→\)"
|
||||||
syn match scalaSpecial /`[^`]*`/ " Backtick literals
|
syn match scalaSpecial /`[^`]\+`/ " Backtick literals
|
||||||
hi link scalaSpecial PreProc
|
hi link scalaSpecial PreProc
|
||||||
|
|
||||||
syn keyword scalaExternal package import
|
syn keyword scalaExternal package import
|
||||||
@@ -188,8 +188,8 @@ hi link scalaTypeAnnotationParameter Function
|
|||||||
syn match scalaShebang "\%^#!.*" display
|
syn match scalaShebang "\%^#!.*" display
|
||||||
syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaTodo,scalaCommentCodeBlock,@Spell keepend fold
|
syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaTodo,scalaCommentCodeBlock,@Spell keepend fold
|
||||||
syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained
|
syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained
|
||||||
syn match scalaParameterAnnotation "@param" nextgroup=scalaParamAnnotationValue skipwhite contained
|
syn match scalaParameterAnnotation "\%(@tparam\|@param\|@see\)" nextgroup=scalaParamAnnotationValue skipwhite contained
|
||||||
syn match scalaParamAnnotationValue /[`_A-Za-z0-9$]\+/ contained
|
syn match scalaParamAnnotationValue /[.`_A-Za-z0-9$]\+/ contained
|
||||||
syn region scalaDocLinks start="\[\[" end="\]\]" contained
|
syn region scalaDocLinks start="\[\[" end="\]\]" contained
|
||||||
syn region scalaCommentCodeBlock matchgroup=Keyword start="{{{" end="}}}" contained
|
syn region scalaCommentCodeBlock matchgroup=Keyword start="{{{" end="}}}" contained
|
||||||
syn match scalaTodo "\vTODO|FIXME|XXX" contained
|
syn match scalaTodo "\vTODO|FIXME|XXX" contained
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
|
|
||||||
" syntax match javascriptIdentifierName /\<[^=<>!?+\-*\/%|&,;:. ~@#`"'\[\]\(\)\{\}\^0-9][^=<>!?+\-*\/%|&,;:. ~@#`"'\[\]\(\)\{\}\^]*/ nextgroup=javascriptDotNotation,javascriptFuncCallArg,javascriptComputedProperty,javascriptWSymbols contains=@_smantic
|
|
||||||
|
|
||||||
syntax cluster _semantic contains=_semantic0,_semantic1,_semantic2,_semantic3,_semantic4,_semantic5,_semantic6,_semantic7,_semantic8,_semantic9,_semantic10,_semantic11,_semantic12,_semantic13,_semantic14,_semantic15,_semantic16,_semantic17,_semantic18,_semantic19,_semantic20,_semantic21,_semantic22,_semantic23,_semantic24,_semantic25
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -68,6 +68,12 @@ syn region slimInterpolation matchgroup=slimInterpolationDelimiter start="#{" en
|
|||||||
syn region slimInterpolation matchgroup=slimInterpolationDelimiter start="#{{" end="}}" contains=@hamlRubyTop containedin=javascriptStringS,javascriptStringD,slimWrappedAttrs
|
syn region slimInterpolation matchgroup=slimInterpolationDelimiter start="#{{" end="}}" contains=@hamlRubyTop containedin=javascriptStringS,javascriptStringD,slimWrappedAttrs
|
||||||
syn match slimInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
|
syn match slimInterpolationEscape "\\\@<!\%(\\\\\)*\\\%(\\\ze#{\|#\ze{\)"
|
||||||
|
|
||||||
|
syn region slimPlainFilter matchgroup=slimFilter start="^\z(\s*\)\%(rdoc\|textile\|markdown\|wiki\):\s*$" end="^\%(\z1 \| *$\)\@!"
|
||||||
|
syn region slimJavascriptFilter matchgroup=slimFilter start="^\z(\s*\)javascript:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlJavaScript,slimInterpolation keepend
|
||||||
|
syn region slimCoffeeFilter matchgroup=slimFilter start="^\z(\s*\)coffee:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@coffeeAll,slimInterpolation keepend
|
||||||
|
syn region slimCSSFilter matchgroup=slimFilter start="^\z(\s*\)css:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@htmlCss,slimInterpolation keepend
|
||||||
|
syn region slimSassFilter matchgroup=slimFilter start="^\z(\s*\)sass:\s*$" end="^\%(\z1 \| *$\)\@!" contains=@hamlSassTop
|
||||||
|
|
||||||
syn region slimRuby matchgroup=slimRubyOutputChar start="\s*[=]\==[']\=" skip="\%\(,\s*\|\\\)$" end="$" contained contains=@slimRubyTop keepend
|
syn region slimRuby matchgroup=slimRubyOutputChar start="\s*[=]\==[']\=" skip="\%\(,\s*\|\\\)$" end="$" contained contains=@slimRubyTop keepend
|
||||||
syn region slimRuby matchgroup=slimRubyChar start="\s*-" skip="\%\(,\s*\|\\\)$" end="$" contained contains=@slimRubyTop keepend
|
syn region slimRuby matchgroup=slimRubyChar start="\s*-" skip="\%\(,\s*\|\\\)$" end="$" contained contains=@slimRubyTop keepend
|
||||||
|
|
||||||
@@ -100,6 +106,7 @@ hi def link slimTodo Todo
|
|||||||
hi def link slimWrappedAttrValueDelimiter Delimiter
|
hi def link slimWrappedAttrValueDelimiter Delimiter
|
||||||
hi def link slimWrappedAttrsDelimiter Delimiter
|
hi def link slimWrappedAttrsDelimiter Delimiter
|
||||||
hi def link slimInlineTagChar Delimiter
|
hi def link slimInlineTagChar Delimiter
|
||||||
|
hi def link slimFilter PreProc
|
||||||
|
|
||||||
let b:current_syntax = "slim"
|
let b:current_syntax = "slim"
|
||||||
|
|
||||||
|
|||||||
@@ -64,9 +64,9 @@ syntax match swiftNumber "\v<\d+>"
|
|||||||
syntax match swiftNumber "\v<(\d+_+)+\d+(\.\d+(_+\d+)*)?>"
|
syntax match swiftNumber "\v<(\d+_+)+\d+(\.\d+(_+\d+)*)?>"
|
||||||
syntax match swiftNumber "\v<\d+\.\d+>"
|
syntax match swiftNumber "\v<\d+\.\d+>"
|
||||||
syntax match swiftNumber "\v<\d*\.?\d+([Ee]-?)?\d+>"
|
syntax match swiftNumber "\v<\d*\.?\d+([Ee]-?)?\d+>"
|
||||||
syntax match swiftNumber "\v<0x\x+([Pp]-?)?\x+>"
|
syntax match swiftNumber "\v<0x[[:xdigit:]_]+([Pp]-?)?\x+>"
|
||||||
syntax match swiftNumber "\v<0b[01]+>"
|
syntax match swiftNumber "\v<0b[01_]+>"
|
||||||
syntax match swiftNumber "\v<0o\o+>"
|
syntax match swiftNumber "\v<0o[0-7_]+>"
|
||||||
|
|
||||||
" BOOLs
|
" BOOLs
|
||||||
syntax keyword swiftBoolean
|
syntax keyword swiftBoolean
|
||||||
@@ -121,6 +121,7 @@ syntax keyword swiftKeywords
|
|||||||
\ else
|
\ else
|
||||||
\ extension
|
\ extension
|
||||||
\ fallthrough
|
\ fallthrough
|
||||||
|
\ fileprivate
|
||||||
\ final
|
\ final
|
||||||
\ for
|
\ for
|
||||||
\ func
|
\ func
|
||||||
|
|||||||
138
syntax/tmux.vim
138
syntax/tmux.vim
@@ -33,15 +33,16 @@ syn keyword tmuxAction any current none
|
|||||||
syn keyword tmuxBoolean off on
|
syn keyword tmuxBoolean off on
|
||||||
|
|
||||||
syn keyword tmuxCmds
|
syn keyword tmuxCmds
|
||||||
\ attach[-session]
|
\ attach
|
||||||
\ bind[-key]
|
\ attach-session
|
||||||
|
\ bind
|
||||||
|
\ bind-key
|
||||||
\ break-pane
|
\ break-pane
|
||||||
\ breakp
|
\ breakp
|
||||||
\ capture-pane
|
\ capture-pane
|
||||||
\ capturep
|
\ capturep
|
||||||
\ choose-buffer
|
\ choose-buffer
|
||||||
\ choose-client
|
\ choose-client
|
||||||
\ choose-list
|
|
||||||
\ choose-session
|
\ choose-session
|
||||||
\ choose-tree
|
\ choose-tree
|
||||||
\ choose-window
|
\ choose-window
|
||||||
@@ -49,124 +50,149 @@ syn keyword tmuxCmds
|
|||||||
\ clearhist
|
\ clearhist
|
||||||
\ clock-mode
|
\ clock-mode
|
||||||
\ command-prompt
|
\ command-prompt
|
||||||
\ confirm[-before]
|
\ confirm
|
||||||
|
\ confirm-before
|
||||||
\ copy-mode
|
\ copy-mode
|
||||||
\ delete-buffer
|
\ delete-buffer
|
||||||
\ deleteb
|
\ deleteb
|
||||||
\ detach[-client]
|
\ detach
|
||||||
\ display[-message]
|
\ detach-client
|
||||||
|
\ display
|
||||||
|
\ display-message
|
||||||
\ display-panes
|
\ display-panes
|
||||||
\ displayp
|
\ displayp
|
||||||
\ find-window
|
\ find-window
|
||||||
\ findw
|
\ findw
|
||||||
\ has[-session]
|
\ has
|
||||||
\ if[-shell]
|
\ has-session
|
||||||
|
\ if
|
||||||
|
\ if-shell
|
||||||
|
\ info
|
||||||
\ join-pane
|
\ join-pane
|
||||||
\ joinp
|
\ joinp
|
||||||
\ kill-pane
|
\ kill-pane
|
||||||
\ killp
|
|
||||||
\ kill-server
|
\ kill-server
|
||||||
\ kill-session
|
\ kill-session
|
||||||
\ kill-window
|
\ kill-window
|
||||||
|
\ killp
|
||||||
\ killw
|
\ killw
|
||||||
|
\ last
|
||||||
\ last-pane
|
\ last-pane
|
||||||
|
\ last-window
|
||||||
\ lastp
|
\ lastp
|
||||||
\ last[-window]
|
|
||||||
\ link-window
|
\ link-window
|
||||||
\ linkw
|
\ linkw
|
||||||
\ list-buffers
|
\ list-buffers
|
||||||
\ lsb
|
|
||||||
\ list-clients
|
\ list-clients
|
||||||
\ lsc
|
|
||||||
\ list-commands
|
\ list-commands
|
||||||
\ lscm
|
|
||||||
\ list-keys
|
\ list-keys
|
||||||
\ lsk
|
|
||||||
\ list-panes
|
\ list-panes
|
||||||
\ lsp
|
|
||||||
\ list-sessions
|
\ list-sessions
|
||||||
\ ls
|
|
||||||
\ list-windows
|
\ list-windows
|
||||||
\ lsw
|
|
||||||
\ load-buffer
|
\ load-buffer
|
||||||
\ loadb
|
\ loadb
|
||||||
|
\ lock
|
||||||
\ lock-client
|
\ lock-client
|
||||||
\ lockc
|
\ lock-server
|
||||||
\ lock[-server]
|
|
||||||
\ lock-session
|
\ lock-session
|
||||||
|
\ lockc
|
||||||
\ locks
|
\ locks
|
||||||
|
\ ls
|
||||||
|
\ lsb
|
||||||
|
\ lsc
|
||||||
|
\ lscm
|
||||||
|
\ lsk
|
||||||
|
\ lsp
|
||||||
|
\ lsw
|
||||||
\ move-pane
|
\ move-pane
|
||||||
\ movep
|
|
||||||
\ move-window
|
\ move-window
|
||||||
|
\ movep
|
||||||
\ movew
|
\ movew
|
||||||
\ new[-session]
|
\ new
|
||||||
|
\ new-session
|
||||||
|
\ new-window
|
||||||
|
\ neww
|
||||||
|
\ next
|
||||||
\ next-layout
|
\ next-layout
|
||||||
|
\ next-window
|
||||||
\ nextl
|
\ nextl
|
||||||
\ next[-window]
|
|
||||||
\ paste-buffer
|
\ paste-buffer
|
||||||
\ pasteb
|
\ pasteb
|
||||||
|
\ path
|
||||||
\ pipe-pane
|
\ pipe-pane
|
||||||
\ pipep
|
\ pipep
|
||||||
|
\ prev
|
||||||
\ previous-layout
|
\ previous-layout
|
||||||
|
\ previous-window
|
||||||
\ prevl
|
\ prevl
|
||||||
\ prev[ious-window]
|
\ refresh
|
||||||
\ refresh[-client]
|
\ refresh-client
|
||||||
\ rename[-session]
|
\ rename
|
||||||
|
\ rename-session
|
||||||
\ rename-window
|
\ rename-window
|
||||||
\ renamew
|
\ renamew
|
||||||
\ resize-pane
|
\ resize-pane
|
||||||
\ resizep
|
\ resizep
|
||||||
\ respawn-pane
|
\ respawn-pane
|
||||||
\ respawnp
|
|
||||||
\ respawn-window
|
\ respawn-window
|
||||||
|
\ respawnp
|
||||||
\ respawnw
|
\ respawnw
|
||||||
\ rotate-window
|
\ rotate-window
|
||||||
\ rotatew
|
\ rotatew
|
||||||
\ run[-shell]
|
\ run
|
||||||
|
\ run-shell
|
||||||
\ save-buffer
|
\ save-buffer
|
||||||
\ saveb
|
\ saveb
|
||||||
\ select-layout
|
\ select-layout
|
||||||
\ selectl
|
|
||||||
\ select-pane
|
\ select-pane
|
||||||
\ selectp
|
|
||||||
\ select-window
|
\ select-window
|
||||||
|
\ selectl
|
||||||
|
\ selectp
|
||||||
\ selectw
|
\ selectw
|
||||||
\ send[-keys]
|
\ send
|
||||||
|
\ send-keys
|
||||||
\ send-prefix
|
\ send-prefix
|
||||||
\ server-info
|
\ server-info
|
||||||
\ info
|
\ set
|
||||||
\ set-buffer
|
\ set-buffer
|
||||||
\ setb
|
|
||||||
\ set-environment
|
\ set-environment
|
||||||
\ setenv
|
\ set-hook
|
||||||
\ set[-option]
|
\ set-option
|
||||||
\ set-window-option
|
\ set-window-option
|
||||||
|
\ setb
|
||||||
|
\ setenv
|
||||||
\ setw
|
\ setw
|
||||||
|
\ show
|
||||||
\ show-buffer
|
\ show-buffer
|
||||||
\ showb
|
|
||||||
\ show-environment
|
\ show-environment
|
||||||
\ showenv
|
\ show-hooks
|
||||||
\ show-messages
|
\ show-messages
|
||||||
\ showmsgs
|
\ show-options
|
||||||
\ show[-options]
|
|
||||||
\ show-window-options
|
\ show-window-options
|
||||||
|
\ showb
|
||||||
|
\ showenv
|
||||||
|
\ showmsgs
|
||||||
\ showw
|
\ showw
|
||||||
\ source[-file]
|
\ source
|
||||||
|
\ source-file
|
||||||
\ split-window
|
\ split-window
|
||||||
\ splitw
|
\ splitw
|
||||||
\ start[-server]
|
\ start
|
||||||
|
\ start-server
|
||||||
\ suspend-client
|
\ suspend-client
|
||||||
\ suspendc
|
\ suspendc
|
||||||
\ swap-pane
|
\ swap-pane
|
||||||
\ swapp
|
|
||||||
\ swap-window
|
\ swap-window
|
||||||
|
\ swapp
|
||||||
\ swapw
|
\ swapw
|
||||||
\ switch-client
|
\ switch-client
|
||||||
\ switchc
|
\ switchc
|
||||||
\ unbind[-key]
|
\ unbind
|
||||||
|
\ unbind-key
|
||||||
\ unlink-window
|
\ unlink-window
|
||||||
\ unlinkw
|
\ unlinkw
|
||||||
\ wait[-for]
|
\ wait
|
||||||
|
\ wait-for
|
||||||
|
|
||||||
syn keyword tmuxOptsSet
|
syn keyword tmuxOptsSet
|
||||||
\ assume-paste-time
|
\ assume-paste-time
|
||||||
@@ -186,19 +212,14 @@ syn keyword tmuxOptsSet
|
|||||||
\ escape-time
|
\ escape-time
|
||||||
\ exit-unattached
|
\ exit-unattached
|
||||||
\ focus-events
|
\ focus-events
|
||||||
|
\ history-file
|
||||||
\ history-limit
|
\ history-limit
|
||||||
\ lock-after-time
|
\ lock-after-time
|
||||||
\ lock-command
|
\ lock-command
|
||||||
\ lock-server
|
|
||||||
\ message-command-style
|
\ message-command-style
|
||||||
\ message-limit
|
\ message-limit
|
||||||
\ message-style
|
\ message-style
|
||||||
\ mouse-resize-pane
|
\ mouse
|
||||||
\ mouse-select-pane
|
|
||||||
\ mouse-select-window
|
|
||||||
\ mouse-utf8
|
|
||||||
\ pane-active-border-style
|
|
||||||
\ pane-border-style
|
|
||||||
\ prefix
|
\ prefix
|
||||||
\ prefix2
|
\ prefix2
|
||||||
\ quiet
|
\ quiet
|
||||||
@@ -218,8 +239,8 @@ syn keyword tmuxOptsSet
|
|||||||
\ status-position
|
\ status-position
|
||||||
\ status-right
|
\ status-right
|
||||||
\ status-right-length
|
\ status-right-length
|
||||||
\ status-utf8
|
\ status-right-style
|
||||||
\ staus-right-style
|
\ status-style
|
||||||
\ terminal-overrides
|
\ terminal-overrides
|
||||||
\ update-environment
|
\ update-environment
|
||||||
\ visual-activity
|
\ visual-activity
|
||||||
@@ -232,8 +253,7 @@ syn keyword tmuxOptsSetw
|
|||||||
\ allow-rename
|
\ allow-rename
|
||||||
\ alternate-screen
|
\ alternate-screen
|
||||||
\ automatic-rename
|
\ automatic-rename
|
||||||
\ c0-change-interval
|
\ automatic-rename-format
|
||||||
\ c0-change-trigger
|
|
||||||
\ clock-mode-colour
|
\ clock-mode-colour
|
||||||
\ clock-mode-style
|
\ clock-mode-style
|
||||||
\ force-height
|
\ force-height
|
||||||
@@ -241,16 +261,17 @@ syn keyword tmuxOptsSetw
|
|||||||
\ main-pane-height
|
\ main-pane-height
|
||||||
\ main-pane-width
|
\ main-pane-width
|
||||||
\ mode-keys
|
\ mode-keys
|
||||||
\ mode-mouse
|
|
||||||
\ mode-style
|
\ mode-style
|
||||||
\ monitor-activity
|
\ monitor-activity
|
||||||
\ monitor-silence
|
\ monitor-silence
|
||||||
\ other-pane-height
|
\ other-pane-height
|
||||||
\ other-pane-width
|
\ other-pane-width
|
||||||
|
\ pane-active-border-style
|
||||||
\ pane-base-index
|
\ pane-base-index
|
||||||
|
\ pane-border-style
|
||||||
\ remain-on-exit
|
\ remain-on-exit
|
||||||
\ synchronize-panes
|
\ synchronize-panes
|
||||||
\ utf8
|
\ window-active-style
|
||||||
\ window-status-activity-style
|
\ window-status-activity-style
|
||||||
\ window-status-bell-style
|
\ window-status-bell-style
|
||||||
\ window-status-current-format
|
\ window-status-current-format
|
||||||
@@ -259,6 +280,7 @@ syn keyword tmuxOptsSetw
|
|||||||
\ window-status-last-style
|
\ window-status-last-style
|
||||||
\ window-status-separator
|
\ window-status-separator
|
||||||
\ window-status-style
|
\ window-status-style
|
||||||
|
\ window-style
|
||||||
\ wrap-search
|
\ wrap-search
|
||||||
\ xterm-keys
|
\ xterm-keys
|
||||||
|
|
||||||
@@ -270,7 +292,9 @@ syn match tmuxOptions /\s-\a\+/ display
|
|||||||
syn match tmuxVariable /\w\+=/ display
|
syn match tmuxVariable /\w\+=/ display
|
||||||
syn match tmuxVariableExpansion /\${\=\w\+}\=/ display
|
syn match tmuxVariableExpansion /\${\=\w\+}\=/ display
|
||||||
|
|
||||||
syn region tmuxComment start=/#/ end=/$/ contains=tmuxTodo display oneline
|
" Comments can span multiple lines, when the newline is escaped
|
||||||
|
" (with a single) backslash at the end.
|
||||||
|
syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo
|
||||||
syn region tmuxString start=/"/ end=/"/ display oneline
|
syn region tmuxString start=/"/ end=/"/ display oneline
|
||||||
syn region tmuxString start=/'/ end=/'/ display oneline
|
syn region tmuxString start=/'/ end=/'/ display oneline
|
||||||
|
|
||||||
|
|||||||
@@ -61,9 +61,12 @@ syntax case match
|
|||||||
syn match typescriptSpecial "\\\d\d\d\|\\."
|
syn match typescriptSpecial "\\\d\d\d\|\\."
|
||||||
syn region typescriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=typescriptSpecial,@htmlPreproc extend
|
syn region typescriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=typescriptSpecial,@htmlPreproc extend
|
||||||
syn region typescriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=typescriptSpecial,@htmlPreproc extend
|
syn region typescriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=typescriptSpecial,@htmlPreproc extend
|
||||||
syn region typescriptStringB start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=typescriptSpecial,@htmlPreproc extend
|
syn region typescriptStringB start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=typescriptInterpolation,typescriptSpecial,@htmlPreproc extend
|
||||||
|
|
||||||
|
syn region typescriptInterpolation matchgroup=typescriptInterpolationDelimiter
|
||||||
|
\ start=/${/ end=/}/ contained
|
||||||
|
\ contains=@typescriptExpression
|
||||||
|
|
||||||
syn match typescriptSpecialCharacter "'\\.'"
|
|
||||||
syn match typescriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
|
syn match typescriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
|
||||||
syn region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
|
syn region typescriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
|
||||||
" syntax match typescriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\."
|
" syntax match typescriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\."
|
||||||
@@ -114,14 +117,14 @@ syntax keyword typescriptDeprecated escape unescape all applets alinkColor bgCol
|
|||||||
syntax keyword typescriptConditional if else switch
|
syntax keyword typescriptConditional if else switch
|
||||||
syntax keyword typescriptRepeat do while for in of
|
syntax keyword typescriptRepeat do while for in of
|
||||||
syntax keyword typescriptBranch break continue yield await
|
syntax keyword typescriptBranch break continue yield await
|
||||||
syntax keyword typescriptLabel case default async
|
syntax keyword typescriptLabel case default async readonly
|
||||||
syntax keyword typescriptStatement return with
|
syntax keyword typescriptStatement return with
|
||||||
|
|
||||||
syntax keyword typescriptGlobalObjects Array Boolean Date Function Infinity Math Number NaN Object Packages RegExp String netscape
|
syntax keyword typescriptGlobalObjects Array Boolean Date Function Infinity Math Number NaN Object Packages RegExp String Symbol netscape
|
||||||
|
|
||||||
syntax keyword typescriptExceptions try catch throw finally Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
|
syntax keyword typescriptExceptions try catch throw finally Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
|
||||||
|
|
||||||
syntax keyword typescriptReserved constructor declare as interface module abstract enum int short export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public type namespace from
|
syntax keyword typescriptReserved constructor declare as interface module abstract enum int short export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public type namespace from get set
|
||||||
"}}}
|
"}}}
|
||||||
"" typescript/DOM/HTML/CSS specified things"{{{
|
"" typescript/DOM/HTML/CSS specified things"{{{
|
||||||
|
|
||||||
@@ -131,7 +134,7 @@ syntax keyword typescriptReserved constructor declare as interface module abstra
|
|||||||
syn match typescriptParameters "([a-zA-Z0-9_?.$][\w?.$]*)\s*:\s*([a-zA-Z0-9_?.$][\w?.$]*)" contained skipwhite
|
syn match typescriptParameters "([a-zA-Z0-9_?.$][\w?.$]*)\s*:\s*([a-zA-Z0-9_?.$][\w?.$]*)" contained skipwhite
|
||||||
"}}}
|
"}}}
|
||||||
" DOM2 Objects"{{{
|
" DOM2 Objects"{{{
|
||||||
syntax keyword typescriptType DOMImplementation DocumentFragment Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction void any string boolean number
|
syntax keyword typescriptType DOMImplementation DocumentFragment Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction void any string boolean number symbol never
|
||||||
syntax keyword typescriptExceptions DOMException
|
syntax keyword typescriptExceptions DOMException
|
||||||
"}}}
|
"}}}
|
||||||
" DOM2 CONSTANT"{{{
|
" DOM2 CONSTANT"{{{
|
||||||
@@ -249,6 +252,7 @@ if version >= 508 || !exists("did_typescript_syn_inits")
|
|||||||
HiLink typescriptStringS String
|
HiLink typescriptStringS String
|
||||||
HiLink typescriptStringD String
|
HiLink typescriptStringD String
|
||||||
HiLink typescriptStringB String
|
HiLink typescriptStringB String
|
||||||
|
HiLink typescriptInterpolationDelimiter Delimiter
|
||||||
HiLink typescriptRegexpString String
|
HiLink typescriptRegexpString String
|
||||||
HiLink typescriptGlobal Constant
|
HiLink typescriptGlobal Constant
|
||||||
HiLink typescriptCharacter Character
|
HiLink typescriptCharacter Character
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||||
|
|
||||||
if exists("b:current_syntax")
|
if exists("b:current_syntax")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let b:current_syntax = "vimgo"
|
let b:current_syntax = "vimgo"
|
||||||
@@ -12,4 +12,6 @@ syn region goTitle start="\%1l" end=":"
|
|||||||
hi def link goInterface Type
|
hi def link goInterface Type
|
||||||
hi def link goTitle Label
|
hi def link goTitle Label
|
||||||
|
|
||||||
|
" vim: sw=2 ts=2 et
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal Intl
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal Array nextgroup=javascriptGlobalArrayDot,javascriptFuncCallArg
|
|
||||||
syntax match javascriptGlobalArrayDot /\./ contained nextgroup=javascriptArrayStaticMethod
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal Date nextgroup=javascriptGlobalDateDot,javascriptFuncCallArg
|
|
||||||
syntax match javascriptGlobalDateDot /\./ contained nextgroup=javascriptDateStaticMethod
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal Function
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal JSON nextgroup=javascriptGlobalJSONDot,javascriptFuncCallArg
|
|
||||||
syntax match javascriptGlobalJSONDot /\./ contained nextgroup=javascriptJSONStaticMethod
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal Map WeakMap
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal Math nextgroup=javascriptGlobalMathDot,javascriptFuncCallArg
|
|
||||||
syntax match javascriptGlobalMathDot /\./ contained nextgroup=javascriptMathStaticProp,javascriptMathStaticMethod
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal Number nextgroup=javascriptGlobalNumberDot,javascriptFuncCallArg
|
|
||||||
syntax match javascriptGlobalNumberDot /\./ contained nextgroup=javascriptNumberStaticProp,javascriptNumberStaticMethod
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal Object nextgroup=javascriptGlobalObjectDot,javascriptFuncCallArg
|
|
||||||
syntax match javascriptGlobalObjectDot /\./ contained nextgroup=javascriptObjectStaticMethod
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal Promise nextgroup=javascriptGlobalPromiseDot,javascriptFuncCallArg
|
|
||||||
syntax match javascriptGlobalPromiseDot /\./ contained nextgroup=javascriptPromiseStaticMethod
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal Proxy
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal RegExp nextgroup=javascriptGlobalRegExpDot,javascriptFuncCallArg
|
|
||||||
syntax match javascriptGlobalRegExpDot /\./ contained nextgroup=javascriptRegExpStaticProp
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal Set WeakSet
|
|
||||||
|
|
||||||
endif
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
||||||
|
|
||||||
syntax keyword javascriptGlobal String nextgroup=javascriptGlobalStringDot,javascriptFuncCallArg
|
|
||||||
syntax match javascriptGlobalStringDot /\./ contained nextgroup=javascriptStringStaticMethod
|
|
||||||
|
|
||||||
endif
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user