Update 04/08/2014: It seems like this post has been helpful for a
lot of people, which really makes me happy! I just wanted to let new
readers coming by know that the configuration I present in this post
is out-of-date. However, I have my
Emacs configuration on GitHub,
and do try to keep it up-to-date. If you have any difficulties
getting the configuration in the GitHub to work, please do submit a
bug request and I will try to help you fix the problem.
As I mentioned in last week’s post, I am a heavy Emacs user and find
it invaluable as an environment for my research. In particular, I use
Emacs most for data analysis and modeling in Python, including an
interface to IPython, which allows me to quickly switch between
writing and running snippets of code. This proves to be a great
replacement MATLAB, at least in my opinion.
I frequently get requests for my .emacs configuration file or
questions about how I have such an environment set up. As such, in
this post I’m going to document how to set up your Emacs configuration
to support rapid Python development, including the plugins I have
installed and the keyboard shortcuts I use most often.
Note that I am running GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK
Version 2.24.5). I have never tried running it under OSX or Windows,
so I can’t guarantee that these instructions will transfer, but you
are welcome to try. If you run into any inconsistencies, feel free to
send them to me and I will update this post accordingly!
Also, if you are new to Emacs, please read my beginner’s guide
first, as I will be assuming familiarity with basic Emacs
functionality and terminology. I will also assume you can at least
read and understand LISP to some extent (but you don’t necessarily
have to be able to write it).