|
1 | 1 | {lib, ...}: let |
2 | | - inherit (lib.types) bool int str; |
3 | | - inherit (lib.nvim.types) mkPluginSetupOption; |
4 | 2 | 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 = { |
6 | 7 | options = { |
7 | 8 | float_opts = mkOption { |
8 | 9 | description = "The options for the floating hint window"; |
9 | | - type = lib.types.submodule { |
| 10 | + type = submodule { |
10 | 11 | options = { |
11 | 12 | border = mkOption { |
12 | | - type = lib.types.str; |
| 13 | + type = str; |
13 | 14 | default = "none"; |
14 | 15 | description = "The border style for the hint window"; |
15 | 16 | }; |
16 | 17 | }; |
17 | 18 | }; |
18 | 19 | }; |
| 20 | + |
19 | 21 | position = mkOption { |
20 | | - type = lib.types.str; |
| 22 | + type = str; |
21 | 23 | default = "bottom"; |
22 | 24 | description = "The position of the hint window"; |
23 | 25 | }; |
24 | 26 | }; |
25 | 27 | }; |
26 | | - generateHints = {lib, ...}: { |
| 28 | + |
| 29 | + generateHints = { |
27 | 30 | options = { |
28 | 31 | normal = mkOption { |
29 | | - type = lib.types.bool; |
30 | | - description = "Generate hints for the normal mode"; |
| 32 | + type = bool; |
31 | 33 | default = true; |
| 34 | + description = "Generate hints for the normal mode"; |
32 | 35 | }; |
| 36 | + |
33 | 37 | insert = mkOption { |
34 | | - type = lib.types.bool; |
35 | | - description = "Generate hints for the insert mode"; |
| 38 | + type = bool; |
36 | 39 | default = true; |
| 40 | + description = "Generate hints for the insert mode"; |
37 | 41 | }; |
| 42 | + |
38 | 43 | extend = mkOption { |
39 | | - type = lib.types.bool; |
40 | | - description = "Generate hints for the extend mode"; |
| 44 | + type = bool; |
41 | 45 | default = true; |
| 46 | + description = "Generate hints for the extend mode"; |
42 | 47 | }; |
| 48 | + |
43 | 49 | config = mkOption { |
44 | 50 | description = "The configuration for generating hints for multicursors.nvim"; |
45 | | - type = lib.types.submodule { |
| 51 | + type = submodule { |
46 | 52 | options = { |
47 | 53 | 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; |
50 | 55 | default = null; |
| 56 | + description = "The number of columns to use for the hint window"; |
51 | 57 | }; |
| 58 | + |
52 | 59 | max_hint_length = mkOption { |
53 | 60 | type = int; |
54 | | - description = "The maximum length of the hint"; |
55 | 61 | default = 25; |
| 62 | + description = "The maximum length of the hint"; |
56 | 63 | }; |
57 | 64 | }; |
58 | 65 | }; |
| 66 | + |
59 | 67 | default = { |
60 | 68 | column_count = null; |
61 | 69 | max_hint_length = 25; |
|
65 | 73 | }; |
66 | 74 | in { |
67 | 75 | options.vim.utility.multicursors = { |
68 | | - enable = mkEnableOption "multicursors.nvim plugin (vscode like multiple cursors)"; |
| 76 | + enable = mkEnableOption "vscode like multiple cursors [multicursor.nvim]"; |
69 | 77 |
|
70 | 78 | setupOpts = mkPluginSetupOption "multicursors" { |
71 | 79 | DEBUG_MODE = mkOption { |
72 | 80 | type = bool; |
73 | 81 | default = false; |
74 | 82 | description = "Enable debug mode."; |
75 | 83 | }; |
| 84 | + |
76 | 85 | create_commands = mkOption { |
77 | 86 | type = bool; |
78 | 87 | default = true; |
79 | 88 | description = "Create Multicursor user commands"; |
80 | 89 | }; |
| 90 | + |
81 | 91 | updatetime = mkOption { |
82 | 92 | type = int; |
83 | 93 | default = 50; |
84 | 94 | description = "The time in milliseconds to wait before updating the cursor in insert mode"; |
85 | 95 | }; |
| 96 | + |
86 | 97 | nowait = mkOption { |
87 | 98 | type = bool; |
88 | | - description = "Don't wait for the cursor to move before updating the cursor"; |
89 | 99 | default = true; |
| 100 | + description = "Don't wait for the cursor to move before updating the cursor"; |
90 | 101 | }; |
| 102 | + |
91 | 103 | mode_keys = mkOption { |
92 | | - type = lib.types.attrsOf str; |
93 | | - description = "The keys to use for each mode"; |
| 104 | + type = attrsOf str; |
94 | 105 | default = { |
95 | 106 | insert = "i"; |
96 | 107 | append = "a"; |
97 | 108 | change = "c"; |
98 | 109 | extend = "e"; |
99 | 110 | }; |
| 111 | + description = "The keys to use for each mode"; |
100 | 112 | }; |
| 113 | + |
101 | 114 | hint_config = mkOption { |
102 | | - type = lib.types.submodule hintConfig; |
103 | | - description = "The configuration for the hint window"; |
| 115 | + type = submodule hintConfig; |
104 | 116 | default = { |
105 | | - float_opts = { |
106 | | - border = "none"; |
107 | | - }; |
| 117 | + float_opts.border = "none"; |
108 | 118 | position = "bottom"; |
109 | 119 | }; |
| 120 | + description = "The configuration for the hint window"; |
110 | 121 | }; |
| 122 | + |
111 | 123 | generate_hints = mkOption { |
112 | | - type = lib.types.submodule generateHints; |
113 | | - description = "The configuration for generating hints"; |
| 124 | + type = submodule generateHints; |
114 | 125 | default = { |
115 | 126 | normal = true; |
116 | 127 | insert = true; |
|
120 | 131 | max_hint_length = 25; |
121 | 132 | }; |
122 | 133 | }; |
| 134 | + description = "The configuration for generating hints"; |
123 | 135 | }; |
124 | 136 | }; |
125 | 137 | }; |
|
0 commit comments