Skip to content

Instantly share code, notes, and snippets.

@asmod3us
Forked from retrography/killring.plugin.zsh
Created October 3, 2021 16:42
Show Gist options
  • Save asmod3us/4fb18bac9ce2980e43797316ad13bf65 to your computer and use it in GitHub Desktop.
Save asmod3us/4fb18bac9ce2980e43797316ad13bf65 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