.. image:: http://melpa.org/packages/browse-at-remote-badge.svg :target: http://melpa.org/#/browse-at-remote
.. image:: https://travis-ci.org/rmuslimov/browse-at-remote.svg?branch=master :target: https://travis-ci.org/rmuslimov/browse-at-remote
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:
C-x v g
by default)Add browse-at-remote
to your Cask file:::
(depends-on "browse-at-remote")
Manual
Simply add this package to your emacs path, and add to .emacs
,::
(require 'browse-at-remote)
Active keybindings for browse-at-remote
function:::
(global-set-key (kbd "C-c g g") 'browse-at-remote)
GNU Guix
Run guix install emacs-browse-at-remote
then load browse-at-remote
from your Emacs init.
Remote types
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
.
Customize how the host is resolved
There are cases where you might need to resolve a remote host to a particular value. For example, one common strategy to manage multiple SSH keys is to add an entry to ~/.ssh.config
::
Host mycompany.github.com HostName github.com User git IdentityFile ~/.ssh/id_rsa_mycompany
For such cases, you can use the :actual-host
property::
(add-to-list 'browse-at-remote-remote-type-regexps `(:host ,(rx bol "mycompany.github.com" eol) :type "github" :actual-host "github.com"))
You can also directly configure the repository::
git config --add browseAtRemote.actualHost "github.com"
You can add your own remote if you need - PRs are welcome! Please see good examples here: gnu-savannah-remote, or stash-remote.
Call function from emacs buffer::
M-x browse-at-remote
or::
M-x bar-browse
.. image:: http://i.imgur.com/rmAky8e.png
or just call C-c g g
if 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:
.. image:: http://i.imgur.com/wBW9Gov.png alt: screenshot of page at github
or same here is folder view at bitbucket:
.. image:: http://i.imgur.com/XuzLhcR.png alt: screenshot page tree at bibucket
Opening github commit's page at magit-commit-mode, magit-log-mode:
.. image:: http://i.imgur.com/NzlIHYr.png alt: screenshot of magit-log-mode
Open last commit which added target line:
.. image:: http://i.imgur.com/lpmOAz2.png alt: screen of vc-annotate-mode
C-x v g
to call standard vc-annotatebrowse-at-remote
on target line@rmuslimov
_@env0der
_@ben
_@duff
_@Wilfred
_@yauhen-l
_@ieure
_@wigust
_@CyberShadow
_@kuba-orlik
_@jwhitbeck
_@microamp
_@FrostyX
_@legendary-mich
_@ilmotta
_0.15.0
Added new feature allowing customize how hosts are resolved by @ilmotta.
0.14.0
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.
0.13.0
New remote type added Sourcehut by @microamp
_.
0.12.0
New remote type added Phabricator by @kuba-orlik
_.
0.11.0
New remote type added gist.github.com by @CyberShadow
_.
0.10.0
New remote type added git.savannah.gnu.org by @wigust
_.
0.9.0
Minor fixes, added Stash (bitbucket support) by @yauhen-l
_.
0.8.0
Drop clojure-style function namings. Add abbrev methods like bar-browse
and bar-to-clipoboard
(where bar
is browse-at-remote abbrev.)
0.7.0
Major refactorings by @ieure
_. Main function renamed to browse-at-remote/browse
. (renamed in 0.8.0 to bar-browse
)
0.6.0
Added support of Gitlab by @env0der
_. Thanks!
0.5.0
Added support of Github Enterprice. Special thanks for @env0der
_ for this feature.
0.4.0
Function browse-at-remote/to-clipboard
were added (renamed in 0.8.0 to bar-to-clibpoard
)
.. @rmuslimov
: https://github.com/rmuslimov
.. @env0der
: https://github.com/env0der
.. @Wilfred
: https://github.com/Wilfred
.. @ben
: https://github.com/ben
.. @duff
: https://github.com/duff
.. @ieure
: https://github.com/ieure
.. @yauhen-l
: https://github.com/yauhen-l
.. @wigust
: https://github.com/wigust
.. @CyberShadow
: https://github.com/CyberShadow
.. @kuba-orlik
: https://github.com/kuba-orlik
.. @jwhitbeck
: https://github.com/jwhitbeck
.. @microamp
: https://github.com/microamp
.. @FrostyX
: https://github.com/FrostyX
.. @legendary-mich
: https://github.com/legendary-mich
.. _stash-remote: https://github.com/rmuslimov/browse-at-remote/pull/34/files
.. _gnu-savannah-remote: https://github.com/rmuslimov/browse-at-remote/pull/46/files