mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2025-12-11 02:56:27 +00:00
54 lines
1.2 KiB
Nix
54 lines
1.2 KiB
Nix
{ lib, config, ... }:
|
|
let
|
|
cfg = config.presets.base.tree;
|
|
in
|
|
{
|
|
options.presets.base.tree = {
|
|
enable = lib.mkEnableOption "file tree";
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
keymaps = [
|
|
{
|
|
key = "<leader>ft";
|
|
action = "<cmd>:Neotree toggle<CR>";
|
|
}
|
|
{
|
|
key = "<leader>ss";
|
|
action = "<cmd>:Neotree document_symbols right toggle<CR>";
|
|
}
|
|
];
|
|
plugins = {
|
|
web-devicons.enable = true;
|
|
neo-tree = {
|
|
enable = true;
|
|
filesystem = {
|
|
useLibuvFileWatcher = true;
|
|
followCurrentFile.enabled = true;
|
|
filteredItems.visible = true;
|
|
};
|
|
extraSources = [ "document_symbols" ];
|
|
popupBorderStyle = "rounded";
|
|
eventHandlers.neo_tree_buffer_leave = # lua
|
|
''
|
|
function()
|
|
require('neo-tree').close_all()
|
|
end
|
|
'';
|
|
};
|
|
which-key.settings.spec = [
|
|
{
|
|
__unkeyed-1 = "<leader>ft";
|
|
desc = "Tree";
|
|
icon = "";
|
|
}
|
|
{
|
|
__unkeyed-1 = "<leader>ss";
|
|
desc = "Document Symbols";
|
|
icon = "";
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|