add more descriptions and refine

This commit is contained in:
Joseph Hanson 2025-02-08 09:40:50 -06:00
commit 8d862d093b
No known key found for this signature in database
3 changed files with 12 additions and 133 deletions

View file

@ -1,15 +1,10 @@
{
options,
config,
lib,
...
}: let
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.binds) mkKeymap;
inherit (lib.nvim.binds) addDescriptionsToMappings; # mkSetLuaBinding;
inherit (lib.modules) mkIf;
cfg = config.vim.utility.multicursors;
mappingDefinitions = options.vim.utility.multicursors.mappings;
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
in {
config = mkIf cfg.enable {
vim = {

View file

@ -1,12 +1,11 @@
{ lib, ... }:
let
{lib, ...}: let
inherit (lib.types) bool int str;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.nvim.binds) mkMappingOption;
hintConfig = { lib, ... }: {
hintConfig = {lib, ...}: {
options = {
float_opts = mkOption {
description = "The options for the floating hint window";
type = lib.types.submodule {
options = {
border = mkOption {
@ -24,21 +23,25 @@ let
};
};
};
generateHints = { lib, ... }: {
generateHints = {lib, ...}: {
options = {
normal = mkOption {
type = lib.types.bool;
description = "Generate hints for the normal mode";
default = true;
};
insert = mkOption {
type = lib.types.bool;
description = "Generate hints for the insert mode";
default = true;
};
extend = mkOption {
type = lib.types.bool;
description = "Generate hints for the extend mode";
default = true;
};
config = mkOption {
description = "The configuration for generating hints for multicursors.nvim";
type = lib.types.submodule {
options = {
column_count = mkOption {
@ -60,8 +63,7 @@ let
};
};
};
in
{
in {
options.vim.utility.multicursors = {
enable = mkEnableOption "multicursors.nvim plugin (vscode like multiple cursors)";
@ -69,6 +71,7 @@ in
DEBUG_MODE = mkOption {
type = bool;
default = false;
description = "Enable debug mode.";
};
create_commands = mkOption {
type = bool;
@ -82,6 +85,7 @@ in
};
nowait = mkOption {
type = bool;
description = "Don't wait for the cursor to move before updating the cursor";
default = true;
};
mode_keys = mkOption {

View file

@ -1,120 +0,0 @@
{lib, ...}: let
inherit (lib.types) bool int str;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.nvim.binds) mkMappingOption;
hintConfig = {
float_opts = {
border = mkOption {
type = lib.types.str;
default = "none";
example = "rounded";
description = "The border style for the hint window";
};
};
position = mkOption {
default = "bottom";
type = lib.types.str;
description = "The position of the hint window";
example = "bottom";
};
};
generateHints = {
normal = mkOption {
type = bool;
default = true;
};
insert = mkOption {
type = bool;
default = true;
};
extend = mkOption {
type = bool;
default = true;
};
config = mkOption {
type = lib.types.attrsOf lib.types.str;
default = {
column_count = "nil";
max_hint_length = "25";
};
};
};
in {
options.vim.utility.multicursors = {
enable = mkEnableOption "multicursors.nvim plugin (vscode like multiple cursors)";
#mappings = {
# mcStart = mkOption {
# type = lib.types.nullOr str;
# description = "Create a selection for selected text or word under the cursor [multicursors.nvim]";
# default = "<leader>ms";
#};
#mcStart = mkMappingOption "Create a selection for selected text or word under the cursor [multicursors.nvim]" "<leader>ms";
#};
setupOpts = mkPluginSetupOption "multicursors" {
DEBUG_MODE = mkOption {
type = bool;
default = false;
};
create_commands = mkOption {
type = bool;
default = true;
description = "Create Multicursor user commands";
};
updatetime = mkOption {
type = int;
default = 50;
description = "The time in milliseconds to wait before updating the cursor in insert mode";
};
nowait = mkOption {
type = bool;
default = true;
};
mode_keys = mkOption {
type = lib.types.attrsOf str;
description = "The keys to use for each mode";
default = {
insert = "i";
append = "a";
change = "c";
extend = "e";
};
};
normal_keys = mkOption {
type = lib.types.str;
default = "normal_keys";
};
insert_keys = mkOption {
type = lib.types.str;
default = "insert_keys";
};
extend_keys = mkOption {
type = lib.types.str;
default = "extend_keys";
};
hint_config = mkOption {
type = lib.types.submodule hintConfig;
description = "The configuration for the hint window";
default = {
float_opts = {
border = "none";
};
position = "bottom";
};
};
generate_hints = mkOption {
type = lib.types.submodule generateHints;
description = "The configuration for generating hints";
default = {
normal = true;
insert = true;
extend = true;
config = {
column_count = null;
max_hint_length = 25;
};
};
};
};
};
}