How to syntax-highlight a part of file in a different syntax?

后端 未结 3 616
陌清茗
陌清茗 2021-02-08 02:19

I installed bnf.vim (highlights BNF grammar files).

Suppose I have a comment in my code:

/* 

 :=  | h
 := a | b |          


        
3条回答
  •  逝去的感伤
    2021-02-08 03:05

    You can use my SyntaxRange plugin for that.

    Either explicitly assign the range, e.g.

    :10,20SyntaxInclude bnf
    

    or automatically based on the delimiting patterns:

    :call SyntaxRange#Include('', '', 'bnf')
    

提交回复
热议问题