Giter VIP home page Giter VIP logo

vim-virtualenv's Introduction

vim-virtualenv

This Vim plugin provides a simple way to activate and deactivate Python virtual environments created by the virtualenv tool from a Vim session as well as synchronizes the Vim internal Python sys.path variable with an already active virtual environment.

By default, :python and :python3 commands have access only to the system-wide Python environment. vim-virtualenv changes the Vim internal Python sys.path and environment $PATH and $PYTHONPATH variables so that they refer to the chosen virtual environment, i.e. activates it.

However, :python and :python3 commands will be still tied to, respectively, Python 2 and Python 3 versions that Vim was compiled against.

Note. Since the v2.0.0 release there are no new features planned and there are no known issues. Nevertheless this plugin is still maintained so feel free to file a bug report or a feature request.

Key features

  • Activate, deactivate and list virtualenvs from a Vim session. By default, vim-virtualenv works with virtualenvs located inside g:virtualenv#directory to avoid unnecessary typing.

  • When a Vim session is started inside an active virtualenv, vim-virtualenv synchronizes the Vim internal Python sys.path variable with the currently active virtualenv.

  • Activate virtualenvs by path using VirtualEnvActivate command. Paths can be absolute or relative, in the latter case they are first expanded against g:virtualenv#directory and then against the current directory.

  • Use <Tab> completion with VirtualEnvActivate and VirtualEnvList commands to avoid typing even more.

  • Change the current directory to the directory of the currently active virtualenv using VirtualEnvCD command. By default, vim-virtualenv automatically does this on virtualenv activation and returns back on deactivation.

  • This plugin is not a replacement for virtualenv or virtualenvwrapper tools nor it aims to be one.

Usage examples

List virtualenvs located inside g:virtualenv#directory:

:VirtualEnvList

List virtualenvs located inside the '/foo/bar' directory:

:VirtualEnvList /foo/bar

Activate the 'foo' virtualenv located inside g:virtualenv#directory:

:VirtualEnvActivate foo

Activate the virtualenv located at '/foo/bar/baz':

:VirtualEnvActivate /foo/bar/baz

Both VirtualEnvActivate and VirtualEnvList commands support <Tab> completion.

Change the current directory to the currently active virtualenv directory:

:VirtualEnvCD

Deactivate the currently active virtualenv:

:VirtualEnvDeactivate

Name of the currently active virtualenv can be shown in the statusline via virtualenv#statusline() function.

For a more detailed help see:

:help virtualenv

vim-virtualenv's People

Contributors

coacher avatar jmcantrell avatar

Stargazers

 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.