Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy importNew to Visual Studio Code? Get it now.
Copy import

Copy import

billjohnston4

|
536 installs
| (0) | Free
Copies import code for file in explorer menu
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy Import

Adds a "Copy Import" action to the file tree context menu. Users can set template strings for different file extensions. Once selected the import string will copied to the clipboard.

Extension preview

Template string Values given the example file path /home/user/dev/projectName/src/some/path/example.js
{{EXT}} js
{{BASENAME}} example
{{PROJECT_ROOT}} /home/user/dev/projectName
{{FILE_PATH}} src/some/path/
{{DOT_PATH}} src.some.path.
{{ROOT_ALIAS}} Configurable in extension settings

Configuration example:

"copyImport.rootAlias": "@",
"copyImport.fileExtensionImportTemplateMap": {
    "js": "import {{BASENAME}} from '{{ROOT_ALIAS}}/{{FILE_PATH}}'",
    "py": "from {{DOT_PATH}} import {{BASENAME}}"
}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft