Tuesday, October 25, 2011

Re: Please fix: make Windows Vim use same files as unix. No reason not to and it's confusing in mixed envirionments.

Ben Fritz wrote:
 On Oct 25, 2:52 am, Linda W <v...@tlinx.org> wrote:   
Comments:  1) that .vim isn't searched for in the same way with 'vimfiles', is a rather glaring BUG, given the above.   It's incompatible with the documented procedures for checking the names of .vimrc, .gvimrc, and .exrc.      
 But, unlike the .vimrc/.gvimrc, any number of directories can be in the runtimepath. There is only one .vimrc.
Sorry, but you lost me.   you can have any number of dirs named .vim? Huh?
isn't  ".vim" searched for in the same locations as .vimrc/.gvimrc??

I wasn't asked for it to be searched for in the runtime path.  I am under (perhaps, the "mis-"), that
.vim as a dir was searched for along for, or in the same way as .vimrc/.gvimrc and the breakage occurred because on Windows it uses a 15-20'yro restriction on filenames that applied to FAT to use another yet another special name for the sake of FAT12/16 & MS-DOS.

I'm not talking about the 'VIMRUNFILES' where vim finds its own runfiles...but the
USER rules that are read along side the "built-in" vimruntime dir files.

----

 The only reason Vim uses vimfiles at all on Windows, is that on Windows, 'runtimepath' defaults to including vimfiles instead of .vim. We could default to include BOTH, however this could easily break a lot of systems already out there, for example if they symlink .vim to vimfiles so they can use the same config on Cygwin/Linux.   
====
    How?
If vimfiles is a symlink to .vim, and it encounters .vim first... it will read it as .vim and stop looking for it.
I.e. this isn't an issue for the multitude of people who have links from _vimrc --> .vimrc


 You could do something fancy like check for the existence of both and only add .vim if both exist by default, but it's hard to know what's correct. And it's trivial to do what you want in vimscript.   
----
Why should vim do anything different with .vim/vimfiles than .vimrc/_vimrc ?   I would have to strongly disagree.  It's the fact that it is doing something completely inconsistent and different that is causing the problem.


 MAYBE the best solution would be to have some logic in vimrc_example.vim, which is sourced by default on a fresh Windows install, which checks for the existence of .vim/vimfiles and sets the runtimepath differently if .vim exists but vimfiles does not. But I don't think changing the default value in the C code is a good idea. It would break tons of systems in use now, and make documentation in Vim and on the Internet outdated.   
----
    Fixing a bug can always cause compat problems.   When bash stopped ignoring "\r" ininput lines by default, it caused a bunch of people's scripts to break.  But that didn't stop progress.   People fixed their scripts and life went on.  BUT, I don't see that changing defaults will necessarily break anything.
It makes for fewer 'special cases', and makes the code more robust and less likely to fail, overall, and
creates less confusion about...what's being read and where,..

No comments: