Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable escaping when copy and pasting in IntelliJ?

When I copy and paste string text into quotes Intellj always escapes certain characters like ", etc,. How can I disable this annoying feature?

like image 434
genxgeek Avatar asked Mar 19 '14 12:03

genxgeek


People also ask

How do I copy and paste in IntelliJ?

Press Ctrl+Alt+Shift+V or choose Edit | Paste | Paste as Plain Text from the main menu .

How do I copy a whole line in IntelliJ?

Duplicate the current line or selectionPress Ctrl+D or choose Edit | Duplicate Line or Selection from the main menu . Alternatively, you can press Ctrl+Shift+A , start typing the command name in the popup, and then choose it there.

How do I copy a class path in IntelliJ?

Copy paths Press Ctrl+Shift+C to copy the absolute path to the current file. Choose Edit | Copy Path/Reference from the main menu. In the popup that opens, choose what part of the path you want to copy — filename, absolute, or relative path.


2 Answers

You can use Ctrl+Alt+Shift+V (presumably +Alt / Option+Shift+V for OS X) to do Paste Simple (also available from the right-click context menu). This will paste your most recent clipboard content without escaping it.

Many other programs that offer "simple pasting" will use Ctrl+Shift+V instead, but in IntelliJ that opens an IntelliJ clipboard memory dialog, where you can choose previously copied text to paste.

Note that these are all default, but customizable, keyboard shortcuts.

like image 70
ajp15243 Avatar answered Oct 11 '22 10:10

ajp15243


I found the Ctrl + Shift + Alt + V combination a bit cumbersome, and after some digging I found an alternative solution that was more to my liking. I want to share it here in case it is useful to anyone else.

You can actually edit the key mappings for the paste simple command, and replace them with the standard Ctrl + V that most people are familiar with.

Simply go into File -> Settings -> Keymap and enter "paste" into the search box to bring up all the various paste commands. Double click "Paste Simple" and enter Ctrl + V for the shortcut.

You will be warned that the shortcut is currently assigned and you will be given the option to remove it. After doing so, you have pretty much replaced the annoying "enhanced paste" with the standard "simple paste".

Hope that helps someone out there :)

like image 42
BMB Avatar answered Oct 11 '22 09:10

BMB