diff options
Diffstat (limited to 'emacs/inits/20-programming.el')
| -rw-r--r-- | emacs/inits/20-programming.el | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/emacs/inits/20-programming.el b/emacs/inits/20-programming.el index 89dc13c..837a2e5 100644 --- a/emacs/inits/20-programming.el +++ b/emacs/inits/20-programming.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2025-07-01 10h19 BST (anker)> +;; Time-stamp: <2025-07-03 19h02 BST (anker)> ;; ----------------------------------------------------------------------------- ;; General setup @@ -26,7 +26,7 @@ (add-to-list 'eglot-server-programs '(bqn-mode . ("bqnlsp"))) (add-to-list 'eglot-server-programs - '(python-mode . ("pyright-langserver" "--stdio")))) + '(python-ts-mode . ("pyright-langserver" "--stdio")))) (use-package treesit-auto :custom @@ -59,7 +59,7 @@ (when (not (eq major-mode 'text-mode)) (hs-minor-mode)) (setq auto-hscroll-mode t) - (when (not (eq major-mode 'python-mode)) + (when (not (eq major-mode 'python-ts-mode)) (keymap-set (current-local-map) "M-/" 'completion-at-point)) ) @@ -197,11 +197,21 @@ ;; ----------------------------------------------------------------------------- ;; Python -(use-package lazy-ruff - :ensure t - :config - (lazy-ruff-mode-global-toggle t) - (setq lazy-ruff-check-command "ruff check --fix -s --select I")) + +(use-package reformatter + :ensure) + +(reformatter-define ruff-fix + :program "ruff" + :args (list "check" "--fix" input-file) + :stdout nil + :stdin nil) + +(reformatter-define ruff-format + :program "ruff" + :args (list "format" input-file) + :stdout nil + :stdin nil) (use-package highlight-indent-guides :ensure @@ -211,18 +221,17 @@ highlight-indent-guides-auto-even-face-perc 5)) (use-package python - :hook (python-mode . (lambda () - (require 'highlight-indent-guides) - (highlight-indent-guides-mode t) - (ruff-format-on-save-mode) - (eglot-ensure) - (visual-line-mode))) - - :bind (:map python-mode-map + :hook (python-ts-mode . (lambda () + (require 'highlight-indent-guides) + (highlight-indent-guides-mode t) + (ruff-format-on-save-mode) + (ruff-fix-on-save-mode) + (eglot-ensure) + (visual-line-mode))) + + :bind (:map python-ts-mode-map ("C-c C-f" . nil) - ("M-/" . hippie-expand)) - :config - (setq python-ts-mode-hook python-mode-hook)) + ("M-/" . hippie-expand))) ;; ----------------------------------------------------------------------------- ;; Rust |
