add gitsigns to neovim

This commit is contained in:
2023-06-05 08:06:50 -04:00
parent ee36c5d56c
commit 43cdf48c54
2 changed files with 50 additions and 1 deletions
+3 -1
View File
@@ -1,5 +1,4 @@
-- ~/.config/nvim/init.lua
--
-- Charles Danesi (https://github.com/cdanesi)
-- Settings
@@ -7,3 +6,6 @@ require("plugins-setup")
require("core.options")
require("core.keymaps")
require("core.colorscheme")
-- Plugins
require("plugins.gitsigns")
+47
View File
@@ -0,0 +1,47 @@
local setup, gitsigns = pcall(require, "gitsigns")
if not setup then
return
end
gitsigns.setup {
signs = {
add = { text = '+' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {
interval = 1000,
follow_files = true
},
attach_to_untracked = true,
current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 200,
ignore_whitespace = false,
},
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = 'single',
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1
},
yadm = {
enable = true
}
}