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

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.

Related

Unable to type > character in Intellij IDEA

Whenever I am using the Canadian Multilingual Standard Keyboard, I can't type the greater than character which are the keys AltCar + period. A dialog box shows
There are no custom foldings in the current file.
Removing/changing the shortcut for Fold selection/ Remove region in the Keymap did not work. I've also tried to add actionSystem.force.alt.gr=true to bin/idea.properties but I can't apply changes to idea.properties.
Press Ctrl-Alt-Shift-Slash (Cmd-Alt-Shift-Slash if you're using Mac OS X), select "Registry" from the menu that appears and enable the "actionSystem.force.alt.gr" checkbox in the menu that appears.
Go to File | Settings | Keymap. On the top of the screen, in a dropdown box you will see that one of the default keymap is selected. You need to make a copy of it. This is important becasue you can't change the default keymaps. To copy it, click on the Copy button on the right of the dropdown box and name your new layout however you want.
Now, with your new Keymap selected, search for the "Custom Fo...". Right click on any shortcut that is mapped to either Alt+. or Ctrl+Alt+. to delete it. Hit OK and you should be good to go.

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.

Is there a search history in Intellij IDEA?

A feature that I used a lot in Eclipse is the Search History, which remembers searches you performed in the past and gives you quick access to them. I cannot seem to replicate this functionality in IntelliJ - it seems that I have to start a new search each time. Does this feature exist, or does anyone know of a plugin that provides such a feature?
I think what you're looking for is the "Open in new tab" checkbox at the bottom of the "Find in path" dialog. For me by default it was disabled. When you enable it, you will have search results open in separate tabs every time, so accessing historic searches will be much easier.
For recent "Find Usages", open the "Find" window (Cmd 3); click the settings button in the "Find" window toolbar; in the settings dialog check the checkbox "Open in new tab".
Inside 'Find' dock press Alt+Down to see 'Recent Find Usages' dropdown.
Search history intellij alt up or alt down.
For in-file search there is Recent Searches drop down if you press the down arrow key, the same is available for the Find in Path dialog.
Alt+down arrow is what you are looking for...
First press Ctrl+Shift+f and then alt+down arrow
for more info check IntelliJ website:
https://www.jetbrains.com/help/idea/searching-everywhere.html#search_all
Using Alt+down works to see previous Finds, but by default only 1 Tab is open.
Of course the setting for opening new Finds in a new Tab can be found in a slightly different place than when the first answer was posted. It can now be found by right-clicking the top bar (or the "Show options menu" gear-icon) -> View Options -> Open Results in New Tab.
Click on the magnifying icon in the find window and you will see it. It is not intutive. I'd expect it to list the previous searches when I click on the text box window.
just when you user find by path, right corner of the search you will find the "open
in find window" there you will see history as shown in the image and you can pin the search history you need . just hit the <- arrow button in the left panel of find window, you would see the history