Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Created December 12, 2012 06:43
Show Gist options
  • Save rummelonp/4265562 to your computer and use it in GitHub Desktop.
Save rummelonp/4265562 to your computer and use it in GitHub Desktop.
zsh で C-k(kill-line)と C-y(yank)をクリップボードと共有する
function copy-line-as-kill() {
zle kill-line
print -rn $CUTBUFFER | pbcopy
}
zle -N copy-line-as-kill
bindkey '^k' copy-line-as-kill
function paste-as-yank() {
pbpaste
}
zle -N paste-as-yank
bindkey "^y" paste-as-yank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment