我的Vim 配置文件 my vimrc file
" ==================================
" --------- Basic Options ----------
syntax on
set expandtab
set hlsearch
" colo sienna
colo evening
set incsearch
set cursorline
set scrolloff=3
" nubmer of spaces for each <tab>
set tabstop=4
set softtabstop=4
" auto indent and cindent, set 4 space for indent
set autoindent smartindent
set shiftwidth=4
" encodings
set fileencoding=utf-8
set fileencodings=utf-8,gb18030,big5
" show line number
set number
set autochdir
" GUI settings
set guifont=Bitstream\ Vera\ Sans\ Mono\ 12
set go-=T
set go-=m
" back up
set noswapfile
set backup
set directory=/var/tmp,/tmp,c:\tmp
set backupdir=/var/tmp,/tmp,c:\tmp
" ==================================================
" ------------- Advanced Options -------------------
" ----- key mappings ------
nmap <silent> ze <c->
nmap zl :buffers<cr>:edit<space>#
nmap </space></cr></c-></silent><silent> zm :bd<cr>
" copy and paste with outside environment
noremap </cr></silent><silent> zp "+p
noremap </silent><silent> zy "+y
" exchange tabs
nmap </silent><silent> gn :bn<cr>
nmap </cr></silent><silent> gp :bp<cr>
" for python and C++ compile
nmap </cr></silent><silent> zP :w<cr>G:r!time python %</cr><cr>
nmap </cr></silent><silent> zG :w<cr>G:r!g++ -o v.o %</cr><cr>:r!./v.o</cr><cr>
" for NERDTree
let NERDTreeIgnore=['\.pyc$', '\~$']
nmap </cr></silent><silent> zn :NERDTreeToggle<cr>
" states bar
set laststatus=2
set statusline=%r%m[%F]%=\ line:%l/%L\ col:%c\ buffers:[%n]
</cr></silent></tab>
Last edited at: April 26, 2011
Comments on old posts like this are closed.