Create links between any files. Useful if your project or solution contains code in multiple languages or you wish to link to documentation files also in the solution.
Watch a video on YouTube
- Open the file
- Open the file and go to a specific line
- Open the file and go to specific text
When a comment contains the text
link: followed by a file name, a green button will be added that when clicked will open that file.
- You can open the file at a specific line by putting
#L and the line number (e.g.
#L25) immediately after the file name.
- You can open the file at a place where specific text is found by placing
: immediately after the file name and then the text to search for.
For compatibility with text fragment anchors you can also use
#:~:text= after the file name to specify the text.
- Files will be found anywhere in the solution, even other projects. If you have more than one file with the same name, you can specify the directory name the file is in too.
- Any words after the file name or search term should be automatically ignored. If you find that something isn't being detected correctly you can escape the name (and, optionally, search terms) by enclosing them in quotes.
// Go to link:"include/mapManager.js" and see ...
- Use a different keyword instead of "link"
Go to Tools > Options > CommentLinks and specify a different value to use.
- Run arbitrary commands to open files or invoke applications by including
link: and before the command to execute.
// Change personalization settings to see the full effect link:run>ms-settings:personalization
// Open a command window - link:run>cmd.exe
// Pass arguments to an application:- link:run>"cmd.exe /?"
// Open a file (in the default app) - link:run>C:\path\to\document.pdf
Please raise an issue if you have feature requests.
There is a separate version that supports Visual Studio 2017 & 2019