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.

On Oct 25, 11:39 am, Linda W <v...@tlinx.org> wrote:
> 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.

You probably won't have multiple .vim files. I'm not suggesting that.

What I mean, is that while Vim only finds and reads a single .vimrc
file, then stops, this is NOT what happens with the folders in
"vimfiles". The ONLY reason Vim reads the contents of $HOME/vimfiles,
is because by default, the 'runtimepath' option is:

Unix: "$HOME/.vim,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
$HOME/.vim/after"
Amiga: "home:vimfiles,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
home:vimfiles/after"
PC, OS/2: "$HOME/vimfiles,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
$HOME/vimfiles/after"
Macintosh: "$VIM:vimfiles,
$VIMRUNTIME,
$VIM:vimfiles:after"
RISC-OS: "Choices:vimfiles,
$VIMRUNTIME,
Choices:vimfiles/after"
VMS: "sys$login:vimfiles,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
sys$login:vimfiles/after")

Here, I assume "PC" refers to Windows. I observe my own runtime path
(which I do not touch) matches this assumption.

As you can see, a Vim OPTION controls which directory is searched for
config files. If you set this option to explicitly check $HOME/.vim
instead of $HOME/vimfiles on Windows, Vim will use that directory
instead. You could also set Unix to use $HOME/vimfiles instead of
$HOME/.vim. You could even dispense with vimfiles/.vim entirely, and
have both systems check $HOME/config/editors/vim or something wild
like that. Nothing at all binds Vim to using .vim or vimfiles, other
than that's the default value of the 'runtimepath' option.

In fact, various plugin-management plugins like Pathogen take
advantage of this, allowing you to install every one of your plugins
in their own directory for easier update or removal. The underlying
method to accomplish this, is to set your runtimepath to contain all
these directories.

Now, a big difference between .vimrc and the files which by default
are looked for in ~/.vim, is that Vim DOES NOT stop when it encounters
a match. It keeps going, grabbing ALL matches. So, with the default
runtimepath on Unix, Vim will source anything in:

$HOME/.vim/plugin
$VIM/vimfiles/plugin
$VIMRUNTIME/plugin
$VIM/vimfiles/after/plugin
$HOME/.vim/after/plugin

...in that order.

This is by design. It allows users to very easily override anything in
plugins or VIMRUNTIME files, and/or install plugins for use on a
system at large which every user need not install but can probably
use.

Now, you're proposing that Windows is inconsistent, because it doesn't
check the $HOME/.vim directory. I would counter that it is truly Unix
that is inconsistent. Out of all the systems with default values for
'runtimepath' listed, Unix is the only one which uses .vim. Every
other system, and indeed Unix itself for the non-user-specific files,
use "vimfiles". So, if any change is made, logically it would be to
default Unix Vim to using $HOME/vimfiles, rather than defaulting
Windows to use $HOME/.vim.

And I'm sure we can safely assume that Unix users everywhere would be
angry for years if Bram decided one day to use vimfiles rather
than .vim for the default Unix Vim config.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: