Deoplete.nvim: Confused about configuration options

Created on 29 Mar 2019  路  18Comments  路  Source: Shougo/deoplete.nvim

Problems summary

There are configuration options for which the documentation is not sufficient to understand what they do.

The options in question are:

  • [x] candidate_marks - what are candidate marks, what do they do?
  • [x] delimiters - what do delimiters do, when are they added to words?
  • [x] keyword_patterns - how do keyword patterns affect completion?
  • [x] prev_completion_mode - what is previous completion?
  • [x] skip_chars - what does it mean to skip a char, where is the skipping taking place?
  • [x] sources - what are the default filetypes?
  • [x] converter_auto_delimiter - how does it decide when it adds delimiters to a word and what delimiters to add?
  • [x] converter_remove_overlap - what is overlapped text how is it removed?

Also why is there a converter_auto_paren and a converter_remove_paren I would expect one or the other?

Expected

Documentation to be sufficient to understand the options.

Environment Information

  • deoplete version (SHA1): d7dcca8f9a71beebe7cb7c82e4fddc05b765052f
help wanted question

Most helpful comment

I have completed answers. Closing.

All 18 comments

Documentation to be sufficient to understand the options.

Please create the PR. It is open source.

Of course, I can explain them for you. But I am veryyyyy busy.

Other people's help is needed.

prev_completion_mode - what is previous completion?

Please read this.

https://github.com/Shougo/deoplete.nvim/issues/900

candidate_marks - what are candidate marks, what do they do?

call deoplete#custom#option('candidate_marks',
      \ ['A', 'S', 'D', 'F', 'G)
inoremap <expr>A       deoplete#insert_candidate(0)
inoremap <expr>S       deoplete#insert_candidate(1)
inoremap <expr>D       deoplete#insert_candidate(2)
inoremap <expr>F       deoplete#insert_candidate(3)
inoremap <expr>G       deoplete#insert_candidate(4)

You can test the configuration.

delimiters - what do delimiters do, when are they added to words?

                    *deoplete-filter-converter_auto_delimiter*
converter_auto_delimiter
        It adds "delimiters" variable characters in a candidate's
        word if the candidate's abbr contains the delimiters.

        Filter custom variables:
        delimiters
                Delimiters list.
                (default: ['/'])

If the delimiters are /, / is added when word does not added in delimiters.

It is useful for file source in the default configuration.
You can test it.

        " Use auto delimiter feature
        call deoplete#custom#source('_', 'converters',
        \ ['converter_auto_delimiter', 'remove_overlap'])

keyword_patterns - how do keyword patterns affect completion?

The option affects only standard complete position like buffer, around, etc.
Some sources like omni use custom complete position, they are not affected.

sources - what are the default filetypes?

The default means not specified filetype.

For example:

        " Example:
        call deoplete#custom#option('sources', {
        \ '_': ['buffer'],
        \ 'cpp': ['buffer', 'tag'],
        \})

['buffer'] is the default filetype sources.
But cpp has specified filetype sources ['buffer', 'tag'].
So the default filetype sources does not affect for cpp.

skip_chars - what does it mean to skip a char, where is the skipping taking place?

If you input the chars, the auto completion is skipped.

  Default value: ['(', ')']

It means the auto completion is skipped if you input ( or ).

converter_remove_overlap - what is overlapped text how is it removed?

For example:

|baz(

If you complete foobarbaz(), the candidate will be foobar and the text will be foobarbaz(.

Also why is there a converter_auto_paren and a converter_remove_paren I would expect one or the other?

converter_auto_paren adds ( in candidate automatically.
converter_remove_paren removes () in candidate automatically.

converter_remove_paren is useful if you use auto insert parenthes plugin.
convert_auto_paren is useful if you don't want to input ( manually.

So they are different features

I have completed answers. Closing.

Hi @Shougo thanks for clarifying.

I'm still not clear about what previous completion is. Is it the cached completion data gathered before the current request to the source was made, is it the last word to be completed or is it the way that completion worked before 1f470af? I am lost.

I am also still unclear on what keyword_patterns do, you say that they only affect "standard complete position", I don't know what that is. Its also not clear, what is the affect they would have on "standard complete position"?

I am also still unclear on what keyword_patterns do, you say that they only affect "standard complete position", I don't know what that is. Its also not clear, what is the affect they would have on "standard complete position"?

Hm. standard complete position means default get_complete_position().
Please read :help deoplete-source-attribute-get_complete_position.

Is it the cached completion data gathered before the current request to the source was made, is it the last word to be completed or is it the way that completion worked before 1f470af?

I don't understand. The previous completion uses the previous same candidates.

I just don't understand what is being referred to by "previous completion".

The most obvious way for me to interpret "previous completion" is the last thing that was completed. By way of an example, if we are using the buffer source and our buffer looks like.

Monday
Tuesday
|

And I complete Monday leaving the buffer like so

Monday
Tuesday
Monday|

Then 'Monday' is now the previous completion (the last thing that was completed).

I'm pretty sure that this interpretation of "previous completion" is wrong because 'Monday' is now just text in the buffer, so it wouldn't make sense to have an option with settings filter length and mirror.

Can you explain in more depth what is "previous completion" ?

The most obvious way for me to interpret "previous completion" is the last thing that was completed.

previous completion means the candidates in the last popup menu instead of the last inserted candidate.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pappasam picture pappasam  路  4Comments

marcus picture marcus  路  6Comments

pr4th4m picture pr4th4m  路  4Comments

shibumi picture shibumi  路  4Comments

tcstory picture tcstory  路  5Comments