You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
event="neo_tree_popup_input_ready",
---@paraminputNuiInputhandler=function(input)
vim.cmd("stopinsert") -- Enter normal modeend,
}
I am unable to enter normal mode after manually entering insert mode with i, since pressing esc even in insert mode just closes the input. Is there a way to make it so that I need to press esc from within normal mode only to exit the input box, as I believe it used to be before?
@uthmanmoh I've updated the help page and it should be more helpful for you this time.
And of course you can combine the two into one handler (tbh I recommend registering only one handler for this event).
{
event="neo_tree_popup_input_ready",
handler=function()
-- enter input popup with normal mode by default.vim.cmd("stopinsert")
end,
},
{
event="neo_tree_popup_input_ready",
---@paramargs{ bufnr: integer, winid: integer }handler=function(args)
-- map <esc> to enter normal mode (by default closes prompt)-- don't forget `opts.buffer` to specify the buffer of the popup.vim.keymap.set("i", "<esc>", vim.cmd.stopinsert, { noremap=true, buffer=args.bufnr })
end,
}
BTW if you have something like nnoremap jk <esc> globally, you don't need to remap <esc> for the popup but use jk to get out of insert mode OOTB.
Also with this new suggested event:
I am unable to enter normal mode after manually entering insert mode with
i
, since pressing esc even in insert mode just closes the input. Is there a way to make it so that I need to pressesc
from within normal mode only to exit the input box, as I believe it used to be before?Originally posted by @uthmanmoh in #1371 (comment)
The text was updated successfully, but these errors were encountered: