vim.py

Mike Steed MSteed at altiris.com
Tue May 23 11:26:32 EDT 2000


> From: Benyang Tang [mailto:btang at pacific.jpl.nasa.gov]
> Sent: Monday, May 22, 2000 5:32 PM
> To: python-list at python.org
> Subject: Re: vim.py
> 
> 
> Thanks for all the help. 
> 
> 
> I was looking for the python module file vim.py. But later I found
> out that the file vim.py does not exist and it is not needed.
> When in vim, typing ":py import vim" just works.
> 
> Now I have another question. When I got a compiled vim, and I 
> typed ":syntax on", I got this message:
> ----------------------------
> Can't open file /igd/a4/software/vim/share/vim/syntax/syntax.vim
> ----------------------------
> 
> My computer does not have a directory /igd, so obviously it 
> is from the computer where vim was compiled. How do I change 
> the directory where vim looks for syntax files?

Try :help $VIMRUNTIME

(Although, now that I think of it, if Vim can't find the syntax files, it
may not be able to get to the help files either.)  Here's what is says:

The environment variable "$VIMRUNTIME" is used to locate various support
files, such as the on-line documentation and files used for syntax
highlighting.  For example, the main help file is normally
"$VIMRUNTIME/doc/help.txt".

You don't normally set $VIMRUNTIME youself, but let Vim figure it out.  This
is the order used to find the value of $VIMRUNTIME:

1. If the environment variable $VIMRUNTIME is set, it is used.  You can use
   this when the runtime files are in an unusual location.
2. If "$VIM/vim{version}" exists, it is used.  {version} is the version
   number of Vim, without any '-' or '.'.  For example: "$VIM/vim54".  This
is
   the normal value for $VIMRUNTIME.
3. If "$VIM/runtime" exists, it is used.
4. The value of $VIM is used.  This is for backwards compatibility with
older
   versions.
5. When the 'helpfile' option is set and doesn't contain a '$', its value is
   used, with "doc/help.txt" removed from the end.

For Unix, when there is a compiled-in default for $VIMRUNTIME (check the
output of ":version"), steps 2, 3 and 4 are skipped, and the compiled-in
default is used after step 5.  This means that the compiled-in default
overrules the value of $VIM.  This is useful if $VIM is "/etc" and the
runtime
files are in "/user/share/vim/vim54".

Once Vim has done this once, it will set the $VIMRUNTIME environment
variable.
To change it later, use a ":let" command like this:
>	let $VIMRUNTIME = "/home/piet/vim/vim54"

--
M.




More information about the Python-list mailing list