我是靠谱客的博主 唠叨大门,这篇文章主要介绍vim中 C函数高亮和运算符高亮,现在分享给大家,希望可以做个参考。

在 syntax/c.vim文件中加入以下内容


"highlight Functions

syn match cFunctions display "<[a-zA-Z_][a-zA-Z_0-9]*>[^()]*)("me=e-2
syn match cFunctions display "<[a-zA-Z_][a-zA-Z_0-9]*>s*("me=e-1
hi cFunctions ctermfg=3 guifg=goldenrod
"hi cFunctions gui=NONE cterm=bold  ctermfg=blue


"syn match cFunctions display "[a-zA-Z_]{-1,}s{-0,}({1}"ms=s,me=e-1
"hi def link cFunctions Title


"========================================================
" Highlight All Math Operator
"========================================================
" C math operators
syn match cMathOperator display "[-+*%=<>(){};|.[],&!^~:]"
"" C pointer operators
syn match cPointerOperator display "->/|/."
"" C logical operators - boolean results
syn match cLogicalOperator display "[!<>]=/="
syn match cLogicalOperator display "==/|/<=/|/>=/|/!="
"" C bit operators
"syn match cBinaryOperator display"/(&/||/|/^/|<</|>>/)=/="
""syn match cBinaryOperator display "/~"
""syn match cBinaryOperatorError display "/~="
"" More C logical operators - highlight in preference to binary
"syn match cLogicalOperator display "&&/|||"
"syn match cLogicalOperatorError display "/(&&/|||/)="


" Math Operator
hi cMathOperator guifg=#3EFFE2
hi cPointerOperator guifg=#3EFFE2
hi cLogicalOperator guifg=#3EFFE2
"hi cBinaryOperator guifg=#3EFFE2
"hi cBinaryOperatorError guifg=#3EFFE2
"hi cLogicalOperator guifg=#3EFFE2
"hi cLogicalOperatorError guifg=#3EFFE2

最后

以上就是唠叨大门最近收集整理的关于vim中 C函数高亮和运算符高亮的全部内容,更多相关vim中内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(103)

评论列表共有 0 条评论

立即
投稿
返回
顶部