如何在WebStorm中重新格式化JavaScript代码?

时间:2013-04-06 12:36:17

标签: node.js ide webstorm

我正在使用JetBrains WebStorm IDE。但我认为autoformat(美化)代码没有捷径。在Netbeans中,其 Ctrl Shift F 命令格式化整个文件。这有什么命令吗?我是否需要安装任何插件或其他东西才能启用此功能?

3 个答案:

答案 0 :(得分:70)

Code | Reformat Code... Ctrl + Alt + L ):

enter image description here

可以在File |中更改键盘快捷键Settings | Keymap

enter image description here

如果您还不熟悉IDE功能,请使用Help | Find Action

enter image description here

feature is also documented

答案 1 :(得分:7)

Opt + Cmd + L(Mac,或任何您的平台组合)

或代码>重新格式化代码......

答案 2 :(得分:1)

在Windows中使用WebStorm 8.0.4,热键是(已成为?)Alt-F8。

相关问题