Skip to content

Instantly share code, notes, and snippets.

@camdez
Created July 24, 2012 15:41
Show Gist options
  • Save camdez/3170757 to your computer and use it in GitHub Desktop.
Save camdez/3170757 to your computer and use it in GitHub Desktop.
Add keybindings to browse gists in gist.el
;; Add `b' binding to `gist-list' to browse to the current gist.
(defun gist-browse-current ()
(interactive)
(gist-browse (tabulated-list-get-id)))
(defun gist-browse (id)
(interactive)
(browse-url (concat "https://gist.github.com/" id)))
(define-key gist-list-menu-mode-map "b" 'gist-browse-current)
;; Add `C-c C-b' binding to browse to the gist currently being edited.
(defun gist-mode-browse ()
(interactive)
(gist-browse gist-id))
(define-key gist-mode-map "\C-c\C-b" 'gist-mode-browse)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment