Search code examples
visual-studio-codekeyboard-shortcuts

VS Code: Case sensitive replacement after pressing Crtl - D


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?


Solution

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

    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.