feat(nvim): embed macro recording in the statusline

This commit is contained in:
Price Hiller 2022-10-07 12:38:20 -05:00
parent 0449c0382c
commit 5b00b9f321

View File

@ -78,6 +78,8 @@ lualine.setup({
},
{
show_macro_recording,
"macro-recording",
fmt = show_macro_recording,
},
},
lualine_c = {
@ -135,3 +137,26 @@ lualine.setup({
'toggleterm',
},
})
vim.api.nvim_create_autocmd("RecordingEnter", {
callback = function()
lualine.refresh({
place = { "statusline" },
})
end,
})
vim.api.nvim_create_autocmd("RecordingLeave", {
callback = function()
local timer = vim.loop.new_timer()
timer:start(
50,
0,
vim.schedule_wrap(function()
lualine.refresh({
place = { "statusline" },
})
end)
)
end,
})