Skip to content

octaltree/cmp-look

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

look source for nvim-cmp

This is look source for hrsh7th/nvim-cmp and Shougo/ddc.vim inspired by ujihisa/neco-look.

http://gyazo.com/c21c8201fa7a571c7665bc7455d88631.png

For nvim-cmp

require('cmp').setup({
    sources = {
        {
            name = 'look',
            keyword_length = 2,
            option = {
                convert_case = true,
                loud = true
                --dict = '/usr/share/dict/words'
            }
        }
    }
})

For ddc

call ddc#custom#patch_global('sources', ['look'])
call ddc#custom#patch_global('sourceOptions', {
      \ '_': {'matchers': ['matcher_head']},
      \ 'look': {'converters': ['loud', 'matcher_head'], 'matchers': [], 'mark': 'l', 'isVolatile': v:true}
      \ })
call ddc#custom#patch_global('sourceParams', {
      \ 'look': {
      \   'convertCase': v:true,
      \   'dict': v:null
      \ }})

Configuration options

convert_case cmp/ convertCase ddc (type: boolean)

Convert the candidates to match the input characters in the case.

loud cmp (type: boolean)

Convert the candidates to UPPERCASE if all input characters are uppercase.

loud ddc (converter)

A converter instead of option for ddc

dict cmp ddc (type: null|string)

null or specify the dict file path

dflag cmp ddc (type: boolean)

"-d" is passed Transparently to look. Remove non-alphanumeric characters from keywords and recalculate keyword_length.

Use normal dictionary character set and order, i.e., only blanks and alphanumeric characters are compared. This is on by default if no file is specified.

fflag cmp ddc (type: boolean)

"-f" is passed Transparently to look.

Ignore the case of alphabetic characters. This is on by default if no file is specified.

Breaking Changes

  • 2022-06-23 Do not pass fflag when the dictionary is set.

Alternatives