lorefnon
lorefnon

Reputation: 13095

Define Keybinding to insert special character in VSCode

I would like to define a keybinding to insert a specific unicode character in VSCode. What is the right way to achieve this ?

Upvotes: 13

Views: 3983

Answers (2)

Type and select "Preferences: Open Keyboard Shortcuts (JSON)" in the Ctrl+Shift+P menu in VSCode.

The file is called keybindings.json but it doesn't seem to be indexed quite as such in search for some reason.

Upvotes: 2

lorefnon
lorefnon

Reputation: 13095

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": "Ψ"
    }
}

Upvotes: 21

Related Questions