Align multiple cursors with whitespace #12186
-
I run into a need to align things on multiple lines fairly frequently. For example, basic tables: // Parameter Min Max
// x 0 500
// x_2 50 1000
// x_3 1000 20000
... Editing large or complex tables like this manually becomes terrible pretty quickly, and I often need to jump to another editor to take care of formatting. Other cases include aligning comments, declarations, or assignments. Those might get taken care of by a formatter, though a formatter isn't always available/doesn't always have the behavior I need. Helix's multiple selection model lends itself to a simple way to do this: For each first selection on a line, insert spaces before the beginning and end of the first selections on other lines until all beginnings and ends are aligned, and repeat for following selections. This vscode extension provides similar functionality. I don't believe there's a command to do this, if there's a simple motion someone knows I'd love to hear it. If not, I'd like to make a PR for an |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think what you're looking for is already covered by the |
Beta Was this translation helpful? Give feedback.
I think what you're looking for is already covered by the
align_selections
command bound to&
by default