Update lua/lazyvim/config/keymaps.lua

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Axel Navarro 2026-04-16 15:19:16 -03:00 committed by GitHub
parent d0fcc0871c
commit 1e9e0af884
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -97,11 +97,19 @@ map("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
-- copy file path
map("n", "<leader>fy", function()
local path = vim.fn.expand("%:p")
if path == "" then
vim.notify("No file path available for the current buffer", vim.log.levels.WARN)
return
end
vim.fn.setreg("+", path)
vim.notify("Copied: " .. path)
end, { desc = "Copy File Path" })
map("n", "<leader>fY", function()
local path = vim.fn.expand("%:~:.")
if path == "" then
vim.notify("No file path available for the current buffer", vim.log.levels.WARN)
return
end
vim.fn.setreg("+", path)
vim.notify("Copied: " .. path)
end, { desc = "Copy Relative File Path" })