Using CEDET and ECB with Emacs
来源:互联网 发布:opencv分水岭分割算法 编辑:程序博客网 时间:2024/05/16 16:05
原文地址:https://cxwangyi.wordpress.com/2010/08/21/using-cedet-with-emacs/
Using CEDET and ECB with Emacs
(I tested the following procedure about installing and customizing CEDET for Emacs with GNU Emacs 23 under Ubuntu and Snow Leopard.)
Installation
Install CEDET
Download the source package of CEDET
Unpack to ~/.emacs.d/cedet (or other places)
Compile the package using command
1
emacs -Q -nw -l cedet-build.el -f cedet-build -f save-buffers-kill-terminal
Install external tag systems (optionally required by CEDET)
GNU Global, and/or
exuberent ctags
Install ECB
Download the source package of ECB.
Unpack into ~/.emacs.d/ecb (or any other directory)
Customization
An excellent tutorial about customizing CEDET is here. The author also published his .emacs file which contains a few flaws. Mine based on his is as follows:
;; CEDET(load-file "~/.emacs.d/cedet-1.0pre7/common/cedet.el") (global-ede-mode 'nil) ; do NOT use project manager (semantic-load-enable-excessive-code-helpers) (require 'semantic-ia) ; names completion and display of tags(require 'semantic-gcc) ; auto locate system include files (semantic-add-system-include "~/3rd-party/boost-1.43.0/include/" 'c++-mode)(semantic-add-system-include "~/3rd-party/protobuf-2.3.0/include" 'c++-mode) (require 'semanticdb)(global-semanticdb-minor-mode 1) (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-c>" 'semantic-complete-analyze-inline) (local-set-key "\C-c=" 'semantic-decoration-include-visit) (local-set-key "\C-cj" 'semantic-ia-fast-jump) (local-set-key "\C-cq" 'semantic-ia-show-doc) (local-set-key "\C-cs" 'semantic-ia-show-summary) (local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle) (local-set-key "\C-c+" 'semantic-tag-folding-show-block) (local-set-key "\C-c-" 'semantic-tag-folding-fold-block) (local-set-key "\C-c\C-c+" 'semantic-tag-folding-show-all) (local-set-key "\C-c\C-c-" 'semantic-tag-folding-fold-all) )(add-hook 'c-mode-common-hook 'my-cedet-hook) (global-semantic-tag-folding-mode 1) (require 'eassist) ;(concat essist-header-switches ("hh" "cc"))(defun alexott/c-mode-cedet-hook () (local-set-key "\C-ct" 'eassist-switch-h-cpp) (local-set-key "\C-xt" 'eassist-switch-h-cpp) (local-set-key "\C-ce" 'eassist-list-methods) (local-set-key "\C-c\C-r" 'semantic-symref) )(add-hook 'c-mode-common-hook 'alexott/c-mode-cedet-hook) ;; gnu global support(require 'semanticdb-global)(semanticdb-enable-gnu-global-databases 'c-mode)(semanticdb-enable-gnu-global-databases 'c++-mode) ;; ctags(require 'semanticdb-ectag)(semantic-load-enable-primary-exuberent-ctags-support) (global-semantic-idle-tag-highlight-mode 1)
Using CEDET
control return: whatever the symbol you are typing, this hot key automatically complete it for you.
C-c?: another way to complete the symbol you are typing
C-c>: when you typed . or -> after an object name, use this key to show possible public member functions or data members.
C-cj: jump to the definition of the symbol under cursor
C-cs: show a summary about the symbol under cursor
C-cq: show the document of the symbol under cursor
C-c=: visit the header file under cursor
C-cp: toggle between the implementation and a prototype of symbol under cursor
C-ce: when your cursor is in the scope of a class or one of its member function, list all methods in the class
C-cC-r: show references of the symbol under cursor
C-cC-c-: fold all
C-cC-c+: unfold all
C-c-: fold the block under cursor
C-c+: unfold the block under cursor
Using ECB
Once CEDET is installed and customized, we can use ECB. Add the following lines into your .emacs file:
(add-to-list 'load-path "~/.emacs.d/ecb-2.40")(require 'ecb)(require 'ecb-autoloads)
In Emacs, we can use M-x ecb-activate to turn on ECB mode. This page shows how to byte compile ECB to make it runs fast.
- Using CEDET and ECB with Emacs
- Emacs、cedet、ecb
- Emacs + ECB + CygWin + Cedet
- 为Emacs安装Cedet+Ecb
- emacs 安装 CEDET ECB 笔记
- emacs 安装cedet和ecb
- Emacs+Cedet+Ecb折腾日记
- emacs 24安装ecb与cedet
- emacs 中使用 ecb & cedet 阅读代码
- Emacs搭建开发环境(ECB+Cedet)
- 用 Emacs+ecb 后 +cedet阅读代码
- emacs配置大全(cedet+ecb+cscope+gdb-ui)-jzj
- 程序员的emacs配置大全(cedet+ecb+cscope+gdb-ui)
- emacs的java编程环境设置(jdee,lib,cedet,ecb
- Emacs配置 gtags+cedet+ecb+doxymacs+session+gdb
- emacs 24 IDE配置(YASnippet、ECB、Cedet、Auto-complete)
- 用emacs 建立开发环境,安装ecb和cedet的全过程
- 程序员的emacs配置大全(cedet+ecb+cscope+gdb-ui)-jzj
- iOS CATrasition
- [架构设计] 什么是业务逻辑
- 并查集 codeforces party
- iOS CAAnimationGroup
- Windows系统下Memcached缓存系列二:CouchbaseClient(c#客户端)的详细试用,单例模式
- Using CEDET and ECB with Emacs
- System.out.print与System.out.println的区别
- [leetcode]Construct Binary Tree from Inorder and Postorder Traversal (利用中序遍历和后续遍历确定一颗二叉树)
- node.js中结合redis实现session
- 《程序员修炼之道:从小工到专家》读书笔记
- mac+virtualbox+centos7+docker搭建lnmp环境
- \n与\r的区别
- Using GitHub for Windows with non-GitHub repositories
- [leetcode]Convert Sorted Array to Binary Search Tree (有序数组转化为二叉搜索树 C语言)