zsh-users
 help / color / mirror / code / Atom feed
From: Yuri D'Elia <wavexx@thregr.org>
To: zsh-users@zsh.org
Subject: Re: bracketed paste mode in xterm and urxvt
Date: Thu, 28 May 2015 21:16:43 +0200	[thread overview]
Message-ID: <5567699B.9060109@thregr.org> (raw)
In-Reply-To: <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.



  reply	other threads:[~2015-05-28 19:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-22 19:16 Mikael Magnusson
2015-05-28 11:42 ` Jérémie Roquet
2015-05-28 19:16   ` Yuri D'Elia [this message]
2015-05-28 20:30   ` Daniel Hahler
2015-05-28 22:30     ` Bart Schaefer
2015-05-29 10:00     ` Yuri D'Elia
2015-06-03  8:35       ` Jesper Nygårds
2015-06-03  8:48         ` toki clover
2015-06-03 10:04         ` Yuri D'Elia
2015-06-03 10:14           ` Jesper Nygårds
2015-06-03 12:06           ` Mikael Magnusson
2015-06-03 14:01             ` Yuri D'Elia
2015-06-06  8:51               ` toki clover

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5567699B.9060109@thregr.org \
    --to=wavexx@thregr.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).