|
| Action | Shortcut |
|---|---|
| Open Spyglass | Ctrl+Alt+F |
VSCode Vim users — bind
<Space>fas your leader shortcut. See Vim setup below.
⌨️ Keyboard shortcuts
| Action | Shortcut |
|---|---|
| Navigate results | ↑ / ↓ |
| Open selected file | Enter |
| Open in split editor | Ctrl+Enter |
| Switch scope | Tab |
| Close | Escape |
| Toggle regex | Shift+Alt+R |
| Toggle case sensitive | Alt+C |
| Toggle whole word | Alt+W |
| Toggle preview panel | Shift+Alt+P |
| Toggle replace mode | Alt+R |
| History — previous query | Ctrl+↑ |
| History — next query | Ctrl+↓ |
| Copy path | Alt+Y |
| Multi-select toggle | Ctrl+Space / Ctrl+Click |
| Select all results | Ctrl+A |
| Open all selected | Shift+Enter |
| Reveal in Explorer | click the preview header |
🗺️ Search Scopes
| Scope | Description |
|---|---|
| Project | Full-text search across all files in the workspace |
| Open Files | Full-text search only within currently open editor tabs |
| Files | Fuzzy search by filename across the whole project |
| Recent | Recently opened files, ordered by most recent |
| Dir | Full-text search within the directory of the active file |
| Symbols | Workspace symbol search via LSP (requires a language extension) |
Switch between scopes with Tab while Spyglass is open.
🔄 Find & Replace
- Open Spyglass and type your search query
- Press
Alt+R(or click⇄) to enable replace mode - Type the replacement text in the second field
- Optionally tune case-sensitive / whole-word / glob filter
- Click Replace all — all matches replaced instantly via VS Code's edit API (supports undo)
👁️ Preview Panel
The right-side preview shows the file around the matched line with syntax highlighting. Lines modified since the last git commit are marked with a blue indicator in the gutter.
- Toggle with
Shift+Alt+Por the⊡button - Click the preview header to Reveal in Explorer
⚙️ Settings
| Setting | Default | Description |
|---|---|---|
spyglass.defaultScope |
project |
Scope on open: project openFiles files recent here symbols |
spyglass.maxResults |
200 |
Maximum number of results to display |
spyglass.keybindings.navigateDown |
ArrowDown |
Navigate down in results |
spyglass.keybindings.navigateUp |
ArrowUp |
Navigate up in results |
spyglass.keybindings.open |
Enter |
Open selected result |
spyglass.keybindings.close |
Escape |
Close Spyglass |
spyglass.keybindings.toggleRegex |
shift+alt+r |
Toggle regex mode |
spyglass.keybindings.togglePreview |
shift+alt+p |
Toggle preview panel |
🎹 Customizing Keybindings
Change the open shortcut
Open Keyboard Shortcuts (Ctrl+K Ctrl+S), search for Spyglass: Open Search and assign your preferred key.
Or edit keybindings.json directly (Ctrl+Shift+P → Open Keyboard Shortcuts (JSON)):
[
{
"key": "ctrl+alt+f",
"command": "spyglass.open",
"when": "!inputFocus || editorTextFocus"
}
]
Change shortcuts inside the panel
Add to your settings.json:
{
"spyglass.keybindings.navigateDown": "j",
"spyglass.keybindings.navigateUp": "k",
"spyglass.keybindings.toggleRegex": "ctrl+r",
"spyglass.keybindings.togglePreview": "ctrl+p"
}
🟢 Vim Setup
If you use the VSCode Vim extension, bind <Space>f just like Telescope in Neovim.
Add to your settings.json:
{
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<Space>", "f"],
"commands": ["spyglass.open"]
}
]
}
To disable the default Ctrl+Alt+F binding:
[
{
"key": "ctrl+alt+f",
"command": "-spyglass.open"
}
]
📋 Requirements
- VS Code
^1.85.0 - No additional dependencies — ripgrep is bundled automatically
- Git (optional) — required for change indicators in the preview panel
- A language server extension (optional) — required for the Symbols scope
🤝 Contributing
PRs and issues welcome at github.com/garroter/spyglass.
📄 License
MIT


