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

后端 未结 3 614
陌清茗
陌清茗 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:14

    for many file types vim will use the heredoc names as a clue. For example in php files I'm often creating here docs thus:

    Solar 
    

    Is good

    html; $my_js = <<

    works beautifully, with only problem being that indentation is problematic (the closing marker cannot have preceding spaces)

提交回复
热议问题