2024-08-08 09:58:48 +08:00
|
|
|
{...}: {
|
2024-08-04 21:19:37 +08:00
|
|
|
plugins.gitsigns = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2024-08-06 21:06:23 +08:00
|
|
|
|
|
|
|
keymaps = [
|
|
|
|
{
|
2024-08-08 09:58:48 +08:00
|
|
|
mode = ["n" "v"];
|
2024-08-06 21:06:23 +08:00
|
|
|
key = "<leader>hs";
|
|
|
|
action = "<cmd>Gitsigns stage_hunk<cr>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
desc = "Stage Hunk";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2024-08-08 09:58:48 +08:00
|
|
|
mode = ["n" "v"];
|
2024-08-06 21:06:23 +08:00
|
|
|
key = "<leader>hr";
|
|
|
|
action = "<cmd>Gitsigns reset_hunk<cr>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
desc = "Reset Hunk";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
mode = "n";
|
|
|
|
key = "<leader>hS";
|
|
|
|
action = "<cmd>Gitsigns stage_buffer<cr>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
desc = "Stage Buffer";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
mode = "n";
|
|
|
|
key = "<leader>hu";
|
|
|
|
action = "<cmd>Gitsigns undo_stage_hunk<cr>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
desc = "Undo Staged Hunk";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
mode = "n";
|
|
|
|
key = "<leader>hR";
|
|
|
|
action = "<cmd>Gitsigns reset_buffer<cr>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
desc = "Reset Buffer";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
mode = "n";
|
|
|
|
key = "<leader>hp";
|
|
|
|
action = "<cmd>Gitsigns preview_hunk_inline<cr>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
desc = "Preview Hunk";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
mode = "n";
|
|
|
|
key = "<leader>hb";
|
|
|
|
action = "<cmd>Gitsigns blame<cr>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
desc = "View Blame";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
mode = "n";
|
|
|
|
key = "<leader>tb";
|
|
|
|
action = "<cmd>Gitsigns toggle_current_line_blame<cr>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
desc = "Toggle Blame";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
mode = "n";
|
|
|
|
key = "<leader>hd";
|
|
|
|
action = "<cmd>Gitsigns diffthis<cr>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
desc = "View Diff";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
mode = "n";
|
|
|
|
key = "<leader>td";
|
|
|
|
action = "<cmd>Gitsigns toggle_deleted<cr>";
|
|
|
|
options = {
|
|
|
|
silent = true;
|
|
|
|
desc = "Toggle Deleted";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2024-08-04 21:19:37 +08:00
|
|
|
}
|