vi批量转换“{”结尾的代码风格到“{”另起一行的代码风格
来源:互联网 发布:电信云计算发展措施 编辑:程序博客网 时间:2024/06/08 16:56
const IfMgrIfAtom* ifa = _rm->iftree().find_interface(ifname); if (ifa == NULL) { ZSP_WARN("Got update for interface not in the libfeaclient tree: %s", ifname.c_str()); return; } const IfTreeInterface* ifp = observed_iftree().find_interface(ifname); if (ifp == NULL) { ZSP_WARN("Got update for interface not in the FEA tree: %s", ifname.c_str()); return; }
需要改成:
const IfMgrIfAtom* ifa = _rm->iftree().find_interface(ifname); if (ifa == NULL) { ZSP_WARN("Got update for interface not in the libfeaclient tree: %s", ifname.c_str()); return; } const IfTreeInterface* ifp = observed_iftree().find_interface(ifname); if (ifp == NULL) { ZSP_WARN("Got update for interface not in the FEA tree: %s", ifname.c_str()); return; }
用正则表达式:
:s/\([^ \t].*\){/\1\r{/g就可以全部替换。
其中
[^ \t].*:是把只有空格,TAB的行过滤掉
\([^ \t].*\):把{前面的内容记录下来\1\r:在{前面加换行符
0 0
- vi批量转换“{”结尾的代码风格到“{”另起一行的代码风格
- c语言实现代码C风格到C++风格的注释转换
- 良好的代码风格
- ACE的代码风格
- ACE的代码风格
- VHDL的代码风格
- 良好的代码风格
- 良好的代码风格
- 代码风格的问题
- java的代码风格
- 优秀的代码风格
- Python 的代码风格
- 良好的代码风格
- 代码风格的问题
- 良好的代码风格
- 代码风格的总结
- Java的代码风格
- 良好的代码风格
- 第7周工作周报
- SCHED_DEALINE调度类分析(二)
- shop++ CriteriaQuery 数据库查询语句
- UIApplication深入研究
- jQuery 实现 九九乘法表
- vi批量转换“{”结尾的代码风格到“{”另起一行的代码风格
- abstract抽象类的总结
- 面向对象编程OPportunity Presentation(OPP)语言
- Java中try 与catch的使用
- java WEB 构思(转)
- Mule-Configuring Propertiesule-配置文件
- hdu1114Piggy-Bank 多重背包问题
- iOS 清除缓存
- Android第一步