Skip to content

Instantly share code, notes, and snippets.

@walkerh
Forked from TooTallNate/pbedit.sh
Last active July 31, 2018 14:28
Show Gist options
  • Save walkerh/a0047896845234bf38d0ad0f00d75760 to your computer and use it in GitHub Desktop.
Save walkerh/a0047896845234bf38d0ad0f00d75760 to your computer and use it in GitHub Desktop.
`pbedit` command: Edit the clipboard in your $EDITOR
#!/bin/bash
# macOS tool to edit the contents of the clipboard in the default text editor
# If your editor supports pipelining it can simplify to:
# pbpaste | $EDITOR | pbcopy
# pbpaste | mate -w | pbcopy # example
tmpfile=`mktemp`
pbpaste > $tmpfile
$EDITOR $tmpfile
pbcopy < $tmpfile
rm -f $tmpmfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment