added branch to statusline

This commit is contained in:
sgraves committed 2026-10-14 14:57:45 +00:00
1 parent 3879bf8751
commit 787505258d
3 files changed
+56 -5

No files matched your search

@@ -18,3 +18,40 @@
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--
require("mini.statusline").setup()
local symbols = require("darcula.utils.symbols")
local statusline = require("mini.statusline")
local section_branch = function()
local branch = NV_Darcula_Git_Branch()
if branch == nil or branch == "" then
return ""
end
return symbols.git.branch .. " " .. branch
end
statusline.setup {
content = {
active = function()
local mode, mode_hl = statusline.section_mode({trunc_width = 120})
local branch = section_branch()
local diagnostics = statusline.section_diagnostics({trunc_width = 75})
local filename = statusline.section_filename({trunc_width = 140})
local fileinfo = statusline.section_fileinfo({trunc_width = 120})
local location = statusline.section_location({trunc_width = 75})
return statusline.combine_groups(
{
{hl = mode_hl, strings = {mode}},
{hl = "MiniStatuslineDevinfo", strings = {branch, diagnostics}},
"%<",
{hl = "MiniStatuslineFilename", strings = {filename}},
"%=",
{hl = "MiniStatuslineFileinfo", strings = {fileinfo}},
{hl = mode_hl, strings = {location}}
}
)
end
}
}