我的vim配置文件
用vim编辑文件,不仅仅是为了耍酷,但是用的话,确实比较酷
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set nobackup
set nu
colo desert
set sw=4
set ts=4
set showmatch
set autoindent
set smartindent
set helplang=cn
set autochdir
set diffexpr=MyDiff()
set guifont=Lucida_Console:h10:cANSI
" set guioptions-=m
set guioptions-=T
set winaltkeys=yes
au GUIEnter * simalt ~x
noremap :update
vnoremap :update
inoremap :update
set list
set listchars=tab:--
au FileType php call AddPHPFuncList()
au FileType html call AddPHPFuncList()
au FileType htm call AddPHPFuncList()
function AddPHPFuncList()
set dictionary-=$VIM/extra/php_function.txt dictionary+=$VIM/extra/php_function.txt
set complete-=k complete+=k
endfunction
inoremap :call PhpDocSingle()i
nnoremap :call PhpDocSingle()
vnoremap :call PhpDocRange()
"对.vimrc配置文件的修改立即生效
autocmd! bufwritepost _vimrc source %
set tags=tags;/
set encoding=utf-8
set fileencodings=utf-8,chinese,latin-1
if has('win32')
set fileencoding=chinese
else
set fileencoding=utf-8
endif
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
language messages zh_CN.utf-8
set nobackup
set hlsearch
set showmatch
"set autoindent
"set smartindent
"set nocompatible
set history=1000
set guioptions-=T
set winaltkeys=yes
au GUIEnter * simalt ~x
set showcmd
set expandtab
set nocompatible
set ru
set magic
sy on
set et
set smarttab
set tw=80
set lbr
"show a message of cmd
set wildmenu
map 1gt
map 2gt
map 3gt
map 4gt
map 5gt
map 6gt
map 7gt
map 8gt
map 9gt
map :tabnew
map :tabclose
map! 1gt
map! 2gt
map! 3gt
map! 4gt
map! 5gt
map! 6gt
map! 7gt
map! 8gt
map! 9gt
map! :tabnew
map! :tabclose
"set encoding=fileencodings
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set nobackup
set nu
colo desert
set sw=4
set ts=4
set showmatch
set autoindent
set smartindent
set helplang=cn
set autochdir
set diffexpr=MyDiff()
set guifont=Lucida_Console:h10:cANSI
" set guioptions-=m
set guioptions-=T
set winaltkeys=yes
au GUIEnter * simalt ~x
noremap
vnoremap
inoremap
set list
set listchars=tab:--
au FileType php call AddPHPFuncList()
au FileType html call AddPHPFuncList()
au FileType htm call AddPHPFuncList()
function AddPHPFuncList()
set dictionary-=$VIM/extra/php_function.txt dictionary+=$VIM/extra/php_function.txt
set complete-=k complete+=k
endfunction
inoremap
nnoremap
vnoremap
"对.vimrc配置文件的修改立即生效
autocmd! bufwritepost _vimrc source %
set tags=tags;/
set encoding=utf-8
set fileencodings=utf-8,chinese,latin-1
if has('win32')
set fileencoding=chinese
else
set fileencoding=utf-8
endif
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
language messages zh_CN.utf-8
set nobackup
set hlsearch
set showmatch
"set autoindent
"set smartindent
"set nocompatible
set history=1000
set guioptions-=T
set winaltkeys=yes
au GUIEnter * simalt ~x
set showcmd
set expandtab
set nocompatible
set ru
set magic
sy on
set et
set smarttab
set tw=80
set lbr
"show a message of cmd
set wildmenu
map
map
map
map
map
map
map
map
map
map
map
map!
map!
map!
map!
map!
map!
map!
map!
map!
map!
map!
"set encoding=fileencodings
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction