on i4PACE(i for Personal Archiving and Creating Environment)
actions » SearchLogin 89 articles • 30 Jul 2010

Article with comments

Thursday, 01 Oct 2009

permalink Autocompletion and snippets in emacs

Got interested in autocompletion (code-assist, code-completion) and snippets in editors. This article shows a way to incorporate such features on emacs. i'm not familiar with emacs, but will try because a demo video of yasnippets looked interesting.

Instead of following the article mentioned above, i'm going to try Ubuntu repositories.

> sudo apt-get install python-rope
> sudo apt-get install pymacs
> sudo apt-get install python-ropemacs
> sudo apt-get install python-mode
> sudo apt-get install pylint

To install yasnippet, download

> mkdir -p ~/.emacs.d/plugins
> cd ~/.emacs.d/plugins
> svn checkout http://yasnippet.googlecode.com/svn/trunk/ yasnippet_svn

Follow the instruction given at http://yasnippet.googlecode.com/svn/trunk/doc/index.html Create ~/.emacs and edit as

(add-to-list 'load-path
              "~/.emacs.d/plugins/yasnippet_svn")
(require 'yasnippet)
(yas/initialize)
(yas/load-directory "~/.emacs.d/plugins/yasnippet_svn/snippets")

Launch emacs, open ~/.emacs.d/plugins/yasnippet_svn/yasnippet.el, and run in mini buffer, alt-x eval-buffer. Now i see a menu Python and YAsnippet: [[image: emacs_yasnippet.png]]

Emacs auto-complete package is found at http://code.google.com/p/auto-complete/. Download

> cd ~/.emacs.d/plugins
> hg clone https://auto-complete.googlecode.com/hg/ auto-complete_hg

Follow the instruction in auto-complete.el. (I noticed the author is Japanese. Thanks Matsuyama-san :-) ) It's verson 0.3.0 alpha.

Did

> cp -R auto-complete ~/.emacs.d/plugins/

Added to ~/.emacs

(add-to-list 'load-path
        "~/.emacs.d/plugins/auto-complete_hg")
(require 'auto-complete)
(global-auto-complete-mode t)
(define-key ac-complete-mode-map "\C-n" 'ac-next)
(define-key ac-complete-mode-map "\C-p" 'ac-previous)
 (define-key ac-complete-mode-map "\t" 'ac-complete)
 (define-key ac-complete-mode-map "\r" nil)

Auto-complete is not working >) Lookng at http://www.enigmacurry.com/2009/01/21/autocompleteel-python-code-completion-in-emacs/... may try some time later.

• Wrote Teru at 11:38 (edited 8×, last on 03 Oct 2009) | read 129× | Add comment

Comments (3)

9CwW7n <a href="http://lwbpsplredlp.com/">lwbpsplredlp</a>, asesmepcttra, [link=http://tnwfubqdhyce.com/]tnwfubqdhyce[/link], http://gxhwglvqkkoa.com/

• wrote ddckeulx (ip) on 05 Jan 2010, 01:22  permalink

auto insurance tgv auto insurance 5401 health insurance 0579 auto insurance 327977

• wrote location (ip) on 03 Feb 2010, 04:29  permalink

buy pills tramadol 096 accutane =D crownpills valium american express pay haw what is ambien hjwxoi

• wrote eurycantha (ip) on 10 Mar 2010, 16:33  permalink


Write a comment

Your name  
E-mail   (only visible for blog owner)
Homepage
How much is 4+6?   (protection against spam-bots)
Text:

[b] [i] [u] [tt] [center] [code] [quote] [url] [url=] [img] [@] [@@] [@:]
detailed help about markup
Process times: page=0.033 request=0.049 cpu=0.050