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

Re: preexec function to work after `&&' -> tab completion for preexec


Alas I cannot take credit for this mimecap for the command line,
that is due to the redoubtable Bart Schaefer who replied to a
question I posted on the list.  I just brainlessly extended it.

I use it constantly with screen(1) cutting and pasting and
could not imagine life without it.  I have some function like
print -l (#i)*$1*
print matching files and then move up in screen copy mode to
the wanted file and hit a button and the file is pasted onto
the command line with enter automatically appended and the file
opens with its associated application.  (This is made practical
by my quirky policy of not using subdirs much and having all files
in a single dir - using `_' to give descriptive "classes" to filenames).

Thanks Jesper for asking the question about completion.  Its been on the tip of my
tongue for months - just did not get round to posting it.


> > fi
> > 
> I only now found the time to experiment with Eric's neat preexec function,
> and it's very nice. However, I'd like it to also work with tab completion,
> is that possible?
> I.e. say I have a file in my current directory called "foo.pdf". Writing
> "./foo.pdf" on the command line starts acroread with the file as an
> argument, just as I wanted, but I cannot type "./fo<tab>" and have a
> completion of the file name. I'm not even sure this would be desirable in
> the general case, as I'm normally not interested in completing regular
> files in the first position, but would it be possible to for example
> specify that files in the current directory should be completed? Or is
> there a better way to solve this problem that I haven't thought about?
> TIA,
> Jesper
> -- 
>           Jesper Holmberg            |"But how can |
>   jesper.holmberg@xxxxxxxxxxxxxxxx   | one be warm |
> ENST Br, BP 832, 29285 Brest, FRANCE | alone?"     |

Eric Smith
Fruitcom BV 
Tel: +31 15 750 2364
Fax: +31 15 219 0524
Mobile: +31 6 551 76300
PO Box 2855 
2601 CW Delft 
The Netherlands

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