From 39a8a94e88b309bf17eb96fbff977f21ff349649 Mon Sep 17 00:00:00 2001 From: Nicky Obreykov Date: Thu, 6 Mar 2025 01:03:24 +0100 Subject: [PATCH] Setup statusline --- init.lua | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index b6a12e75..d53cc3c7 100644 --- a/init.lua +++ b/init.lua @@ -809,7 +809,34 @@ require('lazy').setup({ -- and try some other statusline plugin local statusline = require 'mini.statusline' -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } + statusline.setup { + use_icons = vim.g.have_nerd_font, + content = { + active = function() + local mode, mode_hl = MiniStatusline.section_mode { trunc_width = 120 } + -- local git = MiniStatusline.section_git { trunc_width = 40 } + local diff = MiniStatusline.section_diff { trunc_width = 75 } + -- local diagnostics = MiniStatusline.section_diagnostics { trunc_width = 75 } + -- local filename = MiniStatusline.section_filename { trunc_width = 140 } + local filename = '%t%m%r' + + -- local fileinfo = MiniStatusline.section_fileinfo { trunc_width = 120 } + local location = MiniStatusline.section_location { trunc_width = 75 } + local search = MiniStatusline.section_searchcount { trunc_width = 75 } + + return MiniStatusline.combine_groups { + { hl = mode_hl, strings = { mode } }, + -- { hl = 'MiniStatuslineDevinfo', strings = { git, diff, diagnostics, lsp } }, + { hl = 'MiniStatuslineDevinfo', strings = { diff } }, + '%<', -- Mark general truncate point + '%=', -- End left alignment + { hl = 'MiniStatuslineFilename', strings = { filename } }, + -- { hl = 'MiniStatuslineFileinfo', strings = { fileinfo } }, + { hl = mode_hl, strings = { search, location } }, + } + end, + }, + } -- You can configure sections in the statusline by overriding their -- default behavior. For example, here we set the section for