Skip to content

doc: Add nvim-compe to the autocompletion section#2072

Merged
lervag merged 1 commit intolervag:masterfrom
savq:master
Jun 18, 2021
Merged

doc: Add nvim-compe to the autocompletion section#2072
lervag merged 1 commit intolervag:masterfrom
savq:master

Conversation

@savq
Copy link
Copy Markdown
Contributor

@savq savq commented Jun 17, 2021

Following this reddit thread, this PR adds some information on how to use VimTeX with nvim-compe.

I didn't find info on whether compe can use regex patterns for filetypes 😕 but I followed u/mybumsonfire advice on adding the filetype explicitly.

I added a code sample in Lua, though another one in Vimscript can also be added.

I'm glad VimTeX is so well documented 👍

@jdhao
Copy link
Copy Markdown

jdhao commented Jun 18, 2021

I am writing just to confirm that @savq has provided the correct config (which the original reddit post is not). The value for the key filetypes should be a list, not string. My working config for nvim-come (in lua):

require'compe'.setup {
  enabled = true;
  autocomplete = true;
  debug = false;
  min_length = 1;
  preselect = 'always';
  throttle_time = 80;
  source_timeout = 200;
  incomplete_delay = 400;
  max_abbr_width = 100;
  max_kind_width = 100;
  max_menu_width = 100;
  documentation = true;

  source = {
    omni = {filetypes = {'tex'}};
    path = true;
    buffer = true;
    spell = {filetypes = {'markdown', 'tex'}};
    emoji = true;
    nvim_lsp = true;
    nvim_lua = true;
    ultisnips = true;
    calc = false;
    vsnip = false;
  };
}

Related: hrsh7th/nvim-compe#166 and hrsh7th/nvim-compe#170 (comment)

@lervag
Copy link
Copy Markdown
Owner

lervag commented Jun 18, 2021

Following this reddit thread, this PR adds some information on how to use VimTeX with nvim-compe.

Thank you!

I'm glad VimTeX is so well documented +1

Yes, I think it's important to aim for good documentation, especially considering the size of the plugin. And help from people like you is therefore very useful!

I am writing just to confirm that @savq has provided the correct config (which the original reddit post is not).

Thanks! Also thanks for the references to relevant issues!


One open question remains: Is there something in nvim-compe that is equivalent to the input_patterns variable in deoplete/neocomplete, or the complete_pattern in ncm2?

lervag added a commit that referenced this pull request Jun 18, 2021
@lervag lervag merged commit a0acaaf into lervag:master Jun 18, 2021
@savq
Copy link
Copy Markdown
Contributor Author

savq commented Jun 18, 2021

One open question remains: Is there something in nvim-compe that is equivalent to the input_patterns variable in deoplete/neocomplete, or the complete_pattern in ncm2?

@lervag, compe seems to be able to use regex patterns for the buffer source, but not for omni-completion. The default pattern matches alphanumeric words, including kebab-case: \h\w*\%(-\w*\)*. The docs mention it's an experimental feature.

@lervag
Copy link
Copy Markdown
Owner

lervag commented Jun 18, 2021

Ok, thanks. If something like that should be implemented, then feel free to notify me and/or suggest an update to the configuration suggestions in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants