✨ feat(lualine): add rootilities windows_size function
Allows lualine components to set a minimum window width under which they will be hidden
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
-- │ Lualine │
|
-- │ Lualine │
|
||||||
-- ╰─────────────────────────────────────────────────────────╯
|
-- ╰─────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
local rootilities = require("utils.rootilities")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
@@ -105,6 +107,9 @@ return {
|
|||||||
vim.cmd(":WakaTimeToday")
|
vim.cmd(":WakaTimeToday")
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
cond = function()
|
||||||
|
return rootilities.is_window_wide_enough(100)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lualine_y = {
|
lualine_y = {
|
||||||
@@ -112,6 +117,9 @@ return {
|
|||||||
function()
|
function()
|
||||||
return require("utils.music_stats").get_icon_with_text()
|
return require("utils.music_stats").get_icon_with_text()
|
||||||
end,
|
end,
|
||||||
|
cond = function()
|
||||||
|
return rootilities.is_window_wide_enough(100)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -119,22 +127,37 @@ return {
|
|||||||
return vim.fn.wordcount().words
|
return vim.fn.wordcount().words
|
||||||
end,
|
end,
|
||||||
icon = " ",
|
icon = " ",
|
||||||
|
cond = function()
|
||||||
|
return rootilities.is_window_wide_enough(80)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"progress",
|
"progress",
|
||||||
separator = " ",
|
separator = " ",
|
||||||
padding = { left = 1, right = 0 },
|
padding = { left = 1, right = 0 },
|
||||||
|
cond = function()
|
||||||
|
return rootilities.is_window_wide_enough(60)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"location",
|
"location",
|
||||||
padding = { left = 0, right = 1 },
|
padding = { left = 0, right = 1 },
|
||||||
|
cond = function()
|
||||||
|
return rootilities.is_window_wide_enough(40)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"selection_count",
|
"selection_count",
|
||||||
|
cond = function()
|
||||||
|
return rootilities.is_window_wide_enough(120)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filesize",
|
"filesize",
|
||||||
|
cond = function()
|
||||||
|
return rootilities.is_window_wide_enough(100)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lualine_z = {
|
lualine_z = {
|
||||||
|
|||||||
Reference in New Issue
Block a user