From aeadb0a9d33c004739071c6b19cd1f559fe2ba7f Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 29 Dec 2024 00:31:14 -0800 Subject: [PATCH] feat: remove diffview and adjust Neogit config --- flake.nix | 1 - lua/plugins/lz-spec.lua | 41 +--------------------------------------- lua/plugins/neogit.lua | 42 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 41 deletions(-) create mode 100644 lua/plugins/neogit.lua diff --git a/flake.nix b/flake.nix index a897a4f..9f41a8f 100644 --- a/flake.nix +++ b/flake.nix @@ -156,7 +156,6 @@ mini-bufremove neogit gitsigns-nvim - diffview-nvim barbecue-nvim undotree conform-nvim diff --git a/lua/plugins/lz-spec.lua b/lua/plugins/lz-spec.lua index 35b32de..0464486 100644 --- a/lua/plugins/lz-spec.lua +++ b/lua/plugins/lz-spec.lua @@ -12,6 +12,7 @@ return { require("plugins.render-markdown"), require("plugins.toggleterm"), require("plugins.by-lang.latex"), + require("plugins.neogit"), { "vim-wakatime" }, { "clangd_extensions.nvim" }, { "vim-sleuth" }, @@ -154,46 +155,6 @@ return { require("mini.hipatterns").setup() end, }, - { - "neogit", - cmd = "Neogit", - keys = { - { - "gg", - function() - vim.cmd.Neogit() - end, - desc = "Open neogit", - mode = "n", - }, - { - "gc", - function() - vim.cmd.Neogit("kind=floating commit") - end, - desc = "Open neogit commit menu", - mode = "n", - }, - }, - before = function() - local lz = require("lz.n") - lz.trigger_load("diffview.nvim") - lz.trigger_load("telescope.nvim") - end, - after = function() - require("neogit").setup({ - graph_style = "unicode", - integrations = { - telescope = true, - diffview = true, - }, - }) - end, - }, - { - "diffiew.nvim", - cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles", "DiffviewRefresh" }, - }, { "barbecue.nvim", event = "BufEnter", diff --git a/lua/plugins/neogit.lua b/lua/plugins/neogit.lua new file mode 100644 index 0000000..5781322 --- /dev/null +++ b/lua/plugins/neogit.lua @@ -0,0 +1,42 @@ +return { + "neogit", + cmd = "Neogit", + keys = { + { + "gg", + function() + vim.cmd.Neogit() + end, + desc = "Open neogit", + mode = "n", + }, + { + "gc", + function() + vim.cmd.Neogit("kind=floating commit") + end, + desc = "Open neogit commit menu", + mode = "n", + }, + }, + before = function() + local lz = require("lz.n") + lz.trigger_load("telescope.nvim") + end, + after = function() + local function graph_style() + if os.getenv("TERM") == "xterm-kitty" then + return "kitty" + else + return "ascii" + end + end + require("neogit").setup({ + graph_style = graph_style(), + integrations = { + telescope = true, + }, + kind = "replace", + }) + end, +}