vim-mucomplete
vim-mucomplete copied to clipboard
Clarify g:mucomplete#minimum_prefix_length
The doc states
The minimum number of (keyword) characters that must be present before the cursor for automatic completion to be triggered.
But I found out that I need this to set to 0 so it works with manual Tab completion after an id with dot (ex. Result.|) when I use ALE's omnifunc. Otherwise Tab doesn't trigger the completion menu (note that I can trigger completion with C-x C-o just fine).
Is . in iskeyword? Usually, it is not considered a keyword character.
Hi, I just meet similar problem, I use tern_for_vim(javascript completion),the popup menu doesn't show up automatically when I press dot key(have to C-x C-o) manual).
And I couldn't find iskeyword in help document ,actually i dont know how to add . in iskeyword
@BrokenHugh maybe you could try
augroup insert_dot
au!
au InsertEnter * set iskeyword+=.
au InsertLeave * set iskeyword-=.
augroup END
You can limit it to filetypes by changing * with *.js or else.
Thank you for your help. It works for me after set iskeyword+=.
But I found the other completion plugin jedi-vim doesn't need to do this by default or let g:jedi#popup_on_dot = 0 when I try to figure it out.
still weird.
jedi-vim actually remaps . in insert mode, to do its own stuff. It's a plugin-defined behaviour, vim doesn't do it on its own.
If it worked after pressing . and then <c-x><c-o>, maybe you can get the same by replacing the autogroup above with:
augroup insert_dot
au!
au FileType javascript inoremap <buffer> . .<c-x><c-o>
augroup END
In autocompletion mode, MUcomplete by default triggers completion when there are at least two keyword characters in front of the cursor, where “keyword” is defined by the iskeyword options (see :help 'iskeyword'). Usually, . is not in iskeyword (but it may be added, as suggested above).
You may use g:mucomplete#can_complete to change MUcomplete's default behaviours, globally or for a specific filetype.
I have been asked in the past to enable completion after a dot in C/C++ and Python, so for such languages completion is already triggered after a dot. Which filetype(s) are you working on?