简体   繁体   English

vimrc 中的注释

[英]Comment in vimrc

I commented a part of a line using double quotes in my vimrc file, but that part of the line is not commented as can be seen at the bottom of the screenshot below:我在 vimrc 文件中使用双引号注释了一行的一部分,但该行的一部分没有注释,如下面的屏幕截图底部所示:

在此处输入图像描述

Any idea why is this happening?知道为什么会这样吗?

Please, read :h:comment in the embedded help system.请阅读嵌入式帮助系统中的:h:comment To quote the most relevant part:引用最相关的部分:

It is not possible to add a comment to a shell command "::cmd" or to the ":map" command and a few others (mainly commands that expect expressions) that see the '"' as part of their argument:无法向 shell 命令“::cmd”或“:map”命令以及其他一些将“”视为其参数的一部分的命令(主要是需要表达式的命令)添加注释:

...A long list follows... ...一长串列表如下...

So just don't.所以不要。

vim's docs say the following: vim 的文档是这样说的:

It is not possible to add a comment to a shell command "::cmd" or to the ",map" command and a few others.无法向 shell 命令“::cmd”或“,map”命令和其他一些命令添加注释。 because they see the '"'' as part of their argument. This is mentioned where the command is explained.因为他们将 '"'' 视为参数的一部分。在解释命令的地方提到了这一点。

Just put your comments on preceding lines.只需将您的评论放在前面几行。

vim's docs are here, for example. 例如,vim 的文档在这里。

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

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