今天介绍两个重量级的emacs组件,一个是cedet,一个是ecb.当安装好这两个组
件之后,发现emacs已经完全打造为一个IDE环境。
对应的官方下载网站:
ecb
cedet
1)安装
下载ecb以及cedet包,然后:
tar zxvf ecb-xxx.tar.gz
tar zxvf cedet-xxx.tar.gz
cd cedet-xxx
make
2).在.emacs中加入cedet的功能.
(load-file "~/wxclam/lisp/cedet-1.0pre6/common/cedet.el")
(global-ede-mode 1) ; Enable the Project management system
(semantic-load-enable-code-helpers) ; Enable prototype help and smart completion
(global-srecode-minor-mode 1) ; Enable template insertion menu
;; Enable EDE (Project Management) features
(global-ede-mode 1)
;; Enable EDE for a pre-existing C++ project
;; (ede-cpp-root-project "NAME" :file "~/myproject/Makefile")
;; Enabling Semantic (code-parsing, smart completion) features
;; 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 intellisense mode
;; decoration mode, and stickyfunc mode (plus regular code helpers)
;; (semantic-load-enable-gaudy-code-helpers)
;; * This enables the use of Exuberent ctags if you have it installed.
;; If you use C++ templates or boost, you should NOT enable it.
;; (semantic-load-enable-all-exuberent-ctags-support)
;; Enable SRecode (Template management) minor-mode.
;; (global-srecode-minor-mode 1)
3).在.emacs中加入ecb的配置项。
(add-to-list 'load-path "~/wxclam/lisp/ecb-2.40")
(require 'ecb)
;(require 'ecb-autoloads)
(setq ecb-auto-activate t
ecb-tip-of-the-day nil)
;;;; 各窗口间切换
(global-set-key [M-left] 'windmove-left)
(global-set-key [M-right] 'windmove-right)
(global-set-key [M-up] 'windmove-up)
(global-set-key [M-down] 'windmove-down)
;;;; 隐藏和显示ECB窗口
(define-key global-map [(control f1)] 'ecb-hide-ecb-windows)
(define-key global-map [(control f2)] 'ecb-show-ecb-windows)
;;;; 使某一ecb窗口最大化
(define-key global-map "\C-c1" 'ecb-maximize-window-directories)
(define-key global-map "\C-c2" 'ecb-maximize-window-sources)
(define-key global-map "\C-c3" 'ecb-maximize-window-methods)
(define-key global-map "\C-c4" 'ecb-maximize-window-history)
;;;; 恢复原始窗口布局
(define-key global-map "\C-c`" 'ecb-restore-default-window-sizes)
4).使用:
- 在这份配置文件中,emacs已经在启动的时候将ecb模式启用。
- 在没有启动ecb的时候启动ecb模式:M-x ecb-activate
- 通过M-left,M-right,M-up,M-down可以在各个窗口之间进行切换。
- C-f1,C-f2对应隐藏以及显示ecb窗口。
阅读(5135) | 评论(3) | 转发(0) |