On Sat, 17 Jun 2006, A.J.Mechelynck wrote:
Gerald Lai wrote:
On Sat, 17 Jun 2006, Bram Moolenaar wrote:
Gerald Lai wrote:
For Vim 7, it seems that filename completion in the :cmdline ignores
case when searching for matches. For example,
:e F<Tab>
matches both
foo.txt
Foo.txt
This is different from Vim 6 where it only matches
Foo.txt
Is there any way to revert back to the old behavior?
What system? On MS-Windows case of filenames is ignored, on Unix it
matters, on Mac it depends.
I'm on Windows for Vim 7, Linux for Vim 6 :)
That explains it. I guess this is a matter of discrepancy between what
the user wants to match, and what the OS cares to read.
IMHO, what the user wants to match should take priority over whether the
OS cares about the case of its filenames.
Perhaps for Windows, we could have a 'smartcase' setup for filename
completion matching where it's ignorecase only when all the characters
are lowercase.
Thanks.
--
Gerald
IIUC, under Windows it is not possible to have in the same directory two
files whose names differ only in case. Let's say you have "Makefile" in some
directory. Creating "makefile" or "MAKEFILE" in the same directory will
overwrite it. Similarly foo.c, FOO.C and Foo.C are indistinguishable. If Vim
tries to open one of them, and another one exists, the OS will deliver it.
Thus a 'smartcase' or 'noignorecase' setting for Windows filenames makes no
sense.
True. But how about filenames that aren't the same? Let's say we have
these files on a Windows system:
franticallysearching_0_alongfilename.txt
franticallysearching_1_alongfilename.txt
..
franticallysearching_641237_alongfilename.txt
Franticallysearching_641238_alongfilename.txt
franticallysearching_641239_alongfilename.txt
..
franticallysearching_999999_alongfilename.txt
and we know we want to edit the file that starts with the capital F.
When we do
:e F<Tab>
would we expect it to match
:e franticallysearching_
where we have to follow up by typing in the unknown number for that
capital F file?
I'd rather have it match
:e Franticallysearching_641238_alongfilename.txt
where it does what it's told to do. I could care less that Windows
treats these files the same:
franticallysearching_641238_alongfilename.txt
Franticallysearching_641238_alongfilename.txt
fraNtIcallysearChiNg_641238_alongfilename.txt
to let it affect what I'm searching for.
In the end, it's a matter of preference :)
--
Gerald