Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Prism SearchNew to Visual Studio Code? Get it now.
Prism Search

Prism Search

uta-orange

|
1 install
| (0) | Free
Manage multiple search terms in independent search boxes and highlight them simultaneously in different colors.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

🌈 Prism Search

Manage multiple independent search terms, each highlighted in its own color, across the current file or the whole workspace.


✨ Key Features

  • Multiple independent search boxes — each with its own term, color, and options (case/whole word/regex)
  • Simultaneous multi-color highlighting — across the active editor and every visible split pane at once
  • Match navigation — step through each box's matches with ▲▼ or Enter / Shift+Enter
  • Workspace-wide search & replace — with optional ripgrep support for speed and automatic .gitignore handling
  • Replace, per box — including workspace-wide Replace All with a confirmation dialog and one-click Undo
  • Find in Selection — restrict a box's matches to your current selection
  • Search history & quick actions — reuse recent terms, or grab the word under your cursor via keybinding or icon

🔍 Using It

Highlighting

  • Type into a search box to highlight matches, in that box's color, in the active editor. Split panes are all highlighted too (the inactive pane is shown dimmer)
  • + Add Search Box adds a box with the next color in the palette
  • Aa / ab / .* toggle Match Case / Whole Word / Regex
  • The eye icon hides the highlight without stopping the search; ✕ removes the box

Navigating

  • ▲▼, or Enter / Shift+Enter in the input, jump to the next/previous match, starting from the cursor and wrapping around
  • The match count (1/12) always reflects where "next" will actually land

Workspace search

  • Click the folder icon 📁 to search the whole workspace instead of just the active file. Results appear as a clickable file/line list below the box
  • The "Include" field filters which files are searched, by name/path (plain text or globs, comma-separated)
  • Results are sorted by proximity to your current file

Replace

  • Click the replace icon to reveal Replace / Replace All / Undo
  • Current file: Replace All is a single undo step; the Undo button is just a shortcut for Ctrl+Z
  • Whole workspace: only Replace All is available, with a confirmation dialog showing the affected count. Since each file is a separate edit, Ctrl+Z only undoes the file you're in — use the Undo button to revert the whole batch at once
  • Regex mode supports $1, $2, $&, $$ in the replacement text

Other shortcuts

  • Ctrl+Alt+F adds the selection (or word under cursor) as a new search term, reusing the bottom box if it's still empty
  • The target icon on any box does the same, but always fills that specific box
  • The history icon shows recently used terms for this workspace
  • The color dot opens a color picker; a reset button appears once you've changed it from its default
  • The selection icon turns on Find in Selection, restricting that box to your current selection
  • A toolbar below the title bar toggles Visibility / Workspace Search / Match Case / Whole Word / Regex for all boxes at once
  • Search box state is saved per workspace and restored on restart

⚡ Ripgrep Integration

Workspace search uses a built-in scanner by default. Turn on prismSearch.workspaceSearch.useRipgrep to use rg (ripgrep) instead, if it's installed and on your PATH — faster, and respects .gitignore automatically:

{
  "prismSearch.workspaceSearch.useRipgrep": true
}

This extension doesn't bundle ripgrep. If rg can't be found, or a specific pattern isn't supported (e.g. lookahead/lookbehind), it silently falls back to the built-in scanner — turning the setting on never breaks anything.


📁 Workspace Search Exclude Settings

// .vscode/settings.json (per-workspace) or User Settings
{
  "prismSearch.workspaceSearch.excludeGlobs": [
    "**/node_modules/**",
    "**/.git/**",
    "**/dist/**",
    "**/generated/**"
  ],
  "prismSearch.workspaceSearch.respectFilesExclude": true
}
  • excludeGlobs replaces the default exclude list entirely (extend it yourself if you still need the defaults)
  • respectFilesExclude (on by default) also excludes anything matched by VS Code's own files.exclude / search.exclude

⚙️ Other Settings

{
  // Highlight inactive split panes too (default: true)
  "prismSearch.highlightInactiveEditors": false,

  // Defaults for newly created search boxes
  "prismSearch.newSearch.caseSensitive": false,
  "prismSearch.newSearch.wholeWord": false,
  "prismSearch.newSearch.regex": false,
  "prismSearch.newSearch.scope": "file" // or "workspace"
}

