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

@ -7,48 +7,57 @@
}:
with lib;
with helpers.vim-plugin;
mkVimPlugin config {
name = "startify";
originalName = "vim-startify";
defaultPackage = pkgs.vimPlugins.vim-startify;
globalPrefix = "startify_";
mkVimPlugin config {
name = "startify";
originalName = "vim-startify";
defaultPackage = pkgs.vimPlugins.vim-startify;
globalPrefix = "startify_";
maintainers = [maintainers.GaetanLepage];
maintainers = [ maintainers.GaetanLepage ];
# TODO introduced 2024-03-01: remove 2024-05-01
deprecateExtraConfig = true;
optionsRenamedToSettings = [
"sessionDir"
"lists"
"bookmarks"
"commands"
"filesNumber"
"sessionAutoload"
"sessionBeforeSave"
"sessionPersistence"
"sessionDeleteBuffers"
"changeToDir"
"changeToVcsRoot"
"changeCmd"
"paddingLeft"
"enableSpecial"
"enableUnsafe"
"sessionRemoveLines"
"sessionNumber"
"sessionSort"
"customIndices"
"customHeader"
"customFooter"
"relativePath"
"useEnv"
];
imports =
map
# TODO introduced 2024-03-01: remove 2024-05-01
deprecateExtraConfig = true;
optionsRenamedToSettings = [
"sessionDir"
"lists"
"bookmarks"
"commands"
"filesNumber"
"sessionAutoload"
"sessionBeforeSave"
"sessionPersistence"
"sessionDeleteBuffers"
"changeToDir"
"changeToVcsRoot"
"changeCmd"
"paddingLeft"
"enableSpecial"
"enableUnsafe"
"sessionRemoveLines"
"sessionNumber"
"sessionSort"
"customIndices"
"customHeader"
"customFooter"
"relativePath"
"useEnv"
];
imports =
map
(
option:
mkRenamedOptionModule
["plugins" "startify" option.old]
["plugins" "startify" "settings" option.new]
mkRenamedOptionModule
[
"plugins"
"startify"
option.old
]
[
"plugins"
"startify"
"settings"
option.new
]
)
[
{
@ -85,20 +94,20 @@ with helpers.vim-plugin;
}
];
settingsOptions = import ./options.nix {inherit lib helpers;};
settingsOptions = import ./options.nix { inherit lib helpers; };
# TODO
settingsExample = {
custom_header = [
""
" "
" "
" "
" "
" "
" "
];
change_to_dir = false;
fortune_use_unicode = true;
};
}
# TODO
settingsExample = {
custom_header = [
""
" "
" "
" "
" "
" "
" "
];
change_to_dir = false;
fortune_use_unicode = true;
};
}

View file

