5

I would to have a autocompletion exactly as in sublime text but in vim.

I want this behaviour :

  • When I start to type a word, I want to have a box which suggest completions;
  • In the suggested completions, I want to have last words used;
  • I want to have functions finded through ctags;
  • I want to have standard functions for the language I'm using;
  • I want to have snippets;

There is a lot of plugins about autocompletion for vim and I'm lost.

Dougui
  • 7,142
  • 7
  • 52
  • 87
  • 3
    Welcome to Vim; its vast repository of plugins is both a blessing and a curse; what have you found, what did you like, how important is one feature over the other?! In the end, you won't get around trying some plugins yourself; everybody's preferences are different, and there's no one-size-fits-all solution in Vim. – Ingo Karkat Apr 26 '13 at 09:00

2 Answers2

7

Currently I'm using YouCompleteMe... It's very good, though I dunno whether it can be configured to sort words based on last usage. It has general fuzzy completion capabilities that will work on any file type (you may find fuzzy completion awesome), but it also contains semantic completion for C/C++/Objective-C/Objective-C++ through libclang.

Particularly, I aways compile the lastest clang, libc++ and VIM from sources to tune and set VIM to use my environment python/ruby/etc and get a decent C++11 support. I then, compile YouCompleteMe from sources too, though I first install it through a plugin manager. My current choice is VAM, but there're others like Vundle and Pathogen.

oblitum
  • 11,380
  • 6
  • 54
  • 120
  • I read the doc about YCM and I didn't see anything about snippets. I saw this line "YCM obsoletes the following Vim plugins because it has all of their features plus extra: autocomplpop" but in autocomplpop's doc I saw this line "Also, you can make user-defined completion and snipMate's trigger completion auto-popup if the options are set.". I looked at the source code for YCM and I didn't see nothing about snippets. Is there a way to support snippets with YCM? – Dougui Apr 26 '13 at 18:55
  • @Dougui Recently I've seen snippet support. Possible snippets are also listed in the completion menu, this is done through UltiSnips integration, YCM helps on displaying available snippets, it's UltiSnips that will provide them. http://stackoverflow.com/q/14896327, https://github.com/Valloric/YouCompleteMe/pull/257 – oblitum Apr 26 '13 at 19:21
  • Yep, recently ultisnips support has been implemented. Ctags integration is on the todo list, but is not yet done. I think this plugin indeed comes closest to what you want. – chtenb Apr 27 '13 at 09:59
3

Try this method:

for plugin in plugins
    try
       install plugin
       read    doc
       test    plugin
    catch
       remove plugin
    endtry
endfor

Also, make sure you read and understand :h ins-completion before hunting down plugins.

romainl
  • 186,200
  • 21
  • 280
  • 313