From 65d5ac12ef5ce99f426d6733ec9590f1c8886f66 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 15 Sep 2024 22:09:18 +0200 Subject: [PATCH] nvim: Load mini files earlier Since sometimes it is necessary to have correct access to the files functionality earlier than was possible with the old lazy loading this instead loads it at program start as well. --- nvim/.config/nvim/lua/plugins/base.lua | 29 +++++++++++++++++++------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins/base.lua b/nvim/.config/nvim/lua/plugins/base.lua index a0e1fbf..35bac31 100644 --- a/nvim/.config/nvim/lua/plugins/base.lua +++ b/nvim/.config/nvim/lua/plugins/base.lua @@ -135,6 +135,27 @@ return { starter.gen_hook.aligning("center", "center"), }, }) + require("mini.files").setup({ + mappings = { + synchronize = "S", + go_in = "L", -- switch go-ins around + go_in_plus = "l", + go_out = "H", + go_out_plus = "h", + }, + options = { + use_as_default_explorer = true, + }, + }) + vim.api.nvim_create_autocmd("User", { + pattern = "MiniFilesWindowUpdate", + callback = function(args) + local win_id = args.data.win_id + + vim.wo[win_id].number = true + end, + }) + -- manually create lazy loading scenarios vim.api.nvim_create_autocmd({ "InsertEnter", "CursorHold" }, { once = true, @@ -176,14 +197,6 @@ return { vim.api.nvim_set_hl(0, "MiniCursorword", { bold = true, underline = false }) vim.api.nvim_set_hl(0, "MiniCursorwordCurrent", { bold = true, underline = false }) - require("mini.files").setup() - vim.api.nvim_create_autocmd("User", { - pattern = "MiniFilesWindowUpdate", - callback = function(args) - vim.wo[args.data.win_id].number = true - end, - }) - require("mini.fuzzy").setup() require("mini.indentscope").setup({ symbol = "│",