Giter VIP home page Giter VIP logo

vimpy's Introduction

Vimpy ~ Python auto-import plugin for Vim

  1. Description
  2. Options
  3. Commands
  4. Requirements
  5. Contact

1. Description

Vimpy is a vim-plugin which can be used to (semi) automatically add new import lines to your python scripts. When you run vimpy it will evaluate the line at the cursor position. If it finds any missing / undefined names it will try to automagically resolve what (sub)module(s) is/are missing and add the needed import lines to the top of the python script.

When the import line to be added is in the simple / direct format (eg. import os) impy will not need any help unless it can't find the module in the $PYTHONPATH. Relative imports (eg. from foo import blah) are more tricky. If the relative import is from a module that has already been imported / added as an importline impy should be fine. If it's a new module however vimpy will most likely need some help and (optionally) prompt for the module the relative import is importing from.

Vimpy follows the PEP8 guidelines. Imports are grouped in the following order: stdlib imports, third-party imports and local imports with a blank line between each section and two blank lines after the last importline.

2. Options

This option controls whether impy will ask for help when it cannot resolve a relative import by itself.

let g:vimpy_prompt_resolve = 1

If this option is set vimpy will remove import lines for unused modules.

let g:vimpy_remove_unused = 1

3. Commands

Checks the line at the cursor's position for new imports.

:VimpyCheckLine

4. Requirements

Vimpy relies on 'pyflakes' for its missing import decection magic. This third-party module can be installed using pip or downloaded from pypi: https://pypi.python.org/pypi/pyflakes.

5. Contact

Plugin github page @ http://github.com/dbsr/vimpy

You can contact me at dydrmntion -AT- gmail -DOT- com.

vimpy's People

Contributors

dbsr avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.