- (setq-default make-backup-files nil)
- ;;;;自动补齐策略
- (defun my-indent-or-complete ()
- (interactive)
- (if (looking-at "//>")
- (hippie-expand nil)
- (indent-for-tab-command))
- )
- (global-set-key [(control tab)] 'my-indent-or-complete)
- (autoload 'senator-try-expand-semantic "senator")
- (setq hippie-expand-try-functions-list
- '(
- senator-try-expand-semantic
- try-expand-dabbrev
- try-expand-dabbrev-visible
- try-expand-dabbrev-all-buffers
- try-expand-dabbrev-from-kill
- try-expand-list
- try-expand-list-all-buffers
- try-expand-line
- try-expand-line-all-buffers
- try-complete-file-name-partially
- try-complete-file-name
- try-expand-whole-kill
- )
- )
- (load-file "~/.emacs.d/site-lisp/cedet-1.0/common/cedet.el")
- ;;;; 具体说明可参考源码包下的INSTALL文件,或《A Gentle introduction to Cedet》
- ;; Enabling Semantic (code-parsing, smart completion) features
- ;; Select one of the following:
- ;;(semantic-load-enable-minimum-features)
- ;;(semantic-load-enable-code-helpers)
- ;;(semantic-load-enable-gaudy-code-helpers)
- (semantic-load-enable-excessive-code-helpers)
- ;;(semantic-load-enable-semantic-debugging-helpers)
- ;;;; 使函数体能够折叠或展开
- ;; Enable source code folding
- (global-semantic-tag-folding-mode 1)
- ;; Key bindings
- (defun my-cedet-hook ()
- (local-set-key [(control return)] 'semantic-ia-complete-symbol)
- (local-set-key "/C-c?" 'semantic-ia-complete-symbol-menu)
- (local-set-key "/C-cd" 'semantic-ia-fast-jump)
- (local-set-key "/C-cr" 'semantic-symref-symbol)
- (local-set-key "/C-cR" 'semantic-symref))
- (add-hook 'c-mode-common-hook 'my-cedet-hook)
- ;;;; 当输入"."或">"时,在另一个窗口中列出结构体或类的成员
- (defun my-c-mode-cedet-hook ()
- (local-set-key "." 'semantic-complete-self-insert)
- (local-set-key ">" 'semantic-complete-self-insert))
- (add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook)
参考文献:
http://blog.csdn.net/intrepyd/article/details/4331877
http://docs.huihoo.com/homepage/shredderyin/emacs_elisp.html