Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: Making Auto-Completion Smarter

I use ctags, taglist, etc., to have auto completion in Vim. However, it is very limited compared to Visual Studio intellisense or Eclipse auto-completion. I am wondering whether it is possible to tune Vim to:

  1. Show auto-completion whenever . or -> are typed. But only after some text that might be a variable (e.g. avoid showing auto completion after a number).

  2. Show function parameters when ( is typed.

  3. Stop removing the auto completion list when some delete all characters after . or ->: When I enter a variable name, then press . or -> to search for a certain member, I frequently have to delete all the characters I type after the . or ->, but this makes Vim hide the auto completion list. I would like to keep it visible unless I press Esc.

  4. Showing related auto completion: When I type a variable and press ^X ^O, it usually shows me all the tags in the ctags file. I would like to have it showing only the tags related to the variable.

Thanks for the help.

EDIT: Some people are voting for this question, but no body seems to know the answer. So just wanted to mention that you don't have to provide a complete answer; partial answers to any of the mentioned points would be good also.

like image 921
Rafid Avatar asked Jan 03 '11 09:01

Rafid


People also ask

Can you get Intellisense in Vim?

The auto-completion system (Intellisense) in VSCode is arguably its best feature. Lucky for us, it's been ported over to Vim!

Does Vim support code completion?

Vim editor supports Autocomplete by default for the standard text files and enables autocomplete for programmatic files by explicit configuration.

How do I accept autocomplete in Vim?

To accept the current insert completion entry use <c-y> . Think of it as "yes". Show activity on this post. Usually with Ctrl + Y (yes); read up :help popupmenu-keys .


1 Answers

AutoComplPop is what you need.

like image 101
romainl Avatar answered Sep 28 '22 07:09

romainl