Replace browse-at-remote with call to 'hub browse -u --'
This commit is contained in:
parent
41e5542079
commit
8cef9b08d5
1 changed files with 11 additions and 11 deletions
|
@ -9,17 +9,6 @@
|
||||||
"/\\.git/info/exclude$"
|
"/\\.git/info/exclude$"
|
||||||
"/git/ignore$"))
|
"/git/ignore$"))
|
||||||
|
|
||||||
(use-package browse-at-remote
|
|
||||||
:defer t
|
|
||||||
:init
|
|
||||||
(evil-define-command narf:git-remote-browse (&optional bang file)
|
|
||||||
"Open the website for the current (or specified) version controlled FILE. If BANG,
|
|
||||||
then use hub to do it."
|
|
||||||
(interactive "<!><f>")
|
|
||||||
(if bang
|
|
||||||
(message "Url copied to clipboard: %s" (browse-at-remote/to-clipboard))
|
|
||||||
(browse-at-remote/browse))))
|
|
||||||
|
|
||||||
(use-package git-gutter
|
(use-package git-gutter
|
||||||
:commands (git-gutter-mode narf/vcs-next-hunk narf/vcs-prev-hunk
|
:commands (git-gutter-mode narf/vcs-next-hunk narf/vcs-prev-hunk
|
||||||
narf/vcs-show-hunk narf/vcs-stage-hunk narf/vcs-revert-hunk)
|
narf/vcs-show-hunk narf/vcs-stage-hunk narf/vcs-revert-hunk)
|
||||||
|
@ -60,5 +49,16 @@ then use hub to do it."
|
||||||
:n [tab] 'vc-annotate-toggle-annotation-visibility
|
:n [tab] 'vc-annotate-toggle-annotation-visibility
|
||||||
:n "RET" 'vc-annotate-find-revision-at-line))
|
:n "RET" 'vc-annotate-find-revision-at-line))
|
||||||
|
|
||||||
|
(evil-define-command narf:git-remote-browse (&optional bang file)
|
||||||
|
"Open the website for the current (or specified) version controlled FILE. If BANG,
|
||||||
|
then use hub to do it."
|
||||||
|
(interactive "<!><f>")
|
||||||
|
(let ((url (shell-command-to-string "hub browse -u -- ")))
|
||||||
|
(when url
|
||||||
|
(setq url (concat (s-trim url) "/" (f-relative (buffer-file-name) (narf/project-root)))))
|
||||||
|
(if bang
|
||||||
|
(message "Url copied to clipboard: %s" (kill-new url))
|
||||||
|
(browse-url url))))
|
||||||
|
|
||||||
(provide 'core-vcs)
|
(provide 'core-vcs)
|
||||||
;;; core-vcs.el ends here
|
;;; core-vcs.el ends here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue