Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zle insert problems
- X-seq: zsh-users 16188
- From: Jérémie Roquet <arkanosis@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: zle insert problems
- Date: Tue, 2 Aug 2011 17:09:51 +0200
- Cc: Pascal Wittmann <PascalWittmann@xxxxxxx>
- 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=
- In-reply-to: <4E380FF2.3020309@gmx.net>
- 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: <4E380791.2090807@gmx.net> <CAHYJk3RgW0AbYxXxbFyF8wAow6UWtB-=cDH-98y+WWiP3pQU_A@mail.gmail.com> <4E380FF2.3020309@gmx.net>
2011/8/2 Pascal Wittmann <PascalWittmann@xxxxxxx>:
> 9 replace-pacman-command() {
> 10 if [[ $LBUFFER = "pacman"* ]]; then
> 11 zle beginning-of-line
> 12 zle forward-word
> 13 zle delete-word
> 14 zle -U -- $@
> 15 zle end-of-line
> 16 fi
> 17 }
> 18
> 19 replace-pacman-command-insert() {
> 20 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=${BUFFER/pacman [-a-zA-Z]#/pacman $@}
}
?
Best regards,
--
Jérémie
Messages sorted by:
Reverse Date,
Date,
Thread,
Author