How can I reformat JavaScript code in WebStorm?

旧时模样 提交于 2019-12-12 07:39:00

问题


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?


回答1:


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

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

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

This feature is also documented.




回答2:


Yes.

Opt+Cmd+L (Mac, or whatever your platform combo is)

Or Code > Reformat Code...




回答3:


Using WebStorm 8.0.4 in Windows the hotkey is (has become?) Alt-F8.



来源:https://stackoverflow.com/questions/15851023/how-can-i-reformat-javascript-code-in-webstorm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!