" author: feelinglucky<i.feelinglucky@gmail.com>
" website: http://www.gracecode.com
" date: 2007-12-28
set linebreak
set textwidth=80
set nocompatible
set history=400
set ruler
set number
set hlsearch
set noincsearch
set expandtab
set noerrorbells
set novisualbell
set t_vb= "close visual bell
"set foldmethod=marker
set tabstop=4
set shiftwidth=4
set nobackup
set nowritebackup
"set noswapfile
set smarttab
set smartindent
set autoindent
set cindent
set wrap
syntax on "highlight
syntax enable "for fold?
set autoread
set cmdheight=1
set showtabline=2
"set clipboard+=unnamed
set tabpagemax=20
set laststatus=2
"set statusline=\ [File]\ %F%m%r%h\ %w\ \ [PWD]\ %r%{CurrectDir()}%h\ \ %=[Line]\ %l,%c\ %=\ %P
"x#"function! CurrectDir()
" let curdir = substitute(getcwd(), "", "", "g")
" return curdir
"endfunction
if has("multi_byte")
set encoding=utf-8
set termencoding=utf-8
set formatoptions+=mM
set fencs=utf-8,gbk
if v:lang =~? '^\(zh\)\|\(ja\)\|\(ko\)'
set ambiwidth=double
endif
if has("win32")
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
language messages zh_CN.utf-8
endif
else
echoerr "Sorry, this version of (g)vim was not compiled with +multi_byte"
endif
if has("gui_running")
set guioptions=
colorscheme oceandeep
set cursorline
if has("win32")
set gfn=Raize
au GUIEnter * simalt ~x
else
set guifont=Raize\ 13
set guifontwide=WenQuanYi\ Bitmap\ Song\ 12
endif
else
colorscheme vylight
"colorscheme zellner
endif
" 2012-11-26 for omnicpp
set nocp
filetype plugin on
filetype plugin indent on
if has("autocmd")
filetype plugin indent on
augroup vimrcEx
au!
autocmd FileType text setlocal textwidth=78
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
augroup END
endif
" key stock
map tn :tabnext<cr>
map tp :tabprevious<cr>
map td :tabnew .<cr>
map te :tabedit
map tc :tabclose<cr>
map cs :!php -l %<cr>
map <F10> :VSTreeExplore<cr>
map <F11> :x<cr>
map <F12> :q!<cr>
" vim: set et sw=4 ts=4 sts=4 fdm=marker ff=unix fenc=utf8
"set for ctags
set tags=tags,/usr/local/Trolltech/Qt-4.6.3/include/qtx86tagscpp;
set autochdir
"end set ctags
"set for Tlist
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
"end set Tlist
"set for under line
set cursorline
"set for zz
set foldmethod=indent
"set foldlevel=1
let Tlist_Show_One_FIle=0
let Tlist_Exit_OnlyWindow=1
"map for omni
inoremap <expr> <CR> pumvisible()?"\<C-Y>":"\<CR>"
inoremap <expr> <C-J> pumvisible()?"\<C-N>\<C-P>\<PageDown>":"\<C-X><C-O>"
inoremap <expr> <C-K> pumvisible()?"\<C-P>\<C-N>\<PageUp>":"\<C-N><C-K>"
inoremap <expr> <C-U> pumvisible()?"\<C-E>":"\<C-U>"
set completeopt=longest,menu
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"cscope setting
""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if has("cscope")
set csprg=/usr/bin/cscope
set csto=1
set cst
set nocsverb
"add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
endif
set csverb
endif
nmap <C-@>s : cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>g : cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>c : cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>t : cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>e : cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>f : cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-@>i : cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-@>d : cs find d <C-R>=expand("<cword>")<CR><CR>
"2013-03-21
set incsearch
"high light when search
set hlsearch
set ignorecase
"powerline{
"set guifont=PowerlineSymbols\ for\ Powerline
"set nocompatible
"set t_Co=256
"let g:Powerline_symbols='fancy'
"}
"help doc chinese
set helplang=cn
" --------configuration for neocomplcache-------------
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplcache.
let g:neocomplcache_enable_at_startup = 1
" Use smartcase.
let g:neocomplcache_enable_smart_case = 1
" Use camel case completion.
let g:neocomplcache_enable_camel_case_completion = 1
" Use underbar completion.
let g:neocomplcache_enable_underbar_completion = 1
" Set minimum syntax keyword length.
let g:neocomplcache_min_syntax_length = 1
" set the max list in the popup menu. increase the speed
let g:neocomplcache_max_list=20
" Define keyword.
if !exists('g:neocomplcache_keyword_patterns')
let g:neocomplcache_keyword_patterns = {}
endif
let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
let g:neocomplcache_auto_completion_start_length=1
" ignore letter case
let g:neocomplcache_enable_ignore_case=1
" --------configuration for neocomplcache-------------
"set terminal 256 color
"set t_Co=256
"
"minibufexpl setting
let g:miniBufExplForceSyntaxEnable=1
let g:miniBufExplModSelTarget=1
"statusline setting
set laststatus=2 "2:总是显示状态栏 0:隐藏状态栏
let statusHead ="%-.50f\ %h%m%r"
let statusBreakPoint ="%<"
let statusSeparator ="|"
let statusFileType ="%{((&ft\ ==\ \"help\"\ \|\|\ &ft\ ==\ \"\")?\"\":\"[\".&ft.\"]\")}"
let statusFileFormat ="[%{(&ff\ ==\ \"unix\")?\"u\":\"d\"}]"
let statusAscii ="\{%b:0x%B\}"
let statusCwd ="%-.50{getcwd()}"
let statusBody =statusFileType.statusFileFormat.statusSeparator.statusAscii.statusSeparator."\ ".statusBreakPoint.statusCwd
let statusEncoding ="[%{(&fenc\ ==\ \"\"?&enc:&fenc).(&bomb?\",BOM\":\"\")}]"
let statusBlank ="%="
let statusKeymap ="%k"
let statusRuler ="%-12.(%lL,%c%VC%)\ %P"
let statusTime ="%{strftime(\"%Y/%m/%d\ -\ %H:%M\")}"
let statusEnd=statusKeymap."\ ".statusEncoding.statusRuler."\ ".statusTime
"" 最终状态栏的模式字符串
let statusString=statusHead.statusBody.statusBlank.statusEnd
set statusline=%!statusString
highlight StatusLine cterm=bold ctermfg=yellow ctermbg=black"状态栏颜色设置
" author: feelinglucky<i.feelinglucky@gmail.com>" website: http://www.gracecode.com" date: 2007-12-28set linebreakset textwidth=80set nocompatibleset history=400set rulerset numberset hlsearchset noincsearchset expandtabset noerrorbellsset novisualbellset t_vb= "close visual bell"set foldmethod=markerset tabstop=4set shiftwidth=4set nobackupset nowritebackup"set noswapfileset smarttabset smartindentset autoindentset cindentset wrapsyntax on "highlightsyntax enable "for fold?set autoreadset cmdheight=1set showtabline=2 "set clipboard+=unnamedset tabpagemax=20set laststatus=2"set statusline=\ [File]\ %F%m%r%h\ %w\ \ [PWD]\ %r%{CurrectDir()}%h\ \ %=[Line]\ %l,%c\ %=\ %P"x#"function! CurrectDir()" let curdir = substitute(getcwd(), "", "", "g")" return curdir"endfunctionif has("multi_byte") set encoding=utf-8 set termencoding=utf-8 set formatoptions+=mM set fencs=utf-8,gbk if v:lang =~? '^\(zh\)\|\(ja\)\|\(ko\)' set ambiwidth=double endif if has("win32") source $VIMRUNTIME/delmenu.vim source $VIMRUNTIME/menu.vim language messages zh_CN.utf-8 endif else echoerr "Sorry, this version of (g)vim was not compiled with +multi_byte"endifif has("gui_running") set guioptions= colorscheme oceandeep set cursorline if has("win32") set gfn=Raize au GUIEnter * simalt ~x else set guifont=Raize\ 13 set guifontwide=WenQuanYi\ Bitmap\ Song\ 12 endifelse colorscheme vylight "colorscheme zellnerendif" 2012-11-26 for omnicppset nocpfiletype plugin onfiletype plugin indent onif has("autocmd") filetype plugin indent on augroup vimrcEx au! autocmd FileType text setlocal textwidth=78 autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif augroup ENDendif" key stockmap tn :tabnext<cr>map tp :tabprevious<cr>map td :tabnew .<cr>map te :tabeditmap tc :tabclose<cr>map cs :!php -l %<cr>map <F10> :VSTreeExplore<cr>map <F11> :x<cr>map <F12> :q!<cr>" vim: set et sw=4 ts=4 sts=4 fdm=marker ff=unix fenc=utf8"set for ctagsset tags=tags,/usr/local/Trolltech/Qt-4.6.3/include/qtx86tagscpp;set autochdir"end set ctags"set for Tlistlet Tlist_Show_One_File=1let Tlist_Exit_OnlyWindow=1"end set Tlist"set for under lineset cursorline"set for zzset foldmethod=indent"set foldlevel=1let Tlist_Show_One_FIle=0let Tlist_Exit_OnlyWindow=1"map for omniinoremap <expr> <CR> pumvisible()?"\<C-Y>":"\<CR>"inoremap <expr> <C-J> pumvisible()?"\<C-N>\<C-P>\<PageDown>":"\<C-X><C-O>"inoremap <expr> <C-K> pumvisible()?"\<C-P>\<C-N>\<PageUp>":"\<C-N><C-K>"inoremap <expr> <C-U> pumvisible()?"\<C-E>":"\<C-U>"set completeopt=longest,menu"""""""""""""""""""""""""""""""""""""""""""""""""""""""""cscope setting""""""""""""""""""""""""""""""""""""""""""""""""""""""""if has("cscope") set csprg=/usr/bin/cscope set csto=1 set cst set nocsverb "add any database in current directory if filereadable("cscope.out") cs add cscope.out endif set csverbendifnmap <C-@>s : cs find s <C-R>=expand("<cword>")<CR><CR>nmap <C-@>g : cs find g <C-R>=expand("<cword>")<CR><CR>nmap <C-@>c : cs find c <C-R>=expand("<cword>")<CR><CR>nmap <C-@>t : cs find t <C-R>=expand("<cword>")<CR><CR>nmap <C-@>e : cs find e <C-R>=expand("<cword>")<CR><CR>nmap <C-@>f : cs find f <C-R>=expand("<cfile>")<CR><CR>nmap <C-@>i : cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>nmap <C-@>d : cs find d <C-R>=expand("<cword>")<CR><CR>"2013-03-21set incsearch"high light when searchset hlsearch set ignorecase"powerline{"set guifont=PowerlineSymbols\ for\ Powerline"set nocompatible"set t_Co=256"let g:Powerline_symbols='fancy'"}"help doc chineseset helplang=cn" --------configuration for neocomplcache-------------" Disable AutoComplPop.let g:acp_enableAtStartup = 0" Use neocomplcache.let g:neocomplcache_enable_at_startup = 1 " Use smartcase.let g:neocomplcache_enable_smart_case = 1" Use camel case completion.let g:neocomplcache_enable_camel_case_completion = 1" Use underbar completion.let g:neocomplcache_enable_underbar_completion = 1" Set minimum syntax keyword length.let g:neocomplcache_min_syntax_length = 1" set the max list in the popup menu. increase the speedlet g:neocomplcache_max_list=20" Define keyword.if !exists('g:neocomplcache_keyword_patterns') let g:neocomplcache_keyword_patterns = {}endiflet g:neocomplcache_keyword_patterns['default'] = '\h\w*'let g:neocomplcache_auto_completion_start_length=1" ignore letter caselet g:neocomplcache_enable_ignore_case=1" --------configuration for neocomplcache-------------"set terminal 256 color"set t_Co=256""minibufexpl settinglet g:miniBufExplForceSyntaxEnable=1let g:miniBufExplModSelTarget=1"statusline settingset laststatus=2 "2:总是显示状态栏 0:隐藏状态栏 let statusHead ="%-.50f\ %h%m%r" let statusBreakPoint ="%<" let statusSeparator ="|" let statusFileType ="%{((&ft\ ==\ \"help\"\ \|\|\ &ft\ ==\ \"\")?\"\":\"[\".&ft.\"]\")}" let statusFileFormat ="[%{(&ff\ ==\ \"unix\")?\"u\":\"d\"}]" let statusAscii ="\{%b:0x%B\}" let statusCwd ="%-.50{getcwd()}" let statusBody =statusFileType.statusFileFormat.statusSeparator.statusAscii.statusSeparator."\ ".statusBreakPoint.statusCwd let statusEncoding ="[%{(&fenc\ ==\ \"\"?&enc:&fenc).(&bomb?\",BOM\":\"\")}]" let statusBlank ="%=" let statusKeymap ="%k" let statusRuler ="%-12.(%lL,%c%VC%)\ %P" let statusTime ="%{strftime(\"%Y/%m/%d\ -\ %H:%M\")}" let statusEnd=statusKeymap."\ ".statusEncoding.statusRuler."\ ".statusTime "" 最终状态栏的模式字符串 let statusString=statusHead.statusBody.statusBlank.statusEnd set statusline=%!statusString highlight StatusLine cterm=bold ctermfg=yellow ctermbg=black"状态栏颜色设置
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"