Curser/Caret deletes while typing - intellij-idea

I've pressed some combination of button by accident and in doing so caused the cursor/caret to stop working properly. When I type in the editor it replaces what I already have with the new text
For instance, if I have
if(this.class()==foo){...}
And I try adding "del" infront of 'this.class()' it comes out as
if(dels.class()==foo){...}
How do I turn this effect off? It's not block cursor or selection mode.

Found out I activated the Insert/overwrite keymap by pressing 'insert'

Related

IntelliJ moving my mouse cursor in random positions

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.

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.

PHPStorm deletes line if Backspace is pressed on the default indentation level

After upgrading from 7.x to 8.x I noticed an annoying new "feature". When on an empty line (after pressing enter), then pressing backspace (which used to get rid of the indentation character right in front of the caret) the line is erased and the caret jumps back to the end of the line above.
Given the following code snippet and caret placement:
pressing Backspace does this:
How do I turn this off?
As of PhpStorm 9+, this setting is located in it's own section under Editor > General > Smart Keys > Backspace. Setting the Unindent drop-down to Disabled will give you the behaviour you would expect.
The solution is to disable "Backspace smart indent" by going to File > Settings (or pressing CtrlAltS) then
navigating to IDE Settings > Editor > Smart Keys
searching for Backspace smart indent
and removing the tick from check box next to said option.

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.

Make tab indent the current line

I'm using IntelliJ IDEA to write Java and finding the default Tab behaviour (inserting a tab at the cursor position) quite annoying. I want it to behave like Shift-Tab.
Shift-Tab de-indents the cursor line if there is no selection, or every line in the selection if there is one, regardless of the cursor's position on the line. I tried to make Tab behave the same way by changing the keymap settings: I unbound the Tab key from Editor Actions → Tab so that it'd perform Edit → Indent Selection. But that only makes it indent the selection: if there's no selection, pressing Tab now does nothing.
It appears that the de-indent action for Shift-Tab is actually Editor Actions → Unindent Selection, but there's no corresponding action for indenting.
How can I make the Tab key indent the current line (increase the indent by one stop) if there is no selection?
Remove the keyboard shortcut from "Tab"
Add "Tab" as a keyboard shortcut to "Indent Line or Selection". When the dialog pops up asking you to "Leave" or "remove", click "Leave".
This works on at least IDEA 14+ but I haven't tested it on anything before that
You can press Ctrl+W which selects the nearest item to the cursor and then press Tab to indent or Shift+Tab to unindent the current line.
Not exactly what you need, but you can try Code | Auto-Indent Lines. There is also a known bug about the difference in the selection indent/unindent behavior.