From e3e405705123188c945d0a27e15bc0c76e9d5663 Mon Sep 17 00:00:00 2001 From: Dag Odenhall Date: Sat, 25 May 2013 21:55:42 +0200 Subject: [PATCH] better syntax for line continuations Part of #4 --- syntax/fish.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/syntax/fish.vim b/syntax/fish.vim index 836d2ed..88fa723 100644 --- a/syntax/fish.vim +++ b/syntax/fish.vim @@ -8,20 +8,25 @@ syntax keyword fishRepeat while for syntax keyword fishLabel case syntax match fishComment /#.*/ +syntax match fishSpecial /\\$/ syntax match fishIdentifier /\$[[:alnum:]_]\+/ syntax region fishString start=/'/ skip=/\\'/ end=/'/ syntax region fishString start=/"/ skip=/\\"/ end=/"/ contains=fishIdentifier syntax match fishCharacter /\v\\[abefnrtv *?~%#(){}\[\]<>&;"']|\\[xX][0-9a-f]{1,2}|\\o[0-7]{1,2}|\\u[0-9a-f]{1,4}|\\U[0-9a-f]{1,8}|\\c[a-z]/ -syntax match fishStatement /\v%(^|\(|;)\s*\zs\k+/ +syntax match fishStatement /\v;\s*\zs\k+>/ +syntax match fishCommandSub /\v\(\s*\zs\k+>/ +syntax region fishLineContinuation matchgroup=fishStatement start=/\v^\s*\zs\k+>/ skip=/\\$/ end=/$/ contains=fishSpecial,fishIdentifier,fishString,fishCharacter,fishStatement,fishCommandSub highlight! link fishKeyword Keyword highlight! link fishConditional Conditional highlight! link fishRepeat Repeat highlight! link fishLabel Label highlight! link fishComment Comment +highlight! link fishSpecial Special highlight! link fishIdentifier Identifier highlight! link fishString String highlight! link fishCharacter Character highlight! link fishStatement Statement +highlight! link fishCommandSub fishStatement let b:current_syntax = 'fish'