Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: About insert-last-word and "command args | less"
- X-seq: zsh-users 10875
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: About insert-last-word and "command args | less"
- Date: Sun, 15 Oct 2006 02:50:19 +0200
- In-reply-to: <061014142741.ZM22567@xxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20061014115617.GA28997@xxxxxxxxxxxxxxxxxxx> <061014142741.ZM22567@xxxxxxxxxxxxxxxxxxxxxx>
On 2006-10-14 14:27:41 -0700, Bart Schaefer wrote:
> Use smart-insert-last-word.
>
> autoload -U smart-insert-last-word
> zle -N insert-last-word smart-insert-last-word
> zstyle :insert-last-word match '*[[:alnum:]]*[[:alnum:]]*'
>
> That example says that a word must contain at least two alphanumeric
> characters, so neither 'm' nor '|' qualifies and "file" is inserted.
Thanks, but this is buggy with setopt HIST_IGNORE_DUPS:
prunille:~> zsh -f
prunille% setopt HIST_IGNORE_DUPS
prunille% autoload -U smart-insert-last-word
prunille% zle -N insert-last-word smart-insert-last-word
prunille% zstyle :insert-last-word match '*[[:alnum:]]*[[:alnum:]]*'
prunille% true
prunille% :
prunille% echo | :
prunille% true
prunille% : true
prunille%
On this new line, I start by typing ^]_ and I get "true" as expected,
but on the second ^]_ I get "echoue" with the cursor over the "u".
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author