diff options
| author | srdusr <trevorgray@srdusr.com> | 2025-09-24 02:55:49 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2025-09-24 02:55:49 +0200 |
| commit | 3cf613ec7c90ab4933728b0f19e49b0c955c17bb (patch) | |
| tree | 765e58766936b5228ad473ad77dfbf4353f173e9 /common/nvim/lua/plugins/gitsigns.lua | |
| parent | ef51a60993197ed3bbd1003522f98f0a898d34c6 (diff) | |
| parent | 966d12ac730c83da90d60ab24eae539b2ea69441 (diff) | |
| download | dotfiles-3cf613ec7c90ab4933728b0f19e49b0c955c17bb.tar.gz dotfiles-3cf613ec7c90ab4933728b0f19e49b0c955c17bb.zip | |
Add 'common/nvim/' from commit '966d12ac730c83da90d60ab24eae539b2ea69441'
git-subtree-dir: common/nvim
git-subtree-mainline: ef51a60993197ed3bbd1003522f98f0a898d34c6
git-subtree-split: 966d12ac730c83da90d60ab24eae539b2ea69441
Diffstat (limited to 'common/nvim/lua/plugins/gitsigns.lua')
| -rwxr-xr-x | common/nvim/lua/plugins/gitsigns.lua | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/common/nvim/lua/plugins/gitsigns.lua b/common/nvim/lua/plugins/gitsigns.lua new file mode 100755 index 0000000..7bbe637 --- /dev/null +++ b/common/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,85 @@ +local M = {} + +--- Setup and configure gitsigns +-- This function initializes and configures the git signs in the gutter +-- @return boolean True if setup was successful, false otherwise +function M.setup() + local ok, gitsigns = pcall(require, 'gitsigns') + if not ok then + return false + end + + gitsigns.setup({ + signs = { + --add = { + -- hl = "GitSignsAdd", + -- text = "▍", --│ + -- numhl = "GitSignsAddNr", + -- linehl = "GitSignsAddLn", + --}, + --change = { + -- hl = "GitSignsChange", + -- text = "▍", --│ + -- numhl = "GitSignsChangeNr", + -- linehl = "GitSignsChangeLn", + --}, + delete = { + hl = "GitSignsDelete", + text = "▁", --_━─ + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + topdelete = { + hl = "GitSignsDelete", + text = "▔", --‾ + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + changedelete = { + hl = "GitSignsDelete", + text = "~", + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, + }, + current_line_blame = true, + }) + +vim.api.nvim_command("highlight DiffAdd guibg=none guifg=#21c7a8") +vim.api.nvim_command("highlight DiffModified guibg=none guifg=#82aaff") +vim.api.nvim_command("highlight DiffDelete guibg=none guifg=#fc514e") +vim.api.nvim_command("highlight DiffText guibg=none guifg=#fc514e") +vim.cmd([[ +hi link GitSignsAdd DiffAdd +hi link GitSignsChange DiffModified +hi link GitSignsDelete DiffDelete +hi link GitSignsTopDelete DiffDelete +hi link GitSignsChangedDelete DiffDelete +]]) + -- Set up highlights + vim.cmd([[ + highlight DiffAdd guibg=none guifg=#21c7a8 + highlight DiffModified guibg=none guifg=#82aaff + highlight DiffDelete guibg=none guifg=#fc514e + highlight DiffText guibg=none guifg=#fc514e + + hi link GitSignsAdd DiffAdd + hi link GitSignsChange DiffModified + hi link GitSignsDelete DiffDelete + hi link GitSignsTopDelete DiffDelete + hi link GitSignsChangedelete DiffDelete + hi link GitSignsChangedeleteLn DiffDelete + hi link GitSignsChangedeleteNr DiffDeleteNr + ]]) + + return true +end + +return M +--'signs.delete.hl' is now deprecated, please define highlight 'GitSignsDelete' +--'signs.delete.linehl' is now deprecated, please define highlight 'GitSignsDeleteLn' +--'signs.delete.numhl' is now deprecated, please define highlight 'GitSignsDeleteNr' +--'signs.topdelete.hl' is now deprecated, please define highlight 'GitSignsTopdelete' +--'signs.topdelete.linehl' is now deprecated, please define highlight 'GitSignsTopdeleteLn' +--'signs.topdelete.numhl' is now deprecated, please define highlight 'GitSignsTopdeleteNr' + |
