Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code: Case sensitive replacement after pressing Crtl - D

Tags:

Let's suppose I have the following code:

enter image description here

But I change my mind and I don't want to call it plan anymore. I want to call it schedule. So, because VS Code is so amazing and I'm so lazy, I press <Ctrl - D> hoping for VS Code to change the name respecting the case. But suddenly:

enter image description here

Is it there any way to tell VS Code to respect the case?

like image 379
amedina Avatar asked Jan 17 '19 13:01

amedina


People also ask

What does Ctrl d do in VS Code?

Ctrl+D selects the word at the cursor, or the next occurrence of the current selection. Tip: You can also add more cursors with Ctrl+Shift+L, which will add a selection at each occurrence of the current selected text.


1 Answers

With 1.37 (July 2019), it is possible through a find/replace (which now can replace by preserving case).

  • Issue 9798 has been implemented by PR 78003.
  • issue 78397 has been implemented by PR 79111 (1.38 only) for search/replace.

From 1.37 release notes:

You can now preserve case when doing replacement in the editor's Find widget. The feature is turned on when the Preserve Case option (AB button) is turned on in the editor's Replace input box.

https://code.visualstudio.com/assets/updates/1_37/preserve-case-button.png

Currently VS Code only supports preserve Full Upper Case, Full Lower Case, and Title Case.

like image 140
VonC Avatar answered Nov 20 '22 04:11

VonC