mirror of
https://github.com/DefectingCat/dotfiles
synced 2025-07-15 16:51:36 +00:00
14 lines
400 B
Lua
14 lines
400 B
Lua
local user_command = vim.api.nvim_create_user_command
|
|
|
|
-- Copy file path
|
|
user_command("Cppath", function()
|
|
local path = vim.fn.expand "%:p"
|
|
vim.fn.setreg("+", path)
|
|
vim.notify('Copied "' .. path .. '" to the clipboard!')
|
|
end, {})
|
|
user_command("CpRelPath", function()
|
|
local path = vim.fn.expand "%"
|
|
vim.fn.setreg("+", path)
|
|
vim.notify('Copied "' .. path .. '" to the clipboard!')
|
|
end, {})
|