简体   繁体   中英

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

使用 Prettier:任何人都知道在高亮显示 VSCode 中自动格式化单个 javascript 块的键盘快捷键,而无需使用 Prettier 保存整个文件以使用自动格式化。

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

在此处输入图像描述 在此处输入图像描述

在 VS Code 的 Mac OS 上,它是 Option+Shift+F

答:在mac中制作代码块选择命令K,F。

Try this... in ubuntu 20.04: ----vsCode Prettier - Code formatter shortcut- key is ctrl+shift+I

in windows 10,11: ----vsCode Prettier - Code formatter shortcut- key is alt+shift+F

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM