Intellij plugin keymap first-stroke value - intellij-idea

I have implemented a plugin that I would now like to use. However, I do not understand and did not see clear documentation on how to assign keyboard shortcuts. I would like to activate it on a alt + enter key combination, but its not obvious what my keyboard-shortcut entry should be.
<keyboard-shortcut keymap="Mac OS X" first-keystroke="???"/>
I have the "Mac OS X" keymap set in preferences.

The shortcut for Alt-Enter is written as "alt ENTER". You can look at the default keymaps as an example for defining other keyboard shortcuts.
Note that Alt-Enter is already used by the quickfix menu in IntelliJ IDEA, so it may not be a good idea to use the same shortcut for your own action. If you want to extend the Alt-Enter menu, there are other mechanisms for that (intention actions).

Related

Navigating between splits

I wanted to settup vim-tmux-navigation like navigation on intellij IDE and only way to settup this is from IdeaVim so my configuration in settings -> keymap looks like this:
VimWindowDown_____ alt J
VimWindowLeft______ alt L
VimWindowRight_____alt H
VimWindowUp_______ alt K
But when I split the windows it's not working.... Is this a bug or I'm missing some stuff?
Oh and don't suggest me switcher for my problem...
The best place for setting up custom keys for Vim actions is the ~/.ideavimrc file. You can use the standard Vim map/nmap/noremap/imap/... commands there. For example:
nmap <A-J> <C-W>j
For potential keymap conflicts between the Vim emulation and the IDE see Settings | Vim Emulation.
Chaning Vim actions via Settings | Keymap is not recommended.
OK, got a partial answer.
There is a "Go To Next Splitter" and "Go To Previous Splitter" commands in IntelliJ. So in the keymap settings, change or add keystrokes for those commands to C-h and C-l (or whatever you want). If you are using ideavim, don't forget to override those keymap settings so that C-h and C-l are set to use the IDE. C-h and C-l will probably already be used so be sure you don't need the existing hotkey before you make the change.
This solution will at least allow you to move left/right quickly. Not sure it's going to be possible to move between up/down splits without doing some scripting or if that's even possible to do with scripting.

Grow and shrink selection keybindings in IntelliJ Cursive

Which keybindings should I configure in IntelliJ Cursive to get the "expand" and "shrink" selection behaviour documented in the ParEdit user guide?
The user guide mentions Alt+Up and Alt+Down, but as someone new to structural editing, I'm struggling to find the right keybinding.
It depends which platform you're on. Generally you don't have to configure these actions since they're built in to IntelliJ, they're not Cursive specific. Alt-Up and Alt-Down are for the Mac OSX 10.5+ keymap, recommended if you're on a Mac. In the Default keymap, which is what you'll get if you're on Windows or Linux it's Ctrl-W and Shift-Ctrl-W.
These actions are called "Extend/Shrink Selection" on v14, and on earlier versions (probably for historical reasons) they're "Select/Unselect Word at Caret". They can be found by searching in the Keymaps panel.
If you do want to change any keybindings, make sure you do them in the top-level Prefs -> Keymap settings, NOT in the Prefs -> Keymap -> Clojure Keybindings window. Those are not meant to be edited. On a Mac for example, the default cursive keybinding for Wrap [] clobbered the basic backward navigation keybinding.
This issue cleared up the confusion for me.

What is the intellij idea keyboard shortcut to list all other shortcuts

Eclipse has very good discoverability in that there is a keyboard shortcut thats lists all the keyboard shortcuts. On a Mac this would be Cmd+Shift+L, so on a pc I imagine this would Ctrl+Shift+L.
Is there an IntelliJ idea keyboard that achieves the same thing??
(... so that I can learn by doing, as I am working)
By the way, I am using 12.1.4 community edition.
You can use Help | Find Action (Ctrl+Shift+A or Cmd+Shift+A on Mac) to see all the actions and their shortcuts.
There is no fast way to perform the reverse search yet, but you can open Settings (Preferences on Mac) | Keymap and use the filter by shortcut to find the corresponding action. There is also a feature request to make it easier, feel free to vote.

How to bind an action to multiple shortcut keys in Intellij?

I want to bind some of IntelliJ IDEA shortcut keys, but at the same time keep the default bindings in place in case anyone wants to use my IDE (e.g. pair programming).
Is there a way to assign multiple shortcuts to one action in IntelliJ IDEA? Or is there a plugin that does this?
It's supported out of the box, just add new keyboard shortcuts to the action, old shortcuts will be kept. Note that you can't add a shortcut that conflicts with some other action.
In Settings -> Keymap, there isn't anything preventing multiple shortcuts from being assigned to the same action. Select "Add Keyboard Shortcut" and assign your shortcut. After it is saved, select "Add Keyboard Shortcut" again with your next shortcut. Both should now work.
This was testing with Intellij IDEA 9.0.

Change keyboard shortcut for Basic Code Completion in IntelliJ IDEA on Mac

There is very important shortcut for "Basic Code Completion" in IntelliJ IDE which assumed to be invoked as control+space shortcut on Mac. The problem is this shortcut is system one and used to invoke "Spotlight" in Mac OS X Lion.
How you guys invoke it then?
I think that the question is mostly asking to what key combination do you change it, and why JetBrains haven’t implemented the update to the Mac keymap by themselves.
Anyways, I’ve swapped the Ctrl+Space with Option+Space which doesn’t seem to collide with any Mac OS X system key shortcut.
You either disable/change Spotlight shortcut in the system settings or you change the Basic completion shortcut in IDEA Preferences | Keymap.
You can override the OSX spotlight shortcut in IntelliJ IDEA/Services/Services Preferences. More info: here.
I dont know if this helps but here is a list of the default key mappings http://www.jetbrains.com/idea/docs/IntelliJIDEA_ReferenceCard_Mac.pdf and you can change them from the menu IDE Settings -> Keymap
Alternatively, you can use Ctrl + Shift + Space for "SmartType" to avoid collision with Spotlight.
Actually, spotlight is started by COMMAND-space and not by CTRL-space ...
The shortcut for code compeletion for intelliJ IDEA in MacOS is
Ctrl+Option+Space ,
It Works for me, Try this, it may work