I have following problem:
When I hit new line in PHPstorm (this line has indent) and paste some code, this code appear at the beginning of line. It's really annoying to indent every paste code.
Is there some way how to configure this?
If you need to adjust indentation settings, in the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code Style. On the appropriate language page, on the Tabs and Indents tab, specify the appropriate indents options and click OK.
Go to PHP Storm > Preferences > Editor > Code Style > PHP > Wrapping and Braces > Assignment Statement > Align consecutive assignments . To activate it go to Code > Reformat Code or press Cmd+Opt+L .
Settings/Preferences | Editor | General | Smart Keys -> Reformat on paste
You can also use Code | Auto-Indent Lines
(Ctrl + Alt + I using Windows keymap) on selected lines to re-indent them without applying the actual code formatting rules (lines breaks, force braces etc.)
P.S. Edit | Paste | Paste as Plain Text
(Ctrl + Alt + Shift + V here on Windows keymap) can be used to insert the text as is without any help from such smart helpers.
This setting moved to a slightly different location in the menu structure in Webstorm. Go to
Settings | Editor | General | Smart Keys | Reformat on paste
and then select None
.
Smart Keys
is now a submenu on the General
menu, which is different from another answer to this question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With