[dachuan@dachuanvm branch-0.1-trace]$ cat ~/.vimrc
"for normal setting
set encoding=gb2312
syn on
set guifont=Luxi\ Mono\ 9
set tabstop=4
set shiftwidth=4
set autoindent
set backspace=2
set smartindent
set ai!
set nu!
set showmatch
set ruler
set incsearch
set vb t_vb=
syntax enable
syntax on
"colorscheme desert
"for taglist
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
"for winmanager
let g:winManagerWindowLayout='FileExplorer|TagList'
nmap wm :WMToggle<cr>
"for cscope
set cscopequickfix=s-,c-,d-,i-,t-,e-
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>
"for minibuffer
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
"for a: c/h
nnoremap <silent> <F12> :A<CR>
"for grep
nnoremap <silent> <F3> :Grep<CR>
"for omni-complete
"these two following lines are for c/c++ code completion only.
"and with ctrl+x ctrl+o support.
"no code completion for c/c++ without these two lines
"filetype plugin indent on
"set completeopt=longest,menu
"for supertab
"let g:SuperTabRetainCompletionType=2
"let g:SuperTabDefaultCompletionType="<C-X><C-O>"
"for javacomplete
" Only do this part when compiled with support for autocommands.
":if has("autocmd")
": autocmd Filetype java setlocal omnifunc=javacomplete#Complete
":endif
":setlocal completefunc=javacomplete#CompleteParamsInfo
"for vjde
":let g:vjde_completion_key='<c-space>'
"for vim ant
"autocmd BufRead *.java set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#
"autocmd BufRead set makeprg=ant\ -find\ build.xml
"for vim java src code. ctags
"this is for normal javaproject
"autocmd FileType java set tags=/home/dachuan/jdk1.6.0_18/.tags
"this is for branch-0.1-trace java project
:set tags=~/jdk1.6.0_18/.tags,~/branch-0.1-trace/.tags
"for vim java src code. cscope
"this is for branch-0.1-trace java project
:cs add ~/branch-0.1-trace/cscope.out ~/branch-0.1-trace
"for tab auto-completion, copy from web. http://blog.vinceliu.com/2008/12/tab-completion-for-vim-updated.html
" Modified tab completion. It works fine now.
My_TabComplete()
let line = getline('.') " curline
let substr = strpart(line, -1, col('.')+1) " from start to cursor
let substr = matchstr(substr, "[^ \t]*$") " word till cursor
if (strlen(substr)==0) " nothing to match on empty string
return "\<tab>"
endif
let bool = match(substr, '\.') " position of period, if any
if (bool==-1)
return "\<C-X>\<C-P>" " existing text matching
else
return "\<C-X>\<C-U>"
|