This commit is contained in:
2025-08-13 21:46:48 +02:00
commit c3e2e6509b
818 changed files with 54187 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
local prefix = "<leader>gC"
local function toggle_diffview(cmd)
if next(require("diffview.lib").views) == nil then
vim.cmd(cmd)
else
vim.cmd("DiffviewClose")
end
end
return {
{
"sindrets/diffview.nvim",
-- stylua: ignore
keys = {
{ "<leader>gD", function() toggle_diffview("DiffviewFileHistory") end, desc = "Diff Repo" },
{ "<leader>gd", function() toggle_diffview("DiffviewOpen") end, desc = "Diff View" },
{ "<leader>gF", function() toggle_diffview("DiffviewFileHistory %") end, desc = "Diff Current File" },
},
opts = function(_, opts)
local actions = require("diffview.actions")
opts.enhanced_diff_hl = true
opts.view = {
default = { winbar_info = true },
file_history = { winbar_info = true },
}
opts.hooks = {
diff_buf_read = function(bufnr)
vim.b[bufnr].view_activated = false
end,
}
opts.keymaps = {
--stylua: ignore
view = {
{ "n", prefix .. "o", actions.conflict_choose("ours"), { desc = "Choose the OURS version of a conflict" } },
{ "n", prefix .. "t", actions.conflict_choose("theirs"), { desc = "Choose the THEIRS version of a conflict" } },
{ "n", prefix .. "b", actions.conflict_choose("base"), { desc = "Choose the BASE version of a conflict" } },
{ "n", prefix .. "a", actions.conflict_choose("all"), { desc = "Choose all the versions of a conflict" } },
{ "n", prefix .. "x", actions.conflict_choose("none"), { desc = "Delete the conflict region" } },
{ "n", prefix .. "O", actions.conflict_choose_all("ours"), { desc = "Choose the OURS version of a conflict for the whole file" } },
{ "n", prefix .. "T", actions.conflict_choose_all("theirs"), { desc = "Choose the THEIRS version of a conflict for the whole file" } },
{ "n", prefix .. "B", actions.conflict_choose_all("base"), { desc = "Choose the BASE version of a conflict for the whole file" } },
{ "n", prefix .. "A", actions.conflict_choose_all("all"), { desc = "Choose all the versions of a conflict for the whole file" } },
{ "n", prefix .. "X", actions.conflict_choose_all("none"), { desc = "Delete the conflict region for the whole file" } },
},
--stylua: ignore
file_panel = {
{ "n", prefix .. "O", actions.conflict_choose_all("ours"), { desc = "Choose the OURS version of a conflict for the whole file" } },
{ "n", prefix .. "T", actions.conflict_choose_all("theirs"), { desc = "Choose the THEIRS version of a conflict for the whole file" } },
{ "n", prefix .. "B", actions.conflict_choose_all("base"), { desc = "Choose the BASE version of a conflict for the whole file" } },
{ "n", prefix .. "A", actions.conflict_choose_all("all"), { desc = "Choose all the versions of a conflict for the whole file" } },
{ "n", prefix .. "X", actions.conflict_choose_all("none"), { desc = "Delete the conflict region for the whole file" } },
},
}
end,
},
{
"NeogitOrg/neogit",
optional = true,
opts = {
integrations = {
diffview = true,
},
},
},
{
"folke/which-key.nvim",
opts = {
spec = {
{ prefix, group = "conflicts", icon = "" },
},
},
},
}

View File

@@ -0,0 +1,45 @@
local prefix = "<leader>gC"
vim.api.nvim_create_autocmd("User", {
pattern = "GitConflictDetected",
callback = function()
vim.notify("Conflict detected in " .. vim.fn.expand("<afile>"))
end,
})
return {
{
"akinsho/git-conflict.nvim",
opts = {
default_mappings = {
ours = prefix .. "o",
theirs = prefix .. "t",
none = prefix .. "n",
both = prefix .. "b",
},
},
cmd = {
"GitConflictChooseTheirs",
"GitConflictChooseOurs",
"GitConflictChooseBoth",
"GitConflictListQf",
"GitConflictRefresh",
"GitConflictNextConflict",
"GitConflictPrevConflict",
},
keys = {
{ "]g", "<cmd>GitConflictNextConflict<cr>", desc = "Next Conflict" },
{ "[g", "<cmd>GitConflictPrevConflict<cr>", desc = "Previous Conflict" },
{ prefix .. "l", "<cmd>GitConflictListQf<cr>", desc = "List Conflicts" },
{ prefix .. "r", "<cmd>GitConflictRefresh<cr>", desc = "Refresh Conflicts" },
},
},
{
"folke/which-key.nvim",
opts = {
spec = {
{ prefix, group = "conflicts", icon = "" },
},
},
},
}

