plugins/telescope: normalize plugin defaults

This commit is contained in:
Matt Sturgeon 2024-06-11 17:12:25 +01:00
parent 6ab2a39e6a
commit 66b23fff80
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
3 changed files with 27 additions and 35 deletions

View file

@ -83,12 +83,12 @@ telescopeHelpers.mkExtension {
Custom theme, will use your global theme by default.
'';
path = helpers.defaultNullOpts.mkStr ''{__raw = "vim.loop.cwd()";}'' ''
path = helpers.defaultNullOpts.mkStr { __raw = "vim.loop.cwd()"; } ''
Directory to browse files from.
`vim.fn.expanded` automatically.
'';
cwd = helpers.defaultNullOpts.mkStr ''{__raw = "vim.loop.cwd()";}'' ''
cwd = helpers.defaultNullOpts.mkStr { __raw = "vim.loop.cwd()"; } ''
Directory to browse folders from.
`vim.fn.expanded` automatically.
'';
@ -134,12 +134,10 @@ telescopeHelpers.mkExtension {
};
})
)
''
{
file_browser = false;
folder_browser = false;
}
''
{
file_browser = false;
folder_browser = false;
}
"Determines whether to show hidden files or not.";
respect_gitignore = helpers.defaultNullOpts.mkBool false ''
@ -170,13 +168,11 @@ telescopeHelpers.mkExtension {
Change the highlight group of dir icon.
'';
display_stat = helpers.defaultNullOpts.mkAttrsOf types.anything ''
{
date = true;
size = true;
mode = true;
}
'' "Ordered stat; see upstream for more info.";
display_stat = helpers.defaultNullOpts.mkAttrsOf types.anything {
date = true;
size = true;
mode = true;
} "Ordered stat; see upstream for more info.";
hijack_netrw = helpers.defaultNullOpts.mkBool false ''
Use telescope file browser when opening directory paths.

View file

@ -49,7 +49,7 @@ with lib;
If true, it removes stale entries count over than `db_validate_threshold`.
'';
db_root = helpers.defaultNullOpts.mkStr ''{__raw = "vim.fn.stdpath 'data'";}'' ''
db_root = helpers.defaultNullOpts.mkStr { __raw = "vim.fn.stdpath 'data'"; } ''
Path to parent directory of custom database location.
Defaults to `$XDG_DATA_HOME/nvim` if unset.
'';
@ -82,13 +82,11 @@ with lib;
ignore_patterns =
helpers.defaultNullOpts.mkListOf types.str
''
[
"*.git/*"
"*/tmp/*"
"term://*"
]
''
[
"*.git/*"
"*/tmp/*"
"term://*"
]
''
Patterns in this table control which files are indexed (and subsequently which you'll see
in the finder results).
@ -104,7 +102,7 @@ with lib;
'';
show_filter_column =
helpers.defaultNullOpts.mkNullable (with types; either bool (listOf str)) "true"
helpers.defaultNullOpts.mkNullable (with types; either bool (listOf str)) true
''
Show the path of the active filter before file paths.
In default, it uses the tail of paths for `'LSP'` and `'CWD'` tags.
@ -140,7 +138,7 @@ with lib;
If you prefer Native Lua code, set `workspace_scan_cmd.__raw = "LUA"`.
'';
workspaces = helpers.defaultNullOpts.mkAttrsOf types.str "{}" ''
workspaces = helpers.defaultNullOpts.mkAttrsOf types.str { } ''
This attrs contains mappings of `workspace_tag` -> `workspace_directory`.
The key corresponds to the `:tag_name` used to select the filter in queries.
The value corresponds to the top level directory by which results will be filtered.

View file

@ -122,16 +122,14 @@ with lib;
};
settingsOptions = {
filetypes = helpers.defaultNullOpts.mkListOf types.str ''
[
"png"
"jpg"
"gif"
"mp4"
"webm"
"pdf"
]
'' "Filetypes whitelist.";
filetypes = helpers.defaultNullOpts.mkListOf types.str [
"png"
"jpg"
"gif"
"mp4"
"webm"
"pdf"
] "Filetypes whitelist.";
find_cmd = helpers.defaultNullOpts.mkStr "fd" ''
Which find command to use.