Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bracketed paste mode in xterm and urxvt
- X-seq: zsh-users 20232
- From: Yuri D'Elia <wavexx@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: bracketed paste mode in xterm and urxvt
- Date: Thu, 28 May 2015 21:16:43 +0200
- In-reply-to: <CAFOazAOfk=Sq-smkMGzJKO4b7jMb_1_m4vXXn8twoVA2wV55YA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <BANLkTikh_-+L2W5=Yfu7h7iAe5CcpP6fxw@mail.gmail.com> <CAFOazAOfk=Sq-smkMGzJKO4b7jMb_1_m4vXXn8twoVA2wV55YA@mail.gmail.com>
On 05/28/2015 01:42 PM, Jérémie Roquet wrote:
> PS: below is the full quote of the original mail, which could be
> useful for people that weren't on this list four years ago. Or for
> people like me who didn't give it the attention it deserves.
> PS2: I've added screen-256color to my list of supported terminals,
> though technically I'm not sure it supports bracketed paste (and I'm
> running tmux anyway).
Awesomeness. But I didn't like the quoting toggle.
What about these few changes:
function _start_quoted_paste() {
_paste_quoted=1
bindkey -A paste main
}
function _start_paste() {
_paste_quoted=0
bindkey -A paste main
}
function _end_paste() {
bindkey -e
[[ $_paste_quoted == 1 ]] && LBUFFER+=${(q)_paste_content} ||
LBUFFER+=$_paste_content
unset _paste_content _paste_quoted
}
and now:
bindkey '^x^[[200~' _start_quoted_paste
bindkey '^[[200~' _start_paste
so regular paste is unquoted, but ^x before the paste and it will be
quoted for you. ^x is already a prefix key for me.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author