1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
" Vim syntax file
" Language: Tupfile
"
" HOWTO use:
" 1) Add this to your ~/.vim/filetype.vim -
" au BufNewFile,BufRead Tupfile,*.tup setf tup
"
" 2) Add a symlink to this file in ~/.vim/syntax/ -
" mkdir -p ~/.vim/syntax
" cd ~/.vim/syntax
" ln -s /path/to/tup.vim
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
syntax case match
syntax match comment ,^\s*#.*$,
syntax match rule ,^\s*:,
syntax match bang ,![a-zA-Z0-9_.-]*,
syntax match separator /|>/
syntax match reverseseparator /<|/
syntax match format display "%\([%eOBbd]\|[0-9]\?[0-9]\?[foi]\|<[a-zA-Z0-9_-]*>\)" contained
syntax match errfmt display "%\([^%efoOBbd<0-9]\)" contained
syntax match variable /$([^)]*)/
syntax match variable /{[^}]*}/
syntax match atvar /@([^)]*)/
syntax match atvar /$(CONFIG_[^)]*)/
syntax match control "^\(ifeq\>\|ifneq\>\|else\>\|endif\>\|include\>\|include_rules\>\|preload\>\|\.gitignore\>\|run\>\|export\>|import\>\)"
syntax match backslash /\\$/
syntax keyword keys foreach
syntax region ifdef matchgroup=control start=/^ifdef / start=/^ifndef / end=/$/
syntax region command matchgroup=separator start=/|>/ end=/|>/ end=/$/ contains=format,variable,atvar,bang,errfmt
syntax region reversecommand matchgroup=reverseseparator start=/<|/ end=/<|/ end=/$/ contains=format,variable,atvar,bang,errfmt
highlight link comment Comment
highlight link command String
highlight link reversecommand String
highlight link rule Operator
highlight link separator Keyword
highlight link reverseseparator Keyword
highlight link keys Keyword
highlight link format Special
highlight link errfmt Error
highlight link variable Special
highlight link control Include
highlight link bang Type
highlight def atvar ctermfg=red cterm=bold
highlight def ifdef ctermfg=red cterm=bold
highlight def backslash ctermfg=red cterm=bold
|