1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-26 01:04:06 +08:00

add shy.vim

Change-Id: I17e38f49afdf64a08d8d29ffb6573ee2de40e429
This commit is contained in:
shaoying 2019-01-26 23:11:34 +08:00
parent e9a5e079f0
commit 63f84a3dd6
3 changed files with 77 additions and 71 deletions

View File

@ -174,6 +174,6 @@ function! BenchCode(cmd, arg)
exe "silent !bench " l:line exe "silent !bench " l:line
endfunction endfunction
autocmd BufReadPost * call BenchCode("counter", ["nopen", 1]) " autocmd BufReadPost * call BenchCode("counter", ["nopen", 1])
autocmd BufWritePost * call BenchCode("counter", ["nsave", 1]) " autocmd BufWritePost * call BenchCode("counter", ["nsave", 1])
"}}} "}}}

View File

@ -106,7 +106,7 @@ bindkey "^P" up-line-or-beginning-search
bindkey -M vicmd j down-line-or-beginning-search bindkey -M vicmd j down-line-or-beginning-search
bindkey -M vicmd k up-line-or-beginning-search bindkey -M vicmd k up-line-or-beginning-search
preexec() { # preexec() {
bench web.code.counter nexec 1 >/dev/null # # bench web.code.counter nexec 1 >/dev/null
} # }
#

View File

@ -1,71 +1,77 @@
syn match shComment "#.*$" syntax match shyComment "#.*$"
syn match shString "'[^']*'" syntax match shyContext "^\~[a-zA-Z0-9_\.]\+\>"
syn match shString "\"[^\"]*\"" syntax match shyCommand "\(^\|\t\| \|$(\)[a-zA-Z0-9_\.]\+\>"
syn match shNumber "-\=\<\d\+\>#\=" syntax match shyConfig "\(^\|\t\| \|$(\)config\>"
syntax match shyCache "\(^\|\t\| \|$(\)cache\>"
syn match shOperator "=\|+\|-\|*\|/" syntax match shyString "'[^']*'"
syn match shOperator "<\|<=\|>\|>=\|!=\|==" syntax match shyString "\"[^\"]*\""
syn match shOperator "\\" syntax match shyNumber "-\=\<\d\+\>#\="
syn match shOperator "\~[-_a-zA-Z0-9\.]\+\>" syntax match shVariable "\$[_a-zA-Z0-9]\+\>"
syn match shShellVariables "\$[-_a-zA-Z0-9]\+\>" syntax match shVariable "@[_a-zA-Z0-9]\+\>"
syn match shShellVariables "@[-_a-zA-Z0-9]\+\>"
" syn keyword shStatement break cd chdir continue eval exec exit kill newgrp pwd read readonly shift trap ulimit umask wait syn match shySubCommand "\<\(load\|save\)\>"
" context nfs
syn match shySubCommand "\<\(import\|export\)\>"
" context mdb
syn match shyArgument "\<\(dbname\|dbhelp\)\>"
" context aaa
syn match shyArgument "\<\(componet\|command\)\>"
" context web
syn match shyArgument "\<\(client\|cookie\|header\)\>"
syn match shyOperator "\<\(new\)\>"
" syn keyword shStatement if else elif end for highlight shyComment ctermfg=blue
highlight shyContext ctermfg=red
highlight shyCommand ctermfg=green
highlight shyConfig ctermfg=yellow
highlight shyCache ctermfg=yellow
" ctx command highlight shyString ctermfg=magenta
syn match shStatement "\(^\|\t\| \|$(\)cache" highlight shyNumber ctermfg=magenta
syn match shStatement "\(^\|\t\| \|$(\)config" highlight shyVariable ctermfg=magenta
" ctx command highlight shyOperator ctermfg=yellow
syn match shCommand "\(^\|\t\| \|$(\)command" highlight shyArgument ctermfg=cyan
" cli command highlight shySubCommand ctermfg=yellow
syn match shStatement "\(^\|\t\| \|$(\)let"
syn match shStatement "\(^\|\t\| \|$(\)var"
syn match shStatement "\(^\|\t\| \|$(\)return"
syn match shStatement "\(^\|\t\| \|$(\)arguments"
syn match shStatement "\(^\|\t\| \|$(\)source"
syn match shCommand "\(^\|\t\| \|$(\)alias"
" aaa command
syn match shCommand "\(^\|\t\| \|$(\)hash"
syn match shCommand "\(^\|\t\| \|$(\)auth"
syn match shOperator "\<\(data\|ship\|role\)\>"
syn match shSubCommand "\<\(username\|userrole\|componet\|command\)\>"
" web command
syn match shCommand "\(^\|\t\| \|$(\)serve"
syn match shCommand "\(^\|\t\| \|$(\)route"
syn match shCommand "\(^\|\t\| \|$(\)client"
syn match shCommand "\(^\|\t\| \|$(\)cookie"
syn match shCommand "\(^\|\t\| \|$(\)template"
" mdb command
syn match shCommand "\(^\|\t\| \|$(\)open"
hi def link shComment Comment " syn match shNumber "-\=\<\d\+\>#\="
hi def link shString String "
hi def link shNumber Number " syn match shOperator "=\|+\|-\|*\|/"
hi def link shOperator Operator " syn match shOperator "<\|<=\|>\|>=\|!=\|=="
hi def link shShellVariables PreProc " syn match shOperator "\\"
hi def link shStatement Statement "
hi def link shCommand Identifier " " syn keyword shStatement break cd chdir continue eval exec exit kill newgrp pwd read readonly shift trap ulimit umask wait
hi def link shSubCommand String "
" " syn keyword shStatement if else elif end for
hi def link shArithmetic Special "
hi def link shCharClass Identifier " " ctx command
hi def link shSnglCase Statement "
hi def link shCommandSub Special " " ctx command
hi def link shConditional Conditional " syn match shCommand "\(^\|\t\| \|$(\)command"
hi def link shCtrlSeq Special " " cli command
hi def link shExprRegion Delimiter " syn match shStatement "\(^\|\t\| \|$(\)let"
hi def link shFunctionKey Function " syn match shStatement "\(^\|\t\| \|$(\)var"
hi def link shFunctionName Function " syn match shStatement "\(^\|\t\| \|$(\)return"
hi def link shRepeat Repeat " syn match shStatement "\(^\|\t\| \|$(\)arguments"
hi def link shSet Statement " syn match shStatement "\(^\|\t\| \|$(\)source"
hi def link shSetList Identifier " syn match shCommand "\(^\|\t\| \|$(\)alias"
hi def link shSpecial Special "
hi def link shTodo Todo " " aaa command
hi def link shAlias Identifier " syn match shCommand "\(^\|\t\| \|$(\)hash"
" syn match shCommand "\(^\|\t\| \|$(\)auth"
" syn match shCommand "\(^\|\t\| \|$(\)role"
" syn match shCommand "\(^\|\t\| \|$(\)user"
" syn match shSubCommand "\<\(componet\|command\)\>"
"
" " web command
" syn match shCommand "\(^\|\t\| \|$(\)serve"
" syn match shCommand "\(^\|\t\| \|$(\)route"
" syn match shCommand "\(^\|\t\| \|$(\)client"
" syn match shCommand "\(^\|\t\| \|$(\)cookie"
" syn match shCommand "\(^\|\t\| \|$(\)template"
"
" " mdb command
" syn match shCommand "\(^\|\t\| \|$(\)open"
"
"