From f43d3835f111e41d619cb2d744a39895e8d94a6b Mon Sep 17 00:00:00 2001 From: Ching Pei Yang <59727193+horriblename@users.noreply.github.com> Date: Sat, 3 Aug 2024 16:59:41 +0200 Subject: [PATCH] nvim-tree: load nvim-tree if openOnSetup --- modules/plugins/filetree/nvimtree/config.nix | 1 + modules/wrapper/lazy/config.nix | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/plugins/filetree/nvimtree/config.nix b/modules/plugins/filetree/nvimtree/config.nix index 9e9d4e3..47a85d6 100644 --- a/modules/plugins/filetree/nvimtree/config.nix +++ b/modules/plugins/filetree/nvimtree/config.nix @@ -49,6 +49,7 @@ in { ${ optionalString cfg.openOnSetup '' + require('lz.n').trigger_load("nvim-tree-lua") -- autostart behaviour -- Open on startup has been deprecated -- see https://github.com/nvim-tree/nvim-tree.lua/wiki/Open-At-Startup diff --git a/modules/wrapper/lazy/config.nix b/modules/wrapper/lazy/config.nix index 5ce308b..b1afb5b 100644 --- a/modules/wrapper/lazy/config.nix +++ b/modules/wrapper/lazy/config.nix @@ -9,7 +9,7 @@ inherit (lib.generators) mkLuaInline; inherit (lib.strings) optionalString; inherit (lib.nvim.lua) toLuaObject; - inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.dag) entryBefore; cfg = config.vim.lazy; toLuzLznKeySpec = { @@ -52,7 +52,7 @@ in { optPlugins = mapAttrsToList (_: plugin: plugin.package) cfg.plugins; - luaConfigRC.lzn-load = entryAnywhere '' + luaConfigRC.lzn-load = entryBefore ["pluginConfigs"] '' require('lz.n').load(${toLuaObject lznSpecs}) ''; };