All pastes #797744 Raw Edit

Make Control-v paste in bash

public shellscript v1 · immutable
#797744 ·published 2007-11-26 05:55 UTC
rendered paste body
# Make Control-v paste, if in X and if xclip available - Josh Triplettif [ -n "$DISPLAY" ] && [ -x /usr/bin/xclip ] ; then    # Work around a bash bug: \C-@ does not work in a key binding    bind '"\C-x\C-m": set-mark'    # The '#' characters ensure that kill commands have text to work on; if    # not, this binding would malfunction at the start or end of a line.    bind 'Control-v: "#\C-b\C-k#\C-x\C-?\"$(xclip -o -selection c)\"\e\C-e\C-x\C-m\C-a\C-y\C-?\C-e\C-y\ey\C-x\C-x\C-d"'fi