This commit is contained in:
Adam Stankiewicz 2016-06-26 18:03:28 +02:00
parent 40c54bc12b
commit c69562f864
No known key found for this signature in database
GPG Key ID: A62480DCEAC884DF
19 changed files with 405 additions and 308 deletions

View File

@ -79,7 +79,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [php](https://github.com/StanAngeloff/php.vim) (syntax) - [php](https://github.com/StanAngeloff/php.vim) (syntax)
- [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, ftplugin, ftdetect) - [plantuml](https://github.com/aklt/plantuml-syntax) (syntax, ftplugin, ftdetect)
- [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect) - [powershell](https://github.com/Persistent13/vim-ps1) (syntax, indent, ftplugin, ftdetect)
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect) - [protobuf](https://github.com/uarun/vim-protobuf) (syntax, indent, ftdetect)
- [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin, ftdetect) - [pug](https://github.com/digitaltoad/vim-pug) (syntax, indent, ftplugin, ftdetect)
- [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin, ftdetect) - [puppet](https://github.com/voxpupuli/vim-puppet) (syntax, indent, ftplugin, ftdetect)
- [purescript](https://github.com/raichoo/purescript-vim) (syntax, indent, ftdetect) - [purescript](https://github.com/raichoo/purescript-vim) (syntax, indent, ftdetect)
@ -99,7 +99,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect) - [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax, ftdetect)
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect) - [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin, ftdetect)
- [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect) - [thrift](https://github.com/solarnz/thrift.vim) (syntax, ftdetect)
- [tmux](https://github.com/tejr/vim-tmux) (syntax, ftdetect) - [tmux](https://github.com/keith/tmux.vim) (syntax, ftplugin, ftdetect)
- [tomdoc](https://github.com/wellbredgrapefruit/tomdoc.vim) (syntax) - [tomdoc](https://github.com/wellbredgrapefruit/tomdoc.vim) (syntax)
- [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect) - [toml](https://github.com/cespare/vim-toml) (syntax, ftplugin, ftdetect)
- [twig](https://github.com/evidens/vim-twig) (syntax, ftplugin) - [twig](https://github.com/evidens/vim-twig) (syntax, ftplugin)

2
build
View File

@ -170,7 +170,7 @@ PACKS="
systemd:kurayama/systemd-vim-syntax systemd:kurayama/systemd-vim-syntax
textile:timcharper/textile.vim textile:timcharper/textile.vim
thrift:solarnz/thrift.vim thrift:solarnz/thrift.vim
tmux:tejr/vim-tmux tmux:keith/tmux.vim
tomdoc:wellbredgrapefruit/tomdoc.vim tomdoc:wellbredgrapefruit/tomdoc.vim
toml:cespare/vim-toml toml:cespare/vim-toml
twig:evidens/vim-twig twig:evidens/vim-twig

View File

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

View File

@ -157,14 +157,14 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
let s:current_fileformats = '' let s:current_fileformats = ''
let s:current_fileencodings = '' let s:current_fileencodings = ''
function! s:gofiletype_pre(type) function! s:gofiletype_pre(type)
let s:current_fileformats = &g:fileformats let s:current_fileformats = &g:fileformats
let s:current_fileencodings = &g:fileencodings let s:current_fileencodings = &g:fileencodings
set fileencodings=utf-8 fileformats=unix set fileencodings=utf-8 fileformats=unix
let &l:filetype = a:type let &l:filetype = a:type
endfunction endfunction
function! s:gofiletype_post() function! s:gofiletype_post()
let &g:fileformats = s:current_fileformats let &g:fileformats = s:current_fileformats
let &g:fileencodings = s:current_fileencodings let &g:fileencodings = s:current_fileencodings
endfunction endfunction
au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix
au BufRead *.go call s:gofiletype_pre("go") au BufRead *.go call s:gofiletype_pre("go")
@ -436,7 +436,7 @@ au BufNewFile,BufRead .pryrc call s:setf('ruby')
au BufNewFile,BufRead Puppetfile call s:setf('ruby') au BufNewFile,BufRead Puppetfile call s:setf('ruby')
au BufNewFile,BufRead *.rabl call s:setf('ruby') au BufNewFile,BufRead *.rabl call s:setf('ruby')
au BufNewFile,BufRead [rR]outefile call s:setf('ruby') au BufNewFile,BufRead [rR]outefile call s:setf('ruby')
au BufNewFile,BufRead .simplecov call s:setf('ruby) au BufNewFile,BufRead .simplecov call s:setf('ruby')
au BufNewFile,BufRead [tT]horfile,*.thor call s:setf('ruby') au BufNewFile,BufRead [tT]horfile,*.thor call s:setf('ruby')
au BufNewFile,BufRead [vV]agrantfile call s:setf('ruby') au BufNewFile,BufRead [vV]agrantfile call s:setf('ruby')
endif endif
@ -507,8 +507,7 @@ au BufNewFile,BufRead *.thrift setlocal filetype=thrift
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal filetype=tmux autocmd BufNewFile,BufRead {.,}tmux*.conf* setfiletype tmux
autocmd BufNewFile,BufRead {.,}tmux.conf{.*,} setlocal commentstring=#\ %s
endif endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1

View File

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

5
ftplugin/tmux.vim Normal file
View File

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

View File

@ -7,13 +7,20 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'blade') == -1
if exists("b:did_indent") if exists("b:did_indent")
finish finish
endif endif
runtime! indent/html.vim runtime! indent/html.vim
let s:htmlindent = &indentexpr
unlet! b:did_indent unlet! b:did_indent
runtime! indent/php.vim
let s:phpindent = &indentexpr
unlet! b:did_indent
let b:did_indent = 1 let b:did_indent = 1
setlocal autoindent setlocal autoindent
setlocal indentexpr=GetBladeIndent() setlocal indentexpr=GetBladeIndent()
setlocal indentkeys=o,O,*<Return>,<>>,!^F,=@else,=@end,=@empty,=@show setlocal indentkeys=o,O,*<Return>,<>>,!^F,=@else,=@end,=@empty,=@show,=@stop
" Only define the function once. " Only define the function once.
if exists("*GetBladeIndent") if exists("*GetBladeIndent")
@ -30,13 +37,19 @@ function! GetBladeIndent()
let cline = substitute(substitute(getline(v:lnum), '\s\+$', '', ''), '^\s\+', '', '') let cline = substitute(substitute(getline(v:lnum), '\s\+$', '', ''), '^\s\+', '', '')
let indent = indent(lnum) let indent = indent(lnum)
let cindent = indent(v:lnum) let cindent = indent(v:lnum)
if cline =~# '@\%(else\|elseif\|empty\|end\|show\)' if cline =~# '@\%(else\|elseif\|empty\|end\|show\|stop\)' ||
\ cline =~# '\%(<?.*\)\@<!?>\|\%({{.*\)\@<!}}\|\%({!!.*\)\@<!!!}'
let indent = indent - &sw let indent = indent - &sw
else else
if exists("*GetBladeIndentCustom") if exists("*GetBladeIndentCustom")
let hindent = GetBladeIndentCustom() let hindent = GetBladeIndentCustom()
elseif searchpair('@include\s*(', '', ')', 'bWr') ||
\ searchpair('{!!', '', '!!}', 'bWr') ||
\ searchpair('{{', '', '}}', 'bWr') ||
\ searchpair('<?', '', '?>', 'bWr')
execute 'let hindent = ' . s:phpindent
else else
let hindent = HtmlIndent() execute 'let hindent = ' . s:htmlindent
endif endif
if hindent > -1 if hindent > -1
let indent = hindent let indent = hindent
@ -47,10 +60,13 @@ function! GetBladeIndent()
let indent = cindent <= indent ? -1 : increase let indent = cindent <= indent ? -1 : increase
endif endif
if line =~# '@\%(section\)\%(.*\s*@end\)\@!' && line !~# '@\%(section\)\s*([^,]*)' if line =~# '@\%(section\)\%(.*@end\)\@!' && line !~# '@\%(section\)\s*([^,]*)'
return indent return indent
elseif line =~# '@\%(if\|elseif\|else\|unless\|foreach\|forelse\|for\|while\|empty\|push\|section\|can\)\%(.*\s*@end\)\@!' elseif line =~# '@\%(if\|elseif\|else\|unless\|foreach\|forelse\|for\|while\|empty\|push\|section\|can\|hasSection\)\%(.*@end\|.*@stop\)\@!' ||
\ line =~# '{{\%(.*}}\)\@!' || line =~# '{!!\%(.*!!}\)\@!'
return increase return increase
elseif line =~# '<?\%(.*?>\)\@!'
return indent(lnum-1) == -1 ? increase : indent(lnum) + increase
else else
return indent return indent
endif endif

View File

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

View File

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

View File

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

21
indent/proto.vim Normal file
View File

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

View File

@ -70,7 +70,7 @@ if !exists("g:go_highlight_methods")
endif endif
if !exists("g:go_highlight_fields") if !exists("g:go_highlight_fields")
let g:go_highlight_fields = 0 let g:go_highlight_fields = 0
endif endif
if !exists("g:go_highlight_structs") if !exists("g:go_highlight_structs")
@ -338,35 +338,35 @@ hi def link goInterfaceDef Function
" Build Constraints " Build Constraints
if g:go_highlight_build_constraints != 0 if g:go_highlight_build_constraints != 0
syn match goBuildKeyword display contained "+build" syn match goBuildKeyword display contained "+build"
" Highlight the known values of GOOS, GOARCH, and other +build options. " Highlight the known values of GOOS, GOARCH, and other +build options.
syn keyword goBuildDirectives contained syn keyword goBuildDirectives contained
\ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 \ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9
\ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64 \ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64
\ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc \ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc
\ s390 s390x sparc sparc64 cgo ignore race \ s390 s390x sparc sparc64 cgo ignore race
" Other words in the build directive are build tags not listed above, so " Other words in the build directive are build tags not listed above, so
" avoid highlighting them as comments by using a matchgroup just for the " avoid highlighting them as comments by using a matchgroup just for the
" start of the comment. " start of the comment.
" The rs=s+2 option lets the \s*+build portion be part of the inner region " The rs=s+2 option lets the \s*+build portion be part of the inner region
" instead of the matchgroup so it will be highlighted as a goBuildKeyword. " instead of the matchgroup so it will be highlighted as a goBuildKeyword.
syn region goBuildComment matchgroup=goBuildCommentStart syn region goBuildComment matchgroup=goBuildCommentStart
\ start="//\s*+build\s"rs=s+2 end="$" \ start="//\s*+build\s"rs=s+2 end="$"
\ contains=goBuildKeyword,goBuildDirectives \ contains=goBuildKeyword,goBuildDirectives
hi def link goBuildCommentStart Comment hi def link goBuildCommentStart Comment
hi def link goBuildDirectives Type hi def link goBuildDirectives Type
hi def link goBuildKeyword PreProc hi def link goBuildKeyword PreProc
" One or more line comments that are followed immediately by a "package" " One or more line comments that are followed immediately by a "package"
" declaration are treated like package documentation, so these must be " declaration are treated like package documentation, so these must be
" matched as comments to avoid looking like working build constraints. " matched as comments to avoid looking like working build constraints.
" The he, me, and re options let the "package" itself be highlighted by " The he, me, and re options let the "package" itself be highlighted by
" the usual rules. " the usual rules.
syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/ syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/
\ end=/\v\n\s*package/he=e-7,me=e-7,re=e-7 \ end=/\v\n\s*package/he=e-7,me=e-7,re=e-7
\ contains=@goCommentGroup,@Spell \ contains=@goCommentGroup,@Spell
hi def link goPackageComment Comment hi def link goPackageComment Comment
endif endif
@ -379,4 +379,6 @@ syn sync minlines=500
let b:current_syntax = "go" let b:current_syntax = "go"
" vim: sw=2 ts=2 et
endif endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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