Dotfiles_nvim/lua/toolchain/git.lua
2024-09-08 01:50:39 +02:00

48 lines
1.3 KiB
Lua

local T = require('toolchain')
local K = require('core.keymap')
local M = {}
function M.setup()
T.add_highlighter_autoinstalls('gitcommit', 'gitignore', 'gitattributes', 'git_rebase', 'git_config')
T.add_plugins(
{
'tpope/vim-fugitive',
},
{
'lewis6991/gitsigns.nvim',
config = function()
-- Setup --
require('gitsigns').setup()
-- Keybinding --
vim.keymap.set(
K.GIT.HUNK.mode,
K.GIT.HUNK.shortcut,
':Gitsigns preview_hunk_inline<CR>',
{ desc = K.GIT.HUNK.description }
)
vim.keymap.set(
K.GIT.BLAME.mode,
K.GIT.BLAME.shortcut,
':Gitsigns toggle_current_line_blame<CR>',
{ desc = K.GIT.BLAME.description }
)
vim.keymap.set(
K.GIT.OPEN.mode,
K.GIT.OPEN.shortcut,
':Git <CR>',
{ desc = K.GIT.OPEN.description }
)
end,
},
{
'moyiz/git-dev.nvim',
lazy = true,
cmd = { 'GitDevOpen', 'GitDevCleanAll' },
opts = {},
}
)
end
return M