A VS Code extension that adds context menu items to open files with external applications. Configure multiple apps and associate them with specific file types.
- Multiple Applications: Add multiple external applications to the context menu
- File Type Associations: Associate apps with specific file types (extensions or filenames)
- Cross-Platform: Full support for Windows, macOS, and Linux
- Flexible Configuration: Support for both app names and full executable paths
- Smart Selection: Automatic app selection when only one matches, or quick pick menu for multiple matches
- Easy Setup: Configuration via VS Code settings (UI or JSON)
- Command Palette: Commands available in Command Palette for quick access
- Installation
- Quick Start
- Configuration
- Usage
- Examples
- Requirements
- Troubleshooting
- FAQ
- Known Issues
- Contributing
- Support
- License
- Open VS Code
- Go to Extensions view (
Ctrl+Shift+X/Cmd+Shift+X) - Search for "Open Files Externally"
- Click Install
For Visual Studio Code (Microsoft Marketplace):
code --install-extension tarikkavaz.open-with-context-menuFor VSCodium or other VS Code forks using Open VSX Registry:
codium --install-extension tarikkavaz.open-with-context-menuOr using the ovsx CLI tool:
ovsx install tarikkavaz.open-with-context-menuYou can also install directly from the Open VSX Registry in the Extensions view.
Configure apps and file type associations in VS Code settings:
- Open Settings (
Ctrl+,/Cmd+,) - Search for "Open Files Externally"
- Click "Edit in settings.json" to configure apps
{
"openWithContextMenu.apps": [
{
"name": "Typora",
"appName": "Typora",
"fileTypes": [".md", ".markdown"]
},
{
"name": "Preview",
"appName": "Preview",
"fileTypes": [".pdf", ".png", ".jpg"]
}
]
}- name (required): Display name shown in the context menu and quick pick
- appName (optional): Application name
- macOS: App bundle name (e.g., "Typora", "Sublime Text")
- Windows: Executable name without extension (e.g., "notepad", "code")
- Linux: Executable name (e.g., "gedit", "code")
- appPath (optional): Full path to the application executable
- Takes precedence over
appNameif provided - macOS: Path to
.appbundle or executable (e.g., "/Applications/Typora.app") - Windows: Path to
.exefile (e.g., "C:\Program Files\App\app.exe") - Linux: Path to executable (e.g., "/usr/bin/gedit")
- Takes precedence over
- fileTypes (required): Array of file extensions (with dot) or filenames
- Examples:
[".md", ".txt", ".cursorrules"] - Can also match language IDs for editor context
- Examples:
Note: Either appName or appPath must be provided for each app configuration.
- Use
appNamewith the app bundle name (e.g., "Typora", "Sublime Text") - Or use
appPathpointing to the.appbundle or executable inside it - Examples:
"appName": "Typora""appPath": "/Applications/Typora.app""appPath": "/Applications/Typora.app/Contents/MacOS/Typora"
- Use
appNamefor common apps (e.g., "notepad", "code") - Or use
appPathwith full path to.exefile - Example:
"appPath": "C:\\Program Files\\Typora\\Typora.exe"
appNamemay work for some apps viaxdg-open, butappPathis more reliable- Use
appPathwith full path to executable - Examples:
"appPath": "/usr/bin/gedit""appPath": "/usr/local/bin/code"
- Right-click on a file in the Explorer or Editor
- Select "Open Files Externally" from the context menu
- If multiple apps are configured for the file type, a quick pick menu will appear
- If only one app matches, it will open directly
- Open Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Type "Open Files Externally"
- Select "Open Files Externally"
- Choose the application from the quick pick menu
{
"openWithContextMenu.apps": [
{
"name": "Typora",
"appName": "Typora",
"fileTypes": [".md", ".markdown"]
}
]
}{
"openWithContextMenu.apps": [
{
"name": "GIMP",
"appName": "",
"appPath": "/usr/bin/gimp",
"fileTypes": [".png", ".jpg", ".jpeg", ".gif", ".bmp", ".xcf"]
},
{
"name": "LibreOffice Writer",
"appName": "",
"appPath": "/usr/bin/libreoffice",
"fileTypes": [".doc", ".docx", ".odt", ".rtf"]
},
{
"name": "Okular",
"appName": "",
"appPath": "/usr/bin/okular",
"fileTypes": [".pdf"]
}
]
}When multiple apps are configured for the same file type, a quick pick menu will appear:
{
"openWithContextMenu.apps": [
{
"name": "Photoshop",
"appName": "Photoshop",
"fileTypes": [".psd"]
},
{
"name": "Preview",
"appName": "Preview",
"fileTypes": [".psd"]
}
]
}- VS Code 1.60.0 or higher
Problem: You get an error that the application cannot be found.
Solutions:
- On macOS: Verify the app name matches the bundle name exactly (check in
/Applicationsfolder) - On Windows: Use the executable name without
.exeextension, or useappPathwith full path - On Linux: Use
appPathwith the full path to the executable instead ofappName - Check that the application is installed and accessible from the command line
Problem: The "Open Files Externally" option doesn't appear in the context menu.
Solutions:
- Reload the VS Code window (
Ctrl+R/Cmd+RorCtrl+Shift+P→ "Developer: Reload Window") - Verify the extension is installed and enabled
- Check that you're right-clicking on a file (not a folder)
- Ensure you have at least one app configured in settings
Problem: No apps appear in the quick pick menu or you get "No apps configured" message.
Solutions:
- Verify your configuration syntax is correct (valid JSON)
- Check that
fileTypesarray includes the extension of the file you're trying to open (with the dot, e.g.,.md) - Ensure either
appNameorappPathis provided for each app - Check the Output panel for extension errors (
View→Output→ select "Open Files Externally" from dropdown)
Problem: Paths with spaces or special characters don't work.
Solutions:
- Use double backslashes in JSON:
"C:\\Program Files\\App\\app.exe" - Or use forward slashes:
"C:/Program Files/App/app.exe" - Ensure the path is properly escaped in JSON
Problem: You changed the configuration but the menu doesn't reflect the changes.
Solutions:
- Reload the VS Code window (
Ctrl+R/Cmd+R) - Menu items are static, but commands work immediately - use Command Palette if needed
Yes! You can configure the extension to work with any file type by adding the file extension (with dot) to the fileTypes array.
- macOS: The app name is usually the name of the
.appbundle in/Applications. You can also right-click an app and select "Show Package Contents" to find the executable path. - Windows: The app name is the executable name without
.exe. You can find the path by right-clicking a shortcut and selecting "Properties" → "Target". - Linux: Use
which <app-name>to find the executable path, or check/usr/bin,/usr/local/bin, etc.
Yes! If multiple apps are configured for the same file type, a quick pick menu will appear when you use the context menu, allowing you to choose which app to use.
No, the extension requires a file to be saved to disk before it can be opened with an external application.
Not currently. You must use absolute paths or app names that are available in your system PATH.
Simply remove the app configuration from the openWithContextMenu.apps array in your settings.json file.
- Menu items are static and defined in
package.json. After changing configuration, commands work immediately, but you may need to reload the window for menu visibility changes. - On Linux,
appNamemay not work reliably for all applications. UseappPathfor best results.
Contributions are welcome! Here's how you can help:
- Fork the repository and create your feature branch (
git checkout -b feature/AmazingFeature) - Make your changes following the existing code style
- Test your changes on multiple platforms if possible
- Commit your changes with clear commit messages (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Clone the repository
- Install dependencies:
npm install - Open the folder in VS Code
- Press
F5to open a new Extension Development Host window - Make changes and test in the development window
Please use the GitHub Issues page to report bugs. Include:
- VS Code version
- Operating system
- Extension version
- Steps to reproduce
- Expected vs actual behavior
- Issues: GitHub Issues
- Repository: GitHub Repository
- VS Code Marketplace: Extension Page
If you find this extension helpful, please consider giving it a star on GitHub!
MIT