Clearing the terminal in vs code without using ctrl C - terminal

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.

Related

Use ctrl-j and ctrl-k to navigate menus in Visual studio

I normally use vim, but sometimes it's convenient to use Visual Studio 19.
I'm trying to keep my keybindings as consistent as possible between the two.
In vim I use ctrl-p to open a file by typing its name. I switched visual studio to use the vscode keymap defaults to get this behavior (vscode also uses ctrl-p for searching by filename). However, when using the dropdown list for this search, I'd like to be able to highlight a different item by using ctl-j and ctrl-k to move up and down, similar to how fzf works in vim.
Is this a key binding I can set, and if so, what is it called?
I used AutoHotKey with this script
#NoEnv
#SingleInstance, force
#Warn
;#IfWinActive, ahk_exe devenv.exe
^h::Send {Left}
^j::Send {Down}
^k::Send {Up}
^l::Send {Right}
Capslock::Esc
;:#IfWinActive
if you want it only to happen when you have vs2019 up, then uncoment the #IfWinActive, by removing the ; , however, I want to be able to use the bindings whenever, not just in VS
You can compile the script and then put them into your start up by pressing Win-R to open the run command dialog, then entering in
shell:startup
and it will open an explorer window to your startup, just drop the exe in there afterwards, and it should start up every time.
you can also create hotkeys for doing other things, like added my VS path to my PATH environment variable, then had autohotkey assign Win-S to open up devenv.exe with this script.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %userprofile% ; Ensures a consistent starting directory.
#s::
Run, *RunAs devenv.exe
Return

CMD-Period unexpectedly translated to ESC in IDEA apps on macos (PyCharm, GoLand, Android Studio)

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" />

Control key auto pressed when using vim over SSH through cygwin

I'm using cygwin and sometimes, when I am typing in vim on a file over ssh and I switch to a different window and minimize cygwin and then come back to cygwin sometime later, I get a problem.
The problem is that for some reason, my keyboard doesn't work normally anymore, and it appears that for some reason, it thinks that my Control key on my keyboard is always being pressed. I know this because when I press just the 'V' key on my keyboard, vim says it's in Visual Block mode, and when I just press the 'R' key, it tries to Redo any changes.
The bad thing is that this also means that I can't actually exit from vim because I can press the : key, but then pressing wq doesn't actually enter in the normal wq symbols because it's interpreting it as ctrl w, ctrl q.
The only way I can fix it is by closing the entire window and restarting cygwin, but this means I lose any unsaved work, which is annoying.
Note: This doesn't happen when I use vim locally in cygwin (not over SSH)
What is causing this problem?

Intellij IDEA: shortcut to switch between code and Scala console (Mac)?

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.

Keyboard shortcut to switch between the code editor and ipython console using the Canopy

How can I create a keyboard shortcut to switch between the code editor and ipython console using the Canopy IDE?
I have tried writing a macro according to the documentation for code editing (http://docs.enthought.com/canopy/configure/editor-scripting-api.html#code-editor-scripting-commands) and the ipython pane scripting commands (http://docs.enthought.com/canopy/configure/ipython-scripting-api.html#ipython-pane-scripting-commands, but do not see a solution.
As an example, I have a macro that will execute the current line of code (without having to select it), but it would be nice to be able to switch the cursor back to the code editor after execution without touching the mouse/trackpad.
def run():
code_task = get_active_task()
code_editor = code_task.active_editor
cursor = code_editor.cursor
cursor.start_of_line()
cursor.next_line(select=True)
code_task.run_selection()
Using Canopy Version: 1.1.1 (64 bit) on Mac OS X 10.7.5
Thanks, great suggestion. Added to Canopy wish list. (You can use the keyboard shortcut Control+Tab to cycle among File Browser, Editor, and IPython, but this is not yet macro-able.)
(on Mac) -> Better Touch Tool. This is a macro that is only active while i'm in emacs, which does the following:
save the current buffer (set to F1 in my emacs)
cmd-tab to last other window (terminal)
'Up' arrow (to reload last compile/run cmd)
'Enter' key
cmd-tab to last other window (emacs), once process terminates
Has saved me thousands of keypresses today.

Resources