vim and python

Kevin Dahlhausen kdahlhaus at yahoo.com
Sun Feb 18 11:17:48 EST 2001


'Pyf' is attempting to source the file using the embedded Python
interpreter in Vim.  I don't know offhand if it contains different import
hooks or if it plays with the PYTHONPATH.   I think of it as more for
scripting Vim with Python that debugging Python code, although in theory
what you're doing should work fine.    The first thing to try is running
that python file from outside of Vim and see what happens.   

There was a short series of articles on Python / Vim here a few weeks
ago.  When google puts the archives back up, you might check for 'Vim and
Python Efficiently'


By the way, I commend your choice of editor and language!  :)



In article <mailman.982268898.28556.python-list at python.org>, "Timothy
Grant" <tjg at exceptionalminds.com> wrote:

> Since this is more python related than vim related I'll post it here. I
> have recently had contact with a vim missionary (came to my door one
> Saturday morning and started telling me that I needed to be saved from
> emacs). 
> 
> Since I had been feeling a bit frustrated with emacs, and since I do
> suffer from tendonitis in one of my wrists, I thought I'd give it a
> shot. Surprisingly, I quite like it, and it is certainly easier on my
> bad wrist.
> 
> I've been muddling through for a couple of days now, and discovered that
> there is quite nice builtin python support. I played with it and got it
> sort of working, but have run into what look like environmental
> problems.
> 
> I start vim from the directory where my source files are located, and
> attempt to do a :pyf %, and I started getting import errors. Not a
> problem, I simply added my source directory to the end of sys.path and
> tried again. Now the import works correctly, but I am getting more
> errors and I can't explain them.
> 
> Traceback (innermost last):
>   File "<string>", line 1, in ? File "wlautoconf.py", line 20, in ?
>     class acOptions(wlOptions):
> NameError: wlOptions Press RETURN or enter command to continue
> 
> wlOptions is a class that is imported from a file in my source
> directory.
> 
> So, does anyone have any tips on setting up a nice python/vim
> environment?
> 
> Thanks.
>



More information about the Python-list mailing list