Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Focus FileNew to Visual Studio Code? Get it now.
Focus File

Focus File

1Asy-bit

|
1 install
| (0) | Free
Reveal the active file in the Explorer with a one-click button in the Explorer title bar (between Refresh and Collapse)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Focus File

English · 中文


English

Reveal the active file in the Explorer with a one-click button: a locate icon in the Explorer title bar, placed between Refresh and Collapse All.

Features

  • Locate button in the Explorer header — a navigation@35 button precisely between Refresh ↔ Collapse All (built-in Refresh is order 30, Collapse All is order 40, this button is order 35)
  • Reveal on click — focuses the Explorer, scrolls to the active file, highlights it, and expands the parent folders as needed
  • No active file? — shows a friendly notice instead of doing nothing
  • Command Palette — also available as Locate Current File in Explorer

Usage

Open a file, then click the locate icon in the top-right corner of the Explorer (New File / New Folder / Refresh / 🎯 Locate / Collapse All). No configuration needed.

FAQ

Icon not showing? The button only appears in the Explorer title bar when a folder is open. Without a folder, the Explorer header toolbar is not shown — the Command Palette command still works.

Development

npm install
npm run compile     # compile TypeScript to dist/
npm run package     # package a .vsix

License

MIT


中文

在资源管理器标题栏(最外层文件夹行)的工具栏中,为"刷新"和"折叠全部"之间增加一个 定位图标(🎯)。点击即可在资源管理器中滚动并选中当前正在编辑的文件。

功能特性

  • 资源管理器头部定位按钮——navigation@35 定位按钮,精确位于 刷新 ↔ 折叠全部 之间(内置刷新 order 30、折叠全部 order 40,本按钮 order 35)
  • 点击即定位——焦点切到资源管理器,自动滚动到当前文件、高亮选中,并展开必要的父级文件夹
  • 无活动文件时——给出友好提示,而不是无响应
  • 命令面板——也可通过 在资源管理器中定位当前文件 命令执行

使用

打开一个文件,点击资源管理器右上角(新建文件/新建文件夹/刷新/🎯定位/折叠全部)中的定位图标即可。无需任何配置。

常见问题

图标没出现? 本按钮只在有文件夹打开时出现在资源管理器(Explorer)标题栏。若尚未打开任何文件夹,资源管理器不显示该工具栏,命令面板中的同名命令依然可用。

开发

npm install
npm run compile     # tsc 编译到 dist/
npm run package     # 生成 .vsix

许可证

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft