f-person / git-blame.nvim

Git Blame plugin for Neovim written in Lua
GNU General Public License v3.0
839 stars 41 forks source link

feat: add optional range to file URLs #98

Closed bossley9 closed 9 months ago

bossley9 commented 9 months ago

After playing around a bit with GitBlameOpenFileURL and GItBlameCopyFileURL I thought it would be a great idea to add optional range functionality to the line selection. You would be able to select ranges of lines to reference, and many git repository hosting platforms support line ranges. If you execute one of these commands with a range (i.e. :74,84GitBlameOpenFileURL) or with a visual selection, the resulting URL will have the range highlighted (here is an example range). Otherwise, the existing behavior (selecting an individual line) will work as expected.

I tested in Github, Gitlab, and SourceHut repos (SourceHut uses a slightly different URL pattern).