nvimdev / dashboard-nvim

vim dashboard
MIT License
2.3k stars 187 forks source link

dashboard-nvim not oppening #359

Open zykron1 opened 1 year ago

zykron1 commented 1 year ago

Hi i'm a new user and am using the default setup.

Setup:

local db = require("dashboard")
db.setup({
  theme = 'doom',
  config = {
    header = {}, --your header
    center = {
      {
        icon = ' ',
        icon_hl = 'Title',
        desc = 'Find File           ',
        desc_hl = 'String',
        key = 'b',
        keymap = 'SPC f f',
        key_hl = 'Number',
        action = 'lua print(2)'
      },
      {
        icon = ' ',
        desc = 'Find Dotfiles',
        key = 'f',
        keymap = 'SPC f d',
        action = 'lua print(3)'
      },
    },
    footer = {}  --your footer
  }
})

When I open neovim, I don't see the dashboard

glepnir commented 1 year ago

any error through ? which plugin manager you used?

mikaeleythor commented 1 year ago

any error through ? which plugin manager you used?

I'm getting the same problem using packer.

Using the configuration for packer as shown in the README yields no output on startup and no errors. Calling :Dashboard however shows the correct output.

Ditching the following lines in my packer file

        config = function()
            require("dashboard").setup(require("user.dashboard"))
        end,

and using

require('user.dashboard')

in my init.lua, where user.dashboard contains

return {
    theme = hyper,
    ...
}

shows the correct output on startup but with the following errors

Error detected while processing /home/cinder/.repos/nvim/init.lua:
E5113: Error while calling lua chunk: /home/cinder/.config/nvim/lua/user/dashboard.lua:1: module 'dashboard' not found:
    no field package.preload['dashboard']
    no file './dashboard.lua'
    no file '/home/cinder/Desktop/neovim/.deps/usr/share/luajit-2.1.0-beta3/dashboard.lua'
    no file '/usr/local/share/lua/5.1/dashboard.lua'
    no file '/usr/local/share/lua/5.1/dashboard/init.lua'
    no file '/home/cinder/Desktop/neovim/.deps/usr/share/lua/5.1/dashboard.lua'
    no file '/home/cinder/Desktop/neovim/.deps/usr/share/lua/5.1/dashboard/init.lua'
    no file './dashboard.so'
    no file '/usr/local/lib/lua/5.1/dashboard.so'
    no file '/home/cinder/Desktop/neovim/.deps/usr/lib/lua/5.1/dashboard.so'
    no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
    [C]: in function 'require'
    /home/cinder/.config/nvim/lua/user/dashboard.lua:1: in main chunk
    [C]: in function 'require'
    /home/cinder/.repos/nvim/init.lua:18: in main chunk

This is all using Neovim version 0.9.1

Thanks btw for an awesome plugin!

glepnir commented 1 year ago

/home/cinder/.config/nvim/lua/user/dashboard.lua:1: module 'dashboard' not found:

this mean it not loaded . in fact it's not in runtimepath. so you may need check your packer config.

gitrospective commented 1 year ago

Hi i'm a new user and am using the default setup.

Setup:

local db = require("dashboard")
db.setup({
  theme = 'doom',
  config = {
    header = {}, --your header
    center = {
      {
        icon = ' ',
        icon_hl = 'Title',
        desc = 'Find File           ',
        desc_hl = 'String',
        key = 'b',
        keymap = 'SPC f f',
        key_hl = 'Number',
        action = 'lua print(2)'
      },
      {
        icon = ' ',
        desc = 'Find Dotfiles',
        key = 'f',
        keymap = 'SPC f d',
        action = 'lua print(3)'
      },
    },
    footer = {}  --your footer
  }
})

When I open neovim, I don't see the dashboard

Did you get a solution for this I am unable to change the default header. i am a super newbie

glepnir commented 1 year ago

:set rtp? then check output did you find dashboard ?

zykron1 commented 1 year ago

Output: runtimepath=~/.config/nvim,/etc/xdg/nvim,~/.local/share/nvim/site,~/.local/share/nvim/site/pack//start/,~/.local/share/nvim/site/pack/packer/start/packe r.nvim,/usr/local/share/nvim/site,/usr/share/nvim/site,/opt/local/share/nvim/runtime,/opt/local/share/nvim/runtime/pack/dist/opt/matchit,/opt/local/lib/nvim ,~/.local/share/nvim/site/pack//start//after,/usr/share/nvim/site/after,/usr/local/share/nvim/site/after,~/.local/share/nvim/site/after,/etc/xdg/nvim/afte r,~/.config/nvim/after

In the packer folders, I can say that dashboard.nvim lives there.

glepnir commented 1 year ago

nope . it should show dashboard-nvim in rtp

Yoquec commented 1 year ago

I am getting exactly the same error. Weird enough everything has been working for months without any issue, but when I switched from using impatient.nvim to vim.loader.enable() to cache lua, the error started appearing.

So this might mean that error comes when compiling the lua packages.

BTW, the output of my set rtp? is:

runtimepath=~/.config/nvim,/etc/xdg/nvim,~/.local/share/nvim/site,~/.local/share/nvim/site/pack/packer/opt/dashboard-nvim,~/.local/share/nvim/site/pack/*/start/*,~/.l
ocal/share/nvim/site/pack/packer/start/packer.nvim,/usr/local/share/nvim/site,/usr/share/nvim/site,/usr/share/nvim/site/pack/*/start/*,/usr/share/nvim/site/pack/packer/
start/packer.nvim,/usr/share/nvim/runtime,/usr/share/nvim/runtime/pack/dist/opt/matchit,/usr/lib/nvim,~/.local/share/nvim/site/pack/*/start/*/after,/usr/share/nvim/site
/after,/usr/local/share/nvim/site/after,~/.local/share/nvim/site/after,/etc/xdg/nvim/after,~/.config/nvim/after,/usr/share/vim/vimfiles

I am also running neovim 0.9.1. Whenever I reinstall impatient.nvim again, the plugin works again.

EDIT: Fixed the problem with the solution provided in #294.

jakucermak commented 1 year ago

I had a same issue, and found solution.. dashboard default installation path was ~/.local/share/nvim/site/pack/packer/opt after moving into ~/.local/share/nvim/site/pack/packer/start everything starts working again, until PackerSync. Hope it will helps.

lucasmarinb commented 1 year ago

Same proble here, the solution proposed by @jakucermak worked for me, but only when I opened the vim from the terminal with nvim. If I open a project on the current folder with vim . and then I try to open Dashboard it just does nothing.

NonlinearFruit commented 1 year ago

This is what I observed (when I installed dashboard-nvim via packer, I was unable to configure it). Packer installs to different directories based on the event.

The Step 4 example works for me (dashboard starts up and is configurable). Step 2 does not work for me (dashboard starts up but is not configurable).

  1. Blank slate

    -- use {
    --   'glepnir/dashboard-nvim',
    --   event = 'VimEnter',
    --   config = function()
    --     require('my-dashboard')
    --   end,
    --   requires = {'nvim-tree/nvim-web-devicons'}
    -- }
    :so
    :PackerClean
    $ rg --files | rg dashboard-nvim
    
  2. Install with VimEnter (goes to opt folder)

    use {
      'glepnir/dashboard-nvim',
      event = 'VimEnter',
      config = function()
        require('my-dashboard')
      end,
      requires = {'nvim-tree/nvim-web-devicons'}
    }
    :so
    :PackerSync
     $ rg --files | rg dashboard-nvim
    site/pack/packer/opt/dashboard-nvim/plugin/dashboard.lua
    site/pack/packer/opt/dashboard-nvim/README.md
    site/pack/packer/opt/dashboard-nvim/LICENSE
    site/pack/packer/opt/dashboard-nvim/doc/dashboard.txt
    site/pack/packer/opt/dashboard-nvim/doc/tags
    site/pack/packer/opt/dashboard-nvim/lua/dashboard/init.lua
    site/pack/packer/opt/dashboard-nvim/lua/dashboard/events.lua
    site/pack/packer/opt/dashboard-nvim/lua/dashboard/preview.lua
    site/pack/packer/opt/dashboard-nvim/lua/dashboard/theme/hyper.lua
    site/pack/packer/opt/dashboard-nvim/lua/dashboard/theme/doom.lua
    site/pack/packer/opt/dashboard-nvim/lua/dashboard/theme/header.lua
    site/pack/packer/opt/dashboard-nvim/lua/dashboard/utils.lua
    #      look here ^^^
  3. Blank slate

    -- use {
    --   'glepnir/dashboard-nvim',
    --   event = 'VimEnter',
    --   config = function()
    --     require('my-dashboard')
    --   end,
    --   requires = {'nvim-tree/nvim-web-devicons'}
    -- }
    :so
    :PackerClean
    $ rg --files | rg dashboard-nvim
    
  4. Install without event (goes to start folder)

    use {
      'glepnir/dashboard-nvim',
      -- event = 'VimEnter',
      config = function()
        require('my-dashboard')
      end,
      requires = {'nvim-tree/nvim-web-devicons'}
    }
    :so
    :PackerClean
     $ rg --files | rg dashboard-nvim
    site/pack/packer/start/dashboard-nvim/README.md
    site/pack/packer/start/dashboard-nvim/lua/dashboard/events.lua
    site/pack/packer/start/dashboard-nvim/lua/dashboard/init.lua
    site/pack/packer/start/dashboard-nvim/lua/dashboard/utils.lua
    site/pack/packer/start/dashboard-nvim/lua/dashboard/preview.lua
    site/pack/packer/start/dashboard-nvim/lua/dashboard/theme/doom.lua
    site/pack/packer/start/dashboard-nvim/lua/dashboard/theme/header.lua
    site/pack/packer/start/dashboard-nvim/lua/dashboard/theme/hyper.lua
    site/pack/packer/start/dashboard-nvim/LICENSE
    site/pack/packer/start/dashboard-nvim/plugin/dashboard.lua
    site/pack/packer/start/dashboard-nvim/doc/dashboard.txt
    site/pack/packer/start/dashboard-nvim/doc/tags
    #      look here ^^^^
data-miner00 commented 10 months ago

Thanks @NonlinearFruit for the tip, now I am able to make the dashboard to display. I'm not sure why Packer does this and why it is not working correctly. I've installed other plugins that have the event property and surely they did not work until I installed them into the start folder.

SchoolyB commented 9 months ago

Having the same issue but with Lazy. when I enter Nvim the dashboard doesnt show even when using :Dashboard it doesnt show. No errors given so idk whats up