12/12/2010

VIM Setting for myself

最近使用Vim一段時間了....終於漸漸習慣操作方式和界面

現在換成去用Source Insigh整個不習慣= =

上傳我自己的Vim設置備份一下


" Maintain : Dicky
"
" Mail : dickychiang73@gamil.com
"
" Date : 2010/5/14 14:43
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sets how many lines of history VIM has to remember
set history=300

" Enable filetype plugin
filetype plugin on
filetype indent on

" Set to auto read when a file is changed from the outside
set autoread

" When vimrc is edited, reload it
autocmd! bufwritepost vimrc source ~/.vim_runtime/vimrc

" always show the mouse
"set mouse=a
set mouse=v

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => VIM user interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Turn on WiLd menu
set wildmenu

"Always show current position
set ruler

"Ignore case when searching
set ignorecase

"Highlight search things
set hlsearch

"Make search act like search in modern browsers
set incsearch

"Set magic on, for regular expressions
set magic

"Show matching bracets when text indicator is over them
set showmatch

"Show the number line
"set nu

"cursorline : hightlight currentline
set cul

"Auto save current status
if has("autocmd")
      au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
  endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors and Fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set background=dark
"colorscheme desert
syntax on
syntax enable
"Default file types
set ffs=unix,dos,mac

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files and backups
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Turn backup off, since most stuff is in SVN, git anyway...
set nobackup
set nowb
set noswapfile

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set expandtab
set shiftwidth=4
set tabstop=4
set smarttab
set lbr
set tw=500
"Auto indent
set ai
"Smart indet
set si
"Wrap lines
set wrap
"C indent
set cin

""""""""""""""""""""""""""""""
" => Statusline
""""""""""""""""""""""""""""""
" Always hide the statusline
set laststatus=2

" Format the statusline
"set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%h\ \ \ Line:\ %l/%L:%c

""""""""""""""""""""""""""""""
" => Chinese solution
""""""""""""""""""""""""""""""
set fileencodings=utf-8,gb2312,gbk,gb18030
set termencoding=utf-8
"set fileformats=unix
set encoding=prc
set helplang=cn

""""""""""""""""""""""""""""""
" => tools setting
""""""""""""""""""""""""""""""
"ctags
set tags=tags
"taglist
let Tlist_Show_One_File=1
let Tlist_Use_Right_Window=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Auto_Open=0
nmap :Tlist
"Grep command
nnoremap :Grep
"MiniBufExplorer
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplMapWindowNavVim = 1
"fast Change c/h between
nnoremap :A
"Cscope
set cscopequickfix=s-,c-,d-,i-,t-,e-
nmap s :cs find s =expand("")
nmap g :cs find g =expand("")
nmap c :cs find c =expand("")
nmap t :cs find t =expand("")
nmap e :cs find e =expand("")
nmap f :cs find f =expand("")
nmap i :cs find i =expand("")$
nmap d :cs find d =expand("")

No comments:

Post a Comment