;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; File name: ` ~/.emacs '
;;; ---------------------
;;;
;;; Test of Emacs derivates
;;; -----------------------
;;LOAD_PATH, added by qiufeng for cscope support,2012-4-8
(add-to-list 'load-path' "~/.emacs.d/site-lisp")
(add-to-list 'load-path' "~/.emacs.d/site-lisp/cedet/common")
(add-to-list 'load-path' "~/.emacs.d/site-lisp/ecb")
(add-to-list 'load-path' "~/.emacs.d/site-lisp/session/lisp")
(add-to-list 'load-path' "~/.emacs.d/site-lisp/doxymacs/lisp")
;;load cscope/cdedt/ecb/sesion/doxymacs, added by qiufeng
(require 'xcscope);; 加载cscope
(setq cscope-do-not-update-database t) ;;avoid sorting every time
;;cscope-indexer -r
;;chaneg cscope-indxer: cscope -q -b -i cscope.files cscope.out
;(require 'cedet) ;;加载cedet
(load-file "~/.emacs.d/site-lisp/cedet/common/cedet.el")
;;(require 'eieio-opt)
(semantic-load-enable-code-helpers); Enable prototype help and smart completion
(semantic-load-enable-excessive-code-helpers)
(semantic-load-enable-semantic-debugging-helpers)
(global-semantic-decoration-mode 1)
(setq imenu-auto-scan t) ;; auto-refresh speed bar
(global-semantic-tag-folding-mode 1) ; Enable source code folding
(global-srecode-minor-mode 1); Enable template insertion menu
;(require 'semantic-gcc)
;(require 'semantic-ia)
;;cedet自动补齐快捷键
;hippie-expand 的补全方式是一个优先列表, hippie-expand 会优先使用表最前面的函数来补全。通常的设置是:
(global-set-key [(meta ?/)] 'hippie-expand)
(setq hippie-expand-try-functions-list
'(try-expand-dabbrev
try-expand-dabbrev-visible
try-expand-dabbrev-all-buffers
try-expand-dabbrev-from-kill
try-complete-file-name-partially
try-complete-file-name
try-expand-all-abbrevs
try-expand-list
try-expand-line
try-complete-lisp-symbol-partially
try-complete-lisp-symbol))
;;cedet快捷键
;设置检索范围
(setq semanticdb-project-roots
(list (expand-file-name "/")));;可以设置为项目的顶级目录
;绑定按键,ctr+tab,以下三种,任意选择一个,我喜欢第二个
;(global-set-key [(control return)] 'senator-complete-symbol);
(global-set-key [(control return)] ' senator-completion-menu-popup)
; (global-set-key [(control return)] 'semantic-ia-complete-symbol-menu)
;; between windows
(windmove-default-keybindings)
(setq windmove-wrap-around t)
;;ecb
(require 'ecb) ;;加载ecb
(require 'ecb-autoloads)
(setq ecb-auto-activate t;自动启动ecb
ecb-tip-of-the-day nil;不显示每日提醒
inhibit-startup-message t;不知道什么意思,望各位指导
ecb-auto-compatibility-check nil;
ecb-version-check nil;
stack-trace-on-error nil;
)
;; set cscope into ecb window
(ecb-layout-define "my-cscope-layout" left nil
(ecb-set-methods-buffer)
(ecb-split-ver 0.5 t)
(other-window 1)
(ecb-set-history-buffer)
(ecb-split-ver 0.25 t)
(other-window 1)
(ecb-set-cscope-buffer))
(defecb-window-dedicator ecb-set-cscope-buffer " *ECB cscope-buf*" (switch-to-buffer "*cscope*")) (setq ecb-layout-name "my-cscope-layout")
(global-set-key [(control e)] 'ecb-activate) ;;定义F8键为激活ecb
(global-set-key [(control shift e)] 'ecb-deactivate) ;;定义F7为停止ecb
;;;;; ecb各窗口间切换
(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 "\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)
;;(require 'session) ;;加载session
;;(add-hook 'after-init-hook 'session-initialize)
;;;;记录和恢复屏幕
;;(load "desktop")
;;;desktop自动存盘模式,23需要加
;;(add-hook 'after-init-hook 'session-initialize) ;; 启动时初始化session
;;(require 'doxymacs) ;; 启动doxymacs
;;注释高亮,针对C和C++程序
;;(defun my-doxymacs-font-lock-hook ()
;; (if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode))
;; (doxymacs-font-lock)))
;; (add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook)
;; (doxymacs-mode);doxymacs-mode常true
;; (global-set-key [(f6)] 'doxymacs-mode);doxymacs-mode快捷键[F6]
;; ;(add-hook 'c-mode-common-hook 'doxymacs-mode) ;; 启动doxymacs-mode
;; ;(add-hook 'c++-mode-common-hook 'doxymacs-mode) ;; 启动doxymacs-mode
;;
;;;GDB
;(global-set-key [(control g)] 'gdb-many-windows);gdb-many-windows快捷键
;(setq gdb-use-separate-io-buffer t) ; 不需要"IO buffer"时,则设为nil
;;woman
(setq woman-use-own-frame nil)
(global-set-key [(meta k)] 'woman)
;;date and time
(setq display-time-day-and-date t)
(display-time)
(setq make-backup-files nil) ;; do not keep backup file
;;(global-font-lock-mode t);;语法高亮
;; 显示行号
(global-linum-mode t)
;; goto line
(global-set-key [(control g)] 'goto-line)
;;高亮指定单词
(require 'highlight-symbol)
(global-set-key [(control h)] 'highlight-symbol-at-point)
(global-set-key [(control j )] 'highlight-symbol-next)
(global-set-key [(meta j)] 'highlight-symbol-prev)
;; 高亮C函数、变量
(require 'zjl-hl)
(zjl-hl-enable-global-all-modes)
;; emacs 自动设置
(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.
'(ansi-color-names-vector ["black" "#d55e00" "#009e73" "#f8ec59" "#0072b2" "#cc79a7" "#56b4e9" "white"])
'(custom-enabled-themes (quote (manoj-dark)))
'(display-time-mode t)
'(ecb-primary-secondary-mouse-buttons (quote mouse-1--mouse-2))
'(ecb-source-path (quote (("/" "/")))))
(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.
'(default ((t (:family "Arial" :foundry "monotype" :slant normal :weight normal :height 143 :width normal)))))
;;换行缩进
;(global-set-key (kbd "RET") 'newline-and-indent)
;;; File name: ` ~/.emacs '
;;; ---------------------
;;; Author: Jerry Q.
;; 2012.12.31
;;;
;;; Test of Emacs derivates
;;; -----------------------
;;LOAD_PATH, added by qiufeng for cscope support,2012-4-8
(add-to-list 'load-path' "~/.emacs.d/site-lisp")
(add-to-list 'load-path' "~/.emacs.d/site-lisp/cedet/common")
(add-to-list 'load-path' "~/.emacs.d/site-lisp/ecb")
(add-to-list 'load-path' "~/.emacs.d/site-lisp/session/lisp")
(add-to-list 'load-path' "~/.emacs.d/site-lisp/doxymacs/lisp")
;;load cscope/cdedt/ecb/sesion/doxymacs, added by qiufeng
(require 'xcscope);; 加载cscope
(setq cscope-do-not-update-database t) ;;avoid sorting every time
;;cscope-indexer -r
;;chaneg cscope-indxer: cscope -q -b -i cscope.files cscope.out
;(require 'cedet) ;;加载cedet
(load-file "~/.emacs.d/site-lisp/cedet/common/cedet.el")
;;(require 'eieio-opt)
(semantic-load-enable-code-helpers); Enable prototype help and smart completion
(semantic-load-enable-excessive-code-helpers)
(semantic-load-enable-semantic-debugging-helpers)
(global-semantic-decoration-mode 1)
(setq imenu-auto-scan t) ;; auto-refresh speed bar
(global-semantic-tag-folding-mode 1) ; Enable source code folding
(global-srecode-minor-mode 1); Enable template insertion menu
;(require 'semantic-gcc)
;(require 'semantic-ia)
;;cedet自动补齐快捷键
;hippie-expand 的补全方式是一个优先列表, hippie-expand 会优先使用表最前面的函数来补全。通常的设置是:
(global-set-key [(meta ?/)] 'hippie-expand)
(setq hippie-expand-try-functions-list
'(try-expand-dabbrev
try-expand-dabbrev-visible
try-expand-dabbrev-all-buffers
try-expand-dabbrev-from-kill
try-complete-file-name-partially
try-complete-file-name
try-expand-all-abbrevs
try-expand-list
try-expand-line
try-complete-lisp-symbol-partially
try-complete-lisp-symbol))
;;cedet快捷键
;设置检索范围
(setq semanticdb-project-roots
(list (expand-file-name "/")));;可以设置为项目的顶级目录
;绑定按键,ctr+tab,以下三种,任意选择一个,我喜欢第二个
;(global-set-key [(control return)] 'senator-complete-symbol);
(global-set-key [(control return)] ' senator-completion-menu-popup)
; (global-set-key [(control return)] 'semantic-ia-complete-symbol-menu)
;; between windows
(windmove-default-keybindings)
(setq windmove-wrap-around t)
;;ecb
(require 'ecb) ;;加载ecb
(require 'ecb-autoloads)
(setq ecb-auto-activate t;自动启动ecb
ecb-tip-of-the-day nil;不显示每日提醒
inhibit-startup-message t;不知道什么意思,望各位指导
ecb-auto-compatibility-check nil;
ecb-version-check nil;
stack-trace-on-error nil;
)
;; set cscope into ecb window
(ecb-layout-define "my-cscope-layout" left nil
(ecb-set-methods-buffer)
(ecb-split-ver 0.5 t)
(other-window 1)
(ecb-set-history-buffer)
(ecb-split-ver 0.25 t)
(other-window 1)
(ecb-set-cscope-buffer))
(defecb-window-dedicator ecb-set-cscope-buffer " *ECB cscope-buf*" (switch-to-buffer "*cscope*")) (setq ecb-layout-name "my-cscope-layout")
(global-set-key [(control e)] 'ecb-activate) ;;定义F8键为激活ecb
(global-set-key [(control shift e)] 'ecb-deactivate) ;;定义F7为停止ecb
;;;;; ecb各窗口间切换
(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 "\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)
;;(require 'session) ;;加载session
;;(add-hook 'after-init-hook 'session-initialize)
;;;;记录和恢复屏幕
;;(load "desktop")
;;;desktop自动存盘模式,23需要加
;;(add-hook 'after-init-hook 'session-initialize) ;; 启动时初始化session
;;(require 'doxymacs) ;; 启动doxymacs
;;注释高亮,针对C和C++程序
;;(defun my-doxymacs-font-lock-hook ()
;; (if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode))
;; (doxymacs-font-lock)))
;; (add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook)
;; (doxymacs-mode);doxymacs-mode常true
;; (global-set-key [(f6)] 'doxymacs-mode);doxymacs-mode快捷键[F6]
;; ;(add-hook 'c-mode-common-hook 'doxymacs-mode) ;; 启动doxymacs-mode
;; ;(add-hook 'c++-mode-common-hook 'doxymacs-mode) ;; 启动doxymacs-mode
;;
;;;GDB
;(global-set-key [(control g)] 'gdb-many-windows);gdb-many-windows快捷键
;(setq gdb-use-separate-io-buffer t) ; 不需要"IO buffer"时,则设为nil
;;woman
(setq woman-use-own-frame nil)
(global-set-key [(meta k)] 'woman)
;;date and time
(setq display-time-day-and-date t)
(display-time)
(setq make-backup-files nil) ;; do not keep backup file
;;(global-font-lock-mode t);;语法高亮
;; 显示行号
(global-linum-mode t)
;; goto line
(global-set-key [(control g)] 'goto-line)
;;高亮指定单词
(require 'highlight-symbol)
(global-set-key [(control h)] 'highlight-symbol-at-point)
(global-set-key [(control j )] 'highlight-symbol-next)
(global-set-key [(meta j)] 'highlight-symbol-prev)
;; 高亮C函数、变量
(require 'zjl-hl)
(zjl-hl-enable-global-all-modes)
;; emacs 自动设置
(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.
'(ansi-color-names-vector ["black" "#d55e00" "#009e73" "#f8ec59" "#0072b2" "#cc79a7" "#56b4e9" "white"])
'(custom-enabled-themes (quote (manoj-dark)))
'(display-time-mode t)
'(ecb-primary-secondary-mouse-buttons (quote mouse-1--mouse-2))
'(ecb-source-path (quote (("/" "/")))))
(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.
'(default ((t (:family "Arial" :foundry "monotype" :slant normal :weight normal :height 143 :width normal)))))
;;换行缩进
;(global-set-key (kbd "RET") 'newline-and-indent)