How can I enable showing virtual environment for python mode? #591
mizhozan
started this conversation in
Configuration
Replies: 2 comments 2 replies
-
If you are using |
Beta Was this translation helpful? Give feedback.
1 reply
-
My lazy.nvim components local function get_venv(variable)
local venv = os.getenv(variable)
if venv ~= nil and string.find(venv, "/") then
local orig_venv = venv
for w in orig_venv:gmatch("([^/]+)") do
venv = w
end
venv = string.format("%s", venv)
end
return venv
end
{
"lualine.nvim",
opts = function(_, opts)
table.insert(opts.sections.lualine_y, {
function()
local venv = get_venv("CONDA_DEFAULT_ENV") or get_venv("VIRTUAL_ENV") or "NO ENV"
return " " .. venv
end,
cond = function() return vim.bo.filetype == "python" end,
})
end
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using lualine and currently learning it. I want the statusline show me the activated virtualenv if any. Unfortunately, the documentation seems to be in progress and I couldn't find a relevant information regarding this. Does lualine support this funcationality?
Beta Was this translation helpful? Give feedback.
All reactions