From 864ee05f5711605390ec2ee2becd571ab0ead759 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sun, 1 Dec 2024 09:34:35 +0300 Subject: [PATCH] wrapper/rc: set `vim.options` and `vim.globals` to freeform submodules --- modules/neovim/init/basic.nix | 2 -- modules/wrapper/rc/options.nix | 11 ++++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/neovim/init/basic.nix b/modules/neovim/init/basic.nix index e019048..f51fb4a 100644 --- a/modules/neovim/init/basic.nix +++ b/modules/neovim/init/basic.nix @@ -200,8 +200,6 @@ in { }; globals = pushDownDefault { - mapleader = cfg.leaderKey; - maplocalleader = cfg.leaderKey; editorconfig = cfg.enableEditorconfig; }; diff --git a/modules/wrapper/rc/options.nix b/modules/wrapper/rc/options.nix index df23257..4a8ec8c 100644 --- a/modules/wrapper/rc/options.nix +++ b/modules/wrapper/rc/options.nix @@ -5,7 +5,7 @@ }: let inherit (lib.options) mkOption mkEnableOption literalMD literalExpression; inherit (lib.strings) optionalString; - inherit (lib.types) str attrs lines listOf either path submodule anything; + inherit (lib.types) str attrsOf lines listOf either path submodule anything; inherit (lib.nvim.types) dagOf; inherit (lib.nvim.lua) listToLuaTable; @@ -102,7 +102,7 @@ in { globals = mkOption { default = {}; type = submodule { - freeformType = anything; + freeformType = attrsOf anything; options = { mapleader = mkOption { type = str; @@ -116,6 +116,7 @@ in { }; }; }; + example = {"some_variable" = 42;}; description = '' An attribute set containing global variable values @@ -133,8 +134,12 @@ in { }; options = mkOption { - type = attrs; default = {}; + type = submodule { + freeformType = attrsOf anything; + options = {}; + }; + example = {visualbell = true;}; description = '' An attribute set containing vim options to be set