Skip to content

mere-human/CopyRelativePath

Repository files navigation

Copy Relative Path Extension

document tab menu

Download: Visual Studio Marketplace

Description

This Visual Studio extension adds advanced path copying commands. Available commands:

  1. Copy Relative Path - Get a relative path to a selected document. Example: transform D:\notepad-plus-plus\PowerEditor\src\resource.hPowerEditor/src/resource.h.

  2. Copy URL - Append a relative path to a base URL specified in preferences. This might be used to get a GitHub link to the selected document in Visual Studio. Example: transform D:\notepad-plus-plus\PowerEditor\src\resource.hhttps://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/resource.h.

  3. Copy Current Line URL - Same as Copy URL but link to a specific line. Example: https://github.com/vim/vim/blob/master/Makefile#L100

  4. Copy Include - Get a relative path while removing directories specified in Include Directories option. Useful for C/C++ projects (#include directive).

Extension commands are available in:

  1. Context menu for a document tab

document tab menu

  1. Context menu for an item in the Solution Explorer:

solution explorer menu

  1. Context menu in the editor

editor context menu

Settings can be customized in Tools > Options > Copy Path Extension:

options dialog

Links