Unnamed Fossil Project

Check-in [9d5fabc206]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:vim: Move from NeoBundle to vim-plug. vim: Add vim-perl for perl5 and perl6 support.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9d5fabc20609026037ab7628a139fdadda26ae09
User & Date: necrophcodr 2015-08-27 21:25:46
Context
2015-08-27
21:47
term: use base16 color themes. check-in: 98c880e881 user: necrophcodr tags: trunk
21:25
vim: Move from NeoBundle to vim-plug. vim: Add vim-perl for perl5 and perl6 support. check-in: 9d5fabc206 user: necrophcodr tags: trunk
2015-08-24
07:12
X: Remove icon set 'NITRUX'. check-in: 4d55b48731 user: necrophcodr tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added vim/.vim/autoload/plug.vim.







































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
" vim-plug: Vim plugin manager
" ============================
"
" Download plug.vim and put it in ~/.vim/autoload
"
"   curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
"     https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
"
" Edit your .vimrc
"
"   call plug#begin('~/.vim/plugged')
"
"   " Make sure you use single quotes
"   Plug 'junegunn/seoul256.vim'
"   Plug 'junegunn/vim-easy-align'
"
"   " Group dependencies, vim-snippets depends on ultisnips
"   Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
"
"   " On-demand loading
"   Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }
"   Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
"
"   " Using git URL
"   Plug 'https://github.com/junegunn/vim-github-dashboard.git'
"
"   " Plugin options
"   Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }
"
"   " Plugin outside ~/.vim/plugged with post-update hook
"   Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': 'yes \| ./install' }
"
"   " Unmanaged plugin (manually installed and updated)
"   Plug '~/my-prototype-plugin'
"
"   " Add plugins to &runtimepath
"   call plug#end()
"
" Then reload .vimrc and :PlugInstall to install plugins.
" Visit https://github.com/junegunn/vim-plug for more information.
"
"
" Copyright (c) 2015 Junegunn Choi
"
" MIT License
"
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be
" included in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

if exists('g:loaded_plug')
  finish
endif
let g:loaded_plug = 1

let s:cpo_save = &cpo
set cpo&vim

let s:plug_src = 'https://github.com/junegunn/vim-plug.git'
let s:plug_tab = get(s:, 'plug_tab', -1)
let s:plug_buf = get(s:, 'plug_buf', -1)
let s:mac_gui = has('gui_macvim') && has('gui_running')
let s:is_win = has('win32') || has('win64')
let s:nvim = has('nvim') && exists('*jobwait') && !s:is_win
let s:me = resolve(expand('<sfile>:p'))
let s:base_spec = { 'branch': 'master', 'frozen': 0 }
let s:TYPE = {
\   'string':  type(''),
\   'list':    type([]),
\   'dict':    type({}),
\   'funcref': type(function('call'))
\ }
let s:loaded = get(s:, 'loaded', {})
let s:triggers = get(s:, 'triggers', {})

function! plug#begin(...)
  if a:0 > 0
    let s:plug_home_org = a:1
    let home = s:path(fnamemodify(expand(a:1), ':p'))
  elseif exists('g:plug_home')
    let home = s:path(g:plug_home)
  elseif !empty(&rtp)
    let home = s:path(split(&rtp, ',')[0]) . '/plugged'
  else
    return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.')
  endif

  let g:plug_home = home
  let g:plugs = {}
  let g:plugs_order = []
  let s:triggers = {}

  call s:define_commands()
  return 1
endfunction

function! s:define_commands()
  command! -nargs=+ -bar Plug call s:add(<args>)
  if !executable('git')
    return s:err('`git` executable not found. vim-plug requires git.')
  endif
  command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install('<bang>' == '!', [<f-args>])
  command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate  call s:update('<bang>' == '!', [<f-args>])
  command! -nargs=0 -bar -bang PlugClean call s:clean('<bang>' == '!')
  command! -nargs=0 -bar PlugUpgrade if s:upgrade() | execute 'source' s:esc(s:me) | endif
  command! -nargs=0 -bar PlugStatus  call s:status()
  command! -nargs=0 -bar PlugDiff    call s:diff()
  command! -nargs=? -bar PlugSnapshot call s:snapshot(<f-args>)
endfunction

function! s:to_a(v)
  return type(a:v) == s:TYPE.list ? a:v : [a:v]
endfunction

function! s:to_s(v)
  return type(a:v) == s:TYPE.string ? a:v : join(a:v, "\n") . "\n"
endfunction

function! s:source(from, ...)
  for pattern in a:000
    for vim in s:lines(globpath(a:from, pattern))
      execute 'source' s:esc(vim)
    endfor
  endfor
endfunction

function! s:assoc(dict, key, val)
  let a:dict[a:key] = add(get(a:dict, a:key, []), a:val)
endfunction

function! plug#end()
  if !exists('g:plugs')
    return s:err('Call plug#begin() first')
  endif

  if exists('#PlugLOD')
    augroup PlugLOD
      autocmd!
    augroup END
    augroup! PlugLOD
  endif
  let lod = { 'ft': {}, 'map': {}, 'cmd': {} }

  filetype off
  for name in g:plugs_order
    let plug = g:plugs[name]
    if get(s:loaded, name, 0) || !has_key(plug, 'on') && !has_key(plug, 'for')
      let s:loaded[name] = 1
      continue
    endif

    if has_key(plug, 'on')
      let s:triggers[name] = { 'map': [], 'cmd': [] }
      for cmd in s:to_a(plug.on)
        if cmd =~? '^<Plug>.\+'
          if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i'))
            call s:assoc(lod.map, cmd, name)
          endif
          call add(s:triggers[name].map, cmd)
        elseif cmd =~ '^[A-Z]'
          if exists(':'.cmd) != 2
            call s:assoc(lod.cmd, cmd, name)
          endif
          call add(s:triggers[name].cmd, cmd)
        endif
      endfor
    endif

    if has_key(plug, 'for')
      let types = s:to_a(plug.for)
      if !empty(types)
        call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim')
      endif
      for type in types
        call s:assoc(lod.ft, type, name)
      endfor
    endif
  endfor

  for [cmd, names] in items(lod.cmd)
    execute printf(
    \ 'command! -nargs=* -range -bang %s call s:lod_cmd(%s, "<bang>", <line1>, <line2>, <q-args>, %s)',
    \ cmd, string(cmd), string(names))
  endfor

  for [map, names] in items(lod.map)
    for [mode, map_prefix, key_prefix] in
          \ [['i', '<C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
      execute printf(
      \ '%snoremap <silent> %s %s:<C-U>call <SID>lod_map(%s, %s, "%s")<CR>',
      \ mode, map, map_prefix, string(map), string(names), key_prefix)
    endfor
  endfor

  for [ft, names] in items(lod.ft)
    augroup PlugLOD
      execute printf('autocmd FileType %s call <SID>lod_ft(%s, %s)',
            \ ft, string(ft), string(names))
    augroup END
  endfor

  call s:reorg_rtp()
  filetype plugin indent on
  if has('vim_starting')
    syntax enable
  else
    call s:reload()
  endif
endfunction

function! s:loaded_names()
  return filter(copy(g:plugs_order), 'get(s:loaded, v:val, 0)')
endfunction

function! s:reload()
  for name in s:loaded_names()
    call s:source(s:rtp(g:plugs[name]), 'plugin/**/*.vim', 'after/plugin/**/*.vim')
  endfor
endfunction

function! s:trim(str)
  return substitute(a:str, '[\/]\+$', '', '')
endfunction

function! s:version_requirement(val, min)
  for idx in range(0, len(a:min) - 1)
    let v = get(a:val, idx, 0)
    if     v < a:min[idx] | return 0
    elseif v > a:min[idx] | return 1
    endif
  endfor
  return 1
endfunction

function! s:git_version_requirement(...)
  let s:git_version = get(s:, 'git_version',
    \ map(split(split(s:system('git --version'))[-1], '\.'), 'str2nr(v:val)'))
  return s:version_requirement(s:git_version, a:000)
endfunction

function! s:progress_opt(base)
  return a:base && !s:is_win &&
        \ s:git_version_requirement(1, 7, 1) ? '--progress' : ''
endfunction

if s:is_win
  function! s:rtp(spec)
    return s:path(a:spec.dir . get(a:spec, 'rtp', ''))
  endfunction

  function! s:path(path)
    return s:trim(substitute(a:path, '/', '\', 'g'))
  endfunction

  function! s:dirpath(path)
    return s:path(a:path) . '\'
  endfunction

  function! s:is_local_plug(repo)
    return a:repo =~? '^[a-z]:\|^[%~]'
  endfunction
else
  function! s:rtp(spec)
    return s:dirpath(a:spec.dir . get(a:spec, 'rtp', ''))
  endfunction

  function! s:path(path)
    return s:trim(a:path)
  endfunction

  function! s:dirpath(path)
    return substitute(a:path, '[/\\]*$', '/', '')
  endfunction

  function! s:is_local_plug(repo)
    return a:repo[0] =~ '[/$~]'
  endfunction
endif

function! s:err(msg)
  echohl ErrorMsg
  echom a:msg
  echohl None
  return 0
endfunction

function! s:esc(path)
  return escape(a:path, ' ')
endfunction

function! s:escrtp(path)
  return escape(a:path, ' ,')
endfunction

function! s:remove_rtp()
  for name in s:loaded_names()
    let rtp = s:rtp(g:plugs[name])
    execute 'set rtp-='.s:escrtp(rtp)
    let after = globpath(rtp, 'after')
    if isdirectory(after)
      execute 'set rtp-='.s:escrtp(after)
    endif
  endfor
endfunction

function! s:reorg_rtp()
  if !empty(s:first_rtp)
    execute 'set rtp-='.s:first_rtp
    execute 'set rtp-='.s:last_rtp
  endif

  " &rtp is modified from outside
  if exists('s:prtp') && s:prtp !=# &rtp
    call s:remove_rtp()
    unlet! s:middle
  endif

  let s:middle = get(s:, 'middle', &rtp)
  let rtps     = map(s:loaded_names(), 's:rtp(g:plugs[v:val])')
  let afters   = filter(map(copy(rtps), 'globpath(v:val, "after")'), 'isdirectory(v:val)')
  let rtp      = join(map(rtps, 'escape(v:val, ",")'), ',')
                 \ . ','.s:middle.','
                 \ . join(map(afters, 'escape(v:val, ",")'), ',')
  let &rtp     = substitute(substitute(rtp, ',,*', ',', 'g'), '^,\|,$', '', 'g')
  let s:prtp   = &rtp

  if !empty(s:first_rtp)
    execute 'set rtp^='.s:first_rtp
    execute 'set rtp+='.s:last_rtp
  endif
endfunction

function! plug#load(...)
  if a:0 == 0
    return s:err('Argument missing: plugin name(s) required')
  endif
  if !exists('g:plugs')
    return s:err('plug#begin was not called')
  endif
  let unknowns = filter(copy(a:000), '!has_key(g:plugs, v:val)')
  if !empty(unknowns)
    let s = len(unknowns) > 1 ? 's' : ''
    return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', ')))
  end
  for name in a:000
    call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
  endfor
  if exists('#BufRead')
    doautocmd BufRead
  endif
  return 1
endfunction

function! s:remove_triggers(name)
  if !has_key(s:triggers, a:name)
    return
  endif
  for cmd in s:triggers[a:name].cmd
    execute 'silent! delc' cmd
  endfor
  for map in s:triggers[a:name].map
    execute 'silent! unmap' map
    execute 'silent! iunmap' map
  endfor
  call remove(s:triggers, a:name)
endfunction

function! s:lod(names, types)
  for name in a:names
    call s:remove_triggers(name)
    let s:loaded[name] = 1
  endfor
  call s:reorg_rtp()

  for name in a:names
    let rtp = s:rtp(g:plugs[name])
    for dir in a:types
      call s:source(rtp, dir.'/**/*.vim')
    endfor
    if exists('#User#'.name)
      execute 'doautocmd User' name
    endif
  endfor
endfunction

function! s:lod_ft(pat, names)
  call s:lod(a:names, ['plugin', 'after/plugin', 'syntax', 'after/syntax'])
  execute 'autocmd! PlugLOD FileType' a:pat
  if exists('#filetypeplugin#FileType')
    doautocmd filetypeplugin FileType
  endif
  if exists('#filetypeindent#FileType')
    doautocmd filetypeindent FileType
  endif
endfunction

function! s:lod_cmd(cmd, bang, l1, l2, args, names)
  call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
  execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args)
endfunction

function! s:lod_map(map, names, prefix)
  call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'])
  let extra = ''
  while 1
    let c = getchar(0)
    if c == 0
      break
    endif
    let extra .= nr2char(c)
  endwhile
  call feedkeys(a:prefix . substitute(a:map, '^<Plug>', "\<Plug>", '') . extra)
endfunction

function! s:add(repo, ...)
  if a:0 > 1
    return s:err('Invalid number of arguments (1..2)')
  endif

  try
    let repo = s:trim(a:repo)
    let name = fnamemodify(repo, ':t:s?\.git$??')
    let spec = extend(s:infer_properties(name, repo),
                    \ a:0 == 1 ? s:parse_options(a:1) : s:base_spec)
    if !has_key(g:plugs, name)
      call add(g:plugs_order, name)
    endif
    let g:plugs[name] = spec
    let s:loaded[name] = get(s:loaded, name, 0)
  catch
    return s:err(v:exception)
  endtry
endfunction

function! s:parse_options(arg)
  let opts = copy(s:base_spec)
  let type = type(a:arg)
  if type == s:TYPE.string
    let opts.tag = a:arg
  elseif type == s:TYPE.dict
    call extend(opts, a:arg)
    if has_key(opts, 'dir')
      let opts.dir = s:dirpath(expand(opts.dir))
    endif
  else
    throw 'Invalid argument type (expected: string or dictionary)'
  endif
  return opts
endfunction

function! s:infer_properties(name, repo)
  let repo = a:repo
  if s:is_local_plug(repo)
    return { 'dir': s:dirpath(expand(repo)) }
  else
    if repo =~ ':'
      let uri = repo
    else
      if repo !~ '/'
        let repo = 'vim-scripts/'. repo
      endif
      let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git')
      let uri = printf(fmt, repo)
    endif
    let dir = s:dirpath( fnamemodify(join([g:plug_home, a:name], '/'), ':p') )
    return { 'dir': dir, 'uri': uri }
  endif
endfunction

function! s:install(force, names)
  call s:update_impl(0, a:force, a:names)
endfunction

function! s:update(force, names)
  call s:update_impl(1, a:force, a:names)
endfunction

function! plug#helptags()
  if !exists('g:plugs')
    return s:err('plug#begin was not called')
  endif
  for spec in values(g:plugs)
    let docd = join([spec.dir, 'doc'], '/')
    if isdirectory(docd)
      silent! execute 'helptags' s:esc(docd)
    endif
  endfor
  return 1
endfunction

function! s:syntax()
  syntax clear
  syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber
  syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX
  syn match plugNumber /[0-9]\+[0-9.]*/ contained
  syn match plugBracket /[[\]]/ contained
  syn match plugX /x/ contained
  syn match plugDash /^-/
  syn match plugPlus /^+/
  syn match plugStar /^*/
  syn match plugMessage /\(^- \)\@<=.*/
  syn match plugName /\(^- \)\@<=[^ ]*:/
  syn match plugInstall /\(^+ \)\@<=[^:]*/
  syn match plugUpdate /\(^* \)\@<=[^:]*/
  syn match plugCommit /^  [0-9a-z]\{7} .*/ contains=plugRelDate,plugSha
  syn match plugSha /\(^  \)\@<=[0-9a-z]\{7}/ contained
  syn match plugRelDate /([^)]*)$/ contained
  syn match plugNotLoaded /(not loaded)$/
  syn match plugError /^x.*/
  syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean
  hi def link plug1       Title
  hi def link plug2       Repeat
  hi def link plugX       Exception
  hi def link plugBracket Structure
  hi def link plugNumber  Number

  hi def link plugDash    Special
  hi def link plugPlus    Constant
  hi def link plugStar    Boolean

  hi def link plugMessage Function
  hi def link plugName    Label
  hi def link plugInstall Function
  hi def link plugUpdate  Type

  hi def link plugError   Error
  hi def link plugRelDate Comment
  hi def link plugSha     Identifier

  hi def link plugNotLoaded Comment
endfunction

function! s:lpad(str, len)
  return a:str . repeat(' ', a:len - len(a:str))
endfunction

function! s:lines(msg)
  return split(a:msg, "[\r\n]")
endfunction

function! s:lastline(msg)
  return get(s:lines(a:msg), -1, '')
endfunction

function! s:new_window()
  execute get(g:, 'plug_window', 'vertical topleft new')
endfunction

function! s:plug_window_exists()
  let buflist = tabpagebuflist(s:plug_tab)
  return !empty(buflist) && index(buflist, s:plug_buf) >= 0
endfunction

function! s:switch_in()
  if !s:plug_window_exists()
    return 0
  endif

  if winbufnr(0) != s:plug_buf
    let s:pos = [tabpagenr(), winnr(), winsaveview()]
    execute 'normal!' s:plug_tab.'gt'
    let winnr = bufwinnr(s:plug_buf)
    execute winnr.'wincmd w'
    call add(s:pos, winsaveview())
  else
    let s:pos = [winsaveview()]
  endif

  setlocal modifiable
  return 1
endfunction

function! s:switch_out(...)
  call winrestview(s:pos[-1])
  setlocal nomodifiable
  if a:0 > 0
    execute a:1
  endif

  if len(s:pos) > 1
    execute 'normal!' s:pos[0].'gt'
    execute s:pos[1] 'wincmd w'
    call winrestview(s:pos[2])
  endif
endfunction

