How can I reformat JavaScript code in WebStorm?

vcxz picture vcxz · Apr 6, 2013 · Viewed 26.5k times · Source

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?

Answer

CrazyCoder picture CrazyCoder · Apr 6, 2013

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

enter image description here

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

enter image description here

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

enter image description here

This feature is also documented.