Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use code completion in vim as in sublime text

Tags:

vim

vim-plugin

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.

like image 718
Dougui Avatar asked Apr 26 '13 08:04

Dougui


People also ask

How do I enable autocomplete in Sublime Text?

By default, Sublime Text will automatically show the completions popup when a user is editing source code or markup, but not within prose in comments, strings or markups. Pressing the Esc key will hide the completions popup. To manually show the completions popup, press Ctrl+Space.

Does vim support code completion?

Vim text editor supports autocompletion for the standard text files by default. Also, when configured properly, Vim enables an autocomplete feature for files with code in the languages it recognizes.


2 Answers

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.

like image 192
pepper_chico Avatar answered Oct 21 '22 23:10

pepper_chico


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.

like image 41
romainl Avatar answered Oct 21 '22 22:10

romainl