From dba7a443d0edb88869c4df70622543a465cf9304 Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 17 Aug 2026 10:20:11 +0100 Subject: python tweaks --- custom/jao-custom-programming.el | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'custom/jao-custom-programming.el') diff --git a/custom/jao-custom-programming.el b/custom/jao-custom-programming.el index e357e38..aed4d29 100644 --- a/custom/jao-custom-programming.el +++ b/custom/jao-custom-programming.el @@ -633,21 +633,36 @@ :ensure t :hook (python-mode . uv-mode-auto-activate-hook)) +(use-package pyinspect + :ensure t) + (use-package python + :ensure t :init (setq-default eglot-workspace-configuration '((:python . (:analysis (:typeCheckingMode "off"))))) (setq python-shell-interpreter "uv" - python-shell-interpreter-args "run ipython -i --simple-prompt" + ;; python-shell-interpreter-args "run ipython -i --simple-prompt" python-shell-interpreter-args "run python -i") (defun jao-python-mode-hook () (setq-local eglot-prefer-plaintext t) (eglot-ensure)) + ;; (with-eval-after-load 'eglot ;; (add-to-list 'eglot-server-programs ;; '((python-base-mode :language-id "python") . ("ty" "server")))) - :hook (python-base-mode . jao-python-mode-hook)) + (defun jao-inferior-python-mode-hook () + (setq-local comint-input-ring-file-name "~/.emacs.d/cache/python_history") + (comint-read-input-ring 'silent) + (add-hook 'kill-buffer-hook #'comint-write-input-ring nil t)) + + :hook ((python-base-mode . jao-python-mode-hook) + (inferior-python-mode . jao-inferior-python-mode-hook)) + + :bind (:map inferior-python-mode-map + ("M-p" . comint-previous-matching-input-from-input) + ("M-n" . comint-next-matching-input-from-input))) ;;;; Javascript -- cgit v1.2.3