summaryrefslogtreecommitdiffstats
path: root/lua/conf/plugins/gitsigns.lua
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2025-05-06 16:51:24 -0500
committerSquibid <me@zacharyscheiman.com>2025-05-06 16:51:24 -0500
commit7c3289fded1f75f6e060f56bd06edc2a327744d9 (patch)
treebf579e6eb1de84237a74ef13ce67703c15266afe /lua/conf/plugins/gitsigns.lua
parent3094bf2a3983b375f4adeccd25c3b12bbbded2aa (diff)
downloadnvim-7c3289fded1f75f6e060f56bd06edc2a327744d9.tar.gz
nvim-7c3289fded1f75f6e060f56bd06edc2a327744d9.tar.bz2
nvim-7c3289fded1f75f6e060f56bd06edc2a327744d9.zip
kitchen sink again :(
Diffstat (limited to 'lua/conf/plugins/gitsigns.lua')
-rw-r--r--lua/conf/plugins/gitsigns.lua64
1 files changed, 32 insertions, 32 deletions
diff --git a/lua/conf/plugins/gitsigns.lua b/lua/conf/plugins/gitsigns.lua
index a92264e..b420746 100644
--- a/lua/conf/plugins/gitsigns.lua
+++ b/lua/conf/plugins/gitsigns.lua
@@ -1,19 +1,19 @@
-local misc = require('core.misc')
+local misc = require("core.misc")
local map = misc.map
-return { 'lewis6991/gitsigns.nvim',
+return { "lewis6991/gitsigns.nvim",
disable = not vim.fn.has("nvim-0.9.0"),
function()
local gs = require("gitsigns")
gs.setup {
signs = {
- add = { text = '│' },
- change = { text = '│' },
- delete = { text = '-' },
- topdelete = { text = '‾' },
- changedelete = { text = '~' },
- untracked = { text = '┆' }
+ add = { text = "│" },
+ change = { text = "│" },
+ delete = { text = "-" },
+ topdelete = { text = "‾" },
+ changedelete = { text = "~" },
+ untracked = { text = "┆" }
},
signcolumn = true,
@@ -27,51 +27,51 @@ return { 'lewis6991/gitsigns.nvim',
},
attach_to_untracked = true,
- current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
+ current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
- preview_config = { border = 'solid' },
+ preview_config = { border = vim.g.border_style },
on_attach = function(bufnr)
local opts = { buffer = bufnr }
-- Navigation
- map('n', ']c', function()
+ map("n", "]c", function()
if vim.wo.diff then
- return ']c'
+ return "]c"
end
vim.schedule(function() gs.next_hunk() end)
- return '<Ignore>'
+ return "<Ignore>"
end, { expr = true, buffer = bufnr })
- map('n', '[c', function()
+ map("n", "[c", function()
if vim.wo.diff then
- return '[c'
+ return "[c"
end
vim.schedule(function() gs.prev_hunk() end)
- return '<Ignore>'
+ return "<Ignore>"
end, { expr = true, buffer = bufnr })
-- Actions
- map('n', '<leader>hs', gs.stage_hunk, opts)
- map('n', '<leader>hr', gs.reset_hunk, opts)
- map('v', '<leader>hs', function()
- gs.stage_hunk { vim.fn.line('.'), vim.fn.line('v') }
+ map("n", "<leader>hs", gs.stage_hunk, opts)
+ map("n", "<leader>hr", gs.reset_hunk, opts)
+ map("v", "<leader>hs", function()
+ gs.stage_hunk { vim.fn.line("."), vim.fn.line("v") }
end, opts)
- map('v', '<leader>hr', function()
- gs.reset_hunk { vim.fn.line('.'), vim.fn.line('v') }
+ map("v", "<leader>hr", function()
+ gs.reset_hunk { vim.fn.line("."), vim.fn.line("v") }
end, opts)
- map('n', '<leader>hS', gs.stage_buffer, opts)
- map('n', '<leader>hu', gs.undo_stage_hunk, opts)
- map('n', '<leader>hR', gs.reset_buffer, opts)
- map('n', '<leader>hp', gs.preview_hunk, opts)
- map('n', '<leader>hb', function() gs.blame_line { full=true } end, opts)
- map('n', '<leader>tb', gs.toggle_current_line_blame, opts)
- map('n', '<leader>hd', gs.diffthis, opts)
- map('n', '<leader>hD', function() gs.diffthis('~') end, opts)
- map('n', '<leader>td', gs.toggle_deleted, opts)
+ map("n", "<leader>hS", gs.stage_buffer, opts)
+ map("n", "<leader>hu", gs.undo_stage_hunk, opts)
+ map("n", "<leader>hR", gs.reset_buffer, opts)
+ map("n", "<leader>hp", gs.preview_hunk, opts)
+ map("n", "<leader>hb", function() gs.blame_line { full=true } end, opts)
+ map("n", "<leader>tb", gs.toggle_current_line_blame, opts)
+ map("n", "<leader>hd", gs.diffthis, opts)
+ map("n", "<leader>hD", function() gs.diffthis("~") end, opts)
+ map("n", "<leader>td", gs.toggle_deleted, opts)
-- Text object
- map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', opts)
+ map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", opts)
end
}
end