技巧1:文件自动对齐
先按gg让光标移动到第一行第一个字符,再按=G
或者在命令模式下打=:1,$
2:多行缩进:
按v进入visual模式,选中多行,按 "<" 或 ">" (加shift键)减少或增加缩进
配置文件:
set hlsearch
set backspace=2
set autoindent
set cindent
set smartindent
set shiftwidth=4
set ruler
set showmode
set nu
set bg=dark
syntax on
set showcmd
set tabstop=4
set noexpandtab
set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936
set fileencoding=utf-8
filetype indent on
autocmd FileType python setlocal et sta sw=4 sts=4