Navigate to files instantly by clicking on import paths!
Go to Import makes file paths in import statements clickable, allowing you to quickly navigate to referenced files with multiple convenient methods.
Customize your experience with the following configuration options:
-
go-to-import.enableStatusBar(default:true)- Show/hide the "Go to Import" button in the status bar.
-
go-to-import.showHelpNotification(default:true)- Show/hide the helpful notification about
Cmd+Clickconflicts on macOS.
- Show/hide the helpful notification about
- 🖱️ One-click navigation to imported files via
Cmd+Click(configurable) - ⌨️ Keyboard shortcuts for quick access (
Cmd+Shift+G) - 📱 Multiple access methods - context menu, status bar, command palette
- 🌍 Multi-language support for JavaScript, TypeScript, Python, CSS, and more
- 🧠 Smart path resolution for relative and absolute paths, path aliases (@, ~)
- 🔍 Automatic file extension detection
- 💡 Rich visual feedback with informative tooltips on hover
Hover over any import path to see instant feedback:
- ✅ File Found: Shows file name, relative path, and click instructions
- 📦 Library Import: Identifies NPM packages and library imports
- ❌ File Not Found: Shows attempted search paths to help debug missing files
- 🔍 Path Debugging: Displays which paths were searched and why resolution failed
- 🎯 Framework-friendly - works with React, Vue, Angular, and more
- 🔒 Security-first - comprehensive security measures built-in
Try the extension with the comprehensive examples in the example/ directory, which includes JavaScript, TypeScript, Python, and CSS files demonstrating various import patterns.
- Open any file containing import statements
- Hold Cmd (Mac) or Ctrl (Windows/Linux) and hover over a file path
- Click the highlighted path to jump directly to that file
- Place cursor on or near an import path
- Press Cmd+Shift+G (Mac) or Ctrl+Shift+G (Windows/Linux)
- If multiple imports exist, select from the quick-pick menu
- Right-click on any import path
- Select "Jump to Import File" from the context menu
- Look for the "🔗 Go to Import" button in the status bar (appears in supported files)
- Click to access jump functionality
You can customize the keyboard shortcut for jumping to imports:
{
"key": "cmd+alt+g",
"command": "go-to-import.jumpToImport",
"when": "editorTextFocus"
}- Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
- Search for "Preferences: Open Keyboard Shortcuts"
- Search for "Jump to Import File"
- Modify the keybinding to your preference
Default keybindings:
- macOS:
Cmd+Shift+G - Windows/Linux:
Ctrl+Shift+G
To change the Cmd+Click behavior system-wide:
-
Change Multi-Cursor Modifier (Recommended):
{ "editor.multiCursorModifier": "altKey" }This makes
Alt+Clickcreate multiple cursors and frees upCmd+Clickfor links. -
Custom Keybindings in keybindings.json:
[ { "key": "cmd+alt+g", "command": "go-to-import.jumpToImport", "when": "editorTextFocus" } ]
The extension intelligently resolves:
- ✅ Relative paths (
./,../) - ✅ Absolute paths from workspace root
- ✅ Common file extensions automatically
- ✅ Index files in directories
- ✅ Files without extensions
- JavaScript (
.js,.jsx) - TypeScript (
.ts,.tsx) - Python (
.py) - CSS/SCSS/LESS (
.css,.scss,.less) - JSON (
.json) - Vue (
.vue) - Svelte (
.svelte)
import React from 'react';
import { Component } from './component';
import utils from '../utils/helpers';
require('./module');
import('./dynamic-module');import os
from pathlib import Path
from .local import module@import './styles.css';
@import '../fonts/fonts.scss';This extension implements comprehensive security measures:
- Workspace Trust: Only operates in trusted workspaces
- Path Validation: Prevents path traversal and validates file access
- File Type Restrictions: Blocks access to executable and sensitive files
- Boundary Enforcement: Restricts access to workspace files only
For detailed security information, see SECURITY.md.
- Visual Studio Code 1.74.0 or higher
- No additional dependencies required
See CHANGELOG.md
If the Cmd+Click event is creating multiple cursors instead of
jumping to the file, this is due to VS Code's multi-cursor
modifier setting conflicting with the DocumentLinkProvider.
Solutions:
-
Change the multi-cursor modifier (Recommended):
- Open VS Code Settings (
Cmd+,) - Search for "multi cursor modifier"
- Change
editor.multiCursorModifierfromcommandKeytoaltKey - Now use Alt+Click for multi-cursor and Cmd+Click for jumping to files
- Open VS Code Settings (
-
Use alternative methods:
- Keyboard: Press
Cmd+Shift+G - Context menu: Right-click on an import path → "Jump to Import File"
- Status bar: Click the "🔗 Go to Import" button
- Command Palette:
Cmd+Shift+P→ "Jump to Import File"
- Keyboard: Press
-
Use Ctrl+Click instead:
- Hold
Ctrl+Clickinstead ofCmd+Clickto follow the link
- Hold
- Complex import patterns may not be detected
- Node modules imports are not resolved (by design for security)
- Very large files (>1MB) are skipped for performance
We welcome contributions! Here's how you can help:
- 🐛 Report bugs - Create an issue
- 💡 Suggest features - Start a discussion
- 🔧 Submit pull requests - See our contribution guidelines
- ⭐ Star the repo if you find it useful!
This extension is licensed under the MIT License.
- Built with ❤️ using the VS Code Extension API
- Inspired by the need for faster navigation in modern development workflows
- Thanks to all contributors and users who provide feedback!
Enjoying Go to Import? Leave a review and help others discover it! ⭐