用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. Ubuntu18.04连接蓝牙耳机

    使用的耳机是索尼WI-SP500,打开设置,找到Bluetooth,直接连接(WI-SP500在连接第二台设备时,需要长按开机键7秒才行), 保证Output选择需要连接的耳机,然后确保Profile ...

  2. jwt揭秘(含源码示例和视频)

    JSON Web Tokens,是一种开发的行业标准 RFC 7519 ,用于安全的表示双方之间的声明.目前,jwt广泛应用在系统的用户认证方面,特别是现在前后端分离项目. 1. jwt认证流程 在项 ...

  3. day64_10_8 vue的导入

    一.简介 vue是一个渐进式的js框架.具体介绍查看官网: https://cn.vuejs.org 在vue框架中,有两个文件,当在开发阶段时使用完整版vue,因为有报错信息,而在上市阶段可以使用m ...

  4. 基于Apache和tomcat实现负载均衡

    1.基于Apache和tomcat实现负载均衡 准备三个虚拟机一个安装Apache两个安装Tomcat 关闭防火墙 systemctl stop firewalld Iptabled -F Seten ...

  5. django restful framework教程大全

    一. 什么是RESTful REST与技术无关,代表的是一种软件架构风格,REST是Representational State Transfer的简称,中文翻译为“表征状态转移” REST从资源的角 ...

  6. Salesforce学习之路(八)一次拉取多个文件或全部文件至本地

    在开发中,经常会遇到本地工程错乱或者误操作导致本地本地项目被删除,此时利用SFDX: Retrieve Source from Org只会拉取新建并且名称相同的组件,若通过创建一个个文件,然后再拉取的 ...

  7. Kubernetes Deployment(部署无状态应用)

    Kubernetes Deployment(部署无状态应用) Pod与controllers的关系 • controllers:在集群上管理和运行容器的对象 • 通过label-selector相关联 ...

  8. Hashtable 负载因子Load Factor

    负载因子(load factor),它用来衡量哈希表的 空/满 程度,一定程度上也可以体现查询的效率,计算公式为: The ratio of the number of elements in the ...

  9. Binding ,抄自 http://www.cnblogs.com/cnblogsfans/archive/2011/02/19/1958586.html

    1. 绑定到其它元素 <Grid> <StackPanel > <TextBox x:Name="textBox1" Height="150 ...

  10. WPF 有任何Focus问题,就找 Keyboard_Navigation

    牛牛的博客 https://www.cnblogs.com/smallidea/p/3412699.html 参照官网教程: https://docs.microsoft.com/en-us/dotn ...