filename completion ignorecase for Vim 7

2006-06-17 Thread Gerald Lai

Hi all,

For Vim 7, it seems that filename completion in the :cmdline ignores
case when searching for matches. For example,

  :e FTab

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?
--
Gerald


Re: filename completion ignorecase for Vim 7

2006-06-17 Thread liujiaping
try :noic
On Sat, Jun 17, 2006 at 02:32:46AM -0700, Gerald Lai wrote:
 Hi all,
 
 For Vim 7, it seems that filename completion in the :cmdline ignores
 case when searching for matches. For example,
 
   :e FTab
 
 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?
 --
 Gerald


Re: filename completion ignorecase for Vim 7

2006-06-17 Thread Bram Moolenaar

Gerald Lai wrote:

 For Vim 7, it seems that filename completion in the :cmdline ignores
 case when searching for matches. For example,
 
:e FTab
 
 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.

-- 
   He was not in the least bit scared to be mashed into a pulp
   Or to have his eyes gouged out and his elbows broken;
   To have his kneecaps split and his body burned away
   And his limbs all hacked and mangled, brave Sir Robin.
 Monty Python and the Holy Grail PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: filename completion ignorecase for Vim 7

2006-06-17 Thread Gerald Lai

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 FTab

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


Re: filename completion ignorecase for Vim 7

2006-06-17 Thread Gerald Lai

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 FTab

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_99_alongfilename.txt

and we know we want to edit the file that starts with the capital F.
When we do

  :e FTab

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