folke / noice.nvim

💥 Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
Apache License 2.0
4.15k stars 95 forks source link

feature: Display Keys before Command is Complete #359

Closed DoeringChristian closed 1 year ago

DoeringChristian commented 1 year ago

Did you check the docs?

Is your feature request related to a problem? Please describe.

As you stated in previous issues it is not possible to have the command line and the menu of your plugin at the same time (limitation due to neovim). It is however possible to show the command entered in for example LuaLine:

{
    function() return require("noice").api.status.command.get() end,
    cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end,
    color = fg("Statement")
},

Unfortunately this is only updated after the command has been entered fully. I don't know if this is possible in neovim at the moment but it would be nice if I could see the keys I've entered before the command is complete. For example when recording a macro I always use the "q" register so I'd like to press "qq". When using the vim command line I can see that I have pressed "q" once and that I only need to press it once more to start the recording. At the moment, when using noice I press "q" three times because I forget if I pressed "q" before.

Screencast from 2023-02-18 11-39-09.webm

I know this might be a somewhat niche problem but it would be nice though. If you'd like you could make this a discussion.

Thanks for the help and the great plugins you've provided.

Describe the solution you'd like

I'd like a way of displaying the keys of a mapping before the command is executed. For example when recording a macro using "qq" It would be nice if the status line could display one "q" and then the second while typing, similar to the original Neovim command line.

Describe alternatives you've considered

An alternative would be to set the timeoutlen to 0 and rely on which-key to display the possible characters immediately, however this does not seem to work for macro recordings.

Additional context

No response

folke commented 1 year ago

I don't fully understand what you're talking about here, but if you mean that you don't see the initial q on the statusline, then that's not possible,

DoeringChristian commented 1 year ago

Thanks for the quick response. Sorry for my somewhat convoluted explanation. What's the reason why this is not possible?

folke commented 1 year ago

When q is active, Neovim is in blocking mode, so lualine can't update the statusline