Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(defun switch-to-buffer-if-exists (nm)
(if (get-buffer nm)
(switch-to-buffer nm)
(message (format "Buffer %s does not exist" nm))))
(defun switch-to-buffer-if-exists-cmd (nm)
(lambda ()
(interactive)
(switch-to-buffer-if-exists nm)))
(global-set-key (kbd "C-0")
(switch-to-buffer-if-exists-cmd "*nrepl*"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment