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

Re: Redirection Symbol After Completion



----- Original Message ----
From: Chris Johnson <cjohnson@xxxxxxxxxx>
To: zsh-users@xxxxxxxxxx
Sent: Monday, July 10, 2006 8:12:20 AM
Subject: Re: Redirection Symbol After Completion

Bart Schaefer sent me the following 1.9K:

> } > I personally find commands easier to parse with my eye when the space
> } > remains before the redirection symbol:
> } > 
> } >    cat file.txt |
> } > 
> } > Is there any way to force this space to persist even if I type a
> } > redirection operator?
> 
>     self-insert-redir() {
>         integer l=$#LBUFFER
>            zle self-insert
>            (( $l >= $#LBUFFER )) && LBUFFER[-1]=" $LBUFFER[-1]"
>     }
>     zle -N self-insert-redir
>     for op in \| \< \> \&
>     do bindkey "$op" self-insert-redir
>     done
> 
> I like that so much I might even keep it.

This is not working for me.

> ls
noname

> cat no<TAB>

  completes the file as expected.

> cat noname<SPACE>

  Then I type "|"

> cat noname cat noname|[-1]

Am I missing an option?

> echo $ZSH_NAME $ZSH_VERSION
zsh 4.3.2

> setopt
autocd
autopushd
nobeep
nobgnice
correct
extendedglob
extendedhistory
histfindnodups
histignorealldups
histignoredups
histnostore
histsavenodups
nohup
incappendhistory
interactive
interactivecomments
ksharrays
kshglob
monitor
nonomatch
numericglobsort
promptsubst
pushdignoredups
pushdminus
pushdsilent
sharehistory
shinstdin
shwordsplit
zle

Thanks in advance for the help.

Scott





Messages sorted by: Reverse Date, Date, Thread, Author