tombonan / emacs-git-open

`git-open`-inspired Emacs package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

emacs-git-open

Emacs package to open a file on a git remote. Inspired by git-open

Usage

Interactive File Functions

From the current buffer, call the function to open file on remote to open in browser:

M-x git-open

To simply copy the remote file path to clipboard, call:

M-x git-open-copy

To view the blame view on the remote, call:

M-x git-open-blame

git-open-blame also has a copy function instead of opening in browser: git-open-blame-copy.

Both git-open and git-open-blame, and their respective copy functions, will open the file by default, but if a region is selected, then that range of lines will be highlighted on the remote.

Interactive Functions from magit-blame View

emacs-git-open similarly allows you to open the current commit from a magit-blame buffer:

M-x git-open-commit

Git Open Commit Usage

Default Branches

My typical workflow often involves wanting to open up remote files from the default remote branch, either to link them to others or to view unmodified files.

By default, this branch is assumed to be main, but it can also be configured on a per-project basis by editing .git/config:

[init]
    defaultBranch = some-default

Todo

  • Support remote targets other than 'origin'
  • Support other git hosting services (gitlab, bitbucket etc.)
  • Tests
  • Packaging for MELPA

About

`git-open`-inspired Emacs package


Languages

Language:Emacs Lisp 98.2%Language:Makefile 1.8%