86

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?

4
  • 24
    Very annoying feature for me too.
    – humkins
    Feb 29, 2016 at 9:59
  • 2
    @gumkins Yeah, wow was that an annoying feature for so many years.
    – Det
    Nov 5, 2019 at 20:55
  • 5
    IntelliJ editor has 10,000 features I love and use and forget everyday. This is one of the 10 I hate and remember. #CodeParkourFeatures
    – Bob Stein
    Aug 23, 2020 at 11:57
  • 1
    Confirmed, dumb feature. Jan 8, 2021 at 15:31

3 Answers 3

124

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.

7
  • 4
    While that option will prevent text drag&drop, it does not disable DnD in the file list. :(
    – Sephie
    Oct 9, 2014 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 9, 2014 at 13:18
  • 1
    Yeah, I often get the move confirmation dialog when I meant to click a file or dir.
    – Sephie
    Oct 9, 2014 at 15:56
  • 47
    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, 2016 at 5: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, 2019 at 5:57
13

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.

2
  • 1
    it does not disable drag'n'drop in project area. PS. Appearance & Behavior - Appearance, check "Drag-n-drop with ALT pressed only" Mar 23, 2021 at 9: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 at 4: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...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.