Skip to content

Commit

Permalink
hierline: swap buf/tab lists; always show filename
Browse files Browse the repository at this point in the history
  • Loading branch information
sunaku committed Jan 27, 2024
1 parent 274450a commit 11cce0a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions plugins/heirline.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
-- Copied from @mehalter on AstroNvim forums:
-- https://code.mehalter.com/AstroNvim_user/~files/master/plugins/heirline.lua
-- https://discord.com/channels/939594913560031363/939857762043695165/1096393767780618240
return {
"rebelot/heirline.nvim",
opts = function(_, opts)
local status = require "astronvim.utils.status"
opts.statusline[3] = status.component.file_info { filetype = {}, filename = false }

local path_func = status.provider.filename { modify = ":.:h", fallback = "" }
opts.winbar[1][1] = status.component.separated_path { path_func = path_func }
-- winbar: always show filename
opts.winbar[2] = {
status.component.separated_path { path_func = path_func },
status.component.file_info { -- add file_info to breadcrumbs
file_icon = { hl = status.hl.filetype_color, padding = { left = 0 } },
file_icon = { hl = status.hl.filetype_color, padding = { left = 1 } },
file_modified = false,
file_read_only = false,
hl = status.hl.get_attributes("winbar", true),
Expand All @@ -26,6 +22,11 @@ return {
padding = { left = 0 },
},
}

-- tabline: swap tablist and buflist (placing tablist on left, buflist on right)
local buflist_index, tablist_index = 2, 4
opts.tabline[buflist_index], opts.tabline[tablist_index] = opts.tabline[tablist_index], opts.tabline[buflist_index]

return opts
end,
}

0 comments on commit 11cce0a

Please sign in to comment.