Skip to content

Commit

Permalink
better syntax for line continuations
Browse files Browse the repository at this point in the history
Part of #4
  • Loading branch information
dag committed May 25, 2013
1 parent 2ffdc9c commit e3e4057
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion syntax/fish.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit e3e4057

Please sign in to comment.