From 1e9e0af884cb8eb941349deb984b7a527a7425d9 Mon Sep 17 00:00:00 2001 From: Axel Navarro Date: Thu, 16 Apr 2026 15:19:16 -0300 Subject: [PATCH] Update lua/lazyvim/config/keymaps.lua Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- lua/lazyvim/config/keymaps.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index bf795081..7dadec76 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -97,11 +97,19 @@ map("n", "fn", "enew", { desc = "New File" }) -- copy file path map("n", "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", "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" })