rc: do not set options via luaConfigPre

This commit is contained in:
Ching Pei Yang 2025-04-13 11:14:50 +02:00 committed by Ching Pei Yang
commit db3a35a116
2 changed files with 11 additions and 25 deletions

View file

@ -1,15 +1,7 @@
{
config,
lib,
...
}: let
{lib, ...}: let
inherit (lib.options) mkOption literalMD literalExpression;
inherit (lib.strings) optionalString;
inherit (lib.types) str bool int enum attrsOf lines listOf either path submodule anything;
inherit (lib.nvim.types) dagOf;
inherit (lib.nvim.lua) listToLuaTable;
cfg = config.vim;
in {
options.vim = {
enableLuaLoader = mkOption {
@ -286,21 +278,7 @@ in {
luaConfigPre = mkOption {
type = str;
default = ''
${optionalString (cfg.additionalRuntimePaths != []) ''
-- The following list is generated from `vim.additionalRuntimePaths`
-- and is used to append additional runtime paths to the
-- `runtimepath` option.
vim.opt.runtimepath:append(${listToLuaTable cfg.additionalRuntimePaths})
''}
${optionalString cfg.enableLuaLoader ''
if vim.loader then
vim.loader.enable()
end
''}
'';
default = "";
defaultText = literalMD ''
By default, this option will **append** paths in
[](#opt-vim.additionalRuntimePaths)