function! s:prepare()
  call s:job_abort()
  if s:switch_in()
    silent %d _
  else
    call s:new_window()
    nnoremap <silent> <buffer> q  :if b:plug_preview==1<bar>pc<bar>endif<bar>echo<bar>q<cr>
    nnoremap <silent> <buffer> R  :silent! call <SID>retry()<cr>
    nnoremap <silent> <buffer> D  :PlugDiff<cr>
    nnoremap <silent> <buffer> S  :PlugStatus<cr>
    nnoremap <silent> <buffer> U  :call <SID>status_update()<cr>
    xnoremap <silent> <buffer> U  :call <SID>status_update()<cr>
    nnoremap <silent> <buffer> ]] :silent! call <SID>section('')<cr>
    nnoremap <silent> <buffer> [[ :silent! call <SID>section('b')<cr>
    let b:plug_preview = -1
    let s:plug_tab = tabpagenr()
    let s:plug_buf = winbufnr(0)
    call s:assign_name()
  endif
  silent! unmap <buffer> <cr>
  silent! unmap <buffer> L
  silent! unmap <buffer> o
  silent! unmap <buffer> X
  setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap cursorline modifiable
  setf vim-plug
  call s:syntax()
endfunction

function! s:assign_name()
  " Assign buffer name
  let prefix = '[Plugins]'
  let name   = prefix
  let idx    = 2
  while bufexists(name)
    let name = printf('%s (%s)', prefix, idx)
    let idx = idx + 1
  endwhile
  silent! execute 'f' fnameescape(name)
endfunction

function! s:do(pull, force, todo)
  for [name, spec] in items(a:todo)
    if !isdirectory(spec.dir)
      continue
    endif
    let installed = has_key(s:update.new, name)
    let updated = installed ? 0 :
      \ (a:pull && !empty(s:system_chomp('git log --pretty=format:"%h" "HEAD...HEAD@{1}"', spec.dir)))
    if a:force || installed || updated
      execute 'cd' s:esc(spec.dir)
      call append(3, '- Post-update hook for '. name .' ... ')
      let type = type(spec.do)
      if type == s:TYPE.string
        try
          " FIXME: Escaping is incomplete. We could use shellescape with eval,
          "        but it won't work on Windows.
          let g:_plug_do = '!'.escape(spec.do, '#!%')
          execute "normal! :execute g:_plug_do\<cr>\<cr>"
        finally
          let result = v:shell_error ? ('Exit status: '.v:shell_error) : 'Done!'
          unlet g:_plug_do
        endtry
      elseif type == s:TYPE.funcref
        try
          let status = installed ? 'installed' : (updated ? 'updated' : 'unchanged')
          call spec.do({ 'name': name, 'status': status, 'force': a:force })
          let result = 'Done!'
        catch
          let result = 'Error: ' . v:exception
        endtry
      else
        let result = 'Error: Invalid type!'
      endif
      call setline(4, getline(4) . result)
      cd -
    endif
  endfor
endfunction

function! s:finish(pull)
  let new_frozen = len(filter(keys(s:update.new), 'g:plugs[v:val].frozen'))
  if new_frozen
    let s = new_frozen > 1 ? 's' : ''
    call append(3, printf('- Installed %d frozen plugin%s', new_frozen, s))
  endif
  call append(3, '- Finishing ... ')
  redraw
  call plug#helptags()
  call plug#end()
  call setline(4, getline(4) . 'Done!')
  redraw
  let msgs = []
  if !empty(s:update.errors)
    call add(msgs, "Press 'R' to retry.")
  endif
  if a:pull && len(s:update.new) < len(filter(getline(5, '$'),
                \ "v:val =~ '^- ' && stridx(v:val, 'Already up-to-date') < 0"))
    call add(msgs, "Press 'D' to see the updated changes.")
  endif
  echo join(msgs, ' ')
endfunction

function! s:retry()
  if empty(s:update.errors)
    return
  endif
  call s:update_impl(s:update.pull, s:update.force,
        \ extend(copy(s:update.errors), [s:update.threads]))
endfunction

function! s:is_managed(name)
  return has_key(g:plugs[a:name], 'uri')
endfunction

function! s:names(...)
  return sort(filter(keys(g:plugs), 'stridx(v:val, a:1) == 0 && s:is_managed(v:val)'))
endfunction

function! s:update_impl(pull, force, args) abort
  let args = copy(a:args)
  let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ?
                  \ remove(args, -1) : get(g:, 'plug_threads', s:is_win ? 1 : 16)

  let managed = filter(copy(g:plugs), 's:is_managed(v:key)')
  let todo = empty(args) ? filter(managed, '!v:val.frozen || !isdirectory(v:val.dir)') :
                         \ filter(managed, 'index(args, v:key) >= 0')

  if empty(todo)
    echohl WarningMsg
    echo 'No plugin to '. (a:pull ? 'update' : 'install') . '.'
    echohl None
    return
  endif

  if !s:is_win && s:git_version_requirement(2, 3)
    let s:git_terminal_prompt = exists('$GIT_TERMINAL_PROMPT') ? $GIT_TERMINAL_PROMPT : ''
    let $GIT_TERMINAL_PROMPT = 0
    for plug in values(todo)
      let plug.uri = substitute(plug.uri,
            \ '^https://git::@github\.com', 'https://github.com', '')
    endfor
  endif

  if !isdirectory(g:plug_home)
    try
      call mkdir(g:plug_home, 'p')
    catch
      return s:err(printf('Invalid plug directory: %s. '.
              \ 'Try to call plug#begin with a valid directory', g:plug_home))
    endtry
  endif

  if has('nvim') && !exists('*jobwait') && threads > 1
    echohl WarningMsg
    echomsg 'vim-plug: update Neovim for parallel installer'
    echohl None
  endif

  let python = (has('python') || has('python3')) && !s:is_win && !has('win32unix')
      \ && (!s:nvim || has('vim_starting'))
  let ruby = has('ruby') && !s:nvim && (v:version >= 703 || v:version == 702 && has('patch374'))

  let s:update = {
    \ 'start':   reltime(),
    \ 'all':     todo,
    \ 'todo':    copy(todo),
    \ 'errors':  [],
    \ 'pull':    a:pull,
    \ 'force':   a:force,
    \ 'new':     {},
    \ 'threads': (python || ruby || s:nvim) ? min([len(todo), threads]) : 1,
    \ 'bar':     '',
    \ 'fin':     0
  \ }

  call s:prepare()
  call append(0, ['', ''])
  normal! 2G
  silent! redraw

  let s:clone_opt = get(g:, 'plug_shallow', 1) ?
        \ '--depth 1' . (s:git_version_requirement(1, 7, 10) ? ' --no-single-branch' : '') : ''

  " Python version requirement (>= 2.7)
  if python && !has('python3') && !ruby && !s:nvim && s:update.threads > 1
    redir => pyv
    silent python import platform; print(platform.python_version())
    redir END
    let python = s:version_requirement(
          \ map(split(split(pyv)[0], '\.'), 'str2nr(v:val)'), [2, 6])
  endif

  if (python || ruby) && s:update.threads > 1
    try
      let imd = &imd
      if s:mac_gui
        set noimd
      endif
      if ruby
        call s:update_ruby()
      else
        call s:update_python()
      endif
    catch
      let lines = getline(4, '$')
      let printed = {}
      silent! 4,$d _
      for line in lines
        let name = s:extract_name(line, '.', '')
        if empty(name) || !has_key(printed, name)
          call append('$', line)
          if !empty(name)
            let printed[name] = 1
            if line[0] == 'x' && index(s:update.errors, name) < 0
              call add(s:update.errors, name)
            end
          endif
        endif
      endfor
    finally
      let &imd = imd
      call s:update_finish()
    endtry
  else
    call s:update_vim()
  endif
endfunction

function! s:update_finish()
  if exists('s:git_terminal_prompt')
    let $GIT_TERMINAL_PROMPT = s:git_terminal_prompt
  endif
  if s:switch_in()
    call s:do(s:update.pull, s:update.force, filter(copy(s:update.all), 'has_key(v:val, "do")'))
    call s:finish(s:update.pull)
    call setline(1, 'Updated. Elapsed time: ' . split(reltimestr(reltime(s:update.start)))[0] . ' sec.')
    call s:switch_out('normal! gg')
  endif
endfunction

function! s:job_abort()
  if !s:nvim || !exists('s:jobs')
    return
  endif

  for [name, j] in items(s:jobs)
    silent! call jobstop(j.jobid)
    if j.new
      call s:system('rm -rf ' . s:shellesc(g:plugs[name].dir))
    endif
  endfor
  let s:jobs = {}
endfunction

" When a:event == 'stdout', data = list of strings
" When a:event == 'exit', data = returncode
function! s:job_handler(job_id, data, event) abort
  if !s:plug_window_exists() " plug window closed
    return s:job_abort()
  endif

  if a:event == 'stdout'
    let self.result .= substitute(s:to_s(a:data), '[\r\n]', '', 'g') . "\n"
    " To reduce the number of buffer updates
    let self.tick = get(self, 'tick', -1) + 1
    if self.tick % len(s:jobs) == 0
      call s:log(self.new ? '+' : '*', self.name, self.result)
    endif
  elseif a:event == 'exit'
    let self.running = 0
    if a:data != 0
      let self.error = 1
    endif
    call s:reap(self.name)
    call s:tick()
  endif
endfunction

function! s:spawn(name, cmd, opts)
  let job = { 'name': a:name, 'running': 1, 'error': 0, 'result': '',
            \ 'new': get(a:opts, 'new', 0),
            \ 'on_stdout': function('s:job_handler'),
            \ 'on_exit' : function('s:job_handler'),
            \ }
  let s:jobs[a:name] = job

  if s:nvim
    let argv = [ 'sh', '-c',
               \ (has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd) ]
    let jid = jobstart(argv, job)
    if jid > 0
      let job.jobid = jid
    else
      let job.running = 0
      let job.error   = 1
      let job.result  = jid < 0 ? 'sh is not executable' :
            \ 'Invalid arguments (or job table is full)'
    endif
  else
    let params = has_key(a:opts, 'dir') ? [a:cmd, a:opts.dir] : [a:cmd]
    let job.result = call('s:system', params)
    let job.error = v:shell_error != 0
    let job.running = 0
  endif
endfunction

function! s:reap(name)
  let job = s:jobs[a:name]
  if job.error
    call add(s:update.errors, a:name)
  elseif get(job, 'new', 0)
    let s:update.new[a:name] = 1
  endif
  let s:update.bar .= job.error ? 'x' : '='

  call s:log(job.error ? 'x' : '-', a:name, job.result)
  call s:bar()

  call remove(s:jobs, a:name)
endfunction

function! s:bar()
  if s:switch_in()
    let total = len(s:update.all)
    call setline(1, (s:update.pull ? 'Updating' : 'Installing').
          \ ' plugins ('.len(s:update.bar).'/'.total.')')
    call s:progress_bar(2, s:update.bar, total)
    call s:switch_out()
  endif
endfunction

function! s:logpos(name)
  for i in range(1, line('$'))
    if getline(i) =~# '^[-+x*] '.a:name.':'
      return i
    endif
  endfor
  return 0
endfunction

function! s:log(bullet, name, lines)
  if s:switch_in()
    let pos = s:logpos(a:name)
    if pos > 0
      execute pos 'd _'
      if pos > winheight('.')
        let pos = 4
      endif
    else
      let pos = 4
    endif
    call append(pos - 1, s:format_message(a:bullet, a:name, a:lines))
    call s:switch_out()
  endif
endfunction

function! s:update_vim()
  let s:jobs = {}

  call s:bar()
  call s:tick()
endfunction

function! s:tick()
  let pull = s:update.pull
  let prog = s:progress_opt(s:nvim)
while 1 " Without TCO, Vim stack is bound to explode
  if empty(s:update.todo)
    if empty(s:jobs) && !s:update.fin
      let s:update.fin = 1
      call s:update_finish()
    endif
    return
  endif

  let name = keys(s:update.todo)[0]
  let spec = remove(s:update.todo, name)
  let new  = !isdirectory(spec.dir)

  call s:log(new ? '+' : '*', name, pull ? 'Updating ...' : 'Installing ...')
  redraw

  let has_tag = has_key(spec, 'tag')
  let checkout = s:shellesc(has_tag ? spec.tag : spec.branch)
  let merge = s:shellesc(has_tag ? spec.tag : 'origin/'.spec.branch)

  if !new
    let [valid, msg] = s:git_valid(spec, 0)
    if valid
      if pull
        let fetch_opt = (has_tag && !empty(globpath(spec.dir, '.git/shallow'))) ? '--depth 99999999' : ''
        call s:spawn(name,
          \ printf('(git fetch %s %s 2>&1 && git checkout -q %s 2>&1 && git merge --ff-only %s 2>&1 && git submodule update --init --recursive 2>&1)',
          \ fetch_opt, prog, checkout, merge), { 'dir': spec.dir })
      else
        let s:jobs[name] = { 'running': 0, 'result': 'Already installed', 'error': 0 }
      endif
    else
      let s:jobs[name] = { 'running': 0, 'result': msg, 'error': 1 }
    endif
  else
    call s:spawn(name,
          \ printf('git clone %s %s --recursive %s -b %s %s 2>&1',
          \ has_tag ? '' : s:clone_opt,
          \ prog,
          \ s:shellesc(spec.uri),
          \ checkout,
          \ s:shellesc(s:trim(spec.dir))), { 'new': 1 })
  endif

  if !s:jobs[name].running
    call s:reap(name)
  endif
  if len(s:jobs) >= s:update.threads
    break
  endif
endwhile
endfunction

function! s:update_python()
let py_exe = has('python3') ? 'python3' : 'python'
execute py_exe "<< EOF"
""" Due to use of signals this function is POSIX only. """
import datetime
import functools
import os
try:
  import queue
except ImportError:
  import Queue as queue
import random
import re
import shutil
import signal
import subprocess
import tempfile
import threading as thr
import time
import traceback
import vim

G_NVIM = vim.eval("has('nvim')") == '1'
G_PULL = vim.eval('s:update.pull') == '1'
G_RETRIES = int(vim.eval('get(g:, "plug_retries", 2)')) + 1
G_TIMEOUT = int(vim.eval('get(g:, "plug_timeout", 60)'))
G_CLONE_OPT = vim.eval('s:clone_opt')
G_PROGRESS = vim.eval('s:progress_opt(1)')
G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads'))
G_STOP = thr.Event()
G_THREADS = {}

class BaseExc(Exception):
  def __init__(self, msg):
    self._msg = msg
  @property
  def msg(self):
    return self._msg
class CmdTimedOut(BaseExc):
  pass
class CmdFailed(BaseExc):
  pass
class InvalidURI(BaseExc):
  pass
class Action(object):
  INSTALL, UPDATE, ERROR, DONE = ['+', '*', 'x', '-']

class Buffer(object):
  def __init__(self, lock, num_plugs, is_pull, is_win):
    self.bar = ''
    self.event = 'Updating' if is_pull else 'Installing'
    self.is_win = is_win
    self.lock = lock
    self.maxy = int(vim.eval('winheight(".")'))
    self.num_plugs = num_plugs

  def _where(self, name):
    """ Find first line with name in current buffer. Return line num. """
    found, lnum = False, 0
    matcher = re.compile('^[-+x*] {0}:'.format(name))
    for line in vim.current.buffer:
      if matcher.search(line) is not None:
        found = True
        break
      lnum += 1

    if not found:
      lnum = -1
    return lnum

  def header(self):
    curbuf = vim.current.buffer
    curbuf[0] = self.event + ' plugins ({0}/{1})'.format(len(self.bar), self.num_plugs)

    num_spaces = self.num_plugs - len(self.bar)
    curbuf[1] = '[{0}{1}]'.format(self.bar, num_spaces * ' ')

    with self.lock:
      vim.command('normal! 2G')
      if not self.is_win:
        vim.command('redraw')

  def write(self, action, name, lines):
    first, rest = lines[0], lines[1:]
    msg = ['{0} {1}{2}{3}'.format(action, name, ': ' if first else '', first)]
    padded_rest = ['    ' + line for line in rest]
    msg.extend(padded_rest)

    try:
      if action == Action.ERROR:
        self.bar += 'x'
        vim.command("call add(s:update.errors, '{0}')".format(name))
      elif action == Action.DONE:
        self.bar += '='

      curbuf = vim.current.buffer
      lnum = self._where(name)
      if lnum != -1: # Found matching line num
        del curbuf[lnum]
        if lnum > self.maxy and action in set([Action.INSTALL, Action.UPDATE]):
          lnum = 3
      else:
        lnum = 3
      curbuf.append(msg, lnum)

      self.header()
    except vim.error:
      pass

class Command(object):
  def __init__(self, cmd, cmd_dir=None, timeout=60, ntries=3, cb=None, clean=None):
    self.cmd = cmd
    self.cmd_dir = cmd_dir
    self.timeout = timeout
    self.ntries = ntries
    self.callback = cb if cb else (lambda msg: None)
    self.clean = clean

  def attempt_cmd(self):
    """ Tries to run the command, returns result if no exceptions. """
    attempt = 0
    finished = False
    limit = self.timeout

    while not finished:
      try:
        attempt += 1
        result = self.timeout_cmd()
        finished = True
      except CmdTimedOut:
        if attempt != self.ntries:
          for count in range(3, 0, -1):
            if G_STOP.is_set():
              raise KeyboardInterrupt
            msg = 'Timeout. Will retry in {0} second{1} ...'.format(
                count, 's' if count != 1 else '')
            self.callback([msg])
            time.sleep(1)
          self.timeout += limit
          self.callback(['Retrying ...'])
        else:
          raise

    return result

  def timeout_cmd(self):
    """ Execute a cmd & poll for callback. Returns list of output.
    Raises CmdFailed   -> return code for Popen isn't 0
    Raises CmdTimedOut -> command exceeded timeout without new output
    """
    proc = None
    first_line = True
    try:
      tfile = tempfile.NamedTemporaryFile(mode='w+b', delete=False)
      proc = subprocess.Popen(self.cmd, cwd=self.cmd_dir, stdout=tfile,
          stderr=subprocess.STDOUT, shell=True, preexec_fn=os.setsid)
      while proc.poll() is None:
        # Yield this thread
        time.sleep(0.2)

        if G_STOP.is_set():
          raise KeyboardInterrupt

        if first_line or random.random() < G_LOG_PROB:
          first_line = False
          line = nonblock_read(tfile.name)
          if line:
            self.callback([line])

        time_diff = time.time() - os.path.getmtime(tfile.name)
        if time_diff > self.timeout:
          raise CmdTimedOut(['Timeout!'])

      tfile.seek(0)
      result = [line.decode('utf-8', 'replace').rstrip() for line in tfile]

      if proc.returncode != 0:
        msg = ['']
        msg.extend(result)
        raise CmdFailed(msg)
    except:
      if proc and proc.poll() is None:
        os.killpg(proc.pid, signal.SIGTERM)
      if self.clean:
        self.clean()
      raise
    finally:
      os.remove(tfile.name)

    return result

class Plugin(object):
  def __init__(self, name, args, buf_q, lock):
    self.name = name
    self.args = args
    self.buf_q = buf_q
    self.lock = lock
    tag = args.get('tag', 0)
    self.checkout = esc(tag if tag else args['branch'])
    self.merge = esc(tag if tag else 'origin/' + args['branch'])
    self.tag = tag

  def manage(self):
    try:
      if os.path.exists(self.args['dir']):
        self.update()
      else:
        self.install()
        with self.lock:
          thread_vim_command("let s:update.new['{0}'] = 1".format(self.name))
    except (CmdTimedOut, CmdFailed, InvalidURI) as exc:
      self.write(Action.ERROR, self.name, exc.msg)
    except KeyboardInterrupt:
      G_STOP.set()
      self.write(Action.ERROR, self.name, ['Interrupted!'])
    except:
      # Any exception except those above print stack trace
      msg = 'Trace:\n{0}'.format(traceback.format_exc().rstrip())
      self.write(Action.ERROR, self.name, msg.split('\n'))
      raise

  def install(self):
    target = self.args['dir']

    def clean(target):
      def _clean():
        try:
          shutil.rmtree(target)
        except OSError:
          pass
      return _clean

    self.write(Action.INSTALL, self.name, ['Installing ...'])
    callback = functools.partial(self.write, Action.INSTALL, self.name)
    cmd = 'git clone {0} {1} --recursive {2} -b {3} {4} 2>&1'.format(
        '' if self.tag else G_CLONE_OPT, G_PROGRESS, self.args['uri'], self.checkout, esc(target))
    com = Command(cmd, None, G_TIMEOUT, G_RETRIES, callback, clean(target))
    result = com.attempt_cmd()
    self.write(Action.DONE, self.name, result[-1:])

  def update(self):
    match = re.compile(r'git::?@')
    actual_uri = re.sub(match, '', self.repo_uri())
    expect_uri = re.sub(match, '', self.args['uri'])
    if actual_uri != expect_uri:
      msg = ['',
             'Invalid URI: {0}'.format(actual_uri),
             'Expected     {0}'.format(expect_uri),
             'PlugClean required.']
      raise InvalidURI(msg)

    if G_PULL:
      self.write(Action.UPDATE, self.name, ['Updating ...'])
      callback = functools.partial(self.write, Action.UPDATE, self.name)
      fetch_opt = '--depth 99999999' if self.tag and os.path.isfile(os.path.join(self.args['dir'], '.git/shallow')) else ''
      cmds = ['git fetch {0} {1}'.format(fetch_opt, G_PROGRESS),
              'git checkout -q {0}'.format(self.checkout),
              'git merge --ff-only {0}'.format(self.merge),
              'git submodule update --init --recursive']
      cmd = ' 2>&1 && '.join(cmds)
      com = Command(cmd, self.args['dir'], G_TIMEOUT, G_RETRIES, callback)
      result = com.attempt_cmd()
      self.write(Action.DONE, self.name, result[-1:])
    else:
      self.write(Action.DONE, self.name, ['Already installed'])

  def repo_uri(self):
    cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config remote.origin.url'
    command = Command(cmd, self.args['dir'], G_TIMEOUT, G_RETRIES)
    result = command.attempt_cmd()
    return result[-1]

  def write(self, action, name, msg):
    self.buf_q.put((action, name, msg))

class PlugThread(thr.Thread):
  def __init__(self, tname, args):
    super(PlugThread, self).__init__()
    self.tname = tname
    self.args = args

  def run(self):
    thr.current_thread().name = self.tname
    buf_q, work_q, lock = self.args

    try:
      while not G_STOP.is_set():
        name, args = work_q.get_nowait()
        plug = Plugin(name, args, buf_q, lock)
        plug.manage()
        work_q.task_done()
    except queue.Empty:
      pass
    finally:
      global G_THREADS
      with lock:
        del G_THREADS[thr.current_thread().name]

class RefreshThread(thr.Thread):
  def __init__(self, lock):
    super(RefreshThread, self).__init__()
    self.lock = lock
    self.running = True

  def run(self):
    while self.running:
      with self.lock:
        thread_vim_command('noautocmd normal! a')
      time.sleep(0.2)

  def stop(self):
    self.running = False

if G_NVIM:
  def thread_vim_command(cmd):
    vim.session.threadsafe_call(lambda: vim.command(cmd))
else:
  def thread_vim_command(cmd):
    vim.command(cmd)

def esc(name):
  return '"' + name.replace('"', '\"') + '"'

def nonblock_read(fname):
  """ Read a file with nonblock flag. Return the last line. """
  fread = os.open(fname, os.O_RDONLY | os.O_NONBLOCK)
  buf = os.read(fread, 100000).decode('utf-8', 'replace')
  os.close(fread)

  line = buf.rstrip('\r\n')
  left = max(line.rfind('\r'), line.rfind('\n'))
  if left != -1:
    left += 1
    line = line[left:]

  return line

def main():
  thr.current_thread().name = 'main'
  nthreads = int(vim.eval('s:update.threads'))
  plugs = vim.eval('s:update.todo')
  mac_gui = vim.eval('s:mac_gui') == '1'
  is_win = vim.eval('s:is_win') == '1'

  lock = thr.Lock()
  buf = Buffer(lock, len(plugs), G_PULL, is_win)
  buf_q, work_q = queue.Queue(), queue.Queue()
  for work in plugs.items():
    work_q.put(work)

  global G_THREADS
  for num in range(nthreads):
    tname = 'PlugT-{0:02}'.format(num)
    thread = PlugThread(tname, (buf_q, work_q, lock))
    thread.start()
    G_THREADS[tname] = thread
  if mac_gui:
    rthread = RefreshThread(lock)
    rthread.start()

  while not buf_q.empty() or len(G_THREADS) != 0:
    try:
      action, name, msg = buf_q.get(True, 0.25)
      buf.write(action, name, msg)
      buf_q.task_done()
    except queue.Empty:
      pass
    except KeyboardInterrupt:
      G_STOP.set()

  if mac_gui:
    rthread.stop()
    rthread.join()

main()
EOF
endfunction

function! s:update_ruby()
  ruby << EOF
  module PlugStream
    SEP = ["\r", "\n", nil]
    def get_line
      buffer = ''
      loop do
        char = readchar rescue return
        if SEP.include? char.chr
          buffer << $/
          break
        else
          buffer << char
        end
      end
      buffer
    end
  end unless defined?(PlugStream)

  def esc arg
    %["#{arg.gsub('"', '\"')}"]
  end

  def killall pid
    pids = [pid]
    unless `which pgrep 2> /dev/null`.empty?
      children = pids
      until children.empty?
        children = children.map { |pid|
          `pgrep -P #{pid}`.lines.map { |l| l.chomp }
        }.flatten
        pids += children
      end
    end
    pids.each { |pid| Process.kill 'TERM', pid.to_i rescue nil }
  end

  require 'thread'
  require 'fileutils'
  require 'timeout'
  running = true
  iswin = VIM::evaluate('s:is_win').to_i == 1
  pull  = VIM::evaluate('s:update.pull').to_i == 1
  base  = VIM::evaluate('g:plug_home')
  all   = VIM::evaluate('s:update.todo')
  limit = VIM::evaluate('get(g:, "plug_timeout", 60)')
  tries = VIM::evaluate('get(g:, "plug_retries", 2)') + 1
  nthr  = VIM::evaluate('s:update.threads').to_i
  maxy  = VIM::evaluate('winheight(".")').to_i
  cd    = iswin ? 'cd /d' : 'cd'
  tot   = VIM::evaluate('len(s:update.todo)') || 0
  bar   = ''
  skip  = 'Already installed'
  mtx   = Mutex.new
  take1 = proc { mtx.synchronize { running && all.shift } }
  logh  = proc {
    cnt = bar.length
    $curbuf[1] = "#{pull ? 'Updating' : 'Installing'} plugins (#{cnt}/#{tot})"
    $curbuf[2] = '[' + bar.ljust(tot) + ']'
    VIM::command('normal! 2G')
    VIM::command('redraw') unless iswin
  }
  where = proc { |name| (1..($curbuf.length)).find { |l| $curbuf[l] =~ /^[-+x*] #{name}:/ } }
  log   = proc { |name, result, type|
    mtx.synchronize do
      ing  = ![true, false].include?(type)
      bar += type ? '=' : 'x' unless ing
      b = case type
          when :install  then '+' when :update then '*'
          when true, nil then '-' else
            VIM::command("call add(s:update.errors, '#{name}')")
            'x'
          end
      result =
        if type || type.nil?
          ["#{b} #{name}: #{result.lines.to_a.last}"]
        elsif result =~ /^Interrupted|^Timeout/
          ["#{b} #{name}: #{result}"]
        else
          ["#{b} #{name}"] + result.lines.map { |l| "    " << l }
        end
      if lnum = where.call(name)
        $curbuf.delete lnum
        lnum = 4 if ing && lnum > maxy
      end
      result.each_with_index do |line, offset|
        $curbuf.append((lnum || 4) - 1 + offset, line.gsub(/\e\[./, '').chomp)
      end
      logh.call
    end
  }
  bt = proc { |cmd, name, type, cleanup|
    tried = timeout = 0
    begin
      tried += 1
      timeout += limit
      fd = nil
      data = ''
      if iswin
        Timeout::timeout(timeout) do
          tmp = VIM::evaluate('tempname()')
          system("(#{cmd}) > #{tmp}")
          data = File.read(tmp).chomp
          File.unlink tmp rescue nil
        end
      else
        fd = IO.popen(cmd).extend(PlugStream)
        first_line = true
        log_prob = 1.0 / nthr
        while line = Timeout::timeout(timeout) { fd.get_line }
          data << line
          log.call name, line.chomp, type if name && (first_line || rand < log_prob)
          first_line = false
        end
        fd.close
      end
      [$? == 0, data.chomp]
    rescue Timeout::Error, Interrupt => e
      if fd && !fd.closed?
        killall fd.pid
        fd.close
      end
      cleanup.call if cleanup
      if e.is_a?(Timeout::Error) && tried < tries
        3.downto(1) do |countdown|
          s = countdown > 1 ? 's' : ''
          log.call name, "Timeout. Will retry in #{countdown} second#{s} ...", type
          sleep 1
        end
        log.call name, 'Retrying ...', type
        retry
      end
      [false, e.is_a?(Interrupt) ? "Interrupted!" : "Timeout!"]
    end
  }
  main = Thread.current
  threads = []
  watcher = Thread.new {
    while VIM::evaluate('getchar(1)')
      sleep 0.1
    end
    mtx.synchronize do
      running = false
      threads.each { |t| t.raise Interrupt }
    end
    threads.each { |t| t.join rescue nil }
    main.kill
  }
  refresh = Thread.new {
    while true
      mtx.synchronize do
        break unless running
        VIM::command('noautocmd normal! a')
      end
      sleep 0.2
    end
  } if VIM::evaluate('s:mac_gui') == 1

  clone_opt = VIM::evaluate('s:clone_opt')
  progress = VIM::evaluate('s:progress_opt(1)')
  nthr.times do
    mtx.synchronize do
      threads << Thread.new {
        while pair = take1.call
          name = pair.first
          dir, uri, branch, tag = pair.last.values_at *%w[dir uri branch tag]
          checkout = esc(tag ? tag : branch)
          merge = esc(tag ? tag : "origin/#{branch}")
          subm = "git submodule update --init --recursive 2>&1"
          exists = File.directory? dir
          ok, result =
            if exists
              dir = iswin ? dir : esc(dir)
              ret, data = bt.call "#{cd} #{dir} && git rev-parse --abbrev-ref HEAD 2>&1 && git config remote.origin.url", nil, nil, nil
              current_uri = data.lines.to_a.last
              if !ret
                if data =~ /^Interrupted|^Timeout/
                  [false, data]
                else
                  [false, [data.chomp, "PlugClean required."].join($/)]
                end
              elsif current_uri.sub(/git::?@/, '') != uri.sub(/git::?@/, '')
                [false, ["Invalid URI: #{current_uri}",
                         "Expected:    #{uri}",
                         "PlugClean required."].join($/)]
              else
                if pull
                  log.call name, 'Updating ...', :update
                  fetch_opt = (tag && File.exist?(File.join(dir, '.git/shallow'))) ? '--depth 99999999' : ''
                  bt.call "#{cd} #{dir} && git fetch #{fetch_opt} #{progress} 2>&1 && git checkout -q #{checkout} 2>&1 && git merge --ff-only #{merge} 2>&1 && #{subm}", name, :update, nil
                else
                  [true, skip]
                end
              end
            else
              d = esc dir.sub(%r{[\\/]+$}, '')
              log.call name, 'Installing ...', :install
              bt.call "git clone #{clone_opt unless tag} #{progress} --recursive #{uri} -b #{checkout} #{d} 2>&1", name, :install, proc {
                FileUtils.rm_rf dir
              }
            end
          mtx.synchronize { VIM::command("let s:update.new['#{name}'] = 1") } if !exists && ok
          log.call name, result, ok
        end
      } if running
    end
  end
  threads.each { |t| t.join rescue nil }
  logh.call
  refresh.kill if refresh
  watcher.kill
EOF
endfunction

function! s:shellesc(arg)
  return '"'.escape(a:arg, '"').'"'
endfunction

function! s:glob_dir(path)
  return map(filter(s:lines(globpath(a:path, '**')), 'isdirectory(v:val)'), 's:dirpath(v:val)')
endfunction

function! s:progress_bar(line, bar, total)
  call setline(a:line, '[' . s:lpad(a:bar, a:total) . ']')
endfunction

function! s:compare_git_uri(a, b)
  let a = substitute(a:a, 'git:\{1,2}@', '', '')
  let b = substitute(a:b, 'git:\{1,2}@', '', '')
  return a ==# b
endfunction

function! s:format_message(bullet, name, message)
  if a:bullet != 'x'
    return [printf('%s %s: %s', a:bullet, a:name, s:lastline(a:message))]
  else
    let lines = map(s:lines(a:message), '"    ".v:val')
    return extend([printf('x %s:', a:name)], lines)
  endif
endfunction

function! s:with_cd(cmd, dir)
  return printf('cd%s %s && %s', s:is_win ? ' /d' : '', s:shellesc(a:dir), a:cmd)
endfunction

function! s:system(cmd, ...)
  try
    let [sh, shrd] = [&shell, &shellredir]
    if !s:is_win
      set shell=sh shellredir=>%s\ 2>&1
    endif
    let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd
    return system(s:is_win ? '('.cmd.')' : cmd)
  finally
    let [&shell, &shellredir] = [sh, shrd]
  endtry
endfunction

function! s:system_chomp(...)
  let ret = call('s:system', a:000)
  return v:shell_error ? '' : substitute(ret, '\n$', '', '')
endfunction

function! s:git_valid(spec, check_branch)
  let ret = 1
  let msg = 'OK'
  if isdirectory(a:spec.dir)
    let result = s:lines(s:system('git rev-parse --abbrev-ref HEAD 2>&1 && git config remote.origin.url', a:spec.dir))
    let remote = result[-1]
    if v:shell_error
      let msg = join([remote, 'PlugClean required.'], "\n")
      let ret = 0
    elseif !s:compare_git_uri(remote, a:spec.uri)
      let msg = join(['Invalid URI: '.remote,
                    \ 'Expected:    '.a:spec.uri,
                    \ 'PlugClean required.'], "\n")
      let ret = 0
    elseif a:check_branch
      let branch = result[0]
      " Check tag
      if has_key(a:spec, 'tag')
        let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir)
        if a:spec.tag !=# tag
          let msg = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.',
                \ (empty(tag) ? 'N/A' : tag), a:spec.tag)
          let ret = 0
        endif
      " Check branch
      elseif a:spec.branch !=# branch
        let msg = printf('Invalid branch: %s (expected: %s). Try PlugUpdate.',
              \ branch, a:spec.branch)
        let ret = 0
      endif
    endif
  else
    let msg = 'Not found'
    let ret = 0
  endif
  return [ret, msg]
endfunction

function! s:rm_rf(dir)
  if isdirectory(a:dir)
    call s:system((s:is_win ? 'rmdir /S /Q ' : 'rm -rf ') . s:shellesc(a:dir))
  endif
endfunction

function! s:clean(force)
  call s:prepare()
  call append(0, 'Searching for unused plugins in '.g:plug_home)
  call append(1, '')

  " List of valid directories
  let dirs = []
  let [cnt, total] = [0, len(g:plugs)]
  for [name, spec] in items(g:plugs)
    if !s:is_managed(name) || s:git_valid(spec, 0)[0]
      call add(dirs, spec.dir)
    endif
    let cnt += 1
    call s:progress_bar(2, repeat('=', cnt), total)
    normal! 2G
    redraw
  endfor

  let allowed = {}
  for dir in dirs
    let allowed[s:dirpath(fnamemodify(dir, ':h:h'))] = 1
    let allowed[dir] = 1
    for child in s:glob_dir(dir)
      let allowed[child] = 1
    endfor
  endfor

  let todo = []
  let found = sort(s:glob_dir(g:plug_home))
  while !empty(found)
    let f = remove(found, 0)
    if !has_key(allowed, f) && isdirectory(f)
      call add(todo, f)
      call append(line('$'), '- ' . f)
      let found = filter(found, 'stridx(v:val, f) != 0')
    end
  endwhile

  normal! G
  redraw
  if empty(todo)
    call append(line('$'), 'Already clean.')
  else
    call inputsave()
    let yes = a:force || (input('Proceed? (y/N) ') =~? '^y')
    call inputrestore()
    if yes
      for dir in todo
        call s:rm_rf(dir)
      endfor
      call append(line('$'), 'Removed.')
    else
      call append(line('$'), 'Cancelled.')
    endif
  endif
  normal! G
endfunction

function! s:upgrade()
  echo 'Downloading the latest version of vim-plug'
  redraw
  let tmp = tempname()
  let new = tmp . '/plug.vim'

  try
    let out = s:system(printf('git clone --depth 1 %s %s', s:plug_src, tmp))
    if v:shell_error
      return s:err('Error upgrading vim-plug: '. out)
    endif

    if readfile(s:me) ==# readfile(new)
      echo 'vim-plug is already up-to-date'
      return 0
    else
      call rename(s:me, s:me . '.old')
      call rename(new, s:me)
      unlet g:loaded_plug
      echo 'vim-plug has been upgraded'
      return 1
    endif
  finally
    silent! call s:rm_rf(tmp)
  endtry
endfunction

function! s:upgrade_specs()
  for spec in values(g:plugs)
    let spec.frozen = get(spec, 'frozen', 0)
  endfor
endfunction

function! s:status()
  call s:prepare()
  call append(0, 'Checking plugins')
  call append(1, '')

  let ecnt = 0
  let unloaded = 0
  let [cnt, total] = [0, len(g:plugs)]
  for [name, spec] in items(g:plugs)
    if has_key(spec, 'uri')
      if isdirectory(spec.dir)
        let [valid, msg] = s:git_valid(spec, 1)
      else
        let [valid, msg] = [0, 'Not found. Try PlugInstall.']
      endif
    else
      if isdirectory(spec.dir)
        let [valid, msg] = [1, 'OK']
      else
        let [valid, msg] = [0, 'Not found.']
      endif
    endif
    let cnt += 1
    let ecnt += !valid
    " `s:loaded` entry can be missing if PlugUpgraded
    if valid && get(s:loaded, name, -1) == 0
      let unloaded = 1
      let msg .= ' (not loaded)'
    endif
    call s:progress_bar(2, repeat('=', cnt), total)
    call append(3, s:format_message(valid ? '-' : 'x', name, msg))
    normal! 2G
    redraw
  endfor
  call setline(1, 'Finished. '.ecnt.' error(s).')
  normal! gg
  setlocal nomodifiable
  if unloaded
    echo "Press 'L' on each line to load plugin, or 'U' to update"
    nnoremap <silent> <buffer> L :call <SID>status_load(line('.'))<cr>
    xnoremap <silent> <buffer> L :call <SID>status_load(line('.'))<cr>
  end
endfunction

function! s:extract_name(str, prefix, suffix)
  return matchstr(a:str, '^'.a:prefix.' \zs[^:]\+\ze:.*'.a:suffix.'$')
endfunction

function! s:status_load(lnum)
  let line = getline(a:lnum)
  let name = s:extract_name(line, '-', '(not loaded)')
  if !empty(name)
    call plug#load(name)
    setlocal modifiable
    call setline(a:lnum, substitute(line, ' (not loaded)$', '', ''))
    setlocal nomodifiable
  endif
endfunction

function! s:status_update() range
  let lines = getline(a:firstline, a:lastline)
  let names = filter(map(lines, 's:extract_name(v:val, "[x-]", "")'), '!empty(v:val)')
  if !empty(names)
    echo
    execute 'PlugUpdate' join(names)
  endif
endfunction

function! s:is_preview_window_open()
  silent! wincmd P
  if &previewwindow
    wincmd p
    return 1
  endif
  return 0
endfunction

function! s:find_name(lnum)
  for lnum in reverse(range(1, a:lnum))
    let line = getline(lnum)
    if empty(line)
      return ''
    endif
    let name = s:extract_name(line, '-', '')
    if !empty(name)
      return name
    endif
  endfor
  return ''
endfunction

function! s:preview_commit()
  if b:plug_preview < 0
    let b:plug_preview = !s:is_preview_window_open()
  endif

  let sha = matchstr(getline('.'), '\(^  \)\@<=[0-9a-z]\{7}')
  if empty(sha)
    return
  endif

  let name = s:find_name(line('.'))
  if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir)
    return
  endif

  execute 'pedit' sha
  wincmd P
  setlocal filetype=git buftype=nofile nobuflisted modifiable
  execute 'silent read !cd' s:shellesc(g:plugs[name].dir) '&& git show --pretty=medium' sha
  normal! gg"_dd
  setlocal nomodifiable
  nnoremap <silent> <buffer> q :q<cr>
  wincmd p
endfunction

function! s:section(flags)
  call search('\(^[x-] \)\@<=[^:]\+:', a:flags)
endfunction

function! s:diff()
  call s:prepare()
  call append(0, 'Collecting updated changes ...')
  normal! gg
  redraw

  let cnt = 0
  for [k, v] in items(g:plugs)
    if !isdirectory(v.dir) || !s:is_managed(k)
      continue
    endif

    let diff = s:system_chomp('git log --pretty=format:"%h %s (%cr)" "HEAD...HEAD@{1}"', v.dir)
    if !empty(diff)
      call append(1, '')
      call append(2, '- '.k.':')
      call append(3, map(s:lines(diff), '"  ". v:val'))
      let cnt += 1
      normal! gg
      redraw
    endif
  endfor

  call setline(1, cnt == 0 ? 'No updates.' : 'Last update:')
  nnoremap <silent> <buffer> <cr> :silent! call <SID>preview_commit()<cr>
  nnoremap <silent> <buffer> o    :silent! call <SID>preview_commit()<cr>
  nnoremap <silent> <buffer> X    :call <SID>revert()<cr>
  normal! gg
  setlocal nomodifiable
  if cnt > 0
    echo "Press 'X' on each block to revert the update"
  endif
endfunction

function! s:revert()
  let name = s:find_name(line('.'))
  if empty(name) || !has_key(g:plugs, name) ||
    \ input(printf('Revert the update of %s? (y/N) ', name)) !~? '^y'
    return
  endif

  call s:system('git reset --hard HEAD@{1} && git checkout '.s:esc(g:plugs[name].branch), g:plugs[name].dir)
  setlocal modifiable
  normal! "_dap
  setlocal nomodifiable
  echo 'Reverted.'
endfunction

function! s:snapshot(...) abort
  let home = get(s:, 'plug_home_org', g:plug_home)
  let [type, var, header] = s:is_win ?
    \ ['dosbatch', '%PLUG_HOME%',
    \   ['@echo off', ':: Generated by vim-plug', ':: '.strftime("%c"), '',
    \    ':: Make sure to PlugUpdate first', '', 'set PLUG_HOME='.home]] :
    \ ['sh', '$PLUG_HOME',
    \   ['#!/bin/sh',  '# Generated by vim-plug', '# '.strftime("%c"), '',
    \    'vim +PlugUpdate +qa', '', 'PLUG_HOME='.s:esc(home)]]

  call s:prepare()
  execute 'setf' type
  call append(0, header)
  call append('$', '')
  1
  redraw

  let dirs = sort(map(values(filter(copy(g:plugs),
        \'has_key(v:val, "uri") && isdirectory(v:val.dir)')), 'v:val.dir'))
  let anchor = line('$') - 1
  for dir in reverse(dirs)
    let sha = s:system_chomp('git rev-parse --short HEAD', dir)
    if !empty(sha)
      call append(anchor, printf('cd %s && git reset --hard %s',
            \ substitute(dir, '^\V'.escape(g:plug_home, '\'), var, ''), sha))
      redraw
    endif
  endfor

  if a:0 > 0
    let fn = expand(a:1)
    let fne = s:esc(fn)
    call writefile(getline(1, '$'), fn)
    if !s:is_win | call s:system('chmod +x ' . fne) | endif
    echo 'Saved to '.a:1
    silent execute 'e' fne
  endif
endfunction

function! s:split_rtp()
  return split(&rtp, '\\\@<!,')
endfunction

let s:first_rtp = s:escrtp(get(s:split_rtp(), 0, ''))
let s:last_rtp  = s:escrtp(get(s:split_rtp(), -1, ''))

if exists('g:plugs')
  let g:plugs_order = get(g:, 'plugs_order', keys(g:plugs))
  call s:upgrade_specs()
  call s:define_commands()
endif

let &cpo = s:cpo_save
unlet s:cpo_save

Deleted vim/.vim/bundle/neobundle.vim/LICENSE-MIT.txt.

1
2
3
4
5
6
7
Copyright (C) 2010 http://github.com/gmarik

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
<
<
<
<
<
<
<














Deleted vim/.vim/bundle/neobundle.vim/README.md.

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
[![Stories in Ready](https://badge.waffle.io/Shougo/neobundle.vim.png)](https://waffle.io/Shougo/neobundle.vim)

## About

NeoBundle is a next generation Vim plugin manager. This plugin is based on
[Vundle](https://github.com/gmarik/vundle), but I renamed and added tons of
features,  while Vundle tends to stay simple.

Requirements:
* Vim 7.2.051 or above.
* "git" command in $PATH (if you want to install github or vim.org plugins)

Recommends:
* [vimproc](https://github.com/Shougo/vimproc.vim) if you want to
  install/update asynchronously in Unite interface.

Note: In :NeoBundleUpdate/:NeoBundleIstall commands, you can parallel update by
vimproc, but you cannot do other work unlike Unite interface.

Note: Neobundle is not a stable plugin manager.  If you want a stable plugin
manager, you should use Vundle plugin.  It well works widely and it is more
tested.  If you want to use extended features, you can use neobundle.

Vundle features: Stable, simple, good for beginners

Neobundle features: Early development (may break compatibility), very complex,
good for plugin power users (for example, 50+ plugins and over 1000 lines
.vimrc, ...)

## How it works

Plugins are defined in NeoBundle by calling `NeoBundle '<plugin repository
location>'`.  NeoBundle assumes Github as the default location for plugins, so
for most plugins you can simply use `NeoBundle 'username/plugin'` rather than
using the absolute URL of the plugin.  These calls should be made in your
.vimrc file.  Once you have defined these, you must call `NeoBundleInstall`,
and NeoBundle will clone all of the repos into the desired folder (generally
`~/.vim/bundle`) and load them into Vim.  If you want to update these
repositories, simply call `NeoBundleUpdate`.

A few other useful commands:
- `:NeoBundleList`          - list configured bundles
- `:NeoBundleInstall(!)`    - install (update) bundles
- `:NeoBundleClean(!)`      - confirm (or auto-approve) removal of unused bundles

Refer to `:help neobundle` for more examples and for a full list of commands.

## Quick start

### 1. Install NeoBundle

#### If you are using Unix/Linux or Mac OS X.

1. Run below script.

     ```
     $ curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh
     ```
Complete.

#### If you want to install manually or you are using Windows.

1. Setup NeoBundle:

     ```
     $ mkdir -p ~/.vim/bundle
     $ git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
     ```

2. Configure bundles:

     Sample `.vimrc`:

     ```vim
     if has('vim_starting')
       set nocompatible               " Be iMproved

       " Required:
       set runtimepath+=~/.vim/bundle/neobundle.vim/
     endif

     " Required:
     call neobundle#begin(expand('~/.vim/bundle/'))

     " Let NeoBundle manage NeoBundle
     " Required:
     NeoBundleFetch 'Shougo/neobundle.vim'

     " My Bundles here:
     " Refer to |:NeoBundle-examples|.
     " Note: You don't set neobundle setting in .gvimrc!

     call neobundle#end()

     " Required:
     filetype plugin indent on

     " If there are uninstalled bundles found on startup,
     " this will conveniently prompt you to install them.
     NeoBundleCheck
     ```

### 2. Install configured bundles

Launch `vim`, run `:NeoBundleInstall` or `:Unite neobundle/install` (required
unite.vim) Or Command run `bin/neoinstall` or `vim +NeoBundleInstall +qall`

## Advantages over Vundle

1. Plugin prefixed command name (:Bundle vs :NeoBundle).
2. Support for vimproc (asynchronous update/install).
3. Support for unite.vim interface (update/install/search).
4. Support for revision locking.
5. Support for multiple version control systems (Subversion/Git).
6. Support for lazy initialization for optimizing startup time.
7. and so on...

## Tips

If you use a single .vimrc across systems where build programs are
named differently (e.g. GNU Make is often `gmake` on non-GNU
systems), the following pattern is useful:

```vim
let g:make = 'gmake'
if system('uname -o') =~ '^GNU/'
        let g:make = 'make'
endif
NeoBundle 'Shougo/vimproc.vim', {'build': {'unix': g:make}}
```
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle.vim.

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
"=============================================================================
" FILE: neobundle.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu at gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
" Version: 3.0, for Vim 7.2
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

" Check 'term' option value.
if exists('g:loaded_neobundle') && &term ==# 'builtin_gui'
  echoerr 'neobundle is initialized in .gvimrc!'
        \' neobundle must be initialized in .vimrc.'
endif

if v:version < 702
  echoerr 'neobundle does not work this version of Vim (' . v:version . ').'
  finish
endif

" Global options definition." "{{{
call neobundle#util#set_default(
      \ 'g:neobundle#log_filename', '', 'g:neobundle_log_filename')
call neobundle#util#set_default(
      \ 'g:neobundle#default_site', 'github', 'g:neobundle_default_site')
call neobundle#util#set_default(
      \ 'g:neobundle#enable_name_conversion', 0)
call neobundle#util#set_default(
      \ 'g:neobundle#default_options', {})
call neobundle#util#set_default(
      \ 'g:neobundle#install_max_processes', 4,
      \ 'g:unite_source_neobundle_install_max_processes')
call neobundle#util#set_default(
      \ 'g:neobundle#install_process_timeout', 120)
"}}}

let g:neobundle#tapped = {}
let g:neobundle#hooks = {}
let s:neobundle_dir = ''
let s:neobundle_runtime_dir = neobundle#util#substitute_path_separator(
      \ fnamemodify(expand('<sfile>'), ':p:h:h'))

command! -nargs=+ NeoBundle
      \ call neobundle#parser#bundle(
      \   substitute(<q-args>, '\s"[^"]\+$', '', ''))

command! -bar NeoBundleCheck
      \ call neobundle#commands#check()

command! -nargs=? -bar
      \ -complete=customlist,neobundle#commands#complete_bundles
      \ NeoBundleCheckUpdate
      \ call neobundle#commands#check_update(<q-args>)

command! -nargs=+ NeoBundleLazy
      \ call neobundle#parser#lazy(
      \   substitute(<q-args>, '\s"[^"]\+$', '', ''))

command! -nargs=+ NeoBundleFetch
      \ call neobundle#parser#fetch(
      \   substitute(<q-args>, '\s"[^"]\+$', '', ''))

command! -nargs=+ NeoBundleRecipe
      \ call neobundle#parser#recipe(
      \   substitute(<q-args>, '\s"[^"]\+$', '', ''))

command! -nargs=1 -complete=dir NeoBundleLocal
      \ call neobundle#local(<q-args>, {})

command! -nargs=+ NeoBundleDirectInstall
      \ call neobundle#parser#direct(
      \   substitute(<q-args>, '\s"[^"]\+$', '', ''))

command! -nargs=* -bar
      \ -complete=customlist,neobundle#commands#complete_lazy_bundles
      \ NeoBundleSource
      \ call neobundle#config#source([<f-args>])

command! -nargs=+ -bar
      \ -complete=customlist,neobundle#commands#complete_bundles
      \ NeoBundleDisable
      \ call neobundle#config#disable(<f-args>)

command! -nargs=? -bang -bar
      \ -complete=customlist,neobundle#commands#complete_bundles
      \ NeoBundleInstall
      \ call neobundle#commands#install('!' == '<bang>', <q-args>)
command! -nargs=? -bang -bar
      \ -complete=customlist,neobundle#commands#complete_bundles
      \ NeoBundleUpdate
      \ call neobundle#commands#install(('!' == '<bang>' ? 2 : 1), <q-args>)

command! -nargs=? -bang -bar
      \ -complete=customlist,neobundle#commands#complete_deleted_bundles
      \ NeoBundleClean
      \ call neobundle#commands#clean('!' == '<bang>', <q-args>)

command! -nargs=+ -bang -bar
      \ -complete=customlist,neobundle#commands#complete_bundles
      \ NeoBundleReinstall
      \ call neobundle#commands#reinstall(<q-args>)

command! -nargs=? -bar
      \ -complete=customlist,neobundle#commands#complete_bundles
      \ NeoBundleGC
      \ call neobundle#commands#gc(<q-args>)

command! -nargs=? -bang -bar
      \ NeoBundleList
      \ call neobundle#commands#list()

command! -bar NeoBundleDocs
      \ call neobundle#commands#helptags(neobundle#config#get_neobundles())

