0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【VSCode】ファイル内検索する時の対象パスまたは除外パスを指定する

Last updated at Posted at 2025-02-22

VSCodeでファイル内文字列検索の範囲を絞り込む

VSCodeでサイドメニューの検索ダイアログからファイル内文字列検索する際、検索範囲のパスと、反対に検索範囲に含めないパスを指定することができます。

右下にある三点リーダー(...)をクリックすると、ダイアログが拡張します。
(Toggle Search Details)

files to include

(例)文字列の検索範囲をsampleというディレクトリパスに絞り込みます。

(例)プロジェクト直下のsampleディレクトリのみに範囲を絞る場合は、./sampleと入力します。

files to exclude

(例)devディレクトリを検索対象から除外します。(Dismiss)

ファイル名

検索結果一覧からの除外

また、検索にヒットし一覧に表示される各ファイル右側のバツ印をクリックすることで、一覧から確認済みとして除外することができます。

ファイル名

(除外したファイルは再度検索し直すことで再度一覧に表示できます)

まとめ

多くのVSCodeユーザの方から「今頃何言っているの?」と言われそうな感じですが、
私は何年もVSCodeを使ってきているのに、なぜか今までこれrの便利機能に気が付きませんでした。(涙)

ですが、VSCodeに限らず、こういった当たり前に見逃している些細な気づきから日々の開発作業効率を改善していきたいですね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?