vim格式化文本

From Evernote:

vim格式化文本

用Evernote从多处来源收集来的文本往往格式各异,尤其是看代码的话,不同的缩进风格,真的是很难看,这个时候可以粘贴到Vim中,使用以下命令快速完成格式化,以含有PHP代码的文本为例: :%s/^ +\{-}//g
:set filetype=php
gg=G

Advertisements
此条目发表在未分类分类目录。将固定链接加入收藏夹。

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s