mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +00:00
Compare commits
3 commits
8f4a6ef0b9
...
f057ed34f1
Author | SHA1 | Date | |
---|---|---|---|
|
f057ed34f1 | ||
|
590cd886f4 | ||
|
c9f5dd1e22 |
2 changed files with 87 additions and 86 deletions
|
@ -4,7 +4,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.filetree.neo-tree;
|
cfg = config.vim.filetree.neo-tree;
|
||||||
in {
|
in {
|
||||||
|
@ -22,10 +22,13 @@ in {
|
||||||
setupModule = "neo-tree";
|
setupModule = "neo-tree";
|
||||||
inherit (cfg) setupOpts;
|
inherit (cfg) setupOpts;
|
||||||
|
|
||||||
beforeAll =
|
cmd = ["Neotree"];
|
||||||
optionalString (cfg.setupOpts.filesystem.hijack_netrw_behavior != "disabled")
|
event = [];
|
||||||
|
};
|
||||||
|
|
||||||
|
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",
|
||||||
|
@ -42,8 +45,6 @@ in {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
'';
|
'';
|
||||||
cmd = ["Neotree"];
|
|
||||||
event = [];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
visuals.nvim-web-devicons.enable = true;
|
visuals.nvim-web-devicons.enable = true;
|
||||||
|
|
|
@ -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 {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue