copybuffer.plugin.zsh 321 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
  else
8
    zle -M "clipcopy not found. Please make sure you have Oh My Zsh installed correctly."
9
10
11
12
13
14
  fi
}

zle -N copybuffer

bindkey "^O" copybuffer