vim 代码块排版

http://cookoo.iteye.com/blog/32275

方法:

1. 按v进入visual状态,选择多行,用>或<缩进或缩出 

2. 通常根据语言特征使用自动缩进排版:在命令状态下对当前行用== (连按=两次), 或对多行用n==(n是自然数)表示自动缩进从当前行起的下面n行。你可以试试把代码缩进任意打乱再用n==排版,相当于一般IDE里的code format。使用gg=G可对整篇代码进行排版。

 

按v进入visual状态,选择多行,用>或<缩进或缩出 

通常根据语言特征使用自动缩进排版:在命令状态下对当前行用== (连按=两次), 或对多行用n==(n是自然数)表示自动缩进从当前行起的下面n行。你可以试试把代码缩进任意打乱再用n==排版,相当于一般IDE里的code format。使用gg=G可对整篇代码进行排版。

原文链接:

Vim多行缩进技巧 - 猪猪多多 - ITeye博客  https://cookoo.iteye.com/blog/32275

vim 代码块排版 - chivalry - CSDN博客  https://blog.csdn.net/sunmenggmail/article/details/9715383

【转】vim格式化C代码 - dorothychai - 博客园  https://www.cnblogs.com/dorothychai/p/3699222.html

vim格式化C代码 - rongtuteng的专栏 - CSDN博客  https://blog.csdn.net/rongtuteng/article/details/38732031

一条命令即可将 Vim 配置为功能强大的 C/C++ IDE - V2EX  https://www.v2ex.com/t/306715

花费几百个小时打造的超级vim,linux下读写c/c++代码的神器-CSDN论坛  https://bbs.csdn.net/topics/391837309?page=1

posted @ 2019-06-06 12:03  西伯利亚虎  阅读(647)  评论(0编辑  收藏  举报

Permanence, perseverance and persistence in spite of all obstacles, discouragements and impossibilities: It is this, that in all things distinguishes the strong soul from the weak.