This commit is contained in:
Adam Stankiewicz 2017-11-19 21:26:59 +01:00
parent 0e9041f29a
commit d219055bc8
No known key found for this signature in database
GPG Key ID: A62480DCEAC884DF
32 changed files with 438 additions and 455 deletions

View File

@ -39,6 +39,8 @@ function! TerraformFolds()
return ">1" return ">1"
elseif match(thisline, '^terraform') >= 0 elseif match(thisline, '^terraform') >= 0
return ">1" return ">1"
elseif match(thisline, '^locals') >= 0
return ">1"
else else
return "=" return "="
endif endif

View File

@ -49,7 +49,7 @@ syn region jsxChild contained start=+{+ end=++ contains=jsBlock,javascriptBlock
" and generic Flow type annotations (http://flowtype.org/). " and generic Flow type annotations (http://flowtype.org/).
syn region jsxRegion syn region jsxRegion
\ contains=@Spell,@XMLSyntax,jsxRegion,jsxChild,jsBlock,javascriptBlock \ contains=@Spell,@XMLSyntax,jsxRegion,jsxChild,jsBlock,javascriptBlock
\ start=+\%(<\|\w\)\@<!<\z([a-zA-Z][a-zA-Z0-9:\-.]*\)+ \ start=+\%(<\|\w\)\@<!<\z([a-zA-Z][a-zA-Z0-9:\-.]*\>[:,]\@!\)\([^>]*>(\)\@!+
\ skip=+<!--\_.\{-}-->+ \ skip=+<!--\_.\{-}-->+
\ end=+</\z1\_\s\{-}>+ \ end=+</\z1\_\s\{-}>+
\ end=+/>+ \ end=+/>+

View File

@ -6,10 +6,10 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
" "
" compiler/go.vim: Vim compiler file for Go. " compiler/go.vim: Vim compiler file for Go.
if exists("current_compiler") if exists("g:current_compiler")
finish finish
endif endif
let current_compiler = "go" let g:current_compiler = "go"
if exists(":CompilerSet") != 2 if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args> command -nargs=* CompilerSet setlocal <args>

View File

@ -339,15 +339,18 @@ function! s:gofiletype_post()
let &g:fileencodings = s:current_fileencodings let &g:fileencodings = s:current_fileencodings
endfunction endfunction
au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix augroup vim-go-filetype
au BufRead *.go call s:gofiletype_pre("go") autocmd!
au BufReadPost *.go call s:gofiletype_post() 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 BufNewFile *.s setfiletype asm | setlocal fileencoding=utf-8 fileformat=unix
au BufRead *.s call s:gofiletype_pre("asm") au BufRead *.s call s:gofiletype_pre("asm")
au BufReadPost *.s call s:gofiletype_post() au BufReadPost *.s call s:gofiletype_post()
au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
augroup end
" vim: sw=2 ts=2 et " vim: sw=2 ts=2 et
augroup END augroup END
@ -919,7 +922,7 @@ fun! s:DetectScala()
endif endif
endfun endfun
au BufRead,BufNewFile *.scala set filetype=scala au BufRead,BufNewFile *.scala,*.sc set filetype=scala
au BufRead,BufNewFile * call s:DetectScala() au BufRead,BufNewFile * call s:DetectScala()
" Install vim-sbt for additional syntax highlighting. " Install vim-sbt for additional syntax highlighting.
@ -1021,8 +1024,8 @@ augroup END
augroup filetypedetect augroup filetypedetect
" toml:cespare/vim-toml " toml:cespare/vim-toml
" Rust uses several TOML config files that are not named with .toml. " Go dep and Rust use several TOML config files that are not named with .toml.
autocmd BufNewFile,BufRead *.toml,Cargo.lock,*/.cargo/config set filetype=toml autocmd BufNewFile,BufRead *.toml,Gopkg.lock,Cargo.lock,*/.cargo/config set filetype=toml
augroup END augroup END
augroup filetypedetect augroup filetypedetect

View File

@ -15,7 +15,7 @@ setlocal commentstring=//\ %s
" " and insert the comment leader when hitting <CR> or using "o". " " and insert the comment leader when hitting <CR> or using "o".
setlocal formatoptions-=t formatoptions+=croql setlocal formatoptions-=t formatoptions+=croql
setlocal suffixesadd+=.ts setlocal suffixesadd+=.ts,.tsx
let b:undo_ftplugin = "setl fo< ofu< com< cms<" let b:undo_ftplugin = "setl fo< ofu< com< cms<"

View File

@ -19,7 +19,7 @@ let b:did_indent = 1
" Doesn't include 'foreach' and 'forelse' because these already get matched by 'for'. " Doesn't include 'foreach' and 'forelse' because these already get matched by 'for'.
let s:directives_start = 'if\|else\|unless\|for\|while\|empty\|push\|section\|can\|hasSection\|verbatim\|php\|' . let s:directives_start = 'if\|else\|unless\|for\|while\|empty\|push\|section\|can\|hasSection\|verbatim\|php\|' .
\ 'component\|slot\|prepend' \ 'component\|slot\|prepend\|auth\|guest'
let s:directives_end = 'else\|end\|empty\|show\|stop\|append\|overwrite' let s:directives_end = 'else\|end\|empty\|show\|stop\|append\|overwrite'
if exists('g:blade_custom_directives_pairs') if exists('g:blade_custom_directives_pairs')

View File

@ -192,11 +192,7 @@ if exists("*searchpairpos")
" Check if form is a reader conditional, that is, it is prefixed by #? " Check if form is a reader conditional, that is, it is prefixed by #?
" or @#? " or @#?
function! s:is_reader_conditional_special_case(position) function! s:is_reader_conditional_special_case(position)
if getline(a:position[0])[a:position[1] - 3 : a:position[1] - 2] == "#?" return getline(a:position[0])[a:position[1] - 3 : a:position[1] - 2] == "#?"
return 1
endif
return 0
endfunction endfunction
" Returns 1 for opening brackets, -1 for _anything else_. " Returns 1 for opening brackets, -1 for _anything else_.
@ -294,6 +290,19 @@ if exists("*searchpairpos")
return paren return paren
endif endif
" If the keyword begins with #, check if it is an anonymous
" function or set, in which case we indent by the shiftwidth
" (minus one if g:clojure_align_subforms = 1), or if it is
" ignored, in which case we use the ( position for indent.
if w[0] == "#"
" TODO: Handle #=() and other rare reader invocations?
if w[1] == '(' || w[1] == '{'
return [paren[0], paren[1] + (g:clojure_align_subforms ? 0 : &shiftwidth - 1)]
elseif w[1] == '_'
return paren
endif
endif
" Test words without namespace qualifiers and leading reader macro " Test words without namespace qualifiers and leading reader macro
" metacharacters. " metacharacters.
" "

View File

@ -8,6 +8,7 @@ if exists("b:did_indent")
endif endif
setlocal autoindent cindent setlocal autoindent cindent
setlocal formatoptions+=roq
" vim:set sts=2 sw=2 : " vim:set sts=2 sw=2 :

View File

@ -12,10 +12,6 @@ if exists('b:did_indent')
endif endif
let b:did_indent = 1 let b:did_indent = 1
" indent correctly if inside <script>
" vim/vim@690afe1 for the switch from cindent
let b:html_indent_script1 = 'inc'
" Now, set up our indentation expression and keys that trigger it. " Now, set up our indentation expression and keys that trigger it.
setlocal indentexpr=GetJavascriptIndent() setlocal indentexpr=GetJavascriptIndent()
setlocal autoindent nolisp nosmartindent setlocal autoindent nolisp nosmartindent
@ -27,13 +23,6 @@ setlocal indentkeys+=0],0)
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<' let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
" Regex of syntax group names that are or delimit string or are comments.
let b:syng_strcom = get(b:,'syng_strcom','string\|comment\|regex\|special\|doc\|template\%(braces\)\@!')
let b:syng_str = get(b:,'syng_str','string\|template\|special')
" template strings may want to be excluded when editing graphql:
" au! Filetype javascript let b:syng_str = '^\%(.*template\)\@!.*string\|special'
" au! Filetype javascript let b:syng_strcom = '^\%(.*template\)\@!.*string\|comment\|regex\|special\|doc'
" Only define the function once. " Only define the function once.
if exists('*GetJavascriptIndent') if exists('*GetJavascriptIndent')
finish finish
@ -42,6 +31,23 @@ endif
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim
" indent correctly if inside <script>
" vim/vim@690afe1 for the switch from cindent
" overridden with b:html_indent_script1
call extend(g:,{'html_indent_script1': 'inc'},'keep')
" Regex of syntax group names that are or delimit string or are comments.
let s:bvars = {
\ 'syng_strcom': 'string\|comment\|regex\|special\|doc\|template\%(braces\)\@!',
\ 'syng_str': 'string\|template\|special' }
" template strings may want to be excluded when editing graphql:
" au! Filetype javascript let b:syng_str = '^\%(.*template\)\@!.*string\|special'
" au! Filetype javascript let b:syng_strcom = '^\%(.*template\)\@!.*string\|comment\|regex\|special\|doc'
function s:GetVars()
call extend(b:,extend(s:bvars,{'js_cache': [0,0,0]}),'keep')
endfunction
" Get shiftwidth value " Get shiftwidth value
if exists('*shiftwidth') if exists('*shiftwidth')
function s:sw() function s:sw()
@ -106,9 +112,7 @@ endfunction
function s:SkipFunc() function s:SkipFunc()
if s:top_col == 1 if s:top_col == 1
throw 'out of bounds' throw 'out of bounds'
endif elseif s:check_in
let s:top_col = 0
if s:check_in
if eval(s:skip_expr) if eval(s:skip_expr)
return 1 return 1
endif endif
@ -161,19 +165,29 @@ function s:Token()
return s:LookingAt() =~ '\k' ? expand('<cword>') : s:LookingAt() return s:LookingAt() =~ '\k' ? expand('<cword>') : s:LookingAt()
endfunction endfunction
function s:PreviousToken() function s:PreviousToken(...)
let l:col = col('.') let [l:pos, tok] = [getpos('.'), '']
if search('\m\k\{1,}\|\S','ebW') if search('\m\k\{1,}\|\S','ebW')
if search('\m\*\%#\/\|\/\/\%<'.a:firstline.'l','nbW',line('.')) && eval(s:in_comm) if getline('.')[col('.')-2:col('.')-1] == '*/'
if s:SearchLoop('\S\ze\_s*\/[/*]','bW',s:in_comm) if eval(s:in_comm) && !s:SearchLoop('\S\ze\_s*\/[/*]','bW',s:in_comm)
return s:Token() call setpos('.',l:pos)
else
let tok = s:Token()
endif endif
call cursor(a:firstline, l:col)
else else
return s:Token() let two = a:0 || line('.') != l:pos[1] ? strridx(getline('.')[:col('.')],'//') + 1 : 0
if two && eval(s:in_comm)
call cursor(0,two)
let tok = s:PreviousToken(1)
if tok is ''
call setpos('.',l:pos)
endif
else
let tok = s:Token()
endif
endif endif
endif endif
return '' return tok
endfunction endfunction
function s:Pure(f,...) function s:Pure(f,...)
@ -217,15 +231,14 @@ let s:opfirst = '^' . get(g:,'javascript_opfirst',
let s:continuation = get(g:,'javascript_continuation', let s:continuation = get(g:,'javascript_continuation',
\ '\C\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$' \ '\C\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
function s:Continues(ln,con) function s:Continues()
let tok = matchstr(a:con[-15:],s:continuation) let tok = matchstr(strpart(getline('.'),col('.')-15,15),s:continuation)
if tok =~ '[a-z:]' if tok =~ '[a-z:]'
call cursor(a:ln, len(a:con))
return tok == ':' ? s:ExprCol() : s:PreviousToken() != '.' return tok == ':' ? s:ExprCol() : s:PreviousToken() != '.'
elseif tok !~ '[/>]' elseif tok !~ '[/>]'
return tok isnot '' return tok isnot ''
endif endif
return s:SynAt(a:ln, len(a:con)) !~? (tok == '>' ? 'jsflow\|^html' : 'regex') return s:SynAt(line('.'),col('.')) !~? (tok == '>' ? 'jsflow\|^html' : 'regex')
endfunction endfunction
" Check if line 'lnum' has a balanced amount of parentheses. " Check if line 'lnum' has a balanced amount of parentheses.
@ -259,21 +272,27 @@ endfunction
function s:DoWhile() function s:DoWhile()
let cpos = searchpos('\m\<','cbW') let cpos = searchpos('\m\<','cbW')
if s:SearchLoop('\C[{}]\|\<\%(do\|while\)\>','bW',s:skip_expr) while s:SearchLoop('\C[{}]\|\<\%(do\|while\)\>','bW',s:skip_expr)
if s:{s:LookingAt() == '}' && s:GetPair('{','}','bW',s:skip_expr) ? if s:LookingAt() =~ '\a'
\ 'Previous' : ''}Token() ==# 'do' && s:IsBlock() if s:Pure('s:IsBlock')
return 1 if s:LookingAt() ==# 'd'
return 1
endif
break
endif
elseif s:LookingAt() != '}' || !s:GetPair('{','}','bW',s:skip_expr)
break
endif endif
call call('cursor',cpos) endwhile
endif call call('cursor',cpos)
endfunction endfunction
" returns total offset from braceless contexts. 'num' is the lineNr which " returns total offset from braceless contexts. 'num' is the lineNr which
" encloses the entire context, 'cont' if whether a:firstline is a continued " encloses the entire context, 'cont' if whether a:firstline is a continued
" expression, which could have started in a braceless context " expression, which could have started in a braceless context
function s:IsContOne(num,cont) function s:IsContOne(cont)
let [l:num, b_l] = [a:num + !a:num, 0] let [l:num, b_l] = [b:js_cache[1] + !b:js_cache[1], 0]
let pind = a:num ? indent(a:num) + s:sw() : 0 let pind = b:js_cache[1] ? indent(b:js_cache[1]) + s:sw() : 0
let ind = indent('.') + !a:cont let ind = indent('.') + !a:cont
while line('.') > l:num && ind > pind || line('.') == l:num while line('.') > l:num && ind > pind || line('.') == l:num
if indent('.') < ind && s:OneScope() if indent('.') < ind && s:OneScope()
@ -300,6 +319,7 @@ endfunction
function s:IsBlock() function s:IsBlock()
let tok = s:PreviousToken() let tok = s:PreviousToken()
if join(s:stack) =~? 'xml\|jsx' && s:SynAt(line('.'),col('.')-1) =~? 'xml\|jsx' if join(s:stack) =~? 'xml\|jsx' && s:SynAt(line('.'),col('.')-1) =~? 'xml\|jsx'
let s:in_jsx = 1
return tok != '{' return tok != '{'
elseif tok =~ '\k' elseif tok =~ '\k'
if tok ==# 'type' if tok ==# 'type'
@ -324,7 +344,7 @@ function s:IsBlock()
endfunction endfunction
function GetJavascriptIndent() function GetJavascriptIndent()
let b:js_cache = get(b:,'js_cache',[0,0,0]) call s:GetVars()
let s:synid_cache = [[],[]] let s:synid_cache = [[],[]]
let l:line = getline(v:lnum) let l:line = getline(v:lnum)
" use synstack as it validates syn state and works in an empty line " use synstack as it validates syn state and works in an empty line
@ -386,10 +406,10 @@ function GetJavascriptIndent()
let [b:js_cache[0], num] = [v:lnum, b:js_cache[1]] let [b:js_cache[0], num] = [v:lnum, b:js_cache[1]]
let [num_ind, is_op, b_l, l:switch_offset] = [s:Nat(indent(num)),0,0,0] let [num_ind, is_op, b_l, l:switch_offset, s:in_jsx] = [s:Nat(indent(num)),0,0,0,0]
if !num || s:LookingAt() == '{' && s:IsBlock() if !num || s:LookingAt() == '{' && s:IsBlock()
let ilnum = line('.') let ilnum = line('.')
if num && s:LookingAt() == ')' && s:GetPair('(',')','bW',s:skip_expr) if num && !s:in_jsx && s:LookingAt() == ')' && s:GetPair('(',')','bW',s:skip_expr)
if ilnum == num if ilnum == num
let [num, num_ind] = [line('.'), indent('.')] let [num, num_ind] = [line('.'), indent('.')]
endif endif
@ -403,26 +423,24 @@ function GetJavascriptIndent()
endif endif
endif endif
if idx == -1 && pline[-1:] !~ '[{;]' if idx == -1 && pline[-1:] !~ '[{;]'
call cursor(l:lnum, len(pline))
let sol = matchstr(l:line,s:opfirst) let sol = matchstr(l:line,s:opfirst)
if sol is '' || sol == '/' && s:SynAt(v:lnum, if sol is '' || sol == '/' && s:SynAt(v:lnum,
\ 1 + len(getline(v:lnum)) - len(l:line)) =~? 'regex' \ 1 + len(getline(v:lnum)) - len(l:line)) =~? 'regex'
if s:Continues(l:lnum,pline) if s:Continues()
let is_op = s:sw() let is_op = s:sw()
endif endif
elseif num && sol =~# '^\%(in\%(stanceof\)\=\|\*\)$' elseif num && sol =~# '^\%(in\%(stanceof\)\=\|\*\)$' &&
call cursor(l:lnum, len(pline)) \ s:LookingAt() == '}' && s:GetPair('{','}','bW',s:skip_expr) &&
if s:LookingAt() == '}' && s:GetPair('{','}','bW',s:skip_expr) && \ s:PreviousToken() == ')' && s:GetPair('(',')','bW',s:skip_expr) &&
\ s:PreviousToken() == ')' && s:GetPair('(',')','bW',s:skip_expr) && \ (s:PreviousToken() == ']' || s:LookingAt() =~ '\k' &&
\ (s:PreviousToken() == ']' || s:Token() =~ '\k' && \ s:{s:PreviousToken() == '*' ? 'Previous' : ''}Token() !=# 'function')
\ s:{s:PreviousToken() == '*' ? 'Previous' : ''}Token() !=# 'function') return num_ind + s:sw()
return num_ind + s:sw()
endif
let is_op = s:sw()
else else
let is_op = s:sw() let is_op = s:sw()
endif endif
call cursor(l:lnum, len(pline)) call cursor(l:lnum, len(pline))
let b_l = s:Nat(s:IsContOne(b:js_cache[1],is_op) - (!is_op && l:line =~ '^{')) * s:sw() let b_l = s:Nat(s:IsContOne(is_op) - (!is_op && l:line =~ '^{')) * s:sw()
endif endif
elseif idx.s:LookingAt().&cino =~ '^-1(.*(' && (search('\m\S','nbW',num) || s:ParseCino('U')) elseif idx.s:LookingAt().&cino =~ '^-1(.*(' && (search('\m\S','nbW',num) || s:ParseCino('U'))
let pval = s:ParseCino('(') let pval = s:ParseCino('(')
@ -438,10 +456,10 @@ function GetJavascriptIndent()
" main return " main return
if l:line =~ '^[])}]\|^|}' if l:line =~ '^[])}]\|^|}'
if l:line_raw[0] == ')' && getline(num)[b:js_cache[2]-1] == '(' if l:line_raw[0] == ')'
if s:ParseCino('M') if s:ParseCino('M')
return indent(l:lnum) return indent(l:lnum)
elseif &cino =~# 'm' && !s:ParseCino('m') elseif num && &cino =~# 'm' && !s:ParseCino('m')
return virtcol('.') - 1 return virtcol('.') - 1
endif endif
endif endif

View File

@ -74,48 +74,42 @@ function GetLuaIndent()
let original_cursor_pos = getpos(".") let original_cursor_pos = getpos(".")
let i = 0 " count how many blocks the previous line opens
" check if the previous line opens blocks
call cursor(v:lnum, 1) call cursor(v:lnum, 1)
let num_pairs = searchpair(s:open_patt, s:middle_patt, s:close_patt, let num_prev_opens = searchpair(s:open_patt, s:middle_patt, s:close_patt,
\ 'mrb', s:skip_expr, prev_line) \ 'mrb', s:skip_expr, prev_line)
if num_pairs > 0
let i += num_pairs
endif
" special case: call(with, {anon = function() -- should indent only once " count how many blocks the current line closes
if num_pairs > 1 && contents_prev =~# s:anon_func_start
let i = 1
endif
" check if current line closes blocks
call cursor(prev_line, col([prev_line,'$'])) call cursor(prev_line, col([prev_line,'$']))
let num_pairs = searchpair(s:open_patt, s:middle_patt, s:close_patt, let num_cur_closes = searchpair(s:open_patt, s:middle_patt, s:close_patt,
\ 'mr', s:skip_expr, v:lnum) \ 'mr', s:skip_expr, v:lnum)
if num_pairs > 0
let i -= num_pairs
endif
" special case: end}) -- end of call with anon func should unindent once let i = num_prev_opens - num_cur_closes
if num_pairs > 1 && contents_cur =~# s:anon_func_end
let i = -1
endif
" if the previous line closed a paren, unindent (except with anon funcs) " if the previous line closed a paren, outdent (except with anon funcs)
call cursor(prev_line - 1, col([prev_line - 1, '$'])) call cursor(prev_line - 1, col([prev_line - 1, '$']))
let num_pairs = searchpair('(', '', ')', 'mr', s:skip_expr, prev_line) let num_prev_closed_parens = searchpair('(', '', ')', 'mr', s:skip_expr, prev_line)
if num_pairs > 0 && contents_prev !~ s:anon_func_end if num_prev_closed_parens > 0 && contents_prev !~# s:anon_func_end
let i -= 1 let i -= 1
endif endif
" if this line closed a paren, indent (except with anon funcs) " if this line closed a paren, indent (except with anon funcs)
call cursor(prev_line, col([prev_line, '$'])) call cursor(prev_line, col([prev_line, '$']))
let num_pairs = searchpair('(', '', ')', 'mr', s:skip_expr, v:lnum) let num_cur_closed_parens = searchpair('(', '', ')', 'mr', s:skip_expr, v:lnum)
if num_pairs > 0 && contents_cur !~ s:anon_func_end if num_cur_closed_parens > 0 && contents_cur !~# s:anon_func_end
let i += 1 let i += 1
endif endif
" special case: call(with, {anon = function() -- should indent only once
if i > 1 && contents_prev =~# s:anon_func_start
let i = 1
endif
" special case: end}) -- end of call w/ anon func should outdent only once
if i < -1 && contents_cur =~# s:anon_func_end
let i = -1
endif
" restore cursor " restore cursor
call setpos(".", original_cursor_pos) call setpos(".", original_cursor_pos)

View File

@ -136,9 +136,9 @@ function! GetPerlIndent()
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold' \ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
let brace = strpart(line, bracepos, 1) let brace = strpart(line, bracepos, 1)
if brace == '(' || brace == '{' || brace == '[' if brace == '(' || brace == '{' || brace == '['
let ind = ind + &sw let ind = ind + shiftwidth()
else else
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
endif endif
let bracepos = match(line, braceclass, bracepos + 1) let bracepos = match(line, braceclass, bracepos + 1)
@ -151,25 +151,25 @@ function! GetPerlIndent()
\ || synid == "perlBraces" \ || synid == "perlBraces"
\ || synid == "perlStatementIndirObj" \ || synid == "perlStatementIndirObj"
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold' \ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
endif endif
else else
if line =~ '[{[(]\s*\(#[^])}]*\)\=$' if line =~ '[{[(]\s*\(#[^])}]*\)\=$'
let ind = ind + &sw let ind = ind + shiftwidth()
endif endif
if cline =~ '^\s*[])}]' if cline =~ '^\s*[])}]'
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
endif endif
" Indent lines that begin with 'or' or 'and' " Indent lines that begin with 'or' or 'and'
if cline =~ '^\s*\(or\|and\)\>' if cline =~ '^\s*\(or\|and\)\>'
if line !~ '^\s*\(or\|and\)\>' if line !~ '^\s*\(or\|and\)\>'
let ind = ind + &sw let ind = ind + shiftwidth()
endif endif
elseif line =~ '^\s*\(or\|and\)\>' elseif line =~ '^\s*\(or\|and\)\>'
let ind = ind - &sw let ind = ind - shiftwidth()
endif endif
return ind return ind

View File

@ -16,7 +16,7 @@ let b:did_indent = 1
" smartindent is good enough for powershell " smartindent is good enough for powershell
setlocal smartindent setlocal smartindent
" disable the indent removal for # marks " disable the indent removal for # marks
inoremap # X# inoremap <buffer> # X#
let b:undo_indent = "setl si<" let b:undo_indent = "setl si<"

View File

@ -4,7 +4,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
" Language: QML " Language: QML
" Author: Robert Kieffer " Author: Robert Kieffer
" URL: " URL:
" Last Change: 2010-03-27 (Happy Birthday, Dash!) " Last Change: 2017-10-27
" "
" Improved JavaScript indent script. " Improved JavaScript indent script.
@ -22,10 +22,10 @@ if exists("*GetJsIndent")
finish finish
endif endif
" Clean up a line of code by removing trailing '//' comments, and trimming " Clean up a line of code by removing trailing '//' and '/* */' comments, and trimming
" whitespace " whitespace
function! Trim(line) function! Trim(line)
return substitute(substitute(a:line, '// .*', '', ''), '^\s*\|\s*$', '', 'g') return substitute(substitute(substitute(a:line, '// .*', '', ''), '/\* .* \*/', '', ''), '^\s*\|\s*$', '', 'g')
endfunction endfunction
function! GetJsIndent() function! GetJsIndent()

View File

@ -11,17 +11,17 @@ endif
syn cluster crystalNotTop contains=@crystalExtendedStringSpecial,@crystalRegexpSpecial,@crystalDeclaration,crystalConditional,crystalExceptional,crystalMethodExceptional,crystalTodo,crystalLinkAttr syn cluster crystalNotTop contains=@crystalExtendedStringSpecial,@crystalRegexpSpecial,@crystalDeclaration,crystalConditional,crystalExceptional,crystalMethodExceptional,crystalTodo,crystalLinkAttr
if exists('crystal_space_errors') if exists('g:crystal_space_errors')
if !exists('crystal_no_trail_space_error') if !exists('g:crystal_no_trail_space_error')
syn match crystalSpaceError display excludenl "\s\+$" syn match crystalSpaceError display excludenl "\s\+$"
endif endif
if !exists('crystal_no_tab_space_error') if !exists('g:crystal_no_tab_space_error')
syn match crystalSpaceError display " \+\t"me=e-1 syn match crystalSpaceError display " \+\t"me=e-1
endif endif
endif endif
" Operators " Operators
if exists('crystal_operators') if exists('g:crystal_operators')
syn match crystalOperator "[~!^&|*/%+-]\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::" syn match crystalOperator "[~!^&|*/%+-]\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::"
syn match crystalOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=" syn match crystalOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!="
syn region crystalBracketOperator matchgroup=crystalOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@crystalNotTop syn region crystalBracketOperator matchgroup=crystalOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@crystalNotTop
@ -170,39 +170,39 @@ syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<
syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-'\z([^']*\)'\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart fold keepend syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-'\z([^']*\)'\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart fold keepend
syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-`\z([^`]*\)`\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart,@crystalStringSpecial fold keepend syn region crystalString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@<!<<-`\z([^`]*\)`\ze\%(.*<<-\=['`"]\=\h\)\@!+hs=s+3 matchgroup=crystalStringDelimiter end=+^\s*\zs\z1$+ contains=crystalHeredocStart,@crystalStringSpecial fold keepend
if exists('main_syntax') && g:main_syntax ==# 'ecrystal' if exists('g:main_syntax') && g:main_syntax ==# 'ecrystal'
let b:crystal_no_expensive = 1 let b:crystal_no_expensive = 1
end end
syn match crystalAliasDeclaration "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable nextgroup=crystalAliasDeclaration2 skipwhite syn match crystalAliasDeclaration "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable nextgroup=crystalAliasDeclaration2 skipwhite
syn match crystalAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable syn match crystalAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=crystalSymbol,crystalGlobalVariable,crystalPredefinedVariable
syn match crystalMethodDeclaration "[^[:space:];#(]\+" contained contains=crystalConstant,crystalBoolean,crystalPseudoVariable,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable syn match crystalMethodDeclaration "[^[:space:];#(]\+" contained contains=crystalConstant,crystalBoolean,crystalPseudoVariable,crystalInstanceVariable,crystalClassVariable,crystalGlobalVariable
syn match crystalFunctionDeclaration "[^[:space:];#(=]\+" contained contains=crystalConstant syn match crystalFunctionDeclaration "[^[:space:];#(=]\+" contained contains=crystalConstant
syn match crystalTypeDeclaration "[^[:space:];#=]\+" contained contains=crystalConstant syn match crystalTypeDeclaration "[^[:space:];#=]\+" contained contains=crystalConstant
syn match crystalClassDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator syn match crystalClassDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
syn match crystalModuleDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator syn match crystalModuleDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
syn match crystalStructDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator syn match crystalStructDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
syn match crystalLibDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator syn match crystalLibDeclaration "[^[:space:];#<]\+" contained contains=crystalConstant,crystalOperator
syn match crystalMacroDeclaration "[^[:space:];#<\"]\+" contained contains=crystalConstant,crystalOperator syn match crystalMacroDeclaration "[^[:space:];#<\"]\+" contained contains=crystalConstant,crystalOperator
syn match crystalEnumDeclaration "[^[:space:];#<\"]\+" contained contains=crystalConstant syn match crystalEnumDeclaration "[^[:space:];#<\"]\+" contained contains=crystalConstant
syn match crystalFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=crystalMethodDeclaration,crystalFunctionDeclaration syn match crystalFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=crystalMethodDeclaration,crystalFunctionDeclaration
syn match crystalFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2 syn match crystalFunction "\%(\s\|^\)\@<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2
syn match crystalFunction "\%([[:space:].]\|^\)\@<=\%(\[\][=?]\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2,crystalMethodDeclaration,crystalFunctionDeclaration syn match crystalFunction "\%([[:space:].]\|^\)\@<=\%(\[\][=?]\=\|\*\*\|[+-]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=crystalAliasDeclaration,crystalAliasDeclaration2,crystalMethodDeclaration,crystalFunctionDeclaration
syn cluster crystalDeclaration contains=crystalAliasDeclaration,crystalAliasDeclaration2,crystalMethodDeclaration,crystalFunctionDeclaration,crystalModuleDeclaration,crystalClassDeclaration,crystalStructDeclaration,crystalLibDeclaration,crystalMacroDeclaration,crystalFunction,crystalBlockParameter,crystalTypeDeclaration,crystalEnumDeclaration syn cluster crystalDeclaration contains=crystalAliasDeclaration,crystalAliasDeclaration2,crystalMethodDeclaration,crystalFunctionDeclaration,crystalModuleDeclaration,crystalClassDeclaration,crystalStructDeclaration,crystalLibDeclaration,crystalMacroDeclaration,crystalFunction,crystalBlockParameter,crystalTypeDeclaration,crystalEnumDeclaration
" Keywords " Keywords
" Note: the following keywords have already been defined: " Note: the following keywords have already been defined:
" begin case class def do end for if module unless until while " begin case class def do end for if module unless until while
syn match crystalControl "\<\%(break\|in\|next\|rescue\|return\)\>[?!]\@!" syn match crystalControl "\<\%(break\|in\|next\|rescue\|return\)\>[?!]\@!"
syn match crystalOperator "\<defined?" display syn match crystalOperator "\<defined?" display
syn match crystalKeyword "\<\%(super\|previous_def\|yield\|as\|of\|with\)\>[?!]\@!" syn match crystalKeyword "\<\%(super\|previous_def\|yield\|of\|with\|uninitialized\|union\)\>[?!]\@!"
syn match crystalBoolean "\<\%(true\|false\)\>[?!]\@!" syn match crystalBoolean "\<\%(true\|false\)\>[?!]\@!"
syn match crystalPseudoVariable "\<\%(nil\|self\|__DIR__\|__FILE__\|__LINE__\)\>[?!]\@!" " TODO: reorganise syn match crystalPseudoVariable "\<\%(nil\|self\|__DIR__\|__FILE__\|__LINE__\|__END_LINE__\)\>[?!]\@!" " TODO: reorganise
" Expensive Mode - match 'end' with the appropriate opening keyword for syntax " Expensive Mode - match 'end' with the appropriate opening keyword for syntax
" based folding and special highlighting of module/class/method definitions " based folding and special highlighting of module/class/method definitions
if !exists('b:crystal_no_expensive') && !exists('crystal_no_expensive') if !exists('b:crystal_no_expensive') && !exists('g:crystal_no_expensive')
syn match crystalDefine "\<alias\>" nextgroup=crystalAliasDeclaration skipwhite skipnl syn match crystalDefine "\<alias\>" nextgroup=crystalAliasDeclaration skipwhite skipnl
syn match crystalDefine "\<def\>" nextgroup=crystalMethodDeclaration skipwhite skipnl syn match crystalDefine "\<def\>" nextgroup=crystalMethodDeclaration skipwhite skipnl
syn match crystalDefine "\<fun\>" nextgroup=crystalFunctionDeclaration skipwhite skipnl syn match crystalDefine "\<fun\>" nextgroup=crystalFunctionDeclaration skipwhite skipnl
@ -246,10 +246,10 @@ if !exists('b:crystal_no_expensive') && !exists('crystal_no_expensive')
syn region crystalOptionalDoLine matchgroup=crystalRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=crystalOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@crystalNotTop syn region crystalOptionalDoLine matchgroup=crystalRepeat start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=crystalOptionalDo end="\%(\<do\>\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@crystalNotTop
syn region crystalRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=crystalRepeat end="\<end\>" contains=ALLBUT,@crystalNotTop nextgroup=crystalOptionalDoLine fold syn region crystalRepeatExpression start="\<for\>[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![!=?]\)\s*\)\@<=\<\%(until\|while\)\>" matchgroup=crystalRepeat end="\<end\>" contains=ALLBUT,@crystalNotTop nextgroup=crystalOptionalDoLine fold
if !exists('crystal_minlines') if !exists('g:crystal_minlines')
let crystal_minlines = 500 let g:crystal_minlines = 500
endif endif
exec 'syn sync minlines=' . crystal_minlines exec 'syn sync minlines=' . g:crystal_minlines
else else
syn match crystalControl "\<def\>[?!]\@!" nextgroup=crystalMethodDeclaration skipwhite skipnl syn match crystalControl "\<def\>[?!]\@!" nextgroup=crystalMethodDeclaration skipwhite skipnl
@ -271,7 +271,7 @@ syn match crystalLinkAttr "@\[" contained containedin=crystalLinkAttrRegion disp
syn match crystalLinkAttr "]" contained containedin=crystalLinkAttrRegion display syn match crystalLinkAttr "]" contained containedin=crystalLinkAttrRegion display
" Special Methods " Special Methods
if !exists('crystal_no_special_methods') if !exists('g:crystal_no_special_methods')
syn keyword crystalAccess protected private syn keyword crystalAccess protected private
" attr is a common variable name " attr is a common variable name
syn keyword crystalAttribute getter setter property abstract syn keyword crystalAttribute getter setter property abstract
@ -293,7 +293,7 @@ syn match crystalMacro "\%({%\|%}\|{{\|}}\)" nextgroup=crystalMacroRegion skipwh
syn match crystalSharpBang "\%^#!.*" display syn match crystalSharpBang "\%^#!.*" display
syn keyword crystalTodo FIXME NOTE TODO OPTIMIZE XXX todo contained syn keyword crystalTodo FIXME NOTE TODO OPTIMIZE XXX todo contained
syn match crystalComment "#.*" contains=crystalSharpBang,crystalSpaceError,crystalTodo,@Spell syn match crystalComment "#.*" contains=crystalSharpBang,crystalSpaceError,crystalTodo,@Spell
if !exists('crystal_no_comment_fold') if !exists('g:crystal_no_comment_fold')
syn region crystalMultilineComment start="\%(\%(^\s*#.*\n\)\@<!\%(^\s*#.*\n\)\)\%(\(^\s*#.*\n\)\{1,}\)\@=" end="\%(^\s*#.*\n\)\@<=\%(^\s*#.*\n\)\%(^\s*#\)\@!" contains=crystalComment transparent fold keepend syn region crystalMultilineComment start="\%(\%(^\s*#.*\n\)\@<!\%(^\s*#.*\n\)\)\%(\(^\s*#.*\n\)\{1,}\)\@=" end="\%(^\s*#.*\n\)\@<=\%(^\s*#.*\n\)\%(^\s*#\)\@!" contains=crystalComment transparent fold keepend
endif endif
@ -307,7 +307,7 @@ syn match crystalKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)
syn match crystalKeywordAsMethod "\<\%(if\|ifdef\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE syn match crystalKeywordAsMethod "\<\%(if\|ifdef\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(abort\|at_exit\|caller\|exit\)\>" transparent contains=NONE syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(abort\|at_exit\|caller\|exit\)\>" transparent contains=NONE
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fork\|include\)\>" transparent contains=NONE syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fork\|include\|asm\)\>" transparent contains=NONE
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(loop\|private\|protected\)\>" transparent contains=NONE syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(loop\|private\|protected\)\>" transparent contains=NONE
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(require\|raise\)\>" transparent contains=NONE syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(require\|raise\)\>" transparent contains=NONE
syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(typeof\|pointerof\|sizeof\|instance_sizeof\|\)\>" transparent contains=NONE syn match crystalKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(typeof\|pointerof\|sizeof\|instance_sizeof\|\)\>" transparent contains=NONE
@ -335,7 +335,7 @@ hi def link crystalASCIICode Character
hi def link crystalFloat Float hi def link crystalFloat Float
hi def link crystalBoolean Boolean hi def link crystalBoolean Boolean
hi def link crystalException Exception hi def link crystalException Exception
if !exists('crystal_no_identifiers') if !exists('g:crystal_no_identifiers')
hi def link crystalIdentifier Identifier hi def link crystalIdentifier Identifier
else else
hi def link crystalIdentifier NONE hi def link crystalIdentifier NONE

View File

@ -72,6 +72,7 @@ syntax keyword dartTodo contained TODO FIXME XXX
syntax region dartComment start="/\*" end="\*/" contains=dartComment,dartTodo,dartDocLink,@Spell syntax region dartComment start="/\*" end="\*/" contains=dartComment,dartTodo,dartDocLink,@Spell
syntax match dartLineComment "//.*" contains=dartTodo,@Spell syntax match dartLineComment "//.*" contains=dartTodo,@Spell
syntax match dartLineDocComment "///.*" contains=dartTodo,dartDocLink,@Spell syntax match dartLineDocComment "///.*" contains=dartTodo,dartDocLink,@Spell
syntax match dartShebangLine /^\%1l#!.*/
syntax region dartDocLink oneline contained start=+\[+ end=+\]+ syntax region dartDocLink oneline contained start=+\[+ end=+\]+
" Strings " Strings
@ -110,6 +111,7 @@ highlight default link dartOperator Operator
highlight default link dartComment Comment highlight default link dartComment Comment
highlight default link dartLineComment Comment highlight default link dartLineComment Comment
highlight default link dartLineDocComment Comment highlight default link dartLineDocComment Comment
highlight default link dartShebangLine Comment
highlight default link dartConstant Constant highlight default link dartConstant Constant
highlight default link dartTypedef Typedef highlight default link dartTypedef Typedef
highlight default link dartTodo Todo highlight default link dartTodo Todo

View File

@ -120,10 +120,10 @@ syn region elixirSigil matchgroup=elixirSigilDelimiter start=+\~\a\z('''\)+ end=
" Documentation " Documentation
if exists('g:elixir_use_markdown_for_docs') && g:elixir_use_markdown_for_docs if exists('g:elixir_use_markdown_for_docs') && g:elixir_use_markdown_for_docs
syn include @markdown syntax/markdown.vim syn include @markdown syntax/markdown.vim
syn cluster elixirDocStringContained contains=@markdown,@Spell syn cluster elixirDocStringContained contains=@markdown,@Spell,elixirInterpolation
else else
let g:elixir_use_markdown_for_docs = 0 let g:elixir_use_markdown_for_docs = 0
syn cluster elixirDocStringContained contains=elixirDocTest,elixirTodo,@Spell syn cluster elixirDocStringContained contains=elixirDocTest,elixirTodo,@Spell,elixirInterpolation
" doctests " doctests
syn region elixirDocTest start="^\s*\%(iex\|\.\.\.\)\%((\d*)\)\?>\s" end="^\s*$" contained syn region elixirDocTest start="^\s*\%(iex\|\.\.\.\)\%((\d*)\)\?>\s" end="^\s*$" contained

View File

@ -15,7 +15,7 @@ syn sync minlines=50
syn include @gitDiff syntax/diff.vim syn include @gitDiff syntax/diff.vim
syn region gitHead start=/\%^/ end=/^$/ syn region gitHead start=/\%^/ end=/^$/
syn region gitHead start=/\%(^commit \x\{40\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/ syn region gitHead start=/\%(^commit\%( \x\{40\}\)\{1,\}\%(\s*(.*)\)\=$\)\@=/ end=/^$/
" For git reflog and git show ...^{tree}, avoid sync issues " For git reflog and git show ...^{tree}, avoid sync issues
syn match gitHead /^\d\{6\} \%(\w\{4} \)\=\x\{40\}\%( [0-3]\)\=\t.*/ syn match gitHead /^\d\{6\} \%(\w\{4} \)\=\x\{40\}\%( [0-3]\)\=\t.*/

View File

@ -4,8 +4,8 @@ if exists("b:current_syntax")
finish finish
endif endif
if !exists("main_syntax") if !exists("g:main_syntax")
let main_syntax = 'html' let g:main_syntax = 'html'
endif endif
runtime! syntax/gotexttmpl.vim runtime! syntax/gotexttmpl.vim

View File

@ -99,6 +99,7 @@ syn region haskellBlockComment start="{-" end="-}"
\ haskellTodo, \ haskellTodo,
\ @Spell \ @Spell
syn region haskellPragma start="{-#" end="#-}" syn region haskellPragma start="{-#" end="#-}"
syn region haskellLiquid start="{-@" end="@-}"
syn match haskellPreProc "^#.*$" syn match haskellPreProc "^#.*$"
syn keyword haskellTodo TODO FIXME contained syn keyword haskellTodo TODO FIXME contained
" Treat a shebang line at the start of the file as a comment " Treat a shebang line at the start of the file as a comment
@ -147,6 +148,7 @@ highlight def link haskellShebang Comment
highlight def link haskellLineComment Comment highlight def link haskellLineComment Comment
highlight def link haskellBlockComment Comment highlight def link haskellBlockComment Comment
highlight def link haskellPragma SpecialComment highlight def link haskellPragma SpecialComment
highlight def link haskellLiquid SpecialComment
highlight def link haskellString String highlight def link haskellString String
highlight def link haskellChar String highlight def link haskellChar String
highlight def link haskellBacktick Operator highlight def link haskellBacktick Operator

View File

@ -35,6 +35,8 @@ syn match i3NoStartupId '--no-startup-id' contained
syn keyword i3WsSpecialParam next prev next_on_output prev_on_output back_and_forth current number syn keyword i3WsSpecialParam next prev next_on_output prev_on_output back_and_forth current number
syn keyword i3BordersSpecialParam none vertical horizontal both syn keyword i3BordersSpecialParam none vertical horizontal both
syn keyword i3ModeParam dock hide invisible skipwhite syn keyword i3ModeParam dock hide invisible skipwhite
syn keyword i3GapsCommand gaps smart_gaps smart_borders
syn keyword i3GapsParam inner outer current all set plus minus no_gaps
" these are not keywords but we add them for consistency " these are not keywords but we add them for consistency
syn keyword i3PseudoParam no false inactive syn keyword i3PseudoParam no false inactive
@ -99,6 +101,7 @@ highlight link i3ColorLast Constant
highlight link i3WsSpecialParam Constant highlight link i3WsSpecialParam Constant
highlight link i3BordersSpecialParam Constant highlight link i3BordersSpecialParam Constant
highlight link i3ModeParam Constant highlight link i3ModeParam Constant
highlight link i3GapsParam Constant
highlight link i3Var Identifier highlight link i3Var Identifier
highlight link i3SetVar Identifier highlight link i3SetVar Identifier
@ -115,6 +118,7 @@ highlight link i3Font String
highlight link i3ExecKeyword Keyword highlight link i3ExecKeyword Keyword
highlight link i3Command Keyword highlight link i3Command Keyword
highlight link i3WsKeyword Keyword highlight link i3WsKeyword Keyword
highlight link i3GapsCommand Keyword
highlight link i3ColorDef1 Define highlight link i3ColorDef1 Define
highlight link i3ColorDef3 Define highlight link i3ColorDef3 Define

View File

@ -26,17 +26,17 @@ syntax sync fromstart
" syntax case ignore " syntax case ignore
syntax case match syntax case match
syntax match jsNoise /[:,\;]\{1}/ syntax match jsNoise /[:,;]/
syntax match jsNoise /[\.]\{1}/ skipwhite skipempty nextgroup=jsObjectProp,jsFuncCall,jsPrototype,jsTaggedTemplate syntax match jsNoise /\./ skipwhite skipempty nextgroup=jsObjectProp,jsFuncCall,jsPrototype,jsTaggedTemplate
syntax match jsObjectProp contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>/ syntax match jsObjectProp contained /\<\K\k*/
syntax match jsFuncCall /\k\+\%(\s*(\)\@=/ syntax match jsFuncCall /\<\K\k*\ze\s*(/
syntax match jsParensError /[)}\]]/ syntax match jsParensError /[)}\]]/
" Program Keywords " Program Keywords
syntax keyword jsStorageClass const var let skipwhite skipempty nextgroup=jsDestructuringBlock,jsDestructuringArray,jsVariableDef syntax keyword jsStorageClass const var let skipwhite skipempty nextgroup=jsDestructuringBlock,jsDestructuringArray,jsVariableDef
syntax match jsVariableDef contained /\k\+/ skipwhite skipempty nextgroup=jsFlowDefinition syntax match jsVariableDef contained /\<\K\k*/ skipwhite skipempty nextgroup=jsFlowDefinition
syntax keyword jsOperator delete instanceof typeof void new in of skipwhite skipempty nextgroup=@jsExpression syntax keyword jsOperator delete instanceof typeof void new in of skipwhite skipempty nextgroup=@jsExpression
syntax match jsOperator /[\!\|\&\+\-\<\>\=\%\/\*\~\^]\{1}/ skipwhite skipempty nextgroup=@jsExpression syntax match jsOperator "[-!|&+<>=%/*~^]" skipwhite skipempty nextgroup=@jsExpression
syntax match jsOperator /::/ skipwhite skipempty nextgroup=@jsExpression syntax match jsOperator /::/ skipwhite skipempty nextgroup=@jsExpression
syntax keyword jsBooleanTrue true syntax keyword jsBooleanTrue true
syntax keyword jsBooleanFalse false syntax keyword jsBooleanFalse false
@ -44,7 +44,7 @@ syntax keyword jsBooleanFalse false
" Modules " Modules
syntax keyword jsImport import skipwhite skipempty nextgroup=jsModuleAsterisk,jsModuleKeyword,jsModuleGroup,jsFlowImportType syntax keyword jsImport import skipwhite skipempty nextgroup=jsModuleAsterisk,jsModuleKeyword,jsModuleGroup,jsFlowImportType
syntax keyword jsExport export skipwhite skipempty nextgroup=@jsAll,jsModuleGroup,jsExportDefault,jsModuleAsterisk,jsModuleKeyword,jsFlowTypeStatement syntax keyword jsExport export skipwhite skipempty nextgroup=@jsAll,jsModuleGroup,jsExportDefault,jsModuleAsterisk,jsModuleKeyword,jsFlowTypeStatement
syntax match jsModuleKeyword contained /\k\+/ skipwhite skipempty nextgroup=jsModuleAs,jsFrom,jsModuleComma syntax match jsModuleKeyword contained /\<\K\k*/ skipwhite skipempty nextgroup=jsModuleAs,jsFrom,jsModuleComma
syntax keyword jsExportDefault contained default skipwhite skipempty nextgroup=@jsExpression syntax keyword jsExportDefault contained default skipwhite skipempty nextgroup=@jsExpression
syntax keyword jsExportDefaultGroup contained default skipwhite skipempty nextgroup=jsModuleAs,jsFrom,jsModuleComma syntax keyword jsExportDefaultGroup contained default skipwhite skipempty nextgroup=jsModuleAs,jsFrom,jsModuleComma
syntax match jsModuleAsterisk contained /\*/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAs,jsFrom syntax match jsModuleAsterisk contained /\*/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAs,jsFrom
@ -53,44 +53,37 @@ syntax keyword jsFrom contained from skipwhite skipempty nextgroup
syntax match jsModuleComma contained /,/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAsterisk,jsModuleGroup,jsFlowTypeKeyword syntax match jsModuleComma contained /,/ skipwhite skipempty nextgroup=jsModuleKeyword,jsModuleAsterisk,jsModuleGroup,jsFlowTypeKeyword
" Strings, Templates, Numbers " Strings, Templates, Numbers
syntax region jsString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend syntax region jsString start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell extend
syntax region jsString start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend syntax region jsTemplateString start=+`+ skip=+\\`+ end=+`+ contains=jsTemplateExpression,jsSpecial,@Spell extend
syntax region jsTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=jsTemplateExpression,jsSpecial,@Spell extend syntax match jsTaggedTemplate /\<\K\k*\ze`/ nextgroup=jsTemplateString
syntax match jsTaggedTemplate /\k\+\%(`\)\@=/ nextgroup=jsTemplateString syntax match jsNumber /\c\<\%(\d\+\%(e[+-]\=\d\+\)\=\|0b[01]\+\|0o\o\+\|0x\x\+\)\>/
syntax match jsNumber /\<\d\+\%([eE][+-]\=\d\+\)\=\>\|\<0[bB][01]\+\>\|\<0[oO]\o\+\>\|\<0[xX]\x\+\>/
syntax keyword jsNumber Infinity syntax keyword jsNumber Infinity
syntax match jsFloat /\<\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/ syntax match jsFloat /\c\<\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%(e[+-]\=\d\+\)\=\>/
" Regular Expressions " Regular Expressions
syntax match jsSpecial contained "\v\\%(0|\\x\x\{2\}\|\\u\x\{4\}\|\c[A-Z]|.)" syntax match jsSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{4,5}})|c\u|.)"
syntax region jsTemplateExpression contained matchgroup=jsTemplateBraces start=+${+ end=+}+ contains=@jsExpression keepend syntax region jsTemplateExpression contained matchgroup=jsTemplateBraces start=+${+ end=+}+ contains=@jsExpression keepend
syntax region jsRegexpCharClass contained start=+\[+ skip=+\\.+ end=+\]+ syntax region jsRegexpCharClass contained start=+\[+ skip=+\\.+ end=+\]+ contains=jsSpecial
syntax match jsRegexpBoundary contained "\v%(\<@![\^$]|\\[bB])" syntax match jsRegexpBoundary contained "\v\c[$^]|\\b"
syntax match jsRegexpBackRef contained "\v\\[1-9][0-9]*" syntax match jsRegexpBackRef contained "\v\\[1-9]\d*"
syntax match jsRegexpQuantifier contained "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??" syntax match jsRegexpQuantifier contained "\v[^\\]%([?*+]|\{\d+%(,\d*)?})\??"lc=1
syntax match jsRegexpOr contained "\v\<@!\|" syntax match jsRegexpOr contained "|"
syntax match jsRegexpMod contained "\v\(@<=\?[:=!>]" syntax match jsRegexpMod contained "\v\(\?[:=!>]"lc=1
syntax region jsRegexpGroup contained start="\\\@<!(" skip="\\.\|\[\(\\.\|[^]]\)*\]" end="\\\@<!)" contains=jsRegexpCharClass,@jsRegexpSpecial keepend syntax region jsRegexpGroup contained start="[^\\]("lc=1 skip="\\.\|\[\(\\.\|[^]]\+\)\]" end=")" contains=jsRegexpCharClass,@jsRegexpSpecial keepend
if v:version > 703 || v:version == 603 && has("patch1088") syntax region jsRegexpString start=+\%(\%(\<return\|\<typeof\|\_[^)\]'"[:blank:][:alnum:]_$]\)\s*\)\@<=/\ze[^*/]+ skip=+\\.\|\[[^]]\{1,}\]+ end=+/[gimyus]\{,6}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial oneline keepend extend
syntax region jsRegexpString start=+\%(\%(\%(return\|case\)\s\+\)\@50<=\|\%(\%([)\]"']\|\d\|\w\)\s*\)\@50<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\%(\\.\|[^]]\)*\]+ end=+/[gimyu]\{,5}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial oneline keepend extend
else
syntax region jsRegexpString start=+\%(\%(\%(return\|case\)\s\+\)\@<=\|\%(\%([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\%(\\.\|[^]]\)*\]+ end=+/[gimyu]\{,5}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial oneline keepend extend
endif
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
" Objects " Objects
syntax match jsObjectKey contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue syntax match jsObjectKey contained /\<\K\k*\ze\s*:/ contains=jsFunctionKey skipwhite skipempty nextgroup=jsObjectValue
syntax match jsObjectColon contained /:/ skipwhite skipempty syntax match jsObjectColon contained /:/ skipwhite skipempty
syntax region jsObjectKeyString contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue syntax region jsObjectKeyString contained start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
syntax region jsObjectKeyString contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell skipwhite skipempty nextgroup=jsObjectValue
syntax region jsObjectKeyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsObjectValue,jsFuncArgs extend syntax region jsObjectKeyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsObjectValue,jsFuncArgs extend
syntax match jsObjectSeparator contained /,/ syntax match jsObjectSeparator contained /,/
syntax region jsObjectValue contained matchgroup=jsNoise start=/:/ end=/\%(,\|}\)\@=/ contains=@jsExpression extend syntax region jsObjectValue contained matchgroup=jsNoise start=/:/ end=/[,}]\@=/ contains=@jsExpression extend
syntax match jsObjectFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>[\r\n\t ]*(\@=/ skipwhite skipempty nextgroup=jsFuncArgs syntax match jsObjectFuncName contained /\<\K\k*\ze\_s*(/ skipwhite skipempty nextgroup=jsFuncArgs
syntax match jsFunctionKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\(\s*:\s*function\s*\)\@=/ syntax match jsFunctionKey contained /\<\K\k*\ze\s*:\s*function\>/
syntax match jsObjectMethodType contained /\%(get\|set\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsObjectFuncName syntax match jsObjectMethodType contained /\<[gs]et\ze\s\+\K\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=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue
syntax region jsObjectStringKey contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs,jsObjectValue
exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '') exe 'syntax keyword jsNull null '.(exists('g:javascript_conceal_null') ? 'conceal cchar='.g:javascript_conceal_null : '')
exe 'syntax keyword jsReturn return contained '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '').' skipwhite skipempty nextgroup=@jsExpression' exe 'syntax keyword jsReturn return contained '.(exists('g:javascript_conceal_return') ? 'conceal cchar='.g:javascript_conceal_return : '').' skipwhite skipempty nextgroup=@jsExpression'
@ -101,8 +94,8 @@ exe 'syntax keyword jsThis this '.(exists('g:javascript_conceal
exe 'syntax keyword jsSuper super contained '.(exists('g:javascript_conceal_super') ? 'conceal cchar='.g:javascript_conceal_super : '') exe 'syntax keyword jsSuper super contained '.(exists('g:javascript_conceal_super') ? 'conceal cchar='.g:javascript_conceal_super : '')
" Statement Keywords " Statement Keywords
syntax match jsBlockLabel /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\s*::\@!/ contains=jsNoise skipwhite skipempty nextgroup=jsBlock syntax match jsBlockLabel /\<\K\k*\s*::\@!/ contains=jsNoise skipwhite skipempty nextgroup=jsBlock
syntax match jsBlockLabelKey contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\%(\s*\%(;\|\n\)\)\@=/ syntax match jsBlockLabelKey contained /\<\K\k*\ze\s*\_[;]/
syntax keyword jsStatement contained with yield debugger syntax keyword jsStatement contained with yield debugger
syntax keyword jsStatement contained break continue skipwhite skipempty nextgroup=jsBlockLabelKey syntax keyword jsStatement contained break continue skipwhite skipempty nextgroup=jsBlockLabelKey
syntax keyword jsConditional if skipwhite skipempty nextgroup=jsParenIfElse syntax keyword jsConditional if skipwhite skipempty nextgroup=jsParenIfElse
@ -119,7 +112,7 @@ syntax keyword jsAsyncKeyword async await
syntax match jsSwitchColon contained /::\@!/ skipwhite skipempty nextgroup=jsSwitchBlock syntax match jsSwitchColon contained /::\@!/ skipwhite skipempty nextgroup=jsSwitchBlock
" Keywords " Keywords
syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat fetch syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set WeakSet 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 fetch
syntax keyword jsGlobalNodeObjects module exports global process __dirname __filename syntax keyword jsGlobalNodeObjects module exports global process __dirname __filename
syntax match jsGlobalNodeObjects /\<require\>/ containedin=jsFuncCall syntax match jsGlobalNodeObjects /\<require\>/ containedin=jsFuncCall
syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError
@ -164,68 +157,68 @@ syntax region jsBlock matchgroup=jsBraces s
syntax region jsModuleGroup contained matchgroup=jsModuleBraces start=/{/ end=/}/ contains=jsModuleKeyword,jsModuleComma,jsModuleAs,jsComment,jsFlowTypeKeyword skipwhite skipempty nextgroup=jsFrom fold syntax region jsModuleGroup contained matchgroup=jsModuleBraces start=/{/ end=/}/ contains=jsModuleKeyword,jsModuleComma,jsModuleAs,jsComment,jsFlowTypeKeyword skipwhite skipempty nextgroup=jsFrom fold
syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression syntax region jsSpreadExpression contained matchgroup=jsSpreadOperator start=/\.\.\./ end=/[,}\]]\@=/ contains=@jsExpression
syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/ syntax region jsRestExpression contained matchgroup=jsRestOperator start=/\.\.\./ end=/[,)]\@=/
syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|[\}]\@=\)/ contains=@jsExpression extend skipwhite skipempty nextgroup=@jsExpression syntax region jsTernaryIf matchgroup=jsTernaryIfOperator start=/?/ end=/\%(:\|}\@=\)/ contains=@jsExpression extend skipwhite skipempty nextgroup=@jsExpression
syntax match jsOperator /?\.\ze\_D/
syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs,jsFlowFunctionGroup syntax match jsGenerator contained /\*/ skipwhite skipempty nextgroup=jsFuncName,jsFuncArgs,jsFlowFunctionGroup
syntax match jsFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>/ skipwhite skipempty nextgroup=jsFuncArgs,jsFlowFunctionGroup syntax match jsFuncName contained /\<\K\k*/ skipwhite skipempty nextgroup=jsFuncArgs,jsFlowFunctionGroup
syntax region jsFuncArgExpression contained matchgroup=jsFuncArgOperator start=/=/ end=/[,)]\@=/ contains=@jsExpression extend syntax region jsFuncArgExpression contained matchgroup=jsFuncArgOperator start=/=/ end=/[,)]\@=/ contains=@jsExpression extend
syntax match jsFuncArgCommas contained ',' syntax match jsFuncArgCommas contained ','
syntax keyword jsArguments contained arguments syntax keyword jsArguments contained arguments
syntax keyword jsForAwait contained await skipwhite skipempty nextgroup=jsParenRepeat syntax keyword jsForAwait contained await skipwhite skipempty nextgroup=jsParenRepeat
" Matches a single keyword argument with no parens " Matches a single keyword argument with no parens
syntax match jsArrowFuncArgs /\k\+\s*\%(=>\)\@=/ skipwhite contains=jsFuncArgs skipwhite skipempty nextgroup=jsArrowFunction extend syntax match jsArrowFuncArgs /\<\K\k*\ze\s*=>/ skipwhite contains=jsFuncArgs skipwhite skipempty nextgroup=jsArrowFunction extend
" Matches a series of arguments surrounded in parens " Matches a series of arguments surrounded in parens
syntax match jsArrowFuncArgs /([^()]*)\s*\(=>\)\@=/ contains=jsFuncArgs skipempty skipwhite nextgroup=jsArrowFunction extend syntax match jsArrowFuncArgs /([^()]*)\ze\s*=>/ contains=jsFuncArgs skipempty skipwhite nextgroup=jsArrowFunction extend
exe 'syntax match jsFunction /\<function\>/ skipwhite skipempty nextgroup=jsGenerator,jsFuncName,jsFuncArgs,jsFlowFunctionGroup skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '') exe 'syntax match jsFunction /\<function\>/ skipwhite skipempty nextgroup=jsGenerator,jsFuncName,jsFuncArgs,jsFlowFunctionGroup skipwhite '.(exists('g:javascript_conceal_function') ? 'conceal cchar='.g:javascript_conceal_function : '')
exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFuncBlock,jsCommentFunction '.(exists('g:javascript_conceal_arrow_function') ? 'conceal cchar='.g:javascript_conceal_arrow_function : '') exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFuncBlock,jsCommentFunction '.(exists('g:javascript_conceal_arrow_function') ? 'conceal cchar='.g:javascript_conceal_arrow_function : '')
exe 'syntax match jsArrowFunction /()\s*\(=>\)\@=/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_noarg_arrow_function') ? 'conceal cchar='.g:javascript_conceal_noarg_arrow_function : '').(' contains=jsArrowFuncArgs') exe 'syntax match jsArrowFunction /()\ze\s*=>/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_noarg_arrow_function') ? 'conceal cchar='.g:javascript_conceal_noarg_arrow_function : '')
exe 'syntax match jsArrowFunction /_\s*\(=>\)\@=/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_underscore_arrow_function') ? 'conceal cchar='.g:javascript_conceal_underscore_arrow_function : '') exe 'syntax match jsArrowFunction /_\ze\s*=>/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_underscore_arrow_function') ? 'conceal cchar='.g:javascript_conceal_underscore_arrow_function : '')
" Classes " Classes
syntax keyword jsClassKeyword contained class syntax keyword jsClassKeyword contained class
syntax keyword jsExtendsKeyword contained extends skipwhite skipempty nextgroup=@jsExpression syntax keyword jsExtendsKeyword contained extends skipwhite skipempty nextgroup=@jsExpression
syntax match jsClassNoise contained /\./ syntax match jsClassNoise contained /\./
syntax match jsClassMethodType contained /\%(get\|set\|static\)\%( \k\+\)\@=/ skipwhite skipempty nextgroup=jsAsyncKeyword,jsFuncName,jsClassProperty syntax match jsClassMethodType contained /\<\%([gs]et\|static\)\ze\s\+\K\k*/ skipwhite skipempty nextgroup=jsAsyncKeyword,jsFuncName,jsClassProperty
syntax region jsClassDefinition start=/\<class\>/ end=/\(\<extends\>\s\+\)\@<!{\@=/ contains=jsClassKeyword,jsExtendsKeyword,jsClassNoise,@jsExpression,jsFlowClassGroup skipwhite skipempty nextgroup=jsCommentClass,jsClassBlock,jsFlowClassGroup syntax region jsClassDefinition start=/\<class\>/ end=/\(\<extends\>\s\+\)\@<!{\@=/ contains=jsClassKeyword,jsExtendsKeyword,jsClassNoise,@jsExpression,jsFlowClassGroup skipwhite skipempty nextgroup=jsCommentClass,jsClassBlock,jsFlowClassGroup
syntax match jsClassProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*[=:]\)\@=/ skipwhite skipempty nextgroup=jsClassValue,jsFlowClassDef syntax match jsClassProperty contained /\<\K\k*\ze\s*=/ skipwhite skipempty nextgroup=jsClassValue,jsFlowClassDef
syntax region jsClassValue contained start=/=/ end=/\%(;\|}\|\n\)\@=/ contains=@jsExpression syntax region jsClassValue contained start=/=/ end=/\_[;}]\@=/ contains=@jsExpression
syntax region jsClassPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsFuncArgs,jsClassValue extend syntax region jsClassPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsFuncArgs,jsClassValue extend
syntax match jsClassFuncName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*\>\%(\s*(\)\@=/ skipwhite skipempty nextgroup=jsFuncArgs syntax match jsClassFuncName contained /\<\K\k*\ze\s*(/ skipwhite skipempty nextgroup=jsFuncArgs
syntax region jsClassStringKey contained start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs syntax region jsClassStringKey contained start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs
syntax region jsClassStringKey contained start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contains=jsSpecial,@Spell extend skipwhite skipempty nextgroup=jsFuncArgs
" Destructuring " Destructuring
syntax match jsDestructuringPropertyValue contained /\<[0-9a-zA-Z_$]*\>/ syntax match jsDestructuringPropertyValue contained /\k\+/
syntax match jsDestructuringProperty contained /\<[0-9a-zA-Z_$]*\>\(\s*=\)\@=/ skipwhite skipempty nextgroup=jsDestructuringValue syntax match jsDestructuringProperty contained /\k\+\ze\s*=/ skipwhite skipempty nextgroup=jsDestructuringValue
syntax match jsDestructuringAssignment contained /\<[0-9a-zA-Z_$]*\>\(\s*:\)\@=/ skipwhite skipempty nextgroup=jsDestructuringValueAssignment syntax match jsDestructuringAssignment contained /\k\+\ze\s*:/ skipwhite skipempty nextgroup=jsDestructuringValueAssignment
syntax region jsDestructuringValue contained start=/=/ end=/[,}\]]\@=/ contains=@jsExpression extend 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 region jsDestructuringValueAssignment contained start=/:/ end=/[,}=]\@=/ contains=jsDestructuringPropertyValue,jsDestructuringBlock,jsNoise,jsDestructuringNoise skipwhite skipempty nextgroup=jsDestructuringValue extend
syntax match jsDestructuringNoise contained /[,\[\]]/ syntax match jsDestructuringNoise contained /[,[\]]/
syntax region jsDestructuringPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsDestructuringValue,jsDestructuringNoise extend fold syntax region jsDestructuringPropertyComputed contained matchgroup=jsBrackets start=/\[/ end=/]/ contains=@jsExpression skipwhite skipempty nextgroup=jsDestructuringValue,jsDestructuringNoise extend fold
" Comments " Comments
syntax keyword jsCommentTodo contained TODO FIXME XXX TBD syntax keyword jsCommentTodo contained TODO FIXME XXX TBD
syntax region jsComment start=/\/\// end=/$/ contains=jsCommentTodo,@Spell extend keepend syntax region jsComment start=+//+ end=/$/ contains=jsCommentTodo,@Spell extend keepend
syntax region jsComment start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell fold extend keepend syntax region jsComment start=+/\*+ end=+\*/+ contains=jsCommentTodo,@Spell fold extend keepend
syntax region jsEnvComment start=/\%^#!/ end=/$/ display syntax region jsEnvComment start=/\%^#!/ end=/$/ display
" Specialized Comments - These are special comment regexes that are used in " Specialized Comments - These are special comment regexes that are used in
" odd places that maintain the proper nextgroup functionality. It sucks we " odd places that maintain the proper nextgroup functionality. It sucks we
" can't make jsComment a skippable type of group for nextgroup " can't make jsComment a skippable type of group for nextgroup
syntax region jsCommentFunction contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn extend keepend syntax region jsCommentFunction contained start=+//+ end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn extend keepend
syntax region jsCommentFunction contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn fold extend keepend syntax region jsCommentFunction contained start=+/\*+ end=+\*/+ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsFuncBlock,jsFlowReturn fold extend keepend
syntax region jsCommentClass contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsClassBlock,jsFlowClassGroup extend keepend syntax region jsCommentClass contained start=+//+ end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsClassBlock,jsFlowClassGroup extend keepend
syntax region jsCommentClass contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsClassBlock,jsFlowClassGroup fold extend keepend syntax region jsCommentClass contained start=+/\*+ end=+\*/+ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsClassBlock,jsFlowClassGroup fold extend keepend
syntax region jsCommentIfElse contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsIfElseBlock extend keepend syntax region jsCommentIfElse contained start=+//+ end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsIfElseBlock extend keepend
syntax region jsCommentIfElse contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsIfElseBlock fold extend keepend syntax region jsCommentIfElse contained start=+/\*+ end=+\*/+ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsIfElseBlock fold extend keepend
syntax region jsCommentRepeat contained start=/\/\// end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsRepeatBlock extend keepend syntax region jsCommentRepeat contained start=+//+ end=/$/ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsRepeatBlock extend keepend
syntax region jsCommentRepeat contained start=/\/\*/ end=/\*\// contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsRepeatBlock fold extend keepend syntax region jsCommentRepeat contained start=+/\*+ end=+\*/+ contains=jsCommentTodo,@Spell skipwhite skipempty nextgroup=jsRepeatBlock fold extend keepend
" Decorators " Decorators
syntax match jsDecorator /^\s*@/ nextgroup=jsDecoratorFunction syntax match jsDecorator /^\s*@/ nextgroup=jsDecoratorFunction
syntax match jsDecoratorFunction contained /[a-zA-Z_][a-zA-Z0-9_.]*/ nextgroup=jsParenDecorator syntax match jsDecoratorFunction contained /\h[a-zA-Z0-9_.]*/ nextgroup=jsParenDecorator
if exists("javascript_plugin_jsdoc") if exists("javascript_plugin_jsdoc")
runtime extras/jsdoc.vim runtime extras/jsdoc.vim

View File

@ -13,12 +13,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
" - Fix <%text> blocks to show HTML tags but ignore Mason tags. " - Fix <%text> blocks to show HTML tags but ignore Mason tags.
" "
" Clear previous syntax settings unless this is v6 or above, in which case just " quit when a syntax file was already loaded
" exit without doing anything. if exists("b:current_syntax")
"
if version < 600
syn clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -30,26 +26,16 @@ endif
" First pull in the HTML syntax. " First pull in the HTML syntax.
" "
if version < 600 runtime! syntax/html.vim
so <sfile>:p:h/html.vim unlet b:current_syntax
else
runtime! syntax/html.vim
unlet b:current_syntax
endif
syn cluster htmlPreproc add=@masonTop syn cluster htmlPreproc add=@masonTop
" Now pull in the Perl syntax. " Now pull in the Perl syntax.
" "
if version < 600 syn include @perlTop syntax/perl.vim
syn include @perlTop <sfile>:p:h/perl.vim unlet b:current_syntax
unlet b:current_syntax syn include @podTop syntax/pod.vim
syn include @podTop <sfile>:p:h/pod.vim
else
syn include @perlTop syntax/perl.vim
unlet b:current_syntax
syn include @podTop syntax/pod.vim
endif
" It's hard to reduce down to the correct sub-set of Perl to highlight in some " It's hard to reduce down to the correct sub-set of Perl to highlight in some
" of these cases so I've taken the safe option of just using perlTop in all of " of these cases so I've taken the safe option of just using perlTop in all of
@ -88,21 +74,9 @@ syn cluster masonTop contains=masonLine,masonExpr,masonPerl,masonComp,masonArgs,
" Set up default highlighting. Almost all of this is done in the included " Set up default highlighting. Almost all of this is done in the included
" syntax files. " syntax files.
" hi def link masonDoc Comment
if version >= 508 || !exists("did_mason_syn_inits") hi def link masonPod Comment
if version < 508 hi def link masonPerlComment perlComment
let did_mason_syn_inits = 1
com -nargs=+ HiLink hi link <args>
else
com -nargs=+ HiLink hi def link <args>
endif
HiLink masonDoc Comment
HiLink masonPod Comment
HiLink masonPerlComment perlComment
delc HiLink
endif
let b:current_syntax = "mason" let b:current_syntax = "mason"

View File

@ -92,32 +92,33 @@ endif
if nim_highlight_builtins == 1 if nim_highlight_builtins == 1
" builtin functions, types and objects, not really part of the syntax " builtin functions, types and objects, not really part of the syntax
syn keyword nimBuiltin int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float float32 float64 bool syn keyword nimBuiltin int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 float float32 float64
syn keyword nimBuiltin char string cstring pointer range array openarray seq syn keyword nimBuiltin bool void chr char string cstring pointer range array openarray openArray seq varargs varArgs
syn keyword nimBuiltin set Byte Natural Positive Conversion syn keyword nimBuiltin set Byte Natural Positive Conversion
syn keyword nimBuiltin BiggestInt BiggestFloat cchar cschar cshort cint csize cuchar cushort syn keyword nimBuiltin BiggestInt BiggestFloat cchar cschar cshort cint csize cuchar cushort
syn keyword nimBuiltin clong clonglong cfloat cdouble clongdouble cuint culong culonglong cchar syn keyword nimBuiltin clong clonglong cfloat cdouble clongdouble cuint culong culonglong cchar
syn keyword nimBuiltin CompileDate CompileTime nimVersion nimMajor syn keyword nimBuiltin CompileDate CompileTime nimversion nimVersion nimmajor nimMajor
syn keyword nimBuiltin nimMinor nimPatch cpuEndian hostOS hostCPU inf syn keyword nimBuiltin nimminor nimMinor nimpatch nimPatch cpuendian cpuEndian hostos hostOS hostcpu hostCPU inf
syn keyword nimBuiltin neginf nan QuitSuccess QuitFailure dbgLineHook stdin syn keyword nimBuiltin neginf nan QuitSuccess QuitFailure dbglinehook dbgLineHook stdin
syn keyword nimBuiltin stdout stderr defined new high low sizeof succ pred syn keyword nimBuiltin stdout stderr defined new high low sizeof succ pred
syn keyword nimBuiltin inc dec newSeq len incl excl card ord chr ze ze64 syn keyword nimBuiltin inc dec newseq newSeq len incl excl card ord chr ze ze64
syn keyword nimBuiltin toU8 toU16 toU32 abs min max add repr syn keyword nimBuiltin tou8 toU8 tou16 toU16 tou32 toU32 abs min max add repr
syn match nimBuiltin "\<contains\>" syn match nimBuiltin "\<contains\>"
syn keyword nimBuiltin toFloat toBiggestFloat toInt toBiggestInt addQuitProc syn keyword nimBuiltin tofloat toFloat tobiggestfloat toBiggestFloat toint toInt tobiggestint toBiggestInt
syn keyword nimBuiltin copy setLen newString zeroMem copyMem moveMem syn keyword nimBuiltin addquitproc addQuitProc
syn keyword nimBuiltin equalMem alloc alloc0 realloc dealloc setLen assert syn keyword nimBuiltin copy setlen setLen newstring newString zeromem zeroMem copymem copyMem movemem moveMem
syn keyword nimBuiltin swap getRefcount getCurrentException Msg syn keyword nimBuiltin equalmem equalMem alloc alloc0 realloc dealloc assert
syn keyword nimBuiltin getOccupiedMem getFreeMem getTotalMem isNil seqToPtr syn keyword nimBuiltin echo swap getrefcount getRefcount getcurrentexception getCurrentException Msg
syn keyword nimBuiltin getoccupiedmem getOccupiedMem getfreemem getFreeMem gettotalmem getTotalMem isnil isNil seqtoptr seqToPtr
syn keyword nimBuiltin find pop GC_disable GC_enable GC_fullCollect syn keyword nimBuiltin find pop GC_disable GC_enable GC_fullCollect
syn keyword nimBuiltin GC_setStrategy GC_enableMarkAndSweep GC_Strategy syn keyword nimBuiltin GC_setStrategy GC_enableMarkAndSweep GC_Strategy
syn keyword nimBuiltin GC_disableMarkAnd Sweep GC_getStatistics GC_ref syn keyword nimBuiltin GC_disableMarkAnd Sweep GC_getStatistics GC_ref
syn keyword nimBuiltin GC_ref GC_ref GC_unref GC_unref GC_unref quit syn keyword nimBuiltin GC_ref GC_ref GC_unref GC_unref GC_unref quit
syn keyword nimBuiltin OpenFile OpenFile CloseFile EndOfFile readChar syn keyword nimBuiltin OpenFile OpenFile CloseFile EndOfFile readChar
syn keyword nimBuiltin FlushFile readFile write readLine writeln writeln syn keyword nimBuiltin FlushFile readfile readFile readline readLine write writeln writeLn writeline writeLine
syn keyword nimBuiltin getFileSize ReadBytes ReadChars readBuffer writeBytes syn keyword nimBuiltin getfilesize getFileSize ReadBytes ReadChars readbuffer readBuffer writebytes writeBytes
syn keyword nimBuiltin writeChars writeBuffer setFilePos getFilePos syn keyword nimBuiltin writechars writeChars writebuffer writeBuffer setfilepos setFilePos getfilepos getFilePos
syn keyword nimBuiltin fileHandle countdown countup items lines syn keyword nimBuiltin filehandle fileHandle countdown countup items lines
syn keyword nimBuiltin FileMode File RootObj FileHandle ByteAddress Endianness syn keyword nimBuiltin FileMode File RootObj FileHandle ByteAddress Endianness
endif endif

View File

@ -435,125 +435,121 @@ else
syn sync minlines=0 syn sync minlines=0
endif endif
command -nargs=+ HiLink hi def link <args>
" NOTE: If you're linking new highlight groups to perlString, please also put " NOTE: If you're linking new highlight groups to perlString, please also put
" them into b:match_skip in ftplugin/perl.vim. " them into b:match_skip in ftplugin/perl.vim.
" The default highlighting. " The default highlighting.
HiLink perlSharpBang PreProc hi def link perlSharpBang PreProc
HiLink perlControl PreProc hi def link perlControl PreProc
HiLink perlInclude Include hi def link perlInclude Include
HiLink perlSpecial Special hi def link perlSpecial Special
HiLink perlString String hi def link perlString String
HiLink perlCharacter Character hi def link perlCharacter Character
HiLink perlNumber Number hi def link perlNumber Number
HiLink perlFloat Float hi def link perlFloat Float
HiLink perlType Type hi def link perlType Type
HiLink perlIdentifier Identifier hi def link perlIdentifier Identifier
HiLink perlLabel Label hi def link perlLabel Label
HiLink perlStatement Statement hi def link perlStatement Statement
HiLink perlConditional Conditional hi def link perlConditional Conditional
HiLink perlRepeat Repeat hi def link perlRepeat Repeat
HiLink perlOperator Operator hi def link perlOperator Operator
HiLink perlFunction Keyword hi def link perlFunction Keyword
HiLink perlSubName Function hi def link perlSubName Function
HiLink perlSubPrototype Type hi def link perlSubPrototype Type
HiLink perlSignature Type hi def link perlSignature Type
HiLink perlSubAttributes PreProc hi def link perlSubAttributes PreProc
HiLink perlSubAttributesCont perlSubAttributes hi def link perlSubAttributesCont perlSubAttributes
HiLink perlComment Comment hi def link perlComment Comment
HiLink perlTodo Todo hi def link perlTodo Todo
if exists("perl_string_as_statement") if exists("perl_string_as_statement")
HiLink perlStringStartEnd perlStatement hi def link perlStringStartEnd perlStatement
else else
HiLink perlStringStartEnd perlString hi def link perlStringStartEnd perlString
endif endif
HiLink perlVStringV perlStringStartEnd hi def link perlVStringV perlStringStartEnd
HiLink perlList perlStatement hi def link perlList perlStatement
HiLink perlMisc perlStatement hi def link perlMisc perlStatement
HiLink perlVarPlain perlIdentifier hi def link perlVarPlain perlIdentifier
HiLink perlVarPlain2 perlIdentifier hi def link perlVarPlain2 perlIdentifier
HiLink perlArrow perlIdentifier hi def link perlArrow perlIdentifier
HiLink perlFiledescRead perlIdentifier hi def link perlFiledescRead perlIdentifier
HiLink perlFiledescStatement perlIdentifier hi def link perlFiledescStatement perlIdentifier
HiLink perlVarSimpleMember perlIdentifier hi def link perlVarSimpleMember perlIdentifier
HiLink perlVarSimpleMemberName perlString hi def link perlVarSimpleMemberName perlString
HiLink perlVarNotInMatches perlIdentifier hi def link perlVarNotInMatches perlIdentifier
HiLink perlVarSlash perlIdentifier hi def link perlVarSlash perlIdentifier
HiLink perlQQ perlString hi def link perlQQ perlString
HiLink perlHereDoc perlString hi def link perlHereDoc perlString
HiLink perlStringUnexpanded perlString hi def link perlStringUnexpanded perlString
HiLink perlSubstitutionSQ perlString hi def link perlSubstitutionSQ perlString
HiLink perlSubstitutionGQQ perlString hi def link perlSubstitutionGQQ perlString
HiLink perlTranslationGQ perlString hi def link perlTranslationGQ perlString
HiLink perlMatch perlString hi def link perlMatch perlString
HiLink perlMatchStartEnd perlStatement hi def link perlMatchStartEnd perlStatement
HiLink perlFormatName perlIdentifier hi def link perlFormatName perlIdentifier
HiLink perlFormatField perlString hi def link perlFormatField perlString
HiLink perlPackageDecl perlType hi def link perlPackageDecl perlType
HiLink perlStorageClass perlType hi def link perlStorageClass perlType
HiLink perlPackageRef perlType hi def link perlPackageRef perlType
HiLink perlStatementPackage perlStatement hi def link perlStatementPackage perlStatement
HiLink perlStatementStorage perlStatement hi def link perlStatementStorage perlStatement
HiLink perlStatementControl perlStatement hi def link perlStatementControl perlStatement
HiLink perlStatementScalar perlStatement hi def link perlStatementScalar perlStatement
HiLink perlStatementRegexp perlStatement hi def link perlStatementRegexp perlStatement
HiLink perlStatementNumeric perlStatement hi def link perlStatementNumeric perlStatement
HiLink perlStatementList perlStatement hi def link perlStatementList perlStatement
HiLink perlStatementHash perlStatement hi def link perlStatementHash perlStatement
HiLink perlStatementIOfunc perlStatement hi def link perlStatementIOfunc perlStatement
HiLink perlStatementFiledesc perlStatement hi def link perlStatementFiledesc perlStatement
HiLink perlStatementVector perlStatement hi def link perlStatementVector perlStatement
HiLink perlStatementFiles perlStatement hi def link perlStatementFiles perlStatement
HiLink perlStatementFlow perlStatement hi def link perlStatementFlow perlStatement
HiLink perlStatementInclude perlStatement hi def link perlStatementInclude perlStatement
HiLink perlStatementProc perlStatement hi def link perlStatementProc perlStatement
HiLink perlStatementSocket perlStatement hi def link perlStatementSocket perlStatement
HiLink perlStatementIPC perlStatement hi def link perlStatementIPC perlStatement
HiLink perlStatementNetwork perlStatement hi def link perlStatementNetwork perlStatement
HiLink perlStatementPword perlStatement hi def link perlStatementPword perlStatement
HiLink perlStatementTime perlStatement hi def link perlStatementTime perlStatement
HiLink perlStatementMisc perlStatement hi def link perlStatementMisc perlStatement
HiLink perlStatementIndirObj perlStatement hi def link perlStatementIndirObj perlStatement
HiLink perlFunctionName perlIdentifier hi def link perlFunctionName perlIdentifier
HiLink perlMethod perlIdentifier hi def link perlMethod perlIdentifier
HiLink perlPostDeref perlIdentifier hi def link perlPostDeref perlIdentifier
HiLink perlFunctionPRef perlType hi def link perlFunctionPRef perlType
if !get(g:, 'perl_include_pod', 1) if !get(g:, 'perl_include_pod', 1)
HiLink perlPOD perlComment hi def link perlPOD perlComment
endif endif
HiLink perlShellCommand perlString hi def link perlShellCommand perlString
HiLink perlSpecialAscii perlSpecial hi def link perlSpecialAscii perlSpecial
HiLink perlSpecialDollar perlSpecial hi def link perlSpecialDollar perlSpecial
HiLink perlSpecialString perlSpecial hi def link perlSpecialString perlSpecial
HiLink perlSpecialStringU perlSpecial hi def link perlSpecialStringU perlSpecial
HiLink perlSpecialMatch perlSpecial hi def link perlSpecialMatch perlSpecial
HiLink perlDATA perlComment hi def link perlDATA perlComment
" NOTE: Due to a bug in Vim (or more likely, a misunderstanding on my part), " NOTE: Due to a bug in Vim (or more likely, a misunderstanding on my part),
" I had to remove the transparent property from the following regions " I had to remove the transparent property from the following regions
" in order to get them to highlight correctly. Feel free to remove " in order to get them to highlight correctly. Feel free to remove
" these and reinstate the transparent property if you know how. " these and reinstate the transparent property if you know how.
HiLink perlParensSQ perlString hi def link perlParensSQ perlString
HiLink perlBracketsSQ perlString hi def link perlBracketsSQ perlString
HiLink perlBracesSQ perlString hi def link perlBracesSQ perlString
HiLink perlAnglesSQ perlString hi def link perlAnglesSQ perlString
HiLink perlParensDQ perlString hi def link perlParensDQ perlString
HiLink perlBracketsDQ perlString hi def link perlBracketsDQ perlString
HiLink perlBracesDQ perlString hi def link perlBracesDQ perlString
HiLink perlAnglesDQ perlString hi def link perlAnglesDQ perlString
HiLink perlSpecialStringU2 perlString hi def link perlSpecialStringU2 perlString
" Possible errors " Possible errors
HiLink perlNotEmptyLine Error hi def link perlNotEmptyLine Error
HiLink perlElseIfError Error hi def link perlElseIfError Error
HiLink perlSubPrototypeError Error hi def link perlSubPrototypeError Error
HiLink perlSubError Error hi def link perlSubError Error
delcommand HiLink
" Syncing to speed up processing " Syncing to speed up processing
" "

View File

@ -621,7 +621,7 @@ if !exists("php_ignore_phpdoc") || !php_ignore_phpdoc
syn region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpDocComment syn region phpDocTags start="{@\(example\|id\|internal\|inheritdoc\|link\|source\|toc\|tutorial\)" end="}" containedin=phpDocComment
syn match phpDocTags "@\%(abstract\|access\|api\|author\|brief\|bug\|category\|class\|copyright\|created\|date\|deprecated\|details\|example\|exception\|file\|filesource\|final\|global\|id\|ignore\|inheritdoc\|internal\|license\|link\|magic\|method\|name\|package\|param\|property\|return\|see\|since\|source\|static\|staticvar\|struct\|subpackage\|throws\|toc\|todo\|tutorial\|type\|uses\|var\|version\|warning\)" containedin=phpDocComment nextgroup=phpDocParam,phpDocIdentifier skipwhite contained syn match phpDocTags "@\%(abstract\|access\|api\|author\|brief\|bug\|category\|class\|copyright\|created\|date\|deprecated\|details\|example\|exception\|file\|filesource\|final\|global\|id\|ignore\|inheritdoc\|internal\|license\|link\|magic\|method\|name\|package\|param\|property\|return\|see\|since\|source\|static\|staticvar\|struct\|subpackage\|throws\|toc\|todo\|tutorial\|type\|uses\|var\|version\|warning\)" containedin=phpDocComment nextgroup=phpDocParam,phpDocIdentifier skipwhite contained
syn match phpDocParam "\s\+\zs\%(\h\w*|\?\)\+" nextgroup=phpDocIdentifier skipwhite contained syn match phpDocParam "\s\+\zs\(|\|\\\|\h\w*\)*\h\w*" nextgroup=phpDocIdentifier skipwhite contained
syn match phpDocIdentifier "\s\+\zs$\h\w*" contained syn match phpDocIdentifier "\s\+\zs$\h\w*" contained
syn case match syn case match

View File

@ -21,11 +21,8 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
" Remove any old syntax stuff hanging around (this is suppressed " Remove any old syntax stuff hanging around (this is suppressed
" automatically by ":syn include" if necessary). " automatically by ":syn include" if necessary).
" For version 5.x: Clear all syntax items " quit when a syntax file was already loaded
" For version 6.x: Quit when a syntax file was already loaded if exists("b:current_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
@ -69,28 +66,17 @@ syn match podEscape "\I\i*>"me=e-1 contained contains=@NoSpell
syn match podEscape2 "\d\+>"me=e-1 contained contains=@NoSpell syn match podEscape2 "\d\+>"me=e-1 contained contains=@NoSpell
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already " Only when an item doesn't have highlighting yet
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_pod_syntax_inits")
if version < 508
let did_pod_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink podCommand Statement hi def link podCommand Statement
HiLink podCmdText String hi def link podCmdText String
HiLink podOverIndent Number hi def link podOverIndent Number
HiLink podForKeywd Identifier hi def link podForKeywd Identifier
HiLink podFormat Identifier hi def link podFormat Identifier
HiLink podVerbatimLine PreProc hi def link podVerbatimLine PreProc
HiLink podSpecial Identifier hi def link podSpecial Identifier
HiLink podEscape String hi def link podEscape String
HiLink podEscape2 Number hi def link podEscape2 Number
delcommand HiLink
endif
if exists("perl_pod_spellcheck_headings") if exists("perl_pod_spellcheck_headings")
" Spell-check headings " Spell-check headings

View File

@ -21,13 +21,13 @@ syn keyword purescriptBoolean true false
syn match purescriptDelimiter "[,;|.()[\]{}]" syn match purescriptDelimiter "[,;|.()[\]{}]"
" Constructor " Constructor
syn match purescriptConstructor "\<[A-Z]\w*\>" syn match purescriptConstructor "\%(\<class\s\+\)\@15<!\<[A-Z]\w*\>"
syn region purescriptConstructorDecl matchgroup=purescriptConstructor start="\<[A-Z]\w*\>" end="\(|\|$\)"me=e-1,re=e-1 contained syn region purescriptConstructorDecl matchgroup=purescriptConstructor start="\<[A-Z]\w*\>" end="\(|\|$\)"me=e-1,re=e-1 contained
\ containedin=purescriptData,purescriptNewtype \ containedin=purescriptData,purescriptNewtype
\ contains=purescriptType,purescriptTypeVar,purescriptDelimiter,purescriptOperatorType,purescriptOperatorTypeSig,@purescriptComment \ contains=purescriptType,purescriptTypeVar,purescriptDelimiter,purescriptOperatorType,purescriptOperatorTypeSig,@purescriptComment
" Type " Type
syn match purescriptType "\<[A-Z]\w*\>" contained syn match purescriptType "\%(\<class\s\+\)\@15<!\<[A-Z]\w*\>" contained
\ containedin=purescriptTypeAlias \ containedin=purescriptTypeAlias
\ nextgroup=purescriptType,purescriptTypeVar skipwhite \ nextgroup=purescriptType,purescriptTypeVar skipwhite
syn match purescriptTypeVar "\<[_a-z]\(\w\|\'\)*\>" contained syn match purescriptTypeVar "\<[_a-z]\(\w\|\'\)*\>" contained
@ -36,9 +36,20 @@ syn region purescriptTypeExport matchgroup=purescriptType start="\<[A-Z]\(\S\&[^
\ contains=purescriptConstructor,purescriptDelimiter \ contains=purescriptConstructor,purescriptDelimiter
" Function " Function
syn match purescriptFunction "\<[_a-z]\(\w\|\'\)*\>" contained syn match purescriptFunction "\%(\<instance\s\+\|\<class\s\+\)\@18<!\<[_a-z]\(\w\|\'\)*\>" contained
syn match purescriptFunction "(\(\W\&[^(),\"]\)\+)" contained extend " syn match purescriptFunction "\<[_a-z]\(\w\|\'\)*\>" contained
syn match purescriptBacktick "`[_A-Za-z][A-Za-z0-9_]*`" syn match purescriptFunction "(\%(\<class\s\+\)\@18<!\(\W\&[^(),\"]\)\+)" contained extend
syn match purescriptBacktick "`[_A-Za-z][A-Za-z0-9_\.]*`"
" Class
syn region purescriptClassDecl start="^\%(\s*\)class\>"ms=e-5 end="\<where\>\|$"
\ contains=purescriptClass,purescriptClassName,purescriptOperatorType,purescriptOperator,purescriptType,purescriptWhere
\ nextgroup=purescriptClass
\ skipnl
syn match purescriptClass "\<class\>" containedin=purescriptClassDecl contained
\ nextgroup=purescriptClassName
\ skipnl
syn match purescriptClassName "\<[A-Z]\w*\>" containedin=purescriptClassDecl contained
" Module " Module
syn match purescriptModuleName "\(\w\+\.\?\)*" contained excludenl syn match purescriptModuleName "\(\w\+\.\?\)*" contained excludenl
@ -46,8 +57,8 @@ syn match purescriptModuleKeyword "\<module\>"
syn match purescriptModule "^module\>\s\+\<\(\w\+\.\?\)*\>" syn match purescriptModule "^module\>\s\+\<\(\w\+\.\?\)*\>"
\ contains=purescriptModuleKeyword,purescriptModuleName \ contains=purescriptModuleKeyword,purescriptModuleName
\ nextgroup=purescriptModuleParams skipwhite skipnl skipempty \ nextgroup=purescriptModuleParams skipwhite skipnl skipempty
syn region purescriptModuleParams start="(" end=")" fold contained keepend syn region purescriptModuleParams start="(" skip="([^)]\{-})" end=")" fold contained keepend
\ contains=purescriptDelimiter,purescriptType,purescriptTypeExport,purescriptFunction,purescriptStructure,purescriptModuleKeyword,@purescriptComment \ contains=purescriptClassDecl,purescriptClass,purescriptClassName,purescriptDelimiter,purescriptType,purescriptTypeExport,purescriptFunction,purescriptStructure,purescriptModuleKeyword,@purescriptComment
\ nextgroup=purescriptImportParams skipwhite \ nextgroup=purescriptImportParams skipwhite
" Import " Import
@ -86,8 +97,9 @@ syn match purescriptForall "∀"
syn keyword purescriptConditional if then else syn keyword purescriptConditional if then else
syn keyword purescriptStatement do case of in syn keyword purescriptStatement do case of in
syn keyword purescriptLet let syn keyword purescriptLet let
" syn keyword purescriptClass class
syn keyword purescriptWhere where syn keyword purescriptWhere where
syn match purescriptStructure "\<\(data\|newtype\|type\|class\|kind\)\>" syn match purescriptStructure "\<\(data\|newtype\|type\|kind\)\>"
\ nextgroup=purescriptType skipwhite \ nextgroup=purescriptType skipwhite
syn keyword purescriptStructure derive syn keyword purescriptStructure derive
syn keyword purescriptStructure instance syn keyword purescriptStructure instance
@ -101,7 +113,7 @@ syn match purescriptInfix "^\(infix\|infixl\|infixr\)\>\s\+\([0-9]\+\)\s\+\(type
" Operators " Operators
syn match purescriptOperator "\([-!#$%&\*\+/<=>\?@\\^|~:]\|\<_\>\)" syn match purescriptOperator "\([-!#$%&\*\+/<=>\?@\\^|~:]\|\<_\>\)"
syn match purescriptOperatorType "\(::\|∷\)" syn match purescriptOperatorType "\%(\<instance\>.*\)\@40<!\(::\|∷\)"
\ nextgroup=purescriptForall,purescriptType skipwhite skipnl skipempty \ nextgroup=purescriptForall,purescriptType skipwhite skipnl skipempty
syn match purescriptOperatorFunction "\(->\|<-\|[\\→←]\)" syn match purescriptOperatorFunction "\(->\|<-\|[\\→←]\)"
syn match purescriptOperatorTypeSig "\(->\|<-\|=>\|<=\|::\|[∷∀→←⇒⇐]\)" contained syn match purescriptOperatorTypeSig "\(->\|<-\|=>\|<=\|::\|[∷∀→←⇒⇐]\)" contained
@ -176,6 +188,8 @@ highlight def link purescriptLineComment purescriptComment
highlight def link purescriptBlockComment purescriptComment highlight def link purescriptBlockComment purescriptComment
" purescript general highlights " purescript general highlights
highlight def link purescriptClass purescriptKeyword
highlight def link purescriptClassName Type
highlight def link purescriptStructure purescriptKeyword highlight def link purescriptStructure purescriptKeyword
highlight def link purescriptKeyword Keyword highlight def link purescriptKeyword Keyword
highlight def link purescriptStatement Statement highlight def link purescriptStatement Statement

View File

@ -2,11 +2,14 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
" Vim syntax file " Vim syntax file
" Language: QML " Language: QML
" Maintainer: Warwick Allison <warwick.allison@nokia.com> " Maintainer: Peter Hoeg <peter@hoeg.com>
" Updaters: " Updaters: Refer to CONTRIBUTORS.md
" URL: " URL: https://github.com/peterhoeg/vim-qml
" Changes: " Changes: `git log` is your friend
" Last Change: 2009 Apr 30 " Last Change: 2017-11-11
"
" This file is bassed on the original work done by Warwick Allison
" <warwick.allison@nokia.com> whose did about 99% of the work here.
" Based on javascript syntax (as is QML) " Based on javascript syntax (as is QML)
@ -26,20 +29,20 @@ endif
syn case ignore syn case ignore
syn cluster qmlExpr contains=qmlStringD,qmlString,SqmlCharacter,qmlNumber,qmlObjectLiteralType,qmlBoolean,qmlType,qmlJsType,qmlNull,qmlGlobal,qmlFunction
syn keyword qmlCommentTodo TODO FIXME XXX TBD contained syn keyword qmlCommentTodo TODO FIXME XXX TBD contained
syn match qmlLineComment "\/\/.*" contains=@Spell,qmlCommentTodo syn match qmlLineComment "\/\/.*" contains=@Spell,qmlCommentTodo
syn match qmlCommentSkip "^[ \t]*\*\($\|[ \t]\+\)" syn match qmlCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
syn region qmlComment start="/\*" end="\*/" contains=@Spell,qmlCommentTodo fold syn region qmlComment start="/\*" end="\*/" contains=@Spell,qmlCommentTodo fold
syn match qmlSpecial "\\\d\d\d\|\\." syn match qmlSpecial "\\\d\d\d\|\\."
syn region qmlStringD start=+"+ skip=+\\\\\|\\"\|\\$+ end=+"\|$+ contains=qmlSpecial,@htmlPreproc syn region qmlStringD start=+"+ skip=+\\\\\|\\"\|\\$+ end=+"\|$+ contains=qmlSpecial,@htmlPreproc,@Spell
syn region qmlStringS start=+'+ skip=+\\\\\|\\'\|\\$+ end=+'\|$+ contains=qmlSpecial,@htmlPreproc syn region qmlStringS start=+'+ skip=+\\\\\|\\'\|\\$+ end=+'\|$+ contains=qmlSpecial,@htmlPreproc,@Spell
syn match qmlCharacter "'\\.'" syn match qmlCharacter "'\\.'"
syn match qmlNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>" syn match qmlNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
syn region qmlRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline syn region qmlRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
syn match qmlObjectLiteralType "[A-Za-z][_A-Za-z0-9]*\s*\({\)\@=" syn match qmlObjectLiteralType "[A-Za-z][_A-Za-z0-9]*\s*\({\)\@="
syn match qmlNonBindingColon "?[^;]*:" syn region qmlTernaryColon start="?" end=":" contains=@qmlExpr,qmlBraces,qmlParens
syn match qmlBindingProperty "\<[A-Za-z][_A-Za-z.0-9]*\s*:" syn match qmlBindingProperty "\<[A-Za-z][_A-Za-z.0-9]*\s*:"
syn keyword qmlConditional if else switch syn keyword qmlConditional if else switch
@ -122,7 +125,6 @@ if version >= 508 || !exists("did_qml_syn_inits")
HiLink qmlReserved Keyword HiLink qmlReserved Keyword
HiLink qmlDebug Debug HiLink qmlDebug Debug
HiLink qmlConstant Label HiLink qmlConstant Label
HiLink qmlNonBindingColon NONE
HiLink qmlBindingProperty Label HiLink qmlBindingProperty Label
HiLink qmlDeclaration Function HiLink qmlDeclaration Function

View File

@ -102,9 +102,9 @@ syn match scalaTypeTypeDeclaration /(/ contained nextgroup=scalaTypeTypeExtensio
syn match scalaTypeTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeTypeDeclaration contains=scalaTypeTypeExtension skipwhite syn match scalaTypeTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeTypeDeclaration contains=scalaTypeTypeExtension skipwhite
syn match scalaTypeTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypeExtension,scalaTypeTypeEquals skipwhite syn match scalaTypeTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypeExtension,scalaTypeTypeEquals skipwhite
syn match scalaTypeTypeEquals /=\ze[^>]/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite syn match scalaTypeTypeEquals /=\ze[^>]/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite
syn match scalaTypeTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeTypeDeclaration skipwhite syn match scalaTypeTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained contains=scalaTypeOperator nextgroup=scalaTypeTypeDeclaration skipwhite
syn match scalaTypeTypePostDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypePostExtension skipwhite syn match scalaTypeTypePostDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypePostExtension skipwhite
syn match scalaTypeTypePostExtension /\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite syn match scalaTypeTypePostExtension /\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained contains=scalaTypeOperator nextgroup=scalaTypeTypePostDeclaration skipwhite
hi link scalaTypeTypeDeclaration Type hi link scalaTypeTypeDeclaration Type
hi link scalaTypeTypeExtension Keyword hi link scalaTypeTypeExtension Keyword
hi link scalaTypeTypePostDeclaration Special hi link scalaTypeTypePostDeclaration Special
@ -113,7 +113,7 @@ hi link scalaTypeTypePostExtension Keyword
syn match scalaTypeDeclaration /(/ contained nextgroup=scalaTypeExtension contains=scalaRoundBrackets skipwhite syn match scalaTypeDeclaration /(/ contained nextgroup=scalaTypeExtension contains=scalaRoundBrackets skipwhite
syn match scalaTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeDeclaration contains=scalaTypeExtension skipwhite syn match scalaTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeDeclaration contains=scalaTypeExtension skipwhite
syn match scalaTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeExtension skipwhite syn match scalaTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeExtension skipwhite
syn match scalaTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeDeclaration skipwhite syn match scalaTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained contains=scalaTypeOperator nextgroup=scalaTypeDeclaration skipwhite
hi link scalaTypeDeclaration Type hi link scalaTypeDeclaration Type
hi link scalaTypeExtension Keyword hi link scalaTypeExtension Keyword
hi link scalaTypePostExtension Keyword hi link scalaTypePostExtension Keyword
@ -122,12 +122,14 @@ syn match scalaTypeAnnotation /\%([_a-zA-Z0-9$\s]:\_s*\)\ze[_=(\.A-Za-z0-9$]\+/
syn match scalaTypeAnnotation /)\_s*:\_s*\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration syn match scalaTypeAnnotation /)\_s*:\_s*\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration
hi link scalaTypeAnnotation Normal hi link scalaTypeAnnotation Normal
syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]\+\>/ contained syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]\+\>/ contained contains=scalaCapitalWord
syn match scalaCaseFollowing /`[^`]\+`/ contained syn match scalaCaseFollowing /`[^`]\+`/ contained contains=scalaCapitalWord
hi link scalaCaseFollowing Special hi link scalaCaseFollowing Special
syn keyword scalaKeywordModifier abstract override final lazy implicit implicitly private protected sealed null require super syn keyword scalaKeywordModifier abstract override final lazy implicit private protected sealed null super
syn keyword scalaSpecialFunction implicitly require
hi link scalaKeywordModifier Function hi link scalaKeywordModifier Function
hi link scalaSpecialFunction Function
syn keyword scalaSpecial this true false ne eq syn keyword scalaSpecial this true false ne eq
syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite
@ -199,7 +201,6 @@ hi link scalaDocLinks Function
hi link scalaParameterAnnotation Function hi link scalaParameterAnnotation Function
hi link scalaParamAnnotationValue Keyword hi link scalaParamAnnotationValue Keyword
hi link scalaCommentAnnotation Function hi link scalaCommentAnnotation Function
hi link scalaCommentCodeBlockBrackets String
hi link scalaCommentCodeBlock String hi link scalaCommentCodeBlock String
hi link scalaTodo Todo hi link scalaTodo Todo

View File

@ -41,10 +41,16 @@ hi def link tomlBoolean Boolean
syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)/ display syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)/ display
hi def link tomlDate Constant hi def link tomlDate Constant
syn match tomlTable /^\s*\[[^#\[\]]\+\]\s*\(#.*\)\?$/ contains=tomlComment syn region tomlKeyDq oneline start=/"/ end=/"/ contains=tomlEscape contained
hi def link tomlKeyDq Identifier
syn region tomlKeySq oneline start=/'/ end=/'/ contained
hi def link tomlKeySq Identifier
syn region tomlTable oneline start=/^\s*\[[^\[]/ end=/\]/ contains=tomlKeyDq,tomlKeySq
hi def link tomlTable Identifier hi def link tomlTable Identifier
syn match tomlTableArray /^\s*\[\[[^#\[\]]\+\]\]\s*\(#.*\)\?$/ contains=tomlComment syn region tomlTableArray oneline start=/^\s*\[\[/ end=/\]\]/ contains=tomlKeyDq,tomlKeySq
hi def link tomlTableArray Identifier hi def link tomlTableArray Identifier
syn keyword tomlTodo TODO FIXME XXX BUG contained syn keyword tomlTodo TODO FIXME XXX BUG contained

View File

@ -19,9 +19,6 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'twig') == -1
" 2011 July 27: Changed all references of jinja tp twig " 2011 July 27: Changed all references of jinja tp twig
" 2014 December 4: Do not assume that the base filetype is HTML. " 2014 December 4: Do not assume that the base filetype is HTML.
if exists('b:main_syntax')
finish
endif
if exists('b:current_syntax') if exists('b:current_syntax')
let b:main_syntax = b:current_syntax let b:main_syntax = b:current_syntax
else else

View File

@ -7,20 +7,11 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
" Previous: Vincent Pit <perl@profvince.com> " Previous: Vincent Pit <perl@profvince.com>
" Last Change: 2016-02-01 " Last Change: 2016-02-01
" For version 5.x: Clear all syntax items if exists("b:current_syntax")
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish finish
endif endif
" Read the C syntax to start with runtime! syntax/c.vim
if version < 600
source <sfile>:p:h/c.vim
else
runtime! syntax/c.vim
endif
" Configuration: " Configuration:
" let xs_superseded = 0 " mark C functions superseded by Perl replacements (ex. memcpy vs Copy) " let xs_superseded = 0 " mark C functions superseded by Perl replacements (ex. memcpy vs Copy)
@ -3672,29 +3663,16 @@ syn keyword xsMacro whichsig write xio_any xio_dirp xiv_iv xlv_targoff
syn keyword xsMacro xpv_len xuv_uv yystype syn keyword xsMacro xpv_len xuv_uv yystype
" Define the default highlighting. " Define the default highlighting.
" For version 5.7 and earlier: only when not done already hi def link xsPrivate Error
" For version 5.8 and later: only when an item doesn't have highlighting yet hi def link xsSuperseded Error
if version >= 508 || !exists("did_xs_syntax_inits") hi def link xsType Type
if version < 508 hi def link xsString String
let did_xs_syntax_inits = 1 hi def link xsConstant Constant
command -nargs=+ HiLink hi link <args> hi def link xsException Exception
else hi def link xsKeyword Keyword
command -nargs=+ HiLink hi def link <args> hi def link xsFunction Function
endif hi def link xsVariable Identifier
hi def link xsMacro Macro
HiLink xsPrivate Error
HiLink xsSuperseded Error
HiLink xsType Type
HiLink xsString String
HiLink xsConstant Constant
HiLink xsException Exception
HiLink xsKeyword Keyword
HiLink xsFunction Function
HiLink xsVariable Identifier
HiLink xsMacro Macro
delcommand HiLink
endif
let b:current_syntax = "xs" let b:current_syntax = "xs"