Ответ на сообщение «how should .vim file find corresponding .py file?», 
присланное в 00:22:21 06 октября 2010, Среда.
Отправитель: Jonathan Hartley:

Use
    " outside of the functions
    execute "pyfile ".fnameescape(fnamemodify(expand("<sfile>"), 
":h")."/run_tests/run_tests.py")
or
    " somewhere at the beginning and *not* inside a function
    let s:scriptfile=expand("<sfile>")
    " anywhere in the script
    execute "pyfile ".fnameescape(fnamemodify(s:scriptfile, 
":h")."/run_tests/run_tests.py")
If user uses something like pathogen or vim-addon-manager, then he definitely 
will not have your script in ~/.vim.

Текст сообщения:
>   Hi,
> 
> I have a some vim scripts I wrote:
> 
> ~/.vim/ftplugin/python
> 
>        |--run_tests.vim
>        |--run_tests
>        |
>              |--run_tests.py
>              |--etc
> 
> Within run_tests.vim, I have a line that currently reads:
> 
>      pyfile ~/.vim/ftplugin/python/run_tests/run_tests.py
> 
> But this assumes the user has installed the scripts in ~/.vim. Is this a
> valid assumption? If not, how should I be referencing run_tests.py from
> within run_tests.vim?
> 
> I considered using $VIMHOME, which is defined as ~/.vim on one of my
> machines, but it is not defined on my other.
> 
> Clues much appreciated,
> 
>      Jonathan

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to