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?
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:

Yes.
Opt+Cmd+L (Mac, or whatever your platform combo is)
Or Code > Reformat Code...
Using WebStorm 8.0.4 in Windows the hotkey is (has become?) Alt-F8.