Roh*_*ran 9 zsh autocomplete filenames
Eclipse 和 Resharper 有一种很好的文件导航方式。
如果我的当前目录中有以下文件夹(或文件)
MyReallyLongName
MyReallyLongAndFunName
MyReallyLongAndNotReallyFunName
Run Code Online (Sandbox Code Playgroud)
在 eclipse 中,我可以只使用大写字母导航到它们。相应地,在 zsh 中我希望能够输入:
cd MRLAFN(Tab)(回车)
MyReallyLongAndFunName一步进入
如果我现在想用 zsh 做到这一点,我必须输入 My(Tab)Fun(Tab)(Enter)
这对我有用:
zstyle ':completion:*' matcher-list 'r:[^A-Z0-9]||[A-Z0-9]=** r:|=*'
Run Code Online (Sandbox Code Playgroud)
然后我可以在测试目录中执行此操作:
touch MyReallyLongName MyReallyLongAndFunName MyReallyLongAndNotReallyFunName
ls MRLANRFN<TAB>
ls MyReallyLongAndNotReallyFunName
Run Code Online (Sandbox Code Playgroud)
我根据Zshell 用户指南中的提示拼凑起来。