We’re rewarding the question askers & reputations are being recalculated! Read more.

New answers tagged

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" ...


0

Install YouCompleteMe. When you place the cursor over an identifier, enter YcmCompleter GetDoc command to get the doc in a little preview window at the bottom. It works across many languages like python and c/c++. Youcompleteme also displays the preview window during its autocomplete feature. You can customize the behavior of the doc preview with g:...


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>")


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

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 ...


Top 50 recent answers are included