vim使用

:%s/ /\r/gc    将空格替换为换行符

:%s/ /\t/gc    将空格替换为制表符

 

syntax on
set ts=4
set autoindent
set smartindent
set cindent shiftwidth=4
set softtabstop=4
autocmd FileType c set expandtab
autocmd FileType cpp set expandtab
autocmd FileType php set expandtab
autocmd FileType python set expandtab
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8
set is
filetype plugin indent on

 

ctrl + z 撤销恢复

gg==G美化,前提有插件和vimrc中插件功能打开,注意文件后缀,否则无法识别

 

删除空行    :g/^$/d    :g/^\s*$/d
 
posted @ 2014-06-20 21:32  戈壁的石头  阅读(160)  评论(0编辑  收藏  举报