top | item 36502278

(no title)

rasen58 | 2 years ago

This is great utility I didn't know about! Thanks!

But do you know why it doesn't seem to work with the `pbfilter` function?

If I do directly `pbpaste | vipe | pbcopy`, then it opens vim and the clipboard text is pasted there. But if I run `pbfilter | vipe`, then vim opens with a blank buffer.

   function pbfilter() {
      if [ $# -gt 0 ]; then
          pbpaste | "$@" | pbcopy
      else
          pbpaste | pbcopy
      fi
   }      

It seems that the number of args is 0 for some reason

discuss

order

nneonneo|2 years ago

I think you have to use `pbfilter vipe`, as the argument to pbfilter is inserted into the middle of the pipe.