View File

@@ -0,0 +1,40 @@
return {
"isakbm/gitgraph.nvim",
opts = {
symbols = {
merge_commit = "",
commit = "",
},
format = {
timestamp = "%H:%M:%S %d-%m-%Y",
fields = { "hash", "timestamp", "author", "branch_name", "tag" },
},
hooks = {
on_select_commit = function(commit)
if LazyVim.has("diffview.nvim") then
vim.notify("DiffviewOpen " .. commit.hash .. "^!")
vim.cmd(":DiffviewOpen " .. commit.hash .. "^!")
else
print("selected commit:", commit.hash)
end
end,
on_select_range_commit = function(from, to)
if LazyVim.has("diffview.nvim") then
vim.notify("DiffviewOpen " .. from.hash .. "~1.." .. to.hash)
vim.cmd(":DiffviewOpen " .. from.hash .. "~1.." .. to.hash)
else
print("selected range:", from.hash, to.hash)
end
end,
},
},
keys = {
{
"<leader>gl",
function()
require("gitgraph").draw({}, { all = true, max_count = 5000 })
end,
desc = "Graph",
},
},
}

View File

@@ -0,0 +1,169 @@
local prefix = "<leader>G"
return {
{ import = "lazyvim.plugins.extras.util.octo" },
{ import = "plugins.extras.lang.git-extended" },
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "gh" })
end,
},
{
"almo7aya/openingh.nvim",
cmd = { "OpenInGHRepo", "OpenInGHFile", "OpenInGHFileLines" },
keys = {
{ prefix .. "ro", "<cmd>OpenInGHRepo<CR>", desc = "Open git repo in web", mode = { "n" } },
{ prefix .. "rf", "<cmd>OpenInGHFile<CR>", desc = "Open git file in web", mode = { "n" } },
{ prefix .. "rc", "<cmd>OpenInGHFileLines<CR>", desc = "Open current line in web", mode = { "n", "x", "v" } },
},
},
{
"folke/which-key.nvim",
opts = {
spec = {
{ prefix, group = "github", icon = "" },
{ prefix .. "c", group = "comments" },
{ prefix .. "t", group = "threads" },
{ prefix .. "i", group = "issues" },
{ prefix .. "p", group = "pull requests" },
{ prefix .. "pm", group = "merge current PR" },
{ prefix .. "r", group = "repo" },
{ prefix .. "a", group = "assignee/reviewer" },
{ prefix .. "l", group = "label" },
{ prefix .. "e", group = "reaction" },
{ prefix .. "R", group = "review" },
{ prefix .. "g", group = "gist" },
{ prefix .. "s", group = "review" },
{ prefix .. "P", group = "profile" },
},
},
},
{
"Rawnly/gist.nvim",
cmd = { "GistCreate", "GistCreateFromFile", "GistsList" },
dependencies = {
"samjwill/nvim-unception",
init = function()
vim.g.unception_block_while_host_edits = true
end,
},
opts = {},
keys = {
{ prefix .. "gc", "<cmd>GistCreate<CR>", desc = "Create a Gist" },
{ prefix .. "gf", "<cmd>GistCreateFromFile<CR>", desc = "Create a Gist from File" },
{ prefix .. "gl", "<cmd>GistsList<CR>", desc = "List Gists" },
},
},
{
"pwntester/octo.nvim",
opts = {
use_diagnostic_signs = true,
mappings = {},
},
keys = {
-- Disable default LazyVim keymaps
{ "<leader>gi", false },
{ "<leader>gI", false },
{ "<leader>gp", false },
{ "<leader>gP", false },
{ "<leader>gr", false },
{ "<leader>gS", false },
{ prefix .. "ca", "<cmd>Octo comment add<CR>", desc = "Add a New Comment" },
{ prefix .. "cd", "<cmd>Octo comment delete<CR>", desc = "Delete a Comment" },
{ prefix .. "ta", "<cmd>Octo thread resolve<CR>", desc = "Mark Thread as Resolved" },
{ prefix .. "td", "<cmd>Octo thread unresolve<CR>", desc = "Mark Thread as Unresolved" },
{ prefix .. "ic", "<cmd>Octo issue close<CR>", desc = "Close Current Issue" },
{ prefix .. "ir", "<cmd>Octo issue reopen<CR>", desc = "Reopen Current Issue" },
{ prefix .. "il", "<cmd>Octo issue list<CR>", desc = "List Open Issues" },
{ prefix .. "is", "<cmd>Octo issue search<CR>", desc = "Search Issues" },
{ prefix .. "iu", "<cmd>Octo issue url<CR>", desc = "Copies URL of Current Issue" },
{ prefix .. "io", "<cmd>Octo issue browser<CR>", desc = "Open Current Issue in Browser" },
{ prefix .. "pp", "<cmd>Octo pr checkout<CR>", desc = "Checkout PR" },
{ prefix .. "pmm", "<cmd>Octo pr merge commit<CR>", desc = "Merge Commit PR" },
{ prefix .. "pms", "<cmd>Octo pr merge squash<CR>", desc = "Squash Merge PR" },
{ prefix .. "pmd", "<cmd>Octo pr merge delete<CR>", desc = "Delete Merge PR" },
{ prefix .. "pmr", "<cmd>Octo pr merge rebase<CR>", desc = "Rebase Merge PR" },
{ prefix .. "pc", "<cmd>Octo pr close<CR>", desc = "Close Current PR" },
{ prefix .. "pn", "<cmd>Octo pr create<CR>", desc = "Create PR for Current Branch" },
{ prefix .. "pd", "<cmd>Octo pr diff<CR>", desc = "Show PR Diff" },
{ prefix .. "ps", "<cmd>Octo pr search<CR>", desc = "Search PR" },
{ prefix .. "ps", "<cmd>Octo pr list<CR>", desc = "List Open PRs" },
{ prefix .. "pr", "<cmd>Octo pr ready<CR>", desc = "Mark Draft as Ready for Review" },
{ prefix .. "po", "<cmd>Octo pr browser<CR>", desc = "Open Current PR in Browser" },
{ prefix .. "pu", "<cmd>Octo pr url<CR>", desc = "Copies URL of Current PR" },
{ prefix .. "pt", "<cmd>Octo pr commits<CR>", desc = "List PR Commits" },
{ prefix .. "pl", "<cmd>Octo pr commits<CR>", desc = "List Changed Files in PR" },
{ prefix .. "rf", "<cmd>Octo repo fork<CR>", desc = "Fork Repo" },
{ prefix .. "ru", "<cmd>Octo repo url<CR>", desc = "Copies URL of Current Repo" },
{ prefix .. "aa", "<cmd> Octo assignee add<CR>", desc = "Assign a User" },
{ prefix .. "ar", "<cmd> Octo assignee remove<CR>", desc = "Remove a User" },
{ prefix .. "ap", "<cmd> Octo reviewer add<CR>", desc = "Assign a PR Reviewer" },
{ prefix .. "la", "<cmd> Octo label add<CR>", desc = "Assign a Label" },
{ prefix .. "lr", "<cmd> Octo label remove<CR>", desc = "Remove a Label" },
{ prefix .. "lc", "<cmd> Octo label create<CR>", desc = "Create a Label" },
{ prefix .. "e1", "<cmd>Octo reaction thumbs_up<CR>", desc = "Add 👍 Reaction" },
{ prefix .. "e2", "<cmd>Octo reaction thumbs_down<CR>", desc = "Add 👎 Reaction" },
{ prefix .. "e3", "<cmd>Octo reaction eyes<CR>", desc = "Add 👀 Reaction" },
{ prefix .. "e4", "<cmd>Octo reaction laugh<CR>", desc = "Add 😄 Reaction" },
{ prefix .. "e5", "<cmd>Octo reaction confused<CR>", desc = "Add 😕 Reaction" },
{ prefix .. "e6", "<cmd>Octo reaction rocket<CR>", desc = "Add 🚀 Reaction" },
{ prefix .. "e7", "<cmd>Octo reaction heart<CR>", desc = "Add ❤️ Reaction" },
{ prefix .. "e8", "<cmd>Octo reaction party<CR>", desc = "Add 🎉 Reaction" },
{ prefix .. "x", "<cmd>Octo actions<CR>", desc = "Run an Action" },
{ prefix .. "ss", "<cmd> Octo review start<CR>", desc = "Start Review" },
{ prefix .. "sf", "<cmd> Octo review submit<CR>", desc = "Submit Review" },
{ prefix .. "sr", "<cmd> Octo review resume<CR>", desc = "Submit Resume" },
{ prefix .. "sd", "<cmd> Octo review discard<CR>", desc = "Delete Pending Review" },
{ prefix .. "sc", "<cmd> Octo review comments<CR>", desc = "View Pending Comments" },
{ prefix .. "sp", "<cmd> Octo review commit<CR>", desc = "Select Commit to Review" },
{ prefix .. "sc", "<cmd> Octo review close<CR>", desc = "Return to PR" },
},
},
{
"2kabhishek/octohub.nvim",
dependencies = {
"2kabhishek/utils.nvim",
},
cmd = {
"OctoRepos",
"OctoRepo",
"OctoStats",
"OctoActivityStats",
"OctoContributionStats",
"OctoRepoStats",
"OctoProfile",
"OctoRepoWeb",
},
opts = {
add_default_keybindings = false,
projects_dir = "~/dev/",
},
keys = {
{ prefix .. "rl", "<cmd>OctoRepos<CR>", desc = "List Repos" },
{ prefix .. "rS", "<cmd>OctoRepos sort:stars<CR>", desc = "Top Starred Repos" },
{ prefix .. "rI", "<cmd>OctoRepos sort:issues<CR>", desc = "Top Repos With Issues" },
{ prefix .. "rU", "<cmd>OctoRepos sort:updated<CR>", desc = "Recently Updated Repos" },
{ prefix .. "rP", "<cmd>OctoRepos type:private<CR>", desc = "Private Repos" },
{ prefix .. "rF", "<cmd>OctoRepos type:fork<CR>", desc = "Forked Repos" },
{ prefix .. "rc", "<cmd>OctoRepo<CR>", desc = "Clone/Open Repo" },
{ prefix .. "rs", "<cmd>OctoRepoStats<CR>", desc = "Repo Stats" },
{ prefix .. "Ps", "<cmd>OctoStats<CR>", desc = "All Stats" },
{ prefix .. "Pa", "<cmd>OctoActivityStats<CR>", desc = "Activity Stats" },
{ prefix .. "Pc", "<cmd>OctoContributionStats<CR>", desc = "Contribution Stats" },
{ prefix .. "Po", "<cmd>OctoProfile<CR>", desc = "Open Profile" },
},
},
}

