diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-03-16 17:41:02 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-03-16 17:41:02 +0100 |
commit | 036986f1507d223549d110af300144468bd3a1f7 (patch) | |
tree | 4ceb878909e769f23d6deeae3bbb03d16e974f0d /runtime/syntax | |
parent | 8820b48654b62472821d9b155fe03ab7ac13a05c (diff) | |
download | vim-git-036986f1507d223549d110af300144468bd3a1f7.tar.gz |
Update runtime files.
Diffstat (limited to 'runtime/syntax')
-rw-r--r-- | runtime/syntax/erlang.vim | 30 | ||||
-rw-r--r-- | runtime/syntax/scala.vim | 4 | ||||
-rw-r--r-- | runtime/syntax/tmux.vim | 17 |
3 files changed, 29 insertions, 22 deletions
diff --git a/runtime/syntax/erlang.vim b/runtime/syntax/erlang.vim index 11b763409..870fcca10 100644 --- a/runtime/syntax/erlang.vim +++ b/runtime/syntax/erlang.vim @@ -1,9 +1,10 @@ " Vim syntax file " Language: Erlang (http://www.erlang.org) " Maintainer: Csaba Hoch <csaba.hoch@gmail.com> -" Last Update: 2013-Jul-25 +" Contributor: Adam Rutkowski <hq@mtod.org> +" Last Update: 2017-Mar-05 " License: Vim license -" URL: https://github.com/hcs42/vim-erlang +" URL: https://github.com/vim-erlang/vim-erlang-runtime " Acknowledgements: This script was originally created by Kresimir Marzic [1]. " The script was then revamped by Csaba Hoch [2]. During the revamp, the new @@ -46,7 +47,6 @@ syn match erlangComment '%.*$' contains=erlangCommentAnnotation,erlang syn match erlangCommentAnnotation ' \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|private\|equiv\|spec\|throws\)' contained syn match erlangCommentAnnotation /`[^']*'/ contained syn keyword erlangTodo TODO FIXME XXX contained -syn match erlangShebang '^#!.*' " Numbers (minimum base is 2, maximum is 36.) syn match erlangNumberInteger '\<\d\+\>' @@ -56,12 +56,12 @@ syn match erlangNumberFloat '\<\d\+\.\d\+\%([eE][+-]\=\d\+\)\=\>' " Strings, atoms, characters syn region erlangString start=/"/ end=/"/ contains=erlangStringModifier syn region erlangQuotedAtom start=/'/ end=/'/ contains=erlangQuotedAtomModifier -syn match erlangStringModifier '\~\a\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained -syn match erlangQuotedAtomModifier '\~\a\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained +syn match erlangStringModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\|\~\%([ni~]\|\%(-\=\d\+\|\*\)\=\.\=\%(\*\|\d\+\)\=\%(\..\)\=[tl]*[cfegswpWPBX#bx+]\)' contained +syn match erlangQuotedAtomModifier '\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained syn match erlangModifier '\$\%([^\\]\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\)' " Operators, separators -syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/' +syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|=>\|:=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/' syn keyword erlangOperator div rem or xor bor bxor bsl bsr and band not bnot andalso orelse syn match erlangBracket '{\|}\|\[\|]\||\|||' syn match erlangPipe '|' @@ -72,14 +72,19 @@ syn match erlangAtom '\<\l[[:alnum:]_@]*' contains=erlangBoolean syn keyword erlangBoolean true false contained syn match erlangLocalFuncCall '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangBIF syn match erlangLocalFuncRef '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@=' -syn match erlangGlobalFuncCall '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangComment -syn match erlangGlobalFuncRef '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@=' contains=erlangComment +syn match erlangGlobalFuncCall '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangComment,erlangVariable +syn match erlangGlobalFuncRef '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@=' contains=erlangComment,erlangVariable -" Variables, macros, records +" Variables, macros, records, maps syn match erlangVariable '\<[A-Z_][[:alnum:]_@]*' syn match erlangMacro '??\=[[:alnum:]_@]\+' syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+' +syn match erlangMap '#' syn match erlangRecord '#\s*\l[[:alnum:]_@]*' +syn region erlangQuotedRecord start=/#\s*'/ end=/'/ contains=erlangQuotedAtomModifier + +" Shebang (this line has to be after the ErlangMap) +syn match erlangShebang '^#!.*' " Bitstrings syn match erlangBitType '\%(\/\%(\s\|\n\|%.*\n\)*\)\@<=\%(integer\|float\|binary\|bytes\|bitstring\|bits\|binary\|utf8\|utf16\|utf32\|signed\|unsigned\|big\|little\|native\|unit\)\%(\%(\s\|\n\|%.*\n\)*-\%(\s\|\n\|%.*\n\)*\%(integer\|float\|binary\|bytes\|bitstring\|bits\|binary\|utf8\|utf16\|utf32\|signed\|unsigned\|big\|little\|native\|unit\)\)*' contains=erlangComment @@ -94,7 +99,7 @@ syn match erlangPreCondit '^\s*-\%(\s\|\n\|%.*\n\)*\%(ifdef\|ifndef\|else\|endif syn match erlangType '^\s*-\%(\s\|\n\|%.*\n\)*\%(spec\|type\|opaque\|callback\)\>' contains=erlangComment " Keywords -syn keyword erlangKeyword after begin case catch cond end fun if let of query +syn keyword erlangKeyword after begin case catch cond end fun if let of syn keyword erlangKeyword receive when try " Build-in-functions (BIFs) @@ -142,7 +147,6 @@ let b:erlang_syntax_synced = 1 let s:old_style = (exists("g:erlang_old_style_highlight") && \g:erlang_old_style_highlight == 1) -" Only when an item doesn't have highlighting yet " Comments hi def link erlangComment Comment @@ -188,6 +192,8 @@ hi def link erlangGlobalFuncRef Function hi def link erlangVariable Normal hi def link erlangMacro Normal hi def link erlangRecord Normal +hi def link erlangQuotedRecord Normal +hi def link erlangMap Normal else hi def link erlangAtom String hi def link erlangLocalFuncCall Normal @@ -197,6 +203,8 @@ hi def link erlangGlobalFuncRef Normal hi def link erlangVariable Identifier hi def link erlangMacro Macro hi def link erlangRecord Structure +hi def link erlangQuotedRecord Structure +hi def link erlangMap Structure endif " Bitstrings diff --git a/runtime/syntax/scala.vim b/runtime/syntax/scala.vim index 7779c4399..c5a175fd7 100644 --- a/runtime/syntax/scala.vim +++ b/runtime/syntax/scala.vim @@ -71,6 +71,8 @@ hi link scalaUnicodeChar Special syn match scalaOperator "||" syn match scalaOperator "&&" +syn match scalaOperator "|" +syn match scalaOperator "&" hi link scalaOperator Special syn match scalaNameDefinition /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaPostNameDefinition,scalaVariableDeclarationList @@ -142,7 +144,7 @@ hi link scalaString String hi link scalaStringEmbeddedQuote String syn region scalaIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar -syn region scalaTripleIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar +syn region scalaTripleIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\ze\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar hi link scalaIString String hi link scalaTripleIString String diff --git a/runtime/syntax/tmux.vim b/runtime/syntax/tmux.vim index 4e87de841..1ba5f6773 100644 --- a/runtime/syntax/tmux.vim +++ b/runtime/syntax/tmux.vim @@ -4,18 +4,16 @@ " Maintainer: Eric Pruitt <eric.pruitt@gmail.com> " License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause) -if version < 600 - syntax clear -elseif exists("b:current_syntax") +if exists("b:current_syntax") finish -else - let b:current_syntax = "tmux" endif -" this file uses line continuations -let s:cpo_sav = &cpo +" Explicitly change compatiblity options to Vim's defaults because this file +" uses line continuations. +let s:original_cpo = &cpo set cpo&vim +let b:current_syntax = "tmux" setlocal iskeyword+=- syntax case match @@ -62,7 +60,6 @@ for s:i in range(0, 255) exec "syn match tmuxColour" . s:i . " /\\<colour" . s:i . "\\>/ display" \ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg endfor -unlet s:bg s:i syn keyword tmuxOptions \ buffer-limit command-alias default-terminal escape-time exit-unattached @@ -123,5 +120,5 @@ syn keyword tmuxCommands \ swapp swap-window swapw switch-client switchc unbind-key unbind wait-for \ wait -let &cpo = s:cpo_sav -unlet! s:cpo_sav +let &cpo = s:original_cpo +unlet! s:original_cpo s:bg s:i |