2023-03-13 15:54:30 +01:00
|
|
|
{
|
|
|
|
lib,
|
2023-11-06 15:04:08 +01:00
|
|
|
helpers,
|
|
|
|
config,
|
|
|
|
pkgs,
|
2023-03-13 15:54:30 +01:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.plugins.neo-tree;
|
2023-05-12 14:13:26 +02:00
|
|
|
basePluginPath = ["plugins" "neo-tree"];
|
2023-03-13 15:54:30 +01:00
|
|
|
in {
|
2023-05-12 14:13:26 +02:00
|
|
|
imports = [
|
|
|
|
(
|
|
|
|
mkRemovedOptionModule
|
|
|
|
(basePluginPath ++ ["sourceSelector" "tabLabels"])
|
2024-03-07 19:44:13 +01:00
|
|
|
"Use `plugins.neo-tree.sourceSelector.sources` to achieve the same functionality."
|
2023-05-12 14:13:26 +02:00
|
|
|
)
|
2023-08-06 16:26:40 +02:00
|
|
|
(
|
|
|
|
mkRemovedOptionModule
|
|
|
|
(basePluginPath ++ ["closeFloatsOnEscapeKey"])
|
|
|
|
"This option has been removed from upstream."
|
|
|
|
)
|
2023-05-12 14:13:26 +02:00
|
|
|
];
|
2023-03-13 15:54:30 +01:00
|
|
|
options.plugins.neo-tree = let
|
|
|
|
listOfRendererComponents = with types; listOf (either str attrs);
|
|
|
|
|
|
|
|
mkRendererComponentListOption = helpers.defaultNullOpts.mkNullable listOfRendererComponents;
|
|
|
|
|
|
|
|
mkMappingsOption = defaults:
|
|
|
|
helpers.defaultNullOpts.mkNullable
|
|
|
|
(with types; attrsOf (either str attrs))
|
|
|
|
defaults
|
|
|
|
"Mapping options";
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
mkWindowMappingsOption = defaults: {
|
|
|
|
mappings = mkMappingsOption defaults;
|
|
|
|
};
|
2023-08-06 16:26:40 +02:00
|
|
|
|
|
|
|
mkFollowCurrentFileOption = default: {
|
|
|
|
enabled = helpers.defaultNullOpts.mkBool default ''
|
|
|
|
This will find and focus the file in the active buffer every time the current file is
|
|
|
|
changed while the tree is open.
|
|
|
|
'';
|
|
|
|
|
|
|
|
leaveDirsOpen = helpers.defaultNullOpts.mkBool false ''
|
|
|
|
`false` closes auto expanded dirs, such as with `:Neotree reveal`.
|
|
|
|
'';
|
|
|
|
};
|
2023-03-13 15:54:30 +01:00
|
|
|
in
|
2024-01-25 16:15:55 +01:00
|
|
|
helpers.neovim-plugin.extraOptionsOptions
|
2023-03-13 15:54:30 +01:00
|
|
|
// {
|
|
|
|
enable = mkEnableOption "neo-tree";
|
|
|
|
|
|
|
|
package = helpers.mkPackageOption "neo-tree" pkgs.vimPlugins.neo-tree-nvim;
|
|
|
|
|
|
|
|
sources =
|
|
|
|
helpers.defaultNullOpts.mkNullable (types.listOf 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.
|
|
|
|
You can also add an external source by adding it's name to this list.
|
|
|
|
The name used here must be the same name you would use in a require() call.
|
|
|
|
'';
|
|
|
|
|
2023-03-14 11:30:45 +01:00
|
|
|
extraSources = helpers.mkNullOrOption (types.listOf types.str) ''
|
|
|
|
Extra sources to be added to the sources. This is an internal nixvim option.
|
|
|
|
'';
|
|
|
|
|
2023-03-13 15:54:30 +01:00
|
|
|
addBlankLineAtTop =
|
|
|
|
helpers.defaultNullOpts.mkBool false
|
|
|
|
"Add a blank line at the top of the tree.";
|
|
|
|
|
|
|
|
autoCleanAfterSessionRestore =
|
|
|
|
helpers.defaultNullOpts.mkBool false
|
|
|
|
"Automatically clean up broken neo-tree buffers saved in sessions";
|
|
|
|
|
|
|
|
closeIfLastWindow =
|
|
|
|
helpers.defaultNullOpts.mkBool false
|
|
|
|
"Close Neo-tree if it is the last window left in the tab";
|
|
|
|
|
|
|
|
defaultSource = helpers.defaultNullOpts.mkStr "filesystem" "";
|
|
|
|
|
|
|
|
enableDiagnostics = helpers.defaultNullOpts.mkBool true "";
|
|
|
|
|
|
|
|
enableGitStatus = helpers.defaultNullOpts.mkBool true "";
|
|
|
|
|
|
|
|
enableModifiedMarkers =
|
|
|
|
helpers.defaultNullOpts.mkBool true
|
|
|
|
"Show markers for files with unsaved changes.";
|
|
|
|
|
|
|
|
enableRefreshOnWrite =
|
|
|
|
helpers.defaultNullOpts.mkBool true
|
|
|
|
"Refresh the tree when a file is written. Only used if `use_libuv_file_watcher` is false.";
|
|
|
|
|
|
|
|
gitStatusAsync = helpers.defaultNullOpts.mkBool true "";
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
gitStatusAsyncOptions = {
|
|
|
|
batchSize =
|
|
|
|
helpers.defaultNullOpts.mkInt 1000
|
|
|
|
"How many lines of git status results to process at a time";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
batchDelay =
|
|
|
|
helpers.defaultNullOpts.mkInt 10
|
|
|
|
"delay in ms between batches. Spreads out the workload to let other processes run.";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
maxLines =
|
|
|
|
helpers.defaultNullOpts.mkInt 10000
|
|
|
|
''
|
|
|
|
How many lines of git status results to process. Anything after this will be dropped.
|
|
|
|
Anything before this will be used.
|
|
|
|
The last items to be processed are the untracked files.
|
|
|
|
'';
|
|
|
|
};
|
2023-03-13 15:54:30 +01:00
|
|
|
|
|
|
|
hideRootNode = helpers.defaultNullOpts.mkBool false "Hide the root node.";
|
|
|
|
|
|
|
|
retainHiddenRootIndent =
|
|
|
|
helpers.defaultNullOpts.mkBool false
|
|
|
|
''
|
|
|
|
If the root node is hidden, keep the indentation anyhow.
|
|
|
|
This is needed if you use expanders because they render in the indent.
|
|
|
|
'';
|
|
|
|
|
|
|
|
logLevel =
|
|
|
|
helpers.defaultNullOpts.mkEnum
|
|
|
|
["trace" "debug" "info" "warn" "error" "fatal"] "info" "";
|
|
|
|
|
|
|
|
logToFile =
|
|
|
|
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
|
|
|
|
["NC" "double" "none" "rounded" "shadow" "single" "solid"] "NC" "";
|
|
|
|
|
|
|
|
resizeTimerInterval =
|
|
|
|
helpers.defaultNullOpts.mkInt 500
|
|
|
|
''
|
|
|
|
In ms, needed for containers to redraw right aligned and faded content.
|
|
|
|
Set to -1 to disable the resize timer entirely.
|
|
|
|
|
|
|
|
NOTE: this will speed up to 50 ms for 1 second following a resize
|
|
|
|
'';
|
|
|
|
|
|
|
|
sortCaseInsensitive =
|
|
|
|
helpers.defaultNullOpts.mkBool false
|
|
|
|
"Used when sorting files and directories in the tree";
|
|
|
|
|
|
|
|
sortFunction =
|
2023-12-29 15:24:42 +01:00
|
|
|
helpers.defaultNullOpts.mkLuaFn "nil"
|
2023-03-13 15:54:30 +01:00
|
|
|
"Uses a custom function for sorting files and directories in the tree";
|
|
|
|
|
|
|
|
usePopupsForInput =
|
|
|
|
helpers.defaultNullOpts.mkBool true
|
|
|
|
"If false, inputs will use vim.ui.input() instead of custom floats.";
|
|
|
|
|
|
|
|
useDefaultMappings = helpers.defaultNullOpts.mkBool true "";
|
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
# sourceSelector provides clickable tabs to switch between sources."
|
|
|
|
sourceSelector = {
|
|
|
|
winbar =
|
|
|
|
helpers.defaultNullOpts.mkBool false
|
|
|
|
"toggle to show selector on winbar";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
statusline =
|
|
|
|
helpers.defaultNullOpts.mkBool false
|
|
|
|
"toggle to show selector on statusline";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
showScrolledOffParentNode = helpers.defaultNullOpts.mkBool false ''
|
|
|
|
If `true`, tabs are replaced with the parent path of the top visible node when
|
|
|
|
scrolled down.
|
|
|
|
'';
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
sources =
|
|
|
|
helpers.mkNullOrOption
|
|
|
|
(
|
|
|
|
with types;
|
|
|
|
listOf
|
|
|
|
(submodule {
|
|
|
|
options = {
|
|
|
|
source = mkOption {
|
|
|
|
type = str;
|
|
|
|
description = "Name of the source to add to the bar.";
|
|
|
|
};
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
displayName = helpers.mkNullOrOption str "How that source to appear in the bar.";
|
|
|
|
};
|
|
|
|
})
|
|
|
|
)
|
|
|
|
"Configure the characters shown on each tab.";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
contentLayout =
|
|
|
|
helpers.defaultNullOpts.mkEnumFirstDefault ["start" "end" "focus"]
|
|
|
|
''
|
|
|
|
Defines how the labels are placed inside a tab.
|
|
|
|
This only takes effect when the tab width is greater than the length of label i.e.
|
|
|
|
`tabsLayout = "equal", "focus"` or when `tabsMinWidth` is large enough.
|
|
|
|
|
|
|
|
Following options are available.
|
|
|
|
"start" : left aligned / 裡 bufname \/..
|
|
|
|
"end" : right aligned / 裡 bufname \/...
|
|
|
|
"center" : centered with equal padding / 裡 bufname \/...
|
|
|
|
'';
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
tabsLayout =
|
|
|
|
helpers.defaultNullOpts.mkEnum
|
|
|
|
["start" "end" "center" "equal" "focus"]
|
|
|
|
"equal"
|
|
|
|
''
|
|
|
|
Defines how the tabs are aligned inside the window when there is more than enough
|
|
|
|
space.
|
|
|
|
The following options are available.
|
|
|
|
`active` will expand the focused tab as much as possible. Bars denote the edge of window.
|
|
|
|
|
|
|
|
"start" : left aligned ┃/ ~ \/ ~ \/ ~ \ ┃
|
|
|
|
"end" : right aligned ┃ / ~ \/ ~ \/ ~ \┃
|
|
|
|
"center" : centered with equal padding ┃ / ~ \/ ~ \/ ~ \ ┃
|
|
|
|
"equal" : expand all tabs equally to fit the window width ┃/ ~ \/ ~ \/ ~ \┃
|
|
|
|
"active" : expand the focused tab to fit the window width ┃/ focused tab \/ ~ \/ ~ \┃
|
|
|
|
'';
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
truncationCharacter =
|
|
|
|
helpers.defaultNullOpts.mkStr "…"
|
|
|
|
"Character to use when truncating the tab label";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
tabsMinWidth =
|
|
|
|
helpers.defaultNullOpts.mkNullable types.int "null"
|
|
|
|
"If int padding is added based on `contentLayout`";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
tabsMaxWidth =
|
|
|
|
helpers.defaultNullOpts.mkNullable types.int "null"
|
|
|
|
"This will truncate text even if `textTruncToFit = false`";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
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; }`.
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
Example: `{ left = 2; right = 0; }`
|
|
|
|
'';
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
separator =
|
|
|
|
helpers.defaultNullOpts.mkNullable
|
|
|
|
(
|
|
|
|
with types;
|
|
|
|
either str (submodule {
|
|
|
|
options = {
|
|
|
|
left = helpers.defaultNullOpts.mkStr "▏" "";
|
|
|
|
right = helpers.defaultNullOpts.mkStr "\\" "";
|
|
|
|
override = helpers.defaultNullOpts.mkStr null "";
|
|
|
|
};
|
|
|
|
})
|
|
|
|
)
|
|
|
|
"Can be a string or a table"
|
|
|
|
''{ left = "▏"; right= "▕"; }'';
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
separatorActive =
|
|
|
|
helpers.defaultNullOpts.mkNullable
|
|
|
|
(
|
|
|
|
with types;
|
|
|
|
either str (submodule {
|
|
|
|
options = {
|
|
|
|
left = helpers.mkNullOrOption types.str "";
|
|
|
|
right = helpers.mkNullOrOption types.str "";
|
|
|
|
override = helpers.mkNullOrOption types.str "";
|
|
|
|
};
|
|
|
|
})
|
|
|
|
)
|
|
|
|
''
|
|
|
|
Set separators around the active tab.
|
|
|
|
null falls back to `sourceSelector.separator`.
|
|
|
|
''
|
|
|
|
"null";
|
2023-03-14 15:22:19 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
showSeparatorOnEdge =
|
|
|
|
helpers.defaultNullOpts.mkBool false
|
|
|
|
''
|
|
|
|
Takes a boolean value where `false` (default) hides the separators on the far
|
|
|
|
left / right.
|
|
|
|
Especially useful when left and right separator are the same.
|
|
|
|
|
|
|
|
'true' : ┃/ ~ \/ ~ \/ ~ \┃
|
|
|
|
'false' : ┃ ~ \/ ~ \/ ~ ┃
|
|
|
|
'';
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
highlightTab = helpers.defaultNullOpts.mkStr "NeoTreeTabInactive" "";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
highlightTabActive = helpers.defaultNullOpts.mkStr "NeoTreeTabActive" "";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
highlightBackground = helpers.defaultNullOpts.mkStr "NeoTreeTabInactive" "";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
highlightSeparator = helpers.defaultNullOpts.mkStr "NeoTreeTabSeparatorInactive" "";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-05-12 14:13:26 +02:00
|
|
|
highlightSeparatorActive = helpers.defaultNullOpts.mkStr "NeoTreeTabSeparatorActive" "";
|
|
|
|
};
|
2023-03-13 15:54:30 +01:00
|
|
|
eventHandlers =
|
|
|
|
helpers.mkNullOrOption
|
2023-11-23 16:25:30 +01:00
|
|
|
(with types; attrsOf str)
|
2023-03-13 15:54:30 +01:00
|
|
|
''
|
|
|
|
Configuration of event handlers.
|
|
|
|
Attrs:
|
|
|
|
- keys are the events (e.g. `before_render`, `file_opened`)
|
|
|
|
- values are lua code defining the callback function.
|
|
|
|
|
|
|
|
Example:
|
2023-08-07 13:18:01 +03:30
|
|
|
```nix
|
2023-03-13 15:54:30 +01:00
|
|
|
{
|
|
|
|
before_render = \'\'
|
|
|
|
function (state)
|
|
|
|
-- add something to the state that can be used by custom components
|
|
|
|
end
|
|
|
|
\'\';
|
|
|
|
|
|
|
|
file_opened = \'\'
|
|
|
|
function(file_path)
|
|
|
|
--auto close
|
|
|
|
require("neo-tree").close_all()
|
|
|
|
end
|
|
|
|
\'\';
|
|
|
|
}
|
|
|
|
```
|
|
|
|
'';
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
defaultComponentConfigs = {
|
|
|
|
container = {
|
2023-03-13 15:54:30 +01:00
|
|
|
enableCharacterFade = helpers.defaultNullOpts.mkBool true "";
|
|
|
|
|
|
|
|
width = helpers.defaultNullOpts.mkStr "100%" "";
|
|
|
|
|
|
|
|
rightPadding = helpers.defaultNullOpts.mkInt 0 "";
|
|
|
|
};
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
diagnostics = {
|
|
|
|
symbols = {
|
2023-03-13 15:54:30 +01:00
|
|
|
hint = helpers.defaultNullOpts.mkStr "H" "";
|
|
|
|
|
|
|
|
info = helpers.defaultNullOpts.mkStr "I" "";
|
|
|
|
|
|
|
|
warn = helpers.defaultNullOpts.mkStr "!" "";
|
|
|
|
|
|
|
|
error = helpers.defaultNullOpts.mkStr "X" "";
|
|
|
|
};
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
highlights = {
|
2023-03-13 15:54:30 +01:00
|
|
|
hint = helpers.defaultNullOpts.mkStr "DiagnosticSignHint" "";
|
|
|
|
|
|
|
|
info = helpers.defaultNullOpts.mkStr "DiagnosticSignInfo" "";
|
|
|
|
|
|
|
|
warn = helpers.defaultNullOpts.mkStr "DiagnosticSignWarn" "";
|
|
|
|
|
|
|
|
error = helpers.defaultNullOpts.mkStr "DiagnosticSignError" "";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
indent = {
|
2023-03-13 15:54:30 +01:00
|
|
|
indentSize = helpers.defaultNullOpts.mkInt 2 "";
|
|
|
|
|
|
|
|
padding = helpers.defaultNullOpts.mkInt 1 "";
|
|
|
|
|
|
|
|
withMarkers = helpers.defaultNullOpts.mkBool true "";
|
|
|
|
|
|
|
|
indentMarker = helpers.defaultNullOpts.mkStr "│" "";
|
|
|
|
|
|
|
|
lastIndentMarker = helpers.defaultNullOpts.mkStr "└" "";
|
|
|
|
|
|
|
|
highlight = helpers.defaultNullOpts.mkStr "NeoTreeIndentMarker" "";
|
|
|
|
|
|
|
|
withExpanders =
|
|
|
|
helpers.defaultNullOpts.mkNullable types.bool "null"
|
|
|
|
"If null and file nesting is enabled, will enable expanders.";
|
|
|
|
|
|
|
|
expanderCollapsed = helpers.defaultNullOpts.mkStr "" "";
|
|
|
|
|
|
|
|
expanderExpanded = helpers.defaultNullOpts.mkStr "" "";
|
|
|
|
|
|
|
|
expanderHighlight = helpers.defaultNullOpts.mkStr "NeoTreeExpander" "";
|
|
|
|
};
|
|
|
|
|
|
|
|
icon = {
|
|
|
|
folderClosed = helpers.defaultNullOpts.mkStr "" "";
|
|
|
|
|
|
|
|
folderOpen = helpers.defaultNullOpts.mkStr "" "";
|
|
|
|
|
|
|
|
folderEmpty = helpers.defaultNullOpts.mkStr "ﰊ" "";
|
|
|
|
|
|
|
|
folderEmptyOpen = helpers.defaultNullOpts.mkStr "ﰊ" "";
|
|
|
|
|
|
|
|
default = helpers.defaultNullOpts.mkStr "*" ''
|
|
|
|
Only a fallback, if you use nvim-web-devicons and configure default icons there
|
|
|
|
then this will never be used.
|
|
|
|
'';
|
|
|
|
|
|
|
|
highlight = helpers.defaultNullOpts.mkStr "NeoTreeFileIcon" ''
|
|
|
|
Only a fallback, if you use nvim-web-devicons and configure default icons there
|
|
|
|
then this will never be used.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
modified = {
|
2023-03-13 15:54:30 +01:00
|
|
|
symbol = helpers.defaultNullOpts.mkStr "[+] " "";
|
|
|
|
|
|
|
|
highlight = helpers.defaultNullOpts.mkStr "NeoTreeModified" "";
|
|
|
|
};
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
name = {
|
2023-03-13 15:54:30 +01:00
|
|
|
trailingSlash = helpers.defaultNullOpts.mkBool false "";
|
|
|
|
|
|
|
|
useGitStatusColors = helpers.defaultNullOpts.mkBool true "";
|
|
|
|
|
|
|
|
highlight = helpers.defaultNullOpts.mkStr "NeoTreeFileName" "";
|
|
|
|
};
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
gitStatus = {
|
2023-03-13 15:54:30 +01:00
|
|
|
symbols =
|
2023-11-23 16:25:30 +01:00
|
|
|
mapAttrs
|
2023-03-13 15:54:30 +01:00
|
|
|
(
|
2023-11-23 16:25:30 +01:00
|
|
|
optionName: default:
|
|
|
|
helpers.defaultNullOpts.mkStr default optionName
|
|
|
|
)
|
|
|
|
{
|
|
|
|
added = "✚";
|
|
|
|
deleted = "✖";
|
|
|
|
modified = "";
|
|
|
|
renamed = "";
|
|
|
|
untracked = "";
|
|
|
|
ignored = "";
|
|
|
|
unstaged = "";
|
|
|
|
staged = "";
|
|
|
|
conflict = "";
|
|
|
|
};
|
2023-03-13 15:54:30 +01:00
|
|
|
|
|
|
|
align = helpers.defaultNullOpts.mkStr "right" "icon alignment";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
renderers = {
|
2023-03-13 15:54:30 +01:00
|
|
|
directory =
|
|
|
|
mkRendererComponentListOption
|
|
|
|
''
|
|
|
|
[
|
|
|
|
"indent"
|
|
|
|
"icon"
|
|
|
|
"current_filter"
|
|
|
|
{
|
|
|
|
name = "container";
|
|
|
|
content = [
|
|
|
|
{
|
|
|
|
name = "name";
|
|
|
|
zindex = 10;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "clipboard";
|
|
|
|
zindex = 10;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "diagnostics";
|
|
|
|
errors_only = true;
|
|
|
|
zindex = 20;
|
|
|
|
align = "right";
|
|
|
|
hide_when_expanded = true;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "git_status";
|
|
|
|
zindex = 20;
|
|
|
|
align = "right";
|
|
|
|
hide_when_expanded = true;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
]
|
|
|
|
''
|
|
|
|
"directory renderers";
|
|
|
|
|
|
|
|
file =
|
|
|
|
mkRendererComponentListOption
|
|
|
|
''
|
|
|
|
[
|
|
|
|
"indent"
|
|
|
|
"icon"
|
|
|
|
{
|
|
|
|
name = "container";
|
|
|
|
content = [
|
|
|
|
{
|
|
|
|
name = "name";
|
|
|
|
zindex = 10;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "clipboard";
|
|
|
|
zindex = 10;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "bufnr";
|
|
|
|
zindex = 10;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "modified";
|
|
|
|
zindex = 20;
|
|
|
|
align = "right";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "diagnostics";
|
|
|
|
zindex = 20;
|
|
|
|
align = "right";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "git_status";
|
|
|
|
zindex = 20;
|
|
|
|
align = "right";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
]
|
|
|
|
''
|
|
|
|
"file renderers";
|
|
|
|
|
|
|
|
message =
|
|
|
|
mkRendererComponentListOption
|
|
|
|
''
|
|
|
|
[
|
|
|
|
{
|
|
|
|
name = "indent";
|
|
|
|
with_markers = false;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "name";
|
|
|
|
highlight = "NeoTreeMessage";
|
|
|
|
}
|
|
|
|
]
|
|
|
|
''
|
|
|
|
"message renderers";
|
|
|
|
|
|
|
|
terminal =
|
|
|
|
mkRendererComponentListOption
|
|
|
|
''
|
|
|
|
[
|
|
|
|
"indent"
|
|
|
|
"icon"
|
|
|
|
"name"
|
|
|
|
"bufnr"
|
|
|
|
]
|
|
|
|
''
|
|
|
|
"message renderers";
|
|
|
|
};
|
|
|
|
|
|
|
|
nestingRules =
|
|
|
|
helpers.defaultNullOpts.mkNullable (types.attrsOf types.str) "{}"
|
|
|
|
"nesting rules";
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
window = {
|
|
|
|
position =
|
|
|
|
helpers.defaultNullOpts.mkEnum
|
|
|
|
["left" "right" "top" "bottom" "float" "current"] "left" "position";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
width = helpers.defaultNullOpts.mkInt 40 "Applies to left and right positions";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
height = helpers.defaultNullOpts.mkInt 15 "Applies to top and bottom positions";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
autoExpandWidth =
|
|
|
|
helpers.defaultNullOpts.mkBool false
|
|
|
|
''
|
|
|
|
Expand the window when file exceeds the window width. does not work with
|
|
|
|
position = "float"
|
|
|
|
'';
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
popup = {
|
|
|
|
size = {
|
|
|
|
height = helpers.defaultNullOpts.mkStr "80%" "height";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
width = helpers.defaultNullOpts.mkStr "50%" "height";
|
2023-03-13 15:54:30 +01:00
|
|
|
};
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
position = helpers.defaultNullOpts.mkStr "80%" ''
|
|
|
|
50% means center it.
|
|
|
|
You can also specify border here, if you want a different setting from the global
|
|
|
|
`popupBorderStyle`.
|
2023-03-13 15:54:30 +01:00
|
|
|
'';
|
2023-11-23 16:25:30 +01:00
|
|
|
};
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
sameLevel = helpers.defaultNullOpts.mkBool false ''
|
|
|
|
Create and paste/move files/directories on the same level as the directory under cursor
|
|
|
|
(as opposed to within the directory under cursor).
|
|
|
|
'';
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
insertAs = helpers.defaultNullOpts.mkEnumFirstDefault ["child" "sibling"] ''
|
|
|
|
Affects how nodes get inserted into the tree during creation/pasting/moving of files if
|
|
|
|
the node under the cursor is a directory:
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
- "child": Insert nodes as children of the directory under cursor.
|
|
|
|
- "sibling": Insert nodes as siblings of the directory under cursor.
|
|
|
|
'';
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
mappingOptions = {
|
|
|
|
noremap = helpers.defaultNullOpts.mkBool true "noremap";
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
nowait = helpers.defaultNullOpts.mkBool true "nowait";
|
2023-03-13 15:54:30 +01:00
|
|
|
};
|
2023-11-23 16:25:30 +01:00
|
|
|
|
|
|
|
mappings =
|
|
|
|
mkMappingsOption
|
|
|
|
''
|
|
|
|
```nix
|
|
|
|
{
|
|
|
|
"<space>" = {
|
|
|
|
command = "toggle_node";
|
|
|
|
# disable `nowait` if you have existing combos starting with this char that you want to use
|
|
|
|
nowait = false;
|
|
|
|
};
|
|
|
|
"<2-LeftMouse>" = "open";
|
|
|
|
"<cr>" = "open";
|
|
|
|
"<esc>" = "revert_preview";
|
|
|
|
P = {
|
|
|
|
command = "toggle_preview";
|
|
|
|
config = { use_float = true; };
|
|
|
|
};
|
|
|
|
l = "focus_preview";
|
|
|
|
S = "open_split";
|
|
|
|
# S = "split_with_window_picker";
|
|
|
|
s = "open_vsplit";
|
|
|
|
# s = "vsplit_with_window_picker";
|
|
|
|
t = "open_tabnew";
|
|
|
|
# "<cr>" = "open_drop";
|
|
|
|
# t = "open_tab_drop";
|
|
|
|
w = "open_with_window_picker";
|
|
|
|
C = "close_node";
|
|
|
|
z = "close_all_nodes";
|
|
|
|
# Z = "expand_all_nodes";
|
|
|
|
R = "refresh";
|
|
|
|
a = {
|
|
|
|
command = "add";
|
|
|
|
# some commands may take optional config options, see `:h neo-tree-mappings` for details
|
|
|
|
config = {
|
|
|
|
show_path = "none"; # "none", "relative", "absolute"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
A = "add_directory"; # also accepts the config.show_path and config.insert_as options.
|
|
|
|
d = "delete";
|
|
|
|
r = "rename";
|
|
|
|
y = "copy_to_clipboard";
|
|
|
|
x = "cut_to_clipboard";
|
|
|
|
p = "paste_from_clipboard";
|
|
|
|
c = "copy"; # takes text input for destination, also accepts the config.show_path and config.insert_as options
|
|
|
|
m = "move"; # takes text input for destination, also accepts the config.show_path and config.insert_as options
|
|
|
|
e = "toggle_auto_expand_width";
|
|
|
|
q = "close_window";
|
|
|
|
"?" = "show_help";
|
|
|
|
"<" = "prev_source";
|
|
|
|
">" = "next_source";
|
|
|
|
}
|
|
|
|
```
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
filesystem = {
|
2023-06-26 08:51:36 +02:00
|
|
|
window = mkWindowMappingsOption (lib.mdDoc ''
|
2023-08-07 13:18:01 +03:30
|
|
|
```nix
|
2023-06-26 08:51:36 +02:00
|
|
|
{
|
|
|
|
H = "toggle_hidden";
|
|
|
|
"/" = "fuzzy_finder";
|
|
|
|
D = "fuzzy_finder_directory";
|
|
|
|
# "/" = "filter_as_you_type"; # this was the default until v1.28
|
|
|
|
"#" = "fuzzy_sorter"; # fuzzy sorting using the fzy algorithm
|
|
|
|
# D = "fuzzy_sorter_directory";
|
|
|
|
f = "filter_on_submit";
|
|
|
|
"<C-x>" = "clear_filter";
|
|
|
|
"<bs>" = "navigate_up";
|
|
|
|
"." = "set_root";
|
|
|
|
"[g" = "prev_git_modified";
|
|
|
|
"]g" = "next_git_modified";
|
|
|
|
}
|
|
|
|
```
|
|
|
|
'');
|
2023-03-13 15:54:30 +01:00
|
|
|
asyncDirectoryScan = helpers.defaultNullOpts.mkEnumFirstDefault ["auto" "always" "never"] ''
|
|
|
|
- "auto" means refreshes are async, but it's synchronous when called from the Neotree
|
|
|
|
commands.
|
|
|
|
- "always" means directory scans are always async.
|
|
|
|
- "never" means directory scans are never async.
|
|
|
|
'';
|
|
|
|
|
|
|
|
scanMode = helpers.defaultNullOpts.mkEnumFirstDefault ["shallow" "deep"] ''
|
|
|
|
- "shallow": Don't scan into directories to detect possible empty directory a priori.
|
|
|
|
- "deep": Scan into directories to detect empty or grouped empty directories a priori.
|
|
|
|
'';
|
|
|
|
|
|
|
|
bindToCwd =
|
|
|
|
helpers.defaultNullOpts.mkBool true
|
|
|
|
"true creates a 2-way binding between vim's cwd and neo-tree's root.";
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
cwdTarget = {
|
2023-03-13 15:54:30 +01:00
|
|
|
sidebar = helpers.defaultNullOpts.mkStr "tab" "sidebar is when position = left or right";
|
|
|
|
current = helpers.defaultNullOpts.mkStr "window" "current is when position = current";
|
|
|
|
};
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
filteredItems = {
|
2023-03-13 15:54:30 +01:00
|
|
|
visible =
|
|
|
|
helpers.defaultNullOpts.mkBool false
|
|
|
|
"when true, they will just be displayed differently than normal items";
|
|
|
|
|
|
|
|
forceVisibleInEmptyFolder =
|
|
|
|
helpers.defaultNullOpts.mkBool false
|
|
|
|
"when true, hidden files will be shown if the root folder is otherwise empty";
|
|
|
|
|
|
|
|
showHiddenCount =
|
|
|
|
helpers.defaultNullOpts.mkBool true
|
|
|
|
"when true, the number of hidden items in each folder will be shown as the last entry";
|
|
|
|
|
|
|
|
hideDotfiles = helpers.defaultNullOpts.mkBool true "hide dotfiles";
|
|
|
|
|
|
|
|
hideGitignored = helpers.defaultNullOpts.mkBool true "hide gitignored files";
|
|
|
|
|
|
|
|
hideHidden =
|
|
|
|
helpers.defaultNullOpts.mkBool true
|
|
|
|
"only works on Windows for hidden files/directories";
|
|
|
|
|
|
|
|
hideByName =
|
2023-06-26 08:51:36 +02:00
|
|
|
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
|
|
|
|
''[".DS_Store" "thumbs.db"]''
|
2023-03-13 15:54:30 +01:00
|
|
|
"hide by name";
|
|
|
|
|
2023-06-26 08:51:36 +02:00
|
|
|
hideByPattern = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
|
|
|
Hide by pattern.
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-06-26 08:51:36 +02:00
|
|
|
Example:
|
2023-08-07 13:18:01 +03:30
|
|
|
```nix
|
2023-03-13 15:54:30 +01:00
|
|
|
[
|
2023-06-26 08:51:36 +02:00
|
|
|
"*.meta"
|
|
|
|
"*/src/*/tsconfig.json"
|
2023-03-13 15:54:30 +01:00
|
|
|
]
|
2023-06-26 08:51:36 +02:00
|
|
|
```
|
|
|
|
'';
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-06-26 08:51:36 +02:00
|
|
|
alwaysShow = helpers.defaultNullOpts.mkNullable (types.listOf types.str) "[]" ''
|
|
|
|
Files/folders to always show.
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-06-26 08:51:36 +02:00
|
|
|
Example: `[".gitignore"]`
|
|
|
|
'';
|
|
|
|
|
|
|
|
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_*"]`
|
|
|
|
'';
|
2023-03-13 15:54:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
findByFullPathWords = helpers.defaultNullOpts.mkBool false ''
|
|
|
|
`false` means it only searches the tail of a path.
|
|
|
|
`true` will change the filter into a full path
|
|
|
|
|
|
|
|
search with space as an implicit ".*", so `fi init` will match:
|
|
|
|
`./sources/filesystem/init.lua
|
|
|
|
'';
|
|
|
|
|
|
|
|
findCommand =
|
|
|
|
helpers.defaultNullOpts.mkStr "fd"
|
|
|
|
"This is determined automatically, you probably don't need to set it";
|
|
|
|
|
|
|
|
findArgs =
|
2024-01-02 00:30:10 +01:00
|
|
|
helpers.mkNullOrStrLuaFnOr
|
|
|
|
(types.submodule {
|
2023-03-13 15:54:30 +01:00
|
|
|
options = {
|
|
|
|
fd =
|
|
|
|
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
|
|
|
|
''
|
|
|
|
[
|
|
|
|
"--exclude"
|
|
|
|
".git"
|
|
|
|
"--exclude"
|
|
|
|
"node_modules"
|
|
|
|
]
|
|
|
|
''
|
|
|
|
"You can specify extra args to pass to the find command.";
|
|
|
|
};
|
2024-01-02 00:30:10 +01:00
|
|
|
})
|
2023-03-13 15:54:30 +01:00
|
|
|
''
|
|
|
|
Find arguments
|
|
|
|
|
|
|
|
Either use a list of strings:
|
|
|
|
|
2023-08-07 13:18:01 +03:30
|
|
|
```nix
|
2023-03-13 15:54:30 +01:00
|
|
|
findArgs = {
|
|
|
|
fd = [
|
|
|
|
"--exclude"
|
|
|
|
".git"
|
|
|
|
"--exclude"
|
|
|
|
"node_modules"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
```
|
|
|
|
|
|
|
|
Or use a function instead of list of strings
|
|
|
|
```
|
|
|
|
findArgs = \'\'
|
|
|
|
find_args = function(cmd, path, search_term, args)
|
|
|
|
if cmd ~= "fd" then
|
|
|
|
return args
|
|
|
|
end
|
|
|
|
--maybe you want to force the filter to always include hidden files:
|
|
|
|
table.insert(args, "--hidden")
|
|
|
|
-- but no one ever wants to see .git files
|
|
|
|
table.insert(args, "--exclude")
|
|
|
|
table.insert(args, ".git")
|
|
|
|
-- or node_modules
|
|
|
|
table.insert(args, "--exclude")
|
|
|
|
table.insert(args, "node_modules")
|
|
|
|
--here is where it pays to use the function, you can exclude more for
|
|
|
|
--short search terms, or vary based on the directory
|
|
|
|
if string.len(search_term) < 4 and path == "/home/cseickel" then
|
|
|
|
table.insert(args, "--exclude")
|
|
|
|
table.insert(args, "Library")
|
|
|
|
end
|
|
|
|
return args
|
|
|
|
end
|
|
|
|
\'\';
|
|
|
|
```
|
|
|
|
'';
|
|
|
|
|
|
|
|
groupEmptyDirs =
|
|
|
|
helpers.defaultNullOpts.mkBool false
|
|
|
|
"when true, empty folders will be grouped together";
|
|
|
|
|
|
|
|
searchLimit =
|
|
|
|
helpers.defaultNullOpts.mkInt 50
|
|
|
|
"max number of search results when using filters";
|
|
|
|
|
2023-08-06 16:26:40 +02:00
|
|
|
followCurrentFile = mkFollowCurrentFileOption false;
|
2023-03-13 15:54:30 +01:00
|
|
|
|
|
|
|
hijackNetrwBehavior =
|
|
|
|
helpers.defaultNullOpts.mkEnumFirstDefault
|
|
|
|
["open_default" "open_current" "disabled"]
|
|
|
|
''
|
|
|
|
- "open_default": netrw disabled, opening a directory opens neo-tree in whatever
|
|
|
|
position is specified in window.position
|
|
|
|
- "open_current": netrw disabled, opening a directory opens within the window like netrw
|
|
|
|
would, regardless of window.position
|
|
|
|
- "disabled": netrw left alone, neo-tree does not handle opening dirs
|
|
|
|
'';
|
|
|
|
|
|
|
|
useLibuvFileWatcher = helpers.defaultNullOpts.mkBool false ''
|
|
|
|
This will use the OS level file watchers to detect changes instead of relying on nvim
|
|
|
|
autocmd events.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
buffers = {
|
2023-03-13 15:54:30 +01:00
|
|
|
bindToCwd = helpers.defaultNullOpts.mkBool true "Bind to current working directory.";
|
|
|
|
|
2023-08-06 16:26:40 +02:00
|
|
|
followCurrentFile = mkFollowCurrentFileOption true;
|
2023-03-13 15:54:30 +01:00
|
|
|
|
|
|
|
groupEmptyDirs =
|
|
|
|
helpers.defaultNullOpts.mkBool true
|
|
|
|
"When true, empty directories will be grouped together.";
|
|
|
|
|
|
|
|
window = mkWindowMappingsOption ''
|
|
|
|
{
|
|
|
|
"<bs>" = "navigate_up";
|
|
|
|
"." = "set_root";
|
|
|
|
bd = "buffer_delete";
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
gitStatus = {
|
2023-03-13 15:54:30 +01:00
|
|
|
window = mkWindowMappingsOption ''
|
|
|
|
{
|
|
|
|
A = "git_add_all";
|
|
|
|
gu = "git_unstage_file";
|
|
|
|
ga = "git_add_file";
|
|
|
|
gr = "git_revert_file";
|
|
|
|
gc = "git_commit";
|
|
|
|
gp = "git_push";
|
|
|
|
gg = "git_commit_and_push";
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
example = {
|
|
|
|
renderers = {
|
2023-03-13 15:54:30 +01:00
|
|
|
custom =
|
|
|
|
mkRendererComponentListOption
|
|
|
|
''
|
|
|
|
[
|
|
|
|
"indent"
|
|
|
|
{
|
|
|
|
name = "icon";
|
|
|
|
default = "C";
|
|
|
|
}
|
|
|
|
"custom"
|
|
|
|
"name"
|
|
|
|
]
|
|
|
|
''
|
|
|
|
"custom renderers";
|
|
|
|
};
|
|
|
|
|
|
|
|
window = mkWindowMappingsOption ''
|
|
|
|
{
|
|
|
|
"<cr>" = "toggle_node";
|
|
|
|
"<C-e>" = "example_command";
|
|
|
|
d = "show_debug_info";
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
2023-05-12 14:13:41 +02:00
|
|
|
|
|
|
|
documentSymbols = {
|
|
|
|
followCursor =
|
|
|
|
helpers.defaultNullOpts.mkBool false
|
|
|
|
"If set to `true`, will automatically focus on the symbol under the cursor.";
|
|
|
|
|
|
|
|
kinds =
|
|
|
|
helpers.mkNullOrOption
|
|
|
|
(
|
|
|
|
with types;
|
|
|
|
attrsOf (submodule {
|
|
|
|
options = {
|
|
|
|
icon = mkOption {
|
|
|
|
description = "Icon for this LSP kind.";
|
|
|
|
type = types.str;
|
|
|
|
example = "";
|
|
|
|
};
|
|
|
|
hl = mkOption {
|
|
|
|
description = "Highlight group for this LSP kind.";
|
|
|
|
type = types.str;
|
|
|
|
example = "Include";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|
|
|
|
)
|
|
|
|
''
|
|
|
|
An attrs specifying how LSP kinds should be rendered.
|
|
|
|
Each entry should map the LSP kind name to an icon and a highlight group, for example
|
|
|
|
`Class = { icon = ""; hl = "Include"; }`
|
|
|
|
'';
|
|
|
|
|
|
|
|
customKinds = mkOption {
|
|
|
|
type = with types; attrsOf str;
|
|
|
|
default = {};
|
|
|
|
example = {
|
|
|
|
"252" = "TypeAlias";
|
|
|
|
};
|
|
|
|
description = ''
|
|
|
|
A table mapping the LSP kind id (an integer) to the LSP kind name that is used for
|
|
|
|
`kinds`.
|
|
|
|
|
|
|
|
For the list of kinds (id and name), please refer to
|
|
|
|
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentSymbol
|
|
|
|
'';
|
|
|
|
};
|
2023-11-22 10:30:45 -03:00
|
|
|
window = mkWindowMappingsOption "{}";
|
2023-05-12 14:13:41 +02:00
|
|
|
};
|
2023-03-13 15:54:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
config = let
|
|
|
|
inherit (helpers) ifNonNull' mkRaw;
|
|
|
|
|
|
|
|
processRendererComponent = component:
|
|
|
|
if isString component
|
|
|
|
then [component]
|
|
|
|
else
|
|
|
|
(mapAttrs' (
|
|
|
|
name: value: {
|
|
|
|
name =
|
|
|
|
if name == "name"
|
2023-10-09 08:50:21 -05:00
|
|
|
then "__unkeyed"
|
2023-03-13 15:54:30 +01:00
|
|
|
else name;
|
|
|
|
value =
|
|
|
|
if isList value
|
|
|
|
then processRendererComponentList value
|
|
|
|
else value;
|
|
|
|
}
|
|
|
|
)
|
|
|
|
component);
|
|
|
|
|
|
|
|
processRendererComponentList = componentList:
|
|
|
|
ifNonNull' componentList
|
|
|
|
(map processRendererComponent componentList);
|
|
|
|
|
|
|
|
processMapping = key: action:
|
|
|
|
if isString action
|
|
|
|
then action
|
|
|
|
else
|
|
|
|
mapAttrs' (k: v: {
|
|
|
|
name =
|
|
|
|
if k == "command"
|
2023-10-09 08:50:21 -05:00
|
|
|
then "__unkeyed"
|
2023-03-13 15:54:30 +01:00
|
|
|
else k;
|
|
|
|
value = v;
|
|
|
|
})
|
|
|
|
action;
|
|
|
|
|
|
|
|
processMappings = mappings:
|
|
|
|
ifNonNull' mappings
|
|
|
|
(mapAttrs processMapping mappings);
|
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
processWindowMappings = window: {
|
|
|
|
mappings = processMappings window.mappings;
|
|
|
|
};
|
2023-03-13 15:54:30 +01:00
|
|
|
|
2023-11-23 16:25:30 +01:00
|
|
|
setupOptions = with cfg;
|
2023-03-13 15:54:30 +01:00
|
|
|
{
|
2023-03-14 11:30:45 +01:00
|
|
|
# Concatenate sources and extraSources, setting sources to it's default value if it is null
|
|
|
|
# and extraSources is not null
|
|
|
|
sources =
|
2023-11-23 16:25:30 +01:00
|
|
|
if (extraSources != null)
|
2023-03-14 11:30:45 +01:00
|
|
|
then
|
2023-11-23 16:25:30 +01:00
|
|
|
if (sources == null)
|
|
|
|
then ["filesystem" "git_status" "buffers"] ++ extraSources
|
|
|
|
else sources ++ extraSources
|
|
|
|
else sources;
|
|
|
|
add_blank_line_at_top = addBlankLineAtTop;
|
|
|
|
auto_clean_after_session_restore = autoCleanAfterSessionRestore;
|
|
|
|
close_if_last_window = closeIfLastWindow;
|
|
|
|
default_source = defaultSource;
|
|
|
|
enable_diagnostics = enableDiagnostics;
|
|
|
|
enable_git_status = enableGitStatus;
|
|
|
|
enable_modified_markers = enableModifiedMarkers;
|
|
|
|
enable_refresh_on_write = enableRefreshOnWrite;
|
|
|
|
git_status_async = gitStatusAsync;
|
|
|
|
git_status_async_options = with gitStatusAsyncOptions; {
|
|
|
|
batch_size = batchSize;
|
|
|
|
batch_delay = batchDelay;
|
|
|
|
max_lines = maxLines;
|
2023-03-13 15:54:30 +01:00
|
|
|
};
|
2023-11-23 16:25:30 +01:00
|
|
|
hide_root_node = hideRootNode;
|
|
|
|
retain_hidden_root_indent = retainHiddenRootIndent;
|
|
|
|
log_level = logLevel;
|
|
|
|
log_to_file = logToFile;
|
|
|
|
open_files_in_last_window = openFilesInLastWindow;
|
|
|
|
popup_border_style = popupBorderStyle;
|
|
|
|
resize_timer_interval = resizeTimerInterval;
|
|
|
|
sort_case_insensitive = sortCaseInsensitive;
|
2023-12-29 15:24:42 +01:00
|
|
|
sort_function = sortFunction;
|
2023-11-23 16:25:30 +01:00
|
|
|
use_popups_for_input = usePopupsForInput;
|
|
|
|
use_default_mappings = useDefaultMappings;
|
|
|
|
source_selector = with sourceSelector; {
|
2023-05-12 14:13:26 +02:00
|
|
|
inherit winbar statusline;
|
|
|
|
show_scrolled_off_parent_node = showScrolledOffParentNode;
|
|
|
|
sources =
|
2023-11-23 16:25:30 +01:00
|
|
|
ifNonNull' sources
|
2023-05-12 14:13:26 +02:00
|
|
|
(
|
|
|
|
map
|
|
|
|
(
|
|
|
|
source: {
|
|
|
|
inherit (source) source;
|
|
|
|
display_name = source.displayName;
|
|
|
|
}
|
|
|
|
)
|
2023-11-23 16:25:30 +01:00
|
|
|
sources
|
2023-05-12 14:13:26 +02:00
|
|
|
);
|
|
|
|
content_layout = contentLayout;
|
|
|
|
tabs_layout = tabsLayout;
|
|
|
|
truncation_character = truncationCharacter;
|
|
|
|
tabs_min_width = tabsMinWidth;
|
|
|
|
tabs_max_width = tabsMaxWidth;
|
|
|
|
inherit padding separator;
|
|
|
|
separator_active = separatorActive;
|
|
|
|
show_separator_on_edge = showSeparatorOnEdge;
|
|
|
|
highlight_tab = highlightTab;
|
|
|
|
highlight_tab_active = highlightTabActive;
|
|
|
|
highlight_background = highlightBackground;
|
|
|
|
highlight_separator = highlightSeparator;
|
|
|
|
highlight_separator_active = highlightSeparatorActive;
|
|
|
|
};
|
2023-03-13 15:54:30 +01:00
|
|
|
event_handlers =
|
2023-11-23 16:25:30 +01:00
|
|
|
ifNonNull' eventHandlers
|
2023-03-13 15:54:30 +01:00
|
|
|
(
|
|
|
|
mapAttrsToList
|
|
|
|
(event: handler: {
|
|
|
|
inherit event;
|
|
|
|
handler = helpers.mkRaw handler;
|
|
|
|
})
|
2023-11-23 16:25:30 +01:00
|
|
|
eventHandlers
|
2023-03-13 15:54:30 +01:00
|
|
|
);
|
2023-11-23 16:25:30 +01:00
|
|
|
default_component_configs = with defaultComponentConfigs; {
|
|
|
|
container = with container; {
|
|
|
|
enable_character_fade = enableCharacterFade;
|
|
|
|
inherit width;
|
|
|
|
right_padding = rightPadding;
|
2023-03-13 15:54:30 +01:00
|
|
|
};
|
2023-11-23 16:25:30 +01:00
|
|
|
inherit diagnostics;
|
|
|
|
indent = with indent; {
|
|
|
|
indent_size = indentSize;
|
|
|
|
inherit padding;
|
|
|
|
with_markers = withMarkers;
|
|
|
|
indent_markers = indentMarker;
|
|
|
|
last_indent_marker = lastIndentMarker;
|
|
|
|
inherit highlight;
|
|
|
|
with_expanders = withExpanders;
|
|
|
|
expander_collapsed = expanderCollapsed;
|
|
|
|
expander_expanded = expanderExpanded;
|
|
|
|
expander_highlight = expanderHighlight;
|
|
|
|
};
|
|
|
|
icon = with icon; {
|
|
|
|
folder_closed = folderClosed;
|
|
|
|
folder_open = folderOpen;
|
|
|
|
folder_empty = folderEmpty;
|
|
|
|
folder_empty_open = folderEmptyOpen;
|
|
|
|
inherit
|
|
|
|
default
|
|
|
|
highlight
|
|
|
|
;
|
|
|
|
};
|
|
|
|
inherit modified;
|
|
|
|
name = with name; {
|
|
|
|
trailing_slash = trailingSlash;
|
|
|
|
use_git_status_colors = useGitStatusColors;
|
|
|
|
inherit highlight;
|
|
|
|
};
|
|
|
|
git_status = gitStatus;
|
|
|
|
};
|
2023-03-13 15:54:30 +01:00
|
|
|
renderers = ifNonNull' cfg.renderers (
|
|
|
|
mapAttrs (name: processRendererComponentList) cfg.renderers
|
|
|
|
);
|
|
|
|
nesting_rules = cfg.nestingRules;
|
2023-11-23 16:25:30 +01:00
|
|
|
window = with window; {
|
|
|
|
inherit position width height;
|
|
|
|
auto_expand_width = autoExpandWidth;
|
|
|
|
inherit popup;
|
|
|
|
same_level = sameLevel;
|
|
|
|
insert_as = insertAs;
|
|
|
|
mapping_options = mappingOptions;
|
|
|
|
mappings = processMappings mappings;
|
|
|
|
};
|
|
|
|
filesystem = with filesystem; {
|
|
|
|
window = processWindowMappings window;
|
|
|
|
async_directory_scan = asyncDirectoryScan;
|
|
|
|
scan_mode = scanMode;
|
|
|
|
bind_to_cwd = bindToCwd;
|
|
|
|
cwd_target = cwdTarget;
|
|
|
|
filtered_items = with filteredItems; {
|
|
|
|
inherit visible;
|
|
|
|
force_visible_in_empty_folder = forceVisibleInEmptyFolder;
|
|
|
|
show_hidden_count = showHiddenCount;
|
|
|
|
hide_dotfiles = hideDotfiles;
|
|
|
|
hide_gitignored = hideGitignored;
|
|
|
|
hide_hidden = hideHidden;
|
|
|
|
hide_by_name = hideByName;
|
|
|
|
hide_by_pattern = hideByPattern;
|
|
|
|
always_show = alwaysShow;
|
|
|
|
never_show = neverShow;
|
|
|
|
never_show_by_pattern = neverShowByPattern;
|
2023-03-13 15:54:30 +01:00
|
|
|
};
|
2023-11-23 16:25:30 +01:00
|
|
|
find_by_full_path_words = findByFullPathWords;
|
|
|
|
find_command = findCommand;
|
2024-01-02 00:30:10 +01:00
|
|
|
find_args = findArgs;
|
2023-11-23 16:25:30 +01:00
|
|
|
group_empty_dirs = groupEmptyDirs;
|
|
|
|
search_limit = searchLimit;
|
|
|
|
follow_current_file = followCurrentFile;
|
|
|
|
hijack_netrw_behavior = hijackNetrwBehavior;
|
|
|
|
use_libuv_file_watcher = useLibuvFileWatcher;
|
|
|
|
};
|
|
|
|
buffers = with buffers; {
|
|
|
|
bind_to_cwd = bindToCwd;
|
|
|
|
follow_current_file = followCurrentFile;
|
|
|
|
group_empty_dirs = groupEmptyDirs;
|
|
|
|
window = processWindowMappings window;
|
|
|
|
};
|
|
|
|
git_status = {
|
2023-03-13 15:54:30 +01:00
|
|
|
window = processWindowMappings cfg.gitStatus.window;
|
|
|
|
};
|
2023-11-23 16:25:30 +01:00
|
|
|
example = with example; {
|
|
|
|
renderers = with renderers; {
|
|
|
|
custom = processRendererComponentList custom;
|
2023-03-13 15:54:30 +01:00
|
|
|
};
|
2023-11-23 16:25:30 +01:00
|
|
|
};
|
|
|
|
document_symbols = with documentSymbols; {
|
|
|
|
follow_cursor = followCursor;
|
|
|
|
inherit kinds;
|
2023-05-12 14:13:41 +02:00
|
|
|
custom_kinds.__raw =
|
|
|
|
"{"
|
|
|
|
+ (concatStringsSep ","
|
|
|
|
(
|
|
|
|
mapAttrsToList
|
|
|
|
(id: name: ''[${id}] = "${name}"'')
|
2023-11-23 16:25:30 +01:00
|
|
|
customKinds
|
2023-05-12 14:13:41 +02:00
|
|
|
))
|
|
|
|
+ "}";
|
2023-11-23 16:25:30 +01:00
|
|
|
window = processWindowMappings window;
|
2023-05-12 14:13:41 +02:00
|
|
|
};
|
2023-03-13 15:54:30 +01:00
|
|
|
}
|
|
|
|
// cfg.extraOptions;
|
|
|
|
in
|
|
|
|
mkIf cfg.enable {
|
|
|
|
extraPlugins = with pkgs.vimPlugins; [
|
|
|
|
cfg.package
|
|
|
|
nvim-web-devicons
|
|
|
|
];
|
|
|
|
|
|
|
|
extraConfigLua = ''
|
2023-11-23 16:25:30 +01:00
|
|
|
require('neo-tree').setup(${helpers.toLuaObject setupOptions})
|
2023-03-13 15:54:30 +01:00
|
|
|
'';
|
|
|
|
extraPackages = [pkgs.git];
|
|
|
|
};
|
|
|
|
}
|