我有一堆带空格的文件名:
[~/music]% ls
Acid Eater - Black Fuzz On Wheels.ogg Angel'in Heavy Syrup 4.mp3
Akalé Wubé - Akalé Wubé.opus Astor Piazzolla & Gary Burton - The New Tango.mp3
Allen Toussaint - The Bright Mississippi.mp3 B.B. King - Live at the Regal.mp3
Angel'in Heavy Syrup 1.opus Bar Kokhba Sextet - Lucifer.opus
Angel'in Heavy Syrup 2.opus Billy Bang - Vietnam the Aftermath.mp3
Angel'in Heavy Syrup 3.mp3
完成操作会为空格插入转义字符(这也意味着没有足够的空间来将其显示在两列中):
[~/music]% mpv <Tab>
Acid\ Eater\ -\ Black\ Fuzz\ On\ Wheels.ogg
Akalé\ Wubé\ -\ Akalé\ Wubé.opus
Allen\ Toussaint\ -\ The\ Bright\ Mississippi.mp3
Angel\'in\ Heavy\ Syrup\ 1.opus
Angel\'in\ Heavy\ Syrup\ 2.opus
Angel\'in\ Heavy\ Syrup\ 3.mp3
Angel\'in\ Heavy\ Syrup\ 4.mp3
Astor\ Piazzolla\ \&\ Gary\ Burton\ -\ The\ New\ Tango.mp3
B.B.\ King\ -\ Live\ at\ the\ Regal.mp3
Bar\ Kokhba\ Sextet\ -\ Lucifer.opus
Billy\ Bang\ -\ Vietnam\ the\ Aftermath.mp3
这是有道理的,但也很难读懂;我想:
[~/music]% mpv <Tab>
Acid Eater - Black Fuzz On Wheels.ogg Angel'in Heavy Syrup 4.mp3
Akalé Wubé - Akalé Wubé.opus Astor Piazzolla & Gary Burton - The New Tango.mp3
Allen Toussaint - The Bright Mississippi.mp3 B.B. King - Live at the Regal.mp3
Angel'in Heavy Syrup 1.opus Bar Kokhba Sextet - Lucifer.opus
Angel'in Heavy Syrup 2.opus Billy Bang - Vietnam the Aftermath.mp3
Angel'in Heavy Syrup 3.mp3
[~/music]% mpv Acid<Tab>
# Completes to:
[~/music]% mpv Acid\ Eater\ -\ Black\ Fuzz\ On\ Wheels.ogg
# It's okay to type escapes on the cmdline; it's just the display.
[~/music]% mpv Angel\'in\ H<Tab>
Angel'in Heavy Syrup 1.opus Angel'in Heavy Syrup 3.mp3
Angel'in Heavy Syrup 2.opus Angel'in Heavy Syrup 4.mp3
我花了一些时间阅读 zshcompsys(1),但我并没有真正找到一种方法来做到这一点。