nvimdev / dashboard-nvim

vim dashboard
MIT License
2.29k stars 187 forks source link

New user - dashboard starting with errors and looks crippled #323

Closed j-xella closed 1 year ago

j-xella commented 1 year ago

Describe the bug

Out of the box, dashboard starts with errors messages (see screenshots below). Once I press ENTER to hide the messages, the dashboard appears, containing only 2 sections, recent projects and recent files (another screenshot below). OK, maybe I would like different sections, but this is a default configuration ... However, I expect the items to be functional: there should be a possibility to conveniently jump between items and open them on mouse click or some key press.

However, the dashboard screen seem just like a temp buffer:


Also, maybe this is not a bug, but as a new user, there are things that I don't understand:

To Reproduce

I have just installed the plugin with packer:

 use {
   'glepnir/dashboard-nvim',
   event = { 'VimEnter' },
   config = function() require( "aj_personal.dashboard-nvim" ) end,
   requires = {'nvim-tree/nvim-web-devicons'}
 }

I have minimal configuration:

local db = require( 'dashboard' )

db.setup( {                      
  theme = 'hyper',               
  config = {                     
    -- disable_move = true,      
  }                              
} )                              

My nvim:

NVIM v0.9.0-dev-1072+gf113cba3e
Build type: Release
LuaJIT 2.1.0-beta3

All I do is start nvim ...

Expected behavior

Screenshots

Error when starting nvim:

[dashboard.nvim] not found nvim-web-devicons
Error executing vim.schedule lua callback: .../packer/opt/dashboard-nvim/lua/dashboard/theme/hyper.lua:328: Expected lua string
stack traceback:
        [C]: in function 'nvim_buf_add_highlight'
        .../packer/opt/dashboard-nvim/lua/dashboard/theme/hyper.lua:328: in function 'gen_center'
        .../packer/opt/dashboard-nvim/lua/dashboard/theme/hyper.lua:411: in function 'callback'
        .../packer/opt/dashboard-nvim/lua/dashboard/theme/hyper.lua:140: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

The look of the dashboard:


              ██████╗  █████╗ ███████╗██╗  ██╗██████╗  ██████╗  █████╗ ██████╗ ██████╗
              ██╔══██╗██╔══██╗██╔════╝██║  ██║██╔══██╗██╔═══██╗██╔══██╗██╔══██╗██╔══██╗
              ██║  ██║███████║███████╗███████║██████╔╝██║   ██║███████║██████╔╝██║  ██║
              ██║  ██║██╔══██║╚════██║██╔══██║██╔══██╗██║   ██║██╔══██║██╔══██╗██║  ██║
              ██████╔╝██║  ██║███████║██║  ██║██████╔╝╚██████╔╝██║  ██║██║  ██║██████╔╝
              ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝╚═════╝

                                 [  Github]  [  glepnir]  [  0.2.3]

                                      neovim loaded 14 packages

    Recent Projects:
      empty project

    Most Recent Files:
       ~/.local/share/chezmoi/home/private_dot_config/nvim/init.lua.tmpl
     ....
glepnir commented 1 year ago

as the error said it does not found the web-devicons

j-xella commented 1 year ago

But the web devicons are installed:

fd web ~/.local
/home/alex/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons/
/home/alex/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons/lua/nvim-web-devicons.lua
/home/alex/.local/share/nvim/site/pack/packer/opt/nvim-web-devicons/plugin/nvim-web-devicons.vim
...

Besides, when the dashboard finally shows, the icons seem to be there:

image

glepnir commented 1 year ago

try run packersync or packercompile . still has this error ?

j-xella commented 1 year ago

Yes, done it several times before raising this issue....

glepnir commented 1 year ago

set rtp? can you find web-devicons in rtp ?

glepnir commented 1 year ago

maybe you need call this first require'nvim-web-devicons'.setup({})

j-xella commented 1 year ago

OK, I think I found the problem.

Another plugin, nvim-lualine/lualine.nvim was specified earlier in the packer config and had devicons as an optional dependency. It seems that this made packer to install devicons as an optional plugin, even if dashboard requires devicons without the optional clause. And then dashboard was not able to find it during nvim startup.

I removed the optional clause from lualine config and rerun PackerSync. Packer moved the plugin from opt to start, and now it works OK

j-xella commented 1 year ago

Any chance to enlighten me regarding the other 2 quiestions? And maybe worth adding this to the plugin documentation?

Thank you in advance

glepnir commented 1 year ago

What are the projects, and how to work with them?

idk. dashboard is a start screen plugin. so it should work with any ?

you don't need do some print ? hyper and doom is different. config has write in doc. different theme has different field in config. more usage you can check out my config.