Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit ba3fdb5

Browse files
committed
doc: README and document update
1 parent 7fd28f9 commit ba3fdb5

File tree

3 files changed

+58
-13
lines changed

3 files changed

+58
-13
lines changed

README.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,26 +181,44 @@ let g:completion_max_items = 10
181181

182182
*NOTE* that this only works for non `ins-complete` completion source.
183183

184-
### Trigger Characters
185-
186-
- By default, `completion-nvim` respect the trigger character of your language server, if you
187-
want more trigger characters, add it by
188-
189-
```vim
190-
let g:completion_trigger_character = ['.', '::']
191-
```
192-
193184
### Sorting completion items
194185

195186
- You can decide how your items being sorted in the popup menu. The default value
196187
is `"alphabet"`, change it by
197-
```.vim
188+
```vim
198189
" possible value: "length", "alphabet", "none"
199190
let g:completion_sorting = "length"
200191
```
201192

202193
- If you don't want any sorting, you can set this value to `"none"`.
203194

195+
### Matching Strategy
196+
197+
- There are three different kind of matching technique implement in
198+
completion-nvim: `substr`, `fuzzy` or `exact`.
199+
200+
- You can specify a list of matching strategy, completion-nvim will loop through the list and
201+
assign priority from high to low. For example
202+
203+
```vim
204+
let g:completion_matching_strategy_list = ['exact', 'substr', fuzzy]
205+
```
206+
207+
- You can also enable ignore case matching by
208+
```vim
209+
g:completion_matching-strategy_list = 1
210+
```
211+
212+
### Trigger Characters
213+
214+
- By default, `completion-nvim` respect the trigger character of your language server, if you
215+
want more trigger characters, add it by
216+
217+
218+
```vim
219+
let g:completion_trigger_character = ['.', '::']
220+
```
221+
204222
*NOTE* use `:lua print(vim.inspect(vim.lsp.buf_get_clients()[1].server_capabilities.completionProvider.triggerCharacters))`
205223
to see the trigger character of your language server.
206224

doc/completion-nvim.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ FEATURE *completion-features*
2626
- Automatically open signature help if it's available.
2727
- Snippets integration with UltiSnips and Neosnippet.
2828
- ins-complete method integration
29+
- Apply additionalTextEdits in LSP spec if it's available.
2930
- Chain completion support inspired by vim-mucomplete
3031

3132
==============================================================================
@@ -303,5 +304,31 @@ g:completion_auto_change_source *g:completion_auto_change_source*
303304

304305
default value: 0
305306

307+
g:completion_matching-strategy_list *g:completion-matching-strategy-list*
308+
309+
There are three different kind of matching technique implement in
310+
completion-nvim: 'substr', 'fuzzy' or 'exact'. You can specify a list
311+
of matching strategy, completion-nvim will loop through the list and
312+
assign priority from high to low. For example
313+
>
314+
let g:completion_matching_strategy_list = ['exact', 'substr', fuzzy]
315+
<
316+
default value: ['exact']
317+
318+
g:completion_matching_ignore_case *g:completion_matching_ignore_case*
319+
320+
Enable ignore case matching in all matching strategy. For example
321+
>
322+
let g:completion_matching_ignore_case = 1
323+
<
324+
default value: 0
325+
326+
g:completion_sorting *g:completion_sorting*
327+
328+
You can determine how you want to sort the completion items in popup
329+
menu. Possible values are 'alphabet', 'length', 'none'
330+
331+
default value: 'alphabet'
332+
306333
==============================================================================
307334
vim:tw=78:ts=8:ft=help:norl:noet:fen:noet:

plugin/completion.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ if ! exists('g:completion_chain_complete_list')
8989
let g:completion_chain_complete_list = {
9090
\ 'default' : {
9191
\ 'default': [
92-
\ {'ins_complete': v:false, 'complete_items': ['lsp', 'snippet']},
93-
\ {'ins_complete': v:true, 'mode': '<c-p>'},
94-
\ {'ins_complete': v:true, 'mode': '<c-n>'}],
92+
\ {'complete_items': ['lsp', 'snippet']},
93+
\ {'mode': '<c-p>'},
94+
\ {'mode': '<c-n>'}],
9595
\ 'comment': []
9696
\ }
9797
\}

0 commit comments

Comments
 (0)