7-7-2015 .emacs 文件备份

原创 2015年07月07日 22:08:00
(put 'upcase-region 'disabled nil)


;;6-18-2015 ColorTheme
(add-to-list 'load-path "~/Documents/emacs/color-theme-6.6.0")

(require 'color-theme)

(color-theme-initialize)
;;颜色选择
(color-theme-pok-wob)

;;6-18-2015 ccmode

(setq c-default-style '((java-mode . "java") 
                                   (awk-mode . "awk") 
                                   (other . "linux")))
(setq-default indent-tabs-mode  nil)
(setq tab-width 4
      c-basic-offset 4)
 (add-hook 'c-mode-hook 'hs-minor-mode)
 (add-hook 'c++-mode-hook 'hs-minor-mode)  

;;cedet 7-7-2015

(require 'cedet)
(global-ede-mode t)
;;基本Helpter定制
;;;;  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)

;;Semantic/ia 的配置
;; 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/")

;;IMenu的集成
;;;; TAGS Menu
(defun my-semantic-hook ()
  (imenu-add-to-menubar "TAGS"))

(add-hook 'semantic-init-hooks 'my-semantic-hook)

;;Semanticdb 的定制
;; Semantic DataBase存储位置
(setq semanticdb-default-save-directory
      (expand-file-name "~/.emacs.d/semanticdb"))

;;semanticdb 可以使用其他工具产生的Tag,例如GNU Global产生的Tags, 可以按照下面的代码来启用
;; 使用 gnu global 的TAGS。
(require 'semantic/db-global)
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode)

;;命名补齐
;;;;  缩进或者补齐
;;; 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和C++的struct/class结构,函数semantic-complete-self-insert 可以插入类或结构中的成员变量,将至绑定到"."或者">",会加速代码编写的效率

;; 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)


相关文章推荐

Win7 64b的VS2015 如何使用nmake成功编译detour express 3.0-error2202 警告被视为错误 - 没有生成“object”文件

首先打开你的开始目录,找到VS2015,找到如图1所示的开发人员命令提示。打开                      图1 从开始菜单打开VS的开发人员命令行 图2 打开VS2015开发...

Win7文件备份

  • 2011年09月15日 14:21
  • 378KB
  • 下载

自己用的emacs配置文件备份

  • 2013年07月30日 16:57
  • 5KB
  • 下载

CentOS 7中安装Emacs

CentOS 7中安装Emacs。 开始接触linux,用的是centos 7,就在博客中分享一些实验中遇到的问题: 只是用作编辑器的话,在GNOME桌面的应用程序的安装程序里面可以下载安装, 至于那...

Emacs Key Binding for Delphi 7

  • 2014年11月30日 11:17
  • 60KB
  • 下载

vi+Emacs+GCC+Make+GDB+Bash经典书籍7

  • 2008年12月20日 18:35
  • 4.88MB
  • 下载

.emacs 7-11-2012

;;yasnippet (add-to-list 'load-path               "~/.emacs.d/plugins") (require 'yasnippet-bundle) ...

【2015/7/22】SqlServer卸载重装全攻略!

请大家大声地告诉我,哪个软件最恶心。装了之后跟在电脑里面糊了一层泥,甩都甩不干净。之前手贱,重装系统后装了sqlserver2014的试用版。可惜过了半年试用期就到了。然后重装2012,2014卸载得...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:7-7-2015 .emacs 文件备份
举报原因:
原因补充:

(最多只允许输入30个字)