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

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.

Related

Intellij Idea - how to get rid of thick caret/cursor

I pressed something in Intellij and my caret shape changed to this. How to revert to the normal thickness? Using Intellij 2016.1.
Compare to this, normal thickness should be that of a bold vertical line:
Update: On Android Studio 2.1 beta, same machine, same font settings, cursor is visibly thinner.
You can .. but it's not pixel perfect. I mean -- for me the value does not seem to control thickness in pixels but rather some index (which gets applied to some predefined values) -- at least this is my impression on what I see my computer.
In any case:
Help | Find Action...
Search for registry action
Once in Registry window -- look for editor.caret.width entry
Set the new value (for me the default was 2) -- make sure that field went bold (move to another entry) to ensure that new value was accepted.
Restart IDE (this option requires it)
UPDATE (2017/04/06):
You may also try ThinCaret plugin:
Makes your editor caret 1 pixel thin (for retina users)
You can change it under Settings -> Editor -> General -> Appearance -> Use Block caret
Other caret settings are under Settings -> Editor -> Colors & Fonts -> General. Then if you scroll down to the editor section on the right, there is a caret item in the list with font/color settings.
Please check the Picture for solution.
If you got here because of the thick cursor (block cursor) that behaves differently than the normal thin one. Just press the insert (Ins) button once and you are good to go.
Go to the Keymaps section of the Preferences and add your own Keyboard shortcut if you are using a Mac. Windows users can just enable/disable Insert mode on their keyboard.

Cycle through autocomplete suggestions without arrows

I'm really impressed with the autocomplete feature of the IntelliJ IDE so far.
What I'd like to do, is cycle through the autocomplete suggestions I get when hitting Ctrl + Space without using the arrow keys (↑, ↓).
The reason for this is that I prefer to keep my fingers on the home row (I'm using IntelliJ's Vim emulator additionally).
For example, how would I select sortThis instead of sorted without using the arrow keys or the mouse?
Peter Gromov's answer brought me to a satisfying solution:
In IntelliJ's settings, for Keymap → Editor Actions → Down I set a custom shortcut: Ctrl + J.
This way I can cycle forward through the suggestions.
Setting a shortcut for Down with Selection or Scroll Line Down in the IdeaVim-specific shortcuts did not affect the selection of autocomplete suggestions though.
The answer here: https://stackoverflow.com/a/9713306/2370679 led me to discover that Ctrl+n & Ctrl+p allow navigation of the auto-complete options without having to modify any settings
For macOS the IDE will give a hint that "^↑ and ^↓ will move caret up and down in the editor". These clearly do not work.
There are a few extra steps that are needed after following #matthias-braun's solution.
Here is the full list of step that I use:
Go to Preferences -> Keymap
Expand Editor Actions (not Plug-ins -> IdeaVim)
Select Down
Click the pencil icon or right-click
Select Add Keyboard Shortcut
Press the shortcut (I use ^N)*
Repeat for 3-6 for Up (I use ^P)
Click Ok**
Go to Preferences -> Other Settings -> Vim Emulation
In the drop-down under the Handler column for the row containing Down, select Vim***
Do the same thing for Up
* If you are warned about the key binding already existing then remove it. You can always reset back to the defaults by clicking the little cog icon up the very top to the right of the drop-down menu.
** The Vim Emulation doesn't seem to be populated correctly until you reopen the Preferences.
*** I'm not sure why the Handler should be Vim. This seems backwards to me but it works.
If you're able to scroll up/down in editor with some IdeaVIM-specific shortcuts, they should also work in the completion list.
In this particular case, I'd just type another "t" so that "sortThis" becomes selected (and the only) variant.
I have done the same thing with mapping the arrows but in a more logical way:
I mapped them that when I press 'Alt' 'J' is left, 'L' is right, 'I' is up, and 'k' is down. that way I can have easy access to the arrows while my fingers are on the home row and I don't need to move them nearly as much...
I'm posting it just so people who search it on google can have that idea.

How can I focus the cursor into the test results output area using the keyboard in Jetbrains IDEs?

