How to paste code without reformating in IDEA

2019-02-03 21:56发布

问题:

I want to prevent Intellij IDEA from reformating my code when I paste it.
How can I do this?

P.S. It is needed because I can't customize code formatting for Erlang (ErlGray plugin)

回答1:

Set Settings (Preferences on Mac) | Editor | Smart Keys | Reformat on Paste to None:



回答2:

In the case anyone else comes across this and doesn't want to change their project-wide settings, I just recently found a "Paste Simple" command (Ctrl+Alt+Shift+V). I'm not sure what version it was added, but it's there as of IntelliJ 13.



回答3:

I found changing Reformat on Paste to None alone didn't work for me. I also had to untick "Smart indent pasted lines"