ohmyzsh: Tab completion broken when file names contain underscores.
e.g.
mkdir test
touch a.z b.z c.z d.z a_.z b_.z c_.z
ls <tab>
on the first tab you see
ls .z
on the second, you see
a.z b.z c.z d.z
files with underscores are not shown.
About this issue
- Original URL
- State: closed
- Created 12 years ago
- Comments: 17 (8 by maintainers)
Commits related to this issue
- Fix hyphen and underscore filename completion This deletes the previous hack that allowed completing files with the extension: e.g. `abcd.z` to `abcdefg.z`. It is still possible to use `abcd[TAB].z`... — committed to mcornella/ohmyzsh by Gravemind 8 years ago
- Fix hyphen and underscore filename completion This deletes the previous hack that allowed completing files with the extension: e.g. `abcd.z` to `abcdefg.z`. It is still possible to use `abcd[TAB].z`... — committed to DennisDenuto/oh-my-zsh by Gravemind 8 years ago
- Fix hyphen and underscore filename completion This deletes the previous hack that allowed completing files with the extension: e.g. `abcd.z` to `abcdefg.z`. It is still possible to use `abcd[TAB].z`... — committed to aaronbieber/oh-my-zsh by Gravemind 8 years ago
- Fix hyphen and underscore filename completion This deletes the previous hack that allowed completing files with the extension: e.g. `abcd.z` to `abcdefg.z`. It is still possible to use `abcd[TAB].z`... — committed to avleen/oh-my-zsh by Gravemind 8 years ago
- Fix hyphen and underscore filename completion This deletes the previous hack that allowed completing files with the extension: e.g. `abcd.z` to `abcdefg.z`. It is still possible to use `abcd[TAB].z`... — committed to fhenrysson/oh-my-zsh by Gravemind 8 years ago
- Fix hyphen and underscore filename completion This deletes the previous hack that allowed completing files with the extension: e.g. `abcd.z` to `abcdefg.z`. It is still possible to use `abcd[TAB].z`... — committed to ekcode/oh-my-zsh by Gravemind 8 years ago
- Sdave/master (#1) * Added perms plugin (#1752) * Added perms plugin * HTTPS -> HTTP for comment URL * Added a README * Updated TOF comment * Pulled in updates by apjanke with minor twe... — committed to sdave2/oh-my-zsh by sdave2 7 years ago
- Squashed commit of the following: commit a7fb55cf13bd5956a183e42916cf160a962b6370 Author: yongxin SHI <shiyongxin@aliyun.com> Date: Fri Dec 8 07:53:10 2017 +0800 add pip --user (#6470) commit... — committed to ahluntang/oh-my-zsh by deleted user 7 years ago
- Fix hyphen and underscore filename completion This deletes the previous hack that allowed completing files with the extension: e.g. `abcd.z` to `abcdefg.z`. It is still possible to use `abcd[TAB].z`... — committed to seth-cohen/oh-my-zsh by Gravemind 8 years ago
- Fix hyphen and underscore filename completion This deletes the previous hack that allowed completing files with the extension: e.g. `abcd.z` to `abcdefg.z`. It is still possible to use `abcd[TAB].z`... — committed to jmartindf/oh-my-zsh by Gravemind 8 years ago
- Fix hyphen and underscore filename completion This deletes the previous hack that allowed completing files with the extension: e.g. `abcd.z` to `abcdefg.z`. It is still possible to use `abcd[TAB].z`... — committed to chihchun/oh-my-zsh by Gravemind 8 years ago
- improve tab-completion according to https://github.com/ohmyzsh/ohmyzsh/issues/1398 — committed to mgaut72/config by deleted user 5 years ago
- Fix hyphen and underscore filename completion This deletes the previous hack that allowed completing files with the extension: e.g. `abcd.z` to `abcdefg.z`. It is still possible to use `abcd[TAB].z`... — committed to spiliopoulos/zsh-config by Gravemind 8 years ago
I’m also working on having a better default that works for everybody. So far, I found this proposal from stackoverflow that enables fuzzy matching and it also works for the original files that had issues completing (https://github.com/robbyrussell/oh-my-zsh/issues/1398#issue-8184366).
For now you can use this (add it at the end of your zshrc file), until I have the proper time to test each candidate, read up on @Gravemind’s proposal and present a viable PR. Enjoy and report back any issues:
#5435 fixes this, I guess I can merge it immediately given that you’ve been running with that since January. Thanks guys!
👍 Thanks for taking the time to look into that. This is still one of the biggest annoyances to date for me.
I took time to find (and understand) this bug, here is what I found:
The
r:|[._-]=*matcher makes any completion with.,_, or-in file names useful when:But really does not seem worth it: it makes any completion with
.,_, or-in file names really annoying, and you already can typevery[TAB]c.So, here it fixes #1398, #4599, and #4063 (and keeps the other neat substring completion):