Grow and shrink selection keybindings in IntelliJ Cursive - intellij-idea

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.

Related

How to make auto completion in WebStorm (*.js) and IntelliJ (*.go) work the same

In WebStorm I can type something like
document.gEBI
press tab key, and it'll autocomplete to
document.getElementById()
But when I do the similar thing in IntelliJ
fmt.Prl
Auto completion doesn't work (the desired result fmt.Println()) at all, it works only if all the letters match strictly in order.
Is it possible to enable this functionality in IntelliJ? I've imported all the settings from WebStorm.
These Tab key shortcuts aren't part of the auto-complete system the Jetbrains use for all their IDEs as LazyOne says, they are actually part of the template-invocation system.
The auto-complete functionality is built into the shortcut: Ctrl+Space.
I suggest looking up the template invocation for .Println() in the settings, Jetbrains documentation, or raising a ticket with Jetbrains on YouTrack for clearer documenation/control over template-invocation.

IntelliJ/Clojure: shortkey for Sync Files in REPL

I want to find the keybinding for "Sync Files in REPL".
I can find the keybinding for this action in:
File -> Settings -> Keymap -> CLojure Keybinding -> Bind Set: Cursive
I see that the keybinding for this action is Ctrl+Shift+M. However, when I use this keybinding, nothing happens. Do you have any idea why and how to use the keybinding?
I ran into the same issue. This github issue explains it:
The Clojure->Keybindings panel isn't where you make general changes to
the key mappings for actions - you'll find that in the generic
IntelliJ Keymap panel. The Keybindings panel is for setting a bunch of
key mappings in bulk - it's something you'll only do probably once
when you're initially setting Cursive up. For changing mappings for
particular actions after that point, you'll use the Keymap panel.
If you look in KeyMap (not Clojure Keybindings), make a new keymaps profile (or copy one of the existing ones), and the go to Plug-ins -> Cursive -> Sync files in REPL. The key binding specified there should work (unless of course you have it set to something that conflicts with something else).

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.

Shortcut to evaluate an expression on the REPL in Cursive Clojure?

I want to be able to send the current expression to the REPL for evaluation in Cursive Clojure. I can do this in emacs. Does anybody know what the keyboard shortcut for doing this in Cursive Clojure is?
I'm looking for the Cursive Clojure equivalent of C-M-x
Edit:
In this Tim Baldridge video (at 2.47) you can see he has evaluates expressions in the repl using a keybinding.
Open File --> Settings --> Keymap
Click on the "Collapse all" to be able to find the options easily
Then go to Main Menu --> Tools --> REPL
You will have there all the actions for the REPL. The specific one that you are asking for is "Run top form in REPL"
According to the official site:
Key bindings
Currently Cursive is distributed without any shortcuts
assigned to its actions - it’s too difficult to avoid conflicts with
existing actions on all platforms. We’ll be suggesting some possible
keybindings for various features of Cursive as we discuss them. When
we talk about Mac keybindings we refer to the Mac OS X 10.5+ keymap,
which is what we use - not the old Mac OS X one.
Assign your shortcuts yourself, here is how. See section keymaps.
<Alt-Shift-P> (Send the surrounding expression to REPL) with Cursive 1.9.0. As mentioned, under Tools/REPL

Intellij ignores the selected keyboard layout

This seems like a bug in IntelliJ 12: Every couple of times when I switch between keyboard layouts (English and Hebrew) IntelliJ get stuck on one of them and ignore the windows selected keyboard layout. This happens only for intelliJ, all other programs respond as usual to the windows selected keyboard layout.
Is there at least a workaround, or a way to reset IntelliJ's keyboard layout? The only thing that seems to work for me so far is restarting my machine...
(My OS is Windows 7 Enterprise 64bit)
This is 100% reproduced when you switch keyboard layout in quick class search (Ctrl+N). Also in intellij idea 13.
Something like:
Open quick search menu when keyboard is not in English layout (Russian e.g.)
Type anything
Switch to English
Congratulations! you stuck in russian layout :) restart your intellij idea!
When I ceased to switch layout in search, I forgot about this problem.
UPD: it's suitable for most part of text inputs (even for search and file creation)
I've just had this problem on PyCharm 2020.2.3
Here's how I've solved it:
Go to Settings -> Keymap
At the bottom of the window, check the option Use national layouts for shortcuts (require restart)
That did the trick
restarting IntelliJ also works.
I wonder how they managed to get such a stupid bug, this is not an easy bug to write, especially in Java.
That was found to be more like a global Microsoft/Oracle bug. Simple workaround from IntelliJ's issue tracker: use Windows' language parameters to assign a hotkey (Ctrl + number) for changing the layout directly to a desired language. This suddenly will affect both Windows And IDEA. It's said that bug was fixed in Win8. A bit more info: here
In 2020 bug is still relevant in the most IDEs based on IntelliJ. For example I observe this in PyCharm now.
There is workaround for Windows:
Go to Language Bar - Settings... - Advanced Key Settings
Set key sequence of To English action to Ctrl + 1
Set key sequence of to other your language to Ctrl + 2
Apply
Go to IntelliJ/PyCharm and switch language by new sequences
After that bug disappears and you can switch language by traditional method
For me the following actions seem to resolve the issue:
Go to Control Panel
Select Clock, Language & Region
Press Region
In the opened window choose English for Format.
Also all my settings except the location are set to English (locale, default keyboard etc.)
This fix worked on my mac, access Preferences -> Editor -> Typing Corrector from the intellij IDEA menu. If you are able to navigate to the same window on your OS, you can try this.
Uncheck Enable keyboard layout correction in the Typing Corrector window
I got the same issue in Ubuntu 16.04. Restarting IDEA doesn't change anything. But Changing the default layout to be the one I want by default ensured ubuntu work well with it.
Go to the search textfield above file editor.
Switch layout.
Type smth.
Click somwhere in the file editor.
Write smth with swithed layout.