Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.22 KB

README.md

File metadata and controls

54 lines (37 loc) · 1.22 KB

pipenv.nvim

A tiny neovim plugin for automatically switching to the correct pipenv for the open buffer.

Installation

use({
    "jpfender/pipenv.nvim",
    requires = "nvim-lua/plenary.nvim",
})

Usage

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()

Lualine component

This plugin includes a lualine component called pipenv which echoes the current venv. Sample usage:

lualine_x = { { "pipenv", icon = "" }, "encoding", "fileformat", "filetype" },

Requirements