8

I want to rename a variable used across an angular template file (i.e. an xxx.component.html file). This could be done with Shift + F6 shortcut in WebStorm. How to do it in vscode? F2 doesn't help.

djy
  • 737
  • 6
  • 14

1 Answers1

8

You need to use Ctrl + F2 combination to select the word and then type the new word , It will select all and replace with the new one

Ctrl + F2

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
  • 3
    Yep, note you can also use ctrl+shift+p to show commands. Type replace and hit enter. I often use this for keycombos I forget/rarely use (e.g. join onto one line, git file history, etc.). – Marco Oct 21 '18 at 13:17
  • 1
    this will change just the occurrences inside the template, and won't refactor the variable inside the component class (`.ts` file), so the true `Shift + F6` shortcut is not available as far as I know – crollywood Jan 29 '19 at 14:55