nvimtree: move beforeAll to pluginRC

This commit is contained in:
Ching Pei Yang 2024-11-19 01:18:52 +01:00
parent c9f5dd1e22
commit 590cd886f4
No known key found for this signature in database
GPG key ID: B3841364253DC4C8

View file

@ -32,8 +32,9 @@ in {
(mkLznBinding ["n"] cfg.mappings.findFile ":NvimTreeFindFile<cr>" mappings.findFile.description) (mkLznBinding ["n"] cfg.mappings.findFile ":NvimTreeFindFile<cr>" mappings.findFile.description)
(mkLznBinding ["n"] cfg.mappings.focus ":NvimTreeFocus<cr>" mappings.focus.description) (mkLznBinding ["n"] cfg.mappings.focus ":NvimTreeFocus<cr>" mappings.focus.description)
]; ];
};
beforeAll = '' pluginRC.nvim-tree = entryAnywhere ''
${ ${
optionalString cfg.setupOpts.disable_netrw '' optionalString cfg.setupOpts.disable_netrw ''
-- disable netrew completely -- disable netrew completely
@ -42,7 +43,7 @@ in {
'' ''
} }
${optionalString (cfg.setupOpts.hijack_netrw && !cfg.openOnSetup) '' ${optionalString (config.vim.lazy.enable && cfg.setupOpts.hijack_netrw && !cfg.openOnSetup) ''
vim.api.nvim_create_autocmd("BufEnter", { vim.api.nvim_create_autocmd("BufEnter", {
group = vim.api.nvim_create_augroup("load_nvim_tree", {}), group = vim.api.nvim_create_augroup("load_nvim_tree", {}),
desc = "Loads nvim-tree when openning a directory", desc = "Loads nvim-tree when openning a directory",
@ -103,5 +104,4 @@ in {
''; '';
}; };
}; };
};
} }