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" })