mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8a0fb37bf | ||
|
|
13fe6ad758 | ||
|
|
78427e4c22 | ||
|
|
829ab22723 | ||
|
|
a8d08c8a49 | ||
|
|
7679a92627 | ||
|
|
ad44c4f7a3 | ||
|
|
3c56c1c7cd | ||
|
|
d4e83d706f | ||
|
|
c47dc02849 | ||
|
|
841cb535df | ||
|
|
e5b26a7308 | ||
|
|
b4b054ebf5 | ||
|
|
08ea94e011 | ||
|
|
ba7a783c7f | ||
|
|
f58692a641 | ||
|
|
0dc7696c89 | ||
|
|
5658b62b7a | ||
|
|
938a2f1667 | ||
|
|
303b3f1b43 | ||
|
|
bf84973173 | ||
|
|
89728a486d | ||
|
|
ae3a0d72cc | ||
|
|
3475a2df67 | ||
|
|
ac42e00864 | ||
|
|
0293cf8346 | ||
|
|
8c139a4546 | ||
|
|
47a036761a | ||
|
|
d2c90dad0a | ||
|
|
7ac92eac0f | ||
|
|
7800dae776 | ||
|
|
a39c9013cc | ||
|
|
25d2786cae | ||
|
|
1f1e821192 | ||
|
|
ae882e85f8 | ||
|
|
aec5e42bdb | ||
|
|
a0c79360ed | ||
|
|
2d3b20bc68 | ||
|
|
a6b0efd530 | ||
|
|
0de043adbc |
@@ -1,7 +1,11 @@
|
||||
language: ruby
|
||||
rvm:
|
||||
- 1.9.3
|
||||
before_install: sudo apt-get install vim-gtk
|
||||
sudo: false
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- vim-gtk
|
||||
before_script:
|
||||
- "export DISPLAY=:99.0"
|
||||
- "sh -e /etc/init.d/xvfb start"
|
||||
|
||||
55
README.md
55
README.md
@@ -8,7 +8,7 @@ A collection of language packs for Vim.
|
||||
> One to rule them all, one to find them, one to bring them all and in the darkness bind them.
|
||||
|
||||
- It **won't affect your startup time**, as scripts are loaded only on demand\*.
|
||||
- It **installs 50+ times faster** than 50+ packages it consist of.
|
||||
- It **installs and updates 70+ times faster** than 70+ packages it consist of.
|
||||
- Solid syntax and indentation support. Only the best language packs.
|
||||
- All unnecessary files are ignored (like enormous documentation from php support).
|
||||
- No support for esoteric languages, only most popular ones (modern too, like `slim`).
|
||||
@@ -18,79 +18,92 @@ A collection of language packs for Vim.
|
||||
|
||||
## Installation
|
||||
|
||||
1. Install pathogen, Vundle or NeoBundle package manager.
|
||||
1. Install [Pathogen](https://github.com/tpope/vim-pathogen), [Vundle](https://github.com/VundleVim/Vundle.vim), [NeoBundle](https://github.com/Shougo/neobundle.vim), or [Plug](https://github.com/junegunn/vim-plug) package manager for Vim.
|
||||
2. Use this repository as submodule or package.
|
||||
|
||||
Optionally download one of the [releases](https://github.com/sheerun/vim-polyglot/releases) and unpack it directly under `~/.vim` directory.
|
||||
|
||||
## Language packs
|
||||
|
||||
- [ansible](https://github.com/pearofducks/ansible-vim) (syntax, indent, ftplugin, ftdetect)
|
||||
- [arduino](https://github.com/sudar/vim-arduino-syntax) (syntax, indent, ftdetect)
|
||||
- [blade](https://github.com/xsbeats/vim-blade) (syntax, indent, ftdetect)
|
||||
- [blade](https://github.com/jwalton512/vim-blade) (syntax, indent, ftdetect)
|
||||
- [c++11](https://github.com/octol/vim-cpp-enhanced-highlight) (syntax)
|
||||
- [c/c++](https://github.com/vim-jp/cpp-vim) (syntax)
|
||||
- [c/c++](https://github.com/vim-jp/vim-cpp) (syntax)
|
||||
- [cjsx](https://github.com/mtscout6/vim-cjsx) (ftdetect, syntax, ftplugin)
|
||||
- [clojure](https://github.com/guns/vim-clojure-static) (syntax, indent, autoload, ftplugin, ftdetect)
|
||||
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||
- [cjsx](https://github.com/mtscout6/vim-cjsx) (ftdetect, syntax, ftplugin)
|
||||
- [cql](https://github.com/elubow/cql-vim) (syntax, ftdetect)
|
||||
- [css](https://github.com/JulesWang/css.vim) (syntax)
|
||||
- [cucumber](https://github.com/tpope/vim-cucumber) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||
- [dart](https://github.com/dart-lang/dart-vim-plugin) (syntax, indent, autoload, ftplugin, ftdetect)
|
||||
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, 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)
|
||||
- [emberscript](https://github.com/heartsentwined/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
|
||||
- [emblem](https://github.com/heartsentwined/vim-emblem) (syntax, indent, ftplugin, ftdetect)
|
||||
- [erlang](https://github.com/hcs42/vim-erlang-runtime) (syntax, indent)
|
||||
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent, ftdetect)
|
||||
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
|
||||
- [go](https://github.com/fatih/vim-go) (syntax, indent, ftdetect)
|
||||
- [glsl](https://github.com/tikhomirov/vim-glsl) (syntax, indent, ftdetect)
|
||||
- [go](https://github.com/fatih/vim-go) (syntax, compiler, indent, ftdetect)
|
||||
- [groovy](https://github.com/vim-scripts/groovy.vim) (syntax)
|
||||
- [haml](https://github.com/tpope/vim-haml) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, ftplugin, ftdetect)
|
||||
- [haskell](https://github.com/raichoo/haskell-vim) (syntax, indent, ftplugin, ftdetect)
|
||||
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (syntax, indent, ftplugin, ftdetect)
|
||||
- [haskell](https://github.com/neovimhaskell/haskell-vim) (syntax, indent, ftplugin, ftdetect)
|
||||
- [haxe](https://github.com/yaymukund/vim-haxe) (syntax, ftdetect)
|
||||
- [html5](https://github.com/othree/html5.vim) (syntax, indent, autoload, ftplugin)
|
||||
- [jade](https://github.com/digitaltoad/vim-jade) (syntax, indent, ftplugin, ftdetect)
|
||||
- [jasmine](https://github.com/glanotte/vim-jasmine) (syntax, ftdetect)
|
||||
- [javascript](https://github.com/sheerun/yajs.vim) (syntax, indent)
|
||||
- [julia](https://github.com/dcjones/julia-minimalist-vim) (syntax, indent, ftdetect)
|
||||
- [jinja](https://github.com/Glench/Vim-Jinja2-Syntax) (syntax, indent, ftdetect)
|
||||
- [json](https://github.com/sheerun/vim-json) (syntax, indent, ftdetect)
|
||||
- [jst](https://github.com/briancollins/vim-jst) (syntax, indent, ftdetect)
|
||||
- [jsx](https://github.com/mxw/vim-jsx) (after)
|
||||
- [jsx](https://github.com/mxw/vim-jsx) (ftdetect, after)
|
||||
- [julia](https://github.com/dcjones/julia-minimalist-vim) (syntax, indent, ftdetect)
|
||||
- [kotlin](https://github.com/udalov/kotlin-vim) (syntax, indent, ftdetect)
|
||||
- [latex](https://github.com/LaTeX-Box-Team/LaTeX-Box) (syntax, indent, ftplugin)
|
||||
- [less](https://github.com/groenewege/vim-less) (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)
|
||||
- [nginx](https://github.com/mutewinter/nginx.vim) (syntax, ftdetect)
|
||||
- [nginx](https://github.com/nginx/nginx) (syntax, indent, ftdetect)
|
||||
- [nix](https://github.com/spwhitt/vim-nix) (syntax, ftplugin, ftdetect)
|
||||
- [objc](https://github.com/b4winckler/vim-objc) (ftplugin, syntax, indent)
|
||||
- [ocaml](https://github.com/jrk/vim-ocaml) (syntax, indent, ftplugin)
|
||||
- [octave](https://github.com/vim-scripts/octave.vim--) (syntax)
|
||||
- [opencl](https://github.com/petRUShka/vim-opencl) (syntax, indent, ftplugin, ftdetect)
|
||||
- [perl](https://github.com/vim-perl/vim-perl) (syntax, indent, ftplugin, ftdetect)
|
||||
- [php](https://github.com/StanAngeloff/php.vim) (syntax)
|
||||
- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, ftplugin, ftdetect)
|
||||
- [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect)
|
||||
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect)
|
||||
- [puppet](https://github.com/rodjek/vim-puppet) (syntax, indent, ftplugin, ftdetect)
|
||||
- [python](https://github.com/mitsuhiko/vim-python-combined) (syntax, indent)
|
||||
- [qml](https://github.com/peterhoeg/vim-qml) (syntax, indent, ftplugin, ftdetect)
|
||||
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
|
||||
- [ragel](https://github.com/jneen/ragel.vim) (syntax)
|
||||
- [rspec](https://github.com/sheerun/rspec.vim) (syntax, ftdetect)
|
||||
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
|
||||
- [rust](https://github.com/wting/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)
|
||||
- [scala](https://github.com/derekwyatt/vim-scala) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||
- [slim](https://github.com/slim-template/vim-slim) (syntax, indent, ftdetect)
|
||||
- [solidity](https://github.com/ethereum/vim-solidity) (syntax, indent, ftdetect)
|
||||
- [stylus](https://github.com/wavded/vim-stylus) (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)
|
||||
- [swift](https://github.com/toyamarinyon/vim-swift) (syntax, indent, ftdetect)
|
||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
|
||||
- [tmux](https://github.com/tejr/vim-tmux) (syntax, ftdetect)
|
||||
- [tomdoc](https://github.com/duwanis/tomdoc.vim) (syntax)
|
||||
- [typescript](https://github.com/leafgarland/typescript-vim) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
|
||||
- [tmux](https://github.com/tejr/vim-tmux) (syntax, ftdetect)
|
||||
- [tomdoc](https://github.com/wellbredgrapefruit/tomdoc.vim) (syntax)
|
||||
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect)
|
||||
- [twig](https://github.com/beyondwords/vim-twig) (syntax, ftplugin, ftdetect)
|
||||
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
||||
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
||||
- [typescript](https://github.com/leafgarland/typescript-vim) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||
- [vala](https://github.com/tkztmk/vim-vala) (syntax, indent, ftdetect)
|
||||
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (syntax)
|
||||
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (syntax, ftdetect)
|
||||
- [vm](https://github.com/lepture/vim-velocity) (syntax, indent, ftdetect)
|
||||
- [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax)
|
||||
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)
|
||||
- [yard](https://github.com/sheerun/vim-yardoc) (syntax)
|
||||
|
||||
## Disabling a language pack
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vim ftdetect file
|
||||
"
|
||||
" Language: JSX (JavaScript)
|
||||
" Maintainer: Max Wang <mxawng@gmail.com>
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
exec 'source '.fnameescape(expand('<sfile>:p:h:h').'/jsx-config.vim')
|
||||
|
||||
fu! <SID>EnableJSX()
|
||||
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
|
||||
return 1
|
||||
endfu
|
||||
|
||||
autocmd BufNewFile,BufRead *.jsx let b:jsx_ext_found = 1
|
||||
autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx
|
||||
autocmd BufNewFile,BufRead *.js
|
||||
\ if <SID>EnableJSX() | set filetype=javascript.jsx | endif
|
||||
|
||||
endif
|
||||
11
after/ftplugin/yaml.vim
Normal file
11
after/ftplugin/yaml.vim
Normal file
@@ -0,0 +1,11 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: Yaml
|
||||
" Author: Henrique Barcelos
|
||||
" Date: 2014-10-08
|
||||
" URL: https://github.com/hjpbarcelos
|
||||
setlocal autoindent sw=2 ts=2 expandtab
|
||||
" vim:set sw=2:
|
||||
|
||||
endif
|
||||
@@ -9,13 +9,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" Do nothing if we don't find the @jsx pragma (and we care).
|
||||
exec 'source '.fnameescape(expand('<sfile>:p:h:h').'/jsx-config.vim')
|
||||
if g:jsx_pragma_required && !b:jsx_pragma_found | finish | endif
|
||||
|
||||
" Do nothing if we don't have the .jsx extension (and we care).
|
||||
if g:jsx_ext_required && !exists('b:jsx_ext_found') | finish | endif
|
||||
|
||||
" Prologue; load in XML indentation.
|
||||
if exists('b:did_indent')
|
||||
let s:did_indent=b:did_indent
|
||||
|
||||
97
after/indent/objc.vim
Normal file
97
after/indent/objc.vim
Normal file
@@ -0,0 +1,97 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'objc') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: Objective-C
|
||||
" Maintainer: Bjorn Winckler <bjorn.winckler@gmail.com>
|
||||
" Last Change: 2012 Jan 01
|
||||
|
||||
" Ensure 'cpo' is set to Vim default values and restore later
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
"if exists("b:did_indent")
|
||||
" finish
|
||||
"endif
|
||||
"let b:did_indent = 1
|
||||
"setlocal cindent
|
||||
|
||||
setl indentkeys=0{,0},:,0#,!^F,o,O,e,<:>
|
||||
|
||||
setlocal indentexpr=GetObjCIndentImproved()
|
||||
|
||||
" Top level statements which should not be indented, and which should not
|
||||
" cause next (non-blank) line to be indented either.
|
||||
let s:topLev = '^\s*@\%(class\|end\|implementation\|interface\|protocol\|\)\>'
|
||||
|
||||
function! GetObjCIndentImproved()
|
||||
" NOTE: Ignore leading white space to avoid having to deal with space vs.
|
||||
" tab issues. Rely on the indent() function instead.
|
||||
let thisLine = substitute(getline(v:lnum), '^\s*', '', '')
|
||||
|
||||
if thisLine =~# s:topLev || getline(prevnonblank(v:lnum - 1)) =~# s:topLev
|
||||
return 0
|
||||
endif
|
||||
|
||||
" If current line looks like an argument to a message dispatch, then line
|
||||
" up colon with previous line. This will indent the second line so that
|
||||
" the colons line up in
|
||||
"
|
||||
" [obj firstParameter:value
|
||||
" paramB:value2];
|
||||
"
|
||||
" but it will not line up colons in
|
||||
"
|
||||
" if ([obj something:here])
|
||||
" [obj other:here];
|
||||
"
|
||||
let thisColon = match(thisLine, '^\s*\K\k*\zs:')
|
||||
if thisColon > 0
|
||||
let prevLine = substitute(getline(v:lnum - 1), '^\s*', '', '')
|
||||
let prevColon = match(prevLine, ':')
|
||||
if prevColon > 0
|
||||
" Try to align colons, always making sure line is indented at least
|
||||
" one shiftwidth more than the indentation at the beginning of the
|
||||
" message. Avoids situations like this:
|
||||
"
|
||||
" if ([obj a:x
|
||||
" aLongParameter:y])
|
||||
"
|
||||
let [lnum,lcol] = searchpairpos('\[', '', '\]', 'b', 0,
|
||||
\ max([1, v:lnum - 10]))
|
||||
let minInd = &sw + (lnum > 0 ? indent(lnum) : 0)
|
||||
let alignedInd = indent(v:lnum - 1) + prevColon - thisColon
|
||||
return alignedInd > minInd ? alignedInd : minInd
|
||||
endif
|
||||
endif
|
||||
|
||||
let prevLnum = v:lnum - 1
|
||||
let ind = indent(prevLnum)
|
||||
|
||||
" Indent one shiftwidth after opening block, e.g.:
|
||||
"
|
||||
" call_func_with_block(param, ^{
|
||||
" do_stuff();
|
||||
" });
|
||||
"
|
||||
let blockPat = '\^\s*\(([^)]*)\)\?\s*{$'
|
||||
if thisLine =~ '^}'
|
||||
norm '^%'
|
||||
if getline(".") =~ blockPat
|
||||
return indent(".")
|
||||
endif
|
||||
endif
|
||||
|
||||
if getline(prevLnum) =~ blockPat
|
||||
return ind + &sw
|
||||
endif
|
||||
|
||||
return cindent(v:lnum)
|
||||
endfunction
|
||||
|
||||
|
||||
" Restore 'cpo' options
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
endif
|
||||
@@ -1,37 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Vimscript file
|
||||
"
|
||||
" Set up a bunch of configuration variables.
|
||||
"
|
||||
" Also check (if desired) whether or not the @jsx pragma is correctly included
|
||||
" in '%'. Set the result in b:jsx_pragma_found.
|
||||
"
|
||||
" Language: JSX (JavaScript)
|
||||
" Maintainer: Max Wang <mxawng@gmail.com>
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" Only check once.
|
||||
if exists('b:jsx_pragma_found')
|
||||
finish
|
||||
endif
|
||||
|
||||
" Whether the .jsx extension is required to enable JSX syntax/indent.
|
||||
if !exists('g:jsx_ext_required')
|
||||
let g:jsx_ext_required = 1
|
||||
endif
|
||||
|
||||
" Whether the @jsx pragma is required to enable JSX syntax/indent.
|
||||
if !exists('g:jsx_pragma_required')
|
||||
let g:jsx_pragma_required = 0
|
||||
endif
|
||||
if !g:jsx_pragma_required | finish | endif
|
||||
|
||||
" Look for the @jsx pragma. It must be included in a docblock comment before
|
||||
" anything else in the file (except whitespace).
|
||||
let s:jsx_pragma_pattern = '\%^\_s*\/\*\*\%(\_.\%(\*\/\)\@!\)*@jsx\_.\{-}\*\/'
|
||||
let b:jsx_pragma_found = search(s:jsx_pragma_pattern, 'npw')
|
||||
|
||||
endif
|
||||
@@ -65,7 +65,7 @@ syn cluster cppSTLgroup contains=cppSTLfunction,cppSTLfunctional,cppSTLconst
|
||||
" -----------------------------------------------------------------------------
|
||||
" Standard library types and functions.
|
||||
"
|
||||
" Mainly based on the excellent STL Syntax vim script by
|
||||
" Mainly based on the excellent STL Syntax vim script by
|
||||
" Mizuchi <ytj000@gmail.com>
|
||||
" http://www.vim.org/scripts/script.php?script_id=4293
|
||||
" which in turn is based on the scripts
|
||||
@@ -1324,6 +1324,31 @@ if !exists("cpp_no_cpp14")
|
||||
"dynarray
|
||||
syntax keyword cppSTLtype dynarray
|
||||
|
||||
"helper type traits types
|
||||
syntax keyword cppSTLtype remove_cv_t
|
||||
syntax keyword cppSTLtype remove_const_t
|
||||
syntax keyword cppSTLtype remove_volatile_t
|
||||
syntax keyword cppSTLtype add_cv_t
|
||||
syntax keyword cppSTLtype add_const_t
|
||||
syntax keyword cppSTLtype add_volatile_t
|
||||
syntax keyword cppSTLtype remove_reference_t
|
||||
syntax keyword cppSTLtype add_lvalue_reference_t
|
||||
syntax keyword cppSTLtype add_rvalue_reference_t
|
||||
syntax keyword cppSTLtype remove_pointer_t
|
||||
syntax keyword cppSTLtype add_pointer_t
|
||||
syntax keyword cppSTLtype remove_extent_t
|
||||
syntax keyword cppSTLtype remove_all_extents_t
|
||||
syntax keyword cppSTLtype make_signed_t
|
||||
syntax keyword cppSTLtype make_unsigned_t
|
||||
syntax keyword cppSTLtype aligned_storage_t
|
||||
syntax keyword cppSTLtype aligned_union_t
|
||||
syntax keyword cppSTLtype decay_t
|
||||
syntax keyword cppSTLtype enable_if_t
|
||||
syntax keyword cppSTLtype conditional_t
|
||||
syntax keyword cppSTLtype common_type_t
|
||||
syntax keyword cppSTLtype underlying_type_t
|
||||
syntax keyword cppSTLtype result_of_t
|
||||
|
||||
"thread
|
||||
syntax keyword cppSTLtype shared_mutex
|
||||
syntax keyword cppSTLtype shared_lock
|
||||
@@ -1362,7 +1387,7 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
|
||||
HiLink cppSTLenum Typedef
|
||||
HiLink cppSTLios Function
|
||||
HiLink cppSTLcast Statement " be consistent with official syntax
|
||||
HiLink cppRawString String
|
||||
HiLink cppRawString String
|
||||
HiLink cppRawDelimiter Delimiter
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
@@ -12,6 +12,19 @@ syn region coffeeScript start=#<script [^>]*type="text/coffeescript"[^>]*>#
|
||||
\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc
|
||||
\ containedin=htmlHead
|
||||
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
|
||||
|
||||
" Language: OpenGL Shading Language
|
||||
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
|
||||
|
||||
syn include @GLSL syntax/glsl.vim
|
||||
syn region ShaderScript
|
||||
\ start="<script [^>]*type=\('\|\"\)x-shader/x-\(vertex\|fragment\)\('\|\"\)[^>]*>"
|
||||
\ keepend
|
||||
\ end="</script>"me=s-1
|
||||
\ contains=@GLSL,htmlScriptTag,@htmlPreproc
|
||||
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
|
||||
|
||||
|
||||
@@ -11,13 +11,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" Do nothing if we don't find the @jsx pragma (and we care).
|
||||
exec 'source '.fnameescape(expand('<sfile>:p:h:h').'/jsx-config.vim')
|
||||
if g:jsx_pragma_required && !b:jsx_pragma_found | finish | endif
|
||||
|
||||
" Do nothing if we don't have the .jsx extension (and we care).
|
||||
if g:jsx_ext_required && !exists('b:jsx_ext_found') | finish | endif
|
||||
|
||||
" Prologue; load in XML syntax.
|
||||
if exists('b:current_syntax')
|
||||
let s:current_syntax=b:current_syntax
|
||||
@@ -28,9 +21,24 @@ if exists('s:current_syntax')
|
||||
let b:current_syntax=s:current_syntax
|
||||
endif
|
||||
|
||||
" Officially, vim-jsx depends on the pangloss/vim-javascript syntax package
|
||||
" (and is tested against it exclusively). However, in practice, we make some
|
||||
" effort towards compatibility with other packages.
|
||||
"
|
||||
" These are the plugin-to-syntax-element correspondences:
|
||||
"
|
||||
" - pangloss/vim-javascript: jsBlock, jsExpression
|
||||
" - jelera/vim-javascript-syntax: javascriptBlock
|
||||
" - othree/yajs.vim: javascriptNoReserved
|
||||
|
||||
|
||||
" Highlight JSX regions as XML; recursively match.
|
||||
"
|
||||
" Note that we prohibit JSX tags from having a < or word character immediately
|
||||
" preceding it, to avoid conflicts with, respectively, the left shift operator
|
||||
" and generic Flow type annotations (http://flowtype.org/).
|
||||
syn region jsxRegion contains=@XMLSyntax,jsxRegion,jsBlock,javascriptBlock
|
||||
\ start=+<\@<!<\z([a-zA-Z][a-zA-Z0-9:\-.]*\)+
|
||||
\ start=+\%(<\|\w\)\@<!<\z([a-zA-Z][a-zA-Z0-9:\-.]*\)+
|
||||
\ skip=+<!--\_.\{-}-->+
|
||||
\ end=+</\z1\_\s\{-}>+
|
||||
\ end=+/>+
|
||||
@@ -44,4 +52,7 @@ syn region xmlString contained start=+{+ end=++ contains=jsBlock,javascriptBlock
|
||||
" Add jsxRegion to the lowest-level JS syntax cluster.
|
||||
syn cluster jsExpression add=jsxRegion
|
||||
|
||||
" Allow jsxRegion to contain reserved words.
|
||||
syn cluster javascriptNoReserved add=jsxRegion
|
||||
|
||||
endif
|
||||
|
||||
23
after/syntax/objc.vim
Normal file
23
after/syntax/objc.vim
Normal file
@@ -0,0 +1,23 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'objc') == -1
|
||||
|
||||
" ARC type modifiers
|
||||
syn keyword objcTypeModifier __bridge __bridge_retained __bridge_transfer __autoreleasing __strong __weak __unsafe_unretained
|
||||
|
||||
" Block modifiers
|
||||
syn keyword objcTypeModifier __block
|
||||
|
||||
" Remote messaging modifiers
|
||||
syn keyword objcTypeModifier byref
|
||||
|
||||
" Property keywords - these are only highlighted inside '@property (...)'
|
||||
syn keyword objcPropertyAttribute contained getter setter readwrite readonly strong weak copy assign retain nonatomic
|
||||
syn match objcProperty display "^\s*@property\>\s*([^)]*)" contains=objcPropertyAttribute
|
||||
|
||||
" The @property directive must be defined after objcProperty or it won't be
|
||||
" highlighted
|
||||
syn match objcDirective "@property\|@synthesize\|@dynamic\|@package"
|
||||
|
||||
" Highlight property attributes as if they were type modifiers
|
||||
hi def link objcPropertyAttribute objcTypeModifier
|
||||
|
||||
endif
|
||||
@@ -1,11 +1,11 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
if !exists('g:rust_conceal') || !has('conceal') || &enc != 'utf-8'
|
||||
if !exists('g:rust_conceal') || g:rust_conceal == 0 || !has('conceal') || &enc != 'utf-8'
|
||||
finish
|
||||
endif
|
||||
|
||||
" For those who don't want to see `::`...
|
||||
if exists('g:rust_conceal_mod_path')
|
||||
if exists('g:rust_conceal_mod_path') && g:rust_conceal_mod_path != 0
|
||||
syn match rustNiceOperator "::" conceal cchar=ㆍ
|
||||
endif
|
||||
|
||||
@@ -20,7 +20,7 @@ syn match rustNiceOperator "=>" contains=rustFatRightArrowHead,rustFatRightArrow
|
||||
syn match rustNiceOperator /\<\@!_\(_*\>\)\@=/ conceal cchar=′
|
||||
|
||||
" For those who don't want to see `pub`...
|
||||
if exists('g:rust_conceal_pub')
|
||||
if exists('g:rust_conceal_pub') && g:rust_conceal_pub != 0
|
||||
syn match rustPublicSigil contained "pu" conceal cchar=*
|
||||
syn match rustPublicRest contained "b" conceal cchar=
|
||||
syn match rustNiceOperator "pub " contains=rustPublicSigil,rustPublicRest
|
||||
@@ -28,7 +28,7 @@ endif
|
||||
|
||||
hi link rustNiceOperator Operator
|
||||
|
||||
if !exists('g:rust_conceal_mod_path')
|
||||
if !exists('g:rust_conceal_mod_path') && g:rust_conceal_mod_path != 0
|
||||
hi! link Conceal Operator
|
||||
endif
|
||||
|
||||
|
||||
64
after/syntax/yaml.vim
Normal file
64
after/syntax/yaml.vim
Normal file
@@ -0,0 +1,64 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'yaml') == -1
|
||||
|
||||
" To make this file do stuff, add something like the following (without the
|
||||
" leading ") to your ~/.vimrc:
|
||||
" au BufNewFile,BufRead *.yaml,*.yml so ~/src/PyYaml/YAML.vim
|
||||
|
||||
" Vim syntax/macro file
|
||||
" Language: YAML
|
||||
" Author: Igor Vergeichik <iverg@mail.ru>
|
||||
" Sponsor: Tom Sawyer <transami@transami.net>
|
||||
" Stayven: Ryan King <jking@panoptic.com>
|
||||
" Copyright (c) 2002 Tom Saywer
|
||||
|
||||
" Add an item to a gangly list:
|
||||
"map , o<bs><bs><bs><bs>-<esc>o
|
||||
" Convert to Canonical form:
|
||||
"map \c :%!python -c 'from yaml.redump import redump; import sys; print redump(sys.stdin.read()).rstrip()'
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
endif
|
||||
syntax clear
|
||||
|
||||
syn match yamlDelimiter "[:,-]"
|
||||
syn match yamlBlock "[\[\]\{\}\|\>]"
|
||||
syn match yamlOperator "[?^+-]\|=>"
|
||||
|
||||
syn region yamlComment start="\#" end="$"
|
||||
syn match yamlIndicator "#YAML:\S\+"
|
||||
|
||||
syn region yamlString start="'" end="'" skip="\\'"
|
||||
syn region yamlString start='"' end='"' skip='\\"' contains=yamlEscape
|
||||
syn match yamlEscape +\\[abfnrtv'"\\]+ contained
|
||||
syn match yamlEscape "\\\o\o\=\o\=" contained
|
||||
syn match yamlEscape "\\x\x\+" contained
|
||||
|
||||
syn match yamlType "!\S\+"
|
||||
|
||||
syn keyword yamlConstant NULL Null null NONE None none NIL Nil nil
|
||||
syn keyword yamlConstant TRUE True true YES Yes yes ON On on
|
||||
syn keyword yamlConstant FALSE False false NO No no OFF Off off
|
||||
|
||||
syn match yamlKey "\w\+\ze\s*:"
|
||||
syn match yamlAnchor "&\S\+"
|
||||
syn match yamlAlias "*\S\+"
|
||||
|
||||
" Setupt the hilighting links
|
||||
|
||||
hi link yamlConstant Keyword
|
||||
hi link yamlIndicator PreCondit
|
||||
hi link yamlAnchor Function
|
||||
hi link yamlAlias Function
|
||||
hi link yamlKey Identifier
|
||||
hi link yamlType Type
|
||||
|
||||
hi link yamlComment Comment
|
||||
hi link yamlBlock Operator
|
||||
hi link yamlOperator Operator
|
||||
hi link yamlDelimiter Delimiter
|
||||
hi link yamlString String
|
||||
hi link yamlEscape Special
|
||||
|
||||
|
||||
endif
|
||||
70
autoload/dart.vim
Normal file
70
autoload/dart.vim
Normal file
@@ -0,0 +1,70 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
|
||||
|
||||
|
||||
function! s:error(text) abort
|
||||
echohl Error
|
||||
echomsg printf('[dart-vim-plugin] %s', a:text)
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
function! s:cexpr(errorformat, joined_lines) abort
|
||||
let temp_errorfomat = &errorformat
|
||||
try
|
||||
let &errorformat = a:errorformat
|
||||
cexpr a:joined_lines
|
||||
copen
|
||||
finally
|
||||
let &errorformat = temp_errorfomat
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! dart#fmt(q_args) abort
|
||||
if executable('dartfmt')
|
||||
let path = expand('%:p:gs:\:/:')
|
||||
if filereadable(path)
|
||||
let joined_lines = system(printf('dartfmt %s %s', a:q_args, shellescape(path)))
|
||||
if 0 == v:shell_error
|
||||
silent % delete _
|
||||
silent put=joined_lines
|
||||
silent 1 delete _
|
||||
else
|
||||
call s:cexpr('line %l\, column %c of %f: %m', joined_lines)
|
||||
endif
|
||||
else
|
||||
call s:error(printf('cannot read a file: "%s"', path))
|
||||
endif
|
||||
else
|
||||
call s:error('cannot execute binary file: dartfmt')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! dart#analyzer(q_args) abort
|
||||
if executable('dartanalyzer')
|
||||
let path = expand('%:p:gs:\:/:')
|
||||
if filereadable(path)
|
||||
let joined_lines = system(printf('dartanalyzer %s %s', a:q_args, shellescape(path)))
|
||||
call s:cexpr('%m (%f\, line %l\, col %c)', joined_lines)
|
||||
else
|
||||
call s:error(printf('cannot read a file: "%s"', path))
|
||||
endif
|
||||
else
|
||||
call s:error('cannot execute binary file: dartanalyzer')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! dart#tojs(q_args) abort
|
||||
if executable('dart2js')
|
||||
let path = expand('%:p:gs:\:/:')
|
||||
if filereadable(path)
|
||||
let joined_lines = system(printf('dart2js %s %s', a:q_args, shellescape(path)))
|
||||
call s:cexpr('%m (%f\, line %l\, col %c)', joined_lines)
|
||||
else
|
||||
call s:error(printf('cannot read a file: "%s"', path))
|
||||
endif
|
||||
else
|
||||
call s:error('cannot execute binary file: dartanalyzer')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
endif
|
||||
12
autoload/elm/io.vim
Normal file
12
autoload/elm/io.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
|
||||
|
||||
" System IO
|
||||
|
||||
" Craft a system command and run it, returning the output.
|
||||
function! elm#io#system(program, args)
|
||||
let cmd ="which " . a:program . " && " . a:program . " " . a:args
|
||||
return system(cmd)
|
||||
endfunction
|
||||
|
||||
|
||||
endif
|
||||
@@ -36,72 +36,74 @@ endfunction
|
||||
" Run {{{1
|
||||
|
||||
function! rust#Run(bang, args)
|
||||
let args = s:ShellTokenize(a:args)
|
||||
if a:bang
|
||||
let idx = index(a:args, '--')
|
||||
let idx = index(l:args, '--')
|
||||
if idx != -1
|
||||
let rustc_args = idx == 0 ? [] : a:args[:idx-1]
|
||||
let args = a:args[idx+1:]
|
||||
let rustc_args = idx == 0 ? [] : l:args[:idx-1]
|
||||
let args = l:args[idx+1:]
|
||||
else
|
||||
let rustc_args = a:args
|
||||
let rustc_args = l:args
|
||||
let args = []
|
||||
endif
|
||||
else
|
||||
let rustc_args = []
|
||||
let args = a:args
|
||||
endif
|
||||
|
||||
let b:rust_last_rustc_args = rustc_args
|
||||
let b:rust_last_args = args
|
||||
let b:rust_last_rustc_args = l:rustc_args
|
||||
let b:rust_last_args = l:args
|
||||
|
||||
call s:WithPath(function("s:Run"), rustc_args, args)
|
||||
endfunction
|
||||
|
||||
function! s:Run(path, rustc_args, args)
|
||||
try
|
||||
let exepath = tempname()
|
||||
if has('win32')
|
||||
let exepath .= '.exe'
|
||||
endif
|
||||
function! s:Run(dict, rustc_args, args)
|
||||
let exepath = a:dict.tmpdir.'/'.fnamemodify(a:dict.path, ':t:r')
|
||||
if has('win32')
|
||||
let exepath .= '.exe'
|
||||
endif
|
||||
|
||||
let rustc_args = [a:path, '-o', exepath] + a:rustc_args
|
||||
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||
let rustc_args = [relpath, '-o', exepath] + a:rustc_args
|
||||
|
||||
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
|
||||
let output = system(shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)')))
|
||||
if output != ''
|
||||
echohl WarningMsg
|
||||
echo output
|
||||
echohl None
|
||||
endif
|
||||
if !v:shell_error
|
||||
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
|
||||
endif
|
||||
finally
|
||||
if exists("exepath")
|
||||
silent! call delete(exepath)
|
||||
endif
|
||||
endtry
|
||||
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||
let output = s:system(pwd, shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)')))
|
||||
if output != ''
|
||||
echohl WarningMsg
|
||||
echo output
|
||||
echohl None
|
||||
endif
|
||||
if !v:shell_error
|
||||
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Expand {{{1
|
||||
|
||||
function! rust#Expand(bang, args)
|
||||
if a:bang && !empty(a:args)
|
||||
let pretty = a:args[0]
|
||||
let args = a:args[1:]
|
||||
let args = s:ShellTokenize(a:args)
|
||||
if a:bang && !empty(l:args)
|
||||
let pretty = remove(l:args, 0)
|
||||
else
|
||||
let pretty = "expanded"
|
||||
let args = a:args
|
||||
endif
|
||||
call s:WithPath(function("s:Expand"), pretty, args)
|
||||
endfunction
|
||||
|
||||
function! s:Expand(path, pretty, args)
|
||||
function! s:Expand(dict, pretty, args)
|
||||
try
|
||||
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
|
||||
let args = [a:path, '--pretty', a:pretty] + a:args
|
||||
let output = system(shellescape(rustc) . " " . join(map(args, "shellescape(v:val)")))
|
||||
if a:pretty =~? '^\%(everybody_loops$\|flowgraph=\)'
|
||||
let flag = '--xpretty'
|
||||
else
|
||||
let flag = '--pretty'
|
||||
endif
|
||||
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||
let args = [relpath, '-Z', 'unstable-options', l:flag, a:pretty] + a:args
|
||||
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
|
||||
if v:shell_error
|
||||
echohl WarningMsg
|
||||
echo output
|
||||
@@ -115,6 +117,20 @@ function! s:Expand(path, pretty, args)
|
||||
setl buftype=nofile
|
||||
setl bufhidden=hide
|
||||
setl noswapfile
|
||||
" give the buffer a nice name
|
||||
let suffix = 1
|
||||
let basename = fnamemodify(a:dict.path, ':t:r')
|
||||
while 1
|
||||
let bufname = basename
|
||||
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
|
||||
let bufname .= '.pretty.rs'
|
||||
if bufexists(bufname)
|
||||
let suffix += 1
|
||||
continue
|
||||
endif
|
||||
exe 'silent noautocmd keepalt file' fnameescape(bufname)
|
||||
break
|
||||
endwhile
|
||||
endif
|
||||
endtry
|
||||
endfunction
|
||||
@@ -122,7 +138,7 @@ endfunction
|
||||
function! rust#CompleteExpand(lead, line, pos)
|
||||
if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$'
|
||||
" first argument and it has a !
|
||||
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph="]
|
||||
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph=", "everybody_loops"]
|
||||
if !empty(a:lead)
|
||||
call filter(list, "v:val[:len(a:lead)-1] == a:lead")
|
||||
endif
|
||||
@@ -135,72 +151,120 @@ endfunction
|
||||
" Emit {{{1
|
||||
|
||||
function! rust#Emit(type, args)
|
||||
call s:WithPath(function("s:Emit"), a:type, a:args)
|
||||
let args = s:ShellTokenize(a:args)
|
||||
call s:WithPath(function("s:Emit"), a:type, args)
|
||||
endfunction
|
||||
|
||||
function! s:Emit(path, type, args)
|
||||
function! s:Emit(dict, type, args)
|
||||
try
|
||||
let output_path = a:dict.tmpdir.'/output'
|
||||
|
||||
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
|
||||
let args = [a:path, '--emit', a:type, '-o', '-'] + a:args
|
||||
let output = system(shellescape(rustc) . " " . join(map(args, "shellescape(v:val)")))
|
||||
if v:shell_error
|
||||
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||
let args = [relpath, '--emit', a:type, '-o', output_path] + a:args
|
||||
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
|
||||
if output != ''
|
||||
echohl WarningMsg
|
||||
echo output
|
||||
echohl None
|
||||
else
|
||||
endif
|
||||
if !v:shell_error
|
||||
new
|
||||
silent put =output
|
||||
exe 'silent keepalt read' fnameescape(output_path)
|
||||
1
|
||||
d
|
||||
if a:type == "ir"
|
||||
if a:type == "llvm-ir"
|
||||
setl filetype=llvm
|
||||
let extension = 'll'
|
||||
elseif a:type == "asm"
|
||||
setl filetype=asm
|
||||
let extension = 's'
|
||||
endif
|
||||
setl buftype=nofile
|
||||
setl bufhidden=hide
|
||||
setl noswapfile
|
||||
if exists('l:extension')
|
||||
" give the buffer a nice name
|
||||
let suffix = 1
|
||||
let basename = fnamemodify(a:dict.path, ':t:r')
|
||||
while 1
|
||||
let bufname = basename
|
||||
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
|
||||
let bufname .= '.'.extension
|
||||
if bufexists(bufname)
|
||||
let suffix += 1
|
||||
continue
|
||||
endif
|
||||
exe 'silent noautocmd keepalt file' fnameescape(bufname)
|
||||
break
|
||||
endwhile
|
||||
endif
|
||||
endif
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" Utility functions {{{1
|
||||
|
||||
" Invokes func(dict, ...)
|
||||
" Where {dict} is a dictionary with the following keys:
|
||||
" 'path' - The path to the file
|
||||
" 'tmpdir' - The path to a temporary directory that will be deleted when the
|
||||
" function returns.
|
||||
" 'istemp' - 1 if the path is a file inside of {dict.tmpdir} or 0 otherwise.
|
||||
" If {istemp} is 1 then an additional key is provided:
|
||||
" 'tmpdir_relpath' - The {path} relative to the {tmpdir}.
|
||||
"
|
||||
" {dict.path} may be a path to a file inside of {dict.tmpdir} or it may be the
|
||||
" existing path of the current buffer. If the path is inside of {dict.tmpdir}
|
||||
" then it is guaranteed to have a '.rs' extension.
|
||||
function! s:WithPath(func, ...)
|
||||
let buf = bufnr('')
|
||||
let saved = {}
|
||||
let dict = {}
|
||||
try
|
||||
let save_write = &write
|
||||
let saved.write = &write
|
||||
set write
|
||||
let path = expand('%')
|
||||
let pathisempty = empty(path)
|
||||
if pathisempty || !save_write
|
||||
" use a temporary file named 'unnamed.rs' inside a temporary
|
||||
" directory. This produces better error messages
|
||||
let tmpdir = tempname()
|
||||
call mkdir(tmpdir)
|
||||
let dict.path = expand('%')
|
||||
let pathisempty = empty(dict.path)
|
||||
|
||||
let save_cwd = getcwd()
|
||||
silent exe 'lcd' fnameescape(tmpdir)
|
||||
" Always create a tmpdir in case the wrapped command wants it
|
||||
let dict.tmpdir = tempname()
|
||||
call mkdir(dict.tmpdir)
|
||||
|
||||
let path = 'unnamed.rs'
|
||||
if pathisempty || !saved.write
|
||||
let dict.istemp = 1
|
||||
" if we're doing this because of nowrite, preserve the filename
|
||||
if !pathisempty
|
||||
let filename = expand('%:t:r').".rs"
|
||||
else
|
||||
let filename = 'unnamed.rs'
|
||||
endif
|
||||
let dict.tmpdir_relpath = filename
|
||||
let dict.path = dict.tmpdir.'/'.filename
|
||||
|
||||
let save_mod = &mod
|
||||
let saved.mod = &mod
|
||||
set nomod
|
||||
|
||||
silent exe 'keepalt write! ' . fnameescape(path)
|
||||
silent exe 'keepalt write! ' . fnameescape(dict.path)
|
||||
if pathisempty
|
||||
silent keepalt 0file
|
||||
endif
|
||||
else
|
||||
let dict.istemp = 0
|
||||
update
|
||||
endif
|
||||
|
||||
call call(a:func, [path] + a:000)
|
||||
call call(a:func, [dict] + a:000)
|
||||
finally
|
||||
if exists("save_mod") | let &mod = save_mod | endif
|
||||
if exists("save_write") | let &write = save_write | endif
|
||||
if exists("save_cwd") | silent exe 'lcd' fnameescape(save_cwd) | endif
|
||||
if exists("tmpdir") | silent call s:RmDir(tmpdir) | endif
|
||||
if bufexists(buf)
|
||||
for [opt, value] in items(saved)
|
||||
silent call setbufvar(buf, '&'.opt, value)
|
||||
unlet value " avoid variable type mismatches
|
||||
endfor
|
||||
endif
|
||||
if has_key(dict, 'tmpdir') | silent call s:RmDir(dict.tmpdir) | endif
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
@@ -210,6 +274,71 @@ function! rust#AppendCmdLine(text)
|
||||
return cmd
|
||||
endfunction
|
||||
|
||||
" Tokenize the string according to sh parsing rules
|
||||
function! s:ShellTokenize(text)
|
||||
" states:
|
||||
" 0: start of word
|
||||
" 1: unquoted
|
||||
" 2: unquoted backslash
|
||||
" 3: double-quote
|
||||
" 4: double-quoted backslash
|
||||
" 5: single-quote
|
||||
let l:state = 0
|
||||
let l:current = ''
|
||||
let l:args = []
|
||||
for c in split(a:text, '\zs')
|
||||
if l:state == 0 || l:state == 1 " unquoted
|
||||
if l:c ==# ' '
|
||||
if l:state == 0 | continue | endif
|
||||
call add(l:args, l:current)
|
||||
let l:current = ''
|
||||
let l:state = 0
|
||||
elseif l:c ==# '\'
|
||||
let l:state = 2
|
||||
elseif l:c ==# '"'
|
||||
let l:state = 3
|
||||
elseif l:c ==# "'"
|
||||
let l:state = 5
|
||||
else
|
||||
let l:current .= l:c
|
||||
let l:state = 1
|
||||
endif
|
||||
elseif l:state == 2 " unquoted backslash
|
||||
if l:c !=# "\n" " can it even be \n?
|
||||
let l:current .= l:c
|
||||
endif
|
||||
let l:state = 1
|
||||
elseif l:state == 3 " double-quote
|
||||
if l:c ==# '\'
|
||||
let l:state = 4
|
||||
elseif l:c ==# '"'
|
||||
let l:state = 1
|
||||
else
|
||||
let l:current .= l:c
|
||||
endif
|
||||
elseif l:state == 4 " double-quoted backslash
|
||||
if stridx('$`"\', l:c) >= 0
|
||||
let l:current .= l:c
|
||||
elseif l:c ==# "\n" " is this even possible?
|
||||
" skip it
|
||||
else
|
||||
let l:current .= '\'.l:c
|
||||
endif
|
||||
let l:state = 3
|
||||
elseif l:state == 5 " single-quoted
|
||||
if l:c == "'"
|
||||
let l:state = 1
|
||||
else
|
||||
let l:current .= l:c
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
if l:state != 0
|
||||
call add(l:args, l:current)
|
||||
endif
|
||||
return l:args
|
||||
endfunction
|
||||
|
||||
function! s:RmDir(path)
|
||||
" sanity check; make sure it's not empty, /, or $HOME
|
||||
if empty(a:path)
|
||||
@@ -222,6 +351,66 @@ function! s:RmDir(path)
|
||||
silent exe "!rm -rf " . shellescape(a:path)
|
||||
endfunction
|
||||
|
||||
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
|
||||
" If {pwd} is the empty string then it doesn't change the cwd.
|
||||
function! s:system(pwd, cmd)
|
||||
let cmd = a:cmd
|
||||
if !empty(a:pwd)
|
||||
let cmd = 'cd ' . shellescape(a:pwd) . ' && ' . cmd
|
||||
endif
|
||||
return system(cmd)
|
||||
endfunction
|
||||
|
||||
" Playpen Support {{{1
|
||||
" Parts of gist.vim by Yasuhiro Matsumoto <mattn.jp@gmail.com> reused
|
||||
" gist.vim available under the BSD license, available at
|
||||
" http://github.com/mattn/gist-vim
|
||||
function! s:has_webapi()
|
||||
if !exists("*webapi#http#post")
|
||||
try
|
||||
call webapi#http#post()
|
||||
catch
|
||||
endtry
|
||||
endif
|
||||
return exists("*webapi#http#post")
|
||||
endfunction
|
||||
|
||||
function! rust#Play(count, line1, line2, ...) abort
|
||||
redraw
|
||||
|
||||
let l:rust_playpen_url = get(g:, 'rust_playpen_url', 'https://play.rust-lang.org/')
|
||||
let l:rust_shortener_url = get(g:, 'rust_shortener_url', 'https://is.gd/')
|
||||
|
||||
if !s:has_webapi()
|
||||
echohl ErrorMsg | echomsg ':RustPlay depends on webapi.vim (https://github.com/mattn/webapi-vim)' | echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
let bufname = bufname('%')
|
||||
if a:count < 1
|
||||
let content = join(getline(a:line1, a:line2), "\n")
|
||||
else
|
||||
let save_regcont = @"
|
||||
let save_regtype = getregtype('"')
|
||||
silent! normal! gvy
|
||||
let content = @"
|
||||
call setreg('"', save_regcont, save_regtype)
|
||||
endif
|
||||
|
||||
let body = l:rust_playpen_url."?code=".webapi#http#encodeURI(content)
|
||||
|
||||
if strlen(body) > 5000
|
||||
echohl ErrorMsg | echomsg 'Buffer too large, max 5000 encoded characters ('.strlen(body).')' | echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
let payload = "format=simple&url=".webapi#http#encodeURI(body)
|
||||
let res = webapi#http#post(l:rust_shortener_url.'create.php', payload, {})
|
||||
let url = res.content
|
||||
|
||||
redraw | echomsg 'Done: '.url
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
" vim: set noet sw=4 ts=4:
|
||||
|
||||
83
autoload/rustfmt.vim
Normal file
83
autoload/rustfmt.vim
Normal file
@@ -0,0 +1,83 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
" Author: Stephen Sugden <stephen@stephensugden.com>
|
||||
"
|
||||
" Adapted from https://github.com/fatih/vim-go
|
||||
|
||||
if !exists("g:rustfmt_autosave")
|
||||
let g:rustfmt_autosave = 0
|
||||
endif
|
||||
|
||||
if !exists("g:rustfmt_command")
|
||||
let g:rustfmt_command = "rustfmt"
|
||||
endif
|
||||
|
||||
if !exists("g:rustfmt_options")
|
||||
let g:rustfmt_options = ""
|
||||
endif
|
||||
|
||||
if !exists("g:rustfmt_fail_silently")
|
||||
let g:rustfmt_fail_silently = 0
|
||||
endif
|
||||
|
||||
let s:got_fmt_error = 0
|
||||
|
||||
function! rustfmt#Format()
|
||||
let l:curw = winsaveview()
|
||||
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
|
||||
call writefile(getline(1, '$'), l:tmpname)
|
||||
|
||||
let command = g:rustfmt_command . " --write-mode=overwrite "
|
||||
|
||||
let out = systemlist(command . g:rustfmt_options . " " . shellescape(l:tmpname))
|
||||
|
||||
if v:shell_error == 0
|
||||
" remove undo point caused via BufWritePre
|
||||
try | silent undojoin | catch | endtry
|
||||
|
||||
" Replace current file with temp file, then reload buffer
|
||||
call rename(l:tmpname, expand('%'))
|
||||
silent edit!
|
||||
let &syntax = &syntax
|
||||
|
||||
" only clear location list if it was previously filled to prevent
|
||||
" clobbering other additions
|
||||
if s:got_fmt_error
|
||||
let s:got_fmt_error = 0
|
||||
call setloclist(0, [])
|
||||
lwindow
|
||||
endif
|
||||
elseif g:rustfmt_fail_silently == 0
|
||||
" otherwise get the errors and put them in the location list
|
||||
let errors = []
|
||||
|
||||
for line in out
|
||||
" src/lib.rs:13:5: 13:10 error: expected `,`, or `}`, found `value`
|
||||
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\):\s*\(\d\+:\d\+\s*\)\?\s*error: \(.*\)')
|
||||
if !empty(tokens)
|
||||
call add(errors, {"filename": @%,
|
||||
\"lnum": tokens[2],
|
||||
\"col": tokens[3],
|
||||
\"text": tokens[5]})
|
||||
endif
|
||||
endfor
|
||||
|
||||
if empty(errors)
|
||||
% | " Couldn't detect rustfmt error format, output errors
|
||||
endif
|
||||
|
||||
if !empty(errors)
|
||||
call setloclist(0, errors, 'r')
|
||||
echohl Error | echomsg "rustfmt returned error" | echohl None
|
||||
endif
|
||||
|
||||
let s:got_fmt_error = 1
|
||||
lwindow
|
||||
" We didn't use the temp file, so clean up
|
||||
call delete(l:tmpname)
|
||||
endif
|
||||
|
||||
call winrestview(l:curw)
|
||||
endfunction
|
||||
|
||||
endif
|
||||
47
build
47
build
@@ -3,7 +3,7 @@
|
||||
set -E
|
||||
|
||||
DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect"
|
||||
DIRS_BASIC="syntax 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"
|
||||
|
||||
OUTPUT=""
|
||||
@@ -96,72 +96,85 @@ EOF
|
||||
}
|
||||
|
||||
PACKS="
|
||||
ansible:pearofducks/ansible-vim
|
||||
arduino:sudar/vim-arduino-syntax
|
||||
blade:xsbeats/vim-blade
|
||||
blade:jwalton512/vim-blade
|
||||
c++11:octol/vim-cpp-enhanced-highlight
|
||||
c/c++:vim-jp/cpp-vim
|
||||
c/c++:vim-jp/vim-cpp
|
||||
cjsx:mtscout6/vim-cjsx
|
||||
clojure:guns/vim-clojure-static
|
||||
coffee-script:kchmck/vim-coffee-script
|
||||
cjsx:mtscout6/vim-cjsx
|
||||
cql:elubow/cql-vim
|
||||
css:JulesWang/css.vim
|
||||
cucumber:tpope/vim-cucumber
|
||||
dart:dart-lang/dart-vim-plugin
|
||||
dockerfile:honza/dockerfile.vim
|
||||
elixir:elixir-lang/vim-elixir
|
||||
elm:lambdatoast/elm.vim
|
||||
emberscript:heartsentwined/vim-ember-script
|
||||
emblem:heartsentwined/vim-emblem
|
||||
erlang:hcs42/vim-erlang-runtime
|
||||
erlang:vim-erlang/vim-erlang-runtime
|
||||
git:tpope/vim-git
|
||||
glsl:tikhomirov/vim-glsl
|
||||
go:fatih/vim-go:_BASIC
|
||||
groovy:vim-scripts/groovy.vim
|
||||
haml:tpope/vim-haml
|
||||
handlebars:mustache/vim-mustache-handlebars
|
||||
haskell:raichoo/haskell-vim
|
||||
haskell:neovimhaskell/haskell-vim
|
||||
haxe:yaymukund/vim-haxe
|
||||
html5:othree/html5.vim
|
||||
jade:digitaltoad/vim-jade
|
||||
jasmine:glanotte/vim-jasmine
|
||||
javascript:sheerun/yajs.vim
|
||||
julia:dcjones/julia-minimalist-vim
|
||||
jinja:Glench/Vim-Jinja2-Syntax
|
||||
json:sheerun/vim-json
|
||||
jst:briancollins/vim-jst
|
||||
jsx:mxw/vim-jsx:_ALL
|
||||
julia:dcjones/julia-minimalist-vim
|
||||
kotlin:udalov/kotlin-vim
|
||||
latex:LaTeX-Box-Team/LaTeX-Box
|
||||
less:groenewege/vim-less
|
||||
liquid:tpope/vim-liquid
|
||||
markdown:tpope/vim-markdown
|
||||
nginx:mutewinter/nginx.vim
|
||||
nginx:nginx/nginx::/contrib/vim/
|
||||
nix:spwhitt/vim-nix
|
||||
objc:b4winckler/vim-objc
|
||||
ocaml:jrk/vim-ocaml
|
||||
octave:vim-scripts/octave.vim--
|
||||
opencl:petRUShka/vim-opencl
|
||||
perl:vim-perl/vim-perl
|
||||
php:StanAngeloff/php.vim
|
||||
puppet:rodjek/vim-puppet
|
||||
powershell:Persistent13/vim-ps1
|
||||
protobuf:uarun/vim-protobuf
|
||||
puppet:rodjek/vim-puppet
|
||||
python:mitsuhiko/vim-python-combined
|
||||
qml:peterhoeg/vim-qml
|
||||
r-lang:vim-scripts/R.vim
|
||||
ragel:jneen/ragel.vim
|
||||
rspec:sheerun/rspec.vim
|
||||
ruby:vim-ruby/vim-ruby
|
||||
rust:wting/rust.vim
|
||||
rust:rust-lang/rust.vim
|
||||
sbt:derekwyatt/vim-sbt
|
||||
scala:derekwyatt/vim-scala
|
||||
slim:slim-template/vim-slim
|
||||
solidity:ethereum/vim-solidity
|
||||
stylus:wavded/vim-stylus
|
||||
swift:keith/swift.vim
|
||||
systemd:kurayama/systemd-vim-syntax
|
||||
swift:toyamarinyon/vim-swift
|
||||
textile:timcharper/textile.vim
|
||||
tmux:tejr/vim-tmux
|
||||
tomdoc:duwanis/tomdoc.vim
|
||||
typescript:leafgarland/typescript-vim
|
||||
vbnet:vim-scripts/vbnet.vim
|
||||
thrift:solarnz/thrift.vim
|
||||
tmux:tejr/vim-tmux
|
||||
tomdoc:wellbredgrapefruit/tomdoc.vim
|
||||
toml:cespare/vim-toml
|
||||
twig:beyondwords/vim-twig
|
||||
xls:vim-scripts/XSLT-syntax
|
||||
yard:sheerun/vim-yardoc
|
||||
typescript:leafgarland/typescript-vim
|
||||
vala:tkztmk/vim-vala
|
||||
vbnet:vim-scripts/vbnet.vim
|
||||
vcl:smerrill/vcl-vim-plugin
|
||||
vm:lepture/vim-velocity
|
||||
xls:vim-scripts/XSLT-syntax
|
||||
yaml:stephpy/vim-yaml
|
||||
yard:sheerun/vim-yardoc
|
||||
"
|
||||
|
||||
rm -rf tmp
|
||||
|
||||
@@ -16,9 +16,15 @@ endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
CompilerSet makeprg=mix\ test
|
||||
CompilerSet errorformat=%A\ \ %.)\ %m(%.%#),%C\ \ \ \ \ **%m,%C\ \ \ \ \ \ \ %m,%Z\ \ \ \ \ at\ %f:%l,%-G%.%#
|
||||
CompilerSet errorformat=
|
||||
\%E\ \ %n)\ %m,
|
||||
\%+G\ \ \ \ \ **\ %m,
|
||||
\%+G\ \ \ \ \ stacktrace:,
|
||||
\%C\ \ \ \ \ %f:%l,
|
||||
\%+G\ \ \ \ \ \ \ (%\\w%\\+)\ %f:%l:\ %m,
|
||||
\%+G\ \ \ \ \ \ \ %f:%l:\ %.%#,
|
||||
\**\ (%\\w%\\+)\ %f:%l:\ %m
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
45
compiler/go.vim
Normal file
45
compiler/go.vim
Normal file
@@ -0,0 +1,45 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||
|
||||
" Copyright 2013 The Go Authors. All rights reserved.
|
||||
" Use of this source code is governed by a BSD-style
|
||||
" license that can be found in the LICENSE file.
|
||||
"
|
||||
" compiler/go.vim: Vim compiler file for Go.
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "go"
|
||||
|
||||
if exists(":CompilerSet") != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo-=C
|
||||
if filereadable("makefile") || filereadable("Makefile")
|
||||
CompilerSet makeprg=make
|
||||
else
|
||||
CompilerSet makeprg=go\ build
|
||||
endif
|
||||
|
||||
" Define the patterns that will be recognized by QuickFix when parsing the
|
||||
" output of Go command that use this errorforamt (when called make, cexpr or
|
||||
" lmake, lexpr). This is the global errorformat, however some command might
|
||||
" use a different output, for those we define them directly and modify the
|
||||
" errorformat ourselves. More information at:
|
||||
" http://vimdoc.sourceforge.net/htmldoc/quickfix.html#errorformat
|
||||
CompilerSet errorformat =%-G#\ %.%# " Ignore lines beginning with '#' ('# command-line-arguments' line sometimes appears?)
|
||||
CompilerSet errorformat+=%-G%.%#panic:\ %m " Ignore lines containing 'panic: message'
|
||||
CompilerSet errorformat+=%Ecan\'t\ load\ package:\ %m " Start of multiline error string is 'can\'t load package'
|
||||
CompilerSet errorformat+=%A%f:%l:%c:\ %m " Start of multiline unspecified string is 'filename:linenumber:columnnumber:'
|
||||
CompilerSet errorformat+=%A%f:%l:\ %m " Start of multiline unspecified string is 'filename:linenumber:'
|
||||
CompilerSet errorformat+=%C%*\\s%m " Continuation of multiline error message is indented
|
||||
CompilerSet errorformat+=%-G%.%# " All lines not matching any of the above patterns are ignored
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim:ts=4:sw=4:et
|
||||
|
||||
endif
|
||||
@@ -24,9 +24,10 @@ CompilerSet errorformat=
|
||||
\%f:%l:\ %tarning:\ %m,
|
||||
\%E%.%#:in\ `load':\ %f:%l:%m,
|
||||
\%E%f:%l:in\ `%*[^']':\ %m,
|
||||
\%-Z\ \ \ \ \ \#\ %f:%l:%.%#,
|
||||
\%-Z\ \ \ \ \ %\\+\#\ %f:%l:%.%#,
|
||||
\%E\ \ %\\d%\\+)%.%#,
|
||||
\%C\ \ \ \ \ %m,
|
||||
\%C%\\s%#,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -17,7 +17,7 @@ if exists(":CompilerSet") != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent == 1
|
||||
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
|
||||
CompilerSet makeprg=rustc
|
||||
else
|
||||
CompilerSet makeprg=rustc\ \%
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
|
||||
|
||||
function! DetectAnsible()
|
||||
let filepath = expand("%:p")
|
||||
let filename = expand("%:t")
|
||||
if filepath =~ '\v/(tasks|roles)/.*\.ya?ml$' || filepath =~ '\v/(group|host)_vars/' || filename =~ '\v(playbook|site)\.ya?ml$'
|
||||
set ft=ansible
|
||||
endif
|
||||
unlet filepath
|
||||
unlet filename
|
||||
endfunction
|
||||
:au BufNewFile,BufRead *.yml,*yaml,*/{group,host}_vars/* call DetectAnsible()
|
||||
:au BufNewFile,BufRead *.j2 set ft=ansible_template
|
||||
:au BufNewFile,BufRead hosts set ft=ansible_hosts
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'arduino') == -1
|
||||
|
||||
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
|
||||
@@ -30,10 +45,20 @@ function! s:DetectCoffee()
|
||||
endfunction
|
||||
autocmd BufNewFile,BufRead * call s:DetectCoffee()
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cql') == -1
|
||||
|
||||
if has("autocmd")
|
||||
au BufNewFile,BufRead *.cql set filetype=cql
|
||||
endif
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -1
|
||||
|
||||
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
|
||||
|
||||
autocmd BufRead,BufNewFile *.dart set filetype=dart
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
|
||||
|
||||
au BufNewFile,BufRead Dockerfile set filetype=dockerfile
|
||||
@@ -54,6 +79,10 @@ function! s:DetectElixir()
|
||||
endfunction
|
||||
autocmd BufNewFile,BufRead * call s:DetectElixir()
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
|
||||
|
||||
au BufNewFile,BufRead *.elm set filetype=elm
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.em set filetype=ember-script
|
||||
@@ -64,9 +93,13 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
||||
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
|
||||
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
|
||||
endif
|
||||
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
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.git/{,modules/**/}{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 */.config/git/config set ft=gitconfig
|
||||
autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig
|
||||
@@ -85,6 +118,10 @@ autocmd BufNewFile,BufRead *
|
||||
\ set filetype=gitsendemail |
|
||||
\ endif
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
|
||||
|
||||
autocmd! BufNewFile,BufRead *.glsl,*.geom,*.vert,*.frag,*.gsh,*.vsh,*.fsh,*.vs,*.fs,*.gs,*.tcs,*.tes set filetype=glsl
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||
|
||||
let s:current_fileformats = ''
|
||||
@@ -99,7 +136,7 @@ function! s:gofiletype_post()
|
||||
let &g:fileformats = s:current_fileformats
|
||||
let &g:fileencodings = s:current_fileencodings
|
||||
endfunction
|
||||
au BufNewFile *.go setlocal filetype=go fileencoding=utf-8 fileformat=unix
|
||||
au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix
|
||||
au BufRead *.go call s:gofiletype_pre()
|
||||
au BufReadPost *.go call s:gofiletype_post()
|
||||
au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
|
||||
@@ -126,6 +163,46 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *Spec.js,*_spec.js set filetype=jasmine.javascript syntax=jasmine
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
|
||||
|
||||
if !exists('g:jsx_ext_required')
|
||||
let g:jsx_ext_required = 1
|
||||
endif
|
||||
if !exists('g:jsx_pragma_required')
|
||||
let g:jsx_pragma_required = 0
|
||||
endif
|
||||
if g:jsx_pragma_required
|
||||
" Look for the @jsx pragma. It must be included in a docblock comment before
|
||||
" anything else in the file (except whitespace).
|
||||
let s:jsx_pragma_pattern = '\%^\_s*\/\*\*\%(\_.\%(\*\/\)\@!\)*@jsx\_.\{-}\*\/'
|
||||
let b:jsx_pragma_found = search(s:jsx_pragma_pattern, 'npw')
|
||||
endif
|
||||
fu! <SID>EnableJSX()
|
||||
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
|
||||
return 1
|
||||
endfu
|
||||
autocmd BufNewFile,BufRead *.jsx let b:jsx_ext_found = 1
|
||||
autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx
|
||||
autocmd BufNewFile,BufRead *.js
|
||||
\ if <SID>EnableJSX() | set filetype=javascript.jsx | endif
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jinja') == -1
|
||||
|
||||
fun! s:SelectHTML()
|
||||
let n = 1
|
||||
while n < 50 && n <= line("$")
|
||||
" check for jinja
|
||||
if getline(n) =~ '{{.*}}\|{%-\?\s*\(end.*\|extends\|block\|macro\|set\|if\|for\|include\|trans\)\>'
|
||||
set ft=jinja
|
||||
return
|
||||
endif
|
||||
let n = n + 1
|
||||
endwhile
|
||||
endfun
|
||||
autocmd BufNewFile,BufRead *.html,*.htm,*.nunjucks,*.nunjs call s:SelectHTML()
|
||||
autocmd BufNewFile,BufRead *.jinja2,*.j2,*.jinja set ft=jinja
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.json set filetype=json
|
||||
@@ -144,6 +221,11 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
||||
au BufRead,BufNewFile *.jl let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<"
|
||||
au BufRead,BufNewFile *.jl set filetype=julia
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.kt setfiletype kotlin
|
||||
autocmd BufNewFile,BufRead *.kts setfiletype kotlin
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.less setf less
|
||||
@@ -188,11 +270,18 @@ endif
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/*,*/nginx/vhosts.d/*,nginx.conf if &ft == '' | setfiletype nginx | endif
|
||||
au BufRead,BufNewFile *.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 nginx.conf set ft=nginx
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nix') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.nix setfiletype nix
|
||||
endif
|
||||
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
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
|
||||
|
||||
@@ -244,6 +333,10 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
|
||||
au! BufRead,BufNewFile *.pp setfiletype puppet
|
||||
au! BufRead,BufNewFile Puppetfile setfiletype ruby
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
|
||||
|
||||
autocmd BufRead,BufNewFile *.qml setfiletype qml
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
||||
|
||||
function! s:setf(filetype) abort
|
||||
@@ -273,6 +366,8 @@ 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 [rR]outefile call s:setf('ruby')
|
||||
au BufNewFile,BufRead .simplecov set filetype=ruby
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
@@ -308,7 +403,17 @@ autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.swift set filetype=swift
|
||||
autocmd BufNewFile,BufRead *.swift setfiletype swift
|
||||
autocmd BufRead * call s:Swift()
|
||||
function! s:Swift()
|
||||
if !empty(&filetype)
|
||||
return
|
||||
endif
|
||||
let line = getline(1)
|
||||
if line =~ "^#!.*swift"
|
||||
setfiletype swift
|
||||
endif
|
||||
endfunction
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'systemd') == -1
|
||||
|
||||
@@ -346,13 +451,17 @@ autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.ts setlocal filetype=typescript
|
||||
autocmd BufNewFile,BufRead *.ts,*.tsx setlocal filetype=typescript
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1
|
||||
|
||||
autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
|
||||
au BufRead,BufNewFile *.vala,*.vapi setfiletype vala
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vcl') == -1
|
||||
|
||||
au BufRead,BufNewFile *.vcl set filetype=vcl
|
||||
endif
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vm') == -1
|
||||
|
||||
au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity
|
||||
|
||||
8
ftplugin/ansible.vim
Normal file
8
ftplugin/ansible.vim
Normal file
@@ -0,0 +1,8 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
|
||||
|
||||
" Slow yaml highlighting workaround
|
||||
if exists('+regexpengine') && ('®expengine' == 0)
|
||||
setlocal regexpengine=1
|
||||
endif
|
||||
|
||||
endif
|
||||
31
ftplugin/dart.vim
Normal file
31
ftplugin/dart.vim
Normal file
@@ -0,0 +1,31 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Enable automatic indentation (2 spaces) if variable g:dart_style_guide is set
|
||||
if exists('g:dart_style_guide')
|
||||
setlocal expandtab
|
||||
setlocal shiftwidth=2
|
||||
setlocal softtabstop=2
|
||||
|
||||
setlocal formatoptions-=t
|
||||
endif
|
||||
|
||||
" Set 'comments' to format dashed lists in comments.
|
||||
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
|
||||
|
||||
setlocal commentstring=//%s
|
||||
let s:win_sep = (has('win32') || has('win64')) ? '/' : ''
|
||||
let &l:errorformat =
|
||||
\ join([
|
||||
\ ' %#''file://' . s:win_sep . '%f'': %s: line %l pos %c:%m',
|
||||
\ '%m'
|
||||
\ ], ',')
|
||||
|
||||
|
||||
let b:undo_ftplugin = 'setl et< fo< sw< sts< com< cms<'
|
||||
|
||||
endif
|
||||
86
ftplugin/elm.vim
Normal file
86
ftplugin/elm.vim
Normal file
@@ -0,0 +1,86 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
|
||||
|
||||
" elm.vim - Plugin for the Elm programming language
|
||||
" Maintainer: Alexander Noriega <http://lambdatoast.com/>
|
||||
" Version: 0.4.3
|
||||
|
||||
" Plugin setup stuff
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Compilation
|
||||
|
||||
function! ElmMake(file)
|
||||
let args = a:file
|
||||
return elm#io#system("elm-make", args)
|
||||
endfunction
|
||||
|
||||
function! ElmMakeCurrentFile()
|
||||
echo ElmMake(expand("%"))
|
||||
endfunction
|
||||
|
||||
function! ElmMakeMain()
|
||||
echo ElmMake("Main.elm")
|
||||
endfunction
|
||||
|
||||
function! ElmMakeFile(file)
|
||||
echo ElmMake(a:file)
|
||||
endfunction
|
||||
|
||||
" REPL
|
||||
|
||||
function! ElmRepl()
|
||||
!elm-repl
|
||||
endfunction
|
||||
|
||||
" Evaluation
|
||||
|
||||
function! ElmEvalLine()
|
||||
return ElmEval(getline("."))
|
||||
endfunction
|
||||
|
||||
function! ElmEvalSelection()
|
||||
let savedReg = @z
|
||||
normal! `<v`>"zy
|
||||
let res = ElmEval(substitute(getreg("z"), "\n", "\\\n", "g"))
|
||||
let @z = savedReg
|
||||
normal! gv
|
||||
endfunction
|
||||
|
||||
function! ElmEval(sourceCode)
|
||||
let currentLine = a:sourceCode
|
||||
let args = "echo '" . currentLine . "' | elm-repl"
|
||||
let result = elm#io#system("echo", args)
|
||||
let cleanResult = "-- " . join(s:Filtered(function("s:IsUsefulReplOutput"), split(result, "\n")), "")
|
||||
put =cleanResult
|
||||
endfunction
|
||||
|
||||
function! s:IsUsefulReplOutput(str)
|
||||
return a:str !~ "^Elm REPL" && a:str !~ "Type :help" && a:str !~ ">\\s*$"
|
||||
endfunction
|
||||
|
||||
" List processing
|
||||
|
||||
function! s:Filtered(fn, l)
|
||||
let new_list = deepcopy(a:l)
|
||||
call filter(new_list, string(a:fn) . '(v:val)')
|
||||
return new_list
|
||||
endfunction
|
||||
|
||||
command -buffer ElmEvalLine call ElmEvalLine()
|
||||
command -buffer ElmEvalSelection call ElmEvalSelection()
|
||||
command -buffer ElmMakeMain call ElmMakeMain()
|
||||
command -buffer -nargs=1 ElmMakeFile call ElmMakeFile <args>
|
||||
command -buffer ElmMakeCurrentFile call ElmMakeCurrentFile()
|
||||
command -buffer ElmRepl call ElmRepl()
|
||||
|
||||
" Define comment convention
|
||||
|
||||
setlocal comments=:--
|
||||
setlocal commentstring=--%s
|
||||
|
||||
endif
|
||||
@@ -3,6 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Vim filetype plugin
|
||||
" Language: generic git output
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2013 May 30
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Vim filetype plugin
|
||||
" Language: git commit file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2012 April 7
|
||||
" Last Change: 2013 May 30
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
|
||||
@@ -21,7 +21,7 @@ setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','')
|
||||
setlocal omnifunc=csscomplete#CompleteCSS
|
||||
setlocal suffixesadd=.less
|
||||
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,://
|
||||
setlocal fo=jcroql
|
||||
setlocal fo=croql
|
||||
|
||||
let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\='
|
||||
|
||||
|
||||
17
ftplugin/nix.vim
Normal file
17
ftplugin/nix.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nix') == -1
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin=1
|
||||
|
||||
setlocal comments=
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
" Nixpkgs indent settings
|
||||
setlocal tabstop=2
|
||||
setlocal softtabstop=2
|
||||
setlocal shiftwidth=2
|
||||
setlocal expandtab
|
||||
|
||||
endif
|
||||
10
ftplugin/objc.vim
Normal file
10
ftplugin/objc.vim
Normal file
@@ -0,0 +1,10 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'objc') == -1
|
||||
|
||||
" Use C++ style comment strings with commentary.vim
|
||||
setl commentstring=//%s
|
||||
|
||||
" Search for include files inside frameworks (used for gf etc.)
|
||||
setl includeexpr=substitute(v:fname,'\\([^/]\\+\\)/\\(.\\+\\)','/System/Library/Frameworks/\\1.framework/Headers/\\2','')
|
||||
|
||||
|
||||
endif
|
||||
@@ -45,7 +45,7 @@ setlocal define=[^A-Za-z_]
|
||||
" after/ftplugin/perl6.vim file that contains
|
||||
" set isfname-=:
|
||||
set isfname+=:
|
||||
setlocal iskeyword=@,48-57,_,192-255,:,-,'
|
||||
setlocal iskeyword=@,48-57,_,192-255,-
|
||||
|
||||
" Set this once, globally.
|
||||
if !exists("perlpath")
|
||||
|
||||
41
ftplugin/qml.vim
Normal file
41
ftplugin/qml.vim
Normal file
@@ -0,0 +1,41 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
|
||||
|
||||
" Vim filetype plugin file
|
||||
" Language: qml
|
||||
" Last change: 2014 Feb 8
|
||||
|
||||
if exists( 'b:did_ftplugin' )
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpoptions_save = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
" command for undo
|
||||
let b:undo_ftplugin =
|
||||
\ 'let b:browsefilter = "" | ' .
|
||||
\ 'setlocal ' .
|
||||
\ 'comments< '.
|
||||
\ 'commentstring< ' .
|
||||
\ 'formatoptions< ' .
|
||||
\ 'indentexpr<'
|
||||
|
||||
if has( 'gui_win32' )
|
||||
\ && !exists( 'b:browsefilter' )
|
||||
let b:browsefilter =
|
||||
\ 'qml files (*.qml)\t*.qml\n' .
|
||||
\ 'All files (*.*)\t*.*\n'
|
||||
endif
|
||||
|
||||
" Set 'comments' to format dashed lists in comments.
|
||||
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
|
||||
setlocal commentstring=//%s
|
||||
|
||||
setlocal formatoptions-=t
|
||||
setlocal formatoptions+=croql
|
||||
|
||||
let &cpoptions = s:cpoptions_save
|
||||
unlet s:cpoptions_save
|
||||
|
||||
endif
|
||||
@@ -46,7 +46,7 @@ endif
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
|
||||
setlocal include=^\\s*\\<\\(load\\>\\\|require\\>\\\|autoload\\s*:\\=[\"']\\=\\h\\w*[\"']\\=,\\)
|
||||
setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.rb','')
|
||||
setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'\%(\.rb\)\=$','.rb','')
|
||||
setlocal suffixesadd=.rb
|
||||
|
||||
if exists("&ofu") && has("ruby")
|
||||
@@ -104,7 +104,7 @@ endfunction
|
||||
|
||||
if !exists('b:ruby_version') && !exists('g:ruby_path') && isdirectory(expand('%:p:h'))
|
||||
let s:version_file = findfile('.ruby-version', '.;')
|
||||
if !empty(s:version_file)
|
||||
if !empty(s:version_file) && filereadable(s:version_file)
|
||||
let b:ruby_version = get(readfile(s:version_file, '', 1), '')
|
||||
if !has_key(g:ruby_version_paths, b:ruby_version)
|
||||
let g:ruby_version_paths[b:ruby_version] = s:query_path(fnamemodify(s:version_file, ':p:h'))
|
||||
@@ -138,7 +138,7 @@ if exists('s:ruby_paths') && stridx(&l:tags, join(map(copy(s:ruby_paths),'v:val.
|
||||
let &l:tags = &tags . ',' . join(map(copy(s:ruby_paths),'v:val."/tags"'),',')
|
||||
endif
|
||||
|
||||
if has("gui_win32") && !exists("b:browsefilter")
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Ruby Source Files (*.rb)\t*.rb\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
@@ -209,16 +209,16 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
|
||||
call s:map('c', '', '<C-R><C-W> <Plug><cword>')
|
||||
call s:map('c', '', '<C-R><C-F> <Plug><cfile>')
|
||||
|
||||
nmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? 'zv' : ''
|
||||
call s:map('n', '<silent>', '<C-]> <SID>c:tag <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', 'g<C-]> <SID>:tjump <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', 'g] <SID>:tselect <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', '<C-W>] <SID>c:stag <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', '<C-W><C-]> <SID>c:stag <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:stjump <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', '<C-W>g] <SID>:stselect <Plug><cword><CR><SID>tagzv')
|
||||
call s:map('n', '<silent>', '<C-W>} <SID>c:ptag <Plug><cword><CR>')
|
||||
call s:map('n', '<silent>', '<C-W>g} <SID>:ptjump <Plug><cword><CR>')
|
||||
cmap <buffer><script><expr> <SID>tagzv &foldopen =~# 'tag' ? '<Bar>norm! zv' : ''
|
||||
call s:map('n', '<silent>', '<C-]> <SID>:exe v:count1."tag <Plug><cword>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', 'g<C-]> <SID>:exe "tjump <Plug><cword>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', 'g] <SID>:exe "tselect <Plug><cword>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', '<C-W>] <SID>:exe v:count1."stag <Plug><cword>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', '<C-W><C-]> <SID>:exe v:count1."stag <Plug><cword>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', '<C-W>g<C-]> <SID>:exe "stjump <Plug><cword>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', '<C-W>g] <SID>:exe "stselect <Plug><cword>"<SID>tagzv<CR>')
|
||||
call s:map('n', '<silent>', '<C-W>} <SID>:exe v:count1."ptag <Plug><cword>"<CR>')
|
||||
call s:map('n', '<silent>', '<C-W>g} <SID>:exe "ptjump <Plug><cword>"<CR>')
|
||||
|
||||
call s:map('n', '<silent>', 'gf <SID>c:find <Plug><cfile><CR>')
|
||||
call s:map('n', '<silent>', '<C-W>f <SID>c:sfind <Plug><cfile><CR>')
|
||||
@@ -361,7 +361,7 @@ function! RubyCursorFile() abort
|
||||
endtry
|
||||
let pre = matchstr(strpart(getline('.'), 0, col('.')-1), '.*\f\@<!')
|
||||
let post = matchstr(strpart(getline('.'), col('.')), '\f\@!.*')
|
||||
let ext = getline('.') =~# '^\s*\%(require\|autoload\)\>' ? '.rb' : ''
|
||||
let ext = getline('.') =~# '^\s*\%(require\%(_relative\)\=\|autoload\)\>' && cfile !~# '\.rb$' ? '.rb' : ''
|
||||
if s:synname() ==# 'rubyConstant'
|
||||
let cfile = substitute(cfile,'\.\w\+[?!=]\=$','','')
|
||||
let cfile = substitute(cfile,'::','/','g')
|
||||
@@ -369,7 +369,7 @@ function! RubyCursorFile() abort
|
||||
let cfile = substitute(cfile,'\(\l\|\d\)\(\u\)','\1_\2', 'g')
|
||||
return tolower(cfile) . '.rb'
|
||||
elseif getline('.') =~# '^\s*require_relative\s*\(["'']\).*\1\s*$'
|
||||
let cfile = expand('%:p:h') . '/' . matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') . '.rb'
|
||||
let cfile = expand('%:p:h') . '/' . matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1') . ext
|
||||
elseif getline('.') =~# '^\s*\%(require[( ]\|load[( ]\|autoload[( ]:\w\+,\)\s*\%(::\)\=File\.expand_path(\(["'']\)\.\./.*\1,\s*__FILE__)\s*$'
|
||||
let target = matchstr(getline('.'),'\(["'']\)\.\.\zs/.\{-\}\ze\1')
|
||||
let cfile = expand('%:p:h') . target . ext
|
||||
|
||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
" Description: Vim syntax file for Rust
|
||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||
" Maintainer: Kevin Ballard <kevin@sb.org>
|
||||
" Last Change: Jul 07, 2014
|
||||
" Last Change: January 29, 2015
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -20,7 +20,7 @@ set cpo&vim
|
||||
" comments, so we'll use that as our default, but make it easy to switch.
|
||||
" This does not affect indentation at all (I tested it with and without
|
||||
" leader), merely whether a leader is inserted by default or not.
|
||||
if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader == 1
|
||||
if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader != 0
|
||||
" Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why,
|
||||
" but without it, */ gets indented one space even if there were no
|
||||
" leaders. I'm fairly sure that's a Vim bug.
|
||||
@@ -37,7 +37,7 @@ silent! setlocal formatoptions+=j
|
||||
" otherwise it's better than nothing.
|
||||
setlocal smartindent nocindent
|
||||
|
||||
if !exists("g:rust_recommended_style") || g:rust_recommended_style == 1
|
||||
if !exists("g:rust_recommended_style") || g:rust_recommended_style != 0
|
||||
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
|
||||
setlocal textwidth=99
|
||||
endif
|
||||
@@ -69,7 +69,7 @@ if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
|
||||
endif
|
||||
endif
|
||||
|
||||
if has('conceal') && exists('g:rust_conceal')
|
||||
if has('conceal') && exists('g:rust_conceal') && g:rust_conceal != 0
|
||||
let b:rust_set_conceallevel=1
|
||||
setlocal conceallevel=2
|
||||
endif
|
||||
@@ -84,19 +84,35 @@ xnoremap <silent> <buffer> ]] :call rust#Jump('v', 'Forward')<CR>
|
||||
onoremap <silent> <buffer> [[ :call rust#Jump('o', 'Back')<CR>
|
||||
onoremap <silent> <buffer> ]] :call rust#Jump('o', 'Forward')<CR>
|
||||
|
||||
" %-matching. <:> is handy for generics.
|
||||
set matchpairs+=<:>
|
||||
" There are two minor issues with it; (a) comparison operators in expressions,
|
||||
" where a less-than may match a greater-than later on—this is deemed a trivial
|
||||
" issue—and (b) `Fn() -> X` syntax. This latter issue is irremediable from the
|
||||
" highlighting perspective (built into Vim), but the actual % functionality
|
||||
" can be fixed by this use of matchit.vim.
|
||||
let b:match_skip = 's:comment\|string\|rustArrow'
|
||||
source $VIMRUNTIME/macros/matchit.vim
|
||||
|
||||
" Commands {{{1
|
||||
|
||||
" See |:RustRun| for docs
|
||||
command! -nargs=* -complete=file -bang -bar -buffer RustRun call rust#Run(<bang>0, [<f-args>])
|
||||
command! -nargs=* -complete=file -bang -buffer RustRun call rust#Run(<bang>0, <q-args>)
|
||||
|
||||
" See |:RustExpand| for docs
|
||||
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -bar -buffer RustExpand call rust#Expand(<bang>0, [<f-args>])
|
||||
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -buffer RustExpand call rust#Expand(<bang>0, <q-args>)
|
||||
|
||||
" See |:RustEmitIr| for docs
|
||||
command! -nargs=* -bar -buffer RustEmitIr call rust#Emit("ir", [<f-args>])
|
||||
command! -nargs=* -buffer RustEmitIr call rust#Emit("llvm-ir", <q-args>)
|
||||
|
||||
" See |:RustEmitAsm| for docs
|
||||
command! -nargs=* -bar -buffer RustEmitAsm call rust#Emit("asm", [<f-args>])
|
||||
command! -nargs=* -buffer RustEmitAsm call rust#Emit("asm", <q-args>)
|
||||
|
||||
" See |:RustPlay| for docs
|
||||
command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
|
||||
|
||||
" See |:RustFmt| for docs
|
||||
command! -buffer RustFmt call rustfmt#Format()
|
||||
|
||||
" Mappings {{{1
|
||||
|
||||
@@ -134,6 +150,7 @@ let b:undo_ftplugin = "
|
||||
\|delcommand RustExpand
|
||||
\|delcommand RustEmitIr
|
||||
\|delcommand RustEmitAsm
|
||||
\|delcommand RustPlay
|
||||
\|nunmap <buffer> <D-r>
|
||||
\|nunmap <buffer> <D-R>
|
||||
\|nunmap <buffer> [[
|
||||
@@ -142,6 +159,8 @@ let b:undo_ftplugin = "
|
||||
\|xunmap <buffer> ]]
|
||||
\|ounmap <buffer> [[
|
||||
\|ounmap <buffer> ]]
|
||||
\|set matchpairs-=<:>
|
||||
\|unlet b:match_skip
|
||||
\"
|
||||
|
||||
" }}}1
|
||||
|
||||
8
ftplugin/swift.vim
Normal file
8
ftplugin/swift.vim
Normal file
@@ -0,0 +1,8 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
|
||||
|
||||
setlocal commentstring=//\ %s
|
||||
" @-@ adds the literal @ to iskeyword for @IBAction and similar
|
||||
setlocal iskeyword+=@-@,#
|
||||
setlocal completefunc=syntaxcomplete#Complete
|
||||
|
||||
endif
|
||||
58
indent/ansible.vim
Normal file
58
indent/ansible.vim
Normal file
@@ -0,0 +1,58 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal indentexpr=GetAnsibleIndent(v:lnum)
|
||||
setlocal indentkeys=!^F,o,O,0#,0},0],<:>,-,*<Return>
|
||||
setlocal nosmartindent
|
||||
setlocal expandtab
|
||||
setlocal softtabstop=2
|
||||
setlocal shiftwidth=2
|
||||
setlocal commentstring=#%s
|
||||
setlocal formatoptions=cl
|
||||
" c -> wrap long comments, including #
|
||||
" l -> do not wrap long lines
|
||||
|
||||
let s:comment = '\v^\s*#' " # comment
|
||||
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:dictionary_entry = '\v^\s*[^:-]+:\s*$' " with_items:
|
||||
let s:key_value = '\v^\s*[^:-]+:\s*\S' " apt: name=package
|
||||
let s:scalar_value = '\v:\s*[>|\|]\s*$' " shell: >
|
||||
|
||||
if exists('*GetAnsibleIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
function GetAnsibleIndent(lnum)
|
||||
if a:lnum == 1 || !prevnonblank(a:lnum-1)
|
||||
return 0
|
||||
endif
|
||||
let prevlnum = prevnonblank(a:lnum - 1)
|
||||
let maintain = indent(prevlnum)
|
||||
let increase = maintain + &sw
|
||||
|
||||
let line = getline(prevlnum)
|
||||
if line =~ s:array_entry
|
||||
if line =~ s:named_module_entry
|
||||
return increase
|
||||
else
|
||||
return maintain
|
||||
endif
|
||||
elseif line =~ s:dictionary_entry
|
||||
return increase
|
||||
elseif line =~ s:key_value
|
||||
if line =~ s:scalar_value
|
||||
return increase
|
||||
else
|
||||
return maintain
|
||||
endif
|
||||
else
|
||||
return maintain
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
|
||||
endif
|
||||
13
indent/dart.vim
Normal file
13
indent/dart.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
|
||||
|
||||
if exists('b:did_indent')
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal cindent
|
||||
setlocal cinoptions+=j1,J1
|
||||
|
||||
let b:undo_indent = 'setl cin< cino<'
|
||||
|
||||
endif
|
||||
129
indent/elm.vim
Normal file
129
indent/elm.vim
Normal file
@@ -0,0 +1,129 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: Haskell
|
||||
" Maintainer: lilydjwg <lilydjwg@gmail.com>
|
||||
" Version: 1.0
|
||||
" References: http://en.wikibooks.org/wiki/Haskell/Indentation
|
||||
" http://book.realworldhaskell.org/read/
|
||||
" See Also: The Align plugin http://www.vim.org/scripts/script.php?script_id=294
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=HaskellIndent()
|
||||
for i in split('0{,:,0#,e', ',')
|
||||
exec "setlocal indentkeys-=" . i
|
||||
endfor
|
||||
setlocal indentkeys+=0=else,0=in,0=where,0),0<bar>
|
||||
setlocal tabstop=8
|
||||
setlocal expandtab
|
||||
|
||||
if !exists('g:Haskell_no_mapping')
|
||||
inoremap <silent> <BS> <C-R>=<SID>HaskellDedent(1)<CR>
|
||||
inoremap <silent> <C-D> <C-R>=<SID>HaskellDedent(0)<CR>
|
||||
endif
|
||||
|
||||
" Only define the functions once.
|
||||
if exists("*HaskellIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:align_map = {
|
||||
\ 'in': '\<let\>',
|
||||
\ '\<else\>': '\<then\>',
|
||||
\ ',': '\v%(\s|\w|^)@<=[[{]%(\s|\w|"|$)@='
|
||||
\ }
|
||||
let s:indent_self = ['=']
|
||||
let s:indent_next = ['let', 'in', 'where', 'do', 'if']
|
||||
let s:indent_if_final = ['=', 'do', '->', 'of', 'where']
|
||||
|
||||
function HaskellIndent()
|
||||
let lnum = v:lnum - 1
|
||||
|
||||
" Hit the start of the file, use zero indent.
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ind = indent(lnum)
|
||||
let prevline = getline(lnum)
|
||||
let curline = getline(v:lnum)
|
||||
let curwords = split(curline)
|
||||
if len(curwords) > 0
|
||||
if has_key(s:align_map, curwords[0])
|
||||
let word = s:align_map[curwords[0]]
|
||||
let m = -1
|
||||
let line = v:lnum
|
||||
while m == -1
|
||||
let line -= 1
|
||||
if line <= 0
|
||||
return -1
|
||||
endif
|
||||
let m = match(getline(line), word)
|
||||
endwhile
|
||||
return m
|
||||
elseif index(s:indent_self, curwords[0]) != -1
|
||||
return ind + &sw
|
||||
elseif curwords[0] == '|'
|
||||
return match(prevline, '\v%(\s|\w|^)@<=[|=]%(\s|\w)@=')
|
||||
elseif index([')', '}'], curwords[0]) != -1
|
||||
return ind - &sw
|
||||
elseif curwords[0] == 'where'
|
||||
if prevline =~ '\v^\s+\|%(\s|\w)@='
|
||||
return ind - 1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
let prevwords = split(prevline)
|
||||
if len(prevwords) == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
if prevwords[-1] == 'where' && prevwords[0] == 'module'
|
||||
return 0
|
||||
elseif index(s:indent_if_final, prevwords[-1]) != -1
|
||||
return ind + &sw
|
||||
elseif prevwords[-1] =~ '\v%(\s|\w|^)@<=[[{(]$'
|
||||
return ind + &sw
|
||||
else
|
||||
for word in reverse(prevwords)
|
||||
if index(s:indent_next, word) != -1
|
||||
return match(prevline, '\<'.word.'\>') + len(word) + 1
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
if len(curwords) > 0 && curwords[0] == 'where'
|
||||
return ind + &sw
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
function s:HaskellDedent(isbs)
|
||||
if a:isbs && strpart(getline('.'), 0, col('.')-1) !~ '^\s\+$'
|
||||
return "\<BS>"
|
||||
endif
|
||||
|
||||
let curind = indent('.')
|
||||
let line = line('.') - 1
|
||||
while curind > 0 && line > 0
|
||||
let ind = indent(line)
|
||||
if ind >= curind
|
||||
let line -= 1
|
||||
else
|
||||
echomsg curind ind
|
||||
call setline('.', repeat(' ', ind) .
|
||||
\ substitute(getline('.'), '^\s\+', '', ''))
|
||||
return ''
|
||||
endif
|
||||
endwhile
|
||||
return a:isbs ? "\<BS>" : ''
|
||||
endfunction
|
||||
|
||||
endif
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Vim indent file
|
||||
" Language: git config file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2012 April 7
|
||||
" Last Change: 2013 May 30
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
|
||||
14
indent/glsl.vim
Normal file
14
indent/glsl.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
|
||||
|
||||
" Language: OpenGL Shading Language
|
||||
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
setlocal autoindent cindent
|
||||
|
||||
" vim:set sts=2 sw=2 :
|
||||
|
||||
endif
|
||||
104
indent/handlebars.vim
Normal file
104
indent/handlebars.vim
Normal file
@@ -0,0 +1,104 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1
|
||||
|
||||
" Mustache & Handlebars syntax
|
||||
" Language: Mustache, Handlebars
|
||||
" Maintainer: Juvenn Woo <machese@gmail.com>
|
||||
" Screenshot: http://imgur.com/6F408
|
||||
" Version: 2
|
||||
" Last Change: Oct 10th 2015
|
||||
" Remarks: based on eruby indent plugin by tpope
|
||||
" References:
|
||||
" [Mustache](http://github.com/defunkt/mustache)
|
||||
" [Handlebars](https://github.com/wycats/handlebars.js)
|
||||
" [ctemplate](http://code.google.com/p/google-ctemplate/)
|
||||
" [ctemplate doc](http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html)
|
||||
" [et](http://www.ivan.fomichev.name/2008/05/erlang-template-engine-prototype.html)
|
||||
|
||||
if exists("b:did_indent_hbs")
|
||||
finish
|
||||
endif
|
||||
|
||||
unlet! b:did_indent
|
||||
setlocal indentexpr=
|
||||
|
||||
runtime! indent/html.vim
|
||||
unlet! b:did_indent
|
||||
|
||||
" Force HTML indent to not keep state.
|
||||
let b:html_indent_usestate = 0
|
||||
|
||||
if &l:indentexpr == ''
|
||||
if &l:cindent
|
||||
let &l:indentexpr = 'cindent(v:lnum)'
|
||||
else
|
||||
let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))'
|
||||
endif
|
||||
endif
|
||||
let b:handlebars_subtype_indentexpr = &l:indentexpr
|
||||
|
||||
let b:did_indent = 1
|
||||
let b:did_indent_hbs = 1
|
||||
|
||||
setlocal indentexpr=GetHandlebarsIndent()
|
||||
setlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],o,O,!^F,=end,=else,=elsif,=rescue,=ensure,=when
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetHandlebarsIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
function! GetHandlebarsIndent(...)
|
||||
" The value of a single shift-width
|
||||
if exists('*shiftwidth')
|
||||
let sw = shiftwidth()
|
||||
else
|
||||
let sw = &sw
|
||||
endif
|
||||
|
||||
if a:0 && a:1 == '.'
|
||||
let v:lnum = line('.')
|
||||
elseif a:0 && a:1 =~ '^\d'
|
||||
let v:lnum = a:1
|
||||
endif
|
||||
let vcol = col('.')
|
||||
call cursor(v:lnum,1)
|
||||
call cursor(v:lnum,vcol)
|
||||
exe "let ind = ".b:handlebars_subtype_indentexpr
|
||||
|
||||
" Workaround for Andy Wokula's HTML indent. This should be removed after
|
||||
" some time, since the newest version is fixed in a different way.
|
||||
if b:handlebars_subtype_indentexpr =~# '^HtmlIndent('
|
||||
\ && exists('b:indent')
|
||||
\ && type(b:indent) == type({})
|
||||
\ && has_key(b:indent, 'lnum')
|
||||
" Force HTML indent to not keep state
|
||||
let b:indent.lnum = -1
|
||||
endif
|
||||
let lnum = prevnonblank(v:lnum-1)
|
||||
let line = getline(lnum)
|
||||
let cline = getline(v:lnum)
|
||||
|
||||
" all indent rules only apply if the block opening/closing
|
||||
" tag is on a separate line
|
||||
|
||||
" indent after block {{#block
|
||||
if line =~# '\v\s*\{\{\#.*\s*'
|
||||
let ind = ind + sw
|
||||
endif
|
||||
" unindent after block close {{/block}}
|
||||
if cline =~# '\v^\s*\{\{\/\S*\}\}\s*'
|
||||
let ind = ind - sw
|
||||
endif
|
||||
" unindent {{else}}
|
||||
if cline =~# '\v^\s*\{\{else.*\}\}\s*$'
|
||||
let ind = ind - sw
|
||||
endif
|
||||
" indent again after {{else}}
|
||||
if line =~# '\v^\s*\{\{else.*\}\}\s*$'
|
||||
let ind = ind + sw
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
endif
|
||||
@@ -65,6 +65,15 @@ function! GetHaskellIndent()
|
||||
return match(l:prevline, '\S')
|
||||
endif
|
||||
|
||||
if synIDattr(synID(line("."), col("."), 1), "name") == 'haskellBlockComment'
|
||||
for l:c in range(v:lnum - 1, 0, -1)
|
||||
let l:bline = getline(l:c)
|
||||
if l:bline =~ '{-'
|
||||
return 1 + match(l:bline, '{-')
|
||||
endfor
|
||||
return 1
|
||||
endif
|
||||
|
||||
if l:prevline =~ '^\s*$'
|
||||
return 0
|
||||
endif
|
||||
|
||||
16
indent/jinja.vim
Normal file
16
indent/jinja.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jinja') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: Jinja HTML template
|
||||
" Maintainer: Evan Hammer <evan@evanhammer.com>
|
||||
" Last Change: 2013 Jan 26
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Use HTML formatting rules.
|
||||
runtime! indent/html.vim
|
||||
|
||||
endif
|
||||
54
indent/kotlin.vim
Normal file
54
indent/kotlin.vim
Normal file
@@ -0,0 +1,54 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: Kotlin
|
||||
" Maintainer: Alexander Udalov
|
||||
" Latest Revision: 27 June 2015
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetKotlinIndent()
|
||||
setlocal indentkeys=0},0),!^F,o,O,e,<CR>
|
||||
setlocal autoindent " TODO ?
|
||||
|
||||
" TODO teach it to count bracket balance, etc.
|
||||
function! GetKotlinIndent()
|
||||
if v:lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let prev_num = prevnonblank(v:lnum - 1)
|
||||
let prev = getline(prev_num)
|
||||
let prev_indent = indent(prev_num)
|
||||
let cur = getline(v:lnum)
|
||||
|
||||
let prev_open_paren = prev =~ '^.*(\s*$'
|
||||
let cur_close_paren = cur =~ '^\s*).*$'
|
||||
|
||||
if prev_open_paren && !cur_close_paren
|
||||
return prev_indent + 2 * &shiftwidth
|
||||
endif
|
||||
|
||||
if cur_close_paren && !prev_open_paren
|
||||
return prev_indent - 2 * &shiftwidth
|
||||
endif
|
||||
|
||||
|
||||
let prev_open_brace = prev =~ '^.*\({\|->\)\s*$'
|
||||
let cur_close_brace = cur =~ '^\s*}.*$'
|
||||
|
||||
if prev_open_brace && !cur_close_brace
|
||||
return prev_indent + &shiftwidth
|
||||
endif
|
||||
|
||||
if cur_close_brace && !prev_open_brace
|
||||
return prev_indent - &shiftwidth
|
||||
endif
|
||||
|
||||
return prev_indent
|
||||
endfunction
|
||||
|
||||
endif
|
||||
15
indent/nginx.vim
Normal file
15
indent/nginx.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=
|
||||
|
||||
" cindent actually works for nginx' simple file structure
|
||||
setlocal cindent
|
||||
" Just make sure that the comments are not reset as defs would be.
|
||||
setlocal cinkeys-=0#
|
||||
|
||||
endif
|
||||
63
indent/qml.vim
Normal file
63
indent/qml.vim
Normal file
@@ -0,0 +1,63 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: QML
|
||||
" Author: Robert Kieffer
|
||||
" URL:
|
||||
" Last Change: 2010-03-27 (Happy Birthday, Dash!)
|
||||
"
|
||||
" Improved JavaScript indent script.
|
||||
|
||||
" Indent script in place for this already?
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetJsIndent()
|
||||
setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e,*<Return>,=*/
|
||||
|
||||
" Only define functions once per session
|
||||
if exists("*GetJsIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Clean up a line of code by removing trailing '//' comments, and trimming
|
||||
" whitespace
|
||||
function! Trim(line)
|
||||
return substitute(substitute(a:line, '// .*', '', ''), '^\s*\|\s*$', '', 'g')
|
||||
endfunction
|
||||
|
||||
function! GetJsIndent()
|
||||
let num = v:lnum
|
||||
let line = Trim(getline(num))
|
||||
|
||||
let pnum = prevnonblank(num - 1)
|
||||
if pnum == 0
|
||||
return 0
|
||||
endif
|
||||
let pline = Trim(getline(pnum))
|
||||
|
||||
let ind = indent(pnum)
|
||||
|
||||
" bracket/brace/paren blocks
|
||||
if pline =~ '[{[(]$'
|
||||
let ind += &sw
|
||||
endif
|
||||
if line =~ '^[}\])]'
|
||||
let ind -= &sw
|
||||
endif
|
||||
|
||||
" '/*' comments
|
||||
if pline =~ '^/\*.*\*/'
|
||||
" no indent for single-line form
|
||||
elseif pline =~ '^/\*'
|
||||
let ind += 1
|
||||
elseif pline =~ '^\*/'
|
||||
let ind -= 1
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
endif
|
||||
@@ -123,6 +123,13 @@ function GetRustIndent(lnum)
|
||||
let prevlinenum = prevnonblank(prevlinenum - 1)
|
||||
let prevline = s:get_line_trimmed(prevlinenum)
|
||||
endwhile
|
||||
|
||||
" Handle where clauses nicely: subsequent values should line up nicely.
|
||||
if prevline[len(prevline) - 1] == ","
|
||||
\ && prevline =~# '^\s*where\s'
|
||||
return indent(prevlinenum) + 6
|
||||
endif
|
||||
|
||||
if prevline[len(prevline) - 1] == ","
|
||||
\ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]'
|
||||
\ && prevline !~ '^\s*fn\s'
|
||||
|
||||
@@ -119,7 +119,7 @@ function! GetStylusIndent()
|
||||
|
||||
" if group !~? 'css.*' && line =~? ')\s*$' " match user functions
|
||||
" return increase
|
||||
if group =~? '\v^%(cssTagName|cssClassName|cssIdentifier|cssSelectorOp|cssSelectorOp2|cssBraces|cssAttributeSelector|cssPseudoClass|cssPseudoClassId|stylusId|stylusClass)$'
|
||||
if group =~? '\v^%(cssTagName|cssClassName|cssIdentifier|cssSelectorOp|cssSelectorOp2|cssBraces|cssAttributeSelector|cssPseudo|stylusId|stylusClass)$'
|
||||
return increase
|
||||
elseif (group == 'stylusUserFunction') && (indent(lnum) == '0') " mixin definition
|
||||
return increase
|
||||
|
||||
229
indent/swift.vim
229
indent/swift.vim
@@ -1,19 +1,230 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
|
||||
|
||||
" Language: Swift<https://developer.apple.com/swift/>
|
||||
" Maintainer: toyama satoshi <toyamarinyon@gmail.com>
|
||||
" URL: http://github.com/toyamarinyon/vim-swift
|
||||
" License: GPL
|
||||
" File: swift.vim
|
||||
" Author: Keith Smiley
|
||||
" Description: The indent file for Swift
|
||||
" Last Modified: December 05, 2014
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
" C indenting is built-in, thus this is very simple
|
||||
setlocal cindent
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_indent = "setl cin<"
|
||||
setlocal nosmartindent
|
||||
setlocal indentkeys-=:
|
||||
setlocal indentkeys-=e
|
||||
setlocal indentkeys+=0]
|
||||
setlocal indentexpr=SwiftIndent()
|
||||
|
||||
function! s:NumberOfMatches(char, string, index)
|
||||
let instances = 0
|
||||
let i = 0
|
||||
while i < strlen(a:string)
|
||||
if a:string[i] == a:char && !s:IsExcludedFromIndentAtPosition(a:index, i + 1)
|
||||
let instances += 1
|
||||
endif
|
||||
|
||||
let i += 1
|
||||
endwhile
|
||||
|
||||
return instances
|
||||
endfunction
|
||||
|
||||
function! s:SyntaxNameAtPosition(line, column)
|
||||
return synIDattr(synID(a:line, a:column, 0), "name")
|
||||
endfunction
|
||||
|
||||
function! s:SyntaxName()
|
||||
return s:SyntaxNameAtPosition(line("."), col("."))
|
||||
endfunction
|
||||
|
||||
function! s:IsExcludedFromIndentAtPosition(line, column)
|
||||
let name = s:SyntaxNameAtPosition(a:line, a:column)
|
||||
return name ==# "swiftComment" || name ==# "swiftString"
|
||||
endfunction
|
||||
|
||||
function! s:IsExcludedFromIndent()
|
||||
return s:SyntaxName() ==# "swiftComment" || s:SyntaxName() ==# "swiftString"
|
||||
endfunction
|
||||
|
||||
function! s:IsCommentLine(lnum)
|
||||
return synIDattr(synID(a:lnum,
|
||||
\ match(getline(a:lnum), "\S") + 1, 0), "name")
|
||||
\ ==# "swiftComment"
|
||||
endfunction
|
||||
|
||||
function! SwiftIndent(...)
|
||||
let clnum = a:0 ? a:1 : v:lnum
|
||||
|
||||
let line = getline(clnum)
|
||||
let previousNum = prevnonblank(clnum - 1)
|
||||
while s:IsCommentLine(previousNum) != 0
|
||||
let previousNum = prevnonblank(previousNum - 1)
|
||||
endwhile
|
||||
|
||||
let previous = getline(previousNum)
|
||||
let cindent = cindent(clnum)
|
||||
let previousIndent = indent(previousNum)
|
||||
|
||||
let numOpenParens = s:NumberOfMatches("(", previous, previousNum)
|
||||
let numCloseParens = s:NumberOfMatches(")", previous, previousNum)
|
||||
let numOpenBrackets = s:NumberOfMatches("{", previous, previousNum)
|
||||
let numCloseBrackets = s:NumberOfMatches("}", previous, previousNum)
|
||||
|
||||
let currentOpenBrackets = s:NumberOfMatches("{", line, clnum)
|
||||
let currentCloseBrackets = s:NumberOfMatches("}", line, clnum)
|
||||
|
||||
let numOpenSquare = s:NumberOfMatches("[", previous, previousNum)
|
||||
let numCloseSquare = s:NumberOfMatches("]", previous, previousNum)
|
||||
|
||||
let currentCloseSquare = s:NumberOfMatches("]", line, clnum)
|
||||
if numOpenSquare > numCloseSquare && currentCloseSquare < 1
|
||||
return previousIndent + shiftwidth()
|
||||
endif
|
||||
|
||||
if currentCloseSquare > 0 && line !~ '\v\[.*\]'
|
||||
let column = col(".")
|
||||
call cursor(line("."), 1)
|
||||
let openingSquare = searchpair("\\[", "", "\\]", "bWn", "s:IsExcludedFromIndent()")
|
||||
call cursor(line("."), column)
|
||||
|
||||
if openingSquare == 0
|
||||
return -1
|
||||
endif
|
||||
|
||||
return indent(openingSquare)
|
||||
endif
|
||||
|
||||
if s:IsExcludedFromIndent()
|
||||
return previousIndent
|
||||
endif
|
||||
|
||||
if line =~ ":$"
|
||||
let switch = search("switch", "bWn")
|
||||
return indent(switch)
|
||||
elseif previous =~ ":$"
|
||||
return previousIndent + shiftwidth()
|
||||
endif
|
||||
|
||||
if numOpenParens == numCloseParens
|
||||
if numOpenBrackets > numCloseBrackets
|
||||
if currentCloseBrackets > currentOpenBrackets || line =~ "\\v^\\s*}"
|
||||
let column = col(".")
|
||||
call cursor(line("."), 1)
|
||||
let openingBracket = searchpair("{", "", "}", "bWn", "s:IsExcludedFromIndent()")
|
||||
call cursor(line("."), column)
|
||||
if openingBracket == 0
|
||||
return -1
|
||||
else
|
||||
return indent(openingBracket)
|
||||
endif
|
||||
endif
|
||||
|
||||
return previousIndent + shiftwidth()
|
||||
elseif previous =~ "}.*{"
|
||||
if line =~ "\\v^\\s*}"
|
||||
return previousIndent
|
||||
endif
|
||||
|
||||
return previousIndent + shiftwidth()
|
||||
elseif line =~ "}.*{"
|
||||
let openingBracket = searchpair("{", "", "}", "bWn", "s:IsExcludedFromIndent()")
|
||||
return indent(openingBracket)
|
||||
elseif currentCloseBrackets > currentOpenBrackets
|
||||
let column = col(".")
|
||||
call cursor(line("."), 1)
|
||||
let openingBracket = searchpair("{", "", "}", "bWn", "s:IsExcludedFromIndent()")
|
||||
call cursor(line("."), column)
|
||||
|
||||
let bracketLine = getline(openingBracket)
|
||||
|
||||
let numOpenParensBracketLine = s:NumberOfMatches("(", bracketLine, openingBracket)
|
||||
let numCloseParensBracketLine = s:NumberOfMatches(")", bracketLine, openingBracket)
|
||||
if numCloseParensBracketLine > numOpenParensBracketLine
|
||||
let line = line(".")
|
||||
let column = col(".")
|
||||
call cursor(openingParen, column)
|
||||
let openingParen = searchpair("(", "", ")", "bWn", "s:IsExcludedFromIndent()")
|
||||
call cursor(line, column)
|
||||
return indent(openingParen)
|
||||
endif
|
||||
return indent(openingBracket)
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endif
|
||||
|
||||
if numCloseParens > 0
|
||||
if currentOpenBrackets > 0 || currentCloseBrackets > 0
|
||||
if currentOpenBrackets > 0
|
||||
if numOpenBrackets > numCloseBrackets
|
||||
return previousIndent + shiftwidth()
|
||||
endif
|
||||
|
||||
if line =~ "}.*{"
|
||||
let openingBracket = searchpair("{", "", "}", "bWn", "s:IsExcludedFromIndent()")
|
||||
return indent(openingBracket)
|
||||
endif
|
||||
|
||||
if numCloseParens > numOpenParens
|
||||
let line = line(".")
|
||||
let column = col(".")
|
||||
call cursor(line - 1, column)
|
||||
let openingParen = searchpair("(", "", ")", "bWn", "s:IsExcludedFromIndent()")
|
||||
call cursor(line, column)
|
||||
return indent(openingParen)
|
||||
endif
|
||||
|
||||
return previousIndent
|
||||
endif
|
||||
|
||||
if currentCloseBrackets > 0
|
||||
let openingBracket = searchpair("{", "", "}", "bWn", "s:IsExcludedFromIndent()")
|
||||
return indent(openingBracket)
|
||||
endif
|
||||
|
||||
return cindent
|
||||
endif
|
||||
|
||||
if numCloseParens < numOpenParens
|
||||
if numOpenBrackets > numCloseBrackets
|
||||
return previousIndent + shiftwidth()
|
||||
endif
|
||||
|
||||
let previousParen = match(previous, "(")
|
||||
return previousParen + 1
|
||||
endif
|
||||
|
||||
if numOpenBrackets > numCloseBrackets
|
||||
let line = line(".")
|
||||
let column = col(".")
|
||||
call cursor(previousNum, column)
|
||||
let openingParen = searchpair("(", "", ")", "bWn", "s:IsExcludedFromIndent()")
|
||||
call cursor(line, column)
|
||||
return indent(openingParen) + shiftwidth()
|
||||
endif
|
||||
|
||||
let line = line(".")
|
||||
let column = col(".")
|
||||
call cursor(previousNum, column)
|
||||
let openingParen = searchpair("(", "", ")", "bWn", "s:IsExcludedFromIndent()")
|
||||
call cursor(line, column)
|
||||
|
||||
return indent(openingParen)
|
||||
endif
|
||||
|
||||
if numOpenParens > 0
|
||||
let previousParen = match(previous, "(")
|
||||
return previousParen + 1
|
||||
endif
|
||||
|
||||
return cindent
|
||||
endfunction
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
endif
|
||||
|
||||
@@ -60,9 +60,21 @@ function GetTypescriptIndent()
|
||||
return indent(prev)
|
||||
endif
|
||||
|
||||
" If a variable was declared and the semicolon omitted, do not indent
|
||||
" the next line
|
||||
if getline(prev) =~ '^\s*var\s\+\w\+'
|
||||
" If the previous line starts with '@', we should have the same indent as
|
||||
" the previous one
|
||||
if getline(prev) =~ '^\s*@\S\+\s*$'
|
||||
return indent(prev)
|
||||
endif
|
||||
|
||||
" If a var, let, or const was declared and the semicolon omitted, do not
|
||||
" indent the next line
|
||||
if getline(prev) =~ '^\s*\(var\|let\|const\)\s\+\w\+'
|
||||
return indent(prev)
|
||||
endif
|
||||
|
||||
" If the line ended with a ',', we should have the same indent as
|
||||
" the previous one
|
||||
if getline(prev) =~ ',\s*$'
|
||||
return indent(prev)
|
||||
endif
|
||||
|
||||
|
||||
90
syntax/ansible.vim
Normal file
90
syntax/ansible.vim
Normal file
@@ -0,0 +1,90 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: Ansible YAML/Jinja templates
|
||||
" Maintainer: Dave Honneffer <pearofducks@gmail.com>
|
||||
" Last Change: 2015.09.06
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists("main_syntax")
|
||||
let main_syntax = 'yaml'
|
||||
endif
|
||||
|
||||
let b:current_syntax = ''
|
||||
unlet b:current_syntax
|
||||
runtime! syntax/yaml.vim
|
||||
|
||||
let b:current_syntax = ''
|
||||
unlet b:current_syntax
|
||||
syntax include @Yaml syntax/yaml.vim
|
||||
|
||||
let b:current_syntax = ''
|
||||
unlet b:current_syntax
|
||||
syntax include @Jinja syntax/jinja2.vim
|
||||
|
||||
" Jinja
|
||||
" ================================
|
||||
|
||||
syn cluster jinjaSLSBlocks add=jinjaTagBlock,jinjaVarBlock,jinjaComment
|
||||
" https://github.com/mitsuhiko/jinja2/blob/6b7c0c23/ext/Vim/jinja.vim
|
||||
syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment,@jinjaSLSBlocks
|
||||
syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment,@jinjaSLSBlocks
|
||||
syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,@jinjaSLSBlocks
|
||||
highlight link jinjaVariable Constant
|
||||
highlight link jinjaVarDelim Delimiter
|
||||
|
||||
" YAML
|
||||
" ================================
|
||||
|
||||
" Reset some YAML to plain styling
|
||||
" the number 80 in Ansible isn't any more important than the word root
|
||||
highlight link yamlInteger NONE
|
||||
highlight link yamlBool NONE
|
||||
highlight link yamlFlowString NONE
|
||||
" but it does make sense we visualize quotes easily
|
||||
highlight link yamlFlowStringDelimiter Delimiter
|
||||
|
||||
fun! s:attribute_highlight(attributes)
|
||||
if a:attributes =~ 'a'
|
||||
syn match ansible_attributes "\v\w+\=" containedin=yamlPlainScalar
|
||||
else
|
||||
syn match ansible_attributes "\v^\s*\w+\=" containedin=yamlPlainScalar
|
||||
endif
|
||||
if a:attributes =~ 'n'
|
||||
highlight link ansible_attributes NONE
|
||||
elseif a:attributes =~ 'd'
|
||||
highlight link ansible_attributes Comment
|
||||
else
|
||||
highlight link ansible_attributes Structure
|
||||
endif
|
||||
endfun
|
||||
|
||||
if exists("g:ansible_attribute_highlight")
|
||||
call s:attribute_highlight(g:ansible_attribute_highlight)
|
||||
else
|
||||
call s:attribute_highlight('ad')
|
||||
endif
|
||||
|
||||
if exists("g:ansible_name_highlight")
|
||||
syn keyword ansible_name name containedin=yamlBlockMappingKey contained
|
||||
if g:ansible_name_highlight =~ 'd'
|
||||
highlight link ansible_name Comment
|
||||
else
|
||||
highlight link ansible_name Underlined
|
||||
endif
|
||||
endif
|
||||
|
||||
syn keyword ansible_debug_keywords debug containedin=yamlBlockMappingKey contained
|
||||
highlight link ansible_debug_keywords Debug
|
||||
|
||||
syn match ansible_with_keywords "\vwith_.+" containedin=yamlBlockMappingKey contained
|
||||
syn keyword ansible_special_keywords include until retries delay when only_if become become_user block rescue always notify containedin=yamlBlockMappingKey contained
|
||||
highlight link ansible_with_keywords Statement
|
||||
highlight link ansible_special_keywords Statement
|
||||
|
||||
let b:current_syntax = "ansible"
|
||||
|
||||
endif
|
||||
35
syntax/ansible_hosts.vim
Normal file
35
syntax/ansible_hosts.vim
Normal file
@@ -0,0 +1,35 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: Ansible hosts files
|
||||
" Maintainer: Dave Honneffer <pearofducks@gmail.com>
|
||||
" Last Change: 2015.09.23
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn case ignore
|
||||
syn match hostsFirstWord "\v^\S+"
|
||||
syn match hostsAttributes "\v\S*\="
|
||||
syn region hostsHeader start="\v^\s*\[" end="\v\]"
|
||||
syn keyword hostsHeaderSpecials children vars containedin=hostsHeader contained
|
||||
syn match hostsComment "\v^[#;].*$"
|
||||
|
||||
highlight link hostsFirstWord Label
|
||||
highlight link hostsHeader Define
|
||||
highlight link hostsComment Comment
|
||||
highlight link hostsHeaderSpecials Identifier
|
||||
highlight link hostsAttributes Structure
|
||||
|
||||
if exists("g:ansible_attribute_highlight")
|
||||
if g:ansible_attribute_highlight =~ 'n'
|
||||
highlight link hostsAttributes NONE
|
||||
elseif g:ansible_attribute_highlight =~ 'd'
|
||||
highlight link hostsAttributes Comment
|
||||
endif
|
||||
endif
|
||||
|
||||
let b:current_syntax = "ansible_hosts"
|
||||
|
||||
endif
|
||||
31
syntax/ansible_template.vim
Normal file
31
syntax/ansible_template.vim
Normal file
@@ -0,0 +1,31 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: Ansible YAML/Jinja templates
|
||||
" Maintainer: Dave Honneffer <pearofducks@gmail.com>
|
||||
" Last Change: 2015.09.06
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists("main_syntax")
|
||||
let main_syntax = 'jinja2'
|
||||
endif
|
||||
|
||||
let b:current_syntax = ''
|
||||
unlet b:current_syntax
|
||||
runtime! syntax/jinja2.vim
|
||||
|
||||
if exists("g:ansible_extra_syntaxes")
|
||||
let s:extra_syntax = split(g:ansible_extra_syntaxes)
|
||||
for syntax_name in s:extra_syntax
|
||||
let b:current_syntax = ''
|
||||
unlet b:current_syntax
|
||||
execute 'runtime!' "syntax/" . syntax_name
|
||||
endfor
|
||||
endif
|
||||
|
||||
let b:current_syntax = "ansible_template"
|
||||
|
||||
endif
|
||||
@@ -73,7 +73,7 @@ syntax match clojureKeyword "\v<:{1,2}%([^ \n\r\t()\[\]{}";@^`~\\%/]+/)*[^ \n\r\
|
||||
|
||||
syntax match clojureStringEscape "\v\\%([\\btnfr"]|u\x{4}|[0-3]\o{2}|\o{1,2})" contained
|
||||
|
||||
syntax region clojureString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=clojureStringEscape,@Spell
|
||||
syntax region clojureString matchgroup=clojureStringDelimiter start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=clojureStringEscape,@Spell
|
||||
|
||||
syntax match clojureCharacter "\\."
|
||||
syntax match clojureCharacter "\\o\%([0-3]\o\{2\}\|\o\{1,2\}\)"
|
||||
@@ -156,9 +156,9 @@ syntax match clojureComment "#!.*$"
|
||||
" Generated from https://github.com/guns/vim-clojure-static/blob/%%RELEASE_TAG%%/clj/src/vim_clojure_static/generate.clj
|
||||
syntax cluster clojureTop contains=@Spell,clojureAnonArg,clojureBoolean,clojureCharacter,clojureComment,clojureCond,clojureConstant,clojureDefine,clojureDeref,clojureDispatch,clojureError,clojureException,clojureFunc,clojureKeyword,clojureMacro,clojureMap,clojureMeta,clojureNumber,clojureQuote,clojureRegexp,clojureRepeat,clojureSexp,clojureSpecial,clojureString,clojureSymbol,clojureUnquote,clojureVarArg,clojureVariable,clojureVector
|
||||
|
||||
syntax region clojureSexp matchgroup=clojureParen start="(" matchgroup=clojureParen end=")" contains=@clojureTop fold
|
||||
syntax region clojureVector matchgroup=clojureParen start="\[" matchgroup=clojureParen end="]" contains=@clojureTop fold
|
||||
syntax region clojureMap matchgroup=clojureParen start="{" matchgroup=clojureParen end="}" contains=@clojureTop fold
|
||||
syntax region clojureSexp matchgroup=clojureParen start="(" end=")" contains=@clojureTop fold
|
||||
syntax region clojureVector matchgroup=clojureParen start="\[" end="]" contains=@clojureTop fold
|
||||
syntax region clojureMap matchgroup=clojureParen start="{" end="}" contains=@clojureTop fold
|
||||
|
||||
" Highlight superfluous closing parens, brackets and braces.
|
||||
syntax match clojureError "]\|}\|)"
|
||||
@@ -171,6 +171,7 @@ highlight default link clojureCharacter Character
|
||||
highlight default link clojureKeyword Keyword
|
||||
highlight default link clojureNumber Number
|
||||
highlight default link clojureString String
|
||||
highlight default link clojureStringDelimiter String
|
||||
highlight default link clojureStringEscape Character
|
||||
|
||||
highlight default link clojureRegexp Constant
|
||||
|
||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'c/c++') == -1
|
||||
" Language: C++
|
||||
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
|
||||
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
||||
" Last Change: 2015 Mar 1
|
||||
" Last Change: 2015 Sep 23
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
@@ -25,7 +25,8 @@ endif
|
||||
" C++ extensions
|
||||
syn keyword cppStatement new delete this friend using
|
||||
syn keyword cppAccess public protected private
|
||||
syn keyword cppType inline virtual explicit export bool wchar_t
|
||||
syn keyword cppModifier inline virtual explicit export
|
||||
syn keyword cppType bool wchar_t
|
||||
syn keyword cppExceptions throw try catch
|
||||
syn keyword cppOperator operator typeid
|
||||
syn keyword cppOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq
|
||||
@@ -38,7 +39,8 @@ syn keyword cppConstant __cplusplus
|
||||
|
||||
" C++ 11 extensions
|
||||
if !exists("cpp_no_cpp11")
|
||||
syn keyword cppType override final
|
||||
syn keyword cppModifier override final
|
||||
syn keyword cppType nullptr_t
|
||||
syn keyword cppExceptions noexcept
|
||||
syn keyword cppStorageClass constexpr decltype thread_local
|
||||
syn keyword cppConstant nullptr
|
||||
@@ -51,6 +53,11 @@ if !exists("cpp_no_cpp11")
|
||||
syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
|
||||
endif
|
||||
|
||||
" C++ 14 extensions
|
||||
if !exists("cpp_no_cpp14")
|
||||
syn match cppNumber display "\<0b[01]\+\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
endif
|
||||
|
||||
" The minimum and maximum operators in GNU C++
|
||||
syn match cppMinMax "[<>]?"
|
||||
|
||||
@@ -67,6 +74,7 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
|
||||
HiLink cppExceptions Exception
|
||||
HiLink cppOperator Operator
|
||||
HiLink cppStatement Statement
|
||||
HiLink cppModifier Type
|
||||
HiLink cppType Type
|
||||
HiLink cppStorageClass StorageClass
|
||||
HiLink cppStructure Structure
|
||||
@@ -74,6 +82,7 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
|
||||
HiLink cppConstant Constant
|
||||
HiLink cppRawStringDelimiter Delimiter
|
||||
HiLink cppRawString String
|
||||
HiLink cppNumber Number
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
|
||||
134
syntax/cql.vim
Normal file
134
syntax/cql.vim
Normal file
@@ -0,0 +1,134 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cql') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: cql
|
||||
" Maintainer: Eric Lubow <eric@lubow.org
|
||||
" Filenames: *.cql
|
||||
" URL: https://github.com/elubow/cql-vim
|
||||
" Note:
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Always ignore case
|
||||
syn case ignore
|
||||
|
||||
" General keywords which don't fall into other categories
|
||||
syn keyword cqlKeyword apply and batch
|
||||
syn keyword cqlKeyword column columnfamily create delete drop
|
||||
syn keyword cqlKeyword family first from
|
||||
syn keyword cqlKeyword in index insert into
|
||||
syn keyword cqlKeyword limit key keyspace
|
||||
syn keyword cqlKeyword on or primary reversed
|
||||
syn keyword cqlKeyword select set truncate
|
||||
syn keyword cqlKeyword where with update use using values
|
||||
|
||||
" CQL 3 additions
|
||||
syn keyword cqlKeyword table order by type if exists not frozen
|
||||
|
||||
|
||||
" Column family/table options
|
||||
syn keyword cqlKeyword comparator key_cache_size row_cache_size read_repair_chance
|
||||
syn keyword cqlKeyword gc_grace_seconds default_validation min_compaction_threshold
|
||||
syn keyword cqlKeyword max_compaction_threshold row_cache_save_period_in_seconds
|
||||
syn keyword cqlKeyword key_cache_save_period_in_seconds memtable_flush_after_mins
|
||||
syn keyword cqlKeyword memtable_throughput_in_mb memtable_operations_in_millions replication_on_write
|
||||
syn keyword cqlKeyword replication_on_write default_validation_class key_validation_class
|
||||
syn keyword cqlKeyword rows_cached row_cache_save_period row_cache_keys_to_save keys_cached
|
||||
syn keyword cqlKeyword column_type key_cache_save_period gc_grace replicate_on_write
|
||||
syn keyword cqlKeyword row_cache_provider compaction_strategy column_metadata
|
||||
syn keyword cqlKeyword column_name validation_class subcomparator replication
|
||||
syn keyword cqlKeyword index_name index_type caching dclocal_read_repair_chance
|
||||
syn keyword cqlKeyword bloom_filter_fp_chance populate_io_cache_on_flush compaction
|
||||
syn keyword cqlKeyword compression class sstable_compression
|
||||
|
||||
" CQL 3 additions
|
||||
syn keyword cqlKeyword clustering
|
||||
|
||||
" Keyspace options
|
||||
syn keyword cqlKeyword placement_strategy strategy_options durable_writes replication_factor
|
||||
syn keyword cqlKeyword strategy_class
|
||||
|
||||
" Hadoop keywords
|
||||
syn keyword cqlKeyword currentJobTracker
|
||||
|
||||
|
||||
" TODO Fix to use regions properly
|
||||
syn keyword cqlColType standard super
|
||||
syn region cqlColumnType start="column_type\W" end="\"'" contains=cqlColType
|
||||
|
||||
" TODO Fix to use regions properly
|
||||
syn keyword cqlPStrategy simplestrategy localstrategy networktopologystrategy
|
||||
syn region cqlPlacementStrategy start="placement_strategy\W" end="\"'" contains=cqlPlaceStrategy
|
||||
|
||||
" Comments highlight the word as a keyword and comment as blue
|
||||
syn region cqlKeyword start=/comment\s*=\s*'/ end=/'/ contains=cqlComment
|
||||
syn region cqlKeyword start=/comment\s*=\s*"/ end=/"/ contains=cqlComment
|
||||
syn region cqlComment start="/\*" end="\*/" contains=cqlComment
|
||||
syn match cqlComment /'\zs\%(\\.\|[^\\']\)*\ze'/ contained
|
||||
syn match cqlComment /"\zs\%(\\.\|[^\\"]\)*\ze"/ contained
|
||||
syn match cqlComment "--.*$" contains=cqlComment
|
||||
syn match cqlComment "//.*$" contains=cqlComment
|
||||
syn match cqlComment "/\*\*/"
|
||||
|
||||
" Special values
|
||||
syn keyword cqlSpecial false null true
|
||||
|
||||
" TODO Add ability to include entire Java class name for compaction strategies
|
||||
syn keyword cqlType SizeTieredCompactionStrategy LeveledCompactionStrategy
|
||||
|
||||
" Variable Types
|
||||
syn keyword cqlType bytea ascii text varchar uuid varint int bigint
|
||||
syn keyword cqlType bytestype utf8type timeuuidtype timeuuid timestamp
|
||||
syn keyword cqlType blob boolean counter decimal double float
|
||||
syn keyword cqlType serializingcacheprovider
|
||||
syn keyword cqlType set list map tuple
|
||||
|
||||
" Consistency Levels
|
||||
syn region cqlType start="consistency" end="zero"
|
||||
syn region cqlType start="consistency" end="one"
|
||||
syn region cqlType start="consistency" end="quorum"
|
||||
syn region cqlType start="consistency" end="all"
|
||||
syn region cqlType start="consistency" end="local_quorum"
|
||||
syn region cqlType start="consistency" end="each_quorum"
|
||||
|
||||
" Numbers and hexidecimal values
|
||||
syn match cqlNumber "-\=\<[0-9]*\>"
|
||||
syn match cqlNumber "-\=\<[0-9]*\.[0-9]*\>"
|
||||
syn match cqlNumber "-\=\<[0-9][0-9]*e[+-]\=[0-9]*\>"
|
||||
syn match cqlNumber "-\=\<[0-9]*\.[0-9]*e[+-]\=[0-9]*\>"
|
||||
syn match cqlNumber "\<0x[abcdefABCDEF0-9]*\>"
|
||||
|
||||
" 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_cql_syn_inits")
|
||||
if version < 508
|
||||
let did_cql_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink cqlKeyword Statement
|
||||
HiLink cqlSpecial Special
|
||||
HiLink cqlString String
|
||||
HiLink cqlNumber Number
|
||||
HiLink cqlVariable Identifier
|
||||
HiLink cqlComment Comment
|
||||
HiLink cqlType Type
|
||||
HiLink cqlOperator Statement
|
||||
HiLink cqlConsistency Statement
|
||||
HiLink cqlColType Type
|
||||
HiLink cqlPStrategy Type
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "cql"
|
||||
|
||||
|
||||
endif
|
||||
@@ -8,7 +8,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'css') == -1
|
||||
" Nikolai Weibull (Add CSS2 support)
|
||||
" Maintainer: Jules Wang <w.jq0722@gmail.com>
|
||||
" URL: https://github.com/JulesWang/css.vim
|
||||
" Last Change: 2015 Apr.17
|
||||
" Last Change: 2015 Aug.25
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
@@ -166,8 +166,8 @@ syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajow
|
||||
syn keyword cssColor contained oldlace olivedrab orange orangered orchid
|
||||
syn match cssColor contained /\<pale\(goldenrod\|green\|turquoise\|violetred\)\>/
|
||||
syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue
|
||||
syn keyword cssColor contained rosybrown royalblue saddlebrown salmon sandybrown
|
||||
syn keyword cssColor contained seagreen seashell sienna skyblue slateblue
|
||||
syn keyword cssColor contained rosybrown royalblue rebeccapurple saddlebrown salmon
|
||||
syn keyword cssColor contained sandybrown seagreen seashell sienna skyblue slateblue
|
||||
syn keyword cssColor contained slategray slategrey snow springgreen steelblue tan
|
||||
syn keyword cssColor contained thistle tomato turquoise violet wheat
|
||||
syn keyword cssColor contained whitesmoke yellowgreen
|
||||
|
||||
110
syntax/dart.vim
Normal file
110
syntax/dart.vim
Normal file
@@ -0,0 +1,110 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
|
||||
|
||||
" Vim syntax file " Language: Dart
|
||||
" Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
||||
" for details. All rights reserved. Use of this source code is governed by a
|
||||
" BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
if !exists("g:main_syntax")
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let g:main_syntax = 'dart'
|
||||
syntax region dartFold start="{" end="}" transparent fold
|
||||
endif
|
||||
|
||||
" Ensure long multiline strings are highlighted.
|
||||
syntax sync fromstart
|
||||
|
||||
" keyword definitions
|
||||
syntax keyword dartConditional if else switch
|
||||
syntax keyword dartRepeat do while for
|
||||
syntax keyword dartBoolean true false
|
||||
syntax keyword dartConstant null
|
||||
syntax keyword dartTypedef this super class typedef
|
||||
syntax keyword dartOperator new is as in factory
|
||||
syntax match dartOperator "+=\=\|-=\=\|*=\=\|/=\=\|%=\=\|\~/=\=\|<<=\=\|>>=\=\|[<>]=\=\|===\=\|\!==\=\|&=\=\|\^=\=\||=\=\|||\|&&\|\[\]=\=\|=>\|!\|\~\|?\|:"
|
||||
syntax keyword dartType void var bool int double num dynamic
|
||||
syntax keyword dartStatement return
|
||||
syntax keyword dartStorageClass static abstract final const
|
||||
syntax keyword dartExceptions throw rethrow try on catch finally
|
||||
syntax keyword dartAssert assert
|
||||
syntax keyword dartClassDecl extends with implements
|
||||
syntax keyword dartBranch break continue nextgroup=dartUserLabelRef skipwhite
|
||||
syntax keyword dartKeyword get set operator call external async await yield sync
|
||||
syntax match dartUserLabelRef "\k\+" contained
|
||||
|
||||
syntax region dartLabelRegion transparent matchgroup=dartLabel start="\<case\>" matchgroup=NONE end=":"
|
||||
syntax keyword dartLabel default
|
||||
|
||||
syntax match dartLibrary "^\(import\|part of\|part\|export\|library\|show\|hide\)\s"
|
||||
|
||||
" Comments
|
||||
syntax keyword dartTodo contained TODO FIXME XXX
|
||||
syntax region dartComment start="/\*" end="\*/" contains=dartTodo,dartDocLink,@Spell
|
||||
syntax match dartLineComment "//.*" contains=dartTodo,@Spell
|
||||
syntax match dartLineDocComment "///.*" contains=dartTodo,dartDocLink,@Spell
|
||||
syntax region dartDocLink oneline contained start=+\[+ end=+\]+
|
||||
|
||||
" Strings
|
||||
syntax region dartString start=+\z(["']\)+ end=+\z1+ contains=@Spell,dartInterpolation,dartSpecialChar
|
||||
syntax region dartRawString start=+r\z(["']\)+ end=+\z1+ contains=@Spell
|
||||
syntax region dartMultilineString start=+\z("\{3\}\|'\{3\}\)+ end=+\z1+ contains=@Spell,dartInterpolation,dartSpecialChar
|
||||
syntax region dartRawMultilineString start=+r\z("\{3\}\|'\{3\}\)+ end=+\z1+ contains=@Spell
|
||||
syntax match dartInterpolation contained "\$\(\w\+\|{[^}]\+}\)"
|
||||
syntax match dartSpecialChar contained "\\\(u\x\{4\}\|u{\x\+}\|x\x\x\|x{\x\+}\|.\)"
|
||||
|
||||
" Numbers
|
||||
syntax match dartNumber "\<\d\+\(\.\d\+\)\=\>"
|
||||
|
||||
" TODO(antonm): consider conditional highlighting of corelib classes.
|
||||
syntax keyword dartCoreClasses BidirectionalIterator Comparable DateTime Duration Expando Function Invocation Iterable Iterator List Map Match Object Pattern RegExp RuneIterator Runes Set StackTrace Stopwatch String StringBuffer StringSink Symbol Type
|
||||
syntax keyword dartCoreTypedefs Comparator
|
||||
syntax keyword dartCoreExceptions AbstractClassInstantiationError ArgumentError AssertionError CastError ConcurrentModificationError Error Exception FallThroughError FormatException IntegerDivisionByZeroException NoSuchMethodError NullThrownError OutOfMemoryError RangeError RuntimeError StackOverflowError StateError TypeError UnimplementedError UnsupportedError
|
||||
|
||||
|
||||
" The default highlighting.
|
||||
highlight default link dartBranch Conditional
|
||||
highlight default link dartUserLabelRef dartUserLabel
|
||||
highlight default link dartLabel Label
|
||||
highlight default link dartUserLabel Label
|
||||
highlight default link dartConditional Conditional
|
||||
highlight default link dartRepeat Repeat
|
||||
highlight default link dartExceptions Exception
|
||||
highlight default link dartAssert Statement
|
||||
highlight default link dartStorageClass StorageClass
|
||||
highlight default link dartClassDecl dartStorageClass
|
||||
highlight default link dartBoolean Boolean
|
||||
highlight default link dartString String
|
||||
highlight default link dartRawString String
|
||||
highlight default link dartMultilineString String
|
||||
highlight default link dartRawMultilineString String
|
||||
highlight default link dartNumber Number
|
||||
highlight default link dartStatement Statement
|
||||
highlight default link dartOperator Operator
|
||||
highlight default link dartComment Comment
|
||||
highlight default link dartLineComment Comment
|
||||
highlight default link dartLineDocComment Comment
|
||||
highlight default link dartConstant Constant
|
||||
highlight default link dartTypedef Typedef
|
||||
highlight default link dartTodo Todo
|
||||
highlight default link dartKeyword Keyword
|
||||
highlight default link dartType Type
|
||||
highlight default link dartInterpolation PreProc
|
||||
highlight default link dartDocLink SpecialComment
|
||||
highlight default link dartSpecialChar SpecialChar
|
||||
highlight default link dartLibrary Include
|
||||
highlight default link dartCoreClasses Type
|
||||
highlight default link dartCoreTypedefs Typedef
|
||||
highlight default link dartCoreExceptions Exception
|
||||
|
||||
let b:current_syntax = "dart"
|
||||
let b:spell_options = "contained"
|
||||
|
||||
if g:main_syntax is# 'dart'
|
||||
unlet g:main_syntax
|
||||
endif
|
||||
|
||||
endif
|
||||
@@ -14,12 +14,12 @@ syn sync minlines=2000
|
||||
|
||||
syn cluster elixirNotTop contains=@elixirRegexSpecial,@elixirStringContained,@elixirDeclaration,elixirTodo,elixirArguments
|
||||
|
||||
syn match elixirComment '#.*' contains=elixirTodo
|
||||
syn match elixirComment '#.*' contains=elixirTodo,@Spell
|
||||
syn keyword elixirTodo FIXME NOTE TODO OPTIMIZE XXX HACK contained
|
||||
|
||||
syn keyword elixirKeyword case when cond for if unless try receive send
|
||||
syn keyword elixirKeyword exit raise throw after rescue catch else do end
|
||||
syn keyword elixirKeyword quote unquote super
|
||||
syn keyword elixirKeyword quote unquote super spawn spawn_link spawn_monitor
|
||||
|
||||
" Functions used on guards
|
||||
syn keyword elixirKeyword contained is_atom is_binary is_bitstring is_boolean
|
||||
@@ -87,8 +87,8 @@ syn region elixirInterpolation matchgroup=elixirInterpolationDelimiter start="#{
|
||||
|
||||
syn region elixirDocStringStart matchgroup=elixirDocString start=+"""+ end=+$+ oneline contains=ALLBUT,@elixirNotTop
|
||||
syn region elixirDocStringStart matchgroup=elixirDocString start=+'''+ end=+$+ oneline contains=ALLBUT,@elixirNotTop
|
||||
syn region elixirDocString start=+\z("""\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo,elixirInterpolation fold keepend
|
||||
syn region elixirDocString start=+\z('''\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo,elixirInterpolation fold keepend
|
||||
syn region elixirDocString start=+\z("""\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo,elixirInterpolation,@Spell fold keepend
|
||||
syn region elixirDocString start=+\z('''\)+ end=+^\s*\zs\z1+ contains=elixirDocStringStart,elixirTodo,elixirInterpolation,@Spell fold keepend
|
||||
|
||||
syn match elixirAtomInterpolated ':\("\)\@=' contains=elixirString
|
||||
syn match elixirString "\(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|0[0-7]{0,2}[0-7]\@!\>\|[^x0MC]\)\|(\\[MC]-)+\w\|[^\s\\]\)"
|
||||
|
||||
81
syntax/elm.vim
Normal file
81
syntax/elm.vim
Normal file
@@ -0,0 +1,81 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: Elm (http://elm-lang.org/)
|
||||
" Maintainer: Alexander Noriega
|
||||
" Latest Revision: 19 April 2015
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Keywords
|
||||
syn keyword elmKeyword alias as case else exposing if import in let module of port then type where
|
||||
|
||||
" Builtin operators
|
||||
syn match elmBuiltinOp "\~"
|
||||
syn match elmBuiltinOp "||"
|
||||
syn match elmBuiltinOp "|>"
|
||||
syn match elmBuiltinOp "|"
|
||||
syn match elmBuiltinOp "`"
|
||||
syn match elmBuiltinOp "\^"
|
||||
syn match elmBuiltinOp "\\"
|
||||
syn match elmBuiltinOp ">>"
|
||||
syn match elmBuiltinOp ">="
|
||||
syn match elmBuiltinOp ">"
|
||||
syn match elmBuiltinOp "=="
|
||||
syn match elmBuiltinOp "="
|
||||
syn match elmBuiltinOp "<\~"
|
||||
syn match elmBuiltinOp "<|"
|
||||
syn match elmBuiltinOp "<="
|
||||
syn match elmBuiltinOp "<<"
|
||||
syn match elmBuiltinOp "<-"
|
||||
syn match elmBuiltinOp "<"
|
||||
syn match elmBuiltinOp "::"
|
||||
syn match elmBuiltinOp ":"
|
||||
syn match elmBuiltinOp "/="
|
||||
syn match elmBuiltinOp "//"
|
||||
syn match elmBuiltinOp "/"
|
||||
syn match elmBuiltinOp "\.\."
|
||||
syn match elmBuiltinOp "\."
|
||||
syn match elmBuiltinOp "->"
|
||||
syn match elmBuiltinOp "-"
|
||||
syn match elmBuiltinOp "++"
|
||||
syn match elmBuiltinOp "+"
|
||||
syn match elmBuiltinOp "*"
|
||||
syn match elmBuiltinOp "&&"
|
||||
syn match elmBuiltinOp "%"
|
||||
|
||||
" Special names
|
||||
syntax match specialName "^main "
|
||||
|
||||
" Comments
|
||||
syn match elmTodo "[tT][oO][dD][oO]\|FIXME\|XXX" contained
|
||||
syn match elmLineComment "--.*" contains=elmTodo,@spell
|
||||
syn region elmComment matchgroup=elmComment start="{-|\=" end="-}" contains=elmTodo,elmComment,@spell
|
||||
|
||||
" String literals
|
||||
syn region elmString start="\"" skip="\\\"" end="\"" contains=elmStringEscape
|
||||
syn match elmStringEscape "\\u[0-9a-fA-F]\{4}" contained
|
||||
syn match elmStringEscape "\\[nrfvbt\\\"]" contained
|
||||
|
||||
" Number literals
|
||||
syn match elmNumber "\(\<\d\+\>\)"
|
||||
syn match elmNumber "\(\<\d\+\.\d\+\>\)"
|
||||
|
||||
" Types
|
||||
syn match elmType "\<[A-Z][0-9A-Za-z_'-]*"
|
||||
|
||||
let b:current_syntax = "elm"
|
||||
|
||||
hi def link elmKeyword Keyword
|
||||
hi def link elmBuiltinOp Special
|
||||
hi def link elmType Type
|
||||
hi def link elmTodo Todo
|
||||
hi def link elmLineComment Comment
|
||||
hi def link elmComment Comment
|
||||
hi def link elmString String
|
||||
hi def link elmNumber Number
|
||||
hi def link specialName Special
|
||||
|
||||
endif
|
||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Language: git commit file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: *.git/COMMIT_EDITMSG
|
||||
" Last Change: 2012 April 7
|
||||
" Last Change: 2013 May 30
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
|
||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
||||
" Language: git rebase --interactive
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: git-rebase-todo
|
||||
" Last Change: 2012 April 7
|
||||
" Last Change: 2013 May 30
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -20,6 +20,7 @@ syn match gitrebaseEdit "\v^e%(dit)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseSquash "\v^s%(quash)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseFixup "\v^f%(ixup)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseExec "\v^%(x|exec)>" nextgroup=gitrebaseCommand skipwhite
|
||||
syn match gitrebaseDrop "\v^d%(rop)=>" nextgroup=gitrebaseCommit skipwhite
|
||||
syn match gitrebaseSummary ".*" contains=gitrebaseHash contained
|
||||
syn match gitrebaseCommand ".*" contained
|
||||
syn match gitrebaseComment "^#.*" contains=gitrebaseHash
|
||||
@@ -33,6 +34,7 @@ hi def link gitrebaseEdit PreProc
|
||||
hi def link gitrebaseSquash Type
|
||||
hi def link gitrebaseFixup Special
|
||||
hi def link gitrebaseExec Function
|
||||
hi def link gitrebaseDrop Comment
|
||||
hi def link gitrebaseSummary String
|
||||
hi def link gitrebaseComment Comment
|
||||
hi def link gitrebaseSquashError Error
|
||||
|
||||
660
syntax/glsl.vim
Normal file
660
syntax/glsl.vim
Normal file
@@ -0,0 +1,660 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
|
||||
|
||||
" Language: OpenGL Shading Language
|
||||
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
|
||||
|
||||
if exists("b:current_syntax") && b:current_syntax == "glsl"
|
||||
finish
|
||||
endif
|
||||
|
||||
" Statements
|
||||
syn keyword glslConditional if else
|
||||
syn keyword glslRepeat for while do
|
||||
syn keyword glslStatement discard return break continue
|
||||
|
||||
" Comments
|
||||
syn keyword glslTodo contained TODO FIXME XXX
|
||||
syn region glslCommentL start="//" skip="\\$" end="$" keepend contains=glslTodo,@Spell
|
||||
syn region glslComment matchgroup=glslCommentStart start="/\*" end="\*/" extend contains=glslTodo,@Spell
|
||||
|
||||
" Preprocessor
|
||||
syn region glslPreCondit start="^\s*#\s*\(if\|ifdef\|ifndef\|else\|elif\|endif\)" skip="\\$" end="$" keepend
|
||||
syn region glslDefine start="^\s*#\s*\(define\|undef\)" skip="\\$" end="$" keepend
|
||||
syn keyword glslTokenConcat ##
|
||||
syn keyword glslPredefinedMacro __LINE__ __FILE__ __VERSION__ GL_ES
|
||||
syn region glslPreProc start="^\s*#\s*\(error\|pragma\|extension\|version\|line\)" skip="\\$" end="$" keepend
|
||||
|
||||
" Boolean Constants
|
||||
syn keyword glslBoolean true false
|
||||
|
||||
" Integer Numbers
|
||||
syn match glslDecimalInt display "\(0\|[1-9]\d*\)"
|
||||
syn match glslOctalInt display "0\o\+"
|
||||
syn match glslHexInt display "0[xX]\x\+"
|
||||
|
||||
" Float Numbers
|
||||
syn match glslFloat display "\d\+\.\([eE][+-]\=\d\+\)\="
|
||||
syn match glslFloat display "\.\d\+\([eE][+-]\=\d\+\)\="
|
||||
syn match glslFloat display "\d\+[eE][+-]\=\d\+"
|
||||
syn match glslFloat display "\d\+\.\d\+\([eE][+-]\=\d\+\)\="
|
||||
|
||||
" Swizzles
|
||||
syn match glslSwizzle display /\.[xyzw]\{1,4\}\>/
|
||||
syn match glslSwizzle display /\.[rgba]\{1,4\}\>/
|
||||
syn match glslSwizzle display /\.[stpq]\{1,4\}\>/
|
||||
|
||||
" Structure
|
||||
syn keyword glslStructure struct
|
||||
|
||||
" This prevents numbers at ends of identifies from being highlighted as numbers
|
||||
syn match glslIdentifier display "\I\i*"
|
||||
|
||||
" Types
|
||||
syn keyword glslType atomic_uint
|
||||
syn keyword glslType bool
|
||||
syn keyword glslType bvec2
|
||||
syn keyword glslType bvec3
|
||||
syn keyword glslType bvec4
|
||||
syn keyword glslType dmat2
|
||||
syn keyword glslType dmat2x2
|
||||
syn keyword glslType dmat2x3
|
||||
syn keyword glslType dmat2x4
|
||||
syn keyword glslType dmat3
|
||||
syn keyword glslType dmat3x2
|
||||
syn keyword glslType dmat3x3
|
||||
syn keyword glslType dmat3x4
|
||||
syn keyword glslType dmat4
|
||||
syn keyword glslType dmat4x2
|
||||
syn keyword glslType dmat4x3
|
||||
syn keyword glslType dmat4x4
|
||||
syn keyword glslType double
|
||||
syn keyword glslType dvec2
|
||||
syn keyword glslType dvec3
|
||||
syn keyword glslType dvec4
|
||||
syn keyword glslType float
|
||||
syn keyword glslType iimage1D
|
||||
syn keyword glslType iimage1DArray
|
||||
syn keyword glslType iimage2D
|
||||
syn keyword glslType iimage2DArray
|
||||
syn keyword glslType iimage2DMS
|
||||
syn keyword glslType iimage2DMSArray
|
||||
syn keyword glslType iimage2DRect
|
||||
syn keyword glslType iimage3D
|
||||
syn keyword glslType iimageBuffer
|
||||
syn keyword glslType iimageCube
|
||||
syn keyword glslType iimageCubeArray
|
||||
syn keyword glslType image1D
|
||||
syn keyword glslType image1DArray
|
||||
syn keyword glslType image2D
|
||||
syn keyword glslType image2DArray
|
||||
syn keyword glslType image2DMS
|
||||
syn keyword glslType image2DMSArray
|
||||
syn keyword glslType image2DRect
|
||||
syn keyword glslType image3D
|
||||
syn keyword glslType imageBuffer
|
||||
syn keyword glslType imageCube
|
||||
syn keyword glslType imageCubeArray
|
||||
syn keyword glslType int
|
||||
syn keyword glslType isampler1D
|
||||
syn keyword glslType isampler1DArray
|
||||
syn keyword glslType isampler2D
|
||||
syn keyword glslType isampler2DArray
|
||||
syn keyword glslType isampler2DMS
|
||||
syn keyword glslType isampler2DMSArray
|
||||
syn keyword glslType isampler2DRect
|
||||
syn keyword glslType isampler3D
|
||||
syn keyword glslType isamplerBuffer
|
||||
syn keyword glslType isamplerCube
|
||||
syn keyword glslType isamplerCubeArray
|
||||
syn keyword glslType ivec2
|
||||
syn keyword glslType ivec3
|
||||
syn keyword glslType ivec4
|
||||
syn keyword glslType mat2
|
||||
syn keyword glslType mat2x2
|
||||
syn keyword glslType mat2x3
|
||||
syn keyword glslType mat2x4
|
||||
syn keyword glslType mat3
|
||||
syn keyword glslType mat3x2
|
||||
syn keyword glslType mat3x3
|
||||
syn keyword glslType mat3x4
|
||||
syn keyword glslType mat4
|
||||
syn keyword glslType mat4x2
|
||||
syn keyword glslType mat4x3
|
||||
syn keyword glslType mat4x4
|
||||
syn keyword glslType sampler1D
|
||||
syn keyword glslType sampler1DArray
|
||||
syn keyword glslType sampler1DArrayShadow
|
||||
syn keyword glslType sampler1DShadow
|
||||
syn keyword glslType sampler2D
|
||||
syn keyword glslType sampler2DArray
|
||||
syn keyword glslType sampler2DArrayShadow
|
||||
syn keyword glslType sampler2DMS
|
||||
syn keyword glslType sampler2DMSArray
|
||||
syn keyword glslType sampler2DRect
|
||||
syn keyword glslType sampler2DRectShadow
|
||||
syn keyword glslType sampler2DShadow
|
||||
syn keyword glslType sampler3D
|
||||
syn keyword glslType samplerBuffer
|
||||
syn keyword glslType samplerCube
|
||||
syn keyword glslType samplerCubeArray
|
||||
syn keyword glslType samplerCubeArrayShadow
|
||||
syn keyword glslType samplerCubeShadow
|
||||
syn keyword glslType uimage1D
|
||||
syn keyword glslType uimage1DArray
|
||||
syn keyword glslType uimage2D
|
||||
syn keyword glslType uimage2DArray
|
||||
syn keyword glslType uimage2DMS
|
||||
syn keyword glslType uimage2DMSArray
|
||||
syn keyword glslType uimage2DRect
|
||||
syn keyword glslType uimage3D
|
||||
syn keyword glslType uimageBuffer
|
||||
syn keyword glslType uimageCube
|
||||
syn keyword glslType uimageCubeArray
|
||||
syn keyword glslType uint
|
||||
syn keyword glslType usampler1D
|
||||
syn keyword glslType usampler1DArray
|
||||
syn keyword glslType usampler2D
|
||||
syn keyword glslType usampler2DArray
|
||||
syn keyword glslType usampler2DMS
|
||||
syn keyword glslType usampler2DMSArray
|
||||
syn keyword glslType usampler2DRect
|
||||
syn keyword glslType usampler3D
|
||||
syn keyword glslType usamplerBuffer
|
||||
syn keyword glslType usamplerCube
|
||||
syn keyword glslType usamplerCubeArray
|
||||
syn keyword glslType uvec2
|
||||
syn keyword glslType uvec3
|
||||
syn keyword glslType uvec4
|
||||
syn keyword glslType vec2
|
||||
syn keyword glslType vec3
|
||||
syn keyword glslType vec4
|
||||
syn keyword glslType void
|
||||
|
||||
" Qualifiers
|
||||
syn keyword glslQualifier attribute
|
||||
syn keyword glslQualifier binding
|
||||
syn keyword glslQualifier buffer
|
||||
syn keyword glslQualifier ccw
|
||||
syn keyword glslQualifier centroid
|
||||
syn keyword glslQualifier centroid varying
|
||||
syn keyword glslQualifier coherent
|
||||
syn keyword glslQualifier column_major
|
||||
syn keyword glslQualifier const
|
||||
syn keyword glslQualifier cw
|
||||
syn keyword glslQualifier depth_any
|
||||
syn keyword glslQualifier depth_greater
|
||||
syn keyword glslQualifier depth_less
|
||||
syn keyword glslQualifier depth_unchanged
|
||||
syn keyword glslQualifier early_fragment_tests
|
||||
syn keyword glslQualifier equal_spacing
|
||||
syn keyword glslQualifier flat
|
||||
syn keyword glslQualifier fractional_even_spacing
|
||||
syn keyword glslQualifier fractional_odd_spacing
|
||||
syn keyword glslQualifier highp
|
||||
syn keyword glslQualifier in
|
||||
syn keyword glslQualifier index
|
||||
syn keyword glslQualifier inout
|
||||
syn keyword glslQualifier invariant
|
||||
syn keyword glslQualifier invocations
|
||||
syn keyword glslQualifier isolines
|
||||
syn keyword glslQualifier layout
|
||||
syn keyword glslQualifier line_strip
|
||||
syn keyword glslQualifier lines
|
||||
syn keyword glslQualifier lines_adjacency
|
||||
syn keyword glslQualifier local_size_x
|
||||
syn keyword glslQualifier local_size_y
|
||||
syn keyword glslQualifier local_size_z
|
||||
syn keyword glslQualifier location
|
||||
syn keyword glslQualifier lowp
|
||||
syn keyword glslQualifier max_vertices
|
||||
syn keyword glslQualifier mediump
|
||||
syn keyword glslQualifier noperspective
|
||||
syn keyword glslQualifier offset
|
||||
syn keyword glslQualifier origin_upper_left
|
||||
syn keyword glslQualifier out
|
||||
syn keyword glslQualifier packed
|
||||
syn keyword glslQualifier patch
|
||||
syn keyword glslQualifier pixel_center_integer
|
||||
syn keyword glslQualifier point_mode
|
||||
syn keyword glslQualifier points
|
||||
syn keyword glslQualifier precise
|
||||
syn keyword glslQualifier precision
|
||||
syn keyword glslQualifier quads
|
||||
syn keyword glslQualifier r11f_g11f_b10f
|
||||
syn keyword glslQualifier r16
|
||||
syn keyword glslQualifier r16_snorm
|
||||
syn keyword glslQualifier r16f
|
||||
syn keyword glslQualifier r16i
|
||||
syn keyword glslQualifier r16ui
|
||||
syn keyword glslQualifier r32f
|
||||
syn keyword glslQualifier r32i
|
||||
syn keyword glslQualifier r32ui
|
||||
syn keyword glslQualifier r8
|
||||
syn keyword glslQualifier r8_snorm
|
||||
syn keyword glslQualifier r8i
|
||||
syn keyword glslQualifier r8ui
|
||||
syn keyword glslQualifier readonly
|
||||
syn keyword glslQualifier restrict
|
||||
syn keyword glslQualifier rg16
|
||||
syn keyword glslQualifier rg16_snorm
|
||||
syn keyword glslQualifier rg16f
|
||||
syn keyword glslQualifier rg16i
|
||||
syn keyword glslQualifier rg16ui
|
||||
syn keyword glslQualifier rg32f
|
||||
syn keyword glslQualifier rg32i
|
||||
syn keyword glslQualifier rg32ui
|
||||
syn keyword glslQualifier rg8
|
||||
syn keyword glslQualifier rg8_snorm
|
||||
syn keyword glslQualifier rg8i
|
||||
syn keyword glslQualifier rg8ui
|
||||
syn keyword glslQualifier rgb10_a2
|
||||
syn keyword glslQualifier rgb10_a2ui
|
||||
syn keyword glslQualifier rgba16
|
||||
syn keyword glslQualifier rgba16_snorm
|
||||
syn keyword glslQualifier rgba16f
|
||||
syn keyword glslQualifier rgba16i
|
||||
syn keyword glslQualifier rgba16ui
|
||||
syn keyword glslQualifier rgba32f
|
||||
syn keyword glslQualifier rgba32i
|
||||
syn keyword glslQualifier rgba32ui
|
||||
syn keyword glslQualifier rgba8
|
||||
syn keyword glslQualifier rgba8_snorm
|
||||
syn keyword glslQualifier rgba8i
|
||||
syn keyword glslQualifier rgba8ui
|
||||
syn keyword glslQualifier row_major
|
||||
syn keyword glslQualifier sample
|
||||
syn keyword glslQualifier shared
|
||||
syn keyword glslQualifier smooth
|
||||
syn keyword glslQualifier std140
|
||||
syn keyword glslQualifier std430
|
||||
syn keyword glslQualifier stream
|
||||
syn keyword glslQualifier triangle_strip
|
||||
syn keyword glslQualifier triangles
|
||||
syn keyword glslQualifier triangles_adjacency
|
||||
syn keyword glslQualifier uniform
|
||||
syn keyword glslQualifier varying
|
||||
syn keyword glslQualifier vertices
|
||||
syn keyword glslQualifier volatile
|
||||
syn keyword glslQualifier writeonly
|
||||
|
||||
" Built-in Constants
|
||||
syn keyword glslBuiltinConstant gl_MaxAtomicCounterBindings
|
||||
syn keyword glslBuiltinConstant gl_MaxAtomicCounterBufferSize
|
||||
syn keyword glslBuiltinConstant gl_MaxClipDistances
|
||||
syn keyword glslBuiltinConstant gl_MaxClipPlanes
|
||||
syn keyword glslBuiltinConstant gl_MaxCombinedAtomicCounterBuffers
|
||||
syn keyword glslBuiltinConstant gl_MaxCombinedAtomicCounters
|
||||
syn keyword glslBuiltinConstant gl_MaxCombinedImageUniforms
|
||||
syn keyword glslBuiltinConstant gl_MaxCombinedImageUnitsAndFragmentOutputs
|
||||
syn keyword glslBuiltinConstant gl_MaxCombinedTextureImageUnits
|
||||
syn keyword glslBuiltinConstant gl_MaxComputeAtomicCounterBuffers
|
||||
syn keyword glslBuiltinConstant gl_MaxComputeAtomicCounters
|
||||
syn keyword glslBuiltinConstant gl_MaxComputeImageUniforms
|
||||
syn keyword glslBuiltinConstant gl_MaxComputeTextureImageUnits
|
||||
syn keyword glslBuiltinConstant gl_MaxComputeUniformComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxComputeWorkGroupCount
|
||||
syn keyword glslBuiltinConstant gl_MaxComputeWorkGroupSize
|
||||
syn keyword glslBuiltinConstant gl_MaxDrawBuffers
|
||||
syn keyword glslBuiltinConstant gl_MaxFragmentAtomicCounterBuffers
|
||||
syn keyword glslBuiltinConstant gl_MaxFragmentAtomicCounters
|
||||
syn keyword glslBuiltinConstant gl_MaxFragmentImageUniforms
|
||||
syn keyword glslBuiltinConstant gl_MaxFragmentInputComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxFragmentInputVectors
|
||||
syn keyword glslBuiltinConstant gl_MaxFragmentUniformComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxFragmentUniformVectors
|
||||
syn keyword glslBuiltinConstant gl_MaxGeometryAtomicCounterBuffers
|
||||
syn keyword glslBuiltinConstant gl_MaxGeometryAtomicCounters
|
||||
syn keyword glslBuiltinConstant gl_MaxGeometryImageUniforms
|
||||
syn keyword glslBuiltinConstant gl_MaxGeometryInputComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxGeometryOutputComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxGeometryOutputVertices
|
||||
syn keyword glslBuiltinConstant gl_MaxGeometryTextureImageUnits
|
||||
syn keyword glslBuiltinConstant gl_MaxGeometryTotalOutputComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxGeometryUniformComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxGeometryVaryingComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxImageSamples
|
||||
syn keyword glslBuiltinConstant gl_MaxImageUnits
|
||||
syn keyword glslBuiltinConstant gl_MaxLights
|
||||
syn keyword glslBuiltinConstant gl_MaxPatchVertices
|
||||
syn keyword glslBuiltinConstant gl_MaxProgramTexelOffset
|
||||
syn keyword glslBuiltinConstant gl_MaxTessControlAtomicCounterBuffers
|
||||
syn keyword glslBuiltinConstant gl_MaxTessControlAtomicCounters
|
||||
syn keyword glslBuiltinConstant gl_MaxTessControlImageUniforms
|
||||
syn keyword glslBuiltinConstant gl_MaxTessControlInputComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxTessControlOutputComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxTessControlTextureImageUnits
|
||||
syn keyword glslBuiltinConstant gl_MaxTessControlTotalOutputComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxTessControlUniformComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxTessEvaluationAtomicCounterBuffers
|
||||
syn keyword glslBuiltinConstant gl_MaxTessEvaluationAtomicCounters
|
||||
syn keyword glslBuiltinConstant gl_MaxTessEvaluationImageUniforms
|
||||
syn keyword glslBuiltinConstant gl_MaxTessEvaluationInputComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxTessEvaluationOutputComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxTessEvaluationTextureImageUnits
|
||||
syn keyword glslBuiltinConstant gl_MaxTessEvaluationUniformComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxTessGenLevel
|
||||
syn keyword glslBuiltinConstant gl_MaxTessPatchComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxTextureCoords
|
||||
syn keyword glslBuiltinConstant gl_MaxTextureImageUnits
|
||||
syn keyword glslBuiltinConstant gl_MaxTextureUnits
|
||||
syn keyword glslBuiltinConstant gl_MaxVaryingComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxVaryingFloats
|
||||
syn keyword glslBuiltinConstant gl_MaxVaryingVectors
|
||||
syn keyword glslBuiltinConstant gl_MaxVertexAtomicCounterBuffers
|
||||
syn keyword glslBuiltinConstant gl_MaxVertexAtomicCounters
|
||||
syn keyword glslBuiltinConstant gl_MaxVertexAttribs
|
||||
syn keyword glslBuiltinConstant gl_MaxVertexImageUniforms
|
||||
syn keyword glslBuiltinConstant gl_MaxVertexOutputComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxVertexOutputVectors
|
||||
syn keyword glslBuiltinConstant gl_MaxVertexTextureImageUnits
|
||||
syn keyword glslBuiltinConstant gl_MaxVertexUniformComponents
|
||||
syn keyword glslBuiltinConstant gl_MaxVertexUniformVectors
|
||||
syn keyword glslBuiltinConstant gl_MaxViewports
|
||||
syn keyword glslBuiltinConstant gl_MinProgramTexelOffset
|
||||
|
||||
" Built-in Variables
|
||||
syn keyword glslBuiltinVariable gl_BackColor
|
||||
syn keyword glslBuiltinVariable gl_BackLightModelProduct
|
||||
syn keyword glslBuiltinVariable gl_BackLightProduct
|
||||
syn keyword glslBuiltinVariable gl_BackLightProduct
|
||||
syn keyword glslBuiltinVariable gl_BackMaterial
|
||||
syn keyword glslBuiltinVariable gl_BackSecondaryColor
|
||||
syn keyword glslBuiltinVariable gl_ClipDistance
|
||||
syn keyword glslBuiltinVariable gl_ClipPlane
|
||||
syn keyword glslBuiltinVariable gl_ClipVertex
|
||||
syn keyword glslBuiltinVariable gl_Color
|
||||
syn keyword glslBuiltinVariable gl_DepthRange
|
||||
syn keyword glslBuiltinVariable gl_EyePlaneQ
|
||||
syn keyword glslBuiltinVariable gl_EyePlaneR
|
||||
syn keyword glslBuiltinVariable gl_EyePlaneS
|
||||
syn keyword glslBuiltinVariable gl_EyePlaneT
|
||||
syn keyword glslBuiltinVariable gl_Fog
|
||||
syn keyword glslBuiltinVariable gl_FogCoord
|
||||
syn keyword glslBuiltinVariable gl_FogFragCoord
|
||||
syn keyword glslBuiltinVariable gl_FragColor
|
||||
syn keyword glslBuiltinVariable gl_FragCoord
|
||||
syn keyword glslBuiltinVariable gl_FragData
|
||||
syn keyword glslBuiltinVariable gl_FragDepth
|
||||
syn keyword glslBuiltinVariable gl_FrontColor
|
||||
syn keyword glslBuiltinVariable gl_FrontFacing
|
||||
syn keyword glslBuiltinVariable gl_FrontLightModelProduct
|
||||
syn keyword glslBuiltinVariable gl_FrontLightProduct
|
||||
syn keyword glslBuiltinVariable gl_FrontMaterial
|
||||
syn keyword glslBuiltinVariable gl_FrontSecondaryColor
|
||||
syn keyword glslBuiltinVariable gl_GlobalInvocationID
|
||||
syn keyword glslBuiltinVariable gl_InstanceID
|
||||
syn keyword glslBuiltinVariable gl_InvocationID
|
||||
syn keyword glslBuiltinVariable gl_Layer
|
||||
syn keyword glslBuiltinVariable gl_LightModel
|
||||
syn keyword glslBuiltinVariable gl_LightSource
|
||||
syn keyword glslBuiltinVariable gl_LocalInvocationID
|
||||
syn keyword glslBuiltinVariable gl_LocalInvocationIndex
|
||||
syn keyword glslBuiltinVariable gl_ModelViewMatrix
|
||||
syn keyword glslBuiltinVariable gl_ModelViewMatrixInverse
|
||||
syn keyword glslBuiltinVariable gl_ModelViewMatrixInverseTranspose
|
||||
syn keyword glslBuiltinVariable gl_ModelViewMatrixTranspose
|
||||
syn keyword glslBuiltinVariable gl_ModelViewProjectionMatrix
|
||||
syn keyword glslBuiltinVariable gl_ModelViewProjectionMatrixInverse
|
||||
syn keyword glslBuiltinVariable gl_ModelViewProjectionMatrixInverseTranspose
|
||||
syn keyword glslBuiltinVariable gl_ModelViewProjectionMatrixTranspose
|
||||
syn keyword glslBuiltinVariable gl_MultiTexCoord0
|
||||
syn keyword glslBuiltinVariable gl_MultiTexCoord1
|
||||
syn keyword glslBuiltinVariable gl_MultiTexCoord2
|
||||
syn keyword glslBuiltinVariable gl_MultiTexCoord3
|
||||
syn keyword glslBuiltinVariable gl_MultiTexCoord4
|
||||
syn keyword glslBuiltinVariable gl_MultiTexCoord5
|
||||
syn keyword glslBuiltinVariable gl_MultiTexCoord6
|
||||
syn keyword glslBuiltinVariable gl_MultiTexCoord7
|
||||
syn keyword glslBuiltinVariable gl_Normal
|
||||
syn keyword glslBuiltinVariable gl_NormalMatrix
|
||||
syn keyword glslBuiltinVariable gl_NormalScale
|
||||
syn keyword glslBuiltinVariable gl_NumSamples
|
||||
syn keyword glslBuiltinVariable gl_NumWorkGroups
|
||||
syn keyword glslBuiltinVariable gl_ObjectPlaneQ
|
||||
syn keyword glslBuiltinVariable gl_ObjectPlaneR
|
||||
syn keyword glslBuiltinVariable gl_ObjectPlaneS
|
||||
syn keyword glslBuiltinVariable gl_ObjectPlaneT
|
||||
syn keyword glslBuiltinVariable gl_PatchVerticesIn
|
||||
syn keyword glslBuiltinVariable gl_Point
|
||||
syn keyword glslBuiltinVariable gl_PointCoord
|
||||
syn keyword glslBuiltinVariable gl_PointSize
|
||||
syn keyword glslBuiltinVariable gl_Position
|
||||
syn keyword glslBuiltinVariable gl_PrimitiveID
|
||||
syn keyword glslBuiltinVariable gl_PrimitiveIDIn
|
||||
syn keyword glslBuiltinVariable gl_ProjectionMatrix
|
||||
syn keyword glslBuiltinVariable gl_ProjectionMatrixInverse
|
||||
syn keyword glslBuiltinVariable gl_ProjectionMatrixInverseTranspose
|
||||
syn keyword glslBuiltinVariable gl_ProjectionMatrixTranspose
|
||||
syn keyword glslBuiltinVariable gl_SampleID
|
||||
syn keyword glslBuiltinVariable gl_SampleMask
|
||||
syn keyword glslBuiltinVariable gl_SampleMaskIn
|
||||
syn keyword glslBuiltinVariable gl_SamplePosition
|
||||
syn keyword glslBuiltinVariable gl_SecondaryColor
|
||||
syn keyword glslBuiltinVariable gl_TessCoord
|
||||
syn keyword glslBuiltinVariable gl_TessLevelInner
|
||||
syn keyword glslBuiltinVariable gl_TessLevelOuter
|
||||
syn keyword glslBuiltinVariable gl_TexCoord
|
||||
syn keyword glslBuiltinVariable gl_TextureEnvColor
|
||||
syn keyword glslBuiltinVariable gl_TextureMatrix
|
||||
syn keyword glslBuiltinVariable gl_TextureMatrixInverse
|
||||
syn keyword glslBuiltinVariable gl_TextureMatrixInverseTranspose
|
||||
syn keyword glslBuiltinVariable gl_TextureMatrixTranspose
|
||||
syn keyword glslBuiltinVariable gl_Vertex
|
||||
syn keyword glslBuiltinVariable gl_VertexID
|
||||
syn keyword glslBuiltinVariable gl_ViewportIndex
|
||||
syn keyword glslBuiltinVariable gl_WorkGroupID
|
||||
syn keyword glslBuiltinVariable gl_WorkGroupSize
|
||||
syn keyword glslBuiltinVariable gl_in
|
||||
syn keyword glslBuiltinVariable gl_out
|
||||
|
||||
" Built-in Functions
|
||||
syn keyword glslBuiltinFunction EmitStreamVertex
|
||||
syn keyword glslBuiltinFunction EmitVertex
|
||||
syn keyword glslBuiltinFunction EndPrimitive
|
||||
syn keyword glslBuiltinFunction EndStreamPrimitive
|
||||
syn keyword glslBuiltinFunction abs
|
||||
syn keyword glslBuiltinFunction acos
|
||||
syn keyword glslBuiltinFunction acosh
|
||||
syn keyword glslBuiltinFunction all
|
||||
syn keyword glslBuiltinFunction any
|
||||
syn keyword glslBuiltinFunction asin
|
||||
syn keyword glslBuiltinFunction asinh
|
||||
syn keyword glslBuiltinFunction atan
|
||||
syn keyword glslBuiltinFunction atanh
|
||||
syn keyword glslBuiltinFunction atomicAdd
|
||||
syn keyword glslBuiltinFunction atomicAnd
|
||||
syn keyword glslBuiltinFunction atomicCompSwap
|
||||
syn keyword glslBuiltinFunction atomicCounter
|
||||
syn keyword glslBuiltinFunction atomicCounterDecrement
|
||||
syn keyword glslBuiltinFunction atomicCounterIncrement
|
||||
syn keyword glslBuiltinFunction atomicExchange
|
||||
syn keyword glslBuiltinFunction atomicMax
|
||||
syn keyword glslBuiltinFunction atomicMin
|
||||
syn keyword glslBuiltinFunction atomicOr
|
||||
syn keyword glslBuiltinFunction atomicXor
|
||||
syn keyword glslBuiltinFunction barrier
|
||||
syn keyword glslBuiltinFunction bitCount
|
||||
syn keyword glslBuiltinFunction bitfieldExtract
|
||||
syn keyword glslBuiltinFunction bitfieldInsert
|
||||
syn keyword glslBuiltinFunction bitfieldReverse
|
||||
syn keyword glslBuiltinFunction ceil
|
||||
syn keyword glslBuiltinFunction clamp
|
||||
syn keyword glslBuiltinFunction cos
|
||||
syn keyword glslBuiltinFunction cosh
|
||||
syn keyword glslBuiltinFunction cross
|
||||
syn keyword glslBuiltinFunction dFdx
|
||||
syn keyword glslBuiltinFunction dFdy
|
||||
syn keyword glslBuiltinFunction degrees
|
||||
syn keyword glslBuiltinFunction determinant
|
||||
syn keyword glslBuiltinFunction distance
|
||||
syn keyword glslBuiltinFunction dot
|
||||
syn keyword glslBuiltinFunction equal
|
||||
syn keyword glslBuiltinFunction exp
|
||||
syn keyword glslBuiltinFunction exp2
|
||||
syn keyword glslBuiltinFunction faceforward
|
||||
syn keyword glslBuiltinFunction findLSB
|
||||
syn keyword glslBuiltinFunction findMSB
|
||||
syn keyword glslBuiltinFunction floatBitsToInt
|
||||
syn keyword glslBuiltinFunction floatBitsToUint
|
||||
syn keyword glslBuiltinFunction floor
|
||||
syn keyword glslBuiltinFunction fma
|
||||
syn keyword glslBuiltinFunction fract
|
||||
syn keyword glslBuiltinFunction frexp
|
||||
syn keyword glslBuiltinFunction ftransform
|
||||
syn keyword glslBuiltinFunction fwidth
|
||||
syn keyword glslBuiltinFunction greaterThan
|
||||
syn keyword glslBuiltinFunction greaterThanEqual
|
||||
syn keyword glslBuiltinFunction groupMemoryBarrier
|
||||
syn keyword glslBuiltinFunction imageAtomicAdd
|
||||
syn keyword glslBuiltinFunction imageAtomicAnd
|
||||
syn keyword glslBuiltinFunction imageAtomicCompSwap
|
||||
syn keyword glslBuiltinFunction imageAtomicExchange
|
||||
syn keyword glslBuiltinFunction imageAtomicMax
|
||||
syn keyword glslBuiltinFunction imageAtomicMin
|
||||
syn keyword glslBuiltinFunction imageAtomicOr
|
||||
syn keyword glslBuiltinFunction imageAtomicXor
|
||||
syn keyword glslBuiltinFunction imageLoad
|
||||
syn keyword glslBuiltinFunction imageSize
|
||||
syn keyword glslBuiltinFunction imageStore
|
||||
syn keyword glslBuiltinFunction imulExtended
|
||||
syn keyword glslBuiltinFunction intBitsToFloat
|
||||
syn keyword glslBuiltinFunction interpolateAtCentroid
|
||||
syn keyword glslBuiltinFunction interpolateAtOffset
|
||||
syn keyword glslBuiltinFunction interpolateAtSample
|
||||
syn keyword glslBuiltinFunction inverse
|
||||
syn keyword glslBuiltinFunction inversesqrt
|
||||
syn keyword glslBuiltinFunction isinf
|
||||
syn keyword glslBuiltinFunction isnan
|
||||
syn keyword glslBuiltinFunction ldexp
|
||||
syn keyword glslBuiltinFunction length
|
||||
syn keyword glslBuiltinFunction lessThan
|
||||
syn keyword glslBuiltinFunction lessThanEqual
|
||||
syn keyword glslBuiltinFunction log
|
||||
syn keyword glslBuiltinFunction log2
|
||||
syn keyword glslBuiltinFunction matrixCompMult
|
||||
syn keyword glslBuiltinFunction max
|
||||
syn keyword glslBuiltinFunction memoryBarrier
|
||||
syn keyword glslBuiltinFunction memoryBarrierAtomicCounter
|
||||
syn keyword glslBuiltinFunction memoryBarrierBuffer
|
||||
syn keyword glslBuiltinFunction memoryBarrierImage
|
||||
syn keyword glslBuiltinFunction memoryBarrierShared
|
||||
syn keyword glslBuiltinFunction min
|
||||
syn keyword glslBuiltinFunction mix
|
||||
syn keyword glslBuiltinFunction mod
|
||||
syn keyword glslBuiltinFunction modf
|
||||
syn keyword glslBuiltinFunction noise1
|
||||
syn keyword glslBuiltinFunction noise2
|
||||
syn keyword glslBuiltinFunction noise3
|
||||
syn keyword glslBuiltinFunction noise4
|
||||
syn keyword glslBuiltinFunction normalize
|
||||
syn keyword glslBuiltinFunction not
|
||||
syn keyword glslBuiltinFunction notEqual
|
||||
syn keyword glslBuiltinFunction outerProduct
|
||||
syn keyword glslBuiltinFunction packDouble2x32
|
||||
syn keyword glslBuiltinFunction packHalf2x16
|
||||
syn keyword glslBuiltinFunction packSnorm2x16
|
||||
syn keyword glslBuiltinFunction packSnorm4x8
|
||||
syn keyword glslBuiltinFunction packUnorm2x16
|
||||
syn keyword glslBuiltinFunction packUnorm4x8
|
||||
syn keyword glslBuiltinFunction pow
|
||||
syn keyword glslBuiltinFunction radians
|
||||
syn keyword glslBuiltinFunction reflect
|
||||
syn keyword glslBuiltinFunction refract
|
||||
syn keyword glslBuiltinFunction round
|
||||
syn keyword glslBuiltinFunction roundEven
|
||||
syn keyword glslBuiltinFunction shadow1D
|
||||
syn keyword glslBuiltinFunction shadow1DLod
|
||||
syn keyword glslBuiltinFunction shadow1DProj
|
||||
syn keyword glslBuiltinFunction shadow1DProjLod
|
||||
syn keyword glslBuiltinFunction shadow2D
|
||||
syn keyword glslBuiltinFunction shadow2DLod
|
||||
syn keyword glslBuiltinFunction shadow2DProj
|
||||
syn keyword glslBuiltinFunction shadow2DProjLod
|
||||
syn keyword glslBuiltinFunction sign
|
||||
syn keyword glslBuiltinFunction sin
|
||||
syn keyword glslBuiltinFunction sinh
|
||||
syn keyword glslBuiltinFunction smoothstep
|
||||
syn keyword glslBuiltinFunction sqrt
|
||||
syn keyword glslBuiltinFunction step
|
||||
syn keyword glslBuiltinFunction tan
|
||||
syn keyword glslBuiltinFunction tanh
|
||||
syn keyword glslBuiltinFunction texelFetch
|
||||
syn keyword glslBuiltinFunction texelFetchOffset
|
||||
syn keyword glslBuiltinFunction texture
|
||||
syn keyword glslBuiltinFunction texture1D
|
||||
syn keyword glslBuiltinFunction texture1DLod
|
||||
syn keyword glslBuiltinFunction texture1DProj
|
||||
syn keyword glslBuiltinFunction texture1DProjLod
|
||||
syn keyword glslBuiltinFunction texture2D
|
||||
syn keyword glslBuiltinFunction texture2DLod
|
||||
syn keyword glslBuiltinFunction texture2DProj
|
||||
syn keyword glslBuiltinFunction texture2DProjLod
|
||||
syn keyword glslBuiltinFunction texture3D
|
||||
syn keyword glslBuiltinFunction texture3DLod
|
||||
syn keyword glslBuiltinFunction texture3DProj
|
||||
syn keyword glslBuiltinFunction texture3DProjLod
|
||||
syn keyword glslBuiltinFunction textureCube
|
||||
syn keyword glslBuiltinFunction textureCubeLod
|
||||
syn keyword glslBuiltinFunction textureGather
|
||||
syn keyword glslBuiltinFunction textureGatherOffset
|
||||
syn keyword glslBuiltinFunction textureGatherOffsets
|
||||
syn keyword glslBuiltinFunction textureGrad
|
||||
syn keyword glslBuiltinFunction textureGradOffset
|
||||
syn keyword glslBuiltinFunction textureLod
|
||||
syn keyword glslBuiltinFunction textureLodOffset
|
||||
syn keyword glslBuiltinFunction textureOffset
|
||||
syn keyword glslBuiltinFunction textureProj
|
||||
syn keyword glslBuiltinFunction textureProjGrad
|
||||
syn keyword glslBuiltinFunction textureProjGradOffset
|
||||
syn keyword glslBuiltinFunction textureProjLod
|
||||
syn keyword glslBuiltinFunction textureProjLodOffset
|
||||
syn keyword glslBuiltinFunction textureProjOffset
|
||||
syn keyword glslBuiltinFunction textureQueryLevels
|
||||
syn keyword glslBuiltinFunction textureQueryLod
|
||||
syn keyword glslBuiltinFunction textureSize
|
||||
syn keyword glslBuiltinFunction transpose
|
||||
syn keyword glslBuiltinFunction trunc
|
||||
syn keyword glslBuiltinFunction uaddCarry
|
||||
syn keyword glslBuiltinFunction uintBitsToFloat
|
||||
syn keyword glslBuiltinFunction umulExtended
|
||||
syn keyword glslBuiltinFunction unpackDouble2x32
|
||||
syn keyword glslBuiltinFunction unpackHalf2x16
|
||||
syn keyword glslBuiltinFunction unpackSnorm2x16
|
||||
syn keyword glslBuiltinFunction unpackSnorm4x8
|
||||
syn keyword glslBuiltinFunction unpackUnorm2x16
|
||||
syn keyword glslBuiltinFunction unpackUnorm4x8
|
||||
syn keyword glslBuiltinFunction usubBorrow
|
||||
|
||||
hi def link glslConditional Conditional
|
||||
hi def link glslRepeat Repeat
|
||||
hi def link glslStatement Statement
|
||||
hi def link glslTodo Todo
|
||||
hi def link glslCommentL glslComment
|
||||
hi def link glslCommentStart glslComment
|
||||
hi def link glslComment Comment
|
||||
hi def link glslPreCondit PreCondit
|
||||
hi def link glslDefine Define
|
||||
hi def link glslTokenConcat glslPreProc
|
||||
hi def link glslPredefinedMacro Macro
|
||||
hi def link glslPreProc PreProc
|
||||
hi def link glslBoolean Boolean
|
||||
hi def link glslDecimalInt glslInteger
|
||||
hi def link glslOctalInt glslInteger
|
||||
hi def link glslHexInt glslInteger
|
||||
hi def link glslInteger Number
|
||||
hi def link glslFloat Float
|
||||
hi def link glslStructure Structure
|
||||
hi def link glslType Type
|
||||
hi def link glslQualifier StorageClass
|
||||
hi def link glslBuiltinConstant Constant
|
||||
hi def link glslBuiltinFunction Function
|
||||
hi def link glslBuiltinVariable Identifier
|
||||
hi def link glslSwizzle SpecialChar
|
||||
|
||||
if !exists("b:current_syntax")
|
||||
let b:current_syntax = "glsl"
|
||||
endif
|
||||
|
||||
" vim:set sts=2 sw=2 :
|
||||
|
||||
endif
|
||||
122
syntax/go.vim
122
syntax/go.vim
@@ -12,7 +12,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||
" let OPTION_NAME = 0
|
||||
" in your ~/.vimrc file to disable particular options. You can also write:
|
||||
" let OPTION_NAME = 1
|
||||
" to enable particular options.
|
||||
" to enable particular options.
|
||||
" At present, all options default to on, except highlight of:
|
||||
" functions, methods and structs.
|
||||
"
|
||||
@@ -27,6 +27,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||
" Highlights instances of tabs following spaces.
|
||||
" - go_highlight_trailing_whitespace_error
|
||||
" Highlights trailing white space.
|
||||
" - go_highlight_string_spellcheck
|
||||
" Specifies that strings should be spell checked
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -54,23 +56,27 @@ if !exists("g:go_highlight_trailing_whitespace_error")
|
||||
endif
|
||||
|
||||
if !exists("g:go_highlight_operators")
|
||||
let g:go_highlight_operators = 0
|
||||
let g:go_highlight_operators = 0
|
||||
endif
|
||||
|
||||
if !exists("g:go_highlight_functions")
|
||||
let g:go_highlight_functions = 0
|
||||
let g:go_highlight_functions = 0
|
||||
endif
|
||||
|
||||
if !exists("g:go_highlight_methods")
|
||||
let g:go_highlight_methods = 0
|
||||
let g:go_highlight_methods = 0
|
||||
endif
|
||||
|
||||
if !exists("g:go_highlight_structs")
|
||||
let g:go_highlight_structs = 0
|
||||
let g:go_highlight_structs = 0
|
||||
endif
|
||||
|
||||
if !exists("g:go_highlight_build_constraints")
|
||||
let g:go_highlight_build_constraints = 0
|
||||
let g:go_highlight_build_constraints = 0
|
||||
endif
|
||||
|
||||
if !exists("g:go_highlight_string_spellcheck")
|
||||
let g:go_highlight_string_spellcheck = 1
|
||||
endif
|
||||
|
||||
syn case match
|
||||
@@ -113,8 +119,8 @@ syn match goDeclaration /\<func\>/
|
||||
|
||||
|
||||
" Predefined functions and values
|
||||
syn keyword goBuiltins append cap close complex copy delete imag len
|
||||
syn keyword goBuiltins make new panic print println real recover
|
||||
syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/
|
||||
syn match goBuiltins /\<\v(make|new|panic|print|println|real|recover)\ze\(/
|
||||
syn keyword goBoolean iota true false nil
|
||||
|
||||
hi def link goBuiltins Keyword
|
||||
@@ -147,13 +153,18 @@ hi def link goEscapeError Error
|
||||
|
||||
" Strings and their contents
|
||||
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
|
||||
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
||||
syn region goRawString start=+`+ end=+`+
|
||||
if g:go_highlight_string_spellcheck != 0
|
||||
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup,@Spell
|
||||
syn region goRawString start=+`+ end=+`+ contains=@Spell
|
||||
else
|
||||
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
||||
syn region goRawString start=+`+ end=+`+
|
||||
endif
|
||||
syn match goFormatSpecifier /%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString
|
||||
|
||||
hi def link goString String
|
||||
hi def link goRawString String
|
||||
hi def link goFormatSpecifier goSpecialString
|
||||
hi def link goFormatSpecifier goSpecialString
|
||||
|
||||
" Characters; their contents
|
||||
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
|
||||
@@ -236,57 +247,76 @@ syn keyword goTodo contained NOTE
|
||||
hi def link goTodo Todo
|
||||
|
||||
|
||||
" Operators;
|
||||
" Operators;
|
||||
if g:go_highlight_operators != 0
|
||||
" match single-char operators: - + % < > ! & | ^ * =
|
||||
" and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= ==
|
||||
syn match goOperator /[-+%<>!&|^*=]=\?/
|
||||
" match / and /=
|
||||
syn match goOperator /\/\%(=\|\ze[^/*]\)/
|
||||
" match two-char operators: << >> &^
|
||||
" and corresponding three-char operators: <<= >>= &^=
|
||||
syn match goOperator /\%(<<\|>>\|&^\)=\?/
|
||||
" match remaining two-char operators: := && || <- ++ --
|
||||
syn match goOperator /:=\|||\|<-\|++\|--/
|
||||
" match ...
|
||||
syn match goOperator /\.\.\./
|
||||
" match single-char operators: - + % < > ! & | ^ * =
|
||||
" and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= ==
|
||||
syn match goOperator /[-+%<>!&|^*=]=\?/
|
||||
" match / and /=
|
||||
syn match goOperator /\/\%(=\|\ze[^/*]\)/
|
||||
" match two-char operators: << >> &^
|
||||
" and corresponding three-char operators: <<= >>= &^=
|
||||
syn match goOperator /\%(<<\|>>\|&^\)=\?/
|
||||
" match remaining two-char operators: := && || <- ++ --
|
||||
syn match goOperator /:=\|||\|<-\|++\|--/
|
||||
" match ...
|
||||
syn match goOperator /\.\.\./
|
||||
endif
|
||||
hi def link goOperator Operator
|
||||
hi def link goOperator Operator
|
||||
|
||||
" Functions;
|
||||
" Functions;
|
||||
if g:go_highlight_functions != 0
|
||||
syn match goFunction /\(func\s\+\)\@<=\w\+\((\)\@=/
|
||||
syn match goFunction /\()\s\+\)\@<=\w\+\((\)\@=/
|
||||
syn match goFunction /\(func\s\+\)\@<=\w\+\((\)\@=/
|
||||
syn match goFunction /\()\s\+\)\@<=\w\+\((\)\@=/
|
||||
endif
|
||||
hi def link goFunction Function
|
||||
hi def link goFunction Function
|
||||
|
||||
" Methods;
|
||||
" Methods;
|
||||
if g:go_highlight_methods != 0
|
||||
syn match goMethod /\(\.\)\@<=\w\+\((\)\@=/
|
||||
syn match goMethod /\(\.\)\@<=\w\+\((\)\@=/
|
||||
endif
|
||||
hi def link goMethod Type
|
||||
hi def link goMethod Type
|
||||
|
||||
" Structs;
|
||||
" Structs;
|
||||
if g:go_highlight_structs != 0
|
||||
syn match goStruct /\(.\)\@<=\w\+\({\)\@=/
|
||||
syn match goStructDef /\(type\s\+\)\@<=\w\+\(\s\+struct\s\+{\)\@=/
|
||||
syn match goStruct /\(.\)\@<=\w\+\({\)\@=/
|
||||
syn match goStructDef /\(type\s\+\)\@<=\w\+\(\s\+struct\s\+{\)\@=/
|
||||
endif
|
||||
hi def link goStruct Function
|
||||
hi def link goStruct Function
|
||||
hi def link goStructDef Function
|
||||
|
||||
" Build Constraints
|
||||
if g:go_highlight_build_constraints != 0
|
||||
syn keyword goBuildOs contained ignore cgo android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris windows
|
||||
syn keyword goBuildArch contained 386 amd64 amd64p32 arm
|
||||
syn match goBuildDirective display contained "+build"
|
||||
syn region goBuildComment start="//\s*+build" end="$" contains=goBuildDirective,goBuildOs,goBuildArch
|
||||
syn region goBuildComment start="/\*\s*+build" end="\*/" contains=goBuildDirective,goBuildOs,goBuildArch
|
||||
endif
|
||||
syn match goBuildKeyword display contained "+build"
|
||||
" Highlight the known values of GOOS, GOARCH, and other +build options.
|
||||
syn keyword goBuildDirectives contained
|
||||
\ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
|
||||
\ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64
|
||||
\ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc
|
||||
\ s390 s390x sparc sparc64 cgo ignore race
|
||||
|
||||
hi def link goBuildComment Comment
|
||||
hi def link goBuildOs Type
|
||||
hi def link goBuildArch Type
|
||||
hi def link goBuildDirective PreProc
|
||||
" 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
|
||||
" start of the comment.
|
||||
" 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.
|
||||
syn region goBuildComment matchgroup=goBuildCommentStart
|
||||
\ start="//\s*+build\s"rs=s+2 end="$"
|
||||
\ contains=goBuildKeyword,goBuildDirectives
|
||||
hi def link goBuildCommentStart Comment
|
||||
hi def link goBuildDirectives Type
|
||||
hi def link goBuildKeyword PreProc
|
||||
|
||||
" One or more line comments that are followed immediately by a "package"
|
||||
" declaration are treated like package documentation, so these must be
|
||||
" matched as comments to avoid looking like working build constraints.
|
||||
" The he, me, and re options let the "package" itself be highlighted by
|
||||
" the usual rules.
|
||||
syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/
|
||||
\ end=/\v\n\s*package/he=e-7,me=e-7,re=e-7
|
||||
\ contains=@goCommentGroup,@Spell
|
||||
hi def link goPackageComment Comment
|
||||
endif
|
||||
|
||||
|
||||
" Search backwards for a global declaration to start processing the syntax.
|
||||
|
||||
@@ -39,7 +39,7 @@ hi def link goRawString String
|
||||
|
||||
" Characters; their contents
|
||||
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
|
||||
syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup
|
||||
syn region goCharacter contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup
|
||||
|
||||
hi def link goCharacter Character
|
||||
|
||||
@@ -67,8 +67,8 @@ hi def link goImaginary Number
|
||||
syn cluster gotplLiteral contains=goString,goRawString,goCharacter,@goInt,goFloat,goImaginary
|
||||
syn keyword gotplControl contained if else end range with template
|
||||
syn keyword gotplFunctions contained and html index js len not or print printf println urlquery eq ne lt le gt ge
|
||||
syn match gotplVariable contained /\$[^ ]*\>/
|
||||
syn match goTplIdentifier contained /\.[^ ]*\>/
|
||||
syn match gotplVariable contained /\$[a-zA-Z0-9_]*\>/
|
||||
syn match goTplIdentifier contained /\.[^\s}]*\>/
|
||||
|
||||
hi def link gotplControl Keyword
|
||||
hi def link gotplFunctions Function
|
||||
|
||||
454
syntax/groovy.vim
Normal file
454
syntax/groovy.vim
Normal file
@@ -0,0 +1,454 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'groovy') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: Groovy
|
||||
" Maintainer: Alessio Pace <billy.corgan@tiscali.it>
|
||||
" Version: 0.1.9b
|
||||
" URL: http://www.vim.org/scripts/script.php?script_id=945
|
||||
" Last Change: 6/4/2004
|
||||
|
||||
" This is my very first vim script, I hope to have
|
||||
" done it the right way.
|
||||
"
|
||||
" I must directly or indirectly thank the author of java.vim and ruby.vim:
|
||||
" I copied from them most of the stuff :-)
|
||||
"
|
||||
" Relies on html.vim
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
"
|
||||
" HOWTO USE IT (INSTALL):
|
||||
" [groovy is still not recognized by vim! :-( ]
|
||||
"
|
||||
" 1) copy the file in the (global or user's $HOME/.vim/syntax/) syntax folder
|
||||
"
|
||||
" 2) add this line to recognize groovy files by filename extension:
|
||||
"
|
||||
" au BufNewFile,BufRead *.groovy setf groovy
|
||||
" in the global vim filetype.vim file or inside $HOME/.vim/filetype.vim
|
||||
"
|
||||
" 3) add this part to recognize by content groovy script (no extension needed :-)
|
||||
"
|
||||
" if did_filetype()
|
||||
" finish
|
||||
" endif
|
||||
" if getline(1) =~ '^#!.*[/\\]groovy\>'
|
||||
" setf groovy
|
||||
" endif
|
||||
"
|
||||
" in the global scripts.vim file or in $HOME/.vim/scripts.vim
|
||||
"
|
||||
" 4) open/write a .groovy file or a groovy script :-)
|
||||
"
|
||||
" Let me know if you like it or send me patches, so that I can improve it
|
||||
" when I have time
|
||||
|
||||
" Quit when a syntax file was already loaded
|
||||
if !exists("main_syntax")
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
" we define it here so that included files can test for it
|
||||
let main_syntax='groovy'
|
||||
endif
|
||||
|
||||
" don't use standard HiLink, it will not work with included syntax files
|
||||
if version < 508
|
||||
command! -nargs=+ GroovyHiLink hi link <args>
|
||||
else
|
||||
command! -nargs=+ GroovyHiLink hi def link <args>
|
||||
endif
|
||||
|
||||
" ##########################
|
||||
" Java stuff taken from java.vim
|
||||
" some characters that cannot be in a groovy program (outside a string)
|
||||
" syn match groovyError "[\\@`]"
|
||||
"syn match groovyError "<<<\|\.\.\|=>\|<>\|||=\|&&=\|[^-]->\|\*\/"
|
||||
"syn match groovyOK "\.\.\."
|
||||
|
||||
" keyword definitions
|
||||
syn keyword groovyExternal native package
|
||||
syn match groovyExternal "\<import\(\s\+static\>\)\?"
|
||||
syn keyword groovyError goto const
|
||||
syn keyword groovyConditional if else switch
|
||||
syn keyword groovyRepeat while for do
|
||||
syn keyword groovyBoolean true false
|
||||
syn keyword groovyConstant null
|
||||
syn keyword groovyTypedef this super
|
||||
syn keyword groovyOperator new instanceof
|
||||
syn keyword groovyType boolean char byte short int long float double
|
||||
syn keyword groovyType void
|
||||
syn keyword groovyType Integer Double Date Boolean Float String Array Vector List
|
||||
syn keyword groovyStatement return
|
||||
syn keyword groovyStorageClass static synchronized transient volatile final strictfp serializable
|
||||
syn keyword groovyExceptions throw try catch finally
|
||||
syn keyword groovyAssert assert
|
||||
syn keyword groovyMethodDecl synchronized throws
|
||||
syn keyword groovyClassDecl extends implements interface
|
||||
" to differentiate the keyword class from MyClass.class we use a match here
|
||||
syn match groovyTypedef "\.\s*\<class\>"ms=s+1
|
||||
syn keyword groovyClassDecl enum
|
||||
syn match groovyClassDecl "^class\>"
|
||||
syn match groovyClassDecl "[^.]\s*\<class\>"ms=s+1
|
||||
syn keyword groovyBranch break continue nextgroup=groovyUserLabelRef skipwhite
|
||||
syn match groovyUserLabelRef "\k\+" contained
|
||||
syn keyword groovyScopeDecl public protected private abstract
|
||||
|
||||
|
||||
if exists("groovy_highlight_groovy_lang_ids") || exists("groovy_highlight_groovy_lang") || exists("groovy_highlight_all")
|
||||
" groovy.lang.*
|
||||
syn keyword groovyLangClass Closure MetaMethod GroovyObject
|
||||
|
||||
syn match groovyJavaLangClass "\<System\>"
|
||||
syn keyword groovyJavaLangClass Cloneable Comparable Runnable Serializable Boolean Byte Class Object
|
||||
syn keyword groovyJavaLangClass Character CharSequence ClassLoader Compiler
|
||||
" syn keyword groovyJavaLangClass Integer Double Float Long
|
||||
syn keyword groovyJavaLangClass InheritableThreadLocal Math Number Object Package Process
|
||||
syn keyword groovyJavaLangClass Runtime RuntimePermission InheritableThreadLocal
|
||||
syn keyword groovyJavaLangClass SecurityManager Short StrictMath StackTraceElement
|
||||
syn keyword groovyJavaLangClass StringBuffer Thread ThreadGroup
|
||||
syn keyword groovyJavaLangClass ThreadLocal Throwable Void ArithmeticException
|
||||
syn keyword groovyJavaLangClass ArrayIndexOutOfBoundsException AssertionError
|
||||
syn keyword groovyJavaLangClass ArrayStoreException ClassCastException
|
||||
syn keyword groovyJavaLangClass ClassNotFoundException
|
||||
syn keyword groovyJavaLangClass CloneNotSupportedException Exception
|
||||
syn keyword groovyJavaLangClass IllegalAccessException
|
||||
syn keyword groovyJavaLangClass IllegalArgumentException
|
||||
syn keyword groovyJavaLangClass IllegalMonitorStateException
|
||||
syn keyword groovyJavaLangClass IllegalStateException
|
||||
syn keyword groovyJavaLangClass IllegalThreadStateException
|
||||
syn keyword groovyJavaLangClass IndexOutOfBoundsException
|
||||
syn keyword groovyJavaLangClass InstantiationException InterruptedException
|
||||
syn keyword groovyJavaLangClass NegativeArraySizeException NoSuchFieldException
|
||||
syn keyword groovyJavaLangClass NoSuchMethodException NullPointerException
|
||||
syn keyword groovyJavaLangClass NumberFormatException RuntimeException
|
||||
syn keyword groovyJavaLangClass SecurityException StringIndexOutOfBoundsException
|
||||
syn keyword groovyJavaLangClass UnsupportedOperationException
|
||||
syn keyword groovyJavaLangClass AbstractMethodError ClassCircularityError
|
||||
syn keyword groovyJavaLangClass ClassFormatError Error ExceptionInInitializerError
|
||||
syn keyword groovyJavaLangClass IllegalAccessError InstantiationError
|
||||
syn keyword groovyJavaLangClass IncompatibleClassChangeError InternalError
|
||||
syn keyword groovyJavaLangClass LinkageError NoClassDefFoundError
|
||||
syn keyword groovyJavaLangClass NoSuchFieldError NoSuchMethodError
|
||||
syn keyword groovyJavaLangClass OutOfMemoryError StackOverflowError
|
||||
syn keyword groovyJavaLangClass ThreadDeath UnknownError UnsatisfiedLinkError
|
||||
syn keyword groovyJavaLangClass UnsupportedClassVersionError VerifyError
|
||||
syn keyword groovyJavaLangClass VirtualMachineError
|
||||
|
||||
syn keyword groovyJavaLangObject clone equals finalize getClass hashCode
|
||||
syn keyword groovyJavaLangObject notify notifyAll toString wait
|
||||
|
||||
GroovyHiLink groovyLangClass groovyConstant
|
||||
GroovyHiLink groovyJavaLangClass groovyExternal
|
||||
GroovyHiLink groovyJavaLangObject groovyConstant
|
||||
syn cluster groovyTop add=groovyJavaLangObject,groovyJavaLangClass,groovyLangClass
|
||||
syn cluster groovyClasses add=groovyJavaLangClass,groovyLangClass
|
||||
endif
|
||||
|
||||
|
||||
" Groovy stuff
|
||||
syn match groovyOperator "\.\."
|
||||
syn match groovyOperator "<\{2,3}"
|
||||
syn match groovyOperator ">\{2,3}"
|
||||
syn match groovyOperator "->"
|
||||
syn match groovyExternal '^#!.*[/\\]groovy\>'
|
||||
syn match groovyExceptions "\<Exception\>\|\<[A-Z]\{1,}[a-zA-Z0-9]*Exception\>"
|
||||
|
||||
" Groovy JDK stuff
|
||||
syn keyword groovyJDKBuiltin as def in
|
||||
syn keyword groovyJDKOperOverl div minus plus abs round power multiply
|
||||
syn keyword groovyJDKMethods each call inject sort print println
|
||||
syn keyword groovyJDKMethods getAt putAt size push pop toList getText writeLine eachLine readLines
|
||||
syn keyword groovyJDKMethods withReader withStream withWriter withPrintWriter write read leftShift
|
||||
syn keyword groovyJDKMethods withWriterAppend readBytes splitEachLine
|
||||
syn keyword groovyJDKMethods newInputStream newOutputStream newPrintWriter newReader newWriter
|
||||
syn keyword groovyJDKMethods compareTo next previous isCase
|
||||
syn keyword groovyJDKMethods times step toInteger upto any collect dump every find findAll grep
|
||||
syn keyword groovyJDKMethods inspect invokeMethods join
|
||||
syn keyword groovyJDKMethods getErr getIn getOut waitForOrKill
|
||||
syn keyword groovyJDKMethods count tokenize asList flatten immutable intersect reverse reverseEach
|
||||
syn keyword groovyJDKMethods subMap append asWritable eachByte eachLine eachFile
|
||||
syn cluster groovyTop add=groovyJDKBuiltin,groovyJDKOperOverl,groovyJDKMethods
|
||||
|
||||
" no useful I think, so I comment it..
|
||||
"if filereadable(expand("<sfile>:p:h")."/groovyid.vim")
|
||||
" source <sfile>:p:h/groovyid.vim
|
||||
"endif
|
||||
|
||||
if exists("groovy_space_errors")
|
||||
if !exists("groovy_no_trail_space_error")
|
||||
syn match groovySpaceError "\s\+$"
|
||||
endif
|
||||
if !exists("groovy_no_tab_space_error")
|
||||
syn match groovySpaceError " \+\t"me=e-1
|
||||
endif
|
||||
endif
|
||||
|
||||
" it is a better case construct than java.vim to match groovy syntax
|
||||
syn region groovyLabelRegion transparent matchgroup=groovyLabel start="\<case\>" matchgroup=NONE end=":\|$" contains=groovyNumber,groovyString,groovyLangClass,groovyJavaLangClass
|
||||
syn match groovyUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=groovyLabel
|
||||
syn keyword groovyLabel default
|
||||
|
||||
if !exists("groovy_allow_cpp_keywords")
|
||||
syn keyword groovyError auto delete extern friend inline redeclared
|
||||
syn keyword groovyError register signed sizeof struct template typedef union
|
||||
syn keyword groovyError unsigned operator
|
||||
endif
|
||||
|
||||
" The following cluster contains all groovy groups except the contained ones
|
||||
syn cluster groovyTop add=groovyExternal,groovyError,groovyError,groovyBranch,groovyLabelRegion,groovyLabel,groovyConditional,groovyRepeat,groovyBoolean,groovyConstant,groovyTypedef,groovyOperator,groovyType,groovyType,groovyStatement,groovyStorageClass,groovyAssert,groovyExceptions,groovyMethodDecl,groovyClassDecl,groovyClassDecl,groovyClassDecl,groovyScopeDecl,groovyError,groovyError2,groovyUserLabel,groovyLangObject
|
||||
|
||||
|
||||
" Comments
|
||||
syn keyword groovyTodo contained TODO FIXME XXX
|
||||
if exists("groovy_comment_strings")
|
||||
syn region groovyCommentString contained start=+"+ end=+"+ end=+$+ end=+\*/+me=s-1,he=s-1 contains=groovySpecial,groovyCommentStar,groovySpecialChar,@Spell
|
||||
syn region groovyComment2String contained start=+"+ end=+$\|"+ contains=groovySpecial,groovySpecialChar,@Spell
|
||||
syn match groovyCommentCharacter contained "'\\[^']\{1,6\}'" contains=groovySpecialChar
|
||||
syn match groovyCommentCharacter contained "'\\''" contains=groovySpecialChar
|
||||
syn match groovyCommentCharacter contained "'[^\\]'"
|
||||
syn cluster groovyCommentSpecial add=groovyCommentString,groovyCommentCharacter,groovyNumber
|
||||
syn cluster groovyCommentSpecial2 add=groovyComment2String,groovyCommentCharacter,groovyNumber
|
||||
endif
|
||||
syn region groovyComment start="/\*" end="\*/" contains=@groovyCommentSpecial,groovyTodo,@Spell
|
||||
syn match groovyCommentStar contained "^\s*\*[^/]"me=e-1
|
||||
syn match groovyCommentStar contained "^\s*\*$"
|
||||
syn match groovyLineComment "//.*" contains=@groovyCommentSpecial2,groovyTodo,@Spell
|
||||
syn match groovyLineComment "#.*" contains=@groovyCommentSpecial2,groovyTodo,@Spell
|
||||
GroovyHiLink groovyCommentString groovyString
|
||||
GroovyHiLink groovyComment2String groovyString
|
||||
GroovyHiLink groovyCommentCharacter groovyCharacter
|
||||
|
||||
syn cluster groovyTop add=groovyComment,groovyLineComment
|
||||
|
||||
if !exists("groovy_ignore_groovydoc") && main_syntax != 'jsp'
|
||||
syntax case ignore
|
||||
" syntax coloring for groovydoc comments (HTML)
|
||||
" syntax include @groovyHtml <sfile>:p:h/html.vim
|
||||
syntax include @groovyHtml runtime! syntax/html.vim
|
||||
unlet b:current_syntax
|
||||
syn region groovyDocComment start="/\*\*" end="\*/" keepend contains=groovyCommentTitle,@groovyHtml,groovyDocTags,groovyTodo,@Spell
|
||||
syn region groovyCommentTitle contained matchgroup=groovyDocComment start="/\*\*" matchgroup=groovyCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@groovyHtml,groovyCommentStar,groovyTodo,@Spell,groovyDocTags
|
||||
|
||||
syn region groovyDocTags contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
|
||||
syn match groovyDocTags contained "@\(see\|param\|exception\|throws\|since\)\s\+\S\+" contains=groovyDocParam
|
||||
syn match groovyDocParam contained "\s\S\+"
|
||||
syn match groovyDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>"
|
||||
syntax case match
|
||||
endif
|
||||
|
||||
" match the special comment /**/
|
||||
syn match groovyComment "/\*\*/"
|
||||
|
||||
" Strings and constants
|
||||
syn match groovySpecialError contained "\\."
|
||||
syn match groovySpecialCharError contained "[^']"
|
||||
syn match groovySpecialChar contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\)"
|
||||
syn region groovyString start=+"+ end=+"+ end=+$+ contains=groovySpecialChar,groovySpecialError,@Spell,groovyELExpr
|
||||
syn region groovyString start=+'+ end=+'+ end=+$+ contains=groovySpecialChar,groovySpecialError,@Spell,groovyELExpr
|
||||
" syn region groovyELExpr start=+${+ end=+}+ keepend contained
|
||||
syn match groovyELExpr /\${.\{-}}/ contained
|
||||
GroovyHiLink groovyELExpr Identifier
|
||||
|
||||
" TODO: better matching. I am waiting to understand how it really works in groovy
|
||||
" syn region groovyClosureParamsBraces start=+|+ end=+|+ contains=groovyClosureParams
|
||||
" syn match groovyClosureParams "[ a-zA-Z0-9_*]\+" contained
|
||||
" GroovyHiLink groovyClosureParams Identifier
|
||||
|
||||
" next line disabled, it can cause a crash for a long line
|
||||
"syn match groovyStringError +"\([^"\\]\|\\.\)*$+
|
||||
|
||||
" disabled: in groovy strings or characters are written the same
|
||||
" syn match groovyCharacter "'[^']*'" contains=groovySpecialChar,groovySpecialCharError
|
||||
" syn match groovyCharacter "'\\''" contains=groovySpecialChar
|
||||
" syn match groovyCharacter "'[^\\]'"
|
||||
syn match groovyNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
|
||||
syn match groovyNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
|
||||
syn match groovyNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
|
||||
syn match groovyNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
|
||||
|
||||
" unicode characters
|
||||
syn match groovySpecial "\\u\d\{4\}"
|
||||
|
||||
syn cluster groovyTop add=groovyString,groovyCharacter,groovyNumber,groovySpecial,groovyStringError
|
||||
|
||||
if exists("groovy_highlight_functions")
|
||||
if groovy_highlight_functions == "indent"
|
||||
syn match groovyFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
|
||||
syn region groovyFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
|
||||
syn match groovyFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
|
||||
syn region groovyFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,@groovyClasses
|
||||
else
|
||||
" This line catches method declarations at any indentation>0, but it assumes
|
||||
" two things:
|
||||
" 1. class names are always capitalized (ie: Button)
|
||||
" 2. method names are never capitalized (except constructors, of course)
|
||||
syn region groovyFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=groovyScopeDecl,groovyType,groovyStorageClass,groovyComment,groovyLineComment,@groovyClasses
|
||||
endif
|
||||
syn match groovyBraces "[{}]"
|
||||
syn cluster groovyTop add=groovyFuncDef,groovyBraces
|
||||
endif
|
||||
|
||||
if exists("groovy_highlight_debug")
|
||||
|
||||
" Strings and constants
|
||||
syn match groovyDebugSpecial contained "\\\d\d\d\|\\."
|
||||
syn region groovyDebugString contained start=+"+ end=+"+ contains=groovyDebugSpecial
|
||||
syn match groovyDebugStringError +"\([^"\\]\|\\.\)*$+
|
||||
syn match groovyDebugCharacter contained "'[^\\]'"
|
||||
syn match groovyDebugSpecialCharacter contained "'\\.'"
|
||||
syn match groovyDebugSpecialCharacter contained "'\\''"
|
||||
syn match groovyDebugNumber contained "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
|
||||
syn match groovyDebugNumber contained "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
|
||||
syn match groovyDebugNumber contained "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
|
||||
syn match groovyDebugNumber contained "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
|
||||
syn keyword groovyDebugBoolean contained true false
|
||||
syn keyword groovyDebugType contained null this super
|
||||
syn region groovyDebugParen start=+(+ end=+)+ contained contains=groovyDebug.*,groovyDebugParen
|
||||
|
||||
" to make this work you must define the highlighting for these groups
|
||||
syn match groovyDebug "\<System\.\(out\|err\)\.print\(ln\)*\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
|
||||
syn match groovyDebug "\<p\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
|
||||
syn match groovyDebug "[A-Za-z][a-zA-Z0-9_]*\.printStackTrace\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
|
||||
syn match groovyDebug "\<trace[SL]\=\s*("me=e-1 contains=groovyDebug.* nextgroup=groovyDebugParen
|
||||
|
||||
syn cluster groovyTop add=groovyDebug
|
||||
|
||||
if version >= 508 || !exists("did_c_syn_inits")
|
||||
GroovyHiLink groovyDebug Debug
|
||||
GroovyHiLink groovyDebugString DebugString
|
||||
GroovyHiLink groovyDebugStringError groovyError
|
||||
GroovyHiLink groovyDebugType DebugType
|
||||
GroovyHiLink groovyDebugBoolean DebugBoolean
|
||||
GroovyHiLink groovyDebugNumber Debug
|
||||
GroovyHiLink groovyDebugSpecial DebugSpecial
|
||||
GroovyHiLink groovyDebugSpecialCharacter DebugSpecial
|
||||
GroovyHiLink groovyDebugCharacter DebugString
|
||||
GroovyHiLink groovyDebugParen Debug
|
||||
|
||||
GroovyHiLink DebugString String
|
||||
GroovyHiLink DebugSpecial Special
|
||||
GroovyHiLink DebugBoolean Boolean
|
||||
GroovyHiLink DebugType Type
|
||||
endif
|
||||
endif
|
||||
|
||||
" Match all Exception classes
|
||||
syn match groovyExceptions "\<Exception\>\|\<[A-Z]\{1,}[a-zA-Z0-9]*Exception\>"
|
||||
|
||||
|
||||
if !exists("groovy_minlines")
|
||||
let groovy_minlines = 10
|
||||
endif
|
||||
exec "syn sync ccomment groovyComment minlines=" . groovy_minlines
|
||||
|
||||
|
||||
" ###################
|
||||
" Groovy stuff
|
||||
" syn match groovyOperator "|[ ,a-zA-Z0-9_*]\+|"
|
||||
|
||||
" All groovy valid tokens
|
||||
" syn match groovyTokens ";\|,\|<=>\|<>\|:\|:=\|>\|>=\|=\|==\|<\|<=\|!=\|/\|/=\|\.\.|\.\.\.\|\~=\|\~=="
|
||||
" syn match groovyTokens "\*=\|&\|&=\|\*\|->\|\~\|+\|-\|/\|?\|<<<\|>>>\|<<\|>>"
|
||||
|
||||
" Must put explicit these ones because groovy.vim mark them as errors otherwise
|
||||
" syn match groovyTokens "<=>\|<>\|==\~"
|
||||
"syn cluster groovyTop add=groovyTokens
|
||||
|
||||
" Mark these as operators
|
||||
|
||||
" Hightlight brackets
|
||||
" syn match groovyBraces "[{}]"
|
||||
" syn match groovyBraces "[\[\]]"
|
||||
" syn match groovyBraces "[\|]"
|
||||
|
||||
if exists("groovy_mark_braces_in_parens_as_errors")
|
||||
syn match groovyInParen contained "[{}]"
|
||||
GroovyHiLink groovyInParen groovyError
|
||||
syn cluster groovyTop add=groovyInParen
|
||||
endif
|
||||
|
||||
" catch errors caused by wrong parenthesis
|
||||
syn region groovyParenT transparent matchgroup=groovyParen start="(" end=")" contains=@groovyTop,groovyParenT1
|
||||
syn region groovyParenT1 transparent matchgroup=groovyParen1 start="(" end=")" contains=@groovyTop,groovyParenT2 contained
|
||||
syn region groovyParenT2 transparent matchgroup=groovyParen2 start="(" end=")" contains=@groovyTop,groovyParenT contained
|
||||
syn match groovyParenError ")"
|
||||
GroovyHiLink groovyParenError groovyError
|
||||
|
||||
" catch errors caused by wrong square parenthesis
|
||||
syn region groovyParenT transparent matchgroup=groovyParen start="\[" end="\]" contains=@groovyTop,groovyParenT1
|
||||
syn region groovyParenT1 transparent matchgroup=groovyParen1 start="\[" end="\]" contains=@groovyTop,groovyParenT2 contained
|
||||
syn region groovyParenT2 transparent matchgroup=groovyParen2 start="\[" end="\]" contains=@groovyTop,groovyParenT contained
|
||||
syn match groovyParenError "\]"
|
||||
|
||||
" ###############################
|
||||
" java.vim default highlighting
|
||||
if version >= 508 || !exists("did_groovy_syn_inits")
|
||||
if version < 508
|
||||
let did_groovy_syn_inits = 1
|
||||
endif
|
||||
GroovyHiLink groovyFuncDef Function
|
||||
GroovyHiLink groovyBraces Function
|
||||
GroovyHiLink groovyBranch Conditional
|
||||
GroovyHiLink groovyUserLabelRef groovyUserLabel
|
||||
GroovyHiLink groovyLabel Label
|
||||
GroovyHiLink groovyUserLabel Label
|
||||
GroovyHiLink groovyConditional Conditional
|
||||
GroovyHiLink groovyRepeat Repeat
|
||||
GroovyHiLink groovyExceptions Exception
|
||||
GroovyHiLink groovyAssert Statement
|
||||
GroovyHiLink groovyStorageClass StorageClass
|
||||
GroovyHiLink groovyMethodDecl groovyStorageClass
|
||||
GroovyHiLink groovyClassDecl groovyStorageClass
|
||||
GroovyHiLink groovyScopeDecl groovyStorageClass
|
||||
GroovyHiLink groovyBoolean Boolean
|
||||
GroovyHiLink groovySpecial Special
|
||||
GroovyHiLink groovySpecialError Error
|
||||
GroovyHiLink groovySpecialCharError Error
|
||||
GroovyHiLink groovyString String
|
||||
GroovyHiLink groovyCharacter Character
|
||||
GroovyHiLink groovySpecialChar SpecialChar
|
||||
GroovyHiLink groovyNumber Number
|
||||
GroovyHiLink groovyError Error
|
||||
GroovyHiLink groovyStringError Error
|
||||
GroovyHiLink groovyStatement Statement
|
||||
GroovyHiLink groovyOperator Operator
|
||||
GroovyHiLink groovyComment Comment
|
||||
GroovyHiLink groovyDocComment Comment
|
||||
GroovyHiLink groovyLineComment Comment
|
||||
GroovyHiLink groovyConstant Constant
|
||||
GroovyHiLink groovyTypedef Typedef
|
||||
GroovyHiLink groovyTodo Todo
|
||||
|
||||
GroovyHiLink groovyCommentTitle SpecialComment
|
||||
GroovyHiLink groovyDocTags Special
|
||||
GroovyHiLink groovyDocParam Function
|
||||
GroovyHiLink groovyCommentStar groovyComment
|
||||
|
||||
GroovyHiLink groovyType Type
|
||||
GroovyHiLink groovyExternal Include
|
||||
|
||||
GroovyHiLink htmlComment Special
|
||||
GroovyHiLink htmlCommentPart Special
|
||||
GroovyHiLink groovySpaceError Error
|
||||
GroovyHiLink groovyJDKBuiltin Special
|
||||
GroovyHiLink groovyJDKOperOverl Operator
|
||||
GroovyHiLink groovyJDKMethods Function
|
||||
endif
|
||||
|
||||
delcommand GroovyHiLink
|
||||
|
||||
|
||||
let b:current_syntax = "groovy"
|
||||
if main_syntax == 'groovy'
|
||||
unlet main_syntax
|
||||
endif
|
||||
|
||||
let b:spell_options="contained"
|
||||
|
||||
" vim: ts=8
|
||||
|
||||
endif
|
||||
@@ -13,101 +13,26 @@ elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1
|
||||
syn region haskellRecordBlock matchgroup=haskellDelimiter start="{" end="}"
|
||||
\ contains=
|
||||
\ haskellType,
|
||||
\ haskellSeparator,
|
||||
\ haskellParens,
|
||||
\ haskellBrackets,
|
||||
\ haskellRecordField,
|
||||
\ haskellOperators,
|
||||
\ haskellDot,
|
||||
\ haskellLineComment,
|
||||
\ haskellBlockComment,
|
||||
\ haskellPragma,
|
||||
\ haskellForall
|
||||
else
|
||||
syn region haskellRecordBlock matchgroup=haskellDelimiter start="{" end="}"
|
||||
\ contains=
|
||||
\ haskellType,
|
||||
\ haskellSeparator,
|
||||
\ haskellParens,
|
||||
\ haskellBrackets,
|
||||
\ haskellRecordField,
|
||||
\ haskellOperators,
|
||||
\ haskellDot,
|
||||
\ haskellLineComment,
|
||||
\ haskellBlockComment,
|
||||
\ haskellPragma
|
||||
endif
|
||||
if exists('g:haskell_enable_pattern_synonyms') && g:haskell_enable_pattern_synonyms == 1
|
||||
syn region haskellImportList matchgroup=haskellDelimiter start="(" end=")"
|
||||
\ contains=
|
||||
\ haskellSeparator,
|
||||
\ haskellType,
|
||||
\ haskellLineComment,
|
||||
\ haskellBlockComment,
|
||||
\ haskellDot,
|
||||
\ haskellParens,
|
||||
\ haskellPatternKeyword
|
||||
else
|
||||
syn region haskellImportList matchgroup=haskellDelimiter start="(" end=")"
|
||||
\ contains=
|
||||
\ haskellSeparator,
|
||||
\ haskellType,
|
||||
\ haskellLineComment,
|
||||
\ haskellBlockComment,
|
||||
\ haskellDot,
|
||||
\ haskellParens
|
||||
end
|
||||
syn match haskellRecordField "[_a-z][a-zA-Z0-9_']*\s*::" contained
|
||||
syn match haskellRecordField contained containedin=haskellBlock
|
||||
\ "[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)"
|
||||
\ contains=
|
||||
\ haskellIdentifier,
|
||||
\ haskellOperators
|
||||
syn match haskellTopLevelDecl
|
||||
\ haskellOperators,
|
||||
\ haskellSeparator,
|
||||
\ haskellParens,
|
||||
syn match haskellTypeSig
|
||||
\ "^\s*\(where\s\+\|let\s\+\|default\s\+\)\?[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)"
|
||||
\ contains=
|
||||
\ haskellWhere,
|
||||
\ haskellLet,
|
||||
\ haskellIdentifier,
|
||||
\ haskellOperators,
|
||||
\ haskellSeparator,
|
||||
\ haskellParens,
|
||||
\ haskellBrackets,
|
||||
\ haskellWhere,
|
||||
\ haskellLet,
|
||||
\ haskellDefault
|
||||
syn region haskellModuleBlock matchgroup=haskellBlockKeywords start="\<module\>" end="\<where\>"
|
||||
\ contains=haskellType,haskellDot,haskellImportList
|
||||
syn region haskellClassBlock
|
||||
\ matchgroup=haskellBlockKeywords
|
||||
\ start="^\<\(class\|instance\)\>"
|
||||
\ end="\<where\>\|^\<"
|
||||
\ contains=
|
||||
\ haskellType,
|
||||
\ haskellSeparator,
|
||||
\ haskellParens,
|
||||
\ haskellDot,
|
||||
\ haskellOperators,
|
||||
\ haskellLineComment,
|
||||
\ haskellBlockComment,
|
||||
\ haskellPragma
|
||||
syn keyword haskellDeclKeyword newtype data type family instance where contained
|
||||
syn region haskellDeclBlock keepend
|
||||
\ start="^\<\(newtype\|data\|type\)\>\s\+\(\<\(family\|instance\)\>\)\?"
|
||||
\ end="\<where\>\|=\|^\<"
|
||||
\ contains=
|
||||
\ haskellDeclKeyword,
|
||||
\ haskellType,
|
||||
\ haskellQuoted,
|
||||
\ haskellParens,
|
||||
\ haskellBrackets,
|
||||
\ haskellDot,
|
||||
\ haskellOperators,
|
||||
\ haskellLineComment,
|
||||
\ haskellBlockComment,
|
||||
\ haskellPragma
|
||||
syn match haskellAssocType "\s\+\<\(data\|type\|newtype\)\>"
|
||||
syn match haskellDeriving "\(deriving\s\+instance\|deriving\)"
|
||||
syn keyword haskelLWhere where
|
||||
syn keyword haskellLet let
|
||||
syn keyword haskellDeclKeyword module class instance newtype deriving in
|
||||
syn match haskellDecl "\<\(type\|data\)\>\s\+\(\<family\>\)\?"
|
||||
syn keyword haskellDefault default
|
||||
syn keyword haskellImportKeywords import qualified safe as hiding contained
|
||||
syn keyword haskellForeignKeywords foreign export import ccall safe unsafe interruptible capi prim contained
|
||||
@@ -117,19 +42,16 @@ syn region haskellForeignImport start="\<foreign\>" end="::" keepend
|
||||
\ haskellOperators,
|
||||
\ haskellForeignKeywords,
|
||||
\ haskellIdentifier
|
||||
syn region haskellImport
|
||||
\ start="^import"
|
||||
\ end="^\<"
|
||||
syn match haskellImport "^\<import\>\s\+\(\<safe\>\s\+\)\?\(\<qualified\>\s\+\)\?.\+\(\s\+\<as\>\s\+.\+\)\?\(\s\+\<hiding\>\)\?"
|
||||
\ contains=
|
||||
\ haskellParens,
|
||||
\ haskellOperators,
|
||||
\ haskellImportKeywords,
|
||||
\ haskellImportList,
|
||||
\ haskellType,
|
||||
\ haskellLineComment,
|
||||
\ haskellBlockComment,
|
||||
\ haskellDot
|
||||
syn keyword haskellStatement do case of in
|
||||
syn keyword haskellWhere where
|
||||
syn keyword haskellLet let
|
||||
\ haskellPragma,
|
||||
syn keyword haskellStatement do case of
|
||||
if exists('g:haskell_enable_static_pointers') && g:haskell_enable_static_pointers == 1
|
||||
syn keyword haskellStatic static
|
||||
endif
|
||||
@@ -137,12 +59,12 @@ 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 haskellFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
|
||||
syn match haskellSeparator "[,;]"
|
||||
syn region haskellParens matchgroup=haskellDelimiter start="(" end=")" contains=TOP
|
||||
syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contains=TOP
|
||||
syn region haskellParens matchgroup=haskellDelimiter start="(" end=")" contains=TOP,haskellTypeSig
|
||||
syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contains=TOP,haskellTypeSig
|
||||
syn region haskellBlock matchgroup=haskellDelimiter start="{" end="}" contains=TOP
|
||||
syn keyword haskellInfix infix infixl infixr
|
||||
syn keyword haskellBottom undefined error
|
||||
syn match haskellOperators "[-!#$%&\*\+/<=>\?@\\^|~:]\+\|\<_\>"
|
||||
syn match haskellOperators "[-!#$%&\*\+/<=>\?@\\^|~:.]\+\|\<_\>"
|
||||
syn match haskellQuote "\<'\+" contained
|
||||
syn match haskellQuotedType "[A-Z][a-zA-Z0-9_']*\>" contained
|
||||
syn region haskellQuoted start="\<'\+" end="\>"
|
||||
@@ -154,7 +76,6 @@ syn region haskellQuoted start="\<'\+" end="\>"
|
||||
\ haskellParens,
|
||||
\ haskellOperators,
|
||||
\ haskellIdentifier
|
||||
syn match haskellDot "\."
|
||||
syn match haskellLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$"
|
||||
\ contains=
|
||||
\ haskellTodo,
|
||||
@@ -164,22 +85,24 @@ syn region haskellString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
\ contains=@Spell
|
||||
syn match haskellIdentifier "[_a-z][a-zA-z0-9_']*" contained
|
||||
syn match haskellChar "\<'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'\>"
|
||||
syn match haskellType "\<[A-Z][a-zA-Z0-9_']*\>\n\?\s*"
|
||||
\ nextgroup=haskellBlockComment,haskellRecordBlock
|
||||
syn match haskellType "\<[A-Z][a-zA-Z0-9_']*\>"
|
||||
syn region haskellBlockComment start="{-" end="-}"
|
||||
\ contains=
|
||||
\ haskellBlockComment,
|
||||
\ haskellTodo,
|
||||
\ @Spell
|
||||
syn region haskellPragma start="{-#" end="#-}"
|
||||
syn match haskellQuasiQuoted "." containedin=haskellQuasiQuote contained
|
||||
syn region haskellQuasiQuote matchgroup=haskellTH start="\[[_a-z][a-zA-z0-9_']*|" end="|\]"
|
||||
syn region haskellTHBlock matchgroup=haskellTH start="\[\(d\|t\|p\)\?|" end="|]" contains=TOP
|
||||
syn region haskellTHDoubleBlock matchgroup=haskellTH start="\[||" end="||]" contains=TOP
|
||||
syn match haskellPreProc "^#.*$"
|
||||
syn keyword haskellTodo TODO FIXME contained
|
||||
" Treat a shebang line at the start of the file as a comment
|
||||
syn match haskellShebang "\%^#!.*$"
|
||||
if exists('g:haskell_enable_typeroles') && g:haskell_enable_typeroles == 1
|
||||
syn keyword haskellTypeRoles phantom representational nominal contained
|
||||
syn region haskellTypeRoleBlock matchgroup=haskellTypeRoles start="type\s\+role" end="^\<" keepend
|
||||
syn region haskellTypeRoleBlock matchgroup=haskellTypeRoles start="type\s\+role" end="$" keepend
|
||||
\ contains=
|
||||
\ haskellType,
|
||||
\ haskellTypeRoles
|
||||
@@ -194,12 +117,7 @@ if exists('g:haskell_enable_arrowsyntax') && g:haskell_enable_arrowsyntax == 1
|
||||
syn keyword haskellArrowSyntax proc
|
||||
endif
|
||||
if exists('g:haskell_enable_pattern_synonyms') && g:haskell_enable_pattern_synonyms == 1
|
||||
syn region haskellPatternSynonym start="^\<pattern\>" end="=\|<-" keepend
|
||||
\ contains=
|
||||
\ haskellPatternKeyword,
|
||||
\ haskellType,
|
||||
\ haskellOperators
|
||||
syn keyword haskellPatternKeyword pattern contained
|
||||
syn keyword haskellPatternKeyword pattern
|
||||
endif
|
||||
|
||||
highlight def link haskellBottom Macro
|
||||
@@ -209,8 +127,6 @@ highlight def link haskellIdentifier Identifier
|
||||
highlight def link haskellForeignKeywords Structure
|
||||
highlight def link haskellDeriving Structure
|
||||
highlight def link haskellStatement Statement
|
||||
highlight def link haskellWhere Statement
|
||||
highlight def link haskellLet Statement
|
||||
highlight def link haskellDefault Statement
|
||||
highlight def link haskellConditional Conditional
|
||||
highlight def link haskellNumber Number
|
||||
@@ -221,8 +137,8 @@ highlight def link haskellInfix PreProc
|
||||
highlight def link haskellOperators Operator
|
||||
highlight def link haskellQuote Operator
|
||||
highlight def link haskellQuotedType Include
|
||||
highlight def link haskellDot Operator
|
||||
highlight def link haskellType Include
|
||||
highlight def link haskellShebang Comment
|
||||
highlight def link haskellLineComment Comment
|
||||
highlight def link haskellBlockComment Comment
|
||||
highlight def link haskellPragma SpecialComment
|
||||
@@ -235,6 +151,10 @@ highlight def link haskellAssocType Structure
|
||||
highlight def link haskellImportBlock Delimiter
|
||||
highlight def link haskellImportKeywords Structure
|
||||
highlight def link haskellDeclKeyword Structure
|
||||
highlight def link haskellDecl Structure
|
||||
highlight def link haskellWhere Structure
|
||||
highlight def link haskellLet Structure
|
||||
highlight def link haskellQuasiQuoted String
|
||||
|
||||
if exists('g:haskell_enable_quantification') && g:haskell_enable_quantification == 1
|
||||
highlight def link haskellForall Operator
|
||||
|
||||
@@ -18,6 +18,8 @@ silent! syntax include @htmlCoffeescript syntax/coffee.vim
|
||||
unlet! b:current_syntax
|
||||
silent! syntax include @htmlStylus syntax/stylus.vim
|
||||
unlet! b:current_syntax
|
||||
silent! syntax include @htmlCss syntax/css.vim
|
||||
unlet! b:current_syntax
|
||||
silent! syntax include @htmlMarkdown syntax/markdown.vim
|
||||
unlet! b:current_syntax
|
||||
|
||||
@@ -37,7 +39,7 @@ syn region jadeCommentBlock start="\z(\s*\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!"
|
||||
syn region jadeHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
|
||||
syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,jadeHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent
|
||||
syn match jadeClassChar "\." contained nextgroup=jadeClass
|
||||
syn match jadeBlockExpansionChar ":\s\+" contained nextgroup=jadeTag
|
||||
syn match jadeBlockExpansionChar ":\s\+" contained nextgroup=jadeTag,jadeClassChar,jadeIdChar
|
||||
syn match jadeIdChar "#[[{]\@!" contained nextgroup=jadeId
|
||||
syn match jadeClass "\%(\w\|-\)\+" contained nextgroup=@jadeComponent
|
||||
syn match jadeId "\%(\w\|-\)\+" contained nextgroup=@jadeComponent
|
||||
@@ -69,7 +71,7 @@ syn keyword jadeScriptLoopKeywords for in contained
|
||||
|
||||
syn region jadeJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,jadeJavascriptTag,jadeCoffeescriptFilter keepend
|
||||
|
||||
syn region jadeCoffeescriptFilter matchgroup=jadeFilter start="^\z(\s*\):coffeescript\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCoffeescript contained
|
||||
syn region jadeCoffeescriptFilter matchgroup=jadeFilter start="^\z(\s*\):coffee-\?script\s*$" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCoffeescript contained
|
||||
syn region jadeJavascriptTag contained start="^\z(\s*\)script\%(:\w\+\)\=" end="$" contains=jadeBegin,jadeTag
|
||||
syn region jadeCssBlock start="^\z(\s*\)style" nextgroup=@jadeComponent,jadeError end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlCss keepend
|
||||
|
||||
|
||||
139
syntax/jinja.vim
Normal file
139
syntax/jinja.vim
Normal file
@@ -0,0 +1,139 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jinja') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: Jinja template
|
||||
" Maintainer: Armin Ronacher <armin.ronacher@active-4.com>
|
||||
" Last Change: 2008 May 9
|
||||
" Version: 1.1
|
||||
"
|
||||
" Known Bugs:
|
||||
" because of odd limitations dicts and the modulo operator
|
||||
" appear wrong in the template.
|
||||
"
|
||||
" Changes:
|
||||
"
|
||||
" 2008 May 9: Added support for Jinja2 changes (new keyword rules)
|
||||
|
||||
" .vimrc variable to disable html highlighting
|
||||
if !exists('g:jinja_syntax_html')
|
||||
let g:jinja_syntax_html=1
|
||||
endif
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
if !exists("main_syntax")
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let main_syntax = 'jinja'
|
||||
endif
|
||||
|
||||
" Pull in the HTML syntax.
|
||||
if g:jinja_syntax_html
|
||||
if version < 600
|
||||
so <sfile>:p:h/html.vim
|
||||
else
|
||||
runtime! syntax/html.vim
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
endif
|
||||
|
||||
syntax case match
|
||||
|
||||
" Jinja template built-in tags and parameters (without filter, macro, is and raw, they
|
||||
" have special threatment)
|
||||
syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained and if else in not or recursive as import
|
||||
|
||||
syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained is filter skipwhite nextgroup=jinjaFilter
|
||||
syn keyword jinjaStatement containedin=jinjaTagBlock contained macro skipwhite nextgroup=jinjaFunction
|
||||
syn keyword jinjaStatement containedin=jinjaTagBlock contained block skipwhite nextgroup=jinjaBlockName
|
||||
|
||||
" Variable Names
|
||||
syn match jinjaVariable containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
syn keyword jinjaSpecial containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained false true none False True None loop super caller varargs kwargs
|
||||
|
||||
" Filters
|
||||
syn match jinjaOperator "|" containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained skipwhite nextgroup=jinjaFilter
|
||||
syn match jinjaFilter contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
syn match jinjaFunction contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
syn match jinjaBlockName contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
|
||||
" Jinja template constants
|
||||
syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/"/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\"/ end=/"/
|
||||
syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/'/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\'/ end=/'/
|
||||
syn match jinjaNumber containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[0-9]\+\(\.[0-9]\+\)\?/
|
||||
|
||||
" Operators
|
||||
syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[+\-*\/<>=!,:]/
|
||||
syn match jinjaPunctuation containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[()\[\]]/
|
||||
syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /\./ nextgroup=jinjaAttribute
|
||||
syn match jinjaAttribute contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
|
||||
" Jinja template tag and variable blocks
|
||||
syn region jinjaNested matchgroup=jinjaOperator start="(" end=")" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
|
||||
syn region jinjaNested matchgroup=jinjaOperator start="\[" end="\]" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
|
||||
syn region jinjaNested matchgroup=jinjaOperator start="{" end="}" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
|
||||
syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
|
||||
|
||||
syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
|
||||
|
||||
" Jinja template 'raw' tag
|
||||
syn region jinjaRaw matchgroup=jinjaRawDelim start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment
|
||||
|
||||
" Jinja comments
|
||||
syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString
|
||||
|
||||
" Block start keywords. A bit tricker. We only highlight at the start of a
|
||||
" tag block and only if the name is not followed by a comma or equals sign
|
||||
" which usually means that we have to deal with an assignment.
|
||||
syn match jinjaStatement containedin=jinjaTagBlock contained /\({%-\?\s*\)\@<=\<[a-zA-Z_][a-zA-Z0-9_]*\>\(\s*[,=]\)\@!/
|
||||
|
||||
" and context modifiers
|
||||
syn match jinjaStatement containedin=jinjaTagBlock contained /\<with\(out\)\?\s\+context\>/
|
||||
|
||||
|
||||
" 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_jinja_syn_inits")
|
||||
if version < 508
|
||||
let did_jinja_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink jinjaPunctuation jinjaOperator
|
||||
HiLink jinjaAttribute jinjaVariable
|
||||
HiLink jinjaFunction jinjaFilter
|
||||
|
||||
HiLink jinjaTagDelim jinjaTagBlock
|
||||
HiLink jinjaVarDelim jinjaVarBlock
|
||||
HiLink jinjaCommentDelim jinjaComment
|
||||
HiLink jinjaRawDelim jinja
|
||||
|
||||
HiLink jinjaSpecial Special
|
||||
HiLink jinjaOperator Normal
|
||||
HiLink jinjaRaw Normal
|
||||
HiLink jinjaTagBlock PreProc
|
||||
HiLink jinjaVarBlock PreProc
|
||||
HiLink jinjaStatement Statement
|
||||
HiLink jinjaFilter Function
|
||||
HiLink jinjaBlockName Function
|
||||
HiLink jinjaVariable Identifier
|
||||
HiLink jinjaString Constant
|
||||
HiLink jinjaNumber Constant
|
||||
HiLink jinjaComment Comment
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "jinja"
|
||||
|
||||
if main_syntax == 'jinja'
|
||||
unlet main_syntax
|
||||
endif
|
||||
|
||||
endif
|
||||
139
syntax/jinja2.vim
Normal file
139
syntax/jinja2.vim
Normal file
@@ -0,0 +1,139 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: Jinja template
|
||||
" Maintainer: Armin Ronacher <armin.ronacher@active-4.com>
|
||||
" Last Change: 2008 May 9
|
||||
" Version: 1.1
|
||||
"
|
||||
" Known Bugs:
|
||||
" because of odd limitations dicts and the modulo operator
|
||||
" appear wrong in the template.
|
||||
"
|
||||
" Changes:
|
||||
"
|
||||
" 2008 May 9: Added support for Jinja2 changes (new keyword rules)
|
||||
|
||||
" .vimrc variable to disable html highlighting
|
||||
if !exists('g:jinja_syntax_html')
|
||||
let g:jinja_syntax_html=1
|
||||
endif
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
if !exists("main_syntax")
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let main_syntax = 'jinja'
|
||||
endif
|
||||
|
||||
" Pull in the HTML syntax.
|
||||
if g:jinja_syntax_html
|
||||
if version < 600
|
||||
so <sfile>:p:h/html.vim
|
||||
else
|
||||
runtime! syntax/html.vim
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
endif
|
||||
|
||||
syntax case match
|
||||
|
||||
" Jinja template built-in tags and parameters (without filter, macro, is and raw, they
|
||||
" have special threatment)
|
||||
syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained and if else in not or recursive as import
|
||||
|
||||
syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained is filter skipwhite nextgroup=jinjaFilter
|
||||
syn keyword jinjaStatement containedin=jinjaTagBlock contained macro skipwhite nextgroup=jinjaFunction
|
||||
syn keyword jinjaStatement containedin=jinjaTagBlock contained block skipwhite nextgroup=jinjaBlockName
|
||||
|
||||
" Variable Names
|
||||
syn match jinjaVariable containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
syn keyword jinjaSpecial containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained false true none False True None loop super caller varargs kwargs
|
||||
|
||||
" Filters
|
||||
syn match jinjaOperator "|" containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained skipwhite nextgroup=jinjaFilter
|
||||
syn match jinjaFilter contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
syn match jinjaFunction contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
syn match jinjaBlockName contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
|
||||
" Jinja template constants
|
||||
syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/"/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\"/ end=/"/
|
||||
syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/'/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\'/ end=/'/
|
||||
syn match jinjaNumber containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[0-9]\+\(\.[0-9]\+\)\?/
|
||||
|
||||
" Operators
|
||||
syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[+\-*\/<>=!,:]/
|
||||
syn match jinjaPunctuation containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[()\[\]]/
|
||||
syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /\./ nextgroup=jinjaAttribute
|
||||
syn match jinjaAttribute contained /[a-zA-Z_][a-zA-Z0-9_]*/
|
||||
|
||||
" Jinja template tag and variable blocks
|
||||
syn region jinjaNested matchgroup=jinjaOperator start="(" end=")" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
|
||||
syn region jinjaNested matchgroup=jinjaOperator start="\[" end="\]" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
|
||||
syn region jinjaNested matchgroup=jinjaOperator start="{" end="}" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
|
||||
syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
|
||||
|
||||
syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
|
||||
|
||||
" Jinja template 'raw' tag
|
||||
syn region jinjaRaw matchgroup=jinjaRawDelim start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment
|
||||
|
||||
" Jinja comments
|
||||
syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString
|
||||
|
||||
" Block start keywords. A bit tricker. We only highlight at the start of a
|
||||
" tag block and only if the name is not followed by a comma or equals sign
|
||||
" which usually means that we have to deal with an assignment.
|
||||
syn match jinjaStatement containedin=jinjaTagBlock contained /\({%-\?\s*\)\@<=\<[a-zA-Z_][a-zA-Z0-9_]*\>\(\s*[,=]\)\@!/
|
||||
|
||||
" and context modifiers
|
||||
syn match jinjaStatement containedin=jinjaTagBlock contained /\<with\(out\)\?\s\+context\>/
|
||||
|
||||
|
||||
" 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_jinja_syn_inits")
|
||||
if version < 508
|
||||
let did_jinja_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink jinjaPunctuation jinjaOperator
|
||||
HiLink jinjaAttribute jinjaVariable
|
||||
HiLink jinjaFunction jinjaFilter
|
||||
|
||||
HiLink jinjaTagDelim jinjaTagBlock
|
||||
HiLink jinjaVarDelim jinjaVarBlock
|
||||
HiLink jinjaCommentDelim jinjaComment
|
||||
HiLink jinjaRawDelim jinja
|
||||
|
||||
HiLink jinjaSpecial Special
|
||||
HiLink jinjaOperator Normal
|
||||
HiLink jinjaRaw Normal
|
||||
HiLink jinjaTagBlock PreProc
|
||||
HiLink jinjaVarBlock PreProc
|
||||
HiLink jinjaStatement Statement
|
||||
HiLink jinjaFilter Function
|
||||
HiLink jinjaBlockName Function
|
||||
HiLink jinjaVariable Identifier
|
||||
HiLink jinjaString Constant
|
||||
HiLink jinjaNumber Constant
|
||||
HiLink jinjaComment Comment
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "jinja"
|
||||
|
||||
if main_syntax == 'jinja'
|
||||
unlet main_syntax
|
||||
endif
|
||||
|
||||
endif
|
||||
105
syntax/kotlin.vim
Normal file
105
syntax/kotlin.vim
Normal file
@@ -0,0 +1,105 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: Kotlin
|
||||
" Maintainer: Alexander Udalov
|
||||
" Latest Revision: 23 December 2015
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:current_syntax = "kotlin"
|
||||
|
||||
syn keyword ktStatement break continue return
|
||||
syn keyword ktConditional if else when
|
||||
syn keyword ktRepeat do for while
|
||||
syn keyword ktOperator as in is by
|
||||
syn keyword ktKeyword get set out super this where
|
||||
syn keyword ktException try catch finally throw
|
||||
|
||||
syn keyword ktInclude import package
|
||||
|
||||
syn keyword ktType Any Boolean Byte Char Double Float Int Long Nothing Short Unit
|
||||
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 ktReservedKeyword async typealias typeof yield
|
||||
|
||||
syn keyword ktBoolean true false
|
||||
syn keyword ktConstant null
|
||||
|
||||
syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix
|
||||
|
||||
syn keyword ktTodo TODO FIXME XXX contained
|
||||
syn match ktLineComment "//.*$" contains=ktTodo,@Spell
|
||||
syn region ktComment matchgroup=ktCommentMatchGroup start="/\*" end="\*/" contains=ktComment,ktTodo,@Spell
|
||||
|
||||
syn match ktSpecialCharError "\v\\." contained
|
||||
syn match ktSpecialChar "\v\\([tbnr'"$\\]|u\x{4})" contained
|
||||
syn region ktString start='"' skip='\\"' end='"' contains=ktSimpleInterpolation,ktComplexInterpolation,ktSpecialChar,ktSpecialCharError
|
||||
syn region ktString start='"""' end='"""' contains=ktSimpleInterpolation,ktComplexInterpolation,ktSpecialChar,ktSpecialCharError
|
||||
syn match ktCharacter "\v'[^']*'" contains=ktSpecialChar,ktSpecialCharError
|
||||
syn match ktCharacter "\v'\\''" contains=ktSpecialChar
|
||||
syn match ktCharacter "\v'[^\\]'"
|
||||
|
||||
" TODO: highlight label in 'this@Foo'
|
||||
syn match ktAnnotation "\v(\w)@<!\@[[:alnum:]_.]*(:[[:alnum:]_.]*)?"
|
||||
syn match ktLabel "\v\w+\@"
|
||||
|
||||
syn match ktSimpleInterpolation "\v\$\h\w*" contained
|
||||
syn region ktComplexInterpolation matchgroup=ktComplexInterpolationBrace start="\v\$\{" end="\v\}" contains=ALLBUT,ktSimpleInterpolation
|
||||
|
||||
syn match ktNumber "\v<\d+[LFf]?"
|
||||
syn match ktNumber "\v<0[Xx]\x+L?"
|
||||
syn match ktNumber "\v<0[Bb]\d+L?"
|
||||
syn match ktFloat "\v<\d*(\d[eE][-+]?\d+|\.\d+([eE][-+]?\d+)?)[Ff]?"
|
||||
|
||||
syn match ktEscapedName "\v`.*`"
|
||||
|
||||
syn match ktExclExcl "!!"
|
||||
syn match ktArrow "->"
|
||||
|
||||
|
||||
|
||||
hi link ktStatement Statement
|
||||
hi link ktConditional Conditional
|
||||
hi link ktRepeat Repeat
|
||||
hi link ktOperator Operator
|
||||
hi link ktKeyword Keyword
|
||||
hi link ktException Exception
|
||||
hi link ktReservedKeyword Error
|
||||
|
||||
hi link ktInclude Include
|
||||
|
||||
hi link ktType Type
|
||||
hi link ktModifier StorageClass
|
||||
hi link ktStructure Structure
|
||||
hi link ktTypedef Typedef
|
||||
|
||||
hi link ktBoolean Boolean
|
||||
hi link ktConstant Constant
|
||||
|
||||
hi link ktTodo Todo
|
||||
hi link ktLineComment Comment
|
||||
hi link ktComment Comment
|
||||
hi link ktCommentMatchGroup Comment
|
||||
|
||||
hi link ktSpecialChar SpecialChar
|
||||
hi link ktSpecialCharError Error
|
||||
hi link ktString String
|
||||
hi link ktCharacter Character
|
||||
|
||||
hi link ktAnnotation Identifier
|
||||
hi link ktLabel Identifier
|
||||
|
||||
hi link ktSimpleInterpolation Identifier
|
||||
hi link ktComplexInterpolationBrace Identifier
|
||||
|
||||
hi link ktNumber Number
|
||||
hi link ktFloat Float
|
||||
|
||||
hi link ktExclExcl Special
|
||||
hi link ktArrow Structure
|
||||
|
||||
endif
|
||||
@@ -87,14 +87,14 @@ exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start=
|
||||
|
||||
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 region markdownCode matchgroup=markdownCodeDelimiter start="^\s*```*.*$" end="^\s*```*\ze\s*$" keepend
|
||||
|
||||
syn match markdownFootnote "\[^[^\]]\+\]"
|
||||
syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:"
|
||||
|
||||
if main_syntax ==# 'markdown'
|
||||
for s:type in g:markdown_fenced_languages
|
||||
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')
|
||||
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')
|
||||
endfor
|
||||
unlet! s:type
|
||||
endif
|
||||
|
||||
204
syntax/nginx.vim
204
syntax/nginx.vim
@@ -11,12 +11,11 @@ setlocal iskeyword+=.
|
||||
setlocal iskeyword+=/
|
||||
setlocal iskeyword+=:
|
||||
|
||||
syn match ngxVariable '\$\w\w*'
|
||||
syn match ngxVariableBlock '\$\w\w*' contained
|
||||
syn match ngxVariableString '\$\w\w*' contained
|
||||
syn region ngxBlock start=+^+ end=+{+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline
|
||||
syn region ngxString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=ngxVariableString oneline
|
||||
syn region ngxString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=ngxVariableString oneline
|
||||
syn match ngxVariable '\$\(\w\+\|{\w\+}\)'
|
||||
syn match ngxVariableBlock '\$\(\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 keyword ngxBoolean on
|
||||
@@ -34,6 +33,7 @@ syn keyword ngxDirectiveBlock limit_except contained
|
||||
syn keyword ngxDirectiveBlock if contained
|
||||
syn keyword ngxDirectiveBlock geo contained
|
||||
syn keyword ngxDirectiveBlock map contained
|
||||
syn keyword ngxDirectiveBlock split_clients contained
|
||||
|
||||
syn keyword ngxDirectiveImportant include
|
||||
syn keyword ngxDirectiveImportant root
|
||||
@@ -44,6 +44,8 @@ syn keyword ngxDirectiveImportant internal
|
||||
syn keyword ngxDirectiveImportant proxy_pass
|
||||
syn keyword ngxDirectiveImportant memcached_pass
|
||||
syn keyword ngxDirectiveImportant fastcgi_pass
|
||||
syn keyword ngxDirectiveImportant scgi_pass
|
||||
syn keyword ngxDirectiveImportant uwsgi_pass
|
||||
syn keyword ngxDirectiveImportant try_files
|
||||
|
||||
syn keyword ngxDirectiveControl break
|
||||
@@ -56,12 +58,15 @@ syn keyword ngxDirectiveError post_action
|
||||
|
||||
syn keyword ngxDirectiveDeprecated connections
|
||||
syn keyword ngxDirectiveDeprecated imap
|
||||
syn keyword ngxDirectiveDeprecated limit_zone
|
||||
syn keyword ngxDirectiveDeprecated open_file_cache_retest
|
||||
syn keyword ngxDirectiveDeprecated optimize_server_names
|
||||
syn keyword ngxDirectiveDeprecated satisfy_any
|
||||
syn keyword ngxDirectiveDeprecated so_keepalive
|
||||
|
||||
syn keyword ngxDirective accept_mutex
|
||||
syn keyword ngxDirective accept_mutex_delay
|
||||
syn keyword ngxDirective acceptex_read
|
||||
syn keyword ngxDirective access_log
|
||||
syn keyword ngxDirective add_after_body
|
||||
syn keyword ngxDirective add_before_body
|
||||
@@ -77,11 +82,14 @@ syn keyword ngxDirective auth_basic_user_file
|
||||
syn keyword ngxDirective auth_http
|
||||
syn keyword ngxDirective auth_http_header
|
||||
syn keyword ngxDirective auth_http_timeout
|
||||
syn keyword ngxDirective auth_request
|
||||
syn keyword ngxDirective auth_request_set
|
||||
syn keyword ngxDirective autoindex
|
||||
syn keyword ngxDirective autoindex_exact_size
|
||||
syn keyword ngxDirective autoindex_localtime
|
||||
syn keyword ngxDirective charset
|
||||
syn keyword ngxDirective charset_types
|
||||
syn keyword ngxDirective chunked_transfer_encoding
|
||||
syn keyword ngxDirective client_body_buffer_size
|
||||
syn keyword ngxDirective client_body_in_file_only
|
||||
syn keyword ngxDirective client_body_in_single_buffer
|
||||
@@ -105,32 +113,44 @@ syn keyword ngxDirective devpoll_changes
|
||||
syn keyword ngxDirective devpoll_events
|
||||
syn keyword ngxDirective directio
|
||||
syn keyword ngxDirective directio_alignment
|
||||
syn keyword ngxDirective disable_symlinks
|
||||
syn keyword ngxDirective empty_gif
|
||||
syn keyword ngxDirective env
|
||||
syn keyword ngxDirective epoll_events
|
||||
syn keyword ngxDirective error_log
|
||||
syn keyword ngxDirective etag
|
||||
syn keyword ngxDirective eventport_events
|
||||
syn keyword ngxDirective expires
|
||||
syn keyword ngxDirective fastcgi_bind
|
||||
syn keyword ngxDirective fastcgi_buffer_size
|
||||
syn keyword ngxDirective fastcgi_buffering
|
||||
syn keyword ngxDirective fastcgi_buffers
|
||||
syn keyword ngxDirective fastcgi_busy_buffers_size
|
||||
syn keyword ngxDirective fastcgi_cache
|
||||
syn keyword ngxDirective fastcgi_cache_bypass
|
||||
syn keyword ngxDirective fastcgi_cache_key
|
||||
syn keyword ngxDirective fastcgi_cache_lock
|
||||
syn keyword ngxDirective fastcgi_cache_lock_timeout
|
||||
syn keyword ngxDirective fastcgi_cache_methods
|
||||
syn keyword ngxDirective fastcgi_cache_min_uses
|
||||
syn keyword ngxDirective fastcgi_cache_path
|
||||
syn keyword ngxDirective fastcgi_cache_revalidate
|
||||
syn keyword ngxDirective fastcgi_cache_use_stale
|
||||
syn keyword ngxDirective fastcgi_cache_valid
|
||||
syn keyword ngxDirective fastcgi_catch_stderr
|
||||
syn keyword ngxDirective fastcgi_connect_timeout
|
||||
syn keyword ngxDirective fastcgi_force_ranges
|
||||
syn keyword ngxDirective fastcgi_hide_header
|
||||
syn keyword ngxDirective fastcgi_ignore_client_abort
|
||||
syn keyword ngxDirective fastcgi_ignore_headers
|
||||
syn keyword ngxDirective fastcgi_index
|
||||
syn keyword ngxDirective fastcgi_intercept_errors
|
||||
syn keyword ngxDirective fastcgi_keep_conn
|
||||
syn keyword ngxDirective fastcgi_max_temp_file_size
|
||||
syn keyword ngxDirective fastcgi_next_upstream
|
||||
syn keyword ngxDirective fastcgi_next_upstream_timeout
|
||||
syn keyword ngxDirective fastcgi_next_upstream_tries
|
||||
syn keyword ngxDirective fastcgi_no_cache
|
||||
syn keyword ngxDirective fastcgi_param
|
||||
syn keyword ngxDirective fastcgi_pass_header
|
||||
syn keyword ngxDirective fastcgi_pass_request_body
|
||||
@@ -143,12 +163,15 @@ syn keyword ngxDirective fastcgi_store
|
||||
syn keyword ngxDirective fastcgi_store_access
|
||||
syn keyword ngxDirective fastcgi_temp_file_write_size
|
||||
syn keyword ngxDirective fastcgi_temp_path
|
||||
syn keyword ngxDirective fastcgi_upstream_fail_timeout
|
||||
syn keyword ngxDirective fastcgi_upstream_max_fails
|
||||
syn keyword ngxDirective flv
|
||||
syn keyword ngxDirective geoip_city
|
||||
syn keyword ngxDirective geoip_country
|
||||
syn keyword ngxDirective geoip_org
|
||||
syn keyword ngxDirective geoip_proxy
|
||||
syn keyword ngxDirective geoip_proxy_recursive
|
||||
syn keyword ngxDirective google_perftools_profiles
|
||||
syn keyword ngxDirective gunzip
|
||||
syn keyword ngxDirective gunzip_buffers
|
||||
syn keyword ngxDirective gzip
|
||||
syn keyword ngxDirective gzip_buffers
|
||||
syn keyword ngxDirective gzip_comp_level
|
||||
@@ -162,30 +185,40 @@ syn keyword ngxDirective gzip_static
|
||||
syn keyword ngxDirective gzip_types
|
||||
syn keyword ngxDirective gzip_vary
|
||||
syn keyword ngxDirective gzip_window
|
||||
syn keyword ngxDirective hash
|
||||
syn keyword ngxDirective if_modified_since
|
||||
syn keyword ngxDirective ignore_invalid_headers
|
||||
syn keyword ngxDirective image_filter
|
||||
syn keyword ngxDirective image_filter_buffer
|
||||
syn keyword ngxDirective image_filter_interlace
|
||||
syn keyword ngxDirective image_filter_jpeg_quality
|
||||
syn keyword ngxDirective image_filter_sharpen
|
||||
syn keyword ngxDirective image_filter_transparency
|
||||
syn keyword ngxDirective imap_auth
|
||||
syn keyword ngxDirective imap_capabilities
|
||||
syn keyword ngxDirective imap_client_buffer
|
||||
syn keyword ngxDirective index
|
||||
syn keyword ngxDirective iocp_threads
|
||||
syn keyword ngxDirective ip_hash
|
||||
syn keyword ngxDirective keepalive
|
||||
syn keyword ngxDirective keepalive_disable
|
||||
syn keyword ngxDirective keepalive_requests
|
||||
syn keyword ngxDirective keepalive_timeout
|
||||
syn keyword ngxDirective kqueue_changes
|
||||
syn keyword ngxDirective kqueue_events
|
||||
syn keyword ngxDirective large_client_header_buffers
|
||||
syn keyword ngxDirective least_conn
|
||||
syn keyword ngxDirective limit_conn
|
||||
syn keyword ngxDirective limit_conn_log_level
|
||||
syn keyword ngxDirective limit_conn_status
|
||||
syn keyword ngxDirective limit_conn_zone
|
||||
syn keyword ngxDirective limit_rate
|
||||
syn keyword ngxDirective limit_rate_after
|
||||
syn keyword ngxDirective limit_req
|
||||
syn keyword ngxDirective limit_req_log_level
|
||||
syn keyword ngxDirective limit_req_status
|
||||
syn keyword ngxDirective limit_req_zone
|
||||
syn keyword ngxDirective limit_zone
|
||||
syn keyword ngxDirective lingering_close
|
||||
syn keyword ngxDirective lingering_time
|
||||
syn keyword ngxDirective lingering_timeout
|
||||
syn keyword ngxDirective lock_file
|
||||
@@ -195,21 +228,27 @@ syn keyword ngxDirective log_subrequest
|
||||
syn keyword ngxDirective map_hash_bucket_size
|
||||
syn keyword ngxDirective map_hash_max_size
|
||||
syn keyword ngxDirective master_process
|
||||
syn keyword ngxDirective max_ranges
|
||||
syn keyword ngxDirective memcached_bind
|
||||
syn keyword ngxDirective memcached_buffer_size
|
||||
syn keyword ngxDirective memcached_connect_timeout
|
||||
syn keyword ngxDirective memcached_gzip_flag
|
||||
syn keyword ngxDirective memcached_next_upstream
|
||||
syn keyword ngxDirective memcached_next_upstream_timeout
|
||||
syn keyword ngxDirective memcached_next_upstream_tries
|
||||
syn keyword ngxDirective memcached_read_timeout
|
||||
syn keyword ngxDirective memcached_send_timeout
|
||||
syn keyword ngxDirective memcached_upstream_fail_timeout
|
||||
syn keyword ngxDirective memcached_upstream_max_fails
|
||||
syn keyword ngxDirective merge_slashes
|
||||
syn keyword ngxDirective min_delete_depth
|
||||
syn keyword ngxDirective modern_browser
|
||||
syn keyword ngxDirective modern_browser_value
|
||||
syn keyword ngxDirective mp4
|
||||
syn keyword ngxDirective mp4_buffer_size
|
||||
syn keyword ngxDirective mp4_max_buffer_size
|
||||
syn keyword ngxDirective msie_padding
|
||||
syn keyword ngxDirective msie_refresh
|
||||
syn keyword ngxDirective multi_accept
|
||||
syn keyword ngxDirective mysql_test
|
||||
syn keyword ngxDirective open_file_cache
|
||||
syn keyword ngxDirective open_file_cache_errors
|
||||
syn keyword ngxDirective open_file_cache_events
|
||||
@@ -218,6 +257,7 @@ syn keyword ngxDirective open_file_cache_valid
|
||||
syn keyword ngxDirective open_log_file_cache
|
||||
syn keyword ngxDirective output_buffers
|
||||
syn keyword ngxDirective override_charset
|
||||
syn keyword ngxDirective pcre_jit
|
||||
syn keyword ngxDirective perl
|
||||
syn keyword ngxDirective perl_modules
|
||||
syn keyword ngxDirective perl_require
|
||||
@@ -226,6 +266,7 @@ syn keyword ngxDirective pid
|
||||
syn keyword ngxDirective pop3_auth
|
||||
syn keyword ngxDirective pop3_capabilities
|
||||
syn keyword ngxDirective port_in_redirect
|
||||
syn keyword ngxDirective post_acceptex
|
||||
syn keyword ngxDirective postpone_gzipping
|
||||
syn keyword ngxDirective postpone_output
|
||||
syn keyword ngxDirective protocol
|
||||
@@ -237,22 +278,33 @@ syn keyword ngxDirective proxy_buffering
|
||||
syn keyword ngxDirective proxy_buffers
|
||||
syn keyword ngxDirective proxy_busy_buffers_size
|
||||
syn keyword ngxDirective proxy_cache
|
||||
syn keyword ngxDirective proxy_cache_bypass
|
||||
syn keyword ngxDirective proxy_cache_key
|
||||
syn keyword ngxDirective proxy_cache_lock
|
||||
syn keyword ngxDirective proxy_cache_lock_timeout
|
||||
syn keyword ngxDirective proxy_cache_methods
|
||||
syn keyword ngxDirective proxy_cache_min_uses
|
||||
syn keyword ngxDirective proxy_cache_path
|
||||
syn keyword ngxDirective proxy_cache_revalidate
|
||||
syn keyword ngxDirective proxy_cache_use_stale
|
||||
syn keyword ngxDirective proxy_cache_valid
|
||||
syn keyword ngxDirective proxy_connect_timeout
|
||||
syn keyword ngxDirective proxy_cookie_domain
|
||||
syn keyword ngxDirective proxy_cookie_path
|
||||
syn keyword ngxDirective proxy_force_ranges
|
||||
syn keyword ngxDirective proxy_headers_hash_bucket_size
|
||||
syn keyword ngxDirective proxy_headers_hash_max_size
|
||||
syn keyword ngxDirective proxy_hide_header
|
||||
syn keyword ngxDirective proxy_http_version
|
||||
syn keyword ngxDirective proxy_ignore_client_abort
|
||||
syn keyword ngxDirective proxy_ignore_headers
|
||||
syn keyword ngxDirective proxy_intercept_errors
|
||||
syn keyword ngxDirective proxy_max_temp_file_size
|
||||
syn keyword ngxDirective proxy_method
|
||||
syn keyword ngxDirective proxy_next_upstream
|
||||
syn keyword ngxDirective proxy_next_upstream_timeout
|
||||
syn keyword ngxDirective proxy_next_upstream_tries
|
||||
syn keyword ngxDirective proxy_no_cache
|
||||
syn keyword ngxDirective proxy_pass_error_message
|
||||
syn keyword ngxDirective proxy_pass_header
|
||||
syn keyword ngxDirective proxy_pass_request_body
|
||||
@@ -263,18 +315,27 @@ syn keyword ngxDirective proxy_send_lowat
|
||||
syn keyword ngxDirective proxy_send_timeout
|
||||
syn keyword ngxDirective proxy_set_body
|
||||
syn keyword ngxDirective proxy_set_header
|
||||
syn keyword ngxDirective proxy_ssl_ciphers
|
||||
syn keyword ngxDirective proxy_ssl_crl
|
||||
syn keyword ngxDirective proxy_ssl_name
|
||||
syn keyword ngxDirective proxy_ssl_protocols
|
||||
syn keyword ngxDirective proxy_ssl_server_name
|
||||
syn keyword ngxDirective proxy_ssl_session_reuse
|
||||
syn keyword ngxDirective proxy_ssl_trusted_certificate
|
||||
syn keyword ngxDirective proxy_ssl_verify
|
||||
syn keyword ngxDirective proxy_ssl_verify_depth
|
||||
syn keyword ngxDirective proxy_store
|
||||
syn keyword ngxDirective proxy_store_access
|
||||
syn keyword ngxDirective proxy_temp_file_write_size
|
||||
syn keyword ngxDirective proxy_temp_path
|
||||
syn keyword ngxDirective proxy_timeout
|
||||
syn keyword ngxDirective proxy_upstream_fail_timeout
|
||||
syn keyword ngxDirective proxy_upstream_max_fails
|
||||
syn keyword ngxDirective random_index
|
||||
syn keyword ngxDirective read_ahead
|
||||
syn keyword ngxDirective real_ip_header
|
||||
syn keyword ngxDirective real_ip_recursive
|
||||
syn keyword ngxDirective recursive_error_pages
|
||||
syn keyword ngxDirective referer_hash_bucket_size
|
||||
syn keyword ngxDirective referer_hash_max_size
|
||||
syn keyword ngxDirective request_pool_size
|
||||
syn keyword ngxDirective reset_timedout_connection
|
||||
syn keyword ngxDirective resolver
|
||||
@@ -285,6 +346,45 @@ syn keyword ngxDirective rtsig_overflow_test
|
||||
syn keyword ngxDirective rtsig_overflow_threshold
|
||||
syn keyword ngxDirective rtsig_signo
|
||||
syn keyword ngxDirective satisfy
|
||||
syn keyword ngxDirective scgi_bind
|
||||
syn keyword ngxDirective scgi_buffer_size
|
||||
syn keyword ngxDirective scgi_buffering
|
||||
syn keyword ngxDirective scgi_buffers
|
||||
syn keyword ngxDirective scgi_busy_buffers_size
|
||||
syn keyword ngxDirective scgi_cache
|
||||
syn keyword ngxDirective scgi_cache_bypass
|
||||
syn keyword ngxDirective scgi_cache_key
|
||||
syn keyword ngxDirective scgi_cache_lock
|
||||
syn keyword ngxDirective scgi_cache_lock_timeout
|
||||
syn keyword ngxDirective scgi_cache_methods
|
||||
syn keyword ngxDirective scgi_cache_min_uses
|
||||
syn keyword ngxDirective scgi_cache_path
|
||||
syn keyword ngxDirective scgi_cache_revalidate
|
||||
syn keyword ngxDirective scgi_cache_use_stale
|
||||
syn keyword ngxDirective scgi_cache_valid
|
||||
syn keyword ngxDirective scgi_connect_timeout
|
||||
syn keyword ngxDirective scgi_force_ranges
|
||||
syn keyword ngxDirective scgi_hide_header
|
||||
syn keyword ngxDirective scgi_ignore_client_abort
|
||||
syn keyword ngxDirective scgi_ignore_headers
|
||||
syn keyword ngxDirective scgi_intercept_errors
|
||||
syn keyword ngxDirective scgi_max_temp_file_size
|
||||
syn keyword ngxDirective scgi_next_upstream
|
||||
syn keyword ngxDirective scgi_next_upstream_timeout
|
||||
syn keyword ngxDirective scgi_next_upstream_tries
|
||||
syn keyword ngxDirective scgi_no_cache
|
||||
syn keyword ngxDirective scgi_param
|
||||
syn keyword ngxDirective scgi_pass_header
|
||||
syn keyword ngxDirective scgi_pass_request_body
|
||||
syn keyword ngxDirective scgi_pass_request_headers
|
||||
syn keyword ngxDirective scgi_read_timeout
|
||||
syn keyword ngxDirective scgi_send_timeout
|
||||
syn keyword ngxDirective scgi_store
|
||||
syn keyword ngxDirective scgi_store_access
|
||||
syn keyword ngxDirective scgi_temp_file_write_size
|
||||
syn keyword ngxDirective scgi_temp_path
|
||||
syn keyword ngxDirective secure_link
|
||||
syn keyword ngxDirective secure_link_md5
|
||||
syn keyword ngxDirective secure_link_secret
|
||||
syn keyword ngxDirective send_lowat
|
||||
syn keyword ngxDirective send_timeout
|
||||
@@ -299,31 +399,50 @@ syn keyword ngxDirective smtp_auth
|
||||
syn keyword ngxDirective smtp_capabilities
|
||||
syn keyword ngxDirective smtp_client_buffer
|
||||
syn keyword ngxDirective smtp_greeting_delay
|
||||
syn keyword ngxDirective so_keepalive
|
||||
syn keyword ngxDirective source_charset
|
||||
syn keyword ngxDirective spdy_chunk_size
|
||||
syn keyword ngxDirective spdy_headers_comp
|
||||
syn keyword ngxDirective spdy_keepalive_timeout
|
||||
syn keyword ngxDirective spdy_max_concurrent_streams
|
||||
syn keyword ngxDirective spdy_pool_size
|
||||
syn keyword ngxDirective spdy_recv_buffer_size
|
||||
syn keyword ngxDirective spdy_recv_timeout
|
||||
syn keyword ngxDirective spdy_streams_index_size
|
||||
syn keyword ngxDirective ssi
|
||||
syn keyword ngxDirective ssi_ignore_recycled_buffers
|
||||
syn keyword ngxDirective ssi_last_modified
|
||||
syn keyword ngxDirective ssi_min_file_chunk
|
||||
syn keyword ngxDirective ssi_silent_errors
|
||||
syn keyword ngxDirective ssi_types
|
||||
syn keyword ngxDirective ssi_value_length
|
||||
syn keyword ngxDirective ssl
|
||||
syn keyword ngxDirective ssl_buffer_size
|
||||
syn keyword ngxDirective ssl_certificate
|
||||
syn keyword ngxDirective ssl_certificate_key
|
||||
syn keyword ngxDirective ssl_ciphers
|
||||
syn keyword ngxDirective ssl_client_certificate
|
||||
syn keyword ngxDirective ssl_crl
|
||||
syn keyword ngxDirective ssl_dhparam
|
||||
syn keyword ngxDirective ssl_ecdh_curve
|
||||
syn keyword ngxDirective ssl_engine
|
||||
syn keyword ngxDirective ssl_password_file
|
||||
syn keyword ngxDirective ssl_prefer_server_ciphers
|
||||
syn keyword ngxDirective ssl_protocols
|
||||
syn keyword ngxDirective ssl_session_cache
|
||||
syn keyword ngxDirective ssl_session_ticket_key
|
||||
syn keyword ngxDirective ssl_session_tickets
|
||||
syn keyword ngxDirective ssl_session_timeout
|
||||
syn keyword ngxDirective ssl_stapling
|
||||
syn keyword ngxDirective ssl_stapling_file
|
||||
syn keyword ngxDirective ssl_stapling_responder
|
||||
syn keyword ngxDirective ssl_stapling_verify
|
||||
syn keyword ngxDirective ssl_trusted_certificate
|
||||
syn keyword ngxDirective ssl_verify_client
|
||||
syn keyword ngxDirective ssl_verify_depth
|
||||
syn keyword ngxDirective starttls
|
||||
syn keyword ngxDirective stub_status
|
||||
syn keyword ngxDirective sub_filter
|
||||
syn keyword ngxDirective sub_filter_last_modified
|
||||
syn keyword ngxDirective sub_filter_once
|
||||
syn keyword ngxDirective sub_filter_types
|
||||
syn keyword ngxDirective tcp_nodelay
|
||||
@@ -345,9 +464,59 @@ syn keyword ngxDirective userid_name
|
||||
syn keyword ngxDirective userid_p3p
|
||||
syn keyword ngxDirective userid_path
|
||||
syn keyword ngxDirective userid_service
|
||||
syn keyword ngxDirective uwsgi_bind
|
||||
syn keyword ngxDirective uwsgi_buffer_size
|
||||
syn keyword ngxDirective uwsgi_buffering
|
||||
syn keyword ngxDirective uwsgi_buffers
|
||||
syn keyword ngxDirective uwsgi_busy_buffers_size
|
||||
syn keyword ngxDirective uwsgi_cache
|
||||
syn keyword ngxDirective uwsgi_cache_bypass
|
||||
syn keyword ngxDirective uwsgi_cache_key
|
||||
syn keyword ngxDirective uwsgi_cache_lock
|
||||
syn keyword ngxDirective uwsgi_cache_lock_timeout
|
||||
syn keyword ngxDirective uwsgi_cache_methods
|
||||
syn keyword ngxDirective uwsgi_cache_min_uses
|
||||
syn keyword ngxDirective uwsgi_cache_path
|
||||
syn keyword ngxDirective uwsgi_cache_revalidate
|
||||
syn keyword ngxDirective uwsgi_cache_use_stale
|
||||
syn keyword ngxDirective uwsgi_cache_valid
|
||||
syn keyword ngxDirective uwsgi_connect_timeout
|
||||
syn keyword ngxDirective uwsgi_force_ranges
|
||||
syn keyword ngxDirective uwsgi_hide_header
|
||||
syn keyword ngxDirective uwsgi_ignore_client_abort
|
||||
syn keyword ngxDirective uwsgi_ignore_headers
|
||||
syn keyword ngxDirective uwsgi_intercept_errors
|
||||
syn keyword ngxDirective uwsgi_max_temp_file_size
|
||||
syn keyword ngxDirective uwsgi_modifier1
|
||||
syn keyword ngxDirective uwsgi_modifier2
|
||||
syn keyword ngxDirective uwsgi_next_upstream
|
||||
syn keyword ngxDirective uwsgi_next_upstream_timeout
|
||||
syn keyword ngxDirective uwsgi_next_upstream_tries
|
||||
syn keyword ngxDirective uwsgi_no_cache
|
||||
syn keyword ngxDirective uwsgi_param
|
||||
syn keyword ngxDirective uwsgi_pass_header
|
||||
syn keyword ngxDirective uwsgi_pass_request_body
|
||||
syn keyword ngxDirective uwsgi_pass_request_headers
|
||||
syn keyword ngxDirective uwsgi_read_timeout
|
||||
syn keyword ngxDirective uwsgi_send_timeout
|
||||
syn keyword ngxDirective uwsgi_ssl_ciphers
|
||||
syn keyword ngxDirective uwsgi_ssl_crl
|
||||
syn keyword ngxDirective uwsgi_ssl_name
|
||||
syn keyword ngxDirective uwsgi_ssl_protocols
|
||||
syn keyword ngxDirective uwsgi_ssl_server_name
|
||||
syn keyword ngxDirective uwsgi_ssl_session_reuse
|
||||
syn keyword ngxDirective uwsgi_ssl_trusted_certificate
|
||||
syn keyword ngxDirective uwsgi_ssl_verify
|
||||
syn keyword ngxDirective uwsgi_ssl_verify_depth
|
||||
syn keyword ngxDirective uwsgi_store
|
||||
syn keyword ngxDirective uwsgi_store_access
|
||||
syn keyword ngxDirective uwsgi_string
|
||||
syn keyword ngxDirective uwsgi_temp_file_write_size
|
||||
syn keyword ngxDirective uwsgi_temp_path
|
||||
syn keyword ngxDirective valid_referers
|
||||
syn keyword ngxDirective variables_hash_bucket_size
|
||||
syn keyword ngxDirective variables_hash_max_size
|
||||
syn keyword ngxDirective worker_aio_requests
|
||||
syn keyword ngxDirective worker_connections
|
||||
syn keyword ngxDirective worker_cpu_affinity
|
||||
syn keyword ngxDirective worker_priority
|
||||
@@ -359,6 +528,9 @@ syn keyword ngxDirective worker_threads
|
||||
syn keyword ngxDirective working_directory
|
||||
syn keyword ngxDirective xclient
|
||||
syn keyword ngxDirective xml_entities
|
||||
syn keyword ngxDirective xslt_last_modified
|
||||
syn keyword ngxDirective xslt_param
|
||||
syn keyword ngxDirective xslt_string_param
|
||||
syn keyword ngxDirective xslt_stylesheet
|
||||
syn keyword ngxDirective xslt_types
|
||||
|
||||
@@ -370,7 +542,7 @@ syn keyword ngxDirective xslt_types
|
||||
syn keyword ngxDirectiveThirdParty set_from_accept_language
|
||||
|
||||
" Access Key Module <http://wiki.nginx.org/NginxHttpAccessKeyModule>
|
||||
" Denies access unless the request URL contains an access key.
|
||||
" Denies access unless the request URL contains an access key.
|
||||
syn keyword ngxDirectiveThirdParty accesskey
|
||||
syn keyword ngxDirectiveThirdParty accesskey_arg
|
||||
syn keyword ngxDirectiveThirdParty accesskey_hashmethod
|
||||
@@ -524,7 +696,7 @@ syn keyword ngxDirectiveThirdParty mogilefs_send_timeout
|
||||
syn keyword ngxDirectiveThirdParty mogilefs_tracker
|
||||
|
||||
" MP4 Streaming Lite Module <http://wiki.nginx.org/NginxMP4StreamingLite>
|
||||
" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL.
|
||||
" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL.
|
||||
syn keyword ngxDirectiveThirdParty mp4
|
||||
|
||||
" Nginx Notice Module <http://xph.us/software/nginx-notice/>
|
||||
|
||||
131
syntax/nix.vim
Normal file
131
syntax/nix.vim
Normal file
@@ -0,0 +1,131 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nix') == -1
|
||||
|
||||
"
|
||||
" Syntax file for Nix
|
||||
"
|
||||
" TODO:
|
||||
" Emphasize :
|
||||
" Deemphasize ;
|
||||
" Consistent ()
|
||||
" rec (red?)
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Operators
|
||||
syn match nixOperator "\V++"
|
||||
syn match nixOperator "\V+"
|
||||
syn match nixOperator "\V!"
|
||||
syn match nixOperator "\V=="
|
||||
syn match nixOperator "\V!="
|
||||
syn match nixOperator "\V&&"
|
||||
syn match nixOperator "\V||"
|
||||
syn match nixOperator "\V->"
|
||||
|
||||
syn match nixOperator "\V-"
|
||||
syn match nixOperator "\V*"
|
||||
syn match nixOperator "\V/"
|
||||
syn match nixOperator "\V>"
|
||||
syn match nixOperator "\V<"
|
||||
|
||||
" Keywords
|
||||
syn keyword nixKeyword let in or assert inherit null with rec
|
||||
syn keyword nixConditional if else then
|
||||
syn keyword nixBoolean true false
|
||||
|
||||
" Builtins
|
||||
syn keyword nixBuiltin builtins abort add attrNames attrValues
|
||||
\ baseNameOf compareVersions concatLists currentSystem deepSeq
|
||||
\ derivation dirOf div elem elemAt filter filterSource fromJSON
|
||||
\ getAttr getEnv hasAttr hashString head import intersectAttrs
|
||||
\ isAttrs isList isFunction isString isInt isBool isNull length
|
||||
\ lessThan listToAttrs map mul parseDrvNames pathExists readDir
|
||||
\ readFile removeAttrs seq stringLength sub substring tail throw
|
||||
\ toFile toJSON toPath toString toXML trace typeOf tryEval
|
||||
|
||||
syn match nixpkgs "<nixpkgs>"
|
||||
syn match nixSpecialOper "\V@\|;\|,\|?\|..."
|
||||
|
||||
" Attribute Lists
|
||||
"syn match nixBrace "\v[(){}\[\]]|rec\s*\{"
|
||||
syn region nixSet matchgroup=nixBraces start="{" end="}" contains=ALL
|
||||
syn region nixRecSet matchgroup=nixBraces start="rec\s*{" end="}" contains=ALL
|
||||
syn region nixList matchgroup=nixBraces start="\[" end="\]" contains=ALLBUT,nixAttr
|
||||
syn match nixAttr "\v[0-9A-Za-z\-\_]+\ze\s*\=" contained
|
||||
|
||||
syn match nixInteger "\v<\d+>"
|
||||
|
||||
" Functions
|
||||
syn match nixFuncArg "\v\zs\w+\ze\s*:"
|
||||
|
||||
" TODO: Exclude ; and other illegal characters
|
||||
syn match nixPath "\v\S*/\S+|\S+/\S*"
|
||||
|
||||
" This operator is placed after nixPath to override nixPath's highlighting
|
||||
syn match nixOperator "\V//"
|
||||
|
||||
" Strings
|
||||
syn match nixStringIndentedEscapes +'''\|''\${\|''\\n\|''\\r\|''\\t+
|
||||
syn match nixStringEscapes +\\"\|\\\${\|\\n\|\\r\|\\t\|\\\\+
|
||||
syn region nixStringIndented
|
||||
\ start=+''+
|
||||
\ skip=+'''+
|
||||
\ end=+''+
|
||||
\ contains=nixAntiquotation,nixStringIndentedEscapes
|
||||
syn region nixString
|
||||
\ start=+"+
|
||||
\ skip=+\\"+
|
||||
\ end=+"+
|
||||
\ contains=nixAntiquotation,nixStringEscapes
|
||||
|
||||
" If this contains nixBrace, it ignores its own closing brace and syntax gets
|
||||
" thrown way off contains=ALLBUT,nixBrace
|
||||
syn region nixAntiquotation start=+\${+ end=+}+ contains=nixAntiQuotation
|
||||
|
||||
" Comments
|
||||
syn region nixMultiLineComment start=+/\*+ skip=+\\"+ end=+\*/+ contains=nixTodos
|
||||
syn match nixEndOfLineComment "#.*$" contains=nixTodos
|
||||
syntax keyword nixTodos TODO XXX FIXME NOTE TODOS contained
|
||||
|
||||
" Special (Delimiter
|
||||
hi def link nixBraces Delimiter
|
||||
hi def link nixpkgs Special
|
||||
hi def link nixSpecialOper Special
|
||||
hi def link nixStringIndentedEscapes SpecialChar
|
||||
hi def link nixStringEscapes SpecialChar
|
||||
hi def link nixBuiltin Special
|
||||
hi def link nixOperator Operator
|
||||
|
||||
" Constants
|
||||
hi def link nixBoolean Boolean
|
||||
hi def link nixInteger Number
|
||||
hi def link nixString String
|
||||
hi def link nixStringIndented String
|
||||
|
||||
" Comments
|
||||
hi def link nixMultiLineComment Comment
|
||||
hi def link nixEndOfLineComment Comment
|
||||
|
||||
" Identifiers
|
||||
hi def link nixConditional Conditional
|
||||
hi def link nixKeyword Keyword
|
||||
hi def link nixOperator Operator
|
||||
hi def link nixException Exception
|
||||
hi def link nixAttr Identifier
|
||||
hi def link nixFuncArg Identifier
|
||||
|
||||
" PreProc
|
||||
hi def link nixAntiquotation Macro
|
||||
|
||||
" Underlined (html links)
|
||||
hi def link nixPath Underlined
|
||||
|
||||
" Error
|
||||
|
||||
syn sync maxlines=20000
|
||||
syn sync minlines=50000
|
||||
|
||||
let b:current_syntax = 'nix'
|
||||
|
||||
endif
|
||||
@@ -244,18 +244,18 @@ syn region perlAnglesDQ start=+<+ end=+>+ extend contained contains=perlAnglesD
|
||||
|
||||
|
||||
" Simple version of searches and matches
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgc]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[msixpodualgc]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[msixpodualgc]*+ contains=@perlInterpSQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[msixpodualgc]*+ contains=@perlInterpSlash keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[msixpodualgc]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[msixpodualgc]*+ contains=@perlInterpMatch,perlBracesDQ extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[msixpodualgc]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][msixpodualgc]*+ contains=@perlInterpMatch,perlBracketsDQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[msixpodualgcn]*+ contains=@perlInterpSQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[msixpodualgcn]*+ contains=@perlInterpSlash keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[msixpodualgcn]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[msixpodualgcn]*+ contains=@perlInterpMatch,perlBracesDQ extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[msixpodualgcn]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][msixpodualgcn]*+ contains=@perlInterpMatch,perlBracketsDQ keepend extend
|
||||
|
||||
" Below some hacks to recognise the // variant. This is virtually impossible to catch in all
|
||||
" cases as the / is used in so many other ways, but these should be the most obvious ones.
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/\%(/=\)\@!" start=+^/\%(/=\)\@!+ start=+\s\@<=/\%(/=\)\@![^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[msixpodualgc]*+ contains=@perlInterpSlash extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/\%(/=\)\@!" start=+^/\%(/=\)\@!+ start=+\s\@<=/\%(/=\)\@![^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[msixpodualgcn]*+ contains=@perlInterpSlash extend
|
||||
|
||||
|
||||
" Substitutions
|
||||
@@ -268,12 +268,12 @@ syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*<+ end=+>+ contains=@perlInterpMatch,perlAnglesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*\[+ end=+\]+ contains=@perlInterpMatch,perlBracketsDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
|
||||
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*{+ end=+}+ contains=@perlInterpMatch,perlBracesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[msixpodualgcer]*+ keepend contained contains=@perlInterpDQ extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlParensDQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][msixpodualgcer]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend
|
||||
syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcer]*+ contained contains=@perlInterpSQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[msixpodualgcern]*+ keepend contained contains=@perlInterpDQ extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlParensDQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend
|
||||
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend
|
||||
syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcern]*+ contained contains=@perlInterpSQ keepend extend
|
||||
|
||||
" Translations
|
||||
" perlMatch is the first part, perlTranslation* is the second, translator part.
|
||||
@@ -424,7 +424,7 @@ if exists("perl_fold")
|
||||
endif
|
||||
|
||||
if exists("perl_fold_blocks")
|
||||
syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)foreach\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
|
||||
syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)for\%(each\)\=\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
|
||||
syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
|
||||
endif
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ let s:keywords = {
|
||||
\ ],
|
||||
\ "p6Operator": [
|
||||
\ "div xx x mod also leg cmp before after eq ne le lt not",
|
||||
\ "gt ge eqv ff fff and andthen or xor orelse extra lcm gcd",
|
||||
\ "gt ge eqv ff fff and andthen or xor orelse extra lcm gcd o",
|
||||
\ ],
|
||||
\ "p6Type": [
|
||||
\ "int int1 int2 int4 int8 int16 int32 int64",
|
||||
@@ -176,7 +176,7 @@ syn match p6Type display "\%(::\)\@2<!\%(Order\%(::Same\|::More\|::Less\)\?\|Boo
|
||||
" Don't put a "\+" at the end of the character class. That makes it so
|
||||
" greedy that the "%" " in "+%foo" won't be allowed to match as a sigil,
|
||||
" among other things
|
||||
syn match p6Operator display "[-+/*~?|=^!%&,<>».;\\∈∉∋∌∩∪≼≽⊂⊃⊄⊅⊆⊇⊈⊉⊍⊎⊖∅]"
|
||||
syn match p6Operator display "[-+/*~?|=^!%&,<>».;\\∈∉∋∌∩∪≼≽⊂⊃⊄⊅⊆⊇⊈⊉⊍⊎⊖∅∘]"
|
||||
syn match p6Operator display "\%(:\@1<!::\@2!\|::=\|\.::\)"
|
||||
" these require whitespace on the left side
|
||||
syn match p6Operator display "\%(\s\|^\)\@1<=\%(xx=\|p5=>\)"
|
||||
@@ -249,9 +249,10 @@ syn cluster p6Interp_qq
|
||||
\ add=@p6Interp_function
|
||||
\ add=@p6Interp_closure
|
||||
\ add=@p6Interp_backslash
|
||||
\ add=p6MatchVarSigil
|
||||
|
||||
syn region p6InterpScalar
|
||||
\ start="\ze\z(\$\%(\%(\%(\d\+\|!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\%(\.\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
||||
\ start="\ze\z(\$\%(\%(\%(\d\+\|!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\%(\.\^\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
||||
\ start="\ze\z(\$\%(\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\|\%(\d\+\|!\|/\|¢\)\)\)"
|
||||
\ end="\z1\zs"
|
||||
\ contained keepend
|
||||
@@ -266,7 +267,7 @@ syn region p6InterpScalar
|
||||
\ contains=TOP
|
||||
|
||||
syn region p6InterpArray
|
||||
\ start="\ze\z(@\$*\%(\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\%(\.\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
||||
\ start="\ze\z(@\$*\%(\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\%(\.\^\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
||||
\ end="\z1\zs"
|
||||
\ contained keepend
|
||||
\ contains=TOP
|
||||
@@ -280,7 +281,7 @@ syn region p6InterpArray
|
||||
\ contains=TOP
|
||||
|
||||
syn region p6InterpHash
|
||||
\ start="\ze\z(%\$*\%(\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\%(\.\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
||||
\ start="\ze\z(%\$*\%(\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\)\%(\.\^\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
||||
\ end="\z1\zs"
|
||||
\ contained keepend
|
||||
\ contains=TOP
|
||||
@@ -294,7 +295,7 @@ syn region p6InterpHash
|
||||
\ contains=TOP
|
||||
|
||||
syn region p6InterpFunction
|
||||
\ start="\ze\z(&\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(\.\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
||||
\ start="\ze\z(&\%(\%(!\|/\|¢\)\|\%(\%(\%([.^*?=!~]\|:\@1<!::\@!\)[A-Za-z_\xC0-\xFF]\@=\)\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\%(\.\^\?\%([A-Za-z_\xC0-\xFF]\%([A-Za-z_\xC0-\xFF0-9]\|[-'][A-Za-z_\xC0-\xFF]\@=\)*\)\|\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)*\)\.\?\%(([^)]*)\|\[[^\]]*]\|<[^>]*>\|«[^»]*»\|{[^}]*}\)\)\)"
|
||||
\ end="\z1\zs"
|
||||
\ contained keepend
|
||||
\ contains=TOP
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -88,6 +88,7 @@ syn keyword pythonStatement exec return
|
||||
syn keyword pythonStatement pass raise
|
||||
syn keyword pythonStatement global assert
|
||||
syn keyword pythonStatement lambda yield
|
||||
syn keyword pythonStatement async await
|
||||
syn keyword pythonStatement with nonlocal True False None
|
||||
syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
|
||||
syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" display contained
|
||||
@@ -210,7 +211,7 @@ if exists("python_highlight_builtins") && python_highlight_builtins != 0
|
||||
syn keyword pythonBuiltinObj Ellipsis NotImplemented
|
||||
|
||||
syn keyword pythonBuiltinFunc __import__ abs all any apply
|
||||
syn keyword pythonBuiltinFunc basestring bool buffer callable
|
||||
syn keyword pythonBuiltinFunc basestring bool buffer bytearray bytes callable
|
||||
syn keyword pythonBuiltinFunc chr classmethod cmp coerce compile complex
|
||||
syn keyword pythonBuiltinFunc delattr dict dir divmod enumerate eval
|
||||
syn keyword pythonBuiltinFunc execfile file filter float frozenset getattr
|
||||
|
||||
137
syntax/qml.vim
Normal file
137
syntax/qml.vim
Normal file
@@ -0,0 +1,137 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: QML
|
||||
" Maintainer: Warwick Allison <warwick.allison@nokia.com>
|
||||
" Updaters:
|
||||
" URL:
|
||||
" Changes:
|
||||
" Last Change: 2009 Apr 30
|
||||
|
||||
" Based on javascript syntax (as is QML)
|
||||
|
||||
if !exists("main_syntax")
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
let main_syntax = 'qml'
|
||||
endif
|
||||
|
||||
" Drop fold if it set but vim doesn't support it.
|
||||
if version < 600 && exists("qml_fold")
|
||||
unlet qml_fold
|
||||
endif
|
||||
|
||||
syn case ignore
|
||||
|
||||
|
||||
syn keyword qmlCommentTodo TODO FIXME XXX TBD contained
|
||||
syn match qmlLineComment "\/\/.*" contains=@Spell,qmlCommentTodo
|
||||
syn match qmlCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
|
||||
syn region qmlComment start="/\*" end="\*/" contains=@Spell,qmlCommentTodo fold
|
||||
syn match qmlSpecial "\\\d\d\d\|\\."
|
||||
syn region qmlStringD start=+"+ skip=+\\\\\|\\"\|\\$+ end=+"\|$+ contains=qmlSpecial,@htmlPreproc
|
||||
syn region qmlStringS start=+'+ skip=+\\\\\|\\'\|\\$+ end=+'\|$+ contains=qmlSpecial,@htmlPreproc
|
||||
|
||||
syn match qmlCharacter "'\\.'"
|
||||
syn match qmlNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
|
||||
syn region qmlRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
|
||||
syn match qmlObjectLiteralType "[A-Za-z][_A-Za-z0-9]*\s*\({\)\@="
|
||||
syn match qmlNonBindingColon "?[^;]*:"
|
||||
syn match qmlBindingProperty "\<[A-Za-z][_A-Za-z.0-9]*\s*:"
|
||||
|
||||
syn keyword qmlConditional if else switch
|
||||
syn keyword qmlRepeat while for do in
|
||||
syn keyword qmlBranch break continue
|
||||
syn keyword qmlOperator new delete instanceof typeof
|
||||
syn keyword qmlJsType Array Boolean Date Function Number Object String RegExp
|
||||
syn keyword qmlType action alias bool color date double enumeration font int list point real rect size string time url variant vector3d
|
||||
syn keyword qmlStatement return with
|
||||
syn keyword qmlBoolean true false
|
||||
syn keyword qmlNull null undefined
|
||||
syn keyword qmlIdentifier arguments this var
|
||||
syn keyword qmlLabel case default
|
||||
syn keyword qmlException try catch finally throw
|
||||
syn keyword qmlMessage alert confirm prompt status
|
||||
syn keyword qmlGlobal self
|
||||
syn keyword qmlDeclaration property signal
|
||||
syn keyword qmlReserved abstract boolean byte char class const debugger enum export extends final float goto implements import interface long native package pragma private protected public short static super synchronized throws transient volatile
|
||||
|
||||
if get(g:, 'qml_fold', 0)
|
||||
syn match qmlFunction "\<function\>"
|
||||
syn region qmlFunctionFold start="\<function\>.*[^};]$" end="^\z1}.*$" transparent fold keepend
|
||||
|
||||
syn sync match qmlSync grouphere qmlFunctionFold "\<function\>"
|
||||
syn sync match qmlSync grouphere NONE "^}"
|
||||
|
||||
setlocal foldmethod=syntax
|
||||
setlocal foldtext=getline(v:foldstart)
|
||||
else
|
||||
syn keyword qmlFunction function
|
||||
syn match qmlBraces "[{}\[\]]"
|
||||
syn match qmlParens "[()]"
|
||||
endif
|
||||
|
||||
syn sync fromstart
|
||||
syn sync maxlines=100
|
||||
|
||||
if main_syntax == "qml"
|
||||
syn sync ccomment qmlComment
|
||||
endif
|
||||
|
||||
" 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_qml_syn_inits")
|
||||
if version < 508
|
||||
let did_qml_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
HiLink qmlComment Comment
|
||||
HiLink qmlLineComment Comment
|
||||
HiLink qmlCommentTodo Todo
|
||||
HiLink qmlSpecial Special
|
||||
HiLink qmlStringS String
|
||||
HiLink qmlStringD String
|
||||
HiLink qmlCharacter Character
|
||||
HiLink qmlNumber Number
|
||||
HiLink qmlConditional Conditional
|
||||
HiLink qmlRepeat Repeat
|
||||
HiLink qmlBranch Conditional
|
||||
HiLink qmlOperator Operator
|
||||
HiLink qmlJsType Type
|
||||
HiLink qmlType Type
|
||||
HiLink qmlObjectLiteralType Type
|
||||
HiLink qmlStatement Statement
|
||||
HiLink qmlFunction Function
|
||||
HiLink qmlBraces Function
|
||||
HiLink qmlError Error
|
||||
HiLink qmlNull Keyword
|
||||
HiLink qmlBoolean Boolean
|
||||
HiLink qmlRegexpString String
|
||||
|
||||
HiLink qmlIdentifier Identifier
|
||||
HiLink qmlLabel Label
|
||||
HiLink qmlException Exception
|
||||
HiLink qmlMessage Keyword
|
||||
HiLink qmlGlobal Keyword
|
||||
HiLink qmlReserved Keyword
|
||||
HiLink qmlDebug Debug
|
||||
HiLink qmlConstant Label
|
||||
HiLink qmlNonBindingColon NONE
|
||||
HiLink qmlBindingProperty Label
|
||||
HiLink qmlDeclaration Function
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "qml"
|
||||
if main_syntax == 'qml'
|
||||
unlet main_syntax
|
||||
endif
|
||||
|
||||
endif
|
||||
@@ -32,7 +32,7 @@ endif
|
||||
|
||||
" 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*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::"
|
||||
syn match rubyOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!="
|
||||
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop
|
||||
endif
|
||||
@@ -82,13 +82,13 @@ syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedPare
|
||||
syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment
|
||||
|
||||
" Numbers and ASCII Codes
|
||||
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 rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*\>" display
|
||||
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0[dD]\)\=\%(0\|[1-9]\d*\%(_\d\+\)*\)\>" display
|
||||
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[oO]\=\o\+\%(_\o\+\)*\>" display
|
||||
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)*\>" display
|
||||
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\.\d\+\%(_\d\+\)*\>" display
|
||||
syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)*\)\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)\>" display
|
||||
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 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[oO]\=\o\+\%(_\o\+\)*r\=i\=\>" display
|
||||
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[bB][01]\+\%(_[01]\+\)*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
|
||||
|
||||
" Identifiers
|
||||
syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent
|
||||
@@ -98,7 +98,7 @@ syn match rubyConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>
|
||||
syn match rubyClassVariable "@@\%(\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 rubySymbol "[]})\"':]\@<!:\%(\^\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)"
|
||||
syn match rubySymbol "[]})\"':]\@<!:\%(\^\|\~@\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!@\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)"
|
||||
syn match rubySymbol "[]})\"':]\@<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)"
|
||||
syn match rubySymbol "[]})\"':]\@<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*"
|
||||
syn match rubySymbol "[]})\"':]\@<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\="
|
||||
@@ -125,20 +125,19 @@ syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|o
|
||||
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold
|
||||
|
||||
" Generalized Regular Expression
|
||||
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 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\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" 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<" 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\z(\s\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold
|
||||
|
||||
" Normal String and Shell Command Output
|
||||
if exists('ruby_spellcheck_strings')
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,@Spell fold
|
||||
else
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
|
||||
endif
|
||||
" Normal String
|
||||
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="\\\\\|\\''" fold contains=rubyQuoteEscape' . s:spell_cluster
|
||||
|
||||
" Shell Command Output
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold
|
||||
|
||||
" Generalized Single Quoted String, Symbol and Array of Strings
|
||||
@@ -147,12 +146,13 @@ syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="%q " end=" " skip="\\\\\|\\)" fold
|
||||
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\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" 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<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
|
||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
|
||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="%s\z(\s\)" end="\z1" skip="\\\\\|\\\z1" fold
|
||||
|
||||
" Generalized Double Quoted String and Array of Strings and Shell Command Output
|
||||
" Note: %= is not matched here as the beginning of a double quoted string
|
||||
@@ -162,7 +162,7 @@ syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" en
|
||||
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,rubyNestedSquareBrackets,rubyDelimEscape fold
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx] " end=" " skip="\\\\\|\\)" contains=@rubyStringSpecial fold
|
||||
syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx]\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold
|
||||
|
||||
" Array of Symbols
|
||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
|
||||
@@ -173,10 +173,10 @@ syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i(" end=")" sk
|
||||
|
||||
" 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\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape 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,rubyNestedSquareBrackets,rubyDelimEscape 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,rubyNestedCurlyBraces,rubyDelimEscape 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,rubyNestedSquareBrackets,rubyDelimEscape fold
|
||||
syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
|
||||
|
||||
" Here Document
|
||||
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
|
||||
@@ -205,7 +205,7 @@ syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyC
|
||||
syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator
|
||||
syn match rubyFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=rubyMethodDeclaration
|
||||
syn match rubyFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2
|
||||
syn match rubyFunction "\%([[:space:].]\|^\)\@<=\%(\[\]=\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration
|
||||
syn match rubyFunction "\%([[:space:].]\|^\)\@<=\%(\[\]=\=\|\*\*\|[-+!~]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration
|
||||
|
||||
syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter
|
||||
|
||||
@@ -244,7 +244,7 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
|
||||
" statements without 'do'
|
||||
syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||
syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
|
||||
syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@<!\.\)\|::\)\s*\)\@<!\<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
|
||||
|
||||
syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression
|
||||
syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression
|
||||
@@ -289,7 +289,7 @@ syn match rubySharpBang "\%^#!.*" display
|
||||
syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained
|
||||
syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell
|
||||
if !exists("ruby_no_comment_fold")
|
||||
syn region rubyMultilineComment start="\%(\%(^\s*#.*\n\)\@<!\%(^\s*#.*\n\)\)\%(\(^\s*#.*\n\)\{1,}\)\@=" end="\%(^\s*#.*\n\)\@<=\%(^\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
|
||||
else
|
||||
syn region rubyDocumentation start="^=begin\s*$" end="^=end\s*$" contains=rubySpaceError,rubyTodo,@Spell
|
||||
|
||||
@@ -5,7 +5,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
|
||||
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
|
||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||
" Last Change: January 5, 2015
|
||||
" Last Change: January 29, 2015
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
@@ -26,9 +26,9 @@ syn keyword rustKeyword continue
|
||||
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
|
||||
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
|
||||
syn keyword rustKeyword for in if impl let
|
||||
syn keyword rustKeyword loop once pub
|
||||
syn keyword rustKeyword loop pub
|
||||
syn keyword rustKeyword return super
|
||||
syn keyword rustKeyword unsafe virtual where while
|
||||
syn keyword rustKeyword unsafe where while
|
||||
syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty
|
||||
" FIXME: Scoped impl's name is also fallen in this category
|
||||
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
|
||||
@@ -45,7 +45,6 @@ syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:spac
|
||||
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
||||
|
||||
syn region rustBoxPlacement matchgroup=rustBoxPlacementParens start="(" end=")" contains=TOP contained
|
||||
syn keyword rustBoxPlacementExpr GC containedin=rustBoxPlacement
|
||||
" Ideally we'd have syntax rules set up to match arbitrary expressions. Since
|
||||
" we don't, we'll just define temporary contained rules to handle balancing
|
||||
" delimiters.
|
||||
@@ -58,13 +57,13 @@ syn match rustMacroRepeatCount ".\?[*+]" contained
|
||||
syn match rustMacroVariable "$\w\+"
|
||||
|
||||
" Reserved (but not yet used) keywords {{{2
|
||||
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield abstract final override macro
|
||||
syn keyword rustReservedKeyword alignof become do offsetof priv pure sizeof typeof unsized yield abstract virtual final override macro
|
||||
|
||||
" Built-in types {{{2
|
||||
syn keyword rustType isize usize float char bool u8 u16 u32 u64 f32
|
||||
syn keyword rustType isize usize char bool u8 u16 u32 u64 f32
|
||||
syn keyword rustType f64 i8 i16 i32 i64 str Self
|
||||
|
||||
" Things from the prelude (src/libstd/prelude.rs) {{{2
|
||||
" Things from the libstd v1 prelude (src/libstd/prelude/v1.rs) {{{2
|
||||
" This section is just straight transformation of the contents of the prelude,
|
||||
" to make it easy to update.
|
||||
|
||||
@@ -73,30 +72,27 @@ syn keyword rustTrait Copy Send Sized Sync
|
||||
syn keyword rustTrait Drop Fn FnMut FnOnce
|
||||
|
||||
" Reexported functions {{{3
|
||||
syn keyword rustFunction drop
|
||||
" There’s no point in highlighting these; when one writes drop( or drop::< it
|
||||
" gets the same highlighting anyway, and if someone writes `let drop = …;` we
|
||||
" don’t really want *that* drop to be highlighted.
|
||||
"syn keyword rustFunction drop
|
||||
|
||||
" Reexported types and traits {{{3
|
||||
syn keyword rustTrait Box
|
||||
syn keyword rustTrait CharExt
|
||||
syn keyword rustTrait ToOwned
|
||||
syn keyword rustTrait Clone
|
||||
syn keyword rustTrait PartialEq PartialOrd Eq Ord
|
||||
syn keyword rustTrait DoubleEndedIterator
|
||||
syn keyword rustTrait ExactSizeIterator
|
||||
syn keyword rustTrait Iterator IteratorExt Extend
|
||||
syn keyword rustTrait AsRef AsMut Into From
|
||||
syn keyword rustTrait Default
|
||||
syn keyword rustTrait Iterator Extend IntoIterator
|
||||
syn keyword rustTrait DoubleEndedIterator ExactSizeIterator
|
||||
syn keyword rustEnum Option
|
||||
syn keyword rustEnumVariant Some None
|
||||
syn keyword rustTrait PtrExt MutPtrExt
|
||||
syn keyword rustEnum Result
|
||||
syn keyword rustEnumVariant Ok Err
|
||||
syn keyword rustTrait AsSlice
|
||||
syn keyword rustTrait SliceExt SliceConcatExt
|
||||
syn keyword rustTrait Str StrExt
|
||||
syn keyword rustTrait SliceConcatExt
|
||||
syn keyword rustTrait String ToString
|
||||
syn keyword rustTrait Vec
|
||||
" FIXME: remove when path reform lands
|
||||
syn keyword rustTrait Path GenericPath
|
||||
" FIXME: remove when I/O reform lands
|
||||
syn keyword rustTrait Buffer Writer Reader Seek BufferPrelude
|
||||
|
||||
" Other syntax {{{2
|
||||
syn keyword rustSelf self
|
||||
@@ -122,6 +118,9 @@ syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1
|
||||
" This isn't actually correct; a closure with no arguments can be `|| { }`.
|
||||
" Last, because the & in && isn't a sigil
|
||||
syn match rustOperator display "&&\|||"
|
||||
" This is rustArrowCharacter rather than rustArrow for the sake of matchparen,
|
||||
" so it skips the ->; see http://stackoverflow.com/a/30309949 for details.
|
||||
syn match rustArrowCharacter display "->"
|
||||
|
||||
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic
|
||||
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic
|
||||
@@ -136,13 +135,16 @@ syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEs
|
||||
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
|
||||
|
||||
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive
|
||||
syn region rustDerive start="derive(" end=")" contained contains=rustTrait
|
||||
syn region rustDerive start="derive(" end=")" contained contains=rustDeriveTrait
|
||||
" This list comes from src/libsyntax/ext/deriving/mod.rs
|
||||
" Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show).
|
||||
syn keyword rustDeriveTrait contained Clone Hash RustcEncodable RustcDecodable Encodable Decodable PartialEq Eq PartialOrd Ord Rand Show Debug Default FromPrimitive Send Sync Copy
|
||||
|
||||
" Number literals
|
||||
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
|
||||
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(size\|8\|16\|32\|64\)\)\="
|
||||
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\="
|
||||
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\="
|
||||
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(size\|8\|16\|32\|64\)\)\="
|
||||
|
||||
" Special case for numbers of the form "1." which are float literals, unless followed by
|
||||
" an identifier, which makes them integer literals with a method call or field access,
|
||||
@@ -168,6 +170,7 @@ syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:g
|
||||
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
|
||||
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
|
||||
|
||||
syn match rustShebang /\%^#![^[].*/
|
||||
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
|
||||
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
|
||||
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell
|
||||
@@ -200,6 +203,7 @@ hi def link rustOctNumber rustNumber
|
||||
hi def link rustBinNumber rustNumber
|
||||
hi def link rustIdentifierPrime rustIdentifier
|
||||
hi def link rustTrait rustType
|
||||
hi def link rustDeriveTrait rustTrait
|
||||
|
||||
hi def link rustMacroRepeatCount rustMacroRepeatDelimiters
|
||||
hi def link rustMacroRepeatDelimiters Macro
|
||||
@@ -220,6 +224,7 @@ hi def link rustEnumVariant rustConstant
|
||||
hi def link rustConstant Constant
|
||||
hi def link rustSelf Constant
|
||||
hi def link rustFloat Float
|
||||
hi def link rustArrowCharacter rustOperator
|
||||
hi def link rustOperator Operator
|
||||
hi def link rustKeyword Keyword
|
||||
hi def link rustReservedKeyword Error
|
||||
@@ -231,6 +236,7 @@ hi def link rustModPathSep Delimiter
|
||||
hi def link rustFunction Function
|
||||
hi def link rustFuncName Function
|
||||
hi def link rustFuncCall Function
|
||||
hi def link rustShebang Comment
|
||||
hi def link rustCommentLine Comment
|
||||
hi def link rustCommentLineDoc SpecialComment
|
||||
hi def link rustCommentBlock rustCommentLine
|
||||
@@ -249,7 +255,6 @@ hi def link rustInvalidBareKeyword Error
|
||||
hi def link rustExternCrate rustKeyword
|
||||
hi def link rustObsoleteExternMod Error
|
||||
hi def link rustBoxPlacementParens Delimiter
|
||||
hi def link rustBoxPlacementExpr rustKeyword
|
||||
|
||||
" Other Suggestions:
|
||||
" hi rustAttribute ctermfg=cyan
|
||||
|
||||
@@ -179,7 +179,7 @@ hi link scalaTypeOperator Keyword
|
||||
hi link scalaTypeAnnotationParameter Function
|
||||
|
||||
syn match scalaShebang "\%^#!.*" display
|
||||
syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaTodo,scalaCommentCodeBlock,@scalaHtml,@Spell keepend
|
||||
syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaTodo,scalaCommentCodeBlock,@scalaHtml,@Spell keepend fold
|
||||
syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained
|
||||
syn match scalaParameterAnnotation "@param" nextgroup=scalaParamAnnotationValue skipwhite contained
|
||||
syn match scalaParamAnnotationValue /[`_A-Za-z0-9$]\+/ contained
|
||||
|
||||
269
syntax/swift.vim
269
syntax/swift.vim
@@ -1,68 +1,229 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
|
||||
|
||||
" Language: Swift<https://developer.apple.com/swift/>
|
||||
" Maintainer: toyama satoshi <toyamarinyon@gmail.com>
|
||||
" URL: http://github.com/toyamarinyon/vim-swift
|
||||
" License: GPL
|
||||
" File: swift.vim
|
||||
" Author: Keith Smiley
|
||||
" Description: Runtime files for Swift
|
||||
" Last Modified: June 15, 2014
|
||||
|
||||
" Bail if our syntax is already loaded.
|
||||
if exists('b:current_syntax') && b:current_syntax == 'swift'
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" {{{ Whitespace and Comments
|
||||
syntax region swiftComment start=#\/\*# end=#\*\/#
|
||||
syntax match swiftComment /\/\/.*/
|
||||
" Comments
|
||||
" Shebang
|
||||
syntax match swiftShebang "\v#!.*$"
|
||||
|
||||
" Comment contained keywords
|
||||
syntax keyword swiftTodos contained TODO XXX FIXME NOTE
|
||||
syntax keyword swiftMarker contained MARK
|
||||
syntax match swiftDocString "\v^\s*-\s*parameter"hs=s+1 contained
|
||||
syntax match swiftDocString "\v^\s*-\s*returns"hs=s+1 contained
|
||||
|
||||
" Literals
|
||||
" Strings
|
||||
syntax region swiftString start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=swiftInterpolatedWrapper
|
||||
syntax region swiftInterpolatedWrapper start="\v[^\\]\\\(\s*" end="\v\s*\)" contained containedin=swiftString contains=swiftInterpolatedString
|
||||
syntax match swiftInterpolatedString "\v\w+(\(\))?" contained containedin=swiftInterpolatedWrapper
|
||||
|
||||
" Numbers
|
||||
syntax match swiftNumber "\v<\d+>"
|
||||
syntax match swiftNumber "\v<(\d+_+)+\d+(\.\d+(_+\d+)*)?>"
|
||||
syntax match swiftNumber "\v<\d+\.\d+>"
|
||||
syntax match swiftNumber "\v<\d*\.?\d+([Ee]-?)?\d+>"
|
||||
syntax match swiftNumber "\v<0x\x+([Pp]-?)?\x+>"
|
||||
syntax match swiftNumber "\v<0b[01]+>"
|
||||
syntax match swiftNumber "\v<0o\o+>"
|
||||
|
||||
" BOOLs
|
||||
syntax keyword swiftBoolean
|
||||
\ true
|
||||
\ false
|
||||
|
||||
|
||||
" Operators
|
||||
syntax match swiftOperator "\v\~"
|
||||
syntax match swiftOperator "\v\s+!"
|
||||
syntax match swiftOperator "\v\%"
|
||||
syntax match swiftOperator "\v\^"
|
||||
syntax match swiftOperator "\v\&"
|
||||
syntax match swiftOperator "\v\*"
|
||||
syntax match swiftOperator "\v-"
|
||||
syntax match swiftOperator "\v\+"
|
||||
syntax match swiftOperator "\v\="
|
||||
syntax match swiftOperator "\v\|"
|
||||
syntax match swiftOperator "\v\/"
|
||||
syntax match swiftOperator "\v\."
|
||||
syntax match swiftOperator "\v\<"
|
||||
syntax match swiftOperator "\v\>"
|
||||
syntax match swiftOperator "\v\?\?"
|
||||
|
||||
" Methods/Functions
|
||||
syntax match swiftMethod "\(\.\)\@<=\w\+\((\)\@="
|
||||
|
||||
" Swift closure arguments
|
||||
syntax match swiftClosureArgument "\$\d\+\(\.\d\+\)\?"
|
||||
|
||||
syntax match swiftAvailability "\v((\*(\s*,\s*[a-zA-Z="0-9.]+)*)|(\w+\s+\d+(\.\d+(.\d+)?)?\s*,\s*)+\*)" contains=swiftString
|
||||
syntax keyword swiftPlatforms OSX iOS watchOS OSXApplicationExtension iOSApplicationExtension contained containedin=swiftAvailability
|
||||
syntax keyword swiftAvailabilityArg renamed unavailable introduced deprecated obsoleted message contained containedin=swiftAvailability
|
||||
|
||||
" Keywords {{{
|
||||
syntax keyword swiftKeywords
|
||||
\ as
|
||||
\ atexit
|
||||
\ break
|
||||
\ case
|
||||
\ catch
|
||||
\ class
|
||||
\ continue
|
||||
\ convenience
|
||||
\ default
|
||||
\ defer
|
||||
\ deinit
|
||||
\ didSet
|
||||
\ do
|
||||
\ dynamic
|
||||
\ else
|
||||
\ extension
|
||||
\ fallthrough
|
||||
\ final
|
||||
\ for
|
||||
\ func
|
||||
\ get
|
||||
\ guard
|
||||
\ if
|
||||
\ import
|
||||
\ in
|
||||
\ indirect
|
||||
\ infix
|
||||
\ init
|
||||
\ inout
|
||||
\ internal
|
||||
\ is
|
||||
\ lazy
|
||||
\ let
|
||||
\ mutating
|
||||
\ nil
|
||||
\ nonmutating
|
||||
\ operator
|
||||
\ optional
|
||||
\ override
|
||||
\ postfix
|
||||
\ prefix
|
||||
\ private
|
||||
\ protocol
|
||||
\ public
|
||||
\ repeat
|
||||
\ required
|
||||
\ rethrows
|
||||
\ return
|
||||
\ self
|
||||
\ set
|
||||
\ static
|
||||
\ subscript
|
||||
\ super
|
||||
\ switch
|
||||
\ throw
|
||||
\ throws
|
||||
\ try
|
||||
\ typealias
|
||||
\ unowned
|
||||
\ var
|
||||
\ weak
|
||||
\ where
|
||||
\ while
|
||||
\ willSet
|
||||
" }}}
|
||||
|
||||
" Names surrounded by backticks. This aren't limited to keywords because 1)
|
||||
" Swift doesn't limit them to keywords and 2) I couldn't make the keywords not
|
||||
" highlight at the same time
|
||||
syntax region swiftEscapedReservedWord start="`" end="`" oneline
|
||||
|
||||
syntax keyword swiftAttributes
|
||||
\ @assignment
|
||||
\ @autoclosure
|
||||
\ @available
|
||||
\ @convention
|
||||
\ @exported
|
||||
\ @IBAction
|
||||
\ @IBDesignable
|
||||
\ @IBInspectable
|
||||
\ @IBOutlet
|
||||
\ @noescape
|
||||
\ @nonobjc
|
||||
\ @noreturn
|
||||
\ @NSApplicationMain
|
||||
\ @NSCopying
|
||||
\ @NSManaged
|
||||
\ @objc
|
||||
\ @testable
|
||||
\ @UIApplicationMain
|
||||
\ @warn_unused_result
|
||||
|
||||
syntax keyword swiftConditionStatement #available
|
||||
|
||||
syntax keyword swiftStructure
|
||||
\ struct
|
||||
\ enum
|
||||
|
||||
syntax region swiftTypeWrapper start="\v:\s*" skip="\s*,\s*$*\s*" end="$" contains=swiftString,swiftBoolean,swiftNumber,swiftType,swiftGenericsWrapper transparent
|
||||
syntax region swiftGenericsWrapper start="\v\<" end="\v\>" contains=swiftType transparent oneline
|
||||
syntax region swiftLiteralWrapper start="\v\=\s*" skip="\v[^\[\]]\(\)" end="\v(\[\]|\(\))" contains=swiftType,swiftString transparent oneline
|
||||
syntax region swiftReturnWrapper start="\v-\>\s*" end="\v(\{|$)" contains=swiftType transparent oneline
|
||||
syntax match swiftType "\v<\u\w*" contained containedin=swiftGenericsWrapper,swiftTypeWrapper,swiftLiteralWrapper,swiftGenericsWrapper
|
||||
|
||||
syntax keyword swiftImports import
|
||||
|
||||
|
||||
" 'preprocesor' stuff
|
||||
syntax keyword swiftPreprocessor
|
||||
\ #if
|
||||
\ #elseif
|
||||
\ #else
|
||||
\ #endif
|
||||
|
||||
|
||||
" Comment patterns
|
||||
syntax match swiftComment "\v\/\/.*$"
|
||||
\ contains=swiftTodos,swiftDocString,swiftMarker,@Spell oneline
|
||||
syntax region swiftComment start="/\*" end="\*/"
|
||||
\ contains=swiftTodos,swiftDocString,swiftMarker,swiftComment,@Spell fold
|
||||
|
||||
|
||||
" Set highlights
|
||||
highlight default link swiftTodos Todo
|
||||
highlight default link swiftDocString String
|
||||
highlight default link swiftShebang Comment
|
||||
highlight default link swiftComment Comment
|
||||
" }}}
|
||||
highlight default link swiftMarker Comment
|
||||
|
||||
" {{{ Identifiers
|
||||
syntax match swiftIdentifier /[[:alpha:]_][[:alnum:]_]*/
|
||||
highlight default link swiftIdentifier Identifier
|
||||
" }}}
|
||||
highlight default link swiftString String
|
||||
highlight default link swiftInterpolatedWrapper Delimiter
|
||||
highlight default link swiftNumber Number
|
||||
highlight default link swiftBoolean Boolean
|
||||
|
||||
" {{{ Keywords
|
||||
" Keywords used in declarations:
|
||||
syntax keyword swiftDeclarationKeywords class deinit enum extension func import init let protocol static struct subscript typealias var
|
||||
highlight default link swiftDeclarationKeywords Keyword
|
||||
" Keywords used in statements:
|
||||
syntax keyword swiftStatementKeywords break case continue default do else fallthrough if in for return switch where while
|
||||
highlight default link swiftStatementKeywords Keyword
|
||||
" Keywords used in expressions and types:
|
||||
syntax keyword swiftExpressionTypeKeywords as dynamicType is new super self Self Type __COLUMN__ __FILE__ __FUNCTION__ __LINE__
|
||||
highlight default link swiftExpressionTypeKeywords Keyword
|
||||
" Keywords reserved in particular contexts:
|
||||
syntax keyword swiftReserveKeywords associativity didSet get infix inout left mutating none nonmutating operator override postfix precedence prefix right set unowned unowned(safe) unowned(unsafe) weak willSet
|
||||
highlight default link swiftReserveKeywords Keyword
|
||||
" }}}
|
||||
highlight default link swiftOperator Operator
|
||||
highlight default link swiftKeywords Keyword
|
||||
highlight default link swiftEscapedReservedWord Normal
|
||||
highlight default link swiftClosureArgument Operator
|
||||
highlight default link swiftAttributes PreProc
|
||||
highlight default link swiftConditionStatement PreProc
|
||||
highlight default link swiftStructure Structure
|
||||
highlight default link swiftType Type
|
||||
highlight default link swiftImports Include
|
||||
highlight default link swiftPreprocessor PreProc
|
||||
highlight default link swiftMethod Function
|
||||
|
||||
" {{{ Literals
|
||||
" Integer literal
|
||||
syntax match swiftIntegerLiteral /\<\d\+\%(_\d\+\)*\%(\.\d\+\%(_\d\+\)*\)\=\>/
|
||||
syntax match swiftIntegerLiteral /\<\d\+\%(_\d\+\)*\%(\.\d\+\%(_\d\+\)*\)\=\%([eE][-+]\=\d\+\%(_\d\+\)*\)\>/
|
||||
syntax match swiftIntegerLiteral /\<0x\x\+\%(_\x\+\)*\>/
|
||||
syntax match swiftIntegerLiteral /\<0o\o\+\%(_\o\+\)*\>/
|
||||
syntax match swiftIntegerLiteral /\<0b[01]\+\%(_[01]\+\)*\>/
|
||||
highlight default link swiftIntegerLiteral Number
|
||||
" String literal
|
||||
syntax region swiftStringLiteral start=/"/ skip=/\\"/ end=/"/
|
||||
highlight default link swiftStringLiteral String
|
||||
" }}}
|
||||
highlight default link swiftConditionStatement PreProc
|
||||
highlight default link swiftAvailability Normal
|
||||
highlight default link swiftAvailabilityArg Normal
|
||||
highlight default link swiftPlatforms Keyword
|
||||
|
||||
" {{{ Operators
|
||||
syntax keyword swiftOperatorKeywords / = - + ! * % < > & \| ^ ~ .
|
||||
highlight default link swiftOperatorKeywords Operator
|
||||
" }}}
|
||||
" Force vim to sync at least x lines. This solves the multiline comment not
|
||||
" being highlighted issue
|
||||
syn sync minlines=100
|
||||
|
||||
" {{{ Type
|
||||
syntax match swiftTypeIdentifier /\<[[:alpha:]_][[:alnum:]_.]*/ contained
|
||||
syntax match swiftType /: .*/ contains=swiftTypeIdentifier
|
||||
highlight default link swiftType Operator
|
||||
highlight default link swiftTypeIdentifier Type
|
||||
" }}}
|
||||
|
||||
if !exists('b:current_syntax')
|
||||
let b:current_syntax = 'swift'
|
||||
endif
|
||||
let b:current_syntax = "swift"
|
||||
|
||||
endif
|
||||
|
||||
@@ -2,7 +2,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1
|
||||
|
||||
" Language: TOML
|
||||
" Maintainer: Caleb Spare <cespare@gmail.com>
|
||||
" URL: http://github.com/cespare/vim-toml
|
||||
" URL: https://github.com/cespare/vim-toml
|
||||
" LICENSE: MIT
|
||||
|
||||
if exists("b:current_syntax")
|
||||
@@ -27,16 +27,17 @@ syn region tomlString oneline start=/'/ end=/'/
|
||||
syn region tomlString start=/'''/ end=/'''/
|
||||
hi def link tomlString String
|
||||
|
||||
syn match tomlInteger /\<-\?\d\+\>/ display
|
||||
syn match tomlInteger /\<[+-]\=[0-9]\(_\=\d\)*\>/ display
|
||||
hi def link tomlInteger Number
|
||||
|
||||
syn match tomlFloat /\<-\?\d\+\.\d\+\>/ display
|
||||
syn match tomlFloat /\<[+-]\=[0-9]\(_\=\d\)*\.\d\+\>/ display
|
||||
syn match tomlFloat /\<[+-]\=[0-9]\(_\=\d\)*\(\.[0-9]\(_\=\d\)*\)\=[eE][+-]\=[0-9]\(_\=\d\)*\>/ display
|
||||
hi def link tomlFloat Float
|
||||
|
||||
syn match tomlBoolean /\<\%(true\|false\)\>/ display
|
||||
hi def link tomlBoolean Boolean
|
||||
|
||||
" http://tools.ietf.org/html/rfc3339
|
||||
" https://tools.ietf.org/html/rfc3339
|
||||
syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)/ display
|
||||
hi def link tomlDate Constant
|
||||
|
||||
|
||||
110
syntax/vcl.vim
Normal file
110
syntax/vcl.vim
Normal file
@@ -0,0 +1,110 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vcl') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Filename: vcl.vim
|
||||
" Language: Varnish configuation Language, http://www.varnish-cache.org/wiki/VCL
|
||||
" Maintainer: Elan Ruusamäe <glen@delfi.ee>
|
||||
" Version Info: $Revision: 1.7 $
|
||||
" Last Change: $Date: 2010/04/06 08:24:28 $ UTC
|
||||
|
||||
" 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
|
||||
|
||||
" TODO
|
||||
" - sub ...
|
||||
" - backend/director/...
|
||||
" - acl ...
|
||||
" - error when invalid operator used in if (...)
|
||||
" - +=, = operators
|
||||
" - functions
|
||||
|
||||
" Code Blocks
|
||||
" sub NAME {
|
||||
" backend NAME {
|
||||
" director NAME FLAGS {
|
||||
" acl NAME {
|
||||
"syn region vclCodeBlock start="\s*\<sub\|backend\|director\|acl\>" end="{"he=e-1 contains=vclCodeBlockName,vclFunctionName
|
||||
"syn match vclCodeBlockName "\<sub\|backend\|director\|acl\>" contained
|
||||
"syn match vclFunctionName "\h[[:alnum:]_:]*" contained
|
||||
"syn match vclFunctionName "\h\w*[^:]" contained
|
||||
"
|
||||
syn keyword vclOperator set call return error esi synthetic include remove unset
|
||||
" return modes
|
||||
syn keyword vclModes deliver pipe pass hash lookup discard fetch restart
|
||||
|
||||
" C strings
|
||||
syn region vclString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=vclSpecial
|
||||
syn match vclSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
|
||||
syn match vclSpecialError "L\='\\[^'\"?\\abfnrtv]'"
|
||||
syn match vclSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
|
||||
syn match vclSpecialCharacter display "L\='\\\o\{1,3}'"
|
||||
syn match vclSpecialCharacter display "'\\x\x\{1,2}'"
|
||||
syn match vclSpecialCharacter display "L'\\x\x\+'"
|
||||
|
||||
syn keyword vclConditional if else elsif elseif
|
||||
|
||||
" Numbers
|
||||
syn match vclNumbers display transparent "\<\d\|\.\d" contains=vclNumber,vclNumberTime
|
||||
syn match vclNumber display contained "\d\+"
|
||||
" set obj.ttl = 0s, 0m;
|
||||
syn match vclNumberTime display contained "\d\+[dhsm]"
|
||||
|
||||
" client
|
||||
syn match vclOption /client\.\(ip\|identity\)/
|
||||
" server
|
||||
syn match vclOption /server\.\(ip\|port\)/
|
||||
" req
|
||||
syn match vclOption /req\.\(hash\|request\|method\|url\|proto\|backend\healthy\|backend\|grace\|xid\|restarts\)/
|
||||
" bereq
|
||||
syn match vclOption /bereq\.\(request\|method\|url\|proto\|connect_timeout\|first_byte_timeout\|between_bytes_timeout\)/
|
||||
" beresp
|
||||
syn match vclOption /beresp\.\(proto\|status\|response\|cacheable\|ttl\|lastuse\|hits\|hash\|grace\|prefetch\|saintmode\|keep\)/
|
||||
" obj
|
||||
syn match vclOption /obj\.\(proto\|status\|response\|cacheable\|ttl\|lastuse\|hits\|hash\|grace\|prefetch\)/
|
||||
" resp
|
||||
syn match vclOption /resp\.\(proto\|status\|response\)/
|
||||
" common: http.HEADERNAME
|
||||
syn match vclOption /\(req\|bereq\|resp\|beresp\|obj\)\.http\.[A-Za-z][-_A-Za-z0-9]*/
|
||||
|
||||
" Highlight the C block
|
||||
syn include @vclC syntax/c.vim
|
||||
unlet b:current_syntax
|
||||
|
||||
" Mark block tags itself as comment
|
||||
syn region vclCBlock matchgroup=vclComment start=/C{/ end=/}C/ contains=@vclC keepend
|
||||
|
||||
" Synthetic
|
||||
syn region vclSynthetic start=/{"/hs=s+2 end=/"}/he=e-2 contains=@vclHTML keepend
|
||||
|
||||
" Allow html in synthetic
|
||||
syn include @vclHTML syntax/html.vim
|
||||
unlet b:current_syntax
|
||||
|
||||
syn match vclComment '#.*'
|
||||
syn match vclComment "//.*"
|
||||
syn region vclComment start="/\*" end="\*/"
|
||||
|
||||
syn sync ccomment vclComment
|
||||
|
||||
hi link vclCodeBlock Function
|
||||
hi link vclComment Comment
|
||||
hi link vclStatement Statement
|
||||
hi link vclFunctionName Identifier
|
||||
hi link vclCodeBlockName Statement
|
||||
hi link vclSpecial SpecialChar
|
||||
hi link vclString String
|
||||
hi link vclConditional Conditional
|
||||
hi link vclSynthetic vclString
|
||||
hi link vclSpecialCharacter vclSpecialSpecial
|
||||
hi link vclOperator Operator
|
||||
hi link vclModes Operator
|
||||
hi link vclOption Identifier
|
||||
hi link vclNumber Number
|
||||
hi link vclNumberTime Number
|
||||
|
||||
endif
|
||||
@@ -1,9 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||
|
||||
{ [Error: ENOENT, no such file or directory 'dom-document.yml']
|
||||
errno: -2,
|
||||
code: 'ENOENT',
|
||||
path: 'dom-document.yml',
|
||||
syscall: 'open' }
|
||||
|
||||
endif
|
||||
@@ -1,9 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||
|
||||
{ [Error: ENOENT, no such file or directory 'dom-elem.yml']
|
||||
errno: -2,
|
||||
code: 'ENOENT',
|
||||
path: 'dom-elem.yml',
|
||||
syscall: 'open' }
|
||||
|
||||
endif
|
||||
@@ -1,9 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||
|
||||
{ [Error: ENOENT, no such file or directory 'dom-event.yml']
|
||||
errno: -2,
|
||||
code: 'ENOENT',
|
||||
path: 'dom-event.yml',
|
||||
syscall: 'open' }
|
||||
|
||||
endif
|
||||
@@ -1,9 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||
|
||||
{ [Error: ENOENT, no such file or directory 'dom-node.yml']
|
||||
errno: -2,
|
||||
code: 'ENOENT',
|
||||
path: 'dom-node.yml',
|
||||
syscall: 'open' }
|
||||
|
||||
endif
|
||||
@@ -1,9 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||
|
||||
{ [Error: ENOENT, no such file or directory 'dom-storage.yml']
|
||||
errno: -2,
|
||||
code: 'ENOENT',
|
||||
path: 'dom-storage.yml',
|
||||
syscall: 'open' }
|
||||
|
||||
endif
|
||||
Reference in New Issue
Block a user