utility/multicursors: stylistic changes after #610
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Validate flake & check documentation / Validate Flake Documentation (push) Waiting to run
Validate flake & check documentation / Validate hyperlinks in documentation sources (push) Waiting to run
Validate flake & check formatting / Validate Flake (push) Waiting to run
Validate flake & check formatting / Formatting via Alejandra (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
Check for typos in the source tree / check-typos (push) Waiting to run

This commit is contained in:
raf 2025-02-22 20:08:06 +03:00
parent b9941583fd
commit b248b5af59
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF
2 changed files with 44 additions and 31 deletions

View file

@ -173,17 +173,18 @@ isMaximal: {
utility = { utility = {
ccc.enable = false; ccc.enable = false;
vim-wakatime.enable = false; vim-wakatime.enable = false;
icon-picker.enable = isMaximal;
surround.enable = isMaximal;
diffview-nvim.enable = true; diffview-nvim.enable = true;
yanky-nvim.enable = false; yanky-nvim.enable = false;
icon-picker.enable = isMaximal;
surround.enable = isMaximal;
leetcode-nvim.enable = isMaximal; leetcode-nvim.enable = isMaximal;
multicursors.enable = isMaximal;
motion = { motion = {
hop.enable = true; hop.enable = true;
leap.enable = true; leap.enable = true;
precognition.enable = isMaximal; precognition.enable = isMaximal;
}; };
multicursors.enable = isMaximal;
images = { images = {
image-nvim.enable = false; image-nvim.enable = false;
}; };

View file

@ -1,61 +1,69 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.types) bool int str;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (lib.options) mkOption mkEnableOption; inherit (lib.options) mkOption mkEnableOption;
hintConfig = {lib, ...}: { inherit (lib.types) attrsOf nullOr bool int str submodule;
inherit (lib.nvim.types) mkPluginSetupOption;
hintConfig = {
options = { options = {
float_opts = mkOption { float_opts = mkOption {
description = "The options for the floating hint window"; description = "The options for the floating hint window";
type = lib.types.submodule { type = submodule {
options = { options = {
border = mkOption { border = mkOption {
type = lib.types.str; type = str;
default = "none"; default = "none";
description = "The border style for the hint window"; description = "The border style for the hint window";
}; };
}; };
}; };
}; };
position = mkOption { position = mkOption {
type = lib.types.str; type = str;
default = "bottom"; default = "bottom";
description = "The position of the hint window"; description = "The position of the hint window";
}; };
}; };
}; };
generateHints = {lib, ...}: {
generateHints = {
options = { options = {
normal = mkOption { normal = mkOption {
type = lib.types.bool; type = bool;
default = true;
description = "Generate hints for the normal mode"; description = "Generate hints for the normal mode";
default = true;
}; };
insert = mkOption { insert = mkOption {
type = lib.types.bool; type = bool;
default = true;
description = "Generate hints for the insert mode"; description = "Generate hints for the insert mode";
default = true;
}; };
extend = mkOption { extend = mkOption {
type = lib.types.bool; type = bool;
description = "Generate hints for the extend mode";
default = true; default = true;
description = "Generate hints for the extend mode";
}; };
config = mkOption { config = mkOption {
description = "The configuration for generating hints for multicursors.nvim"; description = "The configuration for generating hints for multicursors.nvim";
type = lib.types.submodule { type = submodule {
options = { options = {
column_count = mkOption { column_count = mkOption {
type = lib.types.nullOr int; type = nullOr int;
description = "The number of columns to use for the hint window";
default = null; default = null;
description = "The number of columns to use for the hint window";
}; };
max_hint_length = mkOption { max_hint_length = mkOption {
type = int; type = int;
description = "The maximum length of the hint";
default = 25; default = 25;
description = "The maximum length of the hint";
}; };
}; };
}; };
default = { default = {
column_count = null; column_count = null;
max_hint_length = 25; max_hint_length = 25;
@ -65,7 +73,7 @@
}; };
in { in {
options.vim.utility.multicursors = { options.vim.utility.multicursors = {
enable = mkEnableOption "multicursors.nvim plugin (vscode like multiple cursors)"; enable = mkEnableOption "vscode like multiple cursors [multicursor.nvim]";
setupOpts = mkPluginSetupOption "multicursors" { setupOpts = mkPluginSetupOption "multicursors" {
DEBUG_MODE = mkOption { DEBUG_MODE = mkOption {
@ -73,44 +81,47 @@ in {
default = false; default = false;
description = "Enable debug mode."; description = "Enable debug mode.";
}; };
create_commands = mkOption { create_commands = mkOption {
type = bool; type = bool;
default = true; default = true;
description = "Create Multicursor user commands"; description = "Create Multicursor user commands";
}; };
updatetime = mkOption { updatetime = mkOption {
type = int; type = int;
default = 50; default = 50;
description = "The time in milliseconds to wait before updating the cursor in insert mode"; description = "The time in milliseconds to wait before updating the cursor in insert mode";
}; };
nowait = mkOption { nowait = mkOption {
type = bool; type = bool;
description = "Don't wait for the cursor to move before updating the cursor";
default = true; default = true;
description = "Don't wait for the cursor to move before updating the cursor";
}; };
mode_keys = mkOption { mode_keys = mkOption {
type = lib.types.attrsOf str; type = attrsOf str;
description = "The keys to use for each mode";
default = { default = {
insert = "i"; insert = "i";
append = "a"; append = "a";
change = "c"; change = "c";
extend = "e"; extend = "e";
}; };
description = "The keys to use for each mode";
}; };
hint_config = mkOption { hint_config = mkOption {
type = lib.types.submodule hintConfig; type = submodule hintConfig;
description = "The configuration for the hint window";
default = { default = {
float_opts = { float_opts.border = "none";
border = "none";
};
position = "bottom"; position = "bottom";
}; };
description = "The configuration for the hint window";
}; };
generate_hints = mkOption { generate_hints = mkOption {
type = lib.types.submodule generateHints; type = submodule generateHints;
description = "The configuration for generating hints";
default = { default = {
normal = true; normal = true;
insert = true; insert = true;
@ -120,6 +131,7 @@ in {
max_hint_length = 25; max_hint_length = 25;
}; };
}; };
description = "The configuration for generating hints";
}; };
}; };
}; };