From a199ca09f3a0f331c2e5244833544e78e5f8e90a Mon Sep 17 00:00:00 2001 From: aleidk Date: Sat, 8 Apr 2023 16:54:56 -0400 Subject: [PATCH] Add neogit --- config/astronvim/lua/user/mappings.lua | 4 +- config/astronvim/lua/user/plugins/neogit.lua | 46 ++++++++++++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 config/astronvim/lua/user/plugins/neogit.lua diff --git a/config/astronvim/lua/user/mappings.lua b/config/astronvim/lua/user/mappings.lua index 106ed58..0f0c266 100644 --- a/config/astronvim/lua/user/mappings.lua +++ b/config/astronvim/lua/user/mappings.lua @@ -12,12 +12,12 @@ return { ["n"] = { "nzzzv", desc = "Keep cursor centered while searching" }, ["N"] = { "Nzzzv", desc = "Keep cursor centered while searching" }, - ["q"] = "", + ["Q"] = "", -- Buffers ["H"] = { function() - require("astronvim.utils.buffer").nav( -(vim.v.count > 0 and vim.v.count or 1)) + require("astronvim.utils.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end, desc = "Previous buffer", }, diff --git a/config/astronvim/lua/user/plugins/neogit.lua b/config/astronvim/lua/user/plugins/neogit.lua new file mode 100644 index 0000000..2d69a3f --- /dev/null +++ b/config/astronvim/lua/user/plugins/neogit.lua @@ -0,0 +1,46 @@ +return { + "TimUntersberger/neogit", + dependencies = { "nvim-lua/plenary.nvim" }, + 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 = "floating", + -- Change the default way of opening the commit popup + commit_popup = { + kind = "floating", + }, + -- Change the default way of opening the preview buffer + preview_buffer = { + kind = "floating", + }, + -- Change the default way of opening popups + popup = { + kind = "floating", + }, + -- customize displayed signs + signs = { + -- { CLOSED, OPENED } + section = { ">", "v" }, + item = { ">", "v" }, + hunk = { "", "" }, + }, + mappings = { + -- modify status buffer mappings + status = { + ["l"] = "Toggle", + ["h"] = "Close", + }, + }, + }, + keys = { + { + "gn", + function() + require("neogit").open() + end, + desc = "Open neogit", + }, + }, +}