Skip to content

Instantly share code, notes, and snippets.

@diasjorge
Created November 26, 2015 22:41
Show Gist options
  • Save diasjorge/74586d60c65c369a9008 to your computer and use it in GitHub Desktop.
Save diasjorge/74586d60c65c369a9008 to your computer and use it in GitHub Desktop.
(venv-initialize-interactive-shells) ;; if you want interactive shell support
(venv-initialize-eshell)
(defun activate-corresponding-virtual-env ()
(interactive)
(require 'fiplr)
(let ((dirname (file-name-nondirectory (fiplr-root))))
(message dirname)
(if (member "eureka-template" (venv-list-virtualenvs))
(venv-workon dirname))))
(add-hook 'python-mode-hook (lambda ()
(hack-local-variables)
(if (boundp 'project-venv-name)
(venv-workon project-venv-name)
(activate-corresponding-virtual-env))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment