Skip to content

Instantly share code, notes, and snippets.

@jlongster
Created September 9, 2011 16:26
Show Gist options
  • Save jlongster/1206667 to your computer and use it in GitHub Desktop.
Save jlongster/1206667 to your computer and use it in GitHub Desktop.
ZLE widget for pasting on OSX
#!/bin/zsh
# Implements pasting at the terminal level on OS X
function mac_paste () {
left=$BUFFER[0,CURSOR]
right=$BUFFER[$((CURSOR+1)),${#BUFFER}]
content=`pbpaste`
BUFFER="$left$content$right"
CURSOR=$((${#left}+${#content}))
}
zle -N mac_paste
bindkey "v" mac_paste
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment