Skip to content

ChristianChiarulli/swenv.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swenv.nvim

Tiny plugin to quickly switch python virtual environments from within neovim without restarting.

gscreenshot_2022-09-19-144438

Installation

For example using packer:

use 'AckslD/swenv.nvim'

Usage

Call

require('swenv.api').pick_venv()

to pick an environment. Uses vim.ui.select so a tip is to use eg dressing.nvim.

To show the current venv in for example a status-line you can call

require('swenv.api').get_current_venv()

For lualine there is already a configured component called swenv.

Configuration

Pass a dictionary into require("swenv").setup() with callback functions. These are the defaults:

require('swenv').setup({
  -- Should return a list of tables with a `name` and a `path` entry each.
  -- Gets the argument `venvs_path` set below.
  -- By default just lists the entries in `venvs_path`.
  get_venvs = function(venvs_path)
    return require('swenv.api').get_venvs(venvs_path)
  end,
  -- Path passed to `get_venvs`.
  venvs_path = vim.fn.expand('~/venvs'),
  -- Something to do after setting an environment
  post_set_venv = nil,
})

About

Tiny plugin to quickly switch python virtual environments from within neovim without restarting.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Lua 95.0%
  • Makefile 5.0%