Markdown File Link
Type @ in a Markdown file, search workspace files, and insert a clickable relative Markdown link.
This extension is intentionally small: it only activates for Markdown files, has no runtime dependencies, and does not send any workspace data outside VS Code.
中文说明
Features
@ file completions in Markdown documents.
- Fuzzy search by file name or workspace-relative path.
- Inserts links relative to the current Markdown file.
- Handles filenames with spaces by using Markdown angle-bracket link targets.
- Command Palette fallback:
Markdown File Link: Insert Workspace File Link.
- Works in VS Code-compatible editors such as Cursor when installed in that editor's extension directory.
Usage
Open a Markdown file and type:
@
Continue typing a file name or path, then select a suggestion.
For example, when editing docs/demo.md, selecting server/main/main.go inserts:
[server/main/main.go](https://github.com/jarvanstack/markdown-at-file-link/blob/master/../server/main/main.go)
If the completion list does not open automatically, run Trigger Suggest:
- macOS:
Ctrl+Space or the keybinding configured in your editor.
- Windows/Linux:
Ctrl+Space.
You can also run this command from the Command Palette:
Markdown File Link: Insert Workspace File Link
Settings
| Setting |
Default |
Description |
markdownAtFileLink.maxFiles |
20000 |
Maximum workspace files to index. |
markdownAtFileLink.maxSuggestions |
200 |
Maximum completion items shown after @. |
markdownAtFileLink.exclude |
See package.json |
Glob patterns excluded from the file index. |
markdownAtFileLink.linkText |
relativePath |
Link label style: relativePath or fileName. |
markdownAtFileLink.insertStyle |
markdownLink |
Insert style: markdownLink or plainPath. |
Example:
{
"markdownAtFileLink.linkText": "fileName",
"markdownAtFileLink.maxSuggestions": 100
}
Local Development
Install dependencies:
npm install
Run a syntax check:
npm run lint
Open this repository in VS Code, press F5, and test the extension in the Extension Development Host.
To install the extension from source into local VS Code and Cursor extension directories:
./install.sh
Then run Developer: Reload Window.
Package
Create a .vsix package:
npm run package
Publish to Visual Studio Marketplace
Publishing uses the official @vscode/vsce tool.
- Create or verify the Marketplace publisher named
jarvanstack.
- Create a Personal Access Token with Marketplace publishing permission.
- Login:
npx vsce login jarvanstack
- Publish:
npm run publish
You can also publish from GitHub Actions:
- Add a repository secret named
VSCE_PAT.
- Push changes to the
master branch.
- The
Publish workflow automatically bumps the patch version, publishes to the Marketplace, and pushes the release commit and tag back to master.
The workflow can also be run manually from GitHub Actions.
Official docs:
License
MIT