A VS Code extension that allows you to create links to repository files and code with customizable domain options. Easily share links to files or specific code selections with your team.
- Copy Link to Selection: Generate a link to the currently selected code in your repository
- Copy Link to File: Generate a link to the entire file
- Custom Domain Support: Replace the default remote URL with custom domains
- Support for Multiple Hosting Services: Works with GitHub, GitLab, Bitbucket, Azure DevOps, and more
- Context Menu Integration: Right-click in the editor or file explorer to access Repo Anchor commands
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Repo Anchor"
- Click Install
- Select code in the editor
- Right-click and select "Copy Repository Link to Selection"
- The link is copied to your clipboard
- Right-click on a file in the explorer or editor tab
- Select "Copy Repository Link to File"
- The link is copied to your clipboard
- Open the command palette (Ctrl+Shift+P / Cmd+Shift+P)
- Run "Open Repo Anchor Settings"
- Enable "Always use custom domain"
- Add one or more custom domains
- Select the domain you want to use
This extension contributes the following settings:
repoanchor.useCustomUrl: Enable/disable using a custom URL instead of the repository remote URLrepoanchor.customUrl: The currently selected custom URLrepoanchor.customDomains: List of custom domains that can be selectedrepoanchor.lastUsedDomain: The last used custom domain
The extension automatically detects and formats links for:
- GitHub
- GitLab
- Bitbucket
- Azure DevOps
For other hosting services, a generic link format is used.
- Git must be installed and available in your PATH
- The repository must have a remote URL configured
MIT
Enjoy!