mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins/nvim-ufo: remove with lib and helpers
This commit is contained in:
parent
faa962367c
commit
fc584a3a41
1 changed files with 16 additions and 16 deletions
|
@ -1,17 +1,17 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
helpers,
|
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
|
inherit (lib.nixvim) defaultNullOpts;
|
||||||
|
|
||||||
cfg = config.plugins.nvim-ufo;
|
cfg = config.plugins.nvim-ufo;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.plugins.nvim-ufo = helpers.neovim-plugin.extraOptionsOptions // {
|
options.plugins.nvim-ufo = lib.nixvim.neovim-plugin.extraOptionsOptions // {
|
||||||
enable = mkEnableOption "nvim-ufo";
|
enable = lib.mkEnableOption "nvim-ufo";
|
||||||
|
|
||||||
package = lib.mkPackageOption pkgs "nvim-ufo" {
|
package = lib.mkPackageOption pkgs "nvim-ufo" {
|
||||||
default = [
|
default = [
|
||||||
|
@ -20,25 +20,25 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
openFoldHlTimeout = helpers.defaultNullOpts.mkInt 400 ''
|
openFoldHlTimeout = defaultNullOpts.mkInt 400 ''
|
||||||
Time in millisecond between the range to be highlgihted and to be cleared
|
Time in millisecond between the range to be highlgihted and to be cleared
|
||||||
while opening the folded line, `0` value will disable the highlight
|
while opening the folded line, `0` value will disable the highlight
|
||||||
'';
|
'';
|
||||||
|
|
||||||
providerSelector = helpers.defaultNullOpts.mkLuaFn null ''
|
providerSelector = defaultNullOpts.mkLuaFn null ''
|
||||||
A lua function as a selector for fold providers.
|
A lua function as a selector for fold providers.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
closeFoldKinds = helpers.mkNullOrOption types.attrs ''
|
closeFoldKinds = lib.nixvim.mkNullOrOption lib.types.attrs ''
|
||||||
After the buffer is displayed (opened for the first time), close the
|
After the buffer is displayed (opened for the first time), close the
|
||||||
folds whose range with `kind` field is included in this option. For now,
|
folds whose range with `kind` field is included in this option. For now,
|
||||||
'lsp' provider's standardized kinds are 'comment', 'imports' and 'region',
|
'lsp' provider's standardized kinds are 'comment', 'imports' and 'region',
|
||||||
run `UfoInspect` for details if your provider has extended the kinds.
|
run `UfoInspect` for details if your provider has extended the kinds.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
foldVirtTextHandler = helpers.defaultNullOpts.mkLuaFn null "A lua function to customize fold virtual text";
|
foldVirtTextHandler = defaultNullOpts.mkLuaFn null "A lua function to customize fold virtual text";
|
||||||
|
|
||||||
enableGetFoldVirtText = helpers.defaultNullOpts.mkBool false ''
|
enableGetFoldVirtText = defaultNullOpts.mkBool false ''
|
||||||
Enable a function with `lnum` as a parameter to capture the virtual text
|
Enable a function with `lnum` as a parameter to capture the virtual text
|
||||||
for the folded lines and export the function to `get_fold_virt_text` field of
|
for the folded lines and export the function to `get_fold_virt_text` field of
|
||||||
ctx table as 6th parameter in `fold_virt_text_handler`
|
ctx table as 6th parameter in `fold_virt_text_handler`
|
||||||
|
@ -46,16 +46,16 @@ in
|
||||||
|
|
||||||
preview = {
|
preview = {
|
||||||
winConfig = {
|
winConfig = {
|
||||||
border = helpers.defaultNullOpts.mkBorder "rounded" "preview window" "";
|
border = defaultNullOpts.mkBorder "rounded" "preview window" "";
|
||||||
|
|
||||||
winblend = helpers.defaultNullOpts.mkInt 12 "The winblend for preview window, `:h winblend`";
|
winblend = defaultNullOpts.mkInt 12 "The winblend for preview window, `:h winblend`";
|
||||||
|
|
||||||
winhighlight = helpers.defaultNullOpts.mkStr "Normal:Normal" "The winhighlight for preview window, `:h winhighlight`";
|
winhighlight = defaultNullOpts.mkStr "Normal:Normal" "The winhighlight for preview window, `:h winhighlight`";
|
||||||
|
|
||||||
maxheight = helpers.defaultNullOpts.mkInt 20 "The max height of preview window";
|
maxheight = defaultNullOpts.mkInt 20 "The max height of preview window";
|
||||||
};
|
};
|
||||||
|
|
||||||
mappings = helpers.mkNullOrOption types.attrs "Mappings for preview window";
|
mappings = lib.nixvim.mkNullOrOption lib.types.attrs "Mappings for preview window";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -77,11 +77,11 @@ in
|
||||||
}
|
}
|
||||||
// cfg.extraOptions;
|
// cfg.extraOptions;
|
||||||
in
|
in
|
||||||
mkIf cfg.enable {
|
lib.mkIf cfg.enable {
|
||||||
extraPlugins = [ cfg.package ];
|
extraPlugins = [ cfg.package ];
|
||||||
|
|
||||||
extraConfigLua = ''
|
extraConfigLua = ''
|
||||||
require("ufo").setup(${helpers.toLuaObject options})
|
require("ufo").setup(${lib.nixvim.toLuaObject options})
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue