macosvisual-studio-codehotkeyscurly-braces

Hotkey for curly braces around variable in Visual Studio Code


I have the following line of code, and have the bold text selected using a cursor:

console.log(isAdult) 

Is there a Visual Studio Code hotkey (on mac) for inserting curly braces either side of my selected text?


Solution

  • I think the fastest way and what I usually do is to press this set of keys:

    āŒ˜ + D + {
    

    By the way here are all the shortcuts for macOS:

    https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf

    And here the Windows ones

    https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf

    hope it helps :)