How to paste code without reformating in IDEA

Intellij Idea

Intellij Idea Problem Overview


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)

Intellij Idea Solutions


Solution 1 - Intellij Idea

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.

Solution 2 - Intellij Idea

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

reformat on paste

Solution 3 - Intellij Idea

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

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiontsdsView Question on Stackoverflow
Solution 1 - Intellij IdeaJon PetersonView Answer on Stackoverflow
Solution 2 - Intellij IdeaCrazyCoderView Answer on Stackoverflow
Solution 3 - Intellij IdeaRubberDuckRabbitView Answer on Stackoverflow