IntelliJ moving my mouse cursor in random positions - intellij-idea

IntelliJ sometimes moves the cursor on default positions, like over the Find button when you do a Find in Path.
However recently it is moving my cursor to completely random positions. I suspect this is because of my multi-monitor setup.
A computer/IntelliJ restart doesn't fix the issue.
How can I disable this "automatic move" thing entirely?

you can disable "automatic moves" by Settings > Appearance & Behavior > Appearance, checkbox Automatically position cursor on default button. Docs
Edit (2021-02-15): Something changed in the UI in recent versions. If you're having trouble finding the option you can edit the registry.
Here is the request for missing option:
https://youtrack.jetbrains.com/issue/IDEA-99985
The option should be disabled though. Try checking
focus.follows.mouse.workarounds in registry.
You can open the registry by searching all Actions for Registry, then edit that value.

Press Ctrl+Alt+Shift+/ and select "Registry" from the menu that appears.
Then set ide.settings.move.mouse.on.default.button value to disable.
Registry dialog image

From the official Intellij documentation: https://www.jetbrains.com/idea/help/appearance.html#d1207234e126
To disable this quickly in Intellij 15 and newer (which have the 'Search Everywhere' feature), do the following:
Press Shift+Shift
Type UI: auto. This should popup the following:
Highlight that option and press enter.

Related

How to check/uncheck individual change checkbox in IntelliJ commit diff dialog?

I am an aspiring keyboard user, using IntelliJ to do selective commits to my project.
To do this, I open the Commit dialog with Ctrl+K.
I then press Shift+Tab to switch to the file list, Home to select the root-level node, and Space to uncheck/de-select all files.
I then press the down arrow once or more to select a file, press Ctrl+D to display its diff. I press F7 to go to the first change in the file.
At this point, to the left of the right pane (with the new version of the file) is a checkbox. Not the one at the top which selects all the changes in the file, but the one which selects just the change displayed.
My question is: How do I select/un-select this checkbox without using the mouse cursor? I need to use the mouse as little as possible due to RSI.
Note: When asking questions like this, I sometimes get responses with other pointing device suggestions. Unless you're going to recommend a keyboard technique, I am not interested in your suggestion, and will flag/report your response if that's what it is.
By default there is no keyboard keymap for this action. But you can easily choose new keymap for this.
Go to File->Settings and search for "include" in the search box. What you need is to assign a keymap for "Include Lines Into Commit". Double click on this option and assign any keymap that you want. It is hard to find new keymap that didn't assign to any other action, but only for the demo I choosed Ctrl+T.
You can see what I did in the following image:
Click on Apply and then you can use the keymap that you choose to check/uncheck any individual change checkbox in Intellij commit diff dialog.

PHPstorm scrolling with keyboard

I'am looking for an option to force scroll code when entering with keyboard cursor in example at 5 line from the end.
Default behavior is to scroll code when entering 1st or last visible line of code.
I would like to change it even for 10th from the beginning and 10th before last.
It appears the base IDE does not have an option for this. However, the behaviour is available in the IdeaVIM plugin (docs) under the scrolloff option.
'Scroll offset' mode can be enabled for the current session with the command:
:set scrolloffset=10
Add that to your ~/.ideavimrc to make it permanent.
NB: IdeaVIM changes the IDE to behave more like vim*, which may require some re-training.
If you're not familiar with Vim:
Install the IdeaVIM plugin (via Settings → Plugins → Browse Repositores → type 'ideavim' in search)
Restart the IDE
Open a file
Note the caret is a block like █; this indicates 'normal' mode
Press : to enter the 'command' mode
Type set scrolloff=10 then Enter
Scroll around, notice the editor scrolls before the caret gets to the very top (or bottom)
Press i to enter 'insert' mode, and edit your file as usual
Press ESC to return to 'normal' mode
Interactive vim lessons
openvim.com
vim-adventures.com
* It seems difficult to have the plugin only modify the scrolloffset behaviour and leave the rest per the default IDE.
You can set "EditorMoveUpAndScroll" shortcut.

Disable copying entire line when nothing is selected in Intellij

