mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b17b5d4d9f | ||
|
|
bd824d9407 | ||
|
|
c3233deb70 | ||
|
|
bf188c4a51 | ||
|
|
a5857b81c2 | ||
|
|
7a32eec6d1 | ||
|
|
c69562f864 |
22
README.md
22
README.md
@@ -43,7 +43,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
|
||||
- [elixir](https://github.com/elixir-lang/vim-elixir) (syntax, indent, compiler, ftplugin, ftdetect)
|
||||
- [elm](https://github.com/lambdatoast/elm.vim) (syntax, indent, autoload, ftplugin, ftdetect)
|
||||
- [emberscript](https://github.com/heartsentwined/vim-ember-script) (syntax, indent, ftplugin, ftdetect)
|
||||
- [emblem](https://github.com/heartsentwined/vim-emblem) (syntax, indent, ftplugin, ftdetect)
|
||||
- [emblem](https://github.com/yalesov/vim-emblem) (syntax, indent, ftplugin, 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)
|
||||
- [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)
|
||||
- [liquid](https://github.com/tpope/vim-liquid) (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)
|
||||
- [nim](https://github.com/zah/nim.vim) (syntax, compiler, indent, 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)
|
||||
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, 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)
|
||||
- [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin, 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)
|
||||
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, 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)
|
||||
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect)
|
||||
- [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)
|
||||
- [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
|
||||
" ~/.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.
|
||||
|
||||
## Updating
|
||||
|
||||
You can either wait for new patch release with updates or run the `./build` script by yourself.
|
||||
|
||||
## Contributing
|
||||
|
||||
Language packs are periodically updated using automated `build` script.
|
||||
|
||||
9
build
9
build
@@ -5,6 +5,7 @@ set -E
|
||||
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_ALL="syntax indent compiler autoload ftplugin ftdetect after"
|
||||
DIRS_SYNTAX="syntax ftdetect after/syntax after/ftdetect"
|
||||
|
||||
OUTPUT=""
|
||||
|
||||
@@ -74,7 +75,7 @@ copy_dir() {
|
||||
}
|
||||
|
||||
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/*
|
||||
mv tmp/polyglot.vim ftdetect/
|
||||
}
|
||||
@@ -114,7 +115,7 @@ PACKS="
|
||||
elixir:elixir-lang/vim-elixir
|
||||
elm:lambdatoast/elm.vim
|
||||
emberscript:heartsentwined/vim-ember-script
|
||||
emblem:heartsentwined/vim-emblem
|
||||
emblem:yalesov/vim-emblem
|
||||
erlang:vim-erlang/vim-erlang-runtime
|
||||
fish:dag/vim-fish
|
||||
git:tpope/vim-git
|
||||
@@ -137,7 +138,7 @@ PACKS="
|
||||
less:groenewege/vim-less
|
||||
liquid:tpope/vim-liquid
|
||||
mako:sophacles/vim-bundle-mako
|
||||
markdown:tpope/vim-markdown
|
||||
markdown:plasticboy/vim-markdown:_SYNTAX
|
||||
nginx:othree/nginx-contrib-vim
|
||||
nim:zah/nim.vim:_BASIC
|
||||
nix:spwhitt/vim-nix
|
||||
@@ -170,7 +171,7 @@ PACKS="
|
||||
systemd:kurayama/systemd-vim-syntax
|
||||
textile:timcharper/textile.vim
|
||||
thrift:solarnz/thrift.vim
|
||||
tmux:tejr/vim-tmux
|
||||
tmux:keith/tmux.vim
|
||||
tomdoc:wellbredgrapefruit/tomdoc.vim
|
||||
toml:cespare/vim-toml
|
||||
twig:evidens/vim-twig
|
||||
|
||||
@@ -18,9 +18,9 @@ endif
|
||||
let s:save_cpo = &cpo
|
||||
set cpo-=C
|
||||
if filereadable("makefile") || filereadable("Makefile")
|
||||
CompilerSet makeprg=make
|
||||
CompilerSet makeprg=make
|
||||
else
|
||||
CompilerSet makeprg=go\ build
|
||||
CompilerSet makeprg=go\ build
|
||||
endif
|
||||
|
||||
" 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
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim:ts=4:sw=4:et
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
" ftdetect/ansible.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
|
||||
|
||||
function! s:isAnsible()
|
||||
@@ -6,129 +7,238 @@ function! s:isAnsible()
|
||||
if filepath =~ '\v/(tasks|roles|handlers)/.*\.ya?ml$' | return 1 | en
|
||||
if filepath =~ '\v/(group|host)_vars/' | return 1 | en
|
||||
if filename =~ '\v(playbook|site|main|local)\.ya?ml$' | return 1 | en
|
||||
|
||||
let shebang = getline(1)
|
||||
if shebang =~# '^#!.*/bin/env\s\+ansible-playbook\>' | return 1 | en
|
||||
if shebang =~# '^#!.*/bin/ansible-playbook\>' | return 1 | en
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
:au BufNewFile,BufRead * if s:isAnsible() | set ft=ansible | en
|
||||
:au BufNewFile,BufRead *.j2 set ft=ansible_template
|
||||
:au BufNewFile,BufRead hosts set ft=ansible_hosts
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/arduino.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'arduino') == -1
|
||||
|
||||
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/blade.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'blade') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.blade.php set filetype=blade
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/cjsx.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cjsx') == -1
|
||||
|
||||
augroup CJSX
|
||||
au!
|
||||
autocmd BufNewFile,BufRead *.csx,*.cjsx set filetype=coffee
|
||||
augroup END
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/clojure.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc setlocal filetype=clojure
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/coffee.vim
|
||||
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 *Cakefile set filetype=coffee
|
||||
autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee
|
||||
autocmd BufNewFile,BufRead *._coffee set filetype=coffee
|
||||
|
||||
function! s:DetectCoffee()
|
||||
if getline(1) =~ '^#!.*\<coffee\>'
|
||||
set filetype=coffee
|
||||
endif
|
||||
endfunction
|
||||
|
||||
autocmd BufNewFile,BufRead * call s:DetectCoffee()
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/cql.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cql') == -1
|
||||
|
||||
if has("autocmd")
|
||||
au BufNewFile,BufRead *.cql set filetype=cql
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/cryptol.vim
|
||||
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 *.cyl set filetype=cryptol
|
||||
" Literate Cryptol Program;
|
||||
au! BufRead,BufNewFile *.lcry set filetype=cryptol
|
||||
au! BufRead,BufNewFile *.lcyl set filetype=cryptol
|
||||
" Also in LaTeX *.tex which is outside our coverage scope.
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/crystal.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
||||
|
||||
autocmd BufNewFile,BufReadPost *.cr setlocal filetype=crystal
|
||||
autocmd BufNewFile,BufReadPost Projectfile setlocal filetype=crystal
|
||||
autocmd BufNewFile,BufReadPost *.ecr setlocal filetype=eruby
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/cucumber.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -1
|
||||
|
||||
" Cucumber
|
||||
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/dart.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
|
||||
|
||||
autocmd BufRead,BufNewFile *.dart set filetype=dart
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/dockerfile.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
|
||||
|
||||
au BufNewFile,BufRead Dockerfile set filetype=dockerfile
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/elixir.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
|
||||
|
||||
au BufRead,BufNewFile *.ex,*.exs call s:setf('elixir')
|
||||
au BufRead,BufNewFile *.eex call s:setf('eelixir')
|
||||
au BufRead,BufNewFile * call s:DetectElixir()
|
||||
|
||||
au FileType elixir,eelixir setl sw=2 sts=2 et iskeyword+=!,?
|
||||
|
||||
function! s:setf(filetype) abort
|
||||
let &filetype = a:filetype
|
||||
endfunction
|
||||
|
||||
function! s:DetectElixir()
|
||||
if getline(1) =~ '^#!.*\<elixir\>'
|
||||
call s:setf('elixir')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/elm.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
|
||||
|
||||
au BufNewFile,BufRead *.elm set filetype=elm
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/ember-script.vim
|
||||
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.3
|
||||
" Last Change: 2016 Jul 5
|
||||
" License: GPL-3.0
|
||||
|
||||
if !exists('g:vim_ember_script')
|
||||
let g:vim_ember_script = 1
|
||||
endif
|
||||
|
||||
autocmd BufNewFile,BufRead *.em set filetype=ember-script
|
||||
autocmd FileType ember-script set tabstop=2|set shiftwidth=2|set expandtab
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/emblem.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
|
||||
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
|
||||
" Language: emblem
|
||||
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
|
||||
" URL: http://github.com/yalesov/vim-emblem
|
||||
" Version: 2.0.0
|
||||
" Last Change: 2016 Jul 5
|
||||
" License: GPL-3.0
|
||||
|
||||
if !exists('g:vim_emblem')
|
||||
let g:vim_emblem = 1
|
||||
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
|
||||
|
||||
au BufNewFile,BufRead *.erl,*.hrl,rebar.config,*.app,*.app.src,*.yaws,*.xrl set ft=erlang
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/fish.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fish') == -1
|
||||
|
||||
autocmd BufRead,BufNewFile *.fish setfiletype fish
|
||||
|
||||
" Detect fish scripts by the shebang line.
|
||||
autocmd BufRead *
|
||||
\ if getline(1) =~# '\v^#!%(\f*/|/usr/bin/env\s*<)fish>' |
|
||||
\ setlocal filetype=fish |
|
||||
\ endif
|
||||
|
||||
" Move cursor to first empty line when using funced.
|
||||
autocmd BufRead fish_funced_*_*.fish call search('^$')
|
||||
|
||||
" Fish histories are YAML documents.
|
||||
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
|
||||
|
||||
" Mimic `funced` when manually creating functions.
|
||||
autocmd BufNewFile ~/.config/fish/functions/*.fish
|
||||
\ call append(0, ['function '.expand('%:t:r'),
|
||||
\'',
|
||||
\'end']) |
|
||||
\ 2
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/git.vim
|
||||
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/config,.gitconfig,gitconfig,.gitmodules 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: ' |
|
||||
\ set ft=git |
|
||||
\ endif
|
||||
|
||||
" This logic really belongs in scripts.vim
|
||||
autocmd BufNewFile,BufRead,StdinReadPost *
|
||||
\ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' |
|
||||
\ set ft=git |
|
||||
@@ -147,92 +259,153 @@ autocmd BufNewFile,BufRead *
|
||||
\ if getline(1) =~ '^From \x\{40\} Mon Sep 17 00:00:00 2001$' |
|
||||
\ set filetype=gitsendemail |
|
||||
\ endif
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/glsl.vim
|
||||
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
|
||||
|
||||
" vim:set sts=2 sw=2 :
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/gofiletype.vim
|
||||
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_fileencodings = ''
|
||||
|
||||
" define fileencodings to open as utf-8 encoding even if it's ascii.
|
||||
function! s:gofiletype_pre(type)
|
||||
let s:current_fileformats = &g:fileformats
|
||||
let s:current_fileencodings = &g:fileencodings
|
||||
set fileencodings=utf-8 fileformats=unix
|
||||
let &l:filetype = a:type
|
||||
let s:current_fileformats = &g:fileformats
|
||||
let s:current_fileencodings = &g:fileencodings
|
||||
set fileencodings=utf-8 fileformats=unix
|
||||
let &l:filetype = a:type
|
||||
endfunction
|
||||
|
||||
" restore fileencodings as others
|
||||
function! s:gofiletype_post()
|
||||
let &g:fileformats = s:current_fileformats
|
||||
let &g:fileencodings = s:current_fileencodings
|
||||
let &g:fileformats = s:current_fileformats
|
||||
let &g:fileencodings = s:current_fileencodings
|
||||
endfunction
|
||||
|
||||
au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix
|
||||
au BufRead *.go call s:gofiletype_pre("go")
|
||||
au BufReadPost *.go call s:gofiletype_post()
|
||||
|
||||
au BufNewFile *.s setfiletype asm | setlocal fileencoding=utf-8 fileformat=unix
|
||||
au BufRead *.s call s:gofiletype_pre("asm")
|
||||
au BufReadPost *.s call s:gofiletype_post()
|
||||
|
||||
au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/haml.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml
|
||||
autocmd BufNewFile,BufRead *.sass setf sass
|
||||
autocmd BufNewFile,BufRead *.scss setf scss
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/haskell.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
||||
|
||||
au BufRead,BufNewFile *.hsc set filetype=haskell
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/haxe.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haxe') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.hx setf haxe
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/jasmine.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *Spec.js,*_spec.js set filetype=jasmine.javascript syntax=jasmine
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/javascript.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
||||
|
||||
au BufNewFile,BufRead *.js setf javascript
|
||||
au BufNewFile,BufRead *.jsm setf javascript
|
||||
au BufNewFile,BufRead Jakefile setf javascript
|
||||
|
||||
fun! s:SelectJavascript()
|
||||
if getline(1) =~# '^#!.*/bin/\%(env\s\+\)\?node\>'
|
||||
set ft=javascript
|
||||
endif
|
||||
endfun
|
||||
au BufNewFile,BufRead * call s:SelectJavascript()
|
||||
|
||||
endif
|
||||
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')
|
||||
let g:jsx_ext_required = 1
|
||||
endif
|
||||
|
||||
" Whether the @jsx pragma is required.
|
||||
if !exists('g:jsx_pragma_required')
|
||||
let g:jsx_pragma_required = 0
|
||||
endif
|
||||
|
||||
if g:jsx_pragma_required
|
||||
" Look for the @jsx pragma. It must be included in a docblock comment before
|
||||
" anything else in the file (except whitespace).
|
||||
let s:jsx_pragma_pattern = '\%^\_s*\/\*\*\%(\_.\%(\*\/\)\@!\)*@jsx\_.\{-}\*\/'
|
||||
let b:jsx_pragma_found = search(s:jsx_pragma_pattern, 'npw')
|
||||
endif
|
||||
|
||||
" Whether to set the JSX filetype on *.js files.
|
||||
fu! <SID>EnableJSX()
|
||||
if g:jsx_pragma_required && !b:jsx_pragma_found | return 0 | endif
|
||||
if g:jsx_ext_required && !exists('b:jsx_ext_found') | return 0 | endif
|
||||
return 1
|
||||
endfu
|
||||
|
||||
autocmd BufNewFile,BufRead *.jsx let b:jsx_ext_found = 1
|
||||
autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx
|
||||
autocmd BufNewFile,BufRead *.js
|
||||
\ if <SID>EnableJSX() | set filetype=javascript.jsx | endif
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/json.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.json set filetype=json
|
||||
autocmd BufNewFile,BufRead *.jsonp set filetype=json
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/jst.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jst') == -1
|
||||
|
||||
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 *.hamljs set filetype=jst
|
||||
au BufNewFile,BufRead *.ect set filetype=jst
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/julia.vim
|
||||
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 set filetype=julia
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/kotlin.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.kt setfiletype kotlin
|
||||
autocmd BufNewFile,BufRead *.kts setfiletype kotlin
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/less.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.less setf less
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/liquid.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'liquid') == -1
|
||||
|
||||
" Liquid
|
||||
au BufNewFile,BufRead *.liquid set ft=liquid
|
||||
|
||||
au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html set ft=liquid
|
||||
au BufNewFile,BufRead *.html,*.xml,*.textile
|
||||
\ if getline(1) == '---' | set ft=liquid | endif
|
||||
@@ -266,188 +457,359 @@ au BufNewFile,BufRead *.markdown,*.mkd,*.mkdn,*.md
|
||||
\ let b:liquid_subtype = 'markdown' |
|
||||
\ set ft=liquid |
|
||||
\ endif
|
||||
|
||||
" Set subtype for Shopify alternate templates
|
||||
au BufNewFile,BufRead */templates/**.liquid,*/layout/**.liquid,*/snippets/**.liquid
|
||||
\ let b:liquid_subtype = 'html' |
|
||||
\ set ft=liquid |
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/mako.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mako') == -1
|
||||
|
||||
au BufRead,BufNewFile *.mako set filetype=mako
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/markdown.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mkd,*.mkdn
|
||||
\ if &ft =~# '^\%(conf\|modula2\)$' |
|
||||
\ set ft=markdown |
|
||||
\ else |
|
||||
\ setf markdown |
|
||||
\ endif
|
||||
" markdown filetype file
|
||||
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=markdown
|
||||
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx} set filetype=markdown
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/mason-in-html.vim
|
||||
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
|
||||
\ if getline(1) =~ '^\(%\|<[%&].*>\)' |
|
||||
\ set filetype=mason |
|
||||
\ endif
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/mustache.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1
|
||||
|
||||
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 *.handlebars,*.hbs set filetype=html.handlebars syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/nginx.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
||||
|
||||
au BufRead,BufNewFile *.nginx set ft=nginx
|
||||
au BufRead,BufNewFile */etc/nginx/* set ft=nginx
|
||||
au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx
|
||||
au BufRead,BufNewFile nginx.conf set ft=nginx
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/nim.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nim') == -1
|
||||
|
||||
au BufNewFile,BufRead *.nim,*.nims set filetype=nim
|
||||
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/nix.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nix') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.nix setfiletype nix
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/opencl.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'opencl') == -1
|
||||
|
||||
au! BufRead,BufNewFile *.cl set filetype=opencl
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/perl11.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
|
||||
|
||||
function! s:DetectPerl6()
|
||||
let line_no = 1
|
||||
let eof = line('$')
|
||||
let in_pod = 0
|
||||
|
||||
while line_no <= eof
|
||||
let line = getline(line_no)
|
||||
let line_no = line_no + 1
|
||||
|
||||
if line =~ '^=\w'
|
||||
let in_pod = 1
|
||||
elseif line =~ '^=\%(end\|cut\)'
|
||||
let in_pod = 0
|
||||
elseif !in_pod
|
||||
let line = substitute(line, '#.*', '', '')
|
||||
|
||||
if line =~ '^\s*$'
|
||||
continue
|
||||
endif
|
||||
|
||||
if line =~ '^\s*\%(use\s\+\)\=v6\%(\.\d\%(\.\d\)\=\)\=;'
|
||||
set filetype=perl6 " we matched a 'use v6' declaration
|
||||
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
|
||||
endif
|
||||
|
||||
break " we either found what we needed, or we found a non-POD, non-comment,
|
||||
" non-Perl 6 indicating line, so bail out
|
||||
endif
|
||||
endwhile
|
||||
endfunction
|
||||
|
||||
autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6()
|
||||
autocmd BufNew,BufNewFile,BufRead *.nqp setf perl6
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/pgsql.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pgsql') == -1
|
||||
|
||||
" postgreSQL
|
||||
au BufNewFile,BufRead *.pgsql setf pgsql
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/plantuml.vim
|
||||
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()
|
||||
finish
|
||||
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
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/proto.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'protobuf') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.proto setfiletype proto
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/ps1.vim
|
||||
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 *.psd1 set ft=ps1
|
||||
au BufNewFile,BufRead *.psm1 set ft=ps1
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/ps1xml.vim
|
||||
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
|
||||
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/pug.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pug') == -1
|
||||
|
||||
" Pug
|
||||
autocmd BufNewFile,BufReadPost *.pug set filetype=pug
|
||||
|
||||
" Jade
|
||||
autocmd BufNewFile,BufReadPost *.jade set filetype=pug
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/puppet.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
|
||||
|
||||
au! BufRead,BufNewFile *.pp setfiletype puppet
|
||||
au! BufRead,BufNewFile Puppetfile setfiletype ruby
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/purescript.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'purescript') == -1
|
||||
|
||||
au BufNewFile,BufRead *.purs setf purescript
|
||||
au FileType purescript let &l:commentstring='{--%s--}'
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/qml.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
|
||||
|
||||
autocmd BufRead,BufNewFile *.qml setfiletype qml
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/ruby.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
||||
|
||||
" Officially distributed filetypes
|
||||
|
||||
" Support functions {{{
|
||||
function! s:setf(filetype) abort
|
||||
if &filetype !=# a:filetype
|
||||
let &filetype = a:filetype
|
||||
endif
|
||||
endfunction
|
||||
|
||||
func! s:StarSetf(ft)
|
||||
if expand("<amatch>") !~ g:ft_ignore_pat
|
||||
exe 'setf ' . a:ft
|
||||
endif
|
||||
endfunc
|
||||
" }}}
|
||||
|
||||
" HTML with Ruby - eRuby
|
||||
au BufNewFile,BufRead *.erb,*.rhtml call s:setf('eruby')
|
||||
|
||||
" Interactive Ruby shell
|
||||
au BufNewFile,BufRead .irbrc,irbrc call s:setf('ruby')
|
||||
|
||||
" Ruby
|
||||
au BufNewFile,BufRead *.rb,*.rbw,*.gemspec call s:setf('ruby')
|
||||
|
||||
" Rackup
|
||||
au BufNewFile,BufRead *.ru call s:setf('ruby')
|
||||
|
||||
" Bundler
|
||||
au BufNewFile,BufRead Gemfile call s:setf('ruby')
|
||||
|
||||
" Ruby on Rails
|
||||
au BufNewFile,BufRead *.builder,*.rxml,*.rjs,*.ruby call s:setf('ruby')
|
||||
|
||||
" Rakefile
|
||||
au BufNewFile,BufRead [rR]akefile,*.rake call s:setf('ruby')
|
||||
au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby')
|
||||
|
||||
" TODO: does anyone still use Rantfiles? Remove for Vim 8?
|
||||
" Rantfile
|
||||
au BufNewFile,BufRead [rR]antfile,*.rant call s:setf('ruby')
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/ruby_extra.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
||||
|
||||
" All other filetypes
|
||||
|
||||
" Support functions {{{
|
||||
function! s:setf(filetype) abort
|
||||
if &filetype !=# a:filetype
|
||||
let &filetype = a:filetype
|
||||
endif
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
" Appraisal
|
||||
au BufNewFile,BufRead Appraisals call s:setf('ruby')
|
||||
|
||||
" Autotest
|
||||
au BufNewFile,BufRead .autotest call s:setf('ruby')
|
||||
|
||||
" Buildr Buildfile
|
||||
au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby')
|
||||
|
||||
" Capistrano
|
||||
au BufNewFile,BufRead Capfile,*.cap call s:setf('ruby')
|
||||
|
||||
" Chef
|
||||
au BufNewFile,BufRead Cheffile call s:setf('ruby')
|
||||
au BufNewFile,BufRead Berksfile call s:setf('ruby')
|
||||
|
||||
" CocoaPods
|
||||
au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
|
||||
|
||||
" Guard
|
||||
au BufNewFile,BufRead Guardfile,.Guardfile call s:setf('ruby')
|
||||
|
||||
" Jbuilder
|
||||
au BufNewFile,BufRead *.jbuilder call s:setf('ruby')
|
||||
|
||||
" Kitchen Sink
|
||||
au BufNewFile,BufRead KitchenSink call s:setf('ruby')
|
||||
|
||||
" Opal
|
||||
au BufNewFile,BufRead *.opal call s:setf('ruby')
|
||||
|
||||
" Pry config
|
||||
au BufNewFile,BufRead .pryrc call s:setf('ruby')
|
||||
|
||||
" Puppet librarian
|
||||
au BufNewFile,BufRead Puppetfile call s:setf('ruby')
|
||||
|
||||
" Rabl
|
||||
au BufNewFile,BufRead *.rabl call s:setf('ruby')
|
||||
|
||||
" Routefile
|
||||
au BufNewFile,BufRead [rR]outefile call s:setf('ruby')
|
||||
au BufNewFile,BufRead .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')
|
||||
|
||||
" Vagrant
|
||||
au BufNewFile,BufRead [vV]agrantfile call s:setf('ruby')
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/rust.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
|
||||
au BufRead,BufNewFile *.rs set filetype=rust
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/sbt.vim
|
||||
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
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/scala.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scala') == -1
|
||||
|
||||
fun! s:DetectScala()
|
||||
@@ -455,23 +817,39 @@ fun! s:DetectScala()
|
||||
set filetype=scala
|
||||
endif
|
||||
endfun
|
||||
|
||||
au BufRead,BufNewFile *.scala set filetype=scala
|
||||
au BufRead,BufNewFile * call s:DetectScala()
|
||||
|
||||
" Install vim-sbt for additional syntax highlighting.
|
||||
au BufRead,BufNewFile *.sbt setfiletype sbt.scala
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/slim.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.slim setf slim
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/solidity.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'solidity') == -1
|
||||
|
||||
au BufNewFile,BufRead *.sol setf solidity
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/stylus.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'stylus') == -1
|
||||
|
||||
" Stylus
|
||||
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
|
||||
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/swift.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.swift set filetype=swift
|
||||
@@ -480,12 +858,16 @@ function! s:Swift()
|
||||
if !empty(&filetype)
|
||||
return
|
||||
endif
|
||||
|
||||
let line = getline(1)
|
||||
if line =~ "^#!.*swift"
|
||||
setfiletype swift
|
||||
endif
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/systemd.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'systemd') == -1
|
||||
|
||||
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 *.target set filetype=systemd
|
||||
au BufNewFile,BufRead *.timer set filetype=systemd
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/textile.vim
|
||||
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
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/thrift.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'thrift') == -1
|
||||
|
||||
au BufNewFile,BufRead *.thrift setlocal filetype=thrift
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/tmux.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal filetype=tmux
|
||||
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal commentstring=#\ %s
|
||||
autocmd BufNewFile,BufRead {.,}tmux*.conf* setfiletype tmux
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/toml.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1
|
||||
|
||||
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
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/typescript.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
||||
|
||||
autocmd BufNewFile,BufRead *.ts,*.tsx setlocal filetype=typescript
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/vala.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1
|
||||
|
||||
autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
|
||||
au BufRead,BufNewFile *.vala,*.vapi setfiletype vala
|
||||
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/vcl.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vcl') == -1
|
||||
|
||||
au BufRead,BufNewFile *.vcl set filetype=vcl
|
||||
|
||||
endif
|
||||
|
||||
" ftdetect/velocity.vim
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vm') == -1
|
||||
|
||||
au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity
|
||||
|
||||
endif
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ endif
|
||||
runtime! ftplugin/html.vim
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal iskeyword+=@-@
|
||||
setlocal suffixesadd=.blade.php,.php
|
||||
setlocal includeexpr=substitute(v:fname,'\\.','/','g')
|
||||
setlocal path+=resources/views;
|
||||
|
||||
endif
|
||||
|
||||
@@ -15,7 +15,7 @@ call coffee#CoffeeSetUpVariables()
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
setlocal comments=:# commentstring=#\ %s
|
||||
setlocal omnifunc=javascriptcomplete#CompleteJS
|
||||
setlocal suffixesadd+=coffee
|
||||
setlocal suffixesadd+=.coffee
|
||||
|
||||
" Create custom augroups.
|
||||
augroup CoffeeBufUpdate | augroup END
|
||||
|
||||
@@ -56,6 +56,6 @@ let &l:path =
|
||||
setlocal includeexpr=GetElixirFilename(v:fname)
|
||||
setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl
|
||||
|
||||
setlocal formatoptions-=t formatoptions+=croqlj
|
||||
silent! setlocal formatoptions-=t formatoptions+=croqlj
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
|
||||
|
||||
" Language: ember-script
|
||||
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
|
||||
" URL: http://github.com/heartsentwined/vim-ember-script
|
||||
" Version: 1.0.1
|
||||
" Last Change: 2013 Apr 17
|
||||
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
|
||||
" URL: http://github.com/yalesov/vim-ember-script
|
||||
" Version: 1.0.3
|
||||
" Last Change: 2016 Jul 5
|
||||
" License: GPL-3.0
|
||||
|
||||
setlocal tabstop=2
|
||||
@@ -14,7 +14,11 @@ setlocal smarttab
|
||||
setlocal expandtab
|
||||
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 commentstring=#\ %s
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
||||
|
||||
" Language: emblem
|
||||
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
|
||||
" URL: http://github.com/heartsentwined/vim-emblem
|
||||
" Version: 1.2.0
|
||||
" Last Change: 2013 Apr 22
|
||||
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
|
||||
" URL: http://github.com/yalesov/vim-emblem
|
||||
" Version: 2.0.0
|
||||
" Last Change: 2016 Jul 5
|
||||
" License: GPL-3.0
|
||||
|
||||
setlocal tabstop=2
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
||||
|
||||
" Vim filetype plugin
|
||||
" Language: Markdown
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2013 May 30
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
|
||||
|
||||
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=<!--%s-->
|
||||
setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
|
||||
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:
|
||||
|
||||
if exists('b:undo_ftplugin')
|
||||
let b:undo_ftplugin .= "|setl cms< com< fo< flp<"
|
||||
else
|
||||
let b:undo_ftplugin = "setl cms< com< fo< flp<"
|
||||
endif
|
||||
|
||||
function! MarkdownFold()
|
||||
let line = getline(v:lnum)
|
||||
|
||||
" Regular headers
|
||||
let depth = match(line, '\(^#\+\)\@<=\( .*$\)\@=')
|
||||
if depth > 0
|
||||
return ">" . depth
|
||||
endif
|
||||
|
||||
" Setext style headings
|
||||
let nextline = getline(v:lnum + 1)
|
||||
if (line =~ '^.\+$') && (nextline =~ '^=\+$')
|
||||
return ">1"
|
||||
endif
|
||||
|
||||
if (line =~ '^.\+$') && (nextline =~ '^-\+$')
|
||||
return ">2"
|
||||
endif
|
||||
|
||||
return "="
|
||||
endfunction
|
||||
|
||||
if has("folding") && exists("g:markdown_folding")
|
||||
setlocal foldexpr=MarkdownFold()
|
||||
setlocal foldmethod=expr
|
||||
let b:undo_ftplugin .= " foldexpr< foldmethod<"
|
||||
endif
|
||||
|
||||
" vim:set sw=2:
|
||||
|
||||
endif
|
||||
@@ -77,20 +77,20 @@ function! s:query_path(root) abort
|
||||
let prefix = ''
|
||||
endif
|
||||
if &shellxquote == "'"
|
||||
let path_check = prefix.'ruby -e "' . code . '"'
|
||||
let path_check = prefix.'ruby -e --disable-gems"' . code . '"'
|
||||
else
|
||||
let path_check = prefix."ruby -e '" . code . "'"
|
||||
let path_check = prefix."ruby -e --disable-gems'" . code . "'"
|
||||
endif
|
||||
|
||||
let cd = haslocaldir() ? 'lcd' : 'cd'
|
||||
let cwd = getcwd()
|
||||
let cwd = fnameescape(getcwd())
|
||||
try
|
||||
exe cd fnameescape(a:root)
|
||||
let path = split(system(path_check),',')
|
||||
exe cd fnameescape(cwd)
|
||||
exe cd cwd
|
||||
return path
|
||||
finally
|
||||
exe cd fnameescape(cwd)
|
||||
exe cd cwd
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
||||
" Description: Vim syntax file for Rust
|
||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||
" Maintainer: Kevin Ballard <kevin@sb.org>
|
||||
" Last Change: January 29, 2015
|
||||
" Last Change: June 08, 2016
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -14,6 +14,9 @@ let b:did_ftplugin = 1
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
augroup rust.vim
|
||||
autocmd!
|
||||
|
||||
" Variables {{{1
|
||||
|
||||
" 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")
|
||||
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
|
||||
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
|
||||
|
||||
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
|
||||
@@ -161,10 +190,13 @@ let b:undo_ftplugin = "
|
||||
\|ounmap <buffer> ]]
|
||||
\|set matchpairs-=<:>
|
||||
\|unlet b:match_skip
|
||||
\|augroup! rust.vim
|
||||
\"
|
||||
|
||||
" }}}1
|
||||
|
||||
augroup END
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
|
||||
5
ftplugin/tmux.vim
Normal file
5
ftplugin/tmux.vim
Normal file
@@ -0,0 +1,5 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1
|
||||
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
endif
|
||||
@@ -7,13 +7,20 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'blade') == -1
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! indent/html.vim
|
||||
let s:htmlindent = &indentexpr
|
||||
unlet! b:did_indent
|
||||
|
||||
runtime! indent/php.vim
|
||||
let s:phpindent = &indentexpr
|
||||
unlet! b:did_indent
|
||||
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal autoindent
|
||||
setlocal indentexpr=GetBladeIndent()
|
||||
setlocal indentkeys=o,O,*<Return>,<>>,!^F,=@else,=@end,=@empty,=@show
|
||||
setlocal indentkeys=o,O,*<Return>,<>>,!^F,=@else,=@end,=@empty,=@show,=@stop
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetBladeIndent")
|
||||
@@ -29,27 +36,32 @@ function! GetBladeIndent()
|
||||
let line = substitute(substitute(getline(lnum), '\s\+$', '', ''), '^\s\+', '', '')
|
||||
let cline = substitute(substitute(getline(v:lnum), '\s\+$', '', ''), '^\s\+', '', '')
|
||||
let indent = indent(lnum)
|
||||
let cindent = indent(v:lnum)
|
||||
if cline =~# '@\%(else\|elseif\|empty\|end\|show\)'
|
||||
if cline =~# '@\%(else\|elseif\|empty\|end\|show\|stop\)' ||
|
||||
\ cline =~# '\%(<?.*\)\@<!?>\|\%({{.*\)\@<!}}\|\%({!!.*\)\@<!!!}'
|
||||
let indent = indent - &sw
|
||||
elseif line =~# '<?\%(.*?>\)\@!'
|
||||
let indent = indent + &sw
|
||||
else
|
||||
if exists("*GetBladeIndentCustom")
|
||||
let hindent = GetBladeIndentCustom()
|
||||
elseif searchpair('@include\s*(', '', ')', 'bWr') ||
|
||||
\ searchpair('{!!', '', '!!}', 'bWr') ||
|
||||
\ searchpair('{{', '', '}}', 'bWr') ||
|
||||
\ searchpair('<?', '', '?>', 'bWr')
|
||||
execute 'let hindent = ' . s:phpindent
|
||||
else
|
||||
let hindent = HtmlIndent()
|
||||
execute 'let hindent = ' . s:htmlindent
|
||||
endif
|
||||
if hindent > -1
|
||||
let indent = hindent
|
||||
endif
|
||||
endif
|
||||
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
|
||||
elseif line =~# '@\%(if\|elseif\|else\|unless\|foreach\|forelse\|for\|while\|empty\|push\|section\|can\)\%(.*\s*@end\)\@!'
|
||||
elseif line =~# '@\%(if\|elseif\|else\|unless\|foreach\|forelse\|for\|while\|empty\|push\|section\|can\|hasSection\)\%(.*@end\|.*@stop\)\@!' ||
|
||||
\ line =~# '{{\%(.*}}\)\@!' || line =~# '{!!\%(.*!!}\)\@!'
|
||||
return increase
|
||||
else
|
||||
return indent
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
|
||||
|
||||
" Language: ember-script
|
||||
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
|
||||
" URL: http://github.com/heartsentwined/vim-ember-script
|
||||
" Version: 1.0.1
|
||||
" Last Change: 2013 Apr 17
|
||||
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
|
||||
" URL: http://github.com/yalesov/vim-ember-script
|
||||
" Version: 1.0.3
|
||||
" Last Change: 2016 Jul 5
|
||||
" License: GPL-3.0
|
||||
|
||||
if exists('b:did_indent')
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
||||
|
||||
" Language: emblem
|
||||
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
|
||||
" URL: http://github.com/heartsentwined/vim-emblem
|
||||
" Version: 1.2.0
|
||||
" Last Change: 2013 Apr 22
|
||||
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
|
||||
" URL: http://github.com/yalesov/vim-emblem
|
||||
" Version: 2.0.0
|
||||
" Last Change: 2016 Jul 5
|
||||
" License: GPL-3.0
|
||||
|
||||
endif
|
||||
|
||||
@@ -11,7 +11,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||
" - general line splits (line ends in an operator)
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
@@ -23,60 +23,60 @@ setlocal indentexpr=GoIndent(v:lnum)
|
||||
setlocal indentkeys+=<:>,0=},0=)
|
||||
|
||||
if exists("*GoIndent")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
|
||||
" use shiftwidth function only if it's available
|
||||
if exists('*shiftwidth')
|
||||
func s:sw()
|
||||
return shiftwidth()
|
||||
endfunc
|
||||
func s:sw()
|
||||
return shiftwidth()
|
||||
endfunc
|
||||
else
|
||||
func s:sw()
|
||||
return &sw
|
||||
endfunc
|
||||
func s:sw()
|
||||
return &sw
|
||||
endfunc
|
||||
endif
|
||||
|
||||
function! GoIndent(lnum)
|
||||
let prevlnum = prevnonblank(a:lnum-1)
|
||||
if prevlnum == 0
|
||||
" top of file
|
||||
return 0
|
||||
endif
|
||||
let prevlnum = prevnonblank(a:lnum-1)
|
||||
if prevlnum == 0
|
||||
" top of file
|
||||
return 0
|
||||
endif
|
||||
|
||||
" grab the previous and current line, stripping comments.
|
||||
let prevl = substitute(getline(prevlnum), '//.*$', '', '')
|
||||
let thisl = substitute(getline(a:lnum), '//.*$', '', '')
|
||||
let previ = indent(prevlnum)
|
||||
" grab the previous and current line, stripping comments.
|
||||
let prevl = substitute(getline(prevlnum), '//.*$', '', '')
|
||||
let thisl = substitute(getline(a:lnum), '//.*$', '', '')
|
||||
let previ = indent(prevlnum)
|
||||
|
||||
let ind = previ
|
||||
let ind = previ
|
||||
|
||||
if prevl =~ '[({]\s*$'
|
||||
" previous line opened a block
|
||||
let ind += s:sw()
|
||||
endif
|
||||
if prevl =~# '^\s*\(case .*\|default\):$'
|
||||
" previous line is part of a switch statement
|
||||
let ind += s:sw()
|
||||
endif
|
||||
" TODO: handle if the previous line is a label.
|
||||
if prevl =~ '[({]\s*$'
|
||||
" previous line opened a block
|
||||
let ind += s:sw()
|
||||
endif
|
||||
if prevl =~# '^\s*\(case .*\|default\):$'
|
||||
" previous line is part of a switch statement
|
||||
let ind += s:sw()
|
||||
endif
|
||||
" TODO: handle if the previous line is a label.
|
||||
|
||||
if thisl =~ '^\s*[)}]'
|
||||
" this line closed a block
|
||||
let ind -= s:sw()
|
||||
endif
|
||||
if thisl =~ '^\s*[)}]'
|
||||
" this line closed a block
|
||||
let ind -= s:sw()
|
||||
endif
|
||||
|
||||
" Colons are tricky.
|
||||
" 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
|
||||
" (b) they're hard to disambiguate from a composite literal key.
|
||||
if thisl =~# '^\s*\(case .*\|default\):$'
|
||||
let ind -= s:sw()
|
||||
endif
|
||||
" Colons are tricky.
|
||||
" 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
|
||||
" (b) they're hard to disambiguate from a composite literal key.
|
||||
if thisl =~# '^\s*\(case .*\|default\):$'
|
||||
let ind -= s:sw()
|
||||
endif
|
||||
|
||||
return ind
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
" vim:ts=4:sw=4:et
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
||||
@@ -45,4 +45,6 @@ function! GetGoHTMLTmplIndent(lnum)
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
||||
@@ -19,7 +19,7 @@ setlocal nosmartindent
|
||||
setlocal indentexpr=GetJavascriptIndent()
|
||||
setlocal formatexpr=Fixedgq(v:lnum,v:count)
|
||||
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.
|
||||
if exists("*GetJavascriptIndent")
|
||||
@@ -45,7 +45,7 @@ endif
|
||||
|
||||
let s:line_pre = '^\s*\%(\/\*.*\*\/\s*\)*'
|
||||
let s:js_keywords = s:line_pre . '\%(break\|import\|export\|catch\|const\|continue\|debugger\|delete\|do\|else\|finally\|for\|function\|if\|in\|instanceof\|let\|new\|return\|switch\|this\|throw\|try\|typeof\|var\|void\|while\|with\)\>\C'
|
||||
let s:expr_case = s:line_pre . '\%(case\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.
|
||||
let s:syng_strcom = '\%(string\|regex\|special\|doc\|comment\|template\)\c'
|
||||
|
||||
@@ -79,7 +79,7 @@ function s:Onescope(lnum)
|
||||
end
|
||||
let mypos = col('.')
|
||||
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 &&
|
||||
\ col('.') == strlen(s:RemoveTrailingComments(getline(a:lnum)))
|
||||
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.
|
||||
let msl = a:lnum
|
||||
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.
|
||||
" Otherwise, terminate search as we have found our MSL already.
|
||||
let line = getline(lnum)
|
||||
@@ -314,6 +314,7 @@ function GetJavascriptIndent()
|
||||
" 3.1. Setup {{{1
|
||||
" ----------
|
||||
" 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('.')
|
||||
|
||||
" 3.2. Work on the current line {{{1
|
||||
@@ -338,19 +339,23 @@ function GetJavascriptIndent()
|
||||
endif
|
||||
|
||||
" 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)
|
||||
return cindent(v:lnum)
|
||||
endif
|
||||
|
||||
" cindent each line which has a switch label
|
||||
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
|
||||
|
||||
" If we got a closing bracket on an empty line, find its match and indent
|
||||
" according to it.
|
||||
let col = s:Match(v:lnum, s:line_pre . '[]})]')
|
||||
let col = line =~ s:line_pre . '[]})]'
|
||||
if col > 0
|
||||
let parlnum = v:lnum
|
||||
while col
|
||||
@@ -361,8 +366,8 @@ function GetJavascriptIndent()
|
||||
continue
|
||||
end
|
||||
if parlnum > 0
|
||||
let ind = s:InMultiVarStatement(parlnum, 0, 0)|| s:LineHasOpeningBrackets(parlnum) !~ '2'
|
||||
\ ? indent(parlnum) : indent(s:GetMSL(parlnum, 0))
|
||||
let ind = s:InMultiVarStatement(parlnum, 0, 0)|| s:LineHasOpeningBrackets(parlnum) !~ '2' ?
|
||||
\ indent(parlnum) : indent(s:GetMSL(parlnum, 0))
|
||||
endif
|
||||
endwhile
|
||||
return ind
|
||||
@@ -371,7 +376,8 @@ function GetJavascriptIndent()
|
||||
|
||||
" If line starts with an operator...
|
||||
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
|
||||
return indent(lnum)
|
||||
end
|
||||
@@ -391,13 +397,15 @@ function GetJavascriptIndent()
|
||||
end
|
||||
|
||||
" If previous line starts with an operator...
|
||||
elseif (s:Match(lnum, s:operator_first) && !s:Match(lnum,s:continuation_regex))||getline(lnum) =~ ');\=' . s:line_term
|
||||
elseif (s:Match(lnum, s:operator_first) && !s:Match(lnum,s:continuation_regex)) ||
|
||||
\ getline(lnum) =~ '[]})];\=' . s:line_term
|
||||
let counts = s:LineHasOpeningBrackets(lnum)
|
||||
if counts[0] == '2' && !s:Match(lnum, s:operator_first)
|
||||
if counts =~ '2' && !s:Match(lnum, s:operator_first)
|
||||
call cursor(lnum, 1)
|
||||
" Search for the opening tag
|
||||
let mnum = s:lookForParens('(', ')', 'nbW', 0)
|
||||
if mnum > 0 && s:Match(mnum, s:operator_first)
|
||||
let mnum = s:lookForParens('(\|{\|\[', ')\|}\|\]', 'nbW', 0)
|
||||
if mnum > 0 && (s:Match(mnum, s:operator_first) ||
|
||||
\ (s:Onescope(s:PrevNonBlankNonString(mnum - 1))) && !s:Match(mnum, s:line_pre . '{'))
|
||||
return indent(mnum) - s:sw()
|
||||
end
|
||||
elseif s:Match(lnum, s:operator_first)
|
||||
@@ -413,7 +421,7 @@ function GetJavascriptIndent()
|
||||
" 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
|
||||
" space in ' */'.
|
||||
if line =~ '^\s*$' && getline(prevline) !~ '\%(\%(^\s*\/\/\|\/\*\).*\)\@<!\*\/' &&
|
||||
if line =~ '^\s*$' && getline(prevline) =~ '\%(\%(^\s*\/\/\|\/\*\).*\)\@<!\*\/' &&
|
||||
\ s:IsInComment(prevline, 1)
|
||||
return indent(prevline) - 1
|
||||
endif
|
||||
@@ -430,16 +438,6 @@ function GetJavascriptIndent()
|
||||
return 0
|
||||
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 s:Match(lnum, s:block_regex)
|
||||
return s:InMultiVarStatement(lnum, 0, 0) || s:LineHasOpeningBrackets(lnum) !~ '2' ?
|
||||
@@ -451,15 +449,16 @@ function GetJavascriptIndent()
|
||||
let ind = indent(lnum)
|
||||
" If the previous line contained an opening bracket, and we are still in it,
|
||||
" add indent depending on the bracket type.
|
||||
if s:Match(lnum, '\%([[({]\)\|\%([^\t \])}][})\]]\)')
|
||||
if s:Match(lnum, '[[({})\]]')
|
||||
let counts = s:LineHasOpeningBrackets(lnum)
|
||||
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
|
||||
call cursor(lnum, matchend(s:RemoveTrailingComments(strpart(line,0,col('.'))), '.*\zs[])}]'))
|
||||
endwhile
|
||||
if line('.') < lnum && !s:InMultiVarStatement(line('.'),0,0)
|
||||
return indent(s:GetMSL(line('.'), 0))
|
||||
let cur = line('.')
|
||||
if cur < lnum && !s:InMultiVarStatement(cur,0,0)
|
||||
return indent(s:GetMSL(cur, 0))
|
||||
end
|
||||
elseif counts =~ '1' || s:Onescope(lnum)
|
||||
return ind + s:sw()
|
||||
@@ -502,64 +501,64 @@ let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
" gq{{{2
|
||||
function! Fixedgq(lnum, count)
|
||||
let l:tw = &tw ? &tw : 80;
|
||||
let l:tw = &tw ? &tw : 80;
|
||||
|
||||
let l:count = a:count
|
||||
let l:first_char = indent(a:lnum) + 1
|
||||
let l:count = a:count
|
||||
let l:first_char = indent(a:lnum) + 1
|
||||
|
||||
if mode() == 'i' " gq was not pressed, but tw was set
|
||||
return 1
|
||||
endif
|
||||
if mode() == 'i' " gq was not pressed, but tw was set
|
||||
return 1
|
||||
endif
|
||||
|
||||
" This gq is only meant to do code with strings, not comments
|
||||
if s:IsInComment(a:lnum, l:first_char)
|
||||
return 1
|
||||
endif
|
||||
" This gq is only meant to do code with strings, not comments
|
||||
if s:IsInComment(a:lnum, l:first_char)
|
||||
return 1
|
||||
endif
|
||||
|
||||
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
|
||||
return 1
|
||||
endif
|
||||
if len(getline(a:lnum)) < l:tw && l:count == 1 " No need for gq
|
||||
return 1
|
||||
endif
|
||||
|
||||
" Put all the lines on one line and do normal spliting after that
|
||||
if l:count > 1
|
||||
while l:count > 1
|
||||
let l:count -= 1
|
||||
normal J
|
||||
endwhile
|
||||
endif
|
||||
" Put all the lines on one line and do normal spliting after that
|
||||
if l:count > 1
|
||||
while l:count > 1
|
||||
let l:count -= 1
|
||||
normal J
|
||||
endwhile
|
||||
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)
|
||||
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)
|
||||
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
|
||||
endif
|
||||
let breakpoint = searchpairpos('\.', '', ' ', 'cW', s:skip_expr, a:lnum)
|
||||
endif
|
||||
|
||||
|
||||
if breakpoint[1] != 0
|
||||
call feedkeys("r\<CR>")
|
||||
else
|
||||
let l:count = l:count - 1
|
||||
endif
|
||||
if breakpoint[1] != 0
|
||||
call feedkeys("r\<CR>")
|
||||
else
|
||||
let l:count = l:count - 1
|
||||
endif
|
||||
|
||||
" run gq on new lines
|
||||
if l:count == 1
|
||||
call feedkeys("gqq")
|
||||
endif
|
||||
" run gq on new lines
|
||||
if l:count == 1
|
||||
call feedkeys("gqq")
|
||||
endif
|
||||
|
||||
return 0
|
||||
return 0
|
||||
endfunction
|
||||
"}}}
|
||||
" vim: foldmethod=marker:foldlevel=1
|
||||
|
||||
21
indent/proto.vim
Normal file
21
indent/proto.vim
Normal file
@@ -0,0 +1,21 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'protobuf') == -1
|
||||
|
||||
" Vim indent file
|
||||
" Language: Protobuf
|
||||
" Maintainer: Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: Fri, 15 Mar 2002 07:53:54 CET
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
" Protobuf is like indenting C
|
||||
setlocal cindent
|
||||
setlocal expandtab
|
||||
setlocal shiftwidth=2
|
||||
|
||||
let b:undo_indent = "setl cin<"
|
||||
|
||||
endif
|
||||
@@ -21,6 +21,12 @@ unlet! b:current_syntax
|
||||
syn case match
|
||||
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 bladeComment matchgroup=bladeDelimiter start="{{--" end="--}}" contains=bladeTodo containedin=ALLBUT,@bladeExempt keepend
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
|
||||
|
||||
" Language: ember-script
|
||||
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
|
||||
" URL: http://github.com/heartsentwined/vim-ember-script
|
||||
" Version: 1.0.1
|
||||
" Last Change: 2013 Apr 17
|
||||
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
|
||||
" URL: http://github.com/yalesov/vim-ember-script
|
||||
" Version: 1.0.3
|
||||
" Last Change: 2016 Jul 5
|
||||
" License: GPL-3.0
|
||||
|
||||
if exists('b:current_syntax') && b:current_syntax == 'ember-script'
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
||||
|
||||
" Language: emblem
|
||||
" Maintainer: heartsentwined <heartsentwined@cogito-lab.com>
|
||||
" URL: http://github.com/heartsentwined/vim-emblem
|
||||
" Version: 1.2.0
|
||||
" Last Change: 2013 Apr 22
|
||||
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
|
||||
" URL: http://github.com/yalesov/vim-emblem
|
||||
" Version: 2.0.0
|
||||
" Last Change: 2016 Jul 5
|
||||
" License: GPL-3.0
|
||||
|
||||
" Quit when a syntax file is already loaded.
|
||||
@@ -31,7 +31,7 @@ syn match eblClass '\v(\w|-)+' nextgroup=@eblComponent contained display
|
||||
hi def link eblIdOp eblId
|
||||
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
|
||||
|
||||
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 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 eblHbsText '.*' contained display
|
||||
hi def link eblHbsOp eblOperator
|
||||
@@ -48,24 +48,38 @@ hi def link eblHbsHelper eblFunction
|
||||
hi def link eblHbsTextOp eblOperator
|
||||
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 eblHbsEachHelper '\v<each>' nextgroup=eblHbsEachArg 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 eblHbsInArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ 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
|
||||
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 eblHbsEachArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsIn,eblLineOp 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 eblHbsWithHelper '\v<with>' nextgroup=eblHbsWithArg skipwhite contained display
|
||||
syn match eblHbsWithArg /\v((["'])[^\2]{-}\2|(\w|\.|-|\>)+)/ nextgroup=eblHbsAs skipwhite contained display
|
||||
syn match eblHbsAs '\v<as>' nextgroup=eblHbsAsBlockStartArg skipwhite contained display
|
||||
syn match eblHbsAsBlockStartArg /\v\|/ nextgroup=eblHbsAsBlockFirstArg skipwhite contained display
|
||||
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 eblHbsAttr '\v\s*(\w|-)+\=@=' contains=eblHbsAttrBind nextgroup=eblHbsAttrOp contained display
|
||||
syn match eblHbsAttrBind /\v<(\w|-)+Bind>/ 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 eblHbsAttr eblAttr
|
||||
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
|
||||
hi def link eblItplOp eblOperator
|
||||
|
||||
syn match eblHbsPartialOp '\s*>' nextgroup=@eblHbsHelpers skipwhite contained display
|
||||
|
||||
117
syntax/go.vim
117
syntax/go.vim
@@ -70,15 +70,11 @@ if !exists("g:go_highlight_methods")
|
||||
endif
|
||||
|
||||
if !exists("g:go_highlight_fields")
|
||||
let g:go_highlight_fields = 0
|
||||
let g:go_highlight_fields = 0
|
||||
endif
|
||||
|
||||
if !exists("g:go_highlight_structs")
|
||||
let g:go_highlight_structs = 0
|
||||
endif
|
||||
|
||||
if !exists("g:go_highlight_interfaces")
|
||||
let g:go_highlight_interfaces = 0
|
||||
if !exists("g:go_highlight_types")
|
||||
let g:go_highlight_types = 0
|
||||
endif
|
||||
|
||||
if !exists("g:go_highlight_build_constraints")
|
||||
@@ -100,12 +96,10 @@ endif
|
||||
syn case match
|
||||
|
||||
syn keyword goDirective package import
|
||||
syn keyword goDeclaration var const type
|
||||
syn keyword goDeclType struct interface
|
||||
syn keyword goDeclaration var const
|
||||
|
||||
hi def link goDirective Statement
|
||||
hi def link goDeclaration Keyword
|
||||
hi def link goDeclType Keyword
|
||||
|
||||
" Keywords within functions
|
||||
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 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
|
||||
syn match goBuiltins /\<\v(append|cap|close|complex|copy|delete|imag|len)\ze\(/
|
||||
@@ -303,70 +293,75 @@ hi def link goOperator Operator
|
||||
|
||||
" Functions;
|
||||
if g:go_highlight_functions != 0
|
||||
syn match goFunction /\(func\s\+\)\@<=\w\+\((\)\@=/
|
||||
syn match goFunction /\()\s\+\)\@<=\w\+\((\)\@=/
|
||||
syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction skipwhite skipnl
|
||||
syn match goReceiver /([^),]\+)/ contained nextgroup=goFunction contains=goReceiverType skipwhite skipnl
|
||||
syn match goReceiverType /\(\s\|*\)\w\+)/hs=s+1,he=e-1 contained
|
||||
syn match goFunction /\w\+/ contained
|
||||
else
|
||||
syn keyword goDeclaration func
|
||||
endif
|
||||
hi def link goReceiverType Type
|
||||
hi def link goFunction Function
|
||||
|
||||
" Methods;
|
||||
if g:go_highlight_methods != 0
|
||||
syn match goMethod /\(\.\)\@<=\w\+\((\)\@=/
|
||||
syn match goMethod /\.\w\+(/hs=s+1,he=e-1
|
||||
endif
|
||||
hi def link goMethod Type
|
||||
|
||||
" Fields;
|
||||
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
|
||||
hi def link goField Type
|
||||
hi def link goField Identifier
|
||||
|
||||
" Structs;
|
||||
if g:go_highlight_structs != 0
|
||||
syn match goStruct /\(.\)\@<=\w\+\({\)\@=/
|
||||
syn match goStructDef /\(type\s\+\)\@<=\w\+\(\s\+struct\s\+{\)\@=/
|
||||
" Structs & Interfaces;
|
||||
if g:go_highlight_types != 0
|
||||
syn match goTypeConstructor /\<\w\+{/he=e-1
|
||||
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
|
||||
else
|
||||
syn keyword goDeclType struct interface
|
||||
syn keyword goDeclaration type
|
||||
endif
|
||||
hi def link goStruct Function
|
||||
hi def link goStructDef Function
|
||||
|
||||
" Interfaces;
|
||||
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
|
||||
hi def link goTypeConstructor Type
|
||||
hi def link goTypeName Type
|
||||
hi def link goTypeDecl Keyword
|
||||
hi def link goDeclType Keyword
|
||||
|
||||
" Build Constraints
|
||||
if g:go_highlight_build_constraints != 0
|
||||
syn match goBuildKeyword display contained "+build"
|
||||
" Highlight the known values of GOOS, GOARCH, and other +build options.
|
||||
syn keyword goBuildDirectives contained
|
||||
\ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
|
||||
\ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64
|
||||
\ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc
|
||||
\ s390 s390x sparc sparc64 cgo ignore race
|
||||
syn match goBuildKeyword display contained "+build"
|
||||
" Highlight the known values of GOOS, GOARCH, and other +build options.
|
||||
syn keyword goBuildDirectives contained
|
||||
\ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
|
||||
\ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64
|
||||
\ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc
|
||||
\ s390 s390x sparc sparc64 cgo ignore race
|
||||
|
||||
" Other words in the build directive are build tags not listed above, so
|
||||
" avoid highlighting them as comments by using a matchgroup just for the
|
||||
" start of the comment.
|
||||
" The rs=s+2 option lets the \s*+build portion be part of the inner region
|
||||
" instead of the matchgroup so it will be highlighted as a goBuildKeyword.
|
||||
syn region goBuildComment matchgroup=goBuildCommentStart
|
||||
\ start="//\s*+build\s"rs=s+2 end="$"
|
||||
\ contains=goBuildKeyword,goBuildDirectives
|
||||
hi def link goBuildCommentStart Comment
|
||||
hi def link goBuildDirectives Type
|
||||
hi def link goBuildKeyword PreProc
|
||||
" Other words in the build directive are build tags not listed above, so
|
||||
" avoid highlighting them as comments by using a matchgroup just for the
|
||||
" start of the comment.
|
||||
" The rs=s+2 option lets the \s*+build portion be part of the inner region
|
||||
" instead of the matchgroup so it will be highlighted as a goBuildKeyword.
|
||||
syn region goBuildComment matchgroup=goBuildCommentStart
|
||||
\ start="//\s*+build\s"rs=s+2 end="$"
|
||||
\ contains=goBuildKeyword,goBuildDirectives
|
||||
hi def link goBuildCommentStart Comment
|
||||
hi def link goBuildDirectives Type
|
||||
hi def link goBuildKeyword PreProc
|
||||
|
||||
" One or more line comments that are followed immediately by a "package"
|
||||
" declaration are treated like package documentation, so these must be
|
||||
" matched as comments to avoid looking like working build constraints.
|
||||
" The he, me, and re options let the "package" itself be highlighted by
|
||||
" the usual rules.
|
||||
syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/
|
||||
\ end=/\v\n\s*package/he=e-7,me=e-7,re=e-7
|
||||
\ contains=@goCommentGroup,@Spell
|
||||
hi def link goPackageComment Comment
|
||||
" One or more line comments that are followed immediately by a "package"
|
||||
" declaration are treated like package documentation, so these must be
|
||||
" matched as comments to avoid looking like working build constraints.
|
||||
" The he, me, and re options let the "package" itself be highlighted by
|
||||
" the usual rules.
|
||||
syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/
|
||||
\ end=/\v\n\s*package/he=e-7,me=e-7,re=e-7
|
||||
\ contains=@goCommentGroup,@Spell
|
||||
hi def link goPackageComment Comment
|
||||
endif
|
||||
|
||||
|
||||
@@ -379,4 +374,6 @@ syn sync minlines=500
|
||||
|
||||
let b:current_syntax = "go"
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match godefStackComment '^".*'
|
||||
@@ -19,4 +19,6 @@ hi def link godefStackCurrentPosition Special
|
||||
hi def link godefStackFilename Directory
|
||||
hi def link godefStackEntryLocationNumber LineNr
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists("main_syntax")
|
||||
let main_syntax = 'html'
|
||||
let main_syntax = 'html'
|
||||
endif
|
||||
|
||||
runtime! syntax/gotexttmpl.vim
|
||||
@@ -14,6 +14,6 @@ unlet b:current_syntax
|
||||
|
||||
let b:current_syntax = "gohtmltmpl"
|
||||
|
||||
" vim:ts=4:sw=4:et
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
|
||||
syn case match
|
||||
@@ -84,6 +84,6 @@ hi def link goTplComment Comment
|
||||
|
||||
let b:current_syntax = "gotexttmpl"
|
||||
|
||||
" vim:ts=4:sw=4:et
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
||||
@@ -26,29 +26,28 @@ syntax sync fromstart
|
||||
" syntax case ignore
|
||||
syntax case match
|
||||
|
||||
syntax match jsNoise /[:,\;\.]\{1}/
|
||||
syntax match jsFuncCall /\k\+\%(\s*(\)\@=/
|
||||
syntax match jsParensError /\%()\|}\|\]\)/
|
||||
syntax match jsNoise /[:,\;\.]\{1}/
|
||||
syntax match jsFuncCall /\k\+\%(\s*(\)\@=/
|
||||
syntax match jsParensError /[)}\]]/
|
||||
|
||||
" 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 match jsOperator /[\!\|\&\+\-\<\>\=\%\/\*\~\^]\{1}/
|
||||
syntax match jsSpreadOperator /\.\.\./ skipwhite skipempty nextgroup=@jsExpression
|
||||
syntax keyword jsBooleanTrue true
|
||||
syntax keyword jsBooleanFalse false
|
||||
|
||||
" Modules
|
||||
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 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 keyword jsModuleDefault contained default skipwhite skipempty nextgroup=@jsExpression
|
||||
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 jsExportBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise
|
||||
syntax keyword jsModuleDefault contained default skipwhite kipempty nextgroup=@jsExpression
|
||||
syntax region jsImportContainer start=/\<import\> / end="\%(;\|$\)" contains=jsModuleKeywords,jsModuleOperators,jsComment,jsString,jsTemplateString,jsNoise,jsModuleGroup,jsModuleAsterisk
|
||||
syntax region jsExportContainer start=/\<export\> / end="\%(;\|$\)" contains=jsModuleKeywords,jsModuleOperators,jsStorageClass,jsModuleDefault,@jsExpression
|
||||
syntax region jsExportBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=jsModuleOperators,jsNoise,jsComment
|
||||
|
||||
" Strings, Templates, Numbers
|
||||
syntax region jsString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend
|
||||
@@ -76,7 +75,7 @@ else
|
||||
endif
|
||||
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
|
||||
|
||||
syntax match jsObjectKey contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue
|
||||
syntax match jsObjectKey contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue,jsFlowParenRegion
|
||||
syntax region jsObjectKeyString contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
|
||||
syntax region jsObjectKeyString contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
|
||||
syntax region jsObjectKeyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsObjectValue,jsFuncArgs extend
|
||||
@@ -84,7 +83,7 @@ syntax match jsObjectSeparator contained /,/
|
||||
syntax region jsObjectValue contained start=/:/ end=/\%(,\|}\)\@=/ contains=@jsExpression extend
|
||||
syntax match jsObjectFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>[\r\n\t ]*(\@=/ skipwhite skipempty nextgroup=jsFuncArgs
|
||||
syntax match jsFunctionKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/
|
||||
syntax match 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
|
||||
|
||||
@@ -108,6 +107,7 @@ syntax keyword jsFinally contained finally skipwhite skipempty nextgro
|
||||
syntax keyword jsCatch contained catch skipwhite skipempty nextgroup=jsParenCatch
|
||||
syntax keyword jsException throw
|
||||
syntax keyword jsAsyncKeyword async await
|
||||
syntax match jsSwitchColon contained /:/ skipwhite skipempty nextgroup=jsBlock
|
||||
|
||||
" Keywords
|
||||
syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat
|
||||
@@ -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
|
||||
|
||||
"" Code blocks
|
||||
syntax region jsBracket matchgroup=jsBrackets start="\[" end="\]" contains=@jsExpression extend fold
|
||||
syntax region jsParen matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll extend fold
|
||||
syntax region jsParenIfElse contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsBlock extend fold
|
||||
syntax region jsParenRepeat contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsBlock extend fold
|
||||
syntax region jsParenSwitch contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold
|
||||
syntax region jsParenCatch contained matchgroup=jsParens start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock extend fold
|
||||
syntax region jsClassBlock contained matchgroup=jsClassBraces start=/{/ end=/}/ contains=jsClassFuncName,jsClassMethodDefinitions,jsOperator,jsArrowFunction,jsArrowFuncArgs,jsComment,jsGenerator,jsDecorator,jsClassProperty,jsClassPropertyComputed,jsClassStringKey,jsNoise extend fold
|
||||
syntax region jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll extend fold
|
||||
syntax region jsBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll extend fold
|
||||
syntax region jsTryCatchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold
|
||||
syntax region jsSwitchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsLabel extend fold
|
||||
syntax region jsObject matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectGetSet,jsGenerator,jsComment,jsSpreadOperator,jsObjectStringKey extend fold
|
||||
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression
|
||||
syntax region jsBracket matchgroup=jsBrackets start=/\[/ end=/\]/ contains=@jsExpression extend fold
|
||||
syntax region jsParen matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll extend fold
|
||||
syntax region jsParenIfElse contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsBlock extend fold
|
||||
syntax region jsParenRepeat contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsBlock extend fold
|
||||
syntax region jsParenSwitch contained matchgroup=jsParens start=/(/ end=/)/ contains=@jsAll skipwhite skipempty nextgroup=jsSwitchBlock extend fold
|
||||
syntax region jsParenCatch contained matchgroup=jsParens start=/(/ end=/)/ skipwhite skipempty nextgroup=jsTryCatchBlock extend fold
|
||||
syntax region jsFuncArgs contained matchgroup=jsFuncParens start=/(/ end=/)/ contains=jsFuncArgCommas,jsComment,jsFuncArgExpression,jsDestructuringBlock,jsRestExpression,jsFlow skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn extend fold
|
||||
syntax region jsClassBlock contained matchgroup=jsClassBraces start=/{/ end=/}/ contains=jsClassFuncName,jsClassMethodType,jsOperator,jsArrowFunction,jsArrowFuncArgs,jsComment,jsGenerator,jsDecorator,jsClassProperty,jsClassPropertyComputed,jsClassStringKey,jsNoise,jsFlowClassProperty extend fold
|
||||
syntax region jsFuncBlock contained matchgroup=jsFuncBraces start=/{/ end=/}/ contains=@jsAll extend fold
|
||||
syntax region jsBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll extend fold
|
||||
syntax region jsTryCatchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll skipwhite skipempty nextgroup=jsCatch,jsFinally extend fold
|
||||
syntax region jsSwitchBlock contained matchgroup=jsBraces start=/{/ end=/}/ contains=@jsAll,jsLabel,jsSwitchColon extend fold
|
||||
syntax region jsDestructuringBlock contained matchgroup=jsDestructuringBraces start=/{/ end=/}/ contains=jsDestructuringProperty,jsDestructuringAssignment,jsDestructuringNoise,jsDestructuringPropertyComputed,jsSpreadExpression extend fold
|
||||
syntax region jsDestructuringArray contained matchgroup=jsDestructuringBraces start=/\[/ end=/\]/ contains=jsDestructuringPropertyValue,jsNoise,jsDestructuringProperty,jsSpreadExpression extend fold
|
||||
syntax region jsObject matchgroup=jsObjectBraces start=/{/ end=/}/ contains=jsObjectKey,jsObjectKeyString,jsObjectKeyComputed,jsObjectSeparator,jsObjectFuncName,jsObjectMethodType,jsGenerator,jsComment,jsObjectStringKey,jsSpreadExpression extend fold
|
||||
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression
|
||||
syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression
|
||||
syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/
|
||||
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression
|
||||
|
||||
syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs
|
||||
syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>/ skipwhite skipempty nextgroup=jsFuncArgs
|
||||
syntax match jsFuncArgDestructuring contained /\({\|}\|=\|:\|\[\|\]\)/ 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 region jsFuncArgExpression contained matchgroup=jsFuncArgOperator start=/=/ end=/[,)]\@=/ contains=@jsExpression extend
|
||||
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
|
||||
|
||||
" 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 match jsClassNoise contained /\./
|
||||
syntax match jsClassMethodDefinitions contained /\%(get\|set\|static\)\%( \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 jsClassMethodType contained /\%(get\|set\|static\|async\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsFuncName,jsClassProperty
|
||||
syntax match jsClassDefinition /\<class\>\%( [a-zA-Z_$][0-9a-zA-Z_$ \n.]*\)*/ contains=jsClassKeywords,jsClassNoise skipwhite skipempty nextgroup=jsClassBlock,jsFlowClass
|
||||
syntax match jsDecorator contained "@" nextgroup=jsDecoratorFunction
|
||||
syntax match jsDecoratorFunction contained "[a-zA-Z_][a-zA-Z0-9_.]*"
|
||||
syntax match jsClassProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsClassValue
|
||||
@@ -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
|
||||
|
||||
" Destructuring
|
||||
syntax match jsDestructuringPropertyValue contained /\<[0-9a-zA-Z_$]*\>/
|
||||
syntax match jsDestructuringProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsDestructuringValue
|
||||
syntax match jsDestructuringAssignment contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsDestructuringValueAssignment
|
||||
syntax region jsDestructuringValue contained start=/=/ end=/[,}\]]\@=/ contains=@jsExpression extend
|
||||
syntax region jsDestructuringValueAssignment contained start=/:/ end=/[,}=]\@=/ contains=jsDestructuringPropertyValue,jsDestructuringBlock,jsNoise,jsDestructuringNoise skipwhite skipempty nextgroup=jsDestructuringValue extend
|
||||
syntax match jsDestructuringNoise contained /[,\[\]]/
|
||||
syntax region jsDestructuringPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsDestructuringValue,jsDestructuringNoise extend fold
|
||||
|
||||
" Comments
|
||||
syntax keyword jsCommentTodo contained TODO FIXME XXX TBD
|
||||
syntax region jsComment start=+\/\/+ end=+$+ contains=jsCommentTodo,@Spell extend keepend
|
||||
syntax region jsComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ 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 jsCvsTag contained start="\$\cid:" end="\$" oneline
|
||||
syntax region jsComment start=/\/\// end=/$/ contains=jsCommentTodo,@Spell extend keepend
|
||||
syntax region jsComment start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell fold extend keepend
|
||||
syntax region jsEnvComment start=/\%^#!/ end=/$/ display
|
||||
|
||||
"" JSDoc / JSDoc Toolkit
|
||||
if !exists("javascript_ignore_javaScriptdoc")
|
||||
"" syntax coloring for javadoc comments (HTML)
|
||||
syntax region jsComment matchgroup=jsComment start="/\*\s*" end="\*/" contains=jsDocTags,jsCommentTodo,jsCvsTag,@jsHtml,@Spell fold
|
||||
if exists("javascript_plugin_jsdoc")
|
||||
runtime extras/jsdoc.vim
|
||||
" NGDoc requires JSDoc
|
||||
if exists("javascript_plugin_ngdoc")
|
||||
runtime extras/ngdoc.vim
|
||||
endif
|
||||
endif
|
||||
|
||||
" tags containing a param
|
||||
syntax match jsDocTags contained "@\(alias\|api\|augments\|borrows\|class\|constructs\|default\|defaultvalue\|emits\|exception\|exports\|extends\|fires\|kind\|link\|listens\|member\|member[oO]f\|mixes\|module\|name\|namespace\|requires\|template\|throws\|var\|variation\|version\)\>" skipwhite nextgroup=jsDocParam
|
||||
" tags containing type and param
|
||||
syntax match jsDocTags contained "@\(arg\|argument\|cfg\|param\|property\|prop\)\>" skipwhite nextgroup=jsDocType
|
||||
" tags containing type but no param
|
||||
syntax match jsDocTags contained "@\(callback\|define\|enum\|external\|implements\|this\|type\|typedef\|return\|returns\)\>" skipwhite nextgroup=jsDocTypeNoParam
|
||||
" tags containing references
|
||||
syntax match jsDocTags contained "@\(lends\|see\|tutorial\)\>" skipwhite nextgroup=jsDocSeeTag
|
||||
" other tags (no extra syntax)
|
||||
syntax match jsDocTags contained "@\(abstract\|access\|accessor\|author\|classdesc\|constant\|const\|constructor\|copyright\|deprecated\|desc\|description\|dict\|event\|example\|file\|file[oO]verview\|final\|function\|global\|ignore\|inheritDoc\|inner\|instance\|interface\|license\|localdoc\|method\|mixin\|nosideeffects\|override\|overview\|preserve\|private\|protected\|public\|readonly\|since\|static\|struct\|todo\|summary\|undocumented\|virtual\)\>"
|
||||
if exists("javascript_plugin_flow")
|
||||
runtime extras/flow.vim
|
||||
endif
|
||||
|
||||
syntax region jsDocType contained matchgroup=jsDocTypeBrackets start="{" end="}" contains=jsDocTypeRecord oneline skipwhite nextgroup=jsDocParam
|
||||
syntax match jsDocType contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+" skipwhite nextgroup=jsDocParam
|
||||
syntax region jsDocTypeRecord contained start=/{/ end=/}/ contains=jsDocTypeRecord extend
|
||||
syntax region jsDocTypeRecord contained start=/\[/ end=/\]/ contains=jsDocTypeRecord extend
|
||||
syntax region jsDocTypeNoParam contained start="{" end="}" oneline
|
||||
syntax match jsDocTypeNoParam contained "\%(#\|\"\|\w\|\.\|:\|\/\)\+"
|
||||
syntax match jsDocParam contained "\%(#\|\$\|-\|'\|\"\|{.\{-}}\|\w\|\.\|:\|\/\|\[.{-}]\|=\)\+"
|
||||
syntax region jsDocSeeTag contained matchgroup=jsDocSeeTag start="{" end="}" contains=jsDocTags
|
||||
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 jsExpression contains=jsBracket,jsParen,jsObject,jsBlock,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper
|
||||
syntax cluster jsAll contains=@jsExpression,jsExportContainer,jsImportContainer,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsStatement,jsException,jsTry,jsAsyncKeyword
|
||||
|
||||
" Define the default highlighting.
|
||||
@@ -222,18 +218,9 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
HiLink jsFuncArgRest Special
|
||||
HiLink jsComment Comment
|
||||
HiLink jsEnvComment PreProc
|
||||
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 jsObjectKeyString String
|
||||
HiLink jsTemplateString String
|
||||
@@ -306,11 +293,20 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
||||
HiLink jsModuleDefault Include
|
||||
HiLink jsDecorator Special
|
||||
HiLink jsDecoratorFunction Special
|
||||
HiLink jsFuncArgRestDots Noise
|
||||
HiLink jsFuncArgDestructuring Noise
|
||||
HiLink jsFuncArgOperator jsFuncArgs
|
||||
HiLink jsModuleAsterisk Noise
|
||||
HiLink jsClassProperty jsObjectKey
|
||||
HiLink jsSpreadOperator Operator
|
||||
HiLink jsRestOperator Operator
|
||||
HiLink jsRestExpression jsFuncArgs
|
||||
HiLink jsSwitchColon Noise
|
||||
HiLink jsClassMethodType Type
|
||||
HiLink jsObjectMethodType Type
|
||||
|
||||
HiLink jsDestructuringBraces Noise
|
||||
HiLink jsDestructuringProperty jsFuncArgs
|
||||
HiLink jsDestructuringAssignment jsObjectKey
|
||||
HiLink jsDestructuringNoise Noise
|
||||
|
||||
HiLink jsDomErrNo Constant
|
||||
HiLink jsDomNodeConsts Constant
|
||||
@@ -323,9 +319,6 @@ if version >= 508 || !exists("did_javascript_syn_inits")
|
||||
|
||||
HiLink jsCssStyles Label
|
||||
|
||||
HiLink jsClassMethodDefinitions Type
|
||||
HiLink jsObjectGetSet Type
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
||||
" Vim syntax file
|
||||
" Language: Kotlin
|
||||
" Maintainer: Alexander Udalov
|
||||
" Latest Revision: 24 February 2016
|
||||
" Latest Revision: 4 July 2016
|
||||
|
||||
if exists("b:current_syntax")
|
||||
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 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 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 match ktShebang "\v^#!.*$"
|
||||
|
||||
@@ -1,164 +1,176 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: Markdown
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Filenames: *.markdown
|
||||
" Last Change: 2013 May 30
|
||||
" Language: Markdown
|
||||
" Maintainer: Ben Williams <benw@plasticboy.com>
|
||||
" URL: http://plasticboy.com/markdown-vim-mode/
|
||||
" 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
|
||||
endif
|
||||
|
||||
if !exists('main_syntax')
|
||||
let main_syntax = 'markdown'
|
||||
" don't use standard HiLink, it will not work with included syntax files
|
||||
if version < 508
|
||||
command! -nargs=+ HtmlHiLink hi link <args>
|
||||
else
|
||||
command! -nargs=+ HtmlHiLink hi def link <args>
|
||||
endif
|
||||
|
||||
runtime! syntax/html.vim
|
||||
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 spell toplevel
|
||||
syn case ignore
|
||||
syn sync linebreaks=1
|
||||
|
||||
syn match markdownValid '[<>]\c[a-z/$!]\@!'
|
||||
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:conceal = ''
|
||||
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'
|
||||
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
|
||||
syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart
|
||||
syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*```*.*$" end="^\s*```*\ze\s*$" keepend
|
||||
" additions to HTML groups
|
||||
if get(g:, 'vim_markdown_emphasis_multiline', 1)
|
||||
let s:oneline = ''
|
||||
else
|
||||
let s:oneline = ' oneline'
|
||||
endif
|
||||
execute 'syn region htmlItalic start="\%(^\|\s\)\zs\*\ze[^\\\*\t ]\%(\%([^*]\|\\\*\|\n\)*[^\\\*\t ]\)\?\*\_W" end="[^\\\*\t ]\zs\*\ze\_W" keepend' . s:oneline
|
||||
execute 'syn region htmlItalic start="\%(^\|\s\)\zs_\ze[^\\_\t ]" end="[^\\_\t ]\zs_\ze\_W" keepend' . s:oneline
|
||||
execute 'syn region htmlBold start="\%(^\|\s\)\*\*\ze\S" end="\S\zs\*\*" keepend' . s:oneline
|
||||
execute 'syn region htmlBold start="\%(^\|\s\)\zs__\ze\S" end="\S\zs__" keepend' . s:oneline
|
||||
execute 'syn region htmlBoldItalic start="\%(^\|\s\)\zs\*\*\*\ze\S" end="\S\zs\*\*\*" keepend' . s:oneline
|
||||
execute 'syn region htmlBoldItalic start="\%(^\|\s\)\zs___\ze\S" end="\S\zs___" keepend' . s:oneline
|
||||
|
||||
syn match markdownFootnote "\[^[^\]]\+\]"
|
||||
syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:"
|
||||
" [link](URL) | [link][id] | [link][] | 
|
||||
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'
|
||||
let s:done_include = {}
|
||||
for s:type in g:markdown_fenced_languages
|
||||
if has_key(s:done_include, matchstr(s:type,'[^.]*'))
|
||||
continue
|
||||
endif
|
||||
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*```*\s*'.matchstr(s:type,'[^=]*').'\>.*$" end="^\s*```*\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g')
|
||||
let s:done_include[matchstr(s:type,'[^.]*')] = 1
|
||||
endfor
|
||||
unlet! s:type
|
||||
unlet! s:done_include
|
||||
" Autolink without angle brackets.
|
||||
" mkd inline links: protocol optional user:pass@ sub/domain .com, .co.uk, etc optional port path/querystring/hash fragment
|
||||
" ------------ _____________________ ----------------------------- _________________________ ----------------- __
|
||||
syn match mkdInlineURL /https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*/
|
||||
|
||||
" Autolink with parenthesis.
|
||||
syn region mkdInlineURL matchgroup=mkdDelimiter start="(\(https\?:\/\/\(\w\+\(:\w\+\)\?@\)\?\([A-Za-z0-9][-_0-9A-Za-z]*\.\)\{1,}\(\w\{2,}\.\?\)\{1,}\(:[0-9]\{1,5}\)\?\S*)\)\@=" end=")"
|
||||
|
||||
" Autolink with angle brackets.
|
||||
syn region mkdInlineURL matchgroup=mkdDelimiter start="\\\@<!<\ze[a-z][a-z0-9,.-]\{1,22}:\/\/[^> ]*>" end=">"
|
||||
|
||||
" 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
|
||||
|
||||
syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]"
|
||||
syn match markdownError "\w\@<=_\w\@="
|
||||
|
||||
hi def link markdownH1 htmlH1
|
||||
hi def link markdownH2 htmlH2
|
||||
hi def link markdownH3 htmlH3
|
||||
hi def link markdownH4 htmlH4
|
||||
hi def link markdownH5 htmlH5
|
||||
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
|
||||
if get(g:, 'vim_markdown_toml_frontmatter', 0)
|
||||
try
|
||||
syn include @tomlTop syntax/toml.vim
|
||||
syn region Comment matchgroup=mkdDelimiter start="\%^+++$" end="^+++$" transparent contains=@tomlTop keepend
|
||||
unlet! b:current_syntax
|
||||
catch /E484/
|
||||
syn region Comment matchgroup=mkdDelimiter start="\%^+++$" end="^+++$"
|
||||
endtry
|
||||
endif
|
||||
|
||||
" 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
|
||||
|
||||
@@ -127,6 +127,7 @@ syn match pgsqlKeyword "\<for\_s\+\(search\|order\_s\+by\)\>"
|
||||
syn match pgsqlKeyword "\<\(no\_s\+\)\?inherit\>"
|
||||
syn match pgsqlKeyword "\<\(not\_s\+\)\?of\>"
|
||||
syn match pgsqlKeyword "\<primary\_s\+key\>"
|
||||
syn match pgsqlKeyword "\<foreign\_s\+key\>"
|
||||
syn match pgsqlKeyword "\<replica\_s\+identity\>"
|
||||
syn match pgsqlKeyword "\<using\(\_s\+index\(\_s\+tablespace\)\?\)\?\>"
|
||||
syn match pgsqlKeyword "\<with\(out\)\?\_s\+function\>"
|
||||
|
||||
@@ -34,8 +34,8 @@ syn cluster pugTop contains=pugBegin,pugComment,pugHtmlComment,pugJavascript
|
||||
syn match pugBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=pugTag,pugClassChar,pugIdChar,pugPlainChar,pugJavascript,pugScriptConditional,pugScriptStatement,pugPipedText
|
||||
syn match pugTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@pugComponent
|
||||
syn cluster pugComponent contains=pugAttributes,pugIdChar,pugBlockExpansionChar,pugClassChar,pugPlainChar,pugJavascript,pugTagBlockChar,pugTagInlineText
|
||||
syn match pugComment '\s*\/\/.*$'
|
||||
syn region pugCommentBlock start="\z(\s*\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" keepend
|
||||
syn match pugComment '\(\s\+\|^\)\/\/.*$'
|
||||
syn region pugCommentBlock start="\z(\s\+\|^\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" keepend
|
||||
syn region pugHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->"
|
||||
syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,pugHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent
|
||||
syn match pugClassChar "\." contained nextgroup=pugClass
|
||||
|
||||
@@ -458,9 +458,9 @@ syn match rubyKeywordAsMethod "\%(\%(\.\@1<!\.\)\|::\)\_s*\%([_[:lower:]][_[:aln
|
||||
syn match rubyKeywordAsMethod "\(defined?\|exit!\)\@!\<[_[:lower:]][_[:alnum:]]*[?!]" transparent contains=NONE
|
||||
|
||||
" 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 "\%([{(,]\_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
|
||||
|
||||
" __END__ Directive {{{1
|
||||
|
||||
138
syntax/tmux.vim
138
syntax/tmux.vim
@@ -33,15 +33,16 @@ syn keyword tmuxAction any current none
|
||||
syn keyword tmuxBoolean off on
|
||||
|
||||
syn keyword tmuxCmds
|
||||
\ attach[-session]
|
||||
\ bind[-key]
|
||||
\ attach
|
||||
\ attach-session
|
||||
\ bind
|
||||
\ bind-key
|
||||
\ break-pane
|
||||
\ breakp
|
||||
\ capture-pane
|
||||
\ capturep
|
||||
\ choose-buffer
|
||||
\ choose-client
|
||||
\ choose-list
|
||||
\ choose-session
|
||||
\ choose-tree
|
||||
\ choose-window
|
||||
@@ -49,124 +50,149 @@ syn keyword tmuxCmds
|
||||
\ clearhist
|
||||
\ clock-mode
|
||||
\ command-prompt
|
||||
\ confirm[-before]
|
||||
\ confirm
|
||||
\ confirm-before
|
||||
\ copy-mode
|
||||
\ delete-buffer
|
||||
\ deleteb
|
||||
\ detach[-client]
|
||||
\ display[-message]
|
||||
\ detach
|
||||
\ detach-client
|
||||
\ display
|
||||
\ display-message
|
||||
\ display-panes
|
||||
\ displayp
|
||||
\ find-window
|
||||
\ findw
|
||||
\ has[-session]
|
||||
\ if[-shell]
|
||||
\ has
|
||||
\ has-session
|
||||
\ if
|
||||
\ if-shell
|
||||
\ info
|
||||
\ join-pane
|
||||
\ joinp
|
||||
\ kill-pane
|
||||
\ killp
|
||||
\ kill-server
|
||||
\ kill-session
|
||||
\ kill-window
|
||||
\ killp
|
||||
\ killw
|
||||
\ last
|
||||
\ last-pane
|
||||
\ last-window
|
||||
\ lastp
|
||||
\ last[-window]
|
||||
\ link-window
|
||||
\ linkw
|
||||
\ list-buffers
|
||||
\ lsb
|
||||
\ list-clients
|
||||
\ lsc
|
||||
\ list-commands
|
||||
\ lscm
|
||||
\ list-keys
|
||||
\ lsk
|
||||
\ list-panes
|
||||
\ lsp
|
||||
\ list-sessions
|
||||
\ ls
|
||||
\ list-windows
|
||||
\ lsw
|
||||
\ load-buffer
|
||||
\ loadb
|
||||
\ lock
|
||||
\ lock-client
|
||||
\ lockc
|
||||
\ lock[-server]
|
||||
\ lock-server
|
||||
\ lock-session
|
||||
\ lockc
|
||||
\ locks
|
||||
\ ls
|
||||
\ lsb
|
||||
\ lsc
|
||||
\ lscm
|
||||
\ lsk
|
||||
\ lsp
|
||||
\ lsw
|
||||
\ move-pane
|
||||
\ movep
|
||||
\ move-window
|
||||
\ movep
|
||||
\ movew
|
||||
\ new[-session]
|
||||
\ new
|
||||
\ new-session
|
||||
\ new-window
|
||||
\ neww
|
||||
\ next
|
||||
\ next-layout
|
||||
\ next-window
|
||||
\ nextl
|
||||
\ next[-window]
|
||||
\ paste-buffer
|
||||
\ pasteb
|
||||
\ path
|
||||
\ pipe-pane
|
||||
\ pipep
|
||||
\ prev
|
||||
\ previous-layout
|
||||
\ previous-window
|
||||
\ prevl
|
||||
\ prev[ious-window]
|
||||
\ refresh[-client]
|
||||
\ rename[-session]
|
||||
\ refresh
|
||||
\ refresh-client
|
||||
\ rename
|
||||
\ rename-session
|
||||
\ rename-window
|
||||
\ renamew
|
||||
\ resize-pane
|
||||
\ resizep
|
||||
\ respawn-pane
|
||||
\ respawnp
|
||||
\ respawn-window
|
||||
\ respawnp
|
||||
\ respawnw
|
||||
\ rotate-window
|
||||
\ rotatew
|
||||
\ run[-shell]
|
||||
\ run
|
||||
\ run-shell
|
||||
\ save-buffer
|
||||
\ saveb
|
||||
\ select-layout
|
||||
\ selectl
|
||||
\ select-pane
|
||||
\ selectp
|
||||
\ select-window
|
||||
\ selectl
|
||||
\ selectp
|
||||
\ selectw
|
||||
\ send[-keys]
|
||||
\ send
|
||||
\ send-keys
|
||||
\ send-prefix
|
||||
\ server-info
|
||||
\ info
|
||||
\ set
|
||||
\ set-buffer
|
||||
\ setb
|
||||
\ set-environment
|
||||
\ setenv
|
||||
\ set[-option]
|
||||
\ set-hook
|
||||
\ set-option
|
||||
\ set-window-option
|
||||
\ setb
|
||||
\ setenv
|
||||
\ setw
|
||||
\ show
|
||||
\ show-buffer
|
||||
\ showb
|
||||
\ show-environment
|
||||
\ showenv
|
||||
\ show-hooks
|
||||
\ show-messages
|
||||
\ showmsgs
|
||||
\ show[-options]
|
||||
\ show-options
|
||||
\ show-window-options
|
||||
\ showb
|
||||
\ showenv
|
||||
\ showmsgs
|
||||
\ showw
|
||||
\ source[-file]
|
||||
\ source
|
||||
\ source-file
|
||||
\ split-window
|
||||
\ splitw
|
||||
\ start[-server]
|
||||
\ start
|
||||
\ start-server
|
||||
\ suspend-client
|
||||
\ suspendc
|
||||
\ swap-pane
|
||||
\ swapp
|
||||
\ swap-window
|
||||
\ swapp
|
||||
\ swapw
|
||||
\ switch-client
|
||||
\ switchc
|
||||
\ unbind[-key]
|
||||
\ unbind
|
||||
\ unbind-key
|
||||
\ unlink-window
|
||||
\ unlinkw
|
||||
\ wait[-for]
|
||||
\ wait
|
||||
\ wait-for
|
||||
|
||||
syn keyword tmuxOptsSet
|
||||
\ assume-paste-time
|
||||
@@ -186,19 +212,14 @@ syn keyword tmuxOptsSet
|
||||
\ escape-time
|
||||
\ exit-unattached
|
||||
\ focus-events
|
||||
\ history-file
|
||||
\ history-limit
|
||||
\ lock-after-time
|
||||
\ lock-command
|
||||
\ lock-server
|
||||
\ message-command-style
|
||||
\ message-limit
|
||||
\ message-style
|
||||
\ mouse-resize-pane
|
||||
\ mouse-select-pane
|
||||
\ mouse-select-window
|
||||
\ mouse-utf8
|
||||
\ pane-active-border-style
|
||||
\ pane-border-style
|
||||
\ mouse
|
||||
\ prefix
|
||||
\ prefix2
|
||||
\ quiet
|
||||
@@ -218,8 +239,8 @@ syn keyword tmuxOptsSet
|
||||
\ status-position
|
||||
\ status-right
|
||||
\ status-right-length
|
||||
\ status-utf8
|
||||
\ staus-right-style
|
||||
\ status-right-style
|
||||
\ status-style
|
||||
\ terminal-overrides
|
||||
\ update-environment
|
||||
\ visual-activity
|
||||
@@ -232,8 +253,7 @@ syn keyword tmuxOptsSetw
|
||||
\ allow-rename
|
||||
\ alternate-screen
|
||||
\ automatic-rename
|
||||
\ c0-change-interval
|
||||
\ c0-change-trigger
|
||||
\ automatic-rename-format
|
||||
\ clock-mode-colour
|
||||
\ clock-mode-style
|
||||
\ force-height
|
||||
@@ -241,16 +261,17 @@ syn keyword tmuxOptsSetw
|
||||
\ main-pane-height
|
||||
\ main-pane-width
|
||||
\ mode-keys
|
||||
\ mode-mouse
|
||||
\ mode-style
|
||||
\ monitor-activity
|
||||
\ monitor-silence
|
||||
\ other-pane-height
|
||||
\ other-pane-width
|
||||
\ pane-active-border-style
|
||||
\ pane-base-index
|
||||
\ pane-border-style
|
||||
\ remain-on-exit
|
||||
\ synchronize-panes
|
||||
\ utf8
|
||||
\ window-active-style
|
||||
\ window-status-activity-style
|
||||
\ window-status-bell-style
|
||||
\ window-status-current-format
|
||||
@@ -259,6 +280,7 @@ syn keyword tmuxOptsSetw
|
||||
\ window-status-last-style
|
||||
\ window-status-separator
|
||||
\ window-status-style
|
||||
\ window-style
|
||||
\ wrap-search
|
||||
\ xterm-keys
|
||||
|
||||
@@ -270,7 +292,9 @@ syn match tmuxOptions /\s-\a\+/ display
|
||||
syn match tmuxVariable /\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
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:current_syntax = "vimgo"
|
||||
@@ -12,4 +12,6 @@ syn region goTitle start="\%1l" end=":"
|
||||
hi def link goInterface Type
|
||||
hi def link goTitle Label
|
||||
|
||||
" vim: sw=2 ts=2 et
|
||||
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user