my emacs setup
来源:互联网 发布:郫县兼职教师招聘知乎 编辑:程序博客网 时间:2024/05/17 08:03
(require 'cmake-mode)
(setq auto-mode-alist
(append '(("CMakeLists\\.txt\\'" . cmake-mode)
("\\.cmake\\'" . cmake-mode))
auto-mode-alist))
(require 'cedet)
(global-ede-mode t)
;;;; Helper tools.
(custom-set-variables
'(semantic-default-submodes (quote (global-semantic-decoration-mode global-semantic-idle-completions-mode
global-semantic-idle-scheduler-mode global-semanticdb-minor-mode
global-semantic-idle-summary-mode global-semantic-mru-bookmark-mode)))
'(semantic-idle-scheduler-idle-time 3))
(semantic-mode)
;; smart complitions
(require 'semantic/ia)
(setq-mode-local c-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
(setq-mode-local c++-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
;;;; Include settings
(require 'semantic/bovine/gcc)
(require 'semantic/bovine/c)
(defconst cedet-user-include-dirs
(list ".." "../include" "../inc" "../common" "../public" "."
"../.." "../../include" "../../inc" "../../common" "../../public"))
(setq cedet-sys-include-dirs (list
"/usr/include"
"/usr/include/bits"
"/usr/include/glib-2.0"
"/usr/include/gnu"
"/usr/include/gtk-2.0"
"/usr/include/gtk-2.0/gdk-pixbuf"
"/usr/include/gtk-2.0/gtk"
"/usr/local/include"
"/usr/local/include"))
(let ((include-dirs cedet-user-include-dirs))
(setq include-dirs (append include-dirs cedet-sys-include-dirs))
(mapc (lambda (dir)
(semantic-add-system-include dir 'c++-mode)
(semantic-add-system-include dir 'c-mode))
include-dirs))
(setq semantic-c-dependency-system-include-path "/usr/include/")
;;;; TAGS Menu
(defun my-semantic-hook ()
(imenu-add-to-menubar "TAGS"))
(add-hook 'semantic-init-hooks 'my-semantic-hook)
;;;; Semantic DataBase Location
(setq semanticdb-default-save-directory
(expand-file-name "~/.emacs.d/semanticdb"))
;; use gnu global TAGS
(require 'semantic/db-global)
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode)
;;;; Auto complete and format
;;; hippie-try-expand settings
(setq hippie-expand-try-functions-list
'(
yas/hippie-try-expand
semantic-ia-complete-symbol
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))
(defun indent-or-complete ()
"Complete if point is at end of a word, otherwise indent line."
(interactive)
(if (looking-at "//>")
(hippie-expand nil)
(indent-for-tab-command)
))
(defun yyc/indent-key-setup ()
"Set tab as key for indent-or-complete"
(local-set-key [(tab)] 'indent-or-complete)
)
;;;; C-mode-hooks .
(defun yyc/c-mode-keys ()
"description"
;; Semantic functions.
(semantic-default-c-setup)
(local-set-key "/C-c?" 'semantic-ia-complete-symbol-menu)
(local-set-key "/C-cb" 'semantic-mrub-switch-tags)
(local-set-key "/C-cR" 'semantic-symref)
(local-set-key "/C-cj" 'semantic-ia-fast-jump)
(local-set-key "/C-cp" 'semantic-ia-show-summary)
(local-set-key "/C-cl" 'semantic-ia-show-doc)
(local-set-key "/C-cr" 'semantic-symref-symbol)
(local-set-key "/C-c/" 'semantic-ia-complete-symbol)
(local-set-key [(control return)] 'semantic-ia-complete-symbol)
(local-set-key "." 'semantic-complete-self-insert)
(local-set-key ">" 'semantic-complete-self-insert)
;; Indent or complete
(local-set-key [(tab)] 'indent-or-complete)
)
(add-hook 'c-mode-common-hook 'yyc/c-mode-keys)
(defadvice push-mark (around semantic-mru-bookmark activate)
"Push a mark at LOCATION with NOMSG and ACTIVATE passed to `push-mark'.
If `semantic-mru-bookmark-mode' is active, also push a tag onto
the mru bookmark stack."
(semantic-mrub-push semantic-mru-bookmark-ring
(point)
'mark)
ad-do-it)
;;;; Custom template for srecode
;(setq srecode-map-load-path
; (list (srecode-map-base-template-dir)
; (expand-file-name "~/.emacs.d/templates/srecode")
; ))
(setq x-select-enable-clipboard t);
(setq auto-mode-alist
(append '(("CMakeLists\\.txt\\'" . cmake-mode)
("\\.cmake\\'" . cmake-mode))
auto-mode-alist))
(require 'cedet)
(global-ede-mode t)
;;;; Helper tools.
(custom-set-variables
'(semantic-default-submodes (quote (global-semantic-decoration-mode global-semantic-idle-completions-mode
global-semantic-idle-scheduler-mode global-semanticdb-minor-mode
global-semantic-idle-summary-mode global-semantic-mru-bookmark-mode)))
'(semantic-idle-scheduler-idle-time 3))
(semantic-mode)
;; smart complitions
(require 'semantic/ia)
(setq-mode-local c-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
(setq-mode-local c++-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
;;;; Include settings
(require 'semantic/bovine/gcc)
(require 'semantic/bovine/c)
(defconst cedet-user-include-dirs
(list ".." "../include" "../inc" "../common" "../public" "."
"../.." "../../include" "../../inc" "../../common" "../../public"))
(setq cedet-sys-include-dirs (list
"/usr/include"
"/usr/include/bits"
"/usr/include/glib-2.0"
"/usr/include/gnu"
"/usr/include/gtk-2.0"
"/usr/include/gtk-2.0/gdk-pixbuf"
"/usr/include/gtk-2.0/gtk"
"/usr/local/include"
"/usr/local/include"))
(let ((include-dirs cedet-user-include-dirs))
(setq include-dirs (append include-dirs cedet-sys-include-dirs))
(mapc (lambda (dir)
(semantic-add-system-include dir 'c++-mode)
(semantic-add-system-include dir 'c-mode))
include-dirs))
(setq semantic-c-dependency-system-include-path "/usr/include/")
;;;; TAGS Menu
(defun my-semantic-hook ()
(imenu-add-to-menubar "TAGS"))
(add-hook 'semantic-init-hooks 'my-semantic-hook)
;;;; Semantic DataBase Location
(setq semanticdb-default-save-directory
(expand-file-name "~/.emacs.d/semanticdb"))
;; use gnu global TAGS
(require 'semantic/db-global)
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode)
;;;; Auto complete and format
;;; hippie-try-expand settings
(setq hippie-expand-try-functions-list
'(
yas/hippie-try-expand
semantic-ia-complete-symbol
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))
(defun indent-or-complete ()
"Complete if point is at end of a word, otherwise indent line."
(interactive)
(if (looking-at "//>")
(hippie-expand nil)
(indent-for-tab-command)
))
(defun yyc/indent-key-setup ()
"Set tab as key for indent-or-complete"
(local-set-key [(tab)] 'indent-or-complete)
)
;;;; C-mode-hooks .
(defun yyc/c-mode-keys ()
"description"
;; Semantic functions.
(semantic-default-c-setup)
(local-set-key "/C-c?" 'semantic-ia-complete-symbol-menu)
(local-set-key "/C-cb" 'semantic-mrub-switch-tags)
(local-set-key "/C-cR" 'semantic-symref)
(local-set-key "/C-cj" 'semantic-ia-fast-jump)
(local-set-key "/C-cp" 'semantic-ia-show-summary)
(local-set-key "/C-cl" 'semantic-ia-show-doc)
(local-set-key "/C-cr" 'semantic-symref-symbol)
(local-set-key "/C-c/" 'semantic-ia-complete-symbol)
(local-set-key [(control return)] 'semantic-ia-complete-symbol)
(local-set-key "." 'semantic-complete-self-insert)
(local-set-key ">" 'semantic-complete-self-insert)
;; Indent or complete
(local-set-key [(tab)] 'indent-or-complete)
)
(add-hook 'c-mode-common-hook 'yyc/c-mode-keys)
(defadvice push-mark (around semantic-mru-bookmark activate)
"Push a mark at LOCATION with NOMSG and ACTIVATE passed to `push-mark'.
If `semantic-mru-bookmark-mode' is active, also push a tag onto
the mru bookmark stack."
(semantic-mrub-push semantic-mru-bookmark-ring
(point)
'mark)
ad-do-it)
;;;; Custom template for srecode
;(setq srecode-map-load-path
; (list (srecode-map-base-template-dir)
; (expand-file-name "~/.emacs.d/templates/srecode")
; ))
(setq x-select-enable-clipboard t);
- my emacs setup
- my .emacs
- My .Emacs
- setup emacs for windows
- ubuntu emacs setup
- my Emacs favorites
- my emacs configure
- emacs config for my
- My Presentation For Emacs
- My Hadoop: Hadoop 0.23 setup
- my emacs configuration(for Windows)
- my.emacs' c-h b(emacs默认键盘帮定)
- My Emacs 的配置文件--有待续写
- My csdn blog is setup today, welcome to be here.
- Inno Setup 及 My Inno Setup Extensions安装程序生成工具中文教程
- Inno Setup 及 My Inno Setup Extensions安装程序生成工具中文教程
- setup
- setup
- JBoss负载均衡两模式配置详解
- 职场进化论--每天淘汰你自己
- 用wpa_cli 连接无线网络
- 移动终端开发配置
- com中的类型对应
- my emacs setup
- Hibernate保存记录时遇到的一个问题----evitic,not-null配置及主键生成策略
- SQL 2008将数据导出到Sql脚本文件的方法
- .NET C# 如何监控并及时的显示另一个控制台Console的输出
- Google封锁整个co.cc子域只能临时止血难以长治久安
- 在ubuntu11.04通过Wine使用中国知网cnki的CAJview阅读器打开*.nh *.caj后缀的文献资料
- 开源协议的概览图
- 一个有趣的小学生算法题
- trac 经验谈之(3)工作流篇