VSCode insert tab character manually

I'm not sure if there is a generic solution, but you can setup a keybinding for this:

{
    "key": "ctrl+v tab",
    "command": "type",
    "args": { "text": "\t" },
    "when": "editorTextFocus"
}

This keybinding will insert an tab character even when the current mode is spaces.


<Alt> <Numpad: 0 0 9>

Still works great!


Quick-and-dirty solution: Find a tab somewhere else, then copy-paste.

Chances are that you already have a tab character in the file you are editing, but if not you can generate one in another application or text editor.

You can also generate a tab programmatically in a bash shell with the following command (the brackets are optional):

echo -e [\\t]

For your more immediate needs, I have inserted a tab character below...

    There is a tab character between these brackets: [	]

Another approach is to change the tab mode temporarily, as shown here.