I have recently started using Intellij and I noticed that by default, when you do ctrl+c for copying something when you have nothing selected, it copies the entire line into the clipboard overriding what I had in there before.
This is really annoying yet I cannot seem to figure out how to disable it. I am aware that there is a paste history you can use however this is not what I am after, I just want to disable it like you can do with sublime text.
Is there a way to disable this behaviour so that when I press ctrl+c and nothing is selected it just leaves the clipboard alone?
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.
In Mac OS X:
Press cmd+shift+a.
Type registry and press return to
open the Registry.
Enable the editor.skip.copy.and.cut.for.empty.selection option.
Click Close.
I suppose it should be same as in WebStorm, or someone might be searching WebStorm solution as I did:
Open the settings: File > Settings > Advanced Settings (bottom of the list).
Start typing "editor".
Check the editor.skip.copy.and.cut.for.empty.selection
Click "OK" or "Apply"
On: WebStorm 2022.3.1
in PHPStorm -> From the Help menu, select Edit Custom Properties.
and paste
editor.skip.copy.and.cut.for.empty.selection = true

Intellij - what is this strange selection, and how do I turn it off?

See the screenshot below to see what I mean. Basically, Intellij only highlights the box I draw with the cursor, but leaves the rest of the editor untouched. I have no idea why it happens, and the only way to resolve it for now is to close and reopen the editor. I have observed the same behavior on a Linux box and a MacBook, both when editing Java and PHP files, so I am not sure it's a bug.
The desired behaviour is standard row selection, i.e. highlight all rows which I drag the cursor over.
I think you have enabled 'column selection'.
Option can be toggled via these methods:
Menu Bar -> Edit -> Column selection mode
Document Body -> Right Click -> Column selection mode
Keyboard Shortcut -> ALT + SHIFT + INSERT
The column select mode is enabled, use Alt+Shift+Insert to enable or disable this mode.
Shift-command-8 to toggle it back and forth on OSX.

How do I disable the Search Everywhere shortcut?

IntelliJ IDEA 13 has the new Search Anywhere feature. It sounds like it might be useful, but so far it just gets in the way. It's mapped to some kind of magical shift-based shortcut, and it comes up every time I try to shift-click to select text. When this happens, the pop-up flickers and gets into some stuck state, so the only way to get rid of it is to click in the editor pane, which of course loses the selection.
I call the shortcut "magical" because the Search Everywhere action appears in the Settings → Keymap list with no mapping, so I can't remove this mapping the usual way. Searching the dialog for search gives no relevant results.
How can I disable this buggy feature until it's ready for production use, and get back the ability to select text?
To disable the "Search everywhere" feature, you need to invoke "Go to action" (Ctrl+Shift+A), then type "Registry...".
Scroll down to "ide.suppress.double.click.handler" and check the box.
Source: https://youtrack.jetbrains.com/issue/IDEA-161094
After updating to build 133.331, I tried assigning a normal shortcut to it in Settings → Keymap, and that made it stop appearing on double-shift.
The settings for the new version have changed
Version: IDEA 2021.2.3
Preference > Advanced Settings
Scroll down to "User Interface", find "Disable double modifier key shortcuts" and check the box.
It's called Search Everywhere, and it's present in keymap.
For me it's perfectly disabled.
EDIT As I'v found it is hardcoded now, and will popup at doubleshift source
There is also an issue at jira, about this problem.
I hope it will be fixed soon.
from: https://youtrack.jetbrains.com/issue/IDEA-161094
In IDEA 2021.2:
You could enable the Settings (Preference on macOS) |
Advanced Settings | Disable double modifier key shortcuts option to
disable it.
This problem is still present under linux (ubuntu amd64 16.10 ) on Android Studio using X11Rdp for remote connection, maybe in other situations too - the Search Everywhere dialog appear on single Shift press.
The answer is here
https://youtrack.jetbrains.com/issue/IDEA-114933#comment=27-603899
Basically you need to
Open lib/resources.jar/idea/PlatformActions.xml and remove or comment such line:
<action id="SearchEverywhere" class="com.intellij.ide.actions.SearchEverywhereAction" />
and repack the jar.
Since end of 2017 you can add -Dide.suppress.double.click.handler=true to the custom VM options: cf. the answer from JetBrains.