Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I reformat JavaScript code in WebStorm?

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?

like image 285
vcxz Avatar asked Apr 06 '13 12:04

vcxz


People also ask

How do I refactor code in WebStorm?

Press F6 or choose Refactor | Move from the context menu or from the main menu. Alternatively, choose Refactor | Refactor This or press Ctrl+Alt+Shift+T , then choose Move from the list. The Move Module Members dialog opens. Specify the destination file and select the members to move.

Is WebStorm good for JavaScript?

WebStorm is an integrated development environment for JavaScript and related technologies. Like other JetBrains IDEs, it makes your development experience more enjoyable, automating routine work and helping you handle complex tasks with ease.

How do I align text in WebStorm?

TO set this code style go: File -> Settings -> Code style -> PHP(choose here your language) -> Other -> Align key-value pair - mark as checked. And then press Reformat code (Ctrl+Alt+L) and voila.


1 Answers

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.

like image 65
CrazyCoder Avatar answered Oct 03 '22 19:10

CrazyCoder