Make clang-complete in vim to autocomplete after any input -
how make clang_complete automaticaly complete not after ., -> , ::, after first 3 characters of word exampe?
this isn't supported clang_complete
out of box, here example of how implemented (this rather a proof of concept rather working solution):
autocmd cursormovedi *.h,*.c,*.hpp,*.cpp call fastinvoke() function! fastinvoke() let l:col = col('.') if l:col == 1 || len(expand('<cword>')) != 0 return endif let l:line = line('.') call cursor(l:line, l:col - 1) let l:wordlen = len(expand('<cword>')) call cursor(l:line, l:col) if l:wordlen == 3 call feedkeys("\<c-x>\<c-u>") endif endfunction
it measures length of string returned expand('<cword>')
, returns 0
@ end of word. bad thing try complete everything, might lot of failed complete
messages , low performance.
Comments
Post a Comment