forked from matsui54/ddc-source-buffer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathddc-source-buffer.txt
91 lines (66 loc) · 2.52 KB
/
ddc-source-buffer.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
*ddc-source-buffer.txt* buffer source for ddc.vim
Author: matsui54 <haru.matu9168 at gmail.com>
uga-rosa
License: MIT license
CONTENTS *ddc-source-buffer-contents*
Introduction |ddc-source-buffer-introduction|
Install |ddc-source-buffer-install|
Examples |ddc-source-buffer-examples|
Params |ddc-source-buffer-params|
==============================================================================
INTRODUCTION *ddc-source-buffer-introduction*
This source collects keywords from buffers.
The target buffers are all those that have 'buflisted' turned on and are
loaded (|bufloaded()|). See also |ddc-source-param-getBufnrs|.
==============================================================================
INSTALL *ddc-source-buffer-install*
Please install both "ddc.vim" and "denops.vim".
https://github.com/Shougo/ddc.vim
https://github.com/vim-denops/denops.vim
==============================================================================
EXAMPLES *ddc-source-buffer-examples*
>
call ddc#custom#patch_global('sources', ['buffer'])
call ddc#custom#patch_global('sourceOptions', {
\ '_': {'matchers': ['matcher_head']},
\ 'buffer': {'mark': 'B'},
\ })
" Current buffer only
call ddc#custom#patch_global('sourceParams', #{
\ buffer: #{
\ getBufnrs: denops#callback#register({ctx -> [0]})
\ },
\})
<
==============================================================================
PARAMS *ddc-source-buffer-params*
*ddc-source-buffer-param-getBufnrs*
getBufnrs (number|undefined)
This is the function {id} for collecting the target buffer. Use
|denops#callback#register()| to obtain the {id}.
The argument of the function is {context} and the return value is an
array of bufnr.
{context} is a |Dictionary|, has the following entries.
- changedTick: number;
- event: DdcEvent;
- filetype: string;
- input: string;
- lineNr: number;
- mode: string;
- nextInput: string;
Default: undefined
*ddc-source-buffer-param-limitBytes*
limitBytes (number)
If the byte size of buffer exceeds this number, keywords from
it are not collected.
Default: 1,000,000
*ddc-source-buffer-param-bufNameStyle*
bufNameStyle ("none"|"full"|"basename")
Style of the buffer name style shown in menu.
- "none": empty string
- "full": full buffer name
- "basename": only basename of the file.
ex: /home/user/test.ts => /test.ts
Default: "none"
==============================================================================
vim:tw=78:ts=8:ft=help:norl:noet:fen:noet: