Re: Version confusion

2006-10-16 Thread panshizhu
Meino Christian Cramer [EMAIL PROTECTED] 写于 2006-10-14 14:10:19:
  I myself use to update my vim source with the newest patches and
  download the runtime files on a regular base. Furthermore I download
  the newest CVS stuff from vim-ruby, the ruby support files for vim.
  How can I simplify the update of my whole vim environment without the
  need to look into each single file whether it is newer/older as
  another file of the same name at another place and what version of
  this file will work with what version of another file of the same
  suit at shat place?

  Keep hacking!
  mcc

Tony's reply is precise and detailed, but that's not simple enough.

I simplyfy it to the following:

If you choose to put something in ~/.vim, then you'll always have to update
it yourself.

If there's something both in $VIMRUNTIME and ~/.vim, Vim will use the
version in ~/.vim.

So, if you want the vim distribution to update the script, just do not
custumize it in ~/.vim and keep the official version.

If you choose to do it yourself, just be aware what scripts you had in
~/.vim and update it when you feel it necessary.

Version confusion

2006-10-14 Thread Meino Christian Cramer
Hi,

 For the real vim junkie there are several sources for the real
 stuff ( == newest versions of vim/scripts/plugins et cetera
 available).

 I myself use to update my vim source with the newest patches and
 download the runtime files on a regular base. Furthermore I download
 the newest CVS stuff from vim-ruby, the ruby support files for vim.

 The vim-ruby files go into ~/.vim/
 The runtime files go into /usr/share/vim/vim70 (== $VIMRUNTIME)
 The result of the compilation of the sources go also to $VIMRUNTIME
 (and non-scripts to other places).

 I recognized, that some files are doubled: Older version of the
 vim-ruby support files go also to $VIMRUNTIM.

 Furthermore: Newly installed vimruntimefiles will be overridden with
 older ones from the compilation results of the vim sources (when a
 new patch is available...).

 As it seems with this practice of trying to have always the newest
 vim stuff on my hd I will shoot into my own feet...

 If vim recognized a script file which it has already loaded from
 another place, will it be loaded ?

 Has vim an automatism to load the script with the highest versioning?

 How can I simplify the update of my whole vim environment without the
 need to look into each single file whether it is newer/older as
 another file of the same name at another place and what version of
 this file will work with what version of another file of the same
 suit at shat place?

 Keep hacking!
 mcc


 


Re: Version confusion

2006-10-14 Thread A.J.Mechelynck

Meino Christian Cramer wrote:

Hi,

 For the real vim junkie there are several sources for the real
 stuff ( == newest versions of vim/scripts/plugins et cetera
 available).

 I myself use to update my vim source with the newest patches and
 download the runtime files on a regular base. Furthermore I download
 the newest CVS stuff from vim-ruby, the ruby support files for vim.

 The vim-ruby files go into ~/.vim/
 The runtime files go into /usr/share/vim/vim70 (== $VIMRUNTIME)
 The result of the compilation of the sources go also to $VIMRUNTIME
 (and non-scripts to other places).

 I recognized, that some files are doubled: Older version of the
 vim-ruby support files go also to $VIMRUNTIM.

 Furthermore: Newly installed vimruntimefiles will be overridden with
 older ones from the compilation results of the vim sources (when a
 new patch is available...).

 As it seems with this practice of trying to have always the newest
 vim stuff on my hd I will shoot into my own feet...

 If vim recognized a script file which it has already loaded from
 another place, will it be loaded ?

 Has vim an automatism to load the script with the highest versioning?

 How can I simplify the update of my whole vim environment without the
 need to look into each single file whether it is newer/older as
 another file of the same name at another place and what version of
 this file will work with what version of another file of the same
 suit at shat place?

 Keep hacking!
 mcc


 



Vim has no knowledge of script versions.

When using the :runtime! command or in most cases of auto-loading, Vim loads 
all scripts by a given name and/or in a given subdirectory in all directories 
listed in the 'runtimepath' option. Most full-fledged scripts have an if 
clause at the start, with a :finish command, to avoid running them twice. 
This means that the first one loaded will win. OTOH, small tweak scripts 
don't have that, so the last one loaded will win.


'runtimepath' normally lists the following directories, in the following order:

1. ~/.vim/ (on Unix) or ~/vimfiles (on Windows) for full-fledged scripts 
applicable to one user only.


2. $VIM/vimfiles/ (on all platforms) for system-wide full-fledged scripts not 
distributed with Vim


3. $VIMRUNTIME/ for scripts distributed with Vim. Any upgrade may silently 
add, remove or change anything in this tree; on Unix, make install or make 
installruntime _will_ silently replace everything here with scripts from 
vim70/runtime/ in your build directory tree (which were downloaded with the 
sources).


4. $VIM/vimfiles/after/ for small system-wide tweaks to any of the above

5. ~/.vim/after/ or ~/vimfiles/after/ for small single-user tweaks to any of 
the above.


On Windows, the binaries are usually installed in $VIMRUNTIME; on Unix, they 
are installed in some nearby directory already in the $PATH.


Typical values:

$VIM: (Unix) /usr/local/share/vim/ ; (Windows) C:\Program Files\Vim

$VIMRUNTIME: (version 7.0) $VIM/vim70

executables: (Unix) /usr/local/bin/ ; (Windows) same as $VIMRUNTIME.


This means that user scripts (in 1 and 5) may override all others, and 
system-wide scripts (in 2 and 4) may override those distributed with Vim (in 3).



AFAIK, the only reliable way to always use the newest version is to manually 
check the datestamps (in directory listings and/or near the top of the file 
text) of any duplicated files. Note that depending on how you upgrade your 
sources, the timestamp shown in a directory listing can be either the 
date-time when the files were updated by their authors, or the date-time when 
you downloaded them.



Best regards,
Tony.