dashboard-nvim
dashboard-nvim copied to clipboard
Error when trying to call :help <something> from dashboard
Describe the bug
When i open neovim without files (just nvim command) i get dashboard plugin completely working, but if i try to call :help
To Reproduce Steps to reproduce the behavior:
- Open neovim without files to start it with dashboard;
- just try to call some help page
Screenshots
Config
{
'nvimdev/dashboard-nvim',
event = 'VimEnter',
opts = function()
local logo = [[
███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗
████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║
██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║
██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║
██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║
╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝
]]
logo = string.rep("\n", 8) .. logo .. "\n\n"
local opts = {
theme = "doom",
config = {
header = vim.split(logo, "\n"),
center = {
{ action = "ene | startinsert", desc = " New file", icon = " ", key = "n" },
{ action = "Telescope find_files", desc = " Find file", icon = " ", key = "f" },
{ action = "Telescope file_browser", desc = " File Browser", icon = " ", key = "t" },
{ action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" },
{ action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" },
{ action = "lua require('telescope.builtin').find_files({cwd='~/.dotfiles'})", desc = " Config", icon = " ", key = "c" },
{ action = "Telescope colorscheme", desc = " Colorschemes", icon = " ", key = "C" },
{ action = "Lazy", desc = " Lazy", icon = " ", key = "l" },
{ action = "qa", desc = " Quit", icon = " ", key = "q" },
},
footer = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
end,
},
}
for _, button in ipairs(opts.config.center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
button.key_format = " %s"
end
-- close Lazy and re-open when the dashboard is ready
if vim.o.filetype == "lazy" then
vim.cmd.close()
vim.api.nvim_create_autocmd("User", {
pattern = "DashboardLoaded",
callback = function()
require("lazy").show()
end,
})
end
return opts
end,
dependencies = { {'nvim-tree/nvim-web-devicons'} }
},