MagicSearch
Advanced Multi-Search & Highlight Tool for VSCode
A powerful search extension that enables multiple simultaneous searches with color-coded highlighting for each search pattern.
✨ Key Features
🔍 Multi-Search
- Multiple search patterns running simultaneously
- Unique colors for each search pattern
- Real-time search: Auto-update results during file editing
- Fast response with optimized memory efficiency
🎯 Quick Search
- Context menu search: Select text → Right-click → "Start Magic Search"
- Command palette:
Ctrl+Shift+P → "MagicSearch: Start Magic Search"
- Auto-section creation with instant search execution
🎨 Highlight Features
- Custom colors: Assign any color to each search pattern
- All files supported: Highlights across all open files
- State persistence: Search state maintained after tab switching
- Auto-update: Real-time highlight and result updates during code editing
🔄 Replace Features
- Single replace: Replace current focused occurrence
- Replace all: Batch replace all matches
- Cross-file: Bulk replacement across multiple files
🚀 How to Use
Basic Search
- Click the MagicSearch icon in the sidebar
- Enter search text in the search box
- Press 🔍 button or Enter key to execute search
- Use ↑↓ buttons to navigate between results
- Select text in the editor
- Right-click → "Start Magic Search"
- New section is added and search starts immediately
- Text is highlighted with a random color
Multi-Search
- Click + button to add new search section
- Set different search patterns for each section
- Each pattern is highlighted with a different color
Replace Operations
- Click ⮟ button to show replace UI
- Enter replacement text
- Execute single replace or replace all
🔧 Search Options
| Button |
Feature |
Description |
| Aa |
Case Sensitive |
Match case exactly |
| [ab] |
Whole Word |
Match whole words only |
| .* |
Regular Expression |
Use regex patterns |
| ▼ |
Replace |
Enable replace mode |
| 三 |
Range Search |
Search within selection |
| 📄 |
Tabs Only |
Search only in opened tabs (faster) |
| 🌐 |
Project Mode |
Search entire project |
📁 File Filtering
Include/Exclude Patterns
- Include:
*.ts,*.js - Search specific files only
- Exclude:
node_modules,dist - Exclude specific files/folders
- Press Enter to apply filters
Recommended Patterns
Include: *.ts,*.tsx,*.js,*.jsx
Exclude: node_modules,dist,build,coverage,.git
🔄 Real-time Search
MagicSearch automatically updates search results during file editing.
Example
- Execute search for "break" keyword
- Add new "break" in the editor
- Search results update automatically and new line is highlighted
Features
- Debounce processing: 500ms wait to reduce unnecessary searches
- Memory efficient: Re-search only modified files
- Background operation: Lightweight design that doesn't interfere with editing
⌨️ Keyboard Shortcuts
| Shortcut |
Action |
| Alt+Shift+M |
Start Magic Search with selected text |
| Enter |
Execute search (highlight only) |
| Enter in replace box |
Execute single replace |
| Enter in filter box |
Apply filter and search |
Customizing Shortcuts
Open keyboard shortcuts settings with Ctrl+K Ctrl+S and search for "Start Magic Search" to customize the keybinding.
🎯 Common Use Cases
Code Review
- Select variable/function name and right-click search
- Highlight multiple elements with color coding
Debugging
- Select error message to identify related locations
- Search multiple log levels simultaneously
Refactoring
- Search target elements to check impact scope
- Efficient renaming with bulk replace
API Exploration
- Select method name to find usage locations
- Cross-search library features
Real-time Search Optimization
- Debounce: Wait 500ms after file edit before re-searching
- Differential updates: Update UI only when match count changes
- Document cache: Avoid duplicate file reads
- Batch processing: Efficiently process multiple files in parallel
Large Projects
- Use 📄 Tabs Only mode (default)
- Actively use Include/Exclude patterns
- Real-time search targets only opened files
Enjoy efficient searching with MagicSearch! 🚀
| |