diff --git a/remap.lua b/remap.lua index ef63955..768dc9b 100644 --- a/remap.lua +++ b/remap.lua @@ -6,6 +6,13 @@ vim.keymap.set("x", "p", "\"_dP") if package.config:sub(1,1) == "\\" then vim.keymap.set("n", "oe", ":!explorer .", { desc = "[O]pen [E]xplorer in current working directory" }) vim.keymap.set("n", "ot", ":!wt -w 0 nt -d .", { desc = "[O]pen Windows [T]erminal in current working directory" }) + vim.keymap.set("n", "oce", function () + local path = vim.api.nvim_buf_get_name(0) + local dir = path:sub(1, path:find('\\[^\\]*$')) + -- vim.cmd(":!echo " .. "(path:sub(1, path:find('\\[^\\]*$')))" .. "") + -- print("Check "..dir) + os.execute("explorer " .. dir) + end, { desc = "[O]pen [C]urrent buffer [Explorer]"}) end -- Telescope