diff options
| author | Christian Cunningham <cc@local.lan> | 2026-02-27 23:36:33 -0800 |
|---|---|---|
| committer | Christian Cunningham <cc@local.lan> | 2026-02-27 23:36:33 -0800 |
| commit | 542a1eaf958ab80d9eaa062d185ee87281e82fcd (patch) | |
| tree | 56f9a142e5f93e3c8c16eb5638a83a1f5670daf1 | |
| parent | c72713d05cd1ff9f1655bf1b33db1dca753119a4 (diff) | |
| -rw-r--r-- | elchemy-package-pyvenv.el | 14 | ||||
| -rw-r--r-- | elchemy-packages.el | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/elchemy-package-pyvenv.el b/elchemy-package-pyvenv.el new file mode 100644 index 0000000..dc0c9f6 --- /dev/null +++ b/elchemy-package-pyvenv.el @@ -0,0 +1,14 @@ +(use-package pyvenv + :ensure t + :config + (pyvenv-mode t) + ;; Set correct Python interpreter when environment activates + (add-hook 'pyvenv-post-activate-hooks + (lambda () + (setq python-shell-interpreter (concat pyvenv-virtual-env "bin/ipython3")))) + ;; Reset interpreter when environment deactivates + (add-hook 'pyvenv-post-deactivate-hooks + (lambda () + (setq python-shell-interpreter "python3")))) + +(provide 'elchemy-package-pyvenv) diff --git a/elchemy-packages.el b/elchemy-packages.el index 433500c..543ef1a 100644 --- a/elchemy-packages.el +++ b/elchemy-packages.el @@ -31,6 +31,8 @@ (require 'elchemy-package-ido) ;; Snippets (require 'elchemy-package-yasnippet) +;; PyVenv Mode +(require 'elchemy-package-pyvenv) ;; HTML Highlighting (use-package htmlize :ensure t) |
