mawww/kakoune

Add `0` commands to pipe-all with NUL

alexherbo2 opened this issue · 1 comments

  • 0: Pipe all selections – separated by null characters – through the given external filter program and replace the selections with its output after restoring.
  • Alt + 0: Pipe all selections – separated by newlines, each line separated by null characters – through the given external filter program and replace the selections with its output after restoring.

Examples – Sort selections by their content:

0sort -z<ret>
<a-0>sort<ret>

The command should fail if a selection contains NUL.

It seems Alt+0 would be used more often then 0, though I guess that messes up the mnemonic.

While it seems like there would be use cases for this, I can't think of any specific ones. When would we sort all the selections? What else would we do, other than sort them? We can't change the number of selections, so I think we can only reorder them - manipulating each one would use | instead. More complicated things like replacing successive duplicates with wildcards or something seem hard to do with a pipe.