1
0
forked from x/ContextOS
ContextOS/etc/conf/shy.vim
2019-10-30 13:30:40 +08:00

60 lines
1.8 KiB
VimL

function! Keys(which, keys)
for key in a:keys
if a:which == "Statment"
let key = "\"\\(^\\|\\t\\| \\|$(\\)" . key . "\\>\""
else
let key = "\"\\<" . key . "\\>\""
end
exec "syn match shy" . a:which. " " . l:key
endfor
endfunction
highlight shyArgument ctermfg=cyan
highlight shySubCommand ctermfg=yellow
highlight shyCache ctermfg=yellow
highlight shyConfig ctermfg=yellow
highlight shyCommand ctermfg=green
highlight shyContext ctermfg=red
highlight shyComment ctermfg=blue
highlight shyStatment ctermfg=yellow
highlight shyOperator ctermfg=yellow
highlight shyVariable ctermfg=magenta
highlight shyNumber ctermfg=magenta
highlight shyString ctermfg=magenta
syn match shyString "'[^']*'"
syn match shyString "\"[^\"]*\""
syn match shyNumber "-\=\<\d\+\>#\="
syn match shyNumber "false\|true"
syn match shVariable "\$[_a-zA-Z0-9]\+\>"
syn match shVariable "@[_a-zA-Z0-9]\+\>"
syn match shyComment "#.*$"
syn match shyContext "^\~[a-zA-Z0-9_\.]\+\>"
syn match shyCommand "\(^\|\t\| \|$(\)[a-zA-Z0-9_\.]\+\>"
syn match shyOperator "option"
call Keys("Statment", ["fun", "kit"])
call Keys("SubCommand", ["private", "protected", "public"])
call Keys("Statment", ["config", "cache"])
call Keys("Statment", ["return", "source"])
call Keys("Statment", ["var", "let"])
call Keys("Statment", ["if", "else", "else if", "for", "end"])
call Keys("Statment", ["label", "goto"])
" context nfs
" call Keys("SubCommand", ["import", "export", "load", "save"])
" context ctx
" call Keys("Argument", ["list", "map"])
" context mdb
call Keys("Argument", ["dbname", "dbhelp"])
" context aaa
call Keys("Argument", ["user", "componet", "command"])
" context web
call Keys("Argument", ["client", "cookie", "header"])