ruifm / gitlinker.nvim

A lua neovim plugin to generate shareable file permalinks (with line ranges) for several git web frontend hosts. Inspired by tpope/vim-fugitive's :GBrowse
GNU General Public License v3.0
525 stars 44 forks source link

feat: support function for option - remote #89

Open MunifTanjim opened 1 year ago

linrongbin16 commented 6 months ago

hi @MunifTanjim ,

Seems ruifm doesn't maintain this repo any longer.

This feature is been implemented in my fork: https://github.com/linrongbin16/gitlinker.nvim.

MunifTanjim commented 6 months ago

Hey @linrongbin16 , I looked into your fork a few days ago. But couldn't figure out how to provide a function to dynamically set remote.

linrongbin16 commented 6 months ago

Hey @linrongbin16 , I looked into your fork a few days ago. But couldn't figure out how to provide a function to dynamically set remote.

Type below command:

The upstream is the remote configured in the git repository's .git/config.

For example in my gitlinker fork, the .git/config is:

image

There's only 1 configured remote: origin. So the GitLink and GitLink remote=origin are doing the same thing: they all generate the link for the origin remote (e.g. the repo hosted in GitHub).

Once your git repo contains multiple remote, the GitLink command will use the first detected remote, if you want to specify a remote, use GitLink remote=upstream will link you to the upstream remote.