diff --git a/config/plugins/git/fugitive.nix b/config/plugins/git/fugitive.nix index f440e26..93d997a 100644 --- a/config/plugins/git/fugitive.nix +++ b/config/plugins/git/fugitive.nix @@ -2,4 +2,36 @@ plugins.fugitive = { enable = true; }; + + keymaps = [ + { + mode = ["n"]; + key = "gc"; + action = "Git commit"; + options = { + silent = true; + desc = "Commit Changes"; + }; + } + + { + mode = ["n"]; + key = "gd"; + action = "Git diff"; + options = { + silent = true; + desc = "View diff"; + }; + } + + { + mode = ["n"]; + key = "gu"; + action = "Git restore --staged ."; + options = { + silent = true; + desc = "Unstage all changes"; + }; + } + ]; } diff --git a/config/plugins/git/gitsigns.nix b/config/plugins/git/gitsigns.nix index cfa5131..1ad36e3 100644 --- a/config/plugins/git/gitsigns.nix +++ b/config/plugins/git/gitsigns.nix @@ -14,6 +14,16 @@ }; } + { + mode = ["n"]; + key = "gS"; + action = "Gitsigns stage_buffer"; + options = { + silent = true; + desc = "Stage Buffer"; + }; + } + { mode = ["n" "v"]; key = "gr"; @@ -25,27 +35,7 @@ } { - mode = "n"; - key = "gS"; - action = "Gitsigns stage_buffer"; - options = { - silent = true; - desc = "Stage Buffer"; - }; - } - - { - mode = "n"; - key = "gu"; - action = "Gitsigns undo_stage_hunk"; - options = { - silent = true; - desc = "Undo Staged Hunk"; - }; - } - - { - mode = "n"; + mode = ["n"]; key = "gR"; action = "Gitsigns reset_buffer"; options = { @@ -55,28 +45,8 @@ } { - mode = "n"; - key = "gp"; - action = "Gitsigns preview_hunk_inline"; - options = { - silent = true; - desc = "Preview Hunk"; - }; - } - - { - mode = "n"; + mode = ["n"]; key = "gb"; - action = "Gitsigns blame"; - options = { - silent = true; - desc = "View Blame"; - }; - } - - { - mode = "n"; - key = "gtb"; action = "Gitsigns toggle_current_line_blame"; options = { silent = true; @@ -85,22 +55,32 @@ } { - mode = "n"; - key = "gd"; - action = "Gitsigns diffthis"; + mode = ["n"]; + key = "gB"; + action = "Gitsigns blame"; options = { silent = true; - desc = "View Diff"; + desc = "View Blame"; }; } { - mode = "n"; - key = "gtd"; - action = "Gitsigns toggle_deleted"; + mode = ["n"]; + key = "[h"; + action = "Gitsigns prev_hunk"; options = { silent = true; - desc = "Toggle Deleted"; + desc = "Goto Previous Hunk"; + }; + } + + { + mode = ["n"]; + key = "]h"; + action = "Gitsigns next_hunk"; + options = { + silent = true; + desc = "Goto Next Hunk"; }; } ];