I would like to know if its possible to indent a single line with the tab-key without deleting the marked text.
In the first part of the GIF you see Visual Studio Code and in the second part Atom. Atom shows the desired behaviour.
Thus far it is possible to indent multiple lines this way in VS Code, it also works with backtab, but not with tab and a single line.
Is this a bug or normal behavior??
My Setup:
Visual Studio Code: Version 1.25.1 (MacOS 10.13.6 High Sierra)
Visual Studio Code: Version 1.25.1 (Ubuntu 18.04 LTS)
You could use this default keybinding:
{
"key": "ctrl+]",
"command": "editor.action.indentLines",
"when": "editorTextFocus && !editorReadonly"
}
to tab single or multilines. If you want that bound to tab you could modify it to:
{
"key": "tab",
"command": "editor.action.indentLines",
"when": "editorHasSelection && editorTextFocus && !editorReadonly"
}
I added the editorHasSelection
clause so it operates only when something is selected on your line, but then you would lose the normal simple tab behavior (that you don't like).
From my understanding, this is the expected behavior. To indent a single line, you'd need to either:
There may be an extension available that gives you your desired behavior, though.
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