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

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.

I like it too.  Thanks so much, Bart!

-- 
Chris Johnson
cjohnson@xxxxxxxxxx
http://www.cs.utk.edu/~cjohnson



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