In MATLAB there is a really nice feature where when you change a variable name in a script it gives you the option to press Shift and Enter to replace all instances of that variable.
Is a keyboard shortcut/feature like this possible in VSCode?
1 Answer
There's a combination of shortcuts:
CTRL + H -> ALT + W -> [Type New Name] -> Enter
- Highlight the word/variable
- Hit CTRL + H (Find & Replace)
- Hit ALT + W (Match whole word)
- Type in the new name and press enter.
You can hit ALT + C to after CTRL + W if you'd like to match case too if the language is case sensitive.
There's also great answers and alternative methods over on stackoverflow.
1