sponsor Vim development Vim logo Vim Book Ad

GetFilePlus : a gf tweak for python webapp developers

 script karma  Rating 0/0, Downloaded by 207    Comments, bugs, improvements  Vim wiki

created by
Michael Brown
 
script type
utility
 
description
Usage: place plugin/gf.vim in your ~/.vim/plugin directory
Repo: https://github.com/mjbrownie/GetFilePlus

GetFilePlus is a simple enhancement on the gf mappings it does the following

1. standard 'find file/path.ext' first as normal gf would.

2. does a 'find ./file/path.ext'. check

    This is for when a file path starts with a / (often js and css references).

    eg: /js/some_file.js that actually  resides in media/js/some_file.js

    Note for this to be useful you need to set up your :set path to refer to
    the directories you want. (Eg. I have :set path+=media/ in my .vimrc)

3. does a python path check eg.

    from django.contrib.admin.views import foobar

    would open /yourvirtualenv/lib/site-packages/django/contrib/admin/views.py

    Note for this to work you need the python path to set eg in your .vimrc
    python import sys;sys.path = sys.path + ['yourvirtualenv/lib/site-packages/']

Also as a bonus There is a command included to make it easier to open python
files from the command line.

    :Ppath django.contrib.admin.views<cr>

    would open /yourvirtualenv/lib/site-packages/django/contrib/admin/views.py

Note as is the script will send any import errors to screen. If this is the
case then it's just sys.path not configured properly

This script needs vim python support
 
install details
place gf.vim in your 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
mjbrownie-GetFilePlus-67345e4.tar.gz 0.1 2011-04-02 7.2 Michael Brown Initial upload
ip used for rating: 54.234.147.84

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