codota / tabnine-vim

Vim client for TabNine. https://vimawesome.com/plugin/tabnine-vim
https://www.tabnine.com/install/vim
GNU General Public License v3.0
672 stars 36 forks source link

Support some YCM's options #3

Closed yous closed 3 years ago

yous commented 6 years ago

YCM has quite many global options, and you can see them on doc/youcompleteme.txt, :help youcompleteme-options. Of course many of them are not relevant to or can't be applied to TabNine, but yet the plugin is a fork of YCM, and I think some of them can be handled by plugin itself.

For example:

let g:ycm_min_num_of_chars_for_completion = 4
let g:ycm_filetype_blacklist = {
      \ 'diff': 1,
      \ 'infolog': 1,
      \ 'mail': 1,
      \ 'markdown': 1,
      \ 'netrw': 1,
      \ 'notes': 1,
      \ 'pandoc': 1,
      \ 'qf': 1,
      \ 'tagbar': 1,
      \ 'text': 1,
      \ 'unite': 1,
      \ 'vimwiki': 1 }

It seems that g:ycm_filetype_blacklist and g:ycm_filetype_whitelist can be handled by fixing s:AllowedToCompleteInBuffer(), but g:ycm_min_num_of_chars_for_completion is read by ycmd.

dmd commented 6 years ago

Related? Is there a way to have tabnine start suggesting only after tab is pressed, rather than always displaying?

half0wl commented 5 years ago

@dmd Check out g:ycm_auto_trigger.

sersorrel commented 5 years ago

Thanks for the pointer to s:AllowedToCompleteInBuffer(); removing the return 1 from the top of that function apparently makes the filetype blacklist just work, I don't know why that was added in the first place, and the commit message (9b868b9c178c820539fe7cbb50c87d1121599f2a) isn't helpful.