goolord / alpha-nvim

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

[Question] Dont understant hl prop #215

Closed TheElegantCoding closed 1 year ago

TheElegantCoding commented 1 year ago

How do you change the font from italic, bold, normal and how do you put custom colors or default colors the value hl recieve a string but waht tipy of string should i pass for colors ?

goolord commented 1 year ago

the string is a highlight group. https://neovim.io/doc/user/syntax.html#:highlight

TheElegantCoding commented 1 year ago

ok i understand this are the types

image

and some colors are aplied depending of the value but i stil dont kwon what are the numbers and how to put it in bold i try some styles but nothing in bold

TheElegantCoding commented 1 year ago

i try to put the numbers of this table but still dont show any color

image

here is my code what is the mistake ?

    local header = {
        type = 'text',
        val = ascii_header,
        opts = {
            position = 'center',
            hl = { { 'String', 1, 4 } },
        },
    }
goolord commented 1 year ago

no, the numbers in the alpha api are the range to highlight. create a highlight group like how the docs i sent you show you and then set "hl" to that group. if you need to learn more about how to create a highlight group and you can't read the documentation, google it, respectfully

TheElegantCoding commented 1 year ago

now i understand thanks, and sorry if it was a stupid question i am new to neovim, kwon the number are the ranges help a lot thanks for the help

goolord commented 1 year ago

no problem, sorry for not being more helpful, good luck 👍