Giter VIP home page Giter VIP logo

poet-v's Introduction

Poet-v

Poet-v is a vim/nvim plugin that detects and activates virtual environments in your python poetry or pipenv project.

It is inspired (and closely resembles) both vim-virtualenv and its pipenv spin-off vim-pipenv. However it also adds the ability to interact with virtual environments created by poetry and integrates nicely with jedi-vim (and deoplete-jedi).

Installation

Install using your preferred package manager. For example using dein.vim:

call dein#add('petobens/poet-v')

Usage (commands)

Poet-v provides just two commands:

  • PoetvActivate: activates the corresponding poetry or pipenv venv (see below for details regarding order) and enforces jedi (and deoplete-jedi) to use it (if jedi-vim/deoplete-jedi is installed).
  • PoetvDeactivate: deactivates the current venv.

There is also a function, poetv#statusline(), that retrieves the current venv name. It can be used for instance to display such information in the statusline (poet-v in fact employs this to provide out of the box integration with vim-airline).

Configuration (options)

The following variables (along with their default values) control poet-v behaviour:

  • g:poetv_executables = ['poetry', 'pipenv']
    • (Ordered) list of dependency managers to be used when attempting to activate a venv (or switch between existing ones).
  • g:poetv_auto_activate = 0
    • If set to 1 poet-v will attempt to automatically activate a venv (or switch between existing ones) when entering a python window.
  • g:poetv_statusline_symbol = ''
    • Symbol to be displayed after venv name returned by poetv#statusline() function.
  • g:poetv_set_environment = 1
    • If set to 1 poet-v will set the $VIRTUAL_ENV and $PATH environment variables when a venv gets activated.

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.