From 8132d444a315a36c5c3a8c23cef7538915e5883d Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Wed, 17 Mar 2021 11:22:44 -0400 Subject: [PATCH] add py-isort --- emacs.d/custom.el | 2 +- emacs.d/layers/python/init.el | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/emacs.d/custom.el b/emacs.d/custom.el index 722f6b8..0644ea7 100644 --- a/emacs.d/custom.el +++ b/emacs.d/custom.el @@ -4,7 +4,7 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(package-selected-packages - '(lsp-python-ms helm-lsp go-mode company projectile helm adoc-mode csv-mode php-mode python-black cython-mode scss-mode vue-mode tide rust-mode company-auctex tex-site auctex sphinx-doc company-lsp lsp-ui lsp-mode ws-butler use-package smartparens pip-requirements osx-clipboard monokai-theme markdown-mode helm-projectile helm-ag godoctor go-guru go-eldoc go-autocomplete flycheck-gometalinter doom-modeline dockerfile-mode docker-compose-mode diminish company-go company-anaconda))) + '(py-isort lsp-python-ms helm-lsp go-mode company projectile helm adoc-mode csv-mode php-mode python-black cython-mode scss-mode vue-mode tide rust-mode company-auctex tex-site auctex sphinx-doc company-lsp lsp-ui lsp-mode ws-butler use-package smartparens pip-requirements osx-clipboard monokai-theme markdown-mode helm-projectile helm-ag godoctor go-guru go-eldoc go-autocomplete flycheck-gometalinter doom-modeline dockerfile-mode docker-compose-mode diminish company-go company-anaconda))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/emacs.d/layers/python/init.el b/emacs.d/layers/python/init.el index ae2dca4..405360f 100644 --- a/emacs.d/layers/python/init.el +++ b/emacs.d/layers/python/init.el @@ -33,5 +33,12 @@ :after python :hook (python-mode . python-black-on-save-mode)) +;; Enable `isort`ing files +;; https://github.com/paetzke/py-isort.el +(use-package py-isort + :demand t + :after python + :hook (before-save . py-isort-before-save)) + ;; Enable Flycheck for python (enable-flycheck 'python-mode-hook)