vim实用系列3:vim格式化代码
2010-02-03 11:20
399 查看
从别的编辑器里粘贴到vim里的代码经常由于不正常的缩进变得格式混乱。
格式化全文: gg=G
自动缩进当前行: ==
格式化当前光标接下来的10行: 10=
格式化选定的行: v (向上下选择)=
官方解释:http://vimdoc.sourceforge.net/cgi-bin/vimfaq2html3.pl#14.6
格式化全文: gg=G
自动缩进当前行: ==
格式化当前光标接下来的10行: 10=
格式化选定的行: v (向上下选择)=
官方解释:http://vimdoc.sourceforge.net/cgi-bin/vimfaq2html3.pl#14.6
14.6. How do I format/indent an entire file? You can format/indent an entire file using the gg=G command, where gg - Goto the beginning of the file = - apply indentation G - till end of file For more information, read :help gg :help = :help G :help 'formatprg' :help C-indenting
相关文章推荐
- VIM实用系列1:Vim代码缩进设置
- VIM格式化代码(How to format code with VIM)
- VIM代码 格式化与注释 自动对齐
- vim格式化代码
- Vim使用YouCompleteMe达到类似IDE的代码提示、补全,以及其他实用设置
- vim格式化代码
- 如何通过VIM把代码格式化后生成HTML网页代码
- go语言笔记——调试还很弱,用gdb来做?可用panic和defer。格式化代码使用gofmt,貌似我的vim插件是自带
- vim格式化代码
- vim格式化代码
- vim中自动格式化代码
- vim格式化python代码
- VIM使用系列之一——配置VIM下编程和代码阅读环境
- phper 的两个实用批处理助你自动格式化php代码、清除svn、netbeans等工程文件
- vim中自动格式化代码
- vim 快速格式化代码
- 【转】vim格式化C代码
- vim+astyle 格式化代码
- vim格式化代码实际上就是 "缩进代码", 命令是等号=
- Vim中简单格式化代码