2

There are some ways to do it. CMD + }, or press Tab when you select more than one line, but I want to change keybindings or install any plugin to make my Tab button work as well as Shift + Tab do.

If there are any misunderstandings I will show an example:

enter image description here

When I press Shift + Tab the line goes left, but this line doesn't go right when I press only Tab

rioV8
  • 24,506
  • 3
  • 32
  • 49
Aspiration
  • 23
  • 3
  • have you tried to go to preferences of vs code then settings and checking if it's disabled. try answers from here too https://stackoverflow.com/questions/36251820/visual-studio-code-format-is-not-using-indent-settings – Armen Sanoyan Dec 14 '20 at 11:32
  • Try the extension `Multi Command` to combine multiple commands into one – rioV8 Dec 14 '20 at 14:34

1 Answers1

1
  1. Go to Keyboard Shortcuts
  2. search for indent line
  3. right-click on Indent Line entry, chose Add Keybinding...
  4. in the popup box asking for a keybinding, hit Tab and Enter to accept

You'll get a custom keybinding added to the end of your keybindings.json that looks like this:

 {
    "key": "tab",
    "command": "editor.action.indentLines",
    "when": "editorTextFocus && !editorReadonly"
 }

You may want to change that "when" clause to

"when": "editorHasSelection && editorTextFocus && !editorReadonly"

if you want it to work only when there is a selection in the line - otherwise you'll never be able to add a Tab anywhere but the beginning of a line.

Mark
  • 143,421
  • 24
  • 428
  • 436