Skip to content

Instantly share code, notes, and snippets.

@jmbr
Created April 9, 2021 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmbr/71d24d27648a928ec770025d6ab32248 to your computer and use it in GitHub Desktop.
Save jmbr/71d24d27648a928ec770025d6ab32248 to your computer and use it in GitHub Desktop.
Quickly switch to (or start) a Python interpreter buffer in Emacs.
(defun switch-to-python-buffer ()
"Switch to Python shell buffer quickly."
(interactive)
(let ((python-buffer (get-buffer "*Python*")))
(if python-buffer
(switch-to-buffer python-buffer)
(run-python))))
(global-set-key (kbd "C-c z") 'switch-to-python-buffer)
(global-set-key (kbd "C-c C-z") 'switch-to-python-buffer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment