VIM语法折叠:禁用折叠多行注释
VIM syntax folding : disable folding multi-line comments
我在vim 7.3中使用了"语法"foldmethod。In.vimrc:
set foldmethod=syntax
当我打开Test.cpp时,包含:
/* A function with a multi-line
* comment. This takes at least
* four lines and I want to be
* able to read all of them.
*/
void TheFunction()
{
DoStuff();
}
折叠时我看到以下内容:
+-- 5 lines: A function with a multi-line---------------------------------------------
void TheFunction()
+-- 3 lines: {------------------------------------------------------------------------
我喜欢功能体折叠,但不喜欢评论折叠。我想禁用它,所以它看起来像这样:
/* A function with a multi-line
* comment. This takes at least
* four lines and I want to be
* able to read all of them.
*/
void TheFunction()
+-- 3 lines: {------------------------------------------------------------------------
我该怎么做?我可以看到与以下内容相关的语法组:syn-listcComment
cComment xxx matchgroup=cCommentStart start=+/*+ end=+*/+ extend fold contains
=@cCommentGroup,cCommentStartError,cSpaceError,@Spell
links to Comment
但是,使用vim文档工作了一个小时,谷歌还没有告诉我如何从这个组中删除"fold"属性。
我唯一的办法真的是编辑语言语法文件吗?我想复制系统语法文件并使用它不会那么难看,但我应该能够用.virc.中的命令关闭特定的组
当'foldmethod'
设置为"syntax"
时,/* */ comments
和{ } blocks
将成为一个褶皱。如果你不想评论变成折叠使用:
:let c_no_comment_fold = 1
相关文章:
- VSCode 中带有 C/C++ 扩展名的多行注释缩进错误
- 如何设置叮当格式的注释编译指示,以免触及多行doxygen注释?
- 如何阻止 ReSharper 在 C++ 中格式化多行注释
- C++,在多行代码段中注释
- QSyntax荧光笔和多行注释
- 防止 clang 格式将多行 if 语句折叠为一行
- gcc多行注释警告
- visualstudio继续多行注释
- 宏和多行注释
- 变量后的Doxygen多行注释
- VIM语法折叠:禁用折叠多行注释
- 使用RegEx剥离C++中的多行注释
- 用c++计算多行注释之间的所有行数
- 如何在氧代码示例中插入多行注释
- c++单行注释后面跟着多行注释中的变换
- 为什么在c++中注释多行注释不一致?
- 使用反斜杠的多行注释
- 多行注释和新行
- c++正则表达式搜索多行注释(在/* */之间)
- 使用flex/bison进行多行注释声明