syntax on
set nu
set paste
set fileencodings=ucs-bom,utf-8,utf-16,gbk,big5,gb18030,latin1
set fileencoding=utf-8
set encoding=utf-8
map I//
map ^xx
"map
"============"
"多窗口操作"
"============"
map + + "ctrl+w++ 扩大窗口"
map - - "ctrl+w++ 缩小窗口"
map gl l "ctrl+w+l 移动到右侧窗口"
map gh h "ctrl+w+h 移动到左侧窗口"
map gj j "ctrl+w+j 移动到下方窗口"
map gk k "ctrl+w+k 移动到上方窗口"
"================="
"当前文件内搜索选项"
"================="
set hlsearch "开启搜索结果的高亮显示"
set incsearch "边输入边搜索(实时搜索)"
"ctrl+a全选并复制
"gg是定位到行首
"V:是进入 visual模式
"G$是VISUAL模式全选
"y:是复制
"+是+号寄存器
map ggVG$"+y
"================="
"加入文件头注释"
"================="
autocmd BufNewFile *.js,*.php exec ":call SetComment()"
"新建文件后,自动定位到文件末尾
autocmd BufNewFile * normal G
func SetComment()
if expand("%:e") == 'php'
call setline(1,"")
call append(line(".")+5, " * 创建日期:".strftime("%Y年%m月%d日 %H:%M:%S"))
call append(line(".")+6, " ****************************************************************/")
call append(line(".")+7, "")
call append(line(".")+8, "")
endfunc