Copies a GitHub or GitLab permalink of the active file (name and line) to clipboard in VSCode. Works with both cloud-hosted (github.com, gitlab.com) and self-hosted repositories.
https://marketplace.visualstudio.com/items?itemName=hogashi.vscode-copy-github-permalink
- Command Palette: open it with Cmd-Shift-P (or so), search for
Copy GitHub Permalink, and select it. - Editor context menu: right-click in the editor and choose
Copy GitHub Permalink. - Gutter context menu: right-click on a line number (gutter) and choose
Copy GitHub Permalink.
In every case, the permalink for your workspace's git info and active file (name / line number) is copied to the clipboard.
Copy GitHub Permalinkcommand copies a permalink generated by your workspace's git info and active file (name / line number)- Works with GitHub (github.com and self-hosted GitHub Enterprise) and GitLab (gitlab.com and self-hosted GitLab instances)
- e.g.
https://github.com/hogashi/vscode-copy-github-permalink/blob/47b96dd6cc7c521d9ab017ce7760d62536cbb4cc/src/extension.ts#L4
- Multiple-lined permalink will be copied if multiple lines are selected
- e.g.
https://github.com/hogashi/vscode-copy-github-permalink/blob/47b96dd6cc7c521d9ab017ce7760d62536cbb4cc/src/extension.ts#L4-L6
- e.g.
?plain=1will be added if Markdown (and other rich docs that will be rendered in web)- e.g.
https://github.com/hogashi/vscode-copy-github-permalink/blob/47b96dd6cc7c521d9ab017ce7760d62536cbb4cc/src/README.md?plain=1#L4
- e.g.
- Workspace is with git
- File is opened
- Nothing