Skip to content

Commit 92b9954

Browse files
committed
Add git url
1 parent b7a6d31 commit 92b9954

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lua/config/yank.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,13 @@ function M.setup()
1010
print("File path copied: " .. path)
1111
end, {})
1212
vim.keymap.set("n", "<leader>cp", ":CopyFilePath<CR>", { silent = true, noremap = true })
13+
vim.keymap.set("n", "<leader>cr", function()
14+
local file = vim.fn.expand("%:p")
15+
local line = vim.fn.line(".")
16+
local result = vim.fn.system({ "git-url", file, tostring(line) })
17+
if vim.v.shell_error ~= 0 then
18+
vim.notify("git-url: " .. result, vim.log.levels.ERROR)
19+
end
20+
end, { silent = true, noremap = true })
1321
end
1422
return M

0 commit comments

Comments
 (0)