mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-22 20:41:08 +00:00
Update lua/lazyvim/config/keymaps.lua
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
d0fcc0871c
commit
1e9e0af884
1 changed files with 8 additions and 0 deletions
|
|
@ -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" })
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue