In zsh with oh-my-zsh, I like how I can, within this directory for instance:
mydir/
app.component.html
app.component.ts
app.module.ts
app-routing.module.ts
type ./html<tab>
and have it automatically expanded as ./app.component.html
, even though the filename doesn't actually start with html
, but it is a part that is characteristic.
Also, I can ./rout<tab>
to get ./app-routing.module.ts
with a middle clue.
If I use something ambiguous, like ./ts<tab>
, the experience is a bit weirder, since
- 1. it first expands to the longest common part
./|.ts
(where|
represents my cursor's position). - 2. on a second press to
<tab>
(why not the first?), I get a list of options displayed below:
$ ./|.ts
app.component.ts app.module.ts
- 3. on a third press to
<tab>
(why a third?), the first item of the list get selected. - 4. then, after one last
<tab>
, I finally get my expansion to./app.module.ts
.
I understand that zsh needs more input since my initial clue was ambiguous, but I'm sure that 2 <tabs>
would have been saved in the above process if the first <tab>
directly resulted in 3. instead of 1. Is there anything I can configure about this?
Finally, if I use a non-terminal ambiguous clue, things start feeling clumsy. For instance ./mod<tab>
results in
1.
./|d.module.ts
(not sure where thisd
comes from).2. a second
<tab>
just shifts the cursor to the end:./d.module.ts|
.+∞. pressing
<tab>
does not change anything from this point on, or propose a list of options like it did before. So I end up scrolling back and fixing the filename myself.
I would have expected a list of options to be offered in only one <tab>
, like in the previous case.
Is this expected behaviour?
Have I not understood quite well the way autocompletion is supposed to work?
Is this something I can configure, and how?