Sometimes I want a filename instead of what zsh guesses for me. For example, I have a PNG file without a proper .png
suffix, which makes zsh think it isn't a picture and won't list it when I type Tab
to complete arguments of display
.
I am wondering if there is a key sequence that completes for a filename wherever the context is, like ^XC
for _correct_filename
, or how to configure zsh to do the thing?
You can add a key binding to do what you want:
Edit: Added
$PREFIX
You can add those lines to your
~/.zshrc
file.That makes the completion list all files when you press Ctrl-x Tab at each step instead of Tab. You could choose another keystroke combination that suits you.
Or to make ImageMagick completions always include all files, try editing (make a backup first) the file
/usr/share/zsh/functions/Completion/Unix/_imagemagick
(or similar) and change this to comment out the existing line that begins with_files
and add the new one shown:Dennis' answer didn't expand tilde for me, so I would get stuff like
complete-files: no matches found: ~/ma*
when I tried to invoke it onfoo ~/ma
. I did find an alternate in the zsh FAQ that will expand them, though: