plugins/utils: normalize plugin defaults

This commit is contained in:
Matt Sturgeon 2024-06-11 16:54:57 +01:00
parent b10a391bd0
commit 6ab2a39e6a
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
53 changed files with 1434 additions and 1221 deletions

View file

@ -31,13 +31,10 @@ in
Whether to enable the "last session" feature.
'';
rootDir =
helpers.defaultNullOpts.mkNullable (with types; either str helpers.nixvimTypes.rawLua)
"{__raw = \"vim.fn.stdpath 'data' .. '/sessions/'\";}"
''
Root directory for session files.
Can be either a string or lua code (using `{__raw = 'foo';}`).
'';
rootDir = helpers.defaultNullOpts.mkStr { __raw = "vim.fn.stdpath 'data' .. '/sessions/'"; } ''
Root directory for session files.
Can be either a string or lua code (using `{__raw = 'foo';}`).
'';
createEnabled = helpers.mkNullOrOption types.bool ''
Whether to enable auto creating new sessions
@ -91,7 +88,7 @@ in
};
})
)
"false"
false
''
Config for handling the DirChangePre and DirChanged autocmds.
Set to `false` to disable the feature.
@ -108,9 +105,10 @@ in
`require("auto-session").setup_session_lens()` if they want to use session-lens.
'';
themeConf =
helpers.defaultNullOpts.mkNullable types.attrs "{winblend = 10; border = true;}"
"Theme configuration.";
themeConf = helpers.defaultNullOpts.mkAttrsOf types.anything {
winblend = 10;
border = true;
} "Theme configuration.";
previewer = helpers.defaultNullOpts.mkBool false ''
Use default previewer config by setting the value to `null` if some sets previewer to
@ -123,8 +121,7 @@ in
sessionControl = {
controlDir =
helpers.defaultNullOpts.mkNullable (with types; either str helpers.nixvimTypes.rawLua)
"\"vim.fn.stdpath 'data' .. '/auto_session/'\""
helpers.defaultNullOpts.mkStr { __raw = "vim.fn.stdpath 'data' .. '/auto_session/'"; }
''
Auto session control dir, for control files, like alternating between two sessions
with session-lens.