sponsor Vim development Vim logo Vim Book Ad

pyimp.vim : load python file from import statement

 script karma  Rating 1/1, Downloaded by 957  Comments, bugs, improvements  Vim wiki

created by
Tom Jenkins
 
script type
utility
 
description
Set of functions to open a Python import statement as a file.
This is a modification of javaimp.vim by Darren Greaves <darren@krapplets.org> http://boncey.org/vim.shtml
Suggested stuff to add to your ~.vimrc:
let $PYTHONSOURCEPATH="/usr/lib/python2.2/,/usr/lib/python2.2/lib,/usr/lib/python2.2/site-packages,~/python"
map H :call OpenPythonImport($PYTHONSOURCEPATH)<CR>
Then press H while on a import line and the file should open (you'll need the
source files and the path to have been set already.

The paths in $PYTHONSOURCEPATH should have the source packages directly
underneath each path.  The script needs to be able to add the package to the
path element and open a file.

I still need to figure out how to load the "from blah.bleh.blih import yada" type of imports
 
install details
Vim 6:  Copy to ~/.vim/plugin or $VIM/plugin directory
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
pyimp.vim 0.2 2002-06-03 6.0 Tom Jenkins Now has rudimentary loading for "from" type imports.
pyimp.vim 0.1 2002-05-29 6.0 Tom Jenkins Initial upload
ip used for rating: 18.220.137.164

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github