今天把把emacs的C开发环境鼓捣出来,首先上图:
-
-
gdb的效果
-
-
ecb的效果
1.color theme
color-theme.el
;; color theme
(require ‘color-theme)
(color-theme-classic)
2.line number
我用的是wp-line-number
参考网站:http://homepage1.nifty.com/blankspace/emacs/elisp.html
;;line number
(set-scroll-bar-mode nil) ;no scroll bar
(require ‘wb-line-number)
(wb-line-number-toggle)
3.cedet(Collection of Emacs Development Environment Tools)
这是个非常强大的东东,专门为emacs开发的用于开发环境的工具
参考地址:http://cedet.sourceforge.net/
;; Load CEDET
(load-file “/usr/share/emacs/site-lisp/cedet/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)
;;speedbar
(global-set-key [(f4)] ’speedbar-get-focus)
;;ia-complete
(define-key c-mode-base-map [(meta ?/)] ’semantic-ia-complete-symbol-menu)
4.ecb(emacs code browser)
阅读代码的,也是个非常强大的工具,跟cedet绝配.
参考地址:http://ecb.sourceforge.net/
;;ecb
(add-to-list ‘load-path “/usr/share/emacs/site-lisp/ecb”)
(require ‘ecb)
(setq ecb-layout-name “right1″)
(setq ecb-tip-of-the-day nil);switch off tip of the day
;;(ecb-activate)
5.gdb
调试工具,相比大家都听说过.
我喜欢调成多个窗口,什么stack,break point等等
参考地址:http://www.inet.net.nz/~nickrob/
;;gdb
(add-to-list ‘load-path “/usr/share/emacs/site-lisp/gdb”)
(load-library “multi-gud.el”)
(load-library “multi-gdb-ui.el”)
(setq gdb-many-windows t)