1 |
Alon Bar-Lev <alonbl@g.o> wrote: |
2 |
> |
3 |
> Only issue I could not find a solution to is tab completion after '=', |
4 |
> for example: |
5 |
> |
6 |
> xxx --file=<TAB> |
7 |
> |
8 |
> This will not complete files, while it will be nice if it does. |
9 |
|
10 |
For standard commands, it works as it should. For instance, |
11 |
|
12 |
tar --file=<TAB> |
13 |
chmod --reference=<TAB> |
14 |
dd if=<TAB> |
15 |
|
16 |
all work as excpected. For your own custom-commands, it is usually the |
17 |
best idea to write your own _custom-command completion file for _zsh |
18 |
where you can specify the options and their arguments (and how the |
19 |
option arguments can look like, e.g. whether "=" is acceptable |
20 |
as an option-argument separator) in detail. |
21 |
|
22 |
For instance, gentoo-zsh-completion does this for most commands of |
23 |
gentoo projects, others like eix bring their own completion files. |
24 |
If you don't, you do not get completion for options but only the |
25 |
"generic" completion of filenames (in which case "=" has no magic |
26 |
meaning, of course). |
27 |
|
28 |
> There is magic_equal_subst option which enables that but also cause |
29 |
> harm when using = in other places such as: |
30 |
|
31 |
That's exactly the purpose of magic_equal_subst: |
32 |
To support it for *all* arguments everywhere. |
33 |
Usually there is no point to specify this globally. |
34 |
You can of course set it locally in a specific completion function, |
35 |
in which you want it (although other completion helper functions |
36 |
like _arguments are usually sufficient to treat "=" correctly). |
37 |
|
38 |
> Is there any sequence to enable completion after space without |
39 |
> effecting the entire interpreter? |
40 |
|
41 |
After "space"? I suppose the question you meant is answered above. |