Add copybuffer function and keybinding

binds ctrl-o to copy the command line buffer to the system clipboard
This commit is contained in:
Brad Urani 2016-09-21 01:34:15 -07:00
commit 6aabcdf876

14
plugins/copybuffer.zsh Normal file
View file

@ -0,0 +1,14 @@
# copy the active line from the command line buffer
# onto the system clipboard (requires clipcopy plugin)
copybuffer () {
if which clipcopy &>/dev/null; then
echo $BUFFER | clipcopy
else
echo "you must install clipcopy to use this keybinding"
fi
}
zle -N copybuffer
bindkey "^O" copybuffer