Iterm2 Customized Key Mapping does not work as Vscode Shell - visual-studio-code

I have configured my Vscode to use ITerm2 as the built-in shell.
However, my customized key mapping does not work inside the Vscode. But it does work in external standalone ITerm2.
For example, in VScode ITerm2, Option + H combination displays the escape character, as shown.
But in external ITerm, it moves the cursor left, as expected due to my key mapping configuration, as below.

Related

How to change F5 key binding on Ubuntu 22.04 laptop

I have installed Visual Studio Code on Ubuntu 22.04 and found out that F5 Start Debugging key does not work because it is captured by operation system. It is bound to lower screen brightness function.
How can I disable this operation system key binding?
As a quick fix I have changed keyboard mapping inside VS Code, but I do not like it.
I would rather keep standard VS Code binding and bind Fn+F5 to lower screen brightness, as it is indicated on my laptop keyboard.

Sending commands prefixed with `Shift`-`Alt` to VSCode's integrated terminal in Windows 11

Is it possible to send keyboard shortcuts prefixed with Shift-Alt to VSCode's integrated terminal in Windows 11?
I'm using Tilish, a nifty tmux plugin that by default uses several shortcuts prefixed with Shift-Alt (e.g. Shift-Alt-q to close a panel). Unfortunately, commands prefixed with Shift-Alt don't seem to get propagated to the terminal.
Ideally I'd prefer all input go to the terminal while my input focus is there.
Thanks!

In VSCode integrated Terminal, how to pass mouse event?

As title.
For more environment details, I am using the default configure in VSCode. I connected to my server via SSH in the VSCode integrated terminal. I can use VIM to edit files. I have configured for VIM to enable mouse click in .vimrc as below.
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
endif
set clipboard=unnamedplus
It works fine when I use other terminals. Does anyone know what I should configure in VSCode or .vimrc?

How to transfer VSCode key mapping on windows to ubuntu

I use vs-code as my go-to editor on Windows. Recently I've installed on Ubuntu and now the default key mapping is different.
Is there any way I can set the key mapping on Ubuntu similar to what they were for Windows, or at least a subset of it?
I have created an extension that provides the default Windows keybindings. It is on the VSCode extension marketplace and called Windows Default Keybindngs.
I have tested it on Linux with VSCode 1.38.0 and 1.36.1.
The new bindings take precedence where there is a conflict, but existing, non-conflicting bindings are still available.
Basically all I did was use HolyBlackCat's suggestion to run "Preferences: Open Default Keyboard Shortcuts (JSON)" and stuff the result into the appropriate place in package.json. (Plus document it and figure out how to publish it!)
Update 2020-06-05: In response to a question in a comment, I did a search and found LinuxKeybindings, an extension that provides the default Linux bindings. I have not tried it myself but this could be useful for those wanting the Linux bindings instead of Windows bindings.
A quick way to transfer the default keymap without an extension:
VS Code Windows (source)
open "Show All Commands" / Ctrl+Shift+P
select Open Default Keyboard Shortcuts (JSON) (docs)
Note: #Ville Venäläinen's answer did not work for me for default key bindings.
copy everthing to clipboard or a temporary file (like you need it)
VS Code Linux (target)
open user keybindings / CTRL + K CTRL + S → click Open Keyboard Shortcuts (JSON) button
paste all previously copied settings to this file. If you already have custom user settings, make sure to don't overwrite them. Also preserve the file JSON structure [{}, {}, ...].
Additional notes
You can make a backup of the keymaps before. Default file locations analogue to settings.json:
Linux: $HOME/.config/Code/User/keybindings.json
Windows: %APPDATA%\Code\User\keybindings.json
If needed, also copy custom user keyboard shortcuts in source and append them in the target keybindings.json file (as explained above).
This worked well for me with a Debian target distro. If you should happen to get a key conflict, just delete or change the relevant key binding for this case.
At least with the latest VSCode, you can go to File -> Preferences -> Keyboard Shortcuts. On that page, there is a text under the search field: For advanced customizations open and edit keybindings.json. That will open you a view showing the default keybindings on the left and an empty file on the right for your own bindings. You can try to copy those bindings from Windows and save the to your Ubuntu one.
If you're not customizing your keymap, look through VSCode Keymaps for keymaps and install on both Windows and Ubuntu.
I personally use the code-settings-sync extension.
Synchronize Settings, Snippets, Themes, File Icons, Launch, Keybindings, Workspaces and Extensions Across Multiple Machines Using GitHub Gist.

There a way to swapping instances of only the application VSCode?

I'm new to VSCode (Visual Studio Code) and I'm coming from WebStorm.
When I used WebStorm I was able to use Command + ` to swap instances of WebStorm windows. This behavior is also found in Chrome when you use that shortcut to switch between Chrome windows.
Is there a way to do this on VSCode?
Two options using VS Code:
The workbench.action.switchWindow keybinding to select the window to switch to. It is bound to ctrlw by default
The workbench.action.quickSwitchWindow command. Unlike workbench.action.switchWindow, it automatically switches windows when you release the keys. It is not bound by default but you can configure a keybinding for it.
The OS may also provide this:
Mac: cmd`
Windows