mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-08 03:11:36 +00:00
git/neogit: module init
This commit is contained in:
parent
b485040933
commit
94908ffb0a
8 changed files with 83 additions and 3 deletions
39
modules/plugins/git/neogit/config.nix
Normal file
39
modules/plugins/git/neogit/config.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
options,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.binds) pushDownDefault mkKeymap;
|
||||
|
||||
cfg = config.vim.git.neogit;
|
||||
|
||||
keys = cfg.mappings;
|
||||
inherit (options.vim.git.neogit) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["plenary-nvim"];
|
||||
|
||||
lazy.plugins.neogit = {
|
||||
package = "neogit";
|
||||
setupModule = "neogit";
|
||||
inherit (cfg) setupOpts;
|
||||
|
||||
cmd = ["Neogit"];
|
||||
|
||||
keys = [
|
||||
(mkKeymap "n" keys.open "<Cmd>Neogit<CR>" {desc = mappings.open.description;})
|
||||
(mkKeymap "n" keys.commit "<Cmd>Neogit commit<CR>" {desc = mappings.commit.description;})
|
||||
(mkKeymap "n" keys.pull "<Cmd>Neogit pull<CR>" {desc = mappings.pull.description;})
|
||||
(mkKeymap "n" keys.push "<Cmd>Neogit push<CR>" {desc = mappings.push.description;})
|
||||
];
|
||||
};
|
||||
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>g" = "+Git";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue