mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-19 10:14:52 +02:00
treewide: Reformat with nixfmt
This commit is contained in:
parent
c6281260dc
commit
62f32bfc71
459 changed files with 28139 additions and 26377 deletions
|
@ -6,16 +6,18 @@
|
|||
...
|
||||
}:
|
||||
with lib;
|
||||
helpers.neovim-plugin.mkNeovimPlugin config {
|
||||
name = "dressing";
|
||||
originalName = "dressing.nvim";
|
||||
defaultPackage = pkgs.vimPlugins.dressing-nvim;
|
||||
helpers.neovim-plugin.mkNeovimPlugin config {
|
||||
name = "dressing";
|
||||
originalName = "dressing.nvim";
|
||||
defaultPackage = pkgs.vimPlugins.dressing-nvim;
|
||||
|
||||
maintainers = [helpers.maintainers.AndresBermeoMarinelli];
|
||||
maintainers = [ helpers.maintainers.AndresBermeoMarinelli ];
|
||||
|
||||
settingsOptions = let
|
||||
settingsOptions =
|
||||
let
|
||||
intOrRatio = with types; either ints.unsigned (numbers.between 0.0 1.0);
|
||||
in {
|
||||
in
|
||||
{
|
||||
input = {
|
||||
enabled = helpers.defaultNullOpts.mkBool true ''
|
||||
Enable the `vim.ui.input` implementation.
|
||||
|
@ -29,9 +31,16 @@ with lib;
|
|||
Trim trailing `:` from prompt.
|
||||
'';
|
||||
|
||||
title_pos = helpers.defaultNullOpts.mkEnumFirstDefault ["left" "right" "center"] ''
|
||||
Position of title.
|
||||
'';
|
||||
title_pos =
|
||||
helpers.defaultNullOpts.mkEnumFirstDefault
|
||||
[
|
||||
"left"
|
||||
"right"
|
||||
"center"
|
||||
]
|
||||
''
|
||||
Position of title.
|
||||
'';
|
||||
|
||||
insert_only = helpers.defaultNullOpts.mkBool true ''
|
||||
When true, `<Esc>` will close the modal.
|
||||
|
@ -43,10 +52,17 @@ with lib;
|
|||
|
||||
border = helpers.defaultNullOpts.mkBorder "rounded" "the input window" "";
|
||||
|
||||
relative = helpers.defaultNullOpts.mkEnumFirstDefault ["cursor" "win" "editor"] ''
|
||||
Affects the dimensions of the window with respect to this setting.
|
||||
If 'editor' or 'win', will default to being centered.
|
||||
'';
|
||||
relative =
|
||||
helpers.defaultNullOpts.mkEnumFirstDefault
|
||||
[
|
||||
"cursor"
|
||||
"win"
|
||||
"editor"
|
||||
]
|
||||
''
|
||||
Affects the dimensions of the window with respect to this setting.
|
||||
If 'editor' or 'win', will default to being centered.
|
||||
'';
|
||||
|
||||
prefer_width = helpers.defaultNullOpts.mkNullable intOrRatio "40" ''
|
||||
Can be an integer or a float between 0 and 1 (e.g. 0.4 for 40%).
|
||||
|
@ -57,79 +73,57 @@ with lib;
|
|||
'';
|
||||
|
||||
max_width =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(
|
||||
with types;
|
||||
either
|
||||
intOrRatio
|
||||
(listOf intOrRatio)
|
||||
)
|
||||
"[140 0.9]"
|
||||
''
|
||||
Max width of window.
|
||||
helpers.defaultNullOpts.mkNullable (with types; either intOrRatio (listOf intOrRatio)) "[140 0.9]"
|
||||
''
|
||||
Max width of window.
|
||||
|
||||
Can be a list of mixed types, e.g. `[140 0.9]` means "less than 140 columns or 90% of
|
||||
total."
|
||||
'';
|
||||
Can be a list of mixed types, e.g. `[140 0.9]` means "less than 140 columns or 90% of
|
||||
total."
|
||||
'';
|
||||
|
||||
min_width =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(
|
||||
with types;
|
||||
either
|
||||
intOrRatio
|
||||
(listOf intOrRatio)
|
||||
)
|
||||
"[20 0.2]"
|
||||
''
|
||||
Min width of window.
|
||||
helpers.defaultNullOpts.mkNullable (with types; either intOrRatio (listOf intOrRatio)) "[20 0.2]"
|
||||
''
|
||||
Min width of window.
|
||||
|
||||
Can be a list of mixed types, e.g. `[140 0.9]` means "less than 140 columns or 90% of
|
||||
total."
|
||||
'';
|
||||
Can be a list of mixed types, e.g. `[140 0.9]` means "less than 140 columns or 90% of
|
||||
total."
|
||||
'';
|
||||
|
||||
buf_options = helpers.defaultNullOpts.mkAttrsOf types.anything "{}" ''
|
||||
An attribute set of neovim buffer options.
|
||||
'';
|
||||
|
||||
win_options =
|
||||
helpers.defaultNullOpts.mkAttrsOf types.anything
|
||||
''
|
||||
{
|
||||
wrap = false;
|
||||
list = true;
|
||||
listchars = "precedes:...,extends:...";
|
||||
sidescrolloff = 0;
|
||||
}
|
||||
''
|
||||
"An attribute set of window options.";
|
||||
win_options = helpers.defaultNullOpts.mkAttrsOf types.anything ''
|
||||
{
|
||||
wrap = false;
|
||||
list = true;
|
||||
listchars = "precedes:...,extends:...";
|
||||
sidescrolloff = 0;
|
||||
}
|
||||
'' "An attribute set of window options.";
|
||||
|
||||
mappings =
|
||||
helpers.defaultNullOpts.mkAttrsOf
|
||||
(
|
||||
with types;
|
||||
attrsOf
|
||||
(either str (enum [false]))
|
||||
)
|
||||
''
|
||||
{
|
||||
n = {
|
||||
"<Esc>" = "Close";
|
||||
"<CR>" = "Confirm";
|
||||
};
|
||||
i = {
|
||||
"<C-c>" = "Close";
|
||||
"<CR>" = "Confirm";
|
||||
"<Up>" = "HistoryPrev";
|
||||
"<Down>" = "HistoryNext";
|
||||
};
|
||||
}
|
||||
''
|
||||
''
|
||||
Mappings for defined modes.
|
||||
helpers.defaultNullOpts.mkAttrsOf (with types; attrsOf (either str (enum [ false ])))
|
||||
''
|
||||
{
|
||||
n = {
|
||||
"<Esc>" = "Close";
|
||||
"<CR>" = "Confirm";
|
||||
};
|
||||
i = {
|
||||
"<C-c>" = "Close";
|
||||
"<CR>" = "Confirm";
|
||||
"<Up>" = "HistoryPrev";
|
||||
"<Down>" = "HistoryNext";
|
||||
};
|
||||
}
|
||||
''
|
||||
''
|
||||
Mappings for defined modes.
|
||||
|
||||
To disable a default mapping in a specific mode, set it to `false`.
|
||||
'';
|
||||
To disable a default mapping in a specific mode, set it to `false`.
|
||||
'';
|
||||
|
||||
override = helpers.defaultNullOpts.mkLuaFn "function(conf) return conf end" ''
|
||||
Lua function that takes config that is passed to nvim_open_win.
|
||||
|
@ -150,76 +144,61 @@ with lib;
|
|||
Enable the vim.ui.select implementation.
|
||||
'';
|
||||
|
||||
backend =
|
||||
helpers.defaultNullOpts.mkListOf types.str
|
||||
''
|
||||
["telescope" "fzf_lua" "fzf" "builtin" "nui"]
|
||||
''
|
||||
"Priority list of preferred vim.select implementations. ";
|
||||
backend = helpers.defaultNullOpts.mkListOf types.str ''
|
||||
["telescope" "fzf_lua" "fzf" "builtin" "nui"]
|
||||
'' "Priority list of preferred vim.select implementations. ";
|
||||
|
||||
trim_prompt = helpers.defaultNullOpts.mkBool true ''
|
||||
Trim trailing `:` from prompt.
|
||||
'';
|
||||
|
||||
telescope =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(
|
||||
with helpers.nixvimTypes;
|
||||
either
|
||||
strLua
|
||||
(attrsOf anything)
|
||||
)
|
||||
"null"
|
||||
''
|
||||
Options for telescope selector.
|
||||
helpers.defaultNullOpts.mkNullable (with helpers.nixvimTypes; either strLua (attrsOf anything))
|
||||
"null"
|
||||
''
|
||||
Options for telescope selector.
|
||||
|
||||
Can be a raw lua string like:
|
||||
Can be a raw lua string like:
|
||||
|
||||
`telescope = \'\'require("telescope.themes").get_ivy({})\'\'`
|
||||
`telescope = \'\'require("telescope.themes").get_ivy({})\'\'`
|
||||
|
||||
or an attribute set of telescope settings.
|
||||
'';
|
||||
or an attribute set of telescope settings.
|
||||
'';
|
||||
|
||||
fzf = {
|
||||
window =
|
||||
helpers.defaultNullOpts.mkAttrsOf types.anything
|
||||
''
|
||||
{
|
||||
width = 0.5;
|
||||
height = 0.4;
|
||||
}
|
||||
''
|
||||
"Window options for fzf selector. ";
|
||||
window = helpers.defaultNullOpts.mkAttrsOf types.anything ''
|
||||
{
|
||||
width = 0.5;
|
||||
height = 0.4;
|
||||
}
|
||||
'' "Window options for fzf selector. ";
|
||||
};
|
||||
|
||||
fzf_lua = helpers.defaultNullOpts.mkAttrsOf types.anything "{}" ''
|
||||
Options for fzf-lua selector.
|
||||
'';
|
||||
|
||||
nui =
|
||||
helpers.defaultNullOpts.mkAttrsOf types.anything
|
||||
''
|
||||
{
|
||||
position = "50%";
|
||||
size = null;
|
||||
relative = "editor";
|
||||
border = {
|
||||
style = "rounded";
|
||||
};
|
||||
buf_options = {
|
||||
swapfile = false;
|
||||
filetype = "DressingSelect";
|
||||
};
|
||||
win_options = {
|
||||
winblend = 0;
|
||||
};
|
||||
max_width = 80;
|
||||
max_height = 40;
|
||||
min_width = 40;
|
||||
min_height = 10;
|
||||
}
|
||||
''
|
||||
"Options for nui selector. ";
|
||||
nui = helpers.defaultNullOpts.mkAttrsOf types.anything ''
|
||||
{
|
||||
position = "50%";
|
||||
size = null;
|
||||
relative = "editor";
|
||||
border = {
|
||||
style = "rounded";
|
||||
};
|
||||
buf_options = {
|
||||
swapfile = false;
|
||||
filetype = "DressingSelect";
|
||||
};
|
||||
win_options = {
|
||||
winblend = 0;
|
||||
};
|
||||
max_width = 80;
|
||||
max_height = 40;
|
||||
min_width = 40;
|
||||
min_height = 10;
|
||||
}
|
||||
'' "Options for nui selector. ";
|
||||
|
||||
builtin = {
|
||||
show_numbers = helpers.defaultNullOpts.mkBool true ''
|
||||
|
@ -228,115 +207,87 @@ with lib;
|
|||
|
||||
border = helpers.defaultNullOpts.mkBorder "rounded" "the select window" "";
|
||||
|
||||
relative = helpers.defaultNullOpts.mkEnumFirstDefault ["editor" "win" "cursor"] ''
|
||||
Affects the dimensions of the window with respect to this setting.
|
||||
If 'editor' or 'win', will default to being centered.
|
||||
'';
|
||||
relative =
|
||||
helpers.defaultNullOpts.mkEnumFirstDefault
|
||||
[
|
||||
"editor"
|
||||
"win"
|
||||
"cursor"
|
||||
]
|
||||
''
|
||||
Affects the dimensions of the window with respect to this setting.
|
||||
If 'editor' or 'win', will default to being centered.
|
||||
'';
|
||||
|
||||
buf_options = helpers.defaultNullOpts.mkAttrsOf types.anything "{}" ''
|
||||
An attribute set of buffer options.
|
||||
'';
|
||||
|
||||
win_options =
|
||||
helpers.defaultNullOpts.mkAttrsOf types.anything
|
||||
''
|
||||
{
|
||||
cursorline = true;
|
||||
cursorlineopt = "both";
|
||||
}
|
||||
''
|
||||
"An attribute set of window options.";
|
||||
win_options = helpers.defaultNullOpts.mkAttrsOf types.anything ''
|
||||
{
|
||||
cursorline = true;
|
||||
cursorlineopt = "both";
|
||||
}
|
||||
'' "An attribute set of window options.";
|
||||
|
||||
width = helpers.defaultNullOpts.mkNullable intOrRatio "null" ''
|
||||
Can be an integer or a float between 0 and 1 (e.g. 0.4 for 40%).
|
||||
'';
|
||||
|
||||
max_width =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(
|
||||
with types;
|
||||
either
|
||||
intOrRatio
|
||||
(listOf intOrRatio)
|
||||
)
|
||||
"[140 0.8]"
|
||||
''
|
||||
Max width of window.
|
||||
helpers.defaultNullOpts.mkNullable (with types; either intOrRatio (listOf intOrRatio)) "[140 0.8]"
|
||||
''
|
||||
Max width of window.
|
||||
|
||||
Can be a list of mixed types, e.g. `[140 0.8]` means "less than 140 columns or 80%
|
||||
of total."
|
||||
'';
|
||||
Can be a list of mixed types, e.g. `[140 0.8]` means "less than 140 columns or 80%
|
||||
of total."
|
||||
'';
|
||||
|
||||
min_width =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(
|
||||
with types;
|
||||
either
|
||||
intOrRatio
|
||||
(listOf intOrRatio)
|
||||
)
|
||||
"[40 0.2]"
|
||||
''
|
||||
Min width of window.
|
||||
helpers.defaultNullOpts.mkNullable (with types; either intOrRatio (listOf intOrRatio)) "[40 0.2]"
|
||||
''
|
||||
Min width of window.
|
||||
|
||||
Can be a list of mixed types, e.g. `[40 0.2]` means "less than 40 columns or 20%
|
||||
of total."
|
||||
'';
|
||||
Can be a list of mixed types, e.g. `[40 0.2]` means "less than 40 columns or 20%
|
||||
of total."
|
||||
'';
|
||||
|
||||
height = helpers.defaultNullOpts.mkNullable intOrRatio "null" ''
|
||||
Can be an integer or a float between 0 and 1 (e.g. 0.4 for 40%).
|
||||
'';
|
||||
|
||||
max_height =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(
|
||||
with types;
|
||||
either
|
||||
intOrRatio
|
||||
(listOf intOrRatio)
|
||||
)
|
||||
"0.9"
|
||||
''
|
||||
Max height of window.
|
||||
helpers.defaultNullOpts.mkNullable (with types; either intOrRatio (listOf intOrRatio)) "0.9"
|
||||
''
|
||||
Max height of window.
|
||||
|
||||
Can be a list of mixed types, e.g. `[140 0.8]` means "less than 140 rows or 80%
|
||||
of total."
|
||||
'';
|
||||
Can be a list of mixed types, e.g. `[140 0.8]` means "less than 140 rows or 80%
|
||||
of total."
|
||||
'';
|
||||
|
||||
min_height =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(
|
||||
with types;
|
||||
either
|
||||
intOrRatio
|
||||
(listOf intOrRatio)
|
||||
)
|
||||
"[10 0.2]"
|
||||
''
|
||||
Min height of window.
|
||||
helpers.defaultNullOpts.mkNullable (with types; either intOrRatio (listOf intOrRatio)) "[10 0.2]"
|
||||
''
|
||||
Min height of window.
|
||||
|
||||
Can be a list of mixed types, e.g. `[10 0.2]` means "less than 10 rows or 20%
|
||||
of total."
|
||||
'';
|
||||
Can be a list of mixed types, e.g. `[10 0.2]` means "less than 10 rows or 20%
|
||||
of total."
|
||||
'';
|
||||
|
||||
mappings =
|
||||
helpers.defaultNullOpts.mkAttrsOf
|
||||
(
|
||||
with types;
|
||||
either str (enum [false])
|
||||
)
|
||||
''
|
||||
{
|
||||
"<Esc>" = "Close";
|
||||
"<C-c>" = "Close";
|
||||
"<CR>" = "Confirm";
|
||||
}
|
||||
''
|
||||
''
|
||||
Mappings in normal mode for the builtin selector.
|
||||
helpers.defaultNullOpts.mkAttrsOf (with types; either str (enum [ false ]))
|
||||
''
|
||||
{
|
||||
"<Esc>" = "Close";
|
||||
"<C-c>" = "Close";
|
||||
"<CR>" = "Confirm";
|
||||
}
|
||||
''
|
||||
''
|
||||
Mappings in normal mode for the builtin selector.
|
||||
|
||||
To disable a default mapping in a specific mode, set it to `false`.
|
||||
'';
|
||||
To disable a default mapping in a specific mode, set it to `false`.
|
||||
'';
|
||||
|
||||
override = helpers.defaultNullOpts.mkLuaFn "function(conf) return conf end" ''
|
||||
Lua function that takes config that is passed to nvim_open_win.
|
||||
|
@ -372,32 +323,38 @@ with lib;
|
|||
};
|
||||
};
|
||||
|
||||
settingsExample = {
|
||||
input = {
|
||||
enabled = true;
|
||||
mappings = {
|
||||
n = {
|
||||
"<Esc>" = "Close";
|
||||
"<CR>" = "Confirm";
|
||||
};
|
||||
i = {
|
||||
"<C-c>" = "Close";
|
||||
"<CR>" = "Confirm";
|
||||
"<Up>" = "HistoryPrev";
|
||||
"<Down>" = "HistoryNext";
|
||||
};
|
||||
settingsExample = {
|
||||
input = {
|
||||
enabled = true;
|
||||
mappings = {
|
||||
n = {
|
||||
"<Esc>" = "Close";
|
||||
"<CR>" = "Confirm";
|
||||
};
|
||||
};
|
||||
select = {
|
||||
enabled = true;
|
||||
backend = ["telescope" "fzf_lua" "fzf" "builtin" "nui"];
|
||||
builtin = {
|
||||
mappings = {
|
||||
"<Esc>" = "Close";
|
||||
"<C-c>" = "Close";
|
||||
"<CR>" = "Confirm";
|
||||
};
|
||||
i = {
|
||||
"<C-c>" = "Close";
|
||||
"<CR>" = "Confirm";
|
||||
"<Up>" = "HistoryPrev";
|
||||
"<Down>" = "HistoryNext";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
select = {
|
||||
enabled = true;
|
||||
backend = [
|
||||
"telescope"
|
||||
"fzf_lua"
|
||||
"fzf"
|
||||
"builtin"
|
||||
"nui"
|
||||
];
|
||||
builtin = {
|
||||
mappings = {
|
||||
"<Esc>" = "Close";
|
||||
"<C-c>" = "Close";
|
||||
"<CR>" = "Confirm";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue