Use Vim to create ide-highlighted display

Source: Internet
Author: User

Use Vim to build ide-Highlight

In ~ Create C. Vim under/. Vim/syntax. If this directory does not exist, create it by yourself.

 

Vim uses this script to read the syntax highlighting rules and edit the c. Vim file as follows:

"============================================== ========================
"Highlight all function
"============================================== ========================
SYN match cfunction "/<[A-Za-Z _] [a-zA-Z_0-9] */> [^ ()] *) (" Me = E-2
SYN match cfunction "/<[A-Za-Z _] [a-zA-Z_0-9] */>/S * (" Me = E-1
Hi cfunction GUI = none guifg = # b5a1ff

"============================================== ========================
"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

"============================================== ========================
"My own datatype
"============================================== ========================
SYN keyword ctype my_type_1 my_type_2 my_type_3

The preceding section highlights the data types you have defined. In this way, my_type_1 my_type_2 my_type_3 is highlighted.

Use Vim to build ide-Highlight

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.