View File

@@ -0,0 +1,24 @@
local prefix = "<leader>gn"
return {
{
"NeogitOrg/neogit",
cmd = "Neogit",
opts = {},
keys = {
{ prefix .. "n", "<cmd>Neogit<cr>", desc = "Neogit (Root Dir)" },
{ prefix .. "c", "<cmd>Neogit commit<cr>", desc = "Commit" },
{ prefix .. "p", "<cmd>Neogit pull<cr>", desc = "Pull" },
{ prefix .. "P", "<cmd>Neogit push<cr>", desc = "Push" },
{ prefix .. "f", "<cmd>Neogit fetch<cr>", desc = "Fetch" },
},
},
{
"folke/which-key.nvim",
opts = {
spec = {
{ prefix, group = "neogit", icon = "" },
},
},
},
}

View File

@@ -0,0 +1,26 @@
local prefix = "<leader>gw"
return {
{
"ThePrimeagen/git-worktree.nvim",
opts = {},
config = function()
LazyVim.on_load("telescope.nvim", function()
require("telescope").load_extension("git_worktree")
end)
end,
-- stylua: ignore
keys = {
{ prefix .. "m", function() require("telescope").extensions.git_worktree.git_worktrees() end, desc = "Manage Worktrees" },
{ prefix .. "c", function() require("telescope").extensions.git_worktree.create_git_worktree() end, desc = "Create Worktree" },
},
},
{
"folke/which-key.nvim",
opts = {
spec = {
{ prefix, group = "worktrees", icon = "" },
},
},
},
}