command! -bar NeoBundleLog
      \ echo join(neobundle#installer#get_log(), "\n")

command! -bar NeoBundleUpdatesLog
      \ echo join(neobundle#installer#get_updates_log(), "\n")

command! -bar NeoBundleExtraEdit
      \ execute 'edit' fnameescape(neobundle#get_neobundle_dir()).'/extra_bundles.vim'

command! -bar NeoBundleCount
      \ echo len(neobundle#config#get_neobundles())

command! -bar NeoBundleSaveCache
      \ call neobundle#commands#save_cache()
command! -bar NeoBundleLoadCache
      \ call neobundle#commands#load_cache()
command! -bar NeoBundleClearCache
      \ call neobundle#commands#clear_cache()

command! -nargs=1 -bar
      \ -complete=customlist,neobundle#commands#complete_bundles
      \ NeoBundleRollback
      \ call neobundle#commands#rollback(<f-args>)

function! neobundle#rc(...) "{{{
  let path = (a:0 > 0) ? a:1 :
        \ get(filter(split(globpath(&runtimepath, 'bundle', 1), '\n'),
        \ 'isdirectory(v:val)'), 0, '~/.vim/bundle')
  return neobundle#init#_rc(path, 0)
endfunction"}}}
function! neobundle#begin(...) "{{{
  let path = (a:0 > 0) ? a:1 :
        \ get(filter(split(globpath(&runtimepath, 'bundle', 1), '\n'),
        \ 'isdirectory(v:val)'), 0, '~/.vim/bundle')
  return neobundle#init#_rc(path, 1)
endfunction"}}}
function! neobundle#end() "{{{
  call neobundle#config#final()
endfunction"}}}

function! neobundle#set_neobundle_dir(path)
  let s:neobundle_dir = a:path
endfunction

function! neobundle#get_neobundle_dir()
  return s:neobundle_dir
endfunction

function! neobundle#get_runtime_dir()
  return s:neobundle_runtime_dir
endfunction

function! neobundle#get_tags_dir() "{{{
  let dir = neobundle#get_neobundle_dir() . '/.neobundle/doc'
  if !isdirectory(dir)
    call mkdir(dir, 'p')
  endif
  return dir
endfunction"}}}

function! neobundle#get_rtp_dir()
  return s:neobundle_dir . '/.neobundle'
endfunction

function! neobundle#source(bundle_names)
  return neobundle#config#source(a:bundle_names)
endfunction

function! neobundle#local(localdir, ...)
  return neobundle#parser#local(
        \ a:localdir, get(a:000, 0, {}), get(a:000, 1, []))
endfunction

function! neobundle#exists_not_installed_bundles()
  return !empty(neobundle#get_not_installed_bundles([]))
endfunction

function! neobundle#is_installed(...) "{{{
  return type(get(a:000, 0, [])) == type([]) ?
        \ !empty(neobundle#_get_installed_bundles(get(a:000, 0, []))) :
        \ neobundle#config#is_installed(a:1)
endfunction"}}}

function! neobundle#is_sourced(name)
  return neobundle#config#is_sourced(a:name)
endfunction

function! neobundle#has_cache()
  return filereadable(neobundle#commands#get_cache_file())
endfunction

function! neobundle#has_fresh_cache()
  " Check if the cache file is newer than the vimrc file (if it exists,
  " which is not the case for `vim -u NONE`).
  let cache = neobundle#commands#get_cache_file()
  return filereadable(cache)
        \ && ($MYVIMRC == ''
        \    || getftime(cache) >= getftime($MYVIMRC))
endfunction

function! neobundle#get_not_installed_bundle_names()
  return map(neobundle#get_not_installed_bundles([]), 'v:val.name')
endfunction

function! neobundle#get_not_installed_bundles(bundle_names) "{{{
  let bundles = empty(a:bundle_names) ?
        \ neobundle#config#get_neobundles() :
        \ neobundle#config#fuzzy_search(a:bundle_names)

  call neobundle#installer#_load_install_info(bundles)

  return filter(copy(bundles), "
        \  v:val.rtp != '' && !v:val.local
        \  && !isdirectory(neobundle#util#expand(v:val.path))
        \")
endfunction"}}}

function! neobundle#get(name)
  return neobundle#config#get(a:name)
endfunction
function! neobundle#get_hooks(name)
  return get(neobundle#config#get(a:name), 'hooks', {})
endfunction

function! neobundle#tap(name) "{{{
  let g:neobundle#tapped = neobundle#get(a:name)
  let g:neobundle#hooks = get(neobundle#get(a:name), 'hooks', {})
  return !empty(g:neobundle#tapped)
endfunction"}}}
function! neobundle#untap() "{{{
  let g:neobundle#tapped = {}
  let g:neobundle#hooks = {}
endfunction"}}}

function! neobundle#bundle(arg, ...) "{{{
  let opts = get(a:000, 0, {})
  call map(neobundle#util#convert2list(a:arg),
        \ "neobundle#config#add(neobundle#parser#_init_bundle(
        \     v:val, [deepcopy(opts)]))")
endfunction"}}}

function! neobundle#config(arg, ...) "{{{
  " Use neobundle#tapped or name.
  return type(a:arg) == type({}) ?
        \   neobundle#config#set(g:neobundle#tapped.name, a:arg) :
        \ type(a:arg) == type('') ?
        \   neobundle#config#set(a:arg, a:1) :
        \   map(copy(a:arg), "neobundle#config#set(v:val, deepcopy(a:1))")
endfunction"}}}

function! neobundle#call_hook(hook_name, ...) "{{{
  let bundles = neobundle#util#convert2list(
        \ (empty(a:000) ? neobundle#config#get_neobundles() : a:1))
  let bundles = filter(copy(bundles),
        \ 'has_key(v:val.hooks, a:hook_name) &&
        \  !has_key(v:val.called_hooks, a:hook_name)')

  if a:hook_name ==# 'on_source' || a:hook_name ==# 'on_post_source'
    let bundles = filter(neobundle#config#tsort(filter(bundles,
          \ 'neobundle#config#is_sourced(v:val.name) &&
          \  neobundle#config#is_installed(v:val.name)')),
          \ 'has_key(v:val.hooks, a:hook_name)
          \  && !has_key(v:val.called_hooks, a:hook_name)')
  endif

  for bundle in bundles
    if type(bundle.hooks[a:hook_name]) == type('')
      execute 'source' fnameescape(bundle.hooks[a:hook_name])
    else
      call call(bundle.hooks[a:hook_name], [bundle], bundle)
    endif
    let bundle.called_hooks[a:hook_name] = 1
  endfor
endfunction"}}}

function! neobundle#_get_installed_bundles(bundle_names) "{{{
  let bundles = empty(a:bundle_names) ?
        \ neobundle#config#get_neobundles() :
        \ neobundle#config#search(a:bundle_names)

  return filter(copy(bundles),
        \ 'neobundle#config#is_installed(v:val.name)')
endfunction"}}}

function! neobundle#get_unite_sources()
  return neobundle#autoload#get_unite_sources()
endfunction

let &cpo = s:save_cpo
unlet s:save_cpo
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































































































































































































































































































































































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/autoload.vim.

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
"=============================================================================
" FILE: autoload.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu at gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

function! neobundle#autoload#init()
  let s:active_auto_source = 0

  augroup neobundle
    autocmd FileType *
          \ call neobundle#autoload#filetype()
    autocmd FuncUndefined *
          \ call neobundle#autoload#function()
    autocmd BufNewFile,BufRead *
          \ call neobundle#autoload#filename(expand('<afile>'))
    autocmd InsertEnter *
          \ call neobundle#autoload#insert()
  augroup END

  for event in ['BufRead', 'BufCreate', 'BufEnter', 'BufWinEnter']
    execute 'autocmd neobundle' event "* call neobundle#autoload#explorer(
          \ expand('<afile>'), ".string(event) . ")"
  endfor

  augroup neobundle-focus
    autocmd CursorHold * if s:active_auto_source
          \ | call s:source_focus()
          \ | endif
    autocmd FocusLost * let s:active_auto_source = 1
    autocmd FocusGained * let s:active_auto_source = 0
  augroup END

  call neobundle#autoload#filename(bufname('%'))
endfunction

function! neobundle#autoload#filetype()
  let bundles = filter(neobundle#config#get_autoload_bundles(),
        \ "has_key(v:val.autoload, 'filetypes')")
  for filetype in neobundle#util#get_filetypes()
    call neobundle#config#source_bundles(filter(copy(bundles),"
          \ index(neobundle#util#convert2list(
          \     v:val.autoload.filetypes), filetype) >= 0"))
  endfor
endfunction

function! neobundle#autoload#filename(filename)
  let bundles = filter(neobundle#config#get_autoload_bundles(),
        \ "has_key(v:val.autoload, 'filename_patterns')")
  if !empty(bundles)
    call neobundle#config#source_bundles(filter(copy(bundles),"
          \ len(filter(copy(neobundle#util#convert2list(
          \  v:val.autoload.filename_patterns)),
          \  'a:filename =~? v:val')) > 0"))
  endif
endfunction

function! neobundle#autoload#insert()
  let bundles = filter(neobundle#config#get_autoload_bundles(),
        \ "get(v:val.autoload, 'insert', 0)")
  if !empty(bundles)
    call neobundle#config#source_bundles(bundles)
    doautocmd InsertEnter
  endif
endfunction

function! neobundle#autoload#function()
  let function = expand('<amatch>')
  let function_prefix = get(split(function, '#'), 0, '') . '#'

  let bundles = filter(neobundle#config#get_autoload_bundles(),
        \ "get(v:val.autoload, 'function_prefix', '').'#' ==# function_prefix ||
        \  (has_key(v:val.autoload, 'functions') &&
        \    index(neobundle#util#convert2list(
        \     v:val.autoload.functions), function) >= 0)")
  call neobundle#config#source_bundles(bundles)
endfunction

function! neobundle#autoload#command(command, name, args, bang, line1, line2)
  " Delete dummy commands.
  silent! execute 'delcommand' a:command

  call neobundle#config#source(a:name)

  let range = (a:line1 != a:line2) ? "'<,'>" : ''

  try
    execute range.a:command.a:bang a:args
  catch /^Vim\%((\a\+)\)\=:E481/
    " E481: No range allowed
    execute a:command.a:bang a:args
  endtry
endfunction

function! neobundle#autoload#mapping(mapping, name, mode)
  let cnt = v:count > 0 ? v:count : ''

  let input = s:get_input()

  call neobundle#config#source(a:name)

  if a:mode ==# 'v' || a:mode ==# 'x'
    call feedkeys('gv', 'n')
  elseif a:mode ==# 'o'
    " TODO: omap
    " v:prevcount?
    " Cancel waiting operator mode.
    " call feedkeys("\<C-\\>\<C-n>", 'n')
    call feedkeys("\<Esc>", 'n')
    call feedkeys(v:operator, 'm')
  endif

  call feedkeys(cnt, 'n')

  let mapping = substitute(a:mapping, '<Plug>', "\<Plug>", 'g')
  call feedkeys(mapping . input, 'm')

  return ''
endfunction

function! neobundle#autoload#explorer(path, event)
  if bufnr('%') != expand('<abuf>') || a:path == ''
    return
  endif

  let path = a:path
  " For ":edit ~".
  if fnamemodify(path, ':t') ==# '~'
    let path = '~'
  endif

  let path = neobundle#util#expand(path)
  if !(isdirectory(path) || (!filereadable(path) && path =~ '^\h\w\+://'))
    return
  endif

  let bundles = filter(neobundle#config#get_autoload_bundles(),
        \ "get(v:val.autoload, 'explorer', 0)")
  if !empty(bundles)
    call neobundle#config#source_bundles(bundles)
    execute 'doautocmd' a:event
  endif
endfunction

function! neobundle#autoload#unite_sources(sources)
  let bundles = []
  let sources_bundles = filter(neobundle#config#get_autoload_bundles(),
          \ "has_key(v:val.autoload, 'unite_sources')")
  for source_name in a:sources
    if source_name ==# 'source'
      " In source source, load all sources.
      let bundles += copy(sources_bundles)
    else
      let bundles += filter(copy(sources_bundles),
            \ "index(neobundle#util#convert2list(
            \    v:val.autoload.unite_sources), source_name) >= 0")
    endif
  endfor

  call neobundle#config#source_bundles(neobundle#util#uniq(bundles))
endfunction

function! neobundle#autoload#get_unite_sources()
  let _ = []
  let sources_bundles = filter(neobundle#config#get_autoload_bundles(),
          \ "has_key(v:val.autoload, 'unite_sources')")
  for bundle in sources_bundles
    let _ += neobundle#util#convert2list(
          \ bundle.autoload.unite_sources)
  endfor

  return _
endfunction

function! s:source_focus()
  let bundles = neobundle#util#sort_by(filter(
        \ neobundle#config#get_autoload_bundles(),
        \ "v:val.focus > 0"), 'v:val.focus')
  if empty(bundles)
    augroup neobundle-focus
      autocmd!
    augroup END
    return
  endif

  call neobundle#config#source_bundles([bundles[0]])
  call feedkeys("g\<ESC>", 'n')
endfunction

function! neobundle#autoload#source(bundle_name)
  let bundles = filter(neobundle#config#get_neobundles(),
        \ "has_key(v:val.autoload, 'on_source') &&
        \   index(neobundle#util#convert2list(
        \         v:val.autoload.on_source), a:bundle_name) >= 0 &&
        \   !v:val.sourced && v:val.lazy")
  if !empty(bundles)
    call neobundle#config#source_bundles(bundles)
  endif
endfunction

function! s:get_input()
  let input = ''
  let termstr = "<M-_>"

  call feedkeys(termstr, 'n')

  while 1
    let input .= nr2char(getchar())

    let idx = stridx(input, termstr)
    if idx >= 1
      let input = input[: idx - 1]
      break
    elseif idx == 0
      let input = ''
      break
    endif
  endwhile

  return input
endfunction

function! s:get_lazy_bundles()
  return filter(neobundle#config#get_neobundles(),
        \ "!neobundle#config#is_sourced(v:val.name)
        \ && v:val.rtp != '' && v:val.lazy")
endfunction

let &cpo = s:save_cpo
unlet s:save_cpo

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


























































































































































































































































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/cache.vim.

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
" Utilities for output cache.

let s:save_cpo = &cpo
set cpo&vim

function! neobundle#cache#getfilename(cache_dir, filename)
  return s:_encode_name(a:cache_dir, a:filename)
endfunction

function! neobundle#cache#filereadable(cache_dir, filename)
  let cache_name = s:_encode_name(a:cache_dir, a:filename)
  return filereadable(cache_name)
endfunction

function! neobundle#cache#readfile(cache_dir, filename)
  let cache_name = s:_encode_name(a:cache_dir, a:filename)
  return filereadable(cache_name) ? readfile(cache_name) : []
endfunction

function! neobundle#cache#writefile(cache_dir, filename, list)
  let cache_name = s:_encode_name(a:cache_dir, a:filename)

  call writefile(a:list, cache_name)
endfunction

function! neobundle#cache#deletefile(cache_dir, filename)
  let cache_name = s:_encode_name(a:cache_dir, a:filename)
  return delete(cache_name)
endfunction

function! s:_encode_name(cache_dir, filename)
  " Check cache directory.
  if !isdirectory(a:cache_dir)
    call mkdir(a:cache_dir, 'p')
  endif
  let cache_dir = a:cache_dir
  if cache_dir !~ '/$'
    let cache_dir .= '/'
  endif

  return cache_dir . s:_create_hash(cache_dir, a:filename)
endfunction

function! neobundle#cache#check_old_cache(cache_dir, filename)
  " Check old cache file.
  let cache_name = s:_encode_name(a:cache_dir, a:filename)
  let ret = getftime(cache_name) == -1
        \ || getftime(cache_name) <= getftime(a:filename)
  if ret && filereadable(cache_name)
    " Delete old cache.
    call delete(cache_name)
  endif

  return ret
endfunction

function! s:_create_hash(dir, str)
  if len(a:dir) + len(a:str) < 150
    let hash = substitute(substitute(
          \ a:str, ':', '=-', 'g'), '[/\\]', '=+', 'g')
  elseif exists('*sha256')
    let hash = sha256(a:str)
  else
    " Use simple hash.
    let sum = 0
    for i in range(len(a:str))
      let sum += char2nr(a:str[i]) * (i + 1)
    endfor

    let hash = printf('%x', sum)
  endif

  return hash
endfunction

let &cpo = s:save_cpo
unlet s:save_cpo

" vim:set et ts=2 sts=2 sw=2 tw=0:
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/commands.vim.

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
"=============================================================================
" FILE: commands.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu at gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
" Version: 3.0, for Vim 7.2
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

call neobundle#util#set_default(
      \ 'g:neobundle#rm_command',
      \ (neobundle#util#is_windows() ? 'rmdir /S /Q' : 'rm -rf'),
      \ 'g:neobundle_rm_command')

function! neobundle#commands#install(bang, bundle_names) "{{{
  if neobundle#util#is_sudo()
    call neobundle#util#print_error(
          \ '"sudo vim" is detected. This feature is disabled.')
    return
  endif

  let bundle_dir = neobundle#get_neobundle_dir()
  if !isdirectory(bundle_dir)
    call mkdir(bundle_dir, 'p')
  endif

  let bundle_names = split(a:bundle_names)

  let bundles = !a:bang ?
        \ neobundle#get_not_installed_bundles(bundle_names) :
        \ empty(bundle_names) ?
        \ neobundle#config#get_neobundles() :
        \ neobundle#config#fuzzy_search(bundle_names)
  if empty(bundles)
    call neobundle#installer#error(
          \ '[neobundle/install] Target bundles not found.')
    call neobundle#installer#error(
          \ '[neobundle/install] You may have used the wrong bundle name,'.
          \ ' or all of the bundles are already installed.')
    return
  endif

  call sort(bundles, 's:cmp_vimproc')

  call neobundle#installer#_load_install_info(bundles)

  call neobundle#installer#clear_log()

  call neobundle#installer#error(
        \ '[neobundle/install] Update started: ' .
        \     strftime('(%Y/%m/%d %H:%M:%S)'))

  let reinstall_bundles =
        \ neobundle#installer#get_reinstall_bundles(bundles)
  if !empty(reinstall_bundles)
    call neobundle#installer#reinstall(reinstall_bundles)
  endif

  let [installed, errored] = s:install(a:bang, bundles)
  if !has('vim_starting')
    redraw!
  endif

  call neobundle#installer#update(installed)

  call neobundle#installer#log(
        \ "[neobundle/install] Installed/Updated bundles:\n".
        \ join((empty(installed) ?
        \   ['no new bundles installed'] :
        \   map(copy(installed), 'v:val.name')),"\n"))

  if !empty(errored)
    call neobundle#installer#log(
          \ "[neobundle/install] Error installing bundles:\n".join(
          \ map(copy(errored), 'v:val.name')), "\n")
    call neobundle#installer#log(
          \ 'Please read the error message log with the :message command.')
  endif

  call neobundle#installer#error(
        \ '[neobundle/install] Update done: ' .
        \     strftime('(%Y/%m/%d %H:%M:%S)'))
endfunction"}}}

function! neobundle#commands#helptags(bundles) "{{{
  if neobundle#util#is_sudo()
    call neobundle#util#print_error(
          \ '"sudo vim" is detected. This feature is disabled.')
    return
  endif

  let help_dirs = filter(copy(a:bundles), 's:has_doc(v:val.rtp)')

  if !empty(help_dirs)
    call s:update_tags()

    if !has('vim_starting')
      call neobundle#installer#log(
            \ '[neobundle/install] Helptags: done. '
            \ .len(help_dirs).' bundles processed')
    endif
  endif

  return help_dirs
endfunction"}}}

function! neobundle#commands#check() "{{{
  if neobundle#installer#get_tags_info() !=#
        \ sort(map(neobundle#config#get_neobundles(), 'v:val.name'))
    " Recache automatically.
    NeoBundleDocs
  endif

  if !neobundle#exists_not_installed_bundles()
    return
  endif

  if has('gui_running') && has('vim_starting')
    " Note: :NeoBundleCheck cannot work in GUI startup.
    autocmd neobundle VimEnter * NeoBundleCheck
  else
    echomsg 'Not installed bundles: '
          \ string(neobundle#get_not_installed_bundle_names())
    if confirm('Install bundles now?', "yes\nNo", 2) == 1
      call neobundle#commands#install(0, '')
    endif
    echo ''
  endif
endfunction"}}}

function! neobundle#commands#check_update(bundle_names) "{{{
  let bundle_names = split(a:bundle_names)

  " Set context.
  let context = {}
  let context.source__updated_bundles = []
  let context.source__processes = []
  let context.source__number = 0
  let context.source__bundles = empty(bundle_names) ?
        \ neobundle#config#get_neobundles() :
        \ neobundle#config#fuzzy_search(bundle_names)
  let context.source__max_bundles =
        \ len(context.source__bundles)
  while 1
    while context.source__number < context.source__max_bundles
          \ && len(context.source__processes) <
          \      g:neobundle#install_max_processes

      call s:check_update_init(
            \ context.source__bundles[context.source__number],
            \ context, 0)
    endwhile

    for process in context.source__processes
      call s:check_update_process(context, process, 0)
    endfor

    " Filter eof processes.
    call filter(context.source__processes, '!v:val.eof')

    if empty(context.source__processes)
          \ && context.source__number == context.source__max_bundles
      break
    endif
  endwhile

  let bundles = map(context.source__updated_bundles, 'v:val.name')
  redraw!

  if !empty(bundles)
    echomsg 'Updates available bundles: '
          \ string(bundles)

    if confirm('Update bundles now?', "yes\nNo", 2) == 1
      call neobundle#commands#install(1, join(bundles))
    endif
  endif
endfunction"}}}

function! neobundle#commands#clean(bang, ...) "{{{
  if neobundle#util#is_sudo()
    call neobundle#util#print_error(
          \ '"sudo vim" is detected. This feature is disabled.')
    return
  endif

  if get(a:000, 0, '') == ''
    let all_dirs = filter(split(neobundle#util#substitute_path_separator(
          \ globpath(neobundle#get_neobundle_dir(), '*', 1)), "\n"),
          \ 'isdirectory(v:val)')
    let bundle_dirs = map(copy(neobundle#config#get_neobundles()),
          \ "(v:val.script_type != '') ?
          \  v:val.base . '/' . v:val.directory : v:val.path")
    let x_dirs = filter(all_dirs,
          \ "!neobundle#config#is_installed(fnamemodify(v:val, ':t'))
          \ && index(bundle_dirs, v:val) < 0 && v:val !~ '/neobundle.vim$'")
  else
    let x_dirs = map(neobundle#config#search_simple(a:000), 'v:val.path')
    if len(x_dirs) > len(a:000)
      " Check bug.
      call neobundle#util#print_error('Bug: x_dirs = %s but arguments is %s',
            \ string(x_dirs), map(copy(a:000), 'v:val.path'))
      return
    endif
  endif

  if empty(x_dirs)
    call neobundle#installer#log('[neobundle/install] All clean!')
    return
  end

  if a:bang || s:check_really_clean(x_dirs)
    if !has('vim_starting')
      redraw
    endif
    let cmdline = join(map(copy(x_dirs), '"\"" . v:val . "\""'), ' ')
    if neobundle#util#is_windows()
      " Note: In rm command, must use "\" instead of "/".
      let cmdline = substitute(cmdline, '/', '\\\\', 'g')
    endif

    " Use system instead of vimproc#system()
    let result = system(g:neobundle#rm_command . ' ' . cmdline)
    if v:shell_error
      call neobundle#installer#error(result)
    endif

    for dir in x_dirs
      call neobundle#config#rm(dir)
    endfor

    call s:update_tags()
  endif
endfunction"}}}

function! neobundle#commands#reinstall(bundle_names) "{{{
  let bundles = neobundle#config#search_simple(split(a:bundle_names))

  if empty(bundles)
    call neobundle#installer#error(
          \ '[neobundle/install] Target bundles not found.')
    call neobundle#installer#error(
          \ '[neobundle/install] You may have used the wrong bundle name.')
    return
  endif

  call neobundle#installer#reinstall(bundles)
endfunction"}}}

function! neobundle#commands#gc(bundle_names) "{{{
  let bundle_names = split(a:bundle_names)
  let number = 0
  let bundles = empty(bundle_names) ?
        \ neobundle#config#get_neobundles() :
        \ neobundle#config#search_simple(bundle_names)
  let max = len(bundles)
  for bundle in bundles

    let number += 1

    let type = neobundle#config#get_types(bundle.type)
    if empty(type) || !has_key(type, 'get_gc_command')
      continue
    endif

    let cmd = type.get_gc_command(bundle)

    let cwd = getcwd()
    try
      if isdirectory(bundle.path)
        " Cd to bundle path.
        call neobundle#util#cd(bundle.path)
      endif

      redraw
      call neobundle#util#redraw_echo(
            \ printf('(%'.len(max).'d/%d): |%s| %s',
            \ number, max, bundle.name, cmd))
      let result = neobundle#util#system(cmd)
      redraw
      call neobundle#util#redraw_echo(result)
      let status = neobundle#util#get_last_status()
    finally
      if isdirectory(cwd)
        call neobundle#util#cd(cwd)
      endif
    endtry

    if status
      call neobundle#installer#error(bundle.path, 0)
      call neobundle#installer#error(result, 0)
    endif
  endfor
endfunction"}}}

function! neobundle#commands#rollback(bundle_name) "{{{
  let bundle = get(neobundle#config#search_simple([a:bundle_name]), 0, {})
  if empty(bundle) || !isdirectory(bundle.path)
    call neobundle#util#print_error(
          \ '[neobundle] ' . a:bundle_name . ' is not found.')
    return
  endif

  call neobundle#installer#_load_install_info([bundle])

  if len(bundle.revisions) <= 1
    call neobundle#util#print_error(
          \ '[neobundle] No revision information.')
    return
  endif

  let cnt = 1
  let selections = []
  let revisions = neobundle#util#sort_by(
        \ items(bundle.revisions), 'v:val[0]')
  for [date, revision] in revisions
    call add(selections, cnt . strftime(
          \ '. %Y/%D/%m %H:%M:%S ', date) . ' ' . revision)
    let cnt += 1
  endfor

  let select = inputlist(['Select revision:'] + selections)
  if select == ''
    return
  endif

  redraw

  let revision = revisions[select-1][1]
  call neobundle#installer#log('[neobundle] ' . a:bundle_name .
        \ ' rollbacked to ' . revision)

  let cwd = getcwd()
  let revision_save = bundle.rev
  try
    let bundle.rev = revision
    let type = neobundle#config#get_types(bundle.type)
    if !has_key(type, 'get_revision_lock_command')
      call neobundle#util#print_error(
            \ '[neobundle] ' . a:bundle_name . ' is not supported this feature.')
      return
    endif

    let cmd = type.get_revision_lock_command(bundle)

    call neobundle#util#cd(bundle.path)
    call neobundle#util#system(cmd)
  finally
    if isdirectory(cwd)
      call neobundle#util#cd(cwd)
    endif
    let bundle.rev = revision_save
  endtry
endfunction"}}}

function! neobundle#commands#list() "{{{
  for bundle in neobundle#config#get_neobundles()
    echo (neobundle#is_sourced(bundle.name) ? ' ' :
          \ neobundle#is_installed(bundle.name) ? '#' : 'X')
          \ . ' ' . bundle.name
  endfor
endfunction"}}}

function! neobundle#commands#complete_bundles(arglead, cmdline, cursorpos) "{{{
  return filter(map(neobundle#config#get_neobundles(), 'v:val.name'),
        \ 'stridx(tolower(v:val), tolower(a:arglead)) >= 0')
endfunction"}}}

function! neobundle#commands#complete_lazy_bundles(arglead, cmdline, cursorpos) "{{{
  return filter(map(filter(neobundle#config#get_neobundles(),
        \ "!neobundle#config#is_sourced(v:val.name) && v:val.rtp != ''"), 'v:val.name'),
        \ 'stridx(tolower(v:val), tolower(a:arglead)) == 0')
endfunction"}}}

function! neobundle#commands#complete_deleted_bundles(arglead, cmdline, cursorpos) "{{{
  let bundle_dirs = map(copy(neobundle#config#get_neobundles()), 'v:val.path')
  let all_dirs = split(neobundle#util#substitute_path_separator(
        \ globpath(neobundle#get_neobundle_dir(), '*', 1)), "\n")
  let x_dirs = filter(all_dirs, 'index(bundle_dirs, v:val) < 0')

  return filter(map(x_dirs, "fnamemodify(v:val, ':t')"),
        \ 'stridx(v:val, a:arglead) == 0')
endfunction"}}}

function! neobundle#commands#get_cache_file() "{{{
  return neobundle#get_rtp_dir() . '/cache.vim'
endfunction"}}}

function! neobundle#commands#save_cache() "{{{
  if !has('vim_starting')
    " Ignore if loaded
    return
  endif

  let cache = neobundle#commands#get_cache_file()
  let bundles = deepcopy(neobundle#config#get_neobundles())
  " Clear hooks.  Because, VimL cannot save functions in JSON.
  for bundle in bundles
    let bundle.hooks = {}
  endfor

  call writefile([s:get_cache_version(), string(bundles)], cache)
endfunction"}}}
function! neobundle#commands#load_cache() "{{{
  let cache = neobundle#commands#get_cache_file()
  if !filereadable(cache)
    return
  endif

  try
    let list = readfile(cache)
    let ver = list[0]
    sandbox let bundles = eval(list[1])
    if ver !=# s:get_cache_version()
          \ || type(bundles) != type([])
      return
    endif

    for bundle in bundles
      call neobundle#config#add(bundle)
    endfor
  catch
    call neobundle#util#print_error(
          \ '[neobundle] Error occured while loading cache : ' . v:errmsg)
  endtry
endfunction"}}}
function! neobundle#commands#clear_cache() "{{{
  let cache = neobundle#commands#get_cache_file()
  if !filereadable(cache)
    return
  endif

  call delete(cache)
endfunction"}}}

function! s:install(bang, bundles) "{{{
  " Set context.
  let context = {}
  let context.source__bang = a:bang
  let context.source__synced_bundles = []
  let context.source__errored_bundles = []
  let context.source__processes = []
  let context.source__number = 0
  let context.source__bundles = a:bundles
  let context.source__max_bundles =
        \ len(context.source__bundles)

  while 1
    while context.source__number < context.source__max_bundles
          \ && len(context.source__processes) <
          \      g:neobundle#install_max_processes

      call neobundle#installer#sync(
            \ context.source__bundles[context.source__number],
            \ context, 0)
    endwhile

    for process in context.source__processes
      call neobundle#installer#check_output(context, process, 0)
    endfor

    " Filter eof processes.
    call filter(context.source__processes, '!v:val.eof')

    if empty(context.source__processes)
          \ && context.source__number == context.source__max_bundles
      break
    endif
  endwhile

  return [context.source__synced_bundles,
        \ context.source__errored_bundles]
endfunction"}}}

function! s:check_update_init(bundle, context, is_unite) "{{{
  let a:context.source__number += 1

  let num = a:context.source__number
  let max = a:context.source__max_bundles

  let type = neobundle#config#get_types(a:bundle.type)
  let cmd = has_key(type, 'get_revision_remote_command') ?
        \ type.get_revision_remote_command(a:bundle) : ''
  if cmd == '' || !isdirectory(a:bundle.path)
    return
  endif

  let message = printf('(%'.len(max).'d/%d): |%s| %s',
        \ num, max, a:bundle.name, cmd)

  call neobundle#installer#log(
        \ '[neobundle/check] ' . message, a:is_unite)

  let cwd = getcwd()
  try
    " Cd to bundle path.
    call neobundle#util#cd(a:bundle.path)

    let process = {
          \ 'number' : num,
          \ 'bundle' : a:bundle,
          \ 'output' : '',
          \ 'status' : -1,
          \ 'eof' : 0,
          \ 'start_time' : localtime(),
          \ }
    if neobundle#util#has_vimproc()
      let process.proc = vimproc#pgroup_open(vimproc#util#iconv(
            \            cmd, &encoding, 'char'), 0, 2)

      " Close handles.
      call process.proc.stdin.close()
      " call process.proc.stderr.close()
    else
      let process.output = neobundle#util#system(cmd)
      let process.status = neobundle#util#get_last_status()
    endif
  finally
    if isdirectory(cwd)
      call neobundle#util#cd(cwd)
    endif
  endtry

  call add(a:context.source__processes, process)
endfunction "}}}

function! s:check_update_process(context, process, is_unite) "{{{
  if neobundle#util#has_vimproc() && has_key(a:process, 'proc')
    let is_timeout = (localtime() - a:process.start_time)
          \             >= g:neobundle#install_process_timeout
    let a:process.output .= vimproc#util#iconv(
          \ a:process.proc.stdout.read(-1, 300), 'char', &encoding)
    if !a:process.proc.stdout.eof && !is_timeout
      return
    endif
    call a:process.proc.stdout.close()

    let [_, status] = a:process.proc.waitpid()
  else
    let is_timeout = 0
    let status = a:process.status
  endif

  let num = a:process.number
  let max = a:context.source__max_bundles
  let bundle = a:process.bundle

  let cwd = getcwd()

  let remote_rev = matchstr(a:process.output, '^\S\+')

  let revision_save = bundle.rev
  try
    " Get HEAD revision
    let rev = neobundle#installer#get_revision_number(bundle)
  finally
    let bundle.rev = revision_save
  endtry

  if is_timeout || status
    let message = printf('[neobundle/install] (%'.len(max).'d/%d): |%s| %s',
          \ num, max, bundle.name, 'Error')
    call neobundle#installer#log(message, a:is_unite)
    call neobundle#installer#error(bundle.path, a:is_unite)
    call neobundle#installer#error(
          \ (is_timeout ? 'Process timeout.' :
          \    split(a:process.output, '\n')), a:is_unite)
  elseif remote_rev != '' && remote_rev !=# rev
    call add(a:context.source__updated_bundles,
          \ bundle)
  endif

  let a:process.eof = 1
endfunction"}}}

function! s:check_really_clean(dirs) "{{{
  echo join(a:dirs, "\n")

  return input('Are you sure you want to remove '
        \        .len(a:dirs).' bundles? [y/n] : ') =~? 'y'
endfunction"}}}

function! s:update_tags() "{{{
  let bundles = [{ 'rtp' : neobundle#get_runtime_dir()}]
        \ + neobundle#config#get_neobundles()
  call neobundle#util#copy_bundle_files(bundles, 'doc')

  call neobundle#util#writefile('tags_info',
        \ sort(map(neobundle#config#get_neobundles(), 'v:val.name')))

  try
    execute 'helptags' fnameescape(neobundle#get_tags_dir())
  catch
    call neobundle#installer#error('Error generating helptags:')
    call neobundle#installer#error(v:exception)
  endtry
endfunction"}}}

function! s:has_doc(path) "{{{
  return a:path != '' &&
        \ isdirectory(a:path.'/doc')
        \   && (!filereadable(a:path.'/doc/tags')
        \       || filewritable(a:path.'/doc/tags'))
        \   && (!filereadable(a:path.'/doc/tags-??')
        \       || filewritable(a:path.'/doc/tags-??'))
        \   && (glob(a:path.'/doc/*.txt') != ''
        \       || glob(a:path.'/doc/*.??x') != '')
endfunction"}}}

" Vimproc is first.
function! s:cmp_vimproc(a, b) "{{{
  return !(a:a.name ==# 'vimproc' || a:a.name ==# 'vimproc.vim')
endfunction"}}}

function! s:get_cache_version()"{{{
  return str2nr(printf('%02d%02d', 1, 0))
endfunction "}}}

let &cpo = s:save_cpo
unlet s:save_cpo
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/config.vim.

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
"=============================================================================
" FILE: config.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu at gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

if !exists('s:neobundles')
  let s:is_block = 0
  let s:neobundles = {}
  let s:sourced_neobundles = {}
  let neobundle#tapped = {}
  let s:lazy_rtps = []
endif

function! neobundle#config#init(is_block) "{{{
  filetype off

  for bundle in values(s:neobundles)
    if (!bundle.resettable && !bundle.lazy) ||
          \ (bundle.sourced && bundle.lazy
          \ && neobundle#is_sourced(bundle.name))
      call neobundle#config#rtp_add(bundle)
    elseif bundle.resettable
      " Reset.
      call neobundle#config#rtp_rm(bundle)

      call remove(s:neobundles, bundle.name)
    endif
  endfor

  " Load extra bundles configuration.
  call neobundle#config#load_extra_bundles()

  augroup neobundle
    autocmd VimEnter * call s:on_vim_enter()
  augroup END

  let s:is_block = a:is_block
  let s:lazy_rtps = []
endfunction"}}}
function! neobundle#config#final() "{{{
  " Join to the tail in runtimepath.
  let rtps = neobundle#util#split_rtp(&runtimepath)
  let index = index(rtps, neobundle#get_rtp_dir())
  for rtp in filter(s:lazy_rtps, 'isdirectory(v:val)')
    call insert(rtps, rtp, index)
    let index += 1

    if isdirectory(rtp.'/after')
      call add(rtps, fnameescape(rtp.'/after'))
    endif
  endfor
  let &runtimepath = neobundle#util#join_rtp(rtps, &runtimepath, '')

  let s:is_block = 0
endfunction"}}}

function! neobundle#config#get(name) "{{{
  return get(s:neobundles, a:name, {})
endfunction"}}}

function! neobundle#config#get_neobundles() "{{{
  return values(s:neobundles)
endfunction"}}}

function! neobundle#config#get_autoload_bundles() "{{{
  return filter(values(s:neobundles),
        \ "!v:val.sourced && v:val.lazy")
endfunction"}}}

function! neobundle#config#source_bundles(bundles) "{{{
  if !empty(a:bundles)
    call neobundle#config#source(map(copy(a:bundles),
          \ "type(v:val) == type({}) ? v:val.name : v:val"))
  endif
endfunction"}}}

function! neobundle#config#check_not_exists(names, ...) "{{{
  " For infinite loop.
  let self = get(a:000, 0, [])

  let _ = map(neobundle#get_not_installed_bundles(a:names), 'v:val.name')
  for bundle in map(filter(copy(a:names),
        \ 'index(self, v:val) < 0 && has_key(s:neobundles, v:val)'),
        \ 's:neobundles[v:val]')
    call add(self, bundle.name)

    if !empty(bundle.depends)
      let _ += neobundle#config#check_not_exists(
            \ map(copy(bundle.depends), 'v:val.name'), self)
    endif
  endfor

  if len(_) > 1
    let _ = neobundle#util#uniq(_)
  endif

  return _
endfunction"}}}

function! neobundle#config#source(names, ...) "{{{
  let is_force = get(a:000, 0, 1)

  let names = neobundle#util#convert2list(a:names)
  let bundles = empty(names) ?
        \ neobundle#config#get_neobundles() :
        \ neobundle#config#search(names)

  let rtps = neobundle#util#split_rtp(&runtimepath)
  let bundles = filter(bundles,
        \ "!neobundle#config#is_sourced(v:val.name) ||
        \ (v:val.rtp != '' && index(rtps, v:val.rtp) < 0)")
  if empty(bundles)
    return
  endif

  let filetype_out = ''
  redir => filetype_out
  silent filetype
  redir END

  redir => filetype_before
  silent autocmd FileType
  redir END

  let reset_ftplugin = 0
  for bundle in bundles
    let bundle.sourced = 1
    let bundle.disabled = 0

    let s:sourced_neobundles[bundle.name] = 1

    if !empty(bundle.dummy_mappings)
      for [mode, mapping] in bundle.dummy_mappings
        silent! execute mode.'unmap' mapping
      endfor
      let bundle.dummy_mappings = []
    endif

    call neobundle#config#rtp_add(bundle)

    if exists('g:loaded_neobundle') || is_force
      call s:on_source(bundle)
    endif

    call neobundle#autoload#source(bundle.name)

    if !reset_ftplugin
      let reset_ftplugin = s:is_reset_ftplugin(&filetype, bundle.rtp)
    endif
  endfor

  redir => filetype_after
  silent autocmd FileType
  redir END

  if reset_ftplugin
    call s:reset_ftplugin(filetype_out)
  elseif filetype_before !=# filetype_after
    execute 'doautocmd FileType' &filetype
  endif

  if exists('g:loaded_neobundle')
    call neobundle#call_hook('on_post_source', bundles)
  endif
endfunction"}}}

function! neobundle#config#disable(arg) "{{{
  let bundle_names = neobundle#config#search(split(a:arg))
  if empty(bundle_names)
    return
  endif

  for bundle in bundle_names
    call neobundle#config#rtp_rm(bundle)
    let bundle.sourced = 0
    let bundle.disabled = 1
  endfor
endfunction"}}}

function! neobundle#config#is_sourced(name) "{{{
  return get(neobundle#config#get(a:name), 'sourced', 0)
endfunction"}}}

function! neobundle#config#is_installed(name) "{{{
  return isdirectory(get(neobundle#config#get(a:name), 'path', ''))
endfunction"}}}

function! neobundle#config#rm(path) "{{{
  for bundle in filter(neobundle#config#get_neobundles(),
        \ 'v:val.path ==# a:path')
    call neobundle#config#rtp_rm(bundle)
    call remove(s:neobundles, bundle.name)
  endfor
endfunction"}}}

function! neobundle#config#get_types(...) "{{{
  let type = get(a:000, 0, '')

  if type ==# 'git'
    if !exists('s:neobundle_type_git')
      let s:neobundle_type_git = neobundle#types#git#define()
    endif

    return s:neobundle_type_git
  endif

  if !exists('s:neobundle_types')
    " Load neobundle types.
    let s:neobundle_types = []
    for list in map(split(globpath(&runtimepath,
          \ 'autoload/neobundle/types/*.vim', 1), '\n'),
          \ "neobundle#util#convert2list(
          \    neobundle#types#{fnamemodify(v:val, ':t:r')}#define())")
      let s:neobundle_types += list
    endfor

    let s:neobundle_types = neobundle#util#uniq(
          \ s:neobundle_types, 'v:val.name')
  endif

  return (type == '') ? s:neobundle_types :
        \ get(filter(copy(s:neobundle_types), 'v:val.name ==# type'), 0, {})
endfunction"}}}

function! neobundle#config#rtp_rm_all_bundles() "{{{
  call filter(values(s:neobundles), 'neobundle#config#rtp_rm(v:val)')
endfunction"}}}

function! neobundle#config#rtp_rm(bundle) "{{{
  execute 'set rtp-='.fnameescape(a:bundle.rtp)
  if isdirectory(a:bundle.rtp.'/after')
    execute 'set rtp-='.fnameescape(a:bundle.rtp.'/after')
  endif
endfunction"}}}

function! neobundle#config#rtp_add(bundle) abort "{{{
  if has_key(s:neobundles, a:bundle.name)
    call neobundle#config#rtp_rm(s:neobundles[a:bundle.name])
  endif

  if s:is_block
    " Add rtp lazily.
    call add(s:lazy_rtps, a:bundle.rtp)
    return
  endif

  let rtp = a:bundle.rtp
  if isdirectory(rtp)
    " Join to the tail in runtimepath.
    let rtps = neobundle#util#split_rtp(&runtimepath)
    let &runtimepath = neobundle#util#join_rtp(
          \ insert(rtps, rtp, index(rtps, neobundle#get_rtp_dir())),
          \ &runtimepath, rtp)
  endif
  if isdirectory(rtp.'/after')
    execute 'set rtp+='.fnameescape(rtp.'/after')
  endif
endfunction"}}}

function! neobundle#config#search(bundle_names, ...) "{{{
  if empty(a:bundle_names)
    return []
  endif

  " For infinite loop.
  let self = get(a:000, 0, [])

  let _ = []
  let bundles = len(a:bundle_names) != 1 ?
        \ filter(neobundle#config#get_neobundles(),
        \ 'index(a:bundle_names, v:val.name) >= 0 &&
        \  (empty(self) || index(self, v:val.name) < 0)') :
        \ has_key(s:neobundles, a:bundle_names[0]) ?
        \     [s:neobundles[a:bundle_names[0]]] : []
  for bundle in bundles
    call add(self, bundle.name)

    if !empty(bundle.depends)
      let _ += neobundle#config#search(
            \ map(copy(bundle.depends), 'v:val.name'), self)
    endif
    call add(_, bundle)
  endfor

  if len(_) > 1
    let _ = neobundle#util#uniq(_)
  endif

  return _
endfunction"}}}

function! neobundle#config#search_simple(bundle_names) "{{{
  return filter(neobundle#config#get_neobundles(),
        \ 'index(a:bundle_names, v:val.name) >= 0')
endfunction"}}}

function! neobundle#config#fuzzy_search(bundle_names) "{{{
  let bundles = []
  for name in a:bundle_names
    let bundles += filter(neobundle#config#get_neobundles(),
          \ 'stridx(v:val.name, name) >= 0')
  endfor

  let _ = []
  for bundle in bundles
    if !empty(bundle.depends)
      let _ += neobundle#config#search(
            \ map(copy(bundle.depends), 'v:val.name'))
    endif
    call add(_, bundle)
  endfor

  if len(_) > 1
    let _ = neobundle#util#uniq(_)
  endif

  return _
endfunction"}}}

function! neobundle#config#load_extra_bundles() "{{{
  let path = neobundle#get_neobundle_dir() . '/extra_bundles.vim'

  if filereadable(path)
    source `=path`
  endif
endfunction"}}}

function! neobundle#config#save_direct(arg) "{{{
  if neobundle#util#is_sudo()
    call neobundle#util#print_error(
          \ '"sudo vim" is detected. This feature is disabled.')
    return
  endif

  let path = neobundle#get_neobundle_dir() . '/extra_bundles.vim'
  let bundles = filereadable(path) ? readfile(path) : []
  call writefile(add(bundles, 'NeoBundle ' . a:arg), path)
endfunction"}}}

function! neobundle#config#set(name, dict) "{{{
  let bundle = neobundle#config#get(a:name)
  if empty(bundle)
    call neobundle#util#print_error(
          \ '[neobundle] Plugin name "' . a:name . '" is not defined.')
    return
  endif

  let bundle = neobundle#init#_bundle(extend(bundle, a:dict))
  if bundle.lazy && bundle.sourced &&
        \ !get(s:sourced_neobundles, bundle.name, 0)
    " Remove from runtimepath.
    call neobundle#config#rtp_rm(bundle)
    let bundle.sourced = 0
  endif

  call neobundle#config#add(bundle, 1)
endfunction"}}}

function! neobundle#config#add(bundle, ...) "{{{
  if empty(a:bundle)
    return
  endif

  let bundle = a:bundle
  let is_force = get(a:000, 0, bundle.local)

  if !is_force && !bundle.overwrite &&
        \     has_key(s:neobundles, bundle.name)
    return
  endif

  let prev_bundle = get(s:neobundles, bundle.name, {})

  if get(prev_bundle, 'local', 0) && !bundle.local
    return
  endif

  if !empty(prev_bundle)
    call neobundle#config#rtp_rm(prev_bundle)
  endif
  let s:neobundles[bundle.name] = bundle

  if bundle.disabled
        \ || (bundle.gui && !has('gui_running'))
        \ || (bundle.terminal && has('gui_running'))
        \ || (bundle.vim_version != ''
        \     && s:check_version(bundle.vim_version))
        \ || (!empty(bundle.external_commands)
        \     && s:check_external_commands(bundle))
    " Ignore load.
    return
  endif

  if !empty(bundle.depends)
    call s:add_depends(bundle)
  endif

  if !bundle.lazy && bundle.rtp != ''
    if !has('vim_starting')
      " Load automatically.
      call neobundle#config#source(bundle.name, bundle.force)
    else
      let bundle.sourced = 1
      call neobundle#config#rtp_add(bundle)

      if bundle.force
        runtime! plugin/**/*.vim
      endif
    endif
  elseif bundle.lazy
    call s:add_lazy(bundle)
  endif

  if !is_force && bundle.overwrite &&
        \ !empty(prev_bundle) && prev_bundle.overwrite &&
        \ bundle.orig_arg !=# prev_bundle.orig_arg &&
        \ prev_bundle.resettable && prev_bundle.overwrite
    " echomsg string(bundle.orig_arg)
    " echomsg string(prev_bundle.orig_arg)
    " Warning.
    call neobundle#util#print_error(
          \ '[neobundle] Plugin "' . bundle.name .
          \ '" appears to be defined multiple times in .vimrc.')
  endif
endfunction"}}}

function! neobundle#config#tsort(bundles) "{{{
  let sorted = []
  let mark = {}
  for target in a:bundles
    call s:tsort_impl(target, a:bundles, mark, sorted)
  endfor

  return sorted
endfunction"}}}

function! neobundle#config#get_lazy_rtps() "{{{
  return s:lazy_rtps
endfunction"}}}

function! s:tsort_impl(target, bundles, mark, sorted) "{{{
  if has_key(a:mark, a:target.name)
    return
  endif

  let a:mark[a:target.name] = 1
  for depend in get(a:target, 'depends', [])
    call s:tsort_impl(get(s:neobundles, depend.name, depend),
          \ a:bundles, a:mark, a:sorted)
  endfor

  call add(a:sorted, a:target)
endfunction"}}}

function! s:on_vim_enter() "{{{
  " Call hooks.
  call neobundle#call_hook('on_source')
  call neobundle#call_hook('on_post_source')
endfunction"}}}

function! s:check_version(min_version) "{{{
  let versions = split(a:min_version, '\.')
  let major = get(versions, 0, 0)
  let minor = get(versions, 1, 0)
  let patch = get(versions, 2, 0)
  let min_version = major * 100 + minor
  return v:version < min_version ||
        \ (patch != 0 && v:version == min_version && !has('patch'.patch))
endfunction"}}}

function! s:check_external_commands(bundle) "{{{
  " Environment check.
  let external_commands = a:bundle.external_commands
  if type(external_commands) == type([])
        \ || type(external_commands) == type('')
    let commands = external_commands
  elseif neobundle#util#is_windows() && has_key(external_commands, 'windows')
    let commands = external_commands.windows
  elseif neobundle#util#is_mac() && has_key(external_commands, 'mac')
    let commands = external_commands.mac
  elseif neobundle#util#is_cygwin() && has_key(external_commands, 'cygwin')
    let commands = external_commands.cygwin
  elseif !neobundle#util#is_windows() && has_key(external_commands, 'unix')
    let commands = external_commands.unix
  elseif has_key(external_commands, 'others')
    let commands = external_commands.others
  else
    " Invalid.
    return 0
  endif

  for command in neobundle#util#convert2list(commands)
    if !executable(command)
      return 1
    endif
  endfor
endfunction"}}}

function! s:add_depends(bundle) "{{{
  " Add depends.
  for depend in a:bundle.depends
    if !has_key(s:neobundles, depend.name)
      call neobundle#config#add(depend)
    elseif !depend.lazy
      " Load automatically.
      call neobundle#config#source(depend.name, depend.force)
    endif
  endfor
endfunction"}}}

function! s:add_lazy(bundle) "{{{
  let bundle = a:bundle

  " Auto set autoload keys.
  for key in filter([
        \ 'filetypes', 'filename_patterns',
        \ 'commands', 'functions', 'mappings', 'unite_sources',
        \ 'insert', 'explorer', 'on_source', 'function_prefix',
        \ ], 'has_key(bundle, v:val)')
    let bundle.autoload[key] = bundle[key]
    call remove(bundle, key)
  endfor

  if !has_key(bundle.autoload, 'function_prefix')
    let bundle.autoload.function_prefix =
          \ neobundle#parser#_function_prefix(bundle.name)
  endif
  if !has_key(bundle.autoload, 'unite_sources')
        \ && bundle.name =~ '^unite-'
    let bundle.autoload.unite_sources =
          \ matchstr(bundle.name, '^unite-\zs.*')
  endif

  if neobundle#config#is_sourced(bundle.name)
    " Already sourced.
    call neobundle#config#rtp_add(bundle)
  else
    if has_key(bundle.autoload, 'commands')
      call s:add_dummy_commands(bundle)
    endif

    if has_key(bundle.autoload, 'mappings')
      call s:add_dummy_mappings(bundle)
    endif
  endif
endfunction"}}}

function! s:add_dummy_commands(bundle) "{{{
  let a:bundle.dummy_commands = []
  for command in map(copy(neobundle#util#convert2list(
        \ a:bundle.autoload.commands)), "
        \ type(v:val) == type('') ?
          \ { 'name' : v:val } : v:val
          \")

    " Define dummy commands.
    silent! execute 'command ' . (get(command, 'complete', '') != '' ?
          \ ('-complete=' . command.complete) : '')
          \ . ' -bang -range -nargs=*' command.name printf(
          \ "call neobundle#autoload#command(%s, %s, <q-args>,
          \  expand('<bang>'), expand('<line1>'), expand('<line2>'))",
          \   string(command.name), string(a:bundle.name))

    call add(a:bundle.dummy_commands, command.name)
  endfor
endfunction"}}}
function! s:add_dummy_mappings(bundle) "{{{
  let a:bundle.dummy_mappings = []
  for [modes, mappings] in map(neobundle#util#convert2list(
        \ copy(a:bundle.autoload.mappings)), "
        \   type(v:val) == type([]) ?
        \     [v:val[0], v:val[1:]] : ['nxo', [v:val]]
        \ ")

    for mapping in mappings
      " Define dummy mappings.
      for mode in filter(split(modes, '\zs'),
            \ "index(['n', 'v', 'x', 'o', 'i', 'c'], v:val) >= 0")
        silent! execute mode.'noremap <unique><silent>' mapping printf(
              \ (mode ==# 'c' ? "\<C-r>=" :
              \  (mode ==# 'i' ? "\<C-o>:" : ":\<C-u>")."call ").
              \   "neobundle#autoload#mapping(%s, %s, %s)<CR>",
              \   string(mapping), string(a:bundle.name), string(mode))

        call add(a:bundle.dummy_mappings, [mode, mapping])
      endfor
    endfor
  endfor
endfunction"}}}

function! s:on_source(bundle) "{{{
  if a:bundle.verbose && a:bundle.lazy
    redraw
    echo 'source:' a:bundle.name
  endif
  call neobundle#call_hook('on_source', a:bundle)

  " Reload script files.
  for directory in filter(
        \ ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'],
        \ "isdirectory(a:bundle.rtp.'/'.v:val)")
    for file in split(glob(a:bundle.rtp.'/'.directory.'/**/*.vim'), '\n')
      silent! source `=file`
    endfor
  endfor

  if exists('#'.a:bundle.augroup.'#VimEnter')
    execute 'silent doautocmd' a:bundle.augroup 'VimEnter'

    if has('gui_running') && &term ==# 'builtin_gui'
      execute 'silent doautocmd' a:bundle.augroup 'GUIEnter'
    endif
  endif

  if a:bundle.verbose && a:bundle.lazy
    redraw
    echo 'sourced:' a:bundle.name
  endif
endfunction"}}}

function! s:clear_dummy(bundle) "{{{
endfunction"}}}

function! s:is_reset_ftplugin(filetype, rtp) "{{{
  for filetype in split(a:filetype, '\.')
    for directory in ['ftplugin', 'indent', 'syntax',
          \ 'after/ftplugin', 'after/indent', 'after/syntax']
      let base = a:rtp . '/' . directory
      if filereadable(base.'/'.filetype.'.vim') ||
            \ (directory =~# 'ftplugin$' &&
            \   isdirectory(base . '/' . filetype) ||
            \   glob(base.'/'.filetype.'_*.vim') != '')
        return 1
      endif
    endfor
  endfor

  return 0
endfunction"}}}

function! s:reset_ftplugin(filetype_out) "{{{
  filetype off

  if a:filetype_out =~# 'detection:ON'
        \ && a:filetype_out =~# 'plugin:ON'
        \ && a:filetype_out =~# 'indent:ON'
    silent! filetype plugin indent on
  else
    if a:filetype_out =~# 'detection:ON'
      silent! filetype on
    endif

    if a:filetype_out =~# 'plugin:ON'
      silent! filetype plugin on
    endif

    if a:filetype_out =~# 'indent:ON'
      silent! filetype indent on
    endif
  endif

  " Reload filetype plugins.
  let &l:filetype = &l:filetype
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/init.vim.

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
"=============================================================================
" FILE: init.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu at gmail.com>
"          Copyright (C) 2010 http://github.com/gmarik
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

function! neobundle#init#_rc(path, is_block) "{{{
  let path =
        \ neobundle#util#substitute_path_separator(
        \ neobundle#util#expand(a:path))
  if path =~ '/$'
    let path = path[: -2]
  endif
  call neobundle#set_neobundle_dir(path)

  " Join to the tail in runtimepath.
  let rtp = neobundle#get_rtp_dir()
  execute 'set rtp-='.fnameescape(rtp)
  let rtps = neobundle#util#split_rtp(&runtimepath)
  let n = index(rtps, $VIMRUNTIME)
  let &runtimepath = neobundle#util#join_rtp(
        \ insert(rtps, rtp, n-1), &runtimepath, rtp)

  augroup neobundle
    autocmd!
  augroup END

  call neobundle#config#init(a:is_block)
  call neobundle#autoload#init()
endfunction"}}}

function! neobundle#init#_bundle(bundle) "{{{
  if !has_key(a:bundle, 'type') && get(a:bundle, 'local', 0)
    " Default type.
    let a:bundle.type = 'nosync'
  endif
  if !has_key(a:bundle, 'type')
    call neobundle#installer#error(
          \ printf('Failed parse name "%s" and args %s',
          \   a:bundle.orig_name, string(a:bundle.orig_opts)))
    return {}
  endif

  let bundle = {
          \ 'uri' : '',
          \ 'script_type' : '',
          \ 'rev' : '',
          \ 'rtp' : '',
          \ 'depends' : [],
          \ 'lazy' : 0,
          \ 'force' : 0,
          \ 'gui' : 0,
          \ 'terminal' : 0,
          \ 'overwrite' : 1,
          \ 'stay_same' : 0,
          \ 'autoload' : {},
          \ 'hooks' : {},
          \ 'called_hooks' : {},
          \ 'external_commands' : {},
          \ 'description' : '',
          \ 'dummy_commands' : [],
          \ 'dummy_mappings' : [],
          \ 'sourced' : 0,
          \ 'disabled' : 0,
          \ 'local' : 0,
          \ 'focus' : 0,
          \ 'verbose' : 0,
          \ 'orig_name' : '',
          \ 'vim_version' : '',
          \ 'orig_opts' : {},
          \ 'recipe' : '',
          \ 'base' : neobundle#get_neobundle_dir(),
          \ }
  call extend(bundle, a:bundle)

  if !has_key(bundle, 'name')
    let bundle.name = neobundle#util#name_conversion(bundle.orig_name)
  endif

  if !has_key(bundle, 'normalized_name')
    let bundle.normalized_name = substitute(
          \ fnamemodify(bundle.name, ':r'), '^vim-\|-vim$', '', 'g')
  endif
  if !has_key(bundle.orig_opts, 'name') &&
     \ g:neobundle#enable_name_conversion
    " Use normalized name.
    let bundle.name = bundle.normalized_name
  endif

  if !has_key(bundle, 'directory')
    let bundle.directory = bundle.name

    if bundle.rev != ''
      let bundle.directory .= '_' . substitute(bundle.rev,
            \ '[^[:alnum:]_-]', '_', 'g')
    endif
  endif

  if bundle.base[0] == '~'
    let bundle.base = neobundle#util#expand(bundle.base)
  endif
  if bundle.base[-1] == '/' || bundle.base[-1] == '\'
    " Chomp.
    let bundle.base = bundle.base[: -2]
  endif

  let bundle.path = isdirectory(bundle.uri) ?
        \ bundle.uri : bundle.base.'/'.bundle.directory

  " Check relative path.
  if bundle.rtp !~ '^\%([~/]\|\a\+:\)'
    let bundle.rtp = bundle.path.'/'.bundle.rtp
  endif
  if bundle.rtp[0] == '~'
    let bundle.rtp = neobundle#util#expand(bundle.rtp)
  endif
  if bundle.rtp[-1] == '/' || bundle.rtp[-1] == '\'
    " Chomp.
    let bundle.rtp = bundle.rtp[: -2]
  endif
  if bundle.normalized_name ==# 'neobundle'
    " Do not add runtimepath.
    let bundle.rtp = ''
  endif

  if bundle.script_type != ''
    " Add script_type.
    " Note: To check by neobundle#config#is_installed().
    let bundle.path .= '/' . bundle.script_type
  endif

  if !has_key(bundle, 'resettable')
    let bundle.resettable = !bundle.lazy
  endif

  if !has_key(bundle, 'augroup')
    let bundle.augroup = bundle.name
  endif

  " Parse depends.
  if !empty(bundle.depends)
    call s:init_depends(bundle)
  endif

  if get(neobundle#config#get(bundle.name), 'sourced', 0)
    let bundle.sourced = 1
  endif

  return bundle
endfunction"}}}

function! s:init_depends(bundle) "{{{
  let bundle = a:bundle
  let _ = []

  for depend in neobundle#util#convert2list(bundle.depends)
    if type(depend) == type('')
      let depend = string(depend)
    endif

    let depend_bundle = type(depend) == type({}) ?
          \ depend : neobundle#parser#bundle(depend, 1)
    let depend_bundle.lazy = bundle.lazy
    let depend_bundle.resettable = bundle.resettable
    let depend_bundle.overwrite = 0
    call add(_, depend_bundle)

    unlet depend
  endfor

  let bundle.depends = _
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/installer.vim.

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
"=============================================================================
" FILE: installer.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu at gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
" Version: 0.1, for Vim 7.2
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

let s:install_info_version = '3.0'

let s:log = []
let s:updates_log = []

function! neobundle#installer#update(bundles)
  if neobundle#util#is_sudo()
    call neobundle#util#print_error(
          \ '"sudo vim" is detected. This feature is disabled.')
    return
  endif

  let all_bundles = neobundle#config#get_neobundles()

  call neobundle#commands#helptags(all_bundles)
  call s:reload(filter(copy(a:bundles),
        \ 'v:val.sourced && !v:val.disabled'))

  call s:save_install_info(all_bundles)

  if !empty(a:bundles)
    let lazy_bundles = filter(copy(all_bundles), 'v:val.lazy')
    call neobundle#util#copy_bundle_files(
          \ lazy_bundles, 'ftdetect')
    call neobundle#util#copy_bundle_files(
          \ lazy_bundles, 'after/ftdetect')
  endif
endfunction

function! neobundle#installer#build(bundle)
  " Environment check.
  let build = get(a:bundle, 'build', {})
  if neobundle#util#is_windows() && has_key(build, 'windows')
    let cmd = build.windows
  elseif neobundle#util#is_mac() && has_key(build, 'mac')
    let cmd = build.mac
  elseif neobundle#util#is_cygwin() && has_key(build, 'cygwin')
    let cmd = build.cygwin
  elseif !neobundle#util#is_windows() && has_key(build, 'unix')
    let cmd = build.unix
  elseif has_key(build, 'others')
    let cmd = build.others
  else
    return 0
  endif

  call neobundle#installer#log('[neobundle/install] Building...')

  let cwd = getcwd()
  try
    if isdirectory(a:bundle.path)
      call neobundle#util#cd(a:bundle.path)
    endif

    let result = neobundle#util#system(cmd)
  catch
    " Build error from vimproc.
    let message = (v:exception !~# '^Vim:')?
          \ v:exception : v:exception . ' ' . v:throwpoint
    call neobundle#installer#error(message)

    return 1
  finally
    if isdirectory(cwd)
      call neobundle#util#cd(cwd)
    endif
  endtry

  if neobundle#util#get_last_status()
    call neobundle#installer#error(result)
  else
    call neobundle#installer#log('[neobundle/install] ' . result)
  endif

  return neobundle#util#get_last_status()
endfunction

function! neobundle#installer#reinstall(bundles)
  for bundle in a:bundles
    " Reinstall.
    call neobundle#installer#log(
          \ printf('[neobundle/install] |%s| Reinstalling...', bundle.name))

    " Save info.
    let arg = copy(bundle.orig_arg)

    " Remove.
    call neobundle#commands#clean(1, bundle.name)

    call call('neobundle#parser#bundle', [arg])
  endfor

  " Install.
  call neobundle#commands#install(0,
        \ join(map(copy(a:bundles), 'v:val.name')))

  call neobundle#installer#update(a:bundles)
endfunction

function! neobundle#installer#get_reinstall_bundles(bundles)
  let reinstall_bundles = filter(copy(a:bundles),
        \ "neobundle#config#is_installed(v:val.name)
        \  && v:val.normalized_name !=# 'neobundle' &&
        \     v:val.normalized_name !=# 'unite'
        \  && v:val.type !=# 'nosync'
        \  && !v:val.local &&
        \     v:val.path ==# v:val.installed_path &&
        \     v:val.uri !=# v:val.installed_uri")
  if !empty(reinstall_bundles)
    echomsg 'Reinstall bundles detected: '
          \ string(map(copy(reinstall_bundles), 'v:val.name'))
    let ret = confirm('Reinstall bundles now?', "yes\nNo", 2)
    redraw
    if ret != 1
      return []
    endif
  endif

  return reinstall_bundles
endfunction

function! neobundle#installer#get_sync_command(bang, bundle, number, max)
  let type = neobundle#config#get_types(a:bundle.type)
  if empty(type)
    return ['', printf('(%'.len(a:max).'d/%d): |%s| %s',
          \ a:number, a:max, a:bundle.name, 'Unknown Type')]
  endif

  let is_directory = isdirectory(a:bundle.path)

  let cmd = type.get_sync_command(a:bundle)

  if cmd == ''
    return ['', 'Not supported sync action.']
  elseif (is_directory && !a:bang)
    return ['', 'Already installed.']
  endif

  let message = printf('(%'.len(a:max).'d/%d): |%s| %s',
        \ a:number, a:max, a:bundle.name, cmd)

  return [cmd, message]
endfunction

function! neobundle#installer#get_revision_lock_command(bang, bundle, number, max)
  let repo_dir = neobundle#util#substitute_path_separator(
        \ neobundle#util#expand(a:bundle.path.'/.'.a:bundle.type.'/'))

  let type = neobundle#config#get_types(a:bundle.type)
  if empty(type)
    return ['', printf('(%'.len(a:max).'d/%d): |%s| %s',
          \ a:number, a:max, a:bundle.name, 'Unknown Type')]
  endif

  let cmd = type.get_revision_lock_command(a:bundle)

  if cmd == ''
    return ['', '']
  endif

  let message = printf('(%'.len(a:max).'d/%d): |%s| %s',
        \ a:number, a:max, a:bundle.name, cmd)

  return [cmd, message]
endfunction

function! neobundle#installer#get_revision_number(bundle)
  let cwd = getcwd()
  try
    let type = neobundle#config#get_types(a:bundle.type)

    if !isdirectory(a:bundle.path)
      return ''
    endif

    call neobundle#util#cd(a:bundle.path)

    return neobundle#util#system(
          \ type.get_revision_number_command(a:bundle))
  finally
    if isdirectory(cwd)
      call neobundle#util#cd(cwd)
    endif
  endtry

  return ''
endfunction

function! s:get_commit_date(bundle)
  let cwd = getcwd()
  try
    let type = neobundle#config#get_types(a:bundle.type)

    if !isdirectory(a:bundle.path) ||
          \ !has_key(type, 'get_commit_date_command')
      return 0
    endif

    call neobundle#util#cd(a:bundle.path)

    return neobundle#util#system(
          \ type.get_commit_date_command(a:bundle))
  finally
    if isdirectory(cwd)
      call neobundle#util#cd(cwd)
    endif
  endtry

  return ''
endfunction

function! neobundle#installer#get_updated_log_message(bundle, new_rev, old_rev)
  let cwd = getcwd()
  try
    let type = neobundle#config#get_types(a:bundle.type)

    if isdirectory(a:bundle.path)
      call neobundle#util#cd(a:bundle.path)
    endif

    let log_command = has_key(type, 'get_log_command') ?
          \ type.get_log_command(a:bundle, a:new_rev, a:old_rev) : ''
    let log = (log_command != '' ?
          \ neobundle#util#system(log_command) : '')
    return log != '' ? log : printf('%s -> %s', a:old_rev, a:new_rev)
  finally
    if isdirectory(cwd)
      call neobundle#util#cd(cwd)
    endif
  endtry
endfunction

function! neobundle#installer#sync(bundle, context, is_unite)
  let a:context.source__number += 1

  let num = a:context.source__number
  let max = a:context.source__max_bundles

  let before_one_day = localtime() - 60 * 60 * 24
  let before_one_week = localtime() - 60 * 60 * 24 * 7

  if a:context.source__bang == 1 &&
        \ a:bundle.stay_same
    let [cmd, message] = ['', 'has "stay_same" attribute.']
  elseif a:context.source__bang == 1 &&
        \ a:bundle.uri ==# a:bundle.installed_uri &&
        \ a:bundle.updated_time < before_one_week
        \     && a:bundle.checked_time >= before_one_day
    let [cmd, message] = ['', 'Outdated plugin.']
  else
    let [cmd, message] =
          \ neobundle#installer#get_sync_command(
          \ a:context.source__bang, a:bundle,
          \ a:context.source__number, a:context.source__max_bundles)
  endif

  if cmd == ''
    " Skipped.
    call neobundle#installer#log(s:get_skipped_message(
          \ num, max, a:bundle, '[neobundle/install]', message), a:is_unite)
    return
  elseif cmd =~# '^E: '
    " Errored.

    call neobundle#installer#log(
          \ printf('[neobundle/install] (%'.len(max).'d/%d): |%s| %s',
          \ num, max, a:bundle.name, 'Error'), a:is_unite)
    call neobundle#installer#error(cmd[3:], a:is_unite)
    call add(a:context.source__errored_bundles,
          \ a:bundle)
    return
  endif

  call neobundle#installer#log(
        \ '[neobundle/install] ' . message, a:is_unite)

  let cwd = getcwd()
  try
    let lang_save = $LANG
    let $LANG = 'C'

    if isdirectory(a:bundle.path)
      " Cd to bundle path.
      call neobundle#util#cd(a:bundle.path)
    endif

    let rev = neobundle#installer#get_revision_number(a:bundle)

    let process = {
          \ 'number' : num,
          \ 'rev' : rev,
          \ 'bundle' : a:bundle,
          \ 'output' : '',
          \ 'status' : -1,
          \ 'eof' : 0,
          \ 'start_time' : localtime(),
          \ }
    if neobundle#util#has_vimproc()
      let process.proc = vimproc#pgroup_open(vimproc#util#iconv(
            \            cmd, &encoding, 'char'), 0, 2)

      " Close handles.
      call process.proc.stdin.close()
      call process.proc.stderr.close()
    else
      let process.output = neobundle#util#system(cmd)
      let process.status = neobundle#util#get_last_status()
    endif
  finally
    let $LANG = lang_save
    if isdirectory(cwd)
      call neobundle#util#cd(cwd)
    endif
  endtry

  call add(a:context.source__processes, process)
