Chinaunix首页 | 论坛 | 博客
  • 博客访问: 891777
  • 博文数量: 113
  • 博客积分: 3160
  • 博客等级: 少校
  • 技术积分: 1801
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-19 10:09
文章分类

全部博文(113)

分类: LINUX

2012-09-01 20:44:28


1 安装Cscope

  • 这是cscope的下载地址:
  • 这是cscope的主页:


2 编译安装


将下载的cscope解压,然后进入目录:

tar zxf cscope* 
cd cscope*

接着是老三步:

./configure 
make 
sudo make install


Cscope 的发行包里面有xcscope.el,它处于源代码包的contrib/xcscope目录下,把xcospe放入.emcs.d/中。

同时将其中的cscope-indexer放入/usr/bin,同时使它具有可执行权限。

cp xcscope.el ~/.emacs.d/ 
sudo cp cscope-indexer /usr/bin 
cd /usr/bin 
sudo chmod 744 cscope-indexer


3 配置

在.emacs中添加如下代码:

(require 'xcscope)
 ;; 设置仅在打开c/c++文件时打开 
(add-hook 'c-mode-common-hook '(lambda() (require 'xcscope))) 

;; 打开cscope时不更新,提高索引速度 
(setq cscope-do-not-update-database t)


4 使用

如果需要使用cscope,请将cscope-indexer放入该目录,同时执行M+X cscope-index-files,

即可在该目录下生成索引文件。或者在该目录下执行 sudo cscope-indexer -r,它会生成cscope.files

和cscope.out两个文件或目录。

阅读(4356) | 评论(0) | 转发(1) |
2

上一篇:安装git-emacs

下一篇:Git 存储过程探究

给主人留下些什么吧!~~