LoginSignup
1
0

More than 3 years have passed since last update.

VScode で一括置換 大文字小文字を区別[備忘録]

Posted at

やりたいこと

VSCode上での現在開いているファイル内で一括置換を行う
大文字と小文字を区別する

 方法

VScodeのメニューバーから [Edit] => [Replace in Files]をクリック
image.png

そうするとVScode上で虫眼鏡アイコンから2つのバー([検索する文字列] ボックスと[置換後文字列]のボックス)が出るのでそこで置換したい文字列、置換後の文字列を入力する

defaultだと大文字と小文字は区別しないので、下図の Aa  のアイコンをクリックすると区別して置換される(検索時も同様) 

image.png

ちなみにその横のアイコンで単語単位での検索、さらによこのアイコンで正規表現などを使った検索が可能になる

ショートカット

僕の環境だと置換のボックスを出すショートカットは shift + option + H でした。

Preferance => Keyboard Shortcut から変更可

参考

https://docs.microsoft.com/ja-jp/visualstudio/ide/replace-in-files?view=vs-2019
VScode document

1
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
1
0