" 語法高亮
syntax onhtml
" 搜索高亮
set hlsearchnode
" 顯示行號
set number"python
let mapleader=","git
set pastetoggle=<F10>github
set backspace=indent,eol,startvim
" 基本縮進效果
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set autoindentapi
let g:ycm_server_python_interpreter='/usr/bin/python'
let g:ycm_global_ycm_extra_conf='/home/jyb/.vim/.ycm_extra_conf.py'
let g:ycm_enable_diagnostic_highlighting = 0app
set nocompatible " be iMproved, required........
filetype off " requiredsvn
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')字體
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" Plugin 'Valloric/YouCompleteMe'
Bundle 'ctrlpvim/ctrlp.vim'
Bundle 'taglist.vim'
Plugin 'easymotion/vim-easymotion'
Plugin 'jiangmiao/auto-pairs'
Plugin 'git://github.com/scrooloose/nerdtree.git'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
"Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
"Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
"Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
"Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"摺疊設置"
let xml_syntax_folding=1 " XML fold
"set foldmethod=syntax
set foldlevelstart=1
" 用空格鍵來開關摺疊
nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>
" Command-line mode
" set mouse=a 啓動全部模式,會屏蔽鼠標右鍵功能
set mouse=c
"ctrlp 配置
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
map <c-k> :CtrlPMRUFiles<CR>
let g:ctrlp_tabpage_position = 'ac'
let g:ctrlp_extensions = ['tag']
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_working_path_mode = 0
let g:ctrlp_use_caching = 1
let g:ctrlp_clear_cache_on_exit = 0
let g:ctrlp_mruf_max = 250
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.rc,*.aps,*.vcproj.*,/home/shuaijun/se/SimulationEngine_Rapid/tinyxml/*
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.hg$\|\.svn$\|\.yardoc\|public\/images\|public\/system\|data\|log\|tmp$\|node_modules\|vendor',
\ 'file': '\.exe$\|\.so$\|\.dat$'
\ }
"nerdtree配置
" 設置<F5> 關閉打開NerdTree
map <F5> :NERDTreeMirror<CR>
map <F5> :NERDTreeToggle<CR>
" " 顯示行號
let NERDTreeShowLineNumbers=1
let NERDTreeAutoCenter=1
" 是否顯示隱藏文件
let NERDTreeShowHidden=1
" 設置寬度
let NERDTreeWinSize=31
" 在終端啓動vim時,共享NERDTree
let g:nerdtree_tabs_open_on_console_startup=1
" 忽略一下文件的顯示
let NERDTreeIgnore=['\.pyc','\~$','\.swp']
" 顯示書籤列表
let NERDTreeShowBookmarks=1
" 窗口位置
let g:NERDTreeWinPos="right"
"cscope自動更新
function! UpdateCscope()
let db = findfile("cscope.out", ".;")
if (!empty(db))
let oldpath = getcwd()
let path = strpart(db, 0, match(db, "/cscope.out$"))
if (!empty(path))
exe "cd " . path
endif
"!cscope -Rbq
!find -name "*.[ch]" -o -name "*.cpp" > cscope.files
!cscope -bR -i cscope.files
exe "cd " . oldpath
endif
endfunction
au VimEnter * silent! call UpdateCscope()
" auto load cscope file [start]
function! LoadCscope()
set cst
set csto=0
set nocsverb
let db = findfile("cscope.out", ".;")
if (!empty(db))
let path = strpart(db, 0, match(db, "/cscope.out$"))
set nocscopeverbose " suppress 'duplicate connection' error
exe "cs add " . db . " " . path
set cscopeverbose
" else add the database pointed to by environment variable
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
endfunction
au BufEnter /* call LoadCscope()
" auto load cscope file [end]
" 基於縮進或語法進行代碼摺疊
"set foldmethod=indent
set foldmethod=syntax
" 啓動vim時關閉摺疊代碼
set nofoldenable
" 配置vim-airline 開始
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#formatter = 'default'
let g:airline_theme='dark'
let g:airline_powerline_fonts = 1
let g:airline_highlighting_cache = 1
let Tlist_Auto_Open=1
let g:airline_powerline_fonts = 1
"打開tabline功能,方便查看Buffer和切換,省去了minibufexpl插件 let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#buffer_nr_show = 1 "設置切換Buffer快捷鍵" nnoremap <C-tab> :bn<CR> nnoremap <C-s-tab> :bp<CR> " 關閉狀態顯示空白符號計數
let g:airline#extensions#whitespace#enabled = 0
let g:airline#extensions#whitespace#symbol = '!'
" 設置consolas字體"前面已經設置過
"set guifont=Consolas\ for\ Powerline\ FixedD:h11 if !exists('g:airline_symbols') let g:airline_symbols = {} endif " old vim-powerline symbols
let g:airline_left_sep = '⮀'
let g:airline_left_alt_sep = '⮁'
let g:airline_right_sep = '⮂'
let g:airline_right_alt_sep = '⮃'
set t_Co=256
" taglist配置" 只顯示當前文件的tagslet Tlist_Show_One_File=1" 設置taglist寬度let Tlist_WinWidth=40" tagList窗口是最後一個窗口,則退出Vimlet Tlist_Exit_OnlyWindow=1" 讓taglist窗口出如今Vim的左邊邊let Tlist_Use_Left_Window=1 " 當同時顯示多個文件中的tag時,設置爲1,可以使taglist只顯示當前文件tag,其它文件的tag都被摺疊起來。let Tlist_File_Fold_Auto_Close=1 map <F6> :Tlist<CR>