2021-07-17 11:14:52 +00:00
|
|
|
local present, gitsigns = pcall(require, "gitsigns")
|
|
|
|
if not present then
|
2021-08-16 07:49:09 +00:00
|
|
|
return
|
2021-06-26 02:15:42 +00:00
|
|
|
end
|
|
|
|
|
2021-07-15 15:43:17 +00:00
|
|
|
gitsigns.setup {
|
2021-08-16 07:49:09 +00:00
|
|
|
keymaps = {
|
|
|
|
-- Default keymap options
|
|
|
|
buffer = true,
|
2021-08-22 07:49:15 +00:00
|
|
|
noremap = true,
|
2021-08-16 07:49:09 +00:00
|
|
|
["n ]c"] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns\".next_hunk()<CR>'" },
|
|
|
|
["n [c"] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns\".prev_hunk()<CR>'" },
|
|
|
|
["n <leader>hs"] = '<cmd>lua require"gitsigns".stage_hunk()<CR>',
|
|
|
|
["n <leader>hu"] = '<cmd>lua require"gitsigns".undo_stage_hunk()<CR>',
|
|
|
|
["n <leader>hr"] = '<cmd>lua require"gitsigns".reset_hunk()<CR>',
|
|
|
|
["n <leader>hp"] = '<cmd>lua require"gitsigns".preview_hunk()<CR>',
|
|
|
|
["n <leader>hb"] = '<cmd>lua require"gitsigns".blame_line()<CR>',
|
|
|
|
},
|
2021-08-22 07:49:15 +00:00
|
|
|
numhl = false,
|
|
|
|
|
|
|
|
sign_priority = 5,
|
|
|
|
signs = {
|
|
|
|
add = { hl = "DiffAdd", text = "│", numhl = "GitSignsAddNr" },
|
|
|
|
change = { hl = "DiffChange", text = "│", numhl = "GitSignsChangeNr" },
|
|
|
|
changedelete = { hl = "DiffChange", text = "~", numhl = "GitSignsChangeNr" },
|
|
|
|
delete = { hl = "DiffDelete", text = "_", numhl = "GitSignsDeleteNr" },
|
|
|
|
topdelete = { hl = "DiffDelete", text = "‾", numhl = "GitSignsDeleteNr" },
|
|
|
|
},
|
|
|
|
|
|
|
|
status_formatter = nil, -- Use default
|
2021-09-24 16:25:44 +00:00
|
|
|
watch_gitdir = {
|
2021-08-16 07:49:09 +00:00
|
|
|
interval = 100,
|
|
|
|
},
|
2021-07-15 15:43:17 +00:00
|
|
|
}
|