输入括号时如何使VIM折叠不打开
我正在使用 vim 和 Foldmethod=syntax;当我在代码中的某处输入括号时,它会立即打开所有后续折叠。我可以明白为什么会发生这种情况:开括号改变其他括号的对应关系,并且所有折叠同时改变。我能以某种方式阻止这种情况吗?我不知道,也许在所有折叠都打开之前有延迟?
编辑:
Vim 版本(vim --version 的输出):
VIM - Vi IMproved 8.1(2018年5月18日,编译于2022年2月1日09:16:32)
包含的补丁:1-2269、3612、3625、3669、3741
操作系统:Ubuntu 20.04
I am using vim and foldmethod=syntax; When I type brackets somewhere in my code, it immediately opens all following folds. I can see why that happens: the open bracket changes the correspondences of the other brackets and all the folds change at the same time. Can I somehow prevent that? I don't know, maybe something like a delay before all the folds are opened?
Edit:
Vim version (output of vim --version):
VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 01 2022 09:16:32)
Included patches: 1-2269, 3612, 3625, 3669, 3741
OS: Ubuntu 20.04
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以
按照@eff提到的那样尝试。
inoremap { {}
似乎不再起作用了。You can try
as mentioned by @eff.
inoremap { {}<left>
seems not to work any more.