1 自动启动ecb
;;;; 自动启动ecb,并且不显示每日提示
(setq ecb-auto-activate t
ecb-tip-of-the-day nil)
2显示行号
1.下载扩展文件linum.el,可以在http://stud4.tuwien.ac.at/~e0225855/linum/linum.html进行下载,它有不同的版本供你使用,我选择emacs22及以上版本。
2.设置.emacs文件:
(add-to-list ‘load-path “/usr/share/emacs/mylisp”)
(require ‘linum)
(global-linum-mode 1)
3鼠标的支持
默认情况下,使用鼠标点击ECB窗口中的内容,不起作用,并不能打开它,要回车才可以。可以在Emacs中执行“M-x ecb-customize-most-important”,找到“Ecb Primary Secondary Mouse Buttons”选项,将其设为“Primary: mouse-1, secondary: mouse-2”,并且以“Save for Future Sessions”保存。
4全屏
(defun my-fullscreen ()
(interactive)
(x-send-client-message
nil 0 nil “_NET_WM_STATE” 32
‘(2 “_NET_WM_STATE_FULLSCREEN” 0))
)
;该函数用于最大化,状态值为1说明最大化后不会被还原
;因为这里有两次最大化 (分别是水平和垂直)
(defun my-maximized ()
(interactive)
(x-send-client-message
nil 0 nil “_NET_WM_STATE” 32
‘(1 “_NET_WM_STATE_MAXIMIZED_HORZ” 0))
(interactive)
(x-send-client-message
nil 0 nil “_NET_WM_STATE” 32
‘(1 “_NET_WM_STATE_MAXIMIZED_VERT” 0)))
(my-maximized)
5自定义按键
(global-set-key [f1] ’shell);F1进入Shell
(global-set-key [f5] ‘gdb);F5调试程序
(setq compile-command “make -f Makefile”)
(global-set-key [f7] ‘do-compile);F7编译文件
(global-set-key [f8] ‘other-window);F8窗口间跳转
(global-set-key [...]
Archives for emacs
emacs简单配置
cedet和ecb在emacs中的配置
最近,研究emacs的使用,期间遇到很多配置方面的问题,在http://www.emacer.com上面寻找到一些相关的教程,但中间仍然出现了很多难以预料的问题,在这里,把我用的的相应配置过程记录一下,一是为自己以后备用,二来为那些和我一样挣扎的新手提供一些帮助,废话少说,进入正文。
我使用的系统是ubuntu 9.10, 在这里我主要是配置cedet和ecb的相关内容,内容全部在.emacs 文件中(.emacs文件一般在/home/你的用户名 目录下,一般是隐藏的,按ctrl+h可以查看隐藏文件)。
1 安装前的准备
1.1 Emacs已经安装好,且版本号必须高于或等于21.(我用的是Emacs23.1)
1.2 安装Cedet套件:
1.2.1 首先下载cedet的cvs版本(请先安装cvs)
cvs -d:pserver:anonymous@cedet.cvs.sourceforge.net:/cvsroot/cedet login
cvs -z3 -d:pserver:anonymous@cedet.cvs.sourceforge.net:/cvsroot/cedet co -P
cedet
1.2.2 编译Cedet
进入到cedet
$ cd cedet-1.0pre6
编译:
$ make EMACS=emacs
如果这里没有安装texinfo, 会出现makeinfo命令未找到的出错. 请把texinfo安装就行了.
更多的编译过程, 请参阅cedet目录下的INSTALL文件.
1.2.4 配置Cedet
打开.emacs, 在最后加入:
(load-file “/home/你的用户名/cedet/common/cedet.el”)
(require ’semantic-ia)
(require ‘eldoc)
(require ’semantic-gcc)
(global-ede-mode 1) ; Enable the Project management system
(semantic-load-enable-code-helpers) ; Enable prototype help and smart completion
(global-srecode-minor-mode [...]