summaryrefslogtreecommitdiff
path: root/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua
diff options
context:
space:
mode:
Diffstat (limited to 'ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua')
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua
index 044b9cf..cc206ab 100644
--- a/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua
@@ -178,6 +178,17 @@ vim.keymap.set("n", "<leader>oq", "<cmd>copen<cr>", { desc = "Open quickfix list
-- Formats
vim.keymap.set("n", "<leader>cF", vim.lsp.buf.format, { desc = "Format buffer by default lsp" })
+-- Full path
+vim.keymap.set("n", "<leader>zf", function()
+ local word = vim.fn.expand("<cWORD>") -- Get full text under the cursor (handles paths with slashes)
+ if word:match("%$") then
+ local expanded_path = vim.fn.expand(word)
+ if expanded_path ~= word then
+ vim.cmd("normal! ciW" .. expanded_path) -- Replace entire word under cursor
+ end
+ end
+end, { desc = "Expand and replace path under cursor" })
+
-- Git
-- create repository
vim.keymap.set("n", "<leader>gR", function()