Automatically format Python files
This commit is contained in:
parent
01532fbac6
commit
265541d135
2 changed files with 17 additions and 1 deletions
|
|
@ -168,6 +168,18 @@
|
|||
("C-c C-l" . nil))
|
||||
:hook ((python-mode . load-python-env)))
|
||||
|
||||
; Requires the Python package "black"
|
||||
(use-package blacken
|
||||
:hook (python-mode . blacken-mode))
|
||||
|
||||
; Requires the Python package "isort"
|
||||
(use-package py-isort
|
||||
:hook (before-save . (lambda ()
|
||||
(when (bound-and-true-p blacken-mode)
|
||||
(py-isort-before-save))))
|
||||
:config
|
||||
(setq py-isort-options '("--profile" "black")))
|
||||
|
||||
;; Jupyter notebook integration
|
||||
(use-package ein
|
||||
:bind (("C-z j" . ein:run)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue