How can I reformat js code in webstorm?

How can I reformat js code in webstorm?

Problem

I am using JetBrains WebStorm IDE. But I think there is not shortcut to autoformat(beautify) the code. In Netbeans, its Ctrl+Shft+F 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?

Problem courtesy of: vcxz

Solution

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.

Solution courtesy of: CrazyCoder

Discussion

Leave a Reply

Your email address will not be published. Required fields are marked *