copybuffer.plugin.zsh 328 Bytes
Newer Older
1
# copy the active line from the command line buffer 
2
# onto the system clipboard
3
4
5

copybuffer () {
  if which clipcopy &>/dev/null; then
6
    printf "%s" "$BUFFER" | clipcopy
7
8
9
10
11
12
13
14
  else
    echo "clipcopy function not found. Please make sure you have Oh My Zsh installed correctly."
  fi
}

zle -N copybuffer

bindkey "^O" copybuffer