From 0ac228d0c35d71701237bae3b746387f718621a3 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 18 Sep 2026 18:53:36 +0200 Subject: [PATCH] change mini.files open location --- nvim/.config/nvim/lua/romanzy/keymaps.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nvim/.config/nvim/lua/romanzy/keymaps.lua b/nvim/.config/nvim/lua/romanzy/keymaps.lua index 775866a..a28afac 100644 --- a/nvim/.config/nvim/lua/romanzy/keymaps.lua +++ b/nvim/.config/nvim/lua/romanzy/keymaps.lua @@ -18,11 +18,18 @@ local function telescope_picker(picker) end end +local function open_mini_files_at_current_buffer() + local current_path = vim.api.nvim_buf_get_name(0) + if vim.bo.buftype ~= "" or current_path == "" then + current_path = nil + end + + MiniFiles.open(current_path) +end + map("n", "r", ":source ~/.config/nvim/init.lua", { desc = "reload init.lua" }) map("n", "h", telescope_picker("keymaps"), { desc = "show keymaps" }) -map("n", "e", function() - MiniFiles.open() -end, { desc = "open mini.files" }) +map("n", "e", open_mini_files_at_current_buffer, { desc = "open mini.files" }) map("n", "ff", telescope_picker("find_files"), { desc = "find files" }) map("n", "fg", telescope_picker("live_grep"), { desc = "live grep" }) map("n", "fb", telescope_picker("buffers"), { desc = "find buffers" })