all repos

init.lua @ 2ffce811f1b81f11ee28290b81f45da7657c8816

my nvim config
1 files changed, 12 insertions(+), 7 deletions(-)
refactor(git): setup all mappings with helper function
Author: Smirnov Oleksandr ss2316544@gmail.com
Committed at: 2024-09-03 11:16:43 +0300
Parent: ec13226
M lua/plugins/git.lua

@@ -4,14 +4,19 @@ {

"lewis6991/gitsigns.nvim", event = "BufRead", keys = function() - --stylua: ignore + local function gitsigns(fn) + return function() + require("gitsigns")[fn]() + end + end + return { - { "]g", function() require("gitsigns").next_hunk() end }, - { "[g", function() require("gitsigns").prev_hunk() end}, - { "<leader>gs", function() require("gitsigns").stage_hunk() end}, - { "<leader>gS", function() require("gitsigns").undo_stage_hunk() end }, - { "<leader>gr", function() require("gitsigns").reset_hunk() end }, - { "<leader>gh", function() require("gitsigns").preview_hunk() end }, + { "]g", gitsigns "next_hunk" }, + { "[g", gitsigns "prev_hunk" }, + { "<leader>gs", gitsigns "stage_hunk" }, + { "<leader>gS", gitsigns "undo_stage_hunk" }, + { "<leader>gr", gitsigns "reset_hunk" }, + { "<leader>gh", gitsigns "preview_hunk" }, } end, opts = {