Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: About insert-last-word and "command args | less"



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