neurocyte / flow

Flow Control: a programmer's text editor
MIT License
224 stars 10 forks source link

Suggestion: vis-Style Structural Regular Expressions #11

Open welcome-linja opened 4 weeks ago

welcome-linja commented 4 weeks ago

Well, I say vis-style, but really it was Sam's idea first. vis is the only modal editor ever to grasp the concept with both hands and not have the snail's pace selection-operator grammar; I wish I could use it but I need more code intelligence than it has. If Flow has it I'll never use anything else.

neurocyte commented 4 weeks ago

Can you be a bit more specific? Structural regex seems very vague to me and I don't really want to read the whole vis and sam manuals.

I intend to add regex support to the find command soon, which will also mean regex support for adding cursors and doing multi-cursor edits. Is that enough regex support for you? (that's usually all I need)

welcome-linja commented 4 weeks ago

A structural regular expression is a bit like a (CLI) pipe, except instead of running data through many commands, you’re running a selection through many filters. Like, you select the whole document, then you input a regex and every match of that regex becomes a different selection, then another regex and only the selections that contain that regex are kept, then another and every selection is split into multiple separated by those matches. It’s hard to explain in words; vis has a video demo on their README, and I’m sure there’s a command language section in the man page. It contains cursor-by-regex but goes far beyond it.