case insensitive buffer names completion - only on windows ?

86 views
Skip to first unread message

Anton Sharonov

unread,
Aug 14, 2008, 2:50:59 PM8/14/08
to vim...@googlegroups.com
VIM - Vi IMproved 7.1 (2007 May 12, compiled May 21 2008 22:23:37)
Patches: 1-298

Assuming two buffers are opened in VIM

path/to/TMaster.java
path/to/TSlave.java

On windows, :b tma<TAB> finds TMaster

On linux, only :b TMa<TAB> finds, :b tma<TAB> finds nothing.

Only what I have found in documentation, related to that, is:

(todo.txt)
...
5 Add 'ignorefilecase' option: Ignore case when expanding file names.
":e ma<Tab>" would also find "Makefile" on Unix.
8 Sorting of filenames for completion is wrong on systems that ignore
case of filenames. Add 'ignorefncase' option. When set, case in
filenames is ignored for sorting them. Patch by Mike Williams:
~/vim/patches/ignorefncase. Also change what matches? Or use another
option name.
...

Does it means, that for buffer names completion it is as well
case sensitive on unix, yet without the configuration option to
switch it off ?

Tony Mechelynck

unread,
Aug 14, 2008, 3:28:33 PM8/14/08
to vim...@googlegroups.com

Well, on FAT and, I think, NTFS, filesystems, which are used on Windows,
filenames (and directory names) are case-insensitive, so that "tmaster"
would indeed be the same file as "TMaster", and creating, deleting or
modifying the one would also create, modify or delete the other. Both
names would refer to the same data (if any), and the one couldn't be a
directory if the other is a file.

Most of the filesystems used on Linux are case-sensitive, and there you
could have two (or more) different files (or directories, or both) in
the same directory, one named tmaster and the other named TMaster
(and/or Tmaster, tMaster, TmAsTeR, etc.) and they would be different;
so, when you're on a Unix machine (or Linux or MacOsX or...) it makes
sense to pay attention to the case of the filenames you're typing in.

If you know part of a buffer name (even if it isn't at the beginning)
and you're sure of the case, you can type that, then hit <Tab>
(especially with 'wildmenu' on) or Ctrl-D, and let Vim complete the rest.


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
114. You are counting items, you go "0,1,2,3,4,5,6,7,8,9,A,B,C,D...".

Anton Sharonov

unread,
Aug 14, 2008, 5:13:20 PM8/14/08
to vim...@googlegroups.com
Thank you very much for the answer, Tony,

Can I somehow to tell vim on linux|unix, that it isn't really
matter for me (especially in buffer names completion) what is the
case of those names ? And if there are several matches with
different case, vim will cycle through all them with subsequent
<TAB> press; or list them all after I press <CTRL>-D ? (Now on
linux if I don't match the case of _any_ letter, nothing is
matched).


2008/8/14, Tony Mechelynck <antoine.m...@gmail.com>:

Tony Mechelynck

unread,
Aug 14, 2008, 5:24:45 PM8/14/08
to vim...@googlegroups.com
On 14/08/08 23:13, Anton Sharonov wrote:
> Thank you very much for the answer, Tony,
>
> Can I somehow to tell vim on linux|unix, that it isn't really
> matter for me (especially in buffer names completion) what is the
> case of those names ? And if there are several matches with
> different case, vim will cycle through all them with subsequent
> <TAB> press; or list them all after I press<CTRL>-D ? (Now on
> linux if I don't match the case of _any_ letter, nothing is
> matched).

I don't think you can, unless or until these TODO items you listed
become part of Vim code; and when (if ever) that happens, we'll see how
it is implemented. Until then, on Unix at least, when you want to match
a file name you have to know, case-sensitively, something (possibly with
wildcards) which will match it; then Ctrl-D will list everything that
matches what you typed, repeated tabbing will cycle through the matches,
and Tab with 'wildmode' on will give you them all as a menu on the
bottom statusline. But I suppose you already knew this.


Best regards,
Tony.
--
The more things change, the more they stay insane.

Anton Sharonov

unread,
Aug 14, 2008, 6:00:04 PM8/14/08
to vim...@googlegroups.com
Thanks, Tony.

I have just had the hope, that may be somewhere deep in the
documentation one more configuration option is hidden, which I
haven't found for myself. (This is really amazing, how much
configuration possibilities VIM have, therefore I always forget
that it isn't still completely almighty yet :)


2008/8/14, Tony Mechelynck <antoine.m...@gmail.com>:

Reply all
Reply to author
Forward
0 new messages