-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdeoppet.txt
178 lines (139 loc) · 5.33 KB
/
deoppet.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
*deoppet.txt* Dark powered neo-snippet plugin for neovim/Vim8.
Version: 0.0
Author: Shougo <Shougo.Matsu at gmail.com>
License: MIT license
CONTENTS *deoppet-contents*
Introduction |deoppet-introduction|
Install |deoppet-install|
Interface |deoppet-interface|
Functions |deoppet-functions|
Key mappings |deoppet-key-mappings|
Options |deoppet-options|
Examples |deoppet-examples|
FAQ |deoppet-faq|
Compatibility |deoppet-compatibility|
==============================================================================
INTRODUCTION *deoppet-introduction*
*deoppet* is the abbreviation of "dark powered neo-snippet".
==============================================================================
INSTALL *deoppet-install*
Note: deoppet requires Neovim 0.5.0+ with Python3.6.1+.
1. Extract the files and put them in your Neovim or .vim directory
(usually `$XDG_CONFIG_HOME/nvim/`).
2. Execute the ":UpdateRemotePlugins" if Neovim.
If ":echo has('python3')" returns `1`, then you're done; otherwise, see below.
You can enable Python3 interface with pip: >
pip3 install --user pynvim
Note: deoppet needs pynvim ver.0.1.8+. You need update pynvim module.
>
pip3 install --user --upgrade pynvim
<
You can check the Python3 installation by |:checkhealth| command in neovim.
==============================================================================
INTERFACE *deoppet-interface*
------------------------------------------------------------------------------
FUNCTIONS *deoppet-functions*
*deoppet#initialize()*
deoppet#initialize()
Initialize deoppet plugin.
Note: You need to call the function before use deoppet plugin.
*deoppet#custom#option()*
deoppet#custom#option({option-name}, {value})
deoppet#custom#option({dict})
Set {option-name} option to {value} in {buffer-name}
buffer.
If {dict} is available, the key is {option-name} and the value
is {value}.
Note: The all options are in |deoppet-options|.
*deoppet#expandable()*
deoppet#expandable()
It checks if the cursor text is a snippet trigger.
Note: You should use it with imap <expr>.
------------------------------------------------------------------------------
KEY MAPPINGS *deoppet-key-mappings*
*x_<Plug>(deoppet_cut_text)*
x_<Plug>(deoppet_cut_text)
Cut the selected text for "TARGET" placeholder.
*i_<Plug>(deoppet_expand)*
i_<Plug>(deoppet_expand)
Expand a snippet in current cursor position. It only takes
effect if there is a snippet text to expand.
*i_<Plug>(deoppet_jump_backward)*
*s_<Plug>(deoppet_jump_backward)*
i_<Plug>(deoppet_jump_backward)
s_<Plug>(deoppet_jump_backward)
Jump to the previous placeholder key. It does not expand any
snippets.
*i_<Plug>(deoppet_jump_forward)*
*s_<Plug>(deoppet_jump_forward)*
i_<Plug>(deoppet_jump_forward)
s_<Plug>(deoppet_jump_forward)
Jump to the next placeholder key. It does not expand any
snippets.
*x_<Plug>(deoppet_select_text)*
x_<Plug>(deoppet_select_text)
Select the selected text for "TARGET" placeholder.
------------------------------------------------------------------------------
OPTIONS *deoppet-options*
*deoppet-options-ft_snippets_map*
ft_snippets_map
From Filetype to snippets mappings.
You can extend `javascript` filetype with `typescript`
filetype.
>
call deoppet#custom#option('ft_snippets_map',
\ {'typescript': ['typescript', 'javascript']})
<
Default: {}
*deoppet-options-snippets*
snippets
Snippets directory information dictionaries list.
Note: deoppet does not include any of default snippets.
To load snippets, you need to set the option.
Snippets dictionary has following keys:
path (String) (Required)
The snippets directory path.
Note: It must be full path.
Default: []
==============================================================================
EXAMPLES *deoppet-examples*
>
imap <C-k> <Plug>(deoppet_expand)
imap <expr><Tab> deoppet#expandable() ?
\ "\<Plug>(deoppet_expand)" : "\<Tab>"
imap <C-f> <Plug>(deoppet_jump_forward)
imap <C-b> <Plug>(deoppet_jump_backward)
xmap <C-l> <Plug>(deoppet_select_text)
xmap <C-x> <Plug>(deoppet_cut_text)
call deoppet#initialize()
call deoppet#custom#option('snippets',
\ map(globpath(&runtimepath, 'neosnippets', 1, 1),
\ { _, val -> { 'path': val } }))
<
==============================================================================
FREQUENTLY ASKED QUESTIONS (FAQ) *deoppet-faq*
Q: I want to capture group in snippet.
https://github.com/Shougo/neosnippet.vim/issues/426
A: Please use "g:deoppet#captures" variable for it.
>
snippet .map
options word
regexp '\(\w\+\)s\.map$'
.map(`g:deoppet#captures[1]` => ${0})
Q. How to enable deoppet the completion in ddc.vim?
A. >
call ddc#custom#patch_global('sources', ['deoppet'])
call ddc#custom#patch_global('sourceOptions', {
\ '_': {
\ 'matchers': ['matcher_head'],
\ 'sorters': ['sorter_rank']
\ },
\ 'deoppet': {'mark': 'dp', 'dup': v:true},
\ })
<
==============================================================================
COMPATIBILITY *deoppet-compatibility*
2020.04.10
* Replace "snippets_dirs" option to "snippets" to expand it in the future.
==============================================================================
vim:tw=78:ts=8:ft=help:norl:noet:fen:noet: