feat: add neogit

This commit is contained in:
fiplox 2023-01-28 15:24:05 +01:00
parent 4eaba8b41d
commit b4c5601387
1 changed files with 90 additions and 0 deletions

90
lua/plugins/neogit.lua Normal file
View File

@ -0,0 +1,90 @@
local M = {
'TimUntersberger/neogit',
cmd = 'Neogit',
}
function M.config()
require('neogit').setup {
disable_signs = false,
disable_hint = false,
disable_context_highlighting = false,
disable_commit_confirmation = false,
-- 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',
},
-- 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.
-- use {
-- 'TimUntersberger/neogit',
-- requires = {
-- 'nvim-lua/plenary.nvim',
-- 'sindrets/diffview.nvim'
-- }
-- }
--
diffview = false,
},
-- Setting any section to `false` will make the section not render at all
sections = {
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'] = '',
},
},
}
end
return M