feat(nvim): use winbar with lualine

This commit is contained in:
Price Hiller 2022-10-25 19:09:39 -05:00
parent 37be985b68
commit 79c3789184

View File

@ -48,6 +48,48 @@ lualine.setup({
always_divide_middle = true, always_divide_middle = true,
globalstatus = true, globalstatus = true,
}, },
winbar = {
lualine_a = {
{
"filename",
path = 1,
},
},
lualine_b = {
{
"macro-recording",
fmt = show_macro_recording,
},
},
lualine_c = {},
lualine_x = {
"encoding",
"fileformat",
"filetype",
},
lualine_y = {
{
"location",
fmt = customLocation,
},
},
lualine_z = {
{
"progress",
fmt = customProgress,
},
},
},
inactive_winbar = {
lualine_a = { { "filename", path = 1 } },
lualine_b = {},
lualine_c = {},
lualine_x = {
"filetype",
},
lualine_y = {},
lualine_z = {},
},
sections = { sections = {
lualine_a = { lualine_a = {
{ {
@ -88,37 +130,17 @@ lualine.setup({
}, },
-- Right -- Right
lualine_x = { lualine_x = {},
"encoding",
"fileformat",
"filetype",
},
lualine_y = { lualine_y = {
{ {
"location", "buffers",
fmt = customLocation,
}, },
}, },
lualine_z = { lualine_z = {
{ { "tabs" },
"progress",
fmt = customProgress,
},
}, },
}, },
inactive_sections = { inactive_sections = {},
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = {
{
"location",
fmt = customLocation,
},
},
lualine_y = {},
lualine_z = {},
},
tabline = {}, tabline = {},
extensions = { extensions = {
"aerial", "aerial",
@ -130,10 +152,11 @@ lualine.setup({
}, },
}) })
local macro_refresh_places = { "statusline", "winbar" }
vim.api.nvim_create_autocmd("RecordingEnter", { vim.api.nvim_create_autocmd("RecordingEnter", {
callback = function() callback = function()
lualine.refresh({ lualine.refresh({
place = { "statusline" }, place = macro_refresh_places,
}) })
end, end,
}) })
@ -142,11 +165,11 @@ vim.api.nvim_create_autocmd("RecordingLeave", {
callback = function() callback = function()
local timer = vim.loop.new_timer() local timer = vim.loop.new_timer()
timer:start( timer:start(
50, 30,
0, 0,
vim.schedule_wrap(function() vim.schedule_wrap(function()
lualine.refresh({ lualine.refresh({
place = { "statusline" }, place = macro_refresh_places,
}) })
end) end)
) )