zsh-users
 help / color / mirror / code / Atom feed
* Ignoring files with a specific extension
@ 2008-11-05 11:26 Leslie P. Polzer
  2008-11-05 11:33 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Leslie P. Polzer @ 2008-11-05 11:26 UTC (permalink / raw)
  To: zsh-users


Hi,

what's the most simple way to make zsh completion
ignore files with a specific extension (here FASL)

  a) for all commands

  b) for a certain command (here vim/vi)

Thanks! :)

  Leslie

-- 
LinkedIn Profile: http://www.linkedin.com/in/polzer
Xing Profile: https://www.xing.com/profile/LeslieP_Polzer
Blog: http://blog.viridian-project.de/


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

* Re: Ignoring files with a specific extension
  2008-11-05 11:26 Ignoring files with a specific extension Leslie P. Polzer
@ 2008-11-05 11:33 ` Peter Stephenson
  2008-11-05 11:50   ` Leslie P. Polzer
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2008-11-05 11:33 UTC (permalink / raw)
  To: zsh-users

"Leslie P. Polzer" wrote:
> what's the most simple way to make zsh completion
> ignore files with a specific extension (here FASL)
> 
>   a) for all commands

  fignore=(.FASL)

or

  fignore+=(.FASL)

to preserve the current contents

>   b) for a certain command (here vim/vi)

  zstyle ':completion::complete:vi(m|):*' ignored-patterns '*.FASL' 

This restricts the effect to just "ordinary" completion, i.e. not all
the various clever additions like spelling correction etc.  To make it
more general,

  zstyle ':completion:*:*:vi(m|):*' ignored-patterns '*.FASL' 

should be good enough.

-- 
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


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

* Re: Ignoring files with a specific extension
  2008-11-05 11:33 ` Peter Stephenson
@ 2008-11-05 11:50   ` Leslie P. Polzer
  2008-11-05 12:01     ` Peter Stephenson
  2008-11-06  9:33     ` Richard Hartmann
  0 siblings, 2 replies; 5+ messages in thread
From: Leslie P. Polzer @ 2008-11-05 11:50 UTC (permalink / raw)
  To: zsh-users


Dear Peter,

thanks for your prompt reply, especially the fignore version
is dead simple.

Only nothing of that worked for me... I have tried both setting
fignore and doing

  zstyle ':completion:*:*:vi(m|):*' ignored-patterns '*.fasl'

(actually the extension is a lower case ".fasl")

Is there something I should check for?

FWIW I have the following lines in my /etc/zsh/zshrc:

---

autoload -U compinit
compinit -C

zstyle ':completion:*' list-colors $LS_COLORS

---

and in my local zshrc, among other probably harmless things:

---

setopt extended_glob
setopt equals
setopt correctall

autoload -U url-quote-magic
zle -N self-insert url-quote-magic

---

  Leslie


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

* Re: Ignoring files with a specific extension
  2008-11-05 11:50   ` Leslie P. Polzer
@ 2008-11-05 12:01     ` Peter Stephenson
  2008-11-06  9:33     ` Richard Hartmann
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2008-11-05 12:01 UTC (permalink / raw)
  To: zsh-users

"Leslie P. Polzer" wrote:
> Only nothing of that worked for me... I have tried both setting
> fignore and doing
> 
>   zstyle ':completion:*:*:vi(m|):*' ignored-patterns '*.fasl'
> 
> (actually the extension is a lower case ".fasl")
> 
> Is there something I should check for?
> 
> FWIW I have the following lines in my /etc/zsh/zshrc:
> 
> ---
> 
> autoload -U compinit
> compinit -C
> 
> zstyle ':completion:*' list-colors $LS_COLORS

Looks OK to me... in particular, you're using "compinit" without which
the ignored-patterns method wouldn't work.  I tried it from scratch to
make sure and it worked for me.

One point is that if you have *only* .fasl files, a later completion
pass will put those back in.  To stop that,

  zstyle ':completion:*' completer _complete

(the default is equivalent to adding "_ignored" to the end).  However,
usually the default behaviour is harmless and occasionally useful.

> and in my local zshrc, among other probably harmless things:

Yes, those shouldn't have any adverse effect.

-- 
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


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

* Re: Ignoring files with a specific extension
  2008-11-05 11:50   ` Leslie P. Polzer
  2008-11-05 12:01     ` Peter Stephenson
@ 2008-11-06  9:33     ` Richard Hartmann
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Hartmann @ 2008-11-06  9:33 UTC (permalink / raw)
  To: leslie.polzer; +Cc: zsh-users

On Wed, Nov 5, 2008 at 12:50, Leslie P. Polzer <sky@viridian-project.de> wrote:

> Only nothing of that worked for me... I have tried both setting
> fignore and doing

Try starting zsh with

  zsh -f

and see if you can make it work from there. I agree that nothing
you pasted should influence your completion, but perhaps you
missed something obscure/in a weird place.

Also, what does

  echo $ZSH_VERSION

say?



Richard


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

end of thread, other threads:[~2008-11-06  9:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-05 11:26 Ignoring files with a specific extension Leslie P. Polzer
2008-11-05 11:33 ` Peter Stephenson
2008-11-05 11:50   ` Leslie P. Polzer
2008-11-05 12:01     ` Peter Stephenson
2008-11-06  9:33     ` Richard Hartmann

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).