1

I've set a dictionary with the command:

set dictionary+=~/Dictionary.txt 

And add the following command to make more quickly to access it:

set complete+=k 

But I still have to press <CTRL-N> to access it.

Is there a way to get the completions as I'm typing? I mean, without having to press any keys to access it. I would like to have it the same way the autocompletion works for words that are in the buffer, they appear in the autocompletion box as I type, without having to press any keys to invoke it.

3
  • Welcome to Vi and Vim! Commented Sep 8, 2021 at 17:45
  • FWIW, the "from dictionary" part is irrelevant and could be removed from the question entirely. Commented Mar 3, 2023 at 8:30
  • Try set complete+=kspell,d (d for adding dictionaries) Commented Jun 21 at 6:44

1 Answer 1

0

I would suggest starting by defining an autocommand. One of these events seem promising to trigger what you need

InsertCharPre when a character was typed in Insert mode, before inserting it TextChangedI after a change was made to the text in Insert mode when popup menu is not visible 

An autocommand trigged by this event can be a function that triggers auto-completion. It's likely that you want this function to return early unless a minimum number of characters have been typed.

1
  • Hi, thank you for the suggestions. I've tried both events, but I got strange behaviours, nothing close to what I need. The way I did was like that: augroup spellComplete autocmd! autocmd TextChangedI * normal <F8> augroup END obs.: I've mapped F8 to <C-N> Commented Sep 9, 2021 at 11:29

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.