Skip to content

Commit b248b5a

Browse files
committed
utility/multicursors: stylistic changes after #610
1 parent b994158 commit b248b5a

File tree

2 files changed

+44
-31
lines changed

2 files changed

+44
-31
lines changed

configuration.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,18 @@ isMaximal: {
173173
utility = {
174174
ccc.enable = false;
175175
vim-wakatime.enable = false;
176-
icon-picker.enable = isMaximal;
177-
surround.enable = isMaximal;
178176
diffview-nvim.enable = true;
179177
yanky-nvim.enable = false;
178+
icon-picker.enable = isMaximal;
179+
surround.enable = isMaximal;
180180
leetcode-nvim.enable = isMaximal;
181+
multicursors.enable = isMaximal;
182+
181183
motion = {
182184
hop.enable = true;
183185
leap.enable = true;
184186
precognition.enable = isMaximal;
185187
};
186-
multicursors.enable = isMaximal;
187188
images = {
188189
image-nvim.enable = false;
189190
};

modules/plugins/utility/multicursors/multicursors.nix

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,69 @@
11
{lib, ...}: let
2-
inherit (lib.types) bool int str;
3-
inherit (lib.nvim.types) mkPluginSetupOption;
42
inherit (lib.options) mkOption mkEnableOption;
5-
hintConfig = {lib, ...}: {
3+
inherit (lib.types) attrsOf nullOr bool int str submodule;
4+
inherit (lib.nvim.types) mkPluginSetupOption;
5+
6+
hintConfig = {
67
options = {
78
float_opts = mkOption {
89
description = "The options for the floating hint window";
9-
type = lib.types.submodule {
10+
type = submodule {
1011
options = {
1112
border = mkOption {
12-
type = lib.types.str;
13+
type = str;
1314
default = "none";
1415
description = "The border style for the hint window";
1516
};
1617
};
1718
};
1819
};
20+
1921
position = mkOption {
20-
type = lib.types.str;
22+
type = str;
2123
default = "bottom";
2224
description = "The position of the hint window";
2325
};
2426
};
2527
};
26-
generateHints = {lib, ...}: {
28+
29+
generateHints = {
2730
options = {
2831
normal = mkOption {
29-
type = lib.types.bool;
30-
description = "Generate hints for the normal mode";
32+
type = bool;
3133
default = true;
34+
description = "Generate hints for the normal mode";
3235
};
36+
3337
insert = mkOption {
34-
type = lib.types.bool;
35-
description = "Generate hints for the insert mode";
38+
type = bool;
3639
default = true;
40+
description = "Generate hints for the insert mode";
3741
};
42+
3843
extend = mkOption {
39-
type = lib.types.bool;
40-
description = "Generate hints for the extend mode";
44+
type = bool;
4145
default = true;
46+
description = "Generate hints for the extend mode";
4247
};
48+
4349
config = mkOption {
4450
description = "The configuration for generating hints for multicursors.nvim";
45-
type = lib.types.submodule {
51+
type = submodule {
4652
options = {
4753
column_count = mkOption {
48-
type = lib.types.nullOr int;
49-
description = "The number of columns to use for the hint window";
54+
type = nullOr int;
5055
default = null;
56+
description = "The number of columns to use for the hint window";
5157
};
58+
5259
max_hint_length = mkOption {
5360
type = int;
54-
description = "The maximum length of the hint";
5561
default = 25;
62+
description = "The maximum length of the hint";
5663
};
5764
};
5865
};
66+
5967
default = {
6068
column_count = null;
6169
max_hint_length = 25;
@@ -65,52 +73,55 @@
6573
};
6674
in {
6775
options.vim.utility.multicursors = {
68-
enable = mkEnableOption "multicursors.nvim plugin (vscode like multiple cursors)";
76+
enable = mkEnableOption "vscode like multiple cursors [multicursor.nvim]";
6977

7078
setupOpts = mkPluginSetupOption "multicursors" {
7179
DEBUG_MODE = mkOption {
7280
type = bool;
7381
default = false;
7482
description = "Enable debug mode.";
7583
};
84+
7685
create_commands = mkOption {
7786
type = bool;
7887
default = true;
7988
description = "Create Multicursor user commands";
8089
};
90+
8191
updatetime = mkOption {
8292
type = int;
8393
default = 50;
8494
description = "The time in milliseconds to wait before updating the cursor in insert mode";
8595
};
96+
8697
nowait = mkOption {
8798
type = bool;
88-
description = "Don't wait for the cursor to move before updating the cursor";
8999
default = true;
100+
description = "Don't wait for the cursor to move before updating the cursor";
90101
};
102+
91103
mode_keys = mkOption {
92-
type = lib.types.attrsOf str;
93-
description = "The keys to use for each mode";
104+
type = attrsOf str;
94105
default = {
95106
insert = "i";
96107
append = "a";
97108
change = "c";
98109
extend = "e";
99110
};
111+
description = "The keys to use for each mode";
100112
};
113+
101114
hint_config = mkOption {
102-
type = lib.types.submodule hintConfig;
103-
description = "The configuration for the hint window";
115+
type = submodule hintConfig;
104116
default = {
105-
float_opts = {
106-
border = "none";
107-
};
117+
float_opts.border = "none";
108118
position = "bottom";
109119
};
120+
description = "The configuration for the hint window";
110121
};
122+
111123
generate_hints = mkOption {
112-
type = lib.types.submodule generateHints;
113-
description = "The configuration for generating hints";
124+
type = submodule generateHints;
114125
default = {
115126
normal = true;
116127
insert = true;
@@ -120,6 +131,7 @@ in {
120131
max_hint_length = 25;
121132
};
122133
};
134+
description = "The configuration for generating hints";
123135
};
124136
};
125137
};

0 commit comments

Comments
 (0)