vim 代码中高效使用折叠fold

如何高效折叠当前cpp文件的所有的函数呢?

1. 找到所有的匹配个数n

:%s/^{//gn

最后的n,代表只报告匹配的个数,而不进行实际的替换。

2. normal模式下录制宏进行折叠模式

qaggnzf%nq

3. 对匹配个数n执行宏

n@a

作者:yusq77

-------------------------------------------

Wish you all the best and good health in 2021.

原文地址:https://www.cnblogs.com/yusq77/p/14670380.html