Better Autocomplete in Vim

Autocompletion in Vim

You can use a plugin like AutoComplPop to get automatic code completion as you type.

2015 Edit: I personally use YouCompleteMe now.

Better autocomplete in VIM

Relatively satisfied with stock Vim's omnicomplete + vim-ruby and vim-rails having completion abilities on par with NetBeans but with all the bells&whistles of Vim and much lower resource requirements, of course.

From my .vimrc concerning completion options :

autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1 
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1

How to efficiently undo an autocomplete in vim

There are 2 native ways to do this in vim. If you know right way that the item is not in the completion menu you can use <c-y>. <c-y> accepts the current match which if you didn't move though any completions will send you back to only the text you inserted. (Second way) However if you did move through the completion menu you can move though until you get back to the original text.

However I imagine it isn't too hard to simply accept the longest matching and edit the word. You could also use <c-g>u to break up the undo block by working it into your <tab> mapping. Although that may break the history up more than you want.

Autocompletion in Vim

Try YouCompleteMe. It uses Clang through the libclang interface, offering semantic C/C++/Objective-C completion. It's much like clang_complete, but substantially faster and with fuzzy-matching.

In addition to the above, YCM also provides semantic completion for C#, Python, Go, TypeScript etc. It also provides non-semantic, identifier-based completion for languages for which it doesn't have semantic support.

Why we need autocomplete plugin for Vim since we have omni completion?

The most probable reason you were recommended to use the delplete plugin is that it performs its autocompletion actions asynchronously. This can be a great benefit over native Vim autocompletion, which I believe still performs those actions synchronously.

The benefit lies in the case where the action to complete is long & slow: an asynchronous task will allow for other tasks to run alongside it while it works, while a synchronous task will block other tasks and make them wait for it to finish. Having "asynchronicity" will provide a smoother experience and shorter overall wait times.

Autocompletion tasks definitely have the capacity to be slower, but if you don't notice any slowdowns there's no pressing reason to switch to delplete if you don't want to.



Related Topics



Leave a reply



Submit