Normally, one can hit the tab key after entering the first few characters of a filename and get the complete filename (or suggestions in case there are many with the same beginning characters).
However for filenames with peculiar characters, this doesn't seem to work. Specifically, I'm in the ~/.vim/view
dir - which contains files with details like fold locations (line numbers) for all files opened with vim. These are the files that vim uses to restore the same "view" with the proper folds, etc. when one reopens a previously used file. Now (at least on my box) these very useful files seem to have the most curious filenames, e.g. ~=+temp=+test.sh=
, or =+temp=+test.sh=
These files have info on the last "view" of the ~/temp/test.sh
and the /temp/test.sh
files respectively.
When I go in this dir, and do something like a ls -l ~=+tem
and then hit tab, I'd normally expect it to autocomplete to ~=+temp=+test.sh=
But that doesn't happen. Why? And how (if at all) can I make it happen?
I'm using Bash on FreeBSD. For the record, I've tried this on zsh, csh, tcsh and sh (same OS). I've not added any question tags for specific shells, but do feel free to do so if you think it should be done.
~
is a special character, it expands to${HOME}
.ls \~=+tem<TAB>
orls ./~=+tem<TAB>
should work. – tastytea Mar 24 '19 at 07:21=
has to be escaped, but in zsh only if it is at the beginning of a file name. – tastytea Mar 24 '19 at 09:39