Auto Open Latest FilesAutomatically open the newest matching file from configured folders in VS Code. Features
Requirements
Sidebar UIThe extension contributes two views under the
Configuration View Behavior
Extension SettingsTargets (
|
| Property | Type | Required | Description |
|---|---|---|---|
id |
string | Yes | Unique target id used by command routing. |
path |
string | Yes | Absolute folder path to scan. |
include |
string[] | No | Patterns used to include files. Empty or omitted means all files. |
exclude |
string[] | No | Patterns used to exclude files/folders. |
sortBy |
string | No | modificationTime (default) or creationTime. |
searchSubdirectories |
boolean | No | Recursively scan nested subdirectories. Default: false. |
Example:
{
"vscode-auto-open-latest-files.targets": [
{
"id": "app-logs",
"path": "/absolute/path/to/logs",
"include": ["*.log", "*error*"],
"exclude": [".DS_Store"],
"sortBy": "modificationTime",
"searchSubdirectories": true
}
]
}
Include Matching Rules
- Matching is case-insensitive.
- regex patterns (for example
*.log,*test*,**/*.{log,txt}) are matched against file names. - Dot-prefixed literals (for example
.log) are treated as extension suffix matches. - Non-regex literals (for example
test) are matched as file-name substrings.
Exclude Matching Rules
- Matching is case-insensitive.
- regex patterns are matched against file names.
- Literal values exclude matching file names (eg:
.DS_Store).
Other Settings
| Setting | Type | Default | Description |
|---|---|---|---|
vscode-auto-open-latest-files.refreshInterval |
number | 60 |
Sidebar refresh cadence in seconds (minimum 5). |
vscode-auto-open-latest-files.autoOpen |
boolean | false |
Open newest matching files automatically during refresh cycles. |
vscode-auto-open-latest-files.autoClose |
boolean | false |
Close previously auto-opened tabs that are no longer newest results. |
Commands
| Command | Title | Usage |
|---|---|---|
vscode-auto-open-latest-files.openLatestFile |
Open Latest File | Main command from Command Palette; quick-picks target when needed. |
vscode-auto-open-latest-files.refreshTargets |
Refresh | Refreshes the Latest Files view. |
vscode-auto-open-latest-files.openLatestFileByUri |
Open Latest File | Internal click handler used by the tree item command. |
vscode-auto-open-latest-files.openLatestFileInEditor |
Open | Opens selected latest file as non-preview tab. |
vscode-auto-open-latest-files.revealLatestFileInExplorer |
Reveal in File Explorer | Reveals selected latest file in OS file manager. |
vscode-auto-open-latest-files.copyLatestFilePath |
Copy Path | Copies absolute file path. |
vscode-auto-open-latest-files.copyLatestFileRelativePath |
Copy Relative Path | Copies workspace-relative path. |
How It Works
- Configure one or more targets in Settings or in the
Configurationview. - Run
Open Latest File(or click a file inLatest Files). - The extension validates path and settings, scans for matches, sorts by recency, and opens the newest file.
- When
autoOpenis enabled, this also runs automatically each refresh cycle. - When
autoCloseis enabled, tabs opened by the auto-open flow are closed when they are no longer current newest matches.
Known Limitations
- Target paths must be absolute paths.
- Matching for include/exclude regexs is filename-focused, not full-path routing.
- When no files match a target, the command shows a warning and the tree item shows
No matching files.
License
GNU General Public License v3.0 (GPL-3.0-only).