mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-12-22 23:08:01 +00:00
[neovim] Add venv to lualine
This commit is contained in:
parent
f211112451
commit
73e4047c86
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user