sponsor Vim development Vim logo Vim Book Ad

Vimpy : Vimpy helps in Navigating through Python code easy.

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

created by
Amit Ranjit
script type
This Vim plugin is to make navigation of Python files easier with Vim. If you have a large python project, navigating to multiple files is not easy currently. There are various ways to make it easier like using ctags/ptags, gf over the python path etc. But it does not work well with multiple files with same name, going to a praticular class/function etc.


Currently it provides two functions - Open and Goto.
Open can be used to open any python module in the project by module name, class name or function.
Goto can be used to goto any python module in the project by the token in the current file by module name, class name or function.

Usage is similar to how ctags/ptags work in Vim. Basically there are 2 steps:

1. Create the index file. Use :VimpyCreate <project-name> path [exclude-path] to create index. (Alternatively, the vimpy.py script can be invoked using python to create the index file. See 'python vimpy.py' for usage.) This is a one time operation. The index will be automatically updated if you edit the files using vim, otherwise this can be rerun and only the changed files will be updated.
2. Load the index file in Vim. This can be done using ':VimpyLoad <file-name>' inside Vim. This can automated by adding in the vimrc. Now it is ready to use! Following commands (the Keybindings can be changed in vimpy.vim) can be used to navigate to any desired module:
    - <leader> om : Open Module. Go to a module with a given name.
    - <leader> oc : Open Class. Go to a class with a given name.
    - <leader> of : Open Function. Go to a funtion with a given name.
    - <leader> gm : Goto Module given by word under cursor (Eg. use this to navigate to a module under an 'import' statement).
    - <leader> gc : Goto Class given by word under cursor.
    - <leader> gf : Goto Function given by word under cursor.

All of them has auto completion support, so you just need to type in few characters and press <tab>
See https://github.com/amitdev/vimpy for updates on this.
install details
Extract vimpy.zip to your vim plugins folder.

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
vimpy.zip 0.2 2011-12-08 7.0 Amit Ranjit Automated indexing. Just use ':VimpyCreate' to create index initially and ':VimpyLoad' to load it. As long as the files are edited with vim while the project is loaded, index is always kept up to date.
vimpy.zip 0.1 2011-09-21 7.2 Amit Ranjit Initial upload
ip used for rating:

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.
SourceForge.net Logo