A tiny neovim plugin for automatically switching to the correct pipenv for the open buffer.
use({
"jpfender/pipenv.nvim",
requires = "nvim-lua/plenary.nvim",
})
Call
require("pipenv").set_pipenv()
to set the venv of the current buffer to the associated pipenv (according to the output of pipenv --venv
in the buffer's CWD).
To switch venvs automatically whenever you open or switch to a buffer, use an autocmd:
vim.api.nvim_create_autocmd("BufEnter", {
callback = function()
require("pipenv").set_pipenv()
end,
})
To show the venv for the current buffer, call:
require("pipenv").get_current_venv()
This plugin includes a lualine
component called
pipenv
which echoes the current venv. Sample usage:
lualine_x = { { "pipenv", icon = "" }, "encoding", "fileformat", "filetype" },
- plenary.nvim
- pipenv if you want this plugin to do anything useful ;)