
Open Related Files is a VS Code extension that allows you to quickly navigate files that are in the same folder and have the same name as the file you have currently opened.
Demo

Features
QiuckPick list
Use the command Open Related Files
or the default shortcut cmd+shift+r
. This will show the Open Related Files QuickPick list. The list shows all extensions for related files - i.e. if you have opened main.html
and there are main.css
and main.js
files in the same folder, the list will display css
and js
.
Use the command Create Related File
to create a new file next to the currently opened file. The new file will have the same name and the extension that you specified.
Custom shortcuts
openRelatedFiles.open
- Opens the QuickPick list.
- Default:
cmd+shift+r
.
Example / Default:
{
"key": "cmd+shift+r",
"command": "openRelatedFiles.open",
}
openRelatedFiles.withExtension
- Define your own custom shorctuts for a specific extension.
- Directly opens the related file with the specified extension if such file exists.
- No default shortcut provided.
Example:
{
"key": "alt+cmd+c",
"command": "openRelatedFiles.withExtension",
"args": "css"
}
openRelatedFiles.create
- Execute the 'Create Related File' command.
- No default shortcut provided.
Extension Settings
This extension contributes the following settings:
openRelatedFiles.limitToExtensions
:
Only look for this specific list of extensions, ignore all other files. Will be ignored if array is empty.
openRelatedFiles.openSingleFile
:
- Type:
boolean
- Default:
true
If there is only one related file, open it without prompt.