Created
August 14, 2013 14:05
-
-
Save arvidj/6231354 to your computer and use it in GitHub Desktop.
Emacs command for opening the currently visited file in the bitbucket source browser
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
(defun open-bitbucket-link () | |
"" | |
(interactive) | |
(let* ((rev (magit-rev-parse "HEAD")) | |
(remote (magit-get "remote" (magit-get-current-remote) "url")) | |
(url (concat | |
"https://" | |
(replace-regexp-in-string "^ssh://git@\\|.git$" "" remote) | |
"/src/" | |
rev | |
"/" | |
(magit-filename buffer-file-name) | |
"#cl-" | |
(number-to-string (line-number-at-pos)) | |
))) | |
(browse-url url))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment