dev: rewrite icons section

This commit is contained in:
raf 2023-07-30 14:29:34 +03:00
parent 897f7ce746
commit 05f3c653bf
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
2 changed files with 28 additions and 29 deletions

View file

@ -74,7 +74,7 @@ in {
disable_netrw = ${boolToString cfg.disableNetrw}, disable_netrw = ${boolToString cfg.disableNetrw},
hijack_netrw = ${boolToString cfg.hijackNetrw}, hijack_netrw = ${boolToString cfg.hijackNetrw},
auto_reload_on_write = ${boolToString cfg.autoreloadOnWrite}, auto_reload_on_write = ${boolToString cfg.autoreloadOnWrite},
sort = { sort = {
sorter = "${cfg.sort.sorter}", sorter = "${cfg.sort.sorter}",
folders_first = ${boolToString cfg.sort.foldersFirst}, folders_first = ${boolToString cfg.sort.foldersFirst},
@ -87,7 +87,7 @@ in {
sync_root_with_cwd = ${boolToString cfg.syncRootWithCwd}, sync_root_with_cwd = ${boolToString cfg.syncRootWithCwd},
reload_on_bufenter = ${boolToString cfg.reloadOnBufEnter}, reload_on_bufenter = ${boolToString cfg.reloadOnBufEnter},
respect_buf_cwd = ${boolToString cfg.respectBufCwd}, respect_buf_cwd = ${boolToString cfg.respectBufCwd},
hijack_directories = { hijack_directories = {
enable = ${boolToString cfg.hijackDirectories.enable}, enable = ${boolToString cfg.hijackDirectories.enable},
auto_open = ${boolToString cfg.hijackDirectories.autoOpen}, auto_open = ${boolToString cfg.hijackDirectories.autoOpen},
@ -164,7 +164,7 @@ in {
}, },
}, },
}, },
renderer = { renderer = {
add_trailing = ${boolToString cfg.renderer.addTrailing}, add_trailing = ${boolToString cfg.renderer.addTrailing},
group_empty = ${boolToString cfg.renderer.groupEmpty}, group_empty = ${boolToString cfg.renderer.groupEmpty},
@ -179,7 +179,7 @@ in {
inline_arrows = ${boolToString cfg.renderer.indentMarkers.inlineArrows}, inline_arrows = ${boolToString cfg.renderer.indentMarkers.inlineArrows},
icons = ${nvim.lua.expToLua cfg.renderer.indentMarkers.icons}, icons = ${nvim.lua.expToLua cfg.renderer.indentMarkers.icons},
}, },
special_files = ${nvim.lua.listToLuaTable cfg.renderer.specialFiles}, special_files = ${nvim.lua.listToLuaTable cfg.renderer.specialFiles},
symlink_destination = ${boolToString cfg.renderer.symlinkDestination}, symlink_destination = ${boolToString cfg.renderer.symlinkDestination},
@ -189,7 +189,7 @@ in {
modified_placement = "${cfg.renderer.icons.modifiedPlacement}", modified_placement = "${cfg.renderer.icons.modifiedPlacement}",
padding = "${cfg.renderer.icons.padding}", padding = "${cfg.renderer.icons.padding}",
symlink_arrow = "${cfg.renderer.icons.symlinkArrow}", symlink_arrow = "${cfg.renderer.icons.symlinkArrow}",
show = { show = {
git = ${boolToString cfg.renderer.icons.show.git}, git = ${boolToString cfg.renderer.icons.show.git},
folder = ${boolToString cfg.renderer.icons.show.folder}, folder = ${boolToString cfg.renderer.icons.show.folder},
@ -197,12 +197,12 @@ in {
file = ${boolToString cfg.renderer.icons.show.file}, file = ${boolToString cfg.renderer.icons.show.file},
modified = ${boolToString cfg.renderer.icons.show.modified}, modified = ${boolToString cfg.renderer.icons.show.modified},
}, },
glyphs = { glyphs = {
default = "${cfg.renderer.icons.glyphs.default}", default = "${cfg.renderer.icons.glyphs.default}",
symlink = "${cfg.renderer.icons.glyphs.symlink}", symlink = "${cfg.renderer.icons.glyphs.symlink}",
modified = "${cfg.renderer.icons.glyphs.modified}", modified = "${cfg.renderer.icons.glyphs.modified}",
folder = { folder = {
default = "${cfg.renderer.icons.glyphs.folder.default}", default = "${cfg.renderer.icons.glyphs.folder.default}",
open = "${cfg.renderer.icons.glyphs.folder.open}", open = "${cfg.renderer.icons.glyphs.folder.open}",
@ -226,7 +226,7 @@ in {
}, },
}, },
}, },
filters = { filters = {
git_ignored = ${boolToString cfg.filters.gitIgnored}, git_ignored = ${boolToString cfg.filters.gitIgnored},
dotfiles = ${boolToString cfg.filters.dotfiles}, dotfiles = ${boolToString cfg.filters.dotfiles},
@ -234,11 +234,11 @@ in {
no_buffer = ${boolToString cfg.filters.noBuffer}, no_buffer = ${boolToString cfg.filters.noBuffer},
exclude = ${nvim.lua.listToLuaTable cfg.filters.exclude}, exclude = ${nvim.lua.listToLuaTable cfg.filters.exclude},
}, },
trash = { trash = {
cmd = "${cfg.trash.cmd}", cmd = "${cfg.trash.cmd}",
}, },
actions = { actions = {
use_system_clipboard = ${boolToString cfg.actions.useSystemClipboard}, use_system_clipboard = ${boolToString cfg.actions.useSystemClipboard},
change_dir = { change_dir = {
@ -251,11 +251,11 @@ in {
max_folder_discovery = ${toString cfg.actions.expandAll.maxFolderDiscovery}, max_folder_discovery = ${toString cfg.actions.expandAll.maxFolderDiscovery},
exclude = ${nvim.lua.listToLuaTable cfg.actions.expandAll.exclude}, exclude = ${nvim.lua.listToLuaTable cfg.actions.expandAll.exclude},
}, },
file_popup = { file_popup = {
open_win_config = ${nvim.lua.expToLua cfg.actions.filePopup.openWinConfig}, open_win_config = ${nvim.lua.expToLua cfg.actions.filePopup.openWinConfig},
}, },
open_file = { open_file = {
quit_on_open = ${boolToString cfg.actions.openFile.quitOnOpen}, quit_on_open = ${boolToString cfg.actions.openFile.quitOnOpen},
eject = ${boolToString cfg.actions.openFile.eject}, eject = ${boolToString cfg.actions.openFile.eject},
@ -270,17 +270,17 @@ in {
}, },
}, },
}, },
remove_file = { remove_file = {
close_window = ${boolToString cfg.actions.removeFile.closeWindow}, close_window = ${boolToString cfg.actions.removeFile.closeWindow},
}, },
}, },
live_filter = { live_filter = {
prefix = "${cfg.liveFilter.prefix}", prefix = "${cfg.liveFilter.prefix}",
always_show_folders = ${boolToString cfg.liveFilter.alwaysShowFolders}, always_show_folders = ${boolToString cfg.liveFilter.alwaysShowFolders},
}, },
tab = { tab = {
sync = { sync = {
open = ${boolToString cfg.tab.sync.open}, open = ${boolToString cfg.tab.sync.open},

View file

@ -11,7 +11,7 @@ with builtins; {
mappings = { mappings = {
toggle = mkOption { toggle = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = "<C-n>"; default = "<leader>t";
description = "Toggle NvimTree"; description = "Toggle NvimTree";
}; };
refresh = mkOption { refresh = mkOption {
@ -95,7 +95,7 @@ with builtins; {
syncRootWithCwd = mkOption { syncRootWithCwd = mkOption {
type = types.bool; type = types.bool;
default = true; default = false;
description = '' description = ''
Changes the tree root directory on `DirChanged` and refreshes the tree. Changes the tree root directory on `DirChanged` and refreshes the tree.
Only relevant when `updateFocusedFile.updateRoot` is `true` Only relevant when `updateFocusedFile.updateRoot` is `true`
@ -194,9 +194,11 @@ with builtins; {
Note that the modified sign will take precedence over the diagnostics signs. Note that the modified sign will take precedence over the diagnostics signs.
''; '';
default = { default = {
enable = false;
debounceDelay = 50; debounceDelay = 50;
showOnDirs = false; showOnDirs = false;
showOnOpenDirs = true; showOnOpenDirs = true;
icons = { icons = {
hint = ""; hint = "";
info = ""; info = "";
@ -212,6 +214,7 @@ with builtins; {
type = types.submodule { type = types.submodule {
options = { options = {
enable = mkEnableOption "diagnostics"; enable = mkEnableOption "diagnostics";
debounceDelay = mkOption { debounceDelay = mkOption {
description = "Idle milliseconds between diagnostic event and update."; description = "Idle milliseconds between diagnostic event and update.";
type = types.int; type = types.int;
@ -246,19 +249,15 @@ with builtins; {
}; };
}; };
severity = mkOption { severity = {
type = types.submodule { min = mkOption {
options = { description = "Minimum severity.";
min = mkOption { type = types.enum ["HINT" "INFO" "WARNING" "ERROR"];
description = "Minimum severity."; };
type = types.enum ["HINT" "INFO" "WARNING" "ERROR"];
};
max = mkOption { max = mkOption {
description = "Maximum severity."; description = "Maximum severity.";
type = types.enum ["HINT" "INFO" "WARNING" "ERROR"]; type = types.enum ["HINT" "INFO" "WARNING" "ERROR"];
};
};
}; };
}; };
}; };