Reputation: 27025
I want to copy a link to github.com from the file/line I have open in vscode.
I found a way to copy a vscode.dev link.
You could modify that link by hand:
https://vscode.dev/github/examplecom/myproject/blob/main/mydir/myfile.go#L91-L98
to:
https://github.com/examplecom/myproject/blob/main/mydir/myfile.go#L91-L98
... but that is not convenient.
How to copy a link to github.com directly?
BTW, "GitLens" is not an answer. I uninstalled that plugin because it constantly wants you to sell something.
Upvotes: -1
Views: 37
Reputation: 51422
If you have the GitHub PR extension installed, I'm pretty sure it contributes items to the gutter context menu for this. At least, github.dev has that extension installed if I recall correctly, and it has this feature.
I'm pretty sure getting this without extensions would be difficult. The best idea I can think of right now is binding a keyboard shortcut that inserts a snippet, and using runCommands to then cut that inserted snippet. And the part I can't complete for that is how to get the user and repo name without hardcoding.
Upvotes: 0