Skip to content

Commit ff582a1

Browse files
committed
plugins/gitlineage: init
1 parent 5b138ed commit ff582a1

2 files changed

Lines changed: 119 additions & 0 deletions

File tree

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
lib,
3+
pkgs,
4+
...
5+
}:
6+
let
7+
inherit (lib) types;
8+
inherit (lib.nixvim) defaultNullOpts;
9+
in
10+
lib.nixvim.plugins.mkNeovimPlugin {
11+
name = "gitlineage";
12+
moduleName = "gitlineage";
13+
package = lib.mkOption {
14+
type = types.package;
15+
default = pkgs.vimUtils.buildVimPlugin {
16+
name = "gitlineage.nvim";
17+
src = pkgs.fetchFromGitHub {
18+
owner = "LionyxML";
19+
repo = "gitlineage.nvim";
20+
rev = "main";
21+
hash = "sha256-BGCE/SosircJu9JDz92JKlMgNw7CEl6BeIDDFEvGWFs=";
22+
};
23+
};
24+
defaultText = lib.literalExpression ''
25+
pkgs.vimUtils.buildVimPlugin {
26+
name = "gitlineage.nvim";
27+
src = pkgs.fetchFromGitHub {
28+
owner = "LionyxML";
29+
repo = "gitlineage.nvim";
30+
rev = "main";
31+
hash = "sha256-BGCE/SosircJu9JDz92JKlMgNw7CEl6BeIDDFEvGWFs=";
32+
};
33+
}
34+
'';
35+
description = "Package providing gitlineage.nvim.";
36+
};
37+
description = "Show git lineage information inside Neovim.";
38+
39+
maintainers = with lib.maintainers; [ LionyxML ];
40+
41+
settingsOptions = {
42+
split = defaultNullOpts.mkStr "auto" ''
43+
Where the git lineage window should open.
44+
Accepts "vertical", "horizontal", or "auto".
45+
'';
46+
47+
keymap = defaultNullOpts.mkStr "<leader>gl" ''
48+
Default keymap for opening the git lineage window.
49+
Set to `null` to disable.
50+
'';
51+
52+
keys =
53+
defaultNullOpts.mkAttrsOf (types.nullOr types.str)
54+
{
55+
close = "q";
56+
next_commit = "]c";
57+
prev_commit = "[c";
58+
yank_commit = "yc";
59+
open_diff = "<CR>";
60+
}
61+
''
62+
Keymaps inside the git lineage window.
63+
Set individual entries to `null` to disable.
64+
'';
65+
};
66+
67+
settingsExample = {
68+
split = "auto";
69+
keymap = "<leader>gl";
70+
keys = {
71+
close = "q";
72+
next_commit = "]c";
73+
prev_commit = "[c";
74+
yank_commit = "yc";
75+
open_diff = "<CR>";
76+
};
77+
};
78+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
empty = {
3+
plugins.gitlineage.enable = true;
4+
};
5+
6+
defaults = {
7+
plugins.gitlineage = {
8+
enable = true;
9+
10+
settings = {
11+
split = "auto";
12+
keymap = "<leader>gl";
13+
keys = {
14+
close = "q";
15+
next_commit = "]c";
16+
prev_commit = "[c";
17+
yank_commit = "yc";
18+
open_diff = "<CR>";
19+
};
20+
};
21+
};
22+
};
23+
24+
example = {
25+
plugins.gitlineage = {
26+
enable = true;
27+
28+
settings = {
29+
split = "vertical";
30+
keymap.__raw = "nil";
31+
keys = {
32+
close = "q";
33+
next_commit = "]c";
34+
prev_commit = "[c";
35+
yank_commit = "yc";
36+
open_diff.__raw = "nil";
37+
};
38+
};
39+
};
40+
};
41+
}

0 commit comments

Comments
 (0)