nvimdev / dashboard-nvim

vim dashboard
MIT License
2.37k stars 193 forks source link

Unable to set custom header #318

Closed ajayd-san closed 1 year ago

ajayd-san commented 1 year ago

Describe the bug I'm try to set a custom header but it does not reflect when I restart nvim. I'm using hyper and tried setting the ascii art in my config. It does not seem to work.

Config

in after/plugin/dashboard.lua

local status, dashboard = pcall(require, "dashboard")

if not status then
    return
end

local custom_banner ={
    "", 
    "", 
    " ⣿⣿⣷⡁⢆⠈⠕⢕⢂⢕⢂⢕⢂⢔⢂⢕⢄⠂⣂⠂⠆⢂⢕⢂⢕⢂⢕⢂⢕⢂ ",
    " ⣿⣿⣿⡷⠊⡢⡹⣦⡑⢂⢕⢂⢕⢂⢕⢂⠕⠔⠌⠝⠛⠶⠶⢶⣦⣄⢂⢕⢂⢕ ",
    " ⣿⣿⠏⣠⣾⣦⡐⢌⢿⣷⣦⣅⡑⠕⠡⠐⢿⠿⣛⠟⠛⠛⠛⠛⠡⢷⡈⢂⢕⢂ ",
    " ⠟⣡⣾⣿⣿⣿⣿⣦⣑⠝⢿⣿⣿⣿⣿⣿⡵⢁⣤⣶⣶⣿⢿⢿⢿⡟⢻⣤⢑⢂ ",
    " ⣾⣿⣿⡿⢟⣛⣻⣿⣿⣿⣦⣬⣙⣻⣿⣿⣷⣿⣿⢟⢝⢕⢕⢕⢕⢽⣿⣿⣷⣔ ",
    " ⣿⣿⠵⠚⠉⢀⣀⣀⣈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣗⢕⢕⢕⢕⢕⢕⣽⣿⣿⣿⣿ ",
    " ⢷⣂⣠⣴⣾⡿⡿⡻⡻⣿⣿⣴⣿⣿⣿⣿⣿⣿⣷⣵⣵⣵⣷⣿⣿⣿⣿⣿⣿⡿ ",
    " ⢌⠻⣿⡿⡫⡪⡪⡪⡪⣺⣿⣿⣿⣿⣿⠿⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃ ",
    " ⠣⡁⠹⡪⡪⡪⡪⣪⣾⣿⣿⣿⣿⠋⠐⢉⢍⢄⢌⠻⣿⣿⣿⣿⣿⣿⣿⣿⠏⠈ ",
    " ⡣⡘⢄⠙⣾⣾⣾⣿⣿⣿⣿⣿⣿⡀⢐⢕⢕⢕⢕⢕⡘⣿⣿⣿⣿⣿⣿⠏⠠⠈ ",
    " ⠌⢊⢂⢣⠹⣿⣿⣿⣿⣿⣿⣿⣿⣧⢐⢕⢕⢕⢕⢕⢅⣿⣿⣿⣿⡿⢋⢜⠠⠈ ",
    " ⠄⠁⠕⢝⡢⠈⠻⣿⣿⣿⣿⣿⣿⣿⣷⣕⣑⣑⣑⣵⣿⣿⣿⡿⢋⢔⢕⣿⠠⠈ ",
    " ⠨⡂⡀⢑⢕⡅⠂⠄⠉⠛⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢋⢔⢕⢕⣿⣿⠠⠈ ",
    " ⠄⠪⣂⠁⢕⠆⠄⠂⠄⠁⡀⠂⡀⠄⢈⠉⢍⢛⢛⢛⢋⢔⢕⢕⢕⣽⣿⣿⠠⠈ ",
    "", 
    "", 
    }

dashboard.setup{
    config = {
        theme = "hyper", 
        header = custom_banner
    }
}

in lua/default/packer.lua:

    use {
        'glepnir/dashboard-nvim',
        event = 'VimEnter',
        requires = { 'nvim-tree/nvim-web-devicons' }
    }

Expected behavior The plugin displays the custom header as set in its config.

glepnir commented 1 year ago

packercompile

dinkopehar commented 1 year ago

@default-303 I set it up by placing header inside config as:

require('dashboard').setup({
                theme = 'hyper',
                config = {
                    header = banner,
                }
            })
lbollar commented 1 year ago

You keep telling everyone to compile but don’t put in docs.

glepnir commented 1 year ago

why i need put it in doc ? it is packer usage ? why you don't read packer doc? i think packer doc had tell you when you need sync or compile ?

lbollar commented 1 year ago

Users are expecting their config to be picked up like most configs. I don’t remember last time I had to sync or compile for config change besides trying dashboard. That’s why people keep saying these things. They expect it.

lbollar commented 1 year ago

I’m guessing it’s the way dashboard is setup to be more efficient. But I don’t think that is obvious to casual user.

glepnir commented 1 year ago

you know how packer works ? it generate a compile file and load it. it include all your plugins loaded rule and config. if you changed any plugins config you must to sync or compile. not issue of dashboard. if you don't like this way change to lazy.nvim it no need you to compile or sync. it use lua package loaders way to load lua plugins.