VIM配置

"********************************************************  
"                   一般性配置                          *  
"********************************************************
"關閉vim一致性原則  
set nocompatible  

"搜索高亮
set hlsearch

"顯示行號  
set number  
   
"設置在編輯過程中右下角顯示光標的行列信息  
set ruler  
   
"在狀態欄顯示正在輸入的命令  
set showcmd  
   
"設置歷史記錄條數  
set history=1000  
   
"設置取消備份 禁止臨時文件的生成  
set nobackup  
set noswapfile  
   
"設置匹配模式  
set showmatch  
   
"設置C/C++方式自動對齊  
set autoindent  
set cindent  
   
"開啓語法高亮功能  
syntax enable  
syntax on  
   
"指定配色方案爲256色  
set t_Co=256  
   
"設置搜索時忽略大小寫  
set ignorecase  
   
"配置backspace的工作方式  
set backspace=indent,eol,start  
   
"設置在vim中可以使用鼠標  
set mouse=a  
   
"設置tab寬度  
set tabstop=4  
   
"設置自動對齊空格數  
set shiftwidth=4  
   
"設置退格鍵時可以刪除4個空格  
set smarttab  
set softtabstop=4  
   
"將tab鍵自動轉換爲空格  
set expandtab  
   
"設置編碼方式  
set encoding=utf-8  
   
"自動判斷編碼時 依次嘗試以下編碼  
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936

"屏幕編碼
set termencoding=utf-8

"檢測文件類型  
filetype on  
   
"針對不同的文件採取不同的縮進方式  
filetype indent on  
   
"允許插件  
filetype plugin on  
   
"啓動智能補全  
filetype plugin indent on  

"設置顏色方案
colorscheme ron

"設置當前行橫線
set cursorline

"保存上次打開位置
if has("autocmd")
      au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif

"*********************************************************  
"                  vundle 配置                           *  
"*********************************************************  
   
set rtp+=~/.vim/bundle/vundle/  
call vundle#rc()  
   
" let Vundle manage Vundle  
Bundle 'gmarik/vundle'  
    
" My Bundles here:  
   
Bundle 'tpope/vim-fugitive'  
Bundle 'Lokaltog/vim-easymotion'  
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}  
Bundle 'tpope/vim-rails.git'  
Bundle 'taglist.vim'  
Bundle 'The-NERD-tree'  
Bundle 'Syntastic'  
Bundle 'L9'  
Bundle 'FuzzyFinder'  
Bundle 'Lokaltog/vim-powerline'  
Bundle 'Valloric/YouCompleteMe'   

"*****************************************************  
"                   taglist配置                      *  
"*****************************************************  
   
"不顯示"press F1 to display help"  
let Tlist_Compact_Format=1  
   
"窗口在左側顯示  
let Tlist_Use_Right_Window=1  
   
"只顯示當前文件的tags  
let Tlist_Show_One_File=1    
   
"高亮顯示  
let Tlist_Auto_Highlight_tag=1  
   
"隨文件自動更新  
let Tlist_Auto_Update=1  
   
"設置寬度  
let Tlist_WinWidth=30         
   
"taglist窗口是最後一個窗口,則退出vim  
let Tlist_Exit_OnlyWindow=1   
   
"單擊跳轉  
let Tlist_Use_SingClick=1  
   
"打開關閉快捷鍵  
nnoremap <silent> <F8> :TlistToggle<CR>  

"********************************************************  
"                      NERD_Tree 配置                   *  
"********************************************************  
   
"顯示增強  
let NERDChristmasTree=1  
   
"自動調整焦點  
let NERDTreeAutoCenter=1  
   
"鼠標模式:目錄單擊,文件雙擊  
let NERDTreeMouseMode=2  
   
"打開文件後自動關閉  
let NERDTreeQuitOnOpen=1  
   
"顯示文件  
let NERDTreeShowFiles=1  
   
"顯示隱藏文件  
let NERDTreeShowHidden=1  
   
"高亮顯示當前文件或目錄  
let NERDTreeHightCursorline=1  
   
"顯示行號  
let NERDTreeShowLineNumbers=1  
   
"窗口位置  
let NERDTreeWinPos='left'  
   
"窗口寬度  
let NERDTreeWinSize=31  
   
"不顯示'Bookmarks' label 'Press ? for help'  
let NERDTreeMinimalUI=1  
   
"快捷鍵  
nnoremap <silent> <F4> :NERDTreeToggle<CR>  

let NERDTreeQuitOnOpen=0
 
"*****************************************************  
"           YouCompleteMe配置                        *  
"*****************************************************  
   
"leader映射爲逗號“,”  
let mapleader = ","    
   
"配置默認的ycm_extra_conf.py  
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'   

"按,jd 會跳轉到定義  
"nnoremap <leader>jd :YcmCompleter GoToDefinitionElseDeclaration<CR>     
nnoremap gt :YcmCompleter GoToDefinitionElseDeclaration<CR>     
   
"打開vim時不再詢問是否加載ycm_extra_conf.py配置  
let g:ycm_confirm_extra_conf=0     
   
"使用ctags生成的tags文件  
let g:ycm_collect_identifiers_from_tag_files = 1   

"*****************************************************  
"           Syntastic配置                            *  
"*****************************************************  
let g:Syntastic_check_on_open=1 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章