endfunction

function! neobundle#installer#check_output(context, process, is_unite)
  if neobundle#util#has_vimproc() && has_key(a:process, 'proc')
    let is_timeout = (localtime() - a:process.start_time)
          \             >= g:neobundle#install_process_timeout
    let a:process.output .= vimproc#util#iconv(
          \ a:process.proc.stdout.read(-1, 300), 'char', &encoding)
    if !a:process.proc.stdout.eof && !is_timeout
      return
    endif
    call a:process.proc.stdout.close()

    let [_, status] = a:process.proc.waitpid()
  else
    let is_timeout = 0
    let status = a:process.status
  endif

  let num = a:process.number
  let max = a:context.source__max_bundles
  let bundle = a:process.bundle

  " Lock revision.
  call neobundle#installer#lock_revision(
        \ a:process, a:context, a:is_unite)

  let cwd = getcwd()

  let rev = neobundle#installer#get_revision_number(bundle)

  let updated_time = s:get_commit_date(bundle)
  let bundle.checked_time = localtime()

  let is_failed = is_timeout
        \ || (status && a:process.rev ==# rev
        \     && (bundle.type !=# 'git'
        \         || a:process.output !~# 'up-to-date\|up to date'))

  let build_failed = is_failed ? 0 : neobundle#installer#build(bundle)

  if is_failed || build_failed
    let message = printf('[neobundle/install] (%'.len(max).'d/%d): |%s| %s',
          \ num, max, bundle.name, 'Error')
    call neobundle#installer#log(message, a:is_unite)
    call neobundle#installer#error(bundle.path, a:is_unite)

    if build_failed
      if confirm('Build failed. Uninstall "'.bundle.name.'" now?', "yes\nNo", 2) == 1
        " Remove.
        call neobundle#commands#clean(1, bundle.name)
      endif
    endif

    call neobundle#installer#error(
          \ (is_timeout ? 'Process timeout.' :
          \    split(a:process.output, '\n')), a:is_unite)

    call add(a:context.source__errored_bundles,
          \ bundle)
  elseif a:process.rev ==# rev
    if updated_time != 0
      let bundle.updated_time = updated_time
    endif

    call neobundle#installer#log(s:get_skipped_message(
          \ num, max, bundle, '[neobundle/install]',
          \ 'Same revision.'), a:is_unite)
  else
    call neobundle#installer#update_log(
          \ printf('[neobundle/install] (%'.len(max).'d/%d): |%s| %s',
          \ num, max, bundle.name, 'Updated'), a:is_unite)
    let message = neobundle#installer#get_updated_log_message(
          \ bundle, rev, a:process.rev)
    call neobundle#installer#update_log(
          \ map(split(message, '\n'),
          \ "printf('[neobundle/install] |%s| ' .
          \   substitute(v:val, '%', '%%', 'g'), bundle.name)"),
          \ a:is_unite)

    if updated_time == 0
      let updated_time = bundle.checked_time
    endif
    let bundle.updated_time = updated_time
    let bundle.installed_uri = bundle.uri
    let bundle.revisions[updated_time] = rev

    if neobundle#config#is_sourced(bundle.name)
      " Already sourced.
      call neobundle#config#rtp_add(bundle)
    endif

    call add(a:context.source__synced_bundles,
          \ bundle)
  endif

  let a:process.eof = 1
endfunction

function! neobundle#installer#lock_revision(process, context, is_unite)
  let num = a:process.number
  let max = a:context.source__max_bundles
  let bundle = a:process.bundle

  if bundle.rev == ''
    " Skipped.
    return 0
  endif

  let bundle.new_rev = neobundle#installer#get_revision_number(bundle)

  let [cmd, message] =
        \ neobundle#installer#get_revision_lock_command(
        \ a:context.source__bang, bundle, num, max)

  if cmd == ''
    " Skipped.
    return 0
  elseif cmd =~# '^E: '
    " Errored.
    call neobundle#installer#error(bundle.path, a:is_unite)
    call neobundle#installer#error(cmd[3:], a:is_unite)
    return -1
  endif

  call neobundle#installer#log(
        \ printf('[neobundle/install] (%'.len(max).'d/%d): |%s| %s',
        \ num, max, bundle.name, 'Locked'), a:is_unite)

  call neobundle#installer#log(
        \ '[neobundle/install] ' . message, a:is_unite)

  let cwd = getcwd()
  try
    if isdirectory(bundle.path)
      " Cd to bundle path.
      call neobundle#util#cd(bundle.path)
    endif

    let result = neobundle#util#system(cmd)
    let status = neobundle#util#get_last_status()
  finally
    if isdirectory(cwd)
      call neobundle#util#cd(cwd)
    endif
  endtry

  if status
    call neobundle#installer#error(bundle.path, a:is_unite)
    call neobundle#installer#error(result, a:is_unite)
    return -1
  endif
endfunction

function! s:save_install_info(bundles)
  let s:install_info = {}
  for bundle in filter(copy(a:bundles),
        \ "!v:val.local && has_key(v:val, 'updated_time')")
    " Note: Don't save local repository.
    let s:install_info[bundle.name] = {
          \   'checked_time' : bundle.checked_time,
          \   'updated_time' : bundle.updated_time,
          \   'installed_uri' : bundle.installed_uri,
          \   'installed_path' : bundle.path,
          \   'revisions' : bundle.revisions,
          \ }
  endfor

  call neobundle#util#writefile('install_info',
        \ [s:install_info_version, string(s:install_info)])
endfunction

function! neobundle#installer#_load_install_info(bundles)
  let install_info_path =
        \ neobundle#get_neobundle_dir() . '/.neobundle/install_info'
  if !exists('s:install_info')
    let s:install_info = {}

    if filereadable(install_info_path)
      try
        let list = readfile(install_info_path)
        let ver = list[0]
        sandbox let s:install_info = eval(list[1])
        if ver !=# s:install_info_version
              \ || type(s:install_info) != type({})
          let s:install_info = {}
        endif
      catch
      endtry
    endif
  endif

  call map(a:bundles, "extend(v:val, get(s:install_info, v:val.name, {
        \ 'checked_time' : localtime(),
        \ 'updated_time' : localtime(),
        \ 'installed_uri' : v:val.uri,
        \ 'installed_path' : v:val.path,
        \ 'revisions' : {},
        \}))")

  return s:install_info
endfunction

function! s:get_skipped_message(number, max, bundle, prefix, message)
  let messages = [a:prefix . printf(' (%'.len(a:max).'d/%d): |%s| %s',
          \ a:number, a:max, a:bundle.name, 'Skipped')]
  if a:message != ''
    call add(messages, a:prefix . ' ' . a:message)
  endif
  return messages
endfunction

function! neobundle#installer#log(msg, ...)
  let is_unite = get(a:000, 0, 0)
  let msg = type(a:msg) == type([]) ?
        \ a:msg : split(a:msg, '\n')
  call extend(s:log, msg)

  if !(&filetype == 'unite' || is_unite)
    call neobundle#util#redraw_echo(msg)
  endif

  call s:append_log_file(msg)
endfunction

function! neobundle#installer#update_log(msg, ...)
  let msgs = []
  for msg in type(a:msg) == type([]) ?
        \ a:msg : [a:msg]
    let source_name = matchstr(msg, '^\[.\{-}\] ')

    let msg_nrs = split(msg, '\n')
    let msgs += [msg_nrs[0]] +
          \ map(msg_nrs[1:], "source_name . v:val")
  endfor

  call call('neobundle#installer#log', [msgs] + a:000)

  let s:updates_log += msgs
endfunction

function! neobundle#installer#error(msg, ...)
  let is_unite = get(a:000, 0, 0)
  let msg = type(a:msg) == type([]) ?
        \ a:msg : split(a:msg, '\r\?\n')
  call extend(s:log, msg)
  call extend(s:updates_log, msg)

  if &filetype == 'unite' || is_unite
    call unite#print_error(msg)
  else
    call neobundle#util#print_error(msg)
  endif

  call s:append_log_file(msg)
endfunction

function! s:append_log_file(msg)
  if g:neobundle#log_filename == ''
    return
  endif

  let msg = a:msg
  " Appends to log file.
  if filereadable(g:neobundle#log_filename)
    let msg = readfile(g:neobundle#log_filename) + msg
  endif

  let dir = fnamemodify(g:neobundle#log_filename, ':h')
  if !isdirectory(dir)
    call mkdir(dir, 'p')
  endif
  call writefile(msg, g:neobundle#log_filename)
endfunction

function! neobundle#installer#get_log()
  return s:log
endfunction

function! neobundle#installer#get_updates_log()
  return s:updates_log
endfunction

function! neobundle#installer#clear_log()
  let s:log = []
  let s:updates_log = []
endfunction

function! neobundle#installer#get_tags_info()
  let path = neobundle#get_neobundle_dir() . '/.neobundle/tags_info'
  if !filereadable(path)
    return []
  endif

  return readfile(path)
endfunction

function! s:reload(bundles) "{{{
  if empty(a:bundles)
    return
  endif

  call filter(copy(a:bundles), 'neobundle#config#rtp_add(v:val)')

  " Call hooks.
  call neobundle#call_hook('on_source', a:bundles)

  silent! runtime! ftdetect/**/*.vim
  silent! runtime! after/ftdetect/**/*.vim
  silent! runtime! plugin/**/*.vim
  silent! runtime! after/plugin/**/*.vim

  " Call hooks.
  call neobundle#call_hook('on_post_source', a:bundles)
endfunction"}}}

function! s:redir(cmd) "{{{
  redir => res
  silent! execute a:cmd
  redir END
  return res
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/parser.vim.

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
"=============================================================================
" FILE: parser.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu at gmail.com>
"          Copyright (C) 2010 http://github.com/gmarik
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

function! neobundle#parser#bundle(arg, ...) "{{{
  let bundle = s:parse_arg(a:arg)
  let is_parse_only = get(a:000, 0, 0)
  if !is_parse_only
    call neobundle#config#add(bundle)
  endif

  return bundle
endfunction"}}}

function! neobundle#parser#lazy(arg) "{{{
  let bundle = s:parse_arg(a:arg)
  if empty(bundle)
    return {}
  endif

  " Update lazy flag.
  let bundle.lazy = 1
  let bundle.resettable = 0
  let bundle.orig_opts.lazy = 1
  for depend in bundle.depends
    let depend.lazy = bundle.lazy
    let depend.resettable = 0
  endfor

  call neobundle#config#add(bundle)

  return bundle
endfunction"}}}

function! neobundle#parser#fetch(arg) "{{{
  let bundle = s:parse_arg(a:arg)
  if empty(bundle)
    return {}
  endif

  " Clear runtimepath.
  let bundle.rtp = ''

  call neobundle#config#add(bundle)

  return bundle
endfunction"}}}

function! neobundle#parser#recipe(arg) "{{{
  " Parse args.
  let arg = type(a:arg) == type([]) ?
   \ string(a:arg) : '[' . a:arg . ']'
  sandbox let args = eval(arg)
  if empty(args)
    return {}
  endif

  let recipe = args[0]
  let recipe_bundle = neobundle#parser#_parse_recipe(recipe)
  if empty(recipe_bundle)
    return {}
  endif

  let bundle = neobundle#parser#_init_bundle(
        \ recipe_bundle.path,
        \ [extend(recipe_bundle, get(args, 1, {}))])
  if empty(bundle)
    return {}
  endif

  let bundle.orig_arg = copy(a:arg)

  call neobundle#config#add(bundle)

  return bundle
endfunction"}}}

function! neobundle#parser#direct(arg) "{{{
  let bundle = neobundle#parser#bundle(a:arg, 1)

  if empty(bundle)
    return {}
  endif

  if !empty(neobundle#get(bundle.name))
    call neobundle#util#print_error(
          \ bundle.name . ' is already installed.')
    return {}
  endif

  call neobundle#config#add(bundle)

  call neobundle#config#save_direct(a:arg)

  " Direct install.
  call neobundle#commands#install(0, bundle.name)

  return bundle
endfunction"}}}

function! s:parse_arg(arg) "{{{
  let arg = type(a:arg) == type([]) ?
   \ string(a:arg) : '[' . a:arg . ']'
  sandbox let args = eval(arg)
  if empty(args)
    return {}
  endif

  let bundle = neobundle#parser#_init_bundle(
        \ args[0], args[1:])
  if empty(bundle)
    return {}
  endif

  let bundle.orig_arg = copy(a:arg)

  return bundle
endfunction"}}}

function! neobundle#parser#_init_bundle(name, opts) "{{{
  let path = substitute(a:name, "['".'"]\+', '', 'g')
  if path[0] == '~'
    let path = neobundle#util#expand(path)
  endif
  let opts = s:parse_options(a:opts)
  if !has_key(opts, 'recipe')
    let opts.recipe = ''
  endif
  let bundle = extend(neobundle#parser#path(
        \ path, opts), opts)
  if bundle.recipe != ''
    call extend(bundle,
          \ neobundle#parser#_parse_recipe(bundle.recipe), 'keep')
  endif

  let bundle.orig_name = a:name
  let bundle.orig_path = path
  let bundle.orig_opts = opts
  let bundle.orig_arg = string(a:name).', '.string(opts)

  let bundle = neobundle#init#_bundle(bundle)

  return bundle
endfunction"}}}

function! neobundle#parser#local(localdir, options, names) "{{{
  let base = fnamemodify(neobundle#util#expand(a:localdir), ':p')
  for dir in filter(map(filter(split(glob(
        \ base . '*'), '\n'), "isdirectory(v:val)"),
        \ "substitute(neobundle#util#substitute_path_separator(
        \   fnamemodify(v:val, ':p')), '/$', '', '')"),
        \ "empty(a:names) || index(a:names, fnamemodify(v:val, ':t')) >= 0")
    let options = extend({ 'local' : 1, 'base' : base }, a:options)
    let name = fnamemodify(dir, ':t')
    let bundle = neobundle#get(name)
    if !empty(bundle)
      call extend(options, copy(bundle.orig_opts))
      if bundle.lazy
        let options.lazy = 1
      endif

      " Remove from lazy runtimepath
      call filter(neobundle#config#get_lazy_rtps(),
            \ "fnamemodify(v:val, ':h:t') != name")
    endif

    call neobundle#parser#bundle([dir, options])
  endfor
endfunction"}}}

function! neobundle#parser#path(path, ...) "{{{
  let opts = get(a:000, 0, {})
  let site = get(opts, 'site', g:neobundle#default_site)
  let path = substitute(a:path, '/$', '', '')

  if path !~ '^/\|^\a:' && path !~ ':'
    " Add default site.
    let path = site . ':' . path
  endif

  if has_key(opts, 'type')
    let type = neobundle#config#get_types(opts.type)
    let types = empty(type) ? [] : [type]
  else
    let detect = neobundle#config#get_types('git').detect(path, opts)
    if !empty(detect)
      return detect
    endif

    let types = neobundle#config#get_types()
  endif

  for type in types
    let detect = type.detect(path, opts)

    if !empty(detect)
      return detect
    endif
  endfor

  if isdirectory(path)
    " Detect nosync type.
    return { 'name' : split(path, '/')[-1],
          \  'uri' : path, 'type' : 'nosync' }
  endif

  return {}
endfunction"}}}

function! neobundle#parser#_function_prefix(name) "{{{
  let function_prefix = tolower(fnamemodify(a:name, ':r'))
  let function_prefix = substitute(function_prefix,
        \'^vim-', '','')
  let function_prefix = substitute(function_prefix,
        \'^unite-', 'unite#sources#','')
  let function_prefix = substitute(function_prefix,
        \'-', '_', 'g')
  return function_prefix
endfunction"}}}

function! s:parse_options(opts) "{{{
  if empty(a:opts)
    return has_key(g:neobundle#default_options, '_') ?
          \ copy(g:neobundle#default_options['_']) : {}
  endif

  if len(a:opts) == 3
    " rev, default, options
    let [rev, default, options] = a:opts
  elseif len(a:opts) == 2 && type(a:opts[-1]) == type('')
    " rev, default
    let [rev, default, options] = a:opts + [{}]
  elseif len(a:opts) == 2 && type(a:opts[-1]) == type({})
    " rev, options
    let [rev, default, options] = [a:opts[0], '', a:opts[1]]
  elseif len(a:opts) == 1 && type(a:opts[-1]) == type('')
    " rev
    let [rev, default, options] = [a:opts[0], '', {}]
  elseif len(a:opts) == 1 && type(a:opts[-1]) == type({})
    " options
    let [rev, default, options] = ['', '', a:opts[0]]
  else
    call neobundle#installer#error(
          \ printf('Invalid option : "%s".', string(a:opts)))
    return {}
  endif

  if rev != ''
    let options.rev = rev
  endif

  if !has_key(options, 'default')
    let options.default = (default == '') ?  '_' : default
  endif

  " Set default options.
  if has_key(g:neobundle#default_options, options.default)
    call extend(options,
          \ g:neobundle#default_options[options.default], 'keep')
  endif

  return options
endfunction"}}}

function! neobundle#parser#_parse_recipe(recipe) "{{{
  let recipe = a:recipe
  if recipe !~ '\.vimrecipe$'
    let recipe .= '.vimrecipe'
  endif

  if recipe !~ '^/\|^\w\+:'
    " Search from runtimepath.
    let path = get(split(globpath(&runtimepath,
        \ 'recipes/' . recipe, 1), '\n'), 0, '')
    if path == ''
      " Use name conversion.
      let recipe = neobundle#util#name_conversion(a:recipe)
      if recipe !~ '\.vimrecipe$'
        let recipe .= '.vimrecipe'
      endif

      let path = get(split(globpath(&runtimepath,
            \ 'recipes/' . recipe, 1), '\n'), 0, '')
    endif
  else
    let path = recipe
  endif

  if !filereadable(path)
    call neobundle#util#print_error(printf(
          \ '[neobundle] The recipe file "%s" is not found.', a:recipe))
    return {}
  endif

  sandbox let data = eval(join(filter(readfile(path),
          \ "v:val !~ '^\\s*\\%(#.*\\)\\?$'"), ''))

  if !has_key(data, 'name') || !has_key(data, 'path')
    call neobundle#util#print_error(
          \ '[neobundle] ' . path)
    call neobundle#util#print_error(
          \ '[neobundle] The recipe file format is wrong.')
    return {}
  endif

  let data.receipe_path = path

  " Initialize.
  let default = {
        \ 'options' : {},
        \ 'description' : '',
        \ 'website' : '',
        \ 'script_type' : '',
        \ }

  let data = extend(data, default, 'keep')

  return data
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


























































































































































































































































































































































































































































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/sources/github.vim.

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
"=============================================================================
" FILE: github.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

function! neobundle#sources#github#define() "{{{
  return s:source
endfunction"}}}

let s:source = {
      \ 'name' : 'github',
      \ 'short_name' : 'github',
      \ }

function! s:source.gather_candidates(args, context) "{{{
  if !executable('wget')
    call unite#print_error(
          \ '[neobundle/search:github] '.
          \ 'wget command is not available!')
    return []
  endif

  let plugins = s:get_github_searches(a:context.source__input)

  return map(copy(plugins), "{
        \ 'word' : v:val.username.'/'.v:val.name . ' ' . v:val.description,
        \ 'source__name' : (v:val.fork ? '| ' : '') .
        \          v:val.username.'/'.v:val.name,
        \ 'source__path' : v:val.username.'/'.v:val.name,
        \ 'source__description' : v:val.description,
        \ 'source__options' : [],
        \ 'action__uri' : 'https://github.com/' .
        \        v:val.username.'/'.v:val.name,
        \ }")
endfunction"}}}

" Misc.
function! s:get_github_searches(string) "{{{
  let path = 'https://api.github.com/legacy/repos/search/'
        \ . a:string . '*?language=VimL'
  let temp = neobundle#util#substitute_path_separator(tempname())

  let cmd = printf('%s "%s" "%s"', 'wget -q -O ', temp, path)

  call unite#print_message(
        \ '[neobundle/search:github] Searching plugins from github...')
  redraw

  let result = unite#util#system(cmd)

  if unite#util#get_last_status()
    call unite#print_message('[neobundle/search:github] ' . cmd)
    call unite#print_error('[neobundle/search:github] Error occured!')
    call unite#print_error(result)
    return []
  elseif !filereadable(temp)
    call unite#print_error('[neobundle/search:github] '.
          \ 'Temporary file was not created!')
    return []
  else
    call unite#print_message('[neobundle/search:github] Done!')
  endif

  let [true, false, null] = [1,0,"''"]
  sandbox let data = eval(join(readfile(temp)))
  call filter(data.repositories,
        \ "stridx(v:val.username.'/'.v:val.name, a:string) >= 0")

  call delete(temp)

  return data.repositories
endfunction"}}}

function! s:convert_vim_scripts_data(data) "{{{
  return map(copy(a:data), "{
        \ 'name' : v:val.n,
        \ 'raw_type' : v:val.t,
        \ 'repository' : v:val.rv,
        \ 'description' : printf('%-5s %s', v:val.rv, v:val.s),
        \ 'uri' : 'https://github.com/vim-scripts/' . v:val.n,
        \ }")
endfunction"}}}

function! s:convert2script_type(type) "{{{
  if a:type ==# 'utility'
    return 'plugin'
  elseif a:type ==# 'color scheme'
    return 'colors'
  else
    return a:type
  endif
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/sources/neobundle_vim_recipes.vim.

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
"=============================================================================
" FILE: neobundle_vim_recipes.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

let s:repository_cache = []

function! neobundle#sources#neobundle_vim_recipes#define() "{{{
  return s:source
endfunction"}}}

let s:source = {
      \ 'name' : 'neobundle-vim-recipes',
      \ 'short_name' : 'neobundle',
      \ }

function! s:source.gather_candidates(args, context) "{{{
  let plugins = s:get_repository_plugins(a:context)

  return map(copy(plugins), "{
        \ 'word' : v:val.name . ' ' . v:val.description,
        \ 'source__name' : v:val.name,
        \ 'source__description' : v:val.description,
        \ 'source__script_type' : v:val.script_type,
        \ 'source__options' : v:val.options,
        \ 'source__path' : v:val.path,
        \ 'action__path' : v:val.receipe_path,
        \ 'action__uri' : v:val.website,
        \ }")
endfunction"}}}

" Misc.
function! s:get_repository_plugins(context) "{{{
  if a:context.is_redraw || empty(s:repository_cache)
    " Reload cache.
    let s:repository_cache = []

    for path in split(globpath(&runtimepath,
          \ 'recipes/**/*.vimrecipe', 1), '\n')
      sandbox let data = eval(join(filter(readfile(path),
            \ "v:val !~ '^\\s*\\%(#.*\\)\\?$'"), ''))

      if !has_key(data, 'name') || !has_key(data, 'path')
        call unite#print_error(
              \ '[neobundle/search:neobundle-vim-recipes] ' . path)
        call unite#print_error(
              \ '[neobundle/search:neobundle-vim-recipes] ' .
              \ 'The recipe file format is wrong.')
        continue
      endif

      let data.receipe_path = path

      " Initialize.
      let default = {
            \ 'options' : {},
            \ 'description' : '',
            \ 'website' : '',
            \ 'script_type' : '',
            \ }

      let data = extend(data, default, 'keep')

      " Set options.
      for key in ['depends', 'rev', 'type', 'script_type',
            \ 'rtp', 'base', 'build', 'external_commands']
        if has_key(data, key)
          let data.options[key] = data[key]
        endif
      endfor

      call add(s:repository_cache, data)
    endfor
  endif

  return s:repository_cache
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


















































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/sources/vim_scripts_org.vim.

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
"=============================================================================
" FILE: vim_scripts_org.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

let s:Cache = vital#of('unite').import('System.Cache')

let s:repository_cache = []

function! neobundle#sources#vim_scripts_org#define() "{{{
  return s:source
endfunction"}}}

let s:source = {
      \ 'name' : 'vim-scripts.org',
      \ 'short_name' : 'vim.org',
      \ }

function! s:source.gather_candidates(args, context) "{{{
  if !executable('curl') && !executable('wget')
    call unite#print_error(
          \ '[neobundle/search:vim-scripts.org] '.
          \ 'curl or wget command is not available!')
    return []
  endif

  let repository = 'http://vim-scripts.org/api/scripts_recent.json'

  call unite#print_message(
        \ '[neobundle/search:vim-scripts.org] repository: ' . repository)

  let plugins = s:get_repository_plugins(a:context, repository)

  try
    return map(copy(plugins), "{
        \ 'word' : v:val.name . ' ' . v:val.description,
        \ 'source__name' : v:val.name,
        \ 'source__path' : v:val.name,
        \ 'source__script_type' : s:convert2script_type(v:val.raw_type),
        \ 'source__description' : v:val.description,
        \ 'source__options' : [],
        \ 'action__uri' : v:val.uri,
        \ }")
  catch
    call unite#print_error(
          \ '[neobundle/search:vim-scripts.org] '
          \ .'Error occured in loading cache.')
    call unite#print_error(
          \ '[neobundle/search:vim-scripts.org] '
          \ .'Please re-make cache by <Plug>(unite_redraw) mapping.')
    call neobundle#installer#error(v:exception . ' ' . v:throwpoint)

    return []
  endtry
endfunction"}}}

" Misc.
function! s:get_repository_plugins(context, path) "{{{
  let cache_dir = neobundle#get_neobundle_dir() . '/.neobundle'

  if a:context.is_redraw || !s:Cache.filereadable(cache_dir, a:path)
    " Reload cache.
    let cache_path = s:Cache.getfilename(cache_dir, a:path)

    call unite#print_message(
          \ '[neobundle/search:vim-scripts.org] Reloading cache from ' . a:path)
    redraw

    if s:Cache.filereadable(cache_dir, a:path)
      call delete(cache_path)
    endif

    let temp = unite#util#substitute_path_separator(tempname())

    if executable('curl')
      let cmd = 'curl --fail -s -o "' . temp . '" '. a:path
    elseif executable('wget')
      let cmd = 'wget -q -O "' . temp . '" ' . a:path
    endif

    let result = unite#util#system(cmd)

    if unite#util#get_last_status()
      call unite#print_message('[neobundle/search:vim-scripts.org] ' . cmd)
      call unite#print_error('[neobundle/search:vim-scripts.org] Error occured!')
      call unite#print_error(result)
      return []
    elseif !filereadable(temp)
      call unite#print_error('[neobundle/search:vim-scripts.org] '.
            \ 'Temporary file was not created!')
      return []
    else
      call unite#print_message('[neobundle/search:vim-scripts.org] Done!')
    endif

    sandbox let data = eval(get(readfile(temp), 0, '[]'))

    " Convert cache data.
    call s:Cache.writefile(cache_dir, a:path,
          \ [string(s:convert_vim_scripts_data(data))])

    call delete(temp)
  endif

  if empty(s:repository_cache)
    sandbox let s:repository_cache =
          \ eval(get(s:Cache.readfile(cache_dir, a:path), 0, '[]'))
  endif

  return s:repository_cache
endfunction"}}}

function! s:convert_vim_scripts_data(data) "{{{
  return map(copy(a:data), "{
        \ 'name' : v:val.n,
        \ 'raw_type' : v:val.t,
        \ 'repository' : v:val.rv,
        \ 'description' : printf('%-5s %s', v:val.rv, v:val.s),
        \ 'uri' : 'https://github.com/vim-scripts/' . v:val.n,
        \ }")
endfunction"}}}

function! s:convert2script_type(type) "{{{
  if a:type ==# 'utility'
    return 'plugin'
  elseif a:type ==# 'color scheme'
    return 'colors'
  else
    return a:type
  endif
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/types/git.vim.

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
"=============================================================================
" FILE: git.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
"          Robert Nelson     <robert@rnelson.ca>
"          Copyright (C) 2010 http://github.com/gmarik
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

" Global options definition. "{{{
call neobundle#util#set_default(
      \ 'g:neobundle#types#git#command_path', 'git')
call neobundle#util#set_default(
      \ 'g:neobundle#types#git#default_protocol', 'https',
      \ 'g:neobundle_default_git_protocol')
call neobundle#util#set_default(
      \ 'g:neobundle#types#git#enable_submodule', 1)
call neobundle#util#set_default(
      \ 'g:neobundle#types#git#clone_depth', 0,
      \ 'g:neobundle_git_clone_depth')
"}}}

function! neobundle#types#git#define() "{{{
  return s:type
endfunction"}}}

let s:type = {
      \ 'name' : 'git',
      \ }

function! s:type.detect(path, opts) "{{{
  if isdirectory(a:path.'/.git')
    " Local repository.
    return { 'name' : split(a:path, '/')[-1],
          \  'uri' : a:path, 'type' : 'git' }
  elseif isdirectory(a:path)
    return {}
  endif

  let protocol = matchstr(a:path, '^.\{-}\ze://')
  if protocol == '' || a:path =~#
        \'\<\%(gh\|github\|bb\|bitbucket\):\S\+'
        \ || has_key(a:opts, 'type__protocol')
    let protocol = get(a:opts, 'type__protocol',
          \ g:neobundle#types#git#default_protocol)
  endif

  if a:path !~ '/'
    " www.vim.org Vim scripts.
    let name = split(a:path, ':')[-1]
    let uri  = (protocol ==# 'ssh') ?
          \ 'git@github.com:vim-scripts/' :
          \ protocol . '://github.com/vim-scripts/'
    let uri .= name
  else
    let name = substitute(split(a:path, ':')[-1],
          \   '^//github.com/', '', '')
    let uri =  (protocol ==# 'ssh') ?
          \ 'git@github.com:' . name :
          \ protocol . '://github.com/'. name
  endif

  if a:path !~# '\<\%(gh\|github\):\S\+\|://github.com/'
    let uri = s:parse_other_pattern(protocol, a:path, a:opts)
    if uri == ''
      " Parse failure.
      return {}
    endif
  endif

  if uri !~ '\.git\s*$'
    " Add .git suffix.
    let uri .= '.git'
  endif

  return { 'name': neobundle#util#name_conversion(uri),
        \  'uri': uri, 'type' : 'git' }
endfunction"}}}
function! s:type.get_sync_command(bundle) "{{{
  if !executable(g:neobundle#types#git#command_path)
    return 'E: "git" command is not installed.'
  endif

  if !isdirectory(a:bundle.path)
    let cmd = 'clone'
    if g:neobundle#types#git#enable_submodule
      let cmd .= ' --recursive'
    endif

    let depth = get(a:bundle, 'type__depth',
          \ g:neobundle#types#git#clone_depth)
    if depth > 0 && a:bundle.rev == '' && a:bundle.uri !~ '^git@'
      let cmd .= ' --depth=' . depth
    endif

    let cmd .= printf(' %s "%s"', a:bundle.uri, a:bundle.path)
  else
    let cmd = 'pull --rebase'
    if g:neobundle#types#git#enable_submodule
      let cmd .= ' && ' . g:neobundle#types#git#command_path
            \ . ' submodule update --init --recursive'
    endif
  endif

  return g:neobundle#types#git#command_path . ' ' . cmd
endfunction"}}}
function! s:type.get_revision_number_command(bundle) "{{{
  if !executable(g:neobundle#types#git#command_path)
    return ''
  endif

  let rev = a:bundle.rev
  if rev == ''
    let rev = 'HEAD'
  endif

  return g:neobundle#types#git#command_path .' rev-parse ' . rev
endfunction"}}}
function! s:type.get_revision_pretty_command(bundle) "{{{
  if !executable(g:neobundle#types#git#command_path)
    return ''
  endif

  return g:neobundle#types#git#command_path .
        \ ' log -1 --pretty=format:"%h [%cr] %s"'
endfunction"}}}
function! s:type.get_commit_date_command(bundle) "{{{
  if !executable(g:neobundle#types#git#command_path)
    return ''
  endif

  return g:neobundle#types#git#command_path .
        \ ' log -1 --pretty=format:"%ct"'
endfunction"}}}
function! s:type.get_log_command(bundle, new_rev, old_rev) "{{{
  if !executable(g:neobundle#types#git#command_path)
        \ || a:new_rev == '' || a:old_rev == ''
    return ''
  endif

  " Note: If the a:old_rev is not the ancestor of two branchs. Then do not use
  " %s^.  use %s^ will show one commit message which already shown last time.
  let is_not_ancestor = neobundle#util#system(
        \ g:neobundle#types#git#command_path . ' merge-base '
        \ . a:old_rev . ' ' . a:new_rev) ==# a:old_rev
  return printf(g:neobundle#types#git#command_path .
        \ ' log %s%s..%s --graph --pretty=format:"%%h [%%cr] %%s"',
        \ a:old_rev, (is_not_ancestor ? '' : '^'), a:new_rev)

  " Test.
  " return g:neobundle#types#git#command_path .
  "      \ ' log HEAD^^^^..HEAD --graph --pretty=format:"%h [%cr] %s"'
endfunction"}}}
function! s:type.get_revision_lock_command(bundle) "{{{
  if !executable(g:neobundle#types#git#command_path)
        \ || a:bundle.rev == ''
    return ''
  endif

  return g:neobundle#types#git#command_path . ' checkout ' . a:bundle.rev
endfunction"}}}
function! s:type.get_gc_command(bundle) "{{{
  if !executable(g:neobundle#types#git#command_path)
    return ''
  endif

  return g:neobundle#types#git#command_path .' gc'
endfunction"}}}
function! s:type.get_revision_remote_command(bundle) "{{{
  if !executable(g:neobundle#types#git#command_path)
    return ''
  endif

  let rev = a:bundle.rev
  if rev == ''
    let rev = 'HEAD'
  endif

  return g:neobundle#types#git#command_path
        \ .' ls-remote origin ' . rev
endfunction"}}}

function! s:parse_other_pattern(protocol, path, opts) "{{{
  let uri = ''

  if a:path =~# '\<gist:\S\+\|://gist.github.com/'
    let name = split(a:path, ':')[-1]
    let uri =  (a:protocol ==# 'ssh') ?
          \ 'git@gist.github.com:' . split(name, '/')[-1] :
          \ a:protocol . '://gist.github.com/'. split(name, '/')[-1]
  elseif a:path =~# '\<\%(git@\|git://\)\S\+'
        \ || a:path =~# '\.git\s*$'
        \ || get(a:opts, 'type', '') ==# 'git'
    if a:path =~# '\<\%(bb\|bitbucket\):\S\+'
      let name = substitute(split(a:path, ':')[-1],
            \   '^//bitbucket.org/', '', '')
      let uri = (a:protocol ==# 'ssh') ?
            \ 'git@bitbucket.org:' . name :
            \ a:protocol . '://bitbucket.org/' . name
    else
      let uri = a:path
    endif
  endif

  return uri
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































































































































































































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/types/hg.vim.

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
"=============================================================================
" FILE: hg.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

" Global options definition. "{{{
call neobundle#util#set_default(
      \ 'g:neobundle#types#hg#command_path', 'hg')
call neobundle#util#set_default(
      \ 'g:neobundle#types#hg#default_protocol', 'https',
      \ 'g:neobundle_default_hg_protocol')
"}}}

function! neobundle#types#hg#define() "{{{
  return s:type
endfunction"}}}

let s:type = {
      \ 'name' : 'hg',
      \ }

function! s:type.detect(path, opts) "{{{
  if isdirectory(a:path.'/.hg')
    " Local repository.
    return { 'name' : split(a:path, '/')[-1],
          \  'uri' : a:path, 'type' : 'hg' }
  elseif isdirectory(a:path)
    return {}
  endif

  let type = ''

  let protocol = matchstr(a:path, '^.\{-}\ze://')
  if protocol == '' || a:path =~#
        \'\<\%(bb\|bitbucket\):\S\+'
        \ || has_key(a:opts, 'type__protocol')
    let protocol = get(a:opts, 'type__protocol',
          \ g:neobundle#types#hg#default_protocol)
  endif

  if a:path =~# '\<\%(bb\|bitbucket\):'
    let name = substitute(split(a:path, ':')[-1],
          \   '^//bitbucket.org/', '', '')
    let uri = (protocol ==# 'ssh') ?
          \ 'ssh://hg@bitbucket.org/' . name :
          \ protocol . '://bitbucket.org/' . name
  elseif a:path =~? '[/.]hg[/.@]'
          \ || (a:path =~# '\<https\?://bitbucket\.org/'
          \ || a:path =~# '\<https://code\.google\.com/'
          \ || get(a:opts, 'type', '') ==# 'hg')
    let uri = a:path
  else
    return {}
  endif

  return { 'name': neobundle#util#name_conversion(uri),
        \  'uri' : uri, 'type' : 'hg' }
endfunction"}}}
function! s:type.get_sync_command(bundle) "{{{
  if !executable(g:neobundle#types#hg#command_path)
    return 'E: "hg" command is not installed.'
  endif

  if !isdirectory(a:bundle.path)
    let cmd = 'clone'
    let cmd .= printf(' %s "%s"', a:bundle.uri, a:bundle.path)
  else
    let cmd = 'pull -u'
  endif

  return g:neobundle#types#hg#command_path . ' ' . cmd
endfunction"}}}
function! s:type.get_revision_number_command(bundle) "{{{
  if !executable(g:neobundle#types#hg#command_path)
    return ''
  endif

  return g:neobundle#types#hg#command_path
        \ . ' heads --quiet --rev default'
endfunction"}}}
function! s:type.get_revision_lock_command(bundle) "{{{
  if !executable(g:neobundle#types#hg#command_path)
        \ || a:bundle.rev == ''
    return ''
  endif

  return g:neobundle#types#hg#command_path
        \ ' up ' . a:bundle.rev
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/types/nosync.vim.

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
"=============================================================================
" FILE: nosync.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

function! neobundle#types#nosync#define() "{{{
  return s:type
endfunction"}}}

let s:type = {
      \ 'name' : 'nosync',
      \ }

function! s:type.detect(path, opts) "{{{
  " No Auto detect.
  return {}
endfunction"}}}
function! s:type.get_sync_command(bundle) "{{{
  if isdirectory(a:bundle.path)
    return ''
  endif

  " Try auto install.
  let path = a:bundle.orig_path
  let site = get(a:bundle, 'site', g:neobundle#default_site)
  if path !~ '^/\|^\a:' && path !~ ':'
    " Add default site.
    let path = site . ':' . path
  endif

  for type in neobundle#config#get_types()
    let detect = type.detect(path, a:bundle.orig_opts)

    if !empty(detect)
      return type.get_sync_command(
            \ extend(copy(a:bundle), detect))
    endif
  endfor

  return 'E: Failed to auto installation.'
endfunction"}}}
function! s:type.get_revision_number_command(bundle) "{{{
  return ''
endfunction"}}}
function! s:type.get_revision_lock_command(bundle) "{{{
  return ''
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






















































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/types/raw.vim.

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
"=============================================================================
" FILE: raw.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

" Global options definition. "{{{
call neobundle#util#set_default(
      \ 'g:neobundle#types#raw#calc_hash_command',
      \ executable('sha1sum') ? 'sha1sum' :
      \ executable('md5sum') ? 'md5sum' : '')
"}}}

function! neobundle#types#raw#define() "{{{
  return s:type
endfunction"}}}

let s:type = {
      \ 'name' : 'raw',
      \ }

function! s:type.detect(path, opts) "{{{
  " No auto detect.
  let type = ''

  if a:path =~# '^https\?:.*\.vim$'
    " HTTP/HTTPS

    let name = split(a:path, '/')[-1]

    let type = 'raw'
  elseif a:path =~# '^https\?://www\.vim\.org/scripts/download_script.php?src_id=\d\+$'
    " For www.vim.org
    let name = 'vim-scripts-' . matchstr(a:path, '\d\+$')
    let type = 'raw'
  endif

  return type == '' ?  {} :
        \ { 'name': name, 'uri' : a:path, 'type' : type }
endfunction"}}}
function! s:type.get_sync_command(bundle) "{{{
  if a:bundle.script_type == ''
    return 'E: script_type is not found.'
  endif

  if !executable('curl') && !executable('wget')
    return 'E: curl or wget command is not available!'
  endif

  let path = a:bundle.path

  if !isdirectory(path)
    " Create script type directory.
    call mkdir(path, 'p')
  endif

  let filename = path . '/' . get(a:bundle,
        \ 'type__filename', fnamemodify(a:bundle.uri, ':t'))
  let a:bundle.type__filepath = filename
  if executable('curl')
    let cmd = printf('curl --fail -s -o "%s" "%s"', filename, a:bundle.uri)
  elseif executable('wget')
    let cmd = printf('wget -q -O "%s" "%s", ', filename, a:bundle.uri)
  endif

  return cmd
endfunction"}}}
function! s:type.get_revision_number_command(bundle) "{{{
  if g:neobundle#types#raw#calc_hash_command == ''
    return ''
  endif

  if !filereadable(a:bundle.type__filepath)
    " Not Installed.
    return ''
  endif

  " Calc hash.
  return g:neobundle#types#raw#calc_hash_command . ' ' . a:bundle.type__filepath
endfunction"}}}
function! s:type.get_revision_lock_command(bundle) "{{{
  let new_rev = matchstr(a:bundle.new_rev, '^\S\+')
  if a:bundle.rev != '' && new_rev != '' &&
        \ new_rev !=# a:bundle.rev
    " Revision check.
    return printf('E: revision digest is not matched : "%s"(got) and "%s"(rev).',
          \ new_rev, a:bundle.rev)
  endif

  " Not supported.
  return ''
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/types/svn.vim.

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
"=============================================================================
" FILE: svn.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

" Global options definition. "{{{
call neobundle#util#set_default(
      \ 'g:neobundle#types#svn#command_path', 'svn')
"}}}

function! neobundle#types#svn#define() "{{{
  return s:type
endfunction"}}}

let s:type = {
      \ 'name' : 'svn',
      \ }

function! s:type.detect(path, opts) "{{{
  if isdirectory(a:path)
    return {}
  endif

  let type = ''

  if a:path =~# '\<\%(file\|https\?\|svn\)://'
        \ && a:path =~? '[/.]svn[/.]'
    let uri = a:path
    let name = split(uri, '/')[-1]

    let type = 'svn'
  elseif a:path =~# '\<\%(gh\|github\):\S\+\|://github.com/'
    let name = substitute(split(a:path, ':')[-1],
          \   '^//github.com/', '', '')
    let uri =  'https://github.com/'. name
    let uri .= '/trunk'

    let name = split(name, '/')[-1]

    let type = 'svn'
  endif

  return type == '' ?  {} :
        \ { 'name': name, 'uri': uri, 'type' : type }
endfunction"}}}
function! s:type.get_sync_command(bundle) "{{{
  if !executable(g:neobundle#types#svn#command_path)
    return 'E: svn command is not installed.'
  endif

  if !isdirectory(a:bundle.path)
    let cmd = 'checkout'
    let cmd .= printf(' %s "%s"', a:bundle.uri, a:bundle.path)
  else
    let cmd = 'up'
  endif

  return g:neobundle#types#svn#command_path . ' ' . cmd
endfunction"}}}
function! s:type.get_revision_number_command(bundle) "{{{
  if !executable(g:neobundle#types#svn#command_path)
    return ''
  endif

  return g:neobundle#types#svn#command_path . ' info'
endfunction"}}}
function! s:type.get_revision_lock_command(bundle) "{{{
  if !executable(g:neobundle#types#svn#command_path)
        \ || a:bundle.rev == ''
    return ''
  endif

  return g:neobundle#types#svn#command_path
        \ . '  up -r ' . a:bundle.rev
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/util.vim.

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
"=============================================================================
" FILE: util.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu at gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

let s:is_windows = has('win32')
let s:is_cygwin = has('win32unix')
let s:is_mac = !s:is_windows
      \ && (has('mac') || has('macunix') || has('gui_macvim') ||
      \   (!isdirectory('/proc') && executable('sw_vers')))

function! neobundle#util#substitute_path_separator(path) "{{{
  return (s:is_windows && a:path =~ '\\') ?
        \ substitute(a:path, '\\', '/', 'g') : a:path
endfunction"}}}
function! neobundle#util#expand(path) "{{{
  let path = (a:path =~ '^\~') ? fnamemodify(a:path, ':p') :
        \ (a:path =~ '^\$\h\w*') ? substitute(a:path,
        \               '^\$\h\w*', '\=eval(submatch(0))', '') :
        \ a:path
  return (s:is_windows && path =~ '\\') ?
        \ neobundle#util#substitute_path_separator(path) : path
endfunction"}}}

function! neobundle#util#is_windows() "{{{
  return s:is_windows
endfunction"}}}
function! neobundle#util#is_mac() "{{{
  return s:is_mac
endfunction"}}}
function! neobundle#util#is_cygwin() "{{{
  return s:is_cygwin
endfunction"}}}

" Sudo check.
function! neobundle#util#is_sudo() "{{{
  return $SUDO_USER != '' && $USER !=# $SUDO_USER
      \ && $HOME !=# expand('~'.$USER)
      \ && $HOME ==# expand('~'.$SUDO_USER)
endfunction"}}}

" Check vimproc. "{{{
function! neobundle#util#has_vimproc() "{{{
  if !exists('*vimproc#version')
    try
      call vimproc#version()
    catch
    endtry
  endif

  return exists('*vimproc#version')
endfunction"}}}
"}}}
" iconv() wrapper for safety.
function! s:iconv(expr, from, to) "{{{
  if a:from == '' || a:to == '' || a:from ==? a:to
    return a:expr
  endif
  let result = iconv(a:expr, a:from, a:to)
  return result != '' ? result : a:expr
endfunction"}}}
function! neobundle#util#system(str, ...) "{{{
  let command = a:str
  let input = a:0 >= 1 ? a:1 : ''
  let command = s:iconv(command, &encoding, 'char')
  let input = s:iconv(input, &encoding, 'char')

  if a:0 == 0
    let output = neobundle#util#has_vimproc() ?
          \ vimproc#system(command) : system(command, "\<C-d>")
  elseif a:0 == 1
    let output = neobundle#util#has_vimproc() ?
          \ vimproc#system(command, input) : system(command, input)
  else
    " ignores 3rd argument unless you have vimproc.
    let output = neobundle#util#has_vimproc() ?
          \ vimproc#system(command, input, a:2) : system(command, input)
  endif

  let output = s:iconv(output, 'char', &encoding)

  return substitute(output, '\n$', '', '')
endfunction"}}}
function! neobundle#util#get_last_status() "{{{
  return neobundle#util#has_vimproc() ?
        \ vimproc#get_last_status() : v:shell_error
endfunction"}}}

" Split a comma separated string to a list.
function! neobundle#util#split_rtp(runtimepath) "{{{
  if stridx(a:runtimepath, '\,') < 0
    return split(a:runtimepath, ',')
  endif

  let split = split(a:runtimepath, '\\\@<!\%(\\\\\)*\zs,')
  return map(split,'substitute(v:val, ''\\\([\\,]\)'', "\\1", "g")')
endfunction"}}}

function! neobundle#util#join_rtp(list, runtimepath, rtp) "{{{
  return (stridx(a:runtimepath, '\,') < 0 && stridx(a:rtp, ',') < 0) ?
        \ join(a:list, ',') : join(map(copy(a:list), 's:escape(v:val)'), ',')
endfunction"}}}

" Removes duplicates from a list.
function! neobundle#util#uniq(list, ...) "{{{
  let list = a:0 ? map(copy(a:list), printf('[v:val, %s]', a:1)) : copy(a:list)
  let i = 0
  let seen = {}
  while i < len(list)
    let key = string(a:0 ? list[i][1] : list[i])
    if has_key(seen, key)
      call remove(list, i)
    else
      let seen[key] = 1
      let i += 1
    endif
  endwhile
  return a:0 ? map(list, 'v:val[0]') : list
endfunction"}}}

function! neobundle#util#set_default(var, val, ...)  "{{{
  if !exists(a:var) || type({a:var}) != type(a:val)
    let alternate_var = get(a:000, 0, '')

    let {a:var} = exists(alternate_var) ?
          \ {alternate_var} : a:val
  endif
endfunction"}}}
function! neobundle#util#set_dictionary_helper(variable, keys, pattern) "{{{
  for key in split(a:keys, '\s*,\s*')
    if !has_key(a:variable, key)
      let a:variable[key] = a:pattern
    endif
  endfor
endfunction"}}}

function! neobundle#util#get_filetypes() "{{{
  let filetype = exists('b:neocomplcache.context_filetype') ?
        \ b:neocomplcache.context_filetype : &filetype
  return split(filetype, '\.')
endfunction"}}}

function! neobundle#util#convert2list(expr) "{{{
  return type(a:expr) ==# type([]) ? a:expr : [a:expr]
endfunction"}}}

function! neobundle#util#print_error(expr) "{{{
  let msg = neobundle#util#convert2list(a:expr)
  echohl WarningMsg | echomsg join(msg, "\n") | echohl None
endfunction"}}}

function! neobundle#util#redraw_echo(expr) "{{{
  if has('vim_starting')
    echo join(neobundle#util#convert2list(a:expr), "\n")
    return
  endif

  let more_save = &more
  let showcmd_save = &showcmd
  let ruler_save = &ruler
  try
    set nomore
    set noshowcmd
    set noruler

    let msg = neobundle#util#convert2list(a:expr)
    let height = max([1, &cmdheight])
    for i in range(0, len(msg)-1, height)
      redraw
      echo join(msg[i : i+height-1], "\n")
    endfor
  finally
    let &more = more_save
    let &showcmd = showcmd_save
    let &ruler = ruler_save
  endtry
endfunction"}}}

function! neobundle#util#name_conversion(path) "{{{
  return fnamemodify(a:path, ':s?/$??:t:s?\c\.git\s*$??')
endfunction"}}}

" Escape a path for runtimepath.
function! s:escape(path)"{{{
  return substitute(a:path, ',\|\\,\@=', '\\\0', 'g')
endfunction"}}}

function! neobundle#util#unify_path(path) "{{{
  return fnamemodify(resolve(a:path), ':p:gs?\\\+?/?')
endfunction"}}}

function! neobundle#util#cd(path) "{{{
  execute 'lcd' fnameescape(a:path)
endfunction"}}}

function! neobundle#util#writefile(path, list) "{{{
  let path = neobundle#get_neobundle_dir() . '/.neobundle/' . a:path
  let dir = fnamemodify(path, ':h')
  if !isdirectory(dir)
    call mkdir(dir, 'p')
  endif

  return writefile(a:list, path)
endfunction"}}}

function! neobundle#util#cleandir(path) "{{{
  let path = neobundle#get_neobundle_dir() . '/.neobundle/' . a:path

  for file in filter(split(globpath(path, '*', 1), '\n'),
        \ '!isdirectory(v:val)')
    call delete(file)
  endfor
endfunction"}}}

function! neobundle#util#copy_bundle_files(bundles, directory) "{{{
  " Delete old files.
  call neobundle#util#cleandir(a:directory)

  let files = {}
  for bundle in a:bundles
    for file in filter(split(globpath(
          \ bundle.rtp, a:directory.'/*', 1), '\n'),
          \ '!isdirectory(v:val)')
      let filename = fnamemodify(file, ':t')
      let files[filename] = readfile(file)
    endfor
  endfor

  for [filename, list] in items(files)
    if filename =~# '^tags\%(-.*\)\?$'
      call sort(list)
    endif
    call neobundle#util#writefile(a:directory . '/' . filename, list)
  endfor
endfunction"}}}

" Sorts a list using a set of keys generated by mapping the values in the list
" through the given expr.
" v:val is used in {expr}
function! neobundle#util#sort_by(list, expr) "{{{
  let pairs = map(a:list, printf('[v:val, %s]', a:expr))
  return map(s:sort(pairs,
  \      'a:a[1] ==# a:b[1] ? 0 : a:a[1] ># a:b[1] ? 1 : -1'), 'v:val[0]')
endfunction"}}}

" Sorts a list with expression to compare each two values.
" a:a and a:b can be used in {expr}.
function! s:sort(list, expr) "{{{
  if type(a:expr) == type(function('function'))
    return sort(a:list, a:expr)
  endif
  let s:expr = a:expr
  return sort(a:list, 's:_compare')
endfunction"}}}

function! s:_compare(a, b)
  return eval(s:expr)
endfunction

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























































































































































































































































































































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/neobundle/vamkr.vim.

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
"=============================================================================
" FILE: vamkr.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:vamkr = {}

if !exists('*vamkr#AddCopyHook')
  " Dummy function.
  function! vamkr#AddCopyHook(repository, files)
    for [filename, type] in items(a:files)
      " Todo: Support multiple files?
      let a:repository.url .= '/' . type . '/' . filename
    endfor

    " echomsg string(a:repository)
    return a:repository
  endfunction
endif

function! neobundle#vamkr#init() "{{{
  let head = 'https://raw.github.com/MarcWeber/'
        \.'vim-addon-manager-known-repositories/master/db/'

  let s:vamkr.id2name = neobundle#vamkr#parse(head .
        \ 'script-id-to-name-log.json')

  let s:vamkr.vimorgsources = neobundle#vamkr#parse(head .
        \ 'vimorgsources.json')
  let snr_to_name = {}
  call map(copy(s:vamkr.vimorgsources),
        \ 'extend(snr_to_name, {v:val.vim_script_nr : v:key})')
  let s:vamkr.patchinfo = neobundle#vamkr#parse(head .
        \ 'patchinfo.vim')

  " Parse scheme
  let [scm, scmnr]= neobundle#vamkr#parse(head .
        \ 'scmsources.vim')
  let scm_generated = neobundle#vamkr#parse(head .
        \ 'scm_generated.json')
  call extend(scm, scm_generated, 'keep')

  call map(scmnr, "extend(scm, {snr_to_name[v:key] :
        \  extend(v:val, {'vim_script_nr': v:key})})")
  " Change dependencies.
  for depdict in map(filter(values(scm),
        \ "has_key(get(v:val, 'addon-info', {}), 'dependencies')"),
        \ "v:val['addon-info'].dependencies")
    for depname in filter(keys(depdict), 'v:val[0] is# "%"')
      call remove(depdict, depname)
      let depdict[snr_to_name[depname[1:]]] = {}
    endfor
  endfor

  let s:vamkr.scm = scm
endfunction"}}}

function! neobundle#vamkr#get(name) "{{{
  if empty(s:vamkr)
    call neobundle#vamkr#init()
  endif

  " Search from number.
  return has_key(s:vamkr.scm, a:name) ? s:vamkr.scm[a:name]
        \ : get(s:vamkr.vimorgsources, a:name, {})
endfunction"}}}

function! neobundle#vamkr#parse(path) "{{{
  let cache_dir = neobundle#get_neobundle_dir() . '/.neobundle'
  let cache_path = neobundle#cache#getfilename(cache_dir, a:path)

  if !neobundle#cache#filereadable(cache_dir, a:path)
    " Reload cache.

    call neobundle#installer#log(
          \ '[neobundle/search:vim-scripts.org] Reloading cache from ' . a:path)
    redraw

    if neobundle#cache#filereadable(cache_dir, a:path)
      call delete(cache_path)
    endif

    if executable('curl')
      let cmd = 'curl --fail -s -o "' . cache_path . '" '. a:path
    elseif executable('wget')
      let cmd = 'wget -q -O "' . cache_path . '" ' . a:path
    else
      call neobundle#util#print_error(
            \ 'curl or wget command is not available!')
      return []
    endif

    let result = neobundle#util#system(cmd)

    if !filereadable(cache_path)
      call unite#print_error('Cache file was not created!')
      return []
    else
      call neobundle#installer#log('Done!')
    endif
  endif

  if fnamemodify(a:path, ':e') == 'vim'
    try
      execute "function! s:Vim()\n".join(
            \ readfile(cache_path, 'b'), "\n")."\nreturn r\nendfunction"

      sandbox let data = s:Vim()
    catch
      throw 'Execute error: '.v:exception
            \ .' error location ('.a:path.'): '.v:throwpoint
    finally
      silent! delfunction s:Vim
    endtry
  elseif fnamemodify(a:path, ':e') == 'json'
    " JSON.
    try
      sandbox let data = eval(join(readfile(cache_path, 'b'), ''))
    catch
      throw 'Failed to read json file: '.a:path
            \ .': '.v:exception.' '.v:throwpoint
    endtry
  else
    throw 'Unknown path: ' . a:path
  endif

  return data
endfunction"}}}

" __END__
" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/unite/kinds/neobundle.vim.

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
"=============================================================================
" FILE: neobundle.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

function! unite#kinds#neobundle#define() "{{{
  return s:kind
endfunction"}}}

let s:kind = {
      \ 'name' : 'neobundle',
      \ 'action_table': {},
      \ 'parents' : ['uri', 'directory'],
      \ 'default_action' : 'update',
      \}

" Actions "{{{
let s:kind.action_table.update = {
      \ 'description' : 'update bundles',
      \ 'is_selectable' : 1,
      \ 'is_start' : 1,
      \ }
function! s:kind.action_table.update.func(candidates) "{{{
  call unite#start_temporary([['neobundle/update', '!']
        \ + map(copy(a:candidates), 'v:val.action__bundle_name')],
        \ { 'log' : 1, 'script' : 1 })
endfunction"}}}
let s:kind.action_table.delete = {
      \ 'description' : 'delete bundles',
      \ 'is_invalidate_cache' : 1,
      \ 'is_quit' : 0,
      \ 'is_selectable' : 1,
      \ }
function! s:kind.action_table.delete.func(candidates) "{{{
  call call('neobundle#commands#clean', insert(map(copy(a:candidates),
        \ 'v:val.action__bundle_name'), 0))
endfunction"}}}
let s:kind.action_table.reinstall = {
      \ 'description' : 'reinstall bundles',
      \ 'is_selectable' : 1,
      \ }
function! s:kind.action_table.reinstall.func(candidates) "{{{
  call neobundle#installer#reinstall(
        \ map(copy(a:candidates), 'v:val.action__bundle'))
endfunction"}}}
let s:kind.action_table.preview = {
      \ 'description' : 'view the plugin documentation',
      \ 'is_quit' : 0,
      \ }
function! s:kind.action_table.preview.func(candidate) "{{{
  " Search help files.
  let readme = get(split(globpath(
        \ a:candidate.action__path, 'doc/*.?*', 1), '\n'), 0, '')

  if readme == ''
    " Search README files.
    let readme = get(split(globpath(
          \ a:candidate.action__path, 'README*', 1), '\n'), 0, '')
    if readme == ''
      return
    endif
  endif

  let buflisted = buflisted(
        \ unite#util#escape_file_searching(readme))

  pedit `=readme`

  " Open folds.
  normal! zv
  normal! zt

  if !buflisted
    call unite#add_previewed_buffer_list(
          \ bufnr(unite#util#escape_file_searching(readme)))
  endif
endfunction"}}}
"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




















































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/unite/sources/neobundle.vim.

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
"=============================================================================
" FILE: neobundle.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

function! unite#sources#neobundle#define() "{{{
  return s:source
endfunction"}}}

let s:source = {
      \ 'name' : 'neobundle',
      \ 'description' : 'candidates from bundles',
      \ 'hooks' : {},
      \ }

function! s:source.hooks.on_init(args, context) "{{{
  let bundle_names = filter(copy(a:args), 'v:val != "!"')
  let a:context.source__bang =
        \ index(a:args, '!') >= 0
  let a:context.source__bundles = empty(bundle_names) ?
        \ neobundle#config#get_neobundles() :
        \ neobundle#config#search(bundle_names)
endfunction"}}}

" Filters "{{{
function! s:source.source__converter(candidates, context) "{{{
  for candidate in a:candidates
    if candidate.source__uri =~
          \ '^\%(https\?\|git\)://github.com/'
      let candidate.action__uri = candidate.source__uri
      let candidate.action__uri =
            \ substitute(candidate.action__uri, '^git://', 'https://', '')
      let candidate.action__uri =
            \ substitute(candidate.action__uri, '.git$', '', '')
    endif
  endfor

  return a:candidates
endfunction"}}}

let s:source.filters =
      \ ['matcher_default', 'sorter_default',
      \      s:source.source__converter]
"}}}

function! s:source.gather_candidates(args, context) "{{{
  let _ = map(copy(a:context.source__bundles), "{
        \ 'word' : substitute(v:val.orig_name,
        \  '^\%(https\?\|git\)://\%(github.com/\)\?', '', ''),
        \ 'kind' : 'neobundle',
        \ 'action__path' : v:val.path,
        \ 'action__directory' : v:val.path,
        \ 'action__bundle' : v:val,
        \ 'action__bundle_name' : v:val.name,
        \ 'source__uri' : v:val.uri,
        \ 'source__description' : v:val.description,
        \ 'is_multiline' : 1,
        \ }
        \")

  let max = max(map(copy(_), 'len(v:val.word)'))

  call unite#print_source_message(
        \ '#: not sourced, X: not installed', self.name)

  for candidate in _
    let candidate.abbr =
          \ neobundle#is_sourced(candidate.action__bundle_name) ? ' ' :
          \ neobundle#is_installed(candidate.action__bundle_name) ? '#' : 'X'
    let candidate.abbr .= ' ' . unite#util#truncate(candidate.word, max)
    if candidate.source__description != ''
      let candidate.abbr .= ' : ' . candidate.source__description
    endif

    let status = s:get_commit_status(
          \         a:context.source__bang, candidate.action__bundle)
    if status != ''
      let candidate.abbr .= "\n   " . status
    endif

    let candidate.word .= candidate.source__description
  endfor

  return _
endfunction"}}}

function! s:get_commit_status(bang, bundle) "{{{
  if !isdirectory(a:bundle.path)
    return 'Not installed'
  endif

  if a:bang && !neobundle#util#is_windows()
        \ || !a:bang && neobundle#util#is_windows()
    return neobundle#util#substitute_path_separator(
          \ fnamemodify(a:bundle.path, ':~'))
  endif

  let type = neobundle#config#get_types(a:bundle.type)
  let cmd = has_key(type, 'get_revision_pretty_command') ?
        \ type.get_revision_pretty_command(a:bundle) :
        \ type.get_revision_number_command(a:bundle)
  if cmd == ''
    return ''
  endif

  let cwd = getcwd()

  call neobundle#util#cd(a:bundle.path)

  let output = neobundle#util#system(cmd)

  call neobundle#util#cd(cwd)

  if neobundle#util#get_last_status()
    return printf('Error(%d) occured when executing "%s"',
          \ neobundle#util#get_last_status(), cmd)
  endif

  return output
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/unite/sources/neobundle_install.vim.

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
"=============================================================================
" FILE: neobundle/install.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

function! unite#sources#neobundle_install#define() "{{{
  return [s:source_install, s:source_update]
endfunction"}}}

let s:source_install = {
      \ 'name' : 'neobundle/install',
      \ 'description' : 'install bundles',
      \ 'hooks' : {},
      \ 'default_kind' : 'word',
      \ 'syntax' : 'uniteSource__NeoBundleInstall',
      \ }

function! s:source_install.hooks.on_init(args, context) "{{{
  let bundle_names = filter(copy(a:args), "v:val != '!'")
  let a:context.source__bang =
        \ index(a:args, '!') >= 0 || !empty(bundle_names)
  let a:context.source__not_fuzzy = 0
  call s:init(a:context, bundle_names)
endfunction"}}}

function! s:source_install.hooks.on_syntax(args, context) "{{{
  syntax match uniteSource__NeoBundleInstall_Progress /(.\{-}):\s*.*/
        \ contained containedin=uniteSource__NeoBundleInstall
  highlight default link uniteSource__NeoBundleInstall_Progress String
  syntax match uniteSource__NeoBundleInstall_Source /|.\{-}|/
        \ contained containedin=uniteSource__NeoBundleInstall_Progress
  highlight default link uniteSource__NeoBundleInstall_Source Type
endfunction"}}}

function! s:source_install.hooks.on_close(args, context) "{{{
  if !empty(a:context.source__processes)
    for process in a:context.source__processes
      call process.proc.waitpid()
    endfor
  endif
endfunction"}}}

function! s:source_install.async_gather_candidates(args, context) "{{{
  let old_msgs = copy(neobundle#installer#get_log())

  if a:context.source__number < a:context.source__max_bundles
    while a:context.source__number < a:context.source__max_bundles
        \ && len(a:context.source__processes) <
        \      g:neobundle#install_max_processes
      call neobundle#installer#sync(
            \ a:context.source__bundles[a:context.source__number],
            \ a:context, 1)
    endwhile
  endif

  if !empty(a:context.source__processes)
    for process in a:context.source__processes
      call neobundle#installer#check_output(a:context, process, 1)
    endfor

    " Filter eof processes.
    call filter(a:context.source__processes, '!v:val.eof')
  else
    let messages = []

    if empty(a:context.source__synced_bundles)
      let messages += ['[neobundle/install] No new bundles installed.']
    else
      let messages += ['[neobundle/install] Installed/Updated bundles:']
            \ + map(copy(a:context.source__synced_bundles),
            \        'v:val.name')
    endif

    if !empty(a:context.source__errored_bundles)
      let messages += ['[neobundle/install] Errored bundles:']
            \ + map(copy(a:context.source__errored_bundles),
            \        'v:val.name')
      call neobundle#installer#log(
            \ 'Please read error message log by :message command.')
    endif

    call neobundle#installer#log(messages, 1)
    call neobundle#installer#update(
          \ a:context.source__synced_bundles)

    " Finish.
    call neobundle#installer#log('[neobundle/install] Completed.', 1)

    let a:context.is_async = 0
  endif

  return map(neobundle#installer#get_log()[len(old_msgs) :], "{
        \ 'word' : substitute(v:val, '^\\[.\\{-}\\]\\s*', '', ''),
        \ 'is_multiline' : 1,
        \}")
endfunction"}}}

function! s:source_install.complete(args, context, arglead, cmdline, cursorpos) "{{{
  return ['!'] +
        \ neobundle#complete_bundles(a:arglead, a:cmdline, a:cursorpos)
endfunction"}}}

let s:source_update = deepcopy(s:source_install)
let s:source_update.name = 'neobundle/update'
let s:source_update.description = 'update bundles'

function! s:source_update.hooks.on_init(args, context) "{{{
  let a:context.source__bang =
        \ index(a:args, 'all') >= 0 ? 2 : 1
  let a:context.source__not_fuzzy = index(a:args, '!') >= 0
  let bundle_names = filter(copy(a:args),
        \ "v:val !=# 'all' && v:val !=# '!'")
  call s:init(a:context, bundle_names)
endfunction"}}}

function! s:init(context, bundle_names)
  let a:context.source__synced_bundles = []
  let a:context.source__errored_bundles = []

  let a:context.source__processes = []

  let a:context.source__number = 0

  let a:context.source__bundles = !a:context.source__bang ?
        \ neobundle#get_not_installed_bundles(a:bundle_names) :
        \ empty(a:bundle_names) ?
        \ neobundle#config#get_neobundles() :
        \ a:context.source__not_fuzzy ?
        \ neobundle#config#search(a:bundle_names) :
        \ neobundle#config#fuzzy_search(a:bundle_names)

  call neobundle#installer#_load_install_info(
        \ a:context.source__bundles)

  let reinstall_bundles =
        \ neobundle#installer#get_reinstall_bundles(a:context.source__bundles)
  if !empty(reinstall_bundles)
    call neobundle#installer#reinstall(reinstall_bundles)
  endif

  let a:context.source__max_bundles =
        \ len(a:context.source__bundles)

  call neobundle#installer#clear_log()

  if empty(a:context.source__bundles)
    let a:context.is_async = 0
    call neobundle#installer#error(
          \ '[neobundle/install] Target bundles not found.' .
          \ ' You may use wrong bundle name.', 1)
  else
    call neobundle#installer#log(
          \ '[neobundle/install] Update started: ' .
          \     strftime('(%Y/%m/%d %H:%M:%S)'))
  endif
endfunction

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































































































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/unite/sources/neobundle_lazy.vim.

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
"=============================================================================
" FILE: neobundle_lazy.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

function! unite#sources#neobundle_lazy#define() "{{{
  return s:source
endfunction"}}}

let s:source = {
      \ 'name' : 'neobundle/lazy',
      \ 'description' : 'candidates from lazy bundles',
      \ 'action_table' : {},
      \ 'default_action' : 'source',
      \ }

function! s:source.gather_candidates(args, context) "{{{
  let _ = []
  for bundle in filter(copy(neobundle#config#get_neobundles()),
        \ '!neobundle#config#is_sourced(v:val.name)')
    let name = substitute(bundle.orig_name,
        \  '^\%(https\?\|git\)://\%(github.com/\)\?', '', '')
    let dict = {
        \ 'word' : name,
        \ 'kind' : 'neobundle',
        \ 'action__path' : bundle.path,
        \ 'action__directory' : bundle.path,
        \ 'action__bundle' : bundle,
        \ 'action__bundle_name' : bundle.name,
        \ 'source__uri' : bundle.uri,
        \ }
    call add(_, dict)
  endfor

  return _
endfunction"}}}

" Actions "{{{
let s:source.action_table.source = {
      \ 'description' : 'source bundles',
      \ 'is_selectable' : 1,
      \ 'is_invalidate_cache' : 1,
      \ }
function! s:source.action_table.source.func(candidates) "{{{
  call call('neobundle#config#source',
        \ map(copy(a:candidates), 'v:val.action__bundle_name'))
endfunction"}}}
"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
























































































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/unite/sources/neobundle_log.vim.

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
"=============================================================================
" FILE: neobundle/log.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

function! unite#sources#neobundle_log#define() "{{{
  return s:source
endfunction"}}}

let s:source = {
      \ 'name' : 'neobundle/log',
      \ 'description' : 'print previous neobundle install logs',
      \ 'syntax' : 'uniteSource__NeoBundleLog',
      \ 'hooks' : {},
      \ }

function! s:source.hooks.on_syntax(args, context) "{{{
  syntax match uniteSource__NeoBundleLog_Message /.*/
        \ contained containedin=uniteSource__NeoBundleLog
  highlight default link uniteSource__NeoBundleLog_Message Comment
  syntax match uniteSource__NeoBundleLog_Progress /(.\{-}):\s*.*/
        \ contained containedin=uniteSource__NeoBundleLog
  highlight default link uniteSource__NeoBundleLog_Progress String
  syntax match uniteSource__NeoBundleLog_Source /|.\{-}|/
        \ contained containedin=uniteSource__NeoBundleLog_Progress
  highlight default link uniteSource__NeoBundleLog_Source Type
endfunction"}}}

function! s:source.gather_candidates(args, context) "{{{
  return map(copy(neobundle#installer#get_log()), "{
        \ 'word' : substitute(v:val, '^\\[.\\{-}\\]\\s*', '', ''),
        \ }")
endfunction"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


























































































































Deleted vim/.vim/bundle/neobundle.vim/autoload/unite/sources/neobundle_search.vim.

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
"=============================================================================
" FILE: neobundle_search.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

let s:Cache = vital#of('unite').import('System.Cache')

function! unite#sources#neobundle_search#define() "{{{
  " Init sources.
  if !exists('s:neobundle_sources')
    let s:neobundle_sources = {}
    for define in map(split(globpath(&runtimepath,
          \ 'autoload/neobundle/sources/*.vim', 1), '\n'),
          \ "neobundle#sources#{fnamemodify(v:val, ':t:r')}#define()")
      for dict in (type(define) == type([]) ? define : [define])
        if !empty(dict) && !has_key(s:neobundle_sources, dict.name)
          let s:neobundle_sources[dict.name] = dict
        endif
      endfor
      unlet define
    endfor
  endif

  return s:source
endfunction"}}}

let s:plugin_names = []

" Source rec.
let s:source = {
      \ 'name' : 'neobundle/search',
      \ 'description' : 'search plugins for neobundle',
      \ 'hooks' : {},
      \ 'action_table' : {},
      \ 'default_action' : 'yank',
      \ 'max_candidates' : 200,
      \ 'syntax' : 'uniteSource__NeoBundleSearch',
      \ 'parents' : ['uri'],
      \ }

function! s:source.hooks.on_init(args, context) "{{{
  let a:context.source__sources = copy(s:neobundle_sources)
  if !empty(a:args)
    let a:context.source__sources = filter(
          \ a:context.source__sources,
          \ 'index(a:args, v:key) >= 0')
  endif

  let a:context.source__input = a:context.input
  if a:context.source__input == ''
    let a:context.source__input =
          \ unite#util#input('Please input search word: ', '',
          \ 'customlist,unite#sources#neobundle_search#complete_plugin_names')
  endif
endfunction"}}}
function! s:source.gather_candidates(args, context) "{{{
  if neobundle#util#is_sudo()
    call neobundle#util#print_error(
          \ '"sudo vim" is detected. This feature is disabled.')
    return []
  endif

  call unite#print_source_message('Search word: '
        \ . a:context.source__input, s:source.name)

  let candidates = []
  let a:context.source__source_names = []

  let s:plugin_names = []

  for source in values(a:context.source__sources)
    let source_candidates = source.gather_candidates(a:args, a:context)
    let source_name = get(source, 'short_name', source.name)
    for candidate in source_candidates
      let candidate.source__source = source_name
      if !has_key(candidate, 'source__script_type')
        let candidate.source__script_type = ''
      endif
      if !has_key(candidate, 'source__description')
        let candidate.source__description = ''
      endif
    endfor

    let candidates += source_candidates
    call add(a:context.source__source_names, source_name)

    let s:plugin_names += map(copy(source_candidates), 'v:val.source__name')
  endfor

  call s:initialize_plugin_names(a:context)

  return filter(candidates,
        \ 'stridx(v:val.word, a:context.source__input) >= 0')
endfunction"}}}

function! s:source.complete(args, context, arglead, cmdline, cursorpos) "{{{
  let arglead = get(a:args, -1, '')
  return filter(keys(s:neobundle_sources),
        \ "stridx(v:val, arglead) == 0")
endfunction"}}}

function! s:source.hooks.on_syntax(args, context) "{{{
  syntax match uniteSource__NeoBundleSearch_DescriptionLine
        \ / -- .*$/
        \ contained containedin=uniteSource__NeoBundleSearch
  syntax match uniteSource__NeoBundleSearch_Description
        \ /.*$/
        \ contained containedin=uniteSource__NeoBundleSearch_DescriptionLine
  syntax match uniteSource__NeoBundleSearch_Marker
        \ / -- /
        \ contained containedin=uniteSource__NeoBundleSearch_DescriptionLine
  syntax match uniteSource__NeoBundleSearch_Install
        \ / Installed /
        \ contained containedin=uniteSource__NeoBundleSearch
  highlight default link uniteSource__NeoBundleSearch_Install Statement
  highlight default link uniteSource__NeoBundleSearch_Marker Special
  highlight default link uniteSource__NeoBundleSearch_Description Comment
endfunction"}}}

" Actions "{{{
let s:source.action_table.yank = {
      \ 'description' : 'yank plugin settings',
      \ 'is_selectable' : 1,
      \ }
function! s:source.action_table.yank.func(candidates) "{{{
  let @" = join(map(a:candidates,
        \ "'NeoBundle ' . s:get_neobundle_args(v:val)"), "\n")
  if has('clipboard')
    let @* = @"
  endif

  echo 'Yanked plugin settings!'
endfunction"}}}

let s:source.action_table.install = {
      \ 'description' : 'direct install plugins',
      \ 'is_selectable' : 1,
      \ 'is_quit' : 0,
      \ }
function! s:source.action_table.install.func(candidates) "{{{
  for candidate in a:candidates
    execute 'NeoBundleDirectInstall' s:get_neobundle_args(candidate)
  endfor
endfunction"}}}
"}}}

" Filters "{{{
function! s:source.source__sorter(candidates, context) "{{{
  return s:sort_by(a:candidates, 'v:val.source__name')
endfunction"}}}
function! s:source.source__converter(candidates, context) "{{{
  let max_plugin_name = max(map(copy(a:candidates),
        \ 'len(v:val.source__name)'))
  let max_script_type = max(map(copy(a:candidates),
        \ 'len(v:val.source__script_type)'))
  let max_source_name = max(map(copy(a:context.source__source_names),
        \ 'len(v:val)'))
  let format = '%-'. max_plugin_name .'s %-'.
        \ max_source_name .'s %-'. max_script_type .'s -- %s'

  for candidate in a:candidates
    let candidate.abbr = printf(format,
        \          candidate.source__name, candidate.source__source,
        \          candidate.source__script_type,
        \          (neobundle#is_installed(candidate.source__name) ?
        \           'Installed' : candidate.source__description))
    let candidate.is_multiline = 1
    let candidate.kind =
          \ get(candidate, 'action__path', '') != '' ?
          \ 'file' : 'common'
  endfor

  return a:candidates
endfunction"}}}

let s:source.filters =
      \ ['matcher_default', s:source.source__sorter,
      \      s:source.source__converter]
"}}}

" Misc. "{{{
function! s:sort_by(list, expr)
  let pairs = map(a:list, printf('[v:val, %s]', a:expr))
  return map(s:sort(pairs,
        \      'a:a[1] == a:b[1] ? 0 : a:a[1] > a:b[1] ? 1 : -1'), 'v:val[0]')
endfunction

" Sorts a list with expression to compare each two values.
" a:a and a:b can be used in {expr}.
function! s:sort(list, expr)
  if type(a:expr) == type(function('function'))
    return sort(a:list, a:expr)
  endif
  let s:expr = a:expr
  return sort(a:list, 's:_compare')
endfunction

function! s:_compare(a, b)
  return eval(s:expr)
endfunction

function! s:get_neobundle_args(candidate)
  return string(a:candidate.source__path)
          \  . (empty(a:candidate.source__options) ?
          \    '' : ', ' . string(a:candidate.source__options))
          \  . (a:candidate.source__description == '' ? '' :
          \      ' " ' . a:candidate.source__description)
endfunction

function! unite#sources#neobundle_search#complete_plugin_names(arglead, cmdline, cursorpos) "{{{
  return filter(s:get_plugin_names(), "stridx(v:val, a:arglead) == 0")
endfunction"}}}

function! s:initialize_plugin_names(context) "{{{
  let cache_dir = neobundle#get_neobundle_dir() . '/.neobundle'
  let path = 'plugin_names'

  if a:context.is_redraw || !s:Cache.filereadable(cache_dir, path)
    " Convert cache data.
    call s:Cache.writefile(cache_dir, path, [string(s:plugin_names)])
  endif

  return s:get_plugin_names()
endfunction"}}}

function! s:get_plugin_names() "{{{
  let cache_dir = neobundle#get_neobundle_dir() . '/.neobundle'
  let path = 'plugin_names'

  if empty(s:plugin_names) && s:Cache.filereadable(cache_dir, path)
    sandbox let s:plugin_names =
          \ eval(get(s:Cache.readfile(cache_dir, path), 0, '[]'))
  endif

  return neobundle#util#uniq(s:plugin_names)
endfunction"}}}
"}}}

let &cpo = s:save_cpo
unlet s:save_cpo

" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


















































































































































































































































































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/bin/install.sh.

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
#!/bin/sh
# Standalone installer for Unixs
# Original version is created by shoma2da
# https://github.com/shoma2da/neobundle_installer

# Installation directory
BUNDLE_DIR=~/.vim/bundle

# check git command
if type git; then
  : # You have git command. No Problem.
else
  echo 'Please install git command!'
  exit 1;
fi

# make bundle dir and fetch neobundle
echo "Start fetch NeoBundle..."
mkdir -p $BUNDLE_DIR
git clone https://github.com/Shougo/neobundle.vim $BUNDLE_DIR/neobundle.vim
echo "Done."

# write initial setting for .vimrc
echo "Please write NeoBundle initial setting to your vimrc path ..."
{
    echo ""
    echo ""
    echo "\"NeoBundle Scripts-----------------------------"
    echo "if has('vim_starting')"
    echo "  set nocompatible               \" Be iMproved"
    echo ""
    echo "  \" Required:"
    echo "  set runtimepath+=$BUNDLE_DIR/neobundle.vim/"
    echo "endif"
    echo ""
    echo "\" Required:"
    echo "call neobundle#begin(expand('$BUNDLE_DIR'))"
    echo ""
    echo "\" Let NeoBundle manage NeoBundle"
    echo "\" Required:"
    echo "NeoBundleFetch 'Shougo/neobundle.vim'"
    echo ""
    echo "\" My Bundles here:"
    echo "NeoBundle 'Shougo/neosnippet.vim'"
    echo "NeoBundle 'Shougo/neosnippet-snippets'"
    echo "NeoBundle 'tpope/vim-fugitive'"
    echo "NeoBundle 'kien/ctrlp.vim'"
    echo "NeoBundle 'flazz/vim-colorschemes'"
    echo ""
    echo "\" You can specify revision/branch/tag."
    echo "NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' }"
    echo ""
    echo "\" Required:"
    echo "call neobundle#end()"
    echo ""
    echo "\" Required:"
    echo "filetype plugin indent on"
    echo ""
    echo "\" If there are uninstalled bundles found on startup,"
    echo "\" this will conveniently prompt you to install them."
    echo "NeoBundleCheck"
    echo "\"End NeoBundle Scripts-------------------------"
    echo ""
    echo ""
}
echo "Done."

echo "Complete setup NeoBundle!"
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































































































Deleted vim/.vim/bundle/neobundle.vim/bin/neoinstall.

1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

# Detect .vimrc path.
VIMRC=$HOME/.vimrc

if [ ! -e $VIMRC ]; then
        VIMRC=$HOME/.vim/vimrc
fi

vim -N -u $VIMRC -c "try | NeoBundleUpdate! $* | finally | qall! | endtry" \
        -U NONE -i NONE -V1 -e -s
echo ''
<
<
<
<
<
<
<
<
<
<
<
<
























Deleted vim/.vim/bundle/neobundle.vim/bin/neoinstall.bat.

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
@echo off
for /F "usebackq" %%t in (`where vim`) do SET _VIM=%%t
set VIM=%_VIM:\vim.exe=%
if "%HOME%"=="" set HOME=%USERPROFILE%
set _VIMRC=%HOME%\_vimrc
if exist %_VIMRC% goto EXEC_NEOBUNDLE_INSTALL
if not exist %_VIMRC% goto DOTVIMRC

:DOTVIMRC
set VIMRC=%HOME%\.vimrc
if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL
if not exist %VIMRC% goto VIMFILES

:VIMFILES
set VIMRC=%HOME%\vimfiles\vimrc
if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL
if not exist %VIMRC% goto ORIGIN_VIM

:ORIGIN_VIM
set VIMRC=%VIM%\_vimrc
if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL
if not exist %VIMRC% goto NO_EXEC_NEOBUNDLE_INSTALL

@echo on
:EXEC_NEOBUNDLE_INSTALL
vim -N -u %VIMRC% -c "try | NeoBundleUpdate! %* | finally | qall! | endtry" -U NONE -i NONE -V1 -e -s


:NO_EXEC_NEOBUNDLE_INSTALL
echo 'vimrc is NotFound.'
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































Deleted vim/.vim/bundle/neobundle.vim/bin/neoinstall_novimproc.bat.

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
@echo off
for /F "usebackq" %%t in (`where vim`) do SET _VIM=%%t
set VIM=%_VIM:\vim.exe=%
if "%HOME%"=="" set HOME=%USERPROFILE%
set _VIMRC=%HOME%\_vimrc
if exist %_VIMRC% goto EXEC_NEOBUNDLE_INSTALL
if not exist %_VIMRC% goto DOTVIMRC

:DOTVIMRC
set VIMRC=%HOME%\.vimrc
if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL
if not exist %VIMRC% goto VIMFILES

:VIMFILES
set VIMRC=%HOME%\vimfiles\vimrc
if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL
if not exist %VIMRC% goto ORIGIN_VIM

:ORIGIN_VIM
set VIMRC=%VIM%\_vimrc
if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL
if not exist %VIMRC% goto NO_EXEC_NEOBUNDLE_INSTALL

@echo on
:EXEC_NEOBUNDLE_INSTALL
vim -N -u %VIMRC% --cmd "let g:vimproc#disable = 1" -c "try | NeoBundleUpdate! %* | finally | qall! | endtry" -U NONE -i NONE -V1 -e -s


:NO_EXEC_NEOBUNDLE_INSTALL
echo 'vimrc is NotFound.'
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































Deleted vim/.vim/bundle/neobundle.vim/doc/neobundle.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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
*neobundle.txt*	Next generation Vim package manager

Version: 3.0
Author:  Shougo <Shougo.Matsu at gmail.com>
         Copyright (C) 2010 http://github.com/gmarik
License: MIT license  {{{
    Permission is hereby granted, free of charge, to any person obtaining
    a copy of this software and associated documentation files (the
    "Software"), to deal in the Software without restriction, including
    without limitation the rights to use, copy, modify, merge, publish,
    distribute, sublicense, and/or sell copies of the Software, and to
    permit persons to whom the Software is furnished to do so, subject to
    the following conditions:
    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}}}

CONTENTS					*neobundle-contents*

Introduction		|neobundle-introduction|
Usage			|neobundle-usage|
Install			|neobundle-install|
Interface		|neobundle-interface|
  Functions		  |neobundle-functions|
  Commands		  |neobundle-commands|
  Variables		  |neobundle-variables|
  Options		    |neobundle-options|
Configuration Examples	|neobundle-examples|
Migrating from Pathogen |neobundle-migrate-from-pathogen|
Unite sources		|neobundle-unite-sources|
Recipe			|neobundle-recipe|
FAQ			|neobundle-faq|

==============================================================================
INTRODUCTION					*neobundle-introduction*

*neobundle* is the next generation Vim package manager. This plugin is based on
Vundle (https://github.com/gmarik/vundle), but I renamed and added tons of
features.  Because, Vundle's author does not want to add huge features in
Vundle.

Note: Neobundle is not a stable plugin manager.  If you want a stable plugin
manager, you should use Vundle plugin.  It well works widely and it is more
tested.  If you want to use extended features, you can use neobundle.

Vundle features: Stable, simple, good for beginners
Neobundle features: Early development (may break compatibility), very complex,
good for plugin power users (for example, 50+ plugins and over 1000 lines
.vimrc, ...)

Neobundle features:
 * Uses |vimproc| if available
 * |unite.vim| interface
 * Revision lock
 * Supports svn/Mercurial repositories besides Git
 * Can use a different base path
 * Vundle like syntax

==============================================================================
USAGE						*neobundle-usage*

Refer to the example:
|neobundle-examples|

Run this command to update your bundled plugins:
>
	:NeoBundleUpdate
<
Note: To use the unite.vim interface, run this command (requires |unite.vim|):
>
	:Unite neobundle/update
<
Settings for this plugin are compatible with Vundle.vim :-)

You can search popular plugins and add neobundle settings at Vimpusher
(registration required):
	http://www.vimpusher.com/
Or at vim-scripts.org:
	http://vim-scripts.org/

Neobundle now features a plugin search for vim.org scripts (requires
|unite.vim|)
>
	:Unite neobundle/search
<
==============================================================================
INSTALL						*neobundle-install*

Requirements:
* Vim 7.2.051 or above.
* "git" command in $PATH (if you want to install github or vim.org plugins)

First of all, git clone the repository.

Note: You need to have git installed.
>
	$ mkdir -p ~/.vim/bundle
	$ git clone git://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
<
And set up a path to the repository directory.
>
	set runtimepath+={path to neobundle directory}
<
Example:
>
	set runtimepath+=~/.vim/bundle/neobundle.vim
<
Now configure your bundles. (Refer to |neobundle-examples|)

Run the |:NeoBundleInstall| command to install your plugins.
>
	$ vim +NeoBundleInstall +q

or
>
	$ . ~/.vim/bundle/neobundle.vim/bin/neoinstall
<
Note: To use neoinstall in Windows, Vim command must be in $PATH. >
        > .vim/bundle/neobundle.vim/bin/neoinstall
Note: To update and build vimproc in Windows, you can use
"neoinstall_novimproc" command. >
	> .vim/bundle/neobundle.vim/bin/neoinstall_novimproc vimproc.vim

neoinstall can take arguments (install/update plugin names).
>
	# Build vimproc before install plugins
	$ . ~/.vim/bundle/neobundle.vim/bin/neoinstall vimproc.vim
<
==============================================================================
INTERFACE					*neobundle-interface*

------------------------------------------------------------------------------
FUNCTIONS 					*neobundle-functions*

neobundle#begin([{base-path}])			*neobundle#begin()*
		Initializes neobundle.vim. {base-path} is where your
		downloaded plugins will be placed.
		If {base-path} is omitted, neobundle looks for a "bundle"
		directory in the default 'runtimepath'.
		Note: It executes ":filetype off" automatically.
		Note: You must not call the function inside a
		"has('vim_starting')" block.
		Note: It is faster interface than |neobundle#rc()|.
>
	if has('vim_starting')
	  set nocompatible
	  set runtimepath+={path to neobundle directory}
	endif

	call neobundle#begin(expand('~/.vim/bundle'))

	NeoBundle 'git://github.com/Shougo/neocomplcache.git'
	...

	call neobundle#end()

	filetype plugin indent on
<

neobundle#end()					*neobundle#end()*
		Finalize neobundle.vim.  If you use |neobundle#begin()|, you
		must call it after neobundle bundles configuration.

neobundle#rc([{base-path}])			*neobundle#rc()*
		Note: It is old interface.  It is slower than
		|neobundle#begin()|.

neobundle#source({bundle-names})		*neobundle#source()*
		Same as |:NeoBundleSource|.
		{bundle-names} is a list of bundle names.

				*neobundle#exists_not_installed_bundles()*
neobundle#exists_not_installed_bundles()
		Checks if there are any bundles that are not installed.

				*neobundle#get_not_installed_bundle_names()*
neobundle#get_not_installed_bundle_names()
		Returns the names of bundles that are not installed.

						*neobundle#is_installed()*
neobundle#is_installed({bundle-name})
		Checks if bundle {bundle-name} is installed.

						*neobundle#is_sourced()*
neobundle#is_sourced({bundle-name})
		Checks if bundle {bundle-name} is loaded.

						 *neobundle#local()*
neobundle#local({directory}, [{options}, [{names}]])
		Adds the subdirectories in {directory} to
		'runtimepath', like |pathogen| does. See |neobundle-options|
		for keys to set in {options}.
		If {names} is given, {names} directories are only loaded.
		Note: |:NeoBundleLocal| is a shortcut for this function.
>
		" Load plugin from "~/.vim/bundle".
		call neobundle#local("~/.vim/bundle", {})
		" Load plugin1 and plugin2 from "~/.vim/bundle".
		call neobundle#local("~/.vim/bundle",
		\   {}, ['plugin1', 'plugin2'])
<
neobundle#get({bundle-name})			 *neobundle#get()*
		Get the neobundle options dictionary for {bundle-name}.
		Useful for setting hooks.
		Example:
>
	NeoBundleLazy 'tyru/open-browser.vim', '', 'same', { 'autoload' : {
	      \ 'mappings' : '<Plug>(open-browser-wwwsearch)',
	      \ }}
	nmap gs <Plug>(open-browser-wwwsearch)

	let bundle = neobundle#get('open-browser.vim')
	function! bundle.hooks.on_source(bundle)
	  nnoremap <Plug>(open-browser-wwwsearch)
	        \ :<C-u>call <SID>www_search()<CR>
	  function! s:www_search()
	    let search_word = input('Please input search word: ', '',
	          \ 'customlist,wwwsearch#cmd_Wwwsearch_complete')
	    if search_word != ''
	      execute 'OpenBrowserSearch' escape(search_word, '"')
	    endif
	  endfunction
	endfunction
<
neobundle#get_hooks({bundle-name})		 *neobundle#get_hooks()*
		Get the neobundle "hooks" dictionary for {bundle-name}.
		Useful for setting hooks.

neobundle#call_hook({hook-name})		 *neobundle#call_hook()*
		Calls the hook {hook-name}.
		Note: If {hook-name} is "on_source", neobundle will call
		"on_source" hooks in sourced bundles.

neobundle#bundle({repository}, [{options}])	 *neobundle#bundle()*
		Initialize a bundle.
		If {repository} is list, you can initialize options in
		multiple bundles.
		Note: You can use this function instead of |:NeoBundle|
		command.

neobundle#config({bundle-name}, {options})	 *neobundle#config()*
neobundle#config({options})
		Change bundle options for {bundle-name}.
		Note: To lazy-load a plugin, you can set the "lazy" flag after
		calling |:NeoBundle| or |:NeoBundleLocal|.
		It you omit {bundle-name}, it uses |neobundle#tapped|
		variable.
		If {bundle-name} is list, you can change options in multiple
		bundles.
		If {bundle-name} is not configured, it will print error
		messages.
>
	NeoBundle 'Shougo/neocomplcache'
	call neobundle#config('neocomplcache', {
	\ 'lazy' : 1,
	\ 'autoload' : {
	\   'insert' : 1,
	\ }})

	" Use neobundle#tap()
	NeoBundle 'Shougo/neocomplete'
	if neobundle#tap('neocomplete')
	  " Some settings...
	  function! neobundle#hooks.on_source(bundle)
	    " Some settings...
	  endfunction
	  call neobundle#untap()
	endif
<
neobundle#tap({bundle-name})			 *neobundle#tap()*
		Initialize |neobundle#tapped| and |neobundle#hooks| variable
		as {bundle-name} bundle.
		It returns non-zero if {bundle-name} is exists.

neobundle#untap()				 *neobundle#untap()*
		Clear current |neobundle#tapped| and |neobundle#hooks| variable.

neobundle#has_cache()			 *neobundle#has_cache()*
		Checks if a cache file is generated.
		You can optimize the .vimrc loading time by using it
		together with |:NeoBundleLoadCache|.
		Note: You must clear the cache by using |:NeoBundleClearCache|
		if the neobundle configuration is changed.
>
	if neobundle#has_cache()
	  NeoBundleLoadCache
	else
	  " My Bundles here:
	  " ...
	  NeoBundleSaveCache
	endif
<
neobundle#has_fresh_cache()		 *neobundle#has_fresh_cache()*
		Similar to |neobundle#has_cache|, but compares the
		modification time of the cache file to your configuration file
		(|$MYVIMRC|).

------------------------------------------------------------------------------
COMMANDS 					*neobundle-commands*

						*:NeoBundle*
:NeoBundle {repository} [[,{revision}] [,{options}]]
:NeoBundle {repository} ,{revision}, {default} [,{options}]]
		Initialize a bundle.
		{repository} is the repository URI. {revision} is the desired
		revision or branch name. If omitted, the current latest
		revision will be used. {default} is a "default options
		name" (See |g:neobundle#default_options|).
		Note: Don't set neobundle setting in .gvimrc!
		Note: If you omit the protocol (ex: git or https) for a git
		repo, |g:neobundle_default_git_protocol| is used.

		Note: If you manage bundle by neobundle, it may be error
		occurred when update bundles.

		See |neobundle-options| for what to set in {options}.

:NeoBundleInstall [{name}...]			*:NeoBundleInstall*
		Installs plugins specified by {name}. {name} is
		fuzzy-searched.  If {name} is omitted, all configured plugins
		are installed.  Note: {name}s are plugin names like
		"neobundle.vim", not "Shougo/neobundle.vim".

:NeoBundleInstall! [{name}...]			*:NeoBundleInstall!*
		Same as |:NeoBundleUpdate|.

:NeoBundleUpdate [{name}...]			*:NeoBundleUpdate*
		Installs and updates plugins specified by {name}. {name} is
		fuzzy-searched.  If {name} is omitted, all configured plugins
		are installed and updated, except if they are outdated or have
		the "stay_same" option set.
		Note: {name}s are plugin names like "neobundle.vim", not
		"Shougo/neobundle.vim".

:NeoBundleUpdate! [{name}...]			*:NeoBundleUpdate!*
		Same as |:NeoBundleUpdate|, except that it disregards the
		"stay_same" option.

:NeoBundleClean [{bang} [{name}...]] 		*:NeoBundleClean*
		Removes non-configured bundles that still exist in the bundle
		path from the filesystem. If {bang} is added, force remove
		them. If {name}s are added, remove bundles specified by
		{name}s.

:NeoBundleReinstall [{name}...]		 	*:NeoBundleReinstall*
		Reinstalls the bundles specified by {name}.

:NeoBundleList 					*:NeoBundleList*
		Prints a list of configured bundles.

:NeoBundleLog 					*:NeoBundleLog*
		Prints all previous install logs.

:NeoBundleUpdatesLog 				*:NeoBundleUpdatesLog*
		Prints previous update logs.

:NeoBundleLocal {base-directory-path}		*:NeoBundleLocal*
		Registers a bundle from the directories in
		{base-directory-path} like pathogen does.

		Note: If you want to use neobundle like pathogen.vim, you
		should set a different base path from the standard neobundle
		bundles path.
>
		NeoBundleLocal ~/.vim/bundle
<
						*:NeoBundleLazy*
:NeoBundleLazy {repository} [[,{revision}] [,{options}]]
:NeoBundleLazy {repository} ,{revision}, {default} [,{options}]]
		Registers a bundle, but doesn't add it to 'runtimepath'.
>
		NeoBundleLazy 'The-NERD-tree', {'augroup' : 'NERDTree'}
		NeoBundleSource The-NERD-tree
<
		You can use it to load plugins for specific filetypes.
>
		NeoBundleLazy 'Rip-Rip/clang_complete'
		autocmd FileType c,cpp NeoBundleSource clang_complete
<
:NeoBundleSource [{name}...]			*:NeoBundleSource*
		|:source|  the bundles specified by {name}.
		If {name} is omitted, |:source| all lazy bundles.
		Note: This command is used to load the bundles configured with
		|:NeoBundleLazy|.

:NeoBundleFetch {repository} [, {options}]	*:NeoBundleFetch*
		Registers a bundle, but doesn't add it to 'runtimepath'.
		Unlike |:NeoBundleLazy|, you cannot load the bundle with
		|:NeoBundleSource|. This command is useful for managing
		non-Vim plugins using neobundle.
>
		NeoBundleFetch 'davidhalter/jedi'
<
:NeoBundleDocs					*:NeoBundleDocs*
		Execute |:helptags| for all bundles manually.

						*:NeoBundleDirectInstall*
:NeoBundleDirectInstall {repository} [, {options}]
		Registers a bundle, and installs it directly.
		Note: The settings are saved in "extra_bundles.vim" in
		|neobundle#begin()| directory.
		Note: To uninstall direct installed bundles, you must delete
		plugin settings manually in "extra_bundles.vim" in
		|neobundle#begin()| directory and execute |:NeoBundleClean|
		command.
>
		NeoBundleDirectInstall 'Shougo/neocomplcache'
<
						*:NeoBundleExtraEdit*
:NeoBundleExtraEdit
		Edit extra bundles configuration easily.

:NeoBundleDisable {name}...			*:NeoBundleDisable*
		Disables bundles specified by {name}.  If a bundle is
		disabled, its path will be removed from 'runtimepath'.
		Note: This command must be executed before neobundle loads
		the plugins.

:NeoBundleCheck					*:NeoBundleCheck*
		Check plugins installation. If plugins are not installed, it
		will execute |:NeoBundleInstall| automatically. This command
		also check documentation directories and will execute
		|:NeoBundleDocs| automatically.

:NeoBundleCheckUpdate [{name}...]			*:NeoBundleCheckUpdate*
		Check plugins update specified by {name}.  If updates are
		available, it will execute |:NeoBundleUpdate| automatically.
		Note: It is supported in git type only.

						*:NeoBundleRecipe*
:NeoBundleRecipe {recipe-name} [, {options}]
		Registers a bundle from "recipes/{recipe-name}.vimrecipe" file
		in 'runtimepath'.  This command is useful if you don't want to
		set bundle options.
		Note: You must install recipes (|neobundle-recipe|) before
		executing it.
>
		NeoBundleRecipe 'vimproc.vim'
<
						*:NeoBundleCount*
:NeoBundleCount
		Show bundles count.  You can know how many bundles you have.

						*:NeoBundleGC*
:NeoBundleGC [{bundle-names}]
		Execute Garbage Collect commands in bundles.
		If {bundle-name} is omit, all bundles will be GCed.

						*:NeoBundleSaveCache*
:NeoBundleSaveCache
		Save plugin configuration in the cache file.
		Note: It cannot save functions for example "hooks" member.
		Note: It is available when loading .vimrc.

						*:NeoBundleLoadCache*
:NeoBundleLoadCache
		Load plugin configuration from the cache file,
		which is located in `neobundle#get_rtp_dir() . '/cache.vim'`.

						*:NeoBundleClearCache*
:NeoBundleClearCache
		Clear the configuration cache file.

						*:NeoBundleRollback*
:NeoBundleRollback {bundle-name}
		Rollback {bundle-name} plugin version to previous updated
		version.
		Note: If you rollbacked the plugin, you cannot update it by
		|:NeoBundleUpdate| command.  If you want to update it, you
		must reinstall the plugin by |:NeoBundleReinstall| command.

------------------------------------------------------------------------------
VARIABLES 					*neobundle-variables*

neobundle#tapped				*neobundle#tapped*
		Current bundle variable set by |neobundle#tap()|.

neobundle#hooks					*neobundle#hooks*
		Current bundle hooks variable set by |neobundle#tap()|.

g:neobundle#default_site			*g:neobundle#default_site*
		The default repository site if "site" option is omitted.

						*g:neobundle_default_site*
		Note: |g:neobundle_default_site| is obsolete.

		Defaults to "github".

g:neobundle#log_filename			*g:neobundle#log_filename*
		The log filename. Set it to "" to disable logging.

						*g:neobundle_log_filename*
		Note: |g:neobundle_log_filename| is obsolete.

		Defaults to "".

	 				*g:neobundle#enable_name_conversion*
g:neobundle#enable_name_conversion
		If you set to 1 and omit bundle name,
		|neobundle-options-regular_name| is used as bundle name.
		It is useful for absorbing difference of repository name.

g:neobundle#rm_command				*g:neobundle#rm_command*
		The command used to remove files for |:NeoBundleClean|.

						*g:neobundle_rm_command*
		Note: |g:neobundle_rm_command| is obsolete.

		Defaults to "rmdir /S /Q" on Windows or "rm -rf" in
		others.

					*g:neobundle#install_max_processes*
g:neobundle#install_max_processes
		The max number of processes used for neobundle/install source
		asynchronous update.

			*g:unite_source_neobundle_install_max_processes*
		Note: |g:unite_source_neobundle_install_max_processes| is
		obsolete.

		Defaults to "4".

					*g:neobundle#install_process_timeout*
g:neobundle#install_process_timeout
		The time of timeout seconds when updating/installing bundles.
		Note: This feature is available if you installed |vimproc|.

		Defaults to "120".

g:neobundle#default_options			*g:neobundle#default_options*
		A dictionary of preconfigured sets of options to use when
		options are omitted for individual commands or functions.
		Keys are arbitrary names for the option sets, and values are
		dictionaries themselves that store option keys and values.
		Use the special key "_" to store a "default default options".
		Example:
>
		let g:neobundle#default_options =
		          \ { 'rev' : {'rev' : 'ver.8'} }
		NeoBundle 'Shougo/neocomplcache', '', 'rev'
<
		Defaults to "{}".

				*g:neobundle#types#raw#calc_hash_command*
g:neobundle#types#raw#calc_hash_command
		The hash command to use in raw repositories.

		Defaults to "sha1sum" or "md5sum".

				*g:neobundle#types#git#command_path*
g:neobundle#types#git#command_path
		The "git" command path used for git type.

		Defaults to "git".

				*g:neobundle#types#git#default_protocol*
g:neobundle#types#git#default_protocol
		The default protocol used for git (github).
		Note: If you need to use neobundle in proxy or firewall, you
		must use it in "https".

					*g:neobundle_default_git_protocol*
		Note: |g:neobundle_default_git_protocol| is obsolete.

		Defaults to "https".

				*g:neobundle#types#git#enable_submodule*
g:neobundle#types#git#enable_submodule
		If it is non-zero, neobundle enables git submodule support.
		But it may be slow in Windows environment.

		Defaults to 1.

				*g:neobundle#types#git#clone_depth*
g:neobundle#types#git#clone_depth
		The default history depth for "git clone".
		If it is 1, neobundle use shallow clone feature.
		See |neobundle-options-type__depth|.

		Defaults to 0.

				*g:neobundle#types#hg#command_path*
g:neobundle#types#hg#command_path
		The "hg" command path used for hg type.

		Defaults to "hg".

				*g:neobundle#types#hg#default_protocol*
g:neobundle#types#hg#default_protocol
		The default protocol used for hg (bitbucket).

				*g:neobundle#types#svn#command_path*
g:neobundle#types#svn#command_path
		The "svn" command path used for svn type.

		Defaults to "svn".

					*g:neobundle_default_hg_protocol*
		Note: |g:neobundle_default_git_protocol| is obsolete.

		Defaults to "https".

------------------------------------------------------------------------------
OPTIONS 					*neobundle-options*
		The {options} in neobundle commands accept the following keys:

						*neobundle-options-name*
		name			(String)
		Specify the name of the bundle. This is used for neobundle
		management and other commands (like |:NeoBundleUpdate|). If
		omitted, the tail of the repository name will be used.
		Note: Must be unique across all bundles. If a bundle name
		conflicts with another bundle, neobundle will overwrite the
		previous settings with the new one. If a repo tail is bound to
		conflict, you can set the "name" option manually to prevent
		overwriting an existing bundle setting.
		Example:
>
		NeoBundle 'git://github.com/Shougo/unite.vim.git',
		   \ {'name' : 'unite'}
		NeoBundle 'git://github.com/foo/foo.git',
		   \ {'name' : 'foo-foo'}
		NeoBundle 'git://github.com/bar/foo.git',
		   \ {'name' : 'bar-foo'}
		NeoBundle 'git://git.code.sf.net/p/atp-vim/code',
		   \ {'name': 'atp-vim'}
<
					*neobundle-options-regular_name*
		regular_name			(String)
		Specify the normalized name of the bundle. This is used for
		neobundle management to detect dependencies. If omitted,
		neobundle will normalize the tail of the repository name.
		Note: Must be unique across all bundles.
		Normalized name example:
		name            : normalized name
>
		unite.vim         unite
		vim-quickrun      quickrun
<
		description		(String)
		Plugin description.

		rev			(String)
		Specify a revision number or branch/tag name.
		Note: If the type is "raw", rev is hash number.

		Example:
>
		NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' }
<
						*neobundle-options-default*
		default			(String)
		Specify a default option name. (See |g:neobundle#default_options|).

						*neobundle-options-directory*
		directory		(String)
		Specify relative directory path from the base directory (set
		by |neobundle#begin()| or "base" option). If omitted, the "name"
		option will be used.
		Note: If you set rev "foo" when the name key is "neobundle",
		the directory key is "neobundle_foo".

		Example:
>
		NeoBundle 'git://github.com/Shougo/unite.vim.git',
		   \ {'directory' : 'unite'}
<
						*neobundle-options-recipe*
		recipe			(String)
		Use default options from the "recipes/{recipe-name}.vimrecipe"
		file in 'runtimepath'. (See |:NeoBundleRecipe|).

		Example:
>
		NeoBundle 'Shougo/unite.vim', {'recipe' : 'unite'}
<
						*neobundle-options-base_path*
		base			(String)
		Directory base path to use. If omitted, the path specified
		with |neobundle#begin()| will be used. It is useful for
		loading scripts from a different path.
		Example:
						*neobundle-options-type*
		type			(String)
		Specify the repository type. If omitted, a guess is made
		based on {repository}.

		Available types:
		"nosync"    : No synchronous
		"raw"       : Raw plugin file ("script_type" attribute is
		              needed)
		"git"       : Git
		"hg"        : Mercurial
		"svn"       : Subversion

		Example:
>
		NeoBundle 'git://host/path/repo.git', {'type': 'hg'}
		NeoBundle 'thinca/vim-localrc', {'type' : 'svn'}
<
					*neobundle-options-script_type*
		script_type		(String)
		Specify the script type. It is useful for non-official
		categorized plugins.
		For example: "indent", "plugin", "ftplugin", ...
		Example:
>
		NeoBundle 'bronzehedwick/impactjs-colorscheme', {'script_type' : 'colors'}
<
						*neobundle-options-site*
		site			(String)
		Specify the repository site.  If you omit both the repository
		URL and the "site" option, |g:neobundle#default_site| will be
		used.
		Note: You can specify site by "{site-name}:{path}".
		For example: "github:Shougo/vimshell"

		Available sites:
		"github" or "gh"    : github.com (git)
		"bitbucket" or "bb" : bitbucket.org (hg)
		"gist"              : gist.github.com (git)

						*neobundle-options-rtp*
		rtp			(String)
		Specify runtime path.
		Use this option when the repository has the Vim plugin
		in a subdirectory.
		For example: https://github.com/rstacruz/sparkup

		Example:
>
		NeoBundle 'rstacruz/sparkup', {'rtp': 'vim'}
		NeoBundle 'https://code.google.com/p/vimwiki/', {
		    \ 'rtp': "~/.vim/bundle/vimwiki/src",
		    \ }
<
						*neobundle-options-depends*
		depends			(List or String)
		Specify a list of plugins a plugin depends on.
		List items are '{plugin-name}' or ['{plugin-name}', {args}].
		Those specified in the list are installed automatically.  If
		the {plugin-name} needs options, specify them with {args}.
		Note: Type String is syntax sugar for List of {plugin-name}.

		Example:
>
		NeoBundle 'Shougo/vimfiler', {'depends' : 'Shougo/unite.vim' }
		NeoBundle 'Shougo/neocomplcache', {'depends' :
		    \ [ 'Shougo/neosnippet.git',
		    \   ['rstacruz/sparkup', {'rtp': 'vim'}],
		    \ ]}
<
						*neobundle-options-build*
		build			(Dictionary)
		Specify the build script.
		You may use this option if the plugin has to be built before
		use.
		This command is executed by |system()| or |vimproc#system()|
		in plugin runtimepath.
		For example: |vimproc|

		This dictionary accepts the following keys:

			windows		(String)
			Specify Windows environment build script.

			mac		(String)
			Specify Mac OS X environment build script.

			cygwin		(String)
			Specify Cygwin environment build script.

			unix		(String)
			Specify Unix environment build script.

			others		(String)
			Specify others environment build script.

		Example:
>
	      NeoBundle 'Shougo/vimproc.vim', {
	      \ 'build' : {
	      \     'windows' : 'make -f make_mingw32.mak',
	      \     'cygwin' : 'make -f make_cygwin.mak',
	      \     'mac' : 'make -f make_mac.mak',
	      \     'unix' : 'make -f make_unix.mak',
	      \    },
	      \ }
<
						*neobundle-options-augroup*
		augroup		(String)
		Specify an augroup name that the plugin uses for |VimEnter| or
		|GUIEnter| autocmd events.
		Neobundle will call their |VimEnter| or |GUIEnter| autocmds
		automatically when |:NeoBundleSource| is executed.
		Note: You'll want to set this option because some plugins
		rely on autocmds defined for |VimEnter| or |GUIEnter|, but by
		using |:NeoBundleSource| after loading .vimrc, those autocmds
		may get skipped. Some examples are, "fugitive", "NERDTree",
		and "session.vim".

		Examples:
>
	" NERDTree uses augroup NERDTreeHijackNetrw.
	NeoBundle 'scrooloose/nerdtree', { 'augroup' : 'NERDTreeHijackNetrw'}
	" fugitive uses augroup fugitive.
	NeoBundle 'tpope/vim-fugitive', { 'augroup' : 'fugitive'}
<
		This option is also valid in |:NeoBundleLazy|.

					*neobundle-options-external_commands*
		external_commands	(Dictionary or List or String)
		Specify a list of external commands that the plugin depends
		on. List items are '{command-name}' or ['{command-name}',
		...] or { {dictionary} }.
		The commands are checked when loading the plugin.
		Note: Type String is syntax sugar for list of {command-name}s.

		The {dictionary} has following keys:

			windows		(String)
			Specify Windows environment external commands.

			mac		(String)
			Specify Mac OS X environment external commands.

			cygwin		(String)
			Specify Cygwin environment external commands.

			unix		(String)
			Specify Unix environment external commands.

			others		(String)
			Specify others environment external commands.

		Example:
>
		NeoBundle 'ujihisa/neco-ghc', { 'external_commands' : 'ghc-mod' }
<
						*neobundle-options-stay_same*
		stay_same		(Number)
		If set to 1, neobundle doesn't update it automatically when
		|:NeoBundleUpdate| or ":Unite neobundle/update" is called with
		no arguments. It is useful for outdated plugins that can no
		longer be updated.
>
		NeoBundle 'Shougo/neobundle', { 'stay_same' : 1 }
<
						*neobundle-options-lazy*
		lazy			(Number)
		If set to 1, neobundle doesn't add the path to user
		runtimepath.

						*neobundle-options-force*
		force			(Number)
		If set to 1, neobundle will load plugin files in the plugin
		repository forcedly.
		Note: It is useful for using Bundle within bundle.
		https://github.com/Shougo/neobundle.vim/issues/199

						*neobundle-options-overwrite*
		overwrite		(Number)
		If set to 1, neobundle doesn't overwrite the path to user
		runtimepath.

						*neobundle-options-resettable*
		resettable		(Number)
		If set to 0, neobundle doesn't reset the path in
		|neobundle#begin()|.

						*neobundle-options-gui*
		gui			(Number)
		If set 1, neobundle will only load the plugin in GUI Vim.

		Example: >
	NeoBundleLazy 'tyru/restart.vim', '', 'same', {
	      \ 'gui' : 1,
	      \ 'autoload' : {
	      \  'commands' : 'Restart'
	      \ }}
<
						*neobundle-options-terminal*
		terminal		(Number)
		If set to 1, neobundle will only load the plugin in Terminal
		Vim.

						*neobundle-options-vim_version*
		vim_version		(String)
		Minimal vim version of the plugin supported.
		It accepts some version formats such as "7" and "7.3" and
		"7.3.885".

						*neobundle-options-disabled*
		disabled		(Number)
		If set to 1, neobundle will disable the plugin.

		Example: >
	" neocomplete requires vim 7.3.885 or above.
	NeoBundle 'Shougo/neocomplete', {
	    \ 'depends' : 'Shougo/context_filetype.vim',
	    \ 'disabled' : !has('lua'),
	    \ 'vim_version' : '7.3.885'
	    \ }
<
						*neobundle-options-focus*
		focus		(Number)
		If it is > 0, neobundle will source the plugin when focus
		is lost.  It also is source priority.
		http://d.hatena.ne.jp/osyo-manga/20140212/1392216949
		Example: >
	" Source all plugins when focus is lost.
	let g:neobundle#default_options._ = { 'verbose' : 1, 'focus' : 1 }
<
						*neobundle-options-verbose*
		verbose		(Number)
		If set to 1, neobundle will print message when it is sourced.

						*neobundle-options-autoload*
		autoload		(Dictionary)
		Specify autoload conditions.
		If you set it, neobundle will execute |:NeoBundleSource|
		automatically when the conditions are met.
		Note: You can omit "autoload" dictionary. It is useful for
		|:NeoBundleLazy| command.

		This dictionary accepts the following keys:

			filetypes	(List) or (String)
			Filetype list.

			filename_patterns	(List) or (String)
			Filename regex pattern list.

			commands	(List) or (String)
			Command list. The item can be following dictionary.
				name		(String)
				Command name.

				complete	(String)
				The type of completion supported for the
				input.  Refer to |:command-completion| for
				information.

				Example:

			functions	(List) or (String)
			Functions list.

			mappings	(List) or (String)
			Mappings 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: But you cannot use lazy <Plug> mappings twice.
			For example: >
			NeoBundleLazy 'osyo-manga/vim-anzu', {
			  \'autoload': {'mappings': '<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
<
			unite_sources	(List) or (String)
			Unite source name list.
			Note: To use this feature, you must install latest
			|unite.vim|.
			Note: If bundle name starts "unite-", this option is
			set automatically.

			insert		(Number)
			If set to non-zero, neobundle will |:NeoBundleSource|
			on |InsertEnter| autocmd.

			explorer	(Number)
			If set to non-zero, neobundle will |:NeoBundleSource|
			on editing non-file.
			Note: It is useful for explorer behavior plugins.
			Ex: vimfiler, metarw...
			Note: To autoload vimfiler, you must disable netrw in
			.vimrc. >
			" Disable netrw.vim
			let g:loaded_netrwPlugin = 1
<
			on_source	(List) or (String)
			Load the bundle when the list bundles are loaded.
			For example: >
			if neobundle#tap('plugin-B.vim')
			  call neobundle#config({
			        \   'autoload' : {
			        \     'on_source' : [ 'plugin-A.vim' ]
			        \   }
			        \ })
			  call neobundle#untap()
			endif
<
			plugin-B is loaded before plugin-A is loaded.

			function_prefix	(String)
			Autoload function prefix in functions.
			{function_prefix}#...
			If the prefix is set, functions were loaded
			automatically.
			If omitted it, automatically generated prefix is used.
			Example: If you use "unite.vim", "unite" function
			prefix is used.

		Examples:
>
	NeoBundleLazy 'Rip-Rip/clang_complete', {
	      \ 'autoload' : {
	      \     'filetypes' : ['c', 'cpp'],
	      \    },
	      \ }
	NeoBundleLazy 'basyura/TweetVim', { 'depends' :
	      \ ['basyura/twibill.vim', 'tyru/open-browser.vim'],
	      \ 'autoload' : { 'commands' : 'TweetVimHomeTimeline' }}
	NeoBundleLazy 'kana/vim-smartword', { 'autoload' : {
	      \ 'mappings' : [
	      \   '<Plug>(smartword-'']
	      \ }}
	NeoBundleLazy 'Shougo/vim-vcs', {
	      \ 'depends' : 'thinca/vim-openbuf',
	      \ 'autoload' : {'functions' : 'vcs#info', 'commands' : 'Vcs'},
	      \   }
	NeoBundleLazy 'Shougo/vimshell',{
	      \ 'depends' : 'Shougo/vimproc.vim',
	      \ 'autoload' : {
	      \   'commands' : [{ 'name' : 'VimShell',
	      \                   'complete' : 'customlist,vimshell#complete'},
	      \                 'VimShellExecute', 'VimShellInteractive',
	      \                 'VimShellTerminal', 'VimShellPop'],
	      \   'mappings' : ['<Plug>(vimshell_']
	      \ }})
	NeoBundleLazy 'Shougo/vimfiler', {
	      \ 'depends' : 'Shougo/unite.vim',
	      \ 'autoload' : {
	      \    'commands' : [{ 'name' : 'VimFiler',
	      \                    'complete' : 'customlist,vimfiler#complete' },
	      \                  'VimFilerExplorer',
	      \                  'Edit', 'Read', 'Source', 'Write'],
	      \    'mappings' : ['<Plug>(vimfiler_'],
	      \    'explorer' : 1,
	      \ }
	      \ }
	NeoBundleLazy 'Shougo/junkfile.vim', {
	      \ 'autoload' : {
	      \   'commands' : 'JunkfileOpen',
	      \   'unite_sources' : ['junkfile', 'junkfile/new'],
	      \ }}
	NeoBundleLazy 'tyru/winmove.vim', { 'autoload' : {
	      \ 'mappings' : [
	      \   ['n', '<Plug>(winmove-']],
	      \ },
	      \ 'gui' : 1,
	      \ 'augroup' : 'winmove',
	      \ }
	NeoBundleLazy 'sophacles/vim-processing', { 'autoload' : {
	      \'filename_patterns': '\.pde$'
	      \}}
	" Omit autoload dictionary.
	NeoBundleLazy 'LeafCage/cmdlineplus.vim', {
	      \ 'mappings': [['c', '<Plug>(cmdlineplus-']]}
<
						*neobundle-options-hooks*
		hooks			(Dictionary)
		Specify hook functions or hook script path. The following
		hooks are defined:

						*neobundle-hooks-on_source*
			on_source
			Called or sourced before scripts are sourced. It is
			useful for plugin initialization in lazy bundles.
			Note: In Vim initializing, calling the hooks are
			delayed until |VimEnter|.
			Note: To re-call on_source hook when reloading .vimrc,
			you must call the hook in end of .vimrc.

					*neobundle-hooks-on_post_source*
			on_post_source
			Called or sourced after scripts are sourced.
			Note: In Vim initializing, calling the hooks are
			delayed until |VimEnter|.
			Note: To re-call on_source hook when reloading .vimrc,
			you must call the hook in end of .vimrc.

					*neobundle-options-type__protocol*
		type__protocol		(String)
		The protocol used for types.
		"https" and "git" and "ssh" are available for git type.
		"https" is available for hg type.
		If omitted, |g:neobundle#types#git#default_protocol|
		or |g:neobundle#types#hg#default_protocol| is used.
		Note: This attribute is available in git and hg types only.

		Examples:
>
		NeoBundle 'ujihisa/neco-ghc', { 'type__protocol' : 'ssh' }
<
					*neobundle-options-type__filename*
		type__filename		(String)
		The downloaded filename.
		If omitted, URI filename will be used.
		It is useful for downloading vim.org scripts.
		Note: This attribute is available in raw type only.

		Examples:
>
		NeoBundle 'http://www.vim.org/scripts/download_script.php?src_id=19619',
		\ { 'type__filename' : 'python.vim', 'script_type' : 'syntax' }
<
		Examples:			|:NeoBundle-examples|
>
		NeoBundle 'git_repository_uri'
		NeoBundle 'script_name'
		NeoBundle 'http://github.com/tpope/vim-fugitive.git'
		NeoBundle 'Shougo/neocomplcache', {'depends' :
		    \ [ 'Shougo/neosnippet.git',
		    \   ['rstacruz/sparkup', {'rtp': 'vim'}],
		    \ ]}
		NeoBundle 'github:Shougo/vimshell'

		" Pushable github repository.
		NeoBundle 'git@github.com:Shougo/neocomplcache.git'

		" For bitbucket svn repository.
		NeoBundle 'http://svn.macports.org/repository/macports/contrib/mpvim/'

		" For bitbucket hg repository.
		NeoBundle 'bitbucket:ns9tks/vim-fuzzyfinder'
		NeoBundle 'https://bitbucket.org/ns9tks/vim-fuzzyfinder'

		" For bitbucket git repository (.git is needed).
		NeoBundle 'bitbucket:kh3phr3n/vim-qt-syntax.git'
		NeoBundle 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git'

		" For raw repository.
		NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
		      \ {'script_type' : 'plugin'}

		" For gist repository.
		NeoBundle 'gist:Shougo/656148', {
		      \ 'name': 'everything.vim',
		      \ 'script_type': 'plugin'}
		NeoBundle 'gist:355360', {
		      \ 'name': 'ambicmd.vim',
		      \ 'script_type': 'plugin'}
<
		Neobundle supports revision (or branch) lock.
		Note: The revision (or branch) is checked out in
		install/update.
		Note: You can either specify the revision manually or set the
		to revision "master" to restore a plugin.
>
		NeoBundle 'Shougo/vimshell', '3787e5'
		NeoBundle 'Shougo/vimshell', 'master'
<
		If type is "nosync", neobundle does not update
		automatically (like pathogen.vim). See also |NeoBundleLocal|.
>
		NeoBundle 'muttator', {'type' : 'nosync', 'base' : '~/.vim/bundle'}
<
		Note: To use hg commands for git repository, please use this.
>
		NeoBundle 'git://github.com/Shougo/neobundle.vim.git', {'type': 'hg'}
<
					*neobundle-options-type__depth*
		type__depth		(Number)
		History depth for "git clone".
		If omitted, |g:neobundle#types#git#clone_depth| is used.
		If it is than 0, neobundle clones the repository by shallow
		clone. Shallow clone feature saves your repository clone time.
		But it have problems in some repository. You should use "git"
		protocol if it is available.
		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.

==============================================================================
EXAMPLES					*neobundle-examples*
>
	if has('vim_starting')
	  set nocompatible                " Recommend
	  set runtimepath+={path to neobundle directory}
	endif

	" Use git protocol.
	" let g:neobundle#types#git#default_protocol = 'git'

	call neobundle#begin(expand('~/.vim/bundle'))

	" Let neobundle manage neobundle
	NeoBundleFetch 'Shougo/neobundle.vim'

	" Use neobundle standard recipes.
	NeoBundle 'Shougo/neobundle-vim-recipes'

	" My Bundles here:
	" Refer to |:NeoBundle-examples|.
	" Note: You don't set neobundle setting in .gvimrc!

	" ...

	call neobundle#end()

	filetype plugin indent on       " Required!

	" Installation check.
	NeoBundleCheck

	"...

	if !has('vim_starting')
	  " Call on_source hook when reloading .vimrc.
	  call neobundle#call_hook('on_source')
	endif
<
==============================================================================
MIGRATING FROM PATHOGEN                 *neobundle-migrate-from-pathogen*

Here are a few tips if you want to migrate from a |pathogen| based
installation to neobundle.

You might want to use a different/non-default directory for neobundle: >

  set rtp+=~/.vim/bundle/neobundle
  call neobundle#begin(expand('~/.vim/neobundle'))
<
This allows you to keep `~/.vim/bundle` in place while migrating.

If you are using Git submodules currently, you can use a shell command like
the following to automatically generate your NeoBundle statements: >

    while read p url; do \
      bundle_name="${url#*://github.com/}"; \
      dir="$(command git config -f .gitmodules --get ${p%.url}.path)"; \
      echo "NeoBundle '$bundle_name', { 'directory': '${dir##*/}' }"; \
    done < <(command git config -f .gitmodules \
      --get-regexp 'submodule.vim/bundle/\S+.(url)' | sort)
<
This uses the "submodule.*" urls and path from your .gitmodules sections that
start with `submodule.vim/bundle/`.
It sets the directory option explicitly to the name you were using before
(see |neobundle-options-directory|), which is useful if you want to compare
your old bundles directory with the one managed by neocomplete later.

The output looks like this: >
  NeoBundle 'tpope/vim-abolish.git', { 'directory': 'abolish' }
>
==============================================================================
UNITE SOURCES					*neobundle-unite-sources*

Here let me explain about a source for |unite| provided in neobundle.

					*neobundle-unite-source-neobundle*
neobundle
		Nominates bundles as a candidate.

		Note: On windows
		If argument is bang(!), print plugins path instead of plugins
		status.
		Note: Other platforms
		If argument is bang(!), print plugins status instead of plugins
		path.

		http://github.com/Shougo/vimproc.vim

				*neobundle-unite-source-neobundle-install*
neobundle/install
		Install configured plugins asynchronously.

		Note: To install |vimproc| plugin is recommended.
		http://github.com/Shougo/vimproc.vim

		If argument is bang(!), it will install and update all plugins.

		Source arguments:
		bundle names (fuzzy searched).

		Example:
>
		:Unite neobundle/install:!
		:Unite neobundle/install:neocomplcache
		:Unite neobundle/install:neocomplcache:unite.vim
<
		If you use the source with "-auto-quit" option, the unite
		buffer will close automatically.
>
		:Unite neobundle/install -auto-quit
<
					*neobundle-unite-source-neobundle-log*
neobundle/log
		Print previous neobundle install logs.

				*neobundle-unite-source-neobundle-update*
neobundle/update
		Install and update configured plugins asynchronously, except
		for outdated ones or those with the "stay_same" option.
		Note: This source is the same as "neobundle/install:!".
		Note: Installing the |vimproc| plugin is recommended.

		If argument is bang(!), it will not be with fuzzy search.
		If argument is "all", it will update all plugins.

		If you use the source with "-auto-quit" option, the unite
		buffer will close automatically.
>
		:Unite neobundle/update -log -wrap -auto-quit
<
				*neobundle-unite-source-neobundle-search*
neobundle/search
		Search plugin settings from sources.
		Note: This source requires "curl" or "wget" command.
		Note: If you get errors in this source, please refresh the
		cache file by |<Plug>(unite_redraw)|.

		Source arguments:
		source names.

		Following source names are available:
		"vim-script.org":
			Search plugins settings from "http://vim-scripts.org/".
		"neobundle-vim-recipes":
			Search plugins settings from the |neobundle-recipe|.
		"github":
			Search plugins settings from "http://github.org/".

				*neobundle-unite-source-neobundle-lazy*
neobundle/lazy
		List lazy configured plugins (not sourced by
		|:NeoBundleSource|).

							*unite-kind-neobundle*
neobundle		An interface for neobundle bundles. It is used in
			neobundle source and neobundle/lazy sources.
	update		Update bundles (Default action)
	delete		Delete bundles
	preview		view the plugin documentation
	reinstall	Reinstall bundles
	narrow		Narrow bundle files
	edit		Browse bundle directory
	start		Browse github plugin page

Actions for each of the sources

neobundle/search			*unite-action-neobundle-search*
	yank		Yank plugin settings (Default action).
	install		Direct install plugins from repository.
			Note: The settings are saved in "extra_bundles.vim" in
			|neobundle#begin()| directory.
	start		Browse github plugin page.
	open		Open the recipe file.

	Note: If you use the install action, you cannot customize the bundle
	settings.

neobundle/lazy					*unite-action-neobundle-lazy*
	source		Source plugin files (Default action)

==============================================================================
RECIPE						*neobundle-recipe*

neobundle/search source loads recipes from "recipes/*.vimrecipe" files in
'runtimepath'.

The standard recipes are in "neobundle-vim-recipes".

https://github.com/Shougo/neobundle-vim-recipes

You can use the recipes with the following command in .vimrc.
>
	NeoBundle 'Shougo/neobundle-vim-recipes'
<

The recipe files are in JSON format, like this:

>
	# Vim recipe file for neobundle.
	{
	        'name' : 'neobundle',
	        'path' : 'Shougo/neobundle',
	        'description' : 'Ultimate Vim package manager',
	        'author' : 'Shougo',
	        'website' : 'https://github.com/Shougo/neobundle.vim'
	}
<
		A recipe has the following keys. Most of keys are the same as
		those used in the neobundle configuration
		dictionary (|neobundle-options|).
		"#" starts a comment string, but they must start at the
		beginning of the line.

		name			(String)	(Required)
		Specify plugin name.

		path			(String)	(Required)
		The repository URI.
		Note: You can abbreviate long complete path, such as
		"Shougo/neobundle.vim" instead of
		"git://github.com/Shougo/neobundle.vim.git"

		description		(String)	(Optional)
		Plugin description to show in neobundle/search.

		author			(String)	(Optional)
		The script author name to show in neobundle/search.

		base			(String)	(Optional)
		Directory base path.

		type			(String)	(Optional)
		Specify repository type.

		script_type		(String)	(Optional)
		Specify script type.

		site			(String)	(Optional)
		Repository site.

		rtp			(String)	(Optional)
		Runtime path. Some plugin repositories contain the
		vim plugins in a subdirectory, whose name is usually
		"vim".

		autoload		(Dictionary)	(Optional)
		Autoload rules. See |neobundle-options-autoload|.

		depends		(List or String)	(Optional)
		Dependency plugins list.

		build			(Dictionary)	(Optional)
		Build script. E.g. make

		external_commands
			(Dictionary or List or String)	(Optional)
		Dependency external commands.

==============================================================================
FAQ						*neobundle-faq*

Q: What's the neobundle advantage for Vundle or other plugin management
system?

A: neobundle solves some problems in Vundle or other plugin management system.
But you must know they are huge and complex features.

   1. Plugin prefixed command name (:Bundle vs :NeoBundle).
   https://github.com/gmarik/Vundle.vim/issues/76
   2. Support vimproc (asynchronous update/install).
   https://github.com/gmarik/Vundle.vim/issues/259
   3. Support unite.vim interface (update/install/search).
   4. Support revision lock feature.
   https://github.com/gmarik/Vundle.vim/issues/35
   5. Support other VCS (Subversion/Git).
   https://github.com/gmarik/Vundle.vim/pull/134
   https://github.com/gmarik/Vundle.vim/pull/268
   6. Support lazy initialization for optimizing startup time.
   https://github.com/gmarik/Vundle.vim/issues/364
   https://github.com/gmarik/Vundle.vim/pull/98

Q: I want to manage the rsense Vim plugin using neobundle.

A: Use |neocomplcache-rsense|. Installation and settings can be found in the
neocomplcache-rsense docs.
Note: neocomplcache-rsense depends |neocomplcache| plugin.

https://github.com/Shougo/neocomplcache-rsense

Q: I want to use "https" protocol instead of "git" (over proxy).

A: Change |g:neobundle#types#git#default_protocol|.
>
	let g:neobundle#types#git#default_protocol = 'https'
<

Q: Vim freezes when a NeoBundle command is run with a typo in the repo name.

A: It's a git feature. Git awaits user input when the repo name is
wrong. You can install |vimproc| to keep your Vim from freezing:
	https://github.com/Shougo/vimproc.vim

Q: Duplicated error was printed when sourcing .vimrc.

A: Your .vimrc was wrong. You must reset neobundle setting by
|neobundle#begin()| in .vimrc.
Note: You must not call |neobundle#begin()| inside a "has('vim_starting')"
block.
>
	if has('vim_starting')
	  set runtimepath+={path to neobundle directory}
	  " This is wrong neobundle#begin().
	  "call neobundle#begin(expand('~/.vim/bundle'))
	endif

	" This is OK.
	call neobundle#begin(expand('~/.vim/bundle'))
<

Q: I want to compile vimproc automatically.

A:
>
	let vimproc_updcmd = has('win64') ?
	  \ 'tools\\update-dll-mingw 64' : 'tools\\update-dll-mingw 32'
	execute "NeoBundle 'Shougo/vimproc.vim'," . string({
		\ 'build' : {
		\     'windows' : vimproc_updcmd,
		\     'cygwin' : 'make -f make_cygwin.mak',
		\     'mac' : 'make -f make_mac.mak',
		\     'unix' : 'make -f make_unix.mak',
		\    },
		\ })
<
Note that arguments of NeoBundle command are evaluated inside the NeoBundle
command. Thus, local variables cannot be passed to NeoBundle command. If you
want to use local variables as arguments of NeoBundle command, you have to
expand them into a string and pass it to `:execute` command.


Q: What's the "outdated" plugin?

A: Last update time is older than one week -> Automatic updates are disabled
until one day from the last update.
Last update time is older within one week -> Automatic updates are every time.
Note: If you use update with name or use "all" argument in neobundle/update
source or use "!" in |:NeoBundleUpdate| command, this feature will be
disabled; it forces updates them.

Q: I want to update messages in unite buffer.

A:
>
	Unite -log -wrap neobundle/update
<

Q: neobundle.vim is not worked in Debian/Ubuntu Linux...

A: Did you use "debian.vim"? "debian.vim" changes 'runtimepath'.
So it conflicts with neobundle. You should not use "debian.vim".

Q: neobundle.vim fails update in submodule repository.

A: neobundle.vim supports submodule repository. But I think the repository was
changed recently from non-use submodule to use submodule. You must reinstall
the repository.

Q: I want to install github plugins with Subversion.

A:
>
		NeoBundle 'thinca/vim-localrc', {'type' : 'svn'}
<
Q: Why change git default protocol to "https" from "git"?
After update, neobundle asks me to update all of my plugins.  It's a kind of
nightmare.

A: Because, github changed default protocol "git" to "https".
https://help.github.com/articles/which-remote-url-should-i-use

In above page, git protocol description is not found.

I think git protocol is default protocol for git and it is fast.
But in proxy or firewall environment, git protocol cannot be used.
I responded the firewall problem recently.

If you don't want to change default protocol, you can set
|g:neobundle#types#git#default_protocol| manually.  I don't change the default
value.

Q: I want to add absolute path in 'runtimepath' with |:NeoBundle| and
|:NeoBundleLazy|.
https://github.com/Shougo/neobundle.vim/issues/136

A: You can use "nosync" type. >
	NeoBundle '/absolute/path/to/plugin', { 'type' : 'nosync' }

Q: For example, I would like to register the IR_Black colorscheme from it's
original URL, without cloning one of the many mirror repo.
https://github.com/Shougo/neobundle.vim/issues/140

A: This feature is already implemented. >
	NeoBundle 'http://blog.toddwerth.com/entry_files/8/ir_black.vim', {
	\ 'name': 'ir_black.vim',
	\ 'script_type': 'colors'}

Q: Problem with lazy loading of matchit plugin.
https://github.com/Shougo/neobundle.vim/issues/153

A:
>
	NeoBundleLazy 'matchit.zip', { 'autoload' : {
	      \ 'mappings' : ['%', 'g%']
	      \ }}
	let bundle = neobundle#get('matchit.zip')
	function! bundle.hooks.on_post_source(bundle)
	  silent! execute 'doautocmd Filetype' &filetype
	endfunction
<

Q: Cannot load colorscheme when reloading .vimrc.
https://github.com/Shougo/neobundle.vim/issues/157

A: You must write :NeoBundle lines before filetype plugin indent on and syntax
enable.
>
	filetype plugin indent on

	NeoBundle 'tomasr/molokai'
	...

	syntax enable
	colorscheme molokai
<

Q: Timeout on github makes Vim terribly slow if the repository is not found in
console Vim.
https://github.com/Shougo/neobundle.vim/issues/175

A: |vimproc| and |system()| uses input redirection.  But git ignores it when
you used https protocol in console Vim. So it freezes. I think it is bad
feature in git. I cannot fix it.  You should change
|g:neobundle#types#git#default_protocol| to "git".

Q: I want to use shallow clone in git.

A: See |neobundle-options-type__depth|.

==============================================================================
vim:tw=78:ts=8:ft=help:norl:noet:fen:
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/ftdetect/vimrecipe.vim.

1
2
" Detect syntax file.
autocmd BufNewFile,BufRead *.vimrecipe set filetype=vimrecipe
<
<




Deleted vim/.vim/bundle/neobundle.vim/plugin/neobundle.vim.

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
"=============================================================================
" FILE: neobundle.vim
" AUTHOR:  Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

if exists('g:loaded_neobundle')
  let &cpo = s:save_cpo
  unlet s:save_cpo

  finish
elseif v:version < 702 || (v:version == 702 && !has('patch51'))
  " Neobundle uses glob()/globpath() another parameter.
  " It is implemented in Vim 7.2.051.
  echoerr 'neobundle does not work this version of Vim "' . v:version . '".'
        \ .' You must use Vim 7.2.051 or later.'

  let &cpo = s:save_cpo
  unlet s:save_cpo

  finish
endif

let g:loaded_neobundle = 1

let &cpo = s:save_cpo
unlet s:save_cpo

" __END__
" vim: foldmethod=marker
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































































Deleted vim/.vim/bundle/neobundle.vim/syntax/vimrecipe.vim.

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
"=============================================================================
" FILE: syntax/recipe.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license  {{{
"     Permission is hereby granted, free of charge, to any person obtaining
"     a copy of this software and associated documentation files (the
"     "Software"), to deal in the Software without restriction, including
"     without limitation the rights to use, copy, modify, merge, publish,
"     distribute, sublicense, and/or sell copies of the Software, and to
"     permit persons to whom the Software is furnished to do so, subject to
"     the following conditions:
"
"     The above copyright notice and this permission notice shall be included
"     in all copies or substantial portions of the Software.
"
"     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
"     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
"     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
"     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
"     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
"     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
"     SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

if version < 700
  syntax clear
elseif exists('b:current_syntax')
  finish
endif

syntax region  recipeString    start=+"+  skip=+\\\\\|\\"+  end=+"+  contains=recipeEscape
syntax region  recipeString    start=+'+  skip=+\\\\\|\\"+  end=+'+

syntax match   recipeEscape    '\\["\\/bfnrt]' contained
syntax match   recipeEscape    '\\u\x\{4}' contained

syntax match   recipeNumber    '-\?\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\?\>'

syntax match   recipeBraces    '[{}\[\]]'
syntax match   recipeComment   '^\s*#.*$'


highlight def link recipeString             String
highlight def link recipeEscape             Special
highlight def link recipeNumber             Number
highlight def link recipeBraces             Operator
highlight def link recipeComment            Comment

let b:current_syntax = 'recipe'

let &cpo = s:save_cpo
unlet s:save_cpo
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































































































Deleted vim/.vim/bundle/neobundle.vim/test/readme.md.

1
2
3
4
To execute neobundle test:

  cd # {neobundle.vim path}
  vim -u test/vimrc -U NONE --noplugin
<
<
<
<








Deleted vim/.vim/bundle/neobundle.vim/test/vimrc.

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
if has('vim_starting')
  set nocompatible                " recommend
  execute 'set' 'runtimepath+='.getcwd()
endif

let testdir = expand('~/neobundle-test/bundles', 1)

call neobundle#rc(expand(testdir, 1))

let g:neobundle#types#git#default_protocol = 'https'

" My Bundles here:
"

" Original repositories in github.
NeoBundle 'Shougo/neocomplcache-clang.git'

" Omit suffix.
NeoBundle 'Shougo/vimshell'

" Vim-script repositories.
NeoBundle 'rails.vim'

" Non-github repos.
NeoBundle 'git://git.wincent.com/command-t.git'

" Username with dashes.
NeoBundle 'vim-scripts/ragtag.vim'

" Original repo.
NeoBundle 'altercation/vim-colors-solarized'

" With extension.
" Comment is allowed.
NeoBundle 'nelstrom/vim-mac-classic-theme.git' " Foo, Bar

" Invalid uri.
NeoBundle 'nonexistinguser/hogehoge.git'

" Full uri.
NeoBundle 'https://github.com/vim-scripts/vim-game-of-life'
NeoBundle 'git@github.com:gmarik/ingretu.git'

" Short uri.
NeoBundle 'gh:gmarik/snipmate.vim.git'
NeoBundle 'github:mattn/gist-vim.git'

" Camel case.
NeoBundle 'vim-scripts/RubySinatra'

" Non-git repos.
NeoBundle 'http://svn.macports.org/repository/macports/contrib/mpvim/'

" With options.
NeoBundle 'git://github.com/Shougo/unite.vim.git', {'directory' : 'unite'}
NeoBundle 'Shougo/vimshell', '3787e5'

" Nosync repos.
NeoBundle 'muttator', {'type' : 'nosync', 'base' : '~/.vim/bundle'}

" Raw repos.
NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
      \ {'script_type' : 'plugin'}

" NeoBundleLocal test.
NeoBundleLocal ~/.vim/bundle/

" Depends repos.
NeoBundle 'Shougo/neocomplcache',
      \ {'depends' : [
      \   'Shougo/neocomplcache-snippets-complete.git',
      \   ['rstacruz/sparkup', {'rtp': 'vim'}],
      \ ]}
NeoBundle 'Shougo/vimfiler',
      \ { 'depends' : 'Shougo/unite.vim' }

" Build repos.
NeoBundle 'Shougo/vimproc', {
      \ 'build' : {
      \     'windows' : 'echo "Sorry, cannot update vimproc binary file in Windows."',
      \     'cygwin' : 'make -f make_cygwin.mak',
      \     'mac' : 'make -f make_mac.mak',
      \     'unix' : 'make -f make_unix.mak',
      \    },
      \ }

" Lazy load.
NeoBundleLazy 'c9s/perlomni.vim.git'
NeoBundleSource perlomni.vim
call neobundle#source(['CSApprox'])

NeoBundleLazy 'The-NERD-tree', {'augroup' : 'NERDTree'}
call neobundle#source(['The-NERD-tree'])

NeoBundleLazy 'masudaK/vim-python'
NeoBundleLazy 'klen/python-mode'
autocmd FileType python* NeoBundleSource python-mode

NeoBundleLazy 'Rip-Rip/clang_complete', {
      \ 'autoload' : {
      \     'filetypes' : ['c', 'cpp'],
      \    },
      \ }

" script_type support.
NeoBundle 'bronzehedwick/impactjs-colorscheme', {'script_type' : 'colors'}
NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
       \ {'script_type' : 'plugin'}

filetype plugin indent on       " required!

" Should not break helptags.
set wildignore+=doc

" Should not break clone.
set wildignore+=.git
set wildignore+=.git/*
set wildignore+=*/.git/*

" Fetch only.
NeoBundleFetch 'Shougo/neobundle.vim'

autocmd VimEnter * NeoBundleCheck
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






















































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/test/vimrc2.

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
if has('vim_starting')
  set nocompatible
  execute 'set' 'runtimepath+='.getcwd()
endif

let testdir = expand('~/neobundle-test/bundles', 1)

let neobundle#types#git#default_protocol =
      \ exists('$http_proxy') ? 'https' : 'git'

call neobundle#rc(expand(testdir, 1))

" Test dependencies.

" A
NeoBundleLazy 'Shougo/echodoc'
NeoBundle 'Shougo/unite-build', { 'depends' : 'Shougo/echodoc' }
echomsg neobundle#is_sourced('echodoc') == 1
echomsg neobundle#is_sourced('unite-build') == 1

" B
NeoBundle 'Shougo/unite-ssh',  { 'depends' : 'Shougo/unite-sudo' }
NeoBundleLazy 'Shougo/unite-sudo'
echomsg neobundle#is_sourced('unite-ssh') == 1
echomsg neobundle#is_sourced('unite-sudo') == 1

" C
NeoBundleLazy 'Shougo/vimproc', { 'depends': 'Shougo/neocomplcache' }
NeoBundle 'Shougo/neocomplcache', 'ver.8'
echomsg neobundle#is_sourced('vimproc') == 0
echomsg neobundle#is_sourced('neocomplcache') == 1

" D
NeoBundleLazy 'Shougo/vimshell', { 'depends': 'Shougo/vinarise' }
NeoBundleLazy 'Shougo/vinarise'
echomsg neobundle#is_sourced('vimshell') == 0
echomsg neobundle#is_sourced('vinarise') == 0

NeoBundle 'Shougo/vimfiler', { 'depends' : 'foo/var' }
echomsg neobundle#config#check_not_exists(['vimfiler']) ==# ['var']

NeoBundleLazy 'Shougo/unite.vim', {
      \ 'depends' : ['Shougo/unite-outline', 'basyura/TweetVim'],
      \ 'autoload' : { 'commands' : 'Unite' } }
NeoBundleLazy 'Shougo/unite-outline', {
      \ 'depends' : 'Shougo/unite.vim' }
echomsg neobundle#get('unite.vim').autoload.commands == 'Unite'

" Dependencies test.
NeoBundleLazy 'basyura/twibill.vim'
NeoBundleLazy 'yomi322/neco-tweetvim'
NeoBundleLazy 'rhysd/tweetvim-advanced-filter'
NeoBundleLazy 'rhysd/TweetVim', {
\ 'depends' :
\ ['basyura/twibill.vim',
\ 'tyru/open-browser.vim',
\ 'yomi322/neco-tweetvim',
\ 'rhysd/tweetvim-advanced-filter'],
\ 'autoload' : {
\ 'commands' :
\ ['TweetVimHomeTimeline',
\ 'TweetVimMentions',
\ 'TweetVimSay',
\ 'TweetVimUserTimeline']
\ }
\ }

" Law.
NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
      \ {'script_type' : 'plugin', 'rev' : '0'}
" NeoBundleReinstall rsense.vim

NeoBundle 'http://www.vim.org/scripts/download_script.php?src_id=19619',
      \ { 'type__filename' : 'python.vim', 'script_type' : 'syntax' }

" on_source Test.
NeoBundle 'hoge'
let bundle = neobundle#get('hoge')
function! bundle.hooks.on_source(bundle)
  " Should ignore.
  echomsg "hoge"
endfunction
unlet bundle

let s:bundle = neobundle#get("TweetVim")
function! s:bundle.hooks.on_source(bundle)
endfunction
unlet s:bundle

NeoBundle 'https://github.com/Shougo/neocomplcache/' " slash is added

filetype plugin indent on       " required!

" Should not break helptags.
set wildignore+=doc

" Should not break clone.
set wildignore+=.git
set wildignore+=.git/*
set wildignore+=*/.git/*

autocmd VimEnter * NeoBundleCheck
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































































































































Deleted vim/.vim/bundle/neobundle.vim/test/vimrc3.

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
" Sample installation test.

if has('vim_starting')
  set nocompatible               " Be iMproved
  set runtimepath+=.
endif

call neobundle#begin(expand('~/test-bundle/'))

" Let NeoBundle manage NeoBundle
NeoBundleFetch 'Shougo/neobundle.vim'

" Recommended to install
" After install, turn shell ~/.vim/bundle/vimproc, (n,g)make -f your_machines_makefile
NeoBundle 'Shougo/vimproc'

" My Bundles here:
"
" Note: You don't set neobundle setting in .gvimrc!
" Original repos on github
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'Lokaltog/vim-easymotion'
NeoBundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" vim-scripts repos
NeoBundle 'L9'
NeoBundle 'FuzzyFinder'
NeoBundle 'rails.vim'
" Non github repos
NeoBundle 'git://git.wincent.com/command-t.git'
" Non git repos
NeoBundle 'http://svn.macports.org/repository/macports/contrib/mpvim/'
NeoBundle 'https://bitbucket.org/ns9tks/vim-fuzzyfinder'

call neobundle#end()

filetype plugin indent on     " Required!
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































Deleted vim/.vim/bundle/neobundle.vim/test/vimrc4.

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
" Recipe installation test.

if has('vim_starting')
  set nocompatible               " Be iMproved
  set runtimepath+=.
endif

call neobundle#begin(expand('~/test-bundle/'))

" Let NeoBundle manage NeoBundle
NeoBundleFetch 'Shougo/neobundle.vim'

" Recommended to install
" After install, turn shell ~/.vim/bundle/vimproc, (n,g)make -f your_machines_makefile
NeoBundle 'Shougo/vimproc'

" Use recipe.
NeoBundle 'Shougo/neobundle-vim-recipes'
NeoBundleRecipe 'vinarise'
NeoBundle 'Shougo/neocomplcache-snippets-complete',
      \ { 'recipe' : 'neocomplcache-snippets-complete'}

call neobundle#end()

filetype plugin indent on     " Required!
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


















































Deleted vim/.vim/bundle/neobundle.vim/vest/test-parse.vim.

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
scriptencoding utf-8

" Saving 'cpoptions' {{{
let s:save_cpo = &cpo
set cpo&vim
" }}}

Context types
  let g:neobundle#types#git#default_protocol = 'git'
  let g:neobundle#types#hg#default_protocol = 'https'
  let g:neobundle#enable_name_conversion = 0

  It parses github git repos
    ShouldEqual neobundle#parser#path(
          \ 'Shougo/neocomplcache-clang.git'),
          \ {'type' : 'git', 'uri' :
          \   g:neobundle#types#git#default_protocol .
          \  '://github.com/Shougo/neocomplcache-clang.git',
          \  'name' : 'neocomplcache-clang'}
    ShouldEqual neobundle#parser#path('Shougo/vimshell'),
          \ {'type' : 'git', 'uri' :
          \   g:neobundle#types#git#default_protocol .
          \  '://github.com/Shougo/vimshell.git',
          \  'name' : 'vimshell'}
    ShouldEqual neobundle#parser#path('rails.vim'),
          \ {'type' : 'git', 'uri' :
          \ g:neobundle#types#git#default_protocol .
          \ '://github.com/vim-scripts/rails.vim.git',
          \  'name' : 'rails.vim'}
    ShouldEqual neobundle#parser#path(
          \ 'git://git.wincent.com/command-t.git'),
          \ {'type' : 'git', 'uri' :
          \  'git://git.wincent.com/command-t.git',
          \  'name' : 'command-t'}
    ShouldEqual neobundle#parser#path('vim-scripts/ragtag.vim'),
          \ {'type' : 'git', 'uri' :
          \ g:neobundle#types#git#default_protocol .
          \ '://github.com/vim-scripts/ragtag.vim.git',
          \  'name' : 'ragtag.vim'}
    ShouldEqual neobundle#parser#path(
          \ 'https://github.com/vim-scripts/vim-game-of-life'),
          \ {'type' : 'git', 'uri' :
          \ 'https://github.com/vim-scripts/vim-game-of-life.git',
          \  'name' : 'vim-game-of-life'}
    ShouldEqual neobundle#parser#path(
          \ 'git@github.com:gmarik/ingretu.git'),
          \ {'type' : 'git', 'uri' :
          \ 'git@github.com:gmarik/ingretu.git',
          \  'name' : 'ingretu'}
    ShouldEqual neobundle#parser#path(
          \ 'gh:gmarik/snipmate.vim.git'),
          \ {'type' : 'git', 'uri' :
          \ g:neobundle#types#git#default_protocol .
          \ '://github.com/gmarik/snipmate.vim.git',
          \  'name' : 'snipmate.vim'}
    ShouldEqual neobundle#parser#path(
          \ 'github:mattn/gist-vim.git'),
          \ {'type' : 'git', 'uri' :
          \ g:neobundle#types#git#default_protocol .
          \ '://github.com/mattn/gist-vim.git',
          \  'name' : 'gist-vim'}
    ShouldEqual neobundle#parser#path(
          \ 'git@github.com:Shougo/neocomplcache.git'),
          \ {'type' : 'git', 'uri' :
          \ 'git@github.com:Shougo/neocomplcache.git',
          \  'name' : 'neocomplcache'}
    ShouldEqual neobundle#parser#path(
          \ 'git://git.wincent.com/command-t.git'),
          \ {'type' : 'git', 'uri' :
          \  'git://git.wincent.com/command-t.git',
          \  'name' : 'command-t'}
    ShouldEqual neobundle#parser#path(
          \ 'https://github.com/Shougo/neocomplcache/'),
          \ {'type' : 'git', 'uri' :
          \ 'https://github.com/Shougo/neocomplcache.git',
          \  'name' : 'neocomplcache'}
  End

  It parse svn repos
    ShouldEqual neobundle#parser#path(
          \ 'http://svn.macports.org/repository/macports/contrib/mpvim/'),
          \ {'type' : 'svn', 'uri' :
          \  'http://svn.macports.org/repository/macports/contrib/mpvim',
          \  'name' : 'mpvim'}
    ShouldEqual neobundle#parser#path(
          \ 'thinca/vim-localrc', {'type' : 'svn'}),
          \ {'type' : 'svn', 'uri' :
          \  'https://github.com/thinca/vim-localrc/trunk',
          \  'name' : 'vim-localrc'}
  End

  It parses bitbucket hg repos
    ShouldEqual neobundle#parser#path(
          \ 'https://bitbucket.org/ns9tks/vim-fuzzyfinder'),
          \ {'type' : 'hg', 'uri' :
          \  'https://bitbucket.org/ns9tks/vim-fuzzyfinder',
          \  'name' : 'vim-fuzzyfinder'}
    ShouldEqual neobundle#parser#path(
          \ 'bitbucket://bitbucket.org/ns9tks/vim-fuzzyfinder'),
          \ {'type' : 'hg', 'uri' :
          \  g:neobundle#types#hg#default_protocol.
          \  '://bitbucket.org/ns9tks/vim-fuzzyfinder',
          \  'name' : 'vim-fuzzyfinder'}
    ShouldEqual neobundle#parser#path(
          \ 'bitbucket:ns9tks/vim-fuzzyfinder'),
          \ {'type' : 'hg', 'uri' :
          \  g:neobundle#types#hg#default_protocol.
          \  '://bitbucket.org/ns9tks/vim-fuzzyfinder',
          \  'name' : 'vim-fuzzyfinder'}
    ShouldEqual neobundle#parser#path(
          \ 'ns9tks/vim-fuzzyfinder', {'site': 'bitbucket'}),
          \ {'type' : 'hg', 'uri' :
          \  g:neobundle#types#hg#default_protocol.
          \  '://bitbucket.org/ns9tks/vim-fuzzyfinder',
          \  'name' : 'vim-fuzzyfinder'}

    let bundle = neobundle#parser#_init_bundle(
          \ 'git://github.com/Shougo/neobundle.vim.git',
          \ [{ 'type' : 'hg'}])
    ShouldEqual bundle.name, 'neobundle.vim'
    ShouldEqual bundle.type, 'hg'
    ShouldEqual bundle.uri,  'git://github.com/Shougo/neobundle.vim.git'
  End

  It parses bitbucket git repos
    ShouldEqual neobundle#parser#path(
          \ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git'),
          \ {'type' : 'git', 'uri' :
          \  'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
          \  'name' : 'vim-qt-syntax'}
    ShouldEqual neobundle#parser#path(
          \ 'git://bitbucket.org/kh3phr3n/vim-qt-syntax.git'),
          \ {'type' : 'git', 'uri' :
          \  'git://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
          \  'name' : 'vim-qt-syntax'}
    ShouldEqual neobundle#parser#path(
          \ 'bitbucket:kh3phr3n/vim-qt-syntax.git'),
          \ {'type' : 'git', 'uri' :
          \  g:neobundle#types#git#default_protocol.
          \  '://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
          \  'name' : 'vim-qt-syntax'}
  End

  It parses raw repos
    let bundle = neobundle#parser#_init_bundle(
          \ 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
          \ [{ 'script_type' : 'plugin'}])
    ShouldEqual bundle.name, 'rsense.vim'
    ShouldEqual bundle.type, 'raw'
    ShouldEqual bundle.uri,
          \ 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim'
  End

  It parses default options.
    let default_options_save = g:neobundle#default_options
    let g:neobundle#default_options =
          \ { 'rev' : {'type__update_style' : 'current'},
          \   '_' : {'type' : 'hg'} }

    let bundle = neobundle#parser#_init_bundle(
          \ 'Shougo/neocomplcache', ['', 'rev', {}])
    ShouldEqual bundle.type__update_style, 'current'

    let bundle2 = neobundle#parser#_init_bundle(
          \ 'Shougo/neocomplcache', [])
    ShouldEqual bundle2.type, 'hg'

    let g:neobundle#default_options = default_options_save
  End

  It parses ssh protocol.
    let bundle = neobundle#parser#_init_bundle(
          \ 'accountname/reponame', [{
          \ 'site' : 'github', 'type' : 'git', 'type__protocol' : 'ssh' }])
    ShouldEqual bundle.uri, 'git@github.com:accountname/reponame.git'

    let bundle = neobundle#parser#_init_bundle(
          \ 'accountname/reponame', [{
          \ 'site' : 'bitbucket', 'type' : 'hg', 'type__protocol' : 'ssh' }])
    ShouldEqual bundle.uri, 'ssh://hg@bitbucket.org/accountname/reponame'

    let bundle = neobundle#parser#_init_bundle(
          \ 'accountname/reponame.git', [{
          \ 'site' : 'bitbucket', 'type' : 'git', 'type__protocol' : 'ssh' }])
    ShouldEqual bundle.uri, 'git@bitbucket.org:accountname/reponame.git'
  End

  It fetches plugins.
    let bundle = neobundle#parser#fetch(
          \ string('accountname/reponame.git'))
    ShouldEqual bundle.rtp, ''
  End

  It parses directory
    let bundle = neobundle#parser#_init_bundle(
          \ 'Shougo/neocomplcache', [])
    ShouldEqual bundle.directory, 'neocomplcache'

    let bundle = neobundle#parser#_init_bundle(
          \ 'Shougo/neocomplcache', ['ver.3'])
    ShouldEqual bundle.directory, 'neocomplcache_ver_3'
  End

  It parses function_prefix
    ShouldEqual neobundle#parser#_function_prefix(
          \ 'neobundle.vim'), 'neobundle'

    ShouldEqual neobundle#parser#_function_prefix(
          \ 'unite-tag'), 'unite#sources#tag'

    ShouldEqual neobundle#parser#_function_prefix(
          \ 'TweetVim'), 'tweetvim'

    ShouldEqual neobundle#parser#_function_prefix(
          \ 'vim-vcs'), 'vcs'
  End

  It tests name conversion.
    let g:neobundle#enable_name_conversion = 1

    let bundle = neobundle#parser#_init_bundle(
          \ 'git://github.com/Shougo/neobundle.vim.git',
          \ [{ 'type' : 'hg'}])
    ShouldEqual bundle.name, 'neobundle'

    let bundle = neobundle#parser#_init_bundle(
          \ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
          \ [{ 'type' : 'hg'}])
    ShouldEqual bundle.name, 'qt-syntax'

    let bundle = neobundle#parser#_init_bundle(
          \ 'https://bitbucket.org/kh3phr3n/qt-syntax-vim.git',
          \ [{ 'type' : 'hg'}])
    ShouldEqual bundle.name, 'qt-syntax'

    let bundle = neobundle#parser#_init_bundle(
          \ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
          \ [{ 'name' : 'vim-qt-syntax'}])
    ShouldEqual bundle.name, 'vim-qt-syntax'

    let g:neobundle#enable_name_conversion = 0
  End
End

Fin

" Restore 'cpoptions' {{{
let &cpo = s:save_cpo
" }}}

" vim:foldmethod=marker:fen:
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






















































































































































































































































































































































































































































































































Deleted vim/.vim/bundle/neobundle.vim/vest/test-tsort.vim.

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
scriptencoding utf-8

" Saving 'cpoptions' {{{
let s:save_cpo = &cpo
set cpo&vim
" }}}

function! s:comp_bundle(bundle1, bundle2)
  return a:bundle1.name > a:bundle2.name
endfunction

function! s:clear_bundles(names)
  for bundle in neobundle#config#search(a:names)
    call neobundle#config#rm(bundle.path)
  endfor
endfunction

function! s:rotate_bundle(bundles)
  return a:bundles[1:-1]+a:bundles[0:0]
endfunction

Context tsort
  It tsort no depends
    " [a, b, c] => [a, b, c]
    let neobundle_test_data = [{'name' : 'a'}, {'name' : 'b'}, {'name' : 'c'},]
    ShouldEqual neobundle#config#tsort(neobundle_test_data), neobundle_test_data
    unlet! neobundle_test_data
  End

  It tsort normal
    " a -> b -> c
    " b -> d
    " c
    " [a, b, c] => [c, b, a]
    let neobundle_test_data = [
    \   {'name' : 'a', 'depends' : [
    \     {'name' : 'b', 'depends' : [
    \       {'name' : 'c'},
    \     ]},
    \   ]},
    \   {'name' : 'b', 'skip' : 1, 'depends' : [
    \       {'name' : 'd', 'skipped' : 1, },
    \   ]},
    \   {'name' : 'c', 'skip' : 1},
    \ ]
    ShouldEqual neobundle#config#tsort(neobundle_test_data), [
    \   neobundle_test_data[0].depends[0].depends[0],
    \   neobundle_test_data[0].depends[0],
    \   neobundle_test_data[0],
    \ ]
    unlet! neobundle_test_data

    " a -> c -> b
    " a -> d
    " b
    " c
    " [a, b, c] => [b, c, d, a]
    let neobundle_test_data = [
    \   {'name' : 'a', 'depends' : [
    \     {'name' : 'c', 'depends' : [
    \       {'name' : 'b'},
    \     ]},
    \     {'name' : 'd'},
    \   ]},
    \   {'name' : 'b', 'skip' : 1},
    \   {'name' : 'c', 'skip' : 1},
    \ ]
    ShouldEqual neobundle#config#tsort(neobundle_test_data),
    \ [
    \   neobundle_test_data[0].depends[0].depends[0],
    \   neobundle_test_data[0].depends[0],
    \   neobundle_test_data[0].depends[1],
    \   neobundle_test_data[0],
    \ ]
    unlet! neobundle_test_data
  End

  It tsort circular reference
    " a -> b -> c -> a
    " b
    " c
    " [a, b, c] => [c, b, a]
    let neobundle_test_data = [
    \   {'name' : 'a', 'depends' : [
    \     {'name' : 'b', 'depends' : [
    \       {'name' : 'c', 'depends' : [
    \         {'name' : 'a', 'skip' : 1},
    \       ]},
    \     ]},
    \   ]},
    \   {'name' : 'b', 'skip' : 1},
    \   {'name' : 'c', 'skip' : 1},
    \ ]
    ShouldEqual neobundle#config#tsort(neobundle_test_data),
    \ [
    \   neobundle_test_data[0].depends[0].depends[0],
    \   neobundle_test_data[0].depends[0],
    \   neobundle_test_data[0],
    \ ]
    unlet! neobundle_test_data
  End

  It tsort bundled no depends
    NeoBundleLazy 'a/a'
    NeoBundleLazy 'b/b'
    NeoBundleLazy 'c/c'
    let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(), "v:val.name =~# '^[abc]$'"), "s:comp_bundle")

    " [a, b, c] => [a, b, c]
    ShouldEqual neobundle#config#tsort(neobundle_test_data), neobundle_test_data

    " [c, b, a] => [c, b, a]
    call reverse(neobundle_test_data)
    ShouldEqual neobundle#config#tsort(neobundle_test_data), neobundle_test_data

    unlet! neobundle_test_data
    call s:clear_bundles(['a','b','c'])
  End

  It tsort bundled normal
    NeoBundleLazy 'a/a'
    NeoBundleLazy 'b/b', {'depends' : 'a/a'}
    NeoBundleLazy 'c/c', {'depends' : 'b/b'}
    let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(), "v:val.name =~# '^[abc]$'"), "s:comp_bundle")

    " [a, b, c] => [a, b, c]
    ShouldEqual neobundle#config#tsort(neobundle_test_data), neobundle_test_data

    " [c, b, a] => [a, b, c]
    ShouldEqual neobundle#config#tsort(reverse(copy(neobundle_test_data))), neobundle_test_data

    unlet! neobundle_test_data
    call s:clear_bundles(['a','b','c'])

    NeoBundleLazy 'a/a', {'depends' : ['c/c', 'b/b']}
    NeoBundleLazy 'b/b'
    NeoBundleLazy 'c/c', {'depends' : 'b/b'}
    let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(), "v:val.name =~# '^[abc]$'"), "s:comp_bundle")
    let neobundle_test_rotated = s:rotate_bundle(neobundle_test_data)

    " [a, b, c] => [b, c, a]
    ShouldEqual neobundle#config#tsort(neobundle_test_data), neobundle_test_rotated

    " [c, b, a] => [b, c, a]
    ShouldEqual neobundle#config#tsort(reverse(copy(neobundle_test_data))), neobundle_test_rotated

    unlet! neobundle_test_data neobundle_test_rotated
    call s:clear_bundles(['a','b','c'])
  End

  It tsort bundled circular reference
    NeoBundleLazy 'a/a', {'depends' : 'b/b'}
    NeoBundleLazy 'b/b', {'depends' : 'c/c'}
    NeoBundleLazy 'c/c', {'depends' : 'a/a'}
    let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(), "v:val.name =~# '^[abc]$'"), "s:comp_bundle")

    " [a, b, c] => [c, b, a]
    ShouldEqual neobundle#config#tsort(neobundle_test_data), reverse(copy(neobundle_test_data))

    " [c, b, a] => [b, a, c]
    call reverse(neobundle_test_data)
    let neobundle_test_rotated = s:rotate_bundle(neobundle_test_data)
    ShouldEqual neobundle#config#tsort(neobundle_test_data), neobundle_test_rotated

    unlet! neobundle_test_data neobundle_test_rotated
    call s:clear_bundles(['a','b','c'])
  End
End

Fin

delfunction s:comp_bundle
delfunction s:clear_bundles
delfunction s:rotate_bundle

" Restore 'cpoptions' {{{
let &cpo = s:save_cpo
" }}}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




































































































































































































































































































































































Changes to vim/.vimrc.

4
5
6
7
8
9
10
11
12


13
14
15
16
17
18
19



20
21
22
23
24
25
26
..
53
54
55
56
57
58
59
60
61
62
endif

if !has('gui_running')
	set t_Co=256
	set mouse=a
end

call neobundle#rc(expand('~/.vim/bundle/'))



NeoBundleFetch 'git://github.com/Shougo/neobundle.vim'

NeoBundle 'git://github.com/Shougo/vimproc.vim', { 'build': { 'unix': 'make' }, }
NeoBundle 'git://github.com/itchyny/lightline.vim'
NeoBundle 'git://github.com/myusuf3/numbers.vim'
NeoBundle 'git://github.com/tpope/vim-markdown.git'
NeoBundle 'git://github.com/scrooloose/nerdtree'




let g:ctrlp_working_path_mode = 'c'

" Visual settings
let g:solarized_termcolors = 256
syntax on
filetype plugin indent on
................................................................................
set undofile
set undodir=~/.vim/undo//

" Key mappings
map <C-n> :NERDTreeToggle<CR>
map <S-Tab> :tabn<CR>

NeoBundleCheck









|

>
>
|

|
|
|
|
|
>
>
>







 







|


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
..
58
59
60
61
62
63
64
65
66
67
endif

if !has('gui_running')
	set t_Co=256
	set mouse=a
end

"call neobundle#rc(expand('~/.vim/bundle/'))

call plug#begin('~/.vim/plugged')

"NeoBundleFetch 'git://github.com/Shougo/neobundle.vim'

"NeoBundle 'git://github.com/Shougo/vimproc.vim', { 'build': { 'unix': 'make' }, }
Plug 'git://github.com/itchyny/lightline.vim'
Plug 'git://github.com/myusuf3/numbers.vim'
Plug 'git://github.com/tpope/vim-markdown.git'
Plug 'git://github.com/scrooloose/nerdtree'
Plug 'git://github.com/vim-perl/vim-perl', { 'for': 'perl', 'do': 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny' }

call plug#end()

let g:ctrlp_working_path_mode = 'c'

" Visual settings
let g:solarized_termcolors = 256
syntax on
filetype plugin indent on
................................................................................
set undofile
set undodir=~/.vim/undo//

" Key mappings
map <C-n> :NERDTreeToggle<CR>
map <S-Tab> :tabn<CR>

"NeoBundleCheck