Sabrina
Sabrina

Reputation: 1466

Autocmd popup menu

I am not asking for plugins. I want to know how can I trigger the pop up menu after inserting every character. In other words is it possible to press ctrl+n automatically after every character inserted like in IDE.(to show Possible Mathes)

autocmd CursorHoldI * call Pop()

function! Pop()
normal! <c-n>
endfunction

but this code doesn't work.

Upvotes: 2

Views: 249

Answers (1)

Sabrina
Sabrina

Reputation: 1466

The solution was to use the function feedkeys() as below:

set completeopt+=noinsert
autocmd CursorHoldI * call feedkeys("\<c-n>")

Upvotes: 2

Related Questions