Create a gist now

Instantly share code, notes, and snippets.

@dpavlin /xclip-vi.sh
Last active Jul 11, 2018

Embed
What would you like to do?
#!/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