Vim scripting with python
J. Clifford Dyer
webmaster at cacradicalgrace.org
Mon Feb 12 18:08:23 EST 2007
Stuart D. Gathman wrote:
> On Sat, 03 Feb 2007 05:02:54 -0800, Tool69 wrote:
>
>> Does anyone have any advice, and more genraly how to script Vim with
>> Python ?
>
> :py import sys
> :py print sys.version
> :help :py
>
>> I know I can put some python functions inside my vimrc file like
>> this :
>>
>> function! My_function()
>> python << EOF
>> import vim, string
>> ...blablabla
>> EOF
>> endfunction
>>
>> but I would like to use external ".py" files.
>
> :py import myfile
>
> Use :py inside your vimrc - don't run python externally.
Which versions of vim is this valid for? I tried ":py print 'Hello'",
and got "E319: Sorry, the command is not available in this version"
Cheers,
Cliff
More information about the Python-list
mailing list