From 8a34cf5a197f7176210cc91b5f26999676ced574 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Tue, 19 Sep 2023 10:27:25 -0400 Subject: Kanagawa theme and putting all custom commands in an mk file --- lisp/python-custom.el | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'lisp/python-custom.el') diff --git a/lisp/python-custom.el b/lisp/python-custom.el index 2c602a5..3d076cb 100644 --- a/lisp/python-custom.el +++ b/lisp/python-custom.el @@ -1,4 +1,4 @@ - +1 ;;; Code: (use-package python :ensure t) @@ -9,6 +9,19 @@ :hook ((python-mode . eglot-ensure))) +(use-package pyvenv + :ensure t + :config + (pyvenv-mode t) + + ;; Set correct Python interpreter + (setq pyvenv-post-activate-hooks + (list (lambda () + (setq python-shell-interpreter (concat pyvenv-virtual-env "bin/python3"))))) + (setq pyvenv-post-deactivate-hooks + (list (lambda () + (setq python-shell-interpreter "python3"))))) + (defun python-args-to-google-docstring (text &optional make-fields) "Return a reST docstring format for the python arguments in yas-text." (let* ((indent (concat "\n" (make-string (current-column) 32))) @@ -29,5 +42,7 @@ indent) "\n")))) +(setq python-indent-guess-indent-offset nil) + (provide 'python-custom) ;;; python-custom.el ends here -- cgit v1.2.1