diff options
Diffstat (limited to 'runtime/syntax')
-rw-r--r-- | runtime/syntax/2html.vim | 93 | ||||
-rw-r--r-- | runtime/syntax/abap.vim | 13 | ||||
-rw-r--r-- | runtime/syntax/apache.vim | 4 | ||||
-rw-r--r-- | runtime/syntax/automake.vim | 18 | ||||
-rw-r--r-- | runtime/syntax/cs.vim | 39 | ||||
-rw-r--r-- | runtime/syntax/debchangelog.vim | 6 | ||||
-rw-r--r-- | runtime/syntax/debsources.vim | 4 | ||||
-rw-r--r-- | runtime/syntax/dune.vim | 46 | ||||
-rw-r--r-- | runtime/syntax/eruby.vim | 19 | ||||
-rw-r--r-- | runtime/syntax/ocaml.vim | 2 | ||||
-rw-r--r-- | runtime/syntax/raml.vim | 106 | ||||
-rw-r--r-- | runtime/syntax/rst.vim | 3 | ||||
-rw-r--r-- | runtime/syntax/ruby.vim | 71 | ||||
-rw-r--r-- | runtime/syntax/sh.vim | 81 | ||||
-rw-r--r-- | runtime/syntax/tasm.vim | 4 | ||||
-rw-r--r-- | runtime/syntax/tex.vim | 10 | ||||
-rw-r--r-- | runtime/syntax/tpp.vim | 22 | ||||
-rw-r--r-- | runtime/syntax/vim.vim | 2 |
18 files changed, 387 insertions, 156 deletions
diff --git a/runtime/syntax/2html.vim b/runtime/syntax/2html.vim index ddc7819be2..4a2d1d3959 100644 --- a/runtime/syntax/2html.vim +++ b/runtime/syntax/2html.vim @@ -1,6 +1,6 @@ " Vim syntax support file " Maintainer: Ben Fritz <fritzophrenic@gmail.com> -" Last Change: 2015 Sep 08 +" Last Change: 2018 Nov 11 " " Additional contributors: " @@ -633,6 +633,45 @@ if s:current_syntax == '' let s:current_syntax = 'none' endif +" If the user is sourcing this script directly then the plugin version isn't +" known because the main plugin script didn't load. In the usual case where the +" user still has the full Vim runtime installed, or has this full plugin +" installed in a package or something, then we can extract the version from the +" main plugin file at it's usual spot relative to this file. Otherwise the user +" is assembling their runtime piecemeal and we have no idea what versions of +" other files may be present so don't even try to make a guess or assume the +" presence of other specific files with specific meaning. +" +" We don't want to actually source the main plugin file here because the user +" may have a good reason not to (e.g. they define their own TOhtml command or +" something). +" +" If this seems way too complicated and convoluted, it is. Probably I should +" have put the version information in the autoload file from the start. But the +" version has been in the global variable for so long that changing it could +" break a lot of user scripts. +if exists("g:loaded_2html_plugin") + let s:pluginversion = g:loaded_2html_plugin +else + if !exists("g:unloaded_tohtml_plugin") + let s:main_plugin_path = expand("<sfile>:p:h:h")."/plugin/tohtml.vim" + if filereadable(s:main_plugin_path) + let s:lines = readfile(s:main_plugin_path, "", 20) + call filter(s:lines, 'v:val =~ "loaded_2html_plugin = "') + if empty(s:lines) + let g:unloaded_tohtml_plugin = "unknown" + else + let g:unloaded_tohtml_plugin = substitute(s:lines[0], '.*loaded_2html_plugin = \([''"]\)\(\%(\1\@!.\)\+\)\1', '\2', '') + endif + unlet s:lines + else + let g:unloaded_tohtml_plugin = "unknown" + endif + unlet s:main_plugin_path + endif + let s:pluginversion = g:unloaded_tohtml_plugin +endif + " Split window to create a buffer with the HTML file. let s:orgbufnr = winbufnr(0) let s:origwin_stl = &l:stl @@ -721,7 +760,7 @@ endif call extend(s:lines, [ \ ("<title>".expand("%:p:~")."</title>"), \ ("<meta name=\"Generator\" content=\"Vim/".v:version/100.".".v:version%100.'"'.s:tag_close), - \ ("<meta name=\"plugin-version\" content=\"".g:loaded_2html_plugin.'"'.s:tag_close) + \ ("<meta name=\"plugin-version\" content=\"".s:pluginversion.'"'.s:tag_close) \ ]) call add(s:lines, '<meta name="syntax" content="'.s:current_syntax.'"'.s:tag_close) call add(s:lines, '<meta name="settings" content="'. @@ -807,12 +846,15 @@ if s:settings.use_css endif endif -" insert script tag; javascript is always needed for the line number -" normalization for URL hashes -call extend(s:lines, [ - \ "", - \ "<script type='text/javascript'>", - \ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"]) +let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids || !empty(s:settings.prevent_copy) + +" insert script tag if needed +if s:uses_script + call extend(s:lines, [ + \ "", + \ "<script type='text/javascript'>", + \ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"]) +endif " insert javascript to toggle folds open and closed if s:settings.dynamic_folds @@ -849,8 +891,9 @@ if s:settings.line_ids \ " if (lineNum.indexOf('L') == -1) {", \ " lineNum = 'L'+lineNum;", \ " }", - \ " lineElem = document.getElementById(lineNum);" + \ " var lineElem = document.getElementById(lineNum);" \ ]) + if s:settings.dynamic_folds call extend(s:lines, [ \ "", @@ -940,12 +983,14 @@ if !empty(s:settings.prevent_copy) \ ]) endif -" insert script closing tag -call extend(s:lines, [ - \ '', - \ s:settings.use_xhtml ? '//]]>' : '-->', - \ "</script>" - \ ]) +" insert script closing tag if needed +if s:uses_script + call extend(s:lines, [ + \ '', + \ s:settings.use_xhtml ? '//]]>' : '-->', + \ "</script>" + \ ]) +endif call extend(s:lines, ["</head>"]) if !empty(s:settings.prevent_copy) @@ -1525,10 +1570,22 @@ while s:lnum <= s:end if s:settings.expand_tabs let s:offset = 0 let s:idx = stridx(s:expandedtab, "\t") + let s:tablist = split(&vts,',') + if empty(s:tablist) + let s:tablist = [ &ts ] + endif + let s:tabidx = 0 + let s:tabwidth = 0 while s:idx >= 0 + while s:startcol+s:idx > s:tabwidth + s:tablist[s:tabidx] + let s:tabwidth += s:tablist[s:tabidx] + if s:tabidx < len(s:tablist)-1 + let s:tabidx = s:tabidx+1 + endif + endwhile if has("multi_byte_encoding") if s:startcol + s:idx == 1 - let s:i = &ts + let s:i = s:tablist[s:tabidx] else if s:idx == 0 let s:prevc = matchstr(s:line, '.\%' . (s:startcol + s:idx + s:offset) . 'c') @@ -1536,11 +1593,11 @@ while s:lnum <= s:end let s:prevc = matchstr(s:expandedtab, '.\%' . (s:idx + 1) . 'c') endif let s:vcol = virtcol([s:lnum, s:startcol + s:idx + s:offset - len(s:prevc)]) - let s:i = &ts - (s:vcol % &ts) + let s:i = s:tablist[s:tabidx] - (s:vcol - s:tabwidth) endif let s:offset -= s:i - 1 else - let s:i = &ts - ((s:idx + s:startcol - 1) % &ts) + let s:i = s:tablist[s:tabidx] - ((s:idx + s:startcol - 1) - s:tabwidth) endif let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', s:i), '') let s:idx = stridx(s:expandedtab, "\t") diff --git a/runtime/syntax/abap.vim b/runtime/syntax/abap.vim index c2857a5f30..4650109fb1 100644 --- a/runtime/syntax/abap.vim +++ b/runtime/syntax/abap.vim @@ -1,11 +1,10 @@ " Vim ABAP syntax file " Language: SAP - ABAP/R4 -" Revision: 2.1 " Maintainer: Marius Piedallu van Wyk <lailoken@gmail.com> -" Last Change: 2013 Jun 13 +" Last Change: 2018 Dec 12 " Comment: Thanks to EPI-USE Labs for all your assistance. :) -" quit when a syntax file was already loaded +" Quit when a syntax file was already loaded if exists("b:current_syntax") finish endif @@ -55,6 +54,7 @@ syn match abapComplexStatement "\<RESPECTING\W\+BLANKS\>" syn match abapComplexStatement "\<SEPARATED\W\+BY\>" syn match abapComplexStatement "\<USING\(\W\+EDIT\W\+MASK\)\?\>" syn match abapComplexStatement "\<WHERE\(\W\+LINE\)\?\>" +syn match abapComplexStatement "\<GET\W\+\(TIME\(\W\+STAMP\)\?\(\W\+FIELD\)\?\|PF-STATUS\|BADI\|BIT\|CONNECTION\|CURSOR\|REFERENCE\W\+OF\)\>" syn match abapComplexStatement "\<RADIOBUTTON\W\+GROUP\>" syn match abapComplexStatement "\<REF\W\+TO\>" syn match abapComplexStatement "\<\(PUBLIC\|PRIVATE\|PROTECTED\)\(\W\+SECTION\)\?\>" @@ -109,7 +109,7 @@ syn keyword abapStatement CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT CO syn keyword abapStatement DATA DEFINE DEFINITION DEFERRED DELETE DESCRIBE DETAIL DIVIDE DO syn keyword abapStatement ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT syn keyword abapStatement FETCH FIELDS FORM FORMAT FREE FROM FUNCTION -syn keyword abapStatement GENERATE GET +syn keyword abapStatement GENERATE syn keyword abapStatement HIDE syn keyword abapStatement IF IMPORT IMPORTING INDEX INFOTYPES INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION syn keyword abapStatement LEAVE LIKE LINE LOAD LOCAL LOOP @@ -147,7 +147,7 @@ syn keyword abapSpecial TRUE FALSE NULL SPACE syn region abapInclude start="include" end="." contains=abapComment " Types -syn keyword abapTypes c n i p f d t x string xstring decfloat16 decfloat34 +syn keyword abapTypes c n i int8 p f d t x string xstring decfloat16 decfloat34 " Atritmitic operators syn keyword abapOperator abs sign ceil floor trunc frac acos asin atan cos sin tan @@ -193,5 +193,4 @@ hi def link abapHex Number let b:current_syntax = "abap" -" vim: ts=8 sw=2 - +" vim: ts=8 sw=2
\ No newline at end of file diff --git a/runtime/syntax/apache.vim b/runtime/syntax/apache.vim index e2315db0d7..71babfba36 100644 --- a/runtime/syntax/apache.vim +++ b/runtime/syntax/apache.vim @@ -3,7 +3,7 @@ " Maintainer: David Necas (Yeti) <yeti@physics.muni.cz> " License: This file can be redistribued and/or modified under the same terms " as Vim itself. -" Last Change: 2014-03-04 +" Last Change: 2018-12-06 " Notes: Last synced with apache-2.2.3, version 1.x is no longer supported " TODO: see particular FIXME's scattered through the file " make it really linewise? @@ -159,7 +159,7 @@ syn keyword apacheOption inherit syn keyword apacheDeclaration BrowserMatch BrowserMatchNoCase SetEnvIf SetEnvIfNoCase syn keyword apacheDeclaration LoadFile LoadModule syn keyword apacheDeclaration CheckSpelling CheckCaseOnly -syn keyword apacheDeclaration SSLCACertificateFile SSLCACertificatePath SSLCADNRequestFile SSLCADNRequestPath SSLCARevocationFile SSLCARevocationPath SSLCertificateChainFile SSLCertificateFile SSLCertificateKeyFile SSLCipherSuite SSLCryptoDevice SSLEngine SSLHonorCipherOrder SSLMutex SSLOptions SSLPassPhraseDialog SSLProtocol SSLProxyCACertificateFile SSLProxyCACertificatePath SSLProxyCARevocationFile SSLProxyCARevocationPath SSLProxyCipherSuite SSLProxyEngine SSLProxyMachineCertificateFile SSLProxyMachineCertificatePath SSLProxyProtocol SSLProxyVerify SSLProxyVerifyDepth SSLRandomSeed SSLRequire SSLRequireSSL SSLSessionCache SSLSessionCacheTimeout SSLUserName SSLVerifyClient SSLVerifyDepth +syn keyword apacheDeclaration SSLCACertificateFile SSLCACertificatePath SSLCADNRequestFile SSLCADNRequestPath SSLCARevocationFile SSLCARevocationPath SSLCertificateChainFile SSLCertificateFile SSLCertificateKeyFile SSLCipherSuite SSLCompression SSLCryptoDevice SSLEngine SSLFIPS SSLHonorCipherOrder SSLInsecureRenegotiation SSLMutex SSLOptions SSLPassPhraseDialog SSLProtocol SSLProxyCACertificateFile SSLProxyCACertificatePath SSLProxyCARevocationFile SSLProxyCARevocationPath SSLProxyCheckPeerCN SSLProxyCheckPeerExpire SSLProxyCipherSuite SSLProxyEngine SSLProxyMachineCertificateChainFile SSLProxyMachineCertificateFile SSLProxyMachineCertificatePath SSLProxyProtocol SSLProxyVerify SSLProxyVerifyDepth SSLRandomSeed SSLRenegBufferSize SSLRequire SSLRequireSSL SSLSessionCache SSLSessionCacheTimeout SSLSessionTicketKeyFile SSLSessionTickets SSLStrictSNIVHostCheck SSLUserName SSLVerifyClient SSLVerifyDepth syn match apacheOption "[+-]\?\<\(StdEnvVars\|CompatEnvVars\|ExportCertData\|FakeBasicAuth\|StrictRequire\|OptRenegotiate\)\>" syn keyword apacheOption builtin sem syn match apacheOption "\(file\|exec\|egd\|dbm\|shm\):" diff --git a/runtime/syntax/automake.vim b/runtime/syntax/automake.vim index 2a215a9e04..8a7db7c27b 100644 --- a/runtime/syntax/automake.vim +++ b/runtime/syntax/automake.vim @@ -1,9 +1,9 @@ " Vim syntax file -" Language: automake Makefile.am -" Maintainer: Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> -" Former Maintainer: John Williams <jrw@pobox.com> -" Last Change: 2011-06-13 -" URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/automake.vim +" Language: automake Makefile.am +" Maintainer: Debian Vim Maintainers +" Former Maintainer: John Williams <jrw@pobox.com> +" Last Change: 2018 Dec 27 +" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/automake.vim " " XXX This file is in need of a new maintainer, Debian VIM Maintainers maintain " it only because patches have been submitted for it by Debian users and the @@ -18,7 +18,7 @@ " EXTRA_SOURCES. " Standard syntax initialization -if exists("b:current_syntax") +if exists('b:current_syntax') finish endif @@ -37,8 +37,8 @@ syn match automakeConditional "^\(if\s*!\=\w\+\|else\|endif\)\s*$" syn match automakeSubst "@\w\+@" syn match automakeSubst "^\s*@\w\+@" -syn match automakeComment1 "#.*$" contains=automakeSubst -syn match automakeComment2 "##.*$" +syn match automakeComment1 "#.*$" contains=automakeSubst,@Spell +syn match automakeComment2 "##.*$" contains=@Spell syn match automakeMakeError "$[{(][^})]*[^a-zA-Z0-9_})][^})]*[})]" " GNU make function call syn match automakeMakeError "^AM_LDADD\s*\ze+\==" " Common mistake @@ -72,6 +72,6 @@ hi def link automakeMakeSString makeSString hi def link automakeMakeBString makeBString -let b:current_syntax = "automake" +let b:current_syntax = 'automake' " vi: ts=8 sw=4 sts=4 diff --git a/runtime/syntax/cs.vim b/runtime/syntax/cs.vim index 116afe0b72..1652cb63c3 100644 --- a/runtime/syntax/cs.vim +++ b/runtime/syntax/cs.vim @@ -3,7 +3,7 @@ " Maintainer: Nick Jensen <nickspoon@gmail.com> " Former Maintainers: Anduin Withers <awithers@anduin.com> " Johannes Zellner <johannes@zellner.org> -" Last Change: 2018-06-29 +" Last Change: 2018-11-26 " Filenames: *.cs " License: Vim (see :h license) " Repository: https://github.com/nickspoons/vim-cs @@ -11,12 +11,12 @@ " REFERENCES: " [1] ECMA TC39: C# Language Specification (WD13Oct01.doc) -if exists("b:current_syntax") - finish +if exists('b:current_syntax') + finish endif -let s:cs_cpo_save = &cpo -set cpo&vim +let s:save_cpo = &cpoptions +set cpoptions&vim syn keyword csType bool byte char decimal double float int long object sbyte short string T uint ulong ushort var void dynamic @@ -34,7 +34,7 @@ syn keyword csException try catch finally throw when syn keyword csLinq ascending by descending equals from group in into join let on orderby select where syn keyword csAsync async await -syn keyword csUnspecifiedStatement as base checked event fixed in is lock nameof operator out params ref sizeof stackalloc this typeof unchecked unsafe using +syn keyword csUnspecifiedStatement as base checked event fixed in is lock nameof operator out params ref sizeof stackalloc this unchecked unsafe using syn keyword csUnsupportedStatement add remove value syn keyword csUnspecifiedKeyword explicit implicit @@ -44,10 +44,16 @@ syn match csContextualStatement /\<partial[[:space:]\n]\+\(class\|struct\|interf syn match csContextualStatement /\<\(get\|set\)\(;\|[[:space:]\n]*{\)/me=s+3 syn match csContextualStatement /\<where\>[^:]\+:/me=s+5 +" Operators +syn keyword csTypeOf typeof contained +syn region csTypeOfStatement start="typeof(" end=")" contains=csType, csTypeOf + " Punctuation syn match csBraces "[{}\[\]]" display syn match csParens "[()]" display -syn match csOpSymbols "[+\-><=]\{1,2}" display +syn match csOpSymbols "[+\-=]\{1,2}" display +syn match csOpSymbols "[><]\{2}" display +syn match csOpSymbols "\s\zs[><]\ze\_s" display syn match csOpSymbols "[!><+\-*/]=" display syn match csOpSymbols "[!*/^]" display syn match csOpSymbols "=>" display @@ -144,17 +150,18 @@ syn cluster csAll contains=csCharacter,csClassType,csComment,csContextualStateme " The default highlighting. hi def link csType Type -hi def link csNewType Type hi def link csClassType Type hi def link csIsType Type -hi def link csStorage StorageClass -hi def link csClass StorageClass +hi def link csStorage Structure +hi def link csClass Structure hi def link csRepeat Repeat hi def link csConditional Conditional hi def link csLabel Label hi def link csModifier StorageClass hi def link csConstant Constant hi def link csException Exception +hi def link csTypeOf Operator +hi def link csTypeOfStatement Typedef hi def link csUnspecifiedStatement Statement hi def link csUnsupportedStatement Statement hi def link csUnspecifiedKeyword Keyword @@ -164,16 +171,12 @@ hi def link csIsAs Keyword hi def link csAsync Keyword hi def link csContextualStatement Statement hi def link csOperatorError Error -hi def link csInterfaceDeclaration Include hi def link csTodo Todo hi def link csComment Comment -hi def link csEndColon Statement hi def link csOpSymbols Operator -hi def link csLogicSymbols Boolean -hi def link csBraces Function -hi def link csParens Operator +hi def link csLogicSymbols Operator hi def link csSpecialError Error hi def link csSpecialCharError Error @@ -200,9 +203,9 @@ hi def link csXmlCommentLeader Comment hi def link csXmlComment Comment hi def link csXmlTag Statement -let b:current_syntax = "cs" +let b:current_syntax = 'cs' -let &cpo = s:cs_cpo_save -unlet s:cs_cpo_save +let &cpoptions = s:save_cpo +unlet s:save_cpo " vim: vts=16,28 diff --git a/runtime/syntax/debchangelog.vim b/runtime/syntax/debchangelog.vim index edaaf6128f..4ca4c299b2 100644 --- a/runtime/syntax/debchangelog.vim +++ b/runtime/syntax/debchangelog.vim @@ -3,7 +3,7 @@ " Maintainer: Debian Vim Maintainers " Former Maintainers: Gerfried Fuchs <alfie@ist.org> " Wichert Akkerman <wakkerma@debian.org> -" Last Change: 2018 May 03 +" Last Change: 2019 Jan 26 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debchangelog.vim " Standard syntax initialization @@ -14,14 +14,14 @@ endif " Case doesn't matter for us syn case ignore -let s:urgency='urgency=\(low\|medium\|high\|critical\)\( [^[:space:],][^,]*\)\=' +let s:urgency='urgency=\(low\|medium\|high\|emergency\|critical\)\( [^[:space:],][^,]*\)\=' let s:binNMU='binary-only=yes' " Define some common expressions we can use later on syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ " exe 'syn match debchangelogFirstKV contained "; \('.s:urgency.'\|'.s:binNMU.'\)"' exe 'syn match debchangelogOtherKV contained ", \('.s:urgency.'\|'.s:binNMU.'\)"' -syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|%(wheezy|jessie)%(-backports%(-sloppy)=|-security)=|stretch%(-backports|-security)=|%(devel|precise|trusty|vivid|wily|xenial|yakkety|zesty|artful|bionic|cosmic)%(-%(security|proposed|updates|backports|commercial|partner))=)+" +syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|%(wheezy|jessie)%(-backports%(-sloppy)=|-security)=|stretch%(-backports|-security)=|%(devel|precise|trusty|vivid|wily|xenial|yakkety|zesty|artful|bionic|cosmic|disco)%(-%(security|proposed|updates|backports|commercial|partner))=)+" syn match debchangelogVersion contained "(.\{-})" syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*" syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*" diff --git a/runtime/syntax/debsources.vim b/runtime/syntax/debsources.vim index 74e8d42d1c..4b2194125d 100644 --- a/runtime/syntax/debsources.vim +++ b/runtime/syntax/debsources.vim @@ -2,7 +2,7 @@ " Language: Debian sources.list " Maintainer: Debian Vim Maintainers " Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl> -" Last Change: 2018 Aug 11 +" Last Change: 2018 Oct 30 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/syntax/debsources.vim " Standard syntax initialization @@ -25,7 +25,7 @@ let s:supported = [ \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', \ 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy', \ - \ 'trusty', 'xenial', 'bionic', 'cosmic', 'devel' + \ 'trusty', 'xenial', 'bionic', 'cosmic', 'disco', 'devel' \ ] let s:unsupported = [ \ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato', diff --git a/runtime/syntax/dune.vim b/runtime/syntax/dune.vim new file mode 100644 index 0000000000..f901813d24 --- /dev/null +++ b/runtime/syntax/dune.vim @@ -0,0 +1,46 @@ +" Language: Dune buildsystem +" Maintainer: Markus Mottl <markus.mottl@gmail.com> +" Anton Kochkov <anton.kochkov@gmail.com> +" URL: https://github.com/rgrinberg/vim-ocaml +" Last Change: +" 2019 Feb 27 - Add newer keywords to the syntax (Simon Cruanes) +" 2018 May 8 - Check current_syntax (Kawahara Satoru) +" 2018 Mar 29 - Extend jbuild syntax with more keywords (Petter A. Urkedal) +" 2017 Sep 6 - Initial version (Etienne Millon) + +if exists("b:current_syntax") + finish +endif + +set syntax=lisp +syn case match + +" The syn-iskeyword setting lacks #,? from the iskeyword setting here. +" Clearing it avoids maintaining keyword characters in multiple places. +syn iskeyword clear + +syn keyword lispDecl jbuild_version library executable executables rule ocamllex ocamlyacc menhir alias install + +syn keyword lispKey name public_name synopsis modules libraries wrapped +syn keyword lispKey preprocess preprocessor_deps optional c_names cxx_names +syn keyword lispKey install_c_headers modes no_dynlink self_build_stubs_archive +syn keyword lispKey ppx_runtime_libraries virtual_deps js_of_ocaml link_flags +syn keyword lispKey javascript_files flags ocamlc_flags ocamlopt_flags pps staged_pps +syn keyword lispKey library_flags c_flags c_library_flags kind package action +syn keyword lispKey deps targets locks fallback +syn keyword lispKey inline_tests tests names + +syn keyword lispAtom true false + +syn keyword lispFunc cat chdir copy# diff? echo run setenv +syn keyword lispFunc ignore-stdout ignore-stderr ignore-outputs +syn keyword lispFunc with-stdout-to with-stderr-to with-outputs-to +syn keyword lispFunc write-file system bash + +syn cluster lispBaseListCluster add=duneVar +syn match duneVar '\${[@<^]}' containedin=lispSymbol +syn match duneVar '\${\k\+\(:\k\+\)\?}' containedin=lispSymbol + +hi def link duneVar Identifier + +let b:current_syntax = "dune" diff --git a/runtime/syntax/eruby.vim b/runtime/syntax/eruby.vim index 4e175bcc25..6bb24fe562 100644 --- a/runtime/syntax/eruby.vim +++ b/runtime/syntax/eruby.vim @@ -3,8 +3,9 @@ " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2018 Jul 04 -if exists("b:current_syntax") +if &syntax !~# '\<eruby\>' || get(b:, 'current_syntax') =~# '\<eruby\>' finish endif @@ -18,11 +19,13 @@ endif if &filetype =~ '^eruby\.' let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+') +elseif &filetype =~ '^.*\.eruby\>' + let b:eruby_subtype = matchstr(&filetype,'^.\{-\}\ze\.eruby\>') elseif !exists("b:eruby_subtype") && main_syntax == 'eruby' let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$") let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+') if b:eruby_subtype == '' - let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$') + let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\|\.example\)\+$','',''),'\.\zs\w\+\%(\ze+\w\+\)\=$') endif if b:eruby_subtype == 'rhtml' let b:eruby_subtype = 'html' @@ -41,16 +44,20 @@ elseif !exists("b:eruby_subtype") && main_syntax == 'eruby' endif if !exists("b:eruby_nest_level") - let b:eruby_nest_level = strlen(substitute(substitute(substitute(expand("%:t"),'@','','g'),'\c\.\%(erb\|rhtml\)\>','@','g'),'[^@]','','g')) + if &syntax =~# '\<eruby\.eruby\>' + let b:eruby_nest_level = strlen(substitute(substitute(&filetype,'\C\<eruby\>','@','g'),'[^@]','','g')) + else + let b:eruby_nest_level = strlen(substitute(substitute(substitute(expand("%:t"),'@','','g'),'\c\.\%(erb\|rhtml\)\>','@','g'),'[^@]','','g')) + endif endif if !b:eruby_nest_level let b:eruby_nest_level = 1 endif -if exists("b:eruby_subtype") && b:eruby_subtype != '' +if get(b:, 'eruby_subtype', '') !~# '^\%(eruby\)\=$' && &syntax =~# '^eruby\>' exe "runtime! syntax/".b:eruby_subtype.".vim" - unlet! b:current_syntax endif +unlet! b:current_syntax syn include @rubyTop syntax/ruby.vim syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,erubyComment @@ -65,7 +72,7 @@ exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:erub hi def link erubyDelimiter PreProc hi def link erubyComment Comment -let b:current_syntax = 'eruby' +let b:current_syntax = matchstr(&syntax, '^.*\<eruby\>') if main_syntax == 'eruby' unlet main_syntax diff --git a/runtime/syntax/ocaml.vim b/runtime/syntax/ocaml.vim index 68c1feddae..06d8f416b5 100644 --- a/runtime/syntax/ocaml.vim +++ b/runtime/syntax/ocaml.vim @@ -4,7 +4,7 @@ " Maintainers: Markus Mottl <markus.mottl@gmail.com> " Karl-Heinz Sylla <Karl-Heinz.Sylla@gmd.de> " Issac Trotts <ijtrotts@ucdavis.edu> -" URL: http://www.ocaml.info/vim/syntax/ocaml.vim +" URL: https://github.com/rgrinberg/vim-ocaml " Last Change: 2012 May 12 - Added Dominique Pellé's spell checking patch (MM) " 2012 Feb 01 - Improved module path highlighting (MM) " 2010 Oct 11 - Added highlighting of lnot (MM, thanks to Erick Matsen) diff --git a/runtime/syntax/raml.vim b/runtime/syntax/raml.vim new file mode 100644 index 0000000000..062a71c81b --- /dev/null +++ b/runtime/syntax/raml.vim @@ -0,0 +1,106 @@ +" Vim syntax file +" Language: RAML (RESTful API Modeling Language) +" Maintainer: Eric Hopkins <eric.on.tech@gmail.com> +" URL: https://github.com/in3d/vim-raml +" License: Same as Vim +" Last Change: 2018-11-03 + +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +syn keyword ramlTodo contained TODO FIXME XXX NOTE + +syn region ramlComment display oneline start='\%(^\|\s\)#' end='$' + \ contains=ramlTodo,@Spell + +syn region ramlVersion display oneline start='#%RAML' end='$' + +syn match ramlNodeProperty '!\%(![^\\^% ]\+\|[^!][^:/ ]*\)' + +syn match ramlAnchor '&.\+' + +syn match ramlAlias '\*.\+' + +syn match ramlDelimiter '[-,:]' +syn match ramlBlock '[\[\]{}>|]' +syn match ramlOperator '[?+-]' +syn match ramlKey '\h\+\(?\)\?\ze\s*:' +syn match ramlKey '\w\+\(\s\+\w\+\)*\(?\)\?\ze\s*:' +syn match routeKey '\/\w\+\(\s\+\w\+\)*\ze\s*:' +syn match routeKey 'application\/\w\+\ze\s*:' +syn match routeParamKey '\/{\w\+}*\ze\s*:' + +syn region ramlString matchgroup=ramlStringDelimiter + \ start=+\s"+ skip=+\\"+ end=+"+ + \ contains=ramlEscape +syn region ramlString matchgroup=ramlStringDelimiter + \ start=+\s'+ skip=+''+ end=+'+ + \ contains=ramlStringEscape +syn region ramlParameter matchgroup=ramlParameterDelimiter + \ start=+<<+ skip=+''+ end=+>>+ +syn match ramlEscape contained display +\\[\\"abefnrtv^0_ NLP]+ +syn match ramlEscape contained display '\\x\x\{2}' +syn match ramlEscape contained display '\\u\x\{4}' +syn match ramlEscape contained display '\\U\x\{8}' +syn match ramlEscape display '\\\%(\r\n\|[\r\n]\)' +syn match ramlStringEscape contained +''+ + +syn match ramlNumber display + \ '\<[+-]\=\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=' +syn match ramlNumber display '0\o\+' +syn match ramlNumber display '0x\x\+' +syn match ramlNumber display '([+-]\=[iI]nf)' +syn match ramlNumber display '(NaN)' + +syn match ramlConstant '\<[~yn]\>' +syn keyword ramlConstant true True TRUE false False FALSE +syn keyword ramlConstant yes Yes on ON no No off OFF +syn keyword ramlConstant null Null NULL nil Nil NIL + +syn keyword httpVerbs get post put delete head patch options +syn keyword ramlTypes string number integer date boolean file + +syn match ramlTimestamp '\d\d\d\d-\%(1[0-2]\|\d\)-\%(3[0-2]\|2\d\|1\d\|\d\)\%( \%([01]\d\|2[0-3]\):[0-5]\d:[0-5]\d.\d\d [+-]\%([01]\d\|2[0-3]\):[0-5]\d\|t\%([01]\d\|2[0-3]\):[0-5]\d:[0-5]\d.\d\d[+-]\%([01]\d\|2[0-3]\):[0-5]\d\|T\%([01]\d\|2[0-3]\):[0-5]\d:[0-5]\d.\dZ\)\=' + +syn region ramlDocumentHeader start='---' end='$' contains=ramlDirective +syn match ramlDocumentEnd '\.\.\.' + +syn match ramlDirective contained '%[^:]\+:.\+' + +hi def link ramlVersion String +hi def link routeInterpolation String +hi def link ramlInterpolation Constant +hi def link ramlTodo Todo +hi def link ramlComment Comment +hi def link ramlDocumentHeader PreProc +hi def link ramlDocumentEnd PreProc +hi def link ramlDirective Keyword +hi def link ramlNodeProperty Type +hi def link ramlAnchor Type +hi def link ramlAlias Type +hi def link ramlBlock Operator +hi def link ramlOperator Operator +hi def link routeParamKey SpecialChar +hi def link ramlKey Identifier +hi def link routeKey SpecialChar +hi def link ramlParameterDelimiter Type +hi def link ramlParameter Type +hi def link ramlString String +hi def link ramlStringDelimiter ramlString +hi def link ramlEscape SpecialChar +hi def link ramlStringEscape SpecialChar +hi def link ramlNumber Number +hi def link ramlConstant Constant +hi def link ramlTimestamp Number +hi def link httpVerbs Statement +hi def link ramlTypes Type +hi def link ramlDelimiter Delimiter + +let b:current_syntax = "raml" + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/syntax/rst.vim b/runtime/syntax/rst.vim index d620d91f4a..c865cf6905 100644 --- a/runtime/syntax/rst.vim +++ b/runtime/syntax/rst.vim @@ -3,7 +3,7 @@ " Maintainer: Marshall Ward <marshall.ward@gmail.com> " Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Website: https://github.com/marshallward/vim-restructuredtext -" Latest Revision: 2018-07-23 +" Latest Revision: 2018-12-29 if exists("b:current_syntax") finish @@ -59,6 +59,7 @@ syn keyword rstTodo contained FIXME TODO XXX NOTE execute 'syn region rstComment contained' . \ ' start=/.*/' + \ ' skip=+^$+' . \ ' end=/^\s\@!/ contains=rstTodo' execute 'syn region rstFootnote contained matchgroup=rstDirective' . diff --git a/runtime/syntax/ruby.vim b/runtime/syntax/ruby.vim index ca7f51b1ea..8b88378e60 100644 --- a/runtime/syntax/ruby.vim +++ b/runtime/syntax/ruby.vim @@ -3,6 +3,7 @@ " Maintainer: Doug Kearns <dougkearns@gmail.com> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2018 Jul 09 " ---------------------------------------------------------------------------- " " Previous Maintainer: Mirko Nasato @@ -45,7 +46,7 @@ function! s:foldable(...) abort return 0 endfunction " }}} -syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo +syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo,rubyModuleName,rubyClassName,rubySymbolDelimiter " Whitespace Errors {{{1 if exists("ruby_space_errors") @@ -122,21 +123,24 @@ syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<\%(0\|[1-9]\d*\%(_\d\+\)* syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent syn match rubyBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent +syn match rubyClassName "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" contained +syn match rubyModuleName "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" contained syn match rubyConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)\@!" syn match rubyClassVariable "@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display syn match rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display syn match rubyGlobalVariable "$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)" -syn match rubySymbol "[]})\"':]\@1<!:\%(\^\|\~@\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!@\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" -syn match rubySymbol "[]})\"':]\@1<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)" -syn match rubySymbol "[]})\"':]\@1<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" -syn match rubySymbol "[]})\"':]\@1<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\=" +syn match rubySymbolDelimiter ":" contained +syn match rubySymbol "[]})\"':]\@1<!:\%(\^\|\~@\|\~\|<<\|<=>\|<=\|<\|===\|[=!]=\|[=!]\~\|!@\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" contains=rubySymbolDelimiter +syn match rubySymbol "[]})\"':]\@1<!:\$\%(-.\|[`~<=>_,;:!?/.'"@$*\&+0]\)" contains=rubySymbolDelimiter +syn match rubySymbol "[]})\"':]\@1<!:\%(\$\|@@\=\)\=\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contains=rubySymbolDelimiter +syn match rubySymbol "[]})\"':]\@1<!:\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\%([?!=]>\@!\)\=" contains=rubySymbolDelimiter if s:foldable(':') - syn region rubySymbol start="[]})\"':]\@1<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold - syn region rubySymbol start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold + syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold + syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold else - syn region rubySymbol start="[]})\"':]\@1<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape - syn region rubySymbol start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial + syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="[]})\"':]\@1<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial endif syn match rubyCapitalizedMethod "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\u\%(\w\|[^\x00-\x7F]\)*\>\%(\s*(\)*\s*(\@=" @@ -157,10 +161,10 @@ syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@<!\<\%(RUBY_\%(VERSION " Normal Regular Expression {{{1 if s:foldable('/') syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/\%([ \t=]\|$\)\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold else syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial - syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/\%([ \t=]\|$\)\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial endif " Generalized Regular Expression {{{1 @@ -275,10 +279,10 @@ else endif " Here Document {{{1 -syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<[-~]\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop -syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<[-~]\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop -syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<[-~]\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop -syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<[-~]\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs"\%([^"]*\)"+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs'\%([^']*\)'+ end=+$+ oneline contains=ALLBUT,@rubyNotTop +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<[-~]\=\zs`\%([^`]*\)`+ end=+$+ oneline contains=ALLBUT,@rubyNotTop if s:foldable('<<') syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@<!<<\z(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\)\ze\%(.*<<[-~]\=['`"]\=\h\)\@!+hs=s+2 matchgroup=rubyStringDelimiter end=+^\z1$+ contains=rubyHeredocStart,rubyHeredoc,@rubyStringSpecial fold keepend @@ -305,19 +309,19 @@ endif " eRuby Config {{{1 if exists('main_syntax') && main_syntax == 'eruby' let b:ruby_no_expensive = 1 -end +endif " Module, Class, Method and Alias Declarations {{{1 syn match rubyAliasDeclaration "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable nextgroup=rubyAliasDeclaration2 skipwhite syn match rubyAliasDeclaration2 "[^[:space:];#.()]\+" contained contains=rubySymbol,rubyGlobalVariable,rubyPredefinedVariable syn match rubyMethodDeclaration "[^[:space:];#(]\+" contained contains=rubyConstant,rubyBoolean,rubyPseudoVariable,rubyInstanceVariable,rubyClassVariable,rubyGlobalVariable -syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator -syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyConstant,rubyOperator -syn match rubyFunction "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=rubyMethodDeclaration -syn match rubyFunction "\%(\s\|^\)\@1<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2 -syn match rubyFunction "\%([[:space:].]\|^\)\@2<=\%(\[\]=\=\|\*\*\|[-+!~]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration +syn match rubyClassDeclaration "[^[:space:];#<]\+" contained contains=rubyClassName,rubyOperator +syn match rubyModuleDeclaration "[^[:space:];#<]\+" contained contains=rubyModuleName,rubyOperator +syn match rubyMethodName "\<[_[:alpha:]][_[:alnum:]]*[?!=]\=[[:alnum:]_.:?!=]\@!" contained containedin=rubyMethodDeclaration +syn match rubyMethodName "\%(\s\|^\)\@1<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2 +syn match rubyMethodName "\%([[:space:].]\|^\)\@2<=\%(\[\]=\=\|\*\*\|[-+!~]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration -syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter +syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyMethodName,rubyBlockParameter " Keywords {{{1 " Note: the following keywords have already been defined: @@ -335,7 +339,7 @@ syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>[?!]\@!" if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") syn match rubyDefine "\<alias\>" nextgroup=rubyAliasDeclaration skipwhite skipnl syn match rubyDefine "\<def\>" nextgroup=rubyMethodDeclaration skipwhite skipnl - syn match rubyDefine "\<undef\>" nextgroup=rubyFunction skipwhite skipnl + syn match rubyDefine "\<undef\>" nextgroup=rubyMethodName skipwhite skipnl syn match rubyClass "\<class\>" nextgroup=rubyClassDeclaration skipwhite skipnl syn match rubyModule "\<module\>" nextgroup=rubyModuleDeclaration skipwhite skipnl @@ -377,8 +381,6 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") if s:foldable('[') syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@rubyNotTop fold - else - syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@<!\[" end="]" contains=ALLBUT,@rubyNotTop endif " statements without 'do' @@ -437,10 +439,12 @@ if !exists("ruby_no_special_methods") syn match rubyControl "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>[?!]\@!\)" syn keyword rubyEval eval class_eval instance_eval module_eval syn keyword rubyException raise fail catch throw - " false positive with 'include?' - syn match rubyInclude "\<include\>[?!]\@!" - syn keyword rubyInclude autoload extend load prepend refine require require_relative using + syn keyword rubyInclude autoload gem load require require_relative syn keyword rubyKeyword callcc caller lambda proc + " false positive with 'include?' + syn match rubyMacro "\<include\>[?!]\@!" + syn keyword rubyMacro extend prepend refine using + syn keyword rubyMacro alias_method define_method define_singleton_method remove_method undef_method endif " Comments and Documentation {{{1 @@ -461,7 +465,7 @@ syn match rubyKeywordAsMethod "\(defined?\|exit!\)\@!\<[_[:lower:]][_[:alnum:]]* " More Symbols {{{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*\)\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 @@ -477,6 +481,10 @@ hi def link rubyClass rubyDefine hi def link rubyModule rubyDefine hi def link rubyMethodExceptional rubyDefine hi def link rubyDefine Define +hi def link rubyAccess rubyMacro +hi def link rubyAttribute rubyMacro +hi def link rubyMacro Macro +hi def link rubyMethodName rubyFunction hi def link rubyFunction Function hi def link rubyConditional Conditional hi def link rubyConditionalModifier rubyConditional @@ -498,8 +506,9 @@ else endif hi def link rubyClassVariable rubyIdentifier hi def link rubyConstant Type +hi def link rubyClassName rubyConstant +hi def link rubyModuleName rubyConstant hi def link rubyGlobalVariable rubyIdentifier -hi def link rubyBlockParameter rubyIdentifier hi def link rubyInstanceVariable rubyIdentifier hi def link rubyPredefinedIdentifier rubyIdentifier hi def link rubyPredefinedConstant rubyPredefinedIdentifier @@ -508,8 +517,6 @@ hi def link rubySymbol Constant hi def link rubyKeyword Keyword hi def link rubyOperator Operator hi def link rubyBeginEnd Statement -hi def link rubyAccess Statement -hi def link rubyAttribute Statement hi def link rubyEval Statement hi def link rubyPseudoVariable Constant hi def link rubyCapitalizedMethod rubyLocalVariableOrMethod diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 5e0d1fd76a..9eed594b8c 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,8 +2,8 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz> " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int> -" Last Change: Sep 04, 2018 -" Version: 182 +" Last Change: Nov 23, 2018 +" Version: 185 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) @@ -144,12 +144,12 @@ endif syn cluster shHereBeginList contains=@shCommandSubList syn cluster shHereList contains=shBeginHere,shHerePayload syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload -syn cluster shIdList contains=shCommandSub,shCommandSubBQ,shWrapLineOperator,shSetOption,shComment,shDeref,shDerefSimple,shHereString,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr +syn cluster shIdList contains=shCommandSub,shCommandSubBQ,shWrapLineOperator,shSetOption,shComment,shDeref,shDerefSimple,shHereString,shNumber,shOperator,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr syn cluster shIfList contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo syn cluster shLoopList contains=@shCaseList,@shErrorList,shCaseEsac,shConditional,shDblBrace,shExpr,shFor,shForPP,shIf,shOption,shSet,shTest,shTestOpr,shTouch syn cluster shPPSRightList contains=shComment,shDeref,shDerefSimple,shEscape,shPosnParm syn cluster shSubShList contains=@shCommandSubList,shCommandSubBQ,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator -syn cluster shTestList contains=shCharClass,shCommandSub,shCommandSubBQ,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shSpecialDQ,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr +syn cluster shTestList contains=shArithmetic,shCharClass,shCommandSub,shCommandSubBQ,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shSpecialDQ,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr syn cluster shNoZSList contains=shSpecialNoZS syn cluster shForList contains=shTestOpr,shNumber,shDerefSimple,shDeref,shCommandSub,shCommandSubBQ,shArithmetic @@ -292,7 +292,9 @@ endif "====== syn match shWrapLineOperator "\\$" syn region shCommandSubBQ start="`" skip="\\\\\|\\." end="`" contains=shBQComment,@shCommandSubList -syn match shEscape contained '\%(^\)\@!\%(\\\\\)*\\.' nextgroup=shSingleQuote,shDoubleQuote,shComment +"see ksh13 +"syn match shEscape contained '\%(^\)\@!\%(\\\\\)*\\.' nextgroup=shSingleQuote,shDoubleQuote,shComment +syn match shEscape contained '\%(^\)\@!\%(\\\\\)*\\.' nextgroup=shComment " $() and $(()): {{{1 " $(..) is not supported by sh (Bourne shell). However, apparently @@ -379,22 +381,22 @@ syn match shBQComment contained "#.\{-}\ze`" contains=@shCommentGroup " Here Documents: {{{1 " ========================================= -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\\\=\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<\s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc02 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<-\s*\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc03 end="^\s*\z1\s*$" contains=@shDblQuoteList +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\\\=\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc02 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\s*\z1\s*$" contains=@shDblQuoteList ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc04 end="^\s*\z1\s*$" ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+\)'" matchgroup=shHereDoc05 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc06 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^ \t0-9|>]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^ \t0-9|>]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^ \t|>]\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\z([^ \t0-9|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc06 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^ \t|>]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$" " Here Strings: {{{1 " ============= @@ -407,18 +409,19 @@ endif "============= syn match shSetOption "\s\zs[-+][a-zA-Z0-9]\+\>" contained syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shVarAssign -syn match shVarAssign "=" contained nextgroup=shCmdParenRegion,shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote +syn match shVarAssign "=" contained nextgroup=shCmdParenRegion,shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote,shVar +syn match shVar contained "\h\w*" syn region shAtExpr contained start="@(" end=")" contains=@shIdList if exists("b:is_bash") - syn match shSet "^\s*set\ze\s*$" - syn region shSetList oneline matchgroup=shSet start="\<\(declare\|typeset\|local\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+#\|=" contains=@shIdList - syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+=" contains=@shIdList nextgroup=shComment + syn match shSet "^\s*set\ze\s\+$" + syn region shSetList oneline matchgroup=shSet start="\<\%(declare\|local\|export\)\>\ze[/a-zA-Z_]\@!" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+#\|=" contains=@shIdList + syn region shSetList oneline matchgroup=shSet start="\<\%(set\|unset\)\>[/a-zA-Z_]\@!" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+=" contains=@shIdList nextgroup=shComment elseif exists("b:is_kornshell") || exists("b:is_posix") - syn match shSet "^\s*set\ze\s*$" - syn region shSetList oneline matchgroup=shSet start="\<\(typeset\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList - syn region shSetList oneline matchgroup=shSet start="\<set\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList + syn match shSet "^\s*set\ze\s\+$" + syn region shSetList oneline matchgroup=shSet start="\<\(export\)\>\ze[/]\@!" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList + syn region shSetList oneline matchgroup=shSet start="\<\%(set\|unset\>\)\ze[/a-zA-Z_]\@!" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList nextgroup=shComment else - syn region shSetList oneline matchgroup=shSet start="\<\(set\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList + syn region shSetList oneline matchgroup=shSet start="\<\(set\|export\|unset\)\>\ze[/a-zA-Z_]\@!" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList endif " Functions: {{{1 @@ -523,12 +526,12 @@ if exists("b:is_bash") " bash : ${parameter//pattern/string} " bash : ${parameter//pattern} syn match shDerefPPS contained '/\{1,2}' nextgroup=shDerefPPSleft - syn region shDerefPPSleft contained start='.' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPPSright contains=@shCommandSubList - syn region shDerefPPSright contained start='.' skip=@\%(\\\\\)\+@ end='\ze}' contains=@shPPSRightList + syn region shDerefPPSleft contained start='.' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPPSright contains=@shCommandSubList + syn region shDerefPPSright contained start='.' skip=@\%(\\\\\)\+@ end='\ze}' contains=@shPPSRightList " bash : ${parameter/#substring/replacement} syn match shDerefPSR contained '/#' nextgroup=shDerefPSRleft,shDoubleQuote,shSingleQuote - syn region shDerefPSRleft contained start='[^"']' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPSRright + syn region shDerefPSRleft contained start='[^"']' skip=@\%(\\\\\)*\\/@ matchgroup=shDerefOp end='/' end='\ze}' nextgroup=shDerefPSRright syn region shDerefPSRright contained start='.' skip=@\%(\\\\\)\+@ end='\ze}' endif @@ -546,8 +549,9 @@ endif " Additional ksh Keywords and Aliases: {{{1 " =================================== -if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix") - syn keyword shStatement bg builtin disown enum export false fg getconf getopts hist jobs let printf sleep true typeset unalias unset whence +if exists("b:is_kornshell") || exists("b:is_posix") + syn keyword shStatement bg builtin disown enum export false fg getconf getopts hist jobs let printf sleep true unalias whence + syn keyword shStatement typeset skipwhite nextgroup=shSetOption syn keyword shStatement autoload compound fc float functions hash history integer nameref nohup r redirect source stop suspend times type if exists("b:is_posix") syn keyword shStatement command @@ -557,12 +561,13 @@ if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix") " Additional bash Keywords: {{{1 " ===================== - if exists("b:is_bash") -" syn keyword shStatement bind builtin dirs disown enable help logout popd pushd shopt source -syn keyword shStatement bind builtin caller compopt declare dirs disown enable export help local logout mapfile popd pushd readarray shopt source typeset unset - else - syn keyword shStatement login newgrp - endif +elseif exists("b:is_bash") + syn keyword shStatement bg builtin disown export false fg getopts jobs let printf sleep true unalias + syn keyword shStatement typeset nextgroup=shSetOption + syn keyword shStatement fc hash history source suspend times type + syn keyword shStatement bind builtin caller compopt declare dirs disown enable export help logout mapfile popd pushd readarray shopt source typeset +else + syn keyword shStatement login newgrp endif " Synchronization: {{{1 diff --git a/runtime/syntax/tasm.vim b/runtime/syntax/tasm.vim index c9fc8186d0..1d6e570752 100644 --- a/runtime/syntax/tasm.vim +++ b/runtime/syntax/tasm.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: TASM: turbo assembler by Borland " Maintaner: FooLman of United Force <foolman@bigfoot.com> -" Last Change: 2012 Feb 03 by Thilo Six +" Last Change: 2012 Feb 03 by Thilo Six, and 2018 Nov 27. " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -109,7 +109,7 @@ hi def link tasmComment Comment hi def link tasmLabel Label -let b:curret_syntax = "tasm" +let b:current_syntax = "tasm" let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim index 18c3a04877..3969cd4777 100644 --- a/runtime/syntax/tex.vim +++ b/runtime/syntax/tex.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: TeX " Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM> -" Last Change: Sep 09, 2018 -" Version: 110 +" Last Change: Nov 02, 2018 +" Version: 111 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX " " Notes: {{{1 @@ -159,9 +159,9 @@ syn cluster texFoldGroup contains=texAccent,texBadMath,texComment,texDefCmd,tex syn cluster texBoldGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texInputFile,texLength,texLigature,texMatcher,texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ,texNewCmd,texNewEnv,texOnlyMath,texOption,texParen,texRefZone,texSection,texBeginEnd,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract,texBoldStyle,texBoldItalStyle,texNoSpell syn cluster texItalGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texInputFile,texLength,texLigature,texMatcher,texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ,texNewCmd,texNewEnv,texOnlyMath,texOption,texParen,texRefZone,texSection,texBeginEnd,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract,texItalStyle,texItalBoldStyle,texNoSpell if !s:tex_nospell - syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,@Spell - syn cluster texMatchNMGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,@Spell - syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texStyleStatement,@Spell,texStyleMatcher + syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell + syn cluster texMatchNMGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,@Spell + syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texBoldStyle,texBoldItalStyle,texItalStyle,texItalBoldStyle,texZone,texInputFile,texOption,texStyleStatement,texStyleMatcher,@Spell else syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption syn cluster texMatchNMGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption diff --git a/runtime/syntax/tpp.vim b/runtime/syntax/tpp.vim index 1244b97f08..ca64b5dce1 100644 --- a/runtime/syntax/tpp.vim +++ b/runtime/syntax/tpp.vim @@ -1,11 +1,11 @@ " Vim syntax file -" Language: tpp - Text Presentation Program -" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> -" Former Maintainer: Gerfried Fuchs <alfie@ist.org> -" Last Change: 2007-10-14 -" URL: http://git.debian.org/?p=pkg-vim/vim.git;a=blob_plain;f=runtime/syntax/tpp.vim;hb=debian -" Filenames: *.tpp -" License: BSD +" Language: tpp - Text Presentation Program +" Maintainer: Debian Vim Maintainers +" Former Maintainer: Gerfried Fuchs <alfie@ist.org> +" Last Change: 2018 Dec 27 +" URL: https://salsa.debian.org/vim-team/vim-debian/master/syntax/tpp.vim +" Filenames: *.tpp +" License: BSD " " XXX This file is in need of a new maintainer, Debian VIM Maintainers maintain " it only because patches have been submitted for it by Debian users and the @@ -18,11 +18,11 @@ " SPAM is _NOT_ welcome - be ready to be reported! " quit when a syntax file was already loaded -if exists("b:current_syntax") +if exists('b:current_syntax') finish endif -if !exists("main_syntax") +if !exists('main_syntax') let main_syntax = 'tpp' endif @@ -46,7 +46,7 @@ syn region tppNewPageOption start="^--newpage" end="$" contains=tppNewPageOption syn region tppPageLocalOption start="^--\%(heading\|center\|right\|huge\|sethugefont\|exec\)" end="$" contains=tppPageLocalOptionKey oneline syn region tppAbstractOption start="^--\%(author\|title\|date\|footer\)" end="$" contains=tppAbstractOptionKey oneline -if main_syntax != 'sh' +if main_syntax !=# 'sh' " shell command syn include @tppShExec syntax/sh.vim unlet b:current_syntax @@ -78,6 +78,6 @@ hi def link tppNewPageOption Error hi def link tppTimeOption Error -let b:current_syntax = "tpp" +let b:current_syntax = 'tpp' " vim: ts=8 sw=2 diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 444b6d8d17..31e81c76f8 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -273,7 +273,7 @@ syn match vimEnvvar "\${\I\i*}" syn region vimEscapeBrace oneline contained transparent start="[^\\]\(\\\\\)*\[\zs\^\=\]\=" skip="\\\\\|\\\]" end="]"me=e-1 syn match vimPatSepErr contained "\\)" syn match vimPatSep contained "\\|" -syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\=\ze(" skip="\\\\" end="\\)\|[^\]['"]" contains=@vimStringGroup +syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\=\ze(" skip="\\\\" end="\\)\|[^\\]['"]" contains=@vimStringGroup syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline syn match vimNotPatSep contained "\\\\" syn cluster vimStringGroup contains=vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell |