3

If your Vim binary includes the patch 8.1.1068, you can use complete_info(). To get the list of all matches, while the pum is visible, you could use it like this: map(get(complete_info(['items']), 'items', {}), {_,v -> v.word}) ^^^^^^^^^^^^^^^^^^^^^^^^ If your Vim binary also includes 8.1.1803, you can rewrite the expression in a more readable ...


2

feedkeys() is the correct approach, but to respect the special keys, I must use double quotes (as mentioned in the vimhelp): execute 'normal! 27Go' startinsert call feedkeys("\<c-x>\<c-o>")


2

To implement your stated use case, the :imap ..<any> ..<any> would leverage Vim's built-in 'timeoutlen'; it's implementation wouldn't be so outrageous, there's only a limited set of available keys and you can use metaprogramming with a :for loop to build all these mappings. The biggest challenge here is enumerating all desired keys. However, I ...


1

I agree with @D.BenKnoble's comment that Pattern not found is not strictly an error, more of an exceptional condition, and therefore doesn't have an E... number and no way to :catch. If you use the completion menu, you could use :help pumvisible() to use the side effect of showing (or not) the menu in case of matches. Also, there's the :help CompleteDone ...


1

To actually trigger the completion dropdown I think your best bet is to use feedkeys() which more closely simulates a user entering text through a keyboard... try call feedkeys("i\<C-n>") catch This shows the completion dropdown for me. When the cursor follows text that won't result in any completion candidates I do see the "Pattern not found" ...


Only top voted, non community-wiki answers of a minimum length are eligible