Skip to content

Commit add9aca

Browse files
committed
plugins/overseer: init
1 parent a20d956 commit add9aca

File tree

2 files changed

+309
-0
lines changed

2 files changed

+309
-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 = "overseer";
11+
originalName = "overseer.nvim";
12+
package = "overseer-nvim";
13+
14+
maintainers = [ lib.maintainers.khaneliman ];
15+
16+
settingsOptions = {
17+
strategy = defaultNullOpts.mkStr "terminal" ''
18+
Default task strategy.
19+
'';
20+
21+
templates = defaultNullOpts.mkListOf types.str [ "builtin" ] ''
22+
Template modules to load.
23+
'';
24+
25+
auto_detect_success_color = defaultNullOpts.mkBool true ''
26+
When true, tries to detect a green color from your colorscheme to use for success highlight.
27+
'';
28+
29+
dap = defaultNullOpts.mkBool true ''
30+
Whether to patch nvim-dap to support preLaunchTask and postDebugTask
31+
'';
32+
33+
task_list =
34+
defaultNullOpts.mkAttrsOf types.anything
35+
{
36+
default_detail = 1;
37+
max_width = [
38+
100
39+
0.2
40+
];
41+
min_width = [
42+
40
43+
0.1
44+
];
45+
width = null;
46+
max_height = [
47+
20
48+
0.1
49+
];
50+
min_height = 8;
51+
height = null;
52+
separator = "────────────────────────────────────────";
53+
direction = "bottom";
54+
bindings = {
55+
"?" = "ShowHelp";
56+
"g?" = "ShowHelp";
57+
"<CR>" = "RunAction";
58+
"<C-e>" = "Edit";
59+
"o" = "Open";
60+
"<C-v>" = "OpenVsplit";
61+
"<C-s>" = "OpenSplit";
62+
"<C-f>" = "OpenFloat";
63+
"<C-q>" = "OpenQuickFix";
64+
"p" = "TogglePreview";
65+
"<C-l>" = "IncreaseDetail";
66+
"<C-h>" = "DecreaseDetail";
67+
"L" = "IncreaseAllDetail";
68+
"H" = "DecreaseAllDetail";
69+
"[" = "DecreaseWidth";
70+
"]" = "IncreaseWidth";
71+
"{" = "PrevTask";
72+
"}" = "NextTask";
73+
"<C-k>" = "ScrollOutputUp";
74+
"<C-j>" = "ScrollOutputDown";
75+
"q" = "Close";
76+
};
77+
}
78+
''The task list displays all tasks that have been created. It shows the task status, name, and a summary of the task output.'';
79+
80+
task_editor = {
81+
bindings =
82+
defaultNullOpts.mkAttrsOf types.anything
83+
{
84+
i = {
85+
"<CR>" = "NextOrSubmit";
86+
"<C-s>" = "Submit";
87+
"<Tab>" = "Next";
88+
"<S-Tab>" = "Prev";
89+
"<C-c>" = "Cancel";
90+
};
91+
n = {
92+
"<CR>" = "NextOrSubmit";
93+
"<C-s>" = "Submit";
94+
"<Tab>" = "Next";
95+
"<S-Tab>" = "Prev";
96+
"q" = "Cancel";
97+
"?" = "ShowHelp";
98+
};
99+
}
100+
''
101+
Set keymap to false to remove default behavior.
102+
You can add custom keymaps here as well (anything vim.keymap.set accepts).
103+
'';
104+
};
105+
106+
task_launcher = {
107+
bindings =
108+
defaultNullOpts.mkAttrsOf types.anything
109+
{
110+
i = {
111+
"<C-s>" = "Submit";
112+
"<C-c>" = "Cancel";
113+
};
114+
n = {
115+
"<CR>" = "Submit";
116+
"<C-s>" = "Submit";
117+
"q" = "Cancel";
118+
"?" = "ShowHelp";
119+
};
120+
}
121+
''
122+
Set keymap to false to remove default behavior.
123+
You can add custom keymaps here as well (anything vim.keymap.set accepts).
124+
'';
125+
};
126+
127+
actions = defaultNullOpts.mkAttrsOf types.anything { } ''
128+
They are simply a custom function that will do something to or with a task.
129+
Please refer to the documentation for details of available builtin actions.
130+
'';
131+
};
132+
}
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
{
2+
empty = {
3+
plugins.overseer.enable = true;
4+
};
5+
6+
default = {
7+
plugins.overseer = {
8+
settings = {
9+
strategy = "terminal";
10+
templates = [ "builtin" ];
11+
auto_detect_success_color = true;
12+
dap = true;
13+
task_list = {
14+
default_detail = 1;
15+
max_width = [
16+
100
17+
0.2
18+
];
19+
min_width = [
20+
40
21+
0.1
22+
];
23+
width = null;
24+
max_height = [
25+
20
26+
0.1
27+
];
28+
min_height = 8;
29+
height = null;
30+
separator = "────────────────────────────────────────";
31+
direction = "bottom";
32+
bindings = {
33+
"?" = "ShowHelp";
34+
"g?" = "ShowHelp";
35+
"<CR>" = "RunAction";
36+
"<C-e>" = "Edit";
37+
"o" = "Open";
38+
"<C-v>" = "OpenVsplit";
39+
"<C-s>" = "OpenSplit";
40+
"<C-f>" = "OpenFloat";
41+
"<C-q>" = "OpenQuickFix";
42+
"p" = "TogglePreview";
43+
"<C-l>" = "IncreaseDetail";
44+
"<C-h>" = "DecreaseDetail";
45+
"L" = "IncreaseAllDetail";
46+
"H" = "DecreaseAllDetail";
47+
"[" = "DecreaseWidth";
48+
"]" = "IncreaseWidth";
49+
"{" = "PrevTask";
50+
"}" = "NextTask";
51+
"<C-k>" = "ScrollOutputUp";
52+
"<C-j>" = "ScrollOutputDown";
53+
"q" = "Close";
54+
};
55+
};
56+
actions = { };
57+
form = {
58+
border = "rounded";
59+
zindex = 40;
60+
min_width = 80;
61+
max_width = 0.9;
62+
width = null;
63+
min_height = 10;
64+
max_height = 0.9;
65+
height = null;
66+
win_opts = {
67+
winblend = 0;
68+
};
69+
};
70+
task_launcher = {
71+
bindings = {
72+
i = {
73+
"<C-s>" = "Submit";
74+
"<C-c>" = "Cancel";
75+
};
76+
n = {
77+
"<CR>" = "Submit";
78+
"<C-s>" = "Submit";
79+
"q" = "Cancel";
80+
"?" = "ShowHelp";
81+
};
82+
};
83+
};
84+
task_editor = {
85+
bindings = {
86+
i = {
87+
"<CR>" = "NextOrSubmit";
88+
"<C-s>" = "Submit";
89+
"<Tab>" = "Next";
90+
"<S-Tab>" = "Prev";
91+
"<C-c>" = "Cancel";
92+
};
93+
n = {
94+
"<CR>" = "NextOrSubmit";
95+
"<C-s>" = "Submit";
96+
"<Tab>" = "Next";
97+
"<S-Tab>" = "Prev";
98+
"q" = "Cancel";
99+
"?" = "ShowHelp";
100+
};
101+
};
102+
};
103+
confirm = {
104+
border = "rounded";
105+
zindex = 40;
106+
min_width = 20;
107+
max_width = 0.5;
108+
width = null;
109+
min_height = 6;
110+
max_height = 0.9;
111+
height = null;
112+
win_opts = {
113+
winblend = 0;
114+
};
115+
};
116+
task_win = {
117+
padding = 2;
118+
border = "rounded";
119+
win_opts = {
120+
winblend = 0;
121+
};
122+
};
123+
help_win = {
124+
border = "rounded";
125+
win_opts = { };
126+
};
127+
component_aliases = {
128+
default = [
129+
{
130+
__unkeyed-1 = "display_duration";
131+
detail_level = 2;
132+
}
133+
"on_output_summarize"
134+
"on_exit_set_status"
135+
"on_complete_notify"
136+
{
137+
__unkeyed-2 = "on_complete_dispose";
138+
require_view = [
139+
"SUCCESS"
140+
"FAILURE"
141+
];
142+
}
143+
];
144+
default_vscode = [
145+
"default"
146+
"on_result_diagnostics"
147+
];
148+
};
149+
bundles = {
150+
save_task_opts = {
151+
bundleable = true;
152+
};
153+
autostart_on_load = true;
154+
};
155+
preload_components = [ ];
156+
default_template_prompt = "allow";
157+
template_timeout = 3000;
158+
template_cache_threshold = 100;
159+
};
160+
};
161+
};
162+
163+
keymaps = {
164+
plugins.overseer = {
165+
enable = true;
166+
settings = {
167+
task_launcher = {
168+
"<C-s>" = false;
169+
"<C-m>" = {
170+
action = "<cmd>make<CR>";
171+
options.silent = true;
172+
};
173+
};
174+
};
175+
};
176+
};
177+
}

0 commit comments

Comments
 (0)