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