From 355dd54b7d12e5c4575f2cfa816e47bc6be11dc7 Mon Sep 17 00:00:00 2001 From: Volodymyr Patuta Date: Thu, 23 May 2024 10:12:07 +0200 Subject: [PATCH] feat!: replace neogit by lazygit --- lua/plugins/git.lua | 63 ++++++++++++++++++++++++++++++ lua/plugins/neogit.lua | 88 ------------------------------------------ 2 files changed, 63 insertions(+), 88 deletions(-) create mode 100644 lua/plugins/git.lua delete mode 100644 lua/plugins/neogit.lua diff --git a/lua/plugins/git.lua b/lua/plugins/git.lua new file mode 100644 index 0000000..eaeb2dd --- /dev/null +++ b/lua/plugins/git.lua @@ -0,0 +1,63 @@ +return { + -- 'NeogitOrg/neogit', + -- dependencies = { + -- 'nvim-lua/plenary.nvim', + -- 'sindrets/diffview.nvim', -- optional + -- -- 'ibhagwan/fzf-lua', -- optional + -- }, + -- cmd = 'Neogit', + -- keys = { + -- { 'g', 'Neogit', desc = 'neogit' }, + -- }, + -- opts = { + -- -- Neogit refreshes its internal state after specific events, which can be expensive depending on the repository size. + -- -- Disabling `auto_refresh` will make it so you have to manually refresh the status after you open it. + -- auto_refresh = true, + -- -- Change the default way of opening neogit + -- kind = 'tab', + -- -- The time after which an output console is shown for slow running commands + -- console_timeout = 5000, + -- -- Change the default way of opening the commit popup + -- commit_editor = { + -- kind = "tab", + -- show_staged_diff = true, + -- -- Accepted values: + -- -- "split" to show the staged diff below the commit editor + -- -- "vsplit" to show it to the right + -- -- "split_above" Like :top split + -- -- "auto" "vsplit" if window would have 80 cols, otherwise "split" + -- staged_diff_split_kind = "auto" + -- }, + -- status = { + -- recent_commit_count = 50, + -- }, + -- integrations = { + -- -- Neogit only provides inline diffs. If you want a more traditional way to look at diffs, you can use `sindrets/diffview.nvim`. + -- -- The diffview integration enables the diff popup, which is a wrapper around `sindrets/diffview.nvim`. + -- -- + -- -- Requires you to have `sindrets/diffview.nvim` installed. + -- diffview = true, + -- telescope = true, + -- }, + -- }, + "kdheepak/lazygit.nvim", + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, + -- optional for floating window border decoration + dependencies = { + "nvim-lua/plenary.nvim", + }, + -- setting the keybinding for LazyGit with 'keys' is recommended in + -- order to load the plugin when the command is run for the first time + keys = { + { "g", "LazyGit", desc = "LazyGit" } + }, + config = function() + require("telescope").load_extension("lazygit") + end +} diff --git a/lua/plugins/neogit.lua b/lua/plugins/neogit.lua deleted file mode 100644 index b30fe73..0000000 --- a/lua/plugins/neogit.lua +++ /dev/null @@ -1,88 +0,0 @@ -return { - 'NeogitOrg/neogit', - dependencies = { - 'nvim-lua/plenary.nvim', - 'sindrets/diffview.nvim', -- optional - 'ibhagwan/fzf-lua', -- optional - }, - cmd = 'Neogit', - keys = { - { 'g', 'Neogit', desc = 'neogit' }, - }, - opts = { - disable_signs = false, - disable_hint = false, - disable_context_highlighting = false, - disable_commit_confirmation = true, - -- Neogit refreshes its internal state after specific events, which can be expensive depending on the repository size. - -- Disabling `auto_refresh` will make it so you have to manually refresh the status after you open it. - auto_refresh = true, - disable_builtin_notifications = false, - use_magit_keybindings = false, - -- Change the default way of opening neogit - kind = 'tab', - -- The time after which an output console is shown for slow running commands - console_timeout = 2000, - -- Automatically show console if a command takes more than console_timeout milliseconds - auto_show_console = true, - -- Change the default way of opening the commit popup - commit_popup = { - kind = 'split', - }, - -- Change the default way of opening popups - popup = { - kind = 'split', - }, - status = { - recent_commit_count = 50, - }, - -- customize displayed signs - signs = { - -- { CLOSED, OPENED } - section = { '>', 'v' }, - item = { '>', 'v' }, - hunk = { '', '' }, - }, - integrations = { - -- Neogit only provides inline diffs. If you want a more traditional way to look at diffs, you can use `sindrets/diffview.nvim`. - -- The diffview integration enables the diff popup, which is a wrapper around `sindrets/diffview.nvim`. - -- - -- Requires you to have `sindrets/diffview.nvim` installed. - diffview = true, - }, - -- Setting any section to `false` will make the section not render at all - section = { - untracked = { - folded = false, - }, - unstaged = { - folded = false, - }, - staged = { - folded = false, - }, - stashes = { - folded = true, - }, - unpulled = { - folded = true, - }, - unmerged = { - folded = false, - }, - recent = { - folded = true, - }, - }, - -- override/add mappings - -- mappings = { - -- -- modify status buffer mappings - -- status = { - -- -- Adds a mapping with "B" as key that does the "BranchPopup" command - -- ['B'] = 'BranchPopup', - -- -- Removes the default mapping of "s" - -- -- ['s'] = '', - -- }, - -- }, - }, -}