Search Everywhere (PyCharm style)
PyCharm's "Shift Shift" search in VS Code: one popup to search files, classes, symbols, commands and
text. Results are ranked the way PyCharm ranks them, with recent files at the top.
It is adapted to one thing PyCharm does not have to deal with: PyCharm opens one project per window,
while a VS Code workspace can hold several projects side by side (a multi-root workspace). The search
covers the project of the file you are editing, and Shift Shift again (or the globe button) widens
it to the whole workspace. See Active project below.
Install
Requirements: VS Code 1.109 or newer, Node.js, and the code command on the PATH (the VS Code
installer adds it by default on Windows).
git clone https://github.com/ThongvanAlexis/vscode-search-everywhere.git
cd vscode-search-everywhere
npm install # once: fetches the build tools
npm run install-local # checks, builds, creates search-everywhere.vsix and installs it in VS Code
Then, in VS Code: Ctrl+Shift+P then Developer: Reload Window, or close and reopen VS Code.
Without the command line: Extensions view (Ctrl+Shift+X), … menu at the top, Install from
VSIX…, then pick search-everywhere.vsix (created by npm run package).
- Update after changing the code: run
npm run install-local again.
- Uninstall:
code --uninstall-extension ThongvanAlexis.search-everywhere-pycharm-style, or the
Uninstall button in the Extensions view.
Use
| Key |
Effect |
Shift Shift |
opens the search (All tab) |
Shift Shift, popup open |
toggles EVERYTHING: the active project only, or every project in the workspace |
Tab / Shift+Tab |
next / previous tab: All, Classes, Files, Symbols, Actions, Text |
Enter |
opens the result |
Shift+Enter |
opens the result in an editor to the side |
Alt+C / Alt+W / Alt+X |
Text tab: match case / whole words / regex |
Esc |
closes |
- Active project: in a workspace with several folders (for example
frontend and backend), the
search only covers the folder that contains the active editor's file. The top line says so:
"Searching in project frontend". The globe button to the right of the input (or Shift Shift)
switches to "Searching in EVERYTHING". Each time the popup opens, it goes back to the active
project.
- From the explorer:
Shift Shift while the explorer has focus searches the project of the
selected file or folder (for example the root folder backend). The right-click Search
Everywhere in This Project does the same.
- VS Code does not give extensions the explorer's selection. The extension therefore runs Copy
Path, reads the path, then puts back the text that was on the clipboard.
- Two side effects: if the clipboard held an image or files, they are replaced by that text; and
the Windows clipboard history (
Win+V) may keep the path.
- The
searchEverywhere.followExplorerSelection setting turns this off. From the editor, the
clipboard is never touched.
- You can click the icons at the top right to switch tabs; the active tab is checked.
capDi finds capture_dialogs.py and CDP finds CaptureDialogsPane: as in PyCharm, the typed
letters land on word starts.
tools/capt limits the search to folders that contain tools.
file.py:42 opens the file at line 42.
* is a wildcard. In the input box it shows as ∗: this is on purpose (see
docs/02-vscode-api.md).
- Classes and Symbols come from the language server. For Python, this needs Microsoft's Python
extension (Pylance).
- Actions lists the extensions' commands. The last row opens VS Code's command palette with the same
text, for VS Code's built-in commands.
PyCharm-style shortcuts (optional)
The extension only takes Shift Shift, so that nothing breaks. To get PyCharm's shortcuts back, open
Ctrl+Shift+P then Preferences: Open Keyboard Shortcuts (JSON) and add:
[
{ "key": "ctrl+shift+n", "command": "searchEverywhere.openFiles" },
{ "key": "ctrl+n", "command": "searchEverywhere.openClasses" },
{ "key": "ctrl+alt+shift+n", "command": "searchEverywhere.openSymbols" },
{ "key": "ctrl+shift+a", "command": "searchEverywhere.openActions" }
]
Note: in VS Code, Ctrl+N creates a file and Ctrl+Shift+N opens a window. These lines replace
those shortcuts.
Settings
Ctrl+, then search for "Search Everywhere".
| Setting |
Default |
Purpose |
searchEverywhere.exclude |
.venv, venv, __pycache__, node_modules, caches, .idea |
folders to skip, on top of files.exclude and search.exclude |
searchEverywhere.defaultScope |
project |
when the popup opens: the active project (project) or the whole workspace (everything) |
searchEverywhere.followExplorerSelection |
true |
Shift Shift in the explorer follows the selection (goes through the clipboard, see above) |
searchEverywhere.recentFilesAtTop |
true |
recent files always first, as in PyCharm |
searchEverywhere.maxRecentFiles |
50 |
size of the history, per workspace |
searchEverywhere.textSearchInAllTab |
true |
text matches at the bottom of the All tab |
searchEverywhere.textSearchMinQueryLength |
3 |
minimum query length before the All tab searches text |
Develop
npm run check # type check + unit tests (vitest)
npm run test:integration # starts a separate VS Code instance and tests the search popup
npm run watch # rebuilds on every change
F5 in VS Code opens a second window with the extension loaded from the sources.
Documentation
The documents in docs/ are in French.
docs/01-pycharm-search-everywhere.md: how PyCharm ranks results, with the intellij-community
source files to read
docs/02-vscode-api.md: what VS Code allows, and the workarounds
docs/03-architecture.md: code layout and deliberate differences from PyCharm
tools/pycharm-oracle/: program that checks our matcher against PyCharm's
LICENSE, NOTICE.md: Apache 2.0; part of the code is ported from the IntelliJ Platform