One of the most frequent things I used to do in Emacs is to have two buffers open: one for Scala code, and one for the Scala Console/REPL, and send code from the code buffer to the console, and rapidly switch between the two buffers using my own defined keyboard shortcuts.
What are the keyboard short-cuts to do this in Intellij IDEA with Scala? None of the docs seem to have exactly what I want, which is:
have both the Scala console (REPL) and the file (code) windows open
switch back and forth between code and console.
If there's no pre-defined keyboard shortcut, then is there an action for this, so I can define my own shortcut? I know there's "Jump to last window" (F12) and "Restore default layout" (Shift F12); these almost get me what I want: F12 takes me to the Scala console, and Shift F12 takes me to the code but closes the Scala console, and I want the Scala console to remain open.
More generally, it would be great to have Shortcuts/Actions to simply cycle through the open windows/components in the IDE, without having to use the switcher (Ctrl-TAB).
As far as I can tell you can run the scala console in either Run mode or Debug mode.
To jump to the Run panel you can hit: Cmd + 4
To jump to the Debug panel you can hit: Cmd + 5
To jump to code without closing the panel hit ESC
To close the currently open panel and go back to code hit the same shortcut for the panel.
If for some reason these don't work for you you can check the keymap bindings. Run & Debug bindings are under Main menu -> View -> Tool Windows -> Run, Debug. The escape binding is Editor Actions -> Escape.
Related
I have ctrl+f2 mapped to toggle bookmark in my vscode keyboard shortcuts.
{ "key": "ctrl+f2", "command": "bookmarks.toggle", "when": "editorTextFocus" },
It work correctly on Linux and Windows, but not on macOs.
I have enabled the setting to switch function keys (f1, f2, etc) to behave as standard function keys.
I have then unmapped ctrl+f2 in macOs keyboard shortcut settings.
But still ctrl+f2 keyboard shortcut is not registering with vscode.
Troubleshooting VS-Code Keybinding Issues
The best way to troubleshoot an issue with Keybindings in V.S. Code is to use the tool that was created for solving keybinding issues
The tool is simply named: "Keyboard Shortcut Troubleshooting Tool"
The tool comes with V.S. Code "out of the box", as a result; no downloading, or installation is needed. To use the tool you just activate it from the Quick Input Menu that drops open by pressing the F1-Key. If you cannot find it your self I posted instructions below, and an image. If you can find it yourself, then skip the "Activating the Troubleshooting Tool" Section, and go ahead and read, "Effectively Troubleshooting Issues with the Troubleshoot Keyboard-Shortcut Tool"
Activate V.S. Code's Troubleshooting Tool
Hit the F1-Key
When the quick input drops open type the following into the text input:
"Toggle Keyboard Shortcuts Troubleshooting"
Select the option: Developer: Toggle Keyboard Shortcuts Troubleshooting
It should automatically open the OUTPUT panel, which is located in the same panel that your terminal is. Make sure that the OUTPUT is set to LOG(Window) in the drop down. (I took a picture and posted it below if you can't find the Keyboard Shortcut Troubleshooter).
The image might have funny declensions because I am on a dual monitor setup with 1 1080x1920 curved screen and one 1080x720 screen.... I cropped it to a STD HD 1920 width.
HELPFUL SIDE NOTE:
"This tool may be the most verbose program ever written, as far as I can tell, it logs data to the OUTPUT Console each & every time you activate a keyboard event. Truth be told, I find this tool to be extremely distracting, and very annoying. Because of this, it is important to note, that even if you switch out of your OUTPUT console to your terminal or something. The Troubleshooter is still actively logging to the OUTPUT Console. Make sure when you are finished to turn it off."
Turning off the Keyboard Troubleshooter, requires the same process as turning it on.
Using V.S. Code's Troubleshooter
STEP-1: Close VS Code
This is not to be confused with reload V.S. Code. The only mechanism that VS-Code has for reloading its-self, doesn't provide the same functionality as closing, and reopening V.S. Code. The two are similar, but they are not equal (discussion for another time).
actually stop its process from running by hitting the X in the upper right corner of the title-bar, or hit
**[Alt + F4].
Step-2: Reopen V.S. Code W/O Any Extensions
Don't worry, you won't have to uninstall anything. You will start V.S. Code from the command-line though. Open up your bash terminal, or Powershell, and enter the following command:
$ code --disable-extensions
V.S. Code should start almost immediately
If the V.S. Code CLI doesn't open your editor, or this doesn't disable your extensions, you should refer to this link
Step-3: Start the Keyboard Shortcut Troubleshooter
I already explained this step above, so their is no reason to go over it again. Do make sure you have your panel open, and the OUTPUT tab is selected. You should see a bunch of logging being output, in the VS-Code output (that is redundant sounding), logging when you use any keybinding. The drop-down should have Log(Window) showing, as the current log selected.
Step-4: Test Your Keybinding
At this point you can use your keybinding, and get results. They might not be the results that you were hoping for, but the troubleshooter should give you details as to what is happening when you use your keyboard shortcut (aka bound-key, aka key-binding).
Step-5:
Fix the issue by opening the Keyboards Shortcuts configuration file by opening the quick input, (like I described above for the troubleshooter), and type Keyboard Shortcuts. Their will be two options, one is the default Keybindings that cannot be written too, the other is a configuration file, where you are allowed to overwrite all of the default keybindings if you choose. Look in the default keybinding.json file and make sure the keybinding that you feel is assigned to a certain task, really is assigned to it. Look in the regular keybindings.json file, and make sure if anything is written in it, that those keybindings are not affecting the keybinding that is not working for you. Use the information from the troubleshooter to help guide you through the process.
These links below further elaborate on V.S. Code keybindings:
V.S. Code Community Docs (Community Contributed)
V.S. Code Official Docs (Keybindings)
I use Cmd-. (Command-Period) as a common hotkey in my IDEs (go to definition), but recently the IDEA/JetBrains IDEs have started to re-interpret this key combination as the escape key. I can't figure out what exactly changed on my system to make this start happening. There was probably an OSX update or two which happened between the last time it worked and when I noticed the new behavior.
In the IDEA keymap menus, when I hit Cmd-. in the search-by-key dialog, it inserts the Esc glyph, the the behavior of the rest of the app seems to follow suit, it's just acting like Esc.
This issue seems to be specific to the IDEA-based apps. It reproduces in PyCharm, GoLand, and Android Studio. Cmd-. still works as expected in iTerm2, Cocoa Emacs, and the OSX system shortcut settings window.
Any idea of how I can bring back Cmd-., or at least interpret it as something other than Esc?
Unfortunately, there's no way to stop interpreting Cmd-. as Esc. However, as a workaround, you can try assigning the shortcut in a keymap XML file.
It may help in some cases, e.g. it works for opening tool windows, but it doesn’t work with Find in Path because sometimes the dialog gets closed (both meta . and Esc are invoked).
In Preferences | Keymap, set some shortcut to the desired action, and exit IDE
Open settings directory: https://intellij-support.jetbrains.com/hc/en-us/articles/206544519
Open a keymap XML file under "keymap" directory
Find the action changed in step 1, and change the "first-keystroke" parameter of the "keyboard-shortcut" node to "meta period". So it will look like:
<keyboard-shortcut first-keystroke="meta period" />
I want to know how do I clear up my terminal in Vs code without using Ctrl C
and restarting my how program?
There is an unbound command:
workbench.action.terminal.clear
that will do what you want without terminating any running tasks/processes. You can set it to a keybinding of your choice if you search for it in the Keyboard Shortcuts. It appears to work when you have editor focus and not terminal focus.
I use Emacs with Cider to debug Clojure Code. After setting a breakpoint using the default debugging framework , there appears the list of debugging options one might execute shown in this Figure .
After pressing l the local values appear in a new tab in emacs. One can press on each element of the list of locals and click ENTER to jump into each map in the list and see its values, which works perfect.
How do we navigate back? After entering a map in a map in a map, how to navigate back one step?
The only behaviour I found is to go back to the debug window again press l and find the right map and find its child again, but there has to be a shortcut?
What is the shortcut? What is the procedure to find such a shortcut in the feature? Google did not help
You can use M-x cider-inspector-pop command. Usually it is bound to l key.
To find this keybinding, you could use M-x describe-mode command, when in the inspector buffer. It will give you all the commands of the mode and keybindings which these commands are bound to.
When I use PyCharm I find myself frequently trying out pieces of code interactively. So far, my workflow has been to use pdbfor this and set a breakpoint as pdb.set_trace, which then drops me into the console.
However, for PyCharm the resulting console has no command history - the up arrow instead moves the cursor upwards into the previous output, which is a pain to use.
I realize there's also the built-in debugger that has a console with history, but getting there involves more clicks (run the debugger, switch to Console tab and clicking on "Show Python Prompt").
There is a built-in console that does have a command history (Tools > Python Console), however, unfortunately that's not the console that's being run for pdbbreak points. Is it possible to get PyCharm to use a different console for pdb?
No, it's not possible. PyCharm has no control over what happens when you invoke pdb.set_trace().