diff --git a/config/default.nix b/config/default.nix index 2e45867..cb4cf55 100644 --- a/config/default.nix +++ b/config/default.nix @@ -10,6 +10,7 @@ ./completion/lspkind.nix ./git/diffview.nix + ./git/gitsigns.nix ./dap/dap.nix diff --git a/config/git/gitsigns.nix b/config/git/gitsigns.nix new file mode 100644 index 0000000..9fc8013 --- /dev/null +++ b/config/git/gitsigns.nix @@ -0,0 +1,91 @@ +{ + plugins.gitsigns = { + enable = true; + trouble = true; + currentLineBlame = true; + }; + keymaps = [ + { + mode = ["n" "v"]; + key = "gh"; + action = "gitsigns"; + options = { + silent = true; + desc = "+hunks"; + }; + } + { + mode = "n"; + key = "ghb"; + action = ":Gitsigns blame_line"; + options = { + silent = true; + desc = "Blame line"; + }; + } + { + mode = "n"; + key = "ghd"; + action = ":Gitsigns diffthis"; + options = { + silent = true; + desc = "Diff This"; + }; + } + { + mode = "n"; + key = "ghp"; + action = ":Gitsigns preview_hunk"; + options = { + silent = true; + desc = "Preview hunk"; + }; + } + { + mode = "n"; + key = "ghR"; + action = ":Gitsigns reset_buffer"; + options = { + silent = true; + desc = "Reset Buffer"; + }; + } + { + mode = ["n" "v"]; + key = "ghr"; + action = ":Gitsigns reset_hunk"; + options = { + silent = true; + desc = "Reset Hunk"; + }; + } + { + mode = ["n" "v"]; + key = "ghs"; + action = ":Gitsigns stage_hunk"; + options = { + silent = true; + desc = "Stage Hunk"; + }; + } + { + mode = "n"; + key = "ghS"; + action = ":Gitsigns stage_buffer"; + options = { + silent = true; + desc = "Stage Buffer"; + }; + } + { + mode = "n"; + key = "ghu"; + action = ":Gitsigns undo_stage_hunk"; + options = { + silent = true; + desc = "Undo Stage Hunk"; + }; + } + ]; +} +