Auto Import Relative Path is a Visual Studio Code extension that simplifies how you import files in your projects. No more memorizing or typing out long relative paths — let this extension do the heavy lifting for you. Whether you’re building a small side project or a complex application with hundreds of files, Auto Import Relative Path will help you streamline your workflow and keep your code clean.
- Auto Import Relative Path (DEMO)
- Instant Relative Path Imports: Quickly copy and paste a file’s path in your editor, or auto-import it in a single command.
- Flexible Placement: Place new import statements at the top, the bottom, or even at your cursor’s current position.
- Highly Customizable: Configure the style of import statements for JavaScript, TypeScript, React, CSS, SCSS, HTML, and Markdown.
- Time-Saving: Ideal for large projects with complex directory structures.
- Keyboard Friendly: Offers intuitive default shortcuts so you can keep your hands on the keyboard and stay in the flow.
| File Type | File Extension |
|---|---|
| Programming | .js, .jsx, .ts, .tsx |
| Markup | .html, .md |
| Stylesheet | .css, .scss |
| Command | Windows/Linux | macOS | Description | Demo |
|---|---|---|---|---|
| Auto Import: Copy | Ctrl+Shift+A | Cmd+Shift+A | Copy the relative path of the selected file in Explorer. | See it in action |
| Auto Import: Paste | Ctrl+I | Cmd+I | Paste the import statement into your active text editor. | See it in action |
| Auto Import: Auto | Alt+D | Option+D | Auto copy and paste the import statement from Explorer to your active text editor in one step (copy + paste). | Single keybinding import |
You can configure where the import statement goes in your code. Choose any of the following placement options:
Windows/Linux:
- Press Ctrl+Shift+A on a file in Explorer.
- Switch to your active text editor and press Ctrl+I to paste.
- Or use Alt+D to do both in one step (copy + paste).
macOS:
- Press Cmd+Shift+A on a file in Explorer.
- Switch to your active text editor and press Cmd+I to paste.
- Or use Option+D to do both in one step (copy + paste).
Windows/Linux:
- Press Ctrl+Shift+A on a file in Explorer.
- Press Ctrl+I in your code editor to paste at the bottom.
- Or use Alt+D to copy and paste in one step.
macOS:
- Press Cmd+Shift+A on a file in Explorer.
- Press Cmd+I in your code editor to paste at the bottom.
- Or use Option+D to copy and paste in one step.
Windows/Linux:
- Press Ctrl+Shift+A on a file in Explorer.
- Press Ctrl+I in your code editor to paste at the top.
- Or use Alt+D to copy and paste in one step.
macOS:
- Press Cmd+Shift+A on a file in Explorer.
- Press Cmd+I in your code editor to paste at the top.
- Or use Option+D to copy and paste in one step.
Windows/Linux
- In the Explorer, press Ctrl+Shift+A on a file.
- In the editor, press Ctrl+I to paste the import statement.
macOS
- In the Explorer, press Cmd+Shift+A on a file.
- In the editor, press Cmd+I to paste the import statement.
Windows/Linux
- Press Alt+D on a file in the Explorer.
- The import statement is automatically inserted into your active editor.
macOS
- Press Option+D on a file in the Explorer.
- The import statement is automatically inserted into your active editor.
Windows/Linux
- Press Ctrl+Shift+A on a file in the Explorer.
- Switch to any open tab and press Ctrl+I.
- The relative path import will be pasted where your cursor is.
macOS
- Press Cmd+Shift+A on a file in the Explorer.
- Switch to any open tab and press Cmd+I.
- The relative path import will be pasted where your cursor is.
Windows/Linux
- Press Ctrl+Shift+A on a
.jsor.cssfile in the Explorer. - Press Ctrl+I in your HTML file, or use Alt+D for a single-step import.
- The extension automatically creates the appropriate
<script>or<link>tag.
macOS
- Press Cmd+Shift+A on a
.jsor.cssfile in the Explorer. - Press Cmd+I in your HTML file, or use Option+D for a single-step import.
- The extension automatically creates the appropriate
<script>or<link>tag.
Windows/Linux
- Press Ctrl+Shift+A on an image file (
.png,.jpg, etc.) in the Explorer. - Press Ctrl+I or use Alt+D in your Markdown file.
- The extension inserts the Markdown image syntax automatically.
macOS
- Press Cmd+Shift+A on an image file (
.png,.jpg, etc.) in the Explorer. - Press Cmd+I or use Option+D in your Markdown file.
- The extension inserts the Markdown image syntax automatically.
Windows/Linux
- Press Ctrl+Shift+A on a
.mdfile in the Explorer. - In another Markdown file, press Ctrl+I or use Alt+D.
- The extension automatically inserts the relative link to your Markdown resource.
macOS
- Press Cmd+Shift+A on a
.mdfile in the Explorer. - In another Markdown file, press Cmd+I or use Option+D.
- The extension automatically inserts the relative link to your Markdown resource.
Check out the CHANGELOG for detailed release notes and version history.
Found a bug or have a feature request? Feel free to open an issue in GitHub Issues. You can also leave a star on GitHub or a review on the Visual Studio Marketplace. Your feedback is greatly appreciated and helps make this extension better!
If you're running into issues or need help using Auto Import Relative Path, please check the resources below:
- 🛠 Troubleshooting: Review the SUPPORT.md for known issues and helpful tips.
- ❓ Ask a Question: If your question isn’t answered in the documentation or support page, feel free to open an issue.
- 💬 Discussions: You can also participate in GitHub Discussions (if enabled) or reach out via comments on the Visual Studio Marketplace.
- 💡 Feature Requests: Use GitHub Issues to suggest improvements or new features.
If this extension has helped you or saved you time, and you’d like to show your support, you can send a donation to any of the addresses below:
- Bitcoin:
bc1q4j2uewfphjmca83905qv37vcl4jh8va5yupl7w - Solana:
EHtTGyRoDAK44KBGrEoypAWyPpResHUqwufKnuLs7Tyy - Sui:
0xcaf8ff4a65d7e35d961abd0203180013b7fe974d4fa0313e880c39c45ada2b09 - ERC20:
0xd25f84Ed2F76dF2F0C8f1207402eF9e15b5d7855
Thank you for your support—every bit helps us continue improving Auto Import Relative Path!
Check out more of my extensions on the VS Code Marketplace.
Thank you for using Auto Import Relative Path! If you have any suggestions or feedback, don’t hesitate to reach out via GitHub Issues. Happy coding!












