Sublime Forum

Split text into lines and then unselect them?

#1

When you select multiple lines with mouse and press Command-Shift-L (on a Mac) or Control-Shift-L (on Windows or Linux), each line become selected separately and there appear a cursor on each of them.

My question: Is there a key or keyboard shortcut, which, if pressed after that, will preserve the cursors but unselect the lines? (Or maybe a custom macro required?)

I tried Left and Right arrows, that is, to press Command-Shift-L, then Right, and then Left, but the problem is that if the lines are wrapped or there are empty lines between them, it won’t be possible to put cursors back to their original positions.

0 Likes

#2

Does pressing POS1 or END key help? It should move carets to beginning or end of those lines

1 Like

#3

Seems to be you are from Germany :slight_smile: I never heard about the POS1 key and it turned out this is how the Home key is called on German keyboards. And on a Mac, to move to the beginning/end of line, Command-Left/Right are used.

This seems to work, though I will need to test it more.

Aren’t there other ways for this?

0 Likes

#4

Well, splitting a line causes all carets to be located at end of lines. So hitting END key wouldn’t move them.

You could create a plugin which iterates through selections and modifies them by moving selection start to selection end. But finally it’s just the same like hitting END.


Yes, I use a QUERTZ keyboard.

1 Like