mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat:remove neo-tree and lazygit
This commit is contained in:
parent
75750be1c0
commit
9554bcce06
11 changed files with 3 additions and 505 deletions
|
|
@ -129,23 +129,8 @@ if vim.lsp.inlay_hint then
|
|||
LazyVim.toggle.map("<leader>uh", LazyVim.toggle.inlay_hints)
|
||||
end
|
||||
|
||||
-- lazygit
|
||||
map("n", "<leader>gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
||||
map("n", "<leader>gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" })
|
||||
map("n", "<leader>gb", LazyVim.lazygit.blame_line, { desc = "Git Blame Line" })
|
||||
map("n", "<leader>gB", LazyVim.lazygit.browse, { desc = "Git Browse" })
|
||||
|
||||
map("n", "<leader>gf", function()
|
||||
local git_path = vim.api.nvim_buf_get_name(0)
|
||||
LazyVim.lazygit({args = { "-f", vim.trim(git_path) }, cwd = LazyVim.root.git()})
|
||||
end, { desc = "Lazygit Current File History" })
|
||||
|
||||
map("n", "<leader>gl", function()
|
||||
LazyVim.lazygit({ args = { "log" }, cwd = LazyVim.root.git() })
|
||||
end, { desc = "Lazygit Log" })
|
||||
map("n", "<leader>gL", function()
|
||||
LazyVim.lazygit({ args = { "log" } })
|
||||
end, { desc = "Lazygit Log (cwd)" })
|
||||
-- TODO: Change to Neogit
|
||||
-- map("n", "<leader>gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
||||
|
||||
-- quit
|
||||
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit All" })
|
||||
|
|
|
|||
|
|
@ -18,16 +18,6 @@ vim.g.lazyvim_picker = "auto"
|
|||
-- * a function with signature `function(buf) -> string|string[]`
|
||||
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
|
||||
|
||||
-- LazyVim automatically configures lazygit:
|
||||
-- * theme, based on the active colorscheme.
|
||||
-- * editPreset to nvim-remote
|
||||
-- * enables nerd font icons
|
||||
-- Set to false to disable.
|
||||
-- Set the options you want to override in `~/.config/lazygit/custom.yml`
|
||||
-- WARN: on Windows you might want to set `editPreset: "nvim"` due to
|
||||
-- this issue https://github.com/jesseduffield/lazygit/issues/3467
|
||||
vim.g.lazygit_config = true
|
||||
|
||||
-- Options for the LazyVim statuscolumn
|
||||
vim.g.lazyvim_statuscolumn = {
|
||||
folds_open = false, -- show fold sign when fold is open
|
||||
|
|
|
|||
|
|
@ -16,26 +16,6 @@ function M.check()
|
|||
else
|
||||
error("Neovim >= 0.9.0 is required")
|
||||
end
|
||||
|
||||
for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit" }) do
|
||||
local name = type(cmd) == "string" and cmd or vim.inspect(cmd)
|
||||
local commands = type(cmd) == "string" and { cmd } or cmd
|
||||
---@cast commands string[]
|
||||
local found = false
|
||||
|
||||
for _, c in ipairs(commands) do
|
||||
if vim.fn.executable(c) == 1 then
|
||||
name = c
|
||||
found = true
|
||||
end
|
||||
end
|
||||
|
||||
if found then
|
||||
ok(("`%s` is installed"):format(name))
|
||||
else
|
||||
warn(("`%s` is not installed"):format(name))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -1,131 +1,5 @@
|
|||
return {
|
||||
|
||||
-- file explorer
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
cmd = "Neotree",
|
||||
keys = {
|
||||
{
|
||||
"<leader>fe",
|
||||
function()
|
||||
require("neo-tree.command").execute({ toggle = true, dir = LazyVim.root() })
|
||||
end,
|
||||
desc = "Explorer NeoTree (Root Dir)",
|
||||
},
|
||||
{
|
||||
"<leader>fE",
|
||||
function()
|
||||
require("neo-tree.command").execute({ toggle = true, dir = vim.uv.cwd() })
|
||||
end,
|
||||
desc = "Explorer NeoTree (cwd)",
|
||||
},
|
||||
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (Root Dir)", remap = true },
|
||||
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
||||
{
|
||||
"<leader>ge",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "git_status", toggle = true })
|
||||
end,
|
||||
desc = "Git Explorer",
|
||||
},
|
||||
{
|
||||
"<leader>be",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "buffers", toggle = true })
|
||||
end,
|
||||
desc = "Buffer Explorer",
|
||||
},
|
||||
},
|
||||
deactivate = function()
|
||||
vim.cmd([[Neotree close]])
|
||||
end,
|
||||
init = function()
|
||||
-- FIX: use `autocmd` for lazy-loading neo-tree instead of directly requiring it,
|
||||
-- because `cwd` is not set up properly.
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
group = vim.api.nvim_create_augroup("Neotree_start_directory", { clear = true }),
|
||||
desc = "Start Neo-tree with directory",
|
||||
once = true,
|
||||
callback = function()
|
||||
if package.loaded["neo-tree"] then
|
||||
return
|
||||
else
|
||||
local stats = vim.uv.fs_stat(vim.fn.argv(0))
|
||||
if stats and stats.type == "directory" then
|
||||
require("neo-tree")
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
opts = {
|
||||
sources = { "filesystem", "buffers", "git_status" },
|
||||
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
||||
filesystem = {
|
||||
bind_to_cwd = false,
|
||||
follow_current_file = { enabled = true },
|
||||
use_libuv_file_watcher = true,
|
||||
},
|
||||
window = {
|
||||
mappings = {
|
||||
["l"] = "open",
|
||||
["h"] = "close_node",
|
||||
["<space>"] = "none",
|
||||
["Y"] = {
|
||||
function(state)
|
||||
local node = state.tree:get_node()
|
||||
local path = node:get_id()
|
||||
vim.fn.setreg("+", path, "c")
|
||||
end,
|
||||
desc = "Copy Path to Clipboard",
|
||||
},
|
||||
["O"] = {
|
||||
function(state)
|
||||
require("lazy.util").open(state.tree:get_node().path, { system = true })
|
||||
end,
|
||||
desc = "Open with System Application",
|
||||
},
|
||||
["P"] = { "toggle_preview", config = { use_float = false } },
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
indent = {
|
||||
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
|
||||
expander_collapsed = "",
|
||||
expander_expanded = "",
|
||||
expander_highlight = "NeoTreeExpander",
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
unstaged = "",
|
||||
staged = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local function on_move(data)
|
||||
LazyVim.lsp.on_rename(data.source, data.destination)
|
||||
end
|
||||
|
||||
local events = require("neo-tree.events")
|
||||
opts.event_handlers = opts.event_handlers or {}
|
||||
vim.list_extend(opts.event_handlers, {
|
||||
{ event = events.FILE_MOVED, handler = on_move },
|
||||
{ event = events.FILE_RENAMED, handler = on_move },
|
||||
})
|
||||
require("neo-tree").setup(opts)
|
||||
vim.api.nvim_create_autocmd("TermClose", {
|
||||
pattern = "*lazygit",
|
||||
callback = function()
|
||||
if package.loaded["neo-tree.sources.git_status"] then
|
||||
require("neo-tree.sources.git_status").refresh()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- search/replace in multiple files
|
||||
{
|
||||
"MagicDuck/grug-far.nvim",
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ return {
|
|||
},
|
||||
left = {
|
||||
{ title = "Neotest Summary", ft = "neotest-summary" },
|
||||
-- "neo-tree",
|
||||
},
|
||||
right = {
|
||||
{ title = "Grug Far", ft = "grug-far", size = { width = 0.4 } },
|
||||
|
|
@ -79,30 +78,6 @@ return {
|
|||
},
|
||||
}
|
||||
|
||||
if LazyVim.has("neo-tree.nvim") then
|
||||
local pos = {
|
||||
filesystem = "left",
|
||||
buffers = "top",
|
||||
git_status = "right",
|
||||
document_symbols = "bottom",
|
||||
diagnostics = "bottom",
|
||||
}
|
||||
local sources = LazyVim.opts("neo-tree.nvim").sources or {}
|
||||
for i, v in ipairs(sources) do
|
||||
table.insert(opts.left, i, {
|
||||
title = "Neo-Tree " .. v:gsub("_", " "):gsub("^%l", string.upper),
|
||||
ft = "neo-tree",
|
||||
filter = function(buf)
|
||||
return vim.b[buf].neo_tree_source == v
|
||||
end,
|
||||
pinned = true,
|
||||
open = function()
|
||||
vim.cmd(("Neotree show position=%s %s dir=%s"):format(pos[v] or "bottom", v, LazyVim.root()))
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
for _, pos in ipairs({ "top", "bottom", "left", "right" }) do
|
||||
opts[pos] = opts[pos] or {}
|
||||
table.insert(opts[pos], {
|
||||
|
|
@ -134,17 +109,6 @@ return {
|
|||
},
|
||||
},
|
||||
|
||||
-- prevent neo-tree from opening files in edgy windows
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
opts.open_files_do_not_replace_types = opts.open_files_do_not_replace_types
|
||||
or { "terminal", "Trouble", "qf", "Outline", "trouble" }
|
||||
table.insert(opts.open_files_do_not_replace_types, "edgy")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Fix bufferline offsets when edgy is loaded
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ return {
|
|||
"lazy",
|
||||
"lazyterm",
|
||||
"mason",
|
||||
"neo-tree",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"Trouble",
|
||||
|
|
|
|||
|
|
@ -20,16 +20,5 @@ return {
|
|||
desc = "GitUi (Root Dir)",
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
-- delete lazygit keymap for file history
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "LazyVimKeymaps",
|
||||
once = true,
|
||||
callback = function()
|
||||
pcall(vim.keymap.del, "n", "<leader>gf")
|
||||
pcall(vim.keymap.del, "n", "<leader>gl")
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,14 +66,6 @@ return {
|
|||
.. (diag.warning and icons.Warn .. diag.warning or "")
|
||||
return vim.trim(ret)
|
||||
end,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "neo-tree",
|
||||
text = "Neo-tree",
|
||||
highlight = "Directory",
|
||||
text_align = "left",
|
||||
},
|
||||
},
|
||||
---@param opts bufferline.IconFetcherOpts
|
||||
get_element_icon = function(opts)
|
||||
return LazyVim.config.icons.ft[opts.filetype]
|
||||
|
|
@ -194,7 +186,7 @@ return {
|
|||
end,
|
||||
},
|
||||
},
|
||||
extensions = { "neo-tree", "lazy" },
|
||||
extensions = { "lazy" },
|
||||
}
|
||||
|
||||
-- do not add trouble symbols if aerial is enabled
|
||||
|
|
@ -247,7 +239,6 @@ return {
|
|||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"lazy",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ local LazyUtil = require("lazy.core.util")
|
|||
---@field lsp lazyvim.util.lsp
|
||||
---@field root lazyvim.util.root
|
||||
---@field terminal lazyvim.util.terminal
|
||||
---@field lazygit lazyvim.util.lazygit
|
||||
---@field toggle lazyvim.util.toggle
|
||||
---@field format lazyvim.util.format
|
||||
---@field plugin lazyvim.util.plugin
|
||||
|
|
|
|||
|
|
@ -1,231 +0,0 @@
|
|||
---@class lazyvim.util.lazygit
|
||||
---@field config_dir? string
|
||||
---@overload fun(cmd: string|string[], opts: LazyTermOpts): LazyFloat
|
||||
local M = setmetatable({}, {
|
||||
__call = function(m, ...)
|
||||
return m.open(...)
|
||||
end,
|
||||
})
|
||||
|
||||
---@alias LazyGitColor {fg?:string, bg?:string, bold?:boolean}
|
||||
|
||||
---@class LazyGitTheme: table<number, LazyGitColor>
|
||||
---@field activeBorderColor LazyGitColor
|
||||
---@field cherryPickedCommitBgColor LazyGitColor
|
||||
---@field cherryPickedCommitFgColor LazyGitColor
|
||||
---@field defaultFgColor LazyGitColor
|
||||
---@field inactiveBorderColor LazyGitColor
|
||||
---@field optionsTextColor LazyGitColor
|
||||
---@field searchingActiveBorderColor LazyGitColor
|
||||
---@field selectedLineBgColor LazyGitColor
|
||||
---@field unstagedChangesColor LazyGitColor
|
||||
M.theme = {
|
||||
[241] = { fg = "Special" },
|
||||
activeBorderColor = { fg = "MatchParen", bold = true },
|
||||
cherryPickedCommitBgColor = { fg = "Identifier" },
|
||||
cherryPickedCommitFgColor = { fg = "Function" },
|
||||
defaultFgColor = { fg = "Normal" },
|
||||
inactiveBorderColor = { fg = "FloatBorder" },
|
||||
optionsTextColor = { fg = "Function" },
|
||||
searchingActiveBorderColor = { fg = "MatchParen", bold = true },
|
||||
selectedLineBgColor = { bg = "Visual" }, -- set to `default` to have no background colour
|
||||
unstagedChangesColor = { fg = "DiagnosticError" },
|
||||
}
|
||||
|
||||
M.theme_path = LazyVim.norm(vim.fn.stdpath("cache") .. "/lazygit-theme.yml")
|
||||
|
||||
-- re-create config file on startup
|
||||
M.dirty = true
|
||||
|
||||
-- re-create theme file on ColorScheme change
|
||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||
callback = function()
|
||||
M.dirty = true
|
||||
end,
|
||||
})
|
||||
|
||||
-- Opens lazygit
|
||||
---@param opts? LazyTermOpts | {args?: string[]}
|
||||
function M.open(opts)
|
||||
if vim.g.lazygit_theme ~= nil then
|
||||
LazyVim.deprecate("vim.g.lazygit_theme", "vim.g.lazygit_config")
|
||||
end
|
||||
|
||||
opts = vim.tbl_deep_extend("force", {}, {
|
||||
esc_esc = false,
|
||||
ctrl_hjkl = false,
|
||||
}, opts or {})
|
||||
|
||||
local cmd = { "lazygit" }
|
||||
vim.list_extend(cmd, opts.args or {})
|
||||
|
||||
if vim.g.lazygit_config then
|
||||
if M.dirty then
|
||||
M.update_config()
|
||||
end
|
||||
|
||||
if not M.config_dir then
|
||||
local Process = require("lazy.manage.process")
|
||||
local ok, lines = pcall(Process.exec, { "lazygit", "-cd" })
|
||||
if ok then
|
||||
M.config_dir = lines[1]
|
||||
vim.env.LG_CONFIG_FILE = LazyVim.norm(M.config_dir .. "/config.yml" .. "," .. M.theme_path)
|
||||
local custom_config = LazyVim.norm(M.config_dir .. "/custom.yml")
|
||||
if vim.uv.fs_stat(custom_config) and vim.uv.fs_stat(custom_config).type == "file" then
|
||||
vim.env.LG_CONFIG_FILE = vim.env.LG_CONFIG_FILE .. "," .. custom_config
|
||||
end
|
||||
else
|
||||
---@diagnostic disable-next-line: cast-type-mismatch
|
||||
---@cast lines string
|
||||
LazyVim.error(
|
||||
{ "Failed to get **lazygit** config directory.", "Will not apply **lazygit** config.", "", "# Error:", lines },
|
||||
{ title = "lazygit" }
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return LazyVim.terminal(cmd, opts)
|
||||
end
|
||||
|
||||
function M.set_ansi_color(idx, color)
|
||||
io.write(("\27]4;%d;%s\7"):format(idx, color))
|
||||
end
|
||||
|
||||
---@param v LazyGitColor
|
||||
---@return string[]
|
||||
function M.get_color(v)
|
||||
---@type string[]
|
||||
local color = {}
|
||||
if v.fg then
|
||||
color[1] = LazyVim.ui.color(v.fg)
|
||||
elseif v.bg then
|
||||
color[1] = LazyVim.ui.color(v.bg, true)
|
||||
end
|
||||
if v.bold then
|
||||
table.insert(color, "bold")
|
||||
end
|
||||
return color
|
||||
end
|
||||
|
||||
function M.update_config()
|
||||
---@type table<string, string[]>
|
||||
local theme = {}
|
||||
|
||||
for k, v in pairs(M.theme) do
|
||||
if type(k) == "number" then
|
||||
local color = M.get_color(v)
|
||||
-- LazyGit uses color 241 a lot, so also set it to a nice color
|
||||
-- pcall, since some terminals don't like this
|
||||
pcall(M.set_ansi_color, k, color[1])
|
||||
else
|
||||
theme[k] = M.get_color(v)
|
||||
end
|
||||
end
|
||||
|
||||
local config = [[
|
||||
os:
|
||||
editPreset: "nvim-remote"
|
||||
gui:
|
||||
nerdFontsVersion: 3
|
||||
theme:
|
||||
]]
|
||||
|
||||
---@type string[]
|
||||
local lines = {}
|
||||
for k, v in pairs(theme) do
|
||||
lines[#lines + 1] = (" %s:"):format(k)
|
||||
for _, c in ipairs(v) do
|
||||
lines[#lines + 1] = (" - %q"):format(c)
|
||||
end
|
||||
end
|
||||
config = config .. table.concat(lines, "\n")
|
||||
require("lazy.util").write_file(M.theme_path, config)
|
||||
M.dirty = false
|
||||
end
|
||||
|
||||
---@param opts? {count?: number}|LazyCmdOptions
|
||||
function M.blame_line(opts)
|
||||
opts = vim.tbl_deep_extend("force", {
|
||||
count = 3,
|
||||
filetype = "git",
|
||||
size = {
|
||||
width = 0.6,
|
||||
height = 0.6,
|
||||
},
|
||||
border = "rounded",
|
||||
}, opts or {})
|
||||
local cursor = vim.api.nvim_win_get_cursor(0)
|
||||
local line = cursor[1]
|
||||
local file = vim.api.nvim_buf_get_name(0)
|
||||
local root = LazyVim.root.detectors.pattern(0, { ".git" })[1] or "."
|
||||
local cmd = { "git", "-C", root, "log", "-n", opts.count, "-u", "-L", line .. ",+1:" .. file }
|
||||
return require("lazy.util").float_cmd(cmd, opts)
|
||||
end
|
||||
|
||||
-- stylua: ignore
|
||||
M.remote_patterns = {
|
||||
{ "^(https?://.*)%.git$" , "%1" },
|
||||
{ "^git@(.+):(.+)%.git$" , "https://%1/%2" },
|
||||
{ "^git@(.+):(.+)$" , "https://%1/%2" },
|
||||
{ "^git@(.+)/(.+)$" , "https://%1/%2" },
|
||||
{ "^ssh://git@(.*)$" , "https://%1" },
|
||||
{ "ssh%.dev%.azure%.com/v3/(.*)/(.*)$", "dev.azure.com/%1/_git/%2" },
|
||||
{ "^https://%w*@(.*)" , "https://%1" },
|
||||
{ "^git@(.*)" , "https://%1" },
|
||||
{ ":%d+" , "" },
|
||||
{ "%.git$" , "" },
|
||||
}
|
||||
|
||||
---@param remote string
|
||||
function M.get_url(remote)
|
||||
local ret = remote
|
||||
for _, pattern in ipairs(M.remote_patterns) do
|
||||
ret = ret:gsub(pattern[1], pattern[2])
|
||||
end
|
||||
return ret:find("https://") == 1 and ret or ("https://%s"):format(ret)
|
||||
end
|
||||
|
||||
function M.browse()
|
||||
local lines = require("lazy.manage.process").exec({ "git", "remote", "-v" })
|
||||
local remotes = {} ---@type {name:string, url:string}[]
|
||||
|
||||
for _, line in ipairs(lines) do
|
||||
local name, remote = line:match("(%S+)%s+(%S+)%s+%(fetch%)")
|
||||
if name and remote then
|
||||
local url = M.get_url(remote)
|
||||
if url then
|
||||
table.insert(remotes, {
|
||||
name = name,
|
||||
url = url,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function open(remote)
|
||||
if remote then
|
||||
LazyVim.info(("Opening [%s](%s)"):format(remote.name, remote.url))
|
||||
if vim.fn.has("nvim-0.10") == 0 then
|
||||
require("lazy.util").open(remote.url, { system = true })
|
||||
return
|
||||
end
|
||||
vim.ui.open(remote.url)
|
||||
end
|
||||
end
|
||||
|
||||
if #remotes == 0 then
|
||||
return LazyVim.error("No git remotes found")
|
||||
elseif #remotes == 1 then
|
||||
return open(remotes[1])
|
||||
end
|
||||
|
||||
vim.ui.select(remotes, {
|
||||
prompt = "Select remote to browse",
|
||||
format_item = function(item)
|
||||
return item.name .. (" "):rep(8 - #item.name) .. " 🔗 " .. item.url
|
||||
end,
|
||||
}, open)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
---@module "luassert"
|
||||
|
||||
_G.LazyVim = require("lazyvim.util")
|
||||
|
||||
-- stylua: ignore
|
||||
local git_remotes_cases = {
|
||||
["https://github.com/LazyVim/LazyVim.git"] = "https://github.com/LazyVim/LazyVim",
|
||||
["https://github.com/LazyVim/LazyVim"] = "https://github.com/LazyVim/LazyVim",
|
||||
["git@github.com:LazyVim/LazyVim"] = "https://github.com/LazyVim/LazyVim",
|
||||
["git@ssh.dev.azure.com:v3/neovim-org/owner/repo"] = "https://dev.azure.com/neovim-org/owner/_git/repo",
|
||||
["https://folkelemaitre@bitbucket.org/samiulazim/neovim.git"] = "https://bitbucket.org/samiulazim/neovim",
|
||||
["git@bitbucket.org:samiulazim/neovim.git"] = "https://bitbucket.org/samiulazim/neovim",
|
||||
["git@gitlab.com:inkscape/inkscape.git"] = "https://gitlab.com/inkscape/inkscape",
|
||||
["https://gitlab.com/inkscape/inkscape.git"] = "https://gitlab.com/inkscape/inkscape",
|
||||
["git@github.com:torvalds/linux.git"] = "https://github.com/torvalds/linux",
|
||||
["https://github.com/torvalds/linux.git"] = "https://github.com/torvalds/linux",
|
||||
["git@bitbucket.org:team/repo.git"] = "https://bitbucket.org/team/repo",
|
||||
["https://bitbucket.org/team/repo.git"] = "https://bitbucket.org/team/repo",
|
||||
["git@gitlab.com:example-group/example-project.git"] = "https://gitlab.com/example-group/example-project",
|
||||
["https://gitlab.com/example-group/example-project.git"] = "https://gitlab.com/example-group/example-project",
|
||||
["git@ssh.dev.azure.com:v3/org/project/repo"] = "https://dev.azure.com/org/project/_git/repo",
|
||||
["https://username@dev.azure.com/org/project/_git/repo"] = "https://dev.azure.com/org/project/_git/repo",
|
||||
["ssh://git@ghe.example.com:2222/org/repo.git"] = "https://ghe.example.com/org/repo",
|
||||
["https://ghe.example.com/org/repo.git"] = "https://ghe.example.com/org/repo",
|
||||
["git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo"] = "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo",
|
||||
["https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo"] = "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo",
|
||||
["ssh://git@source.developers.google.com:2022/p/project/r/repo"] = "https://source.developers.google.com/p/project/r/repo",
|
||||
["https://source.developers.google.com/p/project/r/repo"] = "https://source.developers.google.com/p/project/r/repo",
|
||||
["git@git.sr.ht:~user/repo"] = "https://git.sr.ht/~user/repo",
|
||||
["https://git.sr.ht/~user/repo"] = "https://git.sr.ht/~user/repo",
|
||||
["git@git.sr.ht:~user/another-repo"] = "https://git.sr.ht/~user/another-repo",
|
||||
["https://git.sr.ht/~user/another-repo"] = "https://git.sr.ht/~user/another-repo",
|
||||
}
|
||||
|
||||
describe("util.lazygit", function()
|
||||
for remote, expected in pairs(git_remotes_cases) do
|
||||
it("should parse git remote " .. remote, function()
|
||||
local url = LazyVim.lazygit.get_url(remote)
|
||||
assert.are.equal(expected, url)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
Loading…
Add table
Reference in a new issue