What is Prettier keyboard shortcut command in VS Code to format only a block of React code, not just format on file autosave?

18,370

Solution 1

On Mac OS for VS Code it's Option+Shift+F

Solution 2

you can create you own default keyboard shortcut in VS code for formatting documents like in my case prettier code format command is shift+window+F but it is creating issue in mac so i changed the short cut command for it, for more information can refer below screenshots

enter image description here enter image description here

Solution 3

Answer: it's make code block selection Command K, F in mac.

Share:
18,370
richalk
Author by

richalk

Updated on June 13, 2022

Comments

  • richalk
    richalk over 1 year

    Using Prettier: Anyone know the keyboard shortcuts to auto-format a single block of javascript in VSCode on highlight, without having to save the entire file using Prettier to use auto formatting.