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.
Features
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
Installation
Open VS Code
Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
Search for "Repo Anchor"
Click Install
Usage
Copying a link to selected code
Select code in the editor
Right-click and select "Copy Repository Link to Selection"
The link is copied to your clipboard
Copying a link to a file
Right-click on a file in the explorer or editor tab
Select "Copy Repository Link to File"
The link is copied to your clipboard
Using custom domains
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
Extension Settings
This extension contributes the following settings:
repoanchor.useCustomUrl: Enable/disable using a custom URL instead of the repository remote URL
repoanchor.customUrl: The currently selected custom URL
repoanchor.customDomains: List of custom domains that can be selected
repoanchor.lastUsedDomain: The last used custom domain
Supported Repository Hosting Services
The extension automatically detects and formats links for:
GitHub
GitLab
Bitbucket
Azure DevOps
For other hosting services, a generic link format is used.