Skip to content

Instantly share code, notes, and snippets.

@retrography
Created May 17, 2019 14:56
Show Gist options
  • Save retrography/ec73c8aeb36e4f2fdbb449f1de1e2ce8 to your computer and use it in GitHub Desktop.
Save retrography/ec73c8aeb36e4f2fdbb449f1de1e2ce8 to your computer and use it in GitHub Desktop.
OH-MY-ZSH Custom Plugin -- Redefines the most used kill ring bindings to sync with the system clipboard (requires clipcopy plugin)
kill-line() { zle .kill-line ; echo -n $CUTBUFFER | clipcopy }
zle -N kill-line
bindkey "^K" kill-line
kill-whole-line() { zle .kill-whole-line ; echo -n $CUTBUFFER | clipcopy }
zle -N kill-whole-line
bindkey "^U" kill-whole-line
yank() { LBUFFER=$LBUFFER$(clippaste) }
zle -N yank
bindkey "^Y" yank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment