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

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

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.

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.

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.

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

Keyboard shortcut to Un/Comment out code in Mathematica 7?

A keyboard shortcut to comment/uncomment out a piece of code is common in other programming IDE's for languages like Java, .Net. I find it a very useful technique when experimenting through trial and error to temporarily comment out and uncomment lines, words and parts of the code to find out what is and isn't working.
I cannot find any such keyboard shortcut on the Mathematica front end in version 7. I know that it is possible to comment out code by selecting the code, right mouse click and select Un/Comment from the menu that appears but this is too slow while coding.
I tried to access this using the menu key Menu on the keyboard but Mathematica frontend doesn't respond to or recognise this key unlike other applications, this could have allowed a key combination for commenting. Can someone else verify that this isn't unique to my machine and that the key isn't recognised by mathematica. I looked at this question and looked in the KeyEventTranslations.tr file but I don't think there is any way to create a shortcut to do this(?). Should I just live with it?
Any other suggestions?
(I have seen there is an Emacs version of mathematica, I have never tried Emacs or this Mma version and imagine that it would have this ability but would prefer not to go to the trouble and uncertainty of installing it. Also I would guess that the Wolfram Workbench could do this, but that may not be worth the investment just for this.)
You can install the shortcut in Mathematica 7.0.x if you are willing to edit the Mathematica system file MenuSetup.tr. You can find it in the same location as the KeyEventTranslations.tr file (i.e. in the installation under "SystemFiles/FrontEnd/TextResources/platform"). In MenuSetup.tr, locate the following line under the definition of the Edit menu:
MenuItem["Check &Balance", "Balance", MenuKey["B", Modifiers->{"Control", "Shift"}]],
Immediately below that line, insert the following:
MenuItem["Un/C&omment Selection", KernelExecute[FE`toggleComment[]], MenuKey["/", Modifiers->{"Command"}], MenuEvaluator -> Automatic, Method -> "Queued"],
The Un/Comment Selection command is now available under the Edit menu, with the keyboard shortcut Cmd-/ or Alt-/ depending on your platform -- just like in Mathematica 8 where this command comes pre-installed.
Please take as read the usual disclaimers about hacking the Mathematica installation files -- no warranty is offered :)
I do not know of any way to map this function to some shortcut involving the Menu key.
Shortcut Key, No Menu
The preceding steps mimic what Mathematica 8 does by installing a new menu item. If you prefer to leave the menus unchanged, then you can install the shortcut in KeyEventTranslations.tr instead. Add the following line:
Item[KeyEvent["/", Modifiers->{Command}], KernelExecute[ToExpression["FE`toggleComment[]"]], MenuEvaluator -> Automatic, Method -> "Queued"]
You'll need a comma on the end of that line if it is not the last item in the list.
Select the code and press one of the following:
Alt+/
Alt-E-O
Alt+E+O
Notes:
Tested only on Windows, using Mathematica 8.
On my non-US keyboard (ABNT Brazil), the shortcut Alt+/ doesn't work, instead I use Alt+E+O.
Here is code for your KeyEventTranslations.tr file that will comment out code. I am still working on the other half.
Item[KeyEvent["/", Modifiers -> {Command}],
FrontEndExecute[{
NotebookApply[FrontEnd`InputNotebook[],
"(*\[SelectionPlaceholder]*)"
]
}]
],
This binds it to Alt+/ as it is in Mathematica 8.