Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions plugins/by-name/gitlineage/default.nix
Original file line number Diff line number Diff line change
@@ -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 "<leader>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 = "<CR>";
}
''
Keymaps inside the git lineage window.
Set individual entries to `null` to disable.
'';
};

Comment on lines +17 to +42
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, we tend to avoid explicitly declaring settingsOptions. The settings option is already freeform by default, so it accepts arbitrary values.

settingsExample = {
split = "auto";
keymap = "<leader>gl";
keys = {
close = "q";
next_commit = "]c";
prev_commit = "[c";
yank_commit = "yc";
open_diff = "<CR>";
};
};
}
41 changes: 41 additions & 0 deletions tests/test-sources/plugins/by-name/gitlineage/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
empty = {
plugins.gitlineage.enable = true;
};

defaults = {
plugins.gitlineage = {
enable = true;

settings = {
split = "auto";
keymap = "<leader>gl";
keys = {
close = "q";
next_commit = "]c";
prev_commit = "[c";
yank_commit = "yc";
open_diff = "<CR>";
};
};
};
};

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";
};
};
};
};
}
Loading