2024-09-07 18:39:22 +00:00
|
|
|
local T = require('toolchain')
|
2024-09-07 23:50:39 +00:00
|
|
|
local K = require('core.keymap')
|
2024-09-07 18:39:22 +00:00
|
|
|
local M = {}
|
|
|
|
|
2024-09-07 23:50:39 +00:00
|
|
|
function M.setup()
|
2024-09-07 18:39:22 +00:00
|
|
|
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(
|
2024-09-07 23:50:39 +00:00
|
|
|
K.GIT.HUNK.mode,
|
|
|
|
K.GIT.HUNK.shortcut,
|
2024-09-07 18:39:22 +00:00
|
|
|
':Gitsigns preview_hunk_inline<CR>',
|
2024-09-07 23:50:39 +00:00
|
|
|
{ desc = K.GIT.HUNK.description }
|
2024-09-07 18:39:22 +00:00
|
|
|
)
|
|
|
|
vim.keymap.set(
|
2024-09-07 23:50:39 +00:00
|
|
|
K.GIT.BLAME.mode,
|
|
|
|
K.GIT.BLAME.shortcut,
|
2024-09-07 18:39:22 +00:00
|
|
|
':Gitsigns toggle_current_line_blame<CR>',
|
2024-09-07 23:50:39 +00:00
|
|
|
{ desc = K.GIT.BLAME.description }
|
2024-09-07 18:39:22 +00:00
|
|
|
)
|
|
|
|
vim.keymap.set(
|
2024-09-07 23:50:39 +00:00
|
|
|
K.GIT.OPEN.mode,
|
|
|
|
K.GIT.OPEN.shortcut,
|
2024-09-07 18:39:22 +00:00
|
|
|
':Git <CR>',
|
2024-09-07 23:50:39 +00:00
|
|
|
{ desc = K.GIT.OPEN.description }
|
2024-09-07 18:39:22 +00:00
|
|
|
)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'moyiz/git-dev.nvim',
|
|
|
|
lazy = true,
|
|
|
|
cmd = { 'GitDevOpen', 'GitDevCleanAll' },
|
|
|
|
opts = {},
|
|
|
|
}
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
return M
|