copybuffer.plugin.zsh 403 B

12345678910111213141516
  1. # copy the active line from the command line buffer
  2. # onto the system clipboard
  3. copybuffer () {
  4. if builtin which clipcopy &>/dev/null; then
  5. printf "%s" "$BUFFER" | clipcopy
  6. else
  7. zle -M "clipcopy not found. Please make sure you have Oh My Zsh installed correctly."
  8. fi
  9. }
  10. zle -N copybuffer
  11. bindkey -M emacs "^O" copybuffer
  12. bindkey -M viins "^O" copybuffer
  13. bindkey -M vicmd "^O" copybuffer