-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdpp.txt
1014 lines (793 loc) · 37.6 KB
/
dpp.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
*dpp.txt* Dark powered plugin manager for Vim/Neovim
Author: Shougo <Shougo.Matsu at gmail.com>
License: MIT license
CONTENTS *dpp-contents*
Introduction |dpp-introduction|
Install |dpp-install|
Interface |dpp-interface|
Options |dpp-options|
Functions |dpp-functions|
Plugin options |dpp-plugin-options|
Lua functions. |dpp-lua-functions|
Dpp Sources |dpp-ddu-sources|
Examples |dpp-examples|
Plugins merged feature |dpp-merge|
Exts |dpp-exts|
Ext option |dpp-ext-options|
Ext params |dpp-ext-params|
Protocols |dpp-protocols|
Protocol option |dpp-protocol-options|
Protocol params |dpp-protocol-params|
Autocmds |dpp-autocmds|
Create Ext |dpp-create-ext|
Ext attributes |dpp-ext-attributes|
Create Protocol |dpp-create-protocol|
Protocol attributes |dpp-protocol-attributes|
FAQ |dpp-faq|
Compatibility |dpp-compatibility|
==============================================================================
INTRODUCTION *dpp-introduction*
*dpp* is the abbreviation of "Dark Powered Plugin manager". It provides
extensible plugin manager features.
If you don't want to configure plugins, you don't have to use the plugin
manager. It does not work with zero configuration. You can use other plugin
managers.
==============================================================================
INSTALL *dpp-install*
NOTE: dpp.vim requires Vim 9.1.0448+ or Neovim (0.10.0+) (latest is
recommended).
Please install both Deno 1.45+ and "denops.vim" v7.0+.
https://deno.land/
https://github.com/vim-denops/denops.vim
NOTE: To install plugins from remote, you need to install "dpp-ext-installer".
https://github.com/Shougo/dpp-ext-installer
NOTE: dpp.vim does not include any extensions.
You must install them you want manually.
You can search dpp.vim plugins from https://github.com/topics/dpp-vim.
==============================================================================
INTERFACE *dpp-interface*
------------------------------------------------------------------------------
OPTIONS *dpp-options*
*dpp-option-extOptions*
extOptions (dictionary)
It is a dictionary that maps ext names to its options.
The options with the name "_" is used as the options for all
names.
See also |dpp-ext-options|.
Default: {}
*dpp-option-extParams*
extParams (dictionary)
It is a dictionary that maps ext names to its parameters.
See also |dpp-ext-params|.
Default: {}
*dpp-option-hooksFileMarker*
hooksFileMarker (string)
The marker is used in |dpp-plugin-option-hooks_file|.
Defaults: "{{{,}}}"
*dpp-option-inlineVimrcs*
inlineVimrcs (string[])
The vimrcs are sourced in |dpp#min#load_state()| before hooks.
NOTE: It must be set before |dpp#make_state()|.
NOTE: The files must not be included "<<" pattern(here
document). It breaks the parser.
NOTE: It also supports ".lua" file for Neovim.
Defaults: []
*dpp-option-protocolOptions*
protocolOptions (dictionary)
It is a dictionary that maps protocol names to its options.
The options with the name "_" is used as the options for all
names.
See also |dpp-protocol-options|.
Default: {}
*dpp-option-protocolParams*
protocolParams (dictionary)
It is a dictionary that maps protocol names to its parameters.
See also |dpp-protocol-params|.
Default: {}
*dpp-option-protocols*
protocols (string[])
It is a list of protocol names.
Default: []
*dpp-option-skipMergeFilenamePattern*
skipMergeFilenamePattern (string)
It is the pattern of skip filename when
|dpp-plugin-option-merged| is set.
NOTE: It must be TypeScript regexp.
NOTE: It is only effective for files directly under the
directory.
Default: "^tags(?:-\\w\\w)?$|^package.json$"
------------------------------------------------------------------------------
FUNCTIONS *dpp-functions*
*dpp#async_ext_action()*
dpp#async_ext_action({ext-name}, {action-name}[, {action-params}])
Fire {action-name} action with {action-params} by {ext-name}
ext asynchronously.
{action-params} behavior depends on {action-name}.
NOTE: It does not work to get action value.
NOTE: It must be executed after |dpp#min#load_state()|.
NOTE: It does not work when |vim_starting|. The action may be
executed lazily.
*dpp#check_clean()*
dpp#check_clean()
Returns the non-used plugins directories from dpp base path.
You can write the wrap command to remove them.
NOTE: It must be executed after |dpp#min#load_state()|.
*dpp#check_files()*
dpp#check_files([{name}])
Check dpp.vim cache file is outdated.
{name} is plugins profile name. The default is "vim" or
"nvim".
If it is outdated, |dpp#make_state()| is called
automatically.
It should be called when |BufWritePost| autocmd.
NOTE: "checkFiles" must be set in |dpp#make_state()| script.
*dpp#clear_state()*
dpp#clear_state([{name}])
Remove state file which is created by |dpp#make_state()|.
{name} is plugins profile name. The default is "vim" or
"nvim".
*dpp#get()*
dpp#get([{plugin-name}])
Get the plugin options dictionary for {plugin-name}.
If you omit {plugin-name}, dpp will return the plugins
dictionary. The key is the plugin name. The value is the
plugin dictionary.
*dpp#make_state()*
dpp#make_state({base-path}, {config-path}[, {name}])
Save dpp's state and generate startup script from
{config-path}.
{base-path} is where your downloaded plugins will be placed.
{config-path} is TypeScript configuration file path to make
state. It must be full path.
{name} is plugins profile name. The default is "vim" or
"nvim".
When the state file is created,
|dpp-autocmd-Dpp:makeStatePost| event is fired.
NOTE: It must be called after |DenopsReady|.
NOTE: It saves your 'runtimepath' completely, you must not
call it after change 'runtimepath' dynamically.
The TypeScript configuration script must returns following
object.
checkFiles (string[]) (Optional)
Check file paths when update timestamp.
It is used when |dpp#check_files()|.
Default: []
plugins (Plugin[]) (Required)
Plugins list.
stateLines (string[]) (Optional)
The additional state lines depends on exts.
*dpp#min#load_state()*
dpp#min#load_state({base-path}[, {name}])
Load dpp's state and execute startup script generated by
|dpp#make_state()|, {base-path} is where your downloaded
plugins will be placed.
{name} is plugins profile name. The default is "vim" or
"nvim".
NOTE: It overwrites your 'runtimepath' completely, you must
not call it after change 'runtimepath' dynamically.
NOTE: The block is skipped if dpp's state is loaded.
It returns 1, if the startup script is old or invalid or not
found.
*dpp#source()*
dpp#source([{name}])
|:source| the plugins specified by {name}.
{name} is the plugins name list.
If you omit it, dpp will source all plugins.
It returns sourced plugins list.
*dpp#sync_ext_action()*
dpp#sync_ext_action({ext-name}, {action-name}[, {action-params}])
Fire {action-name} action with {action-params} by {ext-name}
ext synchronously.
{action-params} behavior depends on {action-name}.
NOTE: It must be executed after |dpp#min#load_state()|.
NOTE: It must be called after |DenopsReady|.
------------------------------------------------------------------------------
PLUGIN OPTIONS *dpp-plugin-options*
The {plugin-options} accepts the following keys:
*dpp-plugin-option-augroup*
augroup (String)
An augroup name that the plugin uses for |VimEnter| or
|GUIEnter| autocmd events.
*dpp-plugin-option-denops_wait*
denops_wait (Bool)
If set to v:false, dpp doesn't wait until the denops plugin
is loaded.
NOTE: It is danger option. The plugin does not work well.
*dpp-plugin-option-depends*
depends (List or String)
Specify a list of plugins a plugin depends on.
List items are '{plugin-name}'.
Those specified in the list are NOT installed automatically.
NOTE: The loading order is not guaranteed in non lazy plugins.
*dpp-plugin-option-extAttrs*
extAttrs (Dictionary)
It is a dictionary that exts specific attributes.
See also |dpp-ext-attrs|.
*dpp-plugin-option-ftplugin*
ftplugin (Dictionary)
"_" key is executed after all ftplugin.
"{filetype}" key is executed {filetype} ftplugin.
"lua_{filetype}" key is executed {filetype} ftplugin as
|:lua|.
You can define multiple filetypes by "{filetype1}_{filetype2}"
key. "b:undo_ftplugin" is defined automatically.
NOTE: You need to call |dpp#clear_state()| after vimrc is
changed.
NOTE: It is not executed when the plugin is not installed.
*dpp-plugin-option-if*
if (Bool) or (String)
If set to |v:false|, dpp doesn't load the plugin.
If it is |String|, dpp will eval it.
If you don't set it, dpp will register (enable) the plugin.
NOTE: You cannot disable plugins register in dpp if you use
the option.
*dpp-plugin-option-lazy*
lazy (Bool)
If set to v:true, dpp doesn't add the path to 'runtimepath'
automatically.
If you don't set it, dpp will set it automatically when the
conditions are met.
NOTE: You should not specify the plugins which have no
"plugin/" directory as lazy load plugins. It is meaningless
and just increases the overhead.
NOTE: To load lazy plugins, you need to install
"dpp-ext-lazy".
https://github.com/Shougo/dpp-ext-lazy
*dpp-plugin-option-local*
local (Bool)
If set to v:true, it is local installed plugin.
*dpp-plugin-option-merged*
merged (Bool)
If set to v:false, dpp doesn't merge the plugin directory.
It is useful for the plugin files conflicts.
Default: See |dpp-merge|.
*dpp-plugin-option-merge_ftdetect*
merge_ftdetect (Bool)
If set to v:true, dpp merge the plugin "ftdetect" directory.
It is useful to enable file detection when lazy loaded plugin.
NOTE: It does not work if ftdetect script depends on lazy
plugin functions.
*dpp-plugin-option-name*
name (String)
Specify the name of the plugin. This is used for dpp
management and other functions. If it is omitted, the tail of
the repository name will be used.
NOTE: Must be unique across the all plugin. If the plugin
name conflicts with another plugin, dpp will overwrite the
previous settings with the new one. If the repo tail is bound
to conflict, you can set the "name" option manually to prevent
overwriting an existing plugin setting.
*dpp-plugin-option-on_cmd*
on_cmd (List) or (String)
If it is matched to the executed command name, dpp will call
|dpp#source()|.
NOTE: It must be unique.
NOTE: To use the feature, you need to install "dpp-ext-lazy".
https://github.com/Shougo/dpp-ext-lazy
Default: Prefix match name from |dpp-plugin-option-name|.
*dpp-plugin-option-on_event*
on_event (String) or (List)
dpp will call |dpp#source()| on the events.
NOTE: To use the feature, you need to install "dpp-ext-lazy".
https://github.com/Shougo/dpp-ext-lazy
*dpp-plugin-option-on_func*
on_func (List) or (String)
If it is matched to the called undefined function name, dpp
will call |dpp#source()|.
NOTE: It does not work when Vim initialized.
NOTE: It does not work for Vim9 script. It is |FuncUndefined|
limitation.
NOTE: To use the feature, you need to install "dpp-ext-lazy".
https://github.com/Shougo/dpp-ext-lazy
Default: Prefix match name from |dpp-plugin-option-name|.
*dpp-plugin-option-on_ft*
on_ft (List) or (String)
If it is matched to 'filetype', dpp will call
|dpp#source()|.
NOTE: To use the feature, you need to install "dpp-ext-lazy".
https://github.com/Shougo/dpp-ext-lazy
*dpp-plugin-option-on_if*
on_if (String)
If it is evaluated and it is non-zero, dpp will call
|dpp#source()|.
The default evaluate timings are "BufRead", "BufNewFile",
"VimEnter" and "FileType".
If |dpp-plugin-option-on_event| exists, it is evaluated when
|dpp-plugin-option-on_event|.
NOTE: To use the feature, you need to install "dpp-ext-lazy".
https://github.com/Shougo/dpp-ext-lazy
*dpp-plugin-option-on_lua*
on_lua (List) or (String)
If it is matched to the required lua module root, dpp will
call |dpp#source()|.
NOTE: It is for Neovim only.
NOTE: It does not work for Neovim standard modules and require
in |vim.loop| modules.
NOTE: You cannot require on_lua plugins in
|dpp-plugin-option-hook_add|. Because the plugins are not
initialized.
NOTE: To use the feature, you need to install "dpp-ext-lazy".
https://github.com/Shougo/dpp-ext-lazy
*dpp-plugin-option-on_map*
on_map (Dictionary) or (List) or (String)
If it is the Dictionary, the key is {mode} and the items are
{mapping} or [{mapping1}, {mapping2}, ...].
If it is the List, the items are {mapping} or [{mode},
{mapping1}, [{mapping2}, ...]].
If {mode} is omitted, "nxo" is used.
NOTE: You can use plugin prefix mappings.
For example, you can use "<Plug>(ref-" instead of
"<Plug>(ref-back)" and so on.
NOTE: It must be unique.
NOTE: To use the feature, you need to install "dpp-ext-lazy".
https://github.com/Shougo/dpp-ext-lazy
*dpp-plugin-option-on_path*
on_path (List) or (String)
If set to ".*", dpp will call |dpp#source()| on editing all
files. Otherwise, dpp will call |dpp#source()| if the
buffer name is matched to the string pattern.
NOTE: It is useful for explorer behavior plugins.
NOTE: To use the feature, you need to install "dpp-ext-lazy".
https://github.com/Shougo/dpp-ext-lazy
*dpp-plugin-option-on_post_source*
on_post_source (List) or (String)
Load the plugin after the listed plugins are loaded.
NOTE: The plugins must be lazy loaded plugins.
NOTE: To use the feature, you need to install "dpp-ext-lazy".
https://github.com/Shougo/dpp-ext-lazy
*dpp-plugin-option-on_source*
on_source (List) or (String)
Load the plugin before the listed plugins are loaded.
NOTE: The plugins must be lazy loaded plugins.
NOTE: To use the feature, you need to install "dpp-ext-lazy".
https://github.com/Shougo/dpp-ext-lazy
*dpp-plugin-option-path*
path (String)
Specify the plugin downloaded path.
Default:
"{base-path}/repos/{site-name}/{user-name}/{plugin-name}"
*dpp-plugin-option-protocolAttrs*
protocolAttrs (Dictionary)
It is a dictionary that protocols specific attributes.
See also |dpp-protocol-attrs|.
*dpp-plugin-option-repo*
repo (String)
Specify the plugin repository.
*dpp-plugin-option-rev*
rev (String)
Specify a revision number or branch/tag name.
If it is "*" in "git" type, dpp will use latest released tag.
You can specify the wildcards like "0.*".
NOTE: If the type is "raw", rev must be hash number.
*dpp-plugin-option-rtp*
rtp (String)
Specify the runtime path.
You can use it when the repository has the Vim plugin in a
subdirectory.
For example: https://github.com/rstacruz/sparkup
If it is empty string, dpp will not add the path to
'runtimepath'. It is useful to manage non plugin repostories
or already added to 'runtimepath' plugin manually.
NOTE: If it is empty string, |dpp-plugin-option-hook_source|
and |dpp-plugin-option-hook_post_source| hooks are not called.
Default: Same of |dpp-plugin-option-path|.
*dpp-plugin-options-script_type*
script_type (String)
Specify the script type. It is useful for non-official
categorized plugins.
For example: "indent", "plugin", "ftplugin", ...
NOTE: You must not specify it for categorized plugins.
------------------------------------------------------------------------------
HOOKS *dpp-hooks*
The string will be split by the lines.
It is useful for the plugins initialization.
NOTE: You cannot use function hooks in |dpp#make_state()|.
NOTE: The loading order is not guaranteed in non lazy plugins.
NOTE: The string is executed as Ex commands.
You can use |Vim9| script for hooks. But you cannot use
|Vim9| script in global |dpp-plugin-option-hook_add|. Because
it may be merged for optimize.
To use |Vim9| script, you need to use |:vim9script| or |:def|.
NOTE: |Vim9| script syntax is very strict and it is hard to
debug. It is experimental feature.
*dpp-plugin-option-hooks_file*
hooks_file (String) or (List)
Hooks file path. It must be valid path.
It is useful to define long hooks.
The file format is:
{hook_name} {start_marker}
...
{end_marker}
{start_marker} and {end_marker} are from
|dpp-option-hooksFileMarker|.
{hook_name} is "hook_xxx" or "lua_xxx" or
|dpp-plugin-option-ftplugin| filetype.
Example:
>vim
" hook_source {{{
let g:foo = 'bar'
" }}}
" cpp {{{
let g:bar = 'baz'
" }}}
" Use vim9script
" hook_update {{{
vim9script
g:bar = 'baz'
" }}}
<
*dpp-plugin-option-hook_add*
hook_add (String)
It is executed after the plugin is added.
It is mainly used for defining mappings.
NOTE: You cannot call plugin function in "hook_add".
Because the plugin is not sourced when "hook_add".
NOTE: It is not executed when the plugin is not installed.
*dpp-plugin-option-hook_depends_update*
hook_depends_update (String)
It is executed after |dpp-plugin-option-depends| plugins are
updated.
NOTE: To use the feature, you need to install
"dpp-ext-installer".
https://github.com/Shougo/dpp-ext-installer
*dpp-plugin-option-hook_done_update*
hook_done_update (String)
It is executed after plugins are updated.
NOTE: To use the feature, you need to install
"dpp-ext-installer".
https://github.com/Shougo/dpp-ext-installer
*dpp-plugin-option-hook_post_source*
hook_post_source (String)
It is executed after the plugin script files are sourced.
NOTE: In Vim initializing, you must call the
"hook_post_source" hooks manually in |VimEnter| if needed.
NOTE: |dpp-plugin-option-rtp| must not be empty string.
>
autocmd VimEnter * call dpp#call_hook('post_source')
<
*dpp-plugin-option-hook_post_update*
hook_post_update (String)
It is executed after updated and before
|dpp-ext-installer-action-build|.
NOTE: The plugin may not be sourced.
NOTE: To use the feature, you need to install
"dpp-ext-installer".
https://github.com/Shougo/dpp-ext-installer
*dpp-plugin-option-hook_source*
hook_source (String) or (Function)
It is executed after plugin runtimepath is added and before
the plugin script files are sourced.
It is mainly used for plugin configure.
NOTE: The "sourced" means after |dpp#min#load_state()| or
autoloaded.
NOTE: |dpp-plugin-option-rtp| must not be empty string.
*dpp-plugin-option-lua_add*
lua_add (String)
Lua language string hook instead of Vim script.
It is converted to |dpp-plugin-option-hook_add| key.
NOTE: It works only for Neovim or |+lua|.
*dpp-plugin-option-lua_depends_update*
lua_depends_update (String)
Lua language string hook instead of Vim script.
It is converted to |dpp-plugin-option-hook_depends_update|
key.
NOTE: It works only for Neovim or |+lua|.
NOTE: To use the feature, you need to install
"dpp-ext-installer".
https://github.com/Shougo/dpp-ext-installer
*dpp-plugin-option-lua_done_update*
lua_done_update (String)
Lua language string hook instead of Vim script.
It is converted to |dpp-plugin-option-hook_done_update| key.
NOTE: It works only for Neovim or |+lua|.
NOTE: To use the feature, you need to install
"dpp-ext-installer".
https://github.com/Shougo/dpp-ext-installer
*dpp-plugin-option-lua_post_source*
lua_post_sources (String)
Lua language string hook instead of Vim script.
It is converted to |dpp-plugin-option-hook_post_source| key.
NOTE: It works only for Neovim or |+lua|.
NOTE: |dpp-plugin-option-rtp| must not be empty string.
*dpp-plugin-option-lua_post_update*
lua_post_update (String)
Lua language string hook instead of Vim script.
It is converted to |dpp-plugin-option-hook_post_update| key.
NOTE: It works only for Neovim or |+lua|.
NOTE: To use the feature, you need to install
"dpp-ext-installer".
https://github.com/Shougo/dpp-ext-installer
*dpp-plugin-option-lua_source*
lua_source (String)
Lua language string hook instead of Vim script.
It is converted to |dpp-plugin-option-hook_source| key.
NOTE: It works only for Neovim or |+lua|.
NOTE: |dpp-plugin-option-rtp| must not be empty string.
------------------------------------------------------------------------------
LUA FUNCTIONS *dpp-lua-functions*
*dpp.async_ext_action()*
dpp.async_ext_action({ext-name}, {action-name}[, {action-params}])
Same as |dpp#async_ext_action()|.
*dpp.check_clean()*
dpp.check_clean()
Same as |dpp#check_clean()|.
*dpp.check_files()*
dpp.check_files([{name}])
Same as |dpp#check_files()|.
*dpp.clear_state()*
dpp.clear_state([{name}])
Same as |dpp#clear_state()|.
*dpp.get()*
dpp.get([{plugin-name}])
Same as |dpp#get()|.
*dpp.load_state()*
dpp.load_state({base-path}, {name})
Same as |dpp#min#load_state()|.
*dpp.make_state()*
dpp.make_state({base-path}, {config-path}[, {name}])
Same as |dpp#make_state()|.
*dpp.source()*
dpp.source([{name}])
Same as |dpp#source()|.
*dpp.sync_ext_action()*
dpp.sync_ext_action({ext-name}, {action-name}[, {action-params}])
Same as |dpp#sync_ext_action()|.
==============================================================================
DDU SOURCES *dpp-ddu-sources*
*dpp-ddu-source-dpp*
dpp
Nominates dpp plugins as items.
params:
{names}: Plugin names.
(Default: [])
==============================================================================
EXAMPLES *dpp-examples*
>vim
" Ward off unexpected things that your distro might have made, as
" well as sanely reset options when re-sourcing .vimrc
set nocompatible
" Set dpp base path (required)
const s:dpp_base = '~/.cache/dpp/'
" Set dpp source path (required)
" NOTE: The plugins must be cloned before.
const s:dpp_src = '~/.cache/dpp/repos/github.com/Shougo/dpp.vim'
const s:denops_src = '~/.cache/dpp/repos/github.com/denops/denops.vim'
"const s:denops_installer =
"\ '~/.cache/dpp/repos/github.com/Shougo/dpp-ext-installer'
" Set dpp runtime path (required)
execute 'set runtimepath^=' .. s:dpp_src
if s:dpp_base->dpp#min#load_state()
" NOTE: dpp#make_state() requires denops.vim
" NOTE: denops.vim and dpp plugins are must be added
execute 'set runtimepath^=' .. s:denops_src
"execute 'set runtimepath^=' .. s:denops_installer
autocmd User DenopsReady
\ : echohl WarningMsg
\ | echomsg 'dpp load_state() is failed'
\ | echohl NONE
\ | call dpp#make_state(s:dpp_base, '{TypeScript config file path}')
endif
" Attempt to determine the type of a file based on its name and
" possibly its " contents. Use this to allow intelligent
" auto-indenting " for each filetype, and for plugins that are
" filetype specific.
filetype indent plugin on
" Enable syntax highlighting
if has('syntax')
syntax on
endif
<
==============================================================================
PLUGINS MERGED FEATURE *dpp-merge*
dpp.vim copies the files of multiple plugins into a single directory and
loads them as plugins by default. It expects to improve performance.
That path is usually `dpp_INSTALLED_DIR/.cache/init.vim/.dpp`.
Other plugin managers add a plugin path into 'runtimepath' to load external
plugins. However, if the 'runtimepath' is very large then it will load
slowly. This is because Vim needs to find and load all 'runtimepath' to load
plugins. In dpp.vim, this problem does not exist.
The following plugins will not be merged to prevent merge problems
- |dpp-plugin-option-merged| is v:false
- local plugin (dpp-ext-local)
- lazy loaded plugin (|dpp-plugin-option-lazy|)
- uses |dpp-ext-installer-action-build|
- uses |dpp-plugin-option-hook_post_update|
- uses |dpp-plugin-option-if|
==============================================================================
EXTS *dpp-exts*
NOTE: The Exts are not bundled in dpp.vim. You need to install them
to use dpp.vim. Please search them by https://github.com/topics/dpp-ext
------------------------------------------------------------------------------
EXT ATTRS *dpp-ext-attrs*
There are the ext specific attributes for items. Please read the Ext
documentation.
------------------------------------------------------------------------------
EXT OPTIONS *dpp-ext-options*
NOTE: The Exts cannot set default options. If they need to specify the
recommended configuration, you should write it in the documentation instead.
------------------------------------------------------------------------------
EXT PARAMS *dpp-ext-params*
There are the parameters that each Ext can have. Please read the Ext
documentation.
==============================================================================
PROTOCOLS *dpp-protocols*
NOTE: The Protocols are not bundled in dpp.vim. You need to install them
to use dpp.vim. Please search them by https://github.com/topics/dpp-protocol
------------------------------------------------------------------------------
PROTOCOL ATTRS *dpp-protocol-attrs*
There are the protocol specific attributes for items. Please read the
Protocol documentation.
------------------------------------------------------------------------------
PROTOCOL OPTIONS *dpp-protocol-options*
NOTE: The Protocols cannot set default options. If they need to specify the
recommended configuration, you should write it in the documentation instead.
------------------------------------------------------------------------------
PROTOCOL PARAMS *dpp-protocol-params*
There are the parameters that each Protocol can have. Please read the
Protocol documentation.
==============================================================================
AUTOCMDS *dpp-autocmds*
dpp.vim defines some |User| autocmds.
*dpp-autocmd-Dpp:extActionPost*
Dpp:extActionPost:{ext-name}:{action-name}
Called after |dpp#sync_ext_action()| or
|dpp#async_ext_action()| is finished.
*dpp-autocmd-Dpp:makeStatePost*
Dpp:makeStatePost
Called after |dpp#make_state()| is finished.
>
" Auto exit after dpp#make_state()
autocmd User Dpp:makeStatePost quit!
<
==============================================================================
CREATE EXT *dpp-create-ext*
To create ext, you should read other exts implementation.
The ext must put under "denops/@dpp-exts/*.ts".
The ext class must extend the "BaseExt" class.
NOTE: It must be written in TypeScript language.
NOTE: If you call Vim functions, it is not asynchronous.
------------------------------------------------------------------------------
EXT ATTRIBUTES *dpp-ext-attributes*
*dpp-ext-attribute-actions*
actions (Record<string, function>) (Required)
Defines ext specific actions.
*dpp-ext-attribute-onInit*
onInit (function) (Optional)
Called before call ext functions.
*dpp-ext-attribute-params*
params (function) (Required)
Called to get ext params.
==============================================================================
CREATE PROTOCOL *dpp-create-protocol*
To create protocol, you should read other protocols implementation.
The protocol must put under "denops/@dpp-protocols/*.ts".
The protocol class must extend the "BaseProtocol" class.
NOTE: It must be written in TypeScript language.
NOTE: If you call Vim functions, it is not asynchronous.
------------------------------------------------------------------------------
PROTOCOL ATTRIBUTES *dpp-protocol-attributes*
*dpp-protocol-attribute-detect*
detect (function) (Optional)
Called to detect plugin's protocol.
*dpp-protocol-attribute-getChangesCountCommand*
getChangesCountCommand (function) (Optional)
Called to get changes count command.
*dpp-protocol-attribute-getDiffCommand*
getDiffCommand (function) (Optional)
Called to get updated diff command.
*dpp-protocol-attribute-getLogCommand*
getLogCommand (function) (Optional)
Called to get repository synchronous command.
*dpp-protocol-attribute-getRevision*
getRevisionLockCommand (function) (Optional)
Called to get current revision.
*dpp-protocol-attribute-getRevisionLockCommand*
getRevisionLockCommand (function) (Optional)
Called to get revision lock command.
*dpp-protocol-attribute-getSyncCommand*
getSyncCommand (function) (Optional)
Called to get repository synchronous command.
*dpp-protocol-attribute-onInit*
onInit (function) (Optional)
Called before call protocol functions.
*dpp-protocol-attribute-params*
params (function) (Required)
Called to get protocol params.
==============================================================================
FAQ *dpp-faq*
FAQ 1: |dpp-faq-1|
How to donate money to you?
FAQ 2: |dpp-faq-2|
What means "dark powered"?
FAQ 3: |dpp-faq-3|
Why dpp.vim uses Deno?
FAQ 4: |dpp-faq-4|
I want to update cache file automatically when the config is updated.
FAQ 5: |dpp-faq-5|
I want to use dpp functions in lua.
FAQ 6: |dpp-faq-6|
|DenopsReady| is not executed when |dpp#min#load_state()| is failed.
FAQ 7: |dpp-faq-7|
How to remove the disabled plugins?
FAQ 8: |dpp-faq-8|
Why filetype plugin and detection are disabled in default?
------------------------------------------------------------------------------
*dpp-faq-1*
Q: How to donate money to you?
A: I have started github sponsorship to spend more time for Vim/Neovim
plugins. You can donate money to help me!
https://github.com/sponsors/Shougo
*dpp-faq-2*
Q: What means "dark powered"?
A: I think text editor is everything in the world. I want to do everything in
Vim(Neovim) like Emacs. It is not allowed by |design-not| in Vim. It is not
the light way to use Vim. So I have defined it as the dark way. I am the dark
Vimmer. My plugins are dark powered.
*dpp-faq-3*
Q: Why dpp.vim uses Deno?
A: Deno is asynchronous and faster than Vim script and it can be used in both
Vim and Neovim. The features are what I desired.
I have created some plugins by TypeScript. The development is very fun and
easy to maintain.
*dpp-faq-4*
Q: I want to update cache file automatically when the config is updated.
A: You need to set checkFiles when |dpp#make_state()| and you need to call
|dpp#check_files()| like this.
>vim
autocmd BufWritePost *.lua,*.vim,*.toml,*.ts,vimrc,.vimrc
\ call dpp#check_files()
<
*dpp-faq-5*
Q: I want to use dpp functions in lua.
A: You can use |dpp-lua-functions| like this.
>lua
vim.opt.runtimepath:prepend({dpp src path})
local dpp = require("dpp")
local dppBase = "~/.cache/dpp"
if dpp.load_state(dppBase) then
vim.opt.runtimepath:prepend({denops src path})
vim.api.nvim_create_autocmd("User", {
pattern = "DenopsReady",
callback = function()
vim.notify("dpp load_state() is failed")
dpp.make_state(dppBase, {TypeScript config file path})
end,
})
end
vim.api.nvim_create_autocmd("User", {
pattern = "Dpp:makeStatePost",
callback = function()
vim.notify("dpp make_state() is done")
end,
})
<
*dpp-faq-6*
Q: |DenopsReady| is not executed when |dpp#min#load_state()| is failed.
A: "plugin/denops.vim" is not loaded. I think you have enabled "--noplugin".
You need to execute "plugin/denops.vim" manually by |:runtime| command.
>vim
runtime! plugin/denops.vim
<
*dpp-faq-7*
Q: How to remove the disabled plugins?
A: You can remove them like below.
>vim
call map(dpp#check_clean(), { _, val -> delete(val, 'rf') })
<
*dpp-faq-8*
Q: Why filetype plugin and detection are disabled in default?
A: Because it is Vim's default behavior. Some plugin managers and Neovim is
default enabled for the features.
But I don't like to enable the feature by default because it affects the
editor performance. You must explicitly enable it if necessary.
==============================================================================