Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy Relative Path ImportNew to Visual Studio Code? Get it now.
Copy Relative Path Import

Copy Relative Path Import

Cory Danielson

|
119 installs
| (0) | Free
Copy Relative Path Import from Selection in a File
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy Relative Path Import

VSCode extension that copies import declarations based on selected text in the active file.

Inspired by vscode-copy-relative-path.


Set up a keybinding to use copyRelativePathImport, or access from the context menu in your editor. Multiple selections will be copied as multiple imports.

// Single selections will be copied like this
import {helloWorld} from 'some/nested/directory/multiple';

// Multiple selections will be copied like this
import {helloWorld, testing, multipleThings} from 'some/nested/directory/multiple';

If you execute the same command with the copied value already in your clipboard, it will copy the relative path only.

copy-relative-path-import

If nothing is selected, it will copy the relative path of the active file.

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