简体   繁体   中英

Vim - Automatically always use autocompletion

I am trying to use vim on Mac OS X High Sierra for coding java. If I want to use auto-completion I have to press ctrl + n .

Is there a way to do it automatically (without pressing a key) but with a way to turn it off?

Vim doesn't come with autocompletion built-in; only manual completion.

If you want autocompletion you will need a plugin. A quick Google search will give you many to choose from.

The built-in completion has to be manually triggered. As there are several different key combinations (see :help ins-completion ; the fact that so many different ones are available is a side effect of Vim's mode-based model), you can choose the right one depending on the use case.

However, many users have gotten used to automatic suggestion of completion candidates, as many IDEs provide this.

In Vim, you have multiple options:

  • Use a full-fledged completion plugin (like YouCompleteMe ) modeled after IDEs. Many of those have the auto-completion feature built in.
  • The AutoComplPop plugin can run any built-in (and custom) completion automatically. It's not maintained any longer, but still works well if all you want is the automatic triggering.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM