sponsor Vim development Vim logo Vim Book Ad

python_open_module : open the python module file below the cursor when coding python

 script karma  Rating 8/4, Downloaded by 1412  Comments, bugs, improvements  Vim wiki

created by
tocer deng
 
script type
ftplugin
 
description
the python_open_module.vim is the script that allows you open the module file  below the cursor when coding python. It's easy to use. For example, you can create a new python file and input:

import string

move the cursor above "string" and press "<LocalLeader>oo"("\oo" in common in vim) in normal mode You could see the string.py file opened in current window. you can continue to input:

string.lower

do same above and you can see string.py file opened the cursor jump into lower function.

the open fail if the module is buildin such as 'sys' or is not available.

There are three options for mapping key, you can chang it to any other key:

pom_key_open='<LocalLeader>oo'              # open module file in the current window
pom_key_open_in_win='<LocalLeader>ow'             # open module file in a new window
pom_key_open_in_tab='<LocalLeader>ot'               # open module file in a tab


WORNING: Required vim compiled with +python
 
install details
copy the script into ~/.vim/ftplugin
 

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
python_open_module.vim 1.0.2 2008-12-16 6.0 tocer deng Fixed it can't open the module file in current window if the current buffer is changed.
python_open_module.vim 1.0.1 2008-12-15 6.0 tocer deng fixed a bug
python_open_module.vim 1.0 2008-12-14 6.0 tocer deng * rename python_jumper.vim to python_open_module.vim.
* allow map key youself, cancel old map key such as 'gf'
* increasing identification of module name
* bug fixed
python_jumper.vim 0.6 2008-12-07 6.0 tocer deng Initial upload
ip used for rating: 3.15.221.146

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