set nocompatible source $VIMRUNTIME/vimrc_example.vim behave xterm "set fileencodings=utf-8,gb2312 "set fileencodings=utf-8 set fileencodings=utf-8,gb2312 set tabstop=2 set shiftwidth=2 set nocp set mouse="" set paste set smartindent filetype plugin on set diffexpr=MyDiff() set tags=tags;/ set nobackup nmap :Setcomment imap :Setcomment vmap :SetcommentV command! -nargs=0 Setcomment call s:SET_COMMENT() command! -nargs=0 SetcommentV call s:SET_COMMENTV() function! s:SET_COMMENT() let lindex=line(".") let str=getline(lindex) let CommentMsg=s:IsComment(str) call s:SET_COMMENTV_LINE(lindex,CommentMsg[1],CommentMsg[0]) endfunction function! s:SET_COMMENTV() let lbeginindex=line("'<") let lendindex=line("'>") let str=getline(lbeginindex) let CommentMsg=s:IsComment(str) let i=lbeginindex while i<=lendindex call s:SET_COMMENTV_LINE(i,CommentMsg[1],CommentMsg[0]) let i=i+1 endwhile endfunction function! s:SET_COMMENTV_LINE( index,pos, comment_flag ) let poscur = [0, 0,0, 0] let poscur[1]=a:index let poscur[2]=a:pos+1 call setpos(".",poscur) if a:comment_flag==0 exec "normal! 0" exec "normal! i//" else exec "normal! xx" endif endfunction function! s:IsComment(str) let ret= [0, 0] let i=0 let strlen=len(a:str) while i ' . arg3 . eq endfunction colorscheme evening