Skip to content
This repository has been archived by the owner on Jun 26, 2022. It is now read-only.

Commit

Permalink
More tweaks to the syntax file
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyball committed Aug 30, 2014
1 parent 5e29109 commit 2b67e3e
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions syntax/fish.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ syntax keyword fishKeyword contained
\ fish_default_key_bindings grep la ll ls man nextd-or-forward-word
\ N_ prevd-or-backward-word prompt_pwd seq setenv sgrep up-or-search
syntax keyword fishKeyword contained
\ alias begin bg bind block break breakpoint builtin
\ cd command commandline complete continue count dirh dirs echo emit
\ alias begin bg bind block break breakpoint builtin cd
\ commandline complete \contains continue count dirh dirs echo emit
\ end eval exec exit fg fish fish_config fish_indent fish_pager
\ fish_prompt fish_right_prompt fish_update_completions fishd funced
\ funcsave function functions help history isatty jobs math mimedb
\ nextd not open popd prevd psub pushd pwd random read return set
\ set_color status trap type ulimit umask vared
syntax keyword fishKeyword \contains contained
\ nextd not open popd prevd psub pushd pwd random read return
\ set_color source status trap type ulimit umask vared
syntax keyword fishKeyword command contained nextgroup=@fishCommand skipwhite
syn match fishKeyword "\.\ze\%(\s\|$\)" contained
syn cluster fishCommand add=fishKeyword
syntax keyword fishKeywordError do done then fi export local contained
syn cluster fishCommand add=fishKeywordError
Expand All @@ -30,7 +30,7 @@ syn cluster fishCommand add=fishConditional
syntax keyword fishRepeat while contained nextgroup=@fishCommand skipwhite
syntax keyword fishRepeat for contained nextgroup=fishRepeatForVar skipwhite
syn cluster fishCommand add=fishRepeat
syntax match fishRepeatForVar "\S\+" contained nextgroup=fishRepeatIn skipwhite
syntax region fishRepeatForVar start="\S" end="\ze\%(\s\|;\|$\)" contained contains=@fishValues,@fishEscapeSeqs nextgroup=fishRepeatIn skipwhite
syntax keyword fishRepeatIn in contained
syntax keyword fishLabel case contained
syn cluster fishCommand add=fishLabel
Expand All @@ -54,11 +54,12 @@ syntax match fishEscape ,\\[{}[\]()&;| *?~%#<>^"'\n], "these are not escaped in
syntax match fishNumEscape "\\\(\d\d\d\|[xX]\x\x\|u\x\x\x\x\(\x\x\x\x\)\?\|c\a\)"
syntax cluster fishEscapeSeqs contains=fishSpecial,fishEscape,fishNumEscape

syntax match fishSet "\<set\s\+" contained nextgroup=fishSetOpt,fishIdentifier skipwhite
syntax match fishSet "\<set\>\ze\%(\s\|;\|$\)" contained nextgroup=fishSetOpt,fishSetIdentifier skipwhite
syn cluster fishCommand add=fishSet
syntax match fishSetOpt contained "-[eglLnquUx]\+\s\+" nextgroup=fishSetOpt,fishIdentifier skipwhite
syntax match fishSetOpt contained "--\(local\|global\|universal\|names\|\(un\)\=export\|erase\|query\|long\)\s\+" nextgroup=fishSetOpt,fishIdentifier skipwhite
syntax match fishIdentifier contained "\w\+"
syntax region fishSetIdentifier start="\S" end="\ze\%(\s\|;\|$\)" contained contains=@fishValues,@fishEscapeSeqs
syntax match fishSetOpt contained "-[eglLnquUx]\+\ze\%(\s\|;\|$\)" nextgroup=fishSetOpt,fishSetIdentifier skipwhite
syntax match fishSetOpt contained "--\(local\|global\|universal\|names\|\(un\)\=export\|erase\|query\|long\)\ze\%(\s\|;\|$\)" nextgroup=fishSetOpt,fishSetIdentifier skipwhite
syntax match fishSetOpt contained "--\ze\%(\s\|;\|$\)" nextgroup=fishSetIdentifier skipwhite

syntax match fishVarDerefError "\$[-#@*$?!]" " special variables
syntax region fishVarDerefError start="\${" end="}" " safe dereferencing
Expand Down Expand Up @@ -87,6 +88,7 @@ syntax match fishOpError "==\|&&\|||\|!!\|\[\[\|]]" "syntax
highlight default link fishKeyword Keyword
highlight default link fishConditional Conditional
highlight default link fishRepeat Repeat
highlight default link fishRepeatForVar fishSetIdentifier
highlight default link fishRepeatIn Repeat
highlight default link fishLabel Label

Expand All @@ -98,9 +100,9 @@ highlight default link fishSpecial fishEscape
highlight default link fishNumEscape fishEscape
highlight default link fishCommentEscape fishEscape

highlight default link fishIdentifier Identifier
highlight default link fishSet Keyword
highlight default link fishSetOpt Operator
highlight default link fishSetIdentifier Identifier
highlight default link fishVarDeref Identifier
highlight default link fishString String
highlight default link fishSingleQuoteEscape fishEscape
Expand Down

0 comments on commit 2b67e3e

Please sign in to comment.