diff --git a/emacs/.emacs.d/config/init-python.el b/emacs/.emacs.d/config/init-python.el index f716ddd..18c5aa5 100644 --- a/emacs/.emacs.d/config/init-python.el +++ b/emacs/.emacs.d/config/init-python.el @@ -32,6 +32,17 @@ default-directory))) (add-to-list 'flycheck-disabled-checkers 'python-flake8)) +;; Run a python repl at the project root +(defun projectile-run-python () + (interactive) + (let ((default-directory (projectile-project-root))) + (call-interactively #'run-python))) + +(with-eval-after-load 'projectile + (general-def projectile-command-map + "s p" #'projectile-run-python + "x p" #'projectile-run-python)) + ;; pyvenv to track virtual environments (use-package pyvenv :defer 3