zsh-users
 help / color / mirror / code / Atom feed
* open file with tex extension
@ 2006-02-13 13:20 Fabian Braennstroem
  2006-02-14 12:30 ` Frank Terbeck
  0 siblings, 1 reply; 4+ messages in thread
From: Fabian Braennstroem @ 2006-02-13 13:20 UTC (permalink / raw)
  To: zsh-users

Hi,

I configured zsh using a couple of config files which I
found in the net, which works fine, but the drawback is that
I don't understand everything...
I like a lot the feature, that when using xpdf and acroread
the completion just displays pdf files. 

A similar feature I could use in a directory with latex
files. Once you translated a latex file you have additional
files with the same name, but different extension.
Now, I look for a way to adjust the completion so that when
I type the name of the latex file zsh completes the
extension to '.tex' and does not give any other options
like:

  `--> vim sample.aux
  completing file
  sample.aux    sample.idx    sample.out    sample.rel    sample.tex\~              
  sample.dvi    sample.log    sample.pdf    sample.tex 

Is that somehow possible?

Greetings!
 Fabian


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

* Re: open file with tex extension
  2006-02-14 12:30 ` Frank Terbeck
@ 2006-02-13 14:26   ` Fabian Braennstroem
  2006-02-14 13:29   ` Jean Chalard
  1 sibling, 0 replies; 4+ messages in thread
From: Fabian Braennstroem @ 2006-02-13 14:26 UTC (permalink / raw)
  To: zsh-users

Hi Frank,

* Frank Terbeck <frank.terbeck@rwth-aachen.de> wrote:
> Fabian Braennstroem <f.braennstroem@gmx.de> wrote:
> [...]
>> A similar feature I could use in a directory with latex
>> files. Once you translated a latex file you have additional
>> files with the same name, but different extension.
>> Now, I look for a way to adjust the completion so that when
>> I type the name of the latex file zsh completes the
>> extension to '.tex' and does not give any other options
>> like:
>> 
>>   `--> vim sample.aux
>>   completing file
>>   sample.aux    sample.idx    sample.out    sample.rel    sample.tex\~              
>>   sample.dvi    sample.log    sample.pdf    sample.tex 
>> 
>> Is that somehow possible?
>
> you can ignore certain patterns for completion:
>
> zstyle ':completion::*:(vi|vim):*' ignored-patterns \
>           '*?.(aux|dvi|log|idx|pdf|rel|out)'
> zstyle ':completion::*:(vi|vim):*' ignored-patterns '*~'

Thanks for the quick reply! 
It just works without the second completion, otherwise the
old completion is 'overwritten'. Thanks!
Is it possible to ignore directories with the same name?

Greetings!
 Fabian


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

* Re: open file with tex extension
  2006-02-13 13:20 open file with tex extension Fabian Braennstroem
@ 2006-02-14 12:30 ` Frank Terbeck
  2006-02-13 14:26   ` Fabian Braennstroem
  2006-02-14 13:29   ` Jean Chalard
  0 siblings, 2 replies; 4+ messages in thread
From: Frank Terbeck @ 2006-02-14 12:30 UTC (permalink / raw)
  To: zsh-users

Fabian Braennstroem <f.braennstroem@gmx.de> wrote:
[...]
> A similar feature I could use in a directory with latex
> files. Once you translated a latex file you have additional
> files with the same name, but different extension.
> Now, I look for a way to adjust the completion so that when
> I type the name of the latex file zsh completes the
> extension to '.tex' and does not give any other options
> like:
> 
>   `--> vim sample.aux
>   completing file
>   sample.aux    sample.idx    sample.out    sample.rel    sample.tex\~              
>   sample.dvi    sample.log    sample.pdf    sample.tex 
> 
> Is that somehow possible?

you can ignore certain patterns for completion:

zstyle ':completion::*:(vi|vim):*' ignored-patterns \
          '*?.(aux|dvi|log|idx|pdf|rel|out)'
zstyle ':completion::*:(vi|vim):*' ignored-patterns '*~'

Regards, Frank


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

* Re: open file with tex extension
  2006-02-14 12:30 ` Frank Terbeck
  2006-02-13 14:26   ` Fabian Braennstroem
@ 2006-02-14 13:29   ` Jean Chalard
  1 sibling, 0 replies; 4+ messages in thread
From: Jean Chalard @ 2006-02-14 13:29 UTC (permalink / raw)
  To: zsh-users

> > Now, I look for a way to adjust the completion so that when
> > I type the name of the latex file zsh completes the
> > extension to '.tex' and does not give any other options
> > like:
> > [example]
> > Is that somehow possible?
>
> you can ignore certain patterns for completion:
>
> zstyle ':completion::*:(vi|vim):*' ignored-patterns \
>           '*?.(aux|dvi|log|idx|pdf|rel|out)'
> zstyle ':completion::*:(vi|vim):*' ignored-patterns '*~'

A possibly better solution would  be to complete on the tex file
first, but would still complete on the other files if there is no
other completion :
zstyle ':completion::*:(vi|vim):*' file-patterns '*.tex' '*'

...that way, if there is a tex file and you hit tab, zsh will complete
on the tex file even if there are other acceptable completions.


It's also possible, and probably even better, to complete first on
whatever is not one of the outputs of latex, while retaining the
completion on them failing that.
zstyle ':completion::*:(vi|vim):*' file-patterns
'*~*.(aux|dvi|log|idx|pdf|rel|out)' '*'

--
J
"Toi, je te trouve pas la même tête que sur la page précédente" -- Wakamiya

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

end of thread, other threads:[~2006-02-14 13:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-13 13:20 open file with tex extension Fabian Braennstroem
2006-02-14 12:30 ` Frank Terbeck
2006-02-13 14:26   ` Fabian Braennstroem
2006-02-14 13:29   ` Jean Chalard

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