nvim-config/lua/configs/gitsigns.lua

64 lines
1.4 KiB
Lua
Raw Permalink Normal View History

2022-02-28 14:48:12 +00:00
local M = {}
function M.config()
2023-01-10 18:21:09 +00:00
local status_ok, gitsigns = pcall(require, 'gitsigns')
2022-02-28 14:48:12 +00:00
if not status_ok then
return
end
2023-01-10 18:21:09 +00:00
gitsigns.setup({
2022-02-28 14:48:12 +00:00
signs = {
2023-01-10 18:21:09 +00:00
add = { hl = 'GitSignsAdd', text = '', numhl = 'GitSignsAddNr', linehl = 'GitSignsAddLn' },
change = { hl = 'GitSignsChange', text = '', numhl = 'GitSignsChangeNr', linehl = 'GitSignsChangeLn' },
delete = { hl = 'GitSignsDelete', text = '', numhl = 'GitSignsDeleteNr', linehl = 'GitSignsDeleteLn' },
2022-02-28 14:48:12 +00:00
topdelete = {
2023-01-10 18:21:09 +00:00
hl = 'GitSignsDelete',
text = '',
numhl = 'GitSignsDeleteNr',
linehl = 'GitSignsDeleteLn',
2022-02-28 14:48:12 +00:00
},
changedelete = {
2023-01-10 18:21:09 +00:00
hl = 'GitSignsChange',
text = '',
numhl = 'GitSignsChangeNr',
linehl = 'GitSignsChangeLn',
2022-02-28 14:48:12 +00:00
},
},
signcolumn = true,
numhl = false,
linehl = false,
word_diff = false,
watch_gitdir = {
interval = 1000,
follow_files = true,
},
attach_to_untracked = true,
current_line_blame = false,
current_line_blame_opts = {
virt_text = true,
2023-01-10 18:21:09 +00:00
virt_text_pos = 'eol',
2022-02-28 14:48:12 +00:00
delay = 1000,
ignore_whitespace = false,
},
current_line_blame_formatter_opts = {
relative_time = false,
},
sign_priority = 6,
update_debounce = 100,
status_formatter = nil,
max_file_length = 40000,
preview_config = {
2023-01-10 18:21:09 +00:00
border = 'single',
style = 'minimal',
relative = 'cursor',
2022-02-28 14:48:12 +00:00
row = 0,
col = 1,
},
yadm = {
enable = false,
},
2023-01-10 18:21:09 +00:00
})
2022-02-28 14:48:12 +00:00
end
return M