On 12/05/12 00:10, Tony Mountifield wrote:
> There are a couple of things in my .vimrc that vim complains about when
> the minimal version in /bin/vi is invoked.
>
> I would like to make that section of my .vimrc conditional, only to be
> executed when the full version of vim in /usr/bin/vim is invoked.
>
> What is the correct condition to use to detect which of the two versions
> of vim is running? I have searched the help and online, but can't see the
> wood for the trees!
>
> Thanks for any advice...
>
> Tony
>
If your /bin/vi is actually, as is often the case, compiled from the Vim
sources, but with most features turned off including expression
evaluation, you can wrap your vimrc between "if 1" at the start and
"endif" at the end. The versions of Vim compiled with no expression
evaluation recognise the :if construct and treat it (both the "true and
"false" paths) as a nestable comment.
See :help no-eval-feature
To know what your /bin/vi actually is, type
/bin/vi --version
at the shell command-line, or try
:version
in a running vi.
Best regards,
Tony.
--
As Will Rogers would have said, "There is no such things as a free
variable."