1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-12-22 17:28:01 +00:00

[neovim] Add venv to lualine

This commit is contained in:
Daniel Carrillo 2022-10-08 14:57:06 +02:00
parent f211112451
commit 73e4047c86
Signed by: dcarrillo
GPG Key ID: E4CD5C09DAED6E16

View File

@ -44,6 +44,15 @@ local spaces = function()
return title .. vim.api.nvim_buf_get_option(0, "shiftwidth") return title .. vim.api.nvim_buf_get_option(0, "shiftwidth")
end end
local venv = function()
local venv = os.getenv("VIRTUAL_ENV")
if venv then
return string.format("  %s", string.match(venv, "[^/]+$"))
end
return ""
end
local gitblame_status_ok, gitblame = pcall(require, "gitblame") local gitblame_status_ok, gitblame = pcall(require, "gitblame")
if not gitblame_status_ok then if not gitblame_status_ok then
return return
@ -66,7 +75,7 @@ lualine.setup({
sections = { sections = {
lualine_a = { "mode" }, lualine_a = { "mode" },
lualine_b = { "branch" }, lualine_b = { "branch" },
lualine_c = { diagnostics, { "filename", path = 3 } }, lualine_c = { diagnostics, venv, { "filename", path = 3 } },
lualine_x = { lualine_x = {
{ gitblame.get_current_blame_text, cond = gitblame.is_blame_text_available }, { gitblame.get_current_blame_text, cond = gitblame.is_blame_text_available },
diff, diff,