43

GitHub - paetzke/py-autopep8.el: py-autopep8.el integrates autopep8 into Emacs.

 6 years ago
source link: https://github.com/paetzke/py-autopep8.el
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

py-autopep8.el

Provides commands, which use the external autopep8 tool to tidy up the current buffer according to Python’s PEP8.

To install autopep8 and py-autopep8:

$ pip install autopep8
$ wget https://raw.githubusercontent.com/paetzke/py-autopep8.el/master/py-autopep8.el \
        -O /your/path/py-autopep8.el

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

(require 'py-autopep8)
(add-hook 'python-mode-hook 'py-autopep8-enable-on-save)

You can install py-autopep8 also 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"))

Functions

M-x py-autopep8-buffer: Uses the autopep8 tool to reformat the current buffer.

Bugs and improvements

Feel free to open tickets or send pull requests with improvements. These contributors have done so.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK