summaryrefslogtreecommitdiff
path: root/ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-14 16:48:41 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-14 16:48:41 +0900
commit12f47e852d5db80d9ac95690bb9a117ccff2c4e3 (patch)
tree78ea006dd5647c7d6fbf5d9aaf8d52a13617c229 /ar/.config/TheSiahxyz/lua/thesiahxyz/core/keymaps.lua
parent1d778c5dd0f161c0150e064d8e6fcddd47a9dbbe (diff)
updates
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()