Sublime Forum

Is there any shortcut to un-dent selected content completely?

#1

I can un-indent using shift+tab.

Is there any shortcut to un-dent selected content completely with one key in stead hitting the key combination again & again or holding?

If not, how can I create such shortcut?

Thanks!

0 Likes

#2

You can hit the Home key and then Ctrl+Backspace keystroke.

  1. Everything you (n)ever wanted to know about indentation in ST3
0 Likes

#3

Is there any way I can create new shortcut targeting this command?

0 Likes

#4

You can install the package ChainOfCommand and create this keybind on you user file:

{
    "keys": ["ctrl+backspace"],
    "command": "chain",
    "args": {
        "commands": [
            ["move_to", { "to": "bol", "extend": false }],
            ["delete_word", { "forward": false }],
        ],
    },
},
3 Likes

#5

I would recommend Chain of Command to make sequenced commands into a single command for adding key bindings.

In that case, add the following to your key bindings.

    // un-indent selected content completely
    {
        "keys": ["YOUR_KEY_BINDING"],
        "command": "chain",
        "args": {
            "commands": [
                [ "split_selection_into_lines" ],
                [ "move_to", {"extend": false, "to": "bol"} ],
                [ "delete_word", {"forward": false} ],
                [ "deselect" ],
            ]
        }
    },
1 Like

#6

Very cool - I didn’t know about that one! Will have to remember that for the future :slight_smile:

1 Like