How to quickly write a vim syntax highlighting file

Source: Internet
Author: User

Here is a Chinese entry document, but too long, do not want to read, so there is this article

    1. The quickest way is to find a syntax similar syntax highlighting file, a little change
    2. Write your own words first, the key words:

 Case " is case sensitive syntax keyword your keyword category name x   keyword 1 keyword 2syntax keyword also fill x, will not overwrite, only append   keyword 3 keyword 4

Keywords can not be confused, generally with regular match:

Syntax match category name  /Regular Expression/

There is a trouble is not part of the match, such as I want to match the curly braces,/[a-za-z_]+\s{/, vim syntax highlighting does not match the concept of the group, can not only highlight the preceding string, resulting in curly braces also dyed.

In this case, nested recognition is required, typically nested keyword and match in region, and match is nested in match. For example:

Syntax keyword Sptodo       contained TODO fixme xxxsyntax cluster spcommentgrp contains=sptodosyntax Region  spcomment Start="//" skip="\\$" end= " $ " keepend [email protected]

Specify which syntax units are included in this area by using the CONTAINS keyword.

How to quickly write a vim syntax highlighting file

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.