From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5730 invoked by alias); 7 Nov 2011 22:43:04 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29899 Received: (qmail 23056 invoked from network); 7 Nov 2011 22:42:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3baCQeMtgrrD7z1VyONUFDWcWVeTuAf9UrWLM+nLOGo=; b=sbwDwPWgie3XDDTLib60jl57x+clM5Wt2JlQOCPN6VfhiGaBu4VCEAVa7LU1l17Brd sqWfguUDl0CgNdP8utoecf0KAHta62PbX0pbKgseTWuCf+gUSIjH5UMLVY1qf7/cZY0+ PTTPj5fYKA/n34zWmg53rkHs7gxmYdBbDd0Qc= MIME-Version: 1.0 In-Reply-To: <588.1320705064@thecus.kiddle.eu> References: <588.1320705064@thecus.kiddle.eu> Date: Mon, 7 Nov 2011 23:42:46 +0100 Message-ID: Subject: Re: bracketed paste From: Mikael Magnusson To: Oliver Kiddle Cc: Zsh workers Content-Type: text/plain; charset=UTF-8 On 7 November 2011 23:31, Oliver Kiddle wrote: > Has anyone tried enabling the bracketed paste feature of xterm? I have this for urxvt (now, this is a bit spread out in my config, so I might miss some bits here, hope not). bindkey -N paste bindkey -R -M paste "^@"-"\M-^?" paste-insert bindkey '^[[200~' _start_paste bindkey -M paste '^[[201~' _end_paste bindkey -M paste -s '^M' '^J' function _zle_line_init() { # Tell urxvt to send escape codes around a paste [[ $TERM == rxvt-unicode || $TERM = xterm ]] && printf '\e[?2004h' } function _zle_line_finish() { # Tell it to stop [[ $TERM == rxvt-unicode || $TERM = xterm ]] && printf '\e[?2004l' } function _start_paste() { bindkey -A paste main } function _end_paste() { bindkey -e if [[ $_SPACE_AFTER_PASTE_QUOTE = 1 ]]; then LBUFFER+=${(q)_paste_content}' ' else LBUFFER+=$_paste_content fi unset _paste_content } function _spaceafterpastequote() { if [[ $_SPACE_AFTER_PASTE_QUOTE = 1 ]]; then _SPACE_AFTER_PASTE_QUOTE=0 zle -M "Not inserting a space after pastes, not quoting" else _SPACE_AFTER_PASTE_QUOTE=1 zle -M "Inserting a space after pastes and quoting" fi } function _paste_insert() { _paste_content+=$KEYS } zle -N zle-line-init _zle_line_init zle -N zle-line-finish _zle_line_finish zle -N _start_paste zle -N _end_paste zle -N paste-insert _paste_insert zle -N _spaceafterpastequote -- Mikael Magnusson