I would like to define a keybinding to insert a specific unicode character in VSCode. What is the right way to achieve this ?
All keyboard shortcuts in VS Code can be customized via the keybindings. json file. To configure keyboard shortcuts through the JSON file, open Keyboard Shortcuts editor and select the Open Keyboard Shortcuts (JSON) button on the right of the editor title bar. This will open your keybindings.
Define keyboard shortcuts for tasks# From the Command Palette (Ctrl+Shift+P), select Preferences: Open Keyboard Shortcuts File, bind the desired shortcut to the workbench. action. tasks. runTask command, and define the Task as args .
On the menu bar, choose Tools > Options. Expand Environment, and then choose Keyboard. Optional: Filter the list of commands by entering all or part of the name of the command, without spaces, in the Show commands containing box. In the list, choose the command to which you want to assign a keyboard shortcut.
VSCode has a type
command to handle exactly this kind of use case:
In keybindings.json
:
{
"key": "ctrl+alt+1 s",
"command": "type",
"args": {
"text": "Ψ"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With