feat: git.nullcube.net + git.zynh.me support

This commit is contained in:
Zynh Ludwig 2025-02-16 01:08:09 -08:00
parent 867bbd1e74
commit 26fe3fc8cf

28
lua/plugins/snacks.lua Normal file
View file

@ -0,0 +1,28 @@
local forgejo_patterns = {
branch = "/src/branch/{branch}",
file = "/src/branch/{branch}/{file}#L{line_start}-L{line_end}",
permalink = "/src/commit/{commit}/{file}#L{line_start}-L{line_end}",
commit = "/commit/{commit}",
}
-- https://git.zynh.me/mirror/reqwest-middleware/src/commit/ad17f421309d9a0da5dc7fc94b5145452588b4bf/Cargo.toml#L3-L4
return {
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
gitbrowse = {
url_patterns = {
["git%.zynh%.me"] = forgejo_patterns,
["git%.nullcube%.net"] = forgejo_patterns,
["codeberg%.org"] = forgejo_patterns,
},
},
},
},
}