⚠️ Known Limitations

  • Without ripgrep, .gitignore is not respected (a VS Code API limitation) — customize excludeGlobs instead
  • Ripgrep's regex engine doesn't support lookahead/lookbehind/backreferences; those patterns fall back to the built-in scanner automatically for workspace search
  • Scans are capped (2000 files, 2MB/file, 500 matches total) to avoid runaway operations
  • Workspace search only re-runs when you change the term/options, not when other files change in the background

🛡️ Regex Mode Security Note

Regex patterns run as real JavaScript RegExp. Nested-quantifier patterns like (a+)+ can cause catastrophic backtracking, freezing the entire extension host. This extension detects common cases and blocks execution instead (the input gets an orange border) — but detection isn't exhaustive (e.g. alternation-based patterns can slip through). If this concerns you, use literal search instead. This check doesn't apply when ripgrep is used, since its regex engine is immune to this by design.


🛠️ Troubleshooting

Ripgrep doesn't seem to be used, even though I turned it on Make sure rg is installed and on your PATH (check with rg --version in a terminal). If it's missing, you'll see a one-time warning notification, and the extension automatically falls back to the built-in scanner until it's found.

Workspace search is missing a file I expect to see Check prismSearch.workspaceSearch.excludeGlobs and respectFilesExclude — a pattern may be excluding it. Files over 2MB, or scans beyond the file/match caps, are also skipped (see "Known Limitations").

The input turns orange, or shows no matches, in regex mode The pattern was flagged as a possible catastrophic-backtracking risk and wasn't executed, for safety (see "Regex Mode Security Note"). Simplify the pattern, or use literal search instead.


📄 License & Links

  • License: MIT (LICENSE)
  • Author: uta1214
  • Repository: github.com/uta1214/prism-search

日本語版 (Japanese)

複数の検索語をそれぞれ別の検索ボックスで管理し、色分けしてハイライトする拡張機能です。現在のファイルだけでなく、ワークスペース全体も検索できます。


✨ 主な機能

  • 複数の独立した検索ボックス — 検索語・色・オプション(大文字小文字/単語単位/正規表現)をそれぞれ個別に管理
  • 複数色での同時ハイライト — アクティブなエディタと、表示中の分割ペイン全てに同時表示
  • マッチ間の移動 — ▲▼や Enter / Shift+Enter で各ボックスのマッチを順に移動
  • ワークスペース全体の検索・置換 — ripgrepを使えば高速化・.gitignore自動対応も可能
  • ボックスごとの置換 — ワークスペース全体のReplace Allは確認ダイアログ+ワンクリックUndo付き
  • 選択範囲内検索(Find in Selection) — 現在の選択範囲だけに絞って検索
  • 検索履歴・クイック操作 — 直近の検索語を再利用、キーバインド/アイコンでカーソル位置の単語を即検索

🔍 使い方

ハイライト

  • 検索ボックスに入力すると、アクティブなエディタ内がその色でハイライトされる。分割ペインも全てハイライトされる(非アクティブなペインは少し暗く表示)
  • 「+ Add Search Box」で色パレットの次の色を割り当てたボックスを追加
  • Aa / ab / .* で大文字小文字区別・単語単位・正規表現を切り替え
  • 目のアイコンはハイライト表示だけをON/OFF(検索自体は止まらない)。✕ でボックスを削除

移動

  • ▲▼、または入力欄で Enter / Shift+Enter で次/前のマッチへ移動。カーソル位置から開始し、末尾/先頭で循環
  • マッチ数(1/12)は常に「次へ」で実際に着地する位置と一致する

ワークスペース検索

  • フォルダアイコン📁でワークスペース全体検索に切り替え。結果はボックス下にファイル/行のクリック可能な一覧で表示
  • 「Include」欄で検索対象ファイルを名前/パスで絞り込み(プレーンテキストまたはglob、カンマ区切り)
  • 結果は現在のファイルに近い順に並ぶ

置換

  • 置換アイコンでReplace / Replace All / Undoを表示
  • 現在のファイル: Replace Allは1回のUndoでまとめて戻せる。UndoボタンはCtrl+Zのショートカット
  • ワークスペース全体: Replace Allのみ利用可(実行前に対象件数の確認ダイアログあり)。各ファイルへの変更は独立しているため、Ctrl+Zは今のファイルにしか効かない。まとめて戻すにはUndoボタンを使う
  • 正規表現モードでは置換後文字列に $1, $2, $&, $$ が使える

