mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-26 10:48:35 +02:00
plugins/filetrees: normalize plugin defaults
This commit is contained in:
parent
b86db98f53
commit
25eed3c2f5
3 changed files with 338 additions and 294 deletions
|
@ -27,11 +27,19 @@ in
|
|||
'';
|
||||
|
||||
mimetypes = {
|
||||
warn = mkListStr ''["audio" "font" "image" "video"]'' ''
|
||||
warn =
|
||||
mkListStr
|
||||
[
|
||||
"audio"
|
||||
"font"
|
||||
"image"
|
||||
"video"
|
||||
]
|
||||
''
|
||||
Show a warning before opening these datatypes.
|
||||
'';
|
||||
|
||||
allowExts = mkListStr ''[".ts"]'' ''
|
||||
allowExts = mkListStr [ ".ts" ] ''
|
||||
Skip warning for these extensions.
|
||||
'';
|
||||
};
|
||||
|
@ -58,16 +66,24 @@ in
|
|||
'';
|
||||
|
||||
ignore = {
|
||||
nameExact = mkListStr ''[".DS_Store" ".directory" "thumbs.db" ".git"]'' ''
|
||||
nameExact =
|
||||
mkListStr
|
||||
[
|
||||
".DS_Store"
|
||||
".directory"
|
||||
"thumbs.db"
|
||||
".git"
|
||||
]
|
||||
''
|
||||
Files whose name match these exactly will be ignored.
|
||||
'';
|
||||
|
||||
nameGlob = mkListStr "[]" ''
|
||||
nameGlob = mkListStr [ ] ''
|
||||
Files whose name match these glob patterns will be ignored.
|
||||
ie. `*.py` will match all python files
|
||||
'';
|
||||
|
||||
pathGlob = mkListStr "[]" ''
|
||||
pathGlob = mkListStr [ ] ''
|
||||
Files whose full path match these glob patterns will be ignored.
|
||||
'';
|
||||
};
|
||||
|
@ -85,7 +101,14 @@ in
|
|||
Which way does CHADTree open?
|
||||
'';
|
||||
|
||||
sortBy = mkListStr ''["is_folder" "ext" "file_name"]'' ''
|
||||
sortBy =
|
||||
mkListStr
|
||||
[
|
||||
"is_folder"
|
||||
"ext"
|
||||
"file_name"
|
||||
]
|
||||
''
|
||||
CHADTree can sort by the following criterion.
|
||||
Reorder them if you want a different sorting order.
|
||||
legal keys: some of
|
||||
|
@ -184,123 +207,141 @@ in
|
|||
|
||||
keymap = {
|
||||
windowManagement = {
|
||||
quit = mkListStr ''["q"]'' ''
|
||||
quit = mkListStr [ "q" ] ''
|
||||
Close CHADTree window, quit if it is the last window.
|
||||
'';
|
||||
|
||||
bigger = mkListStr ''["+" "="]'' ''
|
||||
bigger =
|
||||
mkListStr
|
||||
[
|
||||
"+"
|
||||
"="
|
||||
]
|
||||
''
|
||||
Resize CHADTree window bigger.
|
||||
'';
|
||||
|
||||
smaller = mkListStr ''["-" "_"]'' ''
|
||||
smaller =
|
||||
mkListStr
|
||||
[
|
||||
"-"
|
||||
"_"
|
||||
]
|
||||
''
|
||||
Resize CHADTree window smaller.
|
||||
'';
|
||||
|
||||
refresh = mkListStr ''["<c-r>"]'' ''
|
||||
refresh = mkListStr [ "<c-r>" ] ''
|
||||
Refresh CHADTree.
|
||||
'';
|
||||
};
|
||||
|
||||
rerooting = {
|
||||
changeDir = mkListStr ''["b"]'' ''
|
||||
changeDir = mkListStr [ "b" ] ''
|
||||
Change vim's working directory.
|
||||
'';
|
||||
|
||||
changeFocus = mkListStr ''["c"]'' ''
|
||||
changeFocus = mkListStr [ "c" ] ''
|
||||
Set CHADTree's root to folder at cursor. Does not change working directory.
|
||||
'';
|
||||
|
||||
changeFocusUp = mkListStr ''["C"]'' ''
|
||||
changeFocusUp = mkListStr [ "C" ] ''
|
||||
Set CHADTree's root one level up.
|
||||
'';
|
||||
};
|
||||
|
||||
openFileFolder = {
|
||||
primary = mkListStr ''["<enter>"]'' ''
|
||||
primary = mkListStr [ "<enter>" ] ''
|
||||
Open file at cursor.
|
||||
'';
|
||||
|
||||
secondary = mkListStr ''["<tab> <2-leftmouse>"]'' ''
|
||||
secondary = mkListStr [ "<tab> <2-leftmouse>" ] ''
|
||||
Open file at cursor, keep cursor in CHADTree's window.
|
||||
'';
|
||||
|
||||
tertiary = mkListStr ''["<m-enter>" <middlemouse>]'' ''
|
||||
tertiary =
|
||||
mkListStr
|
||||
[
|
||||
"<m-enter>"
|
||||
"<middlemouse>"
|
||||
]
|
||||
''
|
||||
Open file at cursor in a new tab.
|
||||
'';
|
||||
|
||||
vSplit = mkListStr ''["w"]'' ''
|
||||
vSplit = mkListStr [ "w" ] ''
|
||||
Open file at cursor in vertical split.
|
||||
'';
|
||||
|
||||
hSplit = mkListStr ''["W"]'' ''
|
||||
hSplit = mkListStr [ "W" ] ''
|
||||
Open file at cursor in horizontal split.
|
||||
'';
|
||||
|
||||
openSys = mkListStr ''["o"]'' ''
|
||||
openSys = mkListStr [ "o" ] ''
|
||||
Open file with GUI tools using `open` or `xdg open`.
|
||||
This will open third party tools such as Finder or KDE Dolphin or GNOME nautilus, etc.
|
||||
Depends on platform and user setup.
|
||||
'';
|
||||
|
||||
collapse = mkListStr ''["o"]'' ''
|
||||
collapse = mkListStr [ "o" ] ''
|
||||
Collapse all subdirectories for directory at cursor.
|
||||
'';
|
||||
};
|
||||
|
||||
cursor = {
|
||||
refocus = mkListStr ''["~"]'' ''
|
||||
refocus = mkListStr [ "~" ] ''
|
||||
Put cursor at the root of CHADTree.
|
||||
'';
|
||||
|
||||
jumpToCurrent = mkListStr ''["J"]'' ''
|
||||
jumpToCurrent = mkListStr [ "J" ] ''
|
||||
Position cursor in CHADTree at currently open buffer, if the buffer points to a location visible under CHADTree.
|
||||
'';
|
||||
|
||||
stat = mkListStr ''["K"]'' ''
|
||||
stat = mkListStr [ "K" ] ''
|
||||
Print `ls --long` stat for file under cursor.
|
||||
'';
|
||||
|
||||
copyName = mkListStr ''["y"]'' ''
|
||||
copyName = mkListStr [ "y" ] ''
|
||||
Copy paths of files under cursor or visual block.
|
||||
'';
|
||||
|
||||
copyBasename = mkListStr ''["Y"]'' ''
|
||||
copyBasename = mkListStr [ "Y" ] ''
|
||||
Copy names of files under cursor or visual block.
|
||||
'';
|
||||
|
||||
copyRelname = mkListStr ''["<c-y>"]'' ''
|
||||
copyRelname = mkListStr [ "<c-y>" ] ''
|
||||
Copy relative paths of files under cursor or visual block.
|
||||
'';
|
||||
};
|
||||
|
||||
filtering = {
|
||||
filter = mkListStr ''["f"]'' ''
|
||||
filter = mkListStr [ "f" ] ''
|
||||
Set a glob pattern to narrow down visible files.
|
||||
'';
|
||||
|
||||
clearFilter = mkListStr ''["F"]'' ''
|
||||
clearFilter = mkListStr [ "F" ] ''
|
||||
Clear filter.
|
||||
'';
|
||||
};
|
||||
|
||||
bookmarks = {
|
||||
bookmarkGoto = mkListStr ''["m"]'' ''
|
||||
bookmarkGoto = mkListStr [ "m" ] ''
|
||||
Goto bookmark `A-Z`.
|
||||
'';
|
||||
};
|
||||
|
||||
selecting = {
|
||||
select = mkListStr ''["s"]'' ''
|
||||
select = mkListStr [ "s" ] ''
|
||||
Select files under cursor or visual block.
|
||||
'';
|
||||
|
||||
clearSelection = mkListStr ''["S"]'' ''
|
||||
clearSelection = mkListStr [ "S" ] ''
|
||||
Clear selection.
|
||||
'';
|
||||
};
|
||||
|
||||
fileOperations = {
|
||||
new = mkListStr ''["a"]'' ''
|
||||
new = mkListStr [ "a" ] ''
|
||||
Create new file at location under cursor. Files ending with platform specific path separator will be folders.
|
||||
|
||||
Intermediary folders are created automatically.
|
||||
|
@ -308,7 +349,7 @@ in
|
|||
ie. `uwu/owo/` under unix will create `uwu/` then `owo/` under it. Both are folders.
|
||||
'';
|
||||
|
||||
link = mkListStr ''["A"]'' ''
|
||||
link = mkListStr [ "A" ] ''
|
||||
Create links at location under cursor from selection.
|
||||
|
||||
Links are always relative.
|
||||
|
@ -316,44 +357,44 @@ in
|
|||
Intermediary folders are created automatically.
|
||||
'';
|
||||
|
||||
rename = mkListStr ''["r"]'' ''
|
||||
rename = mkListStr [ "r" ] ''
|
||||
Rename file under cursor.
|
||||
'';
|
||||
|
||||
toggleExec = mkListStr ''["X"]'' ''
|
||||
toggleExec = mkListStr [ "X" ] ''
|
||||
Toggle all the `+x` bits of the selected / highlighted files.
|
||||
|
||||
Except for directories, where `-x` will prevent reading.
|
||||
'';
|
||||
|
||||
copy = mkListStr ''["p"]'' ''
|
||||
copy = mkListStr [ "p" ] ''
|
||||
Copy the selected files to location under cursor.
|
||||
'';
|
||||
|
||||
cut = mkListStr ''["x"]'' ''
|
||||
cut = mkListStr [ "x" ] ''
|
||||
Move the selected files to location under cursor.
|
||||
'';
|
||||
|
||||
delete = mkListStr ''["d"]'' ''
|
||||
delete = mkListStr [ "d" ] ''
|
||||
Delete the selected files. Items deleted cannot be recovered.
|
||||
'';
|
||||
|
||||
trash = mkListStr ''[t]'' ''
|
||||
trash = mkListStr [ "t" ] ''
|
||||
Trash the selected files using platform specific `trash` command, if they are available.
|
||||
Items trashed may be recovered.
|
||||
'';
|
||||
};
|
||||
|
||||
toggles = {
|
||||
toggleHidden = mkListStr ''["."]'' ''
|
||||
toggleHidden = mkListStr [ "." ] ''
|
||||
Toggle show_hidden on and off. See `chadtree.showHidden` for details.
|
||||
'';
|
||||
|
||||
toggleFollow = mkListStr ''["u"]'' ''
|
||||
toggleFollow = mkListStr [ "u" ] ''
|
||||
Toggle `follow` on and off. See `chadtree.follow` for details.
|
||||
'';
|
||||
|
||||
toggleVersionControl = mkListStr ''["i"]'' ''
|
||||
toggleVersionControl = mkListStr [ "i" ] ''
|
||||
Toggle version control integration on and off.
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -58,8 +58,12 @@ in
|
|||
package = helpers.mkPluginPackageOption "neo-tree" pkgs.vimPlugins.neo-tree-nvim;
|
||||
|
||||
sources =
|
||||
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
|
||||
''["filesystem" "buffers" "git_status"]''
|
||||
helpers.defaultNullOpts.mkListOf types.str
|
||||
[
|
||||
"filesystem"
|
||||
"buffers"
|
||||
"git_status"
|
||||
]
|
||||
''
|
||||
If a user has a sources list it will replace this one.
|
||||
Only sources listed here will be loaded.
|
||||
|
@ -122,12 +126,12 @@ in
|
|||
] "info" "";
|
||||
|
||||
logToFile =
|
||||
helpers.defaultNullOpts.mkNullable (types.either types.bool types.str) "false"
|
||||
helpers.defaultNullOpts.mkNullable (types.either types.bool types.str) false
|
||||
"use :NeoTreeLogs to show the file";
|
||||
|
||||
openFilesInLastWindow = helpers.defaultNullOpts.mkBool true "If `false`, open files in top left window";
|
||||
|
||||
popupBorderStyle = helpers.defaultNullOpts.mkEnum [
|
||||
popupBorderStyle = helpers.defaultNullOpts.mkEnumFirstDefault [
|
||||
"NC"
|
||||
"double"
|
||||
"none"
|
||||
|
@ -135,7 +139,7 @@ in
|
|||
"shadow"
|
||||
"single"
|
||||
"solid"
|
||||
] "NC" "";
|
||||
] "";
|
||||
|
||||
resizeTimerInterval = helpers.defaultNullOpts.mkInt 500 ''
|
||||
In ms, needed for containers to redraw right aligned and faded content.
|
||||
|
@ -228,7 +232,7 @@ in
|
|||
helpers.defaultNullOpts.mkNullable types.int null
|
||||
"This will truncate text even if `textTruncToFit = false`";
|
||||
|
||||
padding = helpers.defaultNullOpts.mkNullable (with types; either int (attrsOf int)) "0" ''
|
||||
padding = helpers.defaultNullOpts.mkNullable (with types; either int (attrsOf int)) 0 ''
|
||||
Defines the global padding of the source selector.
|
||||
It can be an integer or an attrs with keys `left` and `right`.
|
||||
Setting `padding = 2` is exactly the same as `{ left = 2; right = 2; }`.
|
||||
|
@ -236,7 +240,9 @@ in
|
|||
Example: `{ left = 2; right = 0; }`
|
||||
'';
|
||||
|
||||
separator = helpers.defaultNullOpts.mkNullable (
|
||||
separator =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(
|
||||
with types;
|
||||
either str (submodule {
|
||||
options = {
|
||||
|
@ -245,7 +251,12 @@ in
|
|||
override = helpers.defaultNullOpts.mkStr null "";
|
||||
};
|
||||
})
|
||||
) "Can be a string or a table" ''{ left = "▏"; right= "▕"; }'';
|
||||
)
|
||||
{
|
||||
left = "▏";
|
||||
right = "▕";
|
||||
}
|
||||
"Can be a string or a table";
|
||||
|
||||
separatorActive =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
|
@ -416,8 +427,7 @@ in
|
|||
};
|
||||
|
||||
renderers = {
|
||||
directory = mkRendererComponentListOption ''
|
||||
[
|
||||
directory = mkRendererComponentListOption [
|
||||
"indent"
|
||||
"icon"
|
||||
"current_filter"
|
||||
|
@ -447,11 +457,9 @@ in
|
|||
}
|
||||
];
|
||||
}
|
||||
]
|
||||
'' "directory renderers";
|
||||
] "directory renderers";
|
||||
|
||||
file = mkRendererComponentListOption ''
|
||||
[
|
||||
file = mkRendererComponentListOption [
|
||||
"indent"
|
||||
"icon"
|
||||
{
|
||||
|
@ -486,11 +494,9 @@ in
|
|||
}
|
||||
];
|
||||
}
|
||||
]
|
||||
'' "file renderers";
|
||||
] "file renderers";
|
||||
|
||||
message = mkRendererComponentListOption ''
|
||||
[
|
||||
message = mkRendererComponentListOption [
|
||||
{
|
||||
name = "indent";
|
||||
with_markers = false;
|
||||
|
@ -499,30 +505,27 @@ in
|
|||
name = "name";
|
||||
highlight = "NeoTreeMessage";
|
||||
}
|
||||
]
|
||||
'' "message renderers";
|
||||
] "message renderers";
|
||||
|
||||
terminal = mkRendererComponentListOption ''
|
||||
[
|
||||
terminal = mkRendererComponentListOption [
|
||||
"indent"
|
||||
"icon"
|
||||
"name"
|
||||
"bufnr"
|
||||
]
|
||||
'' "message renderers";
|
||||
] "message renderers";
|
||||
};
|
||||
|
||||
nestingRules = helpers.defaultNullOpts.mkNullable (types.attrsOf types.str) "{}" "nesting rules";
|
||||
nestingRules = helpers.defaultNullOpts.mkAttrsOf types.str { } "nesting rules";
|
||||
|
||||
window = {
|
||||
position = helpers.defaultNullOpts.mkEnum [
|
||||
position = helpers.defaultNullOpts.mkEnumFirstDefault [
|
||||
"left"
|
||||
"right"
|
||||
"top"
|
||||
"bottom"
|
||||
"float"
|
||||
"current"
|
||||
] "left" "position";
|
||||
] "position";
|
||||
|
||||
width = helpers.defaultNullOpts.mkInt 40 "Applies to left and right positions";
|
||||
|
||||
|
@ -572,7 +575,7 @@ in
|
|||
nowait = helpers.defaultNullOpts.mkBool true "nowait";
|
||||
};
|
||||
|
||||
mappings = mkMappingsOption ''
|
||||
mappings = mkMappingsOption (literalMD ''
|
||||
```nix
|
||||
{
|
||||
"<space>" = {
|
||||
|
@ -622,10 +625,10 @@ in
|
|||
">" = "next_source";
|
||||
}
|
||||
```
|
||||
'';
|
||||
'');
|
||||
};
|
||||
filesystem = {
|
||||
window = mkWindowMappingsOption ''
|
||||
window = mkWindowMappingsOption (literalMD ''
|
||||
```nix
|
||||
{
|
||||
H = "toggle_hidden";
|
||||
|
@ -642,7 +645,7 @@ in
|
|||
"]g" = "next_git_modified";
|
||||
}
|
||||
```
|
||||
'';
|
||||
'');
|
||||
asyncDirectoryScan =
|
||||
helpers.defaultNullOpts.mkEnumFirstDefault
|
||||
[
|
||||
|
@ -688,39 +691,44 @@ in
|
|||
|
||||
hideHidden = helpers.defaultNullOpts.mkBool true "only works on Windows for hidden files/directories";
|
||||
|
||||
hideByName =
|
||||
helpers.defaultNullOpts.mkNullable (types.listOf types.str) ''[".DS_Store" "thumbs.db"]''
|
||||
"hide by name";
|
||||
hideByName = helpers.defaultNullOpts.mkListOf types.str [
|
||||
".DS_Store"
|
||||
"thumbs.db"
|
||||
] "hide by name";
|
||||
|
||||
hideByPattern = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||
Hide by pattern.
|
||||
|
||||
Example:
|
||||
```nix
|
||||
[
|
||||
hideByPattern = helpers.defaultNullOpts.mkListOf' {
|
||||
type = types.str;
|
||||
pluginDefault = [ ];
|
||||
description = "Hide by pattern.";
|
||||
example = [
|
||||
"*.meta"
|
||||
"*/src/*/tsconfig.json"
|
||||
]
|
||||
```
|
||||
'';
|
||||
];
|
||||
};
|
||||
|
||||
alwaysShow = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||
Files/folders to always show.
|
||||
alwaysShow = helpers.defaultNullOpts.mkListOf' {
|
||||
type = types.str;
|
||||
pluginDefault = [ ];
|
||||
description = "Files/folders to always show.";
|
||||
example = [ ".gitignore" ];
|
||||
};
|
||||
|
||||
Example: `[".gitignore"]`
|
||||
'';
|
||||
neverShow = helpers.defaultNullOpts.mkListOf' {
|
||||
type = types.str;
|
||||
pluginDefault = [ ];
|
||||
description = "Files/folders to never show.";
|
||||
example = [
|
||||
".DS_Store"
|
||||
"thumbs.db"
|
||||
];
|
||||
};
|
||||
|
||||
neverShow = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||
Files/folders to never show.
|
||||
|
||||
Example: `[".DS_Store" "thumbs.db"]`
|
||||
'';
|
||||
|
||||
neverShowByPattern = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||
Files/folders to never show (by pattern).
|
||||
|
||||
Example: `[".null-ls_*"]`
|
||||
'';
|
||||
neverShowByPattern = helpers.defaultNullOpts.mkListOf' {
|
||||
type = types.str;
|
||||
pluginDefault = [ ];
|
||||
description = "Files/folders to never show (by pattern).";
|
||||
example = [ ".null-ls_*" ];
|
||||
};
|
||||
};
|
||||
|
||||
findByFullPathWords = helpers.defaultNullOpts.mkBool false ''
|
||||
|
@ -737,14 +745,12 @@ in
|
|||
helpers.mkNullOrStrLuaFnOr
|
||||
(types.submodule {
|
||||
options = {
|
||||
fd = helpers.defaultNullOpts.mkNullable (types.listOf types.str) ''
|
||||
[
|
||||
fd = helpers.defaultNullOpts.mkListOf types.str [
|
||||
"--exclude"
|
||||
".git"
|
||||
"--exclude"
|
||||
"node_modules"
|
||||
]
|
||||
'' "You can specify extra args to pass to the find command.";
|
||||
] "You can specify extra args to pass to the find command.";
|
||||
};
|
||||
})
|
||||
''
|
||||
|
@ -824,18 +830,15 @@ in
|
|||
|
||||
groupEmptyDirs = helpers.defaultNullOpts.mkBool true "When true, empty directories will be grouped together.";
|
||||
|
||||
window = mkWindowMappingsOption ''
|
||||
{
|
||||
window = mkWindowMappingsOption {
|
||||
"<bs>" = "navigate_up";
|
||||
"." = "set_root";
|
||||
bd = "buffer_delete";
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
gitStatus = {
|
||||
window = mkWindowMappingsOption ''
|
||||
{
|
||||
window = mkWindowMappingsOption {
|
||||
A = "git_add_all";
|
||||
gu = "git_unstage_file";
|
||||
ga = "git_add_file";
|
||||
|
@ -843,14 +846,12 @@ in
|
|||
gc = "git_commit";
|
||||
gp = "git_push";
|
||||
gg = "git_commit_and_push";
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
example = {
|
||||
renderers = {
|
||||
custom = mkRendererComponentListOption ''
|
||||
[
|
||||
custom = mkRendererComponentListOption [
|
||||
"indent"
|
||||
{
|
||||
name = "icon";
|
||||
|
@ -858,17 +859,14 @@ in
|
|||
}
|
||||
"custom"
|
||||
"name"
|
||||
]
|
||||
'' "custom renderers";
|
||||
] "custom renderers";
|
||||
};
|
||||
|
||||
window = mkWindowMappingsOption ''
|
||||
{
|
||||
window = mkWindowMappingsOption {
|
||||
"<cr>" = "toggle_node";
|
||||
"<C-e>" = "example_command";
|
||||
d = "show_debug_info";
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
documentSymbols = {
|
||||
|
@ -913,7 +911,7 @@ in
|
|||
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentSymbol
|
||||
'';
|
||||
};
|
||||
window = mkWindowMappingsOption "{}";
|
||||
window = mkWindowMappingsOption { };
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -11,11 +11,8 @@ let
|
|||
inherit (helpers) ifNonNull';
|
||||
|
||||
openWinConfigOption =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
# Type
|
||||
types.attrs
|
||||
helpers.defaultNullOpts.mkAttributeSet
|
||||
# Default
|
||||
''
|
||||
{
|
||||
col = 1;
|
||||
row = 1;
|
||||
|
@ -23,7 +20,6 @@ let
|
|||
border = "shadow";
|
||||
style = "minimal";
|
||||
}
|
||||
''
|
||||
# Description
|
||||
''
|
||||
Floating window config for file_popup. See |nvim_open_win| for more details.
|
||||
|
@ -97,14 +93,13 @@ in
|
|||
'';
|
||||
|
||||
sortBy =
|
||||
helpers.defaultNullOpts.mkNullable
|
||||
(types.either (types.enum [
|
||||
helpers.defaultNullOpts.mkEnumFirstDefault
|
||||
[
|
||||
"name"
|
||||
"case_sensitive"
|
||||
"modification_time"
|
||||
"extension"
|
||||
]) helpers.nixvimTypes.rawLua)
|
||||
"name"
|
||||
]
|
||||
''
|
||||
Changes how files within the same directory are sorted.
|
||||
Can be one of `name`, `case_sensitive`, `modification_time`, `extension` or a
|
||||
|
@ -139,7 +134,7 @@ in
|
|||
Keeps the cursor on the first letter of the filename when moving in the tree.
|
||||
'';
|
||||
|
||||
rootDirs = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||
rootDirs = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||
Preferred root directories.
|
||||
Only relevant when `updateFocusedFile.updateRoot` is `true`.
|
||||
'';
|
||||
|
@ -187,7 +182,7 @@ in
|
|||
Only relevant when `updateFocusedFile.enable` is `true`
|
||||
'';
|
||||
|
||||
ignoreList = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||
ignoreList = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||
List of buffer names and filetypes that will not update the root dir of the tree if the
|
||||
file isn't found under the current root directory.
|
||||
Only relevant when `updateFocusedFile.updateRoot` and `updateFocusedFile.enable` are
|
||||
|
@ -205,7 +200,7 @@ in
|
|||
Windows: "`cmd"`
|
||||
'';
|
||||
|
||||
args = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||
args = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||
Optional argument list.
|
||||
|
||||
Leave empty for OS specific default:
|
||||
|
@ -310,7 +305,7 @@ in
|
|||
Idle milliseconds between filesystem change and action.
|
||||
'';
|
||||
|
||||
ignoreDirs = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||
ignoreDirs = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||
List of vim regex for absolute directory paths that will not be watched.
|
||||
Backslashes must be escaped e.g. `"my-project/\\.build$"`.
|
||||
See |string-match|.
|
||||
|
@ -389,7 +384,7 @@ in
|
|||
})
|
||||
]
|
||||
)
|
||||
"30"
|
||||
30
|
||||
''
|
||||
Width of the window: can be a `%` string, a number representing columns or a table.
|
||||
A table indicates that the view should be dynamically sized based on the longest line.
|
||||
|
@ -421,13 +416,12 @@ in
|
|||
'';
|
||||
|
||||
signcolumn =
|
||||
helpers.defaultNullOpts.mkEnum
|
||||
helpers.defaultNullOpts.mkEnumFirstDefault
|
||||
[
|
||||
"yes"
|
||||
"auto"
|
||||
"no"
|
||||
]
|
||||
"yes"
|
||||
''
|
||||
Show diagnostic sign column. Value can be `"yes"`, `"auto"`, `"no"`.
|
||||
'';
|
||||
|
@ -570,13 +564,12 @@ in
|
|||
'';
|
||||
|
||||
modifiedPlacement =
|
||||
helpers.defaultNullOpts.mkEnum
|
||||
helpers.defaultNullOpts.mkEnumFirstDefault
|
||||
[
|
||||
"after"
|
||||
"before"
|
||||
"signcolumn"
|
||||
]
|
||||
"after"
|
||||
''
|
||||
Place where the modified icon will be rendered.
|
||||
Can be `"after"` or `"before"` filename (after the file/folders icons) or `"signcolumn"`
|
||||
|
@ -682,10 +675,12 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
specialFiles =
|
||||
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
|
||||
"[ \"Cargo.toml\" \"Makefile\" \"README.md\" \"readme.md\" ]"
|
||||
"A list of filenames that gets highlighted with `NvimTreeSpecialFile`.";
|
||||
specialFiles = helpers.defaultNullOpts.mkListOf types.str [
|
||||
"Cargo.toml"
|
||||
"Makefile"
|
||||
"README.md"
|
||||
"readme.md"
|
||||
] "A list of filenames that gets highlighted with `NvimTreeSpecialFile`.";
|
||||
|
||||
symlinkDestination = helpers.defaultNullOpts.mkBool true ''
|
||||
Whether to show the destination of the symlink.
|
||||
|
@ -711,13 +706,13 @@ in
|
|||
A reload or filesystem event will result in an update.
|
||||
'';
|
||||
|
||||
custom = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||
custom = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||
Custom list of vim regex for file/directory names that will not be shown.
|
||||
Backslashes must be escaped e.g. "^\\.git". See |string-match|.
|
||||
Toggle via the `toggle_custom` action, default mapping `U`.
|
||||
'';
|
||||
|
||||
exclude = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||
exclude = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||
List of directories or files to exclude from filtering: always show them.
|
||||
Overrides `git.ignore`, `filters.dotfiles` and `filters.custom`.
|
||||
'';
|
||||
|
@ -753,7 +748,7 @@ in
|
|||
Avoids hanging neovim when running this action on very large folders.
|
||||
'';
|
||||
|
||||
exclude = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
||||
exclude = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||
A list of directories that should not be expanded automatically.
|
||||
E.g `[ ".git" "target" "build" ]` etc.
|
||||
'';
|
||||
|
@ -781,29 +776,39 @@ in
|
|||
tree.
|
||||
'';
|
||||
|
||||
picker =
|
||||
helpers.defaultNullOpts.mkNullable (types.either types.str helpers.nixvimTypes.rawLua) "default"
|
||||
''
|
||||
Change the default window picker, can be a string `"default"` or a function.
|
||||
picker = helpers.defaultNullOpts.mkStr' {
|
||||
pluginDefault = "default";
|
||||
description = ''
|
||||
Change the default window picker. This can either be a string or a function (see example).
|
||||
|
||||
The function should return the window id that will open the node, or `nil` if an
|
||||
invalid window is picked or user cancelled the action.
|
||||
|
||||
This can be both a string or a function (see example below).
|
||||
picker = { __raw = "require('window-picker').pick_window"; };
|
||||
'';
|
||||
example.__raw = "require('window-picker').pick_window";
|
||||
};
|
||||
|
||||
chars = helpers.defaultNullOpts.mkStr "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" ''
|
||||
A string of chars used as identifiers by the window picker.
|
||||
'';
|
||||
|
||||
exclude =
|
||||
helpers.defaultNullOpts.mkNullable (with types; attrsOf (listOf str))
|
||||
''
|
||||
helpers.defaultNullOpts.mkAttrsOf (with types; listOf str)
|
||||
{
|
||||
filetype = [ "notify" "lazy" "packer" "qf" "diff" "fugitive" "fugitiveblame" ];
|
||||
buftype = [ "nofile" "terminal" "help" ];
|
||||
};
|
||||
''
|
||||
filetype = [
|
||||
"notify"
|
||||
"lazy"
|
||||
"packer"
|
||||
"qf"
|
||||
"diff"
|
||||
"fugitive"
|
||||
"fugitiveblame"
|
||||
];
|
||||
buftype = [
|
||||
"nofile"
|
||||
"terminal"
|
||||
"help"
|
||||
];
|
||||
}
|
||||
''
|
||||
Table of buffer option names mapped to a list of option values that indicates to
|
||||
the picker that the buffer's window should not be selectable.
|
||||
|
@ -845,7 +850,7 @@ in
|
|||
Closes the tree across all tabpages when the tree is closed.
|
||||
'';
|
||||
|
||||
ignore = helpers.defaultNullOpts.mkNullable (with types; listOf str) "[]" ''
|
||||
ignore = helpers.defaultNullOpts.mkListOf types.str [ ] ''
|
||||
List of filetypes or buffer names on new tab that will prevent
|
||||
|nvim-tree.tab.sync.open| and |nvim-tree.tab.sync.close|
|
||||
'';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue