用emacs写c或者c++代码用的插件的配置。功能是能够代码补齐。


(require 'package)
(package-initialize)
(add-to-list'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
(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.
'(package-selected-packages (quote (highlight-symbol ggtags auto-complete))))
(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.
)
(require 'auto-complete-config)
(ac-config-default) (setq make-backup-files nil) (require 'highlight-symbol)
(global-set-key [(control f3)] 'highlight-symbol)
(global-set-key [f3] 'highlight-symbol-next)
(global-set-key [(shift f3)] 'highlight-symbol-prev)
(global-set-key [(meta f3)] 'highlight-symbol-query-replace) (require 'cedet)
(semantic-mode 1) (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)) ;; smart complitions
(require 'semantic/ia)
(require 'semantic/bovine/gcc)
(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))
;;;; TAGS Menu
(defun my-semantic-hook ()
(imenu-add-to-menubar "TAGS"))
(add-hook 'semantic-init-hooks 'my-semantic-hook) ;;;; Semantic DataBase存储位置
(setq semanticdb-default-save-directory
(expand-file-name "~/.emacs.d/semanticdb")) (require 'semantic/db-global)
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode) ;; 使用 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-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)

c/c++ 学习互助QQ群:877684253

本人微信:xiaoshitou5854

emacs cedet的更多相关文章

  1. C 语言资源大全中文版

    C 语言资源大全中文版 我想很多程序员应该记得 GitHub 上有一个 Awesome - XXX 系列的资源整理.awesome-c 是 koz.ross 发起维护的 C 语言资源列表,内容包括了: ...

  2. emacs工程管理,cedet ede插件自动构建Make,Automake

    鉴于自己一直都是在做客户端开发方面的工作,服务端很多知识都随着时间淡忘了,最近有一个计划,用一些时间补一下基础.所以早上很早就起床,花了一点时间大致浏览了一下BSD socket的相关API,然后用G ...

  3. 为了树莓派IIraspberrypi安装emacs+ecb+cedet+session+color-theme+cscope+linum

    类似这篇文章写的不多,为了避免以后大家转来转去而忽略了写文章的时间,这些特别加上是2014年6月28日,省的对不上一些软件的版本号(下文中有些"最新"的说法就相应这个时间).假设转 ...

  4. Emacs-24.1 + ECB-2.40 + cscope-15.7a + cedet 无root权限指定目录安装与配置

    emacs等安装在-/INSTALL目录下,在-下新建一个INSTALL目录. 1. emacs-24.1.tar.gz ecb-2.40.tar.gz cscope-15.7a.tar.bz2下载到 ...

  5. Emacs 24.3 配置JDEE(http://blog.csdn.net/csfreebird/article/details/19033939)

    最近要重回Java编程,所以打算在最新版本的Emacs 24.3上配置JDEE,听说会有些问题,特此记录安装过程. Emacs 24.3内置了CEDET, 版本是2.0, 这是一个让人困惑的事情,因为 ...

  6. emacs配置详解及C/C++IDE全功能配置演示(附配置文件)

    我的emacs插件下载地址: http://pan.baidu.com/share/link?shareid=4196458904&uk=3708780105 说明: 1.为什么使用emacs ...

  7. Emacs配置erlang开发环境(.emacs 文件)

    以前都是用sublime写erlang代码,好处不多说,主要是觉得一点不好用,不能实现函数跳转,及其不方便,尤其是代码一多,头疼.后来折腾过IntelliJ,下了个收费$0.00的版本,风格还是挺稀饭 ...

  8. emacs 配置

    个人的Emacs配置,环境是archlinux,参考了不少网上资料,因为太多,就不一一列举了,在这里感谢那些作者的辛苦经验劳动. (custom-set-variables ;; custom-set ...

  9. 当python模式遇见cedet

    TAG: emacs, python, cedet, semantic, ctags DATE: 2013-08-20 我用Emacs 24写python程序. 发现屏幕不时有些闪动,MiniBuff ...

随机推荐

  1. MySQL 主从复制(实时热备)原理与配置

    MySQL是现在普遍使用的数据库,但是如果宕机了必然会造成数据丢失.为了保证MySQL数据库的可靠性,就要会一些提高可靠性的技术.MySQL主从复制可以做到实时热备数据.本文介绍MySQL主从复制原理 ...

  2. Shell命令-网络操作之基础之ping、route

    文件及内容处理 - ping.route 1. ping:测试主机之间网络的连通性 ping命令的功能说明 ping 命令用于检测主机.执行 ping 指令会使用 ICMP 传输协议,发出要求回应的信 ...

  3. window系统下的pycharm对虚拟机中的Ubuntu系统操作MySQL数据库

    问题:程序员和数据库的爱情故事:程序为了追一个叫MySQL数据库的姑娘,先苦练功夫,自己模拟泡妹过程积累经验,于是想到一个解决方法:[解决虚拟机跑需要连接数据库的程序卡的问题,通过在物理机Window ...

  4. input 控件常用属性

  5. 如何下载安装MySQL 解压版和安装版以及2个版本的区别

    参考链接:https://blog.csdn.net/qq_33800083/article/details/80722829

  6. [C9] 降维(Dimensionality Reduction)

    降维(Dimensionality Reduction) 动机一:数据压缩(Motivation I : Data Compression) 数据压缩允许我们压缩数据,从而使用较少的计算机内存或磁盘空 ...

  7. CF1225B2 TV Subscriptions (Hard Version)

    CF1225B2 TV Subscriptions (Hard Version) 洛谷评测传送门 题目描述 The only difference between easy and hard vers ...

  8. <Tree> 298 250 366 199(高频) 98(高频)

    298. Binary Tree Longest Consecutive Sequence 先序遍历,根左右.如果该节点的 value == 父节点value + 1, 则长度+1; 否则重置为1. ...

  9. [PKUSC2018]最大前缀和(状压DP)

    题目大意:求给定的 $n$ 个数的所有排列的最大前缀和(不能为空)之和对 $10^9+7$ 取模的值. $1\le n\le 20,1\le\sum|a_i|\le 10^9$. 神级DP.杂题选讲的 ...

  10. 安装pip-9.0.1-py2.py3-none-any.whl

    pip的安装 1.从https://pypi.python.org/pypi/pip#downloads下载所需的.whl文件 2.将下载的文件放入Python的根目录 我的根目录是F:\Python ...