goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.9k stars 112 forks source link

Highlighting MRU Shortcuts #295

Closed adamgulyas closed 2 months ago

adamgulyas commented 2 months ago

After lots of experimentation, I can't seem to find a way to customize highlights on the mru and mru_cwd shortcuts in startify. I'm able to set the highlight of the section titles, but the list of mru shortcuts are generated by a call to the mru library with:

val = function()
  return { mru(10) }
end

When I inspect the MRU val property I see this table:

startify.section.mru.val = { 
  {
    type = "padding",
    val = 1
  }, {
    opts = {
      hl = "SpecialComment"
    },
    type = "text",
    val = "MRU"
  }, {
    type = "padding",
    val = 1
  }, {
    type = "group",
    val = <function 1>
  } 
}

My guess is that the last element's val = <function 1> is the call to mru() which generates the shortcuts. Since this is a function and not a list of elements, I'm wondering if there is a way to customize highlights for the generated MRU [ key ] shorcuts in startify:

image

Can anyone confirm whether this is possible? 🙏

goolord commented 2 months ago

if you want to get that granular in customizing alpha i suggest just copying and modifying the entire startify file