mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 01:38:40 +02:00
helpers: move rawType to helpers.nixvimTypes (#871)
This is done in preparation of adding new (lua) types to help the documentation.
This commit is contained in:
parent
2f13e3a21d
commit
af41ea2d80
38 changed files with 80 additions and 75 deletions
|
@ -32,7 +32,7 @@ in {
|
|||
executionMessage = {
|
||||
message =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(with types; either str helpers.rawType)
|
||||
(with types; either str helpers.nixvimTypes.rawLua)
|
||||
''
|
||||
{
|
||||
__raw = \'\'
|
||||
|
|
|
@ -32,7 +32,7 @@ in {
|
|||
|
||||
rootDir =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(with types; either str helpers.rawType)
|
||||
(with types; either str helpers.nixvimTypes.rawLua)
|
||||
"{__raw = \"vim.fn.stdpath 'data' .. '/sessions/'\";}"
|
||||
''
|
||||
Root directory for session files.
|
||||
|
@ -128,7 +128,7 @@ in {
|
|||
sessionControl = {
|
||||
controlDir =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(with types; either str helpers.rawType)
|
||||
(with types; either str helpers.nixvimTypes.rawLua)
|
||||
"\"vim.fn.stdpath 'data' .. '/auto_session/'\""
|
||||
''
|
||||
Auto session control dir, for control files, like alternating between two sessions
|
||||
|
|
|
@ -39,7 +39,7 @@ in {
|
|||
helpers.defaultNullOpts.mkNullable
|
||||
(
|
||||
with types;
|
||||
either str helpers.rawType
|
||||
either str helpers.nixvimTypes.rawLua
|
||||
)
|
||||
"<ESC>"
|
||||
''
|
||||
|
|
|
@ -34,7 +34,7 @@ in {
|
|||
|
||||
mode =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(with types; either (enum ["exact" "search" "fuzzy"]) helpers.rawType) ''"exact"'' ''
|
||||
(with types; either (enum ["exact" "search" "fuzzy"]) helpers.nixvimTypes.rawLua) ''"exact"'' ''
|
||||
- exact: exact match
|
||||
- search: regular search
|
||||
- fuzzy: fuzzy search
|
||||
|
@ -48,7 +48,7 @@ in {
|
|||
incremental = helpers.defaultNullOpts.mkBool false "behave like `incsearch`";
|
||||
|
||||
exclude =
|
||||
helpers.defaultNullOpts.mkNullable (with types; listOf (either str helpers.rawType)) ''
|
||||
helpers.defaultNullOpts.mkNullable (with types; listOf (either str helpers.nixvimTypes.rawLua)) ''
|
||||
[
|
||||
"notify"
|
||||
"cmp_menu"
|
||||
|
|
|
@ -126,7 +126,7 @@ in {
|
|||
options = {
|
||||
message = lib.mkOption {
|
||||
description = "Hint message to be displayed.";
|
||||
type = helpers.rawType;
|
||||
type = helpers.nixvimTypes.rawLua;
|
||||
};
|
||||
|
||||
length = lib.mkOption {
|
||||
|
|
|
@ -157,7 +157,7 @@ with import ../helpers.nix {inherit lib;};
|
|||
|
||||
Default: `{__raw = "vim.fn.stdpath('data')..'/molten'";}`
|
||||
'';
|
||||
type = with types; either str rawType;
|
||||
type = with nixvimTypes; either str rawLua;
|
||||
};
|
||||
|
||||
useBorderHighlights = mkDefaultOpt {
|
||||
|
|
|
@ -166,7 +166,7 @@ in {
|
|||
(
|
||||
either
|
||||
str
|
||||
helpers.rawType
|
||||
helpers.nixvimTypes.rawLua
|
||||
)
|
||||
)
|
||||
''
|
||||
|
|
|
@ -21,11 +21,11 @@ in {
|
|||
|
||||
timeout = helpers.defaultNullOpts.mkUnsignedInt 5000 "Default timeout for notification.";
|
||||
|
||||
maxWidth = helpers.mkNullOrOption (with types; either ints.unsigned helpers.rawType) ''
|
||||
maxWidth = helpers.mkNullOrOption (with types; either ints.unsigned helpers.nixvimTypes.rawLua) ''
|
||||
Max number of columns for messages.
|
||||
'';
|
||||
|
||||
maxHeight = helpers.mkNullOrOption (with types; either ints.unsigned helpers.rawType) ''
|
||||
maxHeight = helpers.mkNullOrOption (with types; either ints.unsigned helpers.nixvimTypes.rawLua) ''
|
||||
Max number of lines for a message.
|
||||
'';
|
||||
|
||||
|
@ -85,7 +85,7 @@ in {
|
|||
with types;
|
||||
either
|
||||
(enum ["default" "minimal"])
|
||||
helpers.rawType
|
||||
helpers.nixvimTypes.rawLua
|
||||
)
|
||||
"default"
|
||||
"Function to render a notification buffer or a built-in renderer name.";
|
||||
|
|
|
@ -67,7 +67,7 @@ in {
|
|||
package = helpers.mkPackageOption "oil" pkgs.vimPlugins.oil-nvim;
|
||||
|
||||
columns = let
|
||||
highlightsOption = helpers.mkNullOrOption (with types; either str helpers.rawType) ''
|
||||
highlightsOption = helpers.mkNullOrOption (with types; either str helpers.nixvimTypes.rawLua) ''
|
||||
A string or a lua function (`fun(value: string): string`).
|
||||
Highlight group, or function that returns a highlight group.
|
||||
'';
|
||||
|
|
|
@ -14,7 +14,7 @@ with lib; {
|
|||
package = helpers.mkPackageOption "persistence.nvim" pkgs.vimPlugins.persistence-nvim;
|
||||
|
||||
dir =
|
||||
helpers.defaultNullOpts.mkNullable (with types; either str helpers.rawType)
|
||||
helpers.defaultNullOpts.mkNullable (with types; either str helpers.nixvimTypes.rawLua)
|
||||
''vim.fn.expand(vim.fn.stdpath("state") .. "/sessions/")''
|
||||
"directory where session files are saved";
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ in {
|
|||
|
||||
buttons =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(types.either helpers.rawType
|
||||
(types.either helpers.nixvimTypes.rawLua
|
||||
(types.listOf (types.submodule {
|
||||
options = {
|
||||
label = helpers.mkNullOrOption types.str "";
|
||||
|
@ -99,49 +99,49 @@ in {
|
|||
showTime = helpers.defaultNullOpts.mkBool true "Show the timer.";
|
||||
|
||||
# Rich presence text options.
|
||||
editingText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.rawType) "Editing %s" ''
|
||||
editingText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.nixvimTypes.rawLua) "Editing %s" ''
|
||||
String rendered when an editable file is loaded in the buffer.
|
||||
|
||||
Can also be a lua function:
|
||||
`function(filename: string): string`
|
||||
'';
|
||||
|
||||
fileExplorerText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.rawType) "Browsing %s" ''
|
||||
fileExplorerText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.nixvimTypes.rawLua) "Browsing %s" ''
|
||||
String rendered when browsing a file explorer.
|
||||
|
||||
Can also be a lua function:
|
||||
`function(file_explorer_name: string): string`
|
||||
'';
|
||||
|
||||
gitCommitText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.rawType) "Committing changes" ''
|
||||
gitCommitText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.nixvimTypes.rawLua) "Committing changes" ''
|
||||
String rendered when committing changes in git.
|
||||
|
||||
Can also be a lua function:
|
||||
`function(filename: string): string`
|
||||
'';
|
||||
|
||||
pluginManagerText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.rawType) "Managing plugins" ''
|
||||
pluginManagerText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.nixvimTypes.rawLua) "Managing plugins" ''
|
||||
String rendered when managing plugins.
|
||||
|
||||
Can also be a lua function:
|
||||
`function(plugin_manager_name: string): string`
|
||||
'';
|
||||
|
||||
readingText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.rawType) "Reading %s" ''
|
||||
readingText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.nixvimTypes.rawLua) "Reading %s" ''
|
||||
String rendered when a read-only/unmodifiable file is loaded into the buffer.
|
||||
|
||||
Can also be a lua function:
|
||||
`function(filename: string): string`
|
||||
'';
|
||||
|
||||
workspaceText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.rawType) "Working on %s" ''
|
||||
workspaceText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.nixvimTypes.rawLua) "Working on %s" ''
|
||||
String rendered when in a git repository.
|
||||
|
||||
Can also be a lua function:
|
||||
`function(project_name: string|nil, filename: string): string`
|
||||
'';
|
||||
|
||||
lineNumberText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.rawType) "Line %s out of %s" ''
|
||||
lineNumberText = helpers.defaultNullOpts.mkNullable (types.either types.str helpers.nixvimTypes.rawLua) "Line %s out of %s" ''
|
||||
String rendered when `enableLineNumber` is set to `true` to display the current line number.
|
||||
|
||||
Can also be a lua function:
|
||||
|
|
|
@ -64,7 +64,7 @@ in {
|
|||
|
||||
dataPath =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(with types; either str helpers.rawType)
|
||||
(with types; either str helpers.nixvimTypes.rawLua)
|
||||
''{__raw = "vim.fn.stdpath('data')";}''
|
||||
"Path where project.nvim will store the project history for use in telescope.";
|
||||
};
|
||||
|
|
|
@ -77,7 +77,7 @@ in {
|
|||
(listOf str)
|
||||
)
|
||||
)
|
||||
helpers.rawType
|
||||
helpers.nixvimTypes.rawLua
|
||||
# for "oldfiles" sections
|
||||
(enum [""])
|
||||
]
|
||||
|
|
|
@ -40,7 +40,7 @@ in {
|
|||
|
||||
storagePath =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(with types; either str helpers.rawType)
|
||||
(with types; either str helpers.nixvimTypes.rawLua)
|
||||
''{__raw = "vim.fn.stdpath('data') .. '/databases/yanky.db'";}''
|
||||
"Only for sqlite storage.";
|
||||
|
||||
|
@ -70,7 +70,7 @@ in {
|
|||
|
||||
picker = {
|
||||
select = {
|
||||
action = helpers.mkNullOrOption (with types; either helpers.rawType str) ''
|
||||
action = helpers.mkNullOrOption (with types; either helpers.nixvimTypes.rawLua str) ''
|
||||
This define the action that should be done when selecting an item in the
|
||||
`vim.ui.select` prompt.
|
||||
If you let this option to `null`, this will use the default action: put selected item
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue