[Question] A Way To Let The Menu Only Show After Pressing Tab
I find it annoying to see the wildmenu always show as I am typing. Is there a way to let wildmenu only show after pressing tab when typing command just like initially with the default wildmenu?
This is a duplicate of #86, see the comment at https://github.com/gelguy/wilder.nvim/issues/86#issuecomment-921054839 for the relevant config.
What if I want the first option to be selected when I trigger the wildmenu? How could I do that? Because it's not when the menu is triggered.
This requires a bit more configuration and uses an experimental API (which I may remove in the future).
autocmd CmdlineEnter * let g:active = 0
function! s:handle_tab()
if !g:active
let g:active = 1
return wilder#main#next_when_available() . wilder#next()
endif
return wilder#next()
endfunction
cnoremap <expr> <Tab> wilder#in_context() ? <SID>handle_tab() : "\<Tab>"
wilder#main#next_when_available() sets a flag which selects the first candidate when the candidates are retrieved.