首页 > 代码库 > emacs-ide配置
emacs-ide配置
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; CEDET Configuration
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;load cedet
(add-to-list ‘load-path "/opt/emacs-ide/cedet-1.1/common")
(add-to-list ‘load-path "/opt/emacs-ide/cedet-1.1/semantic")
(add-to-list ‘load-path "/opt/emacs-ide/cedet-1.1/cogre")
(add-to-list ‘load-path "/opt/emacs-ide/cedet-1.1/contrib")
(add-to-list ‘load-path "/opt/emacs-ide/cedet-1.1/ede")
(add-to-list ‘load-path "/opt/emacs-ide/cedet-1.1/eieio")
(add-to-list ‘load-path "/opt/emacs-ide/cedet-1.1/speedbar")
(add-to-list ‘load-path "/opt/emacs-ide/cedet-1.1/srecode")
(load-file "/opt/emacs-ide/cedet-1.1/common/cedet.elc")
(require ‘cedet)
(require ‘semantic)
(require ‘srecode)
(global-ede-mode 1)
(global-srecode-minor-mode 1)
;;颜色定制
(set-background-color "black") ;; 使用黑色背景
(set-foreground-color "white") ;; 使用白色前景
(set-face-foreground ‘region "red") ;; 区域前景颜色设为红色
(set-face-background ‘region "blue") ;; 区域背景色设为蓝色
(semantic-load-enable-code-helpers)
(semantic-load-enable-excessive-code-helpers)
(semantic-load-enable-semantic-debugging-helpers)
;;gcc setup
(require ‘semantic-gcc)
;;smart completions setup
(require ‘semantic-ia)
(defun my-cedet-hook()
(local-set-key (kbd "M-RET") ‘semantic-ia-complete-symbol)
(local-set-key (kbd "C-c ?") ‘semantic-ia-complete-symbol-menu)
(local-set-key (kbd "M-n") ‘semantic-ia-complete-symbol-menu)
(local-set-key (kbd "C-c >") ‘semantic-complete-analyze-inline)
(local-set-key (kbd "M-/") ‘semantic-complete-analyze-inline)
(local-set-key (kbd "C-c p") ‘semantic-analyze-proto-impl-toggle)
(local-set-key (kbd "C-c d") ‘semantic-ia-fast-jump)
(local-set-key (kbd "C-c r") ‘semantic-symref-symbol)
(local-set-key (kbd "C-c R") ‘semantic-symref)
(linum-mode)
)
;;c/c++ setting
(local-set-key "." ‘semantic-complete-self-insert)
(local-set-key ">" ‘semantic-complete-self-insert)
(add-hook ‘c-mode-common-hook ‘my-cedet-hook)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ECB Configure
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list ‘load-path "/opt/emacs-ide/ecb-2.40")
(require ‘ecb)
(require ‘ecb-autoloads)
;;auto startup and not show tips
(setq ecb-auto-activate t ecb-tip-of-the-day nil)
(setq ecb-tip-of-the-day nil)
;;window navigate
(global-set-key (kbd "ESC <left>") ‘windmove-left)
(global-set-key (kbd "ESC <right>") ‘windmove-right)
(global-set-key (kbd "ESC <up>") ‘windmove-up)
(global-set-key (kbd "ESC <down>") ‘windmove-down)
;;hide and show window
(global-set-key (kbd "ESC <f1>") ‘ecb-show-ecb-windows)
(global-set-key (kbd "ESC <f2>") ‘ecb-hide-ecb-windows)
(global-set-key (kbd "ESC <f3>") ‘ecb-activate)
(global-set-key (kbd "ESC <f5>") ‘ecb-deactivate)
;;change layout
(global-set-key (kbd "C-c 1") ‘ecb-maximize-window-directories)
(global-set-key (kbd "C-c 2") ‘ecb-maximize-window-sources)
(global-set-key (kbd "C-c 3") ‘ecb-maximize-window-methods)
(global-set-key (kbd "C-c 4") ‘ecb-maximize-window-history)
;;restore layout
(global-set-key (kbd "C-c 0") ‘ecb-restore-default-window-sizes)
(custom-set-variables
‘(ecb-fix-window-size t)
‘(ecb-layout-window-sizes nil)
‘(ecb-windows-width 0.20)
)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won‘t work right.
‘(ecb-options-version "2.40"))
;;(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won‘t work right.
;; )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Other Settings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;set default reader coding system
;;(prefer-coding-system ‘gbk)
;;set default write coding system
;;(setq default-buffer-file-coding-system ‘gbk)
;;set line number
(setq line-number-mode t)
(setq linum-mode t)
;;set column number
(setq column-number-mode t)
;;tab setting
(setq tab-width 4
indent-tabs-mode t
c-basic-offset 4
)
;;Mark set
(global-set-key (kbd "ESC SPC") ‘set-mark-command)
;;Close menu and toolbar
(tool-bar-mode nil)
(menu-bar-mode nil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; xcscope
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list ‘load-path "/opt/emacs-ide/cscope-15.8a/contrib/xcscope")
(load-file "/opt/emacs-ide/cscope-15.8a/contrib/xcscope/xcscope.el")
(require ‘xcscope)
emacs-ide配置