Disable copying entire line when nothing is selected in Intellij

Since version 2021.2 there is a dedicated Don't copy/cut the current line when invoking the Copy or Cut action with no selection setting for this in Preferences | Advanced Settings on the Mac, Settings | Advanced Settings on other platforms.

For older IntelliJ Platform based IDE's the setting is more hidden:

Invoke Help | Find Action... (Ctrl (Cmd on Mac)+Shift+A), type Registry and select the Registry... item that appears. Enable the editor.skip.copy.and.cut.for.empty.selection option there. Be careful with the other configuration options, because it is possible to break your IntelliJ IDEA installation with an incorrect setting.

Registry window


In Mac OS X:

  1. Press cmd+shift+a.
  2. Type registry and press return to open the Registry.
  3. Enable the editor.skip.copy.and.cut.for.empty.selection option.
  4. Click Close.