From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28097 invoked by alias); 2 Aug 2011 15:10:12 -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: 16188 Received: (qmail 15543 invoked from network); 2 Aug 2011 15:10:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.216.171 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:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=zlAkInyJdcBTGA5GhTfSo3FDrX1LK9eOJ+ulfTIaA/s=; b=Su7WlKgPoMTHIvHV8ixXEt7aO3UQzH8XJ5FRf9k1LQmCNhdXw5aolsJgi0bejEQ8YQ 9sz9YNJ94QtCIxVJh22PbCiDaYm4d0Nw2wRt+aTc89Z4T3cqZILCQjFnrahllpWchjwj To/HR/rAu13RrDVYGF8cuefeVQOE3BV/Gzgw8= MIME-Version: 1.0 In-Reply-To: <4E380FF2.3020309@gmx.net> References: <4E380791.2090807@gmx.net> <4E380FF2.3020309@gmx.net> From: =?UTF-8?B?SsOpcsOpbWllIFJvcXVldA==?= Date: Tue, 2 Aug 2011 17:09:51 +0200 Message-ID: Subject: Re: zle insert problems To: Zsh Users Cc: Pascal Wittmann Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2011/8/2 Pascal Wittmann : > =C2=A09 replace-pacman-command() { > 10 =C2=A0 if [[ $LBUFFER =3D "pacman"* ]]; then > 11 =C2=A0 =C2=A0 =C2=A0zle beginning-of-line > 12 =C2=A0 =C2=A0 =C2=A0zle forward-word > 13 =C2=A0 =C2=A0 =C2=A0zle delete-word > 14 =C2=A0 =C2=A0 =C2=A0zle -U -- $@ > 15 =C2=A0 =C2=A0 =C2=A0zle end-of-line > 16 =C2=A0 fi > 17 } > 18 > 19 replace-pacman-command-insert() { > 20 =C2=A0 replace-pacman-command "-S" > 21 } > 22 > 23 zle -N replace-pacman-command-insert > 24 bindkey "^[i" replace-pacman-command-insert > > I think doing this directly via BUFFER gets quickly unreadable. replace-pacman-command() { BUFFER=3D${BUFFER/pacman [-a-zA-Z]#/pacman $@} } ? Best regards, --=20 J=C3=A9r=C3=A9mie