简体   繁体   English

Vim C C ++语法突出显示

[英]Vim C C++ syntax highlighting

In the latest Vim : 在最新的Vim中

Is there a way to define a '{' such that it's ignored by the C/C++ compiler (g++) but treated like a '{' in Vim synatx highlighting? 有没有一种方法来定义'{',以使它被C / C ++编译器(g ++)忽略,但在Vim synatx高亮显示时被视为'{'。

I've tried //{ but it's ignored by Vim too. 我已经尝试过//{但是Vim也忽略了它。

The whole point of syntax highlighting is to help indicate how the compiler will interpret your code. 语法高亮的全部目的是帮助指示编译器将如何解释您的代码。 For example, if you miss a closing quote on a literal string, the syntax highlighting helps you to identify where you did that. 例如,如果您遗漏了文字字符串上的右引号,则语法高亮显示可帮助您确定在何处执行该操作。

You're asking for a vim feature to do something that it's expressly designed to avoid doing. 您需要一个vim功能来执行其明确设计的功能,以避免这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM