8

Possible Duplicate:
Emacs - tab-completion of local Python variables

Ok I am getting very confused about this.

What I want is code completion for:

  • The current file (even all open buffers)
  • Any module that is imported in the current file
  • Standard libraries

(yes I have been spoiled by intelli-sense)

What do I need to achieve this?

I'm just really confused as there seem to be countless plugins for code completion, just have no idea which ones I need/want.

Please don't suggest another editor/ide. I know a lot of them have this out of the box, but I really like emacs.

Thanks in advance.

Community
  • 1
  • 1
Steinthor.palsson
  • 6,286
  • 13
  • 44
  • 51
  • 2
    Have did ["Setup Perfect Python Environment In Emacs"](https://hide1713.wordpress.com/2009/01/30/setup-perfect-python-environment-in-emacs/), ["AutoComplete.el : Python Code Completion in Emacs"](http://www.enigmacurry.com/2008/05/09/emacs-as-a-powerful-python-ide/), ["My Emacs Python environment"](http://www.saltycrane.com/blog/2010/05/my-emacs-python-environment/) and http://stackoverflow.com/questions/750267/emacs-tab-completion-of-local-python-variables http://stackoverflow.com/questions/3856314/python-code-completion not answer your question ? – Francois G Jul 09 '11 at 06:24

1 Answers1

4

Update: I strictly use melpa package manager now, I install auto-complete from there. It is easier. I do not use this method below anymore.


I use autocomplete (docs, installation instruction)

You can install it via make (I used this), or by executing install.el, or manual installation (byte compiling)

You'll be required to add something to your init.el

;;load the auto complete path here, if you havent done it
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(require 'auto-complete-config)
(ac-config-default)

I dont know if there's any tool beside this, but so far this is good enough for me.

Note: this is for auto completion only. If you want a full blown IDE capability you can try those links on comment posted by huitseeker

Community
  • 1
  • 1
kusut
  • 1,610
  • 14
  • 24
  • 1
    also another tip: put your .emacs.d folder on version control to make your emacs setup portable – kusut Jul 09 '11 at 09:34
  • this works allright, but it only seems to complete what has already been written in the current file. Mostly what I want is completion of imported modules. Like if I 'import urllib' then all the functions of 'urllib' would be added to the auto-complete index. – Steinthor.palsson Jul 09 '11 at 23:37
  • It is. By default, auto-complete try to stay out of the way. If you want it to show you auto-completion choices all the time, set `ac-auto-start`to `t`, but you still have to type the first character. You can customize it further if you're not satisfied yet by changing the configuration. – kusut Jul 10 '11 at 07:32
  • 1
    I managed to integrate ropemacs and yasnippet into auto-complete with the help of this guide http://www.enigmacurry.com/2009/01/21/autocompleteel-python-code-completion-in-emacs/ WOrks pretty well. – Steinthor.palsson Jul 10 '11 at 18:48
  • 1
    The autocomplete links are dead – jh314 Mar 25 '15 at 15:50