Compare commits

...

9 Commits

Author SHA1 Message Date
Adam Stankiewicz
11f34624aa Update 2016-07-19 10:09:54 +02:00
Yulij Andreevich Lesov
1422f7a75c Update vim-ember-script repo link (#138) 2016-07-05 10:28:08 +02:00
Adam Stankiewicz
b17b5d4d9f Readability fixes build 2016-07-05 10:00:59 +02:00
Yulij Andreevich Lesov
bd824d9407 readability: add newline and comment to generated ftdetect file (#142) 2016-07-05 09:59:45 +02:00
Yulij Andreevich Lesov
c3233deb70 Update vim-emblem repo link 2016-07-05 09:55:06 +02:00
Adam Stankiewicz
bf188c4a51 Update 2016-07-05 09:53:49 +02:00
Adam Stankiewicz
a5857b81c2 Create troubleshooting section in the README 2016-06-28 16:05:24 +02:00
Adam Stankiewicz
7a32eec6d1 Change markdown provider to plasticboy 2016-06-26 18:13:30 +02:00
Adam Stankiewicz
c69562f864 Update 2016-06-26 18:03:28 +02:00
46 changed files with 1344 additions and 728 deletions

View File

@@ -42,8 +42,8 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect) - [dockerfile](https://github.com/honza/dockerfile.vim) (syntax, ftdetect)
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect) - [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect)
- [elm](https://github.com/lambdatoast/elm.vim) (syntax, indent, autoload, ftplugin, ftdetect) - [elm](https://github.com/lambdatoast/elm.vim) (syntax, indent, autoload, ftplugin, ftdetect)
- [emberscript](https://github.com/heartsentwined/vim-ember-script) (syntax, indent, ftplugin, ftdetect) - [emberscript](https://github.com/yalesov/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
- [emblem](https://github.com/heartsentwined/vim-emblem) (syntax, indent, ftplugin, ftdetect) - [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin, ftdetect)
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent, ftdetect) - [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (syntax, indent, ftdetect)
- [fish](https://github.com/dag/vim-fish) (syntax, indent, compiler, autoload, ftplugin, ftdetect) - [fish](https://github.com/dag/vim-fish) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
- [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect) - [git](https://github.com/tpope/vim-git) (syntax, indent, ftplugin, ftdetect)
@@ -66,7 +66,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin, ftdetect) - [less](https://github.com/groenewege/vim-less) (syntax, indent, ftplugin, ftdetect)
- [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin, ftdetect) - [liquid](https://github.com/tpope/vim-liquid) (syntax, indent, ftplugin, ftdetect)
- [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin, ftdetect) - [mako](https://github.com/sophacles/vim-bundle-mako) (syntax, indent, ftplugin, ftdetect)
- [markdown](https://github.com/tpope/vim-markdown) (syntax, ftplugin, ftdetect) - [markdown](https://github.com/plasticboy/vim-markdown) (syntax, ftdetect)
- [nginx](https://github.com/othree/nginx-contrib-vim) (syntax, indent, ftdetect) - [nginx](https://github.com/othree/nginx-contrib-vim) (syntax, indent, ftdetect)
- [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent, ftdetect) - [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent, ftdetect)
- [nix](https://github.com/spwhitt/vim-nix) (syntax, ftplugin, ftdetect) - [nix](https://github.com/spwhitt/vim-nix) (syntax, ftplugin, ftdetect)
@@ -79,7 +79,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [php](https://github.com/StanAngeloff/php.vim) (syntax) - [php](https://github.com/StanAngeloff/php.vim) (syntax)
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, ftplugin, ftdetect) - [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, ftplugin, ftdetect)
- [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect) - [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect)
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect) - [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent, ftdetect)
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin, ftdetect) - [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin, ftdetect)
- [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin, ftdetect) - [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin, ftdetect)
- [purescript](https://github.com/raichoo/purescript-vim) (syntax, indent, ftdetect) - [purescript](https://github.com/raichoo/purescript-vim) (syntax, indent, ftdetect)
@@ -99,7 +99,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect) - [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect)
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect) - [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect) - [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
- [tmux](https://github.com/tejr/vim-tmux) (syntax, ftdetect) - [tmux](https://github.com/keith/tmux.vim) (syntax, ftplugin, ftdetect)
- [tomdoc](https://github.com/wellbredgrapefruit/tomdoc.vim) (syntax) - [tomdoc](https://github.com/wellbredgrapefruit/tomdoc.vim) (syntax)
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect) - [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect)
- [twig](https://github.com/evidens/vim-twig) (syntax, ftplugin) - [twig](https://github.com/evidens/vim-twig) (syntax, ftplugin)
@@ -112,9 +112,15 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin) - [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin)
- [yard](https://github.com/sheerun/vim-yardoc) (syntax) - [yard](https://github.com/sheerun/vim-yardoc) (syntax)
## Disabling a language pack ## Updating
Individual language packs can be disabled by setting `g:polyglot_disabled`. You can either wait for new patch release with updates or run the `./build` script by yourself.
## Troubleshooting
Please make sure you have `syntax on` in your `.vimrc`, otherwise syntax files are not loaded at all.
Individual language packs can be disabled by setting `g:polyglot_disabled` as follows:
```viml ```viml
" ~/.vimrc " ~/.vimrc
@@ -123,10 +129,6 @@ let g:polyglot_disabled = ['css']
Note that disabiling languages won't make in general your vim startup any faster / slower (only for specific file type). Vim-polyglot is selection of language plugins that are loaded only on demand. Note that disabiling languages won't make in general your vim startup any faster / slower (only for specific file type). Vim-polyglot is selection of language plugins that are loaded only on demand.
## Updating
You can either wait for new patch release with updates or run the `./build` script by yourself.
## Contributing ## Contributing
Language packs are periodically updated using automated `build` script. Language packs are periodically updated using automated `build` script.

View File

@@ -624,6 +624,7 @@ syntax keyword cppSTLtype const_mem_fun_ref_t
syntax keyword cppSTLtype const_mem_fun_t syntax keyword cppSTLtype const_mem_fun_t
syntax keyword cppSTLtype const_pointer syntax keyword cppSTLtype const_pointer
syntax keyword cppSTLtype const_reference syntax keyword cppSTLtype const_reference
syntax keyword cppSTLtype container_type
syntax keyword cppSTLtype deque syntax keyword cppSTLtype deque
syntax keyword cppSTLtype difference_type syntax keyword cppSTLtype difference_type
syntax keyword cppSTLtype div_t syntax keyword cppSTLtype div_t

File diff suppressed because one or more lines are too long

11
build
View File

@@ -5,6 +5,7 @@ set -E
DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect" DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect"
DIRS_BASIC="syntax compiler indent ftdetect after/syntax after/indent after/ftdetect" DIRS_BASIC="syntax compiler indent ftdetect after/syntax after/indent after/ftdetect"
DIRS_ALL="syntax indent compiler autoload ftplugin ftdetect after" DIRS_ALL="syntax indent compiler autoload ftplugin ftdetect after"
DIRS_SYNTAX="syntax ftdetect after/syntax after/ftdetect"
OUTPUT="" OUTPUT=""
@@ -74,7 +75,7 @@ copy_dir() {
} }
concat_ftdetect() { concat_ftdetect() {
cat ftdetect/* | grep -E '^[^"]' > tmp/polyglot.vim for f in ftdetect/*; do (echo '" '"$f"; cat "${f}"; echo) >> tmp/polyglot.vim; done
rm -f ftdetect/* rm -f ftdetect/*
mv tmp/polyglot.vim ftdetect/ mv tmp/polyglot.vim ftdetect/
} }
@@ -113,8 +114,8 @@ PACKS="
dockerfile:honza/dockerfile.vim dockerfile:honza/dockerfile.vim
elixir:elixir-lang/vim-elixir elixir:elixir-lang/vim-elixir
elm:lambdatoast/elm.vim elm:lambdatoast/elm.vim
emberscript:heartsentwined/vim-ember-script emberscript:yalesov/vim-ember-script
emblem:heartsentwined/vim-emblem emblem:yalesov/vim-emblem
erlang:vim-erlang/vim-erlang-runtime erlang:vim-erlang/vim-erlang-runtime
fish:dag/vim-fish fish:dag/vim-fish
git:tpope/vim-git git:tpope/vim-git
@@ -137,7 +138,7 @@ PACKS="
less:groenewege/vim-less less:groenewege/vim-less
liquid:tpope/vim-liquid liquid:tpope/vim-liquid
mako:sophacles/vim-bundle-mako mako:sophacles/vim-bundle-mako
markdown:tpope/vim-markdown markdown:plasticboy/vim-markdown:_SYNTAX
nginx:othree/nginx-contrib-vim nginx:othree/nginx-contrib-vim
nim:zah/nim.vim:_BASIC nim:zah/nim.vim:_BASIC
nix:spwhitt/vim-nix nix:spwhitt/vim-nix
@@ -170,7 +171,7 @@ PACKS="
systemd:kurayama/systemd-vim-syntax systemd:kurayama/systemd-vim-syntax
textile:timcharper/textile.vim textile:timcharper/textile.vim
thrift:solarnz/thrift.vim thrift:solarnz/thrift.vim
tmux:tejr/vim-tmux tmux:keith/tmux.vim
tomdoc:wellbredgrapefruit/tomdoc.vim tomdoc:wellbredgrapefruit/tomdoc.vim
toml:cespare/vim-toml toml:cespare/vim-toml
twig:evidens/vim-twig twig:evidens/vim-twig

View File

@@ -18,9 +18,9 @@ endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo-=C set cpo-=C
if filereadable("makefile") || filereadable("Makefile") if filereadable("makefile") || filereadable("Makefile")
CompilerSet makeprg=make CompilerSet makeprg=make
else else
CompilerSet makeprg=go\ build CompilerSet makeprg=go\ build
endif endif
" Define the patterns that will be recognized by QuickFix when parsing the " Define the patterns that will be recognized by QuickFix when parsing the
@@ -40,6 +40,6 @@ CompilerSet errorformat+=%-G%.%# " All lines not matching a
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim:ts=4:sw=4:et " vim: sw=2 ts=2 et
endif endif

View File

@@ -1,3 +1,4 @@
" ftdetect/ansible.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
function! s:isAnsible() function! s:isAnsible()
@@ -6,129 +7,238 @@ function! s:isAnsible()
if filepath =~ '\v/(tasks|roles|handlers)/.*\.ya?ml$' | return 1 | en if filepath =~ '\v/(tasks|roles|handlers)/.*\.ya?ml$' | return 1 | en
if filepath =~ '\v/(group|host)_vars/' | return 1 | en if filepath =~ '\v/(group|host)_vars/' | return 1 | en
if filename =~ '\v(playbook|site|main|local)\.ya?ml$' | return 1 | en if filename =~ '\v(playbook|site|main|local)\.ya?ml$' | return 1 | en
let shebang = getline(1) let shebang = getline(1)
if shebang =~# '^#!.*/bin/env\s\+ansible-playbook\>' | return 1 | en if shebang =~# '^#!.*/bin/env\s\+ansible-playbook\>' | return 1 | en
if shebang =~# '^#!.*/bin/ansible-playbook\>' | return 1 | en if shebang =~# '^#!.*/bin/ansible-playbook\>' | return 1 | en
return 0 return 0
endfunction endfunction
:au BufNewFile,BufRead * if s:isAnsible() | set ft=ansible | en :au BufNewFile,BufRead * if s:isAnsible() | set ft=ansible | en
:au BufNewFile,BufRead *.j2 set ft=ansible_template :au BufNewFile,BufRead *.j2 set ft=ansible_template
:au BufNewFile,BufRead hosts set ft=ansible_hosts :au BufNewFile,BufRead hosts set ft=ansible_hosts
endif endif
" ftdetect/arduino.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'arduino') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'arduino') == -1
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
endif endif
" ftdetect/blade.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'blade') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'blade') == -1
autocmd BufNewFile,BufRead *.blade.php set filetype=blade autocmd BufNewFile,BufRead *.blade.php set filetype=blade
endif endif
" ftdetect/cjsx.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cjsx') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cjsx') == -1
augroup CJSX augroup CJSX
au! au!
autocmd BufNewFile,BufRead *.csx,*.cjsx set filetype=coffee autocmd BufNewFile,BufRead *.csx,*.cjsx set filetype=coffee
augroup END augroup END
endif endif
" ftdetect/clojure.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc setlocal filetype=clojure autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc setlocal filetype=clojure
endif endif
" ftdetect/coffee.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
" Language: CoffeeScript
" Maintainer: Mick Koch <mick@kochm.co>
" URL: http://github.com/kchmck/vim-coffee-script
" License: WTFPL
autocmd BufNewFile,BufRead *.coffee set filetype=coffee autocmd BufNewFile,BufRead *.coffee set filetype=coffee
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee
autocmd BufNewFile,BufRead *._coffee set filetype=coffee autocmd BufNewFile,BufRead *._coffee set filetype=coffee
function! s:DetectCoffee() function! s:DetectCoffee()
if getline(1) =~ '^#!.*\<coffee\>' if getline(1) =~ '^#!.*\<coffee\>'
set filetype=coffee set filetype=coffee
endif endif
endfunction endfunction
autocmd BufNewFile,BufRead * call s:DetectCoffee() autocmd BufNewFile,BufRead * call s:DetectCoffee()
endif endif
" ftdetect/cql.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cql') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cql') == -1
if has("autocmd") if has("autocmd")
au BufNewFile,BufRead *.cql set filetype=cql au BufNewFile,BufRead *.cql set filetype=cql
endif endif
endif endif
" ftdetect/cryptol.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cryptol') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cryptol') == -1
" Copyright © 2013 Edward O'Callaghan. All Rights Reserved.
" Normal Cryptol Program;
au! BufRead,BufNewFile *.cry set filetype=cryptol au! BufRead,BufNewFile *.cry set filetype=cryptol
au! BufRead,BufNewFile *.cyl set filetype=cryptol au! BufRead,BufNewFile *.cyl set filetype=cryptol
" Literate Cryptol Program;
au! BufRead,BufNewFile *.lcry set filetype=cryptol au! BufRead,BufNewFile *.lcry set filetype=cryptol
au! BufRead,BufNewFile *.lcyl set filetype=cryptol au! BufRead,BufNewFile *.lcyl set filetype=cryptol
" Also in LaTeX *.tex which is outside our coverage scope.
endif endif
" ftdetect/crystal.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
autocmd BufNewFile,BufReadPost *.cr setlocal filetype=crystal autocmd BufNewFile,BufReadPost *.cr setlocal filetype=crystal
autocmd BufNewFile,BufReadPost Projectfile setlocal filetype=crystal autocmd BufNewFile,BufReadPost Projectfile setlocal filetype=crystal
autocmd BufNewFile,BufReadPost *.ecr setlocal filetype=eruby autocmd BufNewFile,BufReadPost *.ecr setlocal filetype=eruby
endif endif
" ftdetect/cucumber.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -1
" Cucumber
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
endif endif
" ftdetect/dart.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
autocmd BufRead,BufNewFile *.dart set filetype=dart autocmd BufRead,BufNewFile *.dart set filetype=dart
endif endif
" ftdetect/dockerfile.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
au BufNewFile,BufRead Dockerfile set filetype=dockerfile au BufNewFile,BufRead Dockerfile set filetype=dockerfile
endif endif
" ftdetect/elixir.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
au BufRead,BufNewFile *.ex,*.exs call s:setf('elixir') au BufRead,BufNewFile *.ex,*.exs call s:setf('elixir')
au BufRead,BufNewFile *.eex call s:setf('eelixir') au BufRead,BufNewFile *.eex call s:setf('eelixir')
au BufRead,BufNewFile * call s:DetectElixir() au BufRead,BufNewFile * call s:DetectElixir()
au FileType elixir,eelixir setl sw=2 sts=2 et iskeyword+=!,? au FileType elixir,eelixir setl sw=2 sts=2 et iskeyword+=!,?
function! s:setf(filetype) abort function! s:setf(filetype) abort
let &filetype = a:filetype let &filetype = a:filetype
endfunction endfunction
function! s:DetectElixir() function! s:DetectElixir()
if getline(1) =~ '^#!.*\<elixir\>' if getline(1) =~ '^#!.*\<elixir\>'
call s:setf('elixir') call s:setf('elixir')
endif endif
endfunction endfunction
endif endif
" ftdetect/elm.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
au BufNewFile,BufRead *.elm set filetype=elm au BufNewFile,BufRead *.elm set filetype=elm
endif endif
" ftdetect/ember-script.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
" Language: ember-script
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
" URL: http://github.com/yalesov/vim-ember-script
" Version: 1.0.4
" Last Change: 2016 Jul 6
" License: ISC
if !exists('g:vim_ember_script')
let g:vim_ember_script = 1
endif
autocmd BufNewFile,BufRead *.em set filetype=ember-script autocmd BufNewFile,BufRead *.em set filetype=ember-script
autocmd FileType ember-script set tabstop=2|set shiftwidth=2|set expandtab autocmd FileType ember-script set tabstop=2|set shiftwidth=2|set expandtab
endif endif
" ftdetect/emblem.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
autocmd BufNewFile,BufRead *.emblem set filetype=emblem " Language: emblem
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab " Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
" URL: http://github.com/yalesov/vim-emblem
" Version: 2.0.1
" Last Change: 2016 Jul 6
" License: ISC
if !exists('g:vim_emblem')
let g:vim_emblem = 1
endif endif
if exists('g:vim_ember_script')
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
else
autocmd BufNewFile,BufRead *.em,*.emblem set filetype=emblem
endif
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
endif
" ftdetect/erlang.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1
au BufNewFile,BufRead *.erl,*.hrl,rebar.config,*.app,*.app.src,*.yaws,*.xrl set ft=erlang au BufNewFile,BufRead *.erl,*.hrl,rebar.config,*.app,*.app.src,*.yaws,*.xrl set ft=erlang
endif endif
" ftdetect/fish.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fish') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fish') == -1
autocmd BufRead,BufNewFile *.fish setfiletype fish autocmd BufRead,BufNewFile *.fish setfiletype fish
" Detect fish scripts by the shebang line.
autocmd BufRead * autocmd BufRead *
\ if getline(1) =~# '\v^#!%(\f*/|/usr/bin/env\s*<)fish>' | \ if getline(1) =~# '\v^#!%(\f*/|/usr/bin/env\s*<)fish>' |
\ setlocal filetype=fish | \ setlocal filetype=fish |
\ endif \ endif
" Move cursor to first empty line when using funced.
autocmd BufRead fish_funced_*_*.fish call search('^$') autocmd BufRead fish_funced_*_*.fish call search('^$')
" Fish histories are YAML documents.
autocmd BufRead,BufNewFile ~/.config/fish/fish_{read_,}history setfiletype yaml autocmd BufRead,BufNewFile ~/.config/fish/fish_{read_,}history setfiletype yaml
" Universal variable storages should not be hand edited.
autocmd BufRead,BufNewFile ~/.config/fish/fishd.* setlocal readonly autocmd BufRead,BufNewFile ~/.config/fish/fishd.* setlocal readonly
" Mimic `funced` when manually creating functions.
autocmd BufNewFile ~/.config/fish/functions/*.fish autocmd BufNewFile ~/.config/fish/functions/*.fish
\ call append(0, ['function '.expand('%:t:r'), \ call append(0, ['function '.expand('%:t:r'),
\'', \'',
\'end']) | \'end']) |
\ 2 \ 2
endif endif
" ftdetect/git.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
" Git
autocmd BufNewFile,BufRead *.git/{,modules/**/,worktrees/*/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit autocmd BufNewFile,BufRead *.git/{,modules/**/,worktrees/*/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
autocmd BufNewFile,BufRead *.git/config,.gitconfig,gitconfig,.gitmodules set ft=gitconfig autocmd BufNewFile,BufRead *.git/config,.gitconfig,gitconfig,.gitmodules set ft=gitconfig
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
@@ -139,6 +249,8 @@ autocmd BufNewFile,BufRead *.git/**
\ if getline(1) =~ '^\x\{40\}\>\|^ref: ' | \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
\ set ft=git | \ set ft=git |
\ endif \ endif
" This logic really belongs in scripts.vim
autocmd BufNewFile,BufRead,StdinReadPost * autocmd BufNewFile,BufRead,StdinReadPost *
\ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' | \ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' |
\ set ft=git | \ set ft=git |
@@ -147,92 +259,153 @@ autocmd BufNewFile,BufRead *
\ if getline(1) =~ '^From \x\{40\} Mon Sep 17 00:00:00 2001$' | \ if getline(1) =~ '^From \x\{40\} Mon Sep 17 00:00:00 2001$' |
\ set filetype=gitsendemail | \ set filetype=gitsendemail |
\ endif \ endif
endif endif
" ftdetect/glsl.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
" Language: OpenGL Shading Language
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
autocmd! BufNewFile,BufRead *.glsl,*.geom,*.vert,*.frag,*.gsh,*.vsh,*.fsh,*.vs,*.fs,*.gs,*.tcs,*.tes set filetype=glsl autocmd! BufNewFile,BufRead *.glsl,*.geom,*.vert,*.frag,*.gsh,*.vsh,*.fsh,*.vs,*.fs,*.gs,*.tcs,*.tes set filetype=glsl
" vim:set sts=2 sw=2 :
endif endif
" ftdetect/gofiletype.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
" We take care to preserve the user's fileencodings and fileformats,
" because those settings are global (not buffer local), yet we want
" to override them for loading Go files, which are defined to be UTF-8.
let s:current_fileformats = '' let s:current_fileformats = ''
let s:current_fileencodings = '' let s:current_fileencodings = ''
" define fileencodings to open as utf-8 encoding even if it's ascii.
function! s:gofiletype_pre(type) function! s:gofiletype_pre(type)
let s:current_fileformats = &g:fileformats let s:current_fileformats = &g:fileformats
let s:current_fileencodings = &g:fileencodings let s:current_fileencodings = &g:fileencodings
set fileencodings=utf-8 fileformats=unix set fileencodings=utf-8 fileformats=unix
let &l:filetype = a:type let &l:filetype = a:type
endfunction endfunction
" restore fileencodings as others
function! s:gofiletype_post() function! s:gofiletype_post()
let &g:fileformats = s:current_fileformats let &g:fileformats = s:current_fileformats
let &g:fileencodings = s:current_fileencodings let &g:fileencodings = s:current_fileencodings
endfunction endfunction
au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix
au BufRead *.go call s:gofiletype_pre("go") au BufRead *.go call s:gofiletype_pre("go")
au BufReadPost *.go call s:gofiletype_post() au BufReadPost *.go call s:gofiletype_post()
au BufNewFile *.s setfiletype asm | setlocal fileencoding=utf-8 fileformat=unix au BufNewFile *.s setfiletype asm | setlocal fileencoding=utf-8 fileformat=unix
au BufRead *.s call s:gofiletype_pre("asm") au BufRead *.s call s:gofiletype_pre("asm")
au BufReadPost *.s call s:gofiletype_post() au BufReadPost *.s call s:gofiletype_post()
au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
" vim: sw=2 ts=2 et
endif endif
" ftdetect/haml.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml
autocmd BufNewFile,BufRead *.sass setf sass autocmd BufNewFile,BufRead *.sass setf sass
autocmd BufNewFile,BufRead *.scss setf scss autocmd BufNewFile,BufRead *.scss setf scss
endif endif
" ftdetect/haskell.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
au BufRead,BufNewFile *.hsc set filetype=haskell au BufRead,BufNewFile *.hsc set filetype=haskell
endif endif
" ftdetect/haxe.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haxe') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haxe') == -1
autocmd BufNewFile,BufRead *.hx setf haxe autocmd BufNewFile,BufRead *.hx setf haxe
endif endif
" ftdetect/jasmine.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1
autocmd BufNewFile,BufRead *Spec.js,*_spec.js set filetype=jasmine.javascript syntax=jasmine autocmd BufNewFile,BufRead *Spec.js,*_spec.js set filetype=jasmine.javascript syntax=jasmine
endif endif
" ftdetect/javascript.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
au BufNewFile,BufRead *.js setf javascript au BufNewFile,BufRead *.js setf javascript
au BufNewFile,BufRead *.jsm setf javascript au BufNewFile,BufRead *.jsm setf javascript
au BufNewFile,BufRead Jakefile setf javascript au BufNewFile,BufRead Jakefile setf javascript
fun! s:SelectJavascript() fun! s:SelectJavascript()
if getline(1) =~# '^#!.*/bin/\%(env\s\+\)\?node\>' if getline(1) =~# '^#!.*/bin/\%(env\s\+\)\?node\>'
set ft=javascript set ft=javascript
endif endif
endfun endfun
au BufNewFile,BufRead * call s:SelectJavascript() au BufNewFile,BufRead * call s:SelectJavascript()
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim ftdetect file
"
" Language: JSX (JavaScript)
" Maintainer: Max Wang <mxawng@gmail.com>
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Whether the .jsx extension is required.
if !exists('g:jsx_ext_required') if !exists('g:jsx_ext_required')
let g:jsx_ext_required = 1 let g:jsx_ext_required = 1
endif endif
" Whether the @jsx pragma is required.
if !exists('g:jsx_pragma_required') if !exists('g:jsx_pragma_required')
let g:jsx_pragma_required = 0 let g:jsx_pragma_required = 0
endif endif
if g:jsx_pragma_required if g:jsx_pragma_required
" Look for the @jsx pragma. It must be included in a docblock comment before " Look for the @jsx pragma. It must be included in a docblock comment before
" anything else in the file (except whitespace). " anything else in the file (except whitespace).
let s:jsx_pragma_pattern = '\%^\_s*\/\*\*\%(\_.\%(\*\/\)\@!\)*@jsx\_.\{-}\*\/' let s:jsx_pragma_pattern = '\%^\_s*\/\*\*\%(\_.\%(\*\/\)\@!\)*@jsx\_.\{-}\*\/'
let b:jsx_pragma_found = search(s:jsx_pragma_pattern, 'npw') let b:jsx_pragma_found = search(s:jsx_pragma_pattern, 'npw')
endif endif
" Whether to set the JSX filetype on *.js files.
fu! <SID>EnableJSX() fu! <SID>EnableJSX()
if g:jsx_pragma_required && !b:jsx_pragma_found | return 0 | endif if g:jsx_pragma_required && !b:jsx_pragma_found | return 0 | endif
if g:jsx_ext_required && !exists('b:jsx_ext_found') | return 0 | endif if g:jsx_ext_required && !exists('b:jsx_ext_found') | return 0 | endif
return 1 return 1
endfu endfu
autocmd BufNewFile,BufRead *.jsx let b:jsx_ext_found = 1 autocmd BufNewFile,BufRead *.jsx let b:jsx_ext_found = 1
autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx
autocmd BufNewFile,BufRead *.js autocmd BufNewFile,BufRead *.js
\ if <SID>EnableJSX() | set filetype=javascript.jsx | endif \ if <SID>EnableJSX() | set filetype=javascript.jsx | endif
endif endif
" ftdetect/json.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json') == -1
autocmd BufNewFile,BufRead *.json set filetype=json autocmd BufNewFile,BufRead *.json set filetype=json
autocmd BufNewFile,BufRead *.jsonp set filetype=json autocmd BufNewFile,BufRead *.jsonp set filetype=json
endif endif
" ftdetect/jst.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jst') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jst') == -1
au BufNewFile,BufRead *.ejs set filetype=jst au BufNewFile,BufRead *.ejs set filetype=jst
@@ -240,24 +413,42 @@ au BufNewFile,BufRead *.jst set filetype=jst
au BufNewFile,BufRead *.djs set filetype=jst au BufNewFile,BufRead *.djs set filetype=jst
au BufNewFile,BufRead *.hamljs set filetype=jst au BufNewFile,BufRead *.hamljs set filetype=jst
au BufNewFile,BufRead *.ect set filetype=jst au BufNewFile,BufRead *.ect set filetype=jst
endif endif
" ftdetect/julia.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
" NOTE: this line fixes an issue with the default system-wide lisp ftplugin
" which doesn't define b:undo_ftplugin
" (*.jt files are recognized as lisp)
au BufRead,BufNewFile *.jl let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<" au BufRead,BufNewFile *.jl let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<"
au BufRead,BufNewFile *.jl set filetype=julia au BufRead,BufNewFile *.jl set filetype=julia
endif endif
" ftdetect/kotlin.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
autocmd BufNewFile,BufRead *.kt setfiletype kotlin autocmd BufNewFile,BufRead *.kt setfiletype kotlin
autocmd BufNewFile,BufRead *.kts setfiletype kotlin autocmd BufNewFile,BufRead *.kts setfiletype kotlin
endif endif
" ftdetect/less.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
autocmd BufNewFile,BufRead *.less setf less autocmd BufNewFile,BufRead *.less setf less
endif endif
" ftdetect/liquid.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'liquid') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'liquid') == -1
" Liquid
au BufNewFile,BufRead *.liquid set ft=liquid au BufNewFile,BufRead *.liquid set ft=liquid
au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html set ft=liquid au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html set ft=liquid
au BufNewFile,BufRead *.html,*.xml,*.textile au BufNewFile,BufRead *.html,*.xml,*.textile
\ if getline(1) == '---' | set ft=liquid | endif \ if getline(1) == '---' | set ft=liquid | endif
@@ -266,188 +457,359 @@ au BufNewFile,BufRead *.markdown,*.mkd,*.mkdn,*.md
\ let b:liquid_subtype = 'markdown' | \ let b:liquid_subtype = 'markdown' |
\ set ft=liquid | \ set ft=liquid |
\ endif \ endif
" Set subtype for Shopify alternate templates
au BufNewFile,BufRead */templates/**.liquid,*/layout/**.liquid,*/snippets/**.liquid au BufNewFile,BufRead */templates/**.liquid,*/layout/**.liquid,*/snippets/**.liquid
\ let b:liquid_subtype = 'html' | \ let b:liquid_subtype = 'html' |
\ set ft=liquid | \ set ft=liquid |
endif endif
" ftdetect/mako.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mako') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mako') == -1
au BufRead,BufNewFile *.mako set filetype=mako au BufRead,BufNewFile *.mako set filetype=mako
endif endif
" ftdetect/markdown.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
autocmd BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mkd,*.mkdn " markdown filetype file
\ if &ft =~# '^\%(conf\|modula2\)$' | au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=markdown
\ set ft=markdown | au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx} set filetype=markdown
\ else |
\ setf markdown |
\ endif
endif endif
" ftdetect/mason-in-html.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
" Highlight .html files as Mason if they start with Mason tags
autocmd BufRead *.html autocmd BufRead *.html
\ if getline(1) =~ '^\(%\|<[%&].*>\)' | \ if getline(1) =~ '^\(%\|<[%&].*>\)' |
\ set filetype=mason | \ set filetype=mason |
\ endif \ endif
endif endif
" ftdetect/mustache.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1
if has("autocmd") if has("autocmd")
au BufNewFile,BufRead *.mustache,*.hogan,*.hulk,*.hjs set filetype=html.mustache syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim au BufNewFile,BufRead *.mustache,*.hogan,*.hulk,*.hjs set filetype=html.mustache syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
au BufNewFile,BufRead *.handlebars,*.hbs set filetype=html.handlebars syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim au BufNewFile,BufRead *.handlebars,*.hbs set filetype=html.handlebars syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
endif endif
endif endif
" ftdetect/nginx.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
au BufRead,BufNewFile *.nginx set ft=nginx au BufRead,BufNewFile *.nginx set ft=nginx
au BufRead,BufNewFile */etc/nginx/* set ft=nginx au BufRead,BufNewFile */etc/nginx/* set ft=nginx
au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx
au BufRead,BufNewFile nginx.conf set ft=nginx au BufRead,BufNewFile nginx.conf set ft=nginx
endif endif
" ftdetect/nim.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nim') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nim') == -1
au BufNewFile,BufRead *.nim,*.nims set filetype=nim au BufNewFile,BufRead *.nim,*.nims set filetype=nim
endif endif
" ftdetect/nix.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nix') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nix') == -1
autocmd BufNewFile,BufRead *.nix setfiletype nix autocmd BufNewFile,BufRead *.nix setfiletype nix
endif endif
" ftdetect/opencl.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'opencl') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'opencl') == -1
au! BufRead,BufNewFile *.cl set filetype=opencl au! BufRead,BufNewFile *.cl set filetype=opencl
endif endif
" ftdetect/perl11.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
function! s:DetectPerl6() function! s:DetectPerl6()
let line_no = 1 let line_no = 1
let eof = line('$') let eof = line('$')
let in_pod = 0 let in_pod = 0
while line_no <= eof while line_no <= eof
let line = getline(line_no) let line = getline(line_no)
let line_no = line_no + 1 let line_no = line_no + 1
if line =~ '^=\w' if line =~ '^=\w'
let in_pod = 1 let in_pod = 1
elseif line =~ '^=\%(end\|cut\)' elseif line =~ '^=\%(end\|cut\)'
let in_pod = 0 let in_pod = 0
elseif !in_pod elseif !in_pod
let line = substitute(line, '#.*', '', '') let line = substitute(line, '#.*', '', '')
if line =~ '^\s*$' if line =~ '^\s*$'
continue continue
endif endif
if line =~ '^\s*\%(use\s\+\)\=v6\%(\.\d\%(\.\d\)\=\)\=;' if line =~ '^\s*\%(use\s\+\)\=v6\%(\.\d\%(\.\d\)\=\)\=;'
set filetype=perl6 " we matched a 'use v6' declaration set filetype=perl6 " we matched a 'use v6' declaration
elseif line =~ '^\s*\%(\%(my\|our\)\s\+\)\=\%(unit\s\+\)\=\(module\|class\|role\|enum\|grammar\)' elseif line =~ '^\s*\%(\%(my\|our\)\s\+\)\=\%(unit\s\+\)\=\(module\|class\|role\|enum\|grammar\)'
set filetype=perl6 " we found a class, role, module, enum, or grammar declaration set filetype=perl6 " we found a class, role, module, enum, or grammar declaration
endif endif
break " we either found what we needed, or we found a non-POD, non-comment, break " we either found what we needed, or we found a non-POD, non-comment,
" non-Perl 6 indicating line, so bail out " non-Perl 6 indicating line, so bail out
endif endif
endwhile endwhile
endfunction endfunction
autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6() autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6()
autocmd BufNew,BufNewFile,BufRead *.nqp setf perl6 autocmd BufNew,BufNewFile,BufRead *.nqp setf perl6
endif endif
" ftdetect/pgsql.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pgsql') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pgsql') == -1
" postgreSQL
au BufNewFile,BufRead *.pgsql setf pgsql au BufNewFile,BufRead *.pgsql setf pgsql
endif endif
" ftdetect/plantuml.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'plantuml') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'plantuml') == -1
" Vim ftdetect file
" Language: PlantUML
" Maintainer: Aaron C. Meadows < language name at shadowguarddev dot com>
" Last Change: 19-Jun-2012
" Version: 0.1
if did_filetype() if did_filetype()
finish finish
endif endif
autocmd BufRead,BufNewFile * :if getline(1) =~ '^.*startuml.*$'| setfiletype plantuml | set filetype=plantuml | endif autocmd BufRead,BufNewFile * :if getline(1) =~ '^.*startuml.*$'| setfiletype plantuml | set filetype=plantuml | endif
autocmd BufRead,BufNewFile *.pu,*.uml,*.plantuml setfiletype plantuml | set filetype=plantuml autocmd BufRead,BufNewFile *.pu,*.uml,*.plantuml setfiletype plantuml | set filetype=plantuml
endif endif
" ftdetect/proto.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'protobuf') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'protobuf') == -1
autocmd BufNewFile,BufRead *.proto setfiletype proto autocmd BufNewFile,BufRead *.proto setfiletype proto
endif endif
" ftdetect/ps1.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1
" Vim ftdetect plugin file
" Language: Windows PowerShell
" Maintainer: Peter Provost <peter@provost.org>
" Version: 2.10
" Project Repository: https://github.com/PProvost/vim-ps1
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327
"
au BufNewFile,BufRead *.ps1 set ft=ps1 au BufNewFile,BufRead *.ps1 set ft=ps1
au BufNewFile,BufRead *.psd1 set ft=ps1 au BufNewFile,BufRead *.psd1 set ft=ps1
au BufNewFile,BufRead *.psm1 set ft=ps1 au BufNewFile,BufRead *.psm1 set ft=ps1
endif endif
" ftdetect/ps1xml.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1
" Vim ftdetect plugin file
" Language: Windows PowerShell
" Maintainer: Peter Provost <peter@provost.org>
" Version: 2.10
" Project Repository: https://github.com/PProvost/vim-ps1
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327
au BufNewFile,BufRead *.ps1xml set ft=ps1xml au BufNewFile,BufRead *.ps1xml set ft=ps1xml
endif endif
" ftdetect/pug.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pug') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pug') == -1
" Pug
autocmd BufNewFile,BufReadPost *.pug set filetype=pug autocmd BufNewFile,BufReadPost *.pug set filetype=pug
" Jade
autocmd BufNewFile,BufReadPost *.jade set filetype=pug autocmd BufNewFile,BufReadPost *.jade set filetype=pug
endif endif
" ftdetect/puppet.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
au! BufRead,BufNewFile *.pp setfiletype puppet au! BufRead,BufNewFile *.pp setfiletype puppet
au! BufRead,BufNewFile Puppetfile setfiletype ruby au! BufRead,BufNewFile Puppetfile setfiletype ruby
endif endif
" ftdetect/purescript.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'purescript') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'purescript') == -1
au BufNewFile,BufRead *.purs setf purescript au BufNewFile,BufRead *.purs setf purescript
au FileType purescript let &l:commentstring='{--%s--}' au FileType purescript let &l:commentstring='{--%s--}'
endif endif
" ftdetect/qml.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
autocmd BufRead,BufNewFile *.qml setfiletype qml autocmd BufRead,BufNewFile *.qml setfiletype qml
endif endif
" ftdetect/ruby.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
" Officially distributed filetypes
" Support functions {{{
function! s:setf(filetype) abort function! s:setf(filetype) abort
if &filetype !=# a:filetype if &filetype !=# a:filetype
let &filetype = a:filetype let &filetype = a:filetype
endif endif
endfunction endfunction
func! s:StarSetf(ft) func! s:StarSetf(ft)
if expand("<amatch>") !~ g:ft_ignore_pat if expand("<amatch>") !~ g:ft_ignore_pat
exe 'setf ' . a:ft exe 'setf ' . a:ft
endif endif
endfunc endfunc
" }}}
" HTML with Ruby - eRuby
au BufNewFile,BufRead *.erb,*.rhtml call s:setf('eruby') au BufNewFile,BufRead *.erb,*.rhtml call s:setf('eruby')
" Interactive Ruby shell
au BufNewFile,BufRead .irbrc,irbrc call s:setf('ruby') au BufNewFile,BufRead .irbrc,irbrc call s:setf('ruby')
" Ruby
au BufNewFile,BufRead *.rb,*.rbw,*.gemspec call s:setf('ruby') au BufNewFile,BufRead *.rb,*.rbw,*.gemspec call s:setf('ruby')
" Rackup
au BufNewFile,BufRead *.ru call s:setf('ruby') au BufNewFile,BufRead *.ru call s:setf('ruby')
" Bundler
au BufNewFile,BufRead Gemfile call s:setf('ruby') au BufNewFile,BufRead Gemfile call s:setf('ruby')
" Ruby on Rails
au BufNewFile,BufRead *.builder,*.rxml,*.rjs,*.ruby call s:setf('ruby') au BufNewFile,BufRead *.builder,*.rxml,*.rjs,*.ruby call s:setf('ruby')
" Rakefile
au BufNewFile,BufRead [rR]akefile,*.rake call s:setf('ruby') au BufNewFile,BufRead [rR]akefile,*.rake call s:setf('ruby')
au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby') au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby')
" TODO: does anyone still use Rantfiles? Remove for Vim 8?
" Rantfile
au BufNewFile,BufRead [rR]antfile,*.rant call s:setf('ruby') au BufNewFile,BufRead [rR]antfile,*.rant call s:setf('ruby')
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
endif endif
" ftdetect/ruby_extra.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
" All other filetypes
" Support functions {{{
function! s:setf(filetype) abort function! s:setf(filetype) abort
if &filetype !=# a:filetype if &filetype !=# a:filetype
let &filetype = a:filetype let &filetype = a:filetype
endif endif
endfunction endfunction
" }}}
" Appraisal
au BufNewFile,BufRead Appraisals call s:setf('ruby') au BufNewFile,BufRead Appraisals call s:setf('ruby')
" Autotest
au BufNewFile,BufRead .autotest call s:setf('ruby') au BufNewFile,BufRead .autotest call s:setf('ruby')
" Buildr Buildfile
au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby') au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby')
" Capistrano
au BufNewFile,BufRead Capfile,*.cap call s:setf('ruby') au BufNewFile,BufRead Capfile,*.cap call s:setf('ruby')
" Chef
au BufNewFile,BufRead Cheffile call s:setf('ruby') au BufNewFile,BufRead Cheffile call s:setf('ruby')
au BufNewFile,BufRead Berksfile call s:setf('ruby') au BufNewFile,BufRead Berksfile call s:setf('ruby')
" CocoaPods
au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby') au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
" Guard
au BufNewFile,BufRead Guardfile,.Guardfile call s:setf('ruby') au BufNewFile,BufRead Guardfile,.Guardfile call s:setf('ruby')
" Jbuilder
au BufNewFile,BufRead *.jbuilder call s:setf('ruby') au BufNewFile,BufRead *.jbuilder call s:setf('ruby')
" Kitchen Sink
au BufNewFile,BufRead KitchenSink call s:setf('ruby') au BufNewFile,BufRead KitchenSink call s:setf('ruby')
" Opal
au BufNewFile,BufRead *.opal call s:setf('ruby') au BufNewFile,BufRead *.opal call s:setf('ruby')
" Pry config
au BufNewFile,BufRead .pryrc call s:setf('ruby') au BufNewFile,BufRead .pryrc call s:setf('ruby')
" Puppet librarian
au BufNewFile,BufRead Puppetfile call s:setf('ruby') au BufNewFile,BufRead Puppetfile call s:setf('ruby')
" Rabl
au BufNewFile,BufRead *.rabl call s:setf('ruby') au BufNewFile,BufRead *.rabl call s:setf('ruby')
" Routefile
au BufNewFile,BufRead [rR]outefile call s:setf('ruby') au BufNewFile,BufRead [rR]outefile call s:setf('ruby')
au BufNewFile,BufRead .simplecov call s:setf('ruby)
" SimpleCov
au BufNewFile,BufRead .simplecov call s:setf('ruby')
" Thor
au BufNewFile,BufRead [tT]horfile,*.thor call s:setf('ruby') au BufNewFile,BufRead [tT]horfile,*.thor call s:setf('ruby')
" Vagrant
au BufNewFile,BufRead [vV]agrantfile call s:setf('ruby') au BufNewFile,BufRead [vV]agrantfile call s:setf('ruby')
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
endif endif
" ftdetect/rust.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
au BufRead,BufNewFile *.rs set filetype=rust au BufRead,BufNewFile *.rs set filetype=rust
endif endif
" ftdetect/sbt.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sbt') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sbt') == -1
" Vim detect file
" Language: sbt
" Maintainer: Derek Wyatt <derek@{myfirstname}{mylastname}.org>
" Last Change: 2012 Jan 19
au BufRead,BufNewFile *.sbt set filetype=sbt.scala au BufRead,BufNewFile *.sbt set filetype=sbt.scala
endif endif
" ftdetect/scala.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scala') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scala') == -1
fun! s:DetectScala() fun! s:DetectScala()
@@ -455,23 +817,39 @@ fun! s:DetectScala()
set filetype=scala set filetype=scala
endif endif
endfun endfun
au BufRead,BufNewFile *.scala set filetype=scala au BufRead,BufNewFile *.scala set filetype=scala
au BufRead,BufNewFile * call s:DetectScala() au BufRead,BufNewFile * call s:DetectScala()
" Install vim-sbt for additional syntax highlighting.
au BufRead,BufNewFile *.sbt setfiletype sbt.scala au BufRead,BufNewFile *.sbt setfiletype sbt.scala
endif endif
" ftdetect/slim.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1
autocmd BufNewFile,BufRead *.slim setf slim autocmd BufNewFile,BufRead *.slim setf slim
endif endif
" ftdetect/solidity.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'solidity') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'solidity') == -1
au BufNewFile,BufRead *.sol setf solidity au BufNewFile,BufRead *.sol setf solidity
endif endif
" ftdetect/stylus.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'stylus') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'stylus') == -1
" Stylus
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
endif endif
" ftdetect/swift.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
autocmd BufNewFile,BufRead *.swift set filetype=swift autocmd BufNewFile,BufRead *.swift set filetype=swift
@@ -480,12 +858,16 @@ function! s:Swift()
if !empty(&filetype) if !empty(&filetype)
return return
endif endif
let line = getline(1) let line = getline(1)
if line =~ "^#!.*swift" if line =~ "^#!.*swift"
setfiletype swift setfiletype swift
endif endif
endfunction endfunction
endif endif
" ftdetect/systemd.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'systemd') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'systemd') == -1
au BufNewFile,BufRead *.automount set filetype=systemd au BufNewFile,BufRead *.automount set filetype=systemd
@@ -496,39 +878,74 @@ au BufNewFile,BufRead *.socket set filetype=systemd
au BufNewFile,BufRead *.swap set filetype=systemd au BufNewFile,BufRead *.swap set filetype=systemd
au BufNewFile,BufRead *.target set filetype=systemd au BufNewFile,BufRead *.target set filetype=systemd
au BufNewFile,BufRead *.timer set filetype=systemd au BufNewFile,BufRead *.timer set filetype=systemd
endif endif
" ftdetect/textile.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'textile') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'textile') == -1
" textile.vim
"
" Tim Harper (tim.theenchanter.com)
" Force filetype to be textile even if already set
" This will override the system ftplugin/changelog
" set on some distros
au BufRead,BufNewFile *.textile set filetype=textile au BufRead,BufNewFile *.textile set filetype=textile
endif endif
" ftdetect/thrift.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'thrift') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'thrift') == -1
au BufNewFile,BufRead *.thrift setlocal filetype=thrift au BufNewFile,BufRead *.thrift setlocal filetype=thrift
endif endif
" ftdetect/tmux.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal filetype=tmux autocmd BufNewFile,BufRead {.,}tmux*.conf* setfiletype tmux
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal commentstring=#\ %s
endif endif
" ftdetect/toml.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1
autocmd BufNewFile,BufRead *.toml set filetype=toml autocmd BufNewFile,BufRead *.toml set filetype=toml
" Rust uses Cargo.toml and Cargo.lock (both are toml files).
autocmd BufNewFile,BufRead Cargo.lock set filetype=toml autocmd BufNewFile,BufRead Cargo.lock set filetype=toml
endif endif
" ftdetect/typescript.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
autocmd BufNewFile,BufRead *.ts,*.tsx setlocal filetype=typescript autocmd BufNewFile,BufRead *.ts,*.tsx setlocal filetype=typescript
endif endif
" ftdetect/vala.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1
autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
au BufRead,BufNewFile *.vala,*.vapi setfiletype vala au BufRead,BufNewFile *.vala,*.vapi setfiletype vala
endif endif
" ftdetect/vcl.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vcl') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vcl') == -1
au BufRead,BufNewFile *.vcl set filetype=vcl au BufRead,BufNewFile *.vcl set filetype=vcl
endif endif
" ftdetect/velocity.vim
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vm') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vm') == -1
au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity
endif endif

View File

@@ -11,6 +11,26 @@ endif
runtime! ftplugin/html.vim runtime! ftplugin/html.vim
let b:did_ftplugin = 1 let b:did_ftplugin = 1
setlocal iskeyword+=@-@ setlocal suffixesadd=.blade.php,.php
setlocal includeexpr=substitute(v:fname,'\\.','/','g')
setlocal path+=resources/views;
setlocal include=\\w\\@<!@\\%(include\\\|extends\\)
setlocal define=\\w\\@<!@\\%(yield\\\|stack\\)
setlocal commentstring={{--%s--}}
setlocal comments+=s:{{--,m:\ \ \ \ ,e:--}}
if exists('loaded_matchit') && exists('b:match_words')
" Append to html matchit words
let b:match_words .= ',' .
\ '@\%(section\|if\|unless\|foreach\|forelse\|for\|while\|push\|can\|cannot\|hasSection\|php\|verbatim\)\>' .
\ ':' .
\ '@\%(else\|elseif\|empty\|break\|continue\|elsecan\|elsecannot\)\>' .
\ ':' .
\ '@\%(end\w\+\|stop\|show\|append\|overwrite\)' .
\ ',{:},\[:\],(:)'
let b:match_skip = 'synIDattr(synID(line("."), col("."), 0), "name") !=# "bladeKeyword"'
let b:match_ignorecase = 0
endif
endif endif

View File

@@ -1,13 +1,13 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
" Vim filetype plugin file " Vim filetype plugin file
" Language: Clojure " Language: Clojure
" Author: Meikel Brandmeyer <mb@kotka.de> " Author: Meikel Brandmeyer <mb@kotka.de>
" "
" Maintainer: Sung Pae <self@sungpae.com> " Maintainer: Sung Pae <self@sungpae.com>
" URL: https://github.com/guns/vim-clojure-static " URL: https://github.com/guns/vim-clojure-static
" License: Same as Vim " License: Same as Vim
" Last Change: %%RELEASE_DATE%% " Last Change: %%RELEASE_DATE%%
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@@ -84,9 +84,9 @@ endif
" Win32 can filter files in the browse dialog " Win32 can filter files in the browse dialog
if has("gui_win32") && !exists("b:browsefilter") if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "Clojure Source Files (*.clj)\t*.clj\n" . let b:browsefilter = "Clojure Source Files (*.clj)\t*.clj\n" .
\ "ClojureScript Source Files (*.cljs)\t*.cljs\n" . \ "ClojureScript Source Files (*.cljs)\t*.cljs\n" .
\ "Java Source Files (*.java)\t*.java\n" . \ "Java Source Files (*.java)\t*.java\n" .
\ "All Files (*.*)\t*.*\n" \ "All Files (*.*)\t*.*\n"
let b:undo_ftplugin .= ' | unlet! b:browsefilter' let b:undo_ftplugin .= ' | unlet! b:browsefilter'
endif endif

View File

@@ -15,7 +15,7 @@ call coffee#CoffeeSetUpVariables()
setlocal formatoptions-=t formatoptions+=croql setlocal formatoptions-=t formatoptions+=croql
setlocal comments=:# commentstring=#\ %s setlocal comments=:# commentstring=#\ %s
setlocal omnifunc=javascriptcomplete#CompleteJS setlocal omnifunc=javascriptcomplete#CompleteJS
setlocal suffixesadd+=coffee setlocal suffixesadd+=.coffee
" Create custom augroups. " Create custom augroups.
augroup CoffeeBufUpdate | augroup END augroup CoffeeBufUpdate | augroup END

View File

@@ -56,6 +56,6 @@ let &l:path =
setlocal includeexpr=GetElixirFilename(v:fname) setlocal includeexpr=GetElixirFilename(v:fname)
setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl
setlocal formatoptions-=t formatoptions+=croqlj silent! setlocal formatoptions-=t formatoptions+=croqlj
endif endif

View File

@@ -1,11 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
" Language: ember-script " Language: ember-script
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com> " Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
" URL: http://github.com/heartsentwined/vim-ember-script " URL: http://github.com/yalesov/vim-ember-script
" Version: 1.0.1 " Version: 1.0.4
" Last Change: 2013 Apr 17 " Last Change: 2016 Jul 6
" License: GPL-3.0 " License: ISC
setlocal tabstop=2 setlocal tabstop=2
setlocal softtabstop=2 setlocal softtabstop=2
@@ -14,7 +14,11 @@ setlocal smarttab
setlocal expandtab setlocal expandtab
setlocal smartindent setlocal smartindent
setlocal formatoptions-=t formatoptions+=croqlj if v:version < 703
setlocal formatoptions-=t formatoptions+=croql
else
setlocal formatoptions-=t formatoptions+=croqlj
endif
setlocal comments=:# setlocal comments=:#
setlocal commentstring=#\ %s setlocal commentstring=#\ %s

View File

@@ -1,11 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
" Language: emblem " Language: emblem
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com> " Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
" URL: http://github.com/heartsentwined/vim-emblem " URL: http://github.com/yalesov/vim-emblem
" Version: 1.2.0 " Version: 2.0.1
" Last Change: 2013 Apr 22 " Last Change: 2016 Jul 6
" License: GPL-3.0 " License: ISC
setlocal tabstop=2 setlocal tabstop=2
setlocal softtabstop=2 setlocal softtabstop=2

View File

@@ -1,54 +0,0 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
" Vim filetype plugin
" Language: Markdown
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2013 May 30
if exists("b:did_ftplugin")
finish
endif
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=<!--%s-->
setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= "|setl cms< com< fo< flp<"
else
let b:undo_ftplugin = "setl cms< com< fo< flp<"
endif
function! MarkdownFold()
let line = getline(v:lnum)
" Regular headers
let depth = match(line, '\(^#\+\)\@<=\( .*$\)\@=')
if depth > 0
return ">" . depth
endif
" Setext style headings
let nextline = getline(v:lnum + 1)
if (line =~ '^.\+$') && (nextline =~ '^=\+$')
return ">1"
endif
if (line =~ '^.\+$') && (nextline =~ '^-\+$')
return ">2"
endif
return "="
endfunction
if has("folding") && exists("g:markdown_folding")
setlocal foldexpr=MarkdownFold()
setlocal foldmethod=expr
let b:undo_ftplugin .= " foldexpr< foldmethod<"
endif
" vim:set sw=2:
endif

View File

@@ -77,20 +77,20 @@ function! s:query_path(root) abort
let prefix = '' let prefix = ''
endif endif
if &shellxquote == "'" if &shellxquote == "'"
let path_check = prefix.'ruby -e "' . code . '"' let path_check = prefix.'ruby -e --disable-gems"' . code . '"'
else else
let path_check = prefix."ruby -e '" . code . "'" let path_check = prefix."ruby -e --disable-gems'" . code . "'"
endif endif
let cd = haslocaldir() ? 'lcd' : 'cd' let cd = haslocaldir() ? 'lcd' : 'cd'
let cwd = getcwd() let cwd = fnameescape(getcwd())
try try
exe cd fnameescape(a:root) exe cd fnameescape(a:root)
let path = split(system(path_check),',') let path = split(system(path_check),',')
exe cd fnameescape(cwd) exe cd cwd
return path return path
finally finally
exe cd fnameescape(cwd) exe cd cwd
endtry endtry
endfunction endfunction

View File

@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
" Description: Vim syntax file for Rust " Description: Vim syntax file for Rust
" Maintainer: Chris Morgan <me@chrismorgan.info> " Maintainer: Chris Morgan <me@chrismorgan.info>
" Maintainer: Kevin Ballard <kevin@sb.org> " Maintainer: Kevin Ballard <kevin@sb.org>
" Last Change: January 29, 2015 " Last Change: June 08, 2016
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@@ -14,6 +14,9 @@ let b:did_ftplugin = 1
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
augroup rust.vim
autocmd!
" Variables {{{1 " Variables {{{1
" The rust source code at present seems to typically omit a leader on /*! " The rust source code at present seems to typically omit a leader on /*!
@@ -56,7 +59,33 @@ if exists("g:loaded_delimitMate")
if exists("b:delimitMate_excluded_regions") if exists("b:delimitMate_excluded_regions")
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
endif endif
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
let s:delimitMate_extra_excluded_regions = ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
" For this buffer, when delimitMate issues the `User delimitMate_map`
" event in the autocommand system, add the above-defined extra excluded
" regions to delimitMate's state, if they have not already been added.
autocmd User <buffer>
\ if expand('<afile>') ==# 'delimitMate_map' && match(
\ delimitMate#Get("excluded_regions"),
\ s:delimitMate_extra_excluded_regions) == -1
\| let b:delimitMate_excluded_regions =
\ delimitMate#Get("excluded_regions")
\ . s:delimitMate_extra_excluded_regions
\|endif
" For this buffer, when delimitMate issues the `User delimitMate_unmap`
" event in the autocommand system, delete the above-defined extra excluded
" regions from delimitMate's state (the deletion being idempotent and
" having no effect if the extra excluded regions are not present in the
" targeted part of delimitMate's state).
autocmd User <buffer>
\ if expand('<afile>') ==# 'delimitMate_unmap'
\| let b:delimitMate_excluded_regions = substitute(
\ delimitMate#Get("excluded_regions"),
\ '\C\V' . s:delimitMate_extra_excluded_regions,
\ '', 'g')
\|endif
endif endif
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0 if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
@@ -161,10 +190,13 @@ let b:undo_ftplugin = "
\|ounmap <buffer> ]] \|ounmap <buffer> ]]
\|set matchpairs-=<:> \|set matchpairs-=<:>
\|unlet b:match_skip \|unlet b:match_skip
\|augroup! rust.vim
\" \"
" }}}1 " }}}1
augroup END
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo

5
ftplugin/tmux.vim Normal file
View File

@@ -0,0 +1,5 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1
setlocal commentstring=#\ %s
endif

View File

@@ -7,13 +7,29 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'blade') == -1
if exists("b:did_indent") if exists("b:did_indent")
finish finish
endif endif
runtime! indent/html.vim runtime! indent/html.vim
let s:htmlindent = &indentexpr
unlet! b:did_indent unlet! b:did_indent
runtime! indent/php.vim
let s:phpindent = &indentexpr
unlet! b:did_indent
let b:did_indent = 1 let b:did_indent = 1
" Doesn't include 'foreach' and 'forelse' because these already get matched by 'for'.
let s:directives_start = 'if\|else\|unless\|for\|while\|empty\|push\|section\|can\|hasSection\|verbatim'
let s:directives_end = 'else\|end\|empty\|show\|stop\|append\|overwrite'
if exists('g:blade_custom_directives_pairs')
let s:directives_start .= '\|' . join(keys(g:blade_custom_directives_pairs), '\|')
let s:directives_end .= '\|' . join(values(g:blade_custom_directives_pairs), '\|')
endif
setlocal autoindent setlocal autoindent
setlocal indentexpr=GetBladeIndent() setlocal indentexpr=GetBladeIndent()
setlocal indentkeys=o,O,*<Return>,<>>,!^F,=@else,=@end,=@empty,=@show exe "setlocal indentkeys=o,O,<>>,!^F,0=}},0=!!},=@" . substitute(s:directives_end, '\\|', ',=@', 'g')
" Only define the function once. " Only define the function once.
if exists("*GetBladeIndent") if exists("*GetBladeIndent")
@@ -29,27 +45,35 @@ function! GetBladeIndent()
let line = substitute(substitute(getline(lnum), '\s\+$', '', ''), '^\s\+', '', '') let line = substitute(substitute(getline(lnum), '\s\+$', '', ''), '^\s\+', '', '')
let cline = substitute(substitute(getline(v:lnum), '\s\+$', '', ''), '^\s\+', '', '') let cline = substitute(substitute(getline(v:lnum), '\s\+$', '', ''), '^\s\+', '', '')
let indent = indent(lnum) let indent = indent(lnum)
let cindent = indent(v:lnum) if cline =~# '@\%(' . s:directives_end . '\)' ||
if cline =~# '@\%(else\|elseif\|empty\|end\|show\)' \ cline =~# '\%(<?.*\)\@<!?>\|\%({{.*\)\@<!}}\|\%({!!.*\)\@<!!!}'
let indent = indent - &sw let indent = indent - &sw
elseif line =~# '<?\%(.*?>\)\@!\|@php\%(\s*(\)\@!'
let indent = indent + &sw
else else
if exists("*GetBladeIndentCustom") if exists("*GetBladeIndentCustom")
let hindent = GetBladeIndentCustom() let hindent = GetBladeIndentCustom()
" Don't use PHP indentation if line is a comment
elseif line !~# '^\s*\%(#\|//\)\|\*/\s*$' && (
\ searchpair('@include\%(If\)\?\s*(', '', ')', 'bWr') ||
\ searchpair('{!!', '', '!!}', 'bWr') ||
\ searchpair('{{', '', '}}', 'bWr') ||
\ searchpair('<?', '', '?>', 'bWr') ||
\ searchpair('@php\%(\s*(\)\@!', '', '@endphp', 'bWr') )
execute 'let hindent = ' . s:phpindent
else else
let hindent = HtmlIndent() execute 'let hindent = ' . s:htmlindent
endif endif
if hindent > -1 if hindent > -1
let indent = hindent let indent = hindent
endif endif
endif endif
let increase = indent + &sw let increase = indent + &sw
if indent = indent(lnum)
let indent = cindent <= indent ? -1 : increase
endif
if line =~# '@\%(section\)\%(.*\s*@end\)\@!' && line !~# '@\%(section\)\s*([^,]*)' if line =~# '@\%(section\)\%(.*@end\)\@!' && line !~# '@\%(section\)\s*([^,]*)'
return indent return indent
elseif line =~# '@\%(if\|elseif\|else\|unless\|foreach\|forelse\|for\|while\|empty\|push\|section\|can\)\%(.*\s*@end\)\@!' elseif line =~# '@\%(' . s:directives_start . '\)\%(.*@end\|.*@stop\)\@!' ||
\ line =~# '{{\%(.*}}\)\@!' || line =~# '{!!\%(.*!!}\)\@!'
return increase return increase
else else
return indent return indent

View File

@@ -1,14 +1,14 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
" Vim indent file " Vim indent file
" Language: Clojure " Language: Clojure
" Author: Meikel Brandmeyer <mb@kotka.de> " Author: Meikel Brandmeyer <mb@kotka.de>
" URL: http://kotka.de/projects/clojure/vimclojure.html " URL: http://kotka.de/projects/clojure/vimclojure.html
" "
" Maintainer: Sung Pae <self@sungpae.com> " Maintainer: Sung Pae <self@sungpae.com>
" URL: https://github.com/guns/vim-clojure-static " URL: https://github.com/guns/vim-clojure-static
" License: Same as Vim " License: Same as Vim
" Last Change: %%RELEASE_DATE%% " Last Change: %%RELEASE_DATE%%
if exists("b:did_indent") if exists("b:did_indent")
finish finish
@@ -79,8 +79,8 @@ if exists("*searchpairpos")
" patterns. " patterns.
function! s:match_one(patterns, string) function! s:match_one(patterns, string)
let list = type(a:patterns) == type([]) let list = type(a:patterns) == type([])
\ ? a:patterns \ ? a:patterns
\ : map(split(a:patterns, ','), '"^" . v:val . "$"') \ : map(split(a:patterns, ','), '"^" . v:val . "$"')
for pat in list for pat in list
if a:string =~# pat | return 1 | endif if a:string =~# pat | return 1 | endif
endfor endfor
@@ -189,6 +189,16 @@ if exists("*searchpairpos")
return val return val
endfunction endfunction
" Check if form is a reader conditional, that is, it is prefixed by #?
" or @#?
function! s:is_reader_conditional_special_case(position)
if getline(a:position[0])[a:position[1] - 3 : a:position[1] - 2] == "#?"
return 1
endif
return 0
endfunction
" Returns 1 for opening brackets, -1 for _anything else_. " Returns 1 for opening brackets, -1 for _anything else_.
function! s:bracket_type(char) function! s:bracket_type(char)
return stridx('([{', a:char) > -1 ? 1 : -1 return stridx('([{', a:char) > -1 ? 1 : -1
@@ -256,6 +266,10 @@ if exists("*searchpairpos")
return [paren[0], paren[1] + &shiftwidth - 1] return [paren[0], paren[1] + &shiftwidth - 1]
endif endif
if s:is_reader_conditional_special_case(paren)
return paren
endif
" In case we are at the last character, we use the paren position. " In case we are at the last character, we use the paren position.
if col("$") - 1 == paren[1] if col("$") - 1 == paren[1]
return paren return paren

View File

@@ -1,11 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
" Language: ember-script " Language: ember-script
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com> " Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
" URL: http://github.com/heartsentwined/vim-ember-script " URL: http://github.com/yalesov/vim-ember-script
" Version: 1.0.1 " Version: 1.0.4
" Last Change: 2013 Apr 17 " Last Change: 2016 Jul 6
" License: GPL-3.0 " License: ISC
if exists('b:did_indent') if exists('b:did_indent')
finish finish

View File

@@ -1,10 +1,10 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
" Language: emblem " Language: emblem
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com> " Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
" URL: http://github.com/heartsentwined/vim-emblem " URL: http://github.com/yalesov/vim-emblem
" Version: 1.2.0 " Version: 2.0.1
" Last Change: 2013 Apr 22 " Last Change: 2016 Jul 6
" License: GPL-3.0 " License: ISC
endif endif

View File

@@ -11,7 +11,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
" - general line splits (line ends in an operator) " - general line splits (line ends in an operator)
if exists("b:did_indent") if exists("b:did_indent")
finish finish
endif endif
let b:did_indent = 1 let b:did_indent = 1
@@ -23,60 +23,60 @@ setlocal indentexpr=GoIndent(v:lnum)
setlocal indentkeys+=<:>,0=},0=) setlocal indentkeys+=<:>,0=},0=)
if exists("*GoIndent") if exists("*GoIndent")
finish finish
endif endif
" use shiftwidth function only if it's available " use shiftwidth function only if it's available
if exists('*shiftwidth') if exists('*shiftwidth')
func s:sw() func s:sw()
return shiftwidth() return shiftwidth()
endfunc endfunc
else else
func s:sw() func s:sw()
return &sw return &sw
endfunc endfunc
endif endif
function! GoIndent(lnum) function! GoIndent(lnum)
let prevlnum = prevnonblank(a:lnum-1) let prevlnum = prevnonblank(a:lnum-1)
if prevlnum == 0 if prevlnum == 0
" top of file " top of file
return 0 return 0
endif endif
" grab the previous and current line, stripping comments. " grab the previous and current line, stripping comments.
let prevl = substitute(getline(prevlnum), '//.*$', '', '') let prevl = substitute(getline(prevlnum), '//.*$', '', '')
let thisl = substitute(getline(a:lnum), '//.*$', '', '') let thisl = substitute(getline(a:lnum), '//.*$', '', '')
let previ = indent(prevlnum) let previ = indent(prevlnum)
let ind = previ let ind = previ
if prevl =~ '[({]\s*$' if prevl =~ '[({]\s*$'
" previous line opened a block " previous line opened a block
let ind += s:sw() let ind += s:sw()
endif endif
if prevl =~# '^\s*\(case .*\|default\):$' if prevl =~# '^\s*\(case .*\|default\):$'
" previous line is part of a switch statement " previous line is part of a switch statement
let ind += s:sw() let ind += s:sw()
endif endif
" TODO: handle if the previous line is a label. " TODO: handle if the previous line is a label.
if thisl =~ '^\s*[)}]' if thisl =~ '^\s*[)}]'
" this line closed a block " this line closed a block
let ind -= s:sw() let ind -= s:sw()
endif endif
" Colons are tricky. " Colons are tricky.
" We want to outdent if it's part of a switch ("case foo:" or "default:"). " We want to outdent if it's part of a switch ("case foo:" or "default:").
" We ignore trying to deal with jump labels because (a) they're rare, and " We ignore trying to deal with jump labels because (a) they're rare, and
" (b) they're hard to disambiguate from a composite literal key. " (b) they're hard to disambiguate from a composite literal key.
if thisl =~# '^\s*\(case .*\|default\):$' if thisl =~# '^\s*\(case .*\|default\):$'
let ind -= s:sw() let ind -= s:sw()
endif endif
return ind return ind
endfunction endfunction
" vim:ts=4:sw=4:et " vim: sw=2 ts=2 et
endif endif

View File

@@ -45,4 +45,6 @@ function! GetGoHTMLTmplIndent(lnum)
return ind return ind
endfunction endfunction
" vim: sw=2 ts=2 et
endif endif

View File

@@ -19,7 +19,7 @@ setlocal nosmartindent
setlocal indentexpr=GetJavascriptIndent() setlocal indentexpr=GetJavascriptIndent()
setlocal formatexpr=Fixedgq(v:lnum,v:count) setlocal formatexpr=Fixedgq(v:lnum,v:count)
setlocal indentkeys=0{,0},0),0],0\,*<Return>,:,!^F,o,O,e setlocal indentkeys=0{,0},0),0],0\,*<Return>,:,!^F,o,O,e
setlocal cinoptions+=j1,J1 setlocal cinoptions+=j1,J1,c1
" Only define the function once. " Only define the function once.
if exists("*GetJavascriptIndent") if exists("*GetJavascriptIndent")
@@ -45,7 +45,7 @@ endif
let s:line_pre = '^\s*\%(\/\*.*\*\/\s*\)*' let s:line_pre = '^\s*\%(\/\*.*\*\/\s*\)*'
let s:js_keywords = s:line_pre . '\%(break\|import\|export\|catch\|const\|continue\|debugger\|delete\|do\|else\|finally\|for\|function\|if\|in\|instanceof\|let\|new\|return\|switch\|this\|throw\|try\|typeof\|var\|void\|while\|with\)\>\C' let s:js_keywords = s:line_pre . '\%(break\|import\|export\|catch\|const\|continue\|debugger\|delete\|do\|else\|finally\|for\|function\|if\|in\|instanceof\|let\|new\|return\|switch\|this\|throw\|try\|typeof\|var\|void\|while\|with\)\>\C'
let s:expr_case = s:line_pre . '\%(case\s\+[^\:]*\|default\)\s*:\s*\C' let s:expr_case = s:line_pre . '\%(\%(case\>.*\)\|default\)\s*:\C'
" Regex of syntax group names that are or delimit string or are comments. " Regex of syntax group names that are or delimit string or are comments.
let s:syng_strcom = '\%(string\|regex\|special\|doc\|comment\|template\)\c' let s:syng_strcom = '\%(string\|regex\|special\|doc\|comment\|template\)\c'
@@ -79,7 +79,7 @@ function s:Onescope(lnum)
end end
let mypos = col('.') let mypos = col('.')
call cursor(a:lnum, 1) call cursor(a:lnum, 1)
if search('\<\%(while\|for\|if\)\>\s*(\C', 'ce', a:lnum) > 0 && if search('.*\zs\<\%(while\|for\|if\)\>\s*(\C', 'ce', a:lnum) > 0 &&
\ s:lookForParens('(', ')', 'W', a:lnum) > 0 && \ s:lookForParens('(', ')', 'W', a:lnum) > 0 &&
\ col('.') == strlen(s:RemoveTrailingComments(getline(a:lnum))) \ col('.') == strlen(s:RemoveTrailingComments(getline(a:lnum)))
call cursor(a:lnum, mypos) call cursor(a:lnum, mypos)
@@ -142,7 +142,7 @@ function s:GetMSL(lnum, in_one_line_scope)
" Start on the line we're at and use its indent. " Start on the line we're at and use its indent.
let msl = a:lnum let msl = a:lnum
let lnum = s:PrevNonBlankNonString(a:lnum - 1) let lnum = s:PrevNonBlankNonString(a:lnum - 1)
while lnum > 0 while lnum > 0 && !s:Match(msl,s:line_pre . '[])}]')
" If we have a continuation line, or we're in a string, use line as MSL. " If we have a continuation line, or we're in a string, use line as MSL.
" Otherwise, terminate search as we have found our MSL already. " Otherwise, terminate search as we have found our MSL already.
let line = getline(lnum) let line = getline(lnum)
@@ -314,6 +314,7 @@ function GetJavascriptIndent()
" 3.1. Setup {{{1 " 3.1. Setup {{{1
" ---------- " ----------
" Set up variables for restoring position in file. Could use v:lnum here. " Set up variables for restoring position in file. Could use v:lnum here.
" Avoid use of line('.')/col('.') type functions as the curpos can change
let vcol = col('.') let vcol = col('.')
" 3.2. Work on the current line {{{1 " 3.2. Work on the current line {{{1
@@ -336,21 +337,25 @@ function GetJavascriptIndent()
if line !~ '^\%(\/\*\|\s*\/\/\)' && s:IsInComment(v:lnum, 1) if line !~ '^\%(\/\*\|\s*\/\/\)' && s:IsInComment(v:lnum, 1)
return cindent(v:lnum) return cindent(v:lnum)
endif endif
" single opening bracket will assume you want a c style of indenting " single opening bracket will assume you want a c style of indenting
if s:Match(v:lnum, s:line_pre . '{' . s:line_term) && !s:Match(lnum,s:block_regex) && if line =~ s:line_pre . '{' && !s:Match(lnum,s:block_regex) &&
\ !s:Match(lnum,s:comma_last) \ !s:Match(lnum,s:comma_last)
return cindent(v:lnum) return cindent(v:lnum)
endif endif
" cindent each line which has a switch label " cindent each line which has a switch label
if (line =~ s:expr_case) if (line =~ s:expr_case)
return cindent(v:lnum) let s:cpo_switch = &cpo
set cpo+=%
let ind = cindent(v:lnum)
let &cpo = s:cpo_switch
return ind
endif endif
" If we got a closing bracket on an empty line, find its match and indent " If we got a closing bracket on an empty line, find its match and indent
" according to it. " according to it.
let col = s:Match(v:lnum, s:line_pre . '[]})]') let col = line =~ s:line_pre . '[]})]'
if col > 0 if col > 0
let parlnum = v:lnum let parlnum = v:lnum
while col while col
@@ -361,8 +366,8 @@ function GetJavascriptIndent()
continue continue
end end
if parlnum > 0 if parlnum > 0
let ind = s:InMultiVarStatement(parlnum, 0, 0)|| s:LineHasOpeningBrackets(parlnum) !~ '2' let ind = s:InMultiVarStatement(parlnum, 0, 0)|| s:LineHasOpeningBrackets(parlnum) !~ '2' ?
\ ? indent(parlnum) : indent(s:GetMSL(parlnum, 0)) \ indent(parlnum) : indent(s:GetMSL(parlnum, 0))
endif endif
endwhile endwhile
return ind return ind
@@ -371,7 +376,8 @@ function GetJavascriptIndent()
" If line starts with an operator... " If line starts with an operator...
if (line =~ s:operator_first) if (line =~ s:operator_first)
if (s:Match(lnum, s:operator_first) || s:Match(lnum, s:line_pre . '[])}]')) if (s:Match(lnum, s:operator_first) || (s:Match(lnum, s:line_pre . '[])}]') &&
\ !(s:Match(v:lnum,s:line_pre . '\.') && s:Match(lnum, ')' . s:line_term))))
" and so does previous line, don't indent " and so does previous line, don't indent
return indent(lnum) return indent(lnum)
end end
@@ -391,13 +397,15 @@ function GetJavascriptIndent()
end end
" If previous line starts with an operator... " If previous line starts with an operator...
elseif (s:Match(lnum, s:operator_first) && !s:Match(lnum,s:continuation_regex))||getline(lnum) =~ ');\=' . s:line_term elseif (s:Match(lnum, s:operator_first) && !s:Match(lnum,s:continuation_regex)) ||
\ getline(lnum) =~ '[]})];\=' . s:line_term
let counts = s:LineHasOpeningBrackets(lnum) let counts = s:LineHasOpeningBrackets(lnum)
if counts[0] == '2' && !s:Match(lnum, s:operator_first) if counts =~ '2' && !s:Match(lnum, s:operator_first)
call cursor(lnum, 1) call cursor(lnum, 1)
" Search for the opening tag " Search for the opening tag
let mnum = s:lookForParens('(', ')', 'nbW', 0) let mnum = s:lookForParens('(\|{\|\[', ')\|}\|\]', 'nbW', 0)
if mnum > 0 && s:Match(mnum, s:operator_first) if mnum > 0 && (s:Match(mnum, s:operator_first) ||
\ (s:Onescope(s:PrevNonBlankNonString(mnum - 1))) && !s:Match(mnum, s:line_pre . '{'))
return indent(mnum) - s:sw() return indent(mnum) - s:sw()
end end
elseif s:Match(lnum, s:operator_first) elseif s:Match(lnum, s:operator_first)
@@ -413,7 +421,7 @@ function GetJavascriptIndent()
" If the line is empty and the previous nonblank line was a multi-line " If the line is empty and the previous nonblank line was a multi-line
" comment, use that comment's indent. Deduct one char to account for the " comment, use that comment's indent. Deduct one char to account for the
" space in ' */'. " space in ' */'.
if line =~ '^\s*$' && getline(prevline) !~ '\%(\%(^\s*\/\/\|\/\*\).*\)\@<!\*\/' && if line =~ '^\s*$' && getline(prevline) =~ '\%(\%(^\s*\/\/\|\/\*\).*\)\@<!\*\/' &&
\ s:IsInComment(prevline, 1) \ s:IsInComment(prevline, 1)
return indent(prevline) - 1 return indent(prevline) - 1
endif endif
@@ -430,16 +438,6 @@ function GetJavascriptIndent()
return 0 return 0
endif endif
" foo('foo',
" bar('bar', function() {
" hi();
" })
" );
" function (a, b, c, d,
" e, f, g) {
" console.log('inner');
" }
" If the previous line ended with a block opening, add a level of indent. " If the previous line ended with a block opening, add a level of indent.
if s:Match(lnum, s:block_regex) if s:Match(lnum, s:block_regex)
return s:InMultiVarStatement(lnum, 0, 0) || s:LineHasOpeningBrackets(lnum) !~ '2' ? return s:InMultiVarStatement(lnum, 0, 0) || s:LineHasOpeningBrackets(lnum) !~ '2' ?
@@ -451,15 +449,16 @@ function GetJavascriptIndent()
let ind = indent(lnum) let ind = indent(lnum)
" If the previous line contained an opening bracket, and we are still in it, " If the previous line contained an opening bracket, and we are still in it,
" add indent depending on the bracket type. " add indent depending on the bracket type.
if s:Match(lnum, '\%([[({]\)\|\%([^\t \])}][})\]]\)') if s:Match(lnum, '[[({})\]]')
let counts = s:LineHasOpeningBrackets(lnum) let counts = s:LineHasOpeningBrackets(lnum)
if counts =~ '2' if counts =~ '2'
call cursor(lnum,matchend(s:RemoveTrailingComments(line), '.\+\zs[])}]')) call cursor(lnum,matchend(s:RemoveTrailingComments(line), '.*\zs[])}]'))
while s:lookForParens('(\|{\|\[', ')\|}\|\]', 'bW', 0) == lnum while s:lookForParens('(\|{\|\[', ')\|}\|\]', 'bW', 0) == lnum
call cursor(lnum, matchend(s:RemoveTrailingComments(strpart(line,0,col('.'))), '.*\zs[])}]')) call cursor(lnum, matchend(s:RemoveTrailingComments(strpart(line,0,col('.'))), '.*\zs[])}]'))
endwhile endwhile
if line('.') < lnum && !s:InMultiVarStatement(line('.'),0,0) let cur = line('.')
return indent(s:GetMSL(line('.'), 0)) if cur < lnum && !s:InMultiVarStatement(cur,0,0)
return indent(s:GetMSL(cur, 0))
end end
elseif counts =~ '1' || s:Onescope(lnum) elseif counts =~ '1' || s:Onescope(lnum)
return ind + s:sw() return ind + s:sw()
@@ -502,64 +501,64 @@ let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save
" gq{{{2 " gq{{{2
function! Fixedgq(lnum, count) function! Fixedgq(lnum, count)
let l:tw = &tw ? &tw : 80; let l:tw = &tw ? &tw : 80;
let l:count = a:count let l:count = a:count
let l:first_char = indent(a:lnum) + 1 let l:first_char = indent(a:lnum) + 1
if mode() == 'i' " gq was not pressed, but tw was set if mode() == 'i' " gq was not pressed, but tw was set
return 1 return 1
endif endif
" This gq is only meant to do code with strings, not comments " This gq is only meant to do code with strings, not comments
if s:IsInComment(a:lnum, l:first_char) if s:IsInComment(a:lnum, l:first_char)
return 1 return 1
endif endif
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
return 1 return 1
endif endif
" Put all the lines on one line and do normal spliting after that " Put all the lines on one line and do normal spliting after that
if l:count > 1 if l:count > 1
while l:count > 1 while l:count > 1
let l:count -= 1 let l:count -= 1
normal J normal J
endwhile endwhile
endif endif
let l:winview = winsaveview() let l:winview = winsaveview()
call cursor(a:lnum, l:tw + 1)
let orig_breakpoint = searchpairpos(' ', '', '\.', 'bcW', '', a:lnum)
call cursor(a:lnum, l:tw + 1)
let breakpoint = searchpairpos(' ', '', '\.', 'bcW', s:skip_expr, a:lnum)
" No need for special treatment, normal gq handles edgecases better
if breakpoint[1] == orig_breakpoint[1]
call winrestview(l:winview)
return 1
endif
" Try breaking after string
if breakpoint[1] <= indent(a:lnum)
call cursor(a:lnum, l:tw + 1) call cursor(a:lnum, l:tw + 1)
let orig_breakpoint = searchpairpos(' ', '', '\.', 'bcW', '', a:lnum) let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
call cursor(a:lnum, l:tw + 1) endif
let breakpoint = searchpairpos(' ', '', '\.', 'bcW', s:skip_expr, a:lnum)
" No need for special treatment, normal gq handles edgecases better
if breakpoint[1] == orig_breakpoint[1]
call winrestview(l:winview)
return 1
endif
" Try breaking after string
if breakpoint[1] <= indent(a:lnum)
call cursor(a:lnum, l:tw + 1)
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
endif
if breakpoint[1] != 0 if breakpoint[1] != 0
call feedkeys("r\<CR>") call feedkeys("r\<CR>")
else else
let l:count = l:count - 1 let l:count = l:count - 1
endif endif
" run gq on new lines " run gq on new lines
if l:count == 1 if l:count == 1
call feedkeys("gqq") call feedkeys("gqq")
endif endif
return 0 return 0
endfunction endfunction
"}}} "}}}
" vim: foldmethod=marker:foldlevel=1 " vim: foldmethod=marker:foldlevel=1

21
indent/proto.vim Normal file
View File

@@ -0,0 +1,21 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'protobuf') == -1
" Vim indent file
" Language: Protobuf
" Maintainer: Johannes Zellner <johannes@zellner.org>
" Last Change: Fri, 15 Mar 2002 07:53:54 CET
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
" Protobuf is like indenting C
setlocal cindent
setlocal expandtab
setlocal shiftwidth=2
let b:undo_indent = "setl cin<"
endif

View File

@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
" Vim indent file " Vim indent file
" Language: Rust " Language: Rust
" Author: Chris Morgan <me@chrismorgan.info> " Author: Chris Morgan <me@chrismorgan.info>
" Last Change: 2014 Sep 13 " Last Change: 2016 Jul 15
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
if exists("b:did_indent") if exists("b:did_indent")
@@ -134,6 +134,7 @@ function GetRustIndent(lnum)
\ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]' \ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]'
\ && prevline !~ '^\s*fn\s' \ && prevline !~ '^\s*fn\s'
\ && prevline !~ '([^()]\+,$' \ && prevline !~ '([^()]\+,$'
\ && s:get_line_trimmed(a:lnum) !~ '^\s*\S\+\s*=>'
" Oh ho! The previous line ended in a comma! I bet cindent will try to " Oh ho! The previous line ended in a comma! I bet cindent will try to
" take this too far... For now, let's normally use the previous line's " take this too far... For now, let's normally use the previous line's
" indent. " indent.
@@ -158,6 +159,8 @@ function GetRustIndent(lnum)
" if baz && (foo || " if baz && (foo ||
" bar) { " bar) {
" "
" Another case is when the current line is a new match arm.
"
" There are probably other cases where we don't want to do this as " There are probably other cases where we don't want to do this as
" well. Add them as needed. " well. Add them as needed.
return indent(prevlinenum) return indent(prevlinenum)

View File

@@ -21,21 +21,39 @@ unlet! b:current_syntax
syn case match syn case match
syn clear htmlError syn clear htmlError
if has('patch-7.4.1142')
syn iskeyword @,48-57,_,192-255,@-@,:
else
setlocal iskeyword+=@-@
endif
syn region bladeEcho matchgroup=bladeDelimiter start="@\@<!{{" end="}}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend syn region bladeEcho matchgroup=bladeDelimiter start="@\@<!{{" end="}}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
syn region bladeEcho matchgroup=bladeDelimiter start="{!!" end="!!}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend syn region bladeEcho matchgroup=bladeDelimiter start="{!!" end="!!}" contains=@bladePhp,bladePhpParenBlock containedin=ALLBUT,@bladeExempt keepend
syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" contains=bladeTodo containedin=ALLBUT,@bladeExempt keepend syn region bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" contains=bladeTodo containedin=ALLBUT,@bladeExempt keepend
syn keyword bladeKeyword @if @elseif @foreach @forelse @for @while @can @include @each @inject @extends @section @stack @push @unless @yield @parent @hasSection nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt syn keyword bladeKeyword @if @elseif @foreach @forelse @for @while @can @cannot @elsecan @elsecannot @include @includeIf @each @inject @extends @section @stack @push @unless @yield @parent @hasSection @break @continue @unset @lang @choice nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @empty @endforelse @endwhile @endcan @stop @append @endsection @endpush @show containedin=ALLBUT,@bladeExempt syn keyword bladeKeyword @else @endif @endunless @endfor @endforeach @empty @endforelse @endwhile @endcan @endcannot @stop @append @endsection @endpush @show @overwrite @verbatim @endverbatim containedin=ALLBUT,@bladeExempt
if exists('g:blade_custom_directives')
exe "syn keyword bladeKeyword @" . join(g:blade_custom_directives, ' @') . " nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt"
endif
if exists('g:blade_custom_directives_pairs')
exe "syn keyword bladeKeyword @" . join(keys(g:blade_custom_directives_pairs), ' @') . " nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt"
exe "syn keyword bladeKeyword @" . join(values(g:blade_custom_directives_pairs), ' @') . " containedin=ALLBUT,@bladeExempt"
endif
syn region bladePhpRegion matchgroup=bladeKeyword start="\<@php\>\%(\s*(\)\@!" end="\<@endphp\>" contains=@bladePhp containedin=ALLBUT,@bladeExempt keepend
syn match bladeKeyword "@php\ze\s*(" nextgroup=bladePhpParenBlock skipwhite containedin=ALLBUT,@bladeExempt
syn region bladePhpParenBlock matchgroup=bladeDelimiter start="\s*(" end=")" contains=@bladePhp,bladePhpParenBlock skipwhite contained syn region bladePhpParenBlock matchgroup=bladeDelimiter start="\s*(" end=")" contains=@bladePhp,bladePhpParenBlock skipwhite contained
syn cluster bladePhp contains=@phpClTop syn cluster bladePhp contains=@phpClTop
syn cluster bladeExempt contains=bladeComment,@htmlTop syn cluster bladeExempt contains=bladeComment,bladePhpRegion,bladePhpParenBlock,@htmlTop
syn cluster htmlPreproc add=bladeEcho,bladeComment syn cluster htmlPreproc add=bladeEcho,bladeComment,bladePhpRegion
syn keyword bladeTodo todo fixme xxx contained syn case ignore
syn keyword bladeTodo todo fixme xxx note contained
hi def link bladeDelimiter PreProc hi def link bladeDelimiter PreProc
hi def link bladeComment Comment hi def link bladeComment Comment

View File

@@ -184,6 +184,11 @@ syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumbe
syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>" syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
"hex number "hex number
syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>" syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
if s:ft ==# 'cpp' && !exists("cpp_no_cpp14")
syn match cNumber display contained "\d\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
syn match cNumber display contained "0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
syn match cNumber display contained "0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
endif
" Flag the first zero of an octal number as something special " Flag the first zero of an octal number as something special
syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
syn match cOctalZero display contained "\<0" syn match cOctalZero display contained "\<0"
@@ -297,7 +302,7 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN
syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX
if !exists("c_no_c99") if !exists("c_no_c99")
syn keyword cConstant __func__ syn keyword cConstant __func__ __VA_ARGS__
syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX
syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN
syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX

File diff suppressed because one or more lines are too long

View File

@@ -39,7 +39,7 @@ syn keyword cppConstant __cplusplus
" C++ 11 extensions " C++ 11 extensions
if !exists("cpp_no_cpp11") if !exists("cpp_no_cpp11")
syn keyword cppModifier override final syn keyword cppModifier override final auto
syn keyword cppType nullptr_t syn keyword cppType nullptr_t
syn keyword cppExceptions noexcept syn keyword cppExceptions noexcept
syn keyword cppStorageClass constexpr decltype thread_local syn keyword cppStorageClass constexpr decltype thread_local

View File

@@ -1,11 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
" Language: ember-script " Language: ember-script
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com> " Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
" URL: http://github.com/heartsentwined/vim-ember-script " URL: http://github.com/yalesov/vim-ember-script
" Version: 1.0.1 " Version: 1.0.4
" Last Change: 2013 Apr 17 " Last Change: 2016 Jul 6
" License: GPL-3.0 " License: ISC
if exists('b:current_syntax') && b:current_syntax == 'ember-script' if exists('b:current_syntax') && b:current_syntax == 'ember-script'
finish finish

View File

@@ -1,11 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
" Language: emblem " Language: emblem
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com> " Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
" URL: http://github.com/heartsentwined/vim-emblem " URL: http://github.com/yalesov/vim-emblem
" Version: 1.2.0 " Version: 2.0.1
" Last Change: 2013 Apr 22 " Last Change: 2016 Jul 6
" License: GPL-3.0 " License: ISC
" Quit when a syntax file is already loaded. " Quit when a syntax file is already loaded.
if exists('b:current_syntax') && b:current_syntax == 'emblem' if exists('b:current_syntax') && b:current_syntax == 'emblem'
@@ -31,7 +31,7 @@ syn match eblClass '\v(\w|-)+' nextgroup=@eblComponent contained display
hi def link eblIdOp eblId hi def link eblIdOp eblId
hi def link eblClassOp eblClass hi def link eblClassOp eblClass
syn region eblHbsAttrRegion matchgroup=eblHbsAttrRegionOp start='{' end='}' contains=@eblHbsHelpers nextgroup=@eblComponent keepend contained display syn region eblHbsAttrRegion matchgroup=eblHbsAttrRegionOp start='{\|(\|\[' end='}\|)\|\]' contains=@eblHbsHelpers nextgroup=@eblComponent keepend contained display
hi def link eblHbsAttrRegionOp eblOperator hi def link eblHbsAttrRegionOp eblOperator
syn match eblInlineText '\v\s+[^:]+.*$' contains=eblItpl contained display syn match eblInlineText '\v\s+[^:]+.*$' contains=eblItpl contained display
@@ -40,7 +40,7 @@ hi def link eblInlineText eblRaw
syn cluster eblHbsComponent contains=eblHbsArg,eblHbsAttr,eblHbsTextOp,eblLineOp syn cluster eblHbsComponent contains=eblHbsArg,eblHbsAttr,eblHbsTextOp,eblLineOp
syn match eblHbsOp '\v\s*\=+' nextgroup=@eblHbsHelpers skipwhite contained display syn match eblHbsOp '\v\s*\=+' nextgroup=@eblHbsHelpers skipwhite contained display
syn match eblHbsHelper '\v\w(\w|-|\.)*' nextgroup=@eblHbsComponent skipwhite contained display syn match eblHbsHelper '\v\w(\w|-|\.|\/)*' nextgroup=@eblHbsComponent skipwhite contained display
syn match eblHbsTextOp '|' nextgroup=eblHbsText contained display syn match eblHbsTextOp '|' nextgroup=eblHbsText contained display
syn match eblHbsText '.*' contained display syn match eblHbsText '.*' contained display
hi def link eblHbsOp eblOperator hi def link eblHbsOp eblOperator
@@ -48,24 +48,38 @@ hi def link eblHbsHelper eblFunction
hi def link eblHbsTextOp eblOperator hi def link eblHbsTextOp eblOperator
hi def link eblHbsText eblRaw hi def link eblHbsText eblRaw
syn cluster eblHbsHelpers contains=eblHbsHelper,eblHbsCtrlFlowHelper,eblHbsEachHelper syn cluster eblHbsHelpers contains=eblHbsHelper,eblHbsCtrlFlowHelper,eblHbsEachHelper,eblHbsWithHelper
syn match eblHbsCtrlFlowHelper '\v<(if|unless|else|with)>' nextgroup=@eblHbsComponent skipwhite contained display syn match eblHbsCtrlFlowHelper '\v<(else if|if|unless|else)>' nextgroup=@eblHbsComponent skipwhite contained display
syn match eblHbsEachHelper '\v<each>' nextgroup=eblHbsEachArg skipwhite contained display syn match eblHbsEachHelper '\v<each>' nextgroup=eblHbsEachArg skipwhite contained display
syn match eblHbsEachArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsIn,eblLineOp skipwhite contained display syn match eblHbsEachArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsIn,eblLineOp skipwhite contained display
syn match eblHbsIn '\v<in>' nextgroup=eblHbsInArg skipwhite contained display syn match eblHbsIn '\v<in>' nextgroup=eblHbsInArg skipwhite contained display
syn match eblHbsInArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblLineOp skipwhite contained display syn match eblHbsInArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblLineOp skipwhite contained display
hi def link eblHbsCtrlFlowHelper eblKeyword syn match eblHbsWithHelper '\v<with>' nextgroup=eblHbsWithArg skipwhite contained display
hi def link eblHbsEachHelper eblKeyword syn match eblHbsWithArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsAs skipwhite contained display
hi def link eblHbsEachArg eblLiteral syn match eblHbsAs '\v<as>' nextgroup=eblHbsAsBlockStartArg skipwhite contained display
hi def link eblHbsIn eblKeyword syn match eblHbsAsBlockStartArg /\v\|/ nextgroup=eblHbsAsBlockFirstArg skipwhite contained display
hi def link eblHbsInArg eblLiteral syn match eblHbsAsBlockFirstArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsAsBlockSecondArg,eblHbsAsBlockEndArg skipwhite contained display
syn match eblHbsAsBlockSecondArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsAsBlockEndArg skipwhite contained display
syn match eblHbsAsBlockEndArg /\v\|/ nextgroup=eblLineOp skipwhite contained display
hi def link eblHbsCtrlFlowHelper eblKeyword
hi def link eblHbsEachHelper eblKeyword
hi def link eblHbsEachArg eblLiteral
hi def link eblHbsIn eblKeyword
hi def link eblHbsInArg eblLiteral
hi def link eblHbsWithHelper eblKeyword
hi def link eblHbsWithArg eblLiteral
hi def link eblHbsAs eblKeyword
hi def link eblHbsAsBlockStartArg eblOperator
hi def link eblHbsAsBlockFirstArg eblLiteral
hi def link eblHbsAsBlockSecondArg eblLiteral
hi def link eblHbsAsBlockEndArg eblOperator
syn match eblHbsArg /\v\s*((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=@eblHbsComponent skipwhite contained display syn match eblHbsArg /\v\s*((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=@eblHbsComponent skipwhite contained display
syn match eblHbsAttr '\v\s*(\w|-)+\=@=' contains=eblHbsAttrBind nextgroup=eblHbsAttrOp contained display syn match eblHbsAttr '\v\s*(\w|-)+\=@=' contains=eblHbsAttrBind nextgroup=eblHbsAttrOp contained display
syn match eblHbsAttrBind /\v<(\w|-)+Bind>/ contained display syn match eblHbsAttrBind /\v<(\w|-)+Bind>/ contained display
syn match eblHbsAttrOp '=' nextgroup=eblHbsAttrLit contained display syn match eblHbsAttrOp '=' nextgroup=eblHbsAttrLit contained display
syn match eblHbsAttrLit /\v(["'])[^\1]{-}\1|[^: ]+/ contains=eblItpl nextgroup=@eblHbsComponent skipwhite contained display syn match eblHbsAttrLit /\v(["'])[^\1]{-}\1|[^\.: ]+/ contains=eblItpl nextgroup=@eblHbsComponent skipwhite contained display
hi def link eblHbsArg eblLiteral hi def link eblHbsArg eblLiteral
hi def link eblHbsAttr eblAttr hi def link eblHbsAttr eblAttr
hi def link eblhbsAttrBind eblBind hi def link eblhbsAttrBind eblBind
@@ -106,6 +120,7 @@ hi def link eblKnownEvent eblEvent
syn region eblItpl matchgroup=eblItplOp start='#{' end='}' contains=@eblHbsHelpers,eblHbsPartialOp keepend contained display syn region eblItpl matchgroup=eblItplOp start='#{' end='}' contains=@eblHbsHelpers,eblHbsPartialOp keepend contained display
syn region eblItpl matchgroup=eblItplOp start='{{' end='}}' contains=@eblHbsHelpers,eblHbsPartialOp keepend contained display syn region eblItpl matchgroup=eblItplOp start='{{' end='}}' contains=@eblHbsHelpers,eblHbsPartialOp keepend contained display
syn region eblItpl matchgroup=eblItplOp start='(' end=')' contains=@eblHbsHelpers,eblHbsPartialOp keepend contained display
hi def link eblItplOp eblOperator hi def link eblItplOp eblOperator
syn match eblHbsPartialOp '\s*>' nextgroup=@eblHbsHelpers skipwhite contained display syn match eblHbsPartialOp '\s*>' nextgroup=@eblHbsHelpers skipwhite contained display

View File

@@ -70,15 +70,11 @@ if !exists("g:go_highlight_methods")
endif endif
if !exists("g:go_highlight_fields") if !exists("g:go_highlight_fields")
let g:go_highlight_fields = 0 let g:go_highlight_fields = 0
endif endif
if !exists("g:go_highlight_structs") if !exists("g:go_highlight_types")
let g:go_highlight_structs = 0 let g:go_highlight_types = 0
endif
if !exists("g:go_highlight_interfaces")
let g:go_highlight_interfaces = 0
endif endif
if !exists("g:go_highlight_build_constraints") if !exists("g:go_highlight_build_constraints")
@@ -100,12 +96,10 @@ endif
syn case match syn case match
syn keyword goDirective package import syn keyword goDirective package import
syn keyword goDeclaration var const type syn keyword goDeclaration var const
syn keyword goDeclType struct interface
hi def link goDirective Statement hi def link goDirective Statement
hi def link goDeclaration Keyword hi def link goDeclaration Keyword
hi def link goDeclType Keyword
" Keywords within functions " Keywords within functions
syn keyword goStatement defer go goto return break continue fallthrough syn keyword goStatement defer go goto return break continue fallthrough
@@ -131,10 +125,6 @@ hi def link goUnsignedInts Type
hi def link goFloats Type hi def link goFloats Type
hi def link goComplexes Type hi def link goComplexes Type
" Treat func specially: it's a declaration at the start of a line, but a type
" elsewhere. Order matters here.
syn match goDeclaration /\<func\>/
" Predefined functions and values " Predefined functions and values
syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/ syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/
@@ -298,77 +288,87 @@ if g:go_highlight_operators != 0
syn match goOperator /:=\|||\|<-\|++\|--/ syn match goOperator /:=\|||\|<-\|++\|--/
" match ... " match ...
syn match goOperator /\.\.\./ syn match goOperator /\.\.\./
hi def link goPointerOperator Operator
endif endif
hi def link goOperator Operator hi def link goOperator Operator
" Functions; " Functions;
if g:go_highlight_functions != 0 if g:go_highlight_functions != 0
syn match goFunction /\(func\s\+\)\@<=\w\+\((\)\@=/ syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction skipwhite skipnl
syn match goFunction /\()\s\+\)\@<=\w\+\((\)\@=/ syn match goReceiver /(\(\w\|[ *]\)\+)/ contained nextgroup=goFunction contains=goReceiverVar skipwhite skipnl
syn match goReceiverVar /\w\+/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained
syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
syn match goReceiverType /\w\+/ contained
syn match goFunction /\w\+/ contained
else
syn keyword goDeclaration func
endif endif
hi def link goFunction Function hi def link goFunction Function
" Methods; " Methods;
if g:go_highlight_methods != 0 if g:go_highlight_methods != 0
syn match goMethod /\(\.\)\@<=\w\+\((\)\@=/ syn match goMethod /\.\w\+(/hs=s+1,he=e-1
endif endif
hi def link goMethod Type hi def link goMethod Type
" Fields; " Fields;
if g:go_highlight_fields != 0 if g:go_highlight_fields != 0
syn match goField /\(\.\)\@<=\a\+\([\ \n\r\:\)]\)\@=/ syn match goVarArgs /\.\.\.\w\+\>/
syn match goField /\.\a\+\([\ \n\r\:\)\[]\)\@=/hs=s+1
endif endif
hi def link goField Type hi def link goField Identifier
" Structs; " Structs & Interfaces;
if g:go_highlight_structs != 0 if g:go_highlight_types != 0
syn match goStruct /\(.\)\@<=\w\+\({\)\@=/ syn match goTypeConstructor /\<\w\+{/he=e-1
syn match goStructDef /\(type\s\+\)\@<=\w\+\(\s\+struct\s\+{\)\@=/ syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
syn match goDeclType /\<interface\|struct\>/ contained skipwhite skipnl
hi def link goReceiverType Type
else
syn keyword goDeclType struct interface
syn keyword goDeclaration type
endif endif
hi def link goStruct Function hi def link goTypeConstructor Type
hi def link goStructDef Function hi def link goTypeName Type
hi def link goTypeDecl Keyword
" Interfaces; hi def link goDeclType Keyword
if g:go_highlight_interfaces != 0
syn match goInterface /\(.\)\@<=\w\+\({\)\@=/
syn match goInterfaceDef /\(type\s\+\)\@<=\w\+\(\s\+interface\s\+{\)\@=/
endif
hi def link goInterface Function
hi def link goInterfaceDef Function
" Build Constraints " Build Constraints
if g:go_highlight_build_constraints != 0 if g:go_highlight_build_constraints != 0
syn match goBuildKeyword display contained "+build" syn match goBuildKeyword display contained "+build"
" Highlight the known values of GOOS, GOARCH, and other +build options. " Highlight the known values of GOOS, GOARCH, and other +build options.
syn keyword goBuildDirectives contained syn keyword goBuildDirectives contained
\ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 \ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
\ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64 \ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64
\ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc \ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc
\ s390 s390x sparc sparc64 cgo ignore race \ s390 s390x sparc sparc64 cgo ignore race
" Other words in the build directive are build tags not listed above, so " Other words in the build directive are build tags not listed above, so
" avoid highlighting them as comments by using a matchgroup just for the " avoid highlighting them as comments by using a matchgroup just for the
" start of the comment. " start of the comment.
" The rs=s+2 option lets the \s*+build portion be part of the inner region " The rs=s+2 option lets the \s*+build portion be part of the inner region
" instead of the matchgroup so it will be highlighted as a goBuildKeyword. " instead of the matchgroup so it will be highlighted as a goBuildKeyword.
syn region goBuildComment matchgroup=goBuildCommentStart syn region goBuildComment matchgroup=goBuildCommentStart
\ start="//\s*+build\s"rs=s+2 end="$" \ start="//\s*+build\s"rs=s+2 end="$"
\ contains=goBuildKeyword,goBuildDirectives \ contains=goBuildKeyword,goBuildDirectives
hi def link goBuildCommentStart Comment hi def link goBuildCommentStart Comment
hi def link goBuildDirectives Type hi def link goBuildDirectives Type
hi def link goBuildKeyword PreProc hi def link goBuildKeyword PreProc
" One or more line comments that are followed immediately by a "package" " One or more line comments that are followed immediately by a "package"
" declaration are treated like package documentation, so these must be " declaration are treated like package documentation, so these must be
" matched as comments to avoid looking like working build constraints. " matched as comments to avoid looking like working build constraints.
" The he, me, and re options let the "package" itself be highlighted by " The he, me, and re options let the "package" itself be highlighted by
" the usual rules. " the usual rules.
syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/ syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/
\ end=/\v\n\s*package/he=e-7,me=e-7,re=e-7 \ end=/\v\n\s*package/he=e-7,me=e-7,re=e-7
\ contains=@goCommentGroup,@Spell \ contains=@goCommentGroup,@Spell
hi def link goPackageComment Comment hi def link goPackageComment Comment
endif endif
hi def goSameId term=bold cterm=bold ctermbg=white ctermfg=black
" Search backwards for a global declaration to start processing the syntax. " Search backwards for a global declaration to start processing the syntax.
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/ "syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
@@ -379,4 +379,6 @@ syn sync minlines=500
let b:current_syntax = "go" let b:current_syntax = "go"
" vim: sw=2 ts=2 et
endif endif

View File

@@ -1,7 +1,7 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
endif endif
syn match godefStackComment '^".*' syn match godefStackComment '^".*'
@@ -19,4 +19,6 @@ hi def link godefStackCurrentPosition Special
hi def link godefStackFilename Directory hi def link godefStackFilename Directory
hi def link godefStackEntryLocationNumber LineNr hi def link godefStackEntryLocationNumber LineNr
" vim: sw=2 ts=2 et
endif endif

View File

@@ -1,11 +1,11 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
endif endif
if !exists("main_syntax") if !exists("main_syntax")
let main_syntax = 'html' let main_syntax = 'html'
endif endif
runtime! syntax/gotexttmpl.vim runtime! syntax/gotexttmpl.vim
@@ -14,6 +14,6 @@ unlet b:current_syntax
let b:current_syntax = "gohtmltmpl" let b:current_syntax = "gohtmltmpl"
" vim:ts=4:sw=4:et " vim: sw=2 ts=2 et
endif endif

View File

@@ -8,7 +8,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
" Quit when a (custom) syntax file was already loaded " Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
endif endif
syn case match syn case match
@@ -84,6 +84,6 @@ hi def link goTplComment Comment
let b:current_syntax = "gotexttmpl" let b:current_syntax = "gotexttmpl"
" vim:ts=4:sw=4:et " vim: sw=2 ts=2 et
endif endif

View File

@@ -13,6 +13,7 @@ elseif exists("b:current_syntax")
finish finish
endif endif
syn spell notoplevel
syn match haskellRecordField contained containedin=haskellBlock syn match haskellRecordField contained containedin=haskellBlock
\ "[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)" \ "[_a-z][a-zA-Z0-9_']*\(,\s*[_a-z][a-zA-Z0-9_']*\)*\(\s*::\|\n\s\+::\)"
\ contains= \ contains=
@@ -60,9 +61,9 @@ syn keyword haskellConditional if then else
syn match haskellNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>\|\<0[bB][10]\+\>" syn match haskellNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>\|\<0[bB][10]\+\>"
syn match haskellFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>" syn match haskellFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
syn match haskellSeparator "[,;]" syn match haskellSeparator "[,;]"
syn region haskellParens matchgroup=haskellDelimiter start="(" end=")" contains=TOP,haskellTypeSig syn region haskellParens matchgroup=haskellDelimiter start="(" end=")" contains=TOP,haskellTypeSig,@Spell
syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contains=TOP,haskellTypeSig syn region haskellBrackets matchgroup=haskellDelimiter start="\[" end="]" contains=TOP,haskellTypeSig,@Spell
syn region haskellBlock matchgroup=haskellDelimiter start="{" end="}" contains=TOP syn region haskellBlock matchgroup=haskellDelimiter start="{" end="}" contains=TOP,@Spell
syn keyword haskellInfix infix infixl infixr syn keyword haskellInfix infix infixl infixr
syn keyword haskellBottom undefined error syn keyword haskellBottom undefined error
syn match haskellOperators "[-!#$%&\*\+/<=>\?@\\^|~:.]\+\|\<_\>" syn match haskellOperators "[-!#$%&\*\+/<=>\?@\\^|~:.]\+\|\<_\>"

View File

@@ -12,27 +12,72 @@ syntax case match
" keywords " keywords
syntax keyword jasmineSuite describe it beforeEach afterEach syntax keyword jasmineSuite describe it beforeEach afterEach
syntax keyword jasmine jasmine
" special
syntax match jasmineSpecial /\.Ajax/
syntax match jasmineSpecial /\.addMatcher/
syntax match jasmineSpecial /\.getEnv/
syntax match jasmineSpecial /\.loadConfigFile/
syntax match jasmineSpecial /\.onComplete/
syntax match jasmineSpecial /\.QueryString/
syntax match jasmineSpecial /\.HtmlSpecFilter/
syntax match jasmineSpecial /\.addCustomEqualityTester/
syntax match jasmineSpecial /\.configureDefaultReporter/
syntax match jasmineSpecial /\.execute/
" clock
syntax match jasmineClock /\.Timer/
syntax match jasmineClock /\.clock/
syntax match jasmineClock /\.tick/
syntax match jasmineClock /\.mockDate/
" disabled
syntax keyword jasmineDisabled xdescribe xit syntax keyword jasmineDisabled xdescribe xit
" expectation
syntax keyword jasmineExpectation expect syntax keyword jasmineExpectation expect
" not
syntax region jasmineNot start=/not/ end=/\.to/me=s-1 syntax region jasmineNot start=/not/ end=/\.to/me=s-1
" matchers
syntax match jasmineMatcher /\.to\h\+/ syntax match jasmineMatcher /\.to\h\+/
syntax match jasmineMatcher /\.objectContaining/
syntax match jasmineMatcher /\.arrayContaining/
syntax match jasmineMatcher /\.anything/
syntax match jasmineMatcher /\.any/
syntax keyword jasmineSpy spyOn syntax keyword jasmineSpy spyOn
syntax match jasmineSpy /\.createSpy/
syntax match jasmineSpyMatcher /and\h\+/ syntax match jasmineSpyMatcher /and\h\+/
" jasmine is a subset of the javascript language, thus we need to activate " jasmine is a subset of the javascript language, thus we need to activate
" javascript syntax highlighting and add new jasmin group names to the " javascript syntax highlighting and add new jasmin group names to the
" JavaScriptAll cluster which is defined there " JavaScriptAll cluster which is defined there
runtime! syntax/javascript.vim runtime! syntax/javascript.vim
syntax cluster JavaScriptAll add=jasmineSuite,jasmineDisabled,jasmineExpectation,jasmineNot,jasmineMatcher,jasmineSpy,jasmineSpyMatcher syntax cluster JavaScriptAll add=
\ jasmine,
\ jasmineClock,
\ jasmineDisabled,
\ jasmineExpectation,
\ jasmineMatcher,
\ jasmineNot,
\ jasmineSpecial,
\ jasmineSpy,
\ jasmineSpyMatcher,
\ jasmineSuite
let b:current_syntax = "jasmine" let b:current_syntax = "jasmine"
hi def link jasmineSuite Statement hi def link jasmine Special
hi def link jasmineClock Special
hi def link jasmineDisabled Error hi def link jasmineDisabled Error
hi def link jasmineExpectation Statement hi def link jasmineExpectation Statement
hi def link jasmineNot Special
hi def link jasmineMatcher Statement hi def link jasmineMatcher Statement
hi def link jasmineNot Special
hi def link jasmineSpecial Special
hi def link jasmineSpy Special hi def link jasmineSpy Special
hi def link jasmineSpyMatcher Statement hi def link jasmineSpyMatcher Statement
hi def link jasmineSuite Statement
endif endif

View File

@@ -26,29 +26,28 @@ syntax sync fromstart
" syntax case ignore " syntax case ignore
syntax case match syntax case match
syntax match jsNoise /[:,\;\.]\{1}/ syntax match jsNoise /[:,\;\.]\{1}/
syntax match jsFuncCall /\k\+\%(\s*(\)\@=/ syntax match jsFuncCall /\k\+\%(\s*(\)\@=/
syntax match jsParensError /\%()\|}\|\]\)/ syntax match jsParensError /[)}\]]/
" Program Keywords " Program Keywords
syntax keyword jsStorageClass const var let syntax keyword jsStorageClass const var let skipwhite skipempty nextgroup=jsDestructuringBlock,jsDestructuringArray
syntax keyword jsOperator delete instanceof typeof void new in of syntax keyword jsOperator delete instanceof typeof void new in of
syntax match jsOperator /[\!\|\&\+\-\<\>\=\%\/\*\~\^]\{1}/ syntax match jsOperator /[\!\|\&\+\-\<\>\=\%\/\*\~\^]\{1}/
syntax match jsSpreadOperator /\.\.\./ skipwhite skipempty nextgroup=@jsExpression
syntax keyword jsBooleanTrue true syntax keyword jsBooleanTrue true
syntax keyword jsBooleanFalse false syntax keyword jsBooleanFalse false
" Modules " Modules
syntax keyword jsModuleKeywords contained import syntax keyword jsModuleKeywords contained import
syntax keyword jsModuleKeywords contained export skipwhite skipempty nextgroup=@jsExpression syntax keyword jsModuleKeywords contained export skipwhite skipempty nextgroup=jsExportBlock,jsModuleDefault
syntax keyword jsModuleOperators contained from syntax keyword jsModuleOperators contained from
syntax keyword jsModuleOperators contained as syntax keyword jsModuleOperators contained as
syntax region jsModuleGroup contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise syntax region jsModuleGroup contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise,jsComment
syntax match jsModuleAsterisk contained /*/ syntax match jsModuleAsterisk contained /*/
syntax keyword jsModuleDefault contained default skipwhite skipempty nextgroup=@jsExpression syntax keyword jsModuleDefault contained default skipwhite kipempty nextgroup=@jsExpression
syntax region jsImportContainer start=/\<import\> / end="\%(;\|$\)" contains=jsModuleKeywords,jsModuleOperators,jsComment,jsString,jsTemplateString,jsNoise,jsModuleGroup,jsModuleAsterisk syntax region jsImportContainer start=/\<import\> / end="\%(;\|$\)" contains=jsModuleKeywords,jsModuleOperators,jsComment,jsString,jsTemplateString,jsNoise,jsModuleGroup,jsModuleAsterisk
syntax match jsExportContainer /\<export\> / contains=jsModuleKeywords skipwhite skipempty nextgroup=jsExportBlock,jsModuleDefault syntax region jsExportContainer start=/\<export\> / end="\%(;\|$\)" contains=jsModuleKeywords,jsModuleOperators,jsStorageClass,jsModuleDefault,@jsExpression
syntax region jsExportBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise syntax region jsExportBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise,jsComment
" Strings, Templates, Numbers " Strings, Templates, Numbers
syntax region jsString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend syntax region jsString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend
@@ -76,7 +75,7 @@ else
endif endif
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
syntax match jsObjectKey contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue syntax match jsObjectKey contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue,jsFlowParenRegion
syntax region jsObjectKeyString contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue syntax region jsObjectKeyString contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
syntax region jsObjectKeyString contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue syntax region jsObjectKeyString contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
syntax region jsObjectKeyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsObjectValue,jsFuncArgs extend syntax region jsObjectKeyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsObjectValue,jsFuncArgs extend
@@ -84,7 +83,7 @@ syntax match jsObjectSeparator contained /,/
syntax region jsObjectValue contained start=/:/ end=/\%(,\|}\)\@=/ contains=@jsExpression extend syntax region jsObjectValue contained start=/:/ end=/\%(,\|}\)\@=/ contains=@jsExpression extend
syntax match jsObjectFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>[\r\n\t ]*(\@=/ skipwhite skipempty nextgroup=jsFuncArgs syntax match jsObjectFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>[\r\n\t ]*(\@=/ skipwhite skipempty nextgroup=jsFuncArgs
syntax match jsFunctionKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/ syntax match jsFunctionKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/
syntax match jsObjectGetSet contained /\%(get\|set\|static\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsObjectFuncName syntax match jsObjectMethodType contained /\%(get\|set\|static\|async\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsObjectFuncName
syntax region jsObjectStringKey contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue syntax region jsObjectStringKey contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue
syntax region jsObjectStringKey contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue syntax region jsObjectStringKey contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue
@@ -108,6 +107,7 @@ syntax keyword jsFinally contained finally skipwhite skipempty nextgro
syntax keyword jsCatch contained catch skipwhite skipempty nextgroup=jsParenCatch syntax keyword jsCatch contained catch skipwhite skipempty nextgroup=jsParenCatch
syntax keyword jsException throw syntax keyword jsException throw
syntax keyword jsAsyncKeyword async await syntax keyword jsAsyncKeyword async await
syntax match jsSwitchColon contained /:/ skipwhite skipempty nextgroup=jsBlock
" Keywords " Keywords
syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat
@@ -131,27 +131,30 @@ syntax keyword jsDomNodeConsts ELEMENT_NODE ATTRIBUTE_NODE TEXT_NODE CDATA_SECT
syntax keyword jsHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize syntax keyword jsHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize
"" Code blocks "" Code blocks
syntax region jsBracket matchgroup=jsBrackets start="\[" end="\]" contains=@jsExpression extend fold syntax region jsBracket matchgroup=jsBrackets start=/\[/ end=/\]/ contains=@jsExpression extend fold
syntax region jsParen matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll extend fold syntax region jsParen matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll extend fold
syntax region jsParenIfElse contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsBlock extend fold syntax region jsParenIfElse contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsBlock extend fold
syntax region jsParenRepeat contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsBlock extend fold syntax region jsParenRepeat contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsBlock extend fold
syntax region jsParenSwitch contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold syntax region jsParenSwitch contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold
syntax region jsParenCatch contained matchgroup=jsParens start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock extend fold syntax region jsParenCatch contained matchgroup=jsParens start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock extend fold
syntax region jsClassBlock contained matchgroup=jsClassBraces start=/{/ end=/}/ contains=jsClassFuncName,jsClassMethodDefinitions,jsOperator,jsArrowFunction,jsArrowFuncArgs,jsComment,jsGenerator,jsDecorator,jsClassProperty,jsClassPropertyComputed,jsClassStringKey,jsNoise extend fold syntax region jsFuncArgs contained matchgroup=jsFuncParens start=/(/ end=/)/ contains=jsFuncArgCommas,jsComment,jsFuncArgExpression,jsDestructuringBlock,jsRestExpression,jsFlow skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn extend fold
syntax region jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll extend fold syntax region jsClassBlock contained matchgroup=jsClassBraces start=/{/ end=/}/ contains=jsClassFuncName,jsClassMethodType,jsOperator,jsArrowFunction,jsArrowFuncArgs,jsComment,jsGenerator,jsDecorator,jsClassProperty,jsClassPropertyComputed,jsClassStringKey,jsNoise,jsFlowClassProperty extend fold
syntax region jsBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll extend fold syntax region jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll extend fold
syntax region jsTryCatchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold syntax region jsBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll extend fold
syntax region jsSwitchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsLabel extend fold syntax region jsTryCatchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold
syntax region jsObject matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectGetSet,jsGenerator,jsComment,jsSpreadOperator,jsObjectStringKey extend fold syntax region jsSwitchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsLabel,jsSwitchColon extend fold
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression syntax region jsDestructuringBlock contained matchgroup=jsDestructuringBraces start=/{/ end=/}/ contains=jsDestructuringProperty,jsDestructuringAssignment,jsDestructuringNoise,jsDestructuringPropertyComputed,jsSpreadExpression extend fold
syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsNoise,jsDestructuringProperty,jsSpreadExpression extend fold
syntax region jsObject matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression extend fold
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression
syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression
syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression
syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs
syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>/ skipwhite skipempty nextgroup=jsFuncArgs syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>/ skipwhite skipempty nextgroup=jsFuncArgs
syntax match jsFuncArgDestructuring contained /\({\|}\|=\|:\|\[\|\]\)/ extend syntax region jsFuncArgExpression contained matchgroup=jsFuncArgOperator start=/=/ end=/[,)]\@=/ contains=@jsExpression extend
syntax region jsFuncArgs contained matchgroup=jsFuncParens start='(' end=')' contains=jsFuncArgCommas,jsFuncArgRest,jsComment,jsString,jsNumber,jsFuncArgDestructuring,jsArrowFunction,jsParen,jsArrowFuncArgs skipwhite skipempty nextgroup=jsFuncBlock extend
syntax match jsFuncArgCommas contained ',' syntax match jsFuncArgCommas contained ','
syntax match jsFuncArgRest contained /\%(\.\.\.[a-zA-Z_$][0-9a-zA-Z_$]*\))/ contains=jsFuncArgRestDots
syntax match jsFuncArgRestDots contained /\.\.\./
syntax keyword jsArguments contained arguments syntax keyword jsArguments contained arguments
" Matches a single keyword argument with no parens " Matches a single keyword argument with no parens
@@ -164,8 +167,8 @@ exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFunc
syntax keyword jsClassKeywords contained extends class syntax keyword jsClassKeywords contained extends class
syntax match jsClassNoise contained /\./ syntax match jsClassNoise contained /\./
syntax match jsClassMethodDefinitions contained /\%(get\|set\|static\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsFuncName,jsClassProperty syntax match jsClassMethodType contained /\%(get\|set\|static\|async\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsFuncName,jsClassProperty
syntax match jsClassDefinition /\<class\>\%( [a-zA-Z_$][0-9a-zA-Z_$ \n.]*\)*/ contains=jsClassKeywords,jsClassNoise skipwhite skipempty nextgroup=jsClassBlock syntax match jsClassDefinition /\<class\>\%( [a-zA-Z_$][0-9a-zA-Z_$ \n.]*\)*/ contains=jsClassKeywords,jsClassNoise skipwhite skipempty nextgroup=jsClassBlock,jsFlowClass
syntax match jsDecorator contained "@" nextgroup=jsDecoratorFunction syntax match jsDecorator contained "@" nextgroup=jsDecoratorFunction
syntax match jsDecoratorFunction contained "[a-zA-Z_][a-zA-Z0-9_.]*" syntax match jsDecoratorFunction contained "[a-zA-Z_][a-zA-Z0-9_.]*"
syntax match jsClassProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsClassValue syntax match jsClassProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsClassValue
@@ -175,41 +178,34 @@ syntax match jsClassFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\
syntax region jsClassStringKey contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs syntax region jsClassStringKey contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs
syntax region jsClassStringKey contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs syntax region jsClassStringKey contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs
" Destructuring
syntax match jsDestructuringPropertyValue contained /\<[0-9a-zA-Z_$]*\>/
syntax match jsDestructuringProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsDestructuringValue
syntax match jsDestructuringAssignment contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsDestructuringValueAssignment
syntax region jsDestructuringValue contained start=/=/ end=/[,}\]]\@=/ contains=@jsExpression extend
syntax region jsDestructuringValueAssignment contained start=/:/ end=/[,}=]\@=/ contains=jsDestructuringPropertyValue,jsDestructuringBlock,jsNoise,jsDestructuringNoise skipwhite skipempty nextgroup=jsDestructuringValue extend
syntax match jsDestructuringNoise contained /[,\[\]]/
syntax region jsDestructuringPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsDestructuringValue,jsDestructuringNoise extend fold
" Comments " Comments
syntax keyword jsCommentTodo contained TODO FIXME XXX TBD syntax keyword jsCommentTodo contained TODO FIXME XXX TBD
syntax region jsComment start=+\/\/+ end=+$+ contains=jsCommentTodo,@Spell extend keepend syntax region jsComment start=/\/\// end=/$/ contains=jsCommentTodo,@Spell extend keepend
syntax region jsComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ contains=jsCommentTodo,@Spell fold extend keepend syntax region jsComment start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell fold extend keepend
syntax region jsComment start="/\*" end="\*/" contains=jsCommentTodo,jsCvsTag,@Spell fold extend keepend syntax region jsEnvComment start=/\%^#!/ end=/$/ display
syntax region jsEnvComment start="\%^#!" end="$" display
syntax region jsCvsTag contained start="\$\cid:" end="\$" oneline
"" JSDoc / JSDoc Toolkit if exists("javascript_plugin_jsdoc")
if !exists("javascript_ignore_javaScriptdoc") runtime extras/jsdoc.vim
"" syntax coloring for javadoc comments (HTML) " NGDoc requires JSDoc
syntax region jsComment matchgroup=jsComment start="/\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold if exists("javascript_plugin_ngdoc")
runtime extras/ngdoc.vim
endif
endif
" tags containing a param if exists("javascript_plugin_flow")
syntax match jsDocTags contained "@\(alias\|api\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam runtime extras/flow.vim
" tags containing type and param endif
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\)\>" skipwhite nextgroup=jsDocType
" tags containing type but no param
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam
" tags containing references
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
" other tags (no extra syntax)
syntax match jsDocTags contained "@\(abstract\|access\|accessor\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|localdoc\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
syntax region jsDocType contained matchgroup=jsDocTypeBrackets start="{" end="}" contains=jsDocTypeRecord oneline skipwhite nextgroup=jsDocParam syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsBlock,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" skipwhite nextgroup=jsDocParam
syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRecord extend
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.{-}]\|=\)\+"
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
endif "" JSDoc end
syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsBlock,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper,jsSpreadOperator
syntax cluster jsAll contains=@jsExpression,jsExportContainer,jsImportContainer,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsStatement,jsException,jsTry,jsAsyncKeyword syntax cluster jsAll contains=@jsExpression,jsExportContainer,jsImportContainer,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsStatement,jsException,jsTry,jsAsyncKeyword
" Define the default highlighting. " Define the default highlighting.
@@ -222,18 +218,9 @@ if version >= 508 || !exists("did_javascript_syn_inits")
else else
command -nargs=+ HiLink hi def link <args> command -nargs=+ HiLink hi def link <args>
endif endif
HiLink jsFuncArgRest Special
HiLink jsComment Comment HiLink jsComment Comment
HiLink jsEnvComment PreProc HiLink jsEnvComment PreProc
HiLink jsCommentTodo Todo HiLink jsCommentTodo Todo
HiLink jsCvsTag Function
HiLink jsDocTags Special
HiLink jsDocSeeTag Function
HiLink jsDocType Type
HiLink jsDocTypeBrackets jsDocType
HiLink jsDocTypeRecord jsDocType
HiLink jsDocTypeNoParam Type
HiLink jsDocParam Label
HiLink jsString String HiLink jsString String
HiLink jsObjectKeyString String HiLink jsObjectKeyString String
HiLink jsTemplateString String HiLink jsTemplateString String
@@ -306,11 +293,20 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsModuleDefault Include HiLink jsModuleDefault Include
HiLink jsDecorator Special HiLink jsDecorator Special
HiLink jsDecoratorFunction Special HiLink jsDecoratorFunction Special
HiLink jsFuncArgRestDots Noise HiLink jsFuncArgOperator jsFuncArgs
HiLink jsFuncArgDestructuring Noise
HiLink jsModuleAsterisk Noise HiLink jsModuleAsterisk Noise
HiLink jsClassProperty jsObjectKey HiLink jsClassProperty jsObjectKey
HiLink jsSpreadOperator Operator HiLink jsSpreadOperator Operator
HiLink jsRestOperator Operator
HiLink jsRestExpression jsFuncArgs
HiLink jsSwitchColon Noise
HiLink jsClassMethodType Type
HiLink jsObjectMethodType Type
HiLink jsDestructuringBraces Noise
HiLink jsDestructuringProperty jsFuncArgs
HiLink jsDestructuringAssignment jsObjectKey
HiLink jsDestructuringNoise Noise
HiLink jsDomErrNo Constant HiLink jsDomErrNo Constant
HiLink jsDomNodeConsts Constant HiLink jsDomNodeConsts Constant
@@ -323,9 +319,6 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsCssStyles Label HiLink jsCssStyles Label
HiLink jsClassMethodDefinitions Type
HiLink jsObjectGetSet Type
delcommand HiLink delcommand HiLink
endif endif

View File

@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
" Vim syntax file " Vim syntax file
" Language: Kotlin " Language: Kotlin
" Maintainer: Alexander Udalov " Maintainer: Alexander Udalov
" Latest Revision: 24 February 2016 " Latest Revision: 4 July 2016
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
@@ -22,14 +22,14 @@ syn keyword ktInclude import package
syn keyword ktType Any Boolean Byte Char Double Float Int Long Nothing Short Unit syn keyword ktType Any Boolean Byte Char Double Float Int Long Nothing Short Unit
syn keyword ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic syn keyword ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic
syn keyword ktStructure class object interface fun val var constructor init syn keyword ktStructure class object interface typealias fun val var constructor init
syn keyword ktReservedKeyword async typealias typeof yield syn keyword ktReservedKeyword typeof
syn keyword ktBoolean true false syn keyword ktBoolean true false
syn keyword ktConstant null syn keyword ktConstant null
syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix coroutine suspend
syn keyword ktTodo TODO FIXME XXX contained syn keyword ktTodo TODO FIXME XXX contained
syn match ktShebang "\v^#!.*$" syn match ktShebang "\v^#!.*$"

View File

@@ -1,164 +1,176 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
" Vim syntax file " Vim syntax file
" Language: Markdown " Language: Markdown
" Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Maintainer: Ben Williams <benw@plasticboy.com>
" Filenames: *.markdown " URL: http://plasticboy.com/markdown-vim-mode/
" Last Change: 2013 May 30 " Remark: Uses HTML syntax file
" TODO: Handle stuff contained within stuff (e.g. headings within blockquotes)
if exists("b:current_syntax")
" Read the HTML syntax to start with
if version < 600
so <sfile>:p:h/html.vim
else
runtime! syntax/html.vim
if exists('b:current_syntax')
unlet b:current_syntax
endif
endif
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
if !exists('main_syntax') " don't use standard HiLink, it will not work with included syntax files
let main_syntax = 'markdown' if version < 508
command! -nargs=+ HtmlHiLink hi link <args>
else
command! -nargs=+ HtmlHiLink hi def link <args>
endif endif
runtime! syntax/html.vim syn spell toplevel
unlet! b:current_syntax
if !exists('g:markdown_fenced_languages')
let g:markdown_fenced_languages = []
endif
let s:done_include = {}
for s:type in map(copy(g:markdown_fenced_languages),'matchstr(v:val,"[^=]*$")')
if has_key(s:done_include, matchstr(s:type,'[^.]*'))
continue
endif
if s:type =~ '\.'
let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*')
endif
exe 'syn include @markdownHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim'
unlet! b:current_syntax
let s:done_include[matchstr(s:type,'[^.]*')] = 1
endfor
unlet! s:type
unlet! s:done_include
syn sync minlines=10
syn case ignore syn case ignore
syn sync linebreaks=1
syn match markdownValid '[<>]\c[a-z/$!]\@!' let s:conceal = ''
syn match markdownValid '&\%(#\=\w*;\)\@!'
syn match markdownLineStart "^[<@]\@!" nextgroup=@markdownBlock,htmlSpecialChar
syn cluster markdownBlock contains=markdownH1,markdownH2,markdownH3,markdownH4,markdownH5,markdownH6,markdownBlockquote,markdownListMarker,markdownOrderedListMarker,markdownCodeBlock,markdownRule
syn cluster markdownInline contains=markdownLineBreak,markdownLinkText,markdownItalic,markdownBold,markdownCode,markdownEscape,@htmlTop,markdownError
syn match markdownH1 "^.\+\n=\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink
syn match markdownH2 "^.\+\n-\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink
syn match markdownHeadingRule "^[=-]\+$" contained
syn region markdownH1 matchgroup=markdownHeadingDelimiter start="##\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
syn region markdownH2 matchgroup=markdownHeadingDelimiter start="###\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
syn region markdownH3 matchgroup=markdownHeadingDelimiter start="####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
syn region markdownH4 matchgroup=markdownHeadingDelimiter start="#####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
syn region markdownH5 matchgroup=markdownHeadingDelimiter start="######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
syn region markdownH6 matchgroup=markdownHeadingDelimiter start="#######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
syn match markdownBlockquote ">\%(\s\|$\)" contained nextgroup=@markdownBlock
syn region markdownCodeBlock start=" \|\t" end="$" contained
" TODO: real nesting
syn match markdownListMarker "\%(\t\| \{0,4\}\)[-*+]\%(\s\+\S\)\@=" contained
syn match markdownOrderedListMarker "\%(\t\| \{0,4}\)\<\d\+\.\%(\s\+\S\)\@=" contained
syn match markdownRule "\* *\* *\*[ *]*$" contained
syn match markdownRule "- *- *-[ -]*$" contained
syn match markdownLineBreak " \{2,\}$"
syn region markdownIdDeclaration matchgroup=markdownLinkDelimiter start="^ \{0,3\}!\=\[" end="\]:" oneline keepend nextgroup=markdownUrl skipwhite
syn match markdownUrl "\S\+" nextgroup=markdownUrlTitle skipwhite contained
syn region markdownUrl matchgroup=markdownUrlDelimiter start="<" end=">" oneline keepend nextgroup=markdownUrlTitle skipwhite contained
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+"+ keepend contained
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained
syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart
syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained
syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained
syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline
let s:concealends = '' let s:concealends = ''
if has('conceal') && get(g:, 'markdown_syntax_conceal', 1) == 1 if has('conceal') && get(g:, 'vim_markdown_conceal', 1)
let s:conceal = ' conceal'
let s:concealends = ' concealends' let s:concealends = ' concealends'
endif endif
exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart' . s:concealends
exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=_\|_\S\@=" end="\S\@<=_\|_\S\@=" keepend contains=markdownLineStart' . s:concealends
exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends
exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=__\|__\S\@=" end="\S\@<=__\|__\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends
exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=markdownLineStart' . s:concealends
exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=___\|___\S\@=" end="\S\@<=___\|___\S\@=" keepend contains=markdownLineStart' . s:concealends
syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart " additions to HTML groups
syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart if get(g:, 'vim_markdown_emphasis_multiline', 1)
syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*```*.*$" end="^\s*```*\ze\s*$" keepend let s:oneline = ''
else
let s:oneline = ' oneline'
endif
execute 'syn region htmlItalic start="\%(^\|\s\)\zs\*\ze[^\\\*\t ]\%(\%([^*]\|\\\*\|\n\)*[^\\\*\t ]\)\?\*\_W" end="[^\\\*\t ]\zs\*\ze\_W" keepend' . s:oneline
execute 'syn region htmlItalic start="\%(^\|\s\)\zs_\ze[^\\_\t ]" end="[^\\_\t ]\zs_\ze\_W" keepend' . s:oneline
execute 'syn region htmlBold start="\%(^\|\s\)\*\*\ze\S" end="\S\zs\*\*" keepend' . s:oneline
execute 'syn region htmlBold start="\%(^\|\s\)\zs__\ze\S" end="\S\zs__" keepend' . s:oneline
execute 'syn region htmlBoldItalic start="\%(^\|\s\)\zs\*\*\*\ze\S" end="\S\zs\*\*\*" keepend' . s:oneline
execute 'syn region htmlBoldItalic start="\%(^\|\s\)\zs___\ze\S" end="\S\zs___" keepend' . s:oneline
syn match markdownFootnote "\[^[^\]]\+\]" " [link](URL) | [link][id] | [link][] | ![image](URL)
syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:" syn region mkdFootnotes matchgroup=mkdDelimiter start="\[^" end="\]"
execute 'syn region mkdID matchgroup=mkdDelimiter start="\[" end="\]" contained oneline' . s:conceal
execute 'syn region mkdURL matchgroup=mkdDelimiter start="(" end=")" contained oneline' . s:conceal
execute 'syn region mkdLink matchgroup=mkdDelimiter start="\\\@<!!\?\[" end="\n\{-,1}[^]]\{-}\zs\]\ze[[(]" contains=@mkdNonListItem,@Spell nextgroup=mkdURL,mkdID skipwhite oneline' . s:concealends
if main_syntax ==# 'markdown' " Autolink without angle brackets.
let s:done_include = {} " mkd inline links: protocol optional user:pass@ sub/domain .com, .co.uk, etc optional port path/querystring/hash fragment
for s:type in g:markdown_fenced_languages " ------------ _____________________ ----------------------------- _________________________ ----------------- __
if has_key(s:done_include, matchstr(s:type,'[^.]*')) syn match mkdInlineURL /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/
continue
endif " Autolink with parenthesis.
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') syn region mkdInlineURL matchgroup=mkdDelimiter start="(\(https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*)\)\@=" end=")"
let s:done_include[matchstr(s:type,'[^.]*')] = 1
endfor " Autolink with angle brackets.
unlet! s:type syn region mkdInlineURL matchgroup=mkdDelimiter start="\\\@<!<\ze[a-z][a-z0-9,.-]\{1,22}:\/\/[^> ]*>" end=">"
unlet! s:done_include
" Link definitions: [id]: URL (Optional Title)
syn region mkdLinkDef matchgroup=mkdDelimiter start="^ \{,3}\zs\[" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite
syn region mkdLinkDefTarget start="<\?\zs\S" excludenl end="\ze[>[:space:]\n]" contained nextgroup=mkdLinkTitle,mkdLinkDef skipwhite skipnl oneline
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+"+ end=+"+ contained
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+ end=+'+ contained
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+ end=+)+ contained
"HTML headings
syn region htmlH1 start="^\s*#" end="$" contains=mkdLink,mkdInlineURL,@Spell
syn region htmlH2 start="^\s*##" end="$" contains=mkdLink,mkdInlineURL,@Spell
syn region htmlH3 start="^\s*###" end="$" contains=mkdLink,mkdInlineURL,@Spell
syn region htmlH4 start="^\s*####" end="$" contains=mkdLink,mkdInlineURL,@Spell
syn region htmlH5 start="^\s*#####" end="$" contains=mkdLink,mkdInlineURL,@Spell
syn region htmlH6 start="^\s*######" end="$" contains=mkdLink,mkdInlineURL,@Spell
syn match htmlH1 /^.\+\n=\+$/ contains=mkdLink,mkdInlineURL,@Spell
syn match htmlH2 /^.\+\n-\+$/ contains=mkdLink,mkdInlineURL,@Spell
"define Markdown groups
syn match mkdLineBreak / \+$/
syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell
syn region mkdCode start=/\(\([^\\]\|^\)\\\)\@<!`/ end=/\(\([^\\]\|^\)\\\)\@<!`/
syn region mkdCode start=/\s*``[^`]*/ end=/[^`]*``\s*/
syn region mkdCode start=/^\s*\z(`\{3,}\)[^`]*$/ end=/^\s*\z1`*\s*$/
syn region mkdCode start=/\s*\~\~[^\~]*/ end=/[^\~]*\~\~\s*/
syn region mkdCode start=/^\s*\z(\~\{3,}\)\s*[0-9A-Za-z_+-]*\s*$/ end=/^\s*\z1\~*\s*$/
syn region mkdCode start="<pre[^>]*\\\@<!>" end="</pre>"
syn region mkdCode start="<code[^>]*\\\@<!>" end="</code>"
syn region mkdFootnote start="\[^" end="\]"
syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/
syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ contained
syn match mkdListItem /^\s*\%([-*+]\|\d\+\.\)\s\+/ contained
syn region mkdListItemLine start="^\s*\%([-*+]\|\d\+\.\)\s\+" end="$" oneline contains=@mkdNonListItem,mkdListItem,@Spell
syn region mkdNonListItemBlock start="\(\%^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@!\|\n\(\_^\_$\|\s\{4,}[^ ]\|\t+[^\t]\)\@!\)" end="^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@=" contains=@mkdNonListItem,@Spell
syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*$/
syn match mkdRule /^\s*-\s\{0,1}-\s\{0,1}-$/
syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_$/
syn match mkdRule /^\s*-\{3,}$/
syn match mkdRule /^\s*\*\{3,5}$/
" YAML frontmatter
if get(g:, 'vim_markdown_frontmatter', 0)
syn include @yamlTop syntax/yaml.vim
syn region Comment matchgroup=mkdDelimiter start="\%^---$" end="^---$" contains=@yamlTop keepend
unlet! b:current_syntax
endif endif
syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]" if get(g:, 'vim_markdown_toml_frontmatter', 0)
syn match markdownError "\w\@<=_\w\@=" try
syn include @tomlTop syntax/toml.vim
hi def link markdownH1 htmlH1 syn region Comment matchgroup=mkdDelimiter start="\%^+++$" end="^+++$" transparent contains=@tomlTop keepend
hi def link markdownH2 htmlH2 unlet! b:current_syntax
hi def link markdownH3 htmlH3 catch /E484/
hi def link markdownH4 htmlH4 syn region Comment matchgroup=mkdDelimiter start="\%^+++$" end="^+++$"
hi def link markdownH5 htmlH5 endtry
hi def link markdownH6 htmlH6
hi def link markdownHeadingRule markdownRule
hi def link markdownHeadingDelimiter Delimiter
hi def link markdownOrderedListMarker markdownListMarker
hi def link markdownListMarker htmlTagName
hi def link markdownBlockquote Comment
hi def link markdownRule PreProc
hi def link markdownFootnote Typedef
hi def link markdownFootnoteDefinition Typedef
hi def link markdownLinkText htmlLink
hi def link markdownIdDeclaration Typedef
hi def link markdownId Type
hi def link markdownAutomaticLink markdownUrl
hi def link markdownUrl Float
hi def link markdownUrlTitle String
hi def link markdownIdDelimiter markdownLinkDelimiter
hi def link markdownUrlDelimiter htmlTag
hi def link markdownUrlTitleDelimiter Delimiter
hi def link markdownItalic htmlItalic
hi def link markdownItalicDelimiter markdownItalic
hi def link markdownBold htmlBold
hi def link markdownBoldDelimiter markdownBold
hi def link markdownBoldItalic htmlBoldItalic
hi def link markdownBoldItalicDelimiter markdownBoldItalic
hi def link markdownCodeDelimiter Delimiter
hi def link markdownEscape Special
hi def link markdownError Error
let b:current_syntax = "markdown"
if main_syntax ==# 'markdown'
unlet main_syntax
endif endif
" vim:set sw=2: if get(g:, 'vim_markdown_json_frontmatter', 0)
try
syn include @jsonTop syntax/json.vim
syn region Comment matchgroup=mkdDelimiter start="\%^{$" end="^}$" contains=@jsonTop keepend
unlet! b:current_syntax
catch /E484/
syn region Comment matchgroup=mkdDelimiter start="\%^{$" end="^}$"
endtry
endif
if get(g:, 'vim_markdown_math', 0)
syn include @tex syntax/tex.vim
syn region mkdMath start="\\\@<!\$" end="\$" contains=@tex keepend
syn region mkdMath start="\\\@<!\$\$" end="\$\$" contains=@tex keepend
endif
syn cluster mkdNonListItem contains=@htmlTop,htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdInlineURL,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,mkdMath
"highlighting for Markdown groups
HtmlHiLink mkdString String
HtmlHiLink mkdCode String
HtmlHiLink mkdCodeStart String
HtmlHiLink mkdCodeEnd String
HtmlHiLink mkdFootnote Comment
HtmlHiLink mkdBlockquote Comment
HtmlHiLink mkdListItem Identifier
HtmlHiLink mkdRule Identifier
HtmlHiLink mkdLineBreak Visual
HtmlHiLink mkdFootnotes htmlLink
HtmlHiLink mkdLink htmlLink
HtmlHiLink mkdURL htmlString
HtmlHiLink mkdInlineURL htmlLink
HtmlHiLink mkdID Identifier
HtmlHiLink mkdLinkDef mkdID
HtmlHiLink mkdLinkDefTarget mkdURL
HtmlHiLink mkdLinkTitle htmlString
HtmlHiLink mkdDelimiter Delimiter
let b:current_syntax = "mkd"
delcommand HtmlHiLink
" vim: ts=8
endif endif

View File

@@ -127,6 +127,7 @@ syn match pgsqlKeyword "\<for\_s\+\(search\|order\_s\+by\)\>"
syn match pgsqlKeyword "\<\(no\_s\+\)\?inherit\>" syn match pgsqlKeyword "\<\(no\_s\+\)\?inherit\>"
syn match pgsqlKeyword "\<\(not\_s\+\)\?of\>" syn match pgsqlKeyword "\<\(not\_s\+\)\?of\>"
syn match pgsqlKeyword "\<primary\_s\+key\>" syn match pgsqlKeyword "\<primary\_s\+key\>"
syn match pgsqlKeyword "\<foreign\_s\+key\>"
syn match pgsqlKeyword "\<replica\_s\+identity\>" syn match pgsqlKeyword "\<replica\_s\+identity\>"
syn match pgsqlKeyword "\<using\(\_s\+index\(\_s\+tablespace\)\?\)\?\>" syn match pgsqlKeyword "\<using\(\_s\+index\(\_s\+tablespace\)\?\)\?\>"
syn match pgsqlKeyword "\<with\(out\)\?\_s\+function\>" syn match pgsqlKeyword "\<with\(out\)\?\_s\+function\>"

View File

@@ -34,8 +34,8 @@ syn cluster pugTop contains=pugBegin,pugComment,pugHtmlComment,pugJavascript
syn match pugBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=pugTag,pugClassChar,pugIdChar,pugPlainChar,pugJavascript,pugScriptConditional,pugScriptStatement,pugPipedText syn match pugBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=pugTag,pugClassChar,pugIdChar,pugPlainChar,pugJavascript,pugScriptConditional,pugScriptStatement,pugPipedText
syn match pugTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@pugComponent syn match pugTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@pugComponent
syn cluster pugComponent contains=pugAttributes,pugIdChar,pugBlockExpansionChar,pugClassChar,pugPlainChar,pugJavascript,pugTagBlockChar,pugTagInlineText syn cluster pugComponent contains=pugAttributes,pugIdChar,pugBlockExpansionChar,pugClassChar,pugPlainChar,pugJavascript,pugTagBlockChar,pugTagInlineText
syn match pugComment '\s*\/\/.*$' syn match pugComment '\(\s\+\|^\)\/\/.*$'
syn region pugCommentBlock start="\z(\s*\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" keepend syn region pugCommentBlock start="\z(\s\+\|^\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" keepend
syn region pugHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->" syn region pugHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,pugHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,pugHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent
syn match pugClassChar "\." contained nextgroup=pugClass syn match pugClassChar "\." contained nextgroup=pugClass

View File

@@ -458,9 +458,9 @@ syn match rubyKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%([_[:lower:]][_[:aln
syn match rubyKeywordAsMethod "\(defined?\|exit!\)\@!\<[_[:lower:]][_[:alnum:]]*[?!]" transparent contains=NONE syn match rubyKeywordAsMethod "\(defined?\|exit!\)\@!\<[_[:lower:]][_[:alnum:]]*[?!]" transparent contains=NONE
" More Symbols {{{1 " More Symbols {{{1
syn match rubySymbol "\%([{(,]\_s*\)\@<=\l\w*[!?]\=::\@!"he=e-1 syn match rubySymbol "\%([{(,]\_s*\)\zs\l\w*[!?]\=::\@!"he=e-1
syn match rubySymbol "[]})\"':]\@1<!\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="he=e-1 syn match rubySymbol "[]})\"':]\@1<!\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="he=e-1
syn match rubySymbol "\%([{(,]\_s*\)\@<=[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1 syn match rubySymbol "\%([{(,]\_s*\)\zs[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1
syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="hs=s+1,he=e-1 syn match rubySymbol "[[:space:],{(]\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*[!?]\=:[[:space:],]\@="hs=s+1,he=e-1
" __END__ Directive {{{1 " __END__ Directive {{{1

View File

@@ -33,15 +33,16 @@ syn keyword tmuxAction any current none
syn keyword tmuxBoolean off on syn keyword tmuxBoolean off on
syn keyword tmuxCmds syn keyword tmuxCmds
\ attach[-session] \ attach
\ bind[-key] \ attach-session
\ bind
\ bind-key
\ break-pane \ break-pane
\ breakp \ breakp
\ capture-pane \ capture-pane
\ capturep \ capturep
\ choose-buffer \ choose-buffer
\ choose-client \ choose-client
\ choose-list
\ choose-session \ choose-session
\ choose-tree \ choose-tree
\ choose-window \ choose-window
@@ -49,124 +50,149 @@ syn keyword tmuxCmds
\ clearhist \ clearhist
\ clock-mode \ clock-mode
\ command-prompt \ command-prompt
\ confirm[-before] \ confirm
\ confirm-before
\ copy-mode \ copy-mode
\ delete-buffer \ delete-buffer
\ deleteb \ deleteb
\ detach[-client] \ detach
\ display[-message] \ detach-client
\ display
\ display-message
\ display-panes \ display-panes
\ displayp \ displayp
\ find-window \ find-window
\ findw \ findw
\ has[-session] \ has
\ if[-shell] \ has-session
\ if
\ if-shell
\ info
\ join-pane \ join-pane
\ joinp \ joinp
\ kill-pane \ kill-pane
\ killp
\ kill-server \ kill-server
\ kill-session \ kill-session
\ kill-window \ kill-window
\ killp
\ killw \ killw
\ last
\ last-pane \ last-pane
\ last-window
\ lastp \ lastp
\ last[-window]
\ link-window \ link-window
\ linkw \ linkw
\ list-buffers \ list-buffers
\ lsb
\ list-clients \ list-clients
\ lsc
\ list-commands \ list-commands
\ lscm
\ list-keys \ list-keys
\ lsk
\ list-panes \ list-panes
\ lsp
\ list-sessions \ list-sessions
\ ls
\ list-windows \ list-windows
\ lsw
\ load-buffer \ load-buffer
\ loadb \ loadb
\ lock
\ lock-client \ lock-client
\ lockc \ lock-server
\ lock[-server]
\ lock-session \ lock-session
\ lockc
\ locks \ locks
\ ls
\ lsb
\ lsc
\ lscm
\ lsk
\ lsp
\ lsw
\ move-pane \ move-pane
\ movep
\ move-window \ move-window
\ movep
\ movew \ movew
\ new[-session] \ new
\ new-session
\ new-window
\ neww
\ next
\ next-layout \ next-layout
\ next-window
\ nextl \ nextl
\ next[-window]
\ paste-buffer \ paste-buffer
\ pasteb \ pasteb
\ path
\ pipe-pane \ pipe-pane
\ pipep \ pipep
\ prev
\ previous-layout \ previous-layout
\ previous-window
\ prevl \ prevl
\ prev[ious-window] \ refresh
\ refresh[-client] \ refresh-client
\ rename[-session] \ rename
\ rename-session
\ rename-window \ rename-window
\ renamew \ renamew
\ resize-pane \ resize-pane
\ resizep \ resizep
\ respawn-pane \ respawn-pane
\ respawnp
\ respawn-window \ respawn-window
\ respawnp
\ respawnw \ respawnw
\ rotate-window \ rotate-window
\ rotatew \ rotatew
\ run[-shell] \ run
\ run-shell
\ save-buffer \ save-buffer
\ saveb \ saveb
\ select-layout \ select-layout
\ selectl
\ select-pane \ select-pane
\ selectp
\ select-window \ select-window
\ selectl
\ selectp
\ selectw \ selectw
\ send[-keys] \ send
\ send-keys
\ send-prefix \ send-prefix
\ server-info \ server-info
\ info \ set
\ set-buffer \ set-buffer
\ setb
\ set-environment \ set-environment
\ setenv \ set-hook
\ set[-option] \ set-option
\ set-window-option \ set-window-option
\ setb
\ setenv
\ setw \ setw
\ show
\ show-buffer \ show-buffer
\ showb
\ show-environment \ show-environment
\ showenv \ show-hooks
\ show-messages \ show-messages
\ showmsgs \ show-options
\ show[-options]
\ show-window-options \ show-window-options
\ showb
\ showenv
\ showmsgs
\ showw \ showw
\ source[-file] \ source
\ source-file
\ split-window \ split-window
\ splitw \ splitw
\ start[-server] \ start
\ start-server
\ suspend-client \ suspend-client
\ suspendc \ suspendc
\ swap-pane \ swap-pane
\ swapp
\ swap-window \ swap-window
\ swapp
\ swapw \ swapw
\ switch-client \ switch-client
\ switchc \ switchc
\ unbind[-key] \ unbind
\ unbind-key
\ unlink-window \ unlink-window
\ unlinkw \ unlinkw
\ wait[-for] \ wait
\ wait-for
syn keyword tmuxOptsSet syn keyword tmuxOptsSet
\ assume-paste-time \ assume-paste-time
@@ -186,19 +212,14 @@ syn keyword tmuxOptsSet
\ escape-time \ escape-time
\ exit-unattached \ exit-unattached
\ focus-events \ focus-events
\ history-file
\ history-limit \ history-limit
\ lock-after-time \ lock-after-time
\ lock-command \ lock-command
\ lock-server
\ message-command-style \ message-command-style
\ message-limit \ message-limit
\ message-style \ message-style
\ mouse-resize-pane \ mouse
\ mouse-select-pane
\ mouse-select-window
\ mouse-utf8
\ pane-active-border-style
\ pane-border-style
\ prefix \ prefix
\ prefix2 \ prefix2
\ quiet \ quiet
@@ -218,8 +239,8 @@ syn keyword tmuxOptsSet
\ status-position \ status-position
\ status-right \ status-right
\ status-right-length \ status-right-length
\ status-utf8 \ status-right-style
\ staus-right-style \ status-style
\ terminal-overrides \ terminal-overrides
\ update-environment \ update-environment
\ visual-activity \ visual-activity
@@ -232,8 +253,7 @@ syn keyword tmuxOptsSetw
\ allow-rename \ allow-rename
\ alternate-screen \ alternate-screen
\ automatic-rename \ automatic-rename
\ c0-change-interval \ automatic-rename-format
\ c0-change-trigger
\ clock-mode-colour \ clock-mode-colour
\ clock-mode-style \ clock-mode-style
\ force-height \ force-height
@@ -241,16 +261,17 @@ syn keyword tmuxOptsSetw
\ main-pane-height \ main-pane-height
\ main-pane-width \ main-pane-width
\ mode-keys \ mode-keys
\ mode-mouse
\ mode-style \ mode-style
\ monitor-activity \ monitor-activity
\ monitor-silence \ monitor-silence
\ other-pane-height \ other-pane-height
\ other-pane-width \ other-pane-width
\ pane-active-border-style
\ pane-base-index \ pane-base-index
\ pane-border-style
\ remain-on-exit \ remain-on-exit
\ synchronize-panes \ synchronize-panes
\ utf8 \ window-active-style
\ window-status-activity-style \ window-status-activity-style
\ window-status-bell-style \ window-status-bell-style
\ window-status-current-format \ window-status-current-format
@@ -259,6 +280,7 @@ syn keyword tmuxOptsSetw
\ window-status-last-style \ window-status-last-style
\ window-status-separator \ window-status-separator
\ window-status-style \ window-status-style
\ window-style
\ wrap-search \ wrap-search
\ xterm-keys \ xterm-keys
@@ -270,7 +292,9 @@ syn match tmuxOptions /\s-\a\+/ display
syn match tmuxVariable /\w\+=/ display syn match tmuxVariable /\w\+=/ display
syn match tmuxVariableExpansion /\${\=\w\+}\=/ display syn match tmuxVariableExpansion /\${\=\w\+}\=/ display
syn region tmuxComment start=/#/ end=/$/ contains=tmuxTodo display oneline " Comments can span multiple lines, when the newline is escaped
" (with a single) backslash at the end.
syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo
syn region tmuxString start=/"/ end=/"/ display oneline syn region tmuxString start=/"/ end=/"/ display oneline
syn region tmuxString start=/'/ end=/'/ display oneline syn region tmuxString start=/'/ end=/'/ display oneline

View File

@@ -61,7 +61,11 @@ syntax case match
syn match typescriptSpecial "\\\d\d\d\|\\." syn match typescriptSpecial "\\\d\d\d\|\\."
syn region typescriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=typescriptSpecial,@htmlPreproc extend syn region typescriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=typescriptSpecial,@htmlPreproc extend
syn region typescriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=typescriptSpecial,@htmlPreproc extend syn region typescriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=typescriptSpecial,@htmlPreproc extend
syn region typescriptStringB start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=typescriptSpecial,@htmlPreproc extend syn region typescriptStringB start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=typescriptInterpolation,typescriptSpecial,@htmlPreproc extend
syn region typescriptInterpolation matchgroup=typescriptInterpolationDelimiter
\ start=/${/ end=/}/ contained
\ contains=@typescriptExpression
syn match typescriptSpecialCharacter "'\\.'" syn match typescriptSpecialCharacter "'\\.'"
syn match typescriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>" syn match typescriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
@@ -114,7 +118,7 @@ syntax keyword typescriptDeprecated escape unescape all applets alinkColor bgCol
syntax keyword typescriptConditional if else switch syntax keyword typescriptConditional if else switch
syntax keyword typescriptRepeat do while for in of syntax keyword typescriptRepeat do while for in of
syntax keyword typescriptBranch break continue yield await syntax keyword typescriptBranch break continue yield await
syntax keyword typescriptLabel case default async syntax keyword typescriptLabel case default async readonly
syntax keyword typescriptStatement return with syntax keyword typescriptStatement return with
syntax keyword typescriptGlobalObjects Array Boolean Date Function Infinity Math Number NaN Object Packages RegExp String Symbol netscape syntax keyword typescriptGlobalObjects Array Boolean Date Function Infinity Math Number NaN Object Packages RegExp String Symbol netscape
@@ -131,7 +135,7 @@ syntax keyword typescriptReserved constructor declare as interface module abstra
syn match typescriptParameters "([a-zA-Z0-9_?.$][\w?.$]*)\s*:\s*([a-zA-Z0-9_?.$][\w?.$]*)" contained skipwhite syn match typescriptParameters "([a-zA-Z0-9_?.$][\w?.$]*)\s*:\s*([a-zA-Z0-9_?.$][\w?.$]*)" contained skipwhite
"}}} "}}}
" DOM2 Objects"{{{ " DOM2 Objects"{{{
syntax keyword typescriptType DOMImplementation DocumentFragment Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction void any string boolean number symbol syntax keyword typescriptType DOMImplementation DocumentFragment Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction void any string boolean number symbol never
syntax keyword typescriptExceptions DOMException syntax keyword typescriptExceptions DOMException
"}}} "}}}
" DOM2 CONSTANT"{{{ " DOM2 CONSTANT"{{{
@@ -249,6 +253,7 @@ if version >= 508 || !exists("did_typescript_syn_inits")
HiLink typescriptStringS String HiLink typescriptStringS String
HiLink typescriptStringD String HiLink typescriptStringD String
HiLink typescriptStringB String HiLink typescriptStringB String
HiLink typescriptInterpolationDelimiter Delimiter
HiLink typescriptRegexpString String HiLink typescriptRegexpString String
HiLink typescriptGlobal Constant HiLink typescriptGlobal Constant
HiLink typescriptCharacter Character HiLink typescriptCharacter Character

View File

@@ -1,7 +1,7 @@
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
endif endif
let b:current_syntax = "vimgo" let b:current_syntax = "vimgo"
@@ -12,4 +12,6 @@ syn region goTitle start="\%1l" end=":"
hi def link goInterface Type hi def link goInterface Type
hi def link goTitle Label hi def link goTitle Label
" vim: sw=2 ts=2 et
endif endif