VIM搭建IDE开发环境 ---.vimrc配置文件参考

先是引用别人的.vimrc文件配置内容,说明的比较详细,而且有解释:

"
" my vim configuration
"
" 关闭compatible
set nocompatible
" 开启语法高亮
syntax on
" 设置文字编码自动识别
set fencs=gbk,utf-8,ucs-bom,gb18030,gb2312,cp936
" 使用鼠标
set mouse=a
" 设置高亮搜索
set hlsearch
" 输入字符串就显示匹配点
set incsearch
" 输入的命令显示出来,看的清楚些。
set showcmd

set background=dark

set history=50 "历史记录50条
filetype plugin indent on "打开文件类型检测
set completeopt=longest,menu "关闭智能补全时的预览窗口
"颜色方案
colorscheme bandit "desert颜色方案

"界面设置.
set ruler "显示当前位置
set number "显示行号
"set nonumber "不显示行号

"格式设置.
set autoindent "自动缩进
set smartindent "智能缩进
set cindent "C缩进
set tabstop=4 "硬TAB
set softtabstop=4 "软TAB
set shiftwidth=4 "缩进空格数
set expandtab "空格替换TAB
"set smarttab "智能TAB

set tags=tags; "ctags
set autochdir "ctags

" TagList"
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1

" BufExplorer"
let g:bufExplorerDefaultHelp=0
let g:bufExplorerShowRelativePath=1
let g:bufExplorerSortBy='mru'
let g:bufExplorerSplitRight=0
let g:bufExplorerSplitVertical=1
let g:bufExplorerSplitVertSize = 30
autocmd BufWinEnter /[Buf/ List/] setl nonumber

" winManager setting"
let g:winManagerWindowLayout = "FileExplorer,BufExplorer|TagList"
let g:winManagerWidth = 30
let g:defaultExplorer = 0
nmap <C-W><C-F> :FirstExplorerWindow<cr>
nmap <C-W><C-B> :BottomExplorerWindow<cr>
nmap <silent> <leader>wm :WMToggle<cr>
nmap <silent> <leader>wu :wa<cr>:TlistUpdate<cr>:FirstExplorerWindow<cr>

" lookupfile setting"
let g:LookupFile_MinPatLength = 2
let g:LookupFile_PreserveLastPattern = 0
let g:LookupFile_PreservePatternHistory = 1
let g:LookupFile_AlwaysAcceptFirst = 1
let g:LookupFile_AllowNewFiles = 0
if filereadable("./filenametags") 
let g:LookupFile_TagExpr = '"./filenametags"'
endif
nmap <silent> <leader>lk :LUTags<cr>
nmap <silent> <leader>ll :LUBufs<cr>
nmap <silent> <leader>lw :LUWalk<cr>

" cscope setting"
set cscopequickfix=s-,c-,d-,i-,t-,e-
nmap <F6>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <F6>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <F6>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <F6>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <F6>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <F6>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <F6>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <F6>d :cs find d <C-R>=expand("<cword>")<CR><CR> 

" 代码折叠
set foldmethod=syntax
set foldlevel=100 " 启动 vim 时不要自动折叠代码

" superTab
let g:SuperTabRetainCompletionType=2
let g:SuperTabDefaultCompletionType="<C-X><C-O>"

" ctags_highlighting
let b:TypesFileRecurse = 1
let b:TypesFileDoNotGenerateTags = 1
let b:TypesFileIncludeLocals = 1
"let b:TypesFileIncludeSynMatches =1
"let b:TypesFileLanguages = ['c']

" Fn 快捷键
" F5 - LookUpFile, F6 - cscope
nnoremap <silent> <F7> :WMToggle<CR>  “(
注意冒号前面需要有个空格奥
nnoremap <silent> <F8> :A<CR>

你可能感兴趣的:(vim)