Skip to content

Instantly share code, notes, and snippets.

@dpavlin
Last active July 11, 2018 18:47
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 dpavlin/441f4ebdca46f6a197686be16a0f61b8 to your computer and use it in GitHub Desktop.
Save dpavlin/441f4ebdca46f6a197686be16a0f61b8 to your computer and use it in GitHub Desktop.
#!/bin/sh
# workflow:
# 1. focus textarea in browser you want to edit
# 2. press ctrl+a then ctrl+c
# 3. switch to terminal and start this script with optional extensioni for highlight: xclip-vi html
# 4. edit file in vi, and save it
# 5. switch back to browser, and press ctrl+v in already selected textarea
ext=$1
test -z "$ext" && ext=txt
xclip -out > /tmp/$$.$ext && vi /tmp/$$.$ext && xclip -in -selection clipboard < /tmp/$$.$ext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment