epegzz
epegzz

Reputation: 865

Un-indenting lines in VS Code

Is there an equivalent to editor.actions.indentLines that moves the selected lines to the left instead of to the right?

I know you can use Tab / Shift+Tab for indenting. But unfortunately, that does not work in Vim mode.

Upvotes: 6

Views: 9031

Answers (2)

Mark
Mark

Reputation: 182911

That is called "outdenting". See the command:

{
  "key": "shift+tab",
  "command": "outdent",
  "when": "editorTextFocus && !editorReadonly && !editorTabMovesFocus"
}

Just set it to a different keybinding. You can search for "shift tab" in the keybindings to try to figure out what command it is already bound to - in this case "outdent".

EDIT: Actually I see that Ctrl-[ is already bound to outdent so you could try that as well.

Upvotes: 5

alefragnani
alefragnani

Reputation: 3313

No, there isn't. You have editor.action.reindentLines but instead of working as Shift + Tab, it resets the indentation.

There is an open issue (Help Sublime Text users migrate to VS Code) which seems to be mapping this. You could upvote there and maybe comment, asking for the VS Code team to add this command as well.

Upvotes: 1

Related Questions