zsh-users
 help / color / mirror / code / Atom feed
* completion for pdf and python
@ 2006-03-24 11:29 Fabian Braennstroem
  2006-03-24 12:17 ` acroread problem? [was: completion for pdf and python] Francisco Borges
  0 siblings, 1 reply; 8+ messages in thread
From: Fabian Braennstroem @ 2006-03-24 11:29 UTC (permalink / raw)
  To: zsh-users


Hi,

I try to add a completion for xpdf, acroread and python.
When typing xpdf|acroread I just want to see pdf files and
with python only *.py files.

zstyle ':completion:*:*:acroread:*' file-patterns \
  '*.(pdf):pdf\ files *(-/):directories'

zstyle ':completion:*:*:xpdf:*' file-patterns \
  '*.(pdf):pdf\ files *(-/):directories'

zstyle ':completion:*:*:python:*' file-patterns \
  '*.(py):py\ files *(-/):directories'

Unfortunately, my attempt does not work. I get:

`--> python
No matches for: `script file'
`--> xpdf
No matches for: `PDF' or `PDF file'

`--> acroread
No matches for: `PDF file'

Do you have any idea, what I am doing wrong?


Greetings!
 Fabian


^ permalink raw reply	[flat|nested] 8+ messages in thread

* acroread problem? [was: completion for pdf and python]
  2006-03-24 11:29 completion for pdf and python Fabian Braennstroem
@ 2006-03-24 12:17 ` Francisco Borges
  2006-03-24 13:24   ` Fabian Braennstroem
  0 siblings, 1 reply; 8+ messages in thread
From: Francisco Borges @ 2006-03-24 12:17 UTC (permalink / raw)
  To: zsh-users; +Cc: Fabian Braennstroem

» On Fri, Mar 24, 2006 at 12:29PM +0100, Fabian Braennstroem wrote:

Hello Fabian,

> I try to add a completion for xpdf, acroread and python.
> When typing xpdf|acroread I just want to see pdf files and
> with python only *.py files.

Hum, which version of Zsh you are using? Do you have completion for
other commands working??

All the programs you mentioned already have completion functions for a
while (I just tested zsh 4.1.1) and already what you want by default.

[...]

Though in the latest version of zsh, xpdf completes also cmd line options.

Python was not completing properly some time ago but it has been fixed
in latest version of zsh (I sent the bug report and the silly fix
;-)).

acroread, seems to have a problem (on 4.3.1) (just try to complete a "-"
option)... Perhaps it was one of the commands with problems on the 4.3.2
release?? Can anybody comment on that?

Cheers,
-- 
Francisco


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: acroread problem? [was: completion for pdf and python]
  2006-03-24 12:17 ` acroread problem? [was: completion for pdf and python] Francisco Borges
@ 2006-03-24 13:24   ` Fabian Braennstroem
  2006-03-24 13:33     ` Frank Terbeck
  0 siblings, 1 reply; 8+ messages in thread
From: Fabian Braennstroem @ 2006-03-24 13:24 UTC (permalink / raw)
  To: zsh-users

Hi,

* Francisco Borges <f.borges@rug.nl> wrote:
> » On Fri, Mar 24, 2006 at 12:29PM +0100, Fabian Braennstroem wrote:
>
> Hello Fabian,
>
>> I try to add a completion for xpdf, acroread and python.
>> When typing xpdf|acroread I just want to see pdf files and
>> with python only *.py files.
>
> Hum, which version of Zsh you are using? Do you have completion for
> other commands working??
>
> All the programs you mentioned already have completion functions for a
> while (I just tested zsh 4.1.1) and already what you want by default.
>
> [...]
>
> Though in the latest version of zsh, xpdf completes also cmd line options.
>
> Python was not completing properly some time ago but it has been fixed
> in latest version of zsh (I sent the bug report and the silly fix
> ;-)).
>
> acroread, seems to have a problem (on 4.3.1) (just try to complete a "-"
> option)... Perhaps it was one of the commands with problems on the 4.3.2
> release?? Can anybody comment on that?

Sorry, it obviously works with version 4.3.2 (ubuntu)
without my completions! My problem was that I missed the
completion due to too many directories aside the pdf and
python files! Would that be possible define different colors
for directories and files in completions?

Thanks!
 Fabian


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: acroread problem? [was: completion for pdf and python]
  2006-03-24 13:24   ` Fabian Braennstroem
@ 2006-03-24 13:33     ` Frank Terbeck
  2006-03-24 16:21       ` Fabian Braennstroem
  0 siblings, 1 reply; 8+ messages in thread
From: Frank Terbeck @ 2006-03-24 13:33 UTC (permalink / raw)
  To: zsh-users

Fabian Braennstroem <f.braennstroem@gmx.de>:
[...]
> > All the programs you mentioned already have completion functions for a
> > while (I just tested zsh 4.1.1) and already what you want by default.
[...]
> 
> Sorry, it obviously works with version 4.3.2 (ubuntu)
> without my completions! My problem was that I missed the
> completion due to too many directories aside the pdf and
> python files! Would that be possible define different colors
> for directories and files in completions?

zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}

That should use the same colors that 'ls' uses.

Regards, Frank


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: acroread problem? [was: completion for pdf and python]
  2006-03-24 13:33     ` Frank Terbeck
@ 2006-03-24 16:21       ` Fabian Braennstroem
  2006-03-24 17:22         ` Chris Johnson
  2006-03-24 18:16         ` Peter Stephenson
  0 siblings, 2 replies; 8+ messages in thread
From: Fabian Braennstroem @ 2006-03-24 16:21 UTC (permalink / raw)
  To: zsh-users

Hi,

* Frank Terbeck <frank.terbeck@rwth-aachen.de> wrote:
> Fabian Braennstroem <f.braennstroem@gmx.de>:
> [...]
>> > All the programs you mentioned already have completion functions for a
>> > while (I just tested zsh 4.1.1) and already what you want by default.
> [...]
>> 
>> Sorry, it obviously works with version 4.3.2 (ubuntu)
>> without my completions! My problem was that I missed the
>> completion due to too many directories aside the pdf and
>> python files! Would that be possible define different colors
>> for directories and files in completions?
>
> zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
>
> That should use the same colors that 'ls' uses.

Thanks, but it does not have any affect!?


Greetings!
 Fabian


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: acroread problem? [was: completion for pdf and python]
  2006-03-24 16:21       ` Fabian Braennstroem
@ 2006-03-24 17:22         ` Chris Johnson
  2006-03-24 18:16         ` Peter Stephenson
  1 sibling, 0 replies; 8+ messages in thread
From: Chris Johnson @ 2006-03-24 17:22 UTC (permalink / raw)
  To: Fabian Braennstroem, zsh-users

Fabian Braennstroem sent me the following 0.7K:

>>> Would that be possible define different colors for directories and
>>> files in completions?
>>
>> zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
>>
>> That should use the same colors that 'ls' uses.
> 
> Thanks, but it does not have any affect!?

I experienced the same thing because LS_COLORS was not defined.
Googling around showed me some possible definitions, and color
completion now works fine.

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: acroread problem? [was: completion for pdf and python]
  2006-03-24 16:21       ` Fabian Braennstroem
  2006-03-24 17:22         ` Chris Johnson
@ 2006-03-24 18:16         ` Peter Stephenson
  2006-03-25  8:34           ` Fabian Braennstroem
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Stephenson @ 2006-03-24 18:16 UTC (permalink / raw)
  To: zsh-users

Fabian Braennstroem wrote:
> * Frank Terbeck <frank.terbeck@rwth-aachen.de> wrote:
> > zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
> >
> > That should use the same colors that 'ls' uses.
> 
> Thanks, but it does not have any affect!?

If you want to set up LS_COLORS, use dircolors, which comes with GNU ls.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: acroread problem? [was: completion for pdf and python]
  2006-03-24 18:16         ` Peter Stephenson
@ 2006-03-25  8:34           ` Fabian Braennstroem
  0 siblings, 0 replies; 8+ messages in thread
From: Fabian Braennstroem @ 2006-03-25  8:34 UTC (permalink / raw)
  To: zsh-users

Hi,

* Peter Stephenson <pws@csr.com> wrote:
> Fabian Braennstroem wrote:
>> * Frank Terbeck <frank.terbeck@rwth-aachen.de> wrote:
>> > zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
>> >
>> > That should use the same colors that 'ls' uses.
>> 
>> Thanks, but it does not have any affect!?
>
> If you want to set up LS_COLORS, use dircolors, which comes with GNU ls.

Thanks to all! I use:

eval $(dircolors -b ~/.dircolors)

setopt autolist
ZLS_COLOURS=$LS_COLORS
export ZLS_COLOURS
#LS_COLORS=$ZLS_COLOURS
#export LS_COLORS
ZLS_COLOURS="$ZLS_COLOURS:(hosts)=(#b)(*).(mayn.de)=36;40=31;40" # real fun
ZLS_COLOURS="$ZLS_COLOURS:(hosts)=*=33;40" # hostnames in yellow
ZLS_COLOURS="$ZLS_COLOURS:(users)=*=32;40" # users in green
export ZLS_COLOURS

It works fine for me :-)

Greetings!
 Fabian


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-03-25  8:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-24 11:29 completion for pdf and python Fabian Braennstroem
2006-03-24 12:17 ` acroread problem? [was: completion for pdf and python] Francisco Borges
2006-03-24 13:24   ` Fabian Braennstroem
2006-03-24 13:33     ` Frank Terbeck
2006-03-24 16:21       ` Fabian Braennstroem
2006-03-24 17:22         ` Chris Johnson
2006-03-24 18:16         ` Peter Stephenson
2006-03-25  8:34           ` Fabian Braennstroem

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).