Last active
December 30, 2015 09:29
-
-
Save davidsnyder/7809500 to your computer and use it in GitHub Desktop.
Change the dev-root and stick this somewhere in .emacs.d/
This file contains 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
(defvar dev-root "/Users/davidsnyder/Development") | |
(defun git-current-branch () | |
(substring (shell-command-to-string "git branch | grep '\*'") 2 -1)) | |
(defun ics-github-link () | |
(interactive) | |
(let ((path (split-string (file-relative-name (buffer-file-name) (dev-root)) "/"))) | |
(message (concat | |
"https://github.com/infochimps/" | |
(car path) | |
"/blob/" (git-current-branch) "/" | |
(mapconcat 'identity (cdr path) "/") | |
(format "#L%d" (line-number-at-pos)) | |
)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment