nvimdev / dashboard-nvim

vim dashboard
MIT License
2.3k stars 187 forks source link

The dashboard-nvim not work #350

Closed EdwardWong1994 closed 1 year ago

EdwardWong1994 commented 1 year ago

HI, previously i use vimscript to configure my vim, now i change to neovim and start to use lua. I am pretty new to lua . I configure dashboard for neovim but it did not work and still give the default neovim interface.

My configration process like this:

  1. in my ~/.config/nvim/init.lua file: require ("plugin-config/dashboard")

  2. in my ~/.config/nvim/plugin-config/dashboard.lua file, i configure it like this:

local db = require('dashboard')

db.custom_header = {
      '   ⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣤⣴⣶⣶⣶⣶⣶⠶⣶⣤⣤⣀⠀⠀⠀⠀⠀⠀ ',
      ' ⠀⠀⠀⠀⠀⠀⠀⢀⣤⣾⣿⣿⣿⠁⠀⢀⠈⢿⢀⣀⠀⠹⣿⣿⣿⣦⣄⠀⠀⠀ ',
      ' ⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⠿⠀⠀⣟⡇⢘⣾⣽⠀⠀⡏⠉⠙⢛⣿⣷⡖⠀ ',
      ' ⠀⠀⠀⠀⠀⣾⣿⣿⡿⠿⠷⠶⠤⠙⠒⠀⠒⢻⣿⣿⡷⠋⠀⠴⠞⠋⠁⢙⣿⣄ ',
      ' ⠀⠀⠀⠀⢸⣿⣿⣯⣤⣤⣤⣤⣤⡄⠀⠀⠀⠀⠉⢹⡄⠀⠀⠀⠛⠛⠋⠉⠹⡇ ',
      ' ⠀⠀⠀⠀⢸⣿⣿⠀⠀⠀⣀⣠⣤⣤⣤⣤⣤⣤⣤⣼⣇⣀⣀⣀⣛⣛⣒⣲⢾⡷ ',
      ' ⢀⠤⠒⠒⢼⣿⣿⠶⠞⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁⠀⣼⠃ ',
      ' ⢮⠀⠀⠀⠀⣿⣿⣆⠀⠀⠻⣿⡿⠛⠉⠉⠁⠀⠉⠉⠛⠿⣿⣿⠟⠁⠀⣼⠃⠀ ',
      ' ⠈⠓⠶⣶⣾⣿⣿⣿⣧⡀⠀⠈⠒⢤⣀⣀⡀⠀⠀⣀⣀⡠⠚⠁⠀⢀⡼⠃⠀⠀ ',
      ' ⠀⠀⠀⠈⢿⣿⣿⣿⣿⣿⣷⣤⣤⣤⣤⣭⣭⣭⣭⣭⣥⣤⣤⣤⣴⣟⠁    ',
}

db.custom_center = {
    {icon = "  ", desc = 'Recently lastest session    ', shortcut = "Leader s l", action = "RestoreSession"},
    {icon = "  ", desc = "Recently opened files       ", shortcut = "Leader f h", action = "Telescope oldfiles"},
    {icon = "  ", desc = "Find File                   ", shortcut = "leader f f", action = "Telescope find_files"},
    {icon = "  ", desc = "File Browser                ", shortcut = "leader f b", action = "Telescope file_browser"},
    {icon = "  ", desc = "Find Word                   ", shortcut = "leader g g", action = "Telescope live_grep"},
    {icon = "  ", desc = "Open Personal dotfiles      ", shortcut = "leader e e", action = "edit $MYVIMRC"}
}

db.custom_footer = function()
    local footer = {'', '🎉 Have fun with neovim'}
    if packer_plugins ~= nil then
        local count = #vim.tbl_keys(packer_plugins)
        footer[2] = '🎉 neovim loaded ' .. count .. ' plugins'
        for key, value in pairs(packer_plugins) do
            table.insert(footer, '✨  ' .. key)
        end
    end

    return footer
end
  1. in my ~/.config/nvim/lua/plugins.lua file,
  use {
      'glepnir/dashboard-nvim',
      event = 'VimEnter',
     requires = {'Nvim-tree'/nvim-web-devicons'}
}

I do think dashboard is a fancy plugin but i just can not make it work. Configure my neovim like this, it still use the default interface when open neovim. Anyone can help me about this??

glepnir commented 1 year ago

okay looks like you don't update this plugin for a long time. new version dashbaord has been rewrite for a while . the config is not same as before. please read doc for new config.

EdwardWong1994 commented 1 year ago

okay looks like you don't update this plugin for a long time. new version dashbaord has been rewrite for a while . the config is not same as before. please read doc for new config.

I have changed the configuration use hyper theme shown in below figure: 28ed4cc902083a9ea00a17bcb6a3535

But i still have errors shown below. Can you help me to figure out this problem? I am really new with lua grammar 781559d53bb1096a7741b92cfb508f3

glepnir commented 1 year ago

so what's error ? you don't show me

EdwardWong1994 commented 1 year ago

Can you see the error in below figure? Because i configure the dashboard for nvim in ipad and i just upload photos in my PC side. 781559d53bb1096a7741b92cfb508f3

glepnir commented 1 year ago

looks like the require failed. try to remove the event if you are using packer.

EdwardWong1994 commented 1 year ago

I did use packer, but which event do you specified?? it seems the require in this require(dashboard).setup({}) have problems?