Old Biboroku

Wednesday, April 28, 2010

python-mode.el for Emacs

Filed under: Linux,Mac OS X,Snow Leopard — nomo17k @ 21:38
Tags: , , , , ,

On Debian, you can simply install the package “python-mode,” but this describes the manual method.

For OS X (I currently use Snow Leopard), I can install the python-mode package via FinkCommander.

First, download python-mode.el and place it under ~/.emacs.d (create this directory if it does not exist).

Then add the following lines to your Emacs configuration file ~/.emacs:

(load “~/.emacs.d/python-mode.el”)
;;python
(setq auto-mode-alist (cons ‘(“\\.py$” . python-mode) auto-mode-alist))
(setq interpreter-mode-alist (cons ‘(“python” . python-mode)
interpreter-mode-alist))
(autoload ‘python-mode “python-mode” “Python editing mode.” t)

(global-font-lock-mode t)
(font-lock-mode +1)

That’s it.

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.