VS Code Web:跨文件搜索快捷键提示
每个会话显示一次提示,提醒 Ctrl+Shift+F 用于全局搜索(github.dev 也适用)。
可复制的代码
/* Show a one-time hint about Ctrl+Shift+F for find-in-files (works on github.dev too) */
(function () {
if (sessionStorage.getItem('vsc-find-hint-seen')) return;
const tip = document.createElement('div');
tip.textContent = 'Tip: press Ctrl+Shift+F to search across all files';
Object.assign(tip.style, {
position: 'fixed', left: '50%', top: '12px', transform: 'translateX(-50%)',
zIndex: 99999, padding: '8px 14px', background: '#1f2328', color: '#fff',
borderRadius: '6px', fontFamily: 'system-ui, sans-serif', fontSize: '12px',
boxShadow: '0 4px 14px rgba(0,0,0,0.3)', cursor: 'pointer'
});
tip.addEventListener('click', () => tip.remove());
document.body.appendChild(tip);
sessionStorage.setItem('vsc-find-hint-seen', '1');
setTimeout(() => tip.remove(), 6000);
})();
如何使用此示例
- 用上方按钮复制代码。
- 安装 JustZix(2 分钟),在目标页面打开扩展。
- 添加一条匹配该页面的新规则。
- 将代码粘贴到规则的 JavaScript 面板并保存 — 每次访问页面时都会运行。
为此示例评分
暂无评分 — 成为第一个。