emacs环境配置

    Cscope:   

    首先官网上下载cscope的源码包,解压进入,按照INSTALL的说明:

./configure

make

make install

    但是在make时报如下错误:fatal error: curses.h: No such file or directory

    百度了下,是字符界面的库ncurses,需要安装开发包:

yum install ncurses-devel ncurses

    安装完毕后编译安装成功。借着将源码包中的xcscope.el拿出来放到emacs的插件目录下cscope文件夹中,并在.emacs中添加引用:

(add-to-list 'load-path "~/.emacs.d/plugin/xcscope")

;;打开C文件时加载cscope

(add-hook 'c-mode-common-hook

                '(lambda()

                   (require 'xcscope)))

    然而这还不够。将源码包中的cscope-indexer拷贝到/usr/bin目录下(系统PATH),并添加执行权限:

chmod +x cscope-indexer

    最后,打开emacs,C-c s I,建立索引文件数据库成功。

posted on 2017-05-25 13:57  莫行  阅读(210)  评论(0编辑  收藏  举报

导航