Closed glepnir closed 2 years ago
Hey! First of all: Glad to see you're doing fine :D
I've updated to the Lua version and the header is not centered. Appart from that, everything is doing fine. Here's a screenshot:
This is my custom configuration:
local dashboard = require("dashboard")
local function repeat_str (str, times)
return times > 0 and str..repeat_str(str, times-1) or ""
end
local empty_line = [[]]
local header = {
empty_line,
[[███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗]],
[[████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║]],
[[██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║]],
[[██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║]],
[[██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║]],
[[╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]],
empty_line
}
local splash = vim.fn.system("shuf -n 1 "..vim.fn.stdpath("config").."/splashes"):sub(1,-2).."!"
local padding = (#header[#header] - #splash) / 2 - 2
splash = repeat_str(" ", padding).."[ "..splash.." ]"
-- Add the splash string followed by two empty lines
table.insert(header, splash)
table.insert(header, empty_line)
table.insert(header, empty_line)
table.insert(header, empty_line)
dashboard.custom_header = header
dashboard.custom_center = {
{
icon = " ",
desc = "New file ",
shortcut = ":enew",
action = "enew",
},
{
icon = " ",
desc = "Find file ",
shortcut = "SPC f",
action = "Telescope find_files hidden=true no_ignore=true",
},
{
icon = " ",
desc = "Browse dotfiles ",
shortcut = "SPC v d",
action = "Telescope find_files cwd=~/.config/nvim/ search_dirs=Ultisnips,lua,viml,init.vim",
},
{
icon = " ",
desc = "Update plugins ",
shortcut = ":PackerSync",
action = "PackerSync",
},
{
icon = " ",
desc = "Open floating terminal ",
shortcut = "SPC t t",
action = "FloatermToggle",
},
{
icon = " ",
desc = "Close neovim ",
shortcut = ":qa!",
action = "qa!",
},
}
The same alignment problem happens without the splash
line or even without the custom header. I don't have time to look into it just now but if I pick it up before you I'll send a PR ;)
first db.custom_header
can a function that return a table. and you don't need to set padding ,just return a table like this
function custom_header()
local header = {
'',
'',
'',
' ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗',
' ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║',
' ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║',
' ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║',
' ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║',
' ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝',
'',
'',
}
table.insert(header, your text here)
end
db.custom_header = custom_header
I have the same issue, the header was not center
fixed .
This breaks anything people had in the configs. Not a very good choice !
@marianpopeanga sorry for break your config. The new version is faster than old version which use vimscript write. and more customization. and i plan to add a new feature that support daily task in dashboard.
This breaks anything people had in the configs. Not a very good choice !
I think it easy to change, just look at example at the main page, also it cleaner in lua since the old version use vimscript
the issue is that there are entirely new commands. Everything was working just fine. You just don't break compatibility like this. You just wrap it around and keep everything working. If users need it or find useful they can use some variable to switch between these versions. Very basic stuff.
The way to not break any configuration is to do compatible development, but I don't have a lot of time to do compatibility development in dashboard, because there are still many issues in lspsaga, galaxyline that need to be fixed. so I have a lot of work to do. sorry for this
So my vimscript version of glepnir/dashboard
refused to update actually (which is a good thing! So it didn't just break out of no where). I had to explicitly remove it, and reinstall it to get the new lua version.
I was able to get everything back up and running how I had it within ~10min of reading through the README.md. Obviously not the greatest move completely changing it without a new branch or pkg name or whatever, but all-in-all was an easy transition to make. I like it! :tada:
For me the session management stopped working
E492: Not an editor command: SessionLoad
@halafi yep there had remove session command. I found some session plugin that write in lua .so maybe them can do it better
Have you found a good alternative for session management @glepnir ? I was using this and am sad to see it go, though I understand the constraints. Could be nice to link to a replacement if you happen to have one!
@keyboard-clacker https://github.com/Shatur/neovim-session-manager .I don't use this. but seems like good.
I was using vim-obsession before
@marianpopeanga if this breaks your things just pin a commit
it's a good thing when something gets improved
great job glepnir
session support .
没想到突然回来了,注意身体要紧,太卷了确实容易伤身体
@max397574 Of course that i've pin that previous commit. This is broken for me. Things SHOULD get improved without braking things what work. All the previous commands should have been supported and not just screw things up.
@keyboard-clacker https://github.com/Shatur/neovim-session-manager .I don't use this. but seems like good.
Nice this one's solid @glepnir ! Just installed it and got it working and is a great replacement. Just had to turn off a few settings to get it to the same as you had implemented here, but can definitely exactly match behavior. Would you be open to adding a section in the README for this? I'm happy to open a PR for it if yeah
I had readd the session support
I have a problem with colorcheme after update. How to fix colors? I'm using gruvbox
@sprainbrains you should check does your colorscheme have the dashboard highlightgroup. if not. you can highlight them in your config. like hi DashboardCenterIcon guifg= color code
etc
you should check does your colorscheme have the dashboard highlightgroup. if not. you can highlight them in your config. like
hi DashboardCenterIcon guifg= color code
etc
Oh... @glepnir Where can I see all the color Dashboard groups in order to make these changes? UPDATED: I found, sorry )
@sprainbrains all of the color groups are detailed on the main README now, I also ran into this and fixed by highlighting all of them. The current available groups are:
DashboardHeader DashboardCenter DashboardCenterIcon DashboardShortCut DashboardFooter
Hi, I've just upgraded but everything is still not centered as per the screenshot below:
My config is as follows:
local dashboard = require("dashboard")
dashboard.custom_header = {
' ',
' ',
' ',
' ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗',
' ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║',
' ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║',
' ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║',
' ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║',
' ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝',
' ',
' ',
' ',
' ',
}
dashboard.custom_center = {
{
icon = '',
desc = 'Load session ',
shortcut = '<leader> l s',
},
{
icon = '',
desc = 'Load Last Session ',
shortcut = '<leader> s l',
},
}
Am I missing some config to make it centred?
@sgoudham your config works fine in my local
I am on Windows 11 so I wonder if that is making a difference?
I've tested in Windows Terminal and a graphical editor NeoVide which both result in the centering not working properly.
That's interesting that it works locally for others though. Problem is something with my config or tools 😅
@sgoudham I don't use windows. but dashboard works fine in @Erven2016 his windows.
@sgoudham It is normal on Windows 11, with your config.
Huh that's interesting, I wonder what my problem is. Thanks for trying it out locally yourselves!
So it looks like it's an issue with neovide but I'm unsure what the problem is causing it not to be centred
Help me, error packer.nvim by dashboard-nvim
@CompanyDATV create a new issue for your problem
@CompanyDATV create a new issue for your problem
how bro :((
new issue
@CompanyDATV
Ok I'm very confused but how are shortcuts supposed to work here? I have tried pressing space key + s + l (which is my leader key also) as well as only a single key (which i prefer).
But none of these seem to work
it should work . if you use packer try PackerCompile
. if not work .please create a new issue and fill issue template
HI all. I had rewrite dashboard. I don't have much time to look issues that were created when I was hospitalized. if your problem still exist in new version, please create an issue let me know :)