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

Re: ZLE Widget: Insert last word (except &)



Talking about context and the "z" expansion flag.  It would be useful
if it was possible to somehow get context information about the words
that were created.

For example, if a word is
        in the command position
        a command separator
        an opening or closing syntax character
        the output/input to redirection.
        parameter assignment (e.g. before a command)
        etc.

I think it be useful if it was possible to get another array that provided
information/context about each of the words from an array created via ${(z)..} 

So it would be possible in this nifty new widget smart-insert-last-word,
to attempt matching the structure of the line rather than just the way
each word looks.

For example when using the "more" command,  it tends to always be the last
command on a command line.  So my command line looks like:'
        cmd1 -flags -flags filename | more
I really don't care about more.  I really would prefer to get to filename.
with this smart-insert-last-word command.

So if I could tell  it to ignore single word commands without args, and
command separators (|), it could find filename in a more reasonable way.

Or in the history completer/widget having context information would make it
a lot easier to look at command line structure, and prune away things that
are unwanted, or make it easier to find things that are useful.



-FR


__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail ? Free email you can access from anywhere!
http://mail.yahoo.com/



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