Sublime Forum

Convert multi-line selection into rectangular selection

#1

Hi everyone,

I am looking for the Sublime Text command to convert a multi-line selection (see image on the left) into a rectangular selection (image on the right, in which short lines have been padded with spaces):

Cheers,
—Torsten

0 Likes

#2

Sorry for following up on myself.

Here’s a macro (based on command alignment of package Alignment) that converts an arbitrary selection into a rectangular one:

[
	{
		"command": "split_selection_into_lines"
	},
	{
		"command": "alignment"
	},
	{
		"args":
		{
			"extend": true,
			"to": "hardeol"
		},
		"command": "move_to"
	}
]

4 Likes