treewide: Reformat with nixfmt

This commit is contained in:
traxys 2024-05-05 19:39:35 +02:00
parent c6281260dc
commit 62f32bfc71
459 changed files with 28139 additions and 26377 deletions

View file

@ -5,39 +5,31 @@
pkgs,
...
}:
with lib; let
with lib;
let
cfg = config.plugins.better-escape;
in {
options.plugins.better-escape =
helpers.neovim-plugin.extraOptionsOptions
// {
enable = mkEnableOption "better-escape.nvim";
in
{
options.plugins.better-escape = helpers.neovim-plugin.extraOptionsOptions // {
enable = mkEnableOption "better-escape.nvim";
package = helpers.mkPackageOption "better-escape.nvim" pkgs.vimPlugins.better-escape-nvim;
package = helpers.mkPackageOption "better-escape.nvim" pkgs.vimPlugins.better-escape-nvim;
mapping = helpers.mkNullOrOption (with types; listOf str) ''
List of mappings to use to enter escape mode.
'';
mapping = helpers.mkNullOrOption (with types; listOf str) ''
List of mappings to use to enter escape mode.
'';
timeout =
helpers.defaultNullOpts.mkStrLuaOr types.ints.unsigned
"vim.o.timeoutlen"
''
The time in which the keys must be hit in ms.
Uses the value of `vim.o.timeoutlen` (`options.timeoutlen` in nixvim) by default.
'';
timeout = helpers.defaultNullOpts.mkStrLuaOr types.ints.unsigned "vim.o.timeoutlen" ''
The time in which the keys must be hit in ms.
Uses the value of `vim.o.timeoutlen` (`options.timeoutlen` in nixvim) by default.
'';
clearEmptyLines = helpers.defaultNullOpts.mkBool false ''
Clear line after escaping if there is only whitespace.
'';
clearEmptyLines = helpers.defaultNullOpts.mkBool false ''
Clear line after escaping if there is only whitespace.
'';
keys =
helpers.defaultNullOpts.mkNullable
(
with types;
either str helpers.nixvimTypes.rawLua
)
"<ESC>"
keys =
helpers.defaultNullOpts.mkNullable (with types; either str helpers.nixvimTypes.rawLua) "<ESC>"
''
Keys used for escaping, if it is a function will use the result everytime.
@ -49,19 +41,21 @@ in {
end
\'\';
'';
};
};
config = let
setupOptions = with cfg;
{
inherit mapping timeout;
clear_empty_lines = clearEmptyLines;
inherit keys;
}
// cfg.extraOptions;
in
config =
let
setupOptions =
with cfg;
{
inherit mapping timeout;
clear_empty_lines = clearEmptyLines;
inherit keys;
}
// cfg.extraOptions;
in
mkIf cfg.enable {
extraPlugins = [cfg.package];
extraPlugins = [ cfg.package ];
extraConfigLua = ''
require('better_escape').setup(${helpers.toLuaObject setupOptions})