Skip to content

Commit a20d956

Browse files
committed
plugins/precognition: init
1 parent 5721962 commit a20d956

File tree

2 files changed

+213
-0
lines changed

2 files changed

+213
-0
lines changed
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
{
2+
lib,
3+
...
4+
}:
5+
let
6+
inherit (lib.nixvim) defaultNullOpts;
7+
inherit (lib) types;
8+
in
9+
lib.nixvim.neovim-plugin.mkNeovimPlugin {
10+
name = "precognition";
11+
originalName = "precognition.nvim";
12+
package = "precognition-nvim";
13+
14+
maintainers = [ lib.maintainers.khaneliman ];
15+
16+
settingsOptions = {
17+
startVisible = defaultNullOpts.mkBool true ''
18+
Whether to show precognition.nvim on startup.
19+
'';
20+
21+
showBlankVirtLine = defaultNullOpts.mkBool true ''
22+
Setting this option will mean that if a Virtual Line would be blank it won't be rendered.
23+
'';
24+
25+
disabled_fts = defaultNullOpts.mkListOf types.str [
26+
"startify"
27+
] "`precognition.nvim` is disabled under these filetypes.";
28+
29+
highlightColor =
30+
defaultNullOpts.mkAttrsOf types.anything
31+
{
32+
link = "Comment";
33+
}
34+
''
35+
Highlight groups for the hints.
36+
37+
Can be defined as either:
38+
- As a table containing a link property pointing to an existing highlight group.
39+
- As a table specifying custom highlight values, such as foreground and background colors.
40+
'';
41+
42+
hints =
43+
defaultNullOpts.mkAttrsOf types.anything
44+
{
45+
Caret = {
46+
text = "^";
47+
prio = 2;
48+
};
49+
Dollar = {
50+
text = "$";
51+
prio = 1;
52+
};
53+
MatchingPair = {
54+
text = "%";
55+
prio = 5;
56+
};
57+
Zero = {
58+
text = "0";
59+
prio = 1;
60+
};
61+
w = {
62+
text = "w";
63+
prio = 10;
64+
};
65+
b = {
66+
text = "b";
67+
prio = 9;
68+
};
69+
e = {
70+
text = "e";
71+
prio = 8;
72+
};
73+
W = {
74+
text = "W";
75+
prio = 7;
76+
};
77+
B = {
78+
text = "B";
79+
prio = 6;
80+
};
81+
E = {
82+
text = "E";
83+
prio = 5;
84+
};
85+
}
86+
''
87+
Hints that will be shown on the virtual line.
88+
Priority is used to determine which hint to show when two can be shown at the same spot.
89+
90+
Hints can be hidden by setting their priority to `0`.
91+
If you want to hide the entire virtual line, set all elements to `prio = 0`.
92+
'';
93+
94+
gutterHints =
95+
defaultNullOpts.mkAttrsOf types.anything
96+
{
97+
G = {
98+
text = "G";
99+
prio = 10;
100+
};
101+
gg = {
102+
text = "gg";
103+
prio = 9;
104+
};
105+
PrevParagraph = {
106+
text = "{";
107+
prio = 8;
108+
};
109+
NextParagraph = {
110+
text = "}";
111+
prio = 8;
112+
};
113+
}
114+
''
115+
Hints that will be shown on the gutter.
116+
117+
Hints can be hidden by setting their priority to `0`.
118+
'';
119+
};
120+
121+
settingsExample = {
122+
startVisible = false;
123+
showBlankVirtLine = false;
124+
highlightColor = {
125+
link = "Text";
126+
};
127+
disabled_fts = [
128+
"startify"
129+
"dashboard"
130+
];
131+
};
132+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
empty = {
3+
plugins.precognition.enable = true;
4+
};
5+
6+
default = {
7+
plugins.precognition = {
8+
enable = true;
9+
settings = {
10+
startVisible = true;
11+
showBlankVirtLine = true;
12+
highlightColor = {
13+
link = "Comment";
14+
};
15+
hints = {
16+
Caret = {
17+
text = "^";
18+
prio = 2;
19+
};
20+
Dollar = {
21+
text = "$";
22+
prio = 1;
23+
};
24+
MatchingPair = {
25+
text = "%";
26+
prio = 5;
27+
};
28+
Zero = {
29+
text = "0";
30+
prio = 1;
31+
};
32+
w = {
33+
text = "w";
34+
prio = 10;
35+
};
36+
b = {
37+
text = "b";
38+
prio = 9;
39+
};
40+
e = {
41+
text = "e";
42+
prio = 8;
43+
};
44+
W = {
45+
text = "W";
46+
prio = 7;
47+
};
48+
B = {
49+
text = "B";
50+
prio = 6;
51+
};
52+
E = {
53+
text = "E";
54+
prio = 5;
55+
};
56+
};
57+
gutterHints = {
58+
G = {
59+
text = "G";
60+
prio = 10;
61+
};
62+
gg = {
63+
text = "gg";
64+
prio = 9;
65+
};
66+
PrevParagraph = {
67+
text = "{";
68+
prio = 8;
69+
};
70+
NextParagraph = {
71+
text = "}";
72+
prio = 8;
73+
};
74+
};
75+
disabled_fts = [
76+
"startify"
77+
];
78+
};
79+
};
80+
};
81+
}

0 commit comments

Comments
 (0)