85

In my IntelliJ Idea 13.1.2 IDE I keep running into situations where I'm selecting on a click and drag via my laptop touch pad. I keep accidentally clicking and dragging text and cutting lines. I've searched the options and settings panels for the words click and drag but I don't see a way to turn this feature off. IntelliJ's help talks about how to use click and drag cutting but doesn't say how to disable it. Does anyone know how to disable cut and paste through click and drag in the IntelliJ IDE?

Jason D
  • 8,023
  • 10
  • 33
  • 39

3 Answers3

123

I found it in SettingsEditorGeneral.

Under the Mouse heading. The option is called "Enable Drag'n'Drop functionality in editor".

This also seems to disable drag and drop moving of files though.

Anton Rudeshko
  • 1,039
  • 2
  • 11
  • 20
Jason D
  • 8,023
  • 10
  • 33
  • 39
  • 4
    While that option will prevent text drag&drop, it does not disable DnD in the file list. :( – Sephie Oct 09 '14 at 12:27
  • 1
    Yup, that's right, it doesn't change the file list. The issue I was having was just with text so that fixed it. Are you trying to disable file drag and drop as well? – Jason D Oct 09 '14 at 13:18
  • 1
    Yeah, I often get the move confirmation dialog when I meant to click a file or dir. – Sephie Oct 09 '14 at 15:56
  • 46
    File list drag-n-drop can be disabled by going to Appearance & Behavior - Appearance, check "Drag-n-drop with ALT pressed only". Or just search by 'drag' word. – jstice4all Apr 18 '16 at 05:50
  • 1
    Great! I think the Intellij change something recently, it became very easy to drag, disable it resolve the problem – Xin Meng Sep 18 '19 at 05:57
  • I actually love the feature of dragging selected text. But I can live without it because I hate even more the unintentional dragging of a **highlighted searched-for term**. It took a long time to realize what was happening, that when I was trying to swipe-select a _portion_ of a highlighted phrase, it was selecting and dragging the _whole_ phrase instead. Wish I could just disable _that_. – Bob Stein Aug 23 '20 at 12:31
  • 1
    Thank, you're a life saver. In my case, a hair saver, as that's less hair ripping I do while trying to select text and the basterd keeps dragging text, something I will never use. – MoDu Apr 06 '21 at 12:16
12

In WebStorm 2020.1 (and presumably in other Jetbrains IDEs), the related option 'Move code fragments with drag-and-drop' is in Preferences > Editor > General:

enter image description here

Unchecking the checkbox does the trick without unwanted side effects such as also disabling the drag-and-drop operations for files etc.

Clokman
  • 303
  • 2
  • 11
  • 1
    it does not disable drag'n'drop in project area. PS. Appearance & Behavior - Appearance, check "Drag-n-drop with ALT pressed only" – Simon Logic Mar 23 '21 at 09:09
  • 1
    @SimonLogic The OP's question does not pertain the dragging and dropping files and folders in the Project pane. It is about cutting and pasting of the code in the editor via drag and drop. – Clokman Jan 21 '23 at 04:34
0

There is no way to disable Drag-n-drop highlighted text in the editor itself!!! ALT guard for drag-n-drop files is a good idea as I accidentally drag and drop files on daily basis. Kudos for discovering that I just enabled it.

I have contacted Intellij support to give us a setting that we can disable in editor drag and drop. I think that is a stupid feature in the first place...

Juha Vehnia
  • 1,255
  • 12
  • 15