VIM配置
给函数配色
修改syntax/c.vim文件
方法一
"highlight Functions
syn match cFunctions "\<[a-zA-Z_][a-zA-Z_0-9]*\>[^()]*)("me=e-2
syn match cFunctions "\<[a-zA-Z_][a-zA-Z_0-9]*\>\s*("me=e-1
hi cFunctions guifg=green cterm=bold ctermfg=yellow
syn match cClass "\<[a-zA-Z_][a-zA-Z_0-9]*\>::"me=e-2
hi cClass guifg=green cterm=bold ctermfg=yellow
方法二
"highlight Functions
syn match cFuntions display "[a-zA-Z_]\{-1,}\s\{-0,}(\{1}"ms=s,me=e-1
hi def link cFuntions Function
vimrc配置文件
"去掉有关vi一致性模式,避免以前版本的一些bug和局限
set nocompatible
"配色方案
colo desert
"开启语法高亮
syntax on
"设置行号
set number
"字体
set guifont=Consolas:h12:cANSI
"文件保存编码
set fileencoding=utf-8
"文件打开时使用的编码
set fileencodings=utf-8,gb2312,gbk,gb18030,cp93
"配置tab键为4个空格
set ts=4
set expandtab
%retab!
"设置缩进的空格为4
set shiftwidth=4
"开启自动换行
set wrap
"设置自动缩进:即每行的缩进值与上一行相等
set autoindent
"设置智能缩进
set smartindent
"开启匹配模式(左右符号匹配)
set showmatch
"设置C/C++语言的具体缩进方式
set cindent
"indent: 如果用了:set indent,:set ai 等自动缩进,想用退格键将字段缩进的删掉,必须设置这个选项。否则不响应。
"eol:如果插入模式下在行开头,想通过退格键合并两行,需要设置eol。
"start:要想删除此次插入前的输入,需设置这个
set backspace=indent,eol,start
插件配置
"配置winManager插件
"let g:winManagerWindowLayout='FileExplorer|TagList'
"nmap <F3> :WMToggle<cr>
" 设置NerdTree,和winManager功能相近
map <F3> :NERDTreeMirror<CR>
map <F3> :NERDTreeToggle<CR>
"配置srcexpl
" // The switch of the Source Explorer
nmap <F4> :SrcExplToggle<CR>
" // Set the height of Source Explorer window
let g:SrcExpl_winHeight = 8
" // Set 100 ms for refreshing the Source Explorer
let g:SrcExpl_refreshTime = 100
" // Set "Enter" key to jump into the exact definition context
let g:SrcExpl_jumpKey = "<ENTER>"
" // Set "Space" key for back from the definition context
let g:SrcExpl_gobackKey = "<SPACE>"
" // In order to Avoid conflicts, the Source Explorer should know what plugins
" // are using buffers. And you need add their bufname into the list below
" // according to the command ":buffers!"
let g:SrcExpl_pluginList = [
\ "__Tag_List__",
\ "_NERD_tree_",
\ "Source_Explorer"
\ ]
" // Enable/Disable the local definition searching, and note that this is not
" // guaranteed to work, the Source Explorer doesn't check the syntax for now.
" // It only searches for a match with the keyword according to command 'gd'
let g:SrcExpl_searchLocalDef = 1
" // Do not let the Source Explorer update the tags file when opening
let g:SrcExpl_isUpdateTags = 0
" // Use 'Exuberant Ctags' with '--sort=foldcase -R .' or '-L cscope.files' to
" // create/update a tags file
let g:SrcExpl_updateTagsCmd = "ctags --sort=foldcase -R ."
" // Set "<F12>" key for updating the tags file artificially
let g:SrcExpl_updateTagsKey = "<F12>"
"配置srcexpl结束
配置IDE
手把手教你把Vim改装成一个IDE编程环境

浙公网安备 33010602011771号