Skip to content

Dashboard alignment for default configurations #517

@gAlleb

Description

@gAlleb

Hi, so after investigating, i've found that current dashboard alignment has a hardcoded horizontal offset of -6, which causes the content to be slightly misaligned to the left on default or fresh NvChad installations.

After testing, I found that changing this offset from -6 to -2 results in much more accurate centering. This value seems to better reflect the default width of UI elements.

I made a fresh install. Defaults are here .local/share/nvim/lazy/ui/lua/nvchad/nvdash/init.lua:

    local col = math.floor((winw / 2) - math.floor(strw(v) / 2)) - 6
    col = math.floor((winw / 2) - math.floor(w / 2)) - 6
    col = math.floor((winw / 2) - math.floor(w / 2)) -  6

Image

Changed -6 to -2 in .local/share/nvim/lazy/ui/lua/nvchad/nvdash/init.lua:

    local col = math.floor((winw / 2) - math.floor(strw(v) / 2)) - 2
    col = math.floor((winw / 2) - math.floor(w / 2)) - 2
    col = math.floor((winw / 2) - math.floor(w / 2)) -  2

Image

While I understand that there can be a specific reasoning: taking into account a number column and a sign column. But default installation looks much better with the defaults changed to -2.

What do you think? Can we change it to -2 by default? Or maybe make this offset a configurable option?

Thanks.

P.S. I didn't make a PR because I'm not sure whether there might be any other reasoning behind this -6 value apart from what i've written above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions