Created
July 24, 2012 15:41
-
-
Save camdez/3170757 to your computer and use it in GitHub Desktop.
Add keybindings to browse gists in gist.el
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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