From 6aabcdf876fb4c6254a3a3e2743b3d3547d7acb3 Mon Sep 17 00:00:00 2001 From: Brad Urani Date: Wed, 21 Sep 2016 01:34:15 -0700 Subject: [PATCH] Add copybuffer function and keybinding binds ctrl-o to copy the command line buffer to the system clipboard --- plugins/copybuffer.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 plugins/copybuffer.zsh diff --git a/plugins/copybuffer.zsh b/plugins/copybuffer.zsh new file mode 100644 index 000000000..8545c189d --- /dev/null +++ b/plugins/copybuffer.zsh @@ -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