Skip to content

Commit 7716617

Browse files
committed
Customize mini statusline
1 parent 4b09b16 commit 7716617

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

lua/kickstart/plugins/mini.lua

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,24 @@ return {
2222
-- and try some other statusline plugin
2323
local statusline = require 'mini.statusline'
2424
-- set use_icons to true if you have a Nerd Font
25-
statusline.setup { use_icons = vim.g.have_nerd_font }
25+
statusline.setup {
26+
use_icons = vim.g.have_nerd_font,
27+
content = {
28+
active = function()
29+
local mode, mode_hl = MiniStatusline.section_mode { trunc_width = 120 }
30+
local filename = MiniStatusline.section_filename { trunc_width = 140 }
31+
local fileinfo = MiniStatusline.section_fileinfo { trunc_width = 120 }
32+
33+
return MiniStatusline.combine_groups {
34+
{ hl = mode_hl, strings = { mode } },
35+
'%<', -- Mark general truncate point
36+
{ hl = 'MiniStatuslineFilename', strings = { filename } },
37+
'%=', -- End left alignment
38+
{ hl = 'MiniStatuslineFileinfo', strings = { fileinfo } },
39+
}
40+
end,
41+
},
42+
}
2643

2744
-- You can configure sections in the statusline by overriding their
2845
-- default behavior. For example, here we set the section for

0 commit comments

Comments
 (0)