#39 Surrounding Code with Language Constructs

Surrounding Code with Language Constructs

PhpStorm can assist in the common task of wrapping code with language constructs such as if statements and foreach loops.

Press Cmd/Ctrl+Alt+T to invoke the Surround With popup, or navigate to Code | Surround With... in the menus, then select the desired language construct from the list.

The current line will be surrounded in the chosen construct, to surround multiple lines make a selection before invoking the Surround With popup.

Further Reading

Related Tips

Comments

Blog Comments powered by Disqus.