@ -1,19 +1,15 @@
{ lib, helpers }:
with lib;
{
lib,
helpers,
}:
with lib; {
session_dir = helpers.defaultNullOpts.mkStr "~/.vim/session" ''
The directory to save/load sessions to/from.
'';
lists = mkOption {
type = with helpers.nixvimTypes;
listOf
(
either
strLua
(submodule {
type =
with helpers.nixvimTypes;
listOf (
either strLua (submodule {
freeformType = with types; attrsOf anything;
options = {
type = mkOption {
@ -34,13 +30,8 @@ with lib; {
};
})
);
apply = v:
map (listElem:
if isString listElem
then helpers.mkRaw listElem
else listElem)
v;
default = [];
apply = v: map (listElem: if isString listElem then helpers.mkRaw listElem else listElem) v;
default = [ ];
description = ''
Startify displays lists. Each list consists of a `type` and optionally a `header` and
custom `indices`.
@ -75,44 +66,47 @@ with lib; {
bookmarks =
helpers.defaultNullOpts.mkListOf
(
with helpers.nixvimTypes;
oneOf [str rawLua attrs]
)
"[]"
''
A list of files or directories to bookmark.
The list can contain two kinds of types.
Either a path (str) or an attrs where the key is the custom index and the value is the path.
'';
(
with helpers.nixvimTypes;
oneOf [
str
rawLua
attrs
]
)
"[]"
''
A list of files or directories to bookmark.
The list can contain two kinds of types.
Either a path (str) or an attrs where the key is the custom index and the value is the path.
'';
commands =
helpers.defaultNullOpts.mkListOf
(
with types;
oneOf
[
(
with types;
oneOf [
str
(attrsOf (either str (listOf str)))
(listOf str)
]
)
"[]"
''
A list of commands to execute on selection.
Leading colons are optional.
It supports optional custom indices and/or command descriptions.
)
"[]"
''
A list of commands to execute on selection.
Leading colons are optional.
It supports optional custom indices and/or command descriptions.
Example:
```nix
[
":help reference"
["Vim Reference" "h ref"]
{h = "h ref";}
{m = ["My magical function" "call Magic()"];}
]
```
'';
Example:
```nix
[
":help reference"
["Vim Reference" "h ref"]
{h = "h ref";}
{m = ["My magical function" "call Magic()"];}
]
```
'';
files_number = helpers.defaultNullOpts.mkUnsignedInt 10 ''
The number of files to list.
@ -233,16 +227,12 @@ with lib; {
The number of spaces used for left padding.
'';
skiplist_server =
helpers.defaultNullOpts.mkListOf
(with helpers.nixvimTypes; maybeRaw str)
"[]"
''
Do not create the startify buffer, if this is a Vim server instance with a name contained in
this list.
skiplist_server = helpers.defaultNullOpts.mkListOf (with helpers.nixvimTypes; maybeRaw str) "[]" ''
Do not create the startify buffer, if this is a Vim server instance with a name contained in
this list.
Example: `["GVIM"]`
'';
Example: `["GVIM"]`
'';
enable_special = helpers.defaultNullOpts.mkBool true ''
Show `<empty buffer>` and `<quit>`.
@ -318,51 +308,42 @@ with lib; {
'';
custom_indices =
helpers.defaultNullOpts.mkNullable
(
with helpers.nixvimTypes;
maybeRaw (listOf str)
)
"[]"
''
Use any list of strings as indices instead of increasing numbers. If there are more startify
entries than actual items in the custom list, the remaining entries will be filled using the
default numbering scheme starting from 0.
helpers.defaultNullOpts.mkNullable (with helpers.nixvimTypes; maybeRaw (listOf str)) "[]"
''
Use any list of strings as indices instead of increasing numbers. If there are more startify
entries than actual items in the custom list, the remaining entries will be filled using the
default numbering scheme starting from 0.
Thus you can create your own indexing scheme that fits your keyboard layout.
You don't want to leave the home row, do you?!
Thus you can create your own indexing scheme that fits your keyboard layout.
You don't want to leave the home row, do you?!
Example:
```nix
["f" "g" "h"]
```
'';
Example:
```nix
["f" "g" "h"]
```
'';
custom_header =
helpers.mkNullOrOption
(
with helpers.nixvimTypes;
maybeRaw (listOf (maybeRaw str))
)
''
Define your own header.
helpers.mkNullOrOption (with helpers.nixvimTypes; maybeRaw (listOf (maybeRaw str)))
''
Define your own header.
This option takes a `list of strings`, whereas each string will be put on its own line.
If it is a simple `string`, it should evaluate to a list of strings.
This option takes a `list of strings`, whereas each string will be put on its own line.
If it is a simple `string`, it should evaluate to a list of strings.
Example:
```nix
[
""
" "
" "
" "
" "
" "
" "
]
```
'';
Example:
```nix
[
""
" "
" "
" "
" "
" "
" "
]
```
'';
custom_header_quotes = helpers.defaultNullOpts.mkListOf (with types; listOf str) "[]" ''
Example:
@ -375,14 +356,10 @@ with lib; {
'';
custom_footer =
helpers.mkNullOrOption
(
with helpers.nixvimTypes;
maybeRaw (listOf (maybeRaw str))
)
''
Same as the custom header, but shown at the bottom of the startify buffer.
'';
helpers.mkNullOrOption (with helpers.nixvimTypes; maybeRaw (listOf (maybeRaw str)))
''
Same as the custom header, but shown at the bottom of the startify buffer.
'';
disable_at_vimenter = helpers.defaultNullOpts.mkBool false ''
Don't run Startify at Vim startup.