New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Show intro message #1980
feat: Show intro message #1980
Conversation
I have only done some basic testing myself, so this needs a bit more testing before merging. We need to test at least for compatibility with plugin managers like lazy vim. It should not show there, since they have their own startup screen. |
src/bridge/setup.rs
Outdated
@@ -30,6 +30,8 @@ const REGISTER_CLIPBOARD_PROVIDER_LUA: &str = r" | |||
cache_enabled = 0 | |||
}"; | |||
|
|||
const INTRO_MESSAGE: &str = include_str!("../../lua/intro.lua"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe call this INTRO_MESSAGE_LUA. As is the variable could be construed as the message itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed now
Yes, I did not want to override that command and I'm not sure if it's even possible. It works without multi-grid, but when using multigrid it gets rendered behind the main window. |
Oh, I have multigrid enabled indeed. Then I think the goals are achieved 👍 By the way, startup intro obviously closes when you enter insert mode, so I think it's good to go. I didn't mention that, but it may be important :) |
That's actually slightly different from the original behaviour, but I think it's better. With standard terminal Neovim, entering insert mode does not close the message, it only closes when you start to type. The message here also closes when switching to other modes. on movement, on buffer switching, on modifications and so on. Basically, anything else than going into the command mode, so you can see the message when typing One thing that still needs testing is compatibility with LazyVim for example, which has its own startup screen. |
It could be nice if someone from a linked issue may verify that for integrity on their machines by the way, but years have passed. So, if you need anything else - feel free to ask/post a checklist |
I have tested passing both directories and files on the commandline, and everything seems to be consistent with the default intro screen, it's not shown when you do that. It even works correctly with Edit: To clarify, by working correctly I mean not showing the message in these cases. |
Is there something special to getting
It doesnt appear to skip it |
At the moment it's ignored. Chances are the logic here will be reworked sooner or later for listening to Neovim itself. A quick workaround for Neovide (and not the TUI) would be this in startinsert
stopinsert |
Is there a way to get it to work with init.lua instead of init.vim? this doesnt appear to do anything:
|
Yes, this was an oversight, I did not know about the local autogroup = vim.api.nvim_create_augroup("disable_intro", { clear = true })
vim.api.nvim_create_autocmd({ "VimEnter" }, {
pattern = "*",
group = autogroup,
callback = function()
vim.cmd('startinsert')
vim.cmd('stopinsert')
end
}) |
Hmm yeah that doesnt appear to work for me either, I'll have to play around with it later. |
Anyone have a way of fixing the stuck message? Ive tried a few different methods and none seem to work. |
@casrass |
I don't know why that's the cause, but I found out that using packer to lazy load A workaround is to remve
to
I don't use lazy.nvim, but the cause is probably the same with that as well. I can fix it in |
Hm. packer does indeed seem to fire the event again I still have no idea why, but there's probably a good reason. I also don't have any idea why Anyway, I will fix the issue by only listening for |
I don't know if it matters but I don't use any dashboard at all, nothing fancy, and I still tried multiple ways to get it working without much luck. Heres the current way i have commented out that also doesnt work:
|
@9mm If you are talking abou tthe issue of not being able to close it at all, then you probably have some other lazy loaded plug that causes That PR also fixes the Pre-built binaries for that can be found here https://github.com/fredizzimo/neovide/actions/runs/5991961622 |
It closes OK, I was just also trying to find a way to not have it open to start with. Im considering switching to master soon though as all the good fixes I want are there :D |
What kind of change does this PR introduce
This emulates the standard Neovim
:intro
message at startup. It's shown if the current buffer is empty and not backed by a file. The message is always centered and does not close when the window is resized, unlike the standard message. Another difference is that this message closes directly on any mode chance except changes from/to cmd mode, while the standard message stays visible if you go into insert mode, until you type something.NOTE: That this is not a maintainable solution, so the goal is to get this or something similar implemented in Neovim itself, but for now I think this is good enough for us.
Fixes: #620
For the corresponding Neovim issue see neovim/neovim#24705
Did this PR introduce a breaking change?
A breaking change includes anything that breaks backwards compatibility either at compile or run time.