On Thu, 13 Apr 2006 at 4:46pm, Charles E Campbell Jr wrote:

> Hari Krishna Dara wrote:
>
> >This is exactly the reason, I didn't suspect this at all. I had netrw in
> >my plugin directory for use with 6.3 Vim. Now, how do I make sure I can
> >use the same plugin directory for both 6.3 and 7.0? I think the
> >g:loaded_xxx variable should be different for these two so that we can
> >control them independently.  Since it took the role of explorer plugin
> >in 7.0, how about using the loaded_explorer instead of loaded_netrw in
> >7.0 (unless there is a better solution)?
> >
> >
> >
>
> Vim 7.0 introduces the notion of "autoload" -- basically only a small
> skeleton of code, generally
> just the user interface commands and maps, is present in the plugin.
> However, the commands
> and maps defined therein can call upon functions with the format
>
>    funcfile#Function(...)
>
> If the function hasn't been loaded yet, then Vim 7.0 will attempt to
> source it in from the system's or user's
> autoload/ directories, using funcfile.vim to do so.  Thus the user gains
> full functionality without having
> to pay a startup price by loading everything whether or not it gets used
> this time around.
>
> One problem: vim 6.x not only doesn't understand this, it complains
> about it.  Hence, vim7.0 can understand
> and use vim6.x (and earlier) plugins, but plugins using vim 7.0's
> autoload will be incompatible with vim 6.x.
>
> Bottom line: there's no point.  Netrw, now a vim 7.0 autoload-using
> plugin, just isn't compatible with 6.x.
> Attempts to use vim 6.x with 7.0-plugins is going to result in lots of
> errors.
>
> Regards,
> Chip Campbell

I think my question was not clear. What I was saying is that for 6.3,
netrw needs to be a user plugin, so I have to put it in say,
~/.vim/plugin, but if I do that, this will override the global netrw
plugin in 7.0. How do I solve this without modifying the older netrw
itself? One solution is to not to put netrw.vim in plugin directory and
conditionally source it from vimrc, if the version is < 7.0. What I was
suggesting is that if you change the name of the control variable for
the new version to say, loaded_explorer, then I can have something like
this in my vimrc:

if v:version < 700
    " Vim 7.0 already comes with netrw, so the user plugin.
    let loaded_netrw = 1
fi

For netrw users transitioning from Vim 6.x to 7.0, I think this will be
useful.

It just occurred to me that having the older netrw.txt in the user doc
directory will confuse or override the global one. I don't know what the
right solution is such that it will work in 6.x transparently and not
interfere in 7.0.

-- 
Thanks,
Hari

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to