Skip to content

Rounded border for hovered row in the file list #426

Closed Answered by sxyazi
MinaMatta98 asked this question in Q&A
Discussion options

You must be logged in to vote
demo.mp4

Yazi allows you to rewrite most of the UI through UI plugins, and you can achieve this by extending the linemode:

function Folder:linemode(area)
  local lines = {}
  for _, f in ipairs(self:by_kind(self.CURRENT).window) do
    if f:is_hovered() then
      -- You may want to change the "foreground color" here to adapt to your theme
      lines[#lines + 1] = ui.Line { ui.Span(""):bg("reset"):fg("blue") }
      break
    else
      lines[#lines + 1] = ui.Line {}
    end
  end
  return ui.Paragraph(area, lines):align(ui.Alignment.RIGHT)
end

Save those lines as a file, for example ~/.config/yazi/ui.lua, and include it in the yazi.toml:

[plugins]
preload = [
  "~/.config/yazi…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@sxyazi
Comment options

@MinaMatta98
Comment options

@sxyazi
Comment options

@MinaMatta98
Comment options

@sxyazi
Comment options

Answer selected by MinaMatta98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #423 on December 03, 2023 14:41.