Mac环境vim+cscope+taglist

本文介绍了在Mac环境下如何通过Homebrew安装vim、cscope和ctags,并提供了.vimrc配置文件的示例,包括启用语法高亮、设置缩进和开启taglist自动打开等特性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. Install software.

$brew install vim

$brew install cscope

$brew install ctags


2. ~/.vimrc

syntax on

filetype on


set ru


set backspace=indent,eol,start

set whichwrap=b,s,<,>,[,]



set nocompatible

set number

set history=1000

set background=dark


set autoindent

set smartindent


set expandtab

set tabstop=4

set shiftwidth=4


set showmatch

set guioptions-=T

set vb t_vb=

set ruler

set nohls

set cindent

set incsearch


let Tlist_Auto_Open=1

let Tlist_Show_One_File=1

let Tlist_Exit_OnlyWindow=1

colorscheme evening


3. cscope+taglist

    taglist 的下载地址:
    http://www.vim.org/scripts/script.php?script_id=273

    cscope_maps.vim的下载地址:

   将下载解压后的文件cppcomplete.vim,taglist.vim和cscope_maps.vim拷贝到~/.vim/plugin中

    修改cscope_maps.vim
    nmap <F5>s :cs find s <C-R>=expand("<cword>")<CR><CR>  
    nmap <F5>g :cs find g <C-R>=expand("<cword>")<CR><CR>  
    nmap <F5>c :cs find c <C-R>=expand("<cword>")<CR><CR>  
    nmap <F5>t :cs find t <C-R>=expand("<cword>")<CR><CR>  
    nmap <F5>e :cs find e <C-R>=expand("<cword>")<CR><CR>  
    nmap <F5>f :cs find f <C-R>=expand("<cfile>")<CR><CR>  
    nmap <F5>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
    nmap <F5>d :cs find d <C-R>=expand("<cword>")<CR><CR> 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值