我当前的 vim 配置设置为在光标移出折叠区域后自动关闭折叠:
set foldmethod=syntax
set foldclose=all
效果非常好。因此,我经常觉得需要同时关注 2 个不同的折叠部分(即:不同位置的两个 if
语句)。
不幸的是,考虑到通过将光标移出第一个 if
子句,将 foldclose
设置为 all
时,上述情况变得不可能将使前一个立即关闭。
有没有办法暂时标记该折叠,以便在我检查两个子句和一个已完成的子句时不会受到 foldclose=all
的影响,我可以简单地删除该阻止标志那么它会恢复正常吗?
I think that the
syntax
method is the one that serves me well since it is usually what I look for when working with language specific folding.
最佳答案
据我所知,这是不可能的。
但是,您可以通过分割窗口(:split
)来作弊。这允许光标位于每个窗口中的不同位置,因此您可以在每个窗口中打开不同的折叠。
关于vim - 暂时禁用foldclose=all,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27090395/