Skip to content

Bind pipe-to-shell commands to keys? #247

Answered by 71
losnappas asked this question in Q&A
Discussion options

You must be logged in to vote

What you did was supposed to work, but did not work as dance.selections.pipe.replace expands to commands([".selections.pipe"], [".edit.insert", { register: "|", ...argument }]), and therefore the input was only given to .edit.insert. To fix this, you can write

{
  "key": "ctrl+alt+w",
  "command": "dance.run",
  "args": {
    "commands": [
      [".selections.pipe", { "input": "#fmt -73" }],
      [".edit.insert", { "register": "|" }],
    ]
  }
}

For that particular case, though, 57fc476 changes the way composite commands work so that the input is passed to the first command, in this case, selections.pipe, so your example will work with no changes.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by losnappas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants