2024-02-26 05:05:23 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (lib.options) mkEnableOption;
|
|
|
|
inherit (lib.nvim.binds) mkMappingOption;
|
2023-11-07 00:50:27 +00:00
|
|
|
in {
|
2023-02-01 19:11:37 +00:00
|
|
|
options.vim.git = {
|
2024-02-26 05:05:23 +00:00
|
|
|
enable = mkEnableOption "git integration";
|
2023-02-01 19:11:37 +00:00
|
|
|
|
2023-04-17 21:55:12 +00:00
|
|
|
gitsigns = {
|
2024-02-26 05:05:23 +00:00
|
|
|
enable = mkEnableOption "gitsigns" // {default = config.vim.git.enable;};
|
2023-02-01 19:11:37 +00:00
|
|
|
|
2023-04-22 16:47:19 +00:00
|
|
|
mappings = {
|
|
|
|
nextHunk = mkMappingOption "Next hunk [Gitsigns]" "]c";
|
|
|
|
previousHunk = mkMappingOption "Previous hunk [Gitsigns]" "[c";
|
|
|
|
|
|
|
|
stageHunk = mkMappingOption "Stage hunk [Gitsigns]" "<leader>hs";
|
|
|
|
undoStageHunk = mkMappingOption "Undo stage hunk [Gitsigns]" "<leader>hu";
|
|
|
|
resetHunk = mkMappingOption "Reset hunk [Gitsigns]" "<leader>hr";
|
|
|
|
|
|
|
|
stageBuffer = mkMappingOption "Stage buffer [Gitsigns]" "<leader>hS";
|
|
|
|
resetBuffer = mkMappingOption "Reset buffer [Gitsigns]" "<leader>hR";
|
|
|
|
|
|
|
|
previewHunk = mkMappingOption "Preview hunk [Gitsigns]" "<leader>hP";
|
|
|
|
|
|
|
|
blameLine = mkMappingOption "Blame line [Gitsigns]" "<leader>hb";
|
|
|
|
toggleBlame = mkMappingOption "Toggle blame [Gitsigns]" "<leader>tb";
|
|
|
|
|
|
|
|
diffThis = mkMappingOption "Diff this [Gitsigns]" "<leader>hd";
|
|
|
|
diffProject = mkMappingOption "Diff project [Gitsigns]" "<leader>hD";
|
|
|
|
|
|
|
|
toggleDeleted = mkMappingOption "Toggle deleted [Gitsigns]" "<leader>td";
|
|
|
|
};
|
|
|
|
|
2023-04-17 21:55:12 +00:00
|
|
|
codeActions = mkEnableOption "gitsigns codeactions through null-ls";
|
2023-03-31 15:47:17 +00:00
|
|
|
};
|
2023-04-17 21:55:12 +00:00
|
|
|
};
|
2023-02-01 19:11:37 +00:00
|
|
|
}
|