https://github.com/emacs-pe/pyimpsort.el.git
git clone 'git://github.com/emacs-pe/pyimpsort.el.git'
Sort python imports. -- lexical-binding: t --
pyimpsort.el
sort the python imports of a file.
Currently uses pyimpsort.py to process the way to sort python
imports.
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))
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.
(pyimpsort-region BEGIN END)
Sort python imports from region BEGIN to END points.
(pyimpsort-buffer)
Sort python imports from current buffer.
—–