Peek into matching files under your cursor. Automatically underline filenames in the editor when they exist in your workspace.
- Underlines filenames like
config.json
,README.md
,notes.txt
only if they exist in your project. - Peek the closest matching file using:
Cmd+Alt+P
(macOS) /Ctrl+Alt+P
(Windows/Linux)- Or by
Alt+Cmd+Click
(like a definition peek)
- Smart file resolution:
- Chooses the closest file path based on folder depth
- Penalizes upward traversal using a configurable
parentTraversalCost
If your code or text contains a string like:
../data/schema.json
And a file named schema.json
exists anywhere in your workspace, the word will be underlined. You can then:
- Press
Cmd+Alt+P
orAlt+Cmd+Click
to peek that file.
You can customize behavior via VS Code settings:
Setting | Type | Default | Description |
---|---|---|---|
peekFiles.parentTraversalCost |
number | 1000 |
Cost of going up a directory when ranking file matches |
peekFiles.fileExtensions |
string[] | ["json", "md", "txt", "yaml", "yml"] |
List of file extensions to underline and peek |
Example settings.json
:
{
"peekFiles.parentTraversalCost": 500,
"peekFiles.fileExtensions": ["json", "ts", "tsx", "md"]
}
VS Code already lets you peek symbols and definitions, but it doesn’t support peeking random filenames — especially when written as plain text or code comments. This extension helps bridge that gap.
- Only matches by basename (not relative paths)
- Ignores
node_modules/**
for performance - Currently only peeks to the first line of the file
- Clone this repo
- Run
npm install
- Run the extension in the VS Code Extension Development Host
- PRs welcome!
To build and publish:
vsce package
vsce publish
MIT © John Ky