diff --git a/docs/manual/configuring/dag-entries.md b/docs/manual/configuring/dag-entries.md index 402cde66..d5afa9b6 100644 --- a/docs/manual/configuring/dag-entries.md +++ b/docs/manual/configuring/dag-entries.md @@ -5,19 +5,16 @@ can add code that relies on other code. However, if you don't know what the entries are called, it's hard to do that, so here is a list of the internal entries in nvf: -## `vim.luaConfigRC` (top-level DAG) {#ch-vim-luaconfigrc} +`vim.luaConfigRC` (top-level DAG): 1. (`luaConfigPre`) - not a part of the actual DAG, instead, it's simply inserted before the rest of the DAG 2. `globalsScript` - used to set globals defined in `vim.globals` 3. `basic` - used to set basic configuration options -4. `optionsScript` - used to set options defined in `vim.o` -5. `theme` (this is simply placed before `pluginConfigs`, meaning that - surrounding entries don't depend on it) - used to set up the theme, which has - to be done before other plugins -6. `pluginConfigs` - the result of the nested `vim.pluginRC` (internal option, - see the [Custom Plugins](/index.xhtml#ch-custom-plugins) page for adding your - own plugins) DAG, used to set up internal plugins -7. `extraPluginConfigs` - the result of `vim.extraPlugins`, which is not a +4. `theme` (this is simply placed before `pluginConfigs`, meaning that surrounding entries don't depend on it) - used to set up the theme, which has to be done before other plugins +5. `pluginConfigs` - the result of the nested `vim.pluginRC` (internal option, + see the [Custom Plugins](/index.xhtml#ch-custom-plugins) page for adding your own + plugins) DAG, used to set up internal plugins +6. `extraPluginConfigs` - the result of `vim.extraPlugins`, which is not a direct DAG, but is converted to, and resolved as one internally -8. `mappings` - the result of `vim.maps` +7. `mappings` - the result of `vim.maps` diff --git a/docs/release-notes/rl-0.7.md b/docs/release-notes/rl-0.7.md index 55746f2b..4a0d282a 100644 --- a/docs/release-notes/rl-0.7.md +++ b/docs/release-notes/rl-0.7.md @@ -187,12 +187,6 @@ everyone. - Add [python-lsp-server](https://github.com/python-lsp/python-lsp-server) as an additional Python LSP server. -- Add [](#opt-vim.options) to set `vim.o` values in in your nvf configuration - without using additional Lua. See option documentation for more details. - -- Add [](#opt-vim.dashboard.dashboard-nvim.setupOpts) to allow user - configuration for [dashboard.nvim](https://github.com/nvimdev/dashboard-nvim) - [ppenguin](https://github.com/ppenguin): - Telescope: diff --git a/modules/plugins/dashboard/dashboard-nvim/config.nix b/modules/plugins/dashboard/dashboard-nvim/config.nix index 7ded14c2..088842ad 100644 --- a/modules/plugins/dashboard/dashboard-nvim/config.nix +++ b/modules/plugins/dashboard/dashboard-nvim/config.nix @@ -5,17 +5,16 @@ }: let inherit (lib.modules) mkIf; inherit (lib.nvim.dag) entryAnywhere; - inherit (lib.nvim.lua) toLuaObject; cfg = config.vim.dashboard.dashboard-nvim; in { config = mkIf cfg.enable { - vim = { - startPlugins = ["dashboard-nvim"]; + vim.startPlugins = [ + "dashboard-nvim" + ]; - pluginRC.dashboard-nvim = entryAnywhere '' - require("dashboard").setup(${toLuaObject cfg.setupOpts}) - ''; - }; + vim.pluginRC.dashboard-nvim = entryAnywhere '' + require("dashboard").setup{} + ''; }; } diff --git a/modules/plugins/dashboard/dashboard-nvim/dashboard-nvim.nix b/modules/plugins/dashboard/dashboard-nvim/dashboard-nvim.nix index cdc41fc7..518082eb 100644 --- a/modules/plugins/dashboard/dashboard-nvim/dashboard-nvim.nix +++ b/modules/plugins/dashboard/dashboard-nvim/dashboard-nvim.nix @@ -1,9 +1,7 @@ {lib, ...}: let inherit (lib.options) mkEnableOption; - inherit (lib.nvim.types) mkPluginSetupOption; in { options.vim.dashboard.dashboard-nvim = { enable = mkEnableOption "Fancy and Blazing Fast start screen plugin of neovim [dashboard.nvim]"; - setupOpts = mkPluginSetupOption "dashboard.nvim" {}; }; } diff --git a/modules/wrapper/rc/config.nix b/modules/wrapper/rc/config.nix index 193be3fc..8ebf1c2c 100644 --- a/modules/wrapper/rc/config.nix +++ b/modules/wrapper/rc/config.nix @@ -80,11 +80,10 @@ maps); in { config = let + filterNonNull = attrs: filterAttrs (_: value: value != null) attrs; globalsScript = - mapAttrsToList (name: value: "vim.g.${name} = ${toLuaObject value}") cfg.globals; - - optionsScript = - mapAttrsToList (name: value: "vim.o.${name} = ${toLuaObject value}") cfg.options; + mapAttrsToList (name: value: "vim.g.${name} = ${toLuaObject value}") + (filterNonNull cfg.globals); extraPluginConfigs = resolveDag { name = "extra plugin configs"; @@ -133,12 +132,9 @@ in { in { vim = { luaConfigRC = { - # `vim.g` and `vim.o` globalsScript = entryAnywhere (concatLines globalsScript); - optionsScript = entryAfter ["basic"] (concatLines optionsScript); - - # Basic - pluginConfigs = entryAfter ["optionsScript"] pluginConfigs; + # basic + pluginConfigs = entryAfter ["basic"] pluginConfigs; extraPluginConfigs = entryAfter ["pluginConfigs"] extraPluginConfigs; mappings = entryAfter ["extraPluginConfigs"] mappings; }; diff --git a/modules/wrapper/rc/options.nix b/modules/wrapper/rc/options.nix index 70ab2a8a..4165da6d 100644 --- a/modules/wrapper/rc/options.nix +++ b/modules/wrapper/rc/options.nix @@ -129,38 +129,16 @@ in { globals = mkOption { type = attrs; default = {}; - example = {"some_variable" = 42;}; description = '' An attribute set containing global variable values for storing vim variables as early as possible. If populated, this option will set vim variables in the built luaConfigRC as the first item. - ::: {.note} - `{foo = "bar";}` will set `vim.g.foo` to "bar", where - the type of `bar` in the resulting Lua value will be - inferred from the type of the value in the `{name = value;}` - pair passed to the option. - ::: - ''; - }; - - options = mkOption { - type = attrs; - default = {}; - example = {visualbell = true;}; - description = '' - An attribute set containing vim options to be set - as early as possible. If populated, this option will - set vim options in the built luaConfigRC after `basic` - and before `pluginConfigs` DAG entries. - - ::: {.note} - `{foo = "bar";}` will set `vim.o.foo` to "bar", where - the type of `bar` in the resulting Lua value will be - inferred from the type of the value in the`{name = value;}` - pair passed to the option. - ::: + E.g. {foo = "bar"} will set `vim.g.foo` to "bar" where + the type of `bar` in the resulting vimscript will be + infered from the type of the value in the `{name = value}` + pair. ''; };