个人使用的vimrc的配置

set background=dark 
colorscheme monokai
"colorscheme desert 
"desert  " 设置主题方案
set number          " 显示行号  
"set cursorline      " 突出显示当前行  
set tabstop=4       " 设置tab键的宽度  
set backspace=2     " 设置退格键可用
set nocompatible

syntax on              " 打开语法高亮 
syntax enable
set cindent
set showmatch       " 设置匹配模式,类似当输入一个左括号时会匹配相应的那个右括号  
set smartindent     " 智能对齐方式  
set shiftwidth=4    " 换行时行间交错使用4个空格  
set autoindent      " 自动对齐  
set ai!             " 设置自动缩进  
filetype plugin indent on     " 开启插件  
set completeopt=longest,menu  
set magic

filetype on
filetype indent on
set history=50000
set showmatch
set ruler
set hlsearch
set ignorecase
set laststatus=2
set title
"
" ===============================================================================  
" Ctags
" ===============================================================================  
set tags=tags; 
set autochdir 
"
" ===============================================================================  
" TagList :Tlist  
" ===============================================================================  
   
let Tlist_Ctags_Cmd = 'ctags'
let Tlist_Use_Right_Window = 1         "在右侧窗口中显示taglist窗口
let Tlist_Show_One_File = 1            "不同时显示多个文件的tag,只显示当前文件的
let Tlist_Exit_OnlyWindow = 1          "如果taglist窗口是最后一个窗口,则退出vim
"let Tlist_Auto_Open = 1                 "设置taglist在vim启动的时候自动打开

" ===============================================================================  
" WinManager :WMToggle  
" ===============================================================================  
  
"let g:winManagerWindowLayout='FileExplorer|TagList'  
let g:winManagerWindowLayout='FileExplorer'
nmap wm :WMToggle:TlistToggle
  
" ===============================================================================  
" cscope  
" ===============================================================================  
  
" set quickfix
set cscopequickfix=s-,c-,d-,i-,t-,e-  

" use both cscope and ctag for 'ctrl-]', ':ta', and 'vim -t'
set cscopetag

" check cscope for definition of a symbol before checking ctags: set to 1
" if you want the reverse search order.
set csto=0

" add any cscope database in current directory
if filereadable("cscope.out")
	cs add cscope.out 
" else add the database pointed to by environment variable
elseif $CSCOPE_DB != ""
	cs add $CSCOPE_DB
endif

" show msg when any other cscope db added
set cscopeverbose  


" ===============================================================================  
" MiniBufExp  
" ===============================================================================  
  
let g:miniBufExplMapCTabSwitchBufs=1  
let g:miniBufExplMapWindowNavVim=1  
let g:miniBufExplMapWindowNavArrows=1  
let g:miniBufExplModSelTarget=1
let g:miniBufExplorerMoreThanOne=2
let g:miniBufExplCycleArround=1
let g:minibufExplMaxHeight=30
let g:minibufExplMinHeight=30
let g:minibufExplMaxSize=30
let g:minibufExplMinSize=30
  
" ===============================================================================  
" SuperTab :SuperTabHelp  
" ===============================================================================  
  
let g:SuperTabRetainCompletionType=2  
let g:SuperTabDefaultCompletionType=""  
  
" ===============================================================================  
" 热键映射  
" ===============================================================================  
"cscope插件热键 
nmap cs :cs find s =expand("") 
nmap cg :cs find g =expand("")  
nmap cc :cs find c =expand("")  
nmap cd :cs find d =expand("")  
nmap ct :cs find t =expand("")  
nmap ce :cs find e =expand("")  
nmap cf :cs find f =expand("")  
nmap ci :cs find i ^=expand("")  



"F5执行编译MAKE
map  :w:make
map  :make clean

"F6打开quickfix
"nmap  :cw
nmap  :botright copen

"Ctrl+F6关闭quickfix
nmap  :ccl

"F7向后选择quickfix
nmap  :cn

"F8向前选择quickfix
nmap  :cp

"F9头文件与源文件切换  
map  :A

"F10打开/关闭taglist
nmap  :TlistToggle

"F12生成/更新tags文件 
function! UpdateTagsFile() 
	silent !ctags -R 
endfunction 
nmap  :call UpdateTagsFile() 
     
"Ctrl+F12删除tags文件 
function! DeleteTagsFile() 
	silent !rm tags 
endfunction 
nmap  :call DeleteTagsFile()

"status line
set statusline=[%F]%y%r%m%*%=[Line:%l/%L,Column:%c][%p%%]

个人使用的vimrc的配置_第1张图片

你可能感兴趣的:(vim配置,vimrc)