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

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

问题描述:

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

I am using JetBrains WebStorm IDE. But I think there is not shortcut to autoformat (beautify) the code. In Netbeans, its CtrlShiftF command which formats the whole file. Is there any command for this? Do I need to install any plugin or something to enable this function?

代码 | 重新格式代码... Ctrl + Alt + L ):

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

可以在文件 |中更改键盘快捷键设置 | Keymap

Keyboard shortcut can be changed in File | Settings | Keymap:

如果您还不熟悉IDE功能,请使用帮助 | 查找行动

If you are not familiar with IDE features yet, use Help | Find Action:

功能也有记录