diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index 3ad70c16..9e5c510c 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -18,6 +18,13 @@ vim.g.lazyvim_picker = "auto" -- * a function with signature `function(buf) -> string|string[]` vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" } +-- You can use this to extend the patterns used by `LazyVim.lazygit.browse` +-- It should be a list of tables with two string patterns, one for the original +-- and one for the replacement +-- vim.g.lazygit_remote_patterns = { +-- { "^ssh://.*@(.*)$", "https://%1" }, +-- } + -- LazyVim automatically configures lazygit: -- * theme, based on the active colorscheme. -- * editPreset to nvim-remote diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index ff96c85c..2a8d9fe8 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -177,6 +177,8 @@ M.remote_patterns = { { "%.git$" , "" }, } +M.remote_patterns = vim.list_extend(M.remote_patterns, vim.g.lazygit_remote_patterns or {}) + ---@param remote string function M.get_url(remote) local ret = remote