Last active
December 4, 2018 01:56
-
-
Save usbuild/21fd99f6341ef1db9758 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
filetype off | |
set nu | |
colo desert | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Bundle 'gmarik/vundle' | |
Bundle 'tpope/vim-fugitive' | |
Bundle 'Lokaltog/vim-easymotion' | |
"Bundle 'rstacruz/sparkup', {'rtp': 'vim/'} | |
"Bundle 'tpope/vim-rails.git' | |
" vim-scripts repos | |
Bundle 'L9' | |
Bundle 'FuzzyFinder' | |
Bundle 'Emmet.vim' | |
Bundle 'SirVer/ultisnips' | |
Bundle 'snipMate' | |
Bundle 'mattn/emmet-vim' | |
"Bundle 'fholgado/minibufexpl.vim' | |
Bundle 'a.vim' | |
Bundle 'vcscommand.vim' | |
"Bundle 'taglist.vim' | |
Bundle 'scrooloose/nerdtree' | |
"Bundle 'OmniCppComplete' | |
Bundle 'AutoComplPop' | |
Bundle 'corntrace/bufexplorer' | |
Bundle 'scrooloose/nerdcommenter' | |
Bundle 'tpope/vim-surround' | |
Bundle 'kien/ctrlp.vim' | |
Bundle 'altercation/vim-colors-solarized' | |
"Bundle 'Shougo/neocomplete.vim' | |
"Bundle 'Rip-Rip/clang_complete' | |
Bundle 'DrawIt' | |
Bundle 'majutsushi/tagbar' | |
Bundle 'godlygeek/tabular' | |
Bundle 'milkypostman/vim-togglelist' | |
"Bundle 'echofunc.vim' | |
"Bundle 'Lokaltog/powerline' | |
"Bundle 'Lokaltog/vim-powerline' | |
"Bundle 'scrooloose/syntastic' | |
"Bundle 'Valloric/YouCompletee' | |
" non-GitHub repos | |
"Bundle 'git://git.wincent.com/command-t.git' | |
" Git repos on your local machine (i.e. when working on your own plugin) | |
"Bundle 'file:///Users/gmarik/path/to/plugin' | |
Bundle 'uarun/vim-protobuf' | |
Bundle 'Chiel92/vim-autoformat' | |
Bundle 'hynek/vim-python-pep8-indent' | |
Bundle 'terryma/vim-multiple-cursors' | |
Bundle 'DoxygenToolkit.vim' | |
Bundle 'rhysd/vim-clang-format' | |
"Bundle 'xolox/vim-misc' | |
"Bundle 'xolox/vim-lua-ftplugin' | |
" | |
" ... | |
call vundle#end() | |
filetype plugin indent on " required! | |
" | |
" Brief help | |
" vim +BundleInstall +qall | |
" :BundleList - list configured bundles | |
" :BundleInstall(!) - install (update) bundles | |
" :BundleSearch(!) foo - search (or refresh cache first) for foo | |
" :BundleClean(!) - confirm (or auto-approve) removal of unused bundles | |
" | |
" see :h vundle for more details or wiki for FAQ | |
" NOTE: comments after Bundle commands are not allowed. | |
" | |
"set fileencodings=ucs-bom,utf-8,chinese | |
filetype plugin on | |
set shellslash | |
set grepprg=grep\ -nH\ $* | |
set nu | |
syn on | |
set helplang=cn | |
set wildmode=longest,list,full | |
set wildmenu | |
"set encoding=gbk | |
"set fileencoding=gbk | |
"colo elflord | |
highlight PmenuSel ctermfg=220 | |
let s:extfname = expand("%:e") | |
if s:extfname ==? "f90" | |
let fortran_free_source=1 | |
unlet! fortran_fixed_source | |
else | |
let fortran_fixed_source=1 | |
unlet! fortran_free_source | |
endif | |
let fortran_more_precise=1 | |
let fortran_do_enddo=1 | |
let fortran_have_tabs=1 | |
let fortran_fold=1 | |
let fortran_fold_conditionals=1 | |
set foldmethod=marker | |
set t_ut= | |
set tabstop=2 | |
set shiftwidth=2 | |
set ai | |
set expandtab | |
set hlsearch | |
set nobackup | |
"set guifont=Consolas:h12 | |
"set guifont=onaco:h12 | |
set guioptions-=Tm | |
set backspace=indent,eol,start | |
set cin | |
set cino=:0g0t0(sus | |
set ambiwidth=double | |
set smarttab | |
set lbr | |
set fo+=mB | |
set helplang=cn | |
set tags+=/home/qichao.zqc/workspace/tags/tags | |
set autochdir | |
set completeopt=longest,menuone | |
let OmniCpp_ayCompleteDot = 1 | |
let OmniCpp_ayCompleteArrow = 1 | |
let OmniCpp_ayCompleteScope = 1 | |
let OmniCpp_SelectFirstItem = 2 | |
let OmniCpp_NamespaceSearch = 2 | |
let OmniCpp_ShowPrototypeInAbbr = 1 | |
let OmniCpp_GlobalScopeSearch=1 | |
let OmniCpp_Displayode=1 | |
let OmniCpp_DefaultNamespaces=["std"] | |
set ofu=syntaxcomplete | |
"let Tlist_Ctags_Cmd='/usr/bin/etags.ctags' | |
let Tlist_Use_Right_Window=0 | |
let Tlist_Show_One_File=0 | |
let Tlist_File_Fold_Auto_Close=1 | |
let Tlist_Exit_OnlyWindow=1 | |
let Tlist_Process_File_Always=0 | |
let Tlist_Inc_Winwidth=0 | |
let g:user_zen_settings = { | |
\ 'indentation' : ' ', | |
\ 'perl' : { | |
\ 'aliases' : { | |
\ 'req' : 'require ' | |
\ }, | |
\ 'snippets' : { | |
\ 'use' : "use strict\nuse warnings\n\n", | |
\ 'warn' : "warn \"|\";", | |
\ } | |
\ } | |
\} | |
let g:user_zen_expandabbr_key = '<c-Tab>' | |
let g:use_zen_complete_tag = 1 | |
if has("cscope") | |
set csprg=/usr/bin/cscope | |
set csto=1 | |
set nocsverb | |
"if filereadable("cscope.out") | |
" cs add cscope.out | |
"endif | |
if filereadable("/home/qichao.zqc/workspace/tags/cscope.out") | |
cs add /home/qichao.zqc/workspace/tags/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> | |
":py import sys; import os; sys.path.append(os.path.expanduser('~/.vim/pyscript/')); import myvim | |
"Show the Subversion 'blame' annotation for the current file, in a narrow | |
" window to the left of it. | |
"Usage: | |
" 'gb' or ':Blame' | |
" To get rid of it, close or delete the annotation buffer. | |
"Bugs: | |
" If the source file buffer has unsaved changes, these aren't noticed and | |
" the annotations won't align properly. Should either warn or preferably | |
" annotate the actual buffer contents rather than the last saved version. | |
" When annotating the same source file again, it creates a new annotation | |
" buffer. It should re-use the existing one if it still exists. | |
"Possible enhancements: | |
" When invoked on a revnum in a Blame window, re-blame same file up to the | |
" previous revision. | |
" Dynamically synchronize when edits are made to the source file. | |
:function s:svnBlame() | |
let line = line(".") | |
setlocal nowrap | |
" create a new window at the left-hand side | |
aboveleft 18vnew | |
" blame, ignoring white space changes | |
%!svn blame -x-w "#" | |
setlocal nomodified readonly buftype=nofile nowrap winwidth=1 | |
setlocal nonumber | |
if has('&relativenumber') | setlocal norelativenumber | endif | |
" return to original line | |
exec "normal " . line . "G" | |
" synchronize scrolling, and return to original window | |
setlocal scrollbind | |
wincmd p | |
setlocal scrollbind | |
syncbind | |
:endfunction | |
:command Blame call s:svnBlame() | |
:function s:tbRetError() | |
let cur_expr = substitute(getline('.'), '^\s*\(.\{-}\)\s*$', '\1', '') | |
let tbret_pat = 'if (OB_SUCCESS != (ret = ' . cur_expr . '))' | |
call setline('.', tbret_pat) | |
call append('.', '{') | |
normal! j | |
call append('.', 'TBSYS_LOG(WARN, " ret=%d", ret);') | |
normal! j | |
call append('.', '}') | |
normal! 3k | |
normal! =4j | |
normal j | |
:endfunction | |
:map ge :call <SID>tbRetError()<CR> | |
" quickfix | |
function! s:redir(cmd) | |
redir => res | |
execute a:cmd | |
redir END | |
return res | |
endfunction | |
let g:miniBufExplapWindowNavVim = 1 | |
let g:miniBufExplapWindowNavArrows = 1 | |
let g:miniBufExplapCTabSwitchBufs = 1 | |
let g:miniBufExplodSelTarget = 1 | |
nnoremap <leader>ff :CtrlP $GTDIR<CR> | |
nnoremap <leader>fb :CtrlPBuffer<CR> | |
let g:ctrlp_map = '<C-k>' | |
:map gb :ls<CR>:buffer<SPACE> | |
nmap <leader>ee :silent! NERDTreeToggle<cr> | |
map <leader>er :silent! TagbarToggle<CR> | |
nmap <script> <silent> <leader>eq :call ToggleQuickfixList()<CR> | |
set pastetoggle=<F10> | |
let g:clang_library_path='/usr/lib/llvm-3.5/lib/' | |
let g:ctrlp_use_caching = 1 | |
let g:ctrlp_clear_cache_on_exit = 0 | |
"let g:syntastic_check_on_open = 1 | |
"let g:syntastic_enable_signs = 1 " Put errors on left side | |
"let g:syntastic_auto_loc_list = 2 " Only show errors when I ask | |
"let g:syntastic_disabled_filetypes = ['html', 'js'] | |
"let g:syntastic_cpp_check_header = 1 | |
"let g:syntastic_cpp_no_include_search = 1 | |
"let g:syntastic_cpp_compiler='clang++' | |
"let g:syntastic_cpp_compiler_options = ' -I/home/qichao.zqc/workspace/oceanbase/dev/oceanbase' | |
let g:clang_auto_select=1 | |
let g:clang_hl_errors=1 | |
let g:clang_complete_macros=1 | |
let g:clang_snippets = 1 | |
let g:clang_snippets_engine = 'ultisnips' | |
":map gc :call g:ClangUpdateQuickFix()<CR> | |
let g:clang_user_options = "-I /usr/lib/llvm-3.5/include/" | |
let g:clang_complete_auto = 0 | |
let g:UltiSnipsExpandTrigger = "<C-e>" | |
set wildignore+=*.so,*.swp,*.zip " acOSX/Linux | |
let g:ctrlp_custom_ignore = { | |
\ 'dir': '\v[\/]\.(git|hg|svn)$', | |
\ 'file': '\v\.(exe|so|dll|o|a)$', | |
\ } | |
highlight BackSpace ctermbg=5 ctermfg=white guibg=#592929 | |
match BackSpace /\ \+$/ | |
au BufNewFile,BufRead *.def set filetype=xml | |
let g:Easyotion_use_upper = 1 | |
:set makeprg=[[\ -f\ Makefile\ ]]\ &&\ make\ \\\|\\\|\ make\ -C\ .. | |
let g:multi_cursor_use_default_mapping=0 | |
"You can then map the 'next', 'previous', 'skip', and 'exit' keys like the following: | |
let g:multi_cursor_next_key='<C-j>' | |
let g:multi_cursor_prev_key='<C-h>' | |
let g:multi_cursor_skip_key='<C-x>' | |
let g:multi_cursor_quit_key='<Esc>' | |
set selection=inclusive | |
setlocal cindent cino=j1,(0,ws,Ws |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment