/
dein.txt
1119 lines (918 loc) · 32.5 KB
/
dein.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
*dein.txt* Dark powered Vim/Neovim plugin manager
Version: 1.0
Author: Shougo <Shougo.Matsu at gmail.com>
License: MIT license
==============================================================================
CONTENTS *dein-contents*
Introduction |dein-introduction|
Usage |dein-usage|
Install |dein-install|
Interface |dein-interface|
Functions |dein-functions|
Variables |dein-variables|
Options |dein-options|
Toml |dein-toml|
Unite Sources |dein-unite-sources|
Denite Sources |dein-denite-sources|
Configuration Examples |dein-examples|
FAQ |dein-faq|
Compatibility |dein-compatibility|
==============================================================================
INTRODUCTION *dein-introduction*
*dein* is the dark powered Vim package manager. It is created from full
scratch.
Concepts are:
* Faster than NeoBundle
* Simple
* No commands, Functions only to simplify the implementation
* Easy to test and maintain
* No Vundle/NeoBundle compatibility
* neovim/Vim8 asynchronous API installation support
* Local plugin support
* Non github plugins support
* Go like clone directory name ex:"github.com/{user}/{repository}"
* Merge the plugins directories automatically to avoid long 'runtimepath'
==============================================================================
USAGE *dein-usage*
Refer to the example:
|dein-examples|
Run this command to update your plugins:
>
:call dein#update()
<
Note: The plugins are not updated automatically.
==============================================================================
INSTALL *dein-install*
Requirements:
* Vim 7.4 or above or NeoVim.
* "git" command in $PATH (if you want to install github or vim.org plugins)
First of all, git clone the repository.
Note: You must define the installation directory before to use dein. It
depends on your usage.
For example, "~/.vim/bundles" or "~/.cache/dein" or "~/.local/share/dein".
dein.vim does not define the default installation directory.
You must not set the installation directory under "~/.vim/plugin" or
"~/.config/nvim/plugin".
Note: You need to have git installed.
>
$ mkdir -p ~/.vim/bundle/repos/github.com/Shougo/dein.vim
$ git clone https://github.com/Shougo/dein.vim \
~/.vim/bundle/repos/github.com/Shougo/dein.vim
<
And set up a path to the repository directory.
>
set runtimepath+={path to dein directory}
<
Example:
>
set runtimepath+=~/.vim/bundle/repos/github.com/Shougo/dein.vim
<
Now configure your bundles. (Refer to |dein-examples|)
Call |dein#update()| function to install your plugins.
>
==============================================================================
INTERFACE *dein-interface*
------------------------------------------------------------------------------
FUNCTIONS *dein-functions*
*dein#begin()*
dein#begin({base-path}, [{vimrcs}])
Initialize dein.vim and start plugins configuration
block.
{base-path} is where your downloaded plugins will be placed.
For example, "Shougo/dein.vim" will be downloaded in
"{base-path}/repos/github.com/Shougo/dein.vim" directory.
{vimrcs} is a list of compared .vimrc and/or other
configuration files. The default is |$MYVIMRC|.
The typical {base-path} is "~/.cache/dein" or
"~/.local/share/dein".
Note: You must not call the function inside a
"has('vim_starting')" block.
Note: It executes ":filetype off" automatically.
*dein#end()*
dein#end()
End dein configuration block.
You must not use the plugins in |dein#begin()| block.
It executes |dein#recache_runtimepath()| automatically.
Note: 'runtimepath' is changed after |dein#end()|.
*dein#add()*
dein#add({repo}[, {options}])
Initialize a plugin.
{repo} is the repository URI or local repository directory
path. If {repo} starts with github user name (ex:
"Shougo/dein.vim"), dein will install github plugins.
If {repo} is plugin name only (ex: "taglist.vim"), dein will
install the plugin in vim.org repository (vim-scripts.org:
https://github.com/vim-scripts).
See |dein-options| for what to set in {options}.
Note: You must call it in |dein#begin()| block.
*dein#direct_install()*
dein#direct_install({repo}[, {options}])
Direct install a plugin without editing the configuration.
The arguments are same with |dein#add()|.
It installs and sources the plugin.
Note: The direct installed plugins configuration is saved in
|dein#get_direct_plugins_path()|. You can load or edit it. >
" Try neocomplete without the configuration.
call dein#direct_install('Shougo/neocomplete.vim')
<
*dein#load_toml()*
dein#load_toml({filename}, [{options}])
Load TOML plugin configuration from {filename}. See
|dein-options| for keys to set in {options}.
Note: TOML parser is slow. You should use it with
|dein#load_state()| and |dein#save_state()|.
For toml file formats: |dein-toml|
*dein#load_dict()*
dein#load_dict({dict}, [{options}])
Load the plugin configuration from {dict}. {dict} is the
|Dictionary|. The key is the repository URI and the value is
the |dein-options| dictionary. See |dein-options| for keys to
set in {options}. >
call dein#load_dict({
\ 'Shougo/unite.vim': {},
\ 'Shougo/neocomplete.vim': {'name': 'neocomplete'}
\ })
<
*dein#local()*
dein#local({directory}, [{options}, [{names}]])
Add the subdirectories in {directory} to 'runtimepath', like
"pathogen" does. See |dein-options| for keys to set in
{options}.
If {names} is given, {names} directories are only loaded.
{names} is |wildcards| list.
>
" Load plugin from "~/.vim/bundle".
call dein#local("~/.vim/bundle")
" Load plugin1 and plugin2 from "~/.vim/bundle".
call dein#local("~/.vim/bundle", {},
\ ['plugin1', 'plugin2', 'vim-*', '*.vim'])
<
*dein#install()*
dein#install([{plugins}])
Install the plugins.
{plugins} is the plugins name list.
If you omit it, dein will install all plugins.
Note: If you are using neovim or Vim 8.0+ enabled |+job|, it
runs asynchronously.
*dein#update()*
dein#update([{plugins}])
Install/Update the plugins.
{plugins} is the plugins name list.
If you omit it, dein will update all plugins.
Note: If you are using neovim or Vim 8.0+, it runs
asynchronously.
*dein#reinstall()*
dein#reinstall({plugins})
Reinstall the plugins.
{plugins} is the plugins name list.
*dein#remote_plugins()*
dein#remote_plugins()
Load not loaded neovim |remote-plugin| and execute
":UpdateRemotePlugins" command.
It is better than ":UpdateRemotePlugins" for dein.
Note: It is valid only in neovim.
*dein#each()*
dein#each({command}[, {plugins}])
Execute {command} for {plugins}.
{plugins} is the plugins name list.
You can execute "git gc" command for the plugins.
*dein#build()*
dein#build([{plugins}])
Build for {plugins}.
{plugins} is the plugins name list.
*dein#rollback()*
dein#rollback({date}[, {plugins}])
Rollback to the latest matched {date} revisions for {plugins}.
If {date} is "", it rollbacks to the latest revisions.
{plugins} is the plugins name list.
Note: It is the dangerous command.
*dein#check_install()*
dein#check_install({plugins})
Check the plugins installation.
If the plugins are not installed, it will return non-zero.
{plugins} is the plugins name list or the plugin name to
check.
If you omit it, dein will check all plugins installation.
Note: You can disable the message by |:silent|.
*dein#check_update()*
dein#check_update([{plugins}])
Check the plugins update.
{plugins} is the plugins name list to check.
If you omit it, dein will check all plugins update.
Note: If you are using neovim or Vim 8.0+, it runs
asynchronously.
*dein#check_lazy_plugins()*
dein#check_lazy_plugins()
Check the no meaning lazy plugins. These plugins don't have
"plugin/" directory.
*dein#check_clean()*
dein#check_clean()
Returns the non-used plugins directories. You can write the
wrap command to remove them.
*dein#recache_runtimepath()*
dein#recache_runtimepath()
Re-make the dein runtimepath cache and execute |:helptags|.
It is called automatically after the installation.
*dein#source()*
dein#source([{plugins}])
|:source| the plugins specified by {plugins}.
{plugins} is the plugins name list.
If you omit it, dein will source all plugins.
*dein#get()*
dein#get([{plugin-name}])
Get the plugin options dictionary for {plugin-name}.
If you omit {plugin-name}, dein will return the plugins
dictionary. The key is the plugin name. The value is the
plugin dictionary.
*dein#load_state()*
dein#load_state({base-path})
Load dein's state from the cache script,
which is located in `dein#util#_get_runtime_path() . '/state_'
. fnamemodify(v:progname, ':r') . '.vim'`.
{base-path} is where your downloaded plugins will be placed.
Note: You must call it before |dein#begin()|. It clears dein
all configuration.
Note: It overwrites your 'runtimepath' completely, you must
not call it after change 'runtimepath' dynamically.
It returns 1, if the cache script is old or invalid or not
found.
>
if dein#load_state(path)
call dein#begin(path)
" My plugins here:
" ...
call dein#end()
call dein#save_state()
endif
<
*dein#save_state()*
dein#save_state()
Save dein's state in the cache script.
It must be after |dein#end()|.
Note: It is available when loading .vimrc.
Note: It saves your 'runtimepath' completely, you must not
call it after change 'runtimepath' dynamically.
*dein#clear_state()*
dein#clear_state()
Clear the state file manually.
*dein#tap()*
dein#tap({plugin-name})
Return non-zero if {plugin-name} exists and isn't
disabled.
It initializes |g:dein#name| and |g:dein#plugin| variables.
*dein#is_sourced()*
dein#is_sourced({plugin-name})
Return non-zero if {plugin-name} exists and is sourced.
See |dein#source()| and |dein#tap()| as well.
*dein#get_log()*
dein#get_log()
Get all previous install logs.
*dein#get_progress()*
dein#get_progress()
Get current update progress message.
*dein#get_updates_log()*
dein#get_updates_log()
Print previous update logs.
*dein#get_direct_plugins_path()*
dein#get_direct_plugins_path()
Get the direct installed plugins script path.
*dein#call_hook()*
dein#call_hook({hook-name})
Calls the hook {hook-name}.
Note: If {hook-name} is "source", dein will call "source"
hooks in sourced plugins.
*dein#plugins2toml()*
dein#plugins2toml({plugins})
Returns the toml configurations for {plugins}
{plugins} is the plugins dictionary from |dein#get()|.
*dein#disable()*
dein#disable({plugins})
Disables plugins specified by {plugins}.
{plugins} is the plugins name list.
Note: This command must be executed before dein loads
the plugins.
*dein#config()*
dein#config({plugin-name}, {options})
dein#config({options})
Change plugin options for {plugin-name}.
It you omit {plugin-name}, it uses |g:dein#name| variable.
If {plugin-name} is list, you can change the options in the
multiple plugins.
If {plugin-name} is already loaded or invalid, it will be
ignored.
Note: You must call it within |dein#begin()| / ||dein#end()|
block.
>
call dein#add('Shougo/neocomplete.vim')
call dein#config('neocomplete.vim', {
\ 'lazy' : 1, 'on_i' : 1,
\ })
<
*dein#set_hook()*
dein#set_hook({plugin-name}, {hook-name}, {hook})
Set hook {hook} as {hook-name} in {plugin-name}.
It can be called after |dein#begin()| / |dein#end()| block.
>
call dein#add('Shougo/neosnippet.vim', {'lazy': 1})
function! Foo() abort
endfunction
call dein#set_hook('neosnippet.vim', 'hook_source', function('Foo'))
<
------------------------------------------------------------------------------
VARIABLES *dein-variables*
*g:dein#name*
g:dein#name
Current plugin name.
You can use it in |dein#tap()| block.
*g:dein#plugin*
g:dein#plugin
Current plugin.
You can use it in |dein#tap()| block or |dein-hooks|.
*g:dein#enable_name_conversion*
g:dein#enable_name_conversion
If you set it to 1 and omit plugin name,
|dein-options-normalized_name| is used as plugin name.
It is useful for absorbing difference of repository name.
Defaults: "0"
*g:dein#enable_notification*
g:dein#enable_notification
If you set it to 1, dein uses the notification feature.
You need the following commands to use it.
In Windows: "Snarl" and "Snarl_CMD" commands
http://snarl.fullphat.net/
https://www.tlhan-ghun.de/projects/snarl-command-line-tools/snarl_cmd-exe/
In Mac: "terminal-notifier" or "osascript" command
https://github.com/julienXX/terminal-notifier
Note: "reattach-to-user-namespace" command is needed in tmux.
In Linux: "notify-send" command
Defaults: "0"
*g:dein#notification_icon*
g:dein#notification_icon
The notification icon path.
Defaults: ""
*g:dein#notification_time*
g:dein#notification_time
This is the time the notification should be displayed in
seconds. For Linux and Windows only.
Defaults: 2
*g:dein#download_command*
g:dein#download_command
The default download command.
Defaults: "curl --silent --location --output" or "wget -q -O"
or use PowerShell.
*g:dein#cache_directory*
g:dein#cache_directory
The cache directory to use.
The default is under the base directory you have already
specified by |dein#begin()|.
*g:dein#install_max_processes*
g:dein#install_max_processes
The max number of processes used for dein/install source
asynchronous update.
If it is less than equal 1, this feature is disabled.
Defaults: "8"
*g:dein#install_process_timeout*
g:dein#install_process_timeout
The time of timeout seconds when updating/installing plugins.
Defaults: "120"
*g:dein#install_progress_type*
g:dein#install_progress_type
The output type of the progress bar in the installer.
Note: If you want to display the progress in the 'statusline',
you should use |dein#get_progress()| .
"none":
Disabled.
"echo":
Displayed in the echo area.
"tabline":
Displayed in the 'tabline'.
"title":
Displayed in the 'titlestring'.
Note: It is neovim only support
Defaults: "echo"
*g:dein#install_message_type*
g:dein#install_message_type
The output type of the messages in the installer.
"none":
Disabled.
"echo":
Displayed in the echo area.
*g:dein#log_filename*
g:dein#install_log_filename
The log filename. Set it to "" to disable logging.
Defaults to "".
*g:dein#types#git#command_path*
g:dein#types#git#command_path
The "git" command path used for git type.
Defaults: "git"
*g:dein#types#git#default_protocol*
g:dein#types#git#default_protocol
The default protocol used for git (github).
Note: It only accepts "https" or "ssh".
Defaults: "https"
*g:dein#types#git#clone_depth*
g:dein#types#git#clone_depth
The default history depth for "git clone".
If it is 1, dein will use shallow clone feature.
See |dein-options-type__depth|.
Defaults: 0
*g:dein#types#git#pull_command*
g:dein#types#git#pull_command
The git command used to pull updates.
Defaults: "pull --ff --ff-only"
------------------------------------------------------------------------------
OPTIONS *dein-options*
The {options} accepts the following keys:
*dein-options-name*
name (String)
Specify the name of the plugin. This is used for dein
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, dein 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.
*dein-options-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, dein will not add the path to
'runtimepath'
Example:
>
call dein#add('rstacruz/sparkup', {'rtp': 'vim'})
<
*dein-options-normalized_name*
normalized_name (String)
Specify the normalized name of the plugin. If omitted, dein
will normalize the tail of the repository name.
Note: Must be unique across all plugins.
Normalized name example:
name : normalized name
>
unite.vim unite
vim-quickrun quickrun
<
*dein-options-path*
path (String)
Specify the plugin downloaded path.
*dein-options-rev*
rev (String)
Specify a revision number or branch/tag name.
If it is "*" in "git" type, dein will use latest released tag.
You can specify the wildcards like "0.*".
Note: If the type is "raw", rev must be hash number.
Example:
>
call dein#add('Shougo/vimshell', { 'rev': '3787e5' })
<
*dein-options-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.
*dein-options-if*
if (Number) or (String)
If set to zero, dein doesn't register the plugin, i.e. the
plugin will be disabled.
If it is String, dein will eval it.
If you don't set it, dein will register (enable) the plugin.
*dein-options-timeout*
timeout (Number)
The time of timeout seconds when updating/installing plugins.
If omit it, |g:dein#install_process_timeout| will be used.
*dein-options-frozen*
frozen (Number)
If set to 1, dein doesn't update it automatically. It is
useful for outdated plugins that can no longer be updated.
*dein-options-merged*
merged (Number)
If set to 0, dein doesn't merge the plugin directory. It is
useful for the plugin files conflicts.
*dein-options-build*
build (String)
Specify the build script.
This command is executed by |system()| in the plugin
runtimepath.
Note: In previous versions of dein, build could also be of type
dictionary, but that is now deprecated.
Please use |dein-options-hook_post_update| instead.
Example:
>
call dein#add('Shougo/vimproc.vim', {'build': 'make'})
<
Note: The command is executed in plugin top directory.
If you need cd command, you must use "sh -c". >
call dein#add('wincent/command-t', {
\ 'build':
\ 'sh -c "cd ruby/command-t && ruby extconf.rb && make"'
\ })
<
*dein-options-type*
type (String)
Specify the repository type. If it is omitted, a guess is made
based on {repository}.
The available types:
"none" : None repository
"raw" : Raw plugin file ("script_type" attribute is
needed)
"git" : Git
*dein-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.
Example:
>
call dein#add(
\ 'https://raw.githubusercontent.com/Shougo/'
\ . 'shougo-s-github/master/vim/colors/candy.vim',
\ {'script_type' : 'colors'})
call dein#add(
\ 'https://github.com/bronzehedwick/impactjs-colorscheme',
\ {'script_type' : 'colors'})
<
*dein-options-augroup*
augroup (String)
An augroup name that the plugin uses for |VimEnter| or
|GUIEnter| autocmd events.
*dein-options-lazy*
lazy (Number)
If set to non-zero, dein doesn't add the path to 'runtimepath'
automatically.
If you don't set it, dein 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. You can get the no meaning
lazy plugins by |dein#check_lazy_plugins()|.
*dein-options-on_ft*
on_ft (List) or (String)
If it is matched to 'filetype', dein will call
|dein#source()|.
*dein-options-on_path*
on_path (List) or (String)
If set to ".*", dein will call |dein#source()| on editing all
files. Otherwise, dein will call |dein#source()| if the
buffer name is matched to the string pattern.
Note: It is useful for explorer behavior plugins.
Ex: vimfiler, metarw, vim-gnupg ...
*dein-options-on_func*
on_func (List) or (String)
If it is matched to the called function, dein will call
|dein#source()|.
*dein-options-on_source*
on_source (List) or (String)
Load the plugin before the listed plugins are loaded.
Note: The plugins must be lazy loaded plugins.
*dein-options-on_cmd*
on_cmd (List) or (String)
If it is matched to the executed command, dein will call
|dein#source()|.
*dein-options-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, "nx" is used.
Note: You can use plugin prefix mappings.
For example, you can use "<Plug>(ref-" instead of
"<Plug>(ref-back)" and so on.
For example: >
call dein#add('Shougo/vimshell.vim',
\ { 'on_map': {'n': '<Plug>'} })
call dein#add('Shougo/vimfiler.vim',
\ { 'on_map': [['n', '<Plug>']], 'depends': 'unite.vim' })
<
Note: You can use "<Plug>" keyword as {mapping}. If
{mapping} is "<Plug>", "<Plug>(normalized_name" is
used.
For example: >
" It is same as "'mappings': '<Plug>(anzu'
call dein#add('osyo-manga/vim-anzu', {'on_map': '<Plug>'})
<
Note: You cannot use lazy <Plug> mappings twice.
For example: >
call dein#add('osyo-manga/vim-anzu',
\ {'on_map': '<Plug>(anzu-'}
" Not working!!
nmap n <Plug>(anzu-jump-n)<Plug>(anzu-echo-search-status)zv
nmap N <Plug>(anzu-jump-N)<Plug>(anzu-echo-search-status)zv
<
*dein-options-on_i*
on_i (Number)
If set to non-zero, dein will call |dein#source()| on
|InsertEnter| autocmd.
Note: This is deprecated option. You should use
|dein-options-on_event| instead.
*dein-options-on_idle*
on_idle (Number)
If set to non-zero, dein will call |dein#source()| on
|FocusLost| or |CursorHold| autocmd.
Note: This is deprecated option. You should use
|dein-options-on_event| instead.
*dein-options-on_event*
on_event (String) or (List)
dein will call |dein#source()| on the events.
*dein-options-on_if*
on_if (String)
If it is evaluated and it is non-zero, dein will call
|dein#source()|.
The default evaluate timings are "BufRead", "BufNewFile",
"VimEnter" and "FileType".
If |dein-options-on_event| exists, it is evaluated when
|dein-options-on_event|.
For example: >
call dein#add('blueyed/vim-diminactive',
\ {'on_event': 'WinEnter', 'on_if': 'winnr("$") > 1'})
<
*dein-options-type__depth*
type__depth (Number)
The history depth for "git clone".
If omitted, |g:dein#types#git#clone_depth| is used.
If it is than 0, dein clones the repository by shallow
clone. Shallow clone feature saves your repository clone time.
But it has problems in some repository.
See below issues:
https://github.com/Shougo/neobundle.vim/issues/81
https://github.com/Homebrew/homebrew/issues/12024
Note: This attribute is available in git type only.
------------------------------------------------------------------------------
HOOKS *dein-hooks*
The string will be split by the lines.
It is useful for the plugins initialization.
Note: The Function hooks cannot be cached. You must
initialize it.
Note: You can use |g:dein#plugin| in the hooks.
Note: The loading order is not guaranteed in non lazy plugins.
*dein-options-hook_add*
hook_add (String) or (Function)
It is executed after plugins are added.
>
call dein#add('Shougo/vimfiler.vim', {
\ 'hook_add': 'nnoremap <silent> [Space]v
\ :<C-u>VimFiler -invisible<CR>'
\ })
call dein#add('kana/vim-niceblock', {
\ 'hook_add': join(['xmap I <Plug>(niceblock-I)',
'xmap A <Plug>(niceblock-A)'], "\n")
\ })
call dein#add('godlygeek/csapprox', {
\ 'hook_add': "
\ let g:CSApprox_konsole = 1\n
\ let g:CSApprox_attr_map =
\ { 'bold' : 'bold', 'italic' : '', 'sp' : '' }\n
\ "})
<
*dein-options-hook_source*
hook_source (String) or (Function)
It is executed before plugins are sourced.
>
call dein#add('artur-shaik/vim-javacomplete2')
call dein#config('artur-shaik/vim-javacomplete2', {
\ 'hook_source': 'autocmd FileType java
\ setlocal omnifunc=javacomplete#Complete'
\ })
function! Func() abort
autocmd FileType qf nnoremap <buffer> r :<C-u>Qfreplace<CR>
endfunction
call dein#source('thinca/vim-qfreplace',
\ 'hook_source': function('Func'))
<
Note: non lazy plugins' |dein-options-hook_source| cannot be
called. You must call it by |dein#call_hook()| if needed.
>
call dein#begin()
...
call dein#end()
call dein#call_hook('source')
<
*dein-options-hook_post_source*
hook_post_source (String) or (Function)
It is executed after plugins are sourced.
Note: In Vim initializing, you must call the
"hook_post_source" hooks manually in |VimEnter| if needed.
>
autocmd VimEnter * call dein#call_hook('post_source')
<
*dein-options-hook_post_update*
hook_post_update (String) or (Function)
It is executed after the plugins are updated.
*dein-options-hook_done_update*
hook_done_update (String) or (Function)
It is executed after all plugins are updated.
------------------------------------------------------------------------------
TOML *dein-toml*
TOML file format specification:
https://github.com/toml-lang/toml
Note: Original TOML parser is created by kamichidu.
https://github.com/kamichidu
*dein-toml-hook_add*
hook_add (String)
It is the global |dein-options-hook_add|.
It is executed in |dein#end()|.
*dein-toml-ftplugin*
ftplugin (Dictionary)
"_" key is executed after all ftplugin.
"{filetype}" key is executed {filetype} ftplugin.
You can define multiple filetypes by "{filetype1}_{filetype2}"
key. "b:undo_ftplugin" is defined automatically.
*dein-toml-plugins*
plugins (Dictionary)
It is converted to |dein#add()|.
"repo" key is needed.
>
" Load toml from "~/.vim/plugins.toml".
call dein#load_toml("~/.vim/plugins.toml", {})
<
TOML file sample is here:
>
# TOML sample
hook_add = 'let g:foo = 0'
[ftplugin]
# Execute after ftplugin.
_ = '''
setl formatoptions-=ro | setl formatoptions+=mMBl
'''
python = '''
let b:undo_ftplugin .= 'setlocal foldmethod<'
setlocal foldmethod=indent
'''
[[plugins]]
# repository name is required.
repo = 'kana/vim-niceblock'
on_map = '<Plug>'
[[plugins]]
repo = 'Shougo/neosnippet.vim'
on_i = 1
on_ft = 'snippet'
[[plugins]]
repo = 'rhysd/accelerated-jk'
on_map = '<Plug>'
hook_add = '''
nmap <silent>j <Plug>(accelerated_jk_gj)
nmap <silent>k <Plug>(accelerated_jk_gk)
'''
==============================================================================
UNITE SOURCES *dein-unite-sources*
Here let me explain about a source for |unite| provided in dein.
*dein-unite-source-dein*
dein
Nominates dein plugins as candidates.
Note:
If argument is bang(!), print plugins status.
*dein-unite-source-dein-log*
dein/log
Print previous dein install logs.
And you can jump the diff URI in github.
If argument 1 is "!", the updated logs are displayed.
Source arguments:
1. "!"
==============================================================================
DENITE SOURCES *dein-denite-sources*
Here let me explain about a source for |denite| provided in dein.
*dein-denite-source-dein*
dein
Nominates dein plugins as candidates.
==============================================================================
EXAMPLES *dein-examples*
>
if &compatible
set nocompatible
endif
set runtimepath+={path to dein.vim directory}
if dein#load_state({path to plugin base path directory})
call dein#begin({path to plugin base path directory})
call dein#add({path to dein.vim directory})
call dein#add('Shougo/neocomplete.vim')
...
call dein#end()
call dein#save_state()
endif
filetype plugin indent on
syntax enable
<
==============================================================================
FAQ *dein-faq*
Q: Where is ":NeoBundleFetch" in dein features?
A: You can use |dein-options-rtp|.
>
call dein#add('Shougo/dein.vim', {'rtp': ''})
<
Note: It does not generate |:helptags| file.
Q: vimproc does not work when manually build it.
https://github.com/Shougo/dein.vim/issues/11
A: You should not build it manually. Please use |dein-options-build| feature.
>
call dein#add('Shougo/vimproc.vim', {'build': 'make'})
<
Q: Where is ":NeoBundleCheck" in dein features?
A: You can use |dein#check_install()|.
>
if dein#check_install()
call dein#install()
endif
<
Q: I want to disable plugins.
A: Please use |dein-options-if|.
Q: Cannot load colorscheme when reloading .vimrc.
A: You must write |:colorscheme| lines after |dein#end()|.
>
call dein#add('tomasr/molokai', {'merged': 0})
...