#cat ~/.vimrcset nocompatiblesource $VIMRUNTIME/vimrc_example.vim"source $VIMRUNTIME/mswin.vim"behave mswinset ruler"set nusyntax onsyntax enableset ts=4set noerrorbellsset sw=4"set autoindent"set smartindentfiletype onset foldlevel=100"set ignorecase smartcaseset so=5colo desertautocmd FileType c,py setl fdm=syntax | setl fen"let g:sh_fold_enabled= 1set nobackup"set cursorline"set cursorcolumn:runtime macros/matchit.vimau BufNewFile,BufRead *.t2t set ft=txt2tags"set foldcolumn=4set mouse-=anmap # I# jmap :tabnew set encoding=utf-8set termencoding=utf-8set fileencodings=ucs-bom,utf-8,gb18030,gbk,gb2312,big5,euc-jp,euc-kr,latin1,cp936autocmd BufNewFile *.sh,*.pl,*.py exec ":call SetTitle()""autocmd BufWrite *.sh,*.pl,*.py exec ":call ModifyTitle()"autocmd BufWrite *.sh,*pl,*py if getline(6) != "# Modify Author: ".expand("$SHTERM_REAL_USER@alibaba-inc.com") || split(getline(7))[3] != strftime("%F") | call ModifyTitle() | endifautocmd BufNewFile,BufRead *.py exec ":call SetTable()"func SetTable() set expandtab set tabstop=4 set shiftwidth=4endfuncfunc SetTitle() if &filetype == 'sh' call setline(1, "\#!/bin/sh") call append(line("."), "\#****************************************************************#") call append(line(".")+1, "\# ScriptName: ".expand("%") ) call append(line(".")+2, "\# Author: ".expand("$SHTERM_REAL_USER@alibaba-inc.com") ) call append(line(".")+3, "\# Create Date: ".strftime("%F %R")) call append(line(".")+4, "\# Modify Author: ".expand("$SHTERM_REAL_USER@alibaba-inc.com") ) call append(line(".")+5, "\# Modify Date: ".strftime("%F %R")) call append(line(".")+6, "\# Function: " ) call append(line(".")+7, "\#***************************************************************#") call append(line(".")+8, "") :8 elseif &filetype == 'perl' call setline(1, "\#!/usr/bin/perl") call append(line("."), "\#****************************************************************#") call append(line(".")+1, "\# ScriptName: ".expand("%") ) call append(line(".")+2, "\# Author: ".expand("$SHTERM_REAL_USER@alibaba-inc.com") ) call append(line(".")+3, "\# Create Date: ".strftime("%F %R")) call append(line(".")+4, "\# Modify Author: ".expand("$SHTERM_REAL_USER@alibaba-inc.com") ) call append(line(".")+5, "\# Modify Date: ".strftime("%F %R")) call append(line(".")+6, "\# Function: ") call append(line(".")+7, "\#***************************************************************#") call append(line(".")+8, "") :8 elseif &filetype == 'python' call setline(1, "\#!/usr/bin/python") call append(line("."), "\#****************************************************************#") call append(line(".")+1, "\# ScriptName: ".expand("%") ) call append(line(".")+2, "\# Author: ".expand("$SHTERM_REAL_USER@alibaba-inc.com") ) call append(line(".")+3, "\# Create Date: ".strftime("%F %R")) call append(line(".")+4, "\# Modify Author: ".expand("$SHTERM_REAL_USER@alibaba-inc.com") ) call append(line(".")+5, "\# Modify Date: ".strftime("%F %R")) call append(line(".")+6, "\# Function: ") call append(line(".")+7, "\#***************************************************************#") call append(line(".")+8, "") :8 endifendfuncfunc ModifyTitle() if getline(6) =~ "# Modify Author:.*" call setline(6, "\# Modify Author: ".expand("$SHTERM_REAL_USER@alibaba-inc.com") ) call setline(7, "\# Modify Date: ".strftime("%F %R")) endifendfunc