summaryrefslogtreecommitdiff
path: root/lisp/python-custom.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/python-custom.el')
-rw-r--r--lisp/python-custom.el17
1 files changed, 16 insertions, 1 deletions
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