This package is easiest way to open particular link on github/gitlab/bitbucket/stash/git.savannah.gnu.org/sourcehut from Emacs. It supports various kind of emacs buffer, like:
- file buffer
- dired buffer
- magit-mode buffers representing code
- vc-annotate mode (use get there by pressing
C-x v gby default)
browse-at-remote to your Cask file::
Simply add this package to your emacs path, and add to
Active keybindings for
(global-set-key (kbd "C-c g g") 'browse-at-remote)
guix package -i emacs-browse-at-remote then load
browse-at-remote from your Emacs init.
By default browse-at-remote knows how to work with popular remote types (github/gitlab..). Knowledge how to work with certain remote-type comes from mapping browse-at-remote-remote-type-domains. It defines that github.com should be treat in github manner, bitbucket.org in bitbucket manner and so on. In your development you may have some specific git-url, and browse-at-remote will before confuse which remote-type map to your domain.
Two solution available:
In that case you can to customize that. (M-x customize ... browse-at-remote-remote-type-domains). For now our package supports next remote-types:
Set specific remote-type directly in git repo. For example, if your repository is hosted on GitHub enterprise, you should add following setting to its config:
git config --add browseAtRemote.type "github"
or for private Stash repository use command:
git config --add browseAtRemote.type "stash"
Excluding line number if no region is selected
By default browse-at-remote add line number when region is not selected in file attached buffer. If you don't like that and what to see no line information URL, it's possible to disable that by adding::
(setq browse-at-remote-add-line-number-if-no-region-selected nil)
Or setting via UI with M-x customize.
Adding new remote type
Call function from emacs buffer:
or just call
C-c g gif you've already added binding before. You can use this command in dired buffers too.
Target page at github/bitbucket will be opened using your default browser:
or same here is folder view at bitbucket:
Opening github commit's page at magit-commit-mode, magit-log-mode:
Open last commit which added target line:
- Press C-x v g to call standard vc-annotate
- Call browse-at-remote on target line
New remote type added Pagure by @FrostyX. New configuration option browse-at-remote-add-line-number-if-no-region-selected allowing add or not line number when target page open and region initially is not selected.
New remote type added Sourcehut by @microamp.
New remote type added Phabricator by @kuba-orlik.
New remote type added gist.github.com by @CyberShadow.
New remote type added git.savannah.gnu.org by @wigust.
Minor fixes, added Stash (bitbucket support) by @yauhen-l.
Drop clojure-style function namings. Add abbrev methods like bar-browse and bar-to-clipoboard (where bar is browse-at-remote abbrev.)
Major refactorings by @ieure. Main function renamed to browse-at-remote/browse. (renamed in 0.8.0 to bar-browse)
Added support of Gitlab by @env0der. Thanks!
Added support of Github Enterprice. Special thanks for @env0der for this feature.
Function browse-at-remote/to-clipboard were added (renamed in 0.8.0 to bar-to-clibpoard)
- Add mercurial support