* How to change order of completions?
@ 2013-04-01 14:27 reckoner
2013-04-01 15:04 ` Bart Schaefer
0 siblings, 1 reply; 5+ messages in thread
From: reckoner @ 2013-04-01 14:27 UTC (permalink / raw)
To: Zsh Users
Hi,
I have a long list of latex files such as
file.tex , file.dvi, file.log, file.aux
and I would like to complete on the *.tex files before any other file.
In other words, when I do
% vi file<TAB>
I would like to have
% vi file.tex
instead of file.aux.
Any help appreciated!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to change order of completions?
2013-04-01 14:27 How to change order of completions? reckoner
@ 2013-04-01 15:04 ` Bart Schaefer
0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2013-04-01 15:04 UTC (permalink / raw)
To: Zsh Users
On Apr 1, 7:27am, reckoner wrote:
}
} file.tex , file.dvi, file.log, file.aux
}
} and I would like to complete on the *.tex files before any other file.
See here: http://zsh.sourceforge.net/Guide/zshguide06.html#l159
So something like
zstyle ':completion:*:vi(|m):*' file-patterns \
'*.tex:tex-files' '*.(c|cpp|c++|h|py):src-files' '*:all-files'
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to change order of completions?
2013-04-03 22:35 ` Bart Schaefer
@ 2013-04-04 1:09 ` reckoner
0 siblings, 0 replies; 5+ messages in thread
From: reckoner @ 2013-04-04 1:09 UTC (permalink / raw)
To: Bart Schaefer; +Cc: zsh-users
On Wednesday, April 3, 2013 3:35:45 PM, Bart Schaefer wrote:
> On Apr 3, 2:39pm, reckoner wrote:
>>
>> > zstyle ':completion:*:vi(|m):*' file-patterns \
>> > '*.tex:tex-files' '*.(c|cpp|c++|h|py):src-files' '*:all-files'
>>
>> This works great except when I have
>>
>> % vi () { gvim $* }
>>
>> as a user-defined function.
>
> Works for me. Do you perhaps also have an alias for "vi"? What do you
> get from
>
> % vi <ctl-x>h
>
> ??
>
> I just set up a test (513 is me pressing ctl-x h):
>
> ----------
> schaefer<511> which vi
> vi () {
> print $*
> }
> schaefer<512> zstyle -L | grep file-patterns
> zstyle ':completion:*:vi(|m):*' file-patterns '*.tex:tex-files' '*.(c|cpp|c++|h):src-files' '*:all-files'
> schaefer<513> vi
> tags in context :completion::complete:vi::
> tex-files (_files _default (eval))
> src-files (_files _default (eval))
> all-files (_files _default (eval))
> ----------
>
>
>> % vi<TAB>
>
> I presume you mean for there to be a space between vi and <TAB>.
Yes. You are right! I had a stray alias.
Thanks again!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to change order of completions?
2013-04-03 21:39 reckoner
@ 2013-04-03 22:35 ` Bart Schaefer
2013-04-04 1:09 ` reckoner
0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2013-04-03 22:35 UTC (permalink / raw)
To: reckoner, zsh-users
On Apr 3, 2:39pm, reckoner wrote:
>
> > zstyle ':completion:*:vi(|m):*' file-patterns \
> > '*.tex:tex-files' '*.(c|cpp|c++|h|py):src-files' '*:all-files'
>
> This works great except when I have
>
> % vi () { gvim $* }
>
> as a user-defined function.
Works for me. Do you perhaps also have an alias for "vi"? What do you
get from
% vi <ctl-x>h
??
I just set up a test (513 is me pressing ctl-x h):
----------
schaefer<511> which vi
vi () {
print $*
}
schaefer<512> zstyle -L | grep file-patterns
zstyle ':completion:*:vi(|m):*' file-patterns '*.tex:tex-files' '*.(c|cpp|c++|h):src-files' '*:all-files'
schaefer<513> vi
tags in context :completion::complete:vi::
tex-files (_files _default (eval))
src-files (_files _default (eval))
all-files (_files _default (eval))
----------
> % vi<TAB>
I presume you mean for there to be a space between vi and <TAB>.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to change order of completions?
@ 2013-04-03 21:39 reckoner
2013-04-03 22:35 ` Bart Schaefer
0 siblings, 1 reply; 5+ messages in thread
From: reckoner @ 2013-04-03 21:39 UTC (permalink / raw)
To: zsh-users
> On Apr 1, 7:27am, reckoner wrote:
> }
> } file.tex , file.dvi, file.log, file.aux
> }
> } and I would like to complete on the *.tex files before any other
file.
> See here: http://zsh.sourceforge.net/Guide/zshguide06.html#l159
> So something like
> zstyle ':completion:*:vi(|m):*' file-patterns \
> '*.tex:tex-files' '*.(c|cpp|c++|h|py):src-files' '*:all-files'
This works great except when I have
% vi () { gvim $* }
as a user-defined function.
% vi<TAB>
doesn't work but
% vim<TAB>
works as expected.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-04-04 1:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-01 14:27 How to change order of completions? reckoner
2013-04-01 15:04 ` Bart Schaefer
2013-04-03 21:39 reckoner
2013-04-03 22:35 ` Bart Schaefer
2013-04-04 1:09 ` reckoner
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).