mirror of
https://github.com/nix-community/nixvim.git
synced 2025-11-18 00:12:48 +01:00
plugins/neo-tree: migrate to mkNeovimPlugin
This commit is contained in:
parent
57eb2a0d15
commit
2ad8d87e42
4 changed files with 639 additions and 1527 deletions
File diff suppressed because it is too large
Load diff
173
plugins/by-name/neo-tree/deprecations.nix
Normal file
173
plugins/by-name/neo-tree/deprecations.nix
Normal file
|
|
@ -0,0 +1,173 @@
|
||||||
|
lib: {
|
||||||
|
deprecateExtraOptions = true;
|
||||||
|
|
||||||
|
imports =
|
||||||
|
let
|
||||||
|
mkRemovedOption =
|
||||||
|
oldSubPath: newSubPath:
|
||||||
|
let
|
||||||
|
oldPath = [
|
||||||
|
"plugins"
|
||||||
|
"neo-tree"
|
||||||
|
]
|
||||||
|
++ (lib.splitString "." oldSubPath);
|
||||||
|
|
||||||
|
message = ''
|
||||||
|
Use `plugins.neo-tree.settings.${newSubPath}`.
|
||||||
|
WARNINGS:
|
||||||
|
- sub-option names are the upstream ones, and use snake_case:
|
||||||
|
`displayName` -> `display_name`
|
||||||
|
- Lua string are not automatically converted to lua:
|
||||||
|
`foo = "vim.fn.stdpath('data')"` -> `foo.__raw = "vim.fn.stdpath('data')"`
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
lib.mkRemovedOptionModule oldPath message;
|
||||||
|
in
|
||||||
|
lib.mapAttrsToList mkRemovedOption {
|
||||||
|
"sourceSelector.sources" = "source_selector.sources";
|
||||||
|
"eventHandlers" = "event_handlers";
|
||||||
|
"window.mappings" = "window.mappings";
|
||||||
|
"renderers" = "renderers";
|
||||||
|
"filesystem.window.mappings" = "filesystem.window.mappings";
|
||||||
|
"filesystem.findArgs" = "filesystem.find_args";
|
||||||
|
"buffers.window.mappings" = "buffers.window.mappings";
|
||||||
|
"gitStatus.window.mappings" = "git_status.window.mappings";
|
||||||
|
"example.renderers.custom" = "example.renderers.custom";
|
||||||
|
"example.window.mappings" = "example.window.mappings";
|
||||||
|
"documentSymbols.customKinds" = "document_symbols.custom_kinds";
|
||||||
|
"documentSymbols.window.mappings" = "document_symbols.window.mappings";
|
||||||
|
};
|
||||||
|
|
||||||
|
optionsRenamedToSettings = [
|
||||||
|
{
|
||||||
|
old = "extraSources";
|
||||||
|
new = "sources";
|
||||||
|
}
|
||||||
|
]
|
||||||
|
++ (map (lib.splitString ".") [
|
||||||
|
"sources"
|
||||||
|
"addBlankLineAtTop"
|
||||||
|
"autoCleanAfterSessionRestore"
|
||||||
|
"closeIfLastWindow"
|
||||||
|
"defaultSource"
|
||||||
|
"enableDiagnostics"
|
||||||
|
"enableGitStatus"
|
||||||
|
"enableModifiedMarkers"
|
||||||
|
"enableRefreshOnWrite"
|
||||||
|
"gitStatusAsync"
|
||||||
|
"gitStatusAsyncOptions.batchSize"
|
||||||
|
"gitStatusAsyncOptions.batchDelay"
|
||||||
|
"gitStatusAsyncOptions.maxLines"
|
||||||
|
"hideRootNode"
|
||||||
|
"retainHiddenRootIndent"
|
||||||
|
"logLevel"
|
||||||
|
"logToFile"
|
||||||
|
"openFilesInLastWindow"
|
||||||
|
"popupBorderStyle"
|
||||||
|
"resizeTimerInterval"
|
||||||
|
"sortCaseInsensitive"
|
||||||
|
"sortFunction"
|
||||||
|
"usePopupsForInput"
|
||||||
|
"useDefaultMappings"
|
||||||
|
|
||||||
|
"sourceSelector.winbar"
|
||||||
|
"sourceSelector.statusline"
|
||||||
|
"sourceSelector.showScrolledOffParentNode"
|
||||||
|
"sourceSelector.contentLayout"
|
||||||
|
"sourceSelector.tabsLayout"
|
||||||
|
"sourceSelector.truncationCharacter"
|
||||||
|
"sourceSelector.tabsMinWidth"
|
||||||
|
"sourceSelector.tabsMaxWidth"
|
||||||
|
"sourceSelector.padding"
|
||||||
|
"sourceSelector.separator"
|
||||||
|
"sourceSelector.separatorActive"
|
||||||
|
"sourceSelector.showSeparatorOnEdge"
|
||||||
|
"sourceSelector.highlightTab"
|
||||||
|
"sourceSelector.highlightTabActive"
|
||||||
|
"sourceSelector.highlightBackground"
|
||||||
|
"sourceSelector.highlightSeparator"
|
||||||
|
"sourceSelector.highlightSeparatorActive"
|
||||||
|
|
||||||
|
"defaultComponentConfigs.container.enableCharacterFade"
|
||||||
|
"defaultComponentConfigs.container.width"
|
||||||
|
"defaultComponentConfigs.container.rightPadding"
|
||||||
|
"defaultComponentConfigs.diagnostics"
|
||||||
|
"defaultComponentConfigs.indent.indentSize"
|
||||||
|
"defaultComponentConfigs.indent.padding"
|
||||||
|
"defaultComponentConfigs.indent.withMarkers"
|
||||||
|
"defaultComponentConfigs.indent.indentMarker"
|
||||||
|
"defaultComponentConfigs.indent.lastIndentMarker"
|
||||||
|
"defaultComponentConfigs.indent.highlight"
|
||||||
|
"defaultComponentConfigs.indent.withExpanders"
|
||||||
|
"defaultComponentConfigs.indent.expanderCollapsed"
|
||||||
|
"defaultComponentConfigs.indent.expanderExpanded"
|
||||||
|
"defaultComponentConfigs.indent.expanderHighlight"
|
||||||
|
"defaultComponentConfigs.icon.folderClosed"
|
||||||
|
"defaultComponentConfigs.icon.folderOpen"
|
||||||
|
"defaultComponentConfigs.icon.folderEmpty"
|
||||||
|
"defaultComponentConfigs.icon.folderEmptyOpen"
|
||||||
|
"defaultComponentConfigs.icon.default"
|
||||||
|
"defaultComponentConfigs.icon.highlight"
|
||||||
|
"defaultComponentConfigs.modified"
|
||||||
|
"defaultComponentConfigs.name.trailingSlash"
|
||||||
|
"defaultComponentConfigs.name.useGitStatusColors"
|
||||||
|
"defaultComponentConfigs.name.highlight"
|
||||||
|
"defaultComponentConfigs.gitStatus.symbols.added"
|
||||||
|
"defaultComponentConfigs.gitStatus.symbols.deleted"
|
||||||
|
"defaultComponentConfigs.gitStatus.symbols.modified"
|
||||||
|
"defaultComponentConfigs.gitStatus.symbols.renamed"
|
||||||
|
"defaultComponentConfigs.gitStatus.symbols.untracked"
|
||||||
|
"defaultComponentConfigs.gitStatus.symbols.ignored"
|
||||||
|
"defaultComponentConfigs.gitStatus.symbols.unstaged"
|
||||||
|
"defaultComponentConfigs.gitStatus.symbols.staged"
|
||||||
|
"defaultComponentConfigs.gitStatus.symbols.conflict"
|
||||||
|
"defaultComponentConfigs.gitStatus.align"
|
||||||
|
|
||||||
|
"nestingRules"
|
||||||
|
|
||||||
|
"window.position"
|
||||||
|
"window.width"
|
||||||
|
"window.height"
|
||||||
|
"window.autoExpandWidth"
|
||||||
|
"window.popup.size.height"
|
||||||
|
"window.popup.size.width"
|
||||||
|
"window.popup.position"
|
||||||
|
"window.sameLevel"
|
||||||
|
"window.insertAs"
|
||||||
|
"window.mappingOptions.noremap"
|
||||||
|
"window.mappingOptions.wait"
|
||||||
|
|
||||||
|
"filesystem.asyncDirectoryScan"
|
||||||
|
"filesystem.scanMode"
|
||||||
|
"filesystem.bindToCwd"
|
||||||
|
"filesystem.cwdTarget.sidebar"
|
||||||
|
"filesystem.cwdTarget.current"
|
||||||
|
"filesystem.filteredItems.visible"
|
||||||
|
"filesystem.filteredItems.forceVisibleInEmptyFolder"
|
||||||
|
"filesystem.filteredItems.showHiddenCount"
|
||||||
|
"filesystem.filteredItems.hideDotfiles"
|
||||||
|
"filesystem.filteredItems.hideGitignored"
|
||||||
|
"filesystem.filteredItems.hideHidden"
|
||||||
|
"filesystem.filteredItems.hideByName"
|
||||||
|
"filesystem.filteredItems.hideByPattern"
|
||||||
|
"filesystem.filteredItems.alwaysShow"
|
||||||
|
"filesystem.filteredItems.neverShow"
|
||||||
|
"filesystem.filteredItems.neverShowByPattern"
|
||||||
|
"filesystem.findByFullPathWords"
|
||||||
|
"filesystem.findCommand"
|
||||||
|
"filesystem.groupEmptyDirs"
|
||||||
|
"filesystem.searchLimit"
|
||||||
|
"filesystem.followCurrentFile.enabled"
|
||||||
|
"filesystem.followCurrentFile.leaveDirsOpen"
|
||||||
|
"filesystem.hijackNetrwBehavior"
|
||||||
|
"filesystem.useLibuvFileWatcher"
|
||||||
|
|
||||||
|
"buffers.bindToCwd"
|
||||||
|
"buffers.followCurrentFile.enabled"
|
||||||
|
"buffers.followCurrentFile.leaveDirsOpen"
|
||||||
|
"buffers.groupEmptyDirs"
|
||||||
|
|
||||||
|
"documentSymbols.followCursor"
|
||||||
|
"documentSymbols.kinds"
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
@ -21,6 +21,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
require("netman")
|
require("netman")
|
||||||
'';
|
'';
|
||||||
|
|
||||||
plugins.neo-tree.extraSources = lib.mkIf cfg.neoTreeIntegration [ "netman.ui.neo-tree" ];
|
plugins.neo-tree.settings.sources = lib.mkIf cfg.neoTreeIntegration [ "netman.ui.neo-tree" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
empty = {
|
empty = {
|
||||||
plugins.web-devicons.enable = true;
|
plugins.web-devicons.enable = true;
|
||||||
|
|
@ -7,7 +8,27 @@
|
||||||
# Otherwise fail at opening the log file
|
# Otherwise fail at opening the log file
|
||||||
# ERROR: [Neo-tree WARN] Could not open log file: /build/.local/share/nvim/neo-tree.nvim.log
|
# ERROR: [Neo-tree WARN] Could not open log file: /build/.local/share/nvim/neo-tree.nvim.log
|
||||||
# /build/.local/share/nvim/neo-tree.nvim.log: No such file or directory
|
# /build/.local/share/nvim/neo-tree.nvim.log: No such file or directory
|
||||||
logToFile = false;
|
settings.log_to_file = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
example = {
|
||||||
|
plugins.web-devicons.enable = true;
|
||||||
|
plugins.neo-tree = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
close_if_last_window = true;
|
||||||
|
filesystem.follow_current_file = {
|
||||||
|
enabled = true;
|
||||||
|
leave_dirs_open = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Otherwise fail at opening the log file
|
||||||
|
# ERROR: [Neo-tree WARN] Could not open log file: /build/.local/share/nvim/neo-tree.nvim.log
|
||||||
|
# /build/.local/share/nvim/neo-tree.nvim.log: No such file or directory
|
||||||
|
log_to_file = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -16,432 +37,437 @@
|
||||||
plugins.neo-tree = {
|
plugins.neo-tree = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
sources = [
|
settings = {
|
||||||
"filesystem"
|
|
||||||
"buffers"
|
|
||||||
"git_status"
|
|
||||||
];
|
|
||||||
|
|
||||||
addBlankLineAtTop = false;
|
|
||||||
autoCleanAfterSessionRestore = false;
|
|
||||||
closeIfLastWindow = false;
|
|
||||||
defaultSource = "filesystem";
|
|
||||||
enableDiagnostics = true;
|
|
||||||
enableGitStatus = true;
|
|
||||||
enableModifiedMarkers = true;
|
|
||||||
enableRefreshOnWrite = true;
|
|
||||||
gitStatusAsync = true;
|
|
||||||
gitStatusAsyncOptions = {
|
|
||||||
batchSize = 1000;
|
|
||||||
batchDelay = 10;
|
|
||||||
maxLines = 10000;
|
|
||||||
};
|
|
||||||
hideRootNode = false;
|
|
||||||
retainHiddenRootIndent = false;
|
|
||||||
logLevel = "info";
|
|
||||||
logToFile = false;
|
|
||||||
openFilesInLastWindow = true;
|
|
||||||
popupBorderStyle = "NC";
|
|
||||||
resizeTimerInterval = 500;
|
|
||||||
sortCaseInsensitive = false;
|
|
||||||
sortFunction = "nil";
|
|
||||||
usePopupsForInput = true;
|
|
||||||
useDefaultMappings = true;
|
|
||||||
sourceSelector = {
|
|
||||||
winbar = false;
|
|
||||||
statusline = false;
|
|
||||||
showScrolledOffParentNode = false;
|
|
||||||
sources = [
|
sources = [
|
||||||
{
|
"filesystem"
|
||||||
source = "filesystem";
|
"buffers"
|
||||||
displayName = " Files ";
|
"git_status"
|
||||||
}
|
|
||||||
{
|
|
||||||
source = "buffers";
|
|
||||||
displayName = " Buffers ";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
source = "gitStatus";
|
|
||||||
displayName = " Git ";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
source = "diagnostics";
|
|
||||||
displayName = " 裂Diagnostics ";
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
contentLayout = "start";
|
add_blank_lLine_at_top = false;
|
||||||
tabsLayout = "equal";
|
auto_clean_after_session_sestore = false;
|
||||||
truncationCharacter = "…";
|
close_if_last_window = false;
|
||||||
tabsMinWidth = null;
|
default_source = "filesystem";
|
||||||
tabsMaxWidth = null;
|
enable_diagnostics = true;
|
||||||
padding = 0;
|
enable_git_status = true;
|
||||||
separator = {
|
enable_modified_markers = true;
|
||||||
left = "▏";
|
enable_refresh_on_write = true;
|
||||||
right = "▕";
|
git_status_async = true;
|
||||||
|
git_status_async_options = {
|
||||||
|
batch_size = 1000;
|
||||||
|
batch_delay = 10;
|
||||||
|
max_lines = 10000;
|
||||||
};
|
};
|
||||||
separatorActive = null;
|
hide_root_node = false;
|
||||||
showSeparatorOnEdge = false;
|
retain_hidden_root_indent = false;
|
||||||
highlightTab = "NeoTreeTabInactive";
|
log_level = "info";
|
||||||
highlightTabActive = "NeoTreeTabActive";
|
log_to_file = false;
|
||||||
highlightBackground = "NeoTreeTabInactive";
|
open_files_in_last_window = true;
|
||||||
highlightSeparator = "NeoTreeTabSeparatorInactive";
|
popup_border_style = "NC";
|
||||||
highlightSeparatorActive = "NeoTreeTabSeparatorActive";
|
resize_timer_interval = 500;
|
||||||
};
|
sort_case_insensitive = false;
|
||||||
eventHandlers = {
|
sort_function = "nil";
|
||||||
before_render = ''
|
use_popups_for_input = true;
|
||||||
function (state)
|
use_default_mappings = true;
|
||||||
-- add something to the state that can be used by custom components
|
source_selector = {
|
||||||
end
|
winbar = false;
|
||||||
'';
|
statusline = false;
|
||||||
|
show_scrolled_off_parent_node = false;
|
||||||
file_opened = ''
|
sources = [
|
||||||
function(file_path)
|
|
||||||
--auto close
|
|
||||||
require("neo-tree").close_all()
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
defaultComponentConfigs = {
|
|
||||||
container = {
|
|
||||||
enableCharacterFade = true;
|
|
||||||
width = "100%";
|
|
||||||
rightPadding = 0;
|
|
||||||
};
|
|
||||||
diagnostics = {
|
|
||||||
symbols = {
|
|
||||||
hint = "H";
|
|
||||||
info = "I";
|
|
||||||
warn = "!";
|
|
||||||
error = "X";
|
|
||||||
};
|
|
||||||
highlights = {
|
|
||||||
hint = "DiagnosticSignHint";
|
|
||||||
info = "DiagnosticSignInfo";
|
|
||||||
warn = "DiagnosticSignWarn";
|
|
||||||
error = "DiagnosticSignError";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
indent = {
|
|
||||||
indentSize = 2;
|
|
||||||
padding = 1;
|
|
||||||
withMarkers = true;
|
|
||||||
indentMarker = "│";
|
|
||||||
lastIndentMarker = "└";
|
|
||||||
highlight = "NeoTreeIndentMarker";
|
|
||||||
withExpanders = null;
|
|
||||||
expanderCollapsed = "";
|
|
||||||
expanderExpanded = "";
|
|
||||||
expanderHighlight = "NeoTreeExpander";
|
|
||||||
};
|
|
||||||
icon = {
|
|
||||||
folderClosed = "";
|
|
||||||
folderOpen = "";
|
|
||||||
folderEmpty = "ﰊ";
|
|
||||||
folderEmptyOpen = "ﰊ";
|
|
||||||
default = "*";
|
|
||||||
highlight = "NeoTreeFileIcon";
|
|
||||||
};
|
|
||||||
modified = {
|
|
||||||
symbol = "[+] ";
|
|
||||||
highlight = "NeoTreeModified";
|
|
||||||
};
|
|
||||||
name = {
|
|
||||||
trailingSlash = false;
|
|
||||||
useGitStatusColors = true;
|
|
||||||
highlight = "NeoTreeFileName";
|
|
||||||
};
|
|
||||||
gitStatus = {
|
|
||||||
symbols = {
|
|
||||||
added = "✚";
|
|
||||||
deleted = "✖";
|
|
||||||
modified = "";
|
|
||||||
renamed = "";
|
|
||||||
untracked = "";
|
|
||||||
ignored = "";
|
|
||||||
unstaged = "";
|
|
||||||
staged = "";
|
|
||||||
conflict = "";
|
|
||||||
};
|
|
||||||
|
|
||||||
align = "right";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
renderers = {
|
|
||||||
directory = [
|
|
||||||
"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;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
file = [
|
|
||||||
"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";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
message = [
|
|
||||||
{
|
|
||||||
name = "indent";
|
|
||||||
with_markers = false;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "name";
|
|
||||||
highlight = "NeoTreeMessage";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
terminal = [
|
|
||||||
"indent"
|
|
||||||
"icon"
|
|
||||||
"name"
|
|
||||||
"bufnr"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
nestingRules = { };
|
|
||||||
window = {
|
|
||||||
position = "left";
|
|
||||||
width = 40;
|
|
||||||
height = 15;
|
|
||||||
autoExpandWidth = false;
|
|
||||||
popup = {
|
|
||||||
size = {
|
|
||||||
height = "80%";
|
|
||||||
width = "50%";
|
|
||||||
};
|
|
||||||
position = "80%";
|
|
||||||
};
|
|
||||||
sameLevel = false;
|
|
||||||
insertAs = "child";
|
|
||||||
mappingOptions = {
|
|
||||||
noremap = true;
|
|
||||||
nowait = true;
|
|
||||||
};
|
|
||||||
mappings = {
|
|
||||||
"<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 = {
|
|
||||||
window = {
|
|
||||||
mappings = {
|
|
||||||
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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
asyncDirectoryScan = "auto";
|
|
||||||
scanMode = "shallow";
|
|
||||||
bindToCwd = true;
|
|
||||||
cwdTarget = {
|
|
||||||
sidebar = "tab";
|
|
||||||
current = "window";
|
|
||||||
};
|
|
||||||
filteredItems = {
|
|
||||||
visible = false;
|
|
||||||
forceVisibleInEmptyFolder = false;
|
|
||||||
showHiddenCount = true;
|
|
||||||
hideDotfiles = true;
|
|
||||||
hideGitignored = true;
|
|
||||||
hideHidden = true;
|
|
||||||
hideByName = [
|
|
||||||
".DS_Store"
|
|
||||||
"thumbs.db"
|
|
||||||
];
|
|
||||||
hideByPattern = [ ];
|
|
||||||
alwaysShow = [ ];
|
|
||||||
neverShow = [ ];
|
|
||||||
neverShowByPattern = [ ];
|
|
||||||
};
|
|
||||||
findByFullPathWords = false;
|
|
||||||
findCommand = "fd";
|
|
||||||
findArgs = {
|
|
||||||
fd = [
|
|
||||||
"--exclude"
|
|
||||||
".git"
|
|
||||||
"--exclude"
|
|
||||||
"node_modules"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
groupEmptyDirs = false;
|
|
||||||
searchLimit = 50;
|
|
||||||
followCurrentFile = {
|
|
||||||
enabled = false;
|
|
||||||
leaveDirsOpen = false;
|
|
||||||
};
|
|
||||||
hijackNetrwBehavior = "open_default";
|
|
||||||
useLibuvFileWatcher = false;
|
|
||||||
};
|
|
||||||
buffers = {
|
|
||||||
bindToCwd = true;
|
|
||||||
followCurrentFile = {
|
|
||||||
enabled = true;
|
|
||||||
leaveDirsOpen = false;
|
|
||||||
};
|
|
||||||
groupEmptyDirs = true;
|
|
||||||
window = {
|
|
||||||
mappings = {
|
|
||||||
"<bs>" = "navigate_up";
|
|
||||||
"." = "set_root";
|
|
||||||
bd = "buffer_delete";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
gitStatus = {
|
|
||||||
window = {
|
|
||||||
mappings = {
|
|
||||||
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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
example = {
|
|
||||||
renderers = {
|
|
||||||
custom = [
|
|
||||||
"indent"
|
|
||||||
{
|
{
|
||||||
name = "icon";
|
source = "filesystem";
|
||||||
default = "C";
|
display_name = " Files ";
|
||||||
}
|
}
|
||||||
"custom"
|
{
|
||||||
|
source = "buffers";
|
||||||
|
display_name = " Buffers ";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
source = "gitStatus";
|
||||||
|
display_name = " Git ";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
source = "diagnostics";
|
||||||
|
display_name = " 裂Diagnostics ";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
content_layout = "start";
|
||||||
|
tabs_layout = "equal";
|
||||||
|
truncation_character = "…";
|
||||||
|
tabs_min_width = null;
|
||||||
|
tabs_max_width = null;
|
||||||
|
padding = 0;
|
||||||
|
separator = {
|
||||||
|
left = "▏";
|
||||||
|
right = "▕";
|
||||||
|
};
|
||||||
|
separator_active = null;
|
||||||
|
show_separator_on_edge = false;
|
||||||
|
highlight_tab = "NeoTreeTabInactive";
|
||||||
|
highlight_tab_active = "NeoTreeTabActive";
|
||||||
|
highlight_background = "NeoTreeTabInactive";
|
||||||
|
highlight_separator = "NeoTreeTabSeparatorInactive";
|
||||||
|
highlight_separator_active = "NeoTreeTabSeparatorActive";
|
||||||
|
};
|
||||||
|
event_handlers = [
|
||||||
|
{
|
||||||
|
event = "before_render";
|
||||||
|
handler = lib.nixvim.mkRaw ''
|
||||||
|
function (state)
|
||||||
|
-- add something to the state that can be used by custom components
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
{
|
||||||
|
event = "file_opened";
|
||||||
|
handler = lib.nixvim.mkRaw ''
|
||||||
|
function(file_path)
|
||||||
|
--auto close
|
||||||
|
require("neo-tree").close_all()
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
default_component_configs = {
|
||||||
|
container = {
|
||||||
|
enable_character_fade = true;
|
||||||
|
width = "100%";
|
||||||
|
right_padding = 0;
|
||||||
|
};
|
||||||
|
diagnostics = {
|
||||||
|
symbols = {
|
||||||
|
hint = "H";
|
||||||
|
info = "I";
|
||||||
|
warn = "!";
|
||||||
|
error = "X";
|
||||||
|
};
|
||||||
|
highlights = {
|
||||||
|
hint = "DiagnosticSignHint";
|
||||||
|
info = "DiagnosticSignInfo";
|
||||||
|
warn = "DiagnosticSignWarn";
|
||||||
|
error = "DiagnosticSignError";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
indent = {
|
||||||
|
indent_size = 2;
|
||||||
|
padding = 1;
|
||||||
|
with_markers = true;
|
||||||
|
indent_marker = "│";
|
||||||
|
last_indent_marker = "└";
|
||||||
|
highlight = "NeoTreeIndentMarker";
|
||||||
|
with_expanders = null;
|
||||||
|
expander_collapsed = "";
|
||||||
|
expander_expanded = "";
|
||||||
|
expander_highlight = "NeoTreeExpander";
|
||||||
|
};
|
||||||
|
icon = {
|
||||||
|
folder_closed = "";
|
||||||
|
folder_open = "";
|
||||||
|
folder_empty = "ﰊ";
|
||||||
|
folder_empty_open = "ﰊ";
|
||||||
|
default = "*";
|
||||||
|
highlight = "NeoTreeFileIcon";
|
||||||
|
};
|
||||||
|
modified = {
|
||||||
|
symbol = "[+] ";
|
||||||
|
highlight = "NeoTreeModified";
|
||||||
|
};
|
||||||
|
name = {
|
||||||
|
trailing_slash = false;
|
||||||
|
use_git_status_colors = true;
|
||||||
|
highlight = "NeoTreeFileName";
|
||||||
|
};
|
||||||
|
gitStatus = {
|
||||||
|
symbols = {
|
||||||
|
added = "✚";
|
||||||
|
deleted = "✖";
|
||||||
|
modified = "";
|
||||||
|
renamed = "";
|
||||||
|
untracked = "";
|
||||||
|
ignored = "";
|
||||||
|
unstaged = "";
|
||||||
|
staged = "";
|
||||||
|
conflict = "";
|
||||||
|
};
|
||||||
|
align = "right";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
renderers = {
|
||||||
|
directory = [
|
||||||
|
"indent"
|
||||||
|
"icon"
|
||||||
|
"current_filter"
|
||||||
|
{
|
||||||
|
__unkeyed = "container";
|
||||||
|
content = [
|
||||||
|
{
|
||||||
|
__unkeyed = "name";
|
||||||
|
zindex = 10;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
__unkeyed = "clipboard";
|
||||||
|
zindex = 10;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
__unkeyed = "diagnostics";
|
||||||
|
errors_only = true;
|
||||||
|
zindex = 20;
|
||||||
|
align = "right";
|
||||||
|
hide_when_expanded = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
__unkeyed = "git_status";
|
||||||
|
zindex = 20;
|
||||||
|
align = "right";
|
||||||
|
hide_when_expanded = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
file = [
|
||||||
|
"indent"
|
||||||
|
"icon"
|
||||||
|
{
|
||||||
|
name = "container";
|
||||||
|
content = [
|
||||||
|
{
|
||||||
|
__unkeyed = "name";
|
||||||
|
zindex = 10;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
__unkeyed = "clipboard";
|
||||||
|
zindex = 10;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
__unkeyed = "bufnr";
|
||||||
|
zindex = 10;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
__unkeyed = "modified";
|
||||||
|
zindex = 20;
|
||||||
|
align = "right";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
__unkeyed = "diagnostics";
|
||||||
|
zindex = 20;
|
||||||
|
align = "right";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
__unkeyed = "git_status";
|
||||||
|
zindex = 20;
|
||||||
|
align = "right";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
message = [
|
||||||
|
{
|
||||||
|
__unkeyed = "indent";
|
||||||
|
with_markers = false;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
__unkeyed = "name";
|
||||||
|
highlight = "NeoTreeMessage";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
terminal = [
|
||||||
|
"indent"
|
||||||
|
"icon"
|
||||||
"name"
|
"name"
|
||||||
|
"bufnr"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
nesting_rules = { };
|
||||||
window = {
|
window = {
|
||||||
|
position = "left";
|
||||||
|
width = 40;
|
||||||
|
height = 15;
|
||||||
|
auto_expand_width = false;
|
||||||
|
popup = {
|
||||||
|
size = {
|
||||||
|
height = "80%";
|
||||||
|
width = "50%";
|
||||||
|
};
|
||||||
|
position = "80%";
|
||||||
|
};
|
||||||
|
same_level = false;
|
||||||
|
insert_as = "child";
|
||||||
|
mapping_options = {
|
||||||
|
noremap = true;
|
||||||
|
nowait = true;
|
||||||
|
};
|
||||||
mappings = {
|
mappings = {
|
||||||
"<cr>" = "toggle_node";
|
"<space>" = {
|
||||||
"<C-e>" = "example_command";
|
command = "toggle_node";
|
||||||
d = "show_debug_info";
|
# 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 = {
|
||||||
|
__unkeyed = "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 = {
|
||||||
documentSymbols = {
|
window = {
|
||||||
followCursor = false;
|
mappings = {
|
||||||
kinds = {
|
H = "toggle_hidden";
|
||||||
File = {
|
"/" = "fuzzy_finder";
|
||||||
icon = "";
|
D = "fuzzy_finder_directory";
|
||||||
hl = "Tag";
|
# "/" = "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";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
Namespace = {
|
async_directory_scan = "auto";
|
||||||
icon = "";
|
scan_mode = "shallow";
|
||||||
hl = "Include";
|
bind_to_cwd = true;
|
||||||
|
cwd_target = {
|
||||||
|
sidebar = "tab";
|
||||||
|
current = "window";
|
||||||
|
};
|
||||||
|
filteredItems = {
|
||||||
|
visible = false;
|
||||||
|
force_visible_in_empty_folder = false;
|
||||||
|
showhidden_count = true;
|
||||||
|
hide_dotfiles = true;
|
||||||
|
hide_gitignored = true;
|
||||||
|
hide_hidden = true;
|
||||||
|
hide_by_name = [
|
||||||
|
".DS_Store"
|
||||||
|
"thumbs.db"
|
||||||
|
];
|
||||||
|
hide_by_pattern = [ ];
|
||||||
|
always_show = [ ];
|
||||||
|
never_show = [ ];
|
||||||
|
never_show_by_pattern = [ ];
|
||||||
|
};
|
||||||
|
find_by_full_path_words = false;
|
||||||
|
find_command = "fd";
|
||||||
|
find_args = {
|
||||||
|
fd = [
|
||||||
|
"--exclude"
|
||||||
|
".git"
|
||||||
|
"--exclude"
|
||||||
|
"node_modules"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
group_empty_dirs = false;
|
||||||
|
search_limit = 50;
|
||||||
|
follow_current_file = {
|
||||||
|
enabled = false;
|
||||||
|
leave_dirs_open = false;
|
||||||
|
};
|
||||||
|
hijack_netrw_behavior = "open_default";
|
||||||
|
use_libuv_file_watcher = false;
|
||||||
|
};
|
||||||
|
buffers = {
|
||||||
|
bind_to_cwd = true;
|
||||||
|
follow_current_file = {
|
||||||
|
enabled = true;
|
||||||
|
leave_dirs_open = false;
|
||||||
|
};
|
||||||
|
group_empty_dirs = true;
|
||||||
|
window = {
|
||||||
|
mappings = {
|
||||||
|
"<bs>" = "navigate_up";
|
||||||
|
"." = "set_root";
|
||||||
|
bd = "buffer_delete";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
customKinds = {
|
git_status = {
|
||||||
"12" = "foo";
|
window = {
|
||||||
"15" = "bar";
|
mappings = {
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
example = {
|
||||||
|
renderers = {
|
||||||
|
custom = [
|
||||||
|
[ "indent" ]
|
||||||
|
{
|
||||||
|
__unkeyed = "icon";
|
||||||
|
default = "C";
|
||||||
|
}
|
||||||
|
"custom"
|
||||||
|
"name"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
window = {
|
||||||
|
mappings = {
|
||||||
|
"<cr>" = "toggle_node";
|
||||||
|
"<C-e>" = "example_command";
|
||||||
|
d = "show_debug_info";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
document_symbols = {
|
||||||
|
follow_cursor = false;
|
||||||
|
kinds = {
|
||||||
|
File = {
|
||||||
|
icon = "";
|
||||||
|
hl = "Tag";
|
||||||
|
};
|
||||||
|
Namespace = {
|
||||||
|
icon = "";
|
||||||
|
hl = "Include";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
custom_kinds = {
|
||||||
|
"12" = "foo";
|
||||||
|
"15" = "bar";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -456,7 +482,7 @@
|
||||||
# Otherwise fail at opening the log file
|
# Otherwise fail at opening the log file
|
||||||
# ERROR: [Neo-tree WARN] Could not open log file: /build/.local/share/nvim/neo-tree.nvim.log
|
# ERROR: [Neo-tree WARN] Could not open log file: /build/.local/share/nvim/neo-tree.nvim.log
|
||||||
# /build/.local/share/nvim/neo-tree.nvim.log: No such file or directory
|
# /build/.local/share/nvim/neo-tree.nvim.log: No such file or directory
|
||||||
logToFile = false;
|
settings.log_to_file = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -472,7 +498,7 @@
|
||||||
# Otherwise fail at opening the log file
|
# Otherwise fail at opening the log file
|
||||||
# ERROR: [Neo-tree WARN] Could not open log file: /build/.local/share/nvim/neo-tree.nvim.log
|
# ERROR: [Neo-tree WARN] Could not open log file: /build/.local/share/nvim/neo-tree.nvim.log
|
||||||
# /build/.local/share/nvim/neo-tree.nvim.log: No such file or directory
|
# /build/.local/share/nvim/neo-tree.nvim.log: No such file or directory
|
||||||
logToFile = false;
|
settings.log_to_file = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue