modules/nvim-tree: add option to disable netrw

disable netrw by default
This commit is contained in:
Dmitriy Pleshevskiy 2024-04-27 02:44:28 +03:00
parent b683936ece
commit c4cc7d5a80
Signed by: pleshevskiy
GPG Key ID: 17041163DA10A9A2

View File

@ -9,14 +9,32 @@ let cfg = config.plugins.navigation.nvim-tree; in
settings = mkOption {
type = attrs;
default = { };
description = ''
`:help nvim-tree-setup`
'';
};
disableNetrw = mkOption {
type = bool;
default = true;
description = ''
Disabling netrw is strongly advised.
`:help nvim-tree-netrw`
'';
};
};
config = lib.mkIf cfg.enable {
plugin.nvim-tree-lua = {
name = "nvim-tree";
package = cfg.package;
setupSettings = cfg.settings;
};
vim.g = lib.mkIf cfg.disableNetrw {
loaded_netrw = 1;
loaded_netrwPlugin = 1;
};
};
}