Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replace with next value (ctrl shift dot) in Visual Studio Code

Does anyone know how "Replace with next value" (ctr + shift + dot) works ?

I am unable to get this shortcut to do anything on my vscode.

I tried googling examples of this shortcut and asking on vscode gitter/reddit but couldn't get any answers.

It would be greatly appreciated if someone could provide the steps of using this shortcut.

like image 721
user941749 Avatar asked Apr 11 '17 16:04

user941749


People also ask

How do you replace a value in VS code?

You can use the Find control in code or text windows, such as Output windows and Find Results windows, by selecting Edit > Find and Replace or pressing Ctrl+F.

How do I replace multiple variables in VSCode?

The keyboard shortcut Ctrl + Shift + H will also work as well to access the search and replace.


2 Answers

Add to the accepted answer:

  1. If you use it on a boolean, it toggles between true and false.
  2. No need to "highlight" the number, putting the cursor on it is enough.
like image 86
ZYinMD Avatar answered Oct 07 '22 13:10

ZYinMD


If I press the shortcut after highlighting an integer or float literal (16 or 5.2 for example) it subtracts 1 from it.

Strangely, Replace with Previous Value adds 1 to the value while Replace with Next Value subtracts 1.

I don't know if it has any other purpose.

like image 31
Félix Caron Avatar answered Oct 07 '22 12:10

Félix Caron