mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-09 14:45:58 +01:00
nvim-tree: use lazy
This commit is contained in:
parent
89b80ac8fb
commit
8369ca5602
1 changed files with 11 additions and 4 deletions
|
@ -16,8 +16,6 @@
|
|||
inherit (self.options.vim.filetree.nvimTree) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = ["nvim-tree-lua"];
|
||||
|
||||
vim.maps.normal = mkMerge [
|
||||
(mkBinding cfg.mappings.toggle ":NvimTreeToggle<cr>" mappings.toggle.description)
|
||||
(mkBinding cfg.mappings.refresh ":NvimTreeRefresh<cr>" mappings.refresh.description)
|
||||
|
@ -29,6 +27,17 @@ in {
|
|||
"<leader>t" = "+NvimTree";
|
||||
};
|
||||
|
||||
vim.lazy = {
|
||||
plugins = {
|
||||
nvim-tree-lua = {
|
||||
package = "nvim-tree-lua";
|
||||
setupModule = "nvim-tree";
|
||||
inherit (cfg) setupOpts;
|
||||
cmd = ["NvimTreeClipboard" "NvimTreeClose" "NvimTreeCollapse" "NvimTreeCollapseKeepBuffers" "NvimTreeFindFile" "NvimTreeFindFileToggle" "NvimTreeFocus" "NvimTreeHiTest" "NvimTreeOpen" "NvimTreeRefresh" "NvimTreeResize" "NvimTreeToggle"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
vim.pluginRC.nvimtreelua = entryAnywhere ''
|
||||
${
|
||||
optionalString cfg.setupOpts.disable_netrw ''
|
||||
|
@ -38,8 +47,6 @@ in {
|
|||
''
|
||||
}
|
||||
|
||||
require'nvim-tree'.setup(${toLuaObject cfg.setupOpts})
|
||||
|
||||
${
|
||||
optionalString cfg.openOnSetup ''
|
||||
-- autostart behaviour
|
||||
|
|
Loading…
Reference in a new issue