From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12326 invoked by alias); 28 May 2015 19:34:45 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20232 Received: (qmail 15709 invoked from network); 28 May 2015 19:34:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,FSL_HELO_BARE_IP_2, RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.0 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: Yuri D'Elia Subject: Re: bracketed paste mode in xterm and urxvt Date: Thu, 28 May 2015 21:16:43 +0200 Message-ID: <5567699B.9060109@thregr.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.106.183.18 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 In-Reply-To: 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.