gitlinker.nvim icon indicating copy to clipboard operation
gitlinker.nvim copied to clipboard

Add patterns in default callbacks

Open Sayrus opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

Many companies have custom domains for their git hosting. These domains often start by the forge name (gitlab., github., bitbucket.) and having mixed domains/forge is very rare (GitHub instance on gitlab.mycompany.tld for instance)

Describe the solution you'd like

After using GitLinker for a while, I only now discovered that it already supports host with wildcards. Since false-positive are very rare and can be overridden with the TLD anyway, I think that providing patterns by default might be a good default. This reduces entry-cost for user and will make GitLinker work with most enterprise forges by default.

Here are some pattern I have observed:

  • bitbucket.*: BitBucket
  • gitlab.*: Gitlab
  • ghe.*: GitHub (short for GitHub Enterprise)
  • github.*: GitHub

Describe alternatives you've considered

If adding patterns to the defaults are not something you want on GitLinker, can we add a short documentation to ensure users know they are able to use wildcards?

Additional context

N/A, thanks for this awesome project !

Sayrus avatar Nov 23 '22 14:11 Sayrus

I want the same function, regex pattern is quite useful!

linrongbin16 avatar Feb 17 '23 09:02 linrongbin16

hi @Sayrus , let's track this issue in https://github.com/linrongbin16/gitlinker.nvim

linrongbin16 avatar Nov 13 '23 05:11 linrongbin16