Live data from Hacker News

Emacs setup for Python development

caisah.info

11–20 of 56 posts

Re: Emacs setup for Python development

#11
post #10

The Emacs tutorial is a great place to start. Using Emacs is a bit of a paradigm shift in text editing, so you should expect a bit more work up front for great results later on. Going through the tutorial and learning the basic vocabulary and commands takes care of most of that up-front cost and should not take long. I think it took me less than two weeks of fairly casual use. Part of the beauty is that most of the t…

>> For some languages, Emacs is even the only option

Which ones would those be? Common Lisp using SLIME?

Re: Emacs setup for Python development

#12
Can someone link a vim setup for python, for comparison puposes, perhaps with a short feature comparison? I'm currently a vim user with a fairly basic setup (I tried st 2 but couldn't figure it out for managing my work flow) , but I find the idea of emacs attractive.

Re: Emacs setup for Python development

#13
I have a similar emacs setup with cedet, autocomplete, and whatnot, but I have one problem -- things like "evaluate this buffer" don't work when your python environment is on a remote server (due to work constraints I am obliged to do this). Files open fine over tramp, but a lot of things (python-mode, jedi, etc.) don't understand that they are interacting with a remote python shell. Is there any easy way that someone here has found to get around that?

Re: Emacs setup for Python development

#14
I have found EmacsRedux informative for learning GNUemacs. The key for me was understanding that Emacs is command driven and that shortcuts are merely shortcuts to commands - i.e. M-x invokes the of which emacs has hundreds (+ lisp expressions). Unlike shortcuts, commands can be accessed with auto-complete.

http://emacsredux.com/

Re: Emacs setup for Python development

#15
post #11
post #10

The Emacs tutorial is a great place to start. Using Emacs is a bit of a paradigm shift in text editing, so you should expect a bit more work up front for great results later on. Going through the tutorial and learning the basic vocabulary and commands takes care of most of that up-front cost and should not take long. I think it took me less than two weeks of fairly casual use. Part of the beauty is that most of the t…

>> For some languages, Emacs is even the only option Which ones would those be? Common Lisp using SLIME?

I was mostly thinking of Agda[1] and, to a lesser extent, similar languages like Coq[2] with Proof General[3].

You could write Common Lisp in Notepad if you really wanted to. I do not think using Agda would be at all practical without Emacs.

[1]: http://wiki.portal.chalmers.se/agda/pmwiki.php

[2]: http://coq.inria.fr/

[3]: http://proofgeneral.inf.ed.ac.uk/

Re: Emacs setup for Python development

#17

I have a similar emacs setup with cedet, autocomplete, and whatnot, but I have one problem -- things like "evaluate this buffer" don't work when your python environment is on a remote server (due to work constraints I am obliged to do this). Files open fine over tramp, but a lot of things (python-mode, jedi, etc.) don't understand that they are interacting with a remote python shell. Is there any easy way that someon…

If you have a remote file open with Tramp, you can also get a shell open there with M-x shell. Try doing that, running python in that shell and renaming the shell buffer to Python. It might work :P.

If that doesn't work, you might have to find the variable which specifies which buffer has the current running Python process. You should then be able to just change that to a remote shell as above.

You can also automate all of this with a bit of elisp. After you've played around with it a bit, ask around on #emacs--I'm sure there are people there both willing and able to help you out.

Re: Emacs setup for Python development

#18

Can someone link a vim setup for python, for comparison puposes, perhaps with a short feature comparison? I'm currently a vim user with a fairly basic setup (I tried st 2 but couldn't figure it out for managing my work flow) , but I find the idea of emacs attractive.

Conque shell can 'run a terminal' inside of vim, but it's a bit buggy. It's not really fair to compare vim and emacs, because vim is _just_ a text editor. Vim + screen or vim + tmux (my preference) is much closer to the same ... category of thing that emacs is.

You can split tmux tabs so that you can have vim up in one pane on a 'tab' and python running in another pane in the same 'tab'. Both tmux and screen have decent copy/paste functionality that mimics vim's movement behaviour to some degree. (Tmux also has scriptable sessions, if you like different workflows for different types of projects)

If you want a nice vim setup SPF-13 is a decent place to start. There are tmux configs everywhere. Also Ipython does a lot for you as far as completion, looking at documentation, and the like.

I think that's kind of what you're after, sorry if it's not.

Re: Emacs setup for Python development

#19

I have a similar emacs setup with cedet, autocomplete, and whatnot, but I have one problem -- things like "evaluate this buffer" don't work when your python environment is on a remote server (due to work constraints I am obliged to do this). Files open fine over tramp, but a lot of things (python-mode, jedi, etc.) don't understand that they are interacting with a remote python shell. Is there any easy way that someon…

The way I get around that is running emacs on the remote server in screen/tmux. If there's a better way I'd love to know it, but I haven't found it to be too much of a problem.

Re: Emacs setup for Python development

#20
post #19

I have a similar emacs setup with cedet, autocomplete, and whatnot, but I have one problem -- things like "evaluate this buffer" don't work when your python environment is on a remote server (due to work constraints I am obliged to do this). Files open fine over tramp, but a lot of things (python-mode, jedi, etc.) don't understand that they are interacting with a remote python shell. Is there any easy way that someon…

The way I get around that is running emacs on the remote server in screen/tmux. If there's a better way I'd love to know it, but I haven't found it to be too much of a problem.

I have tried this, and it works fine...almost :) The only problem I have is that doesn't give you some of the GUI goodness. For example, I find CEDET's code folding incredibly useful when I want to get a bird's eye view of my modules, and the CLI version doesn't seem to support drawing the expandoes.

Thanks for the tip though.

Post reply on HN