Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy File Path Ext: Name, Relative Path to Active EditorNew to Visual Studio Code? Get it now.
Copy File Path Ext: Name, Relative Path to Active Editor

Copy File Path Ext: Name, Relative Path to Active Editor

fseasy

|
5 installs
| (0) | Free
Copy file name or path relative to the currently active editor from Context Menu
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy File Relative Path

Credits to ChatGPT.

Quickly copy file names or paths relative to the currently active file in VS Code.

Copy relative path preview


Features

  • Copy File Name: Right-click on a file in the Explorer and copy its name.
  • Copy Path Relative to Active File: Right-click on a file and copy its path relative to the currently active editor.
  • Multi-language Support: Shows confirmation messages in your system language (English, Chinese, Japanese, Korean, French, Russian).

How to Use

  1. Right-click on a file in the Explorer.
  2. Select "Copy File Name" or "Copy Path (Relative to Active Editor)".
  3. A notification will appear showing the copied content.

You can also use the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and search for:

  • Copy File Name
  • Copy Path (Relative to Active Editor)

Keyboard Shortcuts (Optional)

You can assign your own shortcuts in keybindings.json, for example:

{
  "key": "ctrl+k ctrl+shift+c",
  "command": "copyRelative.copyFileName",
  "when": "explorerViewletVisible"
}

But I recommend you to directly use the context menu to avoid open/preview the target file.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft