Compare commits

..

No commits in common. "590cd886f43f35e2938d799fa3bb65af69260988" and "7f5c33605d73e448cd9572a69a078fe63a6ccbc2" have entirely different histories.

2 changed files with 90 additions and 91 deletions

View file

@ -4,7 +4,7 @@
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere; inherit (lib.strings) optionalString;
cfg = config.vim.filetree.neo-tree; cfg = config.vim.filetree.neo-tree;
in { in {
@ -22,13 +22,10 @@ in {
setupModule = "neo-tree"; setupModule = "neo-tree";
inherit (cfg) setupOpts; inherit (cfg) setupOpts;
cmd = ["Neotree"]; beforeAll =
event = []; optionalString (cfg.setupOpts.filesystem.hijack_netrw_behavior != "disabled")
};
pluginRC = mkIf (cfg.setupOpts.filesystem.hijack_netrw_behavior != "disabled" && config.vim.lazy.enable) {
# from https://github.com/nvim-neo-tree/neo-tree.nvim/discussions/1326 # from https://github.com/nvim-neo-tree/neo-tree.nvim/discussions/1326
neo-tree = entryAnywhere '' ''
vim.api.nvim_create_autocmd("BufEnter", { vim.api.nvim_create_autocmd("BufEnter", {
group = vim.api.nvim_create_augroup("load_neo_tree", {}), group = vim.api.nvim_create_augroup("load_neo_tree", {}),
desc = "Loads neo-tree when openning a directory", desc = "Loads neo-tree when openning a directory",
@ -45,6 +42,8 @@ in {
end, end,
}) })
''; '';
cmd = ["Neotree"];
event = [];
}; };
visuals.nvimWebDevicons.enable = true; visuals.nvimWebDevicons.enable = true;

View file

@ -32,9 +32,8 @@ 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)
]; ];
};
pluginRC.nvim-tree = entryAnywhere '' beforeAll = ''
${ ${
optionalString cfg.setupOpts.disable_netrw '' optionalString cfg.setupOpts.disable_netrw ''
-- disable netrew completely -- disable netrew completely
@ -43,7 +42,7 @@ in {
'' ''
} }
${optionalString (config.vim.lazy.enable && cfg.setupOpts.hijack_netrw && !cfg.openOnSetup) '' ${optionalString (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",
@ -104,4 +103,5 @@ in {
''; '';
}; };
}; };
};
} }