,ee and ,er to clipboard over ssh; lazy-lock.json

This commit is contained in:
2026-09-10 14:58:53 -04:00
parent abe9fde064
commit 78cb52db49
2 changed files with 25 additions and 17 deletions
+9 -2
View File
@@ -25,8 +25,15 @@ map("n", "<leader>k", "<C-w>k", { desc = "Focus upper split" })
map("n", "<leader>l", "<C-w>l", { desc = "Focus right split" })
-- File operations
map("n", "<leader>ee", ':e <C-R>=expand("%:p:h" . "/" <CR><CR>)', { desc = "Copy relative path to file" })
map("n", "<leader>er", ":!echo -n % | pbcopy<CR>", { desc = "Copy absolute path to file" })
-- setreg("+") goes through the clipboard provider, so it works over SSH via OSC 52
local function copy_path(expr, msg)
return function()
vim.fn.setreg("+", vim.fn.expand(expr))
vim.notify(msg)
end
end
map("n", "<leader>ee", copy_path("%", "Relative path copied to clipboard"), { desc = "Copy relative path to file" })
map("n", "<leader>er", copy_path("%:p", "Absolute path copied to clipboard"), { desc = "Copy absolute path to file" })
-- map("n", "<leader>gn", ":Telescope resume<CR>", { desc = "Resume telescope" })
map("n", "<leader>eu", '!!python -c "import uuid; print(uuid.uuid4())"<CR>', { desc = "Drop fresh uuid4" })