I have just run some Rspec tests in Rubymine and I want to use the keyboard to focus on the test results so that I can then jump to the test source code.
Here's the bottom of the IDE window. I want to first focus into the left hand pane so I can choose the correct test, then jump to the right hand pane so I can choose the line to go to. I've tried to use Command-4 to focus on the pane, but it just focuses the tab and not into the actual pane.
What is the correct key combination to do this (or what are the actions called on the keymap so I can assign keys)?
Although it's not what you asked (and I'd like to know an answer), I did just discover the "Select Failed Test When Finished" option in the Run pane settings (the blue gear in the upper right of the left-hand sub-pane). It selects the first failed test (which puts the output of that test in the right-hand sub-pane) and puts focus in the right-hand sub-pane. So if you always want to do that when a test fails, it might make you happy a lot of the time.
Try to use "Tab" button. After that, you could move logs with Up/Down arrows or PageUp/PageDown buttons.
It works on my IntelliJ IDEA 2017.1.5.
View -> Tool Windows -> Run
For me, the shortcut would be [Alt+4], and it is displayed in the menu, you will see it. If there's none, go to Keymap settings and configure it.
And yes, this question is old but it's a useful shortcut

Change intellij/android studio tool window quick access shortcuts

Is it possible to change the quick access shortcut numbers for a tool window?
i.e. the numbers next to a tool window name, used by the keyboard shortcut to toggle the window, talked about here
Yep. They are listed in Keymap. MainMenu -> View -> ToolWindows.
P.S.: Idea has a nice Find by shortcut function in Keymap settings page, I used it, to answer your question.
In Android Studio, you can change the Keymap this way:
Preferences -> Keymap
Then open Tool Windows. You may need to scroll down to see all the options.
Right-click on the element you want to assign a new key-stroke. Select Add Keyboard Shortcut. Make sure that the rectangle with a plus in it is selected (use your mouse) and press the key-stroke that you want for this item.
Android Studio will warn you if that key-stroke is already assigned. Click OK to reassign that key-stroke to the item. It'll warn you one more time that you will need to remove the previous assignment for that key-stroke. Click Remove to proceed. You should see the updated keystroke in the right-most column.

Remove all breakpoints in IntelliJ IDEA

Is there a possibility to remove all breakpoints in the module (might be using a shortcut) in IntelliJ IDEA IDE? Thanks.
Ctrl+Shift+F8
is using for removing all breakpoints.
Select upper breakpoint -> Ctrl+Shift+End -> Remove
On Mac Os use this:
Cmd + Shift + (Fn) + F8 on Mac OS
To remove all breakpoints in IntelliJ Idea press following sequence of shortcuts:
Ctrl+Shift+F8 (open Breakpoints dialog)
Ctrl+A (select all breakpoint)
Alt+Delete (remove selected breakpoints)
Enter (confirm)
If you press Ctrl+Shift+F8 and your cursor is at code line with breakpoint, instead of Breakpoint dialog you get bubble with properties of a single breakpoint.
To get the Breakpoints dialog press Ctrl+Shift+F8 again.
Tested in IntelliJ Idea 14 Community Edition.
In case of Mac, follow below steps:
cmd+Shift+F8 (open Breakpoints dialog)
cmd+A (select all breakpoint)
cmd+Delete (remove selected breakpoints)
Enter (confirm)
Unlike Alt+Delete in windows, It's cmd+Delete in Mac
As an alternative, instead of removing all breakpoints, you can just mute them. This will help in the case that you want to stop breaking on all of them. They will still exist, so you can toggle this setting again to start breaking on them.
The mute breakpoints button can be found in the Debug view (view can be toggled using View -> Tool Windows -> Debug), in the left-hand side button menu. I attached a screenshot below.
As mentioned in this answer the shortcut works.
But we tend to forget the combination of keys (I do).
There exists another way to access breakpoints window.
Clicking on this button will open breakpoints window.
Here is one of my trick to remove all breakpoints of a page:
Ctrl+A : select all code
Ctrl+X : cut all codes
Ctrl+V : paste all code
this trick removes all breakpoints at one go and it takes less than a second.
On a Mac you need Shift + Comand + F8
press ctrl+shift+f8 and select check box of which you want to remove and then press minus button in left upper corner in android studio 2.2