From 77a32b9eefeb7b64b320346942e8bcf807a2ba95 Mon Sep 17 00:00:00 2001 From: niverton Date: Tue, 9 Sep 2025 17:21:48 +0200 Subject: [PATCH] feat(cvs): snacks gitbrowse for personal gitea --- lua/plugins/30-cvs.lua | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lua/plugins/30-cvs.lua b/lua/plugins/30-cvs.lua index d37d68b..ae92271 100644 --- a/lua/plugins/30-cvs.lua +++ b/lua/plugins/30-cvs.lua @@ -1,2 +1,23 @@ ---@type LazySpec -return {} +return { + { + "folke/snacks.nvim", + optional = true, + --@type snacks.Config + opts = { + gitbrowse = { + remote_patterns = { + { "^gitea@(.+):(.+)$", "https://%1/%2" }, + }, + url_patterns = { + ["git.niverton.ovh"] = { + 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}", + }, + }, + }, + }, + }, +}