程序员的emacs配置大全(cedet+ecb+cscope+gdb-ui)-jzj

本文主要讨论以下几方面的设置:
1.字体
2.cedet
3.ecb
4.cscope
4.gdb-many-window

环境:
openSUSE 10.2
默认装的是Emacs 21,我从网上下了Emacs 22.1的tar包,编译安装。

1.字体
    默认的字体非常之小,以下是一篇非常详细的Emacs下设置字体的教程,可惜太长了,长到我实在是懒得看。我抄了个现成的:
(set-default-font "-adobe-courier-medium-r-normal--14-100-100-100-m-90-iso10646-1")

2.cedet
   下载cedet: http://cedet.sourceforge.net/
按照INSTALL安装就行,然后设置.emacs。INSTALL里有一段关于设置的,粘贴过来即可,另外最好设一个speedbar的快捷键:
(global-set-key [(f4)] 'speedbar-get-focus)
这样按一个F4,speedbar就出来了。

3.ecb
    http://ecb.sourceforge.net/
.emacs里:
(add-to-list 'load-path "~/software/ecb-2.32")
;;(require 'ecb)
(require 'ecb-autoloads)
打开emacs,然后M-x ecb-activate即可打开ecb。

4.cscope
   这个应该和ecb的有些功能是重复的
先装好cscope,再把/cscope-15.6/contrib/xcscope目录下的xcscope.el加载到emacs中去:
(add-to-list 'load-path "~/software/cscope-15.6/contrib/xcscope")
(require 'xcscope)
这里有篇讲怎么在emacs下安装和使用cscope的:
http://ann77.stu.cdut.edu.cn/EmacsCscope.html

5.gdb-many-window
   这个功能插件可以使emacs的调试界面像VC一样,有watch, stacktrace等窗口,真正实现图形化gdb.
下载:
http://www.inet.net.nz/~nickrob/multi-gud.el
http://www.inet.net.nz/~nickrob/multi-gdb-ui.el
设置.emacs:
(load-library "multi-gud.el")
(load-library "multi-gdb-ui.el")
还不行的看详细官方教程:http://www.inet.net.nz/
一遍使用gdb-ui的教程:
http://blog.chinaunix.net/u/5958/showart_137996.html


另外:
Emacs安装一个扩展包的方法
http://ann77.stu.cdut.edu.cn/EmacsInstallPackege.html
一个比较全的.emacs配置文件:
http://www.cppblog.com/guangping/archive/2006/08/25/11683.html

附件:
我的.emacs(还没整理过,很乱,貌似还有快捷键重复的-_-|||)
(if (string-match "XEmacs//|Lucid" emacs-version)
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;; XEmacs
  ;;; ------
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (progn
     (if (file-readable-p "~/.xemacs/init.el")
        (load "~/.xemacs/init.el" nil t))
  )
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;; GNU-Emacs
  ;;; ---------
  ;;; load ~/.gnu-emacs or, if not exists /etc/skel/.gnu-emacs
  ;;; For a description and the settings see /etc/skel/.gnu-emacs
  ;;;   ... for your private ~/.gnu-emacs your are on your one.
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (if (file-readable-p "~/.gnu-emacs")
      (load "~/.gnu-emacs" nil t)
    (if (file-readable-p "/etc/skel/.gnu-emacs")
 (load "/etc/skel/.gnu-emacs" nil t)))

  ;; Custum Settings
  ;; ===============
  ;; To avoid any trouble with the customization system of GNU emacs
  ;; we set the default file ~/.gnu-emacs-custom
  (setq custom-file "~/.gnu-emacs-custom")
  (load "~/.gnu-emacs-custom" t t)
;;;
)
;;;

(column-number-mode t)
(transient-mark-mode t)
(setq line-number-mode t)
(setq default-tab-width 8)

(customize-set-variable 'scroll-bar-mode' right)
;;(setq default-directory "home/jzj/backup/emacs/")
(setq inhibit-startup-message t)
(setq line-number-mode t)
(setq global-font-lock-mode t)
(setq make-backup-files nil)
(setq auto-save-mode nil)
(setq x-select-enable-clipboard t)
(setq mouse-yank-at-point t)
(global-set-key [home] 'beginning-of-buffer)

(global-set-key [end] 'end-of-buffer)
;;(global-set-key [f4] 'other-window)
(global-set-key [f5] 'compile)
(setq-default compile-command "make")
;;(global-set-key [f7] 'du-onekey-compile)
(global-set-key [f6] 'gdb)


(global-set-key [C-f7] 'previous-error)
(global-set-key [f7] 'next-error)

;;(set-default-font "9x15")
(set-default-font "-adobe-courier-medium-r-normal--14-100-100-100-m-90-iso10646-1")

;; Load CEDET
(load-file "~/software/cedet-1.0pre4/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)

(global-set-key [(f4)] 'speedbar-get-focus)

(require 'cc-mode)
(c-set-offset 'inline-open 0)
(c-set-offset 'friend '-)
(c-set-offset 'substatement-open 0)
(defun my-c-mode-common-hook()
  (setq tab-width 4 indent-tabs-mode nil)
  ;;; hungry-delete and auto-newline
  (c-toggle-auto-hungry-state 1)
 
  (define-key c-mode-base-map [(control /`)] 'hs-toggle-hiding)
 ;; (define-key c-mode-base-map [(return)] 'newline-and-indent)
;;  (define-key c-mode-base-map [(f6)] 'compile)
  (define-key c-mode-base-map [(meta /`)] 'c-indent-command)
;;  (define-key c-mode-base-map [(tab)] 'hippie-expand)
  (define-key c-mode-base-map [(tab)] 'my-indent-or-complete)
  (define-key c-mode-base-map [(meta ?/)] 'semantic-ia-complete-symbol-menu)
 
  (setq c-macro-shrink-window-flag t)
  (setq c-macro-preprocessor "cpp")
  (setq c-macro-cppflags " ")
  (setq c-macro-prompt-flag t)
  (setq hs-minor-mode t)
  (setq abbrev-mode t)
)
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

(defun my-c++-mode-hook()
  (setq tab-width 4 indent-tabs-mode nil)
  (c-set-style "stroustrup")
;;  (define-key c++-mode-map [f3] 'replace-regexp)
)

(setq gdb-many-windows t)

(add-to-list 'load-path "~/backup/emacs")
(require 'gud)

(add-to-list 'load-path "~/software/ecb-2.32")
;;(require 'ecb)
(require 'ecb-autoloads)

;;for gdb-many-window mode
(load-library "multi-gud.el")
(load-library "multi-gdb-ui.el")

;; cscope in emacs
(add-to-list 'load-path "~/software/cscope-15.6/contrib/xcscope")
(require 'xcscope)

;; hotkey for cscope
(define-key global-map [(control f3)]  'cscope-set-initial-directory)
(define-key global-map [(control f4)]  'cscope-unset-initial-directory)
(define-key global-map [(control f5)]  'cscope-find-this-symbol)
(define-key global-map [(control f6)]  'cscope-find-global-definition)
(define-key global-map [(control f7)]
'cscope-find-global-definition-no-prompting)
(define-key global-map [(control f8)]  'cscope-pop-mark)
(define-key global-map [(control f9)]  'cscope-next-symbol)
(define-key global-map [(control f10)] 'cscope-next-file)
(define-key global-map [(control f11)] 'cscope-prev-symbol)
(define-key global-map [(control f12)] 'cscope-prev-file)
(define-key global-map [(meta f9)]  'cscope-display-buffer)
(define-key global-map [(meta f10)] 'cscope-display-buffer-toggle)
 

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
回答: 根据你提供的引用内容,我理解你在询问关于Centaur Emacs的问题。Centaur Emacs是一个基于Emacs配置,旨在提供更好的用户体验和更高的生产力。它包含了许多常用的插件和配置,使得Emacs更加易用和功能强大。根据引用\[1\]和引用\[2\]的内容,配置Centaur Emacs的过程包括下载和解压Emacs,设置系统环境变量,以及根据个人的需求进行一些额外的配置。具体的步骤可以参考引用\[1\]和引用\[2\]中提供的详细说明。另外,引用\[3\]中提供了一个设置字体的示例代码,可以根据个人喜好进行配置。希望这些信息对你有帮助。 #### 引用[.reference_title] - *1* *2* [Win10+emacs配置](https://blog.csdn.net/gxiaop/article/details/51347350)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [window8.1+ emacs24.3配置python显示自动补全方法](https://blog.csdn.net/huangdecai2/article/details/40951607)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值