mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-11 07:55:31 +00:00
add more descriptions and refine
This commit is contained in:
parent
3325ebb8d6
commit
8d862d093b
3 changed files with 12 additions and 133 deletions
|
|
@ -1,15 +1,10 @@
|
||||||
{
|
{
|
||||||
options,
|
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.nvim.binds) mkKeymap;
|
|
||||||
inherit (lib.nvim.binds) addDescriptionsToMappings; # mkSetLuaBinding;
|
|
||||||
cfg = config.vim.utility.multicursors;
|
cfg = config.vim.utility.multicursors;
|
||||||
mappingDefinitions = options.vim.utility.multicursors.mappings;
|
|
||||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
{ lib, ... }:
|
{lib, ...}: let
|
||||||
let
|
|
||||||
inherit (lib.types) bool int str;
|
inherit (lib.types) bool int str;
|
||||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
inherit (lib.nvim.binds) mkMappingOption;
|
|
||||||
hintConfig = {lib, ...}: {
|
hintConfig = {lib, ...}: {
|
||||||
options = {
|
options = {
|
||||||
float_opts = mkOption {
|
float_opts = mkOption {
|
||||||
|
description = "The options for the floating hint window";
|
||||||
type = lib.types.submodule {
|
type = lib.types.submodule {
|
||||||
options = {
|
options = {
|
||||||
border = mkOption {
|
border = mkOption {
|
||||||
|
|
@ -28,17 +27,21 @@ let
|
||||||
options = {
|
options = {
|
||||||
normal = mkOption {
|
normal = mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
description = "Generate hints for the normal mode";
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
insert = mkOption {
|
insert = mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
description = "Generate hints for the insert mode";
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
extend = mkOption {
|
extend = mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
|
description = "Generate hints for the extend mode";
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
config = mkOption {
|
config = mkOption {
|
||||||
|
description = "The configuration for generating hints for multicursors.nvim";
|
||||||
type = lib.types.submodule {
|
type = lib.types.submodule {
|
||||||
options = {
|
options = {
|
||||||
column_count = mkOption {
|
column_count = mkOption {
|
||||||
|
|
@ -60,8 +63,7 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
options.vim.utility.multicursors = {
|
options.vim.utility.multicursors = {
|
||||||
enable = mkEnableOption "multicursors.nvim plugin (vscode like multiple cursors)";
|
enable = mkEnableOption "multicursors.nvim plugin (vscode like multiple cursors)";
|
||||||
|
|
||||||
|
|
@ -69,6 +71,7 @@ in
|
||||||
DEBUG_MODE = mkOption {
|
DEBUG_MODE = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
description = "Enable debug mode.";
|
||||||
};
|
};
|
||||||
create_commands = mkOption {
|
create_commands = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
|
|
@ -82,6 +85,7 @@ in
|
||||||
};
|
};
|
||||||
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;
|
||||||
};
|
};
|
||||||
mode_keys = mkOption {
|
mode_keys = mkOption {
|
||||||
|
|
|
||||||
|
|
@ -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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue