Skip to content

Instantly share code, notes, and snippets.

@brennen
Created January 8, 2019 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brennen/33c1dfa20606f7a7e8aa91906e058425 to your computer and use it in GitHub Desktop.
Save brennen/33c1dfa20606f7a7e8aa91906e058425 to your computer and use it in GitHub Desktop.
# This works when run from a shell:
#!/bin/sh
tmpfile=`mktemp /tmp/edit-clipboard.XXXXXX`
xclip -d localhost:1 -o > "$tmpfile"
"$EDITOR" "$tmpfile"
xclip -d localhost:1 -i "$tmpfile"
rm "$tmpfile"
# This doesn't work:
#!/bin/sh
export EDITOR=gvim
edit-clipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment