" common
"source /etc/vim/vimrc
"source /home/duoc/.cscope.vim
syntax on
syntax enable
set ai "自动缩进
set bs=2 "在insert模式下用退格键删除
set showmatch "代码匹配
set laststatus=2 "总是显示状态行
set expandtab "以下三个配置配合使用,设置tab和缩进空格数
set shiftwidth=4
set tabstop=4
set cursorline "为光标所在行加下划线
set number "显示行号
set autoread "文件在Vim之外修改过,自动重新读入
set ignorecase "检索时忽略大小写
set fileencodings=utf-8,gbk "使用utf-8或gbk打开文件
set hls "检索时高亮显示匹配项
set helplang=cn "帮助系统设置为中文
set foldmethod=syntax "代码折叠
let mapleader=","
if exists('+colorcolumn')
set colorcolumn=80
else
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
endif
let g:molokai_original = 1
let g:rehash256 = 1
set background=dark
" vundle
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here:
"
" original repos on github
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
" Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" Bundle 'tpope/vim-rails.git'
Bundle 'Valloric/YouCompleteMe'
Bundle 'scrooloose/nerdtree'
Bundle 'majutsushi/tagbar'
Bundle 'scrooloose/syntastic'
Bundle 'SirVer/ultisnips'
Bundle 'tomtom/tcomment_vim'
Bundle 'bling/vim-airline'
Bundle 'Lokaltog/powerline-fonts'
Bundle 'vim-scripts/DoxygenToolkit.vim'
Bundle 'junegunn/vim-easy-align'
Bundle 'tomasr/molokai'
Bundle 'techlivezheng/vim-plugin-minibufexpl'
" vim-scripts repos
Bundle 'L9'
Bundle 'FuzzyFinder'
" non github repos
" Bundle 'git://git.wincent.com/command-t.git'
" git repos on your local machine (ie. when working on your own plugin)
" Bundle 'file:///Users/gmarik/path/to/plugin'
" ...
filetype plugin indent on " required!
"
" Brief help
" :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 command are not allowed..
"YouCompleteMe
let g:ycm_confirm_extra_conf=0
let g:ycm_key_list_select_completion = ['<C-j>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-k>', '<Up>']
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>
" nerdtree
map <F7> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
"autocmd BufEnter * NERDTreeMirror
" emmet-vim
Plugin 'mattn/emmet-vim'
let g:user_emmet_expandabbr_key = '<C-E>'
" tagbar
nnoremap <silent> <F8> :TagbarToggle<CR>
" syntastic
let g:syntastic_always_populate_loc_list=1
let g:syntastic_check_on_open=1
nnoremap <silent> <C-d> :lclose<CR>:bdelete<CR>
cabbrev <silent> bd lclose\|bdelete
" UltiSnips
let g:UltiSnipsExpandTriger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
" powerline fonts
set guifont="~/.vim/bundle/powerline-fonts/DejaVuSansMono/DejaVu Sans Mono Bold for Powerline.ttf"
" easy-align
vnoremap <silent> <Enter> :EasyAlign<Enter>
" MiniBufExpl Colors
hi MBENormal guifg=#808080 guibg=fg
hi MBEChanged guifg=#CD5907 guibg=fg
hi MBEVisibleNormal guifg=#5DC2D6 guibg=fg
hi MBEVisibleChanged guifg=#F1266F guibg=fg
hi MBEVisibleActiveNormal guifg=#A6DB29 guibg=fg
hi MBEVisibleActiveChanged guifg=#F1266F guibg=fg
浙公网安备 33010602011771号