Sublime Forum

Remove a single space if using "use_tab_stops": true

#1

If I have "use_tab_stops": true, how is it possible to remove a single sapce at the beginning of the line?

For example, I have a file like this one:

if (a == b) {
    // before
}

And the cursor is before the first slash. How is it possible then to remove just a single space, not four?

if (a == b) {
   // after
}
0 Likes

#2

Shift + left arrow, Backspace?

0 Likes

#3

Well (thanks), I know about this workaround. The problem is that this is 3 keystrokes instead of 1, and also 1 additional hand movement (from the arrows block to Backspace). Maybe there is a better solution?

1 Like

#4

A key binding which calls a *.sublime-macro or just the chain command could be used to automate those 3 keystrokes.

[
	{
		"keys": ["alt+backspace"],
		"command": "chain",
		"args": {
			"commands": [
				{"command": "move", "args": {"by": "characters", "forward": false, "extend": true} },
				{"command": "right_delete" }
			]
		},
	},
]
2 Likes

#5

Wow, thank you so much! Really :slight_smile:

0 Likes

#6

another approach on a mac is fn-delete (or forward delete, but not all mac keyboards have it)

0 Likes