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