How can I run the current test with a keybinding in IntelliJ IDEA 2018.2? - intellij-idea

Recently upgraded to IDEA 2018.2
In previous versions of IDEA, I was able to bind Run configuration... to a key (ctrl-shift-F10 is what I used) in order to run the current test ("current" meaning the test that my editor cursor was inside).
Note that the functionality itself still exists, you can right-click on test name and select "Run" and it will run that test.
But I can't figure out how to map that functionality to a keyboard now - does anyone know the new way?
EDIT:
The answer below is correct, but be aware that you might need to restart IDEA to pick up the new key mapping.

You can bind a keyboard shortcut of your choice to the action Run context configuration.
If you go to the keymap settings and search for that you should be able to set the keyboard config of your choice and be able to run the current test.
Keep an eye of conflicting keyboard shortcuts (inside and outside intellij!)

Related

How to toggle spell check with a keyboard shortcut in IntelliJ IDEA?

Currently I run with spell check disabled globally in IntelliJ as it ends up being more annoying than helpful most of the time. But there are many times where I'd like to quickly toggle it on and off to check the spelling of things I'm unsure of.
My current workflow in this case is to switch over to sublime then hit my toggle spell check key binding there and then jump back to IntelliJ, which isn't really ideal.
After Google searching around for it all I found was "how to disable spellcheck in IntelliJ" which I already know how to do and searching for "toggle inspection shortcut" was also unfruitful. So does anyone here happen to know if there's a way to bind toggle spell check(or toggle an individual inspection) to a keyboard shortcut in IntelliJ?
If not I might end up writing my own IntelliJ plugin today as I really really want this..
The best thing you can do with out-of-the-box functionality is using Analyze | Run Inspection by Name..., selecting "Typo" from the list and then selecting the scope to run it on.
If you want to run it with a single keyboard shortcut, you'd indeed need to write a simple plugin.
So I ended up making the plugin this late-ish afternoon in a couple hours (thank you yole for telling me it couldn't be done without a plugin before I started work on the plugin). I added the spell check toggle I wanted plus 3 custom toggle bindings that can be bound to any inspection you want.
It's currentley awaiting moderation to get in the JetBrains plugin repository but you can download the plugin jar from my website here.
And I put the source code up on GitHub here

Change default tool window behaviour in IntelliJ IDEA 2016

Every time I open a new project in IntelliJ IDEA, the first time I open a particular tool window, for example 'Maven Projects', it appears in 'pinned' mode and remains visible until either I close it, or I go to the view settings for the window (the little cog) and deselect "Pinned Mode". I don't want any of my tool windows to be pinned so this gets a little annoying.
Do you know of a way to change the default behaviour of new project / tool windows?
As far as IJ 2016.2 I don't know about a dedicated setting for this. However I used an approach which allows you to define a default layout for all projects. Although the window-pinning works, which is what this question is about, some may not be persisted, such as Group Modules setting in the maven tool-window.
Nonetheless, to configure the pinning, you need to do 2 simple things, which you can also see in the GIF below:
1) Manually go and unpin all desired windows
2) Open the Windows menu and select Store current layout as default
P.S. If you'll be using tool-windows that you've never opened before, or install new plugins which add their own tool-windows, just follow these steps again.

Idea shortcut 'Go To Implementation(s)' doesn't work

I faced a very strange problem: in someday(I don't really know when) the shortcut
Ctrl+Alt+B stoped working. This shortcut is just Go To Implementation(s). I still can do it by Ctrl+Alt+Mouse1.
I opened settings, to check how is this shortcut configured - all looks fine for me. So I tried to remove Ctrl+Alt+B and add the same combination again.
In Enter Keyboard Shortcut window I have to press key's so the IDEA would be able to set this shortcut. But I cannot record these combination, I still can record Ctrl+B, Ctrl+Alt+Shift+B, Alt+B, but not the right combination.
I looked at idea log file, but there was nothing criminal.
I wonder if some other application catches this combination, but I doesn't know how to find this application.
PS. I run my Idea on win7
By the way you're describing it, I strongly believe that the problem is not related to the IDE itself but probably some other program listening for that same key combo in a global level.
Its common to lose some keybinding after installing new applications or drivers. For example, I've lost some key bindings in my IDE after installing drivers for Intel Integrated Graphics. The driver was "stealing" hotkeys like Ctrl + Alt + < arrow > used to rotate the screen.
Double check for newly installed or updated programs/drivers, and make sure that they don't have any shortcut that may be conflicting with your IDE.
Also, you might use Hotkey Commander to verify which program is handling your Ctrl+Alt+B.

how to return run default content for intellij

I used one of the best shortcuts for Intellij:
Ctrl+Shift+F10
And it runs default content, which will be open.
I don't know how, but now it really do nothing.
All other short cuts are ok. And this one is dead (doesn't work anymore).
How to return to this useful short cut (or general set to Intellij default)?
Well since you have a psvm method, and your focus is in the code for that class when you press the shortcut, and given your caps key isn't on, then you should see IntelliJ try to make before running your code.
Do you see it Making ?
If not, it's likely another plugin or action has stolen the key shortcut.
Go to Settings -> Ide Settings / Keymap, and type RunClass in the search box.
You should see this: Run context configuration -> Ctrl + Shift + F10
If the key shortcut is missing, assign it.
Hope this helps.
P.S. I was recently using the Haskell IntelliJ plugin which conflicted with this shortcut. Disabling it did the trick to restore it.

How to fix IntelliJ Idea not closing tabs by Ctrl+F4?

I happen to use IntelliJ Idea 10.5.2 with Scala and SBT plugins to code in Scala on an XUbuntu 11.10 system with Oracle JDK 7.
And I can't close editor tabs with Ctrl+F4 (while right-clicking on a tab shows this shortcut for closing).
Any ideas about the reason probable and a way to fix?
Looks like xfce uses Ctrl+F4 as global shortcut that gets captured before it's propagated to IntelliJ. See this page for how to change shortcuts.
Alternatively you can also change the keybindings in IntelliJ. Use 'File|Settings' and got to 'Keymap' in the settings window. The 'close' action is bound to Ctrl+F4
Adding a new answer to this old question as duckduckgo brought me here. This shortcut can be edited quite easily on any version of Xfce (4) which has the Settings Editor app (tested on XUbuntu 18.04).
Launch Settings editor, and on the left column (channel) select xfce4-keyboard-shortcuts. Now on the right find any entry with the value <Primary>F? (primary means ctrl). Some entries can be deleted by pressing the reset button (the ones under xfwm4->custom). While you are at it, you might want to remove all the <Alt>F? bindings too (except Alt+F4).
The entries under xfwm4->default cannot be deleted, but the trick here is to edit the entry and remove any value.
I've read that this was editable in previous versions, but the value was in a text file somewhere (just sharing this in case anyone is using an older version of Xfce).
If you are using a Dell laptop where the F4 keys is used to 'mute' the sound. Muting the sound with the F4 key will disable the F4 key.
Try to unmute, function key 'fn'+F4 to unmute (lamp is not lit on key).
Then you can use CTRL+F4.