add gitsigns

This commit is contained in:
Aditya 2024-03-04 19:22:11 +05:30
parent 77ccb7aedb
commit 7a0ff6d247
Signed by: aditya
SSH key fingerprint: SHA256:jL1IvWsjjlPtw6HvDIHfXfhO9IkIokNEyIfuFhSdoyU
2 changed files with 92 additions and 0 deletions

View file

@ -10,6 +10,7 @@
./completion/lspkind.nix
./git/diffview.nix
./git/gitsigns.nix
./dap/dap.nix

91
config/git/gitsigns.nix Normal file
View file

@ -0,0 +1,91 @@
{
plugins.gitsigns = {
enable = true;
trouble = true;
currentLineBlame = true;
};
keymaps = [
{
mode = ["n" "v"];
key = "<leader>gh";
action = "gitsigns";
options = {
silent = true;
desc = "+hunks";
};
}
{
mode = "n";
key = "<leader>ghb";
action = ":Gitsigns blame_line<CR>";
options = {
silent = true;
desc = "Blame line";
};
}
{
mode = "n";
key = "<leader>ghd";
action = ":Gitsigns diffthis<CR>";
options = {
silent = true;
desc = "Diff This";
};
}
{
mode = "n";
key = "<leader>ghp";
action = ":Gitsigns preview_hunk<CR>";
options = {
silent = true;
desc = "Preview hunk";
};
}
{
mode = "n";
key = "<leader>ghR";
action = ":Gitsigns reset_buffer<CR>";
options = {
silent = true;
desc = "Reset Buffer";
};
}
{
mode = ["n" "v"];
key = "<leader>ghr";
action = ":Gitsigns reset_hunk<CR>";
options = {
silent = true;
desc = "Reset Hunk";
};
}
{
mode = ["n" "v"];
key = "<leader>ghs";
action = ":Gitsigns stage_hunk<CR>";
options = {
silent = true;
desc = "Stage Hunk";
};
}
{
mode = "n";
key = "<leader>ghS";
action = ":Gitsigns stage_buffer<CR>";
options = {
silent = true;
desc = "Stage Buffer";
};
}
{
mode = "n";
key = "<leader>ghu";
action = ":Gitsigns undo_stage_hunk<CR>";
options = {
silent = true;
desc = "Undo Stage Hunk";
};
}
];
}