mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
modules/wrapper: add vim.options
(#386)
* wrapper/rc: add `vim.options` Translates an attribute set of values into `vim.o` values in a key-value format. * docs: document addition of optionsScript * wrapper/rc: don't filter null values in {options,global}Script * wrapper/rc: add examples to vim.options & vim.globals; wording
This commit is contained in:
parent
c957b23aaa
commit
ab9a7c1600
3 changed files with 45 additions and 16 deletions
|
@ -80,10 +80,11 @@
|
|||
maps);
|
||||
in {
|
||||
config = let
|
||||
filterNonNull = attrs: filterAttrs (_: value: value != null) attrs;
|
||||
globalsScript =
|
||||
mapAttrsToList (name: value: "vim.g.${name} = ${toLuaObject value}")
|
||||
(filterNonNull cfg.globals);
|
||||
mapAttrsToList (name: value: "vim.g.${name} = ${toLuaObject value}") cfg.globals;
|
||||
|
||||
optionsScript =
|
||||
mapAttrsToList (name: value: "vim.o.${name} = ${toLuaObject value}") cfg.options;
|
||||
|
||||
extraPluginConfigs = resolveDag {
|
||||
name = "extra plugin configs";
|
||||
|
@ -132,9 +133,12 @@ in {
|
|||
in {
|
||||
vim = {
|
||||
luaConfigRC = {
|
||||
# `vim.g` and `vim.o`
|
||||
globalsScript = entryAnywhere (concatLines globalsScript);
|
||||
# basic
|
||||
pluginConfigs = entryAfter ["basic"] pluginConfigs;
|
||||
optionsScript = entryAfter ["basic"] (concatLines optionsScript);
|
||||
|
||||
# Basic
|
||||
pluginConfigs = entryAfter ["optionsScript"] pluginConfigs;
|
||||
extraPluginConfigs = entryAfter ["pluginConfigs"] extraPluginConfigs;
|
||||
mappings = entryAfter ["extraPluginConfigs"] mappings;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue