How do I add a section to mini.statusline? #819
-
I'm using lazy.nvim and this is my config:
As you can see I overwrote the diagnostics section. I'd like not to overwrite that default section but add a new section. It can be last item in the left or center or first item in the right. Any help would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Customizing statusline structure in 'mini.statusline' is done by completely overriding content function for active and/or inactive windows. Here is a reference example of current default function for active window. So instead of overriding the The overall setup code will look something like this: local active_content = function()
-- Your code goes here
end
require('mini.statusline').setup({ content = { active = active_content } }) |
Beta Was this translation helpful? Give feedback.
Customizing statusline structure in 'mini.statusline' is done by completely overriding content function for active and/or inactive windows. Here is a reference example of current default function for active window. So instead of overriding the
section_location()
, the suggested approach is to have that default content with linelocal location = '%2l:%-2v'
instead of callingsection_location()
.The overall setup code will look something like this: