Provide buffer autocompletion source for asyncomplete.vim
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-buffer.vim'
call asyncomplete#register_source(asyncomplete#sources#buffer#get_source_options({
\ 'name': 'buffer',
\ 'allowlist': ['*'],
\ 'blocklist': ['go'],
\ 'completor': function('asyncomplete#sources#buffer#completor'),
\ 'config': {
\ 'max_buffer_size': 5000000,
\ 'clear_cache': 1,
\ 'min_word_len': 3,
\ },
\ }))
Note: config is optional.
max_buffer_size
defaults to 5000000 (5mb). If the buffer size exceedsmax_buffer_size
, completion that buffer is ignored. Setmax_buffer_size
to -1 for unlimited buffer size.clear_cache
defaults to 1. Setclear_cache
to 0 for disabled cache clear.min_word_len
defaults to 3. Word withmin_word_len
or more letters are subject to completion.
All the credit goes to the following projects