ecb is abbrreviation of the Emacs Code Browser. It has dependency with cedet(a Collection of Emacs Development Environment Tools). And yasnippet is google hosted template system to allow you to type an abbreviation and expand into function templates; supported languages are C, C++, C#, Perl, Python, Ruby, SQL, LaTeX, HTML, CSS and more.
First, install the cedet.
1. Download cedet's lastest tar file from https://sourceforge.net/projects/cedet/files/
2. Untar the file in ~/emacs.d/cedet-1.0
# tar xvf cedet-1.0.tar.gz
# mv cedet-1.0 ~/emacs.d/
3. Make it.
# cd ~/emacs.d/cedet-1.0
# find . -name Makefile -exec touch {} \;
# make
4. Create configuration file named cedet-1.0.el in ~/emacs.d/.
=============== cedet-1.0.el ================
;; Load CEDET.
;; See cedet/common/cedet.info for configuration details.
(load "~/.emacs.d/cedet-1.0/common/cedet")
;; (load-file "~/.emacs.d/cedet-1.0/common/cedet.el")
;; Enable EDE (Project Management) features
(global-ede-mode 1)
;; Enable EDE for a pre-existing C++ project
;; (ede-cpp-root-project "NAME" :file "~/myproject/Makefile")
;; Enabling Semantic (code-parsing, smart completion) features
;; Select one of the following:
;; * This enables the database and idle reparse engines
(semantic-load-enable-minimum-features)
;; * This enables some tools useful for coding, such as summary mode
;; imenu support, and the semantic navigator
(semantic-load-enable-code-helpers)
;; * This enables even more coding tools such as the nascent intellisense mode
;; decoration mode, and stickyfunc mode (plus regular code helpers)
;; (semantic-load-enable-guady-code-helpers)
;; Enable SRecode (Template management) minor-mode.
;; (global-srecode-minor-mode 1)
=============== End of cedet-1.0.el =============
Next, install ecb
1. Download ecb's lastest tar file https://sourceforge.net/projects/ecb/files/
2. Untar the file in ~/emacs.d/ecb-2.40
# tar xvf ecb-2.40.tar.gz
# mv ecb-2.40 ~/emacs.d/
3. Edit Makefile in ~/emacs.d/ecb-2.40.
change
CEDET=c:/Programme/emacs-21/site-lisp/package-development/cedet
into
CEDET=~/.emacs.d/cedet-1.0
3. Make it.
# cd ~/emacs.d/ecb-2.40
# make
4. Create configuration file named cedet-2.40.el in ~/emacs.d/.
================= cedet-2.40.el ===================
;; (require 'ecb-autoloads) 사용하면 folding-mode와 ecb가 충돌함
;; (require 'ecb) 사용해야함
(add-to-list 'load-path
"~/.emacs.d/ecb-2.40/")
;; * If you want to load the complete ECB at (X)Emacs-loadtime (Advantage: All
;; ECB-options available after loading ECB). Disadvantage: Increasing
;; loadtime):
(require 'ecb)
;; * If you want to load the ECB first after starting it by `ecb-activate'
;; (Advantage: Fast loading. Disadvantage: ECB- and semantic-options first
;; available after starting ECB):
;; (require 'ecb-autoloads)
;; * This loads all available autoloads (e.g. `ecb-activate', `ecb-minor-mode',
;;`ecb-show-help' or `ecb-byte-compile') of current ECB.
============= End of cedet-2.40.el ===================
Next, install yasnippet bundle described as http://code.google.com/p/yasnippet/.
1. Download yasnippet-bundle's lastest tar file inhttp://code.google.com/p/yasnippet/
2. Untar the file in ~/emacs.d/
# tar xvf yasnippet-0.6.1c.tar.bz2
# mv yasnippet-bundle.el ~/emacs.d/
Finally, create or change ~/.emacs like as
============== .emacs ==================
(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.
'(column-number-mode t)
'(ecb-options-version "2.40")
'(scroll-bar-mode (quote right))
'(show-paren-mode t))
(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.
)
;; ColorTheme
(require 'color-theme)
(color-theme-initialize)
(color-theme-arjen)
(load "~/.emacs.d/cedet-1.0.el")
(load "~/.emacs.d/ecb-2.40.el")
(load "~/.emacs.d/yasnippet-bundle.el")
============== End of .emacs ==================
Then, You looks like this with checking Tool->Start Code Browser(ECB)
댓글 없음:
댓글 쓰기