Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>MagicSearchNew to Visual Studio Code? Get it now.
MagicSearch

MagicSearch

Roki

|
30 installs
| (0) | Free
Search for several words at once, each highlighted in its own color, with regex, replace and real-time updates.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

MagicSearch

Search for several words at once, each highlighted in its own color.

MagicSearch adds a search sidebar where every search lives in its own section with its own color. All sections stay highlighted in the editor at the same time, keep up with your edits, and can replace text across files.

MagicSearch in VS Code: two search sections, "results" in red and "regex" in pink, highlighted at the same time in the editor, each with its match count and a list of matching lines

Note: The sidebar's labels, tooltips and messages are in Japanese. All features work the same in any VS Code display language, and this README explains every button.

Features

  • Several searches at once: Add as many sections as you need. Each one has its own search text, options, color and result list
  • Color highlights: Matches are highlighted in the section's color in every visible editor and marked in the scrollbar
  • Right-click search: Select text, right-click and choose Start Magic Search (or press Alt+Shift+M)
  • Real-time updates: Results and highlights follow your edits
  • Replace: Replace the current match, or all matches across files in one undoable edit
  • Options: Match case, whole word (also for Japanese and symbols such as $var), regular expressions, search inside a selection, include / exclude files
  • Scope: Files open in tabs (default), or the whole workspace
  • Fits your theme: Works in light, dark and high contrast themes and in narrow sidebars, and can be used with the keyboard and screen readers
Dark (replace box open) High contrast Light, narrow sidebar
Sidebar in a dark theme with the replace box open Sidebar in a high contrast theme Sidebar in a light theme at 260px width

Getting Started

  1. Select a word in the editor
  2. Right-click and choose Start Magic Search, or press Alt+Shift+M
  3. The MagicSearch sidebar opens and the word is highlighted. Select another word and do it again to add a second color

You can also click the MagicSearch icon in the Activity Bar, type in the search box and press Enter.

Usage

Search and move between matches

  1. Type in the search box and press Enter (or click 🔍)
  2. Press Enter again to go to the next match and Shift+Enter to go to the previous one, as in VS Code's find box. The ↓ / ↑ buttons and F3 / Shift+F3 do the same
  3. Click a line in the result list to jump to it
  4. Clear the search box to remove that section's results and highlights right away

Several searches

  • Click + at the bottom of the sidebar to add a section. Each section is searched and highlighted on its own
  • A new section starts with the most vivid color of your theme's find-highlight hue (the top-right of the color picker). Change it with the color box
  • Right-click search uses an empty, unused section if there is one (no search text, no filters, default options); otherwise it adds a section. It picks a random bright color
  • Click × to remove a section and its highlights

Replace

  1. Click ⮟ next to the search box to show the replace box
  2. Type the replacement text
  3. Click the first button after the replace box (one box) to replace the current match, or press Enter in the replace box. Click the second button (two boxes) to replace all matches
  • Replace all changes every match as one edit, so one Ctrl+Z undoes it. Files are not opened in tabs; changed files stay unsaved until you save them (for example File > Save All)
  • Before replacing, MagicSearch re-reads the files with matches, including files that are not open (for example after git checkout), so text is replaced where it is now. If the current match moved, single replace refreshes the results and asks you to replace again instead of replacing the wrong text
  • While a search is still running, replacing is refused with a message. Replace after it finishes

Search Options

Button Option Description
Aa Match case Match upper and lower case exactly (also in regex mode)
[ab] Whole word Match whole words only. Works with Japanese and with words that start with a symbol, such as $var, and in regex mode
.* Regular expression Use a JavaScript regular expression. An invalid one is reported in the result header
☰ Search in selection Search only inside the text selected when you turn it on. With no selection it asks you to select a range. The range moves and grows as you edit above or inside it
📄 Tabs only (default) Search every file open in a tab, including tabs hidden behind others
🌐 Whole workspace Search all files in the workspace folders
⮟ Replace Show or hide the replace box

Include / Exclude

  • include: only search matching files, for example *.ts,*.js
  • exclude: skip matching files and folders, for example node_modules,*.min.js
  • Separate patterns with commas. * matches any characters and ? matches one character. A pattern without * or ? matches if the file name or path contains it (ignoring case)
  • Press Enter in the box to apply it

Whole-workspace search always skips the folders node_modules, build, dist, out, coverage, .git, .vscode, temp and tmp (in any letter case), binary files such as images and archives, and files outside the workspace folders.

Real-time Updates

After you edit a file, MagicSearch waits 300 ms and searches that file again with the same text, options and scope (selection range and include / exclude) as the original search.

  • Highlights disappear as soon as the text no longer matches, and new matches are highlighted
  • The result list is updated when the number or position of matches changes
  • Files edited while a search is running are searched again as soon as it finishes
  • Files changed without being shown are searched again too, for example when Ctrl+Z undoes a replace-all across files. Many files changed at once are updated together

Keyboard Shortcuts

Shortcut Action
Alt+Shift+M Search the selected text (in the editor)
Enter in the search box Search. Once results are shown, go to the next match
Shift+Enter in the search box Go to the previous match
F3 / Shift+F3 in a section Go to the next / previous match
Enter in the replace box Replace the current match
Enter in include / exclude Apply the filter and search again
Tab, then Enter / Space Jump to a result, fold a file, or show / hide the result list

To change Alt+Shift+M, open Keyboard Shortcuts (Ctrl+K Ctrl+S) and search for "Start Magic Search".

Performance

  • Whole-workspace search reads files that are not open without loading them as editor documents, so language extensions do not start analyzing them. In our measurement, 2000 files took about 0.6 seconds
  • Open files are searched including unsaved edits
  • Files are decoded the way VS Code would: by BOM (UTF-8 / UTF-16), as UTF-16 without a BOM, or with your files.encoding setting. Only when files.autoGuessEncoding is on (or the encoding cannot be decoded by the extension, such as cp437) does VS Code open the file, up to 200 files per search. MagicSearch tells you if it skipped any
  • Moving between matches only moves the current mark; the result list is not rebuilt
  • Only whole-workspace searches show a notification (with a Cancel button). Tab and selection searches show progress in the status bar

For large workspaces, keep the default 📄 Tabs only scope, or narrow whole-workspace searches with include / exclude.

Requirements

VS Code 1.102 or later. No settings are needed.

Known Limitations

  • The sidebar text is in Japanese
  • Whole-workspace search looks at up to 5000 files and skips files larger than 10 MB
  • The result list shows up to 500 characters of each line

Release Notes

See CHANGELOG.md.

Feedback

Report bugs and ideas on GitHub Issues.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft