Answer a question

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

Answers

  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.

Logo

开发云社区提供前沿行业资讯和优质的学习知识,同时提供优质稳定、价格优惠的云主机、数据库、网络、云储存等云服务产品

更多推荐