vim配置文件

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
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 =~ '/<cmd'
      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
"********************************************
"  _vimrc/_gvimrc for windows
"  BY Douboer
"********************************************

"
" echo "loading _vimrc ... "
"

 

"
" 不同中文編碼顯示
" 同時支持GBK和UTF-8編碼
"
"set fileencoding=gb18030
"set fileencodings=utf-8,gb18030,utf-16,big5
set fileencodings=ucs-bom,utf-8,cp936
set fileencoding=utf-8
set encoding=cp936 "set encoding=utf-8

"
" 設置字體
"
"set guifont=Lucida_Console:h9:cANSI

"
" 啓動最大化, 設置顏色方案
"
" winsize 1024 768
au GUIEnter * simalt ~x
colorscheme desert

"
"自動縮進
"
set autoindent

"
" 設置tab製表符爲4個空格
"
set ts=4
set expandtab
set shiftwidth=4
set cinoptions=>4,e0,n0,f0,{0,}0,^0,:s,=s,l0,gs,hs,ps,ts,+s,c3,C0,(2s,us,
                          /U0,w0,m0,j0,)20,*30
"
"set cindent
"


" 展開顯示文件類型菜單

let do_syntax_sel_menu = 1 | runtime! synmenu.vim | aunmenu &Syntax.&Show/ filetypes/ in/ menu

"
" 設置語法
"
"if &filetype != 'javacc'
"    setlocal filetype=javacc
"endif
"set syntax=javacc
"cal SetSyn("cpp")
"cal SetSyn("vb")
"cal SetSyn("perl")
"cal SetSyn("awk")

"
" 備份文件放在指定目錄
"
set backupdir=C:/tmp

"
" 沒有警告音和視覺警告
"
set vb t_vb=

"
" 禁用swf交換文件
"
setlocal noswapfile

"
" 顯示行號
"
set number

"
" 隱藏工具條
"
" see :help 'guioptions'
"
set guioptions-=T
"set guioptions-=m

"
" 狀態條,顯示字節數,列數,行數,當前行等信息
"
set statusline=%F%m%r%h%w/ [FORMAT=%{&ff}]/ [TYPE=%Y]/ [ASCII=/%03.3b]/ [HEX=/%02.2B]/ [POS=%04l,%04v][%p%%]/ [LEN=%L]
set laststatus=2 " always show the status line

"
"auto-comments for // and /* */
"setlocal comments=sO:*/ -,mO:*/ / ,exO:*/,s1:/*,mb:*,ex:*/,://
"
"disable auto-comments for //
"setlocal comments=sO:*/ -,mO:*/ / ,exO:*/,s1:/*,mb:*,ex:*/,f://
"
"disable auto-comments for // and /* */
"
"setlocal comments=sO:*/ -,mO:*/ / ,exO:*/,s1:/*
setlocal comments=""
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Auto_Open=0
let Tlist_Auto_Update=1
let g:winManagerWindowLayout='TagList|BufExplorer'
let g:miniBufExplMapCTabSwitchBufs=1
filetype plugin indent on
set completeopt=longest,menu
set nocp
filetype plugin on
set tags+=tags
set tags+=../tags
""""""""""""""""""""""""""""""
" BufExplorer
""""""""""""""""""""""""""""""
let g:bufExplorerDefaultHelp=0       " Do not show default help.
let g:bufExplorerShowRelativePath=1  " Show relative paths.
let g:bufExplorerSortBy='mru'        " Sort by most recently used.
let g:bufExplorerSplitRight=0        " Split left.
let g:bufExplorerSplitVertical=1     " Split vertically.
let g:bufExplorerSplitVertSize = 30  " Split width
let g:bufExplorerUseCurrentWindow=1  " Open in new window.
autocmd BufWinEnter /[Buf/ List/] setl nonumber
set cscopequickfix=s-,c-,d-,i-,t-,e-
nmap <F8> :Tlist<cr>
nmap <F6> :cn<cr>
nmap <F7> :cp<cr>
nmap <F9> :vi .<cr>
"set autowrite
" 光標移動到buffer的頂部和底部時保持3行距離
set scrolloff=5
" 爲C程序提供自動縮進
set smartindent

" 使用C樣式的縮進
set cindent

" 製表符爲4
set tabstop=4

" 統一縮進爲4
set softtabstop=4
set shiftwidth=4
set nocompatible
set nohlsearch

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章