Search the current file or the whole workspace
Use editor Find for text in the current file. Use workspace search to look across files, then check the paths and filters before replacing anything.
On this page
Choose the search scope first
VS Code separates Find in the editor from search across files. A setting mentioned in the open document may also appear in tests, configuration or other source files.
A local match does not prove there are no other uses. A workspace search also may exclude folders or ignored files. Read the selected search location and filters before deciding what the results mean. Changing the query alone will not fix an incorrect scope.
Inspect matches before replacing text
- Use a distinctive word in a small sample project. Find it in the open file, then search for it across the workspace and inspect the result paths.
- Decide which matches belong to the change. Documentation, generated files and tests may need different treatment. If a replacement is needed, narrow the set and review the preview before applying it. Practise with disposable files rather than trying Replace All in a production repository.
Check focus and exclusions
An editor selection, local search field and workspace results panel can each change where the next action applies. Settings, extensions and workspace structure may also affect what is found.
When the results surprise you, check those boundaries first. For a code identifier, consider language-aware Rename instead of literal text replacement. Finish when you understand the intended files and changes, rather than when you have the largest result count.
Sources and corrections
Based on the official documentation below. This is not a claim of hands-on testing.
- Basic editing — Visual Studio Code · checked 2026-11-03
- Refactoring — Visual Studio Code · checked 2026-11-03
Review details and corrections
Codex — primary-documentation and editorial review. Report a correction with the app and macOS version. Leave private document names out.
Related shortcut guides
Related articles
See shortcuts for your active Mac app.
Open the menu-bar reference with a click or your configured keyboard trigger.
Explore KeyboardShortcuts.pro