在WIN下使用GVIM。配置文件位于用户目录下, 文件名是_vimrc。
以下是配置文件内容:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | syntax on
set nu
set tabstop=2
set shiftwidth=2
set autoindent
set smartindent
set ruler
set incsearch
set wildmenu
set wildmode=list:full
set ic
set backspace=indent,eol,start
set whichwrap=h,l
set lbr
set guioptions-=T
colorscheme elflord
:inoremap ( ()<esc>i
:inoremap { {}</esc><esc>i<enter><esc>xO
:inoremap } {}</esc><esc>i
:inoremap [ []</esc><esc>i
:inoremap ' ''</esc><esc>i
:inoremap " ""</esc><esc>i
:inoremap -- -></esc><esc>a
:inoremap -= =></esc><esc>a
:inoremap < << <{ }></esc><esc>hhi
:inoremap /// /**/</esc><esc>hi
:inoremap ppp < ?php<ENTER>?></esc><esc>O<tab>
:inoremap hhb < !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><esc>o<html><esc>o<head><esc>o<title></title></esc><esc>o</esc></head></esc><esc>o<enter><body><enter></enter><enter></enter></body></enter><enter></enter></esc></html></esc><esc>kkkkkka
map $ $a
map @ $;</esc><esc>
</esc></tab></esc></enter></esc> |
第一部分含义可以在这里查询。
第二部分是括号、引号、面向对象符号、数组符号、smarty模板符号、注释符号补全。在insert模式下连续输入第二列的字符即可。
第三部分是php和html结构的快速输入方式。
第四部分是编辑常用模式。
直接拷贝就能应用。