diff --git a/flake.lock b/flake.lock index 02f0b87914..75ed7716de 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1774701658, - "narHash": "sha256-CIS/4AMUSwUyC8X5g+5JsMRvIUL3YUfewe8K4VrbsSQ=", + "lastModified": 1775888245, + "narHash": "sha256-nwASzrRDD1JBEu/o8ekKYEXm/oJW6EMCzCRdrwcLe90=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b63fe7f000adcfa269967eeff72c64cafecbbebe", + "rev": "13043924aaa7375ce482ebe2494338e058282925", "type": "github" }, "original": { diff --git a/plugins/by-name/gitlineage/default.nix b/plugins/by-name/gitlineage/default.nix new file mode 100644 index 0000000000..45ebef0fb4 --- /dev/null +++ b/plugins/by-name/gitlineage/default.nix @@ -0,0 +1,54 @@ +{ + lib, + ... +}: +let + inherit (lib) types; + inherit (lib.nixvim) defaultNullOpts; +in +lib.nixvim.plugins.mkNeovimPlugin { + name = "gitlineage"; + package = "gitlineage-nvim"; + + description = "Show git lineage information inside Neovim."; + + maintainers = with lib.maintainers; [ LionyxML ]; + + settingsOptions = { + split = defaultNullOpts.mkStr "auto" '' + Where the git lineage window should open. + Accepts "vertical", "horizontal", or "auto". + ''; + + keymap = defaultNullOpts.mkStr "gl" '' + Default keymap for opening the git lineage window. + Set to `null` to disable. + ''; + + keys = + defaultNullOpts.mkAttrsOf (types.nullOr types.str) + { + close = "q"; + next_commit = "]c"; + prev_commit = "[c"; + yank_commit = "yc"; + open_diff = ""; + } + '' + Keymaps inside the git lineage window. + Set individual entries to `null` to disable. + ''; + }; + + settingsExample = { + split = "auto"; + keymap = "gl"; + keys = { + close = "q"; + next_commit = "]c"; + prev_commit = "[c"; + yank_commit = "yc"; + open_diff = ""; + }; + }; +} diff --git a/tests/test-sources/plugins/by-name/gitlineage/default.nix b/tests/test-sources/plugins/by-name/gitlineage/default.nix new file mode 100644 index 0000000000..67b13a3f75 --- /dev/null +++ b/tests/test-sources/plugins/by-name/gitlineage/default.nix @@ -0,0 +1,41 @@ +{ + empty = { + plugins.gitlineage.enable = true; + }; + + defaults = { + plugins.gitlineage = { + enable = true; + + settings = { + split = "auto"; + keymap = "gl"; + keys = { + close = "q"; + next_commit = "]c"; + prev_commit = "[c"; + yank_commit = "yc"; + open_diff = ""; + }; + }; + }; + }; + + example = { + plugins.gitlineage = { + enable = true; + + settings = { + split = "vertical"; + keymap.__raw = "nil"; + keys = { + close = "q"; + next_commit = "]c"; + prev_commit = "[c"; + yank_commit = "yc"; + open_diff.__raw = "nil"; + }; + }; + }; + }; +}