mgalgs / pyimpsort.el

Sort python imports

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emacs Logo

pyimpsort.el

Sort python imports.


License GPLv3 MELPA

pyimpsort.el sort the python imports of a file. Currently uses pyimpsort.py to process the way to sort python imports.

Setup

Add the following snippet to your init.el:

(require 'pyimpsort)
(eval-after-load 'python
  '(define-key python-mode-map "\C-c\C-u" #'pyimpsort-buffer))

Troubleshooting

  • Doesn't sort correctly third party libraries

    pyimpsort.el tries to identify the third party libraries if are installed in in the PYTHONPATH, if a package is not installed it is assumed that belongs to the application. pyimpsort.el also tries to identify if a python virtualenv is activated.

Related projects

Customization Documentation

pyimpsort-display-error-buffer

Display error buffer on error.

pyimpsort-error-buffer-name

Buffer name of pyimpsort error.

Function and Macro Documentation

(pyimpsort-region BEGIN END)

Sort python imports from region BEGIN to END points.

(pyimpsort-buffer)

Sort python imports from current buffer.


Markdown README file generated by make-readme-markdown.el

About

Sort python imports


Languages

Language:Python 55.3%Language:Emacs Lisp 32.0%Language:Shell 6.9%Language:Makefile 5.8%