diff options
| author | tslilc <tslil@posteo.de> | 2025-06-04 15:39:07 +0100 |
|---|---|---|
| committer | tslilc <tslil@posteo.de> | 2025-06-04 15:39:07 +0100 |
| commit | 08dbff5e3b8e8e22cfecaddf9cdfc4e0e8e5c399 (patch) | |
| tree | 1d7978f69ab45be9cfa2f3d50801b7c3841acdd2 /emacs/inits | |
| parent | 75f8947b7b17ad650f821242858898904f374431 (diff) | |
[emacs] fix python lsp, black/isort order
Diffstat (limited to 'emacs/inits')
| -rw-r--r-- | emacs/inits/20-programming.el | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/emacs/inits/20-programming.el b/emacs/inits/20-programming.el index 02f95ed..b7838d4 100644 --- a/emacs/inits/20-programming.el +++ b/emacs/inits/20-programming.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2024-07-13 15h00 CEST (471b3659)> +;; Time-stamp: <2025-06-04 15h38 BST (4b100887)> ;; ----------------------------------------------------------------------------- ;; General setup @@ -24,7 +24,9 @@ :defer :config (add-to-list 'eglot-server-programs - '(bqn-mode . ("bqnlsp")))) + '(bqn-mode . ("bqnlsp"))) + (add-to-list 'eglot-server-programs + '(python-mode . ("pyright-langserver" "--stdio")))) (use-package centered-window :defer @@ -188,13 +190,18 @@ ;; ----------------------------------------------------------------------------- ;; Python +(use-package python-isort + :defer + :ensure + :commands python-isort-buffer + ) + (use-package python-black :defer - :after python + :ensure + :commands python-black-buffer :config - (setq python-black-extra-args '("-l120")) - ;; :hook (python-mode . python-black-on-save-mode-enable-dwim) - ) + (setq python-black-extra-args nil)) (use-package highlight-indent-guides :ensure @@ -205,8 +212,16 @@ (use-package python :hook (python-mode . (lambda () + (require 'highlight-indent-guides) (highlight-indent-guides-mode t) + (eglot-ensure) (visual-line-mode))) + :init + (defun my-python-save-hook () + (python-isort-buffer) + (python-black-buffer)) + + :hook (before-save-hook . my-python-save-hook) :bind (:map python-mode-map ("C-c C-f" . nil) ("M-/" . hippie-expand))) |
