-
Notifications
You must be signed in to change notification settings - Fork 1
/
ddc-eval.txt
73 lines (53 loc) · 2.07 KB
/
ddc-eval.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
*ddc-eval.txt* Vim Script Eval Completion for ddc.vim
Author : Luma <world@luma.email>
License: MIT <https://github.com/LumaKernel/ddc-eval/blob/main/LICENSE>
==============================================================================
CONTENTS *ddc-eval-contents*
INTRODUCTION |ddc-eval-introduction|
INSTALL |ddc-eval-install|
EXAMPLES |ddc-eval-examples|
PARAMS |ddc-eval-params|
==============================================================================
INTRODUCTION *ddc-eval-introduction*
This source collects candidates from the evaluation result of vim script expr.
==============================================================================
INSTALL *ddc-eval-install*
Please install both "ddc.vim" and "denops.vim".
https://github.com/Shougo/ddc.vim
https://github.com/vim-denops/denops.vim
==============================================================================
EXAMPLES *ddc-eval-examples*
Recipe: Completion with picking words.
>
let g:ddc_pick_items = []
function! s:pick(word)
call add(g:ddc_pick_items, { 'word': a:word })
if len(g:ddc_pick_items) > 100
let g:ddc_pick_items = g:ddc_pick_items[:-2]
endif
endfunction
call ddc#custom#alias('source', 'pick', 'eval')
call ddc#custom#patch_global('sources', ['pick'])
call ddc#custom#patch_global('sourceOptions', {
\ 'pick': {
\ 'mark': 'P',
\ 'isVolatile': v:true,
\ }})
call ddc#custom#patch_global('sourceParams', {
\ 'pick': {
\ 'expr': 'g:ddc_pick_items',
\ }})
nnoremap <silent> * :<c-u>call <sid>pick(expand('<cword>'))<cr>*
<
==============================================================================
PARAMS *ddc-eval-params*
*ddc-eval-param-expr*
expr (string)
String evaluated as vim script expression.
Default: "[]"
*ddc-eval-param-ignoreFail*
ignoreFail (boolean)
Whether to ignore failed evaluation.
Default: false
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl