pbcopy

Send echo or register contents to pbcopy / mac clipboard on mac os x

纵然是瞬间 提交于 2019-12-23 18:13:52
问题 I have a custom function in vimscript which creates a string and then echo's it to the bottom console. At the moment I copy and paste that output using cmd-c to copy it to the mac os x clipboard. I would like to shorten this workflow by just piping the echo to pbcopy, i tried: :echo "hello" <BAR> !pbcopy But of course that doesn't work. I also tried capturing the output into a register and then outputting it: :@a!pbcopy But it just trys to execute the string stored in @a, which is no a vim

Set clipboard to image - pbcopy

孤街浪徒 提交于 2019-12-04 00:40:18
问题 How do you set an image as the clipboard with pbcopy? This doesn't work: cat image.png | pbcopy 回答1: As stated, this won't work with pbcopy , but you can write a little objective-c program to do this: http://www.alecjacobson.com/weblog/?p=3816 . Then you can issue: cat image.png | impbcopy - 回答2: Updated Answer You can actually put a JPEG image in the clipboard using Applescript like this at the command-line: osascript -e 'set the clipboard to (read (POSIX file "/Users/mark/Desktop/a.jpg") as

Unable to have pbcopy -clipboard inside Screen

给你一囗甜甜゛ 提交于 2019-11-28 08:50:21
Problem Not solved although one answer was accepted: We are working to get Jonah's code to work. Problem: to change the code of (1) to (2) I know the thread . I want to be able to run the following code inside Screen Code (1) cat ~/.vimrc | pbcopy (1) Code (2) cat ~/.vimrc > /tmp/pbcopy.pipe (2) My attempt to solve the problem: to put the following code to .zshrc function pbcopy() { "(cat \"$1\")" > /tmp/pbcopy.pipe } I get cat masi | pbcopy pbcopy: command not found: (cat "") cat: masi: No such file or directory How can you use pbcopy inside Screen? Chas. Owens Alright, this is a screwy

Unable to have pbcopy -clipboard inside Screen

♀尐吖头ヾ 提交于 2019-11-27 02:27:55
问题 Problem Not solved although one answer was accepted: We are working to get Jonah's code to work. Problem: to change the code of (1) to (2) I know the thread. I want to be able to run the following code inside Screen Code (1) cat ~/.vimrc | pbcopy (1) Code (2) cat ~/.vimrc > /tmp/pbcopy.pipe (2) My attempt to solve the problem: to put the following code to .zshrc function pbcopy() { "(cat \"$1\")" > /tmp/pbcopy.pipe } I get cat masi | pbcopy pbcopy: command not found: (cat "") cat: masi: No