How can I reformat JavaScript code in WebStorm?

27,443

Solution 1

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 2

Yes.

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

Or Code > Reformat Code...

Solution 3

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

Share:
27,443
vcxz
Author by

vcxz

Moovweb, PHP, Node.js, Joomla, Wordpress...

Updated on June 01, 2020

Comments

  • vcxz
    vcxz almost 4 years

    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?

  • Arsen Khachaturyan
    Arsen Khachaturyan almost 10 years
    Thanks. In WebStorm 8 formatting content changed to Alt+F8.
  • TechTurtle
    TechTurtle over 6 years
    what about Mac?