その他のショートカット

  • Ctrl+Alt+F で選択範囲(無ければカーソル位置の単語)を新規検索語として追加。末尾のボックスが空ならそれを再利用
  • 各ボックスのターゲットアイコンも同様だが、常にそのボックス自身に入力する
  • 履歴アイコンでこのワークスペースの直近の検索語を表示
  • 色ドットでカラーピッカーを開く。変更後はリセットボタンが表示される
  • 選択範囲アイコンで Find in Selection(選択範囲内のみ検索)をON
  • タイトルバー下の専用ツールバーで、表示/ワークスペース検索/大文字小文字区別/単語単位/正規表現を全ボックス一括切り替え
  • 検索ボックスの状態はワークスペースごとに保存され、再起動後も復元される

⚡ Ripgrep統合

ワークスペース検索は既定で内蔵スキャナを使用。prismSearch.workspaceSearch.useRipgrep をONにすると、PATH上に rg(ripgrep)があればそちらを使用する(高速・.gitignoreを自動で尊重):

{
  "prismSearch.workspaceSearch.useRipgrep": true
}

ripgrepは同梱していません。rg が見つからない場合、または一部のパターンが非対応な場合(例: 先読み/後読み)は、自動的に内蔵スキャナへフォールバックします。ONにしても壊れることはありません。


📁 ワークスペース全体検索の除外設定

// .vscode/settings.json (ワークスペース単位) または ユーザー設定
{
  "prismSearch.workspaceSearch.excludeGlobs": [
    "**/node_modules/**",
    "**/.git/**",
    "**/dist/**",
    "**/generated/**"
  ],
  "prismSearch.workspaceSearch.respectFilesExclude": true
}
  • excludeGlobs は既定の除外リストを丸ごと上書きする(必要なら自分でコピー&追記)
  • respectFilesExclude(既定ON)は、VS Codeのfiles.exclude / search.excludeのパターンもあわせて除外する

⚙️ その他の設定

{
  // 非アクティブな分割ペインにもハイライトを表示するか(既定: true)
  "prismSearch.highlightInactiveEditors": false,

  // 新規作成する検索ボックスの既定値
  "prismSearch.newSearch.caseSensitive": false,
  "prismSearch.newSearch.wholeWord": false,
  "prismSearch.newSearch.regex": false,
  "prismSearch.newSearch.scope": "file" // または "workspace"
}

⚠️ 既知の制約

  • ripgrepを使わない場合、.gitignore は考慮されない(VS Code API側の制限)。excludeGlobs でカスタマイズ可能
  • ripgrepの正規表現エンジンは先読み/後読み/後方参照に非対応。該当パターンはワークスペース検索時に自動で内蔵スキャナへフォールバック
  • 暴走防止のためスキャンには上限がある(最大2000ファイル・1ファイル2MBまで・マッチ数最大500件)
  • ワークスペース検索は検索語/オプション変更時のみ再実行(他ファイルの背後での変更は自動検知しない)

🛡️ 正規表現モードのセキュリティ上の注意

正規表現は実際のJavaScript RegExp として実行されます。(a+)+ のような入れ子の量指定子は「壊滅的バックトラッキング」を起こし、拡張機能ホスト全体が無応答になることがあります。この拡張機能は代表的なパターンを検出して実行をブロックします(入力欄がオレンジ枠になる)が、完全ではありません(alternationを使ったパターンなどはすり抜けます)。心配な場合はリテラル検索を使ってください。ripgrep使用時はエンジンの特性上この問題自体が起こらないため、このチェックは適用されません。


🛠️ トラブルシューティング

ripgrepをONにしたのに使われている気配がない rg がインストール済みで PATH 上にあるか確認してください(ターミナルで rg --version を実行)。無い場合は一度だけ警告通知が表示され、見つかるまで自動的に内蔵スキャナにフォールバックします。

ワークスペース検索で期待したファイルが出てこない prismSearch.workspaceSearch.excludeGlobs と respectFilesExclude を確認してください。パターンに引っかかって除外されている可能性があります。2MBを超えるファイルや、ファイル数/マッチ数の上限(「既知の制約」参照)を超えた分もスキップされます。

正規表現モードで入力欄がオレンジ枠になる/マッチが出ない 壊滅的バックトラッキングの疑いがあるパターンとして検出され、安全のため実行されなかった状態です(「正規表現モードのセキュリティ上の注意」参照)。パターンを単純化するか、リテラル検索を使ってください。


📄 ライセンス・リンク

  • ライセンス: MIT
  • 作者: uta
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft