dfdeshom / py-autopep8.el

py-autopep8.el integrates autopep8 into Emacs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

py-autopep8.el

https://travis-ci.org/paetzke/py-autopep8.el.svg?branch=master http://melpa.org/packages/py-autopep8-badge.svg

Provides the py-autopep8 command, which uses the external autopep8 tool to tidy up the current buffer according to Python’s PEP8.

Install autopep8 and download py-autopep8.el

$ pip install autopep8
$ wget http://git.vanneva.com/py-autopep8.el.git/blob_plain/HEAD:/py-autopep8.el \
       -O /your/path/py-autopep8.el

Add the before-save-hook to your ~/.emacs

(add-to-list 'load-path "/your/path/")
(require 'py-autopep8)
(add-hook 'before-save-hook 'py-autopep8-before-save)

You can also install py-autopep8 with MELPA:

M-x package-install RET
py-autopep8 RET

Now every time you save your Python file autopep8 will be executed on the current buffer.

To customize the behaviour of “autopep8” you can set the py-autopep8-options e.g.

(setq py-autopep8-options '("--max-line-length=100"))

CREDITS

Thanks to:

CHANGELOG

0.5

  • Fixed typo.

0.4

  • Replaced incf and decf.

0.3

  • Added check if autopep8 executable is present.

0.2

  • Added options to change autopep8’s behaviour.

0.1

  • Renamed functions: This will break your code.

Copyright (c) 2013-2014, Friedrich Paetzke (paetzke@fastmail.fm). All rights reserved.

About

py-autopep8.el integrates autopep8 into Emacs.

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 84.7%Language:Shell 14.7%Language:Python 0.6%