首先,对字体颜色进行配置:
1.简单设置方法:
通过命令快速打开背景颜色设定界面:
51Testing软件测试网6p{Uk[;K
M-x customize-face
default
J~B!R6hb|I`051Testing软件测试网.G"g IWw51Testing软件测试网D4q/}r:v1Y;?i2q
51Testing软件测试网d1w
Foreground color: grey85
K]X0c X"O0background color: black5N P+dN9GX4_`r;s2.
)
也可以安装一个软件包,里面包含了几十种已经定义好的颜色主题。
51Testing软件测试网:p:yC`Z�Wsudo apt-get install emacs-goodies-el
6f"mk%a&g0{c,hl#FU;t0键入
‘M-x color-theme-select’
选择不同的主题;
接下来安装配置cc-mode:
下载后:
emacs -batch -no-site-file -q -f batch-byte-compile
cc-*.el 来 byte-compile
新建一个emacs的文件夹:
mkdir ~/.emacsd
mv
cc-mode-5.31.3 ~/.emacsd
修改一下 ~/.emacs
加入
(add-to-list 'load-path "~/.emacsd/cc-mode-5.31.3")
新建一个test.cpp,M-x c-version
出现了
Using CC Mode version 5.31.3就表示安装成功了cc-mode;
然后安装ecb和cedet:
下载出两个tar文件,mv到~/.emacsd下
tar zxvf ecb-2.32.tar.gz
tar zxvf cedet-1.0pre4.tar.gz
cd cedet-1.0pre4
make
等cedet生成完毕.
.emacs中添加下面一段.注意,load-file那一行的目录要自己改一下
;; Load CEDET
(load-file "你存放cedet的目录/common/cedet.el")
;;例如(load-file "~/.emacsd/cedet-1.0/common/cedet.el")
;; Enabling various SEMANTIC minor modes. See semantic/INSTALL for more ideas.
;; Select one of the following:
;; * This enables the database and idle reparse engines
;;(semantic-load-enable-minimum-features)
;; * This enables some tools useful for coding, such as summary mode
;; imenu support, and the semantic navigator
(semantic-load-enable-code-helpers)
;; * This enables even more coding tools such as the nascent intellisense mode
;; decoration mode, and stickyfunc mode (plus regular code helpers)
;; (semantic-load-enable-guady-code-helpers)
;; * This turns on which-func support (Plus all other code helpers)
;; (semantic-load-enable-excessive-code-helpers)
;; This turns on modes that aid in grammar writing and semantic tool
;; development. It does not enable any other features such as code
;; helpers above.
;; (semantic-load-enable-semantic-debugging-helpers)
这样cedet就装好了
接下来安装ecb
在.emacs里面加入
(add-to-list 'load-path "你放ecb的目录")
;;例如(add-to-list 'load-path "~/.emacsd/ecb-2.32")
(require 'ecb)
注意这个段要加在cedet配置的后面
重启emacs
在emacs中打开一个c或者c++文件.选tool中的Start Code Browser(ECB).
ecb和cedet功能丰富.具体请看M-x ecb-show-help 和cedet包里面的install文件.