Open Files Externally
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.
Features
- 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
Table of Contents
Installation
Via VS Code Extensions Marketplace
- Open VS Code
- Go to Extensions view (
Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Open Files Externally"
- Click Install
Via Command Line (VS Code)
For Visual Studio Code (Microsoft Marketplace):
code --install-extension tarikkavaz.open-with-context-menu
Via Open VSX Registry
For VSCodium or other VS Code forks using Open VSX Registry:
codium --install-extension tarikkavaz.open-with-context-menu
Or using the ovsx CLI tool:
ovsx install tarikkavaz.open-with-context-menu
You can also install directly from the Open VSX Registry in the Extensions view.
Quick Start
Add this to your VS Code settings.json to get started with a simple example:
{
"openWithContextMenu.apps": [
{
"name": "Typora",
"appName": "Typora",
"fileTypes": [".md", ".markdown"]
}
]
}
Then right-click any .md file and select "Open Files Externally" from the context menu.
Configuration
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"]
}
]
}
Configuration Properties
- 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
appName if provided
- macOS: Path to
.app bundle or executable (e.g., "/Applications/Typora.app")
- Windows: Path to
.exe file (e.g., "C:\Program Files\App\app.exe")
- Linux: Path to executable (e.g., "/usr/bin/gedit")
- fileTypes (required): Array of file extensions (with dot) or filenames
- Examples:
[".md", ".txt", ".cursorrules"]
- Can also match language IDs for editor context
Note: Either appName or appPath must be provided for each app configuration.
macOS
- Use
appName with the app bundle name (e.g., "Typora", "Sublime Text")
- Or use
appPath pointing to the .app bundle or executable inside it
- Examples:
"appName": "Typora"
"appPath": "/Applications/Typora.app"
"appPath": "/Applications/Typora.app/Contents/MacOS/Typora"
Windows
- Use
appName for common apps (e.g., "notepad", "code")
- Or use
appPath with full path to .exe file
- Example:
"appPath": "C:\\Program Files\\Typora\\Typora.exe"
Linux
appName may work for some apps via xdg-open, but appPath is more reliable
- Use
appPath with full path to executable
- Examples:
"appPath": "/usr/bin/gedit"
"appPath": "/usr/local/bin/code"
Usage
- 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
Command Palette
- 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
Examples
Using appName (macOS)
{
"openWithContextMenu.apps": [
{
"name": "Typora",
"appName": "Typora",
"fileTypes": [".md", ".markdown"]
}
]
}
Using appPath
{
"openWithContextMenu.apps": [
{
"name": "Sublime Text",
"appPath": "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
"fileTypes": [".js", ".ts", ".json", ".py"]
}
]
}
Multiple Apps for Same File Type
When multiple apps are configured for the same file type, a quick pick menu will appear:
{
"openWithContextMenu.apps": [
{
"name": "Typora",
"appName": "Typora",
"fileTypes": [".md"]
},
{
"name": "VS Code",
"appName": "code",
"fileTypes": [".md"]
}
]
}
Requirements
Troubleshooting
App Not Found
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
/Applications folder)
- On Windows: Use the executable name without
.exe extension, or use appPath with full path
- On Linux: Use
appPath with the full path to the executable instead of appName
- 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+R or Ctrl+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
fileTypes array includes the extension of the file you're trying to open (with the dot, e.g., .md)
- Ensure either
appName or appPath is provided for each app
- Check the Output panel for extension errors (
View → Output → select "Open Files Externally" from dropdown)
Path Issues on Windows
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
FAQ
Can I use this extension with any file type?
Yes! You can configure the extension to work with any file type by adding the file extension (with dot) to the fileTypes array.
How do I find the correct app name or path?
- macOS: The app name is usually the name of the
.app bundle 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.
Does the extension work with unsaved files?
No, the extension requires a file to be saved to disk before it can be opened with an external application.
Can I use environment variables in paths?
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.
Known Issues
- 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,
appName may not work reliably for all applications. Use appPath for best results.
Contributing
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
Development Setup
- Clone the repository
- Install dependencies:
npm install
- Open the folder in VS Code
- Press
F5 to open a new Extension Development Host window
- Make changes and test in the development window
Reporting Bugs
Please use the GitHub Issues page to report bugs. Include:
- VS Code version
- Operating system
- Extension version
- Steps to reproduce
- Expected vs actual behavior
Support
If you find this extension helpful, please consider giving it a star on GitHub!
License
MIT