mirror of
https://github.com/neovim/neovim
synced 2025-07-26 00:01:46 +00:00
Compare commits
998 Commits
Author | SHA1 | Date | |
---|---|---|---|
5b8255e251 | |||
b8e6f04e69 | |||
297677ecf4 | |||
45cc14d9a5 | |||
ed49d9d866 | |||
545e7a4163 | |||
2cc523c3af | |||
a26d52ea32 | |||
c317fc20b0 | |||
d9ab9160b8 | |||
c7e6b58012 | |||
35ddcc5bb4 | |||
71b3e20d0f | |||
2d60a15e25 | |||
215922120c | |||
1b825a9ada | |||
12b5c846ba | |||
6f0f8e7f4a | |||
ccb6af064f | |||
6b94d4d14f | |||
22e9c51b0f | |||
ae6db26b09 | |||
f9aa029a8b | |||
acaf480bdc | |||
4b0b391f9f | |||
966f1abd8b | |||
01e33e1c74 | |||
dfb6a5133b | |||
6b48d25cbf | |||
57ac9b0934 | |||
c9b29d3884 | |||
1d4506ee17 | |||
6647f3c047 | |||
e57988a9fb | |||
725074aafc | |||
f332eba16c | |||
4de10d43aa | |||
f282b8ecac | |||
0a882b4818 | |||
82b434dd51 | |||
a63f770bcb | |||
cc657951a9 | |||
7b29fdd200 | |||
35b47890dd | |||
9c4a94f964 | |||
884b37fd2a | |||
fb98145aa2 | |||
79ef4b72d7 | |||
c10fe010f1 | |||
a1682281f4 | |||
8c4c366a9e | |||
6aefd14482 | |||
d0c0930acf | |||
3e00dc4477 | |||
b805a71495 | |||
521ca58ff9 | |||
9768d510fa | |||
add41dca98 | |||
0a51d26b33 | |||
db375102ea | |||
3b785b32f9 | |||
3ff252ca86 | |||
348fcee5fb | |||
68d9198501 | |||
3e26c32994 | |||
6348864e29 | |||
e30b2c2054 | |||
006f9c0c9c | |||
84bf53b803 | |||
abb0928dfb | |||
6da7d6890c | |||
d69194ca8c | |||
852ebc6f0b | |||
5dc28a826e | |||
8625c1d104 | |||
8d09301090 | |||
f1eb303187 | |||
6050d3f15d | |||
6bcaea7c41 | |||
11ecd20387 | |||
25ec29d4e1 | |||
9da4d1b4cb | |||
723366d40b | |||
04012349f6 | |||
faafd9b70c | |||
db7fdcd0ba | |||
b85bae4cac | |||
e8a3477dc7 | |||
e89eb5d21b | |||
46492a472a | |||
08a5f91481 | |||
563628e617 | |||
f665bde183 | |||
64013a5deb | |||
4dc4efc36f | |||
66ceb5a487 | |||
42e9606c23 | |||
a8e973dea6 | |||
fe6ec75725 | |||
d622e9c416 | |||
a8d1b5f721 | |||
b8c27a83b3 | |||
5a8ae8d3fe | |||
0d93cd6c46 | |||
08d11bd42f | |||
e0e15360b8 | |||
f53c8258be | |||
55682710a9 | |||
ba705042ff | |||
d1d9ac5a3c | |||
6fe8c1d051 | |||
23f591dba0 | |||
70ae6ac344 | |||
247d1cec06 | |||
172cf079c7 | |||
2cd3a2d1d8 | |||
af95037c96 | |||
aa2c439940 | |||
f4187c46bd | |||
02346f9bc7 | |||
f2d5ba65b5 | |||
23aadb6948 | |||
d96b359410 | |||
618aad3811 | |||
6b33e9b103 | |||
771d42e426 | |||
faca814116 | |||
9b210c1fa9 | |||
3455e66cfc | |||
3d1084f264 | |||
66a4c95866 | |||
bd8ef4ea24 | |||
c168dc32b9 | |||
149518c6b3 | |||
e5781d005a | |||
7a56967f8c | |||
1f7304b846 | |||
56f178058a | |||
ea690e4038 | |||
67062d20ed | |||
fbb2cd791d | |||
2bb4c43f2f | |||
a4987bac3e | |||
452707e0b0 | |||
f1d912c584 | |||
aece3ffa7d | |||
8c1fb99d2d | |||
7563972fd9 | |||
92866042d9 | |||
77937c4edd | |||
9c3bd3e427 | |||
1d8a076157 | |||
d0c0b10b4c | |||
0595da8d0b | |||
90d1ad3975 | |||
291c3c6ff3 | |||
f639c97c72 | |||
0aa687a15d | |||
7fa1baf44e | |||
ff93c9bd90 | |||
4d4c92535a | |||
ed3b3aa9cd | |||
329f922f14 | |||
e63c6ca8f2 | |||
09c58f721b | |||
be531aba77 | |||
5ea4d58a1b | |||
98fb0f12c4 | |||
a3dc7ef445 | |||
fc98d2d96d | |||
72ad5a16e7 | |||
83aea9ccf5 | |||
448dd2adfa | |||
d529ca0103 | |||
6ea2bde065 | |||
335be4272e | |||
dcbd1c7b13 | |||
29060a592c | |||
b771ec8baa | |||
c7d84c5550 | |||
56fcabbd05 | |||
9767b9f00f | |||
3878626c05 | |||
5fc72882cc | |||
1a92585e32 | |||
c47624482c | |||
895f712df8 | |||
5573e1a350 | |||
ef72303a1f | |||
d3981fee21 | |||
adaacdd71a | |||
340b186230 | |||
4b461b472f | |||
ce91baf94b | |||
3e2daf7125 | |||
059e9785dc | |||
86b4f6856b | |||
c147766389 | |||
520a4f06e2 | |||
e686b613ec | |||
23b2ee0771 | |||
3f689ed327 | |||
31734c6ab0 | |||
d65563ae9c | |||
b418f3d6f2 | |||
99e51b81e6 | |||
5f471b2486 | |||
0b2633b1bb | |||
4bd14e921b | |||
443d335ce3 | |||
53613e7fcd | |||
080476882b | |||
55dcf0918c | |||
26f74fdf61 | |||
ea18b4a60f | |||
1f54d253e1 | |||
4ca9e13637 | |||
8ecdc571b0 | |||
85e539c996 | |||
5f3813daf4 | |||
2f72f34f04 | |||
67d8e58631 | |||
d43ac790f2 | |||
9dc621e77d | |||
8f2505e594 | |||
28300a1293 | |||
562b17260f | |||
bca53fdca0 | |||
e902a172ef | |||
6cee9d1a17 | |||
8641e3a156 | |||
5f1a153831 | |||
bd6dad06dd | |||
a5358688bc | |||
f3056988ed | |||
6e2c02bc6d | |||
b23b561329 | |||
086aa99292 | |||
c402f6e7a9 | |||
173d366a5b | |||
c002310787 | |||
0a3c0205c5 | |||
fab62141c8 | |||
c5b02d5a7a | |||
f80eb768c7 | |||
c6eff87a25 | |||
0d9593ff14 | |||
59487e18a7 | |||
6f4f654231 | |||
c8da12b9a6 | |||
ce31c21c7d | |||
0d5edcef4a | |||
8e804c911e | |||
5c754a2d22 | |||
2c39e0b03f | |||
204f557a11 | |||
43536568ba | |||
f266ff2650 | |||
9fb8adf3ad | |||
e9061117a5 | |||
ae9cb1fe07 | |||
a9546b5e78 | |||
6e79a4d7f6 | |||
57b56e37e5 | |||
c69ccca56d | |||
2b7d13fb19 | |||
26d8ab51da | |||
be0f96ab73 | |||
65ced8e994 | |||
142d00e8da | |||
7900e38a8f | |||
458a4d0444 | |||
50f5bb8ade | |||
0d56118d86 | |||
2968dc7bdd | |||
554005ea9a | |||
f2f9ab6f35 | |||
e07da3a71b | |||
90b8cf133e | |||
6b06bdafa2 | |||
da15b5c1f3 | |||
47a15d0256 | |||
1a91000251 | |||
4741c8b234 | |||
96a57e1bc6 | |||
6580dfeddd | |||
75bd39d49c | |||
a3b05a03b6 | |||
2dd154457c | |||
fec7983ecd | |||
3e7c8e7149 | |||
4b9d2caec2 | |||
a8f3849bc0 | |||
2ac5f1138b | |||
516b7071ca | |||
11dda658d6 | |||
65af001f2b | |||
e8a8342132 | |||
c475e3f8d1 | |||
dff0dd2611 | |||
438c5d27b0 | |||
cde1d818d0 | |||
a2ecbc2cc0 | |||
1a8d9e9d54 | |||
a05e7a6bca | |||
cc8f477d18 | |||
7df9dd33a1 | |||
8a4e5b4bc2 | |||
d5ddebe9e2 | |||
8c28baa7c7 | |||
cf89160d6e | |||
1e93e24f5e | |||
abeb2f020f | |||
86b138b25d | |||
cbda7d85f8 | |||
a59330d6fc | |||
2126ec0c5b | |||
16424caeda | |||
51fe40a033 | |||
1b1be69cd6 | |||
464bc16f81 | |||
742787fe9e | |||
2dbf040048 | |||
37f560aedf | |||
7718f8f24c | |||
c698ed0531 | |||
30a7d551ee | |||
4bad05ba97 | |||
aaec820e6e | |||
cc6edfe357 | |||
23a3e58f02 | |||
bd20892bdf | |||
0d3ff4b55d | |||
ef273f97be | |||
d45a665b00 | |||
bec5fd5809 | |||
aa22b5fd9a | |||
20447ba098 | |||
28cc5a0646 | |||
0ea01c1586 | |||
e247e3acdd | |||
e7ab3e7e59 | |||
871fc6c1e1 | |||
f0c1a06792 | |||
2902153648 | |||
244967bff9 | |||
92d5809052 | |||
ce234b0da5 | |||
3676ad4530 | |||
739f066afe | |||
d359bb3f60 | |||
3d64bd2b3a | |||
6881fcd203 | |||
ff470bb853 | |||
a160590e40 | |||
5832809344 | |||
a581364acc | |||
b3f6b30751 | |||
56e9e81115 | |||
b1c9d7d237 | |||
9e94ffd422 | |||
1e6fa9338e | |||
326ae7c8ce | |||
7db5ad4e4d | |||
86406ffc80 | |||
6c550a4f13 | |||
b2d15fbebc | |||
82da7eed34 | |||
81b9b37e01 | |||
e355624748 | |||
06bbb79e63 | |||
38d98bba68 | |||
15afd30e04 | |||
7e74ba4108 | |||
00fc216e2b | |||
e056e5d558 | |||
48aa28a3eb | |||
e453825aa5 | |||
8849c209cc | |||
18cbe74af7 | |||
e2941ecfbe | |||
8f32fad257 | |||
404dc5420b | |||
24a329b53a | |||
96546fb696 | |||
bc99b4c483 | |||
1bb8930c92 | |||
d966018466 | |||
374b3a6f4c | |||
2cbb8d0540 | |||
7634764e4c | |||
2c44d92572 | |||
704b58e54a | |||
234346312e | |||
5f5f2d8945 | |||
af161dcfb8 | |||
ee508e6e07 | |||
93274bfda7 | |||
999590b313 | |||
d97a97d7e8 | |||
5a387dddc6 | |||
dfaf720442 | |||
c156a18280 | |||
ef6b6e9a09 | |||
cc8a2e7aad | |||
78c6f5c06d | |||
6ed9d47a6e | |||
40e7efe91c | |||
14648cb741 | |||
02e6914a93 | |||
8958863e26 | |||
667c1dc4de | |||
2d9c7dd840 | |||
b3b25c2490 | |||
f421757e57 | |||
abe47d5f64 | |||
8bf94f8f0d | |||
1a21a0cc4f | |||
17cb95b222 | |||
29e618c93c | |||
1b6681e073 | |||
d5380d85ae | |||
634d59f646 | |||
568da8ef3b | |||
4e9f7684f6 | |||
f735ee90c2 | |||
a3f11ad27a | |||
a1303c2e11 | |||
197f384891 | |||
690970acff | |||
0afe63e925 | |||
d6d8073939 | |||
c16cb06656 | |||
b121d85376 | |||
4adee66980 | |||
3dd3d129d3 | |||
4276a03e81 | |||
d0bd023881 | |||
c571e80273 | |||
8f8b6658d7 | |||
d9137b1a3a | |||
139c1bb48b | |||
bd9715a9b5 | |||
30531bc38d | |||
cafd4a4d06 | |||
9ce921a516 | |||
7a44f9e343 | |||
1ce1b85cc6 | |||
d007c2977b | |||
8cfb272c74 | |||
77540a0458 | |||
c4da27095c | |||
c2a1821611 | |||
748898b4dd | |||
c793423374 | |||
ecbc9dbdfe | |||
1e70ebe849 | |||
5fed9f5626 | |||
ff00e289cf | |||
7e65cc22ea | |||
e50b4fd36d | |||
8c127c77a6 | |||
fe0c3999ca | |||
1786844498 | |||
1ea1626764 | |||
dab5d1368a | |||
1e593436d0 | |||
677eae6b0f | |||
48e945e588 | |||
c29cc50b3a | |||
f5642a171f | |||
f5cf6f8de4 | |||
d89bf31f6b | |||
46aac2a09a | |||
c11f22d6c5 | |||
5758432be2 | |||
dd539366fc | |||
1d63672c77 | |||
41c0dfd545 | |||
bfbc974d13 | |||
d693a22de3 | |||
ccef5c9c77 | |||
bc306ab5aa | |||
2115fcdfd5 | |||
2519638796 | |||
c74ce334f2 | |||
1e22076a65 | |||
b37b5a59af | |||
52348a1f8c | |||
d46772588b | |||
3d12192521 | |||
ca7e43100a | |||
a3f398992f | |||
4a40231317 | |||
da9b6b1de0 | |||
5cc87d4dab | |||
61e8adb25e | |||
71e3aec029 | |||
1e1325bd18 | |||
b4848c5d14 | |||
1afb1cc6bc | |||
726a6abfb7 | |||
3734052a76 | |||
9b6988e62a | |||
87e0621857 | |||
9d1b072db0 | |||
7d6b9ddc15 | |||
176f223ea3 | |||
e70cae426c | |||
39c015bd11 | |||
a441356858 | |||
96f834a842 | |||
849d61b551 | |||
d8d159c123 | |||
c3ebfff18b | |||
46a080015f | |||
7b57ab1480 | |||
34957f7ab9 | |||
582fb03f51 | |||
1f4af4c86e | |||
8e20ba9fbd | |||
853440053c | |||
d5168064bf | |||
8a379aacd7 | |||
9d3449852b | |||
6e68cc570c | |||
08cf8f4d15 | |||
95442026e8 | |||
66adc2daee | |||
723497f030 | |||
4eb4a5cdb2 | |||
f598bb7b3c | |||
391d8ff3d8 | |||
9dc08dd692 | |||
33486c8ebd | |||
114fd52230 | |||
56cb1eb9f9 | |||
620806ec07 | |||
3e1ab7c8d6 | |||
dc88173b1b | |||
1ead15ad81 | |||
817438f16c | |||
0838d59a7c | |||
74f6460181 | |||
2ebf365db9 | |||
07382048b0 | |||
093f8d5376 | |||
1fabc63907 | |||
1a194fad22 | |||
d5c89b1896 | |||
509089d053 | |||
8759a77dc2 | |||
957c91d5d0 | |||
af3d4b4049 | |||
9c7038c475 | |||
b907c85fb4 | |||
c17f6c5396 | |||
a69c3fbc8a | |||
2582754bdd | |||
e5eea7fa06 | |||
954aeafa89 | |||
724fc88597 | |||
a5ac389e5c | |||
f6a82c1d4f | |||
244cfe86b5 | |||
91796f70ed | |||
12cfe7775f | |||
dd0e8a03fc | |||
2a0f726b18 | |||
5fdb6043d7 | |||
b4cbfd3c08 | |||
087623aa3c | |||
cf29b4025d | |||
c9b1ad3a57 | |||
7d11cc6912 | |||
50cf32775d | |||
3f3a3cb65f | |||
de570a0b84 | |||
4e101310d5 | |||
ab60a73b6a | |||
5bd65e31da | |||
c3c409c70f | |||
850f91c51c | |||
10c819d453 | |||
39af303600 | |||
68717132b1 | |||
33ba27b002 | |||
71450b54aa | |||
082abb7ca6 | |||
3cc2a28198 | |||
f583bc94fc | |||
8dd91ddb73 | |||
df376d2e49 | |||
bbc13e6459 | |||
9b1e819c8c | |||
36fb600a9e | |||
d81556513d | |||
3320b99816 | |||
128579f7fc | |||
a453c5ce24 | |||
8cdf908ddb | |||
049be74257 | |||
bfc823f972 | |||
14ea366f24 | |||
1c83e9eb82 | |||
f0967b0f4c | |||
92fe357a52 | |||
fcd5d3ad21 | |||
8c399d6b37 | |||
529e2ab178 | |||
a1de2ea154 | |||
104181ea03 | |||
a1f9760a59 | |||
d3a904309b | |||
36a57a9e8a | |||
055c9e1be6 | |||
02fb6ee458 | |||
dfdf7c02be | |||
1573aa0b0a | |||
d02cfe8061 | |||
954f983bc1 | |||
a5a1768918 | |||
80e84550b2 | |||
2a74cba614 | |||
130a1a6bb2 | |||
e63e49d49b | |||
cdc32e72f9 | |||
0415b36865 | |||
6ed201c5b5 | |||
48b2faead8 | |||
a524200ca7 | |||
aa8ccef719 | |||
47fefba529 | |||
dd9dc7ae87 | |||
6bdf82bf6f | |||
1c4989c2a3 | |||
6e9e5d23ce | |||
ae7500457e | |||
bac9db0313 | |||
acc5d08b37 | |||
0bfc1f33a0 | |||
219a8bdb36 | |||
65b7499872 | |||
dc91397463 | |||
b02ba11cb1 | |||
16217b2854 | |||
8f2ac8a731 | |||
f4979d368c | |||
aa4c172a10 | |||
3b492387ee | |||
6c3ead6684 | |||
6396beb432 | |||
71ac92efc7 | |||
a2b888d383 | |||
d06c4a2391 | |||
691e3bbc99 | |||
24dac220d3 | |||
2b238814d7 | |||
fa65e95039 | |||
3a35f63640 | |||
79b4951953 | |||
c7f02f4f8d | |||
9fe0302385 | |||
31373e400d | |||
69d1bc1a47 | |||
e91afdcda6 | |||
508ee7f245 | |||
90995ba788 | |||
ca1230b601 | |||
4682b21ef2 | |||
86eb339120 | |||
c72b60645c | |||
5185b75f7e | |||
9aed8c3eb4 | |||
c6ff71e00c | |||
e443915d8b | |||
1253c99eb8 | |||
22ea7be77b | |||
1bbe513591 | |||
4ac5a0a924 | |||
a62cc5f807 | |||
e2cc3f98fb | |||
6a32852137 | |||
2d4e7311aa | |||
7b29dfc43a | |||
b634cfcc19 | |||
9d1c52239a | |||
95d376dc88 | |||
367b1893e7 | |||
c535cc7dde | |||
3c45e3b42a | |||
490804ed33 | |||
11f41a3c8c | |||
3e1ca9a2db | |||
00c35ab3b4 | |||
d542de4a76 | |||
cf4e1fb0f4 | |||
a1f985f60a | |||
91afb30b66 | |||
121987c5cc | |||
6cc15ccc3b | |||
2a8ceb160c | |||
e4903f8b70 | |||
3dc8cdc150 | |||
cd3461b004 | |||
5f6e63bf38 | |||
7dab6d4d8f | |||
8be91867b3 | |||
fd3088b425 | |||
0786ebe305 | |||
37f1ee0084 | |||
126e475807 | |||
b21c6fbf14 | |||
d0a3f8b73f | |||
a1d326a251 | |||
7db4a15e95 | |||
43e7c40051 | |||
136374ec6f | |||
eefcc50f2c | |||
9cd2488334 | |||
ee4d1f2cce | |||
360d0513d1 | |||
81e0874a54 | |||
860a0194a4 | |||
ef4c0070ce | |||
c6594d73c6 | |||
4ff793eaab | |||
b447b865cd | |||
f931e78fe4 | |||
61e25f995c | |||
2d5520fb25 | |||
c0de12c3c5 | |||
f644d8d88e | |||
de0ea44698 | |||
7209d3c59a | |||
6bb4b9f57f | |||
2adb8acebd | |||
ec916bb983 | |||
e4146dd7df | |||
cc410185c0 | |||
ea483231c5 | |||
0d6fe73d7b | |||
e861af85f8 | |||
17294977bd | |||
204629a1a0 | |||
ee9cca892c | |||
67d5a1aae2 | |||
db9c22adb9 | |||
cf434d2ae4 | |||
3d73956b96 | |||
11fd965554 | |||
ad99d0bf7e | |||
ef977c6b68 | |||
5797f40646 | |||
ef205c3851 | |||
6f98034686 | |||
588bc1d958 | |||
121e76db6f | |||
5a5ef1c222 | |||
dfe85dd80a | |||
49c5689f45 | |||
6e5343d230 | |||
7925ffc872 | |||
4dcd19d9bc | |||
4f5a18237b | |||
9cf91a8691 | |||
ab63f5d934 | |||
a9f97226ae | |||
1cc869ffb9 | |||
3c4544c532 | |||
23e8d6d94b | |||
445f0d7eed | |||
3098b18a2b | |||
98fb53e0eb | |||
e6b8893337 | |||
c107d4a2d6 | |||
3d7a6e4d54 | |||
c4de9c7cc9 | |||
e57238a644 | |||
cef624ee9e | |||
ce17d03180 | |||
5ebffaae4e | |||
89e6973fe2 | |||
ec71d87b81 | |||
9e1cacecbe | |||
5734e21873 | |||
2dfc8de1cf | |||
425fcdb5b4 | |||
29b737e92b | |||
a252fca38e | |||
9e385404b3 | |||
88a735166b | |||
50a7517a6d | |||
a7a0bf54e3 | |||
cd10cdd1b4 | |||
7029dec0ae | |||
02fa6b18d6 | |||
5c6592fdab | |||
ba9bdb3e70 | |||
1cb8afed78 | |||
43fe335eda | |||
0ba12c6691 | |||
0d264abdd0 | |||
f3d6c443d9 | |||
bf63510228 | |||
ef92cca7cc | |||
376ba4e734 | |||
49dde999c0 | |||
2ebc58d25a | |||
ba97f73560 | |||
1b1b920ba8 | |||
a347b29aa3 | |||
c4117d4b2f | |||
4a200ceafa | |||
d835c030f2 | |||
8d12e28d94 | |||
05baf936c0 | |||
8a14750dd3 | |||
28b9a2864a | |||
e5147ce6a0 | |||
40cc5ba0e2 | |||
946807898b | |||
191fb638f4 | |||
fdb68e35e4 | |||
ca280c28b4 | |||
007d573147 | |||
896f548eee | |||
a3dfd1627e | |||
a64114eba0 | |||
28275fe5c3 | |||
45304b482c | |||
bda0165514 | |||
c4f1b5a938 | |||
3e435df42c | |||
fd92e648ac | |||
494b1c9bee | |||
9af400f979 | |||
af7ff808c7 | |||
9709cf2cdb | |||
25bb08dad9 | |||
4f8b686435 | |||
c129f6cfaf | |||
d06c2a1b18 | |||
2b0d46195b | |||
0c598774d8 | |||
515fea1ef0 | |||
69ce17878e | |||
1bada1fde0 | |||
82f249f829 | |||
9a56fcb2e8 | |||
9c543f2e24 | |||
032ac502ff | |||
eb806c9620 | |||
52c6cc2189 | |||
224d7df630 | |||
394830631f | |||
b725f6b428 | |||
4eb5d05f01 | |||
4a29995fe7 | |||
1fc84ae2cd | |||
4ff5d6e41c | |||
54cc6d8025 | |||
6a35f2ac8b | |||
942e0b338c | |||
406562ac6d | |||
7cdd01983a | |||
2f67786796 | |||
f1ced96c28 | |||
af6603a6b4 | |||
4913a25dec | |||
209427e972 | |||
f0bd4a1494 | |||
77776b09c6 | |||
c27395ddc8 | |||
fa26eee85b | |||
569e404622 | |||
7124329bd9 | |||
d4106f6df3 | |||
0aa3e7b7ce | |||
b7cb8f0597 | |||
c91c0171dd | |||
6cdf45e298 | |||
f4ea114c67 | |||
33778c36cc | |||
6167ce6df2 | |||
a3b87fc19b | |||
e303ea8a19 | |||
2c378fdfaf | |||
634e51d12b | |||
57700def79 | |||
5814e29cdb | |||
ea82270d30 | |||
cddd7d47c3 | |||
ed6756563c | |||
700b32a2b3 | |||
3c39219550 | |||
85244e68e3 | |||
41b44d114c | |||
704accfbfa | |||
e213ba1506 | |||
0f0e2bdfd4 | |||
f5c35ba109 | |||
6e5498c3e3 | |||
d70a322c40 | |||
18903bd9b8 | |||
256a5d2522 | |||
68e58444b4 | |||
c3efad5398 | |||
f21cb425fb | |||
44cbf45d26 | |||
5674546580 | |||
c0bab19cf5 | |||
9261f1597f | |||
1168dbe343 | |||
459900b100 | |||
ebabdff5cd | |||
83c683f5e1 | |||
aae7e8b7dd | |||
cc1beecf81 | |||
164bcaf5c9 | |||
4043725991 | |||
e90f52f7ac | |||
cd00aa6ae4 | |||
a8fec15899 | |||
4b097c85d8 | |||
2eb5d73438 | |||
2895883154 | |||
b50afb4651 | |||
a7a3605c0f | |||
e6e843ebc0 | |||
cfe4352897 | |||
2c827cea12 | |||
1b1960ab90 | |||
f09f6ba2e4 | |||
8a2cf943f7 | |||
e34cdf6e79 | |||
a0fec5d3db | |||
622164d403 | |||
824a6877ea | |||
11e8ec0cac | |||
4eb58273cd | |||
523ff9c55c | |||
54188cddde | |||
cf7d6a7a0b | |||
01eafc0c17 | |||
69d74f588a | |||
982198143d | |||
c18d5917e3 | |||
4a6328a8eb | |||
0cb2c39ec4 | |||
10a8bb02ac | |||
4ae7acd152 | |||
584b8eddb4 | |||
f5f11b9e2f | |||
3f698b8106 | |||
704f3dd855 | |||
906271b53d | |||
f47a20a266 | |||
cf32ca5137 | |||
fe4d814c0f | |||
b25b6048ca | |||
c56aceff88 | |||
80471df208 | |||
91c5005da8 | |||
8d37201ed2 | |||
3462f46cb8 | |||
1bf1ffc734 | |||
bf2c2b34cf | |||
d227c843bf | |||
5330aa104b | |||
2df8f88b3c | |||
d44b2c9483 | |||
e605faaa2f | |||
7cdbf3f97a | |||
beccc3e3a1 | |||
15b5bb038b | |||
ce832238c8 | |||
6d2ed7c0eb | |||
07cc1aaae2 | |||
755d4e82b1 | |||
2ac9a3905c | |||
c78aeb0d46 | |||
1addc45e78 | |||
29a1807de8 | |||
04ff218c16 | |||
313810ccad | |||
f6dca79f3a | |||
9e3ebb6711 | |||
d5904160d7 | |||
4d5d76c086 | |||
b16b27a1be | |||
de7165d351 | |||
2af36df86d | |||
11cf3680e4 | |||
1e7c6380fe | |||
2ced866925 | |||
291a43e1dd | |||
c9067dbe8a |
@ -3,8 +3,6 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [[ -n "${CI_TARGET}" ]]; then
|
||||
exit
|
||||
if [[ -n "${GCOV}" ]]; then
|
||||
coveralls --gcov "$(which "${GCOV}")" --encoding iso-8859-1 || echo 'coveralls upload failed.'
|
||||
fi
|
||||
|
||||
[ "$USE_GCOV" = on ] && { coveralls --gcov "$(which "${GCOV}")" --encoding iso-8859-1 || echo 'coveralls upload failed.' ; }
|
||||
|
@ -3,12 +3,6 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [[ "${TRAVIS_OS_NAME}" != linux ]]; then
|
||||
# Caches are only enabled for Travis's Linux container infrastructure,
|
||||
# but this script is still executed on OS X.
|
||||
exit
|
||||
fi
|
||||
|
||||
# Don't cache pip's log and selfcheck.
|
||||
rm -rf "${HOME}/.cache/pip/log"
|
||||
rm -f "${HOME}/.cache/pip/selfcheck.json"
|
||||
@ -16,7 +10,7 @@ rm -f "${HOME}/.cache/pip/selfcheck.json"
|
||||
# Update the third-party dependency cache only if the build was successful.
|
||||
if [[ -f "${SUCCESS_MARKER}" ]]; then
|
||||
rm -rf "${HOME}/.cache/nvim-deps"
|
||||
mv -T "${DEPS_BUILD_DIR}" "${HOME}/.cache/nvim-deps"
|
||||
mv "${DEPS_BUILD_DIR}" "${HOME}/.cache/nvim-deps"
|
||||
touch "${CACHE_MARKER}"
|
||||
echo "Updated third-party dependencies (timestamp: $(stat -c '%y' "${CACHE_MARKER}"))."
|
||||
fi
|
||||
|
@ -12,13 +12,13 @@ if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
fi
|
||||
|
||||
echo "Upgrade Python 2's pip."
|
||||
pip2.7 install --user --upgrade pip
|
||||
pip2.7 -q install --user --upgrade pip
|
||||
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
echo "Install Python 3."
|
||||
brew install python3
|
||||
echo "Upgrade Python 3's pip."
|
||||
pip3 install --user --upgrade pip
|
||||
pip3 -q install --user --upgrade pip
|
||||
else
|
||||
# TODO: Replace with upgrade when Travis gets python3-pip package.
|
||||
echo "Install pip for Python 3."
|
||||
|
@ -19,20 +19,16 @@ if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; the
|
||||
echo "\$LLVM_SYMBOLIZER: '${LLVM_SYMBOLIZER}' is not executable."
|
||||
exit 1
|
||||
fi
|
||||
if [ "${BUILD_32BIT}" = ON ] && [ "${BUILD_MINGW}" = ON ]; then
|
||||
>&2 echo "32-bit MinGW builds not supported."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
# Adds user to a dummy group.
|
||||
# That allows to test changing the group of the file by `os_fchown`.
|
||||
sudo dscl . -create /Groups/chown_test
|
||||
sudo dscl . -append /Groups/chown_test GroupMembership "${USER}"
|
||||
else
|
||||
fi
|
||||
|
||||
# Compile dependencies.
|
||||
build_deps
|
||||
fi
|
||||
|
||||
rm -rf "${LOG_DIR}"
|
||||
mkdir -p "${LOG_DIR}"
|
||||
|
@ -2,9 +2,6 @@ build_deps() {
|
||||
if [[ "${BUILD_32BIT}" == ON ]]; then
|
||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||
fi
|
||||
if [[ "${BUILD_MINGW}" == ON ]]; then
|
||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_MINGW}"
|
||||
fi
|
||||
if [[ "${FUNCTIONALTEST}" == "functionaltest-lua" ]]; then
|
||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
|
||||
fi
|
||||
@ -14,10 +11,15 @@ build_deps() {
|
||||
# If there is a valid cache and we're not forced to recompile,
|
||||
# use cached third-party dependencies.
|
||||
if [[ -f "${CACHE_MARKER}" ]] && [[ "${BUILD_NVIM_DEPS}" != true ]]; then
|
||||
echo "Using third-party dependencies from Travis's cache (last updated: $(stat -c '%y' "${CACHE_MARKER}"))."
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
local statcmd="stat -f '%Sm'"
|
||||
else
|
||||
local statcmd="stat -c '%y'"
|
||||
fi
|
||||
echo "Using third-party dependencies from Travis's cache (last updated: $(${statcmd} "${CACHE_MARKER}"))."
|
||||
|
||||
mkdir -p "$(dirname "${DEPS_BUILD_DIR}")"
|
||||
mv -T "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
|
||||
mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}"
|
||||
else
|
||||
mkdir -p "${DEPS_BUILD_DIR}"
|
||||
fi
|
||||
@ -26,7 +28,7 @@ build_deps() {
|
||||
# update CMake configuration and update to newer deps versions.
|
||||
cd "${DEPS_BUILD_DIR}"
|
||||
echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
|
||||
cmake ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/"
|
||||
CC= cmake ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/"
|
||||
|
||||
if ! ${MAKE_CMD}; then
|
||||
exit 1
|
||||
@ -42,9 +44,6 @@ build_nvim() {
|
||||
if [[ "${BUILD_32BIT}" == ON ]]; then
|
||||
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||
fi
|
||||
if [[ "${BUILD_MINGW}" == ON ]]; then
|
||||
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_MINGW}"
|
||||
fi
|
||||
|
||||
mkdir -p "${BUILD_DIR}"
|
||||
cd "${BUILD_DIR}"
|
||||
|
@ -63,6 +63,7 @@ run_functionaltests() {
|
||||
}
|
||||
|
||||
run_oldtests() {
|
||||
${MAKE_CMD} -C "${BUILD_DIR}" helptags
|
||||
if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then
|
||||
reset
|
||||
asan_check "${LOG_DIR}"
|
||||
@ -83,8 +84,9 @@ install_nvim() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
local genvimsynf=syntax/vim/generated.vim
|
||||
# Check that all runtime files were installed
|
||||
for file in doc/tags syntax/vim/generated.vim $(
|
||||
for file in doc/tags $genvimsynf $(
|
||||
cd runtime ; git ls-files | grep -e '.vim$' -e '.ps$' -e '.dict$' -e '.py$' -e '.tutor$'
|
||||
) ; do
|
||||
if ! test -e "${INSTALL_PREFIX}/share/nvim/runtime/$file" ; then
|
||||
@ -93,6 +95,13 @@ install_nvim() {
|
||||
fi
|
||||
done
|
||||
|
||||
# Check that generated syntax file has function names, #5060.
|
||||
local gpat='syn keyword vimFuncName .*eval'
|
||||
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf"; then
|
||||
echo "It appears that $genvimsynf does not contain $gpat."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for file in $(
|
||||
cd runtime ; git ls-files | grep -e '.awk$' -e '.sh$' -e '.bat$'
|
||||
) ; do
|
||||
|
@ -9,24 +9,19 @@ fi
|
||||
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
brew install gettext
|
||||
elif [[ "${BUILD_MINGW}" == ON ]]; then
|
||||
# TODO: When Travis gets a recent version of Mingw-w64 use packages:
|
||||
# binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-dev mingw-w64-tools
|
||||
|
||||
echo "Downloading MinGW..."
|
||||
curl -sSL "https://github.com/neovim/deps/raw/master/opt/i686-w64-mingw32-gcc-4.8.0-linux64_rubenvb.tar.xz" \
|
||||
| tar xJf - -C "${HOME}/.local"
|
||||
|
||||
brew reinstall -s libtool
|
||||
fi
|
||||
|
||||
# Set CC to default to avoid compilation problems
|
||||
# when installing Python modules.
|
||||
# Use default CC to avoid compilation problems when installing Python modules.
|
||||
echo "Install neovim module and coveralls for Python 2."
|
||||
CC=cc pip2.7 install --user --upgrade neovim cpp-coveralls
|
||||
CC=cc pip2.7 -q install --user --upgrade neovim cpp-coveralls
|
||||
|
||||
echo "Install neovim module for Python 3."
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
CC=cc pip3 install --user --upgrade neovim
|
||||
CC=cc pip3 -q install --user --upgrade neovim
|
||||
else
|
||||
CC=cc pip3.3 install --user --upgrade neovim
|
||||
CC=cc pip3.3 -q install --user --upgrade neovim
|
||||
fi
|
||||
|
||||
echo "Install neovim RubyGem."
|
||||
gem install --no-document --version ">= 0.2.0" neovim
|
||||
|
22
.ci/msys_build.bat
Normal file
22
.ci/msys_build.bat
Normal file
@ -0,0 +1,22 @@
|
||||
echo on
|
||||
if "%TARGET%" == "MINGW_32" (
|
||||
set ARCH=i686
|
||||
set BITS=32
|
||||
) else (
|
||||
set ARCH=x86_64
|
||||
set BITS=64
|
||||
)
|
||||
:: We cannot have sh.exe in the PATH (MinGW)
|
||||
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
|
||||
set PATH=C:\msys64\mingw%BITS%\bin;C:\Windows\System32;C:\Windows;%PATH%
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release .. || goto :error
|
||||
mingw32-make VERBOSE=1 || goto :error
|
||||
bin\nvim --version || goto :error
|
||||
cd ..
|
||||
|
||||
goto :EOF
|
||||
:error
|
||||
exit /b %errorlevel%
|
27
.ci/msys_build_deps.bat
Normal file
27
.ci/msys_build_deps.bat
Normal file
@ -0,0 +1,27 @@
|
||||
:: These are native MinGW builds, but they use the toolchain inside
|
||||
:: MSYS2, this allows using all the dependencies and tools available
|
||||
:: in MSYS2, but we cannot build inside the MSYS2 shell.
|
||||
echo on
|
||||
if "%TARGET%" == "MINGW_32" (
|
||||
set ARCH=i686
|
||||
set BITS=32
|
||||
) else (
|
||||
set ARCH=x86_64
|
||||
set BITS=64
|
||||
)
|
||||
:: We cannot have sh.exe in the PATH (MinGW)
|
||||
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
|
||||
set PATH=C:\msys64\mingw%BITS%\bin;C:\Windows\System32;C:\Windows;%PATH%
|
||||
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" || goto :error
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-perl mingw-w64-%ARCH%-python2 mingw-w64-%ARCH%-diffutils" || goto :error
|
||||
|
||||
mkdir .deps
|
||||
cd .deps
|
||||
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..\third-party\ || goto :error
|
||||
mingw32-make VERBOSE=1 || goto :error
|
||||
cd ..
|
||||
|
||||
goto :EOF
|
||||
:error
|
||||
exit /b %errorlevel%
|
@ -3,14 +3,6 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# TODO: Stop here for MinGW builds,
|
||||
# building Neovim doesn't work yet.
|
||||
if [[ "${BUILD_MINGW}" == ON ]]; then
|
||||
echo "Neovim doesn't build on MinGW yet; stopping build."
|
||||
touch "${SUCCESS_MARKER}"
|
||||
exit
|
||||
fi
|
||||
|
||||
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${CI_DIR}/common/build.sh"
|
||||
source "${CI_DIR}/common/test.sh"
|
||||
|
@ -12,9 +12,6 @@ fi
|
||||
# as $USER, while retaining the environment variables defined and belonging
|
||||
# to secondary groups given above in usermod.
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
# Set up precompiled third-party dependencies.
|
||||
eval "$(curl -Ss https://raw.githubusercontent.com/neovim/bot-ci/master/scripts/travis-setup.sh) deps-x64"
|
||||
|
||||
sudo -E su "${USER}" -c ".ci/run_tests.sh"
|
||||
else
|
||||
.ci/run_tests.sh
|
||||
|
20
.gitignore
vendored
20
.gitignore
vendored
@ -23,11 +23,10 @@ tags
|
||||
|
||||
# Files generated by the tests
|
||||
/src/nvim/testdir/del
|
||||
/src/nvim/testdir/mbyte.vim
|
||||
/src/nvim/testdir/small.vim
|
||||
/src/nvim/testdir/tiny.vim
|
||||
/src/nvim/testdir/test*.out
|
||||
/src/nvim/testdir/test*.res
|
||||
/src/nvim/testdir/test.log
|
||||
/src/nvim/testdir/messages
|
||||
/src/nvim/testdir/viminfo
|
||||
/src/nvim/testdir/test.ok
|
||||
/src/nvim/testdir/*.failed
|
||||
@ -44,27 +43,12 @@ tags
|
||||
# luarocks, not added as a subtree because of the large number of blobs
|
||||
/third-party/luarocks
|
||||
|
||||
# luajit files
|
||||
/third-party/luajit/src/host/buildvm
|
||||
/third-party/luajit/src/host/buildvm_arch.h
|
||||
/third-party/luajit/src/host/minilua
|
||||
/third-party/luajit/src/jit/vmdef.lua
|
||||
/third-party/luajit/src/libluajit.a
|
||||
/third-party/luajit/src/lj_bcdef.h
|
||||
/third-party/luajit/src/lj_ffdef.h
|
||||
/third-party/luajit/src/lj_folddef.h
|
||||
/third-party/luajit/src/lj_libdef.h
|
||||
/third-party/luajit/src/lj_recdef.h
|
||||
/third-party/luajit/src/lj_vm.s
|
||||
/third-party/luajit/src/luajit
|
||||
|
||||
# local make targets
|
||||
local.mk
|
||||
|
||||
# runtime/doc
|
||||
/runtime/doc/*.html
|
||||
/runtime/doc/tags.ref
|
||||
/runtime/doc/doctags
|
||||
/runtime/doc/errors.log
|
||||
|
||||
# clint errors, generated by `make lint`
|
||||
|
29
.travis.yml
29
.travis.yml
@ -8,10 +8,10 @@ env:
|
||||
# Travis has 1.5 virtual cores according to
|
||||
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
|
||||
- MAKE_CMD="make -j2"
|
||||
# Update PATH for pip and MinGW.
|
||||
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$HOME/.local/mingw32/bin:$PATH"
|
||||
# Update PATH for pip.
|
||||
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$PATH"
|
||||
# LLVM symbolizer path.
|
||||
- LLVM_SYMBOLIZER="$(which llvm-symbolizer-3.6)"
|
||||
- LLVM_SYMBOLIZER="$(which llvm-symbolizer-3.4)"
|
||||
# Build directory for Neovim.
|
||||
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
||||
# Build directory for third-party dependencies.
|
||||
@ -34,12 +34,9 @@ env:
|
||||
- CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
|
||||
-DCMAKE_IGNORE_PATH=/lib:/usr/lib:/usr/local/lib
|
||||
-DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
|
||||
# Additional CMake flags for MinGW builds.
|
||||
- CMAKE_FLAGS_MINGW="-DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/mingw32-w64-cross-travis.toolchain.cmake"
|
||||
# Environment variables for Clang sanitizers.
|
||||
- ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan"
|
||||
- ASAN_SYMBOLIZER_PATH="$LLVM_SYMBOLIZER"
|
||||
- MSAN_SYMBOLIZER_PATH="$LLVM_SYMBOLIZER"
|
||||
- TSAN_OPTIONS="external_symbolizer_path=$LLVM_SYMBOLIZER log_path=$LOG_DIR/tsan"
|
||||
- UBSAN_OPTIONS="log_path=$LOG_DIR/ubsan"
|
||||
# Environment variables for Valgrind.
|
||||
@ -62,6 +59,7 @@ matrix:
|
||||
env: CI_TARGET=lint
|
||||
- os: linux
|
||||
compiler: gcc-5
|
||||
env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||
- os: linux
|
||||
compiler: gcc-5
|
||||
env: FUNCTIONALTEST=functionaltest-lua
|
||||
@ -72,24 +70,16 @@ matrix:
|
||||
compiler: gcc-5 -m32
|
||||
env: BUILD_32BIT=ON
|
||||
- os: linux
|
||||
compiler: clang-3.6
|
||||
env: GCOV=llvm-cov-3.6 CLANG_SANITIZER=ASAN_UBSAN CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||
compiler: clang
|
||||
env: CLANG_SANITIZER=ASAN_UBSAN
|
||||
- os: linux
|
||||
compiler: clang-3.6
|
||||
env: CLANG_SANITIZER=MSAN
|
||||
- os: linux
|
||||
compiler: clang-3.6
|
||||
compiler: clang
|
||||
env: CLANG_SANITIZER=TSAN
|
||||
- os: osx
|
||||
compiler: clang
|
||||
- os: osx
|
||||
compiler: gcc-4.9
|
||||
- os: linux
|
||||
env: BUILD_MINGW=ON
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
# TODO: Remove when all MSan errors have been fixed.
|
||||
- env: CLANG_SANITIZER=MSAN
|
||||
|
||||
before_install: .ci/before_install.sh
|
||||
install: .ci/install.sh
|
||||
@ -103,13 +93,12 @@ addons:
|
||||
sources:
|
||||
# TODO: Remove PPA when Travis gets Python >=3.3.
|
||||
- deadsnakes
|
||||
- llvm-toolchain-precise-3.6
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- autoconf
|
||||
- automake
|
||||
- build-essential
|
||||
- clang-3.6
|
||||
- clang-3.4
|
||||
- cmake
|
||||
- g++-5-multilib
|
||||
- g++-multilib
|
||||
@ -118,7 +107,7 @@ addons:
|
||||
- gdb
|
||||
- libc6-dev-i386
|
||||
- libtool
|
||||
- llvm-3.6-dev
|
||||
- llvm-3.4-dev
|
||||
- pkg-config
|
||||
- python3.3-dev
|
||||
- unzip
|
||||
|
@ -59,7 +59,7 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||
# version string, else it is combined with the result of `git describe`.
|
||||
set(NVIM_VERSION_MAJOR 0)
|
||||
set(NVIM_VERSION_MINOR 1)
|
||||
set(NVIM_VERSION_PATCH 3)
|
||||
set(NVIM_VERSION_PATCH 5)
|
||||
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||
|
||||
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
|
||||
@ -291,23 +291,25 @@ endif()
|
||||
include_directories("${PROJECT_BINARY_DIR}/config")
|
||||
include_directories("${PROJECT_SOURCE_DIR}/src")
|
||||
|
||||
# Modules used by platform auto-detection
|
||||
include(CheckLibraryExists)
|
||||
|
||||
find_package(LibUV REQUIRED)
|
||||
include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
|
||||
|
||||
find_package(Msgpack 1.0.0 REQUIRED)
|
||||
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
||||
|
||||
find_package(LuaJit REQUIRED)
|
||||
include_directories(SYSTEM ${LUAJIT_INCLUDE_DIRS})
|
||||
if(UNIX)
|
||||
option(FEAT_TUI "Enable the Terminal UI" ON)
|
||||
else()
|
||||
option(FEAT_TUI "Enable the Terminal UI" OFF)
|
||||
endif()
|
||||
|
||||
if(FEAT_TUI)
|
||||
find_package(Unibilium REQUIRED)
|
||||
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
|
||||
|
||||
find_package(LibTermkey REQUIRED)
|
||||
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
find_package(LibVterm REQUIRED)
|
||||
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
|
||||
@ -367,9 +369,9 @@ endforeach()
|
||||
|
||||
# Find Lua interpreter
|
||||
include(LuaHelpers)
|
||||
set(LUA_DEPENDENCIES lpeg MessagePack bit)
|
||||
set(LUA_DEPENDENCIES lpeg mpack bit)
|
||||
if(NOT LUA_PRG)
|
||||
foreach(CURRENT_LUA_PRG luajit lua)
|
||||
foreach(CURRENT_LUA_PRG luajit lua5.1 lua5.2 lua)
|
||||
# If LUA_PRG is set find_program() will not search
|
||||
unset(LUA_PRG CACHE)
|
||||
unset(LUA_PRG_WORKS)
|
||||
@ -396,8 +398,12 @@ message(STATUS "Using the Lua interpreter ${LUA_PRG}.")
|
||||
find_program(BUSTED_PRG busted)
|
||||
find_program(BUSTED_LUA_PRG busted-lua)
|
||||
if(NOT BUSTED_OUTPUT_TYPE)
|
||||
if(WIN32)
|
||||
set(BUSTED_OUTPUT_TYPE "plainTerminal")
|
||||
else()
|
||||
set(BUSTED_OUTPUT_TYPE "utfTerminal")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_program(LUACHECK_PRG luacheck)
|
||||
|
||||
@ -451,12 +457,24 @@ if(BUSTED_PRG)
|
||||
get_target_property(TEST_LIBNVIM_PATH nvim-test LOCATION)
|
||||
endif()
|
||||
|
||||
# When running tests from 'ninja' we need to use the
|
||||
# console pool: to do so we need to use the USES_TERMINAL
|
||||
# option, but this is only available in CMake 3.2
|
||||
set(TEST_TARGET_ARGS)
|
||||
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.2.0))
|
||||
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
test/config/paths.lua.in
|
||||
${CMAKE_BINARY_DIR}/test/config/paths.lua)
|
||||
|
||||
set(UNITTEST_PREREQS nvim-test unittest-headers)
|
||||
if(WIN32)
|
||||
set(FUNCTIONALTEST_PREREQS nvim shell-test)
|
||||
else()
|
||||
set(FUNCTIONALTEST_PREREQS nvim tty-test shell-test)
|
||||
endif()
|
||||
set(BENCHMARK_PREREQS nvim tty-test)
|
||||
|
||||
# Useful for automated build systems, if they want to manually run the tests.
|
||||
@ -469,6 +487,8 @@ if(BUSTED_PRG)
|
||||
add_custom_target(benchmark-prereqs
|
||||
DEPENDS ${BENCHMARK_PREREQS})
|
||||
|
||||
check_lua_module(${LUA_PRG} "ffi" LUA_HAS_FFI)
|
||||
if(LUA_HAS_FFI)
|
||||
add_custom_target(unittest
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DBUSTED_PRG=${BUSTED_PRG}
|
||||
@ -479,11 +499,17 @@ if(BUSTED_PRG)
|
||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||
-DTEST_TYPE=unit
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||
DEPENDS ${UNITTEST_PREREQS})
|
||||
DEPENDS ${UNITTEST_PREREQS}
|
||||
${TEST_TARGET_ARGS})
|
||||
else()
|
||||
message(WARNING "The Luajit ffi is not available in ${LUA_PRG}"
|
||||
", disabling unit tests")
|
||||
endif()
|
||||
|
||||
add_custom_target(functionaltest
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DBUSTED_PRG=${BUSTED_PRG}
|
||||
-DLUA_PRG=${LUA_PRG}
|
||||
-DNVIM_PRG=$<TARGET_FILE:nvim>
|
||||
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
||||
@ -491,11 +517,13 @@ if(BUSTED_PRG)
|
||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||
-DTEST_TYPE=functional
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||
DEPENDS ${FUNCTIONALTEST_PREREQS})
|
||||
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
||||
${TEST_TARGET_ARGS})
|
||||
|
||||
add_custom_target(benchmark
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DBUSTED_PRG=${BUSTED_PRG}
|
||||
-DLUA_PRG=${LUA_PRG}
|
||||
-DNVIM_PRG=$<TARGET_FILE:nvim>
|
||||
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
||||
@ -503,13 +531,15 @@ if(BUSTED_PRG)
|
||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||
-DTEST_TYPE=benchmark
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||
DEPENDS ${BENCHMARK_PREREQS})
|
||||
DEPENDS ${BENCHMARK_PREREQS}
|
||||
${TEST_TARGET_ARGS})
|
||||
endif()
|
||||
|
||||
if(BUSTED_LUA_PRG)
|
||||
add_custom_target(functionaltest-lua
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DBUSTED_PRG=${BUSTED_LUA_PRG}
|
||||
-DLUA_PRG=${LUA_PRG}
|
||||
-DNVIM_PRG=$<TARGET_FILE:nvim>
|
||||
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
||||
@ -517,7 +547,8 @@ if(BUSTED_LUA_PRG)
|
||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||
-DTEST_TYPE=functional
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||
DEPENDS ${FUNCTIONALTEST_PREREQS})
|
||||
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
||||
${TEST_TARGET_ARGS})
|
||||
endif()
|
||||
|
||||
if(LUACHECK_PRG)
|
||||
|
248
CONTRIBUTING.md
248
CONTRIBUTING.md
@ -1,162 +1,105 @@
|
||||
# Contributing to Neovim
|
||||
|
||||
## Getting started
|
||||
Getting started
|
||||
---------------
|
||||
|
||||
- Help us review [open pull requests](https://github.com/neovim/neovim/pulls)!
|
||||
- Look for [entry-level issues][entry-level] to work on.
|
||||
- [Documentation](https://github.com/neovim/neovim/labels/documentation)
|
||||
improvements are also much appreciated.
|
||||
- Look at [Waffle][waffle] to see who is working on what issues.
|
||||
- If needed, refer to [the wiki][wiki-contributing] for guidance.
|
||||
If you want to help but don't know where to start, here are some
|
||||
low-risk/isolated tasks:
|
||||
|
||||
## Reporting problems
|
||||
- Help us [review pull requests](#reviewing)!
|
||||
- Merge a [Vim patch].
|
||||
- Try a [complexity:low] issue.
|
||||
- Fix [clang-scan] or [coverity](#coverity) warnings.
|
||||
|
||||
Before reporting an issue, see the following wiki articles:
|
||||
Reporting problems
|
||||
------------------
|
||||
|
||||
- [Troubleshooting][wiki-troubleshooting]
|
||||
- [Frequently asked questions][wiki-faq]
|
||||
- Check the [**FAQ**][wiki-faq].
|
||||
- Search [existing issues][github-issues] (including closed!)
|
||||
- Update Neovim to the latest version to see if your problem persists.
|
||||
- If you're using a plugin manager, comment out your plugins, then add them back
|
||||
in one by one, to narrow down the cause of the issue.
|
||||
- Crash reports which include a stacktrace are 10x more valuable.
|
||||
- [Bisecting][git-bisect] to the cause of a regression often leads to an
|
||||
immediate fix.
|
||||
|
||||
If your issue isn't mentioned there:
|
||||
Pull requests ("PRs")
|
||||
---------------------
|
||||
|
||||
- Verify that it hasn't already been reported.
|
||||
- If not already running the latest version of Neovim, update to it to see if
|
||||
your problem persists.
|
||||
- If you're experiencing compile or runtime warnings/failures, try searching for
|
||||
the error message(s) you received (if any) on [Neovim's issue tracker][github-issues].
|
||||
- For runtime issues, try reproducing it using `nvim` with the smallest
|
||||
possible `vimrc` (or none at all via `nvim -u NONE`), to rule out bugs in
|
||||
plugins you're using. If you're using a plugin manager, comment out your
|
||||
plugins, then add them back in one by one.
|
||||
|
||||
Include as much detail as possible; we generally need to know:
|
||||
|
||||
- What operating system you're using.
|
||||
- Which version of Neovim you're using. To get this, run `nvim --version` from
|
||||
a shell, or run `:version` from inside `nvim`.
|
||||
- Whether the bug is present in Vim (not Neovim), and if so which version of
|
||||
Vim. It's fine to report Vim bugs on the Neovim bug tracker, but it saves
|
||||
everyone time if we know from the start that the bug is not a regression
|
||||
caused by Neovim.
|
||||
- This isn't required, but what commit introduced the issue for you. You can
|
||||
use [`git bisect`][git-bisect] for this.
|
||||
|
||||
## Submitting contributions
|
||||
|
||||
- Make it clear in the issue tracker what you are working on.
|
||||
- Be descriptive in your pull request description: what is it for, why is it
|
||||
needed, etc.
|
||||
- Do ***not*** make cosmetic changes to unrelated files in the same pull
|
||||
request. This creates noise, making reviews harder to do. If your text
|
||||
editor strips all trailing whitespace in a file when you edit it, disable
|
||||
it.
|
||||
|
||||
### Tagging in the issue tracker
|
||||
|
||||
When submitting pull requests (commonly referred to as "PRs"), include one of
|
||||
the following tags prepended to the title:
|
||||
|
||||
- `[WIP]` - Work In Progress: the PR will change, so while there is no
|
||||
immediate need for review, the submitter still might appreciate it.
|
||||
- `[RFC]` - Request For Comment: the PR needs reviewing and/or comments.
|
||||
- `[RDY]` - Ready: the PR has been reviewed by at least one other person and
|
||||
has no outstanding issues.
|
||||
|
||||
Assuming the above criteria has been met, feel free to change your PR's tag
|
||||
yourself, as opposed to waiting for a contributor to do it for you.
|
||||
|
||||
### Branching & history
|
||||
|
||||
- Do ***not*** work on your PR on the master branch, [use a feature branch
|
||||
instead][git-feature-branch].
|
||||
- [Rebase your feature branch onto][git-rebasing] (upstream) master before
|
||||
- To avoid duplicate work, you may want to create a `[WIP]` pull request so that
|
||||
others know what you are working on.
|
||||
- Avoid cosmetic changes to unrelated files in the same commit: extra noise
|
||||
makes reviews more difficult.
|
||||
- Use a [feature branch][git-feature-branch] instead of the master branch.
|
||||
- [Rebase your feature branch][git-rebasing] onto (upstream) master before
|
||||
opening the PR.
|
||||
- Keep up to date with changes in (upstream) master so your PR is easy to
|
||||
merge.
|
||||
- [Try to actively tidy your history][git-history-rewriting]: combine related
|
||||
commits with interactive rebasing, separate monolithic commits, etc. If your
|
||||
PR is still `[WIP]`, feel free to force-push to your feature branch to tidy
|
||||
your history.
|
||||
- After addressing the review comments, it's fine to rebase and force-push to
|
||||
your review.
|
||||
- Try to [tidy your history][git-history-rewriting]: combine related commits
|
||||
with interactive rebasing, separate monolithic commits, etc.
|
||||
|
||||
### For code pull requests
|
||||
### Stages: WIP, RFC
|
||||
|
||||
#### Testing
|
||||
Pull requests have two stages: `[WIP]` (Work In Progress) and `[RFC]` (Request
|
||||
For Comment).
|
||||
|
||||
We are unlikely to merge your PR if the Travis build fails:
|
||||
- Untagged PRs are assumed to be `[RFC]`, i.e. the work is ready for review and
|
||||
you would like feedback.
|
||||
- Preprend `[WIP]` to the PR title if you are _not_ ready for feedback and the
|
||||
work is still in flux.
|
||||
|
||||
- Travis builds are compiled with the [`-Werror`][gcc-warnings] flag, so if
|
||||
your PR introduces any compiler warnings then the Travis build will fail.
|
||||
- If any tests fail, the Travis build will fail.
|
||||
See [Building Neovim#running-tests][wiki-building-running-tests] for
|
||||
information on running tests locally.
|
||||
Tests passing locally doesn't guarantee they'll pass in the Travis
|
||||
build, as different compilers and platforms will be used.
|
||||
- Travis runs [Valgrind][valgrind] for the GCC/Linux build, but you may also
|
||||
do so locally by running the following from a shell: `VALGRIND=1 make test`
|
||||
### Commit messages
|
||||
|
||||
#### Coding style
|
||||
|
||||
We have a [style guide][style-guide] that all new code should follow.
|
||||
However, large portions of the existing Vim codebase violate it to some
|
||||
degree, and fixing them would increase merge conflicts and add noise to `git
|
||||
blame`.
|
||||
|
||||
Weigh those costs when making cosmetic changes. In general, avoid pull
|
||||
requests dominated by style changes, but feel free to fix up lines that you
|
||||
happen to be modifying anyway. Fix anything that looks outright
|
||||
[barbarous](http://www.orwell.ru/library/essays/politics/english/e_polit), but
|
||||
otherwise prefer to leave things as they are.
|
||||
|
||||
For new code, run `make lint` (which runs [clint.py][clint]) to detect style
|
||||
errors. It's not perfect, so some warnings may be false positives/negatives.
|
||||
To have `clint.py` ignore certain cases, put `// NOLINT` at the end of the
|
||||
line.
|
||||
|
||||
We also provide a configuration file for [`clang-format`][clang-format], which
|
||||
can be used to format code according to the style guidelines. Be aware that
|
||||
this formatting method might need user supervision. To have `clang-format`
|
||||
ignore certain line ranges, use the following special comments:
|
||||
|
||||
```c
|
||||
int formatted_code;
|
||||
// clang-format off
|
||||
void unformatted_code ;
|
||||
// clang-format on
|
||||
void formatted_code_again;
|
||||
```
|
||||
|
||||
### Commit guidelines
|
||||
|
||||
The purpose of these guidelines is to *make reviews easier* and make the
|
||||
[VCS][vcs] logs more valuable.
|
||||
Follow [commit message hygiene][hygiene] to *make reviews easier* and to make
|
||||
the VCS/git logs more valuable.
|
||||
|
||||
- Try to keep the first line under 72 characters.
|
||||
- If necessary, include further description after a blank line.
|
||||
- Don't make the description too verbose by including obvious things, but
|
||||
don't spare clarifications for anything that may be not so obvious.
|
||||
Some commit messages are pages long, and that's fine if there's no
|
||||
better place for those comments to live.
|
||||
- **Recommended:** Prefix logically-related commits with a consistent
|
||||
identifier in each commit message. For already used identifiers, see the
|
||||
commit history for the respective file(s) you're editing.
|
||||
[For example](https://github.com/neovim/neovim/commits?author=elmart),
|
||||
the following commits are related by task (*Introduce nvim namespace*) and
|
||||
sub-task (*Contrib YCM*).
|
||||
<br/> `Introduce nvim namespace: Contrib YCM: Fix style issues`
|
||||
<br/> `Introduce nvim namespace: Contrib YCM: Fix build dir calculation`
|
||||
- Sub-tasks can be *activity-oriented* (doing different things on the same area)
|
||||
or *scope-oriented* (doing the same thing in different areas).
|
||||
- Granularity helps, but it's conceptual size that matters, not extent size.
|
||||
- Use the [imperative voice][imperative]: "Fix bug" rather than "Fixed bug" or "Fixes bug."
|
||||
- **Prefix the commit subject with a _scope_:** `doc:`, `test:`, `foo.c:`,
|
||||
`runtime:`, ...
|
||||
- For commits that contain only style/lint changes, a single-word subject
|
||||
line is preferred: `style` or `lint`.
|
||||
- A blank line must separate the subject from the description.
|
||||
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
|
||||
|
||||
### Reviewing pull requests
|
||||
### Automated builds (CI)
|
||||
|
||||
Using a checklist during reviews is highly recommended, so we [provide one at
|
||||
the wiki][wiki-review-checklist]. If you think it could be improved, feel free
|
||||
to edit it.
|
||||
Each pull request must pass the automated builds ([travis CI] and [quickbuild]).
|
||||
|
||||
- CI builds are compiled with [`-Werror`][gcc-warnings], so if your PR
|
||||
introduces any compiler warnings, the build will fail.
|
||||
- If any tests fail, the build will fail.
|
||||
See [Building Neovim#running-tests][wiki-run-tests] to run tests locally.
|
||||
Passing locally doesn't guarantee passing the CI build, because of the
|
||||
different compilers and platforms tested against.
|
||||
- CI runs [ASan] and other analyzers. To run valgrind locally:
|
||||
`VALGRIND=1 make test`
|
||||
- The `lint` build ([#3174][3174]) checks modified lines _and their immediate
|
||||
neighbors_. This is to encourage incrementally updating the legacy style to
|
||||
meet our style guidelines.
|
||||
- A single word (`lint` or `style`) is sufficient as the subject line of
|
||||
a commit that contains only style changes.
|
||||
- [How to investigate QuickBuild failures](https://github.com/neovim/neovim/pull/4718#issuecomment-217631350)
|
||||
|
||||
### Coverity
|
||||
|
||||
[Coverity](https://scan.coverity.com/projects/neovim-neovim) runs against the
|
||||
master build. If you want to view the defects, just request access at the
|
||||
_Contributor_ level. An Admin will grant you permission.
|
||||
|
||||
Use this commit-message format for coverity fixes:
|
||||
|
||||
coverity/<id>: <description of what fixed the defect>
|
||||
|
||||
where `<id>` is the Coverity ID (CID). For example see [#804](https://github.com/neovim/neovim/pull/804).
|
||||
|
||||
Reviewing
|
||||
---------
|
||||
|
||||
To help review pull requests, start with [this checklist][review-checklist].
|
||||
|
||||
Reviewing can be done on GitHub, but you may find it easier to do locally.
|
||||
Using [`hub`][hub], you can do the following to create a new branch with the
|
||||
contents of a pull request, such as [#1820][github-pr-1820]:
|
||||
Using [`hub`][hub], you can create a new branch with the contents of a pull
|
||||
request, e.g. [#1820][1820]:
|
||||
|
||||
hub checkout https://github.com/neovim/neovim/pull/1820
|
||||
|
||||
@ -165,12 +108,6 @@ commits in the feature branch which aren't in the `master` branch; `-p`
|
||||
shows each commit's diff. To show the whole surrounding function of a change
|
||||
as context, use the `-W` argument as well.
|
||||
|
||||
You may find it easier to instead use an interactive program for code reviews,
|
||||
such as [`tig`][tig].
|
||||
|
||||
[clang-format]: http://clang.llvm.org/docs/ClangFormat.html
|
||||
[clint]: clint.py
|
||||
[entry-level]: https://github.com/neovim/neovim/issues?labels=entry-level&state=open
|
||||
[gcc-warnings]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||
[git-bisect]: http://git-scm.com/book/tr/v2/Git-Tools-Debugging-with-Git
|
||||
[git-feature-branch]: https://www.atlassian.com/git/tutorials/comparing-workflows
|
||||
@ -178,16 +115,17 @@ such as [`tig`][tig].
|
||||
[git-history-rewriting]: http://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
|
||||
[git-rebasing]: http://git-scm.com/book/en/v2/Git-Branching-Rebasing
|
||||
[github-issues]: https://github.com/neovim/neovim/issues
|
||||
[github-pr-1820]: https://github.com/neovim/neovim/pull/1820
|
||||
[1820]: https://github.com/neovim/neovim/pull/1820
|
||||
[hub]: https://hub.github.com/
|
||||
[imperative]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
||||
[hygiene]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
||||
[style-guide]: http://neovim.io/develop/style-guide.xml
|
||||
[tig]: https://github.com/jonas/tig
|
||||
[valgrind]: http://valgrind.org/
|
||||
[vcs]: https://en.wikipedia.org/wiki/Revision_control
|
||||
[waffle]: https://waffle.io/neovim/neovim
|
||||
[wiki-building-running-tests]: https://github.com/neovim/neovim/wiki/Building-Neovim#running-tests
|
||||
[wiki-contributing]: https://github.com/neovim/neovim/wiki/Contributing
|
||||
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
|
||||
[wiki-run-tests]: https://github.com/neovim/neovim/wiki/Building-Neovim#running-tests
|
||||
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
|
||||
[wiki-review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
|
||||
[wiki-troubleshooting]: https://github.com/neovim/neovim/wiki/Troubleshooting
|
||||
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
|
||||
[3174]: https://github.com/neovim/neovim/issues/3174
|
||||
[travis CI]: https://travis-ci.org/neovim/neovim
|
||||
[quickbuild]: http://neovim-qb.szakmeister.net/dashboard
|
||||
[Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
|
||||
[clang-scan]: https://neovim.io/doc/reports/clang/
|
||||
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
|
||||
|
@ -1,6 +1,5 @@
|
||||
- Neovim version:
|
||||
- [ ] Vim behaves differently?
|
||||
- Vim version:
|
||||
- `nvim --version`:
|
||||
- Vim (version: ) behaves differently?
|
||||
- Operating system/version:
|
||||
- Terminal name/version:
|
||||
- `$TERM`:
|
||||
@ -9,7 +8,9 @@
|
||||
|
||||
### Expected behaviour
|
||||
|
||||
### Steps to reproduce using `nvim -u NONE`
|
||||
### Steps to reproduce using `nvim -u NORC`
|
||||
|
||||
1. `nvim -u NONE`
|
||||
2.
|
||||
```
|
||||
nvim -u NORC
|
||||
|
||||
```
|
||||
|
15
Makefile
15
Makefile
@ -85,16 +85,19 @@ endif
|
||||
mkdir -p build
|
||||
touch $@
|
||||
|
||||
oldtest: | nvim
|
||||
oldtest: | nvim helptags
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir $(MAKEOVERRIDES)
|
||||
|
||||
helptags: | nvim
|
||||
+$(BUILD_CMD) -C build helptags
|
||||
|
||||
functionaltest: | nvim
|
||||
+$(BUILD_CMD) -C build functionaltest
|
||||
|
||||
functionaltest-lua: | nvim
|
||||
+$(BUILD_CMD) -C build functionaltest-lua
|
||||
|
||||
testlint: | nvim
|
||||
testlint: | build/.ran-cmake deps
|
||||
$(BUILD_CMD) -C build testlint
|
||||
|
||||
unittest: | nvim
|
||||
@ -115,10 +118,12 @@ distclean: clean
|
||||
install: | nvim
|
||||
+$(BUILD_CMD) -C build install
|
||||
|
||||
lint:
|
||||
cmake -DLINT_PRG=./clint.py \
|
||||
clint:
|
||||
cmake -DLINT_PRG=./src/clint.py \
|
||||
-DLINT_DIR=src \
|
||||
-DLINT_SUPPRESS_URL="$(DOC_DOWNLOAD_URL_BASE)$(CLINT_ERRORS_FILE_PATH)" \
|
||||
-P cmake/RunLint.cmake
|
||||
|
||||
.PHONY: test testlint functionaltest unittest lint clean distclean nvim libnvim cmake deps install
|
||||
lint: clint testlint
|
||||
|
||||
.PHONY: test testlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install
|
||||
|
69
README.md
69
README.md
@ -1,12 +1,6 @@
|
||||

|
||||
|
||||
[Website](http://neovim.io) |
|
||||
[Community](http://neovim.io/community/) |
|
||||
[Wiki](https://github.com/neovim/neovim/wiki) |
|
||||
[Documentation](http://neovim.io/doc) |
|
||||
[Mailing List](https://groups.google.com/forum/#!forum/neovim) |
|
||||
[Twitter](http://twitter.com/Neovim) |
|
||||
[Bountysource](https://www.bountysource.com/teams/neovim)
|
||||
[Website] | [Community] | [Wiki] | [Documentation] | [Mailing List] | [Twitter] | [Bountysource]
|
||||
|
||||
[](https://travis-ci.org/neovim/neovim)
|
||||
[](https://ci.appveyor.com/project/neovim/neovim/branch/master)
|
||||
@ -14,48 +8,48 @@
|
||||
[](https://coveralls.io/r/neovim/neovim)
|
||||
[](https://scan.coverity.com/projects/2227)
|
||||
[](http://neovim.io/doc/reports/clang)
|
||||
[](https://gitter.im/neovim/neovim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://gitter.im/neovim/neovim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
Neovim is a project that seeks to aggressively refactor Vim in order to:
|
||||
|
||||
- Simplify maintenance and encourage [contributions](https://github.com/neovim/neovim/wiki/Contributing)
|
||||
- Simplify maintenance and encourage [contributions](CONTRIBUTING.md)
|
||||
- Split the work between multiple developers
|
||||
- Enable the implementation of new/modern user interfaces without any
|
||||
modifications to the core source
|
||||
- Enable the implementation of new/modern UIs without modifications to the core
|
||||
- Improve extensibility with a new [plugin architecture](https://github.com/neovim/neovim/wiki/Plugin-UI-architecture)
|
||||
|
||||
For lots more details, see
|
||||
For more details, see
|
||||
[the wiki](https://github.com/neovim/neovim/wiki/Introduction)!
|
||||
|
||||
### What's been done so far
|
||||
|
||||
- Automatic [history merge](https://github.com/neovim/neovim/pull/2506) between multiple editor instances
|
||||
- [XDG-compliant](https://github.com/neovim/neovim/pull/3470) configuration
|
||||
- Embedded [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
|
||||
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
|
||||
- [MessagePack](https://msgpack.org) remote API
|
||||
- [Pushdown automaton](https://github.com/neovim/neovim/pull/3413) for state transitions
|
||||
|
||||
See the [progress page](https://github.com/neovim/neovim/wiki/Progress) for a comprehensive list.
|
||||
|
||||
[](https://waffle.io/neovim/neovim/metrics)
|
||||
|
||||
### What's being worked on now
|
||||
What's been done so far
|
||||
-----------------------
|
||||
|
||||
- Port all IO to [libuv](https://github.com/libuv/libuv/blob/master/README.md)
|
||||
- Convert legacy tests to Lua tests
|
||||
- VimL => Lua translator
|
||||
- RPC API based on [MessagePack](https://msgpack.org)
|
||||
- Embedded [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
|
||||
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
|
||||
- [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances
|
||||
- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support
|
||||
- [libuv](https://github.com/libuv/libuv/)-based platform/OS/"mch" layer
|
||||
- [Pushdown automaton](https://github.com/neovim/neovim/pull/3413) input model
|
||||
- 1000s of new tests
|
||||
- Legacy tests converted to Lua tests
|
||||
|
||||
### How do I get it?
|
||||
See [`:help nvim-features`][nvim-features] for a comprehensive list.
|
||||
|
||||
What's being worked on now
|
||||
--------------------------
|
||||
|
||||
See the [Roadmap].
|
||||
|
||||
How do I get it?
|
||||
----------------
|
||||
|
||||
There is a formula for OSX/homebrew, a PKGBUILD for Arch Linux, RPM, deb, and
|
||||
more. See [the wiki](https://github.com/neovim/neovim/wiki/Installing-Neovim)!
|
||||
|
||||
### Contributing
|
||||
|
||||
...would be awesome! See [the wiki](https://github.com/neovim/neovim/wiki/Contributing) for more details.
|
||||
|
||||
### License
|
||||
License
|
||||
-------
|
||||
|
||||
Neovim is licensed under the terms of the Apache 2.0 license, except for
|
||||
parts that were contributed under the Vim license.
|
||||
@ -80,6 +74,15 @@ See `LICENSE` for details.
|
||||
You can also sponsor the development of Vim. Vim sponsors can vote for
|
||||
features. The money goes to Uganda anyway.
|
||||
|
||||
[Website]: http://neovim.io
|
||||
[Community]: http://neovim.io/community/
|
||||
[Wiki]: https://github.com/neovim/neovim/wiki
|
||||
[Documentation]: http://neovim.io/doc
|
||||
[Mailing List]: https://groups.google.com/forum/#!forum/neovim
|
||||
[Twitter]: http://twitter.com/Neovim
|
||||
[Bountysource]: https://www.bountysource.com/teams/neovim
|
||||
[license-commit]: https://github.com/neovim/neovim/commit/b17d9691a24099c9210289f16afb1a498a89d803
|
||||
[nvim-features]: https://neovim.io/doc/user/vim_diff.html#nvim-features
|
||||
[Roadmap]: https://neovim.io/roadmap/
|
||||
|
||||
<!-- vim: set tw=80: -->
|
||||
|
33
appveyor.yml
33
appveyor.yml
@ -1,23 +1,22 @@
|
||||
version: '{build}'
|
||||
skip_tags: true
|
||||
os: Windows Server 2012 R2
|
||||
environment:
|
||||
GYP_MSVS_VERSION: 2015
|
||||
# The default cpack in the PATH is not CMake
|
||||
CPACK: C:\Program Files (x86)\CMake\bin\cpack.exe
|
||||
matrix:
|
||||
- GENERATOR: Visual Studio 14 Win64
|
||||
DEPS_PATH: deps64
|
||||
- GENERATOR: Visual Studio 14
|
||||
DEPS_PATH: deps32
|
||||
matrix:
|
||||
# Allow builds to fail
|
||||
allow_failures:
|
||||
- os: Windows Server 2012 R2
|
||||
- TARGET: MINGW_64
|
||||
BUILD_DEPS_SCRIPT: .ci\msys_build_deps.bat
|
||||
BUILD_SCRIPT: .ci\msys_build.bat
|
||||
- TARGET: MINGW_32
|
||||
BUILD_DEPS_SCRIPT: .ci\msys_build_deps.bat
|
||||
BUILD_SCRIPT: .ci\msys_build.bat
|
||||
install: []
|
||||
build_script:
|
||||
# See http://help.appveyor.com/discussions/problems/539-cloning-gyp-fails
|
||||
- git config --global url."http://".insteadOf https://
|
||||
- mkdir %DEPS_PATH%
|
||||
- cd %DEPS_PATH%
|
||||
- cmake -G "%GENERATOR%" ..\third-party\
|
||||
- cmake --build .
|
||||
- cd ..
|
||||
- if defined BUILD_DEPS_SCRIPT call %BUILD_DEPS_SCRIPT%
|
||||
- call %BUILD_SCRIPT%
|
||||
# Build artifacts
|
||||
- cd build
|
||||
- '"%CPACK%" -G NSIS -C Release'
|
||||
- '"%CPACK%" -G ZIP -C Release'
|
||||
artifacts:
|
||||
- path: build/Neovim.zip
|
||||
|
@ -42,7 +42,12 @@ if(MSGPACK_USE_STATIC)
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpack${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# The import library for the msgpack DLL has a different name
|
||||
list(APPEND MSGPACK_NAMES msgpack_import)
|
||||
else()
|
||||
list(APPEND MSGPACK_NAMES msgpackc msgpack)
|
||||
endif()
|
||||
|
||||
find_library(MSGPACK_LIBRARY NAMES ${MSGPACK_NAMES}
|
||||
# Check each directory for all names to avoid using headers/libraries from
|
||||
|
@ -8,8 +8,6 @@ function(check_lua_module LUA_PRG_PATH MODULE RESULT_VAR)
|
||||
RESULT_VARIABLE module_missing
|
||||
ERROR_QUIET)
|
||||
if(module_missing)
|
||||
message(STATUS
|
||||
"[${LUA_PRG_PATH}] The '${MODULE}' lua package is required for building Neovim")
|
||||
set(${RESULT_VAR} False PARENT_SCOPE)
|
||||
else()
|
||||
set(${RESULT_VAR} True PARENT_SCOPE)
|
||||
@ -29,6 +27,8 @@ function(check_lua_deps LUA_PRG_PATH MODULES RESULT_VAR)
|
||||
foreach(module ${MODULES})
|
||||
check_lua_module(${LUA_PRG_PATH} ${module} has_module)
|
||||
if(NOT has_module)
|
||||
message(STATUS
|
||||
"[${LUA_PRG_PATH}] The '${module}' lua package is required for building Neovim")
|
||||
set(${RESULT_VAR} False PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
@ -2,6 +2,9 @@ get_filename_component(BUSTED_DIR ${BUSTED_PRG} PATH)
|
||||
set(ENV{PATH} "${BUSTED_DIR}:$ENV{PATH}")
|
||||
|
||||
set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime)
|
||||
set(ENV{NVIM_RPLUGIN_MANIFEST} ${WORKING_DIR}/Xtest_rplugin_manifest)
|
||||
set(ENV{XDG_CONFIG_HOME} ${WORKING_DIR}/Xtest_xdg/config)
|
||||
set(ENV{XDG_DATA_HOME} ${WORKING_DIR}/Xtest_xdg/share)
|
||||
|
||||
if(NVIM_PRG)
|
||||
set(ENV{NVIM_PROG} "${NVIM_PRG}")
|
||||
@ -27,13 +30,16 @@ endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${BUSTED_PRG} ${TEST_TAG} ${TEST_FILTER} -v -o ${BUSTED_OUTPUT_TYPE}
|
||||
--lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
|
||||
--lua=${LUA_PRG} --lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
|
||||
--lpath=${BUILD_DIR}/?.lua ${TEST_PATH}
|
||||
WORKING_DIRECTORY ${WORKING_DIR}
|
||||
ERROR_VARIABLE err
|
||||
RESULT_VARIABLE res
|
||||
${EXTRA_ARGS})
|
||||
|
||||
file(REMOVE ${WORKING_DIR}/Xtest_rplugin_manifest)
|
||||
file(REMOVE_RECURSE ${WORKING_DIR}/Xtest_xdg)
|
||||
|
||||
if(NOT res EQUAL 0)
|
||||
message(STATUS "Output to stderr:\n${err}")
|
||||
message(FATAL_ERROR "Running ${TEST_TYPE} tests failed with error: ${res}.")
|
||||
|
@ -1,5 +1,7 @@
|
||||
set(IGNORE_FILES "${TEST_DIR}/*/preload.lua")
|
||||
|
||||
execute_process(
|
||||
COMMAND ${LUACHECK_PRG} -q ${TEST_DIR}
|
||||
COMMAND ${LUACHECK_PRG} -q ${TEST_DIR} --exclude-files ${IGNORE_FILES}
|
||||
WORKING_DIRECTORY ${TEST_DIR}
|
||||
ERROR_VARIABLE err
|
||||
RESULT_VARIABLE res
|
||||
|
30
cmake/WindowsDllCopy.cmake
Normal file
30
cmake/WindowsDllCopy.cmake
Normal file
@ -0,0 +1,30 @@
|
||||
# In Windows we need to find dependency DLLs and install them along with our
|
||||
# binaries. This script uses the following variables:
|
||||
#
|
||||
# - BINARY: The binary file whose dependencies need to be installed
|
||||
# - DST: The destination path
|
||||
# - CMAKE_PREFIX_PATH: A list of directories to search for dependencies
|
||||
|
||||
if(NOT DEFINED BINARY)
|
||||
message(FATAL_ERROR "Missing required argument -DBINARY=")
|
||||
endif()
|
||||
if(NOT DEFINED DST)
|
||||
message(FATAL_ERROR "Missing required arguments -DDST=")
|
||||
endif()
|
||||
if(NOT DEFINED CMAKE_PREFIX_PATH)
|
||||
message(FATAL_ERROR "Missing required arguments -DCMAKE_PREFIX_PATH=")
|
||||
endif()
|
||||
|
||||
include(GetPrerequisites)
|
||||
get_prerequisites(${BINARY} DLLS 1 1 "" "${CMAKE_PREFIX_PATH}")
|
||||
foreach(DLL_NAME ${DLLS})
|
||||
find_program(DLL_PATH ${DLL_NAME})
|
||||
if(NOT DLL_PATH)
|
||||
message(FATAL_ERROR "Unable to find dependency ${DLL_NAME}")
|
||||
endif()
|
||||
|
||||
message("Copying ${DLL_NAME} to ${DST}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${DLL_PATH} ${DST})
|
||||
unset(DLL_PATH CACHE)
|
||||
endforeach()
|
||||
|
@ -27,12 +27,15 @@ if(NOT HAVE_SYS_WAIT_H AND UNIX)
|
||||
endif()
|
||||
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
|
||||
check_include_files(utime.h HAVE_UTIME_H)
|
||||
check_include_files(sys/uio.h HAVE_SYS_UIO_H)
|
||||
|
||||
# Functions
|
||||
check_function_exists(fseeko HAVE_FSEEKO)
|
||||
check_function_exists(getpwent HAVE_GETPWENT)
|
||||
check_function_exists(getpwnam HAVE_GETPWNAM)
|
||||
check_function_exists(getpwuid HAVE_GETPWUID)
|
||||
check_function_exists(uv_translate_sys_error HAVE_UV_TRANSLATE_SYS_ERROR)
|
||||
check_function_exists(readv HAVE_READV)
|
||||
|
||||
if(Iconv_FOUND)
|
||||
set(HAVE_ICONV 1)
|
||||
@ -67,6 +70,14 @@ if(HAVE_LANGINFO_H)
|
||||
check_symbol_exists(CODESET "langinfo.h" HAVE_NL_LANGINFO_CODESET)
|
||||
endif()
|
||||
|
||||
check_include_files("endian.h" HAVE_ENDIAN_H)
|
||||
check_include_files("sys/endian.h" HAVE_SYS_ENDIAN_H)
|
||||
|
||||
set(ENDIAN_INCLUDE_FILE "endian.h")
|
||||
if(HAVE_SYS_ENDIAN_H AND NOT HAVE_ENDIAN_H)
|
||||
set(ENDIAN_INCLUDE_FILE "sys/endian.h")
|
||||
endif()
|
||||
|
||||
set(SI "#include <stdint.h>\n")
|
||||
set(MS "int main(int argc,char**argv)\n{\n uint64_t i=0x0102030405060708ULL;")
|
||||
set(ME "}")
|
||||
@ -74,7 +85,7 @@ check_c_source_compiles("
|
||||
#define _BSD_SOURCE 1
|
||||
#define _DEFAULT_SOURCE 1
|
||||
${SI}
|
||||
#include <endian.h>
|
||||
#include <${ENDIAN_INCLUDE_FILE}>
|
||||
#ifndef be64toh
|
||||
# error No be64toh macros
|
||||
#endif
|
||||
|
@ -30,6 +30,7 @@
|
||||
#cmakedefine HAVE_PUTENV_S
|
||||
#cmakedefine HAVE_PWD_H
|
||||
#cmakedefine HAVE_READLINK
|
||||
#cmakedefine HAVE_UV_TRANSLATE_SYS_ERROR
|
||||
// TODO: add proper cmake check
|
||||
// #define HAVE_SELINUX 1
|
||||
#cmakedefine HAVE_SETENV
|
||||
@ -48,8 +49,15 @@
|
||||
#cmakedefine HAVE_WORKING_LIBINTL
|
||||
#cmakedefine UNIX
|
||||
#cmakedefine USE_FNAME_CASE
|
||||
#cmakedefine HAVE_SYS_UIO_H
|
||||
#ifdef HAVE_SYS_UIO_H
|
||||
#cmakedefine HAVE_READV
|
||||
# ifndef HAVE_READV
|
||||
# undef HAVE_SYS_UIO_H
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define FEAT_CSCOPE
|
||||
#cmakedefine FEAT_TUI
|
||||
|
||||
#ifndef UNIT_TESTING
|
||||
#cmakedefine HAVE_JEMALLOC
|
||||
@ -57,5 +65,6 @@
|
||||
|
||||
#cmakedefine HAVE_BE64TOH
|
||||
#cmakedefine ORDER_BIG_ENDIAN
|
||||
#define ENDIAN_INCLUDE_FILE <@ENDIAN_INCLUDE_FILE@>
|
||||
|
||||
#endif // AUTO_CONFIG_H
|
||||
|
@ -353,7 +353,7 @@ Like
|
||||
but used to store data not generally edited by the user,
|
||||
namely swap, backup, and ShaDa files.
|
||||
Defaults to
|
||||
.Pa ~/.local/share/nvim
|
||||
.Pa ~/.local/share
|
||||
if not set.
|
||||
.It Ev VIMINIT
|
||||
A string of Ex commands to be executed at startup.
|
||||
@ -391,9 +391,6 @@ See
|
||||
in the
|
||||
.Xr tmux 1
|
||||
manual page for more information.
|
||||
.It Ev NVIM_TUI_ENABLE_TRUE_COLOR
|
||||
If defined, assume the host terminal supports 24 bit colors.
|
||||
Has no effect in GUIs.
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -width "~/.config/nvim/init.vim"
|
||||
|
@ -1,9 +0,0 @@
|
||||
odie <<-EOS.undent
|
||||
|
||||
Whoops, the neovim Homebrew Formula has moved! Please instead run:
|
||||
|
||||
brew tap neovim/homebrew-neovim
|
||||
brew install --HEAD neovim
|
||||
|
||||
Thanks!
|
||||
EOS
|
@ -2,6 +2,7 @@ set(SYN_VIM_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/genvimvim.lua)
|
||||
set(GENERATED_RUNTIME_DIR ${PROJECT_BINARY_DIR}/runtime)
|
||||
set(GENERATED_SYN_VIM ${GENERATED_RUNTIME_DIR}/syntax/vim/generated.vim)
|
||||
set(GENERATED_HELP_TAGS ${GENERATED_RUNTIME_DIR}/doc/tags)
|
||||
set(GENERATED_PACKAGE_DIR ${GENERATED_RUNTIME_DIR}/pack/dist/opt)
|
||||
|
||||
file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR})
|
||||
file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}/syntax)
|
||||
@ -18,6 +19,47 @@ add_custom_command(OUTPUT ${GENERATED_SYN_VIM}
|
||||
${PROJECT_SOURCE_DIR}/src/nvim/eval.c
|
||||
)
|
||||
|
||||
if(POLICY CMP0054)
|
||||
cmake_policy(SET CMP0054 OLD)
|
||||
endif()
|
||||
|
||||
file(GLOB PACKAGES ${PROJECT_SOURCE_DIR}/runtime/pack/dist/opt/*)
|
||||
|
||||
set(GENERATED_PACKAGE_TAGS)
|
||||
foreach(PACKAGE ${PACKAGES})
|
||||
get_filename_component(PACKNAME ${PACKAGE} NAME)
|
||||
file(GLOB "${PACKNAME}_DOC_FILES" ${PACKAGE}/doc/*.txt)
|
||||
if("${PACKNAME}_DOC_FILES")
|
||||
file(MAKE_DIRECTORY ${GENERATED_PACKAGE_DIR}/${PACKNAME})
|
||||
add_custom_target("${PACKNAME}-tags"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${PACKAGE} ${GENERATED_PACKAGE_DIR}/${PACKNAME}
|
||||
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
|
||||
-u NONE -i NONE -e --headless -c "helptags doc" -c quit
|
||||
DEPENDS
|
||||
nvim
|
||||
WORKING_DIRECTORY "${GENERATED_PACKAGE_DIR}/${PACKNAME}"
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags"
|
||||
DEPENDS
|
||||
"${PACKNAME}-tags"
|
||||
)
|
||||
|
||||
set("${PACKNAME}_DOC_NAMES")
|
||||
foreach(DF "${${PACKNAME}_DOC_FILES}")
|
||||
get_filename_component(F ${DF} NAME)
|
||||
list(APPEND "${PACKNAME}_DOC_NAMES" ${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/${F})
|
||||
endforeach()
|
||||
|
||||
install_helper(
|
||||
FILES ${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags "${${PACKNAME}_DOC_NAMES}"
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/pack/dist/opt/${PACKNAME}/doc)
|
||||
|
||||
list(APPEND GENERATED_PACKAGE_TAGS "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
file(GLOB DOCFILES ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
|
||||
|
||||
set(BUILDDOCFILES)
|
||||
@ -26,22 +68,25 @@ foreach(DF ${DOCFILES})
|
||||
list(APPEND BUILDDOCFILES ${GENERATED_RUNTIME_DIR}/doc/${F})
|
||||
endforeach()
|
||||
|
||||
add_custom_command(OUTPUT copy_docfiles
|
||||
add_custom_target(helptags
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
|
||||
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
|
||||
-u NONE -i NONE -e --headless -c "helptags ++t doc" -c quit
|
||||
DEPENDS
|
||||
nvim
|
||||
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}"
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
|
||||
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
|
||||
-u NONE
|
||||
-i NONE
|
||||
-e
|
||||
--headless
|
||||
-c "helptags ++t ."
|
||||
-c quit
|
||||
DEPENDS
|
||||
copy_docfiles
|
||||
nvim
|
||||
helptags
|
||||
)
|
||||
|
||||
add_custom_target(doc_html
|
||||
COMMAND make html
|
||||
DEPENDS
|
||||
${GENERATED_HELP_TAGS}
|
||||
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
|
||||
)
|
||||
|
||||
@ -50,6 +95,7 @@ add_custom_target(
|
||||
DEPENDS
|
||||
${GENERATED_SYN_VIM}
|
||||
${GENERATED_HELP_TAGS}
|
||||
${GENERATED_PACKAGE_TAGS}
|
||||
)
|
||||
|
||||
# CMake is painful here. It will create the destination using the user's
|
||||
@ -78,7 +124,7 @@ endforeach()
|
||||
|
||||
file(GLOB_RECURSE RUNTIME_FILES
|
||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
*.vim *.dict *.py *.ps *.tutor)
|
||||
*.vim *.dict *.py *.rb *.ps *.tutor)
|
||||
|
||||
foreach(F ${RUNTIME_FILES})
|
||||
get_filename_component(BASEDIR ${F} PATH)
|
||||
|
@ -1,9 +1,13 @@
|
||||
" Vim completion script
|
||||
" Language: CSS 2.1
|
||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2007 May 5
|
||||
" Language: CSS
|
||||
" Based on MDN CSS Reference at 2016 Jan <https://developer.mozilla.org/en-US/docs/Web/CSS/Reference>
|
||||
" plus CSS Speech Module <http://www.w3.org/TR/css3-speech/>
|
||||
" Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com )
|
||||
" Original Author: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2016 Jan 11
|
||||
|
||||
let s:values = split("all additive-symbols align-content align-items align-self animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size block-size border border-block-end border-block-end-color border-block-end-style border-block-end-width border-block-start border-block-start-color border-block-start-style border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-inline-end border-inline-end-color border-inline-end-style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-style border-inline-start-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip clip-path color columns column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width content counter-increment counter-reset cue cue-before cue-after cursor direction display empty-cells fallback filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font font-family font-feature-settings font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-position grid-auto-rows grid-column grid-column-start grid-column-end grid-row grid-row-start grid-row-end grid-template grid-template-areas grid-template-rows grid-template-columns height hyphens image-rendering image-resolution image-orientation ime-mode inline-size isolation justify-content left letter-spacing line-break line-height list-style list-style-image list-style-position list-style-type margin margin-block-end margin-block-start margin-bottom margin-inline-end margin-inline-start margin-left margin-right margin-top marks mask mask-type max-block-size max-height max-inline-size max-width max-zoom min-block-size min-height min-inline-size min-width min-zoom mix-blend-mode negative object-fit object-position offset-block-end offset-block-start offset-inline-end offset-inline-start opacity order orientation orphans outline outline-color outline-offset outline-style outline-width overflow overflow-wrap overflow-x overflow-y pad padding padding-block-end padding-block-start padding-bottom padding-inline-end padding-inline-start padding-left padding-right padding-top page-break-after page-break-before page-break-inside pause-before pause-after pause perspective perspective-origin pointer-events position prefix quotes range resize rest rest-before rest-after right ruby-align ruby-merge ruby-position scroll-behavior scroll-snap-coordinate scroll-snap-destination scroll-snap-points-x scroll-snap-points-y scroll-snap-type scroll-snap-type-x scroll-snap-type-y shape-image-threshold shape-margin shape-outside speak speak-as suffix symbols system table-layout tab-size text-align text-align-last text-combine-upright text-decoration text-decoration-color text-decoration-line text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-indent text-orientation text-overflow text-rendering text-shadow text-transform text-underline-position top touch-action transform transform-box transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi unicode-range user-zoom vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-rate voice-range voice-stress voice-volume white-space widows width will-change word-break word-spacing word-wrap writing-mode z-index zoom")
|
||||
|
||||
let s:values = split("azimuth background background-attachment background-color background-image background-position background-repeat border bottom border-collapse border-color border-spacing border-style border-top border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width border-bottom-width border-left-width border-width caption-side clear clip color content counter-increment counter-reset cue cue-after cue-before cursor display direction elevation empty-cells float font font-family font-size font-style font-variant font-weight height left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-right margin-left margin-top margin-bottom max-height max-width min-height min-width orphans outline outline-color outline-style outline-width overflow padding padding-top padding-right padding-bottom padding-left page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position quotes right richness speak speak-header speak-numeral speak-punctuation speech-rate stress table-layout text-align text-decoration text-indent text-transform top unicode-bidi vertical-align visibility voice-family volume white-space width widows word-spacing z-index")
|
||||
|
||||
function! csscomplete#CompleteCSS(findstart, base)
|
||||
|
||||
@ -15,6 +19,7 @@ if a:findstart
|
||||
while start >= 0 && line[start - 1] =~ '\%(\k\|-\)'
|
||||
let start -= 1
|
||||
endwhile
|
||||
let b:after = line[compl_begin :]
|
||||
let b:compl_context = line[0:compl_begin]
|
||||
return start
|
||||
endif
|
||||
@ -33,6 +38,7 @@ endif
|
||||
" 6. if ! complete important
|
||||
if exists("b:compl_context")
|
||||
let line = b:compl_context
|
||||
let after = b:after
|
||||
unlet! b:compl_context
|
||||
else
|
||||
let line = a:base
|
||||
@ -103,12 +109,45 @@ elseif borders[max(keys(borders))] == 'colon'
|
||||
" Get name of property
|
||||
let prop = tolower(matchstr(line, '\zs[a-zA-Z-]*\ze\s*:[^:]\{-}$'))
|
||||
|
||||
if prop == 'azimuth'
|
||||
let values = ["left-side", "far-left", "left", "center-left", "center", "center-right", "right", "far-right", "right-side", "behind", "leftwards", "rightwards"]
|
||||
let wide_keywords = ["initial", "inherit", "unset"]
|
||||
let color_values = ["transparent", "rgb(", "rgba(", "hsl(", "hsla(", "#"]
|
||||
let border_style_values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
let border_width_values = ["thin", "thick", "medium"]
|
||||
let list_style_type_values = ["decimal", "decimal-leading-zero", "arabic-indic", "armenian", "upper-armenian", "lower-armenian", "bengali", "cambodian", "khmer", "cjk-decimal", "devanagari", "georgian", "gujarati", "gurmukhi", "hebrew", "kannada", "lao", "malayalam", "mongolian", "myanmar", "oriya", "persian", "lower-roman", "upper-roman", "tamil", "telugu", "thai", "tibetan", "lower-alpha", "lower-latin", "upper-alpha", "upper-latin", "cjk-earthly-branch", "cjk-heavenly-stem", "lower-greek", "hiragana", "hiragana-iroha", "katakana", "katakana-iroha", "disc", "circle", "square", "disclosure-open", "disclosure-closed"]
|
||||
let timing_functions = ["cubic-bezier(", "steps(", "linear", "ease", "ease-in", "ease-in-out", "ease-out", "step-start", "step-end"]
|
||||
|
||||
if prop == 'all'
|
||||
let values = []
|
||||
elseif prop == 'additive-symbols'
|
||||
let values = []
|
||||
elseif prop == 'align-content'
|
||||
let values = ["flex-start", "flex-end", "center", "space-between", "space-around", "stretch"]
|
||||
elseif prop == 'align-items'
|
||||
let values = ["flex-start", "flex-end", "center", "baseline", "stretch"]
|
||||
elseif prop == 'align-self'
|
||||
let values = ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"]
|
||||
elseif prop == 'animation'
|
||||
let values = timing_functions + ["normal", "reverse", "alternate", "alternate-reverse"] + ["none", "forwards", "backwards", "both"] + ["running", "paused"]
|
||||
elseif prop == 'animation-delay'
|
||||
let values = []
|
||||
elseif prop == 'animation-direction'
|
||||
let values = ["normal", "reverse", "alternate", "alternate-reverse"]
|
||||
elseif prop == 'animation-duration'
|
||||
let values = []
|
||||
elseif prop == 'animation-fill-mode'
|
||||
let values = ["none", "forwards", "backwards", "both"]
|
||||
elseif prop == 'animation-iteration-count'
|
||||
let values = []
|
||||
elseif prop == 'animation-name'
|
||||
let values = []
|
||||
elseif prop == 'animation-play-state'
|
||||
let values = ["running", "paused"]
|
||||
elseif prop == 'animation-timing-function'
|
||||
let values = timing_functions
|
||||
elseif prop == 'background-attachment'
|
||||
let values = ["scroll", "fixed"]
|
||||
elseif prop == 'background-color'
|
||||
let values = ["transparent", "rgb(", "#"]
|
||||
let values = color_values
|
||||
elseif prop == 'background-image'
|
||||
let values = ["url(", "none"]
|
||||
elseif prop == 'background-position'
|
||||
@ -122,92 +161,172 @@ elseif borders[max(keys(borders))] == 'colon'
|
||||
endif
|
||||
elseif prop == 'background-repeat'
|
||||
let values = ["repeat", "repeat-x", "repeat-y", "no-repeat"]
|
||||
elseif prop == 'background-size'
|
||||
let values = ["auto", "contain", "cover"]
|
||||
elseif prop == 'background'
|
||||
let values = ["url(", "scroll", "fixed", "transparent", "rgb(", "#", "none", "top", "center", "bottom" , "left", "right", "repeat", "repeat-x", "repeat-y", "no-repeat"]
|
||||
elseif prop == 'border-collapse'
|
||||
let values = ["collapse", "separate"]
|
||||
let values = ["scroll", "fixed"] + color_values + ["url(", "none"] + ["top", "center", "bottom", "left", "right"] + ["repeat", "repeat-x", "repeat-y", "no-repeat"] + ["auto", "contain", "cover"]
|
||||
elseif prop =~ 'border\%(-top\|-right\|-bottom\|-left\|-block-start\|-block-end\)\?$'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$'
|
||||
let values = border_width_values
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$'
|
||||
let values = border_style_values
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
|
||||
let values = color_values
|
||||
else
|
||||
return []
|
||||
endif
|
||||
elseif prop =~ 'border-\%(top\|right\|bottom\|left\|block-start\|block-end\)-color'
|
||||
let values = color_values
|
||||
elseif prop =~ 'border-\%(top\|right\|bottom\|left\|block-start\|block-end\)-style'
|
||||
let values = border_style_values
|
||||
elseif prop =~ 'border-\%(top\|right\|bottom\|left\|block-start\|block-end\)-width'
|
||||
let values = border_width_values
|
||||
elseif prop == 'border-color'
|
||||
let values = ["rgb(", "#", "transparent"]
|
||||
elseif prop == 'border-spacing'
|
||||
return []
|
||||
let values = color_values
|
||||
elseif prop == 'border-style'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif prop =~ 'border-\%(top\|right\|bottom\|left\)$'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
|
||||
let values = ["rgb(", "#", "transparent"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
elseif prop =~ 'border-\%(top\|right\|bottom\|left\)-color'
|
||||
let values = ["rgb(", "#", "transparent"]
|
||||
elseif prop =~ 'border-\%(top\|right\|bottom\|left\)-style'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif prop =~ 'border-\%(top\|right\|bottom\|left\)-width'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
let values = border_style_values
|
||||
elseif prop == 'border-width'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
elseif prop == 'border'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
|
||||
let values = ["rgb(", "#", "transparent"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
let values = border_width_values
|
||||
elseif prop == 'bottom'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'box-decoration-break'
|
||||
let values = ["slice", "clone"]
|
||||
elseif prop == 'box-shadow'
|
||||
let values = ["inset"]
|
||||
elseif prop == 'box-sizing'
|
||||
let values = ["border-box", "content-box"]
|
||||
elseif prop =~ 'break-\%(before\|after\)'
|
||||
let values = ["auto", "always", "avoid", "left", "right", "page", "column", "region", "recto", "verso", "avoid-page", "avoid-column", "avoid-region"]
|
||||
elseif prop == 'break-inside'
|
||||
let values = ["auto", "avoid", "avoid-page", "avoid-column", "avoid-region"]
|
||||
elseif prop == 'caption-side'
|
||||
let values = ["top", "bottom"]
|
||||
elseif prop == 'clear'
|
||||
let values = ["none", "left", "right", "both"]
|
||||
elseif prop == 'clip'
|
||||
let values = ["auto", "rect("]
|
||||
elseif prop == 'clip-path'
|
||||
let values = ["fill-box", "stroke-box", "view-box", "none"]
|
||||
elseif prop == 'color'
|
||||
let values = ["rgb(", "#"]
|
||||
let values = color_values
|
||||
elseif prop == 'columns'
|
||||
let values = []
|
||||
elseif prop == 'column-count'
|
||||
let values = ['auto']
|
||||
elseif prop == 'column-fill'
|
||||
let values = ['auto', 'balance']
|
||||
elseif prop == 'column-rule-color'
|
||||
let values = color_values
|
||||
elseif prop == 'column-rule-style'
|
||||
let values = border_style_values
|
||||
elseif prop == 'column-rule-width'
|
||||
let values = border_width_values
|
||||
elseif prop == 'column-rule'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^\%([a-zA-Z0-9.]\+\)\?$'
|
||||
let values = border_width_values
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\%([a-zA-Z]\+\)\?$'
|
||||
let values = border_style_values
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
|
||||
let values = color_values
|
||||
else
|
||||
return []
|
||||
endif
|
||||
elseif prop == 'column-span'
|
||||
let values = ["none", "all"]
|
||||
elseif prop == 'column-width'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'content'
|
||||
let values = ["normal", "attr(", "open-quote", "close-quote", "no-open-quote", "no-close-quote"]
|
||||
elseif prop =~ 'counter-\%(increment\|reset\)$'
|
||||
let values = ["none"]
|
||||
elseif prop =~ '^\%(cue-after\|cue-before\|cue\)$'
|
||||
let values = ["url(", "none"]
|
||||
elseif prop =~ 'cue\%(-after\|-before\)\=$'
|
||||
let values = ["url("]
|
||||
elseif prop == 'cursor'
|
||||
let values = ["url(", "auto", "crosshair", "default", "pointer", "move", "e-resize", "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help", "progress"]
|
||||
elseif prop == 'direction'
|
||||
let values = ["ltr", "rtl"]
|
||||
elseif prop == 'display'
|
||||
let values = ["inline", "block", "list-item", "run-in", "inline-block", "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "none"]
|
||||
let values = ["inline", "block", "list-item", "inline-list-item", "run-in", "inline-block", "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "none", "flex", "inline-flex", "grid", "inline-grid", "ruby", "ruby-base", "ruby-text", "ruby-base-container", "ruby-text-container", "contents"]
|
||||
elseif prop == 'elevation'
|
||||
let values = ["below", "level", "above", "higher", "lower"]
|
||||
elseif prop == 'empty-cells'
|
||||
let values = ["show", "hide"]
|
||||
elseif prop == 'fallback'
|
||||
let values = list_style_type_values
|
||||
elseif prop == 'filter'
|
||||
let values = ["blur(", "brightness(", "contrast(", "drop-shadow(", "grayscale(", "hue-rotate(", "invert(", "opacity(", "sepia(", "saturate("]
|
||||
elseif prop == 'flex-basis'
|
||||
let values = ["auto", "content"]
|
||||
elseif prop == 'flex-flow'
|
||||
let values = ["row", "row-reverse", "column", "column-reverse", "nowrap", "wrap", "wrap-reverse"]
|
||||
elseif prop == 'flex-grow'
|
||||
let values = []
|
||||
elseif prop == 'flex-shrink'
|
||||
let values = []
|
||||
elseif prop == 'flex-wrap'
|
||||
let values = ["nowrap", "wrap", "wrap-reverse"]
|
||||
elseif prop == 'flex'
|
||||
let values = ["nowrap", "wrap", "wrap-reverse"] + ["row", "row-reverse", "column", "column-reverse", "nowrap", "wrap", "wrap-reverse"] + ["auto", "content"]
|
||||
elseif prop == 'float'
|
||||
let values = ["left", "right", "none"]
|
||||
elseif prop == 'font-family'
|
||||
let values = ["sans-serif", "serif", "monospace", "cursive", "fantasy"]
|
||||
elseif prop == 'font-feature-settings'
|
||||
let values = ["normal", '"aalt"', '"abvf"', '"abvm"', '"abvs"', '"afrc"', '"akhn"', '"blwf"', '"blwm"', '"blws"', '"calt"', '"case"', '"ccmp"', '"cfar"', '"cjct"', '"clig"', '"cpct"', '"cpsp"', '"cswh"', '"curs"', '"cv', '"c2pc"', '"c2sc"', '"dist"', '"dlig"', '"dnom"', '"dtls"', '"expt"', '"falt"', '"fin2"', '"fin3"', '"fina"', '"flac"', '"frac"', '"fwid"', '"half"', '"haln"', '"halt"', '"hist"', '"hkna"', '"hlig"', '"hngl"', '"hojo"', '"hwid"', '"init"', '"isol"', '"ital"', '"jalt"', '"jp78"', '"jp83"', '"jp90"', '"jp04"', '"kern"', '"lfbd"', '"liga"', '"ljmo"', '"lnum"', '"locl"', '"ltra"', '"ltrm"', '"mark"', '"med2"', '"medi"', '"mgrk"', '"mkmk"', '"mset"', '"nalt"', '"nlck"', '"nukt"', '"numr"', '"onum"', '"opbd"', '"ordn"', '"ornm"', '"palt"', '"pcap"', '"pkna"', '"pnum"', '"pref"', '"pres"', '"pstf"', '"psts"', '"pwid"', '"qwid"', '"rand"', '"rclt"', '"rkrf"', '"rlig"', '"rphf"', '"rtbd"', '"rtla"', '"rtlm"', '"ruby"', '"salt"', '"sinf"', '"size"', '"smcp"', '"smpl"', '"ss01"', '"ss02"', '"ss03"', '"ss04"', '"ss05"', '"ss06"', '"ss07"', '"ss08"', '"ss09"', '"ss10"', '"ss11"', '"ss12"', '"ss13"', '"ss14"', '"ss15"', '"ss16"', '"ss17"', '"ss18"', '"ss19"', '"ss20"', '"ssty"', '"stch"', '"subs"', '"sups"', '"swsh"', '"titl"', '"tjmo"', '"tnam"', '"tnum"', '"trad"', '"twid"', '"unic"', '"valt"', '"vatu"', '"vert"', '"vhal"', '"vjmo"', '"vkna"', '"vkrn"', '"vpal"', '"vrt2"', '"zero"']
|
||||
elseif prop == 'font-kerning'
|
||||
let values = ["auto", "normal", "none"]
|
||||
elseif prop == 'font-language-override'
|
||||
let values = ["normal"]
|
||||
elseif prop == 'font-size'
|
||||
let values = ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller"]
|
||||
elseif prop == 'font-size-adjust'
|
||||
let values = []
|
||||
elseif prop == 'font-stretch'
|
||||
let values = ["normal", "ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded"]
|
||||
elseif prop == 'font-style'
|
||||
let values = ["normal", "italic", "oblique"]
|
||||
elseif prop == 'font-synthesis'
|
||||
let values = ["none", "weight", "style"]
|
||||
elseif prop == 'font-variant-alternates'
|
||||
let values = ["normal", "historical-forms", "stylistic(", "styleset(", "character-variant(", "swash(", "ornaments(", "annotation("]
|
||||
elseif prop == 'font-variant-caps'
|
||||
let values = ["normal", "small-caps", "all-small-caps", "petite-caps", "all-petite-caps", "unicase", "titling-caps"]
|
||||
elseif prop == 'font-variant-asian'
|
||||
let values = ["normal", "ruby", "jis78", "jis83", "jis90", "jis04", "simplified", "traditional"]
|
||||
elseif prop == 'font-variant-ligatures'
|
||||
let values = ["normal", "none", "common-ligatures", "no-common-ligatures", "discretionary-ligatures", "no-discretionary-ligatures", "historical-ligatures", "no-historical-ligatures", "contextual", "no-contextual"]
|
||||
elseif prop == 'font-variant-numeric'
|
||||
let values = ["normal", "ordinal", "slashed-zero", "lining-nums", "oldstyle-nums", "proportional-nums", "tabular-nums", "diagonal-fractions", "stacked-fractions"]
|
||||
elseif prop == 'font-variant-position'
|
||||
let values = ["normal", "sub", "super"]
|
||||
elseif prop == 'font-variant'
|
||||
let values = ["normal", "small-caps"]
|
||||
let values = ["normal", "historical-forms", "stylistic(", "styleset(", "character-variant(", "swash(", "ornaments(", "annotation("] + ["small-caps", "all-small-caps", "petite-caps", "all-petite-caps", "unicase", "titling-caps"] + ["ruby", "jis78", "jis83", "jis90", "jis04", "simplified", "traditional"] + ["none", "common-ligatures", "no-common-ligatures", "discretionary-ligatures", "no-discretionary-ligatures", "historical-ligatures", "no-historical-ligatures", "contextual", "no-contextual"] + ["ordinal", "slashed-zero", "lining-nums", "oldstyle-nums", "proportional-nums", "tabular-nums", "diagonal-fractions", "stacked-fractions"] + ["sub", "super"]
|
||||
elseif prop == 'font-weight'
|
||||
let values = ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]
|
||||
elseif prop == 'font'
|
||||
let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"]
|
||||
elseif prop =~ '^\%(height\|width\)$'
|
||||
let values = ["auto"]
|
||||
let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"]
|
||||
elseif prop =~ '^\%(left\|rigth\)$'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'image-rendering'
|
||||
let values = ["auto", "crisp-edges", "pixelated"]
|
||||
elseif prop == 'image-orientation'
|
||||
let values = ["from-image", "flip"]
|
||||
elseif prop == 'ime-mode'
|
||||
let values = ["auto", "normal", "active", "inactive", "disabled"]
|
||||
elseif prop == 'inline-size'
|
||||
let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"]
|
||||
elseif prop == 'isolation'
|
||||
let values = ["auto", "isolate"]
|
||||
elseif prop == 'justify-content'
|
||||
let values = ["flex-start", "flex-end", "center", "space-between", "space-around"]
|
||||
elseif prop == 'letter-spacing'
|
||||
let values = ["normal"]
|
||||
elseif prop == 'line-break'
|
||||
let values = ["auto", "loose", "normal", "strict"]
|
||||
elseif prop == 'line-height'
|
||||
let values = ["normal"]
|
||||
elseif prop == 'list-style-image'
|
||||
@ -215,25 +334,37 @@ elseif borders[max(keys(borders))] == 'colon'
|
||||
elseif prop == 'list-style-position'
|
||||
let values = ["inside", "outside"]
|
||||
elseif prop == 'list-style-type'
|
||||
let values = ["disc", "circle", "square", "decimal", "decimal-leading-zero", "lower-roman", "upper-roman", "lower-latin", "upper-latin", "none"]
|
||||
let values = list_style_type_values
|
||||
elseif prop == 'list-style'
|
||||
return []
|
||||
let values = list_style_type_values + ["inside", "outside"] + ["url(", "none"]
|
||||
elseif prop == 'margin'
|
||||
let values = ["auto"]
|
||||
elseif prop =~ 'margin-\%(right\|left\|top\|bottom\)$'
|
||||
elseif prop =~ 'margin-\%(right\|left\|top\|bottom\|block-start\|block-end\|inline-start\|inline-end\)$'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'max-height'
|
||||
elseif prop == 'marks'
|
||||
let values = ["crop", "cross", "none"]
|
||||
elseif prop == 'mask'
|
||||
let values = ["url("]
|
||||
elseif prop == 'mask-type'
|
||||
let values = ["luminance", "alpha"]
|
||||
elseif prop == '\%(max\|min\)-\%(block\|inline\)-size'
|
||||
let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"]
|
||||
elseif prop == '\%(max\|min\)-\%(height\|width\)'
|
||||
let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"]
|
||||
elseif prop == '\%(max\|min\)-zoom'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'max-width'
|
||||
let values = ["none"]
|
||||
elseif prop == 'min-height'
|
||||
let values = ["none"]
|
||||
elseif prop == 'min-width'
|
||||
let values = ["none"]
|
||||
elseif prop == 'mix-blend-mode'
|
||||
let values = ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"]
|
||||
elseif prop == 'opacity'
|
||||
let values = []
|
||||
elseif prop == 'orientation'
|
||||
let values = ["auto", "portrait", "landscape"]
|
||||
elseif prop == 'orphans'
|
||||
return []
|
||||
let values = []
|
||||
elseif prop == 'outline-offset'
|
||||
let values = []
|
||||
elseif prop == 'outline-color'
|
||||
let values = ["rgb(", "#"]
|
||||
let values = color_values
|
||||
elseif prop == 'outline-style'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif prop == 'outline-width'
|
||||
@ -241,7 +372,7 @@ elseif borders[max(keys(borders))] == 'colon'
|
||||
elseif prop == 'outline'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^\%([a-zA-Z0-9,()#]\+\)\?$'
|
||||
let values = ["rgb(", "#"]
|
||||
let values = color_values
|
||||
elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+\%([a-zA-Z]\+\)\?$'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+[a-zA-Z]\+\s\+\%([a-zA-Z(]\+\)\?$'
|
||||
@ -249,85 +380,197 @@ elseif borders[max(keys(borders))] == 'colon'
|
||||
else
|
||||
return []
|
||||
endif
|
||||
elseif prop == 'overflow'
|
||||
elseif prop == 'overflow-wrap'
|
||||
let values = ["normal", "break-word"]
|
||||
elseif prop =~ 'overflow\%(-x\|-y\)\='
|
||||
let values = ["visible", "hidden", "scroll", "auto"]
|
||||
elseif prop == 'pad'
|
||||
let values = []
|
||||
elseif prop == 'padding'
|
||||
return []
|
||||
elseif prop =~ 'padding-\%(top\|right\|bottom\|left\)$'
|
||||
return []
|
||||
let values = []
|
||||
elseif prop =~ 'padding-\%(top\|right\|bottom\|left\|inline-start\|inline-end\|block-start\|block-end\)$'
|
||||
let values = []
|
||||
elseif prop =~ 'page-break-\%(after\|before\)$'
|
||||
let values = ["auto", "always", "avoid", "left", "right"]
|
||||
let values = ["auto", "always", "avoid", "left", "right", "recto", "verso"]
|
||||
elseif prop == 'page-break-inside'
|
||||
let values = ["auto", "avoid"]
|
||||
elseif prop =~ 'pause-\%(after\|before\)$'
|
||||
return []
|
||||
elseif prop == 'pause'
|
||||
return []
|
||||
elseif prop == 'pitch-range'
|
||||
return []
|
||||
elseif prop == 'pitch'
|
||||
let values = ["x-low", "low", "medium", "high", "x-high"]
|
||||
elseif prop == 'play-during'
|
||||
let values = ["url(", "mix", "repeat", "auto", "none"]
|
||||
elseif prop =~ 'pause\%(-after\|-before\)\=$'
|
||||
let values = ["none", "x-weak", "weak", "medium", "strong", "x-strong"]
|
||||
elseif prop == 'perspective'
|
||||
let values = ["none"]
|
||||
elseif prop == 'perspective-origin'
|
||||
let values = ["top", "bottom", "left", "center", " right"]
|
||||
elseif prop == 'pointer-events'
|
||||
let values = ["auto", "none", "visiblePainted", "visibleFill", "visibleStroke", "visible", "painted", "fill", "stroke", "all"]
|
||||
elseif prop == 'position'
|
||||
let values = ["static", "relative", "absolute", "fixed"]
|
||||
let values = ["static", "relative", "absolute", "fixed", "sticky"]
|
||||
elseif prop == 'prefix'
|
||||
let values = []
|
||||
elseif prop == 'quotes'
|
||||
let values = ["none"]
|
||||
elseif prop == 'richness'
|
||||
elseif prop == 'range'
|
||||
let values = ["auto", "infinite"]
|
||||
elseif prop == 'resize'
|
||||
let values = ["none", "both", "horizontal", "vertical"]
|
||||
elseif prop =~ 'rest\%(-after\|-before\)\=$'
|
||||
let values = ["none", "x-weak", "weak", "medium", "strong", "x-strong"]
|
||||
elseif prop == 'ruby-align'
|
||||
let values = ["start", "center", "space-between", "space-around"]
|
||||
elseif prop == 'ruby-merge'
|
||||
let values = ["separate", "collapse", "auto"]
|
||||
elseif prop == 'ruby-position'
|
||||
let values = ["over", "under", "inter-character"]
|
||||
elseif prop == 'scroll-behavior'
|
||||
let values = ["auto", "smooth"]
|
||||
elseif prop == 'scroll-snap-coordinate'
|
||||
let values = ["none"]
|
||||
elseif prop == 'scroll-snap-destination'
|
||||
return []
|
||||
elseif prop == 'speak-header'
|
||||
let values = ["once", "always"]
|
||||
elseif prop == 'speak-numeral'
|
||||
let values = ["digits", "continuous"]
|
||||
elseif prop == 'speak-punctuation'
|
||||
let values = ["code", "none"]
|
||||
elseif prop == 'scroll-snap-points-\%(x\|y\)$'
|
||||
let values = ["none", "repeat("]
|
||||
elseif prop == 'scroll-snap-type\%(-x\|-y\)\=$'
|
||||
let values = ["none", "mandatory", "proximity"]
|
||||
elseif prop == 'shape-image-threshold'
|
||||
let values = []
|
||||
elseif prop == 'shape-margin'
|
||||
let values = []
|
||||
elseif prop == 'shape-outside'
|
||||
let values = ["margin-box", "border-box", "padding-box", "content-box", 'inset(', 'circle(', 'ellipse(', 'polygon(', 'url(']
|
||||
elseif prop == 'speak'
|
||||
let values = ["normal", "none", "spell-out"]
|
||||
elseif prop == 'speech-rate'
|
||||
let values = ["x-slow", "slow", "medium", "fast", "x-fast", "faster", "slower"]
|
||||
elseif prop == 'stress'
|
||||
return []
|
||||
let values = ["auto", "none", "normal"]
|
||||
elseif prop == 'speak-as'
|
||||
let values = ["auto", "normal", "spell-out", "digits"]
|
||||
elseif prop == 'src'
|
||||
let values = ["url("]
|
||||
elseif prop == 'suffix'
|
||||
let values = []
|
||||
elseif prop == 'symbols'
|
||||
let values = []
|
||||
elseif prop == 'system'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^extends'
|
||||
let values = list_style_type_values
|
||||
else
|
||||
let values = ["cyclic", "numeric", "alphabetic", "symbolic", "additive", "fixed", "extends"]
|
||||
endif
|
||||
elseif prop == 'table-layout'
|
||||
let values = ["auto", "fixed"]
|
||||
elseif prop == 'tab-size'
|
||||
let values = []
|
||||
elseif prop == 'text-align'
|
||||
let values = ["left", "right", "center", "justify"]
|
||||
elseif prop == 'text-decoration'
|
||||
let values = ["start", "end", "left", "right", "center", "justify", "match-parent"]
|
||||
elseif prop == 'text-align-last'
|
||||
let values = ["auto", "start", "end", "left", "right", "center", "justify"]
|
||||
elseif prop == 'text-combine-upright'
|
||||
let values = ["none", "all", "digits"]
|
||||
elseif prop == 'text-decoration-line'
|
||||
let values = ["none", "underline", "overline", "line-through", "blink"]
|
||||
elseif prop == 'text-decoration-color'
|
||||
let values = color_values
|
||||
elseif prop == 'text-decoration-style'
|
||||
let values = ["solid", "double", "dotted", "dashed", "wavy"]
|
||||
elseif prop == 'text-decoration'
|
||||
let values = ["none", "underline", "overline", "line-through", "blink"] + ["solid", "double", "dotted", "dashed", "wavy"] + color_values
|
||||
elseif prop == 'text-emphasis-color'
|
||||
let values = color_values
|
||||
elseif prop == 'text-emphasis-position'
|
||||
let values = ["over", "under", "left", "right"]
|
||||
elseif prop == 'text-emphasis-style'
|
||||
let values = ["none", "filled", "open", "dot", "circle", "double-circle", "triangle", "sesame"]
|
||||
elseif prop == 'text-emphasis'
|
||||
let values = color_values + ["over", "under", "left", "right"] + ["none", "filled", "open", "dot", "circle", "double-circle", "triangle", "sesame"]
|
||||
elseif prop == 'text-indent'
|
||||
return []
|
||||
let values = ["hanging", "each-line"]
|
||||
elseif prop == 'text-orientation'
|
||||
let values = ["mixed", "upright", "sideways", "sideways-right", "use-glyph-orientation"]
|
||||
elseif prop == 'text-overflow'
|
||||
let values = ["clip", "ellipsis"]
|
||||
elseif prop == 'text-rendering'
|
||||
let values = ["auto", "optimizeSpeed", "optimizeLegibility", "geometricPrecision"]
|
||||
elseif prop == 'text-shadow'
|
||||
let values = color_values
|
||||
elseif prop == 'text-transform'
|
||||
let values = ["capitalize", "uppercase", "lowercase", "none"]
|
||||
let values = ["capitalize", "uppercase", "lowercase", "full-width", "none"]
|
||||
elseif prop == 'text-underline-position'
|
||||
let values = ["auto", "under", "left", "right"]
|
||||
elseif prop == 'touch-action'
|
||||
let values = ["auto", "none", "pan-x", "pan-y", "manipulation", "pan-left", "pan-right", "pan-top", "pan-down"]
|
||||
elseif prop == 'transform'
|
||||
let values = ["matrix(", "translate(", "translateX(", "translateY(", "scale(", "scaleX(", "scaleY(", "rotate(", "skew(", "skewX(", "skewY(", "matrix3d(", "translate3d(", "translateZ(", "scale3d(", "scaleZ(", "rotate3d(", "rotateX(", "rotateY(", "rotateZ(", "perspective("]
|
||||
elseif prop == 'transform-box'
|
||||
let values = ["border-box", "fill-box", "view-box"]
|
||||
elseif prop == 'transform-origin'
|
||||
let values = ["left", "center", "right", "top", "bottom"]
|
||||
elseif prop == 'transform-style'
|
||||
let values = ["flat", "preserve-3d"]
|
||||
elseif prop == 'top'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'transition-property'
|
||||
let values = ["all", "none"] + s:values
|
||||
elseif prop == 'transition-duration'
|
||||
let values = []
|
||||
elseif prop == 'transition-delay'
|
||||
let values = []
|
||||
elseif prop == 'transition-timing-function'
|
||||
let values = timing_functions
|
||||
elseif prop == 'transition'
|
||||
let values = ["all", "none"] + s:values + timing_functions
|
||||
elseif prop == 'unicode-bidi'
|
||||
let values = ["normal", "embed", "bidi-override"]
|
||||
let values = ["normal", "embed", "isolate", "bidi-override", "isolate-override", "plaintext"]
|
||||
elseif prop == 'unicode-range'
|
||||
let values = ["U+"]
|
||||
elseif prop == 'user-zoom'
|
||||
let values = ["zoom", "fixed"]
|
||||
elseif prop == 'vertical-align'
|
||||
let values = ["baseline", "sub", "super", "top", "text-top", "middle", "bottom", "text-bottom"]
|
||||
elseif prop == 'visibility'
|
||||
let values = ["visible", "hidden", "collapse"]
|
||||
elseif prop == 'voice-family'
|
||||
return []
|
||||
elseif prop == 'volume'
|
||||
elseif prop == 'voice-volume'
|
||||
let values = ["silent", "x-soft", "soft", "medium", "loud", "x-loud"]
|
||||
elseif prop == 'voice-balance'
|
||||
let values = ["left", "center", "right", "leftwards", "rightwards"]
|
||||
elseif prop == 'voice-family'
|
||||
let values = []
|
||||
elseif prop == 'voice-rate'
|
||||
let values = ["normal", "x-slow", "slow", "medium", "fast", "x-fast"]
|
||||
elseif prop == 'voice-pitch'
|
||||
let values = ["absolute", "x-low", "low", "medium", "high", "x-high"]
|
||||
elseif prop == 'voice-range'
|
||||
let values = ["absolute", "x-low", "low", "medium", "high", "x-high"]
|
||||
elseif prop == 'voice-stress'
|
||||
let values = ["normal", "strong", "moderate", "none", "reduced "]
|
||||
elseif prop == 'voice-duration'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'white-space'
|
||||
let values = ["normal", "pre", "nowrap", "pre-wrap", "pre-line"]
|
||||
elseif prop == 'widows'
|
||||
return []
|
||||
let values = []
|
||||
elseif prop == 'will-change'
|
||||
let values = ["auto", "scroll-position", "contents"] + s:values
|
||||
elseif prop == 'word-break'
|
||||
let values = ["normal", "break-all", "keep-all"]
|
||||
elseif prop == 'word-spacing'
|
||||
let values = ["normal"]
|
||||
elseif prop == 'word-wrap'
|
||||
let values = ["normal", "break-word"]
|
||||
elseif prop == 'writing-mode'
|
||||
let values = ["horizontal-tb", "vertical-rl", "vertical-lr", "sideways-rl", "sideways-lr"]
|
||||
elseif prop == 'z-index'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'zoom'
|
||||
let values = ["auto"]
|
||||
else
|
||||
" If no property match it is possible we are outside of {} and
|
||||
" trying to complete pseudo-(class|element)
|
||||
let element = tolower(matchstr(line, '\zs[a-zA-Z1-6]*\ze:[^:[:space:]]\{-}$'))
|
||||
if stridx(',a,abbr,acronym,address,area,b,base,bdo,big,blockquote,body,br,button,caption,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,fieldset,form,head,h1,h2,h3,h4,h5,h6,hr,html,i,img,input,ins,kbd,label,legend,li,link,map,meta,noscript,object,ol,optgroup,option,p,param,pre,q,samp,script,select,small,span,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,title,tr,tt,ul,var,', ','.element.',') > -1
|
||||
let values = ["first-child", "link", "visited", "hover", "active", "focus", "lang", "first-line", "first-letter", "before", "after"]
|
||||
if stridx('a,abbr,address,area,article,aside,audio,b,base,bdi,bdo,bgsound,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,command,content,data,datalist,dd,del,details,dfn,dialog,div,dl,dt,element,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,isindex,kbd,keygen,label,legend,li,link,main,map,mark,menu,menuitem,meta,meter,nav,nobr,noframes,noscript,object,ol,optgroup,option,output,p,param,picture,pre,progress,q,rp,rt,rtc,ruby,s,samp,script,section,select,shadow,small,source,span,strong,style,sub,summary,sup,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,u,ul,var,video,wbr', ','.element.',') > -1
|
||||
let values = ["active", "any", "checked", "default", "dir(", "disabled", "empty", "enabled", "first", "first-child", "first-of-type", "fullscreen", "focus", "hover", "indeterminate", "in-range", "invalid", "lang(", "last-child", "last-of-type", "left", "link", "not(", "nth-child(", "nth-last-child(", "nth-last-of-type(", "nth-of-type(", "only-child", "only-of-type", "optional", "out-of-range", "read-only", "read-write", "required", "right", "root", "scope", "target", "valid", "visited", "first-line", "first-letter", "before", "after", "selection", "backdrop"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
let values = wide_keywords + values
|
||||
" Complete values
|
||||
let entered_value = matchstr(line, '.\{-}\zs[a-zA-Z0-9#,.(_-]*$')
|
||||
|
||||
@ -369,10 +612,69 @@ elseif borders[max(keys(borders))] == 'atrule'
|
||||
let atrulename = matchstr(line, '.*@\zs[a-zA-Z-]\+\ze')
|
||||
|
||||
if atrulename == 'media'
|
||||
let values = ["screen", "tty", "tv", "projection", "handheld", "print", "braille", "aural", "all"]
|
||||
|
||||
let entered_atruleafter = matchstr(line, '.*@media\s\+\zs.*$')
|
||||
|
||||
if entered_atruleafter =~ "([^)]*$"
|
||||
let entered_atruleafter = matchstr(entered_atruleafter, '(\s*\zs[^)]*$')
|
||||
let values = ["max-width", "min-width", "width", "max-height", "min-height", "height", "max-aspect-ration", "min-aspect-ration", "aspect-ratio", "orientation", "max-resolution", "min-resolution", "resolution", "scan", "grid", "update-frequency", "overflow-block", "overflow-inline", "max-color", "min-color", "color", "max-color-index", "min-color-index", "color-index", "monochrome", "inverted-colors", "pointer", "hover", "any-pointer", "any-hover", "light-level", "scripting"]
|
||||
else
|
||||
let values = ["screen", "print", "speech", "all", "not", "and", "("]
|
||||
endif
|
||||
|
||||
elseif atrulename == 'supports'
|
||||
let entered_atruleafter = matchstr(line, '.*@supports\s\+\zs.*$')
|
||||
|
||||
if entered_atruleafter =~ "([^)]*$"
|
||||
let entered_atruleafter = matchstr(entered_atruleafter, '(\s*\zs.*$')
|
||||
let values = s:values
|
||||
else
|
||||
let values = ["("]
|
||||
endif
|
||||
|
||||
elseif atrulename == 'charset'
|
||||
let entered_atruleafter = matchstr(line, '.*@charset\s\+\zs.*$')
|
||||
let values = [
|
||||
\ '"UTF-8";', '"ANSI_X3.4-1968";', '"ISO_8859-1:1987";', '"ISO_8859-2:1987";', '"ISO_8859-3:1988";', '"ISO_8859-4:1988";', '"ISO_8859-5:1988";',
|
||||
\ '"ISO_8859-6:1987";', '"ISO_8859-7:1987";', '"ISO_8859-8:1988";', '"ISO_8859-9:1989";', '"ISO-8859-10";', '"ISO_6937-2-add";', '"JIS_X0201";',
|
||||
\ '"JIS_Encoding";', '"Shift_JIS";', '"Extended_UNIX_Code_Packed_Format_for_Japanese";', '"Extended_UNIX_Code_Fixed_Width_for_Japanese";',
|
||||
\ '"BS_4730";', '"SEN_850200_C";', '"IT";', '"ES";', '"DIN_66003";', '"NS_4551-1";', '"NF_Z_62-010";', '"ISO-10646-UTF-1";', '"ISO_646.basic:1983";',
|
||||
\ '"INVARIANT";', '"ISO_646.irv:1983";', '"NATS-SEFI";', '"NATS-SEFI-ADD";', '"NATS-DANO";', '"NATS-DANO-ADD";', '"SEN_850200_B";', '"KS_C_5601-1987";',
|
||||
\ '"ISO-2022-KR";', '"EUC-KR";', '"ISO-2022-JP";', '"ISO-2022-JP-2";', '"JIS_C6220-1969-jp";', '"JIS_C6220-1969-ro";', '"PT";', '"greek7-old";',
|
||||
\ '"latin-greek";', '"NF_Z_62-010_(1973)";', '"Latin-greek-1";', '"ISO_5427";', '"JIS_C6226-1978";', '"BS_viewdata";', '"INIS";', '"INIS-8";',
|
||||
\ '"INIS-cyrillic";', '"ISO_5427:1981";', '"ISO_5428:1980";', '"GB_1988-80";', '"GB_2312-80";', '"NS_4551-2";', '"videotex-suppl";', '"PT2";',
|
||||
\ '"ES2";', '"MSZ_7795.3";', '"JIS_C6226-1983";', '"greek7";', '"ASMO_449";', '"iso-ir-90";', '"JIS_C6229-1984-a";', '"JIS_C6229-1984-b";',
|
||||
\ '"JIS_C6229-1984-b-add";', '"JIS_C6229-1984-hand";', '"JIS_C6229-1984-hand-add";', '"JIS_C6229-1984-kana";', '"ISO_2033-1983";',
|
||||
\ '"ANSI_X3.110-1983";', '"T.61-7bit";', '"T.61-8bit";', '"ECMA-cyrillic";', '"CSA_Z243.4-1985-1";', '"CSA_Z243.4-1985-2";', '"CSA_Z243.4-1985-gr";',
|
||||
\ '"ISO_8859-6-E";', '"ISO_8859-6-I";', '"T.101-G2";', '"ISO_8859-8-E";', '"ISO_8859-8-I";', '"CSN_369103";', '"JUS_I.B1.002";', '"IEC_P27-1";',
|
||||
\ '"JUS_I.B1.003-serb";', '"JUS_I.B1.003-mac";', '"greek-ccitt";', '"NC_NC00-10:81";', '"ISO_6937-2-25";', '"GOST_19768-74";', '"ISO_8859-supp";',
|
||||
\ '"ISO_10367-box";', '"latin-lap";', '"JIS_X0212-1990";', '"DS_2089";', '"us-dk";', '"dk-us";', '"KSC5636";', '"UNICODE-1-1-UTF-7";', '"ISO-2022-CN";',
|
||||
\ '"ISO-2022-CN-EXT";', '"ISO-8859-13";', '"ISO-8859-14";', '"ISO-8859-15";', '"ISO-8859-16";', '"GBK";', '"GB18030";', '"OSD_EBCDIC_DF04_15";',
|
||||
\ '"OSD_EBCDIC_DF03_IRV";', '"OSD_EBCDIC_DF04_1";', '"ISO-11548-1";', '"KZ-1048";', '"ISO-10646-UCS-2";', '"ISO-10646-UCS-4";', '"ISO-10646-UCS-Basic";',
|
||||
\ '"ISO-10646-Unicode-Latin1";', '"ISO-10646-J-1";', '"ISO-Unicode-IBM-1261";', '"ISO-Unicode-IBM-1268";', '"ISO-Unicode-IBM-1276";',
|
||||
\ '"ISO-Unicode-IBM-1264";', '"ISO-Unicode-IBM-1265";', '"UNICODE-1-1";', '"SCSU";', '"UTF-7";', '"UTF-16BE";', '"UTF-16LE";', '"UTF-16";', '"CESU-8";',
|
||||
\ '"UTF-32";', '"UTF-32BE";', '"UTF-32LE";', '"BOCU-1";', '"ISO-8859-1-Windows-3.0-Latin-1";', '"ISO-8859-1-Windows-3.1-Latin-1";',
|
||||
\ '"ISO-8859-2-Windows-Latin-2";', '"ISO-8859-9-Windows-Latin-5";', '"hp-roman8";', '"Adobe-Standard-Encoding";', '"Ventura-US";',
|
||||
\ '"Ventura-International";', '"DEC-MCS";', '"IBM850";', '"PC8-Danish-Norwegian";', '"IBM862";', '"PC8-Turkish";', '"IBM-Symbols";', '"IBM-Thai";',
|
||||
\ '"HP-Legal";', '"HP-Pi-font";', '"HP-Math8";', '"Adobe-Symbol-Encoding";', '"HP-DeskTop";', '"Ventura-Math";', '"Microsoft-Publishing";',
|
||||
\ '"Windows-31J";', '"GB2312";', '"Big5";', '"macintosh";', '"IBM037";', '"IBM038";', '"IBM273";', '"IBM274";', '"IBM275";', '"IBM277";', '"IBM278";',
|
||||
\ '"IBM280";', '"IBM281";', '"IBM284";', '"IBM285";', '"IBM290";', '"IBM297";', '"IBM420";', '"IBM423";', '"IBM424";', '"IBM437";', '"IBM500";', '"IBM851";',
|
||||
\ '"IBM852";', '"IBM855";', '"IBM857";', '"IBM860";', '"IBM861";', '"IBM863";', '"IBM864";', '"IBM865";', '"IBM868";', '"IBM869";', '"IBM870";', '"IBM871";',
|
||||
\ '"IBM880";', '"IBM891";', '"IBM903";', '"IBM904";', '"IBM905";', '"IBM918";', '"IBM1026";', '"EBCDIC-AT-DE";', '"EBCDIC-AT-DE-A";', '"EBCDIC-CA-FR";',
|
||||
\ '"EBCDIC-DK-NO";', '"EBCDIC-DK-NO-A";', '"EBCDIC-FI-SE";', '"EBCDIC-FI-SE-A";', '"EBCDIC-FR";', '"EBCDIC-IT";', '"EBCDIC-PT";', '"EBCDIC-ES";',
|
||||
\ '"EBCDIC-ES-A";', '"EBCDIC-ES-S";', '"EBCDIC-UK";', '"EBCDIC-US";', '"UNKNOWN-8BIT";', '"MNEMONIC";', '"MNEM";', '"VISCII";', '"VIQR";', '"KOI8-R";',
|
||||
\ '"HZ-GB-2312";', '"IBM866";', '"IBM775";', '"KOI8-U";', '"IBM00858";', '"IBM00924";', '"IBM01140";', '"IBM01141";', '"IBM01142";', '"IBM01143";',
|
||||
\ '"IBM01144";', '"IBM01145";', '"IBM01146";', '"IBM01147";', '"IBM01148";', '"IBM01149";', '"Big5-HKSCS";', '"IBM1047";', '"PTCP154";', '"Amiga-1251";',
|
||||
\ '"KOI7-switched";', '"BRF";', '"TSCII";', '"windows-1250";', '"windows-1251";', '"windows-1252";', '"windows-1253";', '"windows-1254";', '"windows-1255";',
|
||||
\ '"windows-1256";', '"windows-1257";', '"windows-1258";', '"TIS-620";']
|
||||
|
||||
elseif atrulename == 'namespace'
|
||||
let entered_atruleafter = matchstr(line, '.*@namespace\s\+\zs.*$')
|
||||
let values = ["url("]
|
||||
|
||||
elseif atrulename == 'document'
|
||||
let entered_atruleafter = matchstr(line, '.*@document\s\+\zs.*$')
|
||||
let values = ["url(", "url-prefix(", "domain(", "regexp("]
|
||||
|
||||
elseif atrulename == 'import'
|
||||
let entered_atruleafter = matchstr(line, '.*@import\s\+\zs.*$')
|
||||
|
||||
@ -398,8 +700,17 @@ elseif borders[max(keys(borders))] == 'atrule'
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.entered_atruleafter
|
||||
if entered_atruleafter =~? '^"' && m =~? '^"'
|
||||
let m = m[1:]
|
||||
endif
|
||||
if b:after =~? '"' && stridx(m, '"') > -1
|
||||
let m = m[0:stridx(m, '"')-1]
|
||||
endif
|
||||
call add(res, m)
|
||||
elseif m =~? entered_atruleafter
|
||||
if m =~? '^"'
|
||||
let m = m[1:]
|
||||
endif
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
@ -408,7 +719,7 @@ elseif borders[max(keys(borders))] == 'atrule'
|
||||
|
||||
endif
|
||||
|
||||
let values = ["charset", "page", "media", "import", "font-face"]
|
||||
let values = ["charset", "page", "media", "import", "font-face", "namespace", "supports", "keyframes", "viewport", "document"]
|
||||
|
||||
let entered_atrule = matchstr(line, '.*@\zs[a-zA-Z-]*$')
|
||||
|
||||
|
150
runtime/autoload/health.vim
Normal file
150
runtime/autoload/health.vim
Normal file
@ -0,0 +1,150 @@
|
||||
function! s:enhance_syntax() abort
|
||||
syntax keyword healthError ERROR
|
||||
highlight link healthError Error
|
||||
|
||||
syntax keyword healthWarning WARNING
|
||||
highlight link healthWarning WarningMsg
|
||||
|
||||
syntax keyword healthInfo INFO
|
||||
highlight link healthInfo ModeMsg
|
||||
|
||||
syntax keyword healthSuccess SUCCESS
|
||||
highlight link healthSuccess Function
|
||||
|
||||
syntax keyword healthSuggestion SUGGESTION
|
||||
highlight link healthSuggestion String
|
||||
endfunction
|
||||
|
||||
" Runs the specified healthchecks.
|
||||
" Runs all discovered healthchecks if a:plugin_names is empty.
|
||||
function! health#check(plugin_names) abort
|
||||
let report = ''
|
||||
|
||||
let healthchecks = empty(a:plugin_names)
|
||||
\ ? s:discover_health_checks()
|
||||
\ : s:to_fn_names(a:plugin_names)
|
||||
|
||||
if empty(healthchecks)
|
||||
let report = "ERROR: No healthchecks found."
|
||||
else
|
||||
for c in healthchecks
|
||||
let report .= printf("\n%s\n%s", c, repeat('=',80))
|
||||
try
|
||||
let report .= execute('call '.c.'()')
|
||||
catch /^Vim\%((\a\+)\)\=:E117/
|
||||
let report .= execute(
|
||||
\ 'call health#report_error(''No healthcheck found for "'
|
||||
\ .s:to_plugin_name(c)
|
||||
\ .'" plugin.'')')
|
||||
catch
|
||||
let report .= execute(
|
||||
\ 'call health#report_error(''Failed to run healthcheck for "'
|
||||
\ .s:to_plugin_name(c)
|
||||
\ .'" plugin. Exception:''."\n".v:exception)')
|
||||
endtry
|
||||
let report .= "\n"
|
||||
endfor
|
||||
endif
|
||||
|
||||
tabnew
|
||||
setlocal bufhidden=wipe
|
||||
set filetype=markdown
|
||||
call s:enhance_syntax()
|
||||
call setline(1, split(report, "\n"))
|
||||
setlocal nomodified
|
||||
endfunction
|
||||
|
||||
" Starts a new report.
|
||||
function! health#report_start(name) abort
|
||||
echo "\n## " . a:name
|
||||
endfunction
|
||||
|
||||
" Indents lines *except* line 1 of a string if it contains newlines.
|
||||
function! s:indent_after_line1(s, columns) abort
|
||||
let lines = split(a:s, "\n", 0)
|
||||
if len(lines) < 2 " We do not indent line 1, so nothing to do.
|
||||
return a:s
|
||||
endif
|
||||
for i in range(1, len(lines)-1) " Indent lines after the first.
|
||||
let lines[i] = substitute(lines[i], '^\s*', repeat(' ', a:columns), 'g')
|
||||
endfor
|
||||
return join(lines, "\n")
|
||||
endfunction
|
||||
|
||||
" Format a message for a specific report item
|
||||
function! s:format_report_message(status, msg, ...) abort " {{{
|
||||
let output = ' - ' . a:status . ': ' . s:indent_after_line1(a:msg, 4)
|
||||
let suggestions = []
|
||||
|
||||
" Optional parameters
|
||||
if a:0 > 0
|
||||
let suggestions = type(a:1) == type("") ? [a:1] : a:1
|
||||
if type(suggestions) != type([])
|
||||
echoerr "Expected String or List"
|
||||
endif
|
||||
endif
|
||||
|
||||
" Report each suggestion
|
||||
if len(suggestions) > 0
|
||||
let output .= "\n - SUGGESTIONS:"
|
||||
endif
|
||||
for suggestion in suggestions
|
||||
let output .= "\n - " . s:indent_after_line1(suggestion, 10)
|
||||
endfor
|
||||
|
||||
return output
|
||||
endfunction " }}}
|
||||
|
||||
" Use {msg} to report information in the current section
|
||||
function! health#report_info(msg) abort " {{{
|
||||
echo s:format_report_message('INFO', a:msg)
|
||||
endfunction " }}}
|
||||
|
||||
" Reports a successful healthcheck.
|
||||
function! health#report_ok(msg) abort " {{{
|
||||
echo s:format_report_message('SUCCESS', a:msg)
|
||||
endfunction " }}}
|
||||
|
||||
" Reports a health warning.
|
||||
function! health#report_warn(msg, ...) abort " {{{
|
||||
if a:0 > 0
|
||||
echo s:format_report_message('WARNING', a:msg, a:1)
|
||||
else
|
||||
echo s:format_report_message('WARNING', a:msg)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" Reports a failed healthcheck.
|
||||
function! health#report_error(msg, ...) abort " {{{
|
||||
if a:0 > 0
|
||||
echo s:format_report_message('ERROR', a:msg, a:1)
|
||||
else
|
||||
echo s:format_report_message('ERROR', a:msg)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
function! s:filepath_to_function(name) abort
|
||||
return substitute(substitute(substitute(a:name, ".*autoload/", "", ""),
|
||||
\ "\\.vim", "#check", ""), "/", "#", "g")
|
||||
endfunction
|
||||
|
||||
function! s:discover_health_checks() abort
|
||||
let healthchecks = globpath(&runtimepath, 'autoload/health/*.vim', 1, 1)
|
||||
let healthchecks = map(healthchecks, '<SID>filepath_to_function(v:val)')
|
||||
return healthchecks
|
||||
endfunction
|
||||
|
||||
" Translates a list of plugin names to healthcheck function names.
|
||||
function! s:to_fn_names(plugin_names) abort
|
||||
let healthchecks = []
|
||||
for p in a:plugin_names
|
||||
call add(healthchecks, 'health#'.p.'#check')
|
||||
endfor
|
||||
return healthchecks
|
||||
endfunction
|
||||
|
||||
" Extracts 'foo' from 'health#foo#check'.
|
||||
function! s:to_plugin_name(fn_name) abort
|
||||
return substitute(a:fn_name,
|
||||
\ '\v.*health\#(.+)\#check.*', '\1', '')
|
||||
endfunction
|
439
runtime/autoload/health/nvim.vim
Normal file
439
runtime/autoload/health/nvim.vim
Normal file
@ -0,0 +1,439 @@
|
||||
let s:bad_responses = [
|
||||
\ 'unable to parse python response',
|
||||
\ 'unable to parse',
|
||||
\ 'unable to get pypi response',
|
||||
\ 'unable to get neovim executable',
|
||||
\ 'unable to find neovim version'
|
||||
\ ]
|
||||
|
||||
function! s:is_bad_response(s) abort
|
||||
return index(s:bad_responses, a:s) >= 0
|
||||
endfunction
|
||||
|
||||
function! s:trim(s) abort
|
||||
return substitute(a:s, '^\_s*\|\_s*$', '', 'g')
|
||||
endfunction
|
||||
|
||||
" Simple version comparison.
|
||||
function! s:version_cmp(a, b) abort
|
||||
let a = split(a:a, '\.')
|
||||
let b = split(a:b, '\.')
|
||||
|
||||
for i in range(len(a))
|
||||
if a[i] > b[i]
|
||||
return 1
|
||||
elseif a[i] < b[i]
|
||||
return -1
|
||||
endif
|
||||
endfor
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" Fetch the contents of a URL.
|
||||
function! s:download(url) abort
|
||||
let content = ''
|
||||
if executable('curl')
|
||||
let content = system(['curl', '-sL', "'", a:url, "'"])
|
||||
endif
|
||||
|
||||
if empty(content) && executable('python')
|
||||
let script = "
|
||||
\try:\n
|
||||
\ from urllib.request import urlopen\n
|
||||
\except ImportError:\n
|
||||
\ from urllib2 import urlopen\n
|
||||
\\n
|
||||
\try:\n
|
||||
\ response = urlopen('".a:url."')\n
|
||||
\ print(response.read().decode('utf8'))\n
|
||||
\except Exception:\n
|
||||
\ pass\n
|
||||
\"
|
||||
let content = system(['python', '-c', "'", script, "'", '2>/dev/null'])
|
||||
endif
|
||||
|
||||
return content
|
||||
endfunction
|
||||
|
||||
|
||||
" Get the latest Neovim Python client version from PyPI. Result is cached.
|
||||
function! s:latest_pypi_version() abort
|
||||
if exists('s:pypi_version')
|
||||
return s:pypi_version
|
||||
endif
|
||||
|
||||
let s:pypi_version = 'unable to get pypi response'
|
||||
let pypi_info = s:download('https://pypi.python.org/pypi/neovim/json')
|
||||
if !empty(pypi_info)
|
||||
let pypi_data = json_decode(pypi_info)
|
||||
let s:pypi_version = get(get(pypi_data, 'info', {}), 'version', 'unable to parse')
|
||||
return s:pypi_version
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Get version information using the specified interpreter. The interpreter is
|
||||
" used directly in case breaking changes were introduced since the last time
|
||||
" Neovim's Python client was updated.
|
||||
"
|
||||
" Returns [
|
||||
" python executable version,
|
||||
" current nvim version,
|
||||
" current pypi nvim status,
|
||||
" installed version status
|
||||
" ]
|
||||
function! s:version_info(python) abort
|
||||
let pypi_version = s:latest_pypi_version()
|
||||
let python_version = s:trim(system([
|
||||
\ a:python,
|
||||
\ '-c',
|
||||
\ 'import sys; print(".".join(str(x) for x in sys.version_info[:3]))',
|
||||
\ ]))
|
||||
|
||||
if empty(python_version)
|
||||
let python_version = 'unable to parse python response'
|
||||
endif
|
||||
|
||||
let nvim_path = s:trim(system([
|
||||
\ a:python,
|
||||
\ '-c',
|
||||
\ 'import neovim; print(neovim.__file__)',
|
||||
\ '2>/dev/null']))
|
||||
|
||||
let nvim_path = s:trim(system([
|
||||
\ 'python3',
|
||||
\ '-c',
|
||||
\ 'import neovim; print(neovim.__file__)'
|
||||
\ ]))
|
||||
" \ '2>/dev/null']))
|
||||
|
||||
if empty(nvim_path)
|
||||
return [python_version, 'unable to find neovim executable', pypi_version, 'unable to get neovim executable']
|
||||
endif
|
||||
|
||||
let nvim_version = 'unable to find neovim version'
|
||||
let base = fnamemodify(nvim_path, ':h')
|
||||
for meta in glob(base.'-*/METADATA', 1, 1) + glob(base.'-*/PKG-INFO', 1, 1)
|
||||
for meta_line in readfile(meta)
|
||||
if meta_line =~# '^Version:'
|
||||
let nvim_version = matchstr(meta_line, '^Version: \zs\S\+')
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
||||
let version_status = 'unknown'
|
||||
if !s:is_bad_response(nvim_version) && !s:is_bad_response(pypi_version)
|
||||
if s:version_cmp(nvim_version, pypi_version) == -1
|
||||
let version_status = 'outdated'
|
||||
else
|
||||
let version_status = 'up to date'
|
||||
endif
|
||||
endif
|
||||
|
||||
return [python_version, nvim_version, pypi_version, version_status]
|
||||
endfunction
|
||||
|
||||
" Check the Python interpreter's usability.
|
||||
function! s:check_bin(bin) abort
|
||||
if !filereadable(a:bin)
|
||||
call health#report_error(printf('"%s" was not found.', a:bin))
|
||||
return 0
|
||||
elseif executable(a:bin) != 1
|
||||
call health#report_error(printf('"%s" is not executable.', a:bin))
|
||||
return 0
|
||||
endif
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
" Load the remote plugin manifest file and check for unregistered plugins
|
||||
function! s:check_manifest() abort
|
||||
call health#report_start('Remote Plugins')
|
||||
let existing_rplugins = {}
|
||||
|
||||
for item in remote#host#PluginsForHost('python')
|
||||
let existing_rplugins[item.path] = 'python'
|
||||
endfor
|
||||
|
||||
for item in remote#host#PluginsForHost('python3')
|
||||
let existing_rplugins[item.path] = 'python3'
|
||||
endfor
|
||||
|
||||
let require_update = 0
|
||||
|
||||
for path in map(split(&runtimepath, ','), 'resolve(v:val)')
|
||||
let python_glob = glob(path.'/rplugin/python*', 1, 1)
|
||||
if empty(python_glob)
|
||||
continue
|
||||
endif
|
||||
|
||||
let python_dir = python_glob[0]
|
||||
let python_version = fnamemodify(python_dir, ':t')
|
||||
|
||||
for script in glob(python_dir.'/*.py', 1, 1)
|
||||
\ + glob(python_dir.'/*/__init__.py', 1, 1)
|
||||
let contents = join(readfile(script))
|
||||
if contents =~# '\<\%(from\|import\)\s\+neovim\>'
|
||||
if script =~# '/__init__\.py$'
|
||||
let script = fnamemodify(script, ':h')
|
||||
endif
|
||||
|
||||
if !has_key(existing_rplugins, script)
|
||||
let msg = printf('"%s" is not registered.', fnamemodify(path, ':t'))
|
||||
if python_version ==# 'pythonx'
|
||||
if !has('python2') && !has('python3')
|
||||
let msg .= ' (python2 and python3 not available)'
|
||||
endif
|
||||
elseif !has(python_version)
|
||||
let msg .= printf(' (%s not available)', python_version)
|
||||
else
|
||||
let require_update = 1
|
||||
endif
|
||||
|
||||
call health#report_warn(msg)
|
||||
endif
|
||||
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
||||
if require_update
|
||||
call health#report_warn('Out of date', ['Run `:UpdateRemotePlugins`'])
|
||||
else
|
||||
call health#report_ok('Up to date')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:check_python(version) abort
|
||||
call health#report_start('Python ' . a:version . ' provider')
|
||||
|
||||
let python_bin_name = 'python'.(a:version == 2 ? '2' : '3')
|
||||
let pyenv = resolve(exepath('pyenv'))
|
||||
let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : 'n'
|
||||
let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : ''
|
||||
let host_prog_var = python_bin_name.'_host_prog'
|
||||
let host_skip_var = python_bin_name.'_host_skip_check'
|
||||
let python_bin = ''
|
||||
let python_multiple = []
|
||||
|
||||
if exists('g:'.host_prog_var)
|
||||
call health#report_info(printf('Using: g:%s = "%s"', host_prog_var, get(g:, host_prog_var)))
|
||||
endif
|
||||
|
||||
let [python_bin_name, pythonx_errs] = provider#pythonx#Detect(a:version)
|
||||
if empty(python_bin_name)
|
||||
call health#report_warn('No Python interpreter was found with the neovim '
|
||||
\ . 'module. Using the first available for diagnostics.')
|
||||
if !empty(pythonx_errs)
|
||||
call health#report_warn(pythonx_errs)
|
||||
endif
|
||||
let old_skip = get(g:, host_skip_var, 0)
|
||||
let g:[host_skip_var] = 1
|
||||
let [python_bin_name, pythonx_errs] = provider#pythonx#Detect(a:version)
|
||||
let g:[host_skip_var] = old_skip
|
||||
endif
|
||||
|
||||
if !empty(python_bin_name)
|
||||
if exists('g:'.host_prog_var)
|
||||
let python_bin = exepath(python_bin_name)
|
||||
endif
|
||||
let python_bin_name = fnamemodify(python_bin_name, ':t')
|
||||
endif
|
||||
|
||||
if !empty(pythonx_errs)
|
||||
call health#report_error('Python provider error', pythonx_errs)
|
||||
endif
|
||||
|
||||
if !empty(python_bin_name) && empty(python_bin) && empty(pythonx_errs)
|
||||
if !exists('g:'.host_prog_var)
|
||||
call health#report_info(printf('`g:%s` is not set. Searching for '
|
||||
\ . '%s in the environment.', host_prog_var, python_bin_name))
|
||||
endif
|
||||
|
||||
if !empty(pyenv)
|
||||
if empty(pyenv_root)
|
||||
call health#report_warn(
|
||||
\ 'pyenv was found, but $PYENV_ROOT is not set.',
|
||||
\ ['Did you follow the final install instructions?']
|
||||
\ )
|
||||
else
|
||||
call health#report_ok(printf('pyenv found: "%s"', pyenv))
|
||||
endif
|
||||
|
||||
let python_bin = s:trim(system(
|
||||
\ printf('"%s" which %s 2>/dev/null', pyenv, python_bin_name)))
|
||||
|
||||
if empty(python_bin)
|
||||
call health#report_warn(printf('pyenv couldn''t find %s.', python_bin_name))
|
||||
endif
|
||||
endif
|
||||
|
||||
if empty(python_bin)
|
||||
let python_bin = exepath(python_bin_name)
|
||||
|
||||
if exists('$PATH')
|
||||
for path in split($PATH, ':')
|
||||
let path_bin = path.'/'.python_bin_name
|
||||
if path_bin != python_bin && index(python_multiple, path_bin) == -1
|
||||
\ && executable(path_bin)
|
||||
call add(python_multiple, path_bin)
|
||||
endif
|
||||
endfor
|
||||
|
||||
if len(python_multiple)
|
||||
" This is worth noting since the user may install something
|
||||
" that changes $PATH, like homebrew.
|
||||
call health#report_info(printf('There are multiple %s executables found. '
|
||||
\ . 'Set "g:%s" to avoid surprises.', python_bin_name, host_prog_var))
|
||||
endif
|
||||
|
||||
if python_bin =~# '\<shims\>'
|
||||
call health#report_warn(printf('"%s" appears to be a pyenv shim.', python_bin), [
|
||||
\ 'The "pyenv" executable is not in $PATH,',
|
||||
\ 'Your pyenv installation is broken. You should set '
|
||||
\ . '"g:'.host_prog_var.'" to avoid surprises.',
|
||||
\ ])
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if !empty(python_bin)
|
||||
if empty(venv) && !empty(pyenv) && !exists('g:'.host_prog_var)
|
||||
\ && !empty(pyenv_root) && resolve(python_bin) !~# '^'.pyenv_root.'/'
|
||||
call health#report_warn('pyenv is not set up optimally.', [
|
||||
\ printf('Suggestion: Create a virtualenv specifically '
|
||||
\ . 'for Neovim using pyenv and use "g:%s". This will avoid '
|
||||
\ . 'the need to install Neovim''s Python client in each '
|
||||
\ . 'version/virtualenv.', host_prog_var)
|
||||
\ ])
|
||||
elseif !empty(venv) && exists('g:'.host_prog_var)
|
||||
if !empty(pyenv_root)
|
||||
let venv_root = pyenv_root
|
||||
else
|
||||
let venv_root = fnamemodify(venv, ':h')
|
||||
endif
|
||||
|
||||
if resolve(python_bin) !~# '^'.venv_root.'/'
|
||||
call health#report_warn('Your virtualenv is not set up optimally.', [
|
||||
\ printf('Suggestion: Create a virtualenv specifically '
|
||||
\ . 'for Neovim and use "g:%s". This will avoid '
|
||||
\ . 'the need to install Neovim''s Python client in each '
|
||||
\ . 'virtualenv.', host_prog_var)
|
||||
\ ])
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if empty(python_bin) && !empty(python_bin_name)
|
||||
" An error message should have already printed.
|
||||
call health#report_error(printf('"%s" was not found.', python_bin_name))
|
||||
elseif !empty(python_bin) && !s:check_bin(python_bin)
|
||||
let python_bin = ''
|
||||
endif
|
||||
|
||||
" Check if $VIRTUAL_ENV is active
|
||||
let virtualenv_inactive = 0
|
||||
|
||||
if exists('$VIRTUAL_ENV')
|
||||
if !empty(pyenv)
|
||||
let pyenv_prefix = resolve(s:trim(system([pyenv, 'prefix'])))
|
||||
if $VIRTUAL_ENV != pyenv_prefix
|
||||
let virtualenv_inactive = 1
|
||||
endif
|
||||
elseif !empty(python_bin_name) && exepath(python_bin_name) !~# '^'.$VIRTUAL_ENV.'/'
|
||||
let virtualenv_inactive = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
if virtualenv_inactive
|
||||
let suggestions = [
|
||||
\ 'If you are using Zsh, see: http://vi.stackexchange.com/a/7654/5229',
|
||||
\ ]
|
||||
call health#report_warn(
|
||||
\ '$VIRTUAL_ENV exists but appears to be inactive. '
|
||||
\ . 'This could lead to unexpected results.',
|
||||
\ suggestions)
|
||||
endif
|
||||
|
||||
" Diagnostic output
|
||||
call health#report_info('Executable: ' . (empty(python_bin) ? 'Not found' : python_bin))
|
||||
if len(python_multiple)
|
||||
for path_bin in python_multiple
|
||||
call health#report_info('Other python executable: ' . path_bin)
|
||||
endfor
|
||||
endif
|
||||
|
||||
if !empty(python_bin)
|
||||
let [pyversion, current, latest, status] = s:version_info(python_bin)
|
||||
if a:version != str2nr(pyversion)
|
||||
call health#report_warn('Got an unexpected version of Python.' .
|
||||
\ ' This could lead to confusing error messages.')
|
||||
endif
|
||||
if a:version == 3 && str2float(pyversion) < 3.3
|
||||
call health#report_warn('Python 3.3+ is recommended.')
|
||||
endif
|
||||
|
||||
call health#report_info('Python'.a:version.' version: ' . pyversion)
|
||||
call health#report_info(printf('%s-neovim Version: %s', python_bin_name, current))
|
||||
|
||||
if s:is_bad_response(current)
|
||||
let suggestions = [
|
||||
\ 'Error found was: ' . current,
|
||||
\ 'Use the command `$ pip' . a:version . ' install neovim`',
|
||||
\ ]
|
||||
call health#report_error(
|
||||
\ 'Neovim Python client is not installed.',
|
||||
\ suggestions)
|
||||
endif
|
||||
|
||||
if s:is_bad_response(latest)
|
||||
call health#report_warn('Unable to fetch latest Neovim Python client version.')
|
||||
endif
|
||||
|
||||
if s:is_bad_response(status)
|
||||
call health#report_warn('Latest Neovim Python client versions: ('.latest.')')
|
||||
else
|
||||
call health#report_ok('Latest Neovim Python client is installed: ('.status.')')
|
||||
endif
|
||||
endif
|
||||
|
||||
endfunction
|
||||
|
||||
function! s:check_ruby() abort
|
||||
call health#report_start('Ruby provider')
|
||||
let min_version = "0.2.4"
|
||||
let ruby_version = systemlist('ruby -v')[0]
|
||||
let ruby_prog = provider#ruby#Detect()
|
||||
let suggestions =
|
||||
\ ['Install or upgrade the neovim RubyGem using `gem install neovim`.']
|
||||
|
||||
if empty(ruby_prog)
|
||||
let ruby_prog = 'not found'
|
||||
let prog_vers = 'not found'
|
||||
call health#report_error('Missing Neovim RubyGem', suggestions)
|
||||
else
|
||||
silent let prog_vers = systemlist(ruby_prog . ' --version')[0]
|
||||
if v:shell_error
|
||||
let prog_vers = 'outdated'
|
||||
call health#report_warn('Neovim RubyGem is not up-to-date', suggestions)
|
||||
elseif s:version_cmp(prog_vers, min_version) == -1
|
||||
let prog_vers .= ' (outdated)'
|
||||
call health#report_warn('Neovim RubyGem is not up-to-date', suggestions)
|
||||
else
|
||||
call health#report_ok('Found Neovim RubyGem')
|
||||
endif
|
||||
endif
|
||||
|
||||
call health#report_info('Ruby Version: ' . ruby_version)
|
||||
call health#report_info('Host Executable: ' . ruby_prog)
|
||||
call health#report_info('Host Version: ' . prog_vers)
|
||||
endfunction
|
||||
|
||||
function! health#nvim#check() abort
|
||||
call s:check_manifest()
|
||||
call s:check_python(2)
|
||||
call s:check_python(3)
|
||||
call s:check_ruby()
|
||||
endfunction
|
@ -1,137 +1,286 @@
|
||||
let s:man_tag_depth = 0
|
||||
let s:man_sect_arg = ''
|
||||
let s:man_find_arg = '-w'
|
||||
" Maintainer: Anmol Sethi <anmol@aubble.com>
|
||||
|
||||
" Ensure Vim is not recursively invoked (man-db does this)
|
||||
" by forcing man to use cat as the pager.
|
||||
" More info here http://comments.gmane.org/gmane.editors.vim.devel/29085
|
||||
if &shell =~# 'fish$'
|
||||
let s:man_cmd = 'man -P cat ^/dev/null'
|
||||
else
|
||||
let s:man_cmd = 'man -P cat 2>/dev/null'
|
||||
endif
|
||||
|
||||
let s:man_find_arg = "-w"
|
||||
|
||||
" TODO(nhooyr) I do not think completion will work on SunOS because I'm not sure if `man -l`
|
||||
" displays the list of directories that are searched by man for manpages.
|
||||
" I also do not think Solaris supports the '-P' flag used above and uses only $PAGER.
|
||||
try
|
||||
if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~? '^5'
|
||||
let s:man_sect_arg = '-s'
|
||||
if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5'
|
||||
let s:man_find_arg = '-l'
|
||||
endif
|
||||
catch /E145:/
|
||||
" Ignore the error in restricted mode
|
||||
endtry
|
||||
|
||||
" Load man page {page} from {section}
|
||||
" call man#get_page([{section}, ]{page})
|
||||
function man#get_page(...) abort
|
||||
let invoked_from_man = (&filetype ==# 'man')
|
||||
|
||||
if a:0 == 0
|
||||
echoerr 'argument required'
|
||||
" We need count and count1 to ensure the section was explicitly set
|
||||
" by the user. count defaults to 0 which is a valid section and
|
||||
" count1 defaults to 1 which is also a valid section. Only when they
|
||||
" are equal was the count explicitly set.
|
||||
function! man#open_page(count, count1, ...) abort
|
||||
if a:0 > 2
|
||||
call s:error('too many arguments')
|
||||
return
|
||||
elseif a:0 > 2
|
||||
echoerr 'too many arguments'
|
||||
elseif a:0 ==# 1
|
||||
if empty(a:1)
|
||||
call s:error('no identifier under cursor')
|
||||
return
|
||||
endif
|
||||
|
||||
let sect = get(a:000, 0)
|
||||
let page = get(a:000, 1, sect)
|
||||
|
||||
let [page, sect] = s:parse_page_and_section(sect, page)
|
||||
|
||||
if !empty(sect) && s:find_page(sect, page) == 0
|
||||
let sect = ''
|
||||
let ref = a:1
|
||||
else
|
||||
" We combine the name and sect into a manpage reference so that all
|
||||
" verification/extraction can be kept in a single function.
|
||||
" If a:2 is a reference as well, that is fine because it is the only
|
||||
" reference that will match.
|
||||
let ref = a:2.'('.a:1.')'
|
||||
endif
|
||||
|
||||
if s:find_page(sect, page) == 0
|
||||
echo 'No manual entry for '.page
|
||||
try
|
||||
let [sect, name] = s:extract_sect_and_name_ref(ref)
|
||||
if a:count ==# a:count1
|
||||
" user explicitly set a count
|
||||
let sect = string(a:count)
|
||||
endif
|
||||
let [sect, name] = s:verify_exists(sect, name)
|
||||
catch
|
||||
call s:error(v:exception)
|
||||
return
|
||||
endtry
|
||||
call s:push_tag()
|
||||
let bufname = 'man://'.name.(empty(sect)?'':'('.sect.')')
|
||||
let found_man = s:find_man()
|
||||
if getbufvar(bufname, 'manwidth') ==# s:manwidth()
|
||||
if found_man
|
||||
silent execute 'buf' bufnr(bufname)
|
||||
else
|
||||
execute 'split' bufname
|
||||
endif
|
||||
keepjumps 1
|
||||
return
|
||||
endif
|
||||
|
||||
exec 'let s:man_tag_buf_'.s:man_tag_depth.' = '.bufnr('%')
|
||||
exec 'let s:man_tag_lin_'.s:man_tag_depth.' = '.line('.')
|
||||
exec 'let s:man_tag_col_'.s:man_tag_depth.' = '.col('.')
|
||||
let s:man_tag_depth = s:man_tag_depth + 1
|
||||
|
||||
let editcmd = 'edit'
|
||||
" Use an existing 'man' window, else open a new one.
|
||||
if &filetype !=# 'man'
|
||||
let thiswin = winnr()
|
||||
wincmd b
|
||||
if winnr() > 1
|
||||
exec thiswin . 'wincmd w'
|
||||
while 1
|
||||
if &filetype ==# 'man'
|
||||
break
|
||||
endif
|
||||
wincmd w
|
||||
if thiswin == winnr()
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
if found_man
|
||||
noautocmd execute 'edit' bufname
|
||||
else
|
||||
noautocmd execute 'split' bufname
|
||||
endif
|
||||
call s:read_page(sect, name)
|
||||
endfunction
|
||||
|
||||
if &filetype !=# 'man'
|
||||
let editcmd = 'tabnew'
|
||||
endif
|
||||
endif
|
||||
|
||||
silent exec editcmd.' man://'.page.(empty(sect)?'':'('.sect.')')
|
||||
function! man#read_page(ref) abort
|
||||
try
|
||||
let [sect, name] = s:extract_sect_and_name_ref(a:ref)
|
||||
let [sect, name] = s:verify_exists(sect, name)
|
||||
catch
|
||||
call s:error(v:exception)
|
||||
return
|
||||
endtry
|
||||
call s:read_page(sect, name)
|
||||
endfunction
|
||||
|
||||
function! s:read_page(sect, name) abort
|
||||
setlocal modifiable
|
||||
silent keepjumps norm! 1G"_dG
|
||||
if empty($MANWIDTH)
|
||||
let $MANWIDTH = winwidth(0)
|
||||
endif
|
||||
silent exec 'r!/usr/bin/man '.s:cmd(sect, page).' | col -b'
|
||||
" Remove blank lines from top and bottom.
|
||||
setlocal noreadonly
|
||||
keepjumps %delete _
|
||||
let b:manwidth = s:manwidth()
|
||||
silent execute 'read!env MANWIDTH='.b:manwidth s:man_cmd s:man_args(a:sect, a:name)
|
||||
" remove all the backspaced text
|
||||
silent execute 'keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g')
|
||||
while getline(1) =~# '^\s*$'
|
||||
silent keepjumps 1delete _
|
||||
endwhile
|
||||
while getline('$') =~# '^\s*$'
|
||||
silent keepjumps $delete _
|
||||
endwhile
|
||||
setlocal nomodified
|
||||
setlocal filetype=man
|
||||
endfunction
|
||||
|
||||
if invoked_from_man || editcmd ==# 'tabnew'
|
||||
call s:set_window_local_options()
|
||||
" attempt to extract the name and sect out of 'name(sect)'
|
||||
" otherwise just return the largest string of valid characters in ref
|
||||
function! s:extract_sect_and_name_ref(ref) abort
|
||||
if a:ref[0] ==# '-' " try ':Man -pandoc' with this disabled.
|
||||
throw 'manpage name starts with ''-'''
|
||||
endif
|
||||
let ref = matchstr(a:ref, '[^()]\+([^()]\+)')
|
||||
if empty(ref)
|
||||
let name = matchstr(a:ref, '[^()]\+')
|
||||
if empty(name)
|
||||
throw 'manpage reference contains only parantheses'
|
||||
endif
|
||||
return ['', name]
|
||||
endif
|
||||
let left = split(ref, '(')
|
||||
" see ':Man 3X curses' on why tolower.
|
||||
" TODO(nhooyr) Not sure if this is portable across OSs
|
||||
" but I have not seen a single uppercase section.
|
||||
return [tolower(split(left[1], ')')[0]), left[0]]
|
||||
endfunction
|
||||
|
||||
function! s:verify_exists(sect, name) abort
|
||||
let path = system(s:man_cmd.' '.s:man_find_arg.' '.s:man_args(a:sect, a:name))
|
||||
if path !~# '^\/'
|
||||
if empty(a:sect)
|
||||
throw 'no manual entry for '.a:name
|
||||
endif
|
||||
let path = system(s:man_cmd.' '.s:man_find_arg.' '.shellescape(a:name))
|
||||
if path !~# '^\/'
|
||||
throw 'no manual entry for '.a:name.'('.a:sect.') or '.a:name
|
||||
endif
|
||||
endif
|
||||
if a:name =~# '\/'
|
||||
" We do not need to extract the section/name from the path if the name is
|
||||
" just a path.
|
||||
return ['', a:name]
|
||||
endif
|
||||
" We need to extract the section from the path because sometimes
|
||||
" the actual section of the manpage is more specific than the section
|
||||
" we provided to `man`. Try ':Man 3 App::CLI'.
|
||||
" Also on linux, it seems that the name is case insensitive. So if one does
|
||||
" ':Man PRIntf', we still want the name of the buffer to be 'printf' or
|
||||
" whatever the correct capitilization is.
|
||||
return s:extract_sect_and_name_path(path[:len(path)-2])
|
||||
endfunction
|
||||
|
||||
let s:tag_stack = []
|
||||
|
||||
function! s:push_tag() abort
|
||||
let s:tag_stack += [{
|
||||
\ 'buf': bufnr('%'),
|
||||
\ 'lnum': line('.'),
|
||||
\ 'col': col('.'),
|
||||
\ }]
|
||||
endfunction
|
||||
|
||||
function! man#pop_tag() abort
|
||||
if !empty(s:tag_stack)
|
||||
let tag = remove(s:tag_stack, -1)
|
||||
execute tag['buf'].'b'
|
||||
call cursor(tag['lnum'], tag['col'])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function s:set_window_local_options() abort
|
||||
setlocal colorcolumn=0 foldcolumn=0 nonumber
|
||||
setlocal nolist norelativenumber nofoldenable
|
||||
" extracts the name and sect out of 'path/name.sect'
|
||||
function! s:extract_sect_and_name_path(path) abort
|
||||
let tail = fnamemodify(a:path, ':t')
|
||||
if a:path =~# '\.\%([glx]z\|bz2\|lzma\|Z\)$' " valid extensions
|
||||
let tail = fnamemodify(tail, ':r')
|
||||
endif
|
||||
let sect = matchstr(tail, '\.\zs[^.]\+$')
|
||||
let name = matchstr(tail, '^.\+\ze\.[^.]\+$')
|
||||
return [sect, name]
|
||||
endfunction
|
||||
|
||||
function man#pop_page() abort
|
||||
if s:man_tag_depth > 0
|
||||
let s:man_tag_depth = s:man_tag_depth - 1
|
||||
exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth
|
||||
exec "let s:man_tag_lin=s:man_tag_lin_".s:man_tag_depth
|
||||
exec "let s:man_tag_col=s:man_tag_col_".s:man_tag_depth
|
||||
exec s:man_tag_buf."b"
|
||||
exec s:man_tag_lin
|
||||
exec "norm! ".s:man_tag_col."|"
|
||||
exec "unlet s:man_tag_buf_".s:man_tag_depth
|
||||
exec "unlet s:man_tag_lin_".s:man_tag_depth
|
||||
exec "unlet s:man_tag_col_".s:man_tag_depth
|
||||
unlet s:man_tag_buf s:man_tag_lin s:man_tag_col
|
||||
function! s:find_man() abort
|
||||
if &filetype ==# 'man'
|
||||
return 1
|
||||
endif
|
||||
let thiswin = winnr()
|
||||
while 1
|
||||
wincmd w
|
||||
if &filetype ==# 'man'
|
||||
return 1
|
||||
elseif thiswin ==# winnr()
|
||||
return 0
|
||||
endif
|
||||
endwhile
|
||||
endfunction
|
||||
|
||||
function! s:manwidth() abort
|
||||
" The reason for respecting $MANWIDTH even if it is wider/smaller than the
|
||||
" current window is that the current window might only be temporarily
|
||||
" narrow/wide. Since we don't reflow, we should just assume the
|
||||
" user knows what they're doing and respect $MANWIDTH.
|
||||
if empty($MANWIDTH)
|
||||
" If $MANWIDTH is not set, we do not assign directly to $MANWIDTH because
|
||||
" then $MANWIDTH will always stay the same value as we only use
|
||||
" winwidth(0) when $MANWIDTH is empty. Instead we set it locally for the command.
|
||||
return winwidth(0)
|
||||
endif
|
||||
return $MANWIDTH
|
||||
endfunction
|
||||
|
||||
function! s:man_args(sect, name) abort
|
||||
if empty(a:sect)
|
||||
return shellescape(a:name)
|
||||
endif
|
||||
" The '-s' flag is very useful.
|
||||
" We do not need to worry about stuff like 'printf(echo)'
|
||||
" (two manpages would be interpreted by man without -s)
|
||||
" We do not need to check if the sect starts with '-'
|
||||
" Lastly, the 3pcap section on macOS doesn't work without -s
|
||||
return '-s '.shellescape(a:sect).' '.shellescape(a:name)
|
||||
endfunction
|
||||
|
||||
function! s:error(msg) abort
|
||||
redraw
|
||||
echohl ErrorMsg
|
||||
echon 'man.vim: ' a:msg
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
let s:mandirs = join(split(system(s:man_cmd.' '.s:man_find_arg), ':\|\n'), ',')
|
||||
|
||||
" see s:extract_sect_and_name_ref on why tolower(sect)
|
||||
function! man#complete(arg_lead, cmd_line, cursor_pos) abort
|
||||
let args = split(a:cmd_line)
|
||||
let l = len(args)
|
||||
if l > 3
|
||||
return
|
||||
elseif l ==# 1
|
||||
let name = ''
|
||||
let sect = ''
|
||||
elseif a:arg_lead =~# '^[^()]\+([^()]*$'
|
||||
" cursor (|) is at ':Man printf(|' or ':Man 1 printf(|'
|
||||
" The later is is allowed because of ':Man pri<TAB>'.
|
||||
" It will offer 'priclass.d(1m)' even though section is specified as 1.
|
||||
let tmp = split(a:arg_lead, '(')
|
||||
let name = tmp[0]
|
||||
let sect = tolower(get(tmp, 1, ''))
|
||||
elseif args[1] !~# '^[^()]\+$'
|
||||
" cursor (|) is at ':Man 3() |' or ':Man (3|' or ':Man 3() pri|'
|
||||
" or ':Man 3() pri |'
|
||||
return
|
||||
elseif l ==# 2
|
||||
if empty(a:arg_lead)
|
||||
" cursor (|) is at ':Man 1 |'
|
||||
let name = ''
|
||||
let sect = tolower(args[1])
|
||||
else
|
||||
" cursor (|) is at ':Man pri|'
|
||||
if a:arg_lead =~# '\/'
|
||||
" if the name is a path, complete files
|
||||
" TODO(nhooyr) why does this complete the last one automatically
|
||||
return glob(a:arg_lead.'*', 0, 1)
|
||||
endif
|
||||
let name = a:arg_lead
|
||||
let sect = ''
|
||||
endif
|
||||
elseif a:arg_lead !~# '^[^()]\+$'
|
||||
" cursor (|) is at ':Man 3 printf |' or ':Man 3 (pr)i|'
|
||||
return
|
||||
else
|
||||
" cursor (|) is at ':Man 3 pri|'
|
||||
let name = a:arg_lead
|
||||
let sect = tolower(args[1])
|
||||
endif
|
||||
" We remove duplicates incase the same manpage in different languages was found.
|
||||
return uniq(sort(map(globpath(s:mandirs,'man?/'.name.'*.'.sect.'*', 0, 1), 's:format_candidate(v:val, sect)'), 'i'))
|
||||
endfunction
|
||||
|
||||
function! s:format_candidate(c, sect) abort
|
||||
if a:c =~# '\.\%(pdf\|in\)$' " invalid extensions
|
||||
return
|
||||
endif
|
||||
let [sect, name] = s:extract_sect_and_name_path(a:c)
|
||||
if sect ==# a:sect
|
||||
return name
|
||||
elseif sect =~# a:sect.'[^.]\+$'
|
||||
" We include the section if the user provided section is a prefix
|
||||
" of the actual section.
|
||||
return name.'('.sect.')'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Expects a string like 'access' or 'access(2)'.
|
||||
function s:parse_page_and_section(sect, str) abort
|
||||
try
|
||||
let [page, sect] = matchlist(a:str, '\v\C([-.[:alnum:]_]+)%(\(([-.[:alnum:]_]+)\))?')[1:2]
|
||||
if empty(sect)
|
||||
let sect = a:sect
|
||||
endif
|
||||
catch
|
||||
echoerr 'man.vim: failed to parse: "'.a:str.'"'
|
||||
endtry
|
||||
|
||||
return [page, sect]
|
||||
endfunction
|
||||
|
||||
function s:cmd(sect, page) abort
|
||||
if !empty(a:sect)
|
||||
return s:man_sect_arg.' '.a:sect.' '.a:page
|
||||
endif
|
||||
return a:page
|
||||
endfunction
|
||||
|
||||
function s:find_page(sect, page) abort
|
||||
let where = system('/usr/bin/man '.s:man_find_arg.' '.s:cmd(a:sect, a:page))
|
||||
return (where =~# '^ */')
|
||||
endfunction
|
||||
|
@ -356,6 +356,8 @@ let s:MSGPACK_STANDARD_TYPES = {
|
||||
\type(''): 'binary',
|
||||
\type([]): 'array',
|
||||
\type({}): 'map',
|
||||
\type(v:true): 'boolean',
|
||||
\type(v:null): 'nil',
|
||||
\}
|
||||
|
||||
""
|
||||
@ -379,7 +381,7 @@ endfunction
|
||||
""
|
||||
" Dump boolean value.
|
||||
function s:msgpack_dump_boolean(v) abort
|
||||
return a:v._VAL ? 'TRUE' : 'FALSE'
|
||||
return (a:v is v:true || (a:v isnot v:false && a:v._VAL)) ? 'TRUE' : 'FALSE'
|
||||
endfunction
|
||||
|
||||
""
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@
|
||||
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
|
||||
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" URL: https://github.com/shawncplus/phpcomplete.vim
|
||||
" Last Change: 2015 Apr 02
|
||||
" Last Change: 2015 Jul 13
|
||||
"
|
||||
" OPTIONS:
|
||||
"
|
||||
@ -318,7 +318,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
||||
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
|
||||
if f_name =~? '^'.substitute(a:base, '\\', '\\\\', 'g')
|
||||
let f_args = matchstr(i,
|
||||
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|$\)')
|
||||
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|$\)')
|
||||
let int_functions[f_name.'('] = f_args.')'
|
||||
endif
|
||||
endfor
|
||||
@ -646,7 +646,7 @@ function! phpcomplete#CompleteUnknownClass(base, context) " {{{
|
||||
let f_name = matchstr(i,
|
||||
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
|
||||
let f_args = matchstr(i,
|
||||
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|$\)')
|
||||
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|$\)')
|
||||
|
||||
let int_functions[f_name.'('] = f_args.')'
|
||||
endfor
|
||||
@ -981,7 +981,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
|
||||
let f_name = matchstr(i,
|
||||
\ 'function\s*&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
|
||||
let f_args = matchstr(i,
|
||||
\ 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|\_$\)')
|
||||
\ 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|\_$\)')
|
||||
if f_name != '' && stridx(f_name, '__') != 0
|
||||
let c_functions[f_name.'('] = f_args
|
||||
if g:phpcomplete_parse_docblock_comments
|
||||
@ -1379,8 +1379,8 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
|
||||
" Get Structured information of all classes and subclasses including namespace and includes
|
||||
" try to find the method's return type in docblock comment
|
||||
for classstructure in classcontents
|
||||
let doclock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method
|
||||
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), doclock_target_pattern)
|
||||
let docblock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method
|
||||
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern)
|
||||
if doc_str != ''
|
||||
break
|
||||
endif
|
||||
@ -1659,7 +1659,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
|
||||
" function declaration line
|
||||
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*('
|
||||
let function_lines = join(reverse(lines), " ")
|
||||
let function_lines = join(reverse(copy(lines)), " ")
|
||||
" search for type hinted arguments
|
||||
if function_lines =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array
|
||||
let f_args = matchstr(function_lines, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)')
|
||||
@ -1700,10 +1700,12 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
|
||||
" try to find the next non-comment or string ";" char
|
||||
let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s\+\(clone\)\?\s*'.variable_name_pattern)
|
||||
let filelines = reverse(lines)
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
|
||||
let filelines = reverse(copy(lines))
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [len(filelines) - i, start_col])
|
||||
let chars_read = 1
|
||||
let last_pos = pos
|
||||
" function_boundary == 0 if we are not in a function
|
||||
let real_lines_offset = len(function_boundary) == 1 ? 1 : function_boundary[0][0]
|
||||
" read while end of the file
|
||||
while char != 'EOF' && chars_read < 1000
|
||||
let last_pos = pos
|
||||
@ -1711,7 +1713,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let chars_read += 1
|
||||
" we got a candidate
|
||||
if char == ';'
|
||||
let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name')
|
||||
" pos values is relative to the function's lines,
|
||||
" line 0 need to be offsetted with the line number
|
||||
" where te function was started to get the line number
|
||||
" in real buffer terms
|
||||
let synIDName = synIDattr(synID(real_lines_offset + pos[0], pos[1] + 1, 0), 'name')
|
||||
" it's not a comment or string, end search
|
||||
if synIDName !~? 'comment\|string'
|
||||
break
|
||||
@ -1719,7 +1725,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
endif
|
||||
endwhile
|
||||
|
||||
let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin)
|
||||
let prev_context = phpcomplete#GetCurrentInstruction(real_lines_offset + last_pos[0], last_pos[1], b:phpbegin)
|
||||
if prev_context == ''
|
||||
" cannot get previous context give up
|
||||
return
|
||||
@ -1739,13 +1745,14 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
|
||||
" assignment for the variable in question with a function on the right hand side
|
||||
if line =~# '^\s*'.object.'\s*=&\?\s*'.function_invocation_pattern
|
||||
|
||||
" try to find the next non-comment or string ";" char
|
||||
let start_col = match(line, '\C^\s*'.object.'\s*=\zs&\?\s*'.function_invocation_pattern)
|
||||
let filelines = reverse(lines)
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
|
||||
let filelines = reverse(copy(lines))
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [len(filelines) - i, start_col])
|
||||
let chars_read = 1
|
||||
let last_pos = pos
|
||||
" function_boundary == 0 if we are not in a function
|
||||
let real_lines_offset = len(function_boundary) == 1 ? 1 : function_boundary[0][0]
|
||||
" read while end of the file
|
||||
while char != 'EOF' && chars_read < 1000
|
||||
let last_pos = pos
|
||||
@ -1753,7 +1760,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let chars_read += 1
|
||||
" we got a candidate
|
||||
if char == ';'
|
||||
let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name')
|
||||
" pos values is relative to the function's lines,
|
||||
" line 0 need to be offsetted with the line number
|
||||
" where te function was started to get the line number
|
||||
" in real buffer terms
|
||||
let synIDName = synIDattr(synID(real_lines_offset + pos[0], pos[1] + 1, 0), 'name')
|
||||
" it's not a comment or string, end search
|
||||
if synIDName !~? 'comment\|string'
|
||||
break
|
||||
@ -1761,7 +1772,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
endif
|
||||
endwhile
|
||||
|
||||
let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin)
|
||||
let prev_context = phpcomplete#GetCurrentInstruction(real_lines_offset + last_pos[0], last_pos[1], b:phpbegin)
|
||||
if prev_context == ''
|
||||
" cannot get previous context give up
|
||||
return
|
||||
@ -1864,6 +1875,9 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{
|
||||
if has_key(g:php_builtin_classes, tolower(a:classname)) && (a:namespace == '' || a:namespace == '\')
|
||||
return 'VIMPHP_BUILTINOBJECT'
|
||||
endif
|
||||
if has_key(g:php_builtin_interfaces, tolower(a:classname)) && (a:namespace == '' || a:namespace == '\')
|
||||
return 'VIMPHP_BUILTINOBJECT'
|
||||
endif
|
||||
|
||||
if a:namespace == '' || a:namespace == '\'
|
||||
let search_namespace = '\'
|
||||
@ -1876,7 +1890,7 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{
|
||||
let i = 1
|
||||
while i < line('.')
|
||||
let line = getline(line('.')-i)
|
||||
if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*\(class\|interface\|trait\)\s*'.a:classname.'\(\s\+\|$\)' && tolower(current_namespace) == search_namespace
|
||||
if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*\(class\|interface\|trait\)\s*'.a:classname.'\(\s\+\|$\|{\)' && tolower(current_namespace) == search_namespace
|
||||
return expand('%:p')
|
||||
else
|
||||
let i += 1
|
||||
@ -2048,9 +2062,18 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
let content = join(getline(cfline, endline), "\n")
|
||||
" Catch extends
|
||||
if content =~? 'extends'
|
||||
let extends_class = matchstr(content, 'class\_s\+'.a:class_name.'\_s\+extends\_s\+\zs'.class_name_pattern.'\ze')
|
||||
let extends_string = matchstr(content, '\(class\|interface\)\_s\+'.a:class_name.'\_.\+extends\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze\(extends\|{\)')
|
||||
let extended_classes = map(split(extends_string, '\(,\|\_s\)\+'), 'substitute(v:val, "\\_s\\+", "", "g")')
|
||||
else
|
||||
let extends_class = ''
|
||||
let extended_classes = ''
|
||||
endif
|
||||
|
||||
" Catch implements
|
||||
if content =~? 'implements'
|
||||
let implements_string = matchstr(content, 'class\_s\+'.a:class_name.'\_.\+implements\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze')
|
||||
let implemented_interfaces = map(split(implements_string, '\(,\|\_s\)\+'), 'substitute(v:val, "\\_s\\+", "", "g")')
|
||||
else
|
||||
let implemented_interfaces = []
|
||||
endif
|
||||
call searchpair('{', '', '}', 'W')
|
||||
let class_closing_bracket_line = line('.')
|
||||
@ -2108,8 +2131,11 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
\ })
|
||||
|
||||
let all_extends = used_traits
|
||||
if extends_class != ''
|
||||
call add(all_extends, extends_class)
|
||||
if len(extended_classes) > 0
|
||||
call extend(all_extends, extended_classes)
|
||||
endif
|
||||
if len(implemented_interfaces) > 0
|
||||
call extend(all_extends, implemented_interfaces)
|
||||
endif
|
||||
if len(all_extends) > 0
|
||||
for class in all_extends
|
||||
@ -2119,11 +2145,16 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
endif
|
||||
let classlocation = phpcomplete#GetClassLocation(class, namespace)
|
||||
if classlocation == "VIMPHP_BUILTINOBJECT"
|
||||
let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(class)])]
|
||||
if has_key(g:php_builtin_classes, tolower(class))
|
||||
let result += [phpcomplete#GenerateBuiltinClassStub('class', g:php_builtin_classes[tolower(class)])]
|
||||
endif
|
||||
if has_key(g:php_builtin_interfaces, tolower(class))
|
||||
let result += [phpcomplete#GenerateBuiltinClassStub('interface', g:php_builtin_interfaces[tolower(class)])]
|
||||
endif
|
||||
elseif classlocation != '' && filereadable(classlocation)
|
||||
let full_file_path = fnamemodify(classlocation, ':p')
|
||||
let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), class)
|
||||
elseif tolower(current_namespace) == tolower(namespace)
|
||||
elseif tolower(current_namespace) == tolower(namespace) && match(join(a:file_lines, "\n"), '\c\(class\|interface\|trait\)\_s\+'.class.'\(\>\|$\)') != -1
|
||||
" try to find the declaration in the same file.
|
||||
let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, class)
|
||||
endif
|
||||
@ -2144,19 +2175,26 @@ function! phpcomplete#GetClassContents(classlocation, class_name) " {{{
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{
|
||||
let re = 'class '.a:class_info['name']." {"
|
||||
function! phpcomplete#GenerateBuiltinClassStub(type, class_info) " {{{
|
||||
let re = a:type.' '.a:class_info['name']." {"
|
||||
if has_key(a:class_info, 'constants')
|
||||
for [name, initializer] in items(a:class_info.constants)
|
||||
let re .= "\n\tconst ".name." = ".initializer.";"
|
||||
endfor
|
||||
endif
|
||||
if has_key(a:class_info, 'properties')
|
||||
for [name, info] in items(a:class_info.properties)
|
||||
let re .= "\n\t// @var $".name." ".info.type
|
||||
let re .= "\n\tpublic $".name.";"
|
||||
endfor
|
||||
endif
|
||||
if has_key(a:class_info, 'static_properties')
|
||||
for [name, info] in items(a:class_info.static_properties)
|
||||
let re .= "\n\t// @var ".name." ".info.type
|
||||
let re .= "\n\tpublic static ".name." = ".info.initializer.";"
|
||||
endfor
|
||||
endif
|
||||
if has_key(a:class_info, 'methods')
|
||||
for [name, info] in items(a:class_info.methods)
|
||||
if name =~ '^__'
|
||||
continue
|
||||
@ -2169,6 +2207,8 @@ function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{
|
||||
let re .= "\n\tpublic function ".name."(".info.signature."){"
|
||||
let re .= "\n\t}"
|
||||
endfor
|
||||
endif
|
||||
if has_key(a:class_info, 'static_methods')
|
||||
for [name, info] in items(a:class_info.static_methods)
|
||||
let re .= "\n\t/**"
|
||||
let re .= "\n\t * ".name
|
||||
@ -2178,9 +2218,10 @@ function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{
|
||||
let re .= "\n\tpublic static function ".name."(".info.signature."){"
|
||||
let re .= "\n\t}"
|
||||
endfor
|
||||
endif
|
||||
let re .= "\n}"
|
||||
|
||||
return { 'class': a:class_info['name'],
|
||||
return { a:type : a:class_info['name'],
|
||||
\ 'content': re,
|
||||
\ 'namespace': '',
|
||||
\ 'imports': {},
|
||||
@ -2204,8 +2245,11 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
|
||||
" start backward serch for the comment block
|
||||
while l != 0
|
||||
let line = a:sccontent[l]
|
||||
" if comment end found save line position and end search
|
||||
if line =~? '^\s*\*/'
|
||||
" if it's a one line docblock like comment and we can just return it right away
|
||||
if line =~? '^\s*\/\*\*.\+\*\/\s*$'
|
||||
return substitute(line, '\v^\s*(\/\*\*\s*)|(\s*\*\/)\s*$', '', 'g')
|
||||
"... or if comment end found save line position and end search
|
||||
elseif line =~? '^\s*\*/'
|
||||
let comment_end = l
|
||||
break
|
||||
" ... or the line doesn't blank (only whitespace or nothing) end search
|
||||
@ -2227,6 +2271,7 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
|
||||
endif
|
||||
let l -= 1
|
||||
endwhile
|
||||
|
||||
" no docblock comment start found
|
||||
if comment_start == -1
|
||||
return ''
|
||||
@ -2388,7 +2433,15 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
break
|
||||
endif
|
||||
let block_end_pos = searchpairpos('{', '', '}\|\%$', 'W', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
|
||||
silent! exec block_start_pos[0].','.block_end_pos[0].'d'
|
||||
|
||||
if block_end_pos != [0, 0]
|
||||
" end of the block found, just delete it
|
||||
silent! exec block_start_pos[0].','.block_end_pos[0].'d _'
|
||||
else
|
||||
" block pair not found, use block start as beginning and the end
|
||||
" of the buffer instead
|
||||
silent! exec block_start_pos[0].',$d _'
|
||||
endif
|
||||
endwhile
|
||||
normal! G
|
||||
|
||||
@ -2407,8 +2460,8 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
while i < file_length
|
||||
let line = file_lines[i]
|
||||
|
||||
if line =~? '^\s*namespace\s*'.namespace_name_pattern
|
||||
let current_namespace = matchstr(line, '\c^\s*namespace\s*\zs'.namespace_name_pattern.'\ze')
|
||||
if line =~? '^\(<?php\)\?\s*namespace\s*'.namespace_name_pattern
|
||||
let current_namespace = matchstr(line, '\c^\(<?php\)\?\s*namespace\s*\zs'.namespace_name_pattern.'\ze')
|
||||
break
|
||||
endif
|
||||
|
||||
@ -2571,7 +2624,7 @@ endfunction
|
||||
|
||||
function! phpcomplete#ExpandClassName(classname, current_namespace, imports) " {{{
|
||||
" if there's an imported class, just use that class's information
|
||||
if has_key(a:imports, a:classname) && (a:imports[a:classname].kind == 'c' || a:imports[a:classname].kind == 'i')
|
||||
if has_key(a:imports, a:classname) && (a:imports[a:classname].kind == 'c' || a:imports[a:classname].kind == 'i' || a:imports[a:classname].kind == 't')
|
||||
let namespace = has_key(a:imports[a:classname], 'namespace') ? a:imports[a:classname].namespace : ''
|
||||
return [a:imports[a:classname].name, namespace]
|
||||
endif
|
||||
|
@ -47,19 +47,28 @@ elseif exists('$DISPLAY') && executable('xclip')
|
||||
let s:paste['+'] = 'xclip -o -selection clipboard'
|
||||
let s:copy['*'] = 'xclip -quiet -i -selection primary'
|
||||
let s:paste['*'] = 'xclip -o -selection primary'
|
||||
elseif executable('lemonade')
|
||||
let s:copy['+'] = 'lemonade copy'
|
||||
let s:paste['+'] = 'lemonade paste'
|
||||
let s:copy['*'] = 'lemonade copy'
|
||||
let s:paste['*'] = 'lemonade paste'
|
||||
elseif executable('doitclient')
|
||||
let s:copy['+'] = 'doitclient wclip'
|
||||
let s:paste['+'] = 'doitclient wclip -r'
|
||||
let s:copy['*'] = s:copy['+']
|
||||
let s:paste['*'] = s:paste['+']
|
||||
else
|
||||
echom 'clipboard: No clipboard tool available. See :help nvim-clipboard'
|
||||
echom 'clipboard: No clipboard tool available. See :help clipboard'
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:clipboard = {}
|
||||
|
||||
function! s:clipboard.get(reg)
|
||||
let reg = a:reg == '"' ? '+' : a:reg
|
||||
if s:selections[reg].owner > 0
|
||||
return s:selections[reg].data
|
||||
if s:selections[a:reg].owner > 0
|
||||
return s:selections[a:reg].data
|
||||
end
|
||||
return s:try_cmd(s:paste[reg])
|
||||
return s:try_cmd(s:paste[a:reg])
|
||||
endfunction
|
||||
|
||||
function! s:clipboard.set(lines, regtype, reg)
|
||||
@ -84,6 +93,7 @@ function! s:clipboard.set(lines, regtype, reg)
|
||||
let selection.data = [a:lines, a:regtype]
|
||||
let argv = split(s:copy[a:reg], " ")
|
||||
let selection.detach = s:cache_enabled
|
||||
let selection.cwd = "/"
|
||||
let jobid = jobstart(argv, selection)
|
||||
if jobid <= 0
|
||||
echohl WarningMsg
|
||||
|
@ -1,5 +1,5 @@
|
||||
" The Python provider uses a Python host to emulate an environment for running
|
||||
" python-vim plugins. See ":help nvim-provider" for more information.
|
||||
" python-vim plugins. See ":help provider".
|
||||
"
|
||||
" Associating the plugin with the Python host is the first step because plugins
|
||||
" will be passed as command-line arguments
|
||||
|
@ -1,5 +1,5 @@
|
||||
" The Python3 provider uses a Python3 host to emulate an environment for running
|
||||
" python3 plugins. See ":help nvim-provider" for more information.
|
||||
" python3 plugins. See ":help provider".
|
||||
"
|
||||
" Associating the plugin with the Python3 host is the first step because
|
||||
" plugins will be passed as command-line arguments
|
||||
|
@ -5,11 +5,24 @@ endif
|
||||
|
||||
let s:loaded_pythonx_provider = 1
|
||||
|
||||
let s:stderr = {}
|
||||
let s:job_opts = {'rpc': v:true}
|
||||
|
||||
" TODO(bfredl): this logic is common and should be builtin
|
||||
function! s:job_opts.on_stderr(chan_id, data, event)
|
||||
let stderr = get(s:stderr, a:chan_id, [''])
|
||||
let last = remove(stderr, -1)
|
||||
let a:data[0] = last.a:data[0]
|
||||
call extend(stderr, a:data)
|
||||
let s:stderr[a:chan_id] = stderr
|
||||
endfunction
|
||||
|
||||
function! provider#pythonx#Require(host) abort
|
||||
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
|
||||
|
||||
" Python host arguments
|
||||
let args = ['-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
|
||||
let prog = (ver == '2' ? provider#python#Prog() : provider#python3#Prog())
|
||||
let args = [prog, '-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
|
||||
|
||||
" Collect registered Python plugins into args
|
||||
let python_plugins = remote#host#PluginsForHost(a:host.name)
|
||||
@ -18,14 +31,16 @@ function! provider#pythonx#Require(host) abort
|
||||
endfor
|
||||
|
||||
try
|
||||
let channel_id = rpcstart((ver == '2' ?
|
||||
\ provider#python#Prog() : provider#python3#Prog()), args)
|
||||
if rpcrequest(channel_id, 'poll') == 'ok'
|
||||
let channel_id = jobstart(args, s:job_opts)
|
||||
if rpcrequest(channel_id, 'poll') ==# 'ok'
|
||||
return channel_id
|
||||
endif
|
||||
catch
|
||||
echomsg v:throwpoint
|
||||
echomsg v:exception
|
||||
for row in get(s:stderr, channel_id, [])
|
||||
echomsg row
|
||||
endfor
|
||||
endtry
|
||||
throw remote#host#LoadErrorForHost(a:host.orig_name,
|
||||
\ '$NVIM_PYTHON_LOG_FILE')
|
||||
@ -70,7 +85,7 @@ endfunction
|
||||
|
||||
function! s:check_interpreter(prog, major_ver, skip) abort
|
||||
let prog_path = exepath(a:prog)
|
||||
if prog_path == ''
|
||||
if prog_path ==# ''
|
||||
return [0, a:prog . ' not found in search path or not executable.']
|
||||
endif
|
||||
|
||||
@ -83,8 +98,8 @@ function! s:check_interpreter(prog, major_ver, skip) abort
|
||||
" Try to load neovim module, and output Python version.
|
||||
" Return codes:
|
||||
" 0 Neovim module can be loaded.
|
||||
" 1 Something else went wrong.
|
||||
" 2 Neovim module cannot be loaded.
|
||||
" Otherwise something else went wrong (e.g. 1 or 127).
|
||||
let prog_ver = system([ a:prog , '-c' ,
|
||||
\ 'import sys; ' .
|
||||
\ 'sys.path.remove(""); ' .
|
||||
@ -93,7 +108,8 @@ function! s:check_interpreter(prog, major_ver, skip) abort
|
||||
\ 'exit(2*int(pkgutil.get_loader("neovim") is None))'
|
||||
\ ])
|
||||
|
||||
if prog_ver
|
||||
if v:shell_error == 2 || v:shell_error == 0
|
||||
" Check version only for expected return codes.
|
||||
if prog_ver !~ '^' . a:major_ver
|
||||
return [0, prog_path . ' is Python ' . prog_ver . ' and cannot provide Python '
|
||||
\ . a:major_ver . '.']
|
||||
@ -103,12 +119,16 @@ function! s:check_interpreter(prog, major_ver, skip) abort
|
||||
endif
|
||||
endif
|
||||
|
||||
if v:shell_error == 1
|
||||
if v:shell_error == 2
|
||||
return [0, prog_path . ' does not have the neovim module installed. '
|
||||
\ . 'See ":help provider-python".']
|
||||
elseif v:shell_error == 127
|
||||
" This can happen with pyenv's shims.
|
||||
return [0, prog_path . ' does not exist: ' . prog_ver]
|
||||
elseif v:shell_error
|
||||
return [0, 'Checking ' . prog_path . ' caused an unknown error. '
|
||||
\ . '(' . v:shell_error . ', output: ' . prog_ver . ')'
|
||||
\ . ' Please report this at github.com/neovim/neovim.']
|
||||
elseif v:shell_error == 2
|
||||
return [0, prog_path . ' does have not have the neovim module installed. '
|
||||
\ . 'See ":help nvim-python".']
|
||||
endif
|
||||
|
||||
return [1, '']
|
||||
|
@ -1,13 +1,30 @@
|
||||
" The Ruby provider helper
|
||||
if exists('s:loaded_ruby_provider')
|
||||
if exists('g:loaded_ruby_provider')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_ruby_provider = 1
|
||||
|
||||
let s:loaded_ruby_provider = 1
|
||||
let s:stderr = {}
|
||||
let s:job_opts = {'rpc': v:true}
|
||||
|
||||
function! s:job_opts.on_stderr(chan_id, data, event)
|
||||
let stderr = get(s:stderr, a:chan_id, [''])
|
||||
let last = remove(stderr, -1)
|
||||
let a:data[0] = last.a:data[0]
|
||||
call extend(stderr, a:data)
|
||||
let s:stderr[a:chan_id] = stderr
|
||||
endfunction
|
||||
|
||||
function! provider#ruby#Detect() abort
|
||||
return exepath('neovim-ruby-host')
|
||||
endfunction
|
||||
|
||||
function! provider#ruby#Prog()
|
||||
return s:prog
|
||||
endfunction
|
||||
|
||||
function! provider#ruby#Require(host) abort
|
||||
" Collect registered Ruby plugins into args
|
||||
let args = []
|
||||
let args = [provider#ruby#Prog()]
|
||||
let ruby_plugins = remote#host#PluginsForHost(a:host.name)
|
||||
|
||||
for plugin in ruby_plugins
|
||||
@ -15,20 +32,47 @@ function! provider#ruby#Require(host) abort
|
||||
endfor
|
||||
|
||||
try
|
||||
let channel_id = rpcstart(provider#ruby#Prog(), args)
|
||||
|
||||
if rpcrequest(channel_id, 'poll') == 'ok'
|
||||
let channel_id = jobstart(args, s:job_opts)
|
||||
if rpcrequest(channel_id, 'poll') ==# 'ok'
|
||||
return channel_id
|
||||
endif
|
||||
catch
|
||||
echomsg v:throwpoint
|
||||
echomsg v:exception
|
||||
for row in get(s:stderr, channel_id, [])
|
||||
echomsg row
|
||||
endfor
|
||||
endtry
|
||||
|
||||
throw remote#host#LoadErrorForHost(a:host.orig_name,
|
||||
\ '$NVIM_RUBY_LOG_FILE')
|
||||
throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_RUBY_LOG_FILE')
|
||||
endfunction
|
||||
|
||||
function! provider#ruby#Prog() abort
|
||||
return 'neovim-ruby-host'
|
||||
function! provider#ruby#Call(method, args)
|
||||
if s:err != ''
|
||||
echoerr s:err
|
||||
return
|
||||
endif
|
||||
|
||||
if !exists('s:host')
|
||||
try
|
||||
let s:host = remote#host#Require('legacy-ruby-provider')
|
||||
catch
|
||||
let s:err = v:exception
|
||||
echohl WarningMsg
|
||||
echomsg v:exception
|
||||
echohl None
|
||||
return
|
||||
endtry
|
||||
endif
|
||||
return call('rpcrequest', insert(insert(a:args, 'ruby_'.a:method), s:host))
|
||||
endfunction
|
||||
|
||||
let s:err = ''
|
||||
let s:prog = provider#ruby#Detect()
|
||||
let s:plugin_path = expand('<sfile>:p:h') . '/script_host.rb'
|
||||
|
||||
if empty(s:prog)
|
||||
let s:err = 'Cannot find the neovim RubyGem. Try :CheckHealth'
|
||||
endif
|
||||
|
||||
call remote#host#RegisterClone('legacy-ruby-provider', 'ruby')
|
||||
call remote#host#RegisterPlugin('legacy-ruby-provider', s:plugin_path, [])
|
||||
|
8
runtime/autoload/provider/script_host.rb
Normal file
8
runtime/autoload/provider/script_host.rb
Normal file
@ -0,0 +1,8 @@
|
||||
begin
|
||||
require "neovim/ruby_provider"
|
||||
rescue LoadError
|
||||
warn(
|
||||
"Your neovim RubyGem is missing or out of date. " +
|
||||
"Install the latest version using `gem install neovim`."
|
||||
)
|
||||
end
|
@ -1,7 +1,7 @@
|
||||
"python3complete.vim - Omni Completion for python
|
||||
" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
|
||||
" Version: 0.9
|
||||
" Last Updated: 18 Jun 2009
|
||||
" Last Updated: 18 Jun 2009 (small fix 2015 Sep 14 from Debian)
|
||||
"
|
||||
" Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim
|
||||
"
|
||||
@ -359,6 +359,7 @@ class PyParser:
|
||||
def __init__(self):
|
||||
self.top = Scope('global',0)
|
||||
self.scope = self.top
|
||||
self.parserline = 0
|
||||
|
||||
def _parsedotname(self,pre=None):
|
||||
#returns (dottedname, nexttoken)
|
||||
|
@ -377,6 +377,7 @@ class PyParser:
|
||||
def __init__(self):
|
||||
self.top = Scope('global',0)
|
||||
self.scope = self.top
|
||||
self.parserline = 0
|
||||
|
||||
def _parsedotname(self,pre=None):
|
||||
#returns (dottedname, nexttoken)
|
||||
|
@ -30,7 +30,7 @@ function! remote#define#CommandOnHost(host, method, sync, name, opts)
|
||||
exe s:GetCommandPrefix(a:name, a:opts)
|
||||
\ .' call remote#define#CommandBootstrap("'.a:host.'"'
|
||||
\ . ', "'.a:method.'"'
|
||||
\ . ', "'.a:sync.'"'
|
||||
\ . ', '.string(a:sync)
|
||||
\ . ', "'.a:name.'"'
|
||||
\ . ', '.string(a:opts).''
|
||||
\ . ', "'.join(forward_args, '').'"'
|
||||
@ -94,7 +94,7 @@ function! remote#define#AutocmdOnHost(host, method, sync, name, opts)
|
||||
let bootstrap_def = s:GetAutocmdPrefix(a:name, a:opts)
|
||||
\ .' call remote#define#AutocmdBootstrap("'.a:host.'"'
|
||||
\ . ', "'.a:method.'"'
|
||||
\ . ', "'.a:sync.'"'
|
||||
\ . ', '.string(a:sync)
|
||||
\ . ', "'.a:name.'"'
|
||||
\ . ', '.string(a:opts).''
|
||||
\ . ', "'.escape(forward, '"').'"'
|
||||
@ -133,7 +133,7 @@ function! remote#define#FunctionOnHost(host, method, sync, name, opts)
|
||||
exe 'autocmd! '.group.' FuncUndefined '.a:name
|
||||
\ .' call remote#define#FunctionBootstrap("'.a:host.'"'
|
||||
\ . ', "'.a:method.'"'
|
||||
\ . ', "'.a:sync.'"'
|
||||
\ . ', '.string(a:sync)
|
||||
\ . ', "'.a:name.'"'
|
||||
\ . ', '.string(a:opts)
|
||||
\ . ', "'.group.'"'
|
||||
@ -157,6 +157,9 @@ endfunction
|
||||
|
||||
function! remote#define#FunctionOnChannel(channel, method, sync, name, opts)
|
||||
let rpcargs = [a:channel, '"'.a:method.'"', 'a:000']
|
||||
if has_key(a:opts, 'range')
|
||||
call add(rpcargs, '[a:firstline, a:lastline]')
|
||||
endif
|
||||
call s:AddEval(rpcargs, a:opts)
|
||||
|
||||
let function_def = s:GetFunctionPrefix(a:name, a:opts)
|
||||
@ -218,7 +221,11 @@ endfunction
|
||||
|
||||
|
||||
function! s:GetFunctionPrefix(name, opts)
|
||||
return "function! ".a:name."(...)\n"
|
||||
let res = "function! ".a:name."(...)"
|
||||
if has_key(a:opts, 'range')
|
||||
let res = res." range"
|
||||
endif
|
||||
return res."\n"
|
||||
endfunction
|
||||
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
let s:hosts = {}
|
||||
let s:plugin_patterns = {}
|
||||
let s:remote_plugins_manifest = fnamemodify(expand($MYVIMRC, 1), ':h')
|
||||
\.'/.'.fnamemodify($MYVIMRC, ':t').'-rplugin~'
|
||||
let s:plugins_for_host = {}
|
||||
|
||||
|
||||
@ -120,9 +118,59 @@ function! remote#host#RegisterPlugin(host, path, specs) abort
|
||||
endfunction
|
||||
|
||||
|
||||
" Get the path to the rplugin manifest file.
|
||||
function! s:GetManifestPath() abort
|
||||
let manifest_base = ''
|
||||
|
||||
if exists('$NVIM_RPLUGIN_MANIFEST')
|
||||
return fnamemodify($NVIM_RPLUGIN_MANIFEST, ':p')
|
||||
endif
|
||||
|
||||
let dest = has('win32') ? '$LOCALAPPDATA' : '$XDG_DATA_HOME'
|
||||
if !exists(dest)
|
||||
let dest = has('win32') ? '~/AppData/Local' : '~/.local/share'
|
||||
endif
|
||||
|
||||
let dest = fnamemodify(expand(dest), ':p')
|
||||
if !empty(dest) && !filereadable(dest)
|
||||
let dest .= ('/' ==# dest[-1:] ? '' : '/') . 'nvim'
|
||||
call mkdir(dest, 'p', 0700)
|
||||
let manifest_base = dest
|
||||
endif
|
||||
|
||||
return manifest_base.'/rplugin.vim'
|
||||
endfunction
|
||||
|
||||
|
||||
" Old manifest file based on known script locations.
|
||||
function! s:GetOldManifestPath() abort
|
||||
let prefix = exists('$MYVIMRC')
|
||||
\ ? $MYVIMRC
|
||||
\ : matchstr(get(split(execute('scriptnames'), '\n'), 0, ''), '\f\+$')
|
||||
return fnamemodify(expand(prefix, 1), ':h')
|
||||
\.'/.'.fnamemodify(prefix, ':t').'-rplugin~'
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:GetManifest() abort
|
||||
let manifest = s:GetManifestPath()
|
||||
|
||||
if !filereadable(manifest)
|
||||
" Check if an old manifest file exists and move it to the new location.
|
||||
let old_manifest = s:GetOldManifestPath()
|
||||
if filereadable(old_manifest)
|
||||
call rename(old_manifest, manifest)
|
||||
endif
|
||||
endif
|
||||
|
||||
return manifest
|
||||
endfunction
|
||||
|
||||
|
||||
function! remote#host#LoadRemotePlugins() abort
|
||||
if filereadable(s:remote_plugins_manifest)
|
||||
exe 'source '.s:remote_plugins_manifest
|
||||
let manifest = s:GetManifest()
|
||||
if filereadable(manifest)
|
||||
execute 'source' fnameescape(manifest)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@ -130,7 +178,9 @@ endfunction
|
||||
function! remote#host#LoadRemotePluginsEvent(event, pattern) abort
|
||||
autocmd! nvim-rplugin
|
||||
call remote#host#LoadRemotePlugins()
|
||||
execute 'silent doautocmd' a:event a:pattern
|
||||
if exists('#'.a:event.'#'.a:pattern) " Avoid 'No matching autocommands'.
|
||||
execute 'silent doautocmd <nomodeline>' a:event a:pattern
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
@ -140,6 +190,7 @@ function! s:RegistrationCommands(host) abort
|
||||
call remote#host#RegisterClone(host_id, a:host)
|
||||
let pattern = s:plugin_patterns[a:host]
|
||||
let paths = globpath(&rtp, 'rplugin/'.a:host.'/'.pattern, 0, 1)
|
||||
let paths = map(paths, 'tr(v:val,"\\","/")') " Normalize slashes #4795
|
||||
if empty(paths)
|
||||
return []
|
||||
endif
|
||||
@ -193,9 +244,9 @@ function! remote#host#UpdateRemotePlugins() abort
|
||||
endtry
|
||||
endif
|
||||
endfor
|
||||
call writefile(commands, s:remote_plugins_manifest)
|
||||
echomsg printf('remote/host: generated the manifest file in "%s"',
|
||||
\ s:remote_plugins_manifest)
|
||||
call writefile(commands, s:GetManifest())
|
||||
echomsg printf('remote/host: generated rplugin manifest: %s',
|
||||
\ s:GetManifest())
|
||||
endfunction
|
||||
|
||||
|
||||
@ -212,9 +263,8 @@ function! remote#host#LoadErrorForHost(host, log) abort
|
||||
\ 'You can try to see what happened '.
|
||||
\ 'by starting Neovim with the environment variable '.
|
||||
\ a:log . ' set to a file and opening the generated '.
|
||||
\ 'log file. Also, the host stderr will be available '.
|
||||
\ 'in Neovim log, so it may contain useful information. '.
|
||||
\ 'See also ~/.nvimlog.'
|
||||
\ 'log file. Also, the host stderr is available '.
|
||||
\ 'in messages.'
|
||||
endfunction
|
||||
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
" Vim script to download a missing spell file
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2012 Jan 08
|
||||
|
||||
if !exists('g:spellfile_URL')
|
||||
" Prefer using http:// when netrw should be able to use it, since
|
||||
@ -43,22 +41,23 @@ function! spellfile#LoadFile(lang)
|
||||
if len(dirlist) == 0
|
||||
let dir_to_create = spellfile#WritableSpellDir()
|
||||
if &verbose || dir_to_create != ''
|
||||
echomsg 'spellfile#LoadFile(): There is no writable spell directory.'
|
||||
echomsg 'spellfile#LoadFile(): No (writable) spell directory found.'
|
||||
endif
|
||||
if dir_to_create != ''
|
||||
if confirm("Shall I create " . dir_to_create, "&Yes\n&No", 2) == 1
|
||||
" After creating the directory it should show up in the list.
|
||||
call mkdir(dir_to_create, "p")
|
||||
" Now it should show up in the list.
|
||||
let [dirlist, dirchoices] = spellfile#GetDirChoices()
|
||||
endif
|
||||
endif
|
||||
if len(dirlist) == 0
|
||||
echomsg 'Failed to create: '.dir_to_create
|
||||
return
|
||||
else
|
||||
echomsg 'Created '.dir_to_create
|
||||
endif
|
||||
endif
|
||||
|
||||
let msg = 'Cannot find spell file for "' . a:lang . '" in ' . &enc
|
||||
let msg .= "\nDo you want me to try downloading it?"
|
||||
let msg = 'No spell file for "' . a:lang . '" in ' . &enc
|
||||
let msg .= "\nDownload it?"
|
||||
if confirm(msg, "&Yes\n&No", 2) == 1
|
||||
let enc = &encoding
|
||||
if enc == 'iso-8859-15'
|
||||
@ -90,7 +89,7 @@ function! spellfile#LoadFile(lang)
|
||||
endif
|
||||
if newbufnr == winbufnr(0)
|
||||
" We are back the old buffer, remove any (half-finished) download.
|
||||
g/^/d
|
||||
g/^/d_
|
||||
else
|
||||
let newbufnr = winbufnr(0)
|
||||
endif
|
||||
@ -99,21 +98,25 @@ function! spellfile#LoadFile(lang)
|
||||
echo 'Could not find it, trying ' . fname . '...'
|
||||
call spellfile#Nread(fname)
|
||||
if getline(2) !~ 'VIMspell'
|
||||
echo 'Sorry, downloading failed'
|
||||
echo 'Download failed'
|
||||
exe newbufnr . "bwipe!"
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
" Delete the empty first line and mark the file unmodified.
|
||||
1d
|
||||
1d_
|
||||
set nomod
|
||||
|
||||
if len(dirlist) == 1
|
||||
let dirchoice = 0
|
||||
else
|
||||
let msg = "In which directory do you want to write the file:"
|
||||
for i in range(len(dirlist))
|
||||
let msg .= "\n" . (i + 1) . '. ' . dirlist[i]
|
||||
endfor
|
||||
let dirchoice = confirm(msg, dirchoices) - 2
|
||||
endif
|
||||
if dirchoice >= 0
|
||||
if exists('*fnameescape')
|
||||
let dirname = fnameescape(dirlist[dirchoice])
|
||||
@ -123,21 +126,17 @@ function! spellfile#LoadFile(lang)
|
||||
setlocal fenc=
|
||||
exe "write " . dirname . '/' . fname
|
||||
|
||||
" Also download the .sug file, if the user wants to.
|
||||
let msg = "Do you want me to try getting the .sug file?\n"
|
||||
let msg .= "This will improve making suggestions for spelling mistakes,\n"
|
||||
let msg .= "but it uses quite a bit of memory."
|
||||
if confirm(msg, "&No\n&Yes") == 2
|
||||
g/^/d
|
||||
" Also download the .sug file.
|
||||
g/^/d_
|
||||
let fname = substitute(fname, '\.spl$', '.sug', '')
|
||||
echo 'Downloading ' . fname . '...'
|
||||
call spellfile#Nread(fname)
|
||||
if getline(2) =~ 'VIMsug'
|
||||
1d
|
||||
1d_
|
||||
exe "write " . dirname . '/' . fname
|
||||
set nomod
|
||||
else
|
||||
echo 'Sorry, downloading failed'
|
||||
echo 'Download failed'
|
||||
" Go back to our own buffer/window, Nread() may have taken us to
|
||||
" another window.
|
||||
if newbufnr != winbufnr(0)
|
||||
@ -151,7 +150,6 @@ function! spellfile#LoadFile(lang)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" Wipe out the buffer we used.
|
||||
exe newbufnr . "bwipe"
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim OMNI completion script for SQL
|
||||
" Language: SQL
|
||||
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||
" Version: 15.0
|
||||
" Last Change: 2013 May 13
|
||||
" Version: 16.0
|
||||
" Last Change: 2015 Dec 29
|
||||
" Homepage: http://www.vim.org/scripts/script.php?script_id=1572
|
||||
" Usage: For detailed help
|
||||
" ":help sql.txt"
|
||||
@ -16,6 +16,12 @@
|
||||
" look backwards to a FROM clause and find the first table
|
||||
" and complete it.
|
||||
"
|
||||
" Version 16.0 (Dec 2015)
|
||||
" - NF: If reseting the cache and table, procedure or view completion
|
||||
" had been used via dbext, have dbext delete or recreate the
|
||||
" dictionary so that new objects are picked up for the
|
||||
" next completion.
|
||||
"
|
||||
" Version 15.0 (May 2013)
|
||||
" - NF: Changed the SQL precached syntax items, omni_sql_precache_syntax_groups,
|
||||
" to use regular expressions to pick up extended syntax group names.
|
||||
@ -103,7 +109,7 @@ endif
|
||||
if exists('g:loaded_sql_completion')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_sql_completion = 150
|
||||
let g:loaded_sql_completion = 160
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
@ -459,6 +465,29 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
let s:tbl_cols = []
|
||||
let s:syn_list = []
|
||||
let s:syn_value = []
|
||||
|
||||
if s:sql_file_table != ""
|
||||
if g:loaded_dbext >= 2300
|
||||
call DB_DictionaryDelete("table")
|
||||
else
|
||||
DBCompleteTables!
|
||||
endif
|
||||
endif
|
||||
if s:sql_file_procedure != ""
|
||||
if g:loaded_dbext >= 2300
|
||||
call DB_DictionaryDelete("procedure")
|
||||
else
|
||||
DBCompleteProcedures!
|
||||
endif
|
||||
endif
|
||||
if s:sql_file_view != ""
|
||||
if g:loaded_dbext >= 2300
|
||||
call DB_DictionaryDelete("view")
|
||||
else
|
||||
DBCompleteViews!
|
||||
endif
|
||||
endif
|
||||
|
||||
let s:sql_file_table = ""
|
||||
let s:sql_file_procedure = ""
|
||||
let s:sql_file_view = ""
|
||||
|
@ -1,6 +1,6 @@
|
||||
" Vim autoload file for the tohtml plugin.
|
||||
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
|
||||
" Last Change: 2013 Jun 19
|
||||
" Last Change: 2013 Sep 03
|
||||
"
|
||||
" Additional contributors:
|
||||
"
|
||||
@ -302,7 +302,7 @@ func! tohtml#Convert2HTML(line1, line2) "{{{
|
||||
else "{{{
|
||||
let win_list = []
|
||||
let buf_list = []
|
||||
windo | if &diff | call add(win_list, winbufnr(0)) | endif
|
||||
windo if &diff | call add(win_list, winbufnr(0)) | endif
|
||||
let s:settings.whole_filler = 1
|
||||
let g:html_diff_win_num = 0
|
||||
for window in win_list
|
||||
|
@ -6,32 +6,14 @@
|
||||
|
||||
AWK = awk
|
||||
|
||||
# Set to $(VIMTARGET) when executed from src/Makefile.
|
||||
VIMEXE = vim
|
||||
|
||||
DOCS = $(wildcard *.txt)
|
||||
HTMLS = $(DOCS:.txt=.html)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .txt .html
|
||||
|
||||
all: tags html
|
||||
|
||||
# Use Vim to generate the tags file. Can only be used when Vim has been
|
||||
# compiled and installed. Supports multiple languages.
|
||||
vimtags: $(DOCS)
|
||||
$(VIMEXE) -u NONE -es -c "helptags ++t ." -c quit
|
||||
|
||||
# Use "doctags" to generate the tags file. Only works for English!
|
||||
tags: doctags $(DOCS)
|
||||
./doctags $(DOCS) | LANG=C LC_ALL=C sort >tags
|
||||
uniq -d -2 tags
|
||||
|
||||
doctags: doctags.c
|
||||
$(CC) doctags.c -o doctags
|
||||
|
||||
# Awk version of .txt to .html conversion.
|
||||
html: noerrors tags $(HTMLS)
|
||||
html: noerrors $(HTMLS)
|
||||
@if test -f errors.log; then cat errors.log; fi
|
||||
|
||||
noerrors:
|
||||
@ -54,5 +36,5 @@ tags.ref tags.html: tags
|
||||
$(AWK) -f maketags.awk tags >tags.html
|
||||
|
||||
clean:
|
||||
-rm -f doctags *.html tags.ref $(HTMLS) errors.log
|
||||
-rm -f *.html tags.ref $(HTMLS) errors.log
|
||||
|
||||
|
@ -1,31 +1,32 @@
|
||||
*api.txt* For Nvim. {Nvim}
|
||||
*api.txt* {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||
|
||||
The C API of Nvim *nvim-api*
|
||||
|
||||
1. Introduction |nvim-api-intro|
|
||||
2. API Types |nvim-api-types|
|
||||
3. API metadata |nvim-api-metadata|
|
||||
4. Buffer highlighting |nvim-api-highlights|
|
||||
C API for Nvim *API* *api*
|
||||
|
||||
1. Introduction |api-intro|
|
||||
2. API Types |api-types|
|
||||
3. API metadata |api-metadata|
|
||||
4. Buffer highlighting |api-highlights|
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *nvim-api-intro*
|
||||
1. Introduction *api-intro*
|
||||
|
||||
Nvim defines a C API as the primary way for external code to interact with
|
||||
the NVim core. In the present version of Nvim the API is primarily used by
|
||||
external processes to interact with Nvim using the msgpack-rpc protocol, see
|
||||
|msgpack-rpc|. The API will also be used from vimscript to access new Nvim core
|
||||
features, but this is not implemented yet. Later on, Nvim might be embeddable
|
||||
in C applications as libnvim, and the application will then control the
|
||||
embedded instance by calling the C API directly.
|
||||
Nvim exposes a public API for external code to interact with the Nvim core. In
|
||||
the present version of Nvim the API is primarily used by external processes to
|
||||
interact with Nvim using the msgpack-rpc protocol, see |msgpack-rpc|. The API
|
||||
will also be used from vimscript to access new Nvim core features, but this is
|
||||
not implemented yet. Later on, Nvim might be embeddable in C applications as
|
||||
libnvim, and the application will then control the embedded instance by
|
||||
calling the C API directly.
|
||||
|
||||
==============================================================================
|
||||
2. API Types *nvim-api-types*
|
||||
2. API Types *api-types*
|
||||
|
||||
Nvim's C API uses custom types for all functions. Some are just typedefs
|
||||
around C99 standard types, and some are Nvim defined data structures.
|
||||
around C99 standard types, and some are Nvim-defined data structures.
|
||||
|
||||
Boolean -> bool
|
||||
Integer (signed 64-bit integer) -> int64_t
|
||||
@ -46,7 +47,7 @@ Window -> enum value kObjectTypeWindow
|
||||
Tabpage -> enum value kObjectTypeTabpage
|
||||
|
||||
==============================================================================
|
||||
3. API metadata *nvim-api-metadata*
|
||||
3. API metadata *api-metadata*
|
||||
|
||||
Nvim exposes metadata about the API as a Dictionary with the following keys:
|
||||
|
||||
@ -54,11 +55,11 @@ functions calling signature of the API functions
|
||||
types The custom handle types defined by Nvim
|
||||
error_types The possible kinds of errors an API function can exit with.
|
||||
|
||||
This metadata is mostly useful for external programs accessing the api over
|
||||
msgpack-api, see |msgpack-rpc-api|.
|
||||
This metadata is mostly useful for external programs accessing the API via
|
||||
RPC, see |rpc-api|.
|
||||
|
||||
==============================================================================
|
||||
4. Buffer highlighting *nvim-api-highlights*
|
||||
4. Buffer highlighting *api-highlights*
|
||||
|
||||
Nvim allows plugins to add position-based highlights to buffers. This is
|
||||
similar to |matchaddpos()| but with some key differences. The added highlights
|
||||
|
@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 7.4. Last change: 2015 Mar 21
|
||||
*autocmd.txt* For Vim version 7.4. Last change: 2016 Mar 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -770,13 +770,15 @@ OptionSet After setting an option. The pattern is
|
||||
it's global or local scoped and |<amatch>|
|
||||
indicates what option has been set.
|
||||
|
||||
Note: It's a bad idea, to reset an option
|
||||
during this autocommand, since this will
|
||||
probably break plugins. You can always use
|
||||
|:noa| to prevent triggering this autocommand.
|
||||
Could be used, to check for existence of the
|
||||
'backupdir' and 'undodir' options and create
|
||||
directories, if they don't exist yet.
|
||||
Usage example: Check for the existence of the
|
||||
directory in the 'backupdir' and 'undodir'
|
||||
options, create the directory if it doesn't
|
||||
exist yet.
|
||||
|
||||
Note: It's a bad idea to reset an option
|
||||
during this autocommand, this may break a
|
||||
plugin. You can always use `:noa` to prevent
|
||||
triggering this autocommand.
|
||||
|
||||
*QuickFixCmdPre*
|
||||
QuickFixCmdPre Before a quickfix command is run (|:make|,
|
||||
@ -910,8 +912,7 @@ TermClose When a terminal buffer ends.
|
||||
{Nvim} *TermOpen*
|
||||
TermOpen When a terminal buffer is starting. This can
|
||||
be used to configure the terminal emulator by
|
||||
setting buffer variables.
|
||||
See |nvim-terminal-emulator| for details.
|
||||
setting buffer variables. |terminal-emulator|
|
||||
*TermResponse*
|
||||
TermResponse After the response to |t_RV| is received from
|
||||
the terminal. The value of |v:termresponse|
|
||||
@ -1100,7 +1101,7 @@ Instead of a pattern buffer-local autocommands use one of these forms:
|
||||
Examples: >
|
||||
:au CursorHold <buffer> echo 'hold'
|
||||
:au CursorHold <buffer=33> echo 'hold'
|
||||
:au CursorHold <buffer=abuf> echo 'hold'
|
||||
:au BufNewFile * au CursorHold <buffer=abuf> echo 'hold'
|
||||
|
||||
All the commands for autocommands also work with buffer-local autocommands,
|
||||
simply use the special string instead of the pattern. Examples: >
|
||||
@ -1159,6 +1160,9 @@ name!
|
||||
:aug[roup] {name} Define the autocmd group name for the
|
||||
following ":autocmd" commands. The name "end"
|
||||
or "END" selects the default group.
|
||||
To avoid confusion, the name should be
|
||||
different from existing {event} names, as this
|
||||
most likely will not do what you intended.
|
||||
|
||||
*:augroup-delete* *E367*
|
||||
:aug[roup]! {name} Delete the autocmd group {name}. Don't use
|
||||
|
@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 7.4. Last change: 2015 Jun 25
|
||||
*change.txt* For Vim version 7.4. Last change: 2016 Mar 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -97,10 +97,10 @@ These commands delete text. You can repeat them with the `.` command
|
||||
|
||||
An exception for the d{motion} command: If the motion is not linewise, the
|
||||
start and end of the motion are not in the same line, and there are only
|
||||
blanks before the start and after the end of the motion, the delete becomes
|
||||
linewise. This means that the delete also removes the line of blanks that you
|
||||
might expect to remain. Use the |o_v| operator to force the motion to be
|
||||
characterwise.
|
||||
blanks before the start and there are no non-blanks after the end of the
|
||||
motion, the delete becomes linewise. This means that the delete also removes
|
||||
the line of blanks that you might expect to remain. Use the |o_v| operator to
|
||||
force the motion to be characterwise.
|
||||
|
||||
Trying to delete an empty region of text (e.g., "d0" in the first column)
|
||||
is an error when 'cpoptions' includes the 'E' flag.
|
||||
@ -108,7 +108,9 @@ is an error when 'cpoptions' includes the 'E' flag.
|
||||
*J*
|
||||
J Join [count] lines, with a minimum of two lines.
|
||||
Remove the indent and insert up to two spaces (see
|
||||
below).
|
||||
below). Fails when on the last line of the buffer.
|
||||
If [count] is too big it is reduce to the number of
|
||||
lines available.
|
||||
|
||||
*v_J*
|
||||
{Visual}J Join the highlighted lines, with a minimum of two
|
||||
@ -396,6 +398,11 @@ CTRL-X Subtract [count] from the number or alphabetic
|
||||
{Visual}CTRL-X Subtract [count] from the number or alphabetic
|
||||
character in the highlighted text. {not in Vi}
|
||||
|
||||
On MS-Windows, this is mapped to cut Visual text
|
||||
|dos-standard-mappings|. If you want to disable the
|
||||
mapping, use this: >
|
||||
silent! vunmap <C-X>
|
||||
<
|
||||
*v_g_CTRL-X*
|
||||
{Visual}g CTRL-X Subtract [count] from the number or alphabetic
|
||||
character in the highlighted text. If several lines
|
||||
@ -423,7 +430,7 @@ This depends on the 'nrformats' option:
|
||||
index.
|
||||
|
||||
For decimals a leading negative sign is considered for incrementing or
|
||||
decrementing, for binary and octal and hex values, it won't be considered. To
|
||||
decrementing, for binary, octal and hex values, it won't be considered. To
|
||||
ignore the sign Visually select the number before using CTRL-A or CTRL-X.
|
||||
|
||||
For numbers with leading zeros (including all octal and hexadecimal numbers),
|
||||
@ -622,9 +629,9 @@ For MS-Windows: $TMP, $TEMP, $USERPROFILE, current-dir.
|
||||
may add [flags], see |:s_flags|.
|
||||
Note that after `:substitute` the '&' flag can't be
|
||||
used, it's recognized as a pattern separator.
|
||||
The space between `:substitute` and the 'c', 'g' and
|
||||
'r' flags isn't required, but in scripts it's a good
|
||||
idea to keep it to avoid confusion.
|
||||
The space between `:substitute` and the 'c', 'g',
|
||||
'i', 'I' and 'r' flags isn't required, but in scripts
|
||||
it's a good idea to keep it to avoid confusion.
|
||||
|
||||
:[range]~[&][flags] [count] *:~*
|
||||
Repeat last substitute with same substitute string
|
||||
@ -833,6 +840,36 @@ either the first or second pattern in parentheses did not match, so either
|
||||
:s/\([ab]\)\|\([cd]\)/\1x/g modifies "a b c d" to "ax bx x x"
|
||||
<
|
||||
|
||||
*:sc* *:sce* *:scg* *:sci* *:scI* *:scl* *:scp* *:sg* *:sgc*
|
||||
*:sge* *:sgi* *:sgI* *:sgl* *:sgn* *:sgp* *:sgr* *:sI* *:si*
|
||||
*:sic* *:sIc* *:sie* *:sIe* *:sIg* *:sIl* *:sin* *:sIn* *:sIp*
|
||||
*:sip* *:sIr* *:sir* *:sr* *:src* *:srg* *:sri* *:srI* *:srl*
|
||||
*:srn* *:srp*
|
||||
2-letter and 3-letter :substitute commands ~
|
||||
|
||||
List of :substitute commands
|
||||
| c e g i I n p l r
|
||||
| c :sc :sce :scg :sci :scI :scn :scp :scl ---
|
||||
| e
|
||||
| g :sgc :sge :sg :sgi :sgI :sgn :sgp :sgl :sgr
|
||||
| i :sic :sie --- :si :siI :sin :sip --- :sir
|
||||
| I :sIc :sIe :sIg :sIi :sI :sIn :sIp :sIl :sIr
|
||||
| n
|
||||
| p
|
||||
| l
|
||||
| r :src --- :srg :sri :srI :srn :srp :srl :sr
|
||||
|
||||
Exceptions:
|
||||
:scr is `:scriptnames`
|
||||
:se is `:set`
|
||||
:sig is `:sign`
|
||||
:sil is `:silent`
|
||||
:sn is `:snext`
|
||||
:sp is `:split`
|
||||
:sl is `:sleep`
|
||||
:sre is `:srewind`
|
||||
|
||||
|
||||
Substitute with an expression *sub-replace-expression*
|
||||
*sub-replace-\=* *s/\=*
|
||||
When the substitute string starts with "\=" the remainder is interpreted as an
|
||||
@ -936,7 +973,7 @@ inside of strings can change! Also see 'softtabstop' option. >
|
||||
|
||||
:reg[isters] {arg} Display the contents of the numbered and named
|
||||
registers that are mentioned in {arg}. For example: >
|
||||
:dis 1a
|
||||
:reg 1a
|
||||
< to display registers '1' and 'a'. Spaces are allowed
|
||||
in {arg}.
|
||||
|
||||
@ -1102,7 +1139,7 @@ Rationale: In Vi the "y" command followed by a backwards motion would
|
||||
With a linewise yank command the cursor is put in the first line, but the
|
||||
column is unmodified, thus it may not be on the first yanked character.
|
||||
|
||||
There are nine types of registers: *registers* *E354*
|
||||
There are ten types of registers: *registers* *E354*
|
||||
1. The unnamed register ""
|
||||
2. 10 numbered registers "0 to "9
|
||||
3. The small delete register "-
|
||||
@ -1215,7 +1252,7 @@ register.
|
||||
Use these registers for storing and retrieving the selected text for the GUI.
|
||||
See |quotestar| and |quoteplus|. When the clipboard is not available or not
|
||||
working, the unnamed register is used instead. For Unix systems and Mac OS X,
|
||||
see |nvim-clipboard|.
|
||||
see |primary-selection|.
|
||||
|
||||
9. Black hole register "_ *quote_*
|
||||
When writing to this register, nothing happens. This can be used to delete
|
||||
@ -1646,7 +1683,7 @@ Vim has a sorting function and a sorting command. The sorting function can be
|
||||
found here: |sort()|, |uniq()|.
|
||||
|
||||
*:sor* *:sort*
|
||||
:[range]sor[t][!] [i][u][r][n][x][o][b] [/{pattern}/]
|
||||
:[range]sor[t][!] [b][f][i][n][o][r][u][x] [/{pattern}/]
|
||||
Sort lines in [range]. When no range is given all
|
||||
lines are sorted.
|
||||
|
||||
@ -1654,10 +1691,18 @@ found here: |sort()|, |uniq()|.
|
||||
|
||||
With [i] case is ignored.
|
||||
|
||||
Options [n][f][x][o][b] are mutually exclusive.
|
||||
|
||||
With [n] sorting is done on the first decimal number
|
||||
in the line (after or inside a {pattern} match).
|
||||
One leading '-' is included in the number.
|
||||
|
||||
With [f] sorting is done on the Float in the line.
|
||||
The value of Float is determined similar to passing
|
||||
the text (after or inside a {pattern} match) to
|
||||
str2float() function. This option is available only
|
||||
if Vim was compiled with Floating point support.
|
||||
|
||||
With [x] sorting is done on the first hexadecimal
|
||||
number in the line (after or inside a {pattern}
|
||||
match). A leading "0x" or "0X" is ignored.
|
||||
@ -1669,10 +1714,10 @@ found here: |sort()|, |uniq()|.
|
||||
With [b] sorting is done on the first binary number in
|
||||
the line (after or inside a {pattern} match).
|
||||
|
||||
With [u] only keep the first of a sequence of
|
||||
identical lines (ignoring case when [i] is used).
|
||||
Without this flag, a sequence of identical lines
|
||||
will be kept in their original order.
|
||||
With [u] (u stands for unique) only keep the first of
|
||||
a sequence of identical lines (ignoring case when [i]
|
||||
is used). Without this flag, a sequence of identical
|
||||
lines will be kept in their original order.
|
||||
Note that leading and trailing white space may cause
|
||||
lines to be different.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 7.4. Last change: 2014 Sep 06
|
||||
*cmdline.txt* For Vim version 7.4. Last change: 2015 Dec 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -97,6 +97,11 @@ CTRL-E or <End> *c_CTRL-E* *c_<End>* *c_End*
|
||||
*c_<LeftMouse>*
|
||||
<LeftMouse> Move the cursor to the position of the mouse click.
|
||||
|
||||
*c_<MiddleMouse>*
|
||||
<MiddleMouse> Paste the contents of the clipboard (for X11 the primary
|
||||
selection). This is similar to using CTRL-R *, but no CR
|
||||
characters are inserted between lines.
|
||||
|
||||
CTRL-H *c_<BS>* *c_CTRL-H* *c_BS*
|
||||
<BS> Delete the character in front of the cursor.
|
||||
*c_<Del>* *c_Del*
|
||||
@ -565,6 +570,7 @@ starts editing the three files "foo bar", "goes to" and "school ".
|
||||
When you want to use the special characters '"' or '|' in a command, or want
|
||||
to use '%' or '#' in a file name, precede them with a backslash. The
|
||||
backslash is not required in a range and in the ":substitute" command.
|
||||
See also |`=|.
|
||||
|
||||
*:_!*
|
||||
The '!' (bang) character after an Ex command makes the command behave in a
|
||||
@ -714,13 +720,13 @@ to insert special things while typing you can use the CTRL-R command. For
|
||||
example, "%" stands for the current file name, while CTRL-R % inserts the
|
||||
current file name right away. See |c_CTRL-R|.
|
||||
|
||||
Note: If you want to avoid the special characters in a Vim script you may want
|
||||
to use |fnameescape()|.
|
||||
Note: If you want to avoid the effects of special characters in a Vim script
|
||||
you may want to use |fnameescape()|. Also see |`=|.
|
||||
|
||||
|
||||
In Ex commands, at places where a file name can be used, the following
|
||||
characters have a special meaning. These can also be used in the expression
|
||||
function expand() |expand()|.
|
||||
function |expand()|.
|
||||
% Is replaced with the current file name. *:_%* *c_%*
|
||||
# Is replaced with the alternate file name. *:_#* *c_#*
|
||||
This is remembered for every window.
|
||||
@ -755,6 +761,7 @@ it, no matter how many backslashes.
|
||||
# alternate.file
|
||||
\# #
|
||||
\\# \#
|
||||
Also see |`=|.
|
||||
|
||||
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
|
||||
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
|
||||
@ -777,12 +784,12 @@ Note: these are typed literally, they are not special keys!
|
||||
(for FileType, Syntax and SpellFileMissing events).
|
||||
<sfile> When executing a ":source" command, is replaced with the
|
||||
file name of the sourced file. *E498*
|
||||
When executing a function, is replaced with
|
||||
"function {function-name}"; function call nesting is
|
||||
indicated like this:
|
||||
"function {function-name1}..{function-name2}". Note that
|
||||
filename-modifiers are useless when <sfile> is used inside
|
||||
a function.
|
||||
When executing a function, is replaced with:
|
||||
"function {function-name}[{lnum}]"
|
||||
function call nesting is indicated like this:
|
||||
"function {function-name1}[{lnum}]..{function-name2}[{lnum}]"
|
||||
Note that filename-modifiers are useless when <sfile> is
|
||||
used inside a function.
|
||||
<slnum> When executing a ":source" command, is replaced with the
|
||||
line number. *E842*
|
||||
When executing a function it's the line number relative to
|
||||
@ -897,9 +904,8 @@ name). This is included for backwards compatibility with version 3.0, the
|
||||
|
||||
Note: Where a file name is expected wildcards expansion is done. On Unix the
|
||||
shell is used for this, unless it can be done internally (for speed).
|
||||
Backticks also work, like in >
|
||||
Unless in |restricted-mode|, backticks work also, like in >
|
||||
:n `echo *.c`
|
||||
(backtick expansion is not possible in |restricted-mode|)
|
||||
But expansion is only done if there are any wildcards before expanding the
|
||||
'%', '#', etc.. This avoids expanding wildcards inside a file name. If you
|
||||
want to expand the result of <cfile>, add a wildcard character to it.
|
||||
@ -910,6 +916,7 @@ Examples: (alternate file name is "?readme?")
|
||||
:e #.* :e {files matching "?readme?.*"}
|
||||
:cd <cfile> :cd {file name under cursor}
|
||||
:cd <cfile>* :cd {file name under cursor plus "*" and then expanded}
|
||||
Also see |`=|.
|
||||
|
||||
When the expanded argument contains a "!" and it is used for a shell command
|
||||
(":!cmd", ":r !cmd" or ":w !cmd"), the "!" is escaped with a backslash to
|
||||
@ -936,6 +943,8 @@ for the file "$home" in the root directory. A few examples:
|
||||
/\$home file "$home" in root directory
|
||||
\\$home file "\\", followed by expanded $home
|
||||
|
||||
Also see |`=|.
|
||||
|
||||
==============================================================================
|
||||
7. Command-line window *cmdline-window* *cmdwin*
|
||||
*command-line-window*
|
||||
|
@ -1,23 +1,19 @@
|
||||
*develop.txt* For Vim version 7.4. Last change: 2014 Mar 27
|
||||
*develop.txt*
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
NVIM REFERENCE MANUAL
|
||||
|
||||
|
||||
Development of Vim. *development*
|
||||
|
||||
This text is important for those who want to be involved in further developing
|
||||
Vim.
|
||||
Development of Nvim. *development*
|
||||
|
||||
1. Design goals |design-goals|
|
||||
2. Design decisions |design-decisions|
|
||||
|
||||
See the file "src/nvim/README.md" for a high-level overview of the source
|
||||
code.
|
||||
Nvim is open source software. Everybody is encouraged to contribute.
|
||||
https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md
|
||||
|
||||
Vim is open source software. Everybody is encouraged to contribute to help
|
||||
improving Vim. For sending patches a context diff "diff -c" is preferred.
|
||||
Also see http://vim.wikia.com/wiki/How_to_make_and_submit_a_patch.
|
||||
See src/nvim/README.md for a high-level overview of the source code:
|
||||
https://github.com/neovim/neovim/blob/master/src/nvim/README.md
|
||||
|
||||
==============================================================================
|
||||
1. Design goals *design-goals*
|
||||
@ -28,7 +24,7 @@ Note that quite a few items are contradicting. This is intentional. A
|
||||
balance must be found between them.
|
||||
|
||||
|
||||
VIM IS... IMPROVED *design-improved*
|
||||
NVIM IS... IMPROVED *design-improved*
|
||||
|
||||
The IMproved bits of Vim should make it a better Vi, without becoming a
|
||||
completely different editor. Extensions are done with a "Vi spirit".
|
||||
@ -49,7 +45,7 @@ completely different editor. Extensions are done with a "Vi spirit".
|
||||
implement and (3) someone actually implementing it.
|
||||
|
||||
|
||||
VIM IS... MULTI PLATFORM *design-multi-platform*
|
||||
NVIM IS... MULTI PLATFORM *design-multi-platform*
|
||||
|
||||
Vim tries to help as many users on as many platforms as possible.
|
||||
- Support many kinds of terminals. The minimal demands are cursor positioning
|
||||
@ -68,7 +64,7 @@ Vim tries to help as many users on as many platforms as possible.
|
||||
contradicts the previous item, these two must be balanced.]
|
||||
|
||||
|
||||
VIM IS... WELL DOCUMENTED *design-documented*
|
||||
NVIM IS... WELL DOCUMENTED *design-documented*
|
||||
|
||||
- A feature that isn't documented is a useless feature. A patch for a new
|
||||
feature must include the documentation.
|
||||
@ -76,9 +72,14 @@ VIM IS... WELL DOCUMENTED *design-documented*
|
||||
recommended.
|
||||
- Don't make the text unnecessarily long. Less documentation means that an
|
||||
item is easier to find.
|
||||
- Do not prefix doc-tags with "nvim-". Use |vim_diff.txt| to document
|
||||
differences from Vim. The {Nvim} annotation is also available
|
||||
to mark a specific feature. No other distinction is necessary.
|
||||
- If a feature is removed, delete its doc entry and move its tag to
|
||||
|vim_diff.txt|.
|
||||
|
||||
|
||||
VIM IS... HIGH SPEED AND SMALL IN SIZE *design-speed-size*
|
||||
NVIM IS... HIGH SPEED AND SMALL IN SIZE *design-speed-size*
|
||||
|
||||
Using Vim must not be a big attack on system resources. Keep it small and
|
||||
fast.
|
||||
@ -89,13 +90,11 @@ fast.
|
||||
possible. Useful commands may take longer.
|
||||
- Don't forget that some people use Vim over a slow connection. Minimize the
|
||||
communication overhead.
|
||||
- Items that add considerably to the size and are not used by many people
|
||||
should be a feature that can be disabled.
|
||||
- Vim is a component among other components. Don't turn it into a massive
|
||||
application, but have it work well together with other programs.
|
||||
|
||||
|
||||
VIM IS... MAINTAINABLE *design-maintain*
|
||||
NVIM IS... MAINTAINABLE *design-maintain*
|
||||
|
||||
- The source code should not become a mess. It should be reliable code.
|
||||
- Use comments in a useful way! Quoting the function name and argument names
|
||||
@ -106,7 +105,7 @@ VIM IS... MAINTAINABLE *design-maintain*
|
||||
knowledge spread to other parts of the code.
|
||||
|
||||
|
||||
VIM IS... FLEXIBLE *design-flexible*
|
||||
NVIM IS... FLEXIBLE *design-flexible*
|
||||
|
||||
Vim should make it easy for users to work in their preferred styles rather
|
||||
than coercing its users into particular patterns of work. This can be for
|
||||
@ -117,28 +116,22 @@ be used to adjust Vim to the desire of the user and its environment.
|
||||
|
||||
NVIM IS... NOT *design-not*
|
||||
|
||||
Nvim is not an Operating System; instead it should be composed with other
|
||||
tools, or hosted as a component. Marvim once said: "Unlike Emacs, Nvim does
|
||||
not attempt to include everything but the kitchen sink, but some people use it
|
||||
for plumbing."
|
||||
Nvim is not an operating system; instead it should be composed with other
|
||||
tools or hosted as a component. Marvim once said: "Unlike Emacs, Nvim does not
|
||||
include the kitchen sink... but you can use it for plumbing."
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. Design decisions *design-decisions*
|
||||
|
||||
Folding
|
||||
Jargon *dev-jargon*
|
||||
|
||||
Several forms of folding should be possible for the same buffer. For example,
|
||||
have one window that shows the text with function bodies folded, another
|
||||
window that shows a function body.
|
||||
|
||||
Folding is a way to display the text. It should not change the text itself.
|
||||
Therefore the folding has been implemented as a filter between the text stored
|
||||
in a buffer (buffer lines) and the text displayed in a window (logical lines).
|
||||
|
||||
|
||||
Naming the window
|
||||
Host ~
|
||||
A plugin "host" is both a client (of the Nvim API) and a server (of an
|
||||
external platform, e.g. python). It is a remote plugin that hosts other
|
||||
plugins.
|
||||
|
||||
Window ~
|
||||
The word "window" is commonly used for several things: A window on the screen,
|
||||
the xterm window, a window inside Vim to view a buffer.
|
||||
To avoid confusion, other items that are sometimes called window have been
|
||||
@ -152,111 +145,52 @@ window View on a buffer. There can be several windows in Vim,
|
||||
together with the command line, menubar, toolbar, etc. they
|
||||
fit in the shell.
|
||||
|
||||
Providers *dev-provider*
|
||||
|
||||
Spell checking *develop-spell*
|
||||
A goal of Nvim is to allow extension of the editor without special knowledge
|
||||
in the core. But some Vim components are too tightly coupled; in those cases
|
||||
a "provider" hook is exposed.
|
||||
|
||||
When spell checking was going to be added to Vim a survey was done over the
|
||||
available spell checking libraries and programs. Unfortunately, the result
|
||||
was that none of them provided sufficient capabilities to be used as the spell
|
||||
checking engine in Vim, for various reasons:
|
||||
Consider two examples of integration with external systems that are
|
||||
implemented in Vim and are now decoupled from Nvim core as providers:
|
||||
|
||||
- Missing support for multi-byte encodings. At least UTF-8 must be supported,
|
||||
so that more than one language can be used in the same file.
|
||||
Doing on-the-fly conversion is not always possible (would require iconv
|
||||
support).
|
||||
- For the programs and libraries: Using them as-is would require installing
|
||||
them separately from Vim. That's mostly not impossible, but a drawback.
|
||||
- Performance: A few tests showed that it's possible to check spelling on the
|
||||
fly (while redrawing), just like syntax highlighting. But the mechanisms
|
||||
used by other code are much slower. Myspell uses a hashtable, for example.
|
||||
The affix compression that most spell checkers use makes it slower too.
|
||||
- For using an external program like aspell a communication mechanism would
|
||||
have to be setup. That's complicated to do in a portable way (Unix-only
|
||||
would be relatively simple, but that's not good enough). And performance
|
||||
will become a problem (lots of process switching involved).
|
||||
- Missing support for words with non-word characters, such as "Etten-Leur" and
|
||||
"et al.", would require marking the pieces of them OK, lowering the
|
||||
reliability.
|
||||
- Missing support for regions or dialects. Makes it difficult to accept
|
||||
all English words and highlight non-Canadian words differently.
|
||||
- Missing support for rare words. Many words are correct but hardly ever used
|
||||
and could be a misspelled often-used word.
|
||||
- For making suggestions the speed is less important and requiring to install
|
||||
another program or library would be acceptable. But the word lists probably
|
||||
differ, the suggestions may be wrong words.
|
||||
1. In the Vim source code, clipboard logic accounts for more than 1k lines of
|
||||
C source code (ui.c), to perform two tasks that are now accomplished with
|
||||
shell commands such as xclip or pbcopy/pbpaste.
|
||||
|
||||
2. Python scripting support: Vim has three files dedicated to embedding the
|
||||
Python interpreter: if_python.c, if_python3.c and if_py_both.h. Together
|
||||
these files sum about 9.5k lines of C source code. In contrast, Nvim Python
|
||||
scripting is performed by an external host process implemented in ~2k lines
|
||||
of Python.
|
||||
|
||||
Ideally we could implement Python and clipboard integration in pure vimscript
|
||||
and without touching the C code. But this is infeasible without compromising
|
||||
backwards compatibility with Vim; that's where providers help.
|
||||
|
||||
The provider framework helps call vimscript from C. It is composed of two
|
||||
functions in eval.c:
|
||||
|
||||
- eval_call_provider(name, method, arguments): calls provider#(name)#Call
|
||||
with the method and arguments.
|
||||
- eval_has_provider(name): Checks if a provider is implemented. Returns true
|
||||
if the provider#(name)#Call function is implemented. Called by |has()|
|
||||
(vimscript) to check if features are available.
|
||||
|
||||
The provider#(name)#Call function implements integration with an external
|
||||
system, because shell commands and |RPC| clients are easier to work with in
|
||||
vimscript.
|
||||
|
||||
For example, the Python provider is implemented by the
|
||||
autoload/provider/python.vim script; the provider#python#Call function is only
|
||||
defined if a valid external Python host is found. That works well with the
|
||||
`has('python')` expression (normally used by Python plugins) because if the
|
||||
Python host isn't installed then the plugin will "think" it is running in
|
||||
a Vim compiled without the |+python| feature.
|
||||
|
||||
|
||||
Spelling suggestions *develop-spell-suggestions*
|
||||
|
||||
For making suggestions there are two basic mechanisms:
|
||||
1. Try changing the bad word a little bit and check for a match with a good
|
||||
word. Or go through the list of good words, change them a little bit and
|
||||
check for a match with the bad word. The changes are deleting a character,
|
||||
inserting a character, swapping two characters, etc.
|
||||
2. Perform soundfolding on both the bad word and the good words and then find
|
||||
matches, possibly with a few changes like with the first mechanism.
|
||||
|
||||
The first is good for finding typing mistakes. After experimenting with
|
||||
hashtables and looking at solutions from other spell checkers the conclusion
|
||||
was that a trie (a kind of tree structure) is ideal for this. Both for
|
||||
reducing memory use and being able to try sensible changes. For example, when
|
||||
inserting a character only characters that lead to good words need to be
|
||||
tried. Other mechanisms (with hashtables) need to try all possible letters at
|
||||
every position in the word. Also, a hashtable has the requirement that word
|
||||
boundaries are identified separately, while a trie does not require this.
|
||||
That makes the mechanism a lot simpler.
|
||||
|
||||
Soundfolding is useful when someone knows how the words sounds but doesn't
|
||||
know how it is spelled. For example, the word "dictionary" might be written
|
||||
as "daktonerie". The number of changes that the first method would need to
|
||||
try is very big, it's hard to find the good word that way. After soundfolding
|
||||
the words become "tktnr" and "tkxnry", these differ by only two letters.
|
||||
|
||||
To find words by their soundfolded equivalent (soundalike word) we need a list
|
||||
of all soundfolded words. A few experiments have been done to find out what
|
||||
the best method is. Alternatives:
|
||||
1. Do the sound folding on the fly when looking for suggestions. This means
|
||||
walking through the trie of good words, soundfolding each word and
|
||||
checking how different it is from the bad word. This is very efficient for
|
||||
memory use, but takes a long time. On a fast PC it takes a couple of
|
||||
seconds for English, which can be acceptable for interactive use. But for
|
||||
some languages it takes more than ten seconds (e.g., German, Catalan),
|
||||
which is unacceptable slow. For batch processing (automatic corrections)
|
||||
it's too slow for all languages.
|
||||
2. Use a trie for the soundfolded words, so that searching can be done just
|
||||
like how it works without soundfolding. This requires remembering a list
|
||||
of good words for each soundfolded word. This makes finding matches very
|
||||
fast but requires quite a lot of memory, in the order of 1 to 10 Mbyte.
|
||||
For some languages more than the original word list.
|
||||
3. Like the second alternative, but reduce the amount of memory by using affix
|
||||
compression and store only the soundfolded basic word. This is what Aspell
|
||||
does. Disadvantage is that affixes need to be stripped from the bad word
|
||||
before soundfolding it, which means that mistakes at the start and/or end
|
||||
of the word will cause the mechanism to fail. Also, this becomes slow when
|
||||
the bad word is quite different from the good word.
|
||||
|
||||
The choice made is to use the second mechanism and use a separate file. This
|
||||
way a user with sufficient memory can get very good suggestions while a user
|
||||
who is short of memory or just wants the spell checking and no suggestions
|
||||
doesn't use so much memory.
|
||||
|
||||
|
||||
Word frequency
|
||||
|
||||
For sorting suggestions it helps to know which words are common. In theory we
|
||||
could store a word frequency with the word in the dictionary. However, this
|
||||
requires storing a count per word. That degrades word tree compression a lot.
|
||||
And maintaining the word frequency for all languages will be a heavy task.
|
||||
Also, it would be nice to prefer words that are already in the text. This way
|
||||
the words that appear in the specific text are preferred for suggestions.
|
||||
|
||||
What has been implemented is to count words that have been seen during
|
||||
displaying. A hashtable is used to quickly find the word count. The count is
|
||||
initialized from words listed in COMMON items in the affix file, so that it
|
||||
also works when starting a new file.
|
||||
|
||||
This isn't ideal, because the longer Vim is running the higher the counts
|
||||
become. But in practice it is a noticeable improvement over not using the word
|
||||
count.
|
||||
RPC API
|
||||
API client
|
||||
remote plugin
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
@ -1,4 +1,4 @@
|
||||
*diff.txt* For Vim version 7.4. Last change: 2015 Feb 03
|
||||
*diff.txt* For Vim version 7.4. Last change: 2015 Nov 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -124,8 +124,9 @@ file for a moment and come back to the same file and be in diff mode again.
|
||||
if the current window does not have 'diff' set then no options
|
||||
in it are changed.
|
||||
|
||||
The ":diffoff" command resets the relevant options to the values they had when
|
||||
using |:diffsplit|, |:diffpatch| , |:diffthis|. or starting Vim in diff mode.
|
||||
The `:diffoff` command resets the relevant options to the values they had when
|
||||
using `:diffsplit`, `:diffpatch` , `:diffthis`. or starting Vim in diff mode.
|
||||
When using `:diffoff` twice the last saved values are restored.
|
||||
Otherwise they are set to their default value:
|
||||
|
||||
'diff' off
|
||||
@ -173,8 +174,8 @@ hidden buffers. You can use ":hide" to close a window without unloading the
|
||||
buffer. If you don't want a buffer to remain used for the diff do ":set
|
||||
nodiff" before hiding it.
|
||||
|
||||
*:diffu* *:diffupdate*
|
||||
:diffu[pdate][!] Update the diff highlighting and folds.
|
||||
*:dif* *:diffupdate*
|
||||
:dif[fupdate][!] Update the diff highlighting and folds.
|
||||
|
||||
Vim attempts to keep the differences updated when you make changes to the
|
||||
text. This mostly takes care of inserted and deleted lines. Changes within a
|
||||
|
@ -1,83 +0,0 @@
|
||||
/* vim:set ts=4 sw=4:
|
||||
* this program makes a tags file for vim_ref.txt
|
||||
*
|
||||
* Usage: doctags vim_ref.txt vim_win.txt ... >tags
|
||||
*
|
||||
* A tag in this context is an identifier between stars, e.g. *c_files*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define LINELEN 200
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
char line[LINELEN];
|
||||
char *p1, *p2;
|
||||
char *p;
|
||||
FILE *fd;
|
||||
|
||||
if (argc <= 1)
|
||||
{
|
||||
fprintf(stderr, "Usage: doctags docfile ... >tags\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("help-tags\ttags\t1\n");
|
||||
while (--argc > 0)
|
||||
{
|
||||
++argv;
|
||||
fd = fopen(argv[0], "r");
|
||||
if (fd == NULL)
|
||||
{
|
||||
fprintf(stderr, "Unable to open %s for reading\n", argv[0]);
|
||||
continue;
|
||||
}
|
||||
while (fgets(line, LINELEN, fd) != NULL)
|
||||
{
|
||||
p1 = strchr(line, '*'); /* find first '*' */
|
||||
while (p1 != NULL)
|
||||
{
|
||||
p2 = strchr(p1 + 1, '*'); /* find second '*' */
|
||||
if (p2 != NULL && p2 > p1 + 1) /* skip "*" and "**" */
|
||||
{
|
||||
for (p = p1 + 1; p < p2; ++p)
|
||||
if (*p == ' ' || *p == '\t' || *p == '|')
|
||||
break;
|
||||
/*
|
||||
* Only accept a *tag* when it consists of valid
|
||||
* characters, there is white space before it and is
|
||||
* followed by a white character or end-of-line.
|
||||
*/
|
||||
if (p == p2
|
||||
&& (p1 == line || p1[-1] == ' ' || p1[-1] == '\t')
|
||||
&& (strchr(" \t\n\r", p[1]) != NULL
|
||||
|| p[1] == '\0'))
|
||||
{
|
||||
*p2 = '\0';
|
||||
++p1;
|
||||
printf("%s\t%s\t/*", p1, argv[0]);
|
||||
while (*p1)
|
||||
{
|
||||
/* insert backslash before '\\' and '/' */
|
||||
if (*p1 == '\\' || *p1 == '/')
|
||||
putchar('\\');
|
||||
putchar(*p1);
|
||||
++p1;
|
||||
}
|
||||
printf("*\n");
|
||||
p2 = strchr(p2 + 1, '*'); /* find next '*' */
|
||||
}
|
||||
}
|
||||
p1 = p2;
|
||||
}
|
||||
}
|
||||
fclose(fd);
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 7.4. Last change: 2015 Apr 18
|
||||
*editing.txt* For Vim version 7.4. Last change: 2016 Mar 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -77,7 +77,8 @@ g CTRL-G Prints the current position of the cursor in five
|
||||
than one position on the screen (<Tab> or special
|
||||
character), both the "real" column and the screen
|
||||
column are shown, separated with a dash.
|
||||
See also 'ruler' option.
|
||||
Also see the 'ruler' option and the |wordcount()|
|
||||
function.
|
||||
|
||||
*v_g_CTRL-G*
|
||||
{Visual}g CTRL-G Similar to "g CTRL-G", but Word, Character, Line, and
|
||||
@ -357,7 +358,7 @@ These are the common ones:
|
||||
To avoid the special meaning of the wildcards prepend a backslash. However,
|
||||
on MS-Windows the backslash is a path separator and "path\[abc]" is still seen
|
||||
as a wildcard when "[" is in the 'isfname' option. A simple way to avoid this
|
||||
is to use "path\[[]abc]". Then the file "path[abc]" literally.
|
||||
is to use "path\[[]abc]", this matches the file "path\[abc]".
|
||||
|
||||
*starstar-wildcard*
|
||||
Expanding "**" is possible on Unix, Win32, Mac OS/X and a few other systems.
|
||||
@ -367,36 +368,54 @@ Note there are some commands where this works slightly differently, see
|
||||
Example: >
|
||||
:n **/*.txt
|
||||
Finds files:
|
||||
ttt.txt
|
||||
subdir/ttt.txt
|
||||
a/b/c/d/ttt.txt
|
||||
When non-wildcard characters are used these are only matched in the first
|
||||
directory. Example: >
|
||||
:n /usr/inc**/*.h
|
||||
aaa.txt ~
|
||||
subdir/bbb.txt ~
|
||||
a/b/c/d/ccc.txt ~
|
||||
When non-wildcard characters are used right before or after "**" these are
|
||||
only matched in the top directory. They are not used for directories further
|
||||
down in the tree. For example: >
|
||||
:n /usr/inc**/types.h
|
||||
Finds files:
|
||||
/usr/include/types.h
|
||||
/usr/include/sys/types.h
|
||||
/usr/inc_old/types.h
|
||||
/usr/include/types.h ~
|
||||
/usr/include/sys/types.h ~
|
||||
/usr/inc/old/types.h ~
|
||||
Note that the path with "/sys" is included because it does not need to match
|
||||
"/inc". Thus it's like matching "/usr/inc*/*/*...", not
|
||||
"/usr/inc*/inc*/inc*".
|
||||
|
||||
*backtick-expansion* *`-expansion*
|
||||
On Unix and a few other systems you can also use backticks in the file name,
|
||||
for example: >
|
||||
:e `find . -name ver\\*.c -print`
|
||||
The backslashes before the star are required to prevent "ver*.c" to be
|
||||
expanded by the shell before executing the find program.
|
||||
On Unix and a few other systems you can also use backticks for the file name
|
||||
argument, for example: >
|
||||
:next `find . -name ver\\*.c -print`
|
||||
:view `ls -t *.patch \| head -n1`
|
||||
The backslashes before the star are required to prevent the shell from
|
||||
expanding "ver*.c" prior to execution of the find program. The backslash
|
||||
before the shell pipe symbol "|" prevents Vim from parsing it as command
|
||||
termination.
|
||||
This also works for most other systems, with the restriction that the
|
||||
backticks must be around the whole item. It is not possible to have text
|
||||
directly before the first or just after the last backtick.
|
||||
|
||||
*`=*
|
||||
You can have the backticks expanded as a Vim expression, instead of an
|
||||
external command, by using the syntax `={expr}` e.g.: >
|
||||
You can have the backticks expanded as a Vim expression, instead of as an
|
||||
external command, by putting an equal sign right after the first backtick,
|
||||
e.g.: >
|
||||
:e `=tempname()`
|
||||
The expression can contain just about anything, thus this can also be used to
|
||||
avoid the special meaning of '"', '|', '%' and '#'. However, 'wildignore'
|
||||
does apply like to other wildcards.
|
||||
|
||||
Environment variables in the expression are expanded when evaluating the
|
||||
expression, thus this works: >
|
||||
:e `=$HOME . '/.vimrc'`
|
||||
This does not work, $HOME is inside a string and used literally: >
|
||||
:e `='$HOME' . '/.vimrc'`
|
||||
|
||||
If the expression returns a string then names are to be separated with line
|
||||
breaks. When the result is a |List| then each item is used as a name. Line
|
||||
breaks also separate names.
|
||||
Note that such expressions are only supported in places where a filename is
|
||||
expected as an argument to an Ex-command.
|
||||
|
||||
*++opt* *[++opt]*
|
||||
The [++opt] argument can be used to force the value of 'fileformat',
|
||||
@ -582,6 +601,7 @@ list of the current window.
|
||||
:0argadd x x a b c
|
||||
:1argadd x a x b c
|
||||
:$argadd x a b c x
|
||||
And after the last one:
|
||||
:+2argadd y a b c x y
|
||||
There is no check for duplicates, it is possible to
|
||||
add a file to the argument list twice.
|
||||
@ -932,7 +952,7 @@ the newly written file (it might be there but contain bogus data). In that
|
||||
case try recovery, because the swap file is synced to disk and might still be
|
||||
there. |:recover|
|
||||
|
||||
The directories given with the 'backupdir' option is used to put the backup
|
||||
The directories given with the 'backupdir' option are used to put the backup
|
||||
file in. (default: same directory as the written file).
|
||||
|
||||
Whether the backup is a new file, which is a copy of the original file, or the
|
||||
@ -1028,10 +1048,10 @@ The names can be in upper- or lowercase.
|
||||
the last file in the argument list has not been
|
||||
edited. See |:confirm| and 'confirm'.
|
||||
|
||||
:q[uit]! Quit without writing, also when currently visible
|
||||
buffers have changes. Does not exit when this is the
|
||||
last window and there is a changed hidden buffer.
|
||||
In this case, the first changed hidden buffer becomes
|
||||
:q[uit]! Quit without writing, also when the current buffer has
|
||||
changes. If this is the last window and there is a
|
||||
modified hidden buffer, the current buffer is
|
||||
abandoned and the first changed hidden buffer becomes
|
||||
the current buffer.
|
||||
Use ":qall!" to exit always.
|
||||
|
||||
@ -1203,12 +1223,18 @@ use has("browsefilter"): >
|
||||
==============================================================================
|
||||
7. The current directory *current-directory*
|
||||
|
||||
You may use the |:cd| and |:lcd| commands to change to another directory, so
|
||||
you will not have to type that directory name in front of the file names. It
|
||||
also makes a difference for executing external commands, e.g. ":!ls".
|
||||
You can use |:cd|, |:tcd| and |:lcd| to change to another directory, so you
|
||||
will not have to type that directory name in front of the file names. It also
|
||||
makes a difference for executing external commands, e.g. ":!ls" or ":te ls".
|
||||
|
||||
Changing directory fails when the current buffer is modified, the '.' flag is
|
||||
present in 'cpoptions' and "!" is not used in the command.
|
||||
There are three current-directory "scopes": global, tab and window. The
|
||||
window-local working directory takes precedence over the tab-local
|
||||
working directory, which in turn takes precedence over the global
|
||||
working directory. If a local working directory (tab or window) does not
|
||||
exist, the next-higher scope in the hierarchy applies.
|
||||
|
||||
Commands for changing the working directory can be suffixed with a bang "!"
|
||||
(e.g. |:cd!|) which is ignored, for compatibility with Vim.
|
||||
|
||||
*:cd* *E747* *E472*
|
||||
:cd[!] On non-Unix systems: Print the current directory
|
||||
@ -1233,29 +1259,50 @@ present in 'cpoptions' and "!" is not used in the command.
|
||||
*:chd* *:chdir*
|
||||
:chd[ir][!] [path] Same as |:cd|.
|
||||
|
||||
*:tc* *:tcd* *E5000* *E5001* *E5002*
|
||||
:tc[d][!] {path} Like |:cd|, but set the current directory for the
|
||||
current tab and window. The current directory for
|
||||
other tabs and windows is not changed.
|
||||
|
||||
*:tcd-*
|
||||
:tcd[!] - Change to the previous current directory (before the
|
||||
previous ":tcd {path}" command).
|
||||
|
||||
*:tch* *:tchdir*
|
||||
:tch[dir][!] Same as |:tcd|.
|
||||
|
||||
*:lc* *:lcd*
|
||||
:lc[d][!] {path} Like |:cd|, but only set the current directory for the
|
||||
current window. The current directory for other
|
||||
windows is not changed.
|
||||
windows or any tabs is not changed.
|
||||
|
||||
*:lch* *:lchdir*
|
||||
:lch[dir][!] Same as |:lcd|.
|
||||
|
||||
*:lcd-*
|
||||
:lcd[!] - Change to the previous current directory (before the
|
||||
previous ":tcd {path}" command).
|
||||
|
||||
*:pw* *:pwd* *E187*
|
||||
:pw[d] Print the current directory name.
|
||||
Also see |getcwd()|.
|
||||
|
||||
So long as no |:lcd| command has been used, all windows share the same current
|
||||
directory. Using a command to jump to another window doesn't change anything
|
||||
for the current directory.
|
||||
When a |:lcd| command has been used for a window, the specified directory
|
||||
becomes the current directory for that window. Windows where the |:lcd|
|
||||
command has not been used stick to the global current directory. When jumping
|
||||
to another window the current directory will become the last specified local
|
||||
current directory. If none was specified, the global current directory is
|
||||
used.
|
||||
When a |:cd| command is used, the current window will lose his local current
|
||||
directory and will use the global current directory from now on.
|
||||
So long as no |:tcd| or |:lcd| command has been used, all windows share the
|
||||
same "current directory". Using a command to jump to another window doesn't
|
||||
change anything for the current directory.
|
||||
|
||||
When |:lcd| has been used for a window, the specified directory becomes the
|
||||
current directory for that window. Windows where the |:lcd| command has not
|
||||
been used stick to the global or tab-local directory. When jumping to another
|
||||
window the current directory will become the last specified local current
|
||||
directory. If none was specified, the global or tab-local directory is used.
|
||||
|
||||
When changing tabs the same behaviour applies. If the current tab has no
|
||||
local working directory the global working directory is used. When a |:cd|
|
||||
command is used, the current window and tab will lose their local current
|
||||
directories and will use the global current directory from now on. When
|
||||
a |:tcd| command is used, only the current window will lose its local working
|
||||
directory.
|
||||
|
||||
After using |:cd| the full path name will be used for reading and writing
|
||||
files. On some networked file systems this may cause problems. The result of
|
||||
@ -1292,7 +1339,7 @@ There are a few things to remember when editing binary files:
|
||||
and when the file is written the <NL> will be replaced with <CR> <NL>.
|
||||
- <Nul> characters are shown on the screen as ^@. You can enter them with
|
||||
"CTRL-V CTRL-@" or "CTRL-V 000".
|
||||
- To insert a <NL> character in the file split up a line. When writing the
|
||||
- To insert a <NL> character in the file split a line. When writing the
|
||||
buffer to a file a <NL> will be written for the <EOL>.
|
||||
- Vim normally appends an <EOL> at the end of the file if there is none.
|
||||
Setting the 'binary' option prevents this. If you want to add the final
|
||||
@ -1304,9 +1351,7 @@ There are a few things to remember when editing binary files:
|
||||
9. Encryption *encryption*
|
||||
|
||||
*:X* *E817* *E818* *E819* *E820*
|
||||
Support for editing encrypted files has been removed, but may be added back in
|
||||
the future. See the following discussions for more information:
|
||||
|
||||
Support for editing encrypted files has been removed.
|
||||
https://github.com/neovim/neovim/issues/694
|
||||
https://github.com/neovim/neovim/issues/701
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
*filetype.txt* For Vim version 7.4. Last change: 2013 Dec 15
|
||||
*filetype.txt* For Vim version 7.4. Last change: 2015 Dec 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -510,32 +510,43 @@ Local mappings:
|
||||
to the end of the file in Normal mode. This means "> " is inserted in
|
||||
each line.
|
||||
|
||||
MAN *ft-man-plugin* *:Man*
|
||||
MAN *ft-man-plugin* *:Man* *man.vim*
|
||||
|
||||
Displays a manual page in a nice way. Also see the user manual
|
||||
|find-manpage|.
|
||||
View manpages in Nvim. Supports highlighting, completion, locales, and
|
||||
navigation. Also see |find-manpage|.
|
||||
|
||||
To start using the ":Man" command before any manual page was loaded, source
|
||||
this script from your startup vimrc file: >
|
||||
To use Nvim as a manpager: >
|
||||
export MANPAGER="nvim -c 'set ft=man' -"
|
||||
|
||||
runtime ftplugin/man.vim
|
||||
|
||||
Options:
|
||||
'iskeyword' the '.' character is added to be able to use CTRL-] on the
|
||||
manual page name.
|
||||
man.vim will always attempt to reuse the closest man window (above/left) but
|
||||
otherwise create a split.
|
||||
|
||||
Commands:
|
||||
Man {name} Display the manual page for {name} in a window.
|
||||
Man {number} {name}
|
||||
Display the manual page for {name} in a section {number}.
|
||||
Man {name} Display the manpage for {name}.
|
||||
Man {sect} {name} Display the manpage for {name} and section {sect}.
|
||||
Man {name}({sect}) Alternate syntax which completes the section.
|
||||
Man {sect} {name}({sect}) Used during completion to show the real section of
|
||||
when the provided section is a prefix, e.g. 1m vs 1.
|
||||
Man {path} Open the manpage specified by path. Prepend "./" if
|
||||
page is in the current directory.
|
||||
|
||||
Global mapping:
|
||||
<Leader>K Displays the manual page for the word under the cursor.
|
||||
|:Man| accepts command modifiers. For example, to use a vertical split: >
|
||||
:vertical Man printf
|
||||
|
||||
Global Mappings:
|
||||
<Plug>(Man) Jump to the manpage for the <cWORD> under the
|
||||
cursor. Takes a count for the section.
|
||||
|
||||
Local mappings:
|
||||
CTRL-] Jump to the manual page for the word under the cursor.
|
||||
CTRL-T Jump back to the previous manual page.
|
||||
K or CTRL-] Jump to the manpage for the <cWORD> under the
|
||||
cursor. Takes a count for the section.
|
||||
CTRL-T Jump back to the location that the manpage was
|
||||
opened from.
|
||||
q :quit if invoked as $MANPAGER, otherwise :close.
|
||||
|
||||
Variables:
|
||||
*g:no_man_maps* Do not create mappings in manpage buffers.
|
||||
*g:ft_man_folding_enable* Fold manpages with foldmethod=indent foldnestmax=1.
|
||||
|
||||
PDF *ft-pdf-plugin*
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*fold.txt* For Vim version 7.4. Last change: 2013 Dec 04
|
||||
*fold.txt* For Vim version 7.4. Last change: 2016 Jan 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -94,9 +94,9 @@ These are the conditions with which the expression is evaluated:
|
||||
lowest.
|
||||
"=" use fold level from the previous line
|
||||
"a1", "a2", .. add one, two, .. to the fold level of the previous
|
||||
line
|
||||
line, use the result for the current line
|
||||
"s1", "s2", .. subtract one, two, .. from the fold level of the
|
||||
previous line
|
||||
previous line, use the result for the next line
|
||||
"<1", "<2", .. a fold with this level ends at this line
|
||||
">1", ">2", .. a fold with this level starts at this line
|
||||
|
||||
@ -119,6 +119,18 @@ method can be very slow!
|
||||
Try to avoid the "=", "a" and "s" return values, since Vim often has to search
|
||||
backwards for a line for which the fold level is defined. This can be slow.
|
||||
|
||||
An example of using "a1" and "s1": For a multi-line C comment, a line
|
||||
containing "/*" would return "a1" to start a fold, and a line containing "*/"
|
||||
would return "s1" to end the fold after that line: >
|
||||
if match(thisline, '/\*') >= 0
|
||||
return 'a1'
|
||||
elseif match(thisline, '\*/') >= 0
|
||||
return 's1'
|
||||
else
|
||||
return '='
|
||||
endif
|
||||
However, this won't work for single line comments, strings, etc.
|
||||
|
||||
|foldlevel()| can be useful to compute a fold level relative to a previous
|
||||
fold level. But note that foldlevel() may return -1 if the level is not known
|
||||
yet. And it returns the level at the start of the line, while a fold might
|
||||
@ -570,8 +582,9 @@ what you type!
|
||||
When using an operator, a closed fold is included as a whole. Thus "dl"
|
||||
deletes the whole closed fold under the cursor.
|
||||
|
||||
For Ex commands the range is adjusted to always start at the first line of a
|
||||
closed fold and end at the last line of a closed fold. Thus this command: >
|
||||
For Ex commands that work on buffer lines the range is adjusted to always
|
||||
start at the first line of a closed fold and end at the last line of a closed
|
||||
fold. Thus this command: >
|
||||
:s/foo/bar/g
|
||||
when used with the cursor on a closed fold, will replace "foo" with "bar" in
|
||||
all lines of the fold.
|
||||
|
@ -395,9 +395,9 @@ You may make selections with the mouse (see |gui-mouse-select|), or by using
|
||||
Vim's Visual mode (see |v|). If 'a' is present in 'guioptions', then
|
||||
whenever a selection is started (Visual or Select mode), or when the selection
|
||||
is changed, Vim becomes the owner of the windowing system's primary selection
|
||||
(on MS-Windows the |gui-clipboard| is used).
|
||||
(on MS-Windows the |clipboard| is used).
|
||||
|
||||
*clipboard*
|
||||
*primary-selection*
|
||||
There is a special register for storing this selection, it is the "*
|
||||
register. Nothing is put in here unless the information about what text is
|
||||
selected is about to change (e.g. with a left mouse click somewhere), or when
|
||||
@ -825,13 +825,13 @@ the <CR> key. |<>|)
|
||||
|
||||
See section |42.4| in the user manual.
|
||||
|
||||
*:tmenu* *:tm*
|
||||
*:tmenu*
|
||||
:tm[enu] {menupath} {rhs} Define a tip for a menu or tool. {only in
|
||||
X11 and Win32 GUI}
|
||||
|
||||
:tm[enu] [menupath] List menu tips. {only in X11 and Win32 GUI}
|
||||
|
||||
*:tunmenu* *:tu*
|
||||
*:tunmenu*
|
||||
:tu[nmenu] {menupath} Remove a tip for a menu or tool.
|
||||
{only in X11 and Win32 GUI}
|
||||
|
||||
|
@ -1,437 +0,0 @@
|
||||
*gui_w32.txt* For Vim version 7.4. Last change: 2014 Dec 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Vim's Win32 Graphical User Interface *gui-w32* *win32-gui*
|
||||
|
||||
1. Starting the GUI |gui-w32-start|
|
||||
2. Vim as default editor |vim-default-editor|
|
||||
3. Using the clipboard |gui-clipboard|
|
||||
4. Shell Commands |gui-shell-win32|
|
||||
5. Special colors |win32-colors|
|
||||
6. Windows dialogs & browsers |gui-w32-dialogs|
|
||||
7. Command line arguments |gui-w32-cmdargs|
|
||||
8. Various |gui-w32-various|
|
||||
|
||||
Other relevant documentation:
|
||||
|gui.txt| For generic items of the GUI.
|
||||
|os_win32.txt| For Win32 specific items.
|
||||
|
||||
==============================================================================
|
||||
1. Starting the GUI *gui-w32-start*
|
||||
|
||||
The Win32 GUI version of Vim will always start the GUI, no matter how you
|
||||
start it or what it's called.
|
||||
|
||||
The GUI will always run in the Windows subsystem. Mostly shells automatically
|
||||
return with a command prompt after starting gvim. If not, you should use the
|
||||
"start" command: >
|
||||
start gvim [options] file ..
|
||||
|
||||
Note: All fonts (bold, italic) must be of the same size!!! If you don't do
|
||||
this, text will disappear or mess up the display. Vim does not check the font
|
||||
sizes. It's the size in screen pixels that must be the same. Note that some
|
||||
fonts that have the same point size don't have the same pixel size!
|
||||
Additionally, the positioning of the fonts must be the same (ascent and
|
||||
descent).
|
||||
|
||||
The Win32 GUI has an extra menu item: "Edit/Select Font". It brings up the
|
||||
standard Windows font selector.
|
||||
|
||||
Setting the menu height doesn't work for the Win32 GUI.
|
||||
|
||||
*gui-win32-maximized*
|
||||
If you want Vim to start with a maximized window, add this command to your
|
||||
vimrc or gvimrc file: >
|
||||
au GUIEnter * simalt ~x
|
||||
<
|
||||
==============================================================================
|
||||
2. Vim as default editor *vim-default-editor*
|
||||
|
||||
To set Vim as the default editor for a file type:
|
||||
1. Start a Windows Explorer
|
||||
2. Choose View/Options -> File Types
|
||||
3. Select the path to gvim for every file type that you want to use it for.
|
||||
(you can also use three spaces in the file type field, for files without an
|
||||
extension).
|
||||
In the "open" action, use: >
|
||||
gvim "%1"
|
||||
< The quotes are required for using file names with embedded spaces.
|
||||
You can also use this: >
|
||||
gvim "%L"
|
||||
< This should avoid short (8.3 character) file names in some situations. But
|
||||
I'm not sure if this works everywhere.
|
||||
|
||||
When you open a file in Vim by double clicking it, Vim changes to that
|
||||
file's directory.
|
||||
|
||||
If you want Vim to start full-screen, use this for the Open action: >
|
||||
gvim -c "simalt ~x" "%1"
|
||||
|
||||
Another method, which also works when you put Vim in another directory (e.g.,
|
||||
when you have got a new version):
|
||||
1. select a file you want to use Vim with
|
||||
2. <Shift-F10>
|
||||
3. select "Open With..." menu entry
|
||||
4. click "Other..."
|
||||
5. browse to the (new) location of Vim and click "Open"
|
||||
6. make "Always Use this program..." checked
|
||||
7. <OK>
|
||||
|
||||
*send-to-menu* *sendto*
|
||||
You can also install Vim in the "Send To" menu:
|
||||
1. Start a Windows Explorer
|
||||
2. Navigate to your sendto directory:
|
||||
Windows NT: %windir%\profiles\%user%\sendto (e.g.
|
||||
"c:\winnt\profiles\mattha\sendto").
|
||||
3. Right-click in the file pane and select New->Shortcut
|
||||
4. Follow the shortcut wizard, using the full path to VIM/GVIM.
|
||||
|
||||
When you 'send a file to Vim', Vim changes to that file's directory. Note,
|
||||
however, that any long directory names will appear in their short (MS-DOS)
|
||||
form. This is a limitation of the Windows "Send To" mechanism.
|
||||
|
||||
*notepad*
|
||||
You could replace notepad.exe with gvim.exe, but that has a few side effects.
|
||||
Some programs rely on notepad arguments, which are not recognized by Vim. For
|
||||
example "notepad -p" is used by some applications to print a file. It's
|
||||
better to leave notepad where it is and use another way to start Vim.
|
||||
|
||||
*win32-popup-menu*
|
||||
A more drastic approach is to install an "Edit with Vim" entry in the popup
|
||||
menu for the right mouse button. With this you can edit any file with Vim.
|
||||
|
||||
This can co-exist with the file associations mentioned above. The difference
|
||||
is that the file associations will make starting Vim the default action. With
|
||||
the "Edit with Vim" menu entry you can keep the existing file association for
|
||||
double clicking on the file, and edit the file with Vim when you want. For
|
||||
example, you can associate "*.mak" with your make program. You can execute
|
||||
the makefile by double clicking it and use the "Edit with Vim" entry to edit
|
||||
the makefile.
|
||||
|
||||
You can select any files and right-click to see a menu option called "Edit
|
||||
with gvim". Choosing this menu option will invoke gvim with the file you have
|
||||
selected. If you select multiple files, you will find two gvim-related menu
|
||||
options:
|
||||
"Edit with multiple gvims" -- one gvim for each file in the selection
|
||||
"Edit with single gvim" -- one gvim for all the files in the selection
|
||||
And if there already is a gvim running:
|
||||
"Edit with existing gvim" -- edit the file with the running gvim
|
||||
|
||||
The "edit with existing Vim" entries can be disabled by adding an entry in the
|
||||
registry under HKLM\Software\Vim\Gvim, named DisableEditWithExisting, and with
|
||||
any value.
|
||||
*install-registry*
|
||||
You can add the "Edit with Vim" menu entry in an easy way by using the
|
||||
"install.exe" program. It will add several registry entries for you.
|
||||
|
||||
You can also do this by hand. This is complicated! Use the install.exe if
|
||||
you can.
|
||||
|
||||
1. Start the registry editor with "regedit".
|
||||
2. Add these keys:
|
||||
key value name value ~
|
||||
HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}
|
||||
{default} Vim Shell Extension
|
||||
HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}\InProcServer32
|
||||
{default} {path}\gvimext.dll
|
||||
ThreadingModel Apartment
|
||||
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\gvim
|
||||
{default} {51EEE242-AD87-11d3-9C1E-0090278BBD99}
|
||||
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved
|
||||
{51EEE242-AD87-11d3-9C1E-0090278BBD99}
|
||||
Vim Shell Extension
|
||||
HKEY_LOCAL_MACHINE\Software\Vim\Gvim
|
||||
path {path}\gvim.exe
|
||||
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\vim 5.6
|
||||
DisplayName Vim 5.6: Edit with Vim popup menu entry
|
||||
UninstallString {path}\uninstal.exe
|
||||
|
||||
Replace {path} with the path that leads to the executable.
|
||||
Don't type {default}, this is the value for the key itself.
|
||||
|
||||
To remove "Edit with Vim" from the popup menu, just remove the registry
|
||||
entries mentioned above. The "uninstal.exe" program can do this for you. You
|
||||
can also use the entry in the Windows standard "Add/Remove Programs" list.
|
||||
|
||||
If you notice that this entry overrules other file type associations, set
|
||||
those associations again by hand (using Windows Explorer, see above). This
|
||||
only seems to happen on some Windows NT versions (Windows bug?). Procedure:
|
||||
1. Find the name of the file type. This can be done by starting the registry
|
||||
editor, and searching for the extension in \\HKEY_CLASSES_ROOT
|
||||
2. In a Windows Explorer, use View/Options/File Types. Search for the file
|
||||
type in the list and click "Edit". In the actions list, you can select on
|
||||
to be used as the default (normally the "open" action) and click on the
|
||||
"Set Default" button.
|
||||
|
||||
|
||||
Vim in the "Open With..." context menu *win32-open-with-menu*
|
||||
|
||||
If you use the Vim install program you have the choice to add Vim to the "Open
|
||||
With..." menu. This means you can use Vim to edit many files. Not every file
|
||||
(for unclear reasons...), thus the "Edit with Vim" menu entry is still useful.
|
||||
|
||||
One reason to add this is to be able to edit HTML files directly from Internet
|
||||
Explorer. To enable this use the "Tools" menu, "Internet Options..." entry.
|
||||
In the dialog select the "Programs" tab and select Vim in the "HTML editor"
|
||||
choice. If it's not there than installing didn't work properly.
|
||||
|
||||
Doing this manually can be done with this script:
|
||||
|
||||
----------------------------------------------------------
|
||||
REGEDIT4
|
||||
|
||||
[HKEY_CLASSES_ROOT\Applications\gvim.exe]
|
||||
|
||||
[HKEY_CLASSES_ROOT\Applications\gvim.exe\shell]
|
||||
|
||||
[HKEY_CLASSES_ROOT\Applications\gvim.exe\shell\edit]
|
||||
|
||||
[HKEY_CLASSES_ROOT\Applications\gvim.exe\shell\edit\command]
|
||||
@="c:\\vim\\vim62\\gvim.exe \"%1\""
|
||||
|
||||
[HKEY_CLASSES_ROOT\.htm\OpenWithList\gvim.exe]
|
||||
|
||||
[HKEY_CLASSES_ROOT\*\OpenWithList\gvim.exe]
|
||||
|
||||
----------------------------------------------------------
|
||||
|
||||
Change the "c:\\vim\\vim62" bit to where gvim.exe is actually located.
|
||||
|
||||
To uninstall this run the Vim uninstall program or manually delete the
|
||||
registry entries with "regedit".
|
||||
|
||||
==============================================================================
|
||||
3. Using the clipboard *gui-clipboard*
|
||||
|
||||
Windows has a clipboard, where you can copy text to, and paste text from. Vim
|
||||
supports this in several ways. For other systems see |gui-selections|.
|
||||
|
||||
The "* register reflects the contents of the clipboard. |quotestar|
|
||||
|
||||
When the "unnamed" string is included in the 'clipboard' option, the unnamed
|
||||
register is the same. Thus you can yank to and paste from the clipboard
|
||||
without prepending "* to commands.
|
||||
|
||||
The 'a' flag in 'guioptions' is not included by default. This means that text
|
||||
is only put on the clipboard when an operation is performed on it. Just
|
||||
Visually selecting text doesn't put it on the clipboard. When the 'a' flag is
|
||||
included, the text is copied to the clipboard even when it is not operated
|
||||
upon.
|
||||
|
||||
*mswin.vim*
|
||||
To use the standard MS-Windows way of CTRL-X, CTRL-C and CTRL-V, use the
|
||||
$VIMRUNTIME/mswin.vim script. You could add this line to your _vimrc file: >
|
||||
source $VIMRUNTIME/mswin.vim
|
||||
|
||||
Since CTRL-C is used to copy the text to the clipboard, it can't be used to
|
||||
cancel an operation. Use CTRL-Break for that.
|
||||
|
||||
CTRL-Z is used for undo. This means you can't suspend Vim with this key, use
|
||||
|:suspend| instead (if it's supported at all).
|
||||
|
||||
*CTRL-V-alternative* *CTRL-Q*
|
||||
Since CTRL-V is used to paste, you can't use it to start a blockwise Visual
|
||||
selection. You can use CTRL-Q instead. You can also use CTRL-Q in Insert
|
||||
mode and Command-line mode to get the old meaning of CTRL-V. But CTRL-Q
|
||||
doesn't work for terminals when it's used for control flow.
|
||||
|
||||
NOTE: The clipboard support still has a number of bugs.
|
||||
|
||||
==============================================================================
|
||||
4. Shell Commands *gui-shell-win32*
|
||||
|
||||
Vim uses another window for external commands, to make it possible to run any
|
||||
command. The external command gets its own environment for running, just like
|
||||
it was started from a DOS prompt.
|
||||
|
||||
*win32-vimrun*
|
||||
Executing an external command is done indirectly by the "vimrun" command. The
|
||||
"vimrun.exe" must be in the path for this to work. Or it must be in the same
|
||||
directory as the Vim executable. If "vimrun" cannot be found, the command is
|
||||
executed directly, but then the DOS window closes immediately after the
|
||||
external command has finished.
|
||||
WARNING: If you close this window with the "X" button, and confirm the
|
||||
question if you really want to kill the application, Vim may be killed too!
|
||||
(This does not apply to commands run asynchronously with ":!start".)
|
||||
|
||||
*win32-!start*
|
||||
Normally, Vim waits for a command to complete before continuing (this makes
|
||||
sense for most shell commands which produce output for Vim to use). If you
|
||||
want Vim to start a program and return immediately, you can use the following
|
||||
syntax on W95 & NT: >
|
||||
:!start [/min] {command}
|
||||
The optional "/min" causes the window to be minimized.
|
||||
|
||||
==============================================================================
|
||||
5. Special colors *win32-colors*
|
||||
|
||||
On Win32, the normal DOS colors can be used. See |dos-colors|.
|
||||
|
||||
Additionally the system configured colors can also be used. These are known
|
||||
by the names Sys_XXX, where XXX is the appropriate system color name, from the
|
||||
following list (see the Win32 documentation for full descriptions). Case is
|
||||
ignored.
|
||||
|
||||
Sys_3DDKShadow Sys_3DFace Sys_BTNFace
|
||||
Sys_3DHilight Sys_3DHighlight Sys_BTNHilight
|
||||
Sys_BTNHighlight Sys_3DLight Sys_3DShadow
|
||||
Sys_BTNShadow Sys_ActiveBorder Sys_ActiveCaption
|
||||
Sys_AppWorkspace Sys_Background Sys_Desktop
|
||||
Sys_BTNText Sys_CaptionText Sys_GrayText
|
||||
Sys_Highlight Sys_HighlightText Sys_InactiveBorder
|
||||
Sys_InactiveCaption Sys_InactiveCaptionText Sys_InfoBK
|
||||
Sys_InfoText Sys_Menu Sys_MenuText
|
||||
Sys_ScrollBar Sys_Window Sys_WindowFrame
|
||||
Sys_WindowText
|
||||
|
||||
Probably the most useful values are
|
||||
Sys_Window Normal window background
|
||||
Sys_WindowText Normal window text
|
||||
Sys_Highlight Highlighted background
|
||||
Sys_HighlightText Highlighted text
|
||||
|
||||
These extra colors are also available:
|
||||
Gray, Grey, LightYellow, SeaGreen, Orange, Purple, SlateBlue, Violet,
|
||||
|
||||
*rgb.txt*
|
||||
Additionally, colors defined by a "rgb.txt" file can be used. This file is
|
||||
well known from X11. A few lines from it: >
|
||||
|
||||
255 218 185 peach puff
|
||||
205 133 63 peru
|
||||
255 181 197 pink
|
||||
|
||||
This shows the layout of the file: First the R, G and B value as a decimal
|
||||
number, followed by the name of the color. The four fields are separated by
|
||||
spaces.
|
||||
|
||||
You can get an rgb.txt file from any X11 distribution. It is located in a
|
||||
directory like "/usr/X11R6/lib/X11/". For Vim it must be located in the
|
||||
$VIMRUNTIME directory. Thus the file can be found with "$VIMRUNTIME/rgb.txt".
|
||||
|
||||
==============================================================================
|
||||
*gui-w32-dialogs* *dialog*
|
||||
6. Windows dialogs & browsers
|
||||
|
||||
The Win32 GUI can use familiar Windows components for some operations, as well
|
||||
as the traditional interface shared with the console version.
|
||||
|
||||
|
||||
6.1 Dialogs
|
||||
|
||||
The dialogs displayed by the "confirm" family (i.e. the 'confirm' option,
|
||||
|:confirm| command and |confirm()| function) are GUI-based rather than the
|
||||
console-based ones used by other versions. The 'c' flag in 'guioptions'
|
||||
changes this.
|
||||
|
||||
|
||||
6.2 File Browsers
|
||||
|
||||
When prepending ":browse" before file editing commands, a file requester is
|
||||
used to allow you to select an existing file. See |:browse|.
|
||||
|
||||
==============================================================================
|
||||
7. Command line arguments *gui-w32-cmdargs*
|
||||
|
||||
Analysis of a command line into parameters is not standardised in MS Windows.
|
||||
Gvim has to provide logic to analyse a command line. This logic is likely to
|
||||
be different from the default logic provided by a compilation system used to
|
||||
build vim. The differences relate to unusual double quote (") usage.
|
||||
The arguments "C:\My Music\freude.txt" and "+/Sch\"iller" are handled in the
|
||||
same way. The argument "+/Sch""iller" may be handled different by gvim and
|
||||
vim, depending what it was compiled with.
|
||||
|
||||
The rules are:
|
||||
a) A parameter is a sequence of graphic characters.
|
||||
b) Parameters are separated by white space.
|
||||
c) A parameter can be enclosed in double quotes to include white space.
|
||||
d) A sequence of zero or more backslashes (\) and a double quote (")
|
||||
is special. The effective number of backslashes is halved, rounded
|
||||
down. An even number of backslashes reverses the acceptability of
|
||||
spaces and tabs, an odd number of backslashes produces a literal
|
||||
double quote.
|
||||
|
||||
So:
|
||||
" is a special double quote
|
||||
\" is a literal double quote
|
||||
\\" is a literal backslash and a special double quote
|
||||
\\\" is a literal backslash and a literal double quote
|
||||
\\\\" is 2 literal backslashes and a special double quote
|
||||
\\\\\" is 2 literal backslashes and a literal double quote
|
||||
etc.
|
||||
|
||||
Example: >
|
||||
gvim "C:\My Music\freude" +"set ignorecase" +/"\"foo\\" +\"bar\\\"
|
||||
|
||||
opens "C:\My Music\freude" and executes the line mode commands: >
|
||||
set ignorecase; /"foo\ and /bar\"
|
||||
|
||||
==============================================================================
|
||||
8. Various *gui-w32-various*
|
||||
|
||||
*gui-w32-printing*
|
||||
The "File/Print" menu prints the text with syntax highlighting, see
|
||||
|:hardcopy|. If you just want to print the raw text and have a default
|
||||
printer installed this should also work: >
|
||||
:w >>prn
|
||||
|
||||
Vim supports a number of standard MS Windows features. Some of these are
|
||||
detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
|
||||
|
||||
*drag-n-drop-win32*
|
||||
You can drag and drop one or more files into the Vim window, where they will
|
||||
be opened as normal. See |drag-n-drop|.
|
||||
|
||||
*:simalt* *:si*
|
||||
:sim[alt] {key} simulate pressing {key} while holding Alt pressed.
|
||||
{only for Win32 versions}
|
||||
|
||||
Normally, Vim takes control of all Alt-<Key> combinations, to increase the
|
||||
number of possible mappings. This clashes with the standard use of Alt as the
|
||||
key for accessing menus.
|
||||
The quick way of getting standard behavior is to set the 'winaltkeys' option
|
||||
to "yes". This however prevents you from mapping Alt keys at all.
|
||||
Another way is to set 'winaltkeys' to "menu". Menu shortcut keys are then
|
||||
handled by windows, other ALT keys can be mapped. This doesn't allow a
|
||||
dependency on the current state though.
|
||||
To get round this, the :simalt command allows Vim (when 'winaltkeys' is not
|
||||
"yes") to fake a Windows-style Alt keypress. You can use this to map Alt key
|
||||
combinations (or anything else for that matter) to produce standard Windows
|
||||
actions. Here are some examples: >
|
||||
|
||||
:map <M-f> :simalt f<CR>
|
||||
This makes Alt-F pop down the 'File' menu (with the stock Menu.vim) by
|
||||
simulating the keystrokes Alt, F. >
|
||||
:map <M-Space> :simalt ~<CR>
|
||||
This maps Alt-Space to pop down the system menu for the Vim window. Note that
|
||||
~ is used by simalt to represent the <Space> character. >
|
||||
:map <C-n> :simalt ~n<CR>
|
||||
Maps Control-N to produce the keys Alt-Space followed by N. This minimizes the
|
||||
Vim window via the system menu.
|
||||
|
||||
Note that the key changes depending on the language you are using.
|
||||
|
||||
*intellimouse-wheel-problems*
|
||||
When using the Intellimouse mouse wheel causes Vim to stop accepting input, go
|
||||
to:
|
||||
ControlPanel - Mouse - Wheel - UniversalScrolling - Exceptions
|
||||
|
||||
And add gvim to the list of applications. This problem only appears to happen
|
||||
with the Intellimouse driver 2.2 and when "Universal Scrolling" is turned on.
|
||||
|
||||
|
||||
XPM support *w32-xpm-support*
|
||||
|
||||
Gvim can be build on MS-Windows with support for XPM files. |+xpm_w32|
|
||||
See the Make_mvc.mak file for instructions, search for XPM.
|
||||
|
||||
To try out if XPM support works do this: >
|
||||
:help
|
||||
:exe 'sign define vimxpm icon=' . $VIMRUNTIME . '\\vim16x16.xpm'
|
||||
:exe 'sign place 1 line=1 name=vimxpm file=' . expand('%:p')
|
||||
<
|
||||
|
||||
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
@ -1,4 +1,4 @@
|
||||
*help.txt* For Vim version 7.4. Last change: 2015 Apr 15
|
||||
*help.txt* For Vim version 7.4. Last change: 2016 Mar 31
|
||||
|
||||
VIM - main help file
|
||||
k
|
||||
@ -9,14 +9,14 @@ Close this window: Use ":q<Enter>".
|
||||
|
||||
Jump to a subject: Position the cursor on a tag (e.g. |bars|) and hit CTRL-].
|
||||
With the mouse: Double-click the left mouse button on a tag, e.g. |bars|.
|
||||
Jump back: Type CTRL-T or CTRL-O (repeat to go further back).
|
||||
Jump back: Type CTRL-T or CTRL-O. Repeat to go further back.
|
||||
|
||||
Get specific help: It is possible to go directly to whatever you want help
|
||||
on, by giving an argument to the |:help| command.
|
||||
It is possible to further specify the context:
|
||||
*help-context*
|
||||
Prepend something to specify the context: *help-context*
|
||||
|
||||
WHAT PREPEND EXAMPLE ~
|
||||
Normal mode command (nothing) :help x
|
||||
Normal mode command :help x
|
||||
Visual mode command v_ :help v_u
|
||||
Insert mode command i_ :help i_<Esc>
|
||||
Command-line command : :help :quit
|
||||
@ -24,6 +24,8 @@ Get specific help: It is possible to go directly to whatever you want help
|
||||
Vim command argument - :help -r
|
||||
Option ' :help 'textwidth'
|
||||
Regular expression / :help /[
|
||||
See |help-summary| for more contexts and an explanation.
|
||||
|
||||
Search for help: Type ":help word", then hit CTRL-D to see matching
|
||||
help entries for "word".
|
||||
Or use ":helpgrep word". |:helpgrep|
|
||||
@ -152,6 +154,7 @@ GUI ~
|
||||
Interfaces ~
|
||||
|if_cscop.txt| using Cscope with Vim
|
||||
|if_pyth.txt| Python interface
|
||||
|if_ruby.txt| Ruby interface
|
||||
|debugger.txt| Interface with a debugger
|
||||
|sign.txt| debugging signs
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*helphelp.txt* For Vim version 7.4. Last change: 2014 Sep 19
|
||||
*helphelp.txt* For Vim version 7.4. Last change: 2016 Apr 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -188,6 +188,9 @@ command: >
|
||||
*E154* *E150* *E151* *E152* *E153* *E670*
|
||||
:helpt[ags] [++t] {dir}
|
||||
Generate the help tags file(s) for directory {dir}.
|
||||
When {dir} is ALL then all "doc" directories in
|
||||
'runtimepath' will be used.
|
||||
|
||||
All "*.txt" and "*.??x" files in the directory and
|
||||
sub-directories are scanned for a help tag definition
|
||||
in between stars. The "*.??x" files are for
|
||||
@ -196,9 +199,11 @@ command: >
|
||||
sorted.
|
||||
When there are duplicates an error message is given.
|
||||
An existing tags file is silently overwritten.
|
||||
|
||||
The optional "++t" argument forces adding the
|
||||
"help-tags" tag. This is also done when the {dir} is
|
||||
equal to $VIMRUNTIME/doc.
|
||||
|
||||
To rebuild the help tags in the runtime directory
|
||||
(requires write permission there): >
|
||||
:helptags $VIMRUNTIME/doc
|
||||
@ -249,7 +254,9 @@ The second one finds the English user manual, even when 'helplang' is set to
|
||||
|
||||
When using command-line completion for the ":help" command, the "@en"
|
||||
extension is only shown when a tag exists for multiple languages. When the
|
||||
tag only exists for English "@en" is omitted.
|
||||
tag only exists for English "@en" is omitted. When the first candidate has an
|
||||
"@ab" extension and it matches the first language in 'helplang' "@ab" is also
|
||||
omitted.
|
||||
|
||||
When using |CTRL-]| or ":help!" in a non-English help file Vim will try to
|
||||
find the tag in the same language. If not found then 'helplang' will be used
|
||||
@ -306,6 +313,10 @@ aligned on a line.
|
||||
When referring to an existing help tag and to create a hot-link, place the
|
||||
name between two bars (|) eg. |help-writing|.
|
||||
|
||||
When referring to a Vim command and to create a hot-link, place the
|
||||
name between two backticks, eg. inside `:filetype`. You will see this is
|
||||
highlighted as a command, like a code block (see below).
|
||||
|
||||
When referring to a Vim option in the help file, place the option name between
|
||||
two single quotes, eg. 'statusline'
|
||||
|
||||
|
@ -16,7 +16,7 @@ The Python Interface to Vim *python* *Python*
|
||||
8. pyeval(), py3eval() Vim functions |python-pyeval|
|
||||
9. Python 3 |python3|
|
||||
|
||||
See |nvim-python| for more information. {Nvim}
|
||||
See |provider-python| for more information. {Nvim}
|
||||
|
||||
==============================================================================
|
||||
1. Commands *python-commands*
|
||||
|
185
runtime/doc/if_ruby.txt
Normal file
185
runtime/doc/if_ruby.txt
Normal file
@ -0,0 +1,185 @@
|
||||
*if_ruby.txt*
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Shugo Maeda
|
||||
|
||||
The Ruby Interface to Vim *ruby* *Ruby*
|
||||
|
||||
|
||||
1. Commands |ruby-commands|
|
||||
2. The VIM module |ruby-vim|
|
||||
3. VIM::Buffer objects |ruby-buffer|
|
||||
4. VIM::Window objects |ruby-window|
|
||||
5. Global variables |ruby-globals|
|
||||
|
||||
*E266* *E267* *E268* *E269* *E270* *E271* *E272* *E273*
|
||||
|
||||
The home page for ruby is http://www.ruby-lang.org/. You can find links for
|
||||
downloading Ruby there.
|
||||
|
||||
==============================================================================
|
||||
1. Commands *ruby-commands*
|
||||
|
||||
*:ruby* *:rub*
|
||||
:rub[y] {cmd} Execute Ruby command {cmd}. A command to try it out: >
|
||||
:ruby print "Hello"
|
||||
|
||||
:rub[y] << {endpattern}
|
||||
{script}
|
||||
{endpattern}
|
||||
Execute Ruby script {script}.
|
||||
{endpattern} must NOT be preceded by any white space.
|
||||
If {endpattern} is omitted, it defaults to a dot '.'
|
||||
like for the |:append| and |:insert| commands. This
|
||||
form of the |:ruby| command is mainly useful for
|
||||
including ruby code in vim scripts.
|
||||
Note: This command doesn't work when the Ruby feature
|
||||
wasn't compiled in. To avoid errors, see
|
||||
|script-here|.
|
||||
|
||||
Example Vim script: >
|
||||
|
||||
function! RedGem()
|
||||
ruby << EOF
|
||||
class Garnet
|
||||
def initialize(s)
|
||||
@buffer = VIM::Buffer.current
|
||||
vimputs(s)
|
||||
end
|
||||
def vimputs(s)
|
||||
@buffer.append(@buffer.count,s)
|
||||
end
|
||||
end
|
||||
gem = Garnet.new("pretty")
|
||||
EOF
|
||||
endfunction
|
||||
<
|
||||
|
||||
*:rubydo* *:rubyd* *E265*
|
||||
:[range]rubyd[o] {cmd} Evaluate Ruby command {cmd} for each line in the
|
||||
[range], with $_ being set to the text of each line in
|
||||
turn, without a trailing <EOL>. Setting $_ will change
|
||||
the text, but note that it is not possible to add or
|
||||
delete lines using this command.
|
||||
The default for [range] is the whole file: "1,$".
|
||||
|
||||
*:rubyfile* *:rubyf*
|
||||
:rubyf[ile] {file} Execute the Ruby script in {file}. This is the same as
|
||||
":ruby load 'file'", but allows file name completion.
|
||||
|
||||
Executing Ruby commands is not possible in the |sandbox|.
|
||||
|
||||
==============================================================================
|
||||
2. The VIM module *ruby-vim*
|
||||
|
||||
Ruby code gets all of its access to vim via the "VIM" module.
|
||||
|
||||
Overview >
|
||||
print "Hello" # displays a message
|
||||
VIM.command(cmd) # execute an Ex command
|
||||
num = VIM::Window.count # gets the number of windows
|
||||
w = VIM::Window[n] # gets window "n"
|
||||
cw = VIM::Window.current # gets the current window
|
||||
num = VIM::Buffer.count # gets the number of buffers
|
||||
b = VIM::Buffer[n] # gets buffer "n"
|
||||
cb = VIM::Buffer.current # gets the current buffer
|
||||
w.height = lines # sets the window height
|
||||
w.cursor = [row, col] # sets the window cursor position
|
||||
pos = w.cursor # gets an array [row, col]
|
||||
name = b.name # gets the buffer file name
|
||||
line = b[n] # gets a line from the buffer
|
||||
num = b.count # gets the number of lines
|
||||
b[n] = str # sets a line in the buffer
|
||||
b.delete(n) # deletes a line
|
||||
b.append(n, str) # appends a line after n
|
||||
line = VIM::Buffer.current.line # gets the current line
|
||||
num = VIM::Buffer.current.line_number # gets the current line number
|
||||
VIM::Buffer.current.line = "test" # sets the current line number
|
||||
<
|
||||
|
||||
Module Functions:
|
||||
|
||||
*ruby-message*
|
||||
VIM::message({msg})
|
||||
Displays the message {msg}.
|
||||
|
||||
*ruby-set_option*
|
||||
VIM::set_option({arg})
|
||||
Sets a vim option. {arg} can be any argument that the ":set" command
|
||||
accepts. Note that this means that no spaces are allowed in the
|
||||
argument! See |:set|.
|
||||
|
||||
*ruby-command*
|
||||
VIM::command({cmd})
|
||||
Executes Ex command {cmd}.
|
||||
|
||||
*ruby-evaluate*
|
||||
VIM::evaluate({expr})
|
||||
Evaluates {expr} using the vim internal expression evaluator (see
|
||||
|expression|). Returns the expression result as a string.
|
||||
A |List| is turned into a string by joining the items and inserting
|
||||
line breaks.
|
||||
|
||||
==============================================================================
|
||||
3. VIM::Buffer objects *ruby-buffer*
|
||||
|
||||
VIM::Buffer objects represent vim buffers.
|
||||
|
||||
Class Methods:
|
||||
|
||||
current Returns the current buffer object.
|
||||
count Returns the number of buffers.
|
||||
self[{n}] Returns the buffer object for the number {n}. The first number
|
||||
is 0.
|
||||
|
||||
Methods:
|
||||
|
||||
name Returns the name of the buffer.
|
||||
number Returns the number of the buffer.
|
||||
count Returns the number of lines.
|
||||
length Returns the number of lines.
|
||||
self[{n}] Returns a line from the buffer. {n} is the line number.
|
||||
self[{n}] = {str}
|
||||
Sets a line in the buffer. {n} is the line number.
|
||||
delete({n}) Deletes a line from the buffer. {n} is the line number.
|
||||
append({n}, {str})
|
||||
Appends a line after the line {n}.
|
||||
line Returns the current line of the buffer if the buffer is
|
||||
active.
|
||||
line = {str} Sets the current line of the buffer if the buffer is active.
|
||||
line_number Returns the number of the current line if the buffer is
|
||||
active.
|
||||
|
||||
==============================================================================
|
||||
4. VIM::Window objects *ruby-window*
|
||||
|
||||
VIM::Window objects represent vim windows.
|
||||
|
||||
Class Methods:
|
||||
|
||||
current Returns the current window object.
|
||||
count Returns the number of windows.
|
||||
self[{n}] Returns the window object for the number {n}. The first number
|
||||
is 0.
|
||||
|
||||
Methods:
|
||||
|
||||
buffer Returns the buffer displayed in the window.
|
||||
height Returns the height of the window.
|
||||
height = {n} Sets the window height to {n}.
|
||||
width Returns the width of the window.
|
||||
width = {n} Sets the window width to {n}.
|
||||
cursor Returns a [row, col] array for the cursor position.
|
||||
cursor = [{row}, {col}]
|
||||
Sets the cursor position to {row} and {col}.
|
||||
|
||||
==============================================================================
|
||||
5. Global variables *ruby-globals*
|
||||
|
||||
There are two global variables.
|
||||
|
||||
$curwin The current window object.
|
||||
$curbuf The current buffer object.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 7.4. Last change: 2015 Feb 12
|
||||
*index.txt* For Vim version 7.4. Last change: 2016 Mar 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1378,6 +1378,8 @@ tag command action ~
|
||||
|:ounmap| :ou[nmap] like ":unmap" but for Operator-pending mode
|
||||
|:ounmenu| :ounme[nu] remove menu for Operator-pending mode
|
||||
|:ownsyntax| :ow[nsyntax] set new local syntax highlight for this window
|
||||
|:packadd| :pa[ckadd] add a plugin from 'packpath'
|
||||
|:packloadall| :packl[oadall] load all packages under 'packpath'
|
||||
|:pclose| :pc[lose] close preview window
|
||||
|:pedit| :ped[it] edit file in the preview window
|
||||
|:print| :p[rint] print lines
|
||||
@ -1515,14 +1517,14 @@ tag command action ~
|
||||
|:tabdo| :tabdo execute command in each tab page
|
||||
|:tabedit| :tabe[dit] edit a file in a new tab page
|
||||
|:tabfind| :tabf[ind] find file in 'path', edit it in a new tab page
|
||||
|:tabfirst| :tabfir[st] got to first tab page
|
||||
|:tablast| :tabl[ast] got to last tab page
|
||||
|:tabfirst| :tabfir[st] go to first tab page
|
||||
|:tablast| :tabl[ast] go to last tab page
|
||||
|:tabmove| :tabm[ove] move tab page to other position
|
||||
|:tabnew| :tabnew edit a file in a new tab page
|
||||
|:tabnext| :tabn[ext] go to next tab page
|
||||
|:tabonly| :tabo[nly] close all tab pages except the current one
|
||||
|:tabprevious| :tabp[revious] go to previous tab page
|
||||
|:tabrewind| :tabr[ewind] got to first tab page
|
||||
|:tabrewind| :tabr[ewind] go to first tab page
|
||||
|:tabs| :tabs list the tab pages and what they contain
|
||||
|:tab| :tab create new tab when opening new window
|
||||
|:tag| :ta[g] jump to tag
|
||||
|
@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 7.4. Last change: 2015 Jun 20
|
||||
*insert.txt* For Vim version 7.4. Last change: 2016 Jan 31
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -148,7 +148,7 @@ CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
|
||||
CTRL-R a results in "ac".
|
||||
CTRL-R CTRL-R a results in "ab^Hc".
|
||||
< Options 'textwidth', 'formatoptions', etc. still apply. If
|
||||
you also want to avoid these, use "<C-R><C-O>r", see below.
|
||||
you also want to avoid these, use CTRL-R CTRL-O, see below.
|
||||
The '.' register (last inserted text) is still inserted as
|
||||
typed.
|
||||
|
||||
|
@ -40,7 +40,7 @@ for details.
|
||||
Job control is achieved by calling a combination of the |jobstart()|,
|
||||
|jobsend()| and |jobstop()| functions. Here's an example:
|
||||
>
|
||||
function s:JobHandler(job_id, data, event)
|
||||
function! s:JobHandler(job_id, data, event)
|
||||
if a:event == 'stdout'
|
||||
let str = self.shell.' stdout: '.join(a:data)
|
||||
elseif a:event == 'stderr'
|
||||
@ -84,6 +84,19 @@ Here's what is happening:
|
||||
program.
|
||||
2: The event type, which is "stdout", "stderr" or "exit".
|
||||
|
||||
Note: Buffered stdout/stderr data which has not been flushed by the sender
|
||||
will not trigger the "stdout" callback (but if the process ends, the
|
||||
"exit" callback will be triggered).
|
||||
For example, "ruby -e" buffers output, so small strings will be
|
||||
buffered unless "auto-flushing" ($stdout.sync=true) is enabled. >
|
||||
function! Receive(job_id, data, event)
|
||||
echom printf('%s: %s',a:event,string(a:data))
|
||||
endfunction
|
||||
call jobstart(['ruby', '-e',
|
||||
\ '$stdout.sync = true; 5.times do sleep 1 and puts "Hello Ruby!" end'],
|
||||
\ {'on_stdout': 'Receive'})
|
||||
< https://github.com/neovim/neovim/issues/1592
|
||||
|
||||
The options dictionary is passed as the "self" variable to the callback
|
||||
function. Here's a more object-oriented version of the above:
|
||||
>
|
||||
|
@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 7.4. Last change: 2014 Dec 08
|
||||
*map.txt* For Vim version 7.4. Last change: 2016 Jan 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -55,6 +55,7 @@ modes.
|
||||
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
|
||||
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
|
||||
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
|
||||
:tm[ap] {lhs} {rhs} |mapmode-t| *:tm* *:tmap*
|
||||
Map the key sequence {lhs} to {rhs} for the modes
|
||||
where the map command applies. The result, including
|
||||
{rhs}, is then further scanned for mappings. This
|
||||
@ -71,6 +72,7 @@ modes.
|
||||
:ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inoremap*
|
||||
:ln[oremap] {lhs} {rhs} |mapmode-l| *:ln* *:lnoremap*
|
||||
:cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap*
|
||||
:tno[remap] {lhs} {rhs} |mapmode-t| *:tno* *:tnoremap*
|
||||
Map the key sequence {lhs} to {rhs} for the modes
|
||||
where the map command applies. Disallow mapping of
|
||||
{rhs}, to avoid nested and recursive mappings. Often
|
||||
@ -87,6 +89,7 @@ modes.
|
||||
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
|
||||
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
|
||||
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
|
||||
:tu[nmap] {lhs} |mapmode-t| *:tu* *:tunmap*
|
||||
Remove the mapping of {lhs} for the modes where the
|
||||
map command applies. The mapping may remain defined
|
||||
for other modes where it applies.
|
||||
@ -105,6 +108,7 @@ modes.
|
||||
:imapc[lear] |mapmode-i| *:imapc* *:imapclear*
|
||||
:lmapc[lear] |mapmode-l| *:lmapc* *:lmapclear*
|
||||
:cmapc[lear] |mapmode-c| *:cmapc* *:cmapclear*
|
||||
:tmapc[lear] |mapmode-t| *:tmapc* *:tmapclear*
|
||||
Remove ALL mappings for the modes where the map
|
||||
command applies.
|
||||
Use the <buffer> argument to remove buffer-local
|
||||
@ -121,6 +125,7 @@ modes.
|
||||
:im[ap] |mapmode-i|
|
||||
:lm[ap] |mapmode-l|
|
||||
:cm[ap] |mapmode-c|
|
||||
:tm[ap] |mapmode-t|
|
||||
List all key mappings for the modes where the map
|
||||
command applies. Note that ":map" and ":map!" are
|
||||
used most often, because they include the other modes.
|
||||
@ -135,6 +140,7 @@ modes.
|
||||
:im[ap] {lhs} |mapmode-i| *:imap_l*
|
||||
:lm[ap] {lhs} |mapmode-l| *:lmap_l*
|
||||
:cm[ap] {lhs} |mapmode-c| *:cmap_l*
|
||||
:tm[ap] {lhs} |mapmode-t| *:tmap_l*
|
||||
List the key mappings for the key sequences starting
|
||||
with {lhs} in the modes where the map command applies.
|
||||
|
||||
@ -288,9 +294,9 @@ as a special key.
|
||||
|
||||
|
||||
1.3 MAPPING AND MODES *:map-modes*
|
||||
*mapmode-nvo* *mapmode-n* *mapmode-v* *mapmode-o*
|
||||
*mapmode-nvo* *mapmode-n* *mapmode-v* *mapmode-o* *mapmode-t*
|
||||
|
||||
There are six sets of mappings
|
||||
There are seven sets of mappings
|
||||
- For Normal mode: When typing commands.
|
||||
- For Visual mode: When typing commands while the Visual area is highlighted.
|
||||
- For Select mode: like Visual mode but typing text replaces the selection.
|
||||
@ -298,6 +304,7 @@ There are six sets of mappings
|
||||
etc.). See below: |omap-info|.
|
||||
- For Insert mode. These are also used in Replace mode.
|
||||
- For Command-line mode: When entering a ":" or "/" command.
|
||||
- For Terminal mode: When typing in a |:terminal| buffer.
|
||||
|
||||
Special case: While typing a count for a command in Normal mode, mapping zero
|
||||
is disabled. This makes it possible to map zero without making it impossible
|
||||
@ -316,6 +323,7 @@ Overview of which map command works in which mode. More details below.
|
||||
:imap :inoremap :iunmap Insert
|
||||
:lmap :lnoremap :lunmap Insert, Command-line, Lang-Arg
|
||||
:cmap :cnoremap :cunmap Command-line
|
||||
:tmap :tnoremap :tunmap Terminal
|
||||
|
||||
|
||||
COMMANDS MODES ~
|
||||
@ -481,7 +489,7 @@ internal code is written to the script file.
|
||||
|
||||
|
||||
1.6 SPECIAL CHARACTERS *:map-special-chars*
|
||||
*map_backslash*
|
||||
*map_backslash* *map-backslash*
|
||||
Note that only CTRL-V is mentioned here as a special character for mappings
|
||||
and abbreviations. When 'cpoptions' does not contain 'B', a backslash can
|
||||
also be used like CTRL-V. The <> notation can be fully used then |<>|. But
|
||||
@ -492,21 +500,21 @@ To map a backslash, or use a backslash literally in the {rhs}, the special
|
||||
sequence "<Bslash>" can be used. This avoids the need to double backslashes
|
||||
when using nested mappings.
|
||||
|
||||
*map_CTRL-C*
|
||||
*map_CTRL-C* *map-CTRL-C*
|
||||
Using CTRL-C in the {lhs} is possible, but it will only work when Vim is
|
||||
waiting for a key, not when Vim is busy with something. When Vim is busy
|
||||
CTRL-C interrupts/breaks the command.
|
||||
When using the GUI version on MS-Windows CTRL-C can be mapped to allow a Copy
|
||||
command to the clipboard. Use CTRL-Break to interrupt Vim.
|
||||
|
||||
*map_space_in_lhs*
|
||||
*map_space_in_lhs* *map-space_in_lhs*
|
||||
To include a space in {lhs} precede it with a CTRL-V (type two CTRL-Vs for
|
||||
each space).
|
||||
*map_space_in_rhs*
|
||||
*map_space_in_rhs* *map-space_in_rhs*
|
||||
If you want a {rhs} that starts with a space, use "<Space>". To be fully Vi
|
||||
compatible (but unreadable) don't use the |<>| notation, precede {rhs} with a
|
||||
single CTRL-V (you have to type CTRL-V two times).
|
||||
*map_empty_rhs*
|
||||
*map_empty_rhs* *map-empty-rhs*
|
||||
You can create an empty {rhs} by typing nothing after a single CTRL-V (you
|
||||
have to type CTRL-V two times). Unfortunately, you cannot do this in a vimrc
|
||||
file.
|
||||
@ -581,7 +589,7 @@ Upper and lowercase differences are ignored.
|
||||
It is not possible to put a comment after these commands, because the '"'
|
||||
character is considered to be part of the {lhs} or {rhs}.
|
||||
|
||||
*map_bar*
|
||||
*map_bar* *map-bar*
|
||||
Since the '|' character is used to separate a map command from the next
|
||||
command, you will have to do something special to include a '|' in {rhs}.
|
||||
There are three methods:
|
||||
@ -599,7 +607,7 @@ When 'b' is present in 'cpoptions', "\|" will be recognized as a mapping
|
||||
ending in a '\' and then another command. This is Vi compatible, but
|
||||
illogical when compared to other commands.
|
||||
|
||||
*map_return*
|
||||
*map_return* *map-return*
|
||||
When you have a mapping that contains an Ex command, you need to put a line
|
||||
terminator after it to have it executed. The use of <CR> is recommended for
|
||||
this (see |<>|). Example: >
|
||||
|
@ -1,4 +1,4 @@
|
||||
*message.txt* For Vim version 7.4. Last change: 2013 Feb 23
|
||||
*message.txt* For Vim version 7.4. Last change: 2016 Feb 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
@ -1,4 +1,4 @@
|
||||
*mlang.txt* For Vim version 7.4. Last change: 2012 Jan 15
|
||||
*mlang.txt* For Vim version 7.4. Last change: 2016 Jan 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -94,13 +94,15 @@ If you used the self-installing .exe file, message translations should work
|
||||
already. Otherwise get the libintl.dll file if you don't have it yet:
|
||||
|
||||
http://sourceforge.net/projects/gettext
|
||||
Or:
|
||||
https://mlocati.github.io/gettext-iconv-windows/
|
||||
|
||||
This also contains tools xgettext, msgformat and others.
|
||||
|
||||
libintl.dll should be placed in same directory with (g)vim.exe, or some
|
||||
place where PATH environment value describe. Message files (vim.mo)
|
||||
have to be placed in "$VIMRUNTIME/lang/xx/LC_MESSAGES", where "xx" is the
|
||||
abbreviation of the language (mostly two letters).
|
||||
place where PATH environment value describe. Vim also finds libintl-8.dll.
|
||||
Message files (vim.mo) have to be placed in "$VIMRUNTIME/lang/xx/LC_MESSAGES",
|
||||
where "xx" is the abbreviation of the language (mostly two letters).
|
||||
|
||||
If you write your own translations you need to generate the .po file and
|
||||
convert it to a .mo file. You need to get the source distribution and read
|
||||
|
@ -1,97 +1,92 @@
|
||||
*msgpack_rpc.txt* For Nvim. {Nvim}
|
||||
*msgpack_rpc.txt* {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||
|
||||
|
||||
The Msgpack-RPC Interface to Nvim *msgpack-rpc*
|
||||
RPC API for Nvim *RPC* *rpc* *msgpack-rpc*
|
||||
|
||||
1. Introduction |msgpack-rpc-intro|
|
||||
2. API mapping |msgpack-rpc-api|
|
||||
3. Connecting |msgpack-rpc-connecting|
|
||||
4. Clients |msgpack-rpc-clients|
|
||||
5. Types |msgpack-rpc-types|
|
||||
6. Wrapping methods |msgpack-rpc-wrap-methods|
|
||||
7. Vimscript functions |msgpack-rpc-vim-functions|
|
||||
1. Introduction |rpc-intro|
|
||||
2. API mapping |rpc-api|
|
||||
3. Connecting |rpc-connecting|
|
||||
4. Clients |rpc-api-client|
|
||||
5. Types |rpc-types|
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *msgpack-rpc-intro*
|
||||
1. Introduction *rpc-intro*
|
||||
|
||||
The primary way to control a running Nvim instance is through
|
||||
MessagePack-RPC, a messaging protocol that uses the MessagePack serialization
|
||||
format: https://github.com/msgpack/msgpack/blob/7498cf3/spec.md.
|
||||
From now on, we refer to the protocol as msgpack-rpc.
|
||||
The primary way to control Nvim programmatically is the RPC API, which speaks
|
||||
MessagePack-RPC ("msgpack-rpc"), a messaging protocol that uses the
|
||||
MessagePack serialization format:
|
||||
https://github.com/msgpack/msgpack/blob/0b8f5ac/spec.md
|
||||
|
||||
At this point, only plugins use msgpack-rpc, but eventually even user
|
||||
interaction will happen through it, since user interfaces will be separate
|
||||
programs that control a headless Nvim instance.
|
||||
All kinds of Nvim "clients" use the RPC API: user interfaces (GUIs), remote
|
||||
plugins, scripts like "nvr" (https://github.com/mhinz/neovim-remote), and even
|
||||
`nvim` itself can control other `nvim` instances. By connecting to the RPC API
|
||||
programs can:
|
||||
|
||||
By connecting to the msgpack-rpc interface, programs can:
|
||||
|
||||
- Call any Nvim API function
|
||||
- Listen for Nvim events
|
||||
- Call any API function
|
||||
- Listen for events
|
||||
- Receive remote calls from Nvim
|
||||
|
||||
Nvim's msgpack-rpc interface is like a more powerful version of Vim's
|
||||
`clientserver` feature.
|
||||
The RPC API is like a more powerful version of Vim's `clientserver` feature.
|
||||
|
||||
==============================================================================
|
||||
2. API mapping *msgpack-rpc-api*
|
||||
2. API mapping *rpc-api*
|
||||
|
||||
The Nvim C API, see |nvim-api|, is automatically exposed to the msgpack-rpc
|
||||
interface by the build system, which parses headers at src/nvim/api from the
|
||||
project root. A dispatch function is generated, which matches msgpack-rpc method
|
||||
names with non-static API functions, converting/validating arguments and return
|
||||
values back to msgpack.
|
||||
The Nvim C |API| is automatically exposed to the RPC API by the build system,
|
||||
which parses headers at src/nvim/api/*. A dispatch function is generated which
|
||||
matches RPC API method names with public API functions, converting/validating
|
||||
arguments and return values back to msgpack.
|
||||
|
||||
Client libraries will normally provide wrappers that hide msgpack-rpc details
|
||||
from programmers. The wrappers can be automatically generated by reading
|
||||
bundled API metadata from a compiled Nvim instance.
|
||||
Client libraries (|api-client|s) normally provide wrappers that hide
|
||||
msgpack-rpc details from application developers. The wrappers can be
|
||||
automatically generated by reading bundled API metadata from a compiled Nvim
|
||||
instance.
|
||||
|
||||
There are two ways to obtain API metadata:
|
||||
There are three ways to obtain API metadata:
|
||||
|
||||
1. By connecting to a running Nvim instance and calling `vim_get_api_info`
|
||||
via msgpack-rpc. This is best for clients written in dynamically-typed
|
||||
languages, which can define functions at runtime.
|
||||
1. Connect to a running Nvim instance and call `vim_get_api_info` via
|
||||
msgpack-rpc. This is best for clients written in dynamic languages which
|
||||
can define functions at runtime.
|
||||
|
||||
2. By starting Nvim with the `--api-info` command-line option, which makes Nvim
|
||||
dump a blob of msgpack metadata to standard output and exit. This is best
|
||||
for clients written in statically-typed languages, which require a separate
|
||||
compilation step.
|
||||
2. Start Nvim with the |--api-info| option. Useful for clients written in
|
||||
statically-compiled languages.
|
||||
|
||||
Here's a simple way to get human-readable description of the API (requires
|
||||
Python and the `pyyaml`/`msgpack-python` pip packages):
|
||||
>
|
||||
nvim --api-info | python -c 'import msgpack, sys, yaml; print yaml.dump(msgpack.unpackb(sys.stdin.read()))' > api.yaml
|
||||
3. Use the |api_info()| vimscript function.
|
||||
|
||||
To get a human-readable list of API functions: >
|
||||
:new|put =map(api_info().functions, 'v:val.name')
|
||||
<
|
||||
To get a formatted dump of the API using python (requires the `pyyaml` and
|
||||
`msgpack-python` packages): >
|
||||
nvim --api-info | python -c 'import msgpack, sys, yaml; print yaml.dump(msgpack.unpackb(sys.stdin.read()))'
|
||||
<
|
||||
==============================================================================
|
||||
3. Connecting *msgpack-rpc-connecting*
|
||||
3. Connecting *rpc-connecting*
|
||||
|
||||
There are four ways to open msgpack-rpc streams to Nvim:
|
||||
There are several ways to open a msgpack-rpc channel to an Nvim instance:
|
||||
|
||||
1. Through Nvim's stdin/stdout when it's started with the `--embed` option.
|
||||
This is how other programs can embed Nvim.
|
||||
1. Through stdin/stdout when `nvim` is started with `--embed`. This is how
|
||||
applications can embed Nvim.
|
||||
|
||||
2. Through the stdin/stdout of a program spawned by the |rpcstart()| function.
|
||||
2. Through stdin/stdout of some other process spawned by |jobstart()|.
|
||||
Set the "rpc" key to |v:true| in the options dict to use the job's stdin
|
||||
and stdout as a single msgpack channel that is processed directly by
|
||||
Nvim. Then it is not possible to process raw data to or from the
|
||||
process's stdin and stdout. stderr can still be used, though.
|
||||
|
||||
*$NVIM_LISTEN_ADDRESS*
|
||||
3. Through the socket automatically created with each instance. To get the
|
||||
socket location for a running Nvim instance (which is random by default),
|
||||
see the |$NVIM_LISTEN_ADDRESS| environment variable:
|
||||
>
|
||||
:echo $NVIM_LISTEN_ADDRESS
|
||||
<
|
||||
See also |v:servername|.
|
||||
3. Through the socket automatically created with each instance. The socket
|
||||
location is stored in |v:servername|.
|
||||
|
||||
4. Through a TCP/IP socket. To make Nvim listen on a TCP/IP socket, set the
|
||||
|$NVIM_LISTEN_ADDRESS| environment variable in a shell before starting Nvim:
|
||||
>
|
||||
|$NVIM_LISTEN_ADDRESS| environment variable before starting Nvim: >
|
||||
NVIM_LISTEN_ADDRESS=127.0.0.1:6666 nvim
|
||||
<
|
||||
Connecting to the socket is the easiest way a programmer can test the API, which
|
||||
can be done through any msgpack-rpc client library or fully-featured Nvim client
|
||||
(which we'll see in the next section). Here's a Ruby script that prints 'hello
|
||||
world!' in the current Nvim instance:
|
||||
Connecting to the socket is the easiest way a programmer can test the API,
|
||||
which can be done through any msgpack-rpc client library or full-featured
|
||||
|api-client|. Here's a Ruby script that prints 'hello world!' in the current
|
||||
Nvim instance:
|
||||
>
|
||||
#!/usr/bin/env ruby
|
||||
# Requires msgpack-rpc: gem install msgpack-rpc
|
||||
@ -118,58 +113,90 @@ functions can be called interactively:
|
||||
>>> nvim = attach('socket', path='[address]')
|
||||
>>> nvim.command('echo "hello world!"')
|
||||
<
|
||||
One can also spawn and connect to an embedded Nvim instance via |rpcstart()|
|
||||
You can also embed an Nvim instance via |jobstart()|, and communicate using
|
||||
|rpcrequest()| and |rpcnotify()|:
|
||||
>
|
||||
let vim = rpcstart('nvim', ['--embed'])
|
||||
let vim = jobstart(['nvim', '--embed'], {'rpc': v:true})
|
||||
echo rpcrequest(vim, 'vim_eval', '"Hello " . "world!"')
|
||||
call rpcstop(vim)
|
||||
call jobstop(vim)
|
||||
<
|
||||
==============================================================================
|
||||
4. Implementing new clients *msgpack-rpc-clients*
|
||||
4. Implementing API clients *rpc-api-client* *api-client*
|
||||
|
||||
Nvim is still in alpha, so there's no in-depth documentation explaining how to
|
||||
properly implement a client library yet. The Python client (the pip package
|
||||
"neovim") will always be up-to-date with the latest API changes, so its source
|
||||
code is the best documentation currently available. There are some guidelines
|
||||
however:
|
||||
All external UIs and remote plugins (as opposed to regular Vim plugins) are
|
||||
"clients" in general; but we call something an "API client" if its purpose is
|
||||
to abstract or wrap the RPC API for the convenience of other applications
|
||||
(just like a REST client or SDK such as boto3 for AWS: you can speak AWS REST
|
||||
using an HTTP client like curl, but boto3 wraps that in a convenient python
|
||||
interface). For example, the lua-client is an API client:
|
||||
https://github.com/neovim/lua-client
|
||||
|
||||
The Python client (pip package "neovim") is the reference implementation of an
|
||||
API client. It is always up-to-date with the Nvim API, so its source code and
|
||||
test suite are an authoritative reference.
|
||||
https://github.com/neovim/python-client
|
||||
|
||||
API client implementation guidelines ~
|
||||
|
||||
- Separate the transport layer from the rest of the library. See
|
||||
|msgpack-rpc-connecting| for details on how clients can connect to Nvim.
|
||||
|rpc-connecting| for details on how clients can connect to Nvim.
|
||||
- Use a MessagePack library that implements at least version 5 of the
|
||||
MessagePack spec, which supports the `bin` and `ext` types used by Nvim.
|
||||
- Read API metadata in order to create client-side wrappers for all
|
||||
msgpack-rpc methods.
|
||||
- Use a single-threaded event loop library/pattern.
|
||||
- Use a fiber/coroutine library for the language being used for implementing a
|
||||
client. These greatly simplify concurrency and allow the library to expose a
|
||||
blocking API on top of a non-blocking event loop without the complexity that
|
||||
comes with preemptive multitasking.
|
||||
- Don't assume anything about the order that responses to msgpack-rpc requests
|
||||
will arrive.
|
||||
- Use a fiber/coroutine library for the language being used for implementing
|
||||
a client. These greatly simplify concurrency and allow the library to
|
||||
expose a blocking API on top of a non-blocking event loop without the
|
||||
complexity that comes with preemptive multitasking.
|
||||
- Don't assume anything about the order that responses to msgpack-rpc
|
||||
requests will arrive.
|
||||
- Clients should expect msgpack-rpc requests, which need to be handled
|
||||
immediately because Nvim is blocked while waiting for the client response.
|
||||
- Clients should expect to receive msgpack-rpc notifications, but these don't
|
||||
need to be handled immediately because they won't block Nvim (although they
|
||||
should probably be handled immediately anyway).
|
||||
|
||||
Most of the complexity could be handled by a msgpack-rpc library that supports
|
||||
server to client requests and notifications, but it's not clear if this is part
|
||||
of the msgpack-rpc spec. At least the Ruby msgpack-rpc library does not seem
|
||||
to support it:
|
||||
- Clients should expect to receive msgpack-rpc notifications, but these
|
||||
don't need to be handled immediately because they won't block Nvim
|
||||
(although they should probably be handled immediately anyway).
|
||||
|
||||
Note: Most of the complexity could be handled by a msgpack-rpc library that
|
||||
supports server to client requests and notifications, but it's not clear if
|
||||
this is part of the msgpack-rpc spec. At least the Ruby msgpack-rpc library
|
||||
does not seem to support it:
|
||||
https://github.com/msgpack-rpc/msgpack-rpc-ruby/blob/master/lib/msgpack/rpc/transport/tcp.rb#L150-L158
|
||||
|
||||
==============================================================================
|
||||
5. Types *msgpack-rpc-types*
|
||||
API metadata object ~
|
||||
|
||||
Nvim's C API uses custom types for all functions, se |nvim-api-types|.
|
||||
For the purpose of mapping to msgpack, he types can be split into two groups:
|
||||
API clients exist to hide msgpack-rpc details. The API metadata object
|
||||
contains information that makes this task easier (see also |rpc-types|):
|
||||
|
||||
- The "functions" key contains a list of metadata objects for individual
|
||||
functions.
|
||||
- Each function metadata object has |rpc-types| information about the return
|
||||
value and parameters. These can be used for generating strongly-typed APIs
|
||||
in static languages.
|
||||
- Container types may be decorated with type/size constraints, e.g.
|
||||
ArrayOf(Buffer) or ArrayOf(Integer, 2). This can be useful to generate
|
||||
even more strongly-typed APIs.
|
||||
- Methods that operate on instances of Nvim special types (msgpack EXT) are
|
||||
prefixed with the type name in lower case, e.g. `buffer_get_line`
|
||||
represents the `get_line` method of a Buffer instance.
|
||||
- Global methods are prefixed with `vim`, e.g. `vim_get_buffers`.
|
||||
|
||||
So for an object-oriented language, an API client contains the classes
|
||||
representing Nvim special types, and the methods of each class could be
|
||||
defined by inspecting the method name prefix. There could also be a singleton
|
||||
Vim class with methods mapped to functions prefixed with `vim_`.
|
||||
|
||||
==============================================================================
|
||||
5. Types *rpc-types*
|
||||
|
||||
The Nvim C API uses custom types for all functions. |api-types|
|
||||
For the purpose of mapping to msgpack, the types can be split into two groups:
|
||||
|
||||
- Basic types that map natively to msgpack (and probably have a default
|
||||
representation in msgpack-supported programming languages)
|
||||
- Special Nvim types that map to msgpack EXT with custom type codes.
|
||||
|
||||
Basic type mapping:
|
||||
Basic types ~
|
||||
|
||||
Nil -> msgpack nil
|
||||
Boolean -> msgpack boolean
|
||||
@ -179,7 +206,7 @@ String -> msgpack string
|
||||
Array -> msgpack array
|
||||
Dictionary -> msgpack map
|
||||
|
||||
Special Nvim types that use msgpack EXT:
|
||||
Special types (msgpack EXT) ~
|
||||
|
||||
Buffer -> enum value kObjectTypeBuffer
|
||||
Window -> enum value kObjectTypeWindow
|
||||
@ -191,7 +218,7 @@ an integer, but not a Window or Tabpage.
|
||||
|
||||
The most reliable way of determining the type codes for the special Nvim types
|
||||
is to inspect the `types` key of metadata dictionary returned by the
|
||||
`vim_get_api_info` method at runtime. Here's an example JSON representation of
|
||||
`vim_get_api_info` method at runtime. Here's a sample JSON representation of
|
||||
the `types` object:
|
||||
>
|
||||
"types": {
|
||||
@ -206,55 +233,9 @@ the `types` object:
|
||||
}
|
||||
}
|
||||
<
|
||||
Even for statically compiled clients, it's a good practice to avoid hardcoding
|
||||
the type codes, because a client may be built against one Nvim version but connect
|
||||
to another with different type codes.
|
||||
|
||||
==============================================================================
|
||||
6. Wrapping methods *msgpack-rpc-wrap-methods*
|
||||
|
||||
As mentioned before, clients should provide an API that hides msgpack-rpc
|
||||
details from programmers, and the API metadata object contains information
|
||||
that makes this task easier:
|
||||
|
||||
- The "functions" key contains a list of metadata objects for individual
|
||||
functions.
|
||||
- Each function metadata object has type information about the return value
|
||||
and parameters. These can be used for generating strongly-typed APIs in
|
||||
static languages.
|
||||
- Container types may be decorated with type/size constraints, e.g.
|
||||
ArrayOf(Buffer) or ArrayOf(Integer, 2). This can be useful to generate even
|
||||
more strongly-typed APIs.
|
||||
- Methods that operate instances of Nvim's types are prefixed with the type
|
||||
name in lower case, e.g. `buffer_get_line` represents the `get_line` method
|
||||
of a Buffer instance.
|
||||
- Global methods are prefixed with `vim`, e.g. `vim_get_buffers`.
|
||||
|
||||
So, for an object-oriented language, a client library would have the classes
|
||||
that represent Nvim's types, and the methods of each class could be defined
|
||||
by inspecting the method name prefix. There could also be a singleton Vim
|
||||
class with methods mapped to functions prefixed with `vim_`
|
||||
|
||||
==============================================================================
|
||||
7. Vimscript functions *msgpack-rpc-vim-functions*
|
||||
|
||||
Four msgpack-rpc functions are available in Vimscript:
|
||||
|
||||
1. |rpcstart()|: Similarly to |jobstart()|, this will spawn a co-process with
|
||||
its standard handles connected to Nvim. The difference is that it's not
|
||||
possible to process raw data to or from the process's stdin, stdout, or
|
||||
stderr. This is because the job's stdin and stdout are used as a single
|
||||
msgpack channel that is processed directly by Nvim.
|
||||
|
||||
2. |rpcstop()|: Same as |jobstop()|, but operates on handles returned by
|
||||
|rpcstart()|.
|
||||
|
||||
3. |rpcrequest()|: Sends a msgpack-rpc request to the process.
|
||||
|
||||
4. |rpcnotify()|: Sends a msgpack-rpc notification to the process.
|
||||
|
||||
The last two functions may also be used with channels created from
|
||||
connections to |$NVIM_LISTEN_ADDRESS|.
|
||||
Even for statically compiled clients it is good practice to avoid hardcoding
|
||||
the type codes, because a client may be built against one Nvim version but
|
||||
connect to another with different type codes.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
@ -1,24 +1,59 @@
|
||||
*nvim.txt* For Nvim. {Nvim}
|
||||
*nvim.txt* {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL *nvim*
|
||||
NVIM REFERENCE MANUAL
|
||||
|
||||
|
||||
Introduction to Nvim *nvim-intro*
|
||||
Nvim *nvim* *nvim-intro*
|
||||
|
||||
This is an introduction for Vim users who are just getting started with Nvim.
|
||||
It is not meant for Vim beginners. For a basic introduction to Vim,
|
||||
see |help.txt|.
|
||||
If you are new to Vim (and Nvim) see |help.txt| or type ":Tutor".
|
||||
If you already use Vim (but not Nvim) see |nvim-from-vim| for a quickstart.
|
||||
|
||||
1. Transitioning from Vim |nvim-from-vim|
|
||||
2. Differences from Vim |vim-differences|
|
||||
3. Msgpack-RPC |msgpack-rpc|
|
||||
4. Job control |job-control|
|
||||
5. Python plugins |nvim-python|
|
||||
6. Clipboard integration |nvim-clipboard|
|
||||
7. Remote plugins |remote-plugin|
|
||||
8. Provider infrastructure |nvim-provider|
|
||||
9. Integrated terminal emulator |nvim-terminal-emulator|
|
||||
Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim is
|
||||
maintained where possible. See |vim_diff.txt| for the complete reference of
|
||||
differences from Vim.
|
||||
|
||||
==============================================================================
|
||||
Transitioning from Vim *nvim-from-vim*
|
||||
|
||||
To start the transition, link your previous configuration so Nvim can use it:
|
||||
>
|
||||
mkdir ~/.config
|
||||
ln -s ~/.vim ~/.config/nvim
|
||||
ln -s ~/.vimrc ~/.config/nvim/init.vim
|
||||
<
|
||||
Note: If your system sets `$XDG_CONFIG_HOME`, use that instead of `~/.config`
|
||||
in the code above. Nvim follows the XDG |base-directories| convention.
|
||||
|
||||
See |provider-python| and |provider-clipboard| for additional software you
|
||||
might need to use some features.
|
||||
|
||||
Your Vim configuration might not be entirely compatible with Nvim. For a
|
||||
full list of differences between Vim and Nvim see |vim-differences|.
|
||||
|
||||
The |'ttymouse'| option, for example, was removed from Nvim (mouse support
|
||||
should work without it). If you use the same |vimrc| for Vim and Nvim,
|
||||
consider guarding |'ttymouse'| in your configuration like so:
|
||||
>
|
||||
if !has('nvim')
|
||||
set ttymouse=xterm2
|
||||
endif
|
||||
<
|
||||
Conversely, if you have Nvim specific configuration items, you could do
|
||||
this:
|
||||
>
|
||||
if has('nvim')
|
||||
tnoremap <Esc> <C-\><C-n>
|
||||
endif
|
||||
<
|
||||
For a more granular approach use |exists()|:
|
||||
>
|
||||
if exists(':tnoremap')
|
||||
tnoremap <Esc> <C-\><C-n>
|
||||
endif
|
||||
<
|
||||
Now you should be able to explore Nvim more comfortably. Check |nvim-features|
|
||||
for more information.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
@ -1,59 +0,0 @@
|
||||
*nvim_clipboard.txt* For Nvim. {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||
|
||||
|
||||
Clipboard integration for Nvim *nvim-clipboard*
|
||||
|
||||
1. Intro |nvim-clipboard-intro|
|
||||
2. X11 selection mechanism |nvim-clipboard-x11|
|
||||
|
||||
==============================================================================
|
||||
1. Intro *nvim-clipboard-intro*
|
||||
|
||||
Nvim has no direct connection to the system clipboard. Instead, it is
|
||||
accessible through the |nvim-provider| infrastructure, which transparently
|
||||
uses shell commands for communicating with the clipboard.
|
||||
|
||||
Clipboard access is implicitly enabled if any of the following clipboard tools
|
||||
is found in your `$PATH`.
|
||||
|
||||
- xclip
|
||||
- xsel (newer alternative to xclip)
|
||||
- pbcopy/pbpaste (only for Mac OS X)
|
||||
|
||||
The presence of a suitable clipboard tool implicitly enables the '+' and '*'
|
||||
registers.
|
||||
|
||||
If you want to ALWAYS use the clipboard for ALL operations (as opposed
|
||||
to interacting with the '+' and/or '*' registers explicitly), set the
|
||||
following option:
|
||||
>
|
||||
set clipboard+=unnamedplus
|
||||
<
|
||||
See 'clipboard' for details and more options.
|
||||
|
||||
==============================================================================
|
||||
2. X11 selection mechanism *nvim-clipboard-x11* *x11-selection*
|
||||
|
||||
The clipboard providers for X11 store text in what is known as "selections".
|
||||
Selections are "owned" by an application, so when the application is closed,
|
||||
the selection text is lost.
|
||||
|
||||
The contents of selections are held by the originating application (e.g., upon
|
||||
a copy), and only passed on to another application when that other application
|
||||
asks for them (e.g., upon a paste).
|
||||
|
||||
*quoteplus* *quote+*
|
||||
|
||||
There are three documented X11 selections: `PRIMARY`, `SECONDARY`, and `CLIPBOARD`.
|
||||
`CLIPBOARD` is typically used in X11 applications for copy/paste operations
|
||||
(`Ctrl-c`/`v`), while `PRIMARY` is used for the last selected text, which is
|
||||
generally inserted with the middle mouse button.
|
||||
|
||||
Nvim's X11 clipboard providers only utilize the `PRIMARY` and `CLIPBOARD`
|
||||
selections, used for the '*' and '+' registers, respectively.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
@ -1,50 +0,0 @@
|
||||
*nvim_from_vim.txt* For Nvim. {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL
|
||||
|
||||
|
||||
Transitioning from Vim *nvim-from-vim*
|
||||
|
||||
Nvim is emphatically a fork of Vim, so compatibility to Vim should be pretty
|
||||
good.
|
||||
|
||||
To start the transition, link your previous configuration so Nvim can use
|
||||
it:
|
||||
>
|
||||
mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config}
|
||||
ln -s ~/.vim $XDG_CONFIG_HOME/nvim
|
||||
ln -s ~/.vimrc $XDG_CONFIG_HOME/nvim/init.vim
|
||||
<
|
||||
See |nvim-intro|, especially |nvim-python| and |nvim-clipboard|, for
|
||||
additional software you might need to install to use all of Nvim's features.
|
||||
|
||||
Your Vim configuration might not be entirely compatible with Nvim. For a
|
||||
full list of differences between Vim and Nvim, see |vim-differences|.
|
||||
|
||||
The |'ttymouse'| option, for example, was removed from Nvim (mouse support
|
||||
should work without it). If you use the same |vimrc| for Vim and Nvim,
|
||||
consider guarding |'ttymouse'| in your configuration like so:
|
||||
>
|
||||
if !has('nvim')
|
||||
set ttymouse=xterm2
|
||||
endif
|
||||
<
|
||||
Conversely, if you have Nvim specific configuration items, you could do
|
||||
this:
|
||||
>
|
||||
if has('nvim')
|
||||
tnoremap <Esc> <C-\><C-n>
|
||||
endif
|
||||
<
|
||||
For a more granular approach, use |exists()|:
|
||||
>
|
||||
if exists(':tnoremap')
|
||||
tnoremap <Esc> <C-\><C-n>
|
||||
endif
|
||||
<
|
||||
Now you should be able to explore Nvim more comfortably. Check |nvim| for more
|
||||
information.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
@ -1,76 +0,0 @@
|
||||
*nvim_provider.txt* For Nvim. {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||
|
||||
|
||||
Nvim provider infrastructure *nvim-provider*
|
||||
|
||||
First of all, this document is meant to be read by developers interested in
|
||||
contributing to the refactoring effort. If you are a normal user or plugin
|
||||
developer looking to learn about Nvim |msgpack-rpc| infrastructure for
|
||||
implementing plugins in other programming languages, see |remote-plugin|.
|
||||
For instructions on how to enable Python plugins, see |nvim-python|. For
|
||||
clipboard, see |nvim-clipboard|.
|
||||
|
||||
Instead of doing everything by itself, Nvim aims to simplify its own
|
||||
maintenance by delegating as much work as possible to external systems. But
|
||||
some Vim components are too tightly coupled and in some cases the refactoring
|
||||
work necessary to swap in-house implementations by code that integrates to
|
||||
other systems is too great. Nvim provider infrastructure is a facility that
|
||||
aims to make this task simpler.
|
||||
|
||||
To understand why the provider infrastructure is useful, let us consider two
|
||||
examples of integration with external systems that are implemented in Vim and
|
||||
are now decoupled from Nvim core as providers:
|
||||
|
||||
The first example is clipboard integration: in the original Vim source code,
|
||||
clipboard functions account for more than 1k lines of C source code (and that
|
||||
is just on ui.c), all to perform two tasks that are now accomplished with
|
||||
simple shell commands such as xclip or pbcopy/pbpaste.
|
||||
|
||||
The other example is Python scripting support: Vim has three files dedicated to
|
||||
embedding the Python interpreter: if_python.c, if_python3.c and if_py_both.h.
|
||||
Together these files sum about 9.5k lines of C source code. On Nvim, Python
|
||||
scripting is performed by an external host process that is running 2k sloc
|
||||
Python program.
|
||||
|
||||
In a perfect world, we would implement Python and clipboard integration in
|
||||
pure vimscript and without touching the C code. Unfortunately we can't achieve
|
||||
these goals without severely compromising backwards compatibility with Vim.
|
||||
That's where providers come to the rescue.
|
||||
|
||||
In essence, this infrastructure is a simple framework that simplifies the task
|
||||
of calling vimscript from C code, making it simpler to rewrite C functions that
|
||||
interact with external systems in pure vimscript. It is composed of two
|
||||
functions in eval.c:
|
||||
|
||||
- eval_call_provider(name, method, arguments): Call a provider(name) method
|
||||
with arguments
|
||||
- eval_has_provider(name): Checks if a provider is implemented
|
||||
|
||||
What these functions do is simple:
|
||||
|
||||
- eval_call_provider will call the provider#(name)#Call function passing in
|
||||
the method and arguments.
|
||||
- eval_has_provider will return true if the provider#(name)#Call function is
|
||||
implemented, and is called by the "has" vimscript function to check if
|
||||
features are available.
|
||||
|
||||
The basic idea is that the provider#(name)#Call function should implement
|
||||
integration with an external system, because calling shell commands and
|
||||
|msgpack-rpc| clients (Nvim only) is easier to do in vimscript.
|
||||
|
||||
Now, back to the Python example. Instead of modifying vimscript to allow for
|
||||
the definition of lowercase functions and commands (for the |:python|,
|
||||
|:pyfile|, and |:pydo| commands, and the |pyeval()| function), which would
|
||||
break backwards compatibility with Vim, we implemented the
|
||||
autoload/provider/python.vim script and the provider#python#Call function
|
||||
that is only defined if an external Python host is started successfully.
|
||||
|
||||
That works well with the `has('python')` expression (normally used by Python
|
||||
plugins) because if the Python host isn't installed then the plugin will
|
||||
"think" it is running in a Vim compiled without |+python| feature.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
@ -1,95 +0,0 @@
|
||||
*nvim_python.txt* For Nvim. {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||
|
||||
|
||||
Python plugins and scripting in Nvim *nvim-python*
|
||||
|
||||
1. Introduction |nvim-python-intro|
|
||||
2. Quickstart |nvim-python-quickstart|
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *nvim-python-intro*
|
||||
|
||||
Through external Python 2/3 interpreters connected via |msgpack-rpc|, Nvim
|
||||
offers some support for the legacy |python-vim| and |python3| interfaces.
|
||||
|
||||
Note: For now only the old Vim 7.3 API is supported.
|
||||
|
||||
==============================================================================
|
||||
2. Quickstart *nvim-python-quickstart*
|
||||
|
||||
If you used a package manager to install Nvim, there's a good chance that
|
||||
it also provides the `neovim` Python package. If it doesn't, follow these
|
||||
steps to install the package with Python's package manager, `pip`.
|
||||
|
||||
Note: Depending on your system, `pip` might refer to Python 2 or Python 3,
|
||||
which is why the following instructions mention `pip2` or `pip3`
|
||||
explicitly. If one of these is not available for you, maybe `pip`
|
||||
is what you want.
|
||||
|
||||
To use Vim Python 2/3 plugins with Nvim, do the following:
|
||||
|
||||
- For Python 2 plugins, make sure an interpreter for Python 2.6 or 2.7 is
|
||||
available in your `$PATH`, then install the `neovim` Python package systemwide:
|
||||
>
|
||||
$ sudo pip2 install neovim
|
||||
<
|
||||
or for the current user:
|
||||
>
|
||||
$ pip2 install --user neovim
|
||||
<
|
||||
- For Python 3 plugins, make sure an interpreter for Python 3.3 or above is
|
||||
available in your `$PATH`, then install the `neovim` Python package systemwide:
|
||||
>
|
||||
$ sudo pip3 install neovim
|
||||
<
|
||||
or for the current user:
|
||||
>
|
||||
$ pip3 install --user neovim
|
||||
<
|
||||
Note: If you previously installed the package, get the latest version by
|
||||
appending the `--upgrade` flag to the commands above.
|
||||
|
||||
==============================================================================
|
||||
*g:python_host_prog*
|
||||
|
||||
To point Nvim to a specific Python 2 interpreter, set |g:python_host_prog|:
|
||||
>
|
||||
let g:python_host_prog = '/path/to/python'
|
||||
<
|
||||
*g:python3_host_prog*
|
||||
|
||||
To point Nvim to a specific Python 3 interpreter, set |g:python3_host_prog|:
|
||||
>
|
||||
let g:python3_host_prog = '/path/to/python3'
|
||||
<
|
||||
*g:loaded_python_provider*
|
||||
|
||||
To disable Python 2 interface, set `g:loaded_python_provider` to 1:
|
||||
>
|
||||
let g:loaded_python_provider = 1
|
||||
<
|
||||
*g:loaded_python3_provider*
|
||||
|
||||
To disable Python 3 interface, set `g:loaded_python3_provider` to 1:
|
||||
>
|
||||
let g:loaded_python3_provider = 1
|
||||
<
|
||||
*g:python_host_skip_check*
|
||||
|
||||
To disable Python 2 interpreter check, set `g:python_host_skip_check` to 1:
|
||||
Note: If you disable Python 2 check, you must install neovim module properly.
|
||||
>
|
||||
let g:python_host_skip_check = 1
|
||||
<
|
||||
*g:python3_host_skip_check*
|
||||
|
||||
To disable Python 3 interpreter check, set `g:python3_host_skip_check` to 1:
|
||||
Note: If you disable Python 3 check, you must install neovim module properly.
|
||||
>
|
||||
let g:python3_host_skip_check = 1
|
||||
<
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
@ -1,34 +1,31 @@
|
||||
*nvim_terminal_emulator.txt* For Nvim. {Nvim}
|
||||
*terminal_emulator.txt* {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||
|
||||
|
||||
Nvim integrated terminal emulator *nvim-terminal-emulator*
|
||||
Embedded terminal emulator *terminal-emulator*
|
||||
|
||||
1. Introduction |nvim-terminal-emulator-introduction|
|
||||
2. Spawning |nvim-terminal-emulator-spawning|
|
||||
3. Input |nvim-terminal-emulator-input|
|
||||
4. Configuration |nvim-terminal-emulator-configuration|
|
||||
1. Introduction |terminal-emulator-intro|
|
||||
2. Spawning |terminal-emulator-spawning|
|
||||
3. Input |terminal-emulator-input|
|
||||
4. Configuration |terminal-emulator-configuration|
|
||||
5. Status Variables |terminal-emulator-status|
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *nvim-terminal-emulator-introduction*
|
||||
1. Introduction *terminal-emulator-intro*
|
||||
|
||||
One feature that distinguishes Nvim from Vim is that it implements a mostly
|
||||
complete VT220/xterm-like terminal emulator. The terminal is presented to the
|
||||
user as a special buffer type, one that is asynchronously updated to mirror
|
||||
the virtual terminal display as data is received from the program connected
|
||||
to it. For most purposes, terminal buffers behave a lot like normal buffers
|
||||
with 'nomodifiable' set.
|
||||
Nvim offers a mostly complete VT220/xterm terminal emulator. The terminal is
|
||||
presented as a special buffer type, asynchronously updated to mirror the
|
||||
virtual terminal display as data is received from the program connected to it.
|
||||
For most purposes, terminal buffers behave a lot like normal buffers with
|
||||
'nomodifiable' set.
|
||||
|
||||
|
||||
The implementation is powered by libvterm[1], a powerful abstract terminal
|
||||
emulation library.
|
||||
|
||||
[1]: http://www.leonerd.org.uk/code/libvterm/
|
||||
The implementation is powered by libvterm, a powerful abstract terminal
|
||||
emulation library. http://www.leonerd.org.uk/code/libvterm/
|
||||
|
||||
==============================================================================
|
||||
2. Spawning *nvim-terminal-emulator-spawning*
|
||||
2. Spawning *terminal-emulator-spawning*
|
||||
|
||||
There are 3 ways to create a terminal buffer:
|
||||
|
||||
@ -37,16 +34,22 @@ There are 3 ways to create a terminal buffer:
|
||||
- By editing a file with a name matching `term://(.{-}//(\d+:)?)?\zs.*`.
|
||||
For example:
|
||||
>
|
||||
:e term://bash
|
||||
:vsp term://top
|
||||
:edit term://bash
|
||||
:vsplit term://top
|
||||
<
|
||||
Note: The "term://" pattern is handled by a BufReadCmd handler, so the
|
||||
|autocmd-nested| modifier is required to use it in an autocmd. >
|
||||
autocmd VimEnter * nested split term://sh
|
||||
< This is only mentioned for reference; you should use the |:terminal|
|
||||
command instead.
|
||||
|
||||
When the terminal spawns the program, the buffer will start to mirror the
|
||||
terminal display and change its name to `term://$CWD//$PID:$COMMAND`.
|
||||
Note that |:mksession| will "save" the terminal buffers by restarting all
|
||||
programs when the session is restored.
|
||||
|
||||
==============================================================================
|
||||
3. Input *nvim-terminal-emulator-input*
|
||||
3. Input *terminal-emulator-input*
|
||||
|
||||
Sending input is possible by entering terminal mode, which is achieved by
|
||||
pressing any key that would enter insert mode in a normal buffer (|i| or |a|
|
||||
@ -90,7 +93,7 @@ Mouse input is also fully supported, and has the following behavior:
|
||||
the terminal wont lose focus and the hovered window will be scrolled.
|
||||
|
||||
==============================================================================
|
||||
4. Configuration *nvim-terminal-emulator-configuration*
|
||||
4. Configuration *terminal-emulator-configuration*
|
||||
|
||||
Terminal buffers can be customized through the following global/buffer-local
|
||||
variables (set via the |TermOpen| autocmd):
|
||||
@ -110,5 +113,26 @@ There is also a corresponding |TermClose| event.
|
||||
The terminal cursor can be highlighted via |hl-TermCursor| and
|
||||
|hl-TermCursorNC|.
|
||||
|
||||
==============================================================================
|
||||
5. Status Variables *terminal-emulator-status*
|
||||
|
||||
Terminal buffers maintain some information about the terminal in buffer-local
|
||||
variables:
|
||||
|
||||
- *b:term_title* The settable title of the terminal, typically displayed in
|
||||
the window title or tab title of a graphical terminal emulator. Programs
|
||||
running in the terminal can set this title via an escape sequence.
|
||||
- *b:terminal_job_id* The nvim job ID of the job running in the terminal. See
|
||||
|job-control| for more information.
|
||||
- *b:terminal_job_pid* The PID of the top-level process running in the
|
||||
terminal.
|
||||
|
||||
These variables will have a value by the time the TermOpen autocmd runs, and
|
||||
will continue to have a value for the lifetime of the terminal buffer, making
|
||||
them suitable for use in 'statusline'. For example, to show the terminal title
|
||||
as the status line:
|
||||
>
|
||||
:autocmd TermOpen * setlocal statusline=%{b:term_title}
|
||||
<
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 7.4. Last change: 2015 Oct 15
|
||||
*options.txt* For Vim version 7.4. Last change: 2016 Apr 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -49,9 +49,12 @@ achieve special effects. These options come in three forms:
|
||||
:se[t] {option}&vi Reset option to its Vi default value.
|
||||
:se[t] {option}&vim Reset option to its Vim default value.
|
||||
|
||||
:se[t] all& Set all options, except terminal options, to their
|
||||
default value. The values of 'lines' and 'columns'
|
||||
are not changed.
|
||||
:se[t] all& Set all options to their default value. The values of
|
||||
these options are not changed:
|
||||
'columns'
|
||||
'encoding'
|
||||
'lines'
|
||||
Warning: This may have a lot of side effects.
|
||||
|
||||
*:set-args* *E487* *E521*
|
||||
:se[t] {option}={value} or
|
||||
@ -704,7 +707,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
line.
|
||||
When 'smartindent' or 'cindent' is on the indent is changed in
|
||||
a different way.
|
||||
The 'autoindent' option is reset when the 'paste' option is set.
|
||||
The 'autoindent' option is reset when the 'paste' option is set and
|
||||
restored when 'paste' is reset.
|
||||
{small difference from Vi: After the indent is deleted when typing
|
||||
<Esc> or <CR>, the cursor position when moving up or down is after the
|
||||
deleted indent; Vi puts the cursor somewhere in the deleted indent}.
|
||||
@ -1168,8 +1172,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
help help buffer (you are not supposed to set this
|
||||
manually)
|
||||
terminal terminal buffer, this is set automatically when a
|
||||
terminal is created. See |nvim-terminal-emulator| for
|
||||
more information.
|
||||
terminal is created. |terminal-emulator|
|
||||
|
||||
This option is used together with 'bufhidden' and 'swapfile' to
|
||||
specify special kinds of buffers. See |special-buffers|.
|
||||
@ -1349,7 +1352,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
used regardless of whether "unnamed" is in 'clipboard'
|
||||
or not. The clipboard register can always be
|
||||
explicitly accessed using the "* notation. Also see
|
||||
|gui-clipboard|.
|
||||
|clipboard|.
|
||||
|
||||
*clipboard-unnamedplus*
|
||||
unnamedplus A variant of the "unnamed" flag which uses the
|
||||
@ -1359,7 +1362,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
register. When "unnamed" is also included to the
|
||||
option, yank and delete operations (but not put)
|
||||
will additionally copy the text into register
|
||||
'*'. See |nvim-clipboard|.
|
||||
'*'. See |clipboard|.
|
||||
|
||||
*clipboard-autoselect*
|
||||
autoselect Works like the 'a' flag in 'guioptions': If present,
|
||||
@ -1598,7 +1601,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
line, the remaining space is filled in the normal manner.
|
||||
See 'preserveindent'.
|
||||
|
||||
*'cpoptions'* *'cpo'*
|
||||
*'cpoptions'* *'cpo'* *cpo*
|
||||
'cpoptions' 'cpo' string (Vim default: "aABceFs",
|
||||
Vi default: all flags)
|
||||
global
|
||||
@ -2273,6 +2276,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
<Tab>. Spaces are used in indents with the '>' and '<' commands and
|
||||
when 'autoindent' is on. To insert a real tab when 'expandtab' is
|
||||
on, use CTRL-V<Tab>. See also |:retab| and |ins-expandtab|.
|
||||
This option is reset when the 'paste' option is set and restored when
|
||||
the 'paste' option is reset.
|
||||
|
||||
*'exrc'* *'ex'* *'noexrc'* *'noex'*
|
||||
'exrc' 'ex' boolean (default off)
|
||||
@ -2453,8 +2458,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
file only, the option is not changed.
|
||||
When 'binary' is set, the value of 'fileformats' is not used.
|
||||
|
||||
Note that when Vim starts up with an empty buffer this option is not
|
||||
used. Set 'fileformat' in your vimrc instead.
|
||||
When Vim starts up with an empty buffer the first item is used. You
|
||||
can overrule this by setting 'fileformat' in your .vimrc.
|
||||
|
||||
For systems with a Dos-like <EOL> (<CR><NL>), when reading files that
|
||||
are ":source"ed and for vimrc files, automatic <EOL> detection may be
|
||||
@ -2509,17 +2514,17 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
item default Used for ~
|
||||
stl:c ' ' or '^' statusline of the current window
|
||||
stlnc:c ' ' or '-' statusline of the non-current windows
|
||||
stlnc:c ' ' or '=' statusline of the non-current windows
|
||||
vert:c '|' vertical separators |:vsplit|
|
||||
fold:c '-' filling 'foldtext'
|
||||
diff:c '-' deleted lines of the 'diff' option
|
||||
|
||||
Any one that is omitted will fall back to the default. For "stl" and
|
||||
"stlnc" the space will be used when there is highlighting, '^' or '-'
|
||||
"stlnc" the space will be used when there is highlighting, '^' or '='
|
||||
otherwise.
|
||||
|
||||
Example: >
|
||||
:set fillchars=stl:^,stlnc:-,vert:\|,fold:-,diff:-
|
||||
:set fillchars=stl:^,stlnc:=,vert:\|,fold:-,diff:-
|
||||
< This is similar to the default, except that these characters will also
|
||||
be used when there is highlighting.
|
||||
|
||||
@ -3322,8 +3327,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
- no highlighting
|
||||
: use a highlight group
|
||||
The default is used for occasions that are not included.
|
||||
If you want to change what the display modes do, see |dos-colors|
|
||||
for an example.
|
||||
When using the ':' display mode, this must be followed by the name of
|
||||
a highlight group. A highlight group can be used to define any type
|
||||
of highlighting, including using color. See |:highlight| on how to
|
||||
@ -3404,7 +3407,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
Ignore case in search patterns. Also used when searching in the tags
|
||||
file.
|
||||
Also see 'smartcase'.
|
||||
Also see 'smartcase' and 'tagcase'.
|
||||
Can be overruled by using "\c" or "\C" in the pattern, see
|
||||
|/ignorecase|.
|
||||
|
||||
@ -3690,6 +3693,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'*', '"' and '|' (so that CTRL-] on a command finds the help for that
|
||||
command).
|
||||
When the 'lisp' option is on the '-' character is always included.
|
||||
This option also influences syntax highlighting, unless the syntax
|
||||
uses |:syn-iskeyword|.
|
||||
|
||||
*'isprint'* *'isp'*
|
||||
'isprint' 'isp' string (default: "@,161-255")
|
||||
@ -3779,7 +3784,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
feature}
|
||||
This option allows switching your keyboard into a special language
|
||||
mode. When you are typing text in Insert mode the characters are
|
||||
inserted directly. When in command mode the 'langmap' option takes
|
||||
inserted directly. When in Normal mode the 'langmap' option takes
|
||||
care of translating these special characters to the original meaning
|
||||
of the key. This means you don't have to change the keyboard mode to
|
||||
be able to execute Normal mode commands.
|
||||
@ -4146,8 +4151,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
Maximum amount of memory in Kbyte to use for all buffers together.
|
||||
The maximum usable value is about 2000000 (2 Gbyte). Use this to work
|
||||
without a limit. On 64 bit machines higher values might work. But
|
||||
hey, do you really need more than 2 Gbyte for text editing?
|
||||
without a limit.
|
||||
On 64 bit machines higher values might work. But hey, do you really
|
||||
need more than 2 Gbyte for text editing? Keep in mind that text is
|
||||
stored in the swap file, one can edit files > 2 Gbyte anyway. We do
|
||||
need the memory to store undo info.
|
||||
Also see 'maxmem'.
|
||||
|
||||
*'menuitems'* *'mis'*
|
||||
@ -4230,6 +4238,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
written. A ":set nomodified" command also resets the original
|
||||
values to the current values and the 'modified' option will be
|
||||
reset.
|
||||
Similarly for 'eol' and 'bomb'.
|
||||
This option is not set when a change is made to the buffer as the
|
||||
result of a BufNewFile, BufRead/BufReadPost, BufWritePost,
|
||||
FileAppendPost or VimLeave autocommand event. See |gzip-example| for
|
||||
@ -4390,9 +4399,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'mousetime'* *'mouset'*
|
||||
'mousetime' 'mouset' number (default 500)
|
||||
global
|
||||
Only for GUI, Windows and Unix with xterm. Defines the maximum
|
||||
time in msec between two mouse clicks for the second click to be
|
||||
recognized as a multi click.
|
||||
Defines the maximum time in msec between two mouse clicks for the
|
||||
second click to be recognized as a multi click.
|
||||
|
||||
*'nrformats'* *'nf'*
|
||||
'nrformats' 'nf' string (default "bin,hex")
|
||||
@ -4491,6 +4499,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'packpath'* *'pp'*
|
||||
'packpath' 'pp' string (default: see 'runtimepath')
|
||||
{not in Vi}
|
||||
Directories used to find packages. See |packages|.
|
||||
|
||||
|
||||
*'paragraphs'* *'para'*
|
||||
'paragraphs' 'para' string (default "IPLPPPQPP TPHPLIPpLpItpplpipbp")
|
||||
global
|
||||
@ -4517,19 +4531,21 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When the 'paste' option is switched on (also when it was already on):
|
||||
- mapping in Insert mode and Command-line mode is disabled
|
||||
- abbreviations are disabled
|
||||
- 'textwidth' is set to 0
|
||||
- 'wrapmargin' is set to 0
|
||||
- 'autoindent' is reset
|
||||
- 'smartindent' is reset
|
||||
- 'softtabstop' is set to 0
|
||||
- 'expandtab' is reset
|
||||
- 'formatoptions' is used like it is empty
|
||||
- 'revins' is reset
|
||||
- 'ruler' is reset
|
||||
- 'showmatch' is reset
|
||||
- 'formatoptions' is used like it is empty
|
||||
- 'smartindent' is reset
|
||||
- 'smarttab' is reset
|
||||
- 'softtabstop' is set to 0
|
||||
- 'textwidth' is set to 0
|
||||
- 'wrapmargin' is set to 0
|
||||
These options keep their value, but their effect is disabled:
|
||||
- 'lisp'
|
||||
- 'indentexpr'
|
||||
- 'cindent'
|
||||
- 'indentexpr'
|
||||
- 'lisp'
|
||||
NOTE: When you start editing another file while the 'paste' option is
|
||||
on, settings from the modelines or autocommands may change the
|
||||
settings again, causing trouble when pasting text. You might want to
|
||||
@ -4852,7 +4868,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Inserting characters in Insert mode will work backwards. See "typing
|
||||
backwards" |ins-reverse|. This option can be toggled with the CTRL-_
|
||||
command in Insert mode, when 'allowrevins' is set.
|
||||
NOTE: This option is reset when 'paste' is set.
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
|
||||
*'rightleft'* *'rl'* *'norightleft'* *'norl'*
|
||||
'rightleft' 'rl' boolean (default off)
|
||||
@ -4901,7 +4918,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
separated with a dash.
|
||||
For an empty line "0-1" is shown.
|
||||
For an empty buffer the line number will also be zero: "0,0-1".
|
||||
This option is reset when the 'paste' option is set.
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
If you don't want to see the ruler all the time but want to know where
|
||||
you are, use "g CTRL-G" |g_CTRL-G|.
|
||||
|
||||
@ -4924,7 +4942,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
$XDG_CONFIG_DIRS[1]/nvim,
|
||||
$XDG_CONFIG_DIRS[2]/nvim,
|
||||
…
|
||||
$XDG_DATA_HOME/nvim,
|
||||
$XDG_DATA_HOME/nvim/site,
|
||||
$XDG_DATA_DIRS[1]/nvim/site,
|
||||
$XDG_DATA_DIRS[2]/nvim/site,
|
||||
…
|
||||
@ -4932,7 +4950,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
…
|
||||
$XDG_DATA_DIRS[2]/nvim/site/after,
|
||||
$XDG_DATA_DIRS[1]/nvim/site/after,
|
||||
$XDG_DATA_HOME/nvim/after,
|
||||
$XDG_DATA_HOME/nvim/site/after,
|
||||
…
|
||||
$XDG_CONFIG_DIRS[2]/nvim/after,
|
||||
$XDG_CONFIG_DIRS[1]/nvim/after,
|
||||
@ -5609,7 +5627,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
jump is only done if the match can be seen on the screen. The time to
|
||||
show the match can be set with 'matchtime'.
|
||||
A Beep is given if there is no match (no matter if the match can be
|
||||
seen or not). This option is reset when the 'paste' option is set.
|
||||
seen or not).
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
When the 'm' flag is not included in 'cpoptions', typing a character
|
||||
will immediately move the cursor back to where it belongs.
|
||||
See the "sm" field in 'guicursor' for setting the cursor shape and
|
||||
@ -5708,7 +5728,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H.
|
||||
When using the ">>" command, lines starting with '#' are not shifted
|
||||
right.
|
||||
NOTE: When 'paste' is set smart indenting is disabled.
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
|
||||
*'smarttab'* *'sta'* *'nosmarttab'* *'nosta'*
|
||||
'smarttab' 'sta' boolean (default on)
|
||||
@ -5723,6 +5744,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
What gets inserted (a <Tab> or spaces) depends on the 'expandtab'
|
||||
option. Also see |ins-expandtab|. When 'expandtab' is not set, the
|
||||
number of spaces is minimized by using <Tab>s.
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
|
||||
*'softtabstop'* *'sts'*
|
||||
'softtabstop' 'sts' number (default 0)
|
||||
@ -5735,7 +5758,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
commands like "x" still work on the actual characters.
|
||||
When 'sts' is zero, this feature is off.
|
||||
When 'sts' is negative, the value of 'shiftwidth' is used.
|
||||
'softtabstop' is set to 0 when the 'paste' option is set.
|
||||
'softtabstop' is set to 0 when the 'paste' option is set and restored
|
||||
when 'paste' is reset.
|
||||
See also |ins-expandtab|. When 'expandtab' is not set, the number of
|
||||
spaces is minimized by using <Tab>s.
|
||||
The 'L' flag in 'cpoptions' changes how tabs are used when 'list' is
|
||||
@ -5807,7 +5831,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
the two-letter, lower case region name. You can use more than one
|
||||
region by listing them: "en_us,en_ca" supports both US and Canadian
|
||||
English, but not words specific for Australia, New Zealand or Great
|
||||
Britain.
|
||||
Britain. (Note: currently en_au and en_nz dictionaries are older than
|
||||
en_ca, en_gb and en_us).
|
||||
If the name "cjk" is included East Asian characters are excluded from
|
||||
spell checking. This is useful when editing text that also has Asian
|
||||
words.
|
||||
@ -5935,7 +5960,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The option consists of printf style '%' items interspersed with
|
||||
normal text. Each status line item is of the form:
|
||||
%-0{minwid}.{maxwid}{item}
|
||||
All fields except the {item} is optional. A single percent sign can
|
||||
All fields except the {item} are optional. A single percent sign can
|
||||
be given as "%%". Up to 80 items can be specified. *E541*
|
||||
|
||||
When the option starts with "%!" then it is used as an expression,
|
||||
@ -6048,7 +6073,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
feature use `has('tablineat')`.
|
||||
< - Where to truncate line if too long. Default is at the start.
|
||||
No width fields allowed.
|
||||
= - Separation point between left and right aligned items.
|
||||
= - Separation point between alignment sections. Each section will
|
||||
be separated by an equal number of spaces.
|
||||
No width fields allowed.
|
||||
# - Set highlight group. The name must follow and then a # again.
|
||||
Thus use %#HLname# for highlight group HLname. The same
|
||||
@ -6069,7 +6095,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
become empty. This will make a group like the following disappear
|
||||
completely from the statusline when none of the flags are set. >
|
||||
:set statusline=...%(\ [%M%R%H]%)...
|
||||
<
|
||||
< *g:actual_curbuf*
|
||||
Beware that an expression is evaluated each and every time the status
|
||||
line is displayed. The current buffer and current window will be set
|
||||
temporarily to that of the window (and buffer) whose statusline is
|
||||
@ -6305,19 +6331,22 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
< [The whitespace before and after the '0' must be a single <Tab>]
|
||||
|
||||
When a binary search was done and no match was found in any of the
|
||||
files listed in 'tags', and 'ignorecase' is set or a pattern is used
|
||||
files listed in 'tags', and case is ignored or a pattern is used
|
||||
instead of a normal tag name, a retry is done with a linear search.
|
||||
Tags in unsorted tags files, and matches with different case will only
|
||||
be found in the retry.
|
||||
|
||||
If a tag file indicates that it is case-fold sorted, the second,
|
||||
linear search can be avoided for the 'ignorecase' case. Use a value
|
||||
of '2' in the "!_TAG_FILE_SORTED" line for this. A tag file can be
|
||||
case-fold sorted with the -f switch to "sort" in most unices, as in
|
||||
the command: "sort -f -o tags tags". For "Exuberant ctags" version
|
||||
5.x or higher (at least 5.5) the --sort=foldcase switch can be used
|
||||
for this as well. Note that case must be folded to uppercase for this
|
||||
to work.
|
||||
linear search can be avoided when case is ignored. Use a value of '2'
|
||||
in the "!_TAG_FILE_SORTED" line for this. A tag file can be case-fold
|
||||
sorted with the -f switch to "sort" in most unices, as in the command:
|
||||
"sort -f -o tags tags". For "Exuberant ctags" version 5.x or higher
|
||||
(at least 5.5) the --sort=foldcase switch can be used for this as
|
||||
well. Note that case must be folded to uppercase for this to work.
|
||||
|
||||
By default, tag searches are case-sensitive. Case is ignored when
|
||||
'ignorecase' is set and 'tagcase' is "followic", or when 'tagcase' is
|
||||
"ignore".
|
||||
|
||||
When 'tagbsearch' is off, tags searching is slower when a full match
|
||||
exists, but faster when no full match exists. Tags in unsorted tags
|
||||
@ -6328,6 +6357,16 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
This option doesn't affect commands that find all matching tags (e.g.,
|
||||
command-line completion and ":help").
|
||||
|
||||
*'tagcase'* *'tc'*
|
||||
'tagcase' 'tc' string (default "followic")
|
||||
global or local to buffer |global-local|
|
||||
{not in Vi}
|
||||
This option specifies how case is handled when searching the tags
|
||||
file:
|
||||
followic Follow the 'ignorecase' option
|
||||
ignore Ignore case
|
||||
match Match case
|
||||
|
||||
*'taglength'* *'tl'*
|
||||
'taglength' 'tl' number (default 0)
|
||||
global
|
||||
@ -6391,6 +6430,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'termencoding'* *'tenc'*
|
||||
'termencoding' 'tenc' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'termguicolors'* *'tgc'*
|
||||
'termguicolors' 'tgc' boolean (default off)
|
||||
global
|
||||
When on, uses |highlight-guifg| and |highlight-guibg| attributes in
|
||||
the terminal (thus using 24-bit color). Requires a ISO-8613-3
|
||||
compatible terminal.
|
||||
Must be set at startup (in your |init.vim| or |--cmd|).
|
||||
|
||||
*'terse'* *'noterse'*
|
||||
'terse' boolean (default off)
|
||||
global
|
||||
@ -6404,8 +6451,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
local to buffer
|
||||
Maximum width of text that is being inserted. A longer line will be
|
||||
broken after white space to get this width. A zero value disables
|
||||
this. 'textwidth' is set to 0 when the 'paste' option is set. When
|
||||
'textwidth' is zero, 'wrapmargin' may be used. See also
|
||||
this.
|
||||
'textwidth' is set to 0 when the 'paste' option is set and restored
|
||||
when 'paste' is reset.
|
||||
When 'textwidth' is zero, 'wrapmargin' may be used. See also
|
||||
'formatoptions' and |ins-textwidth|.
|
||||
When 'formatexpr' is set it will be used to break the line.
|
||||
|
||||
@ -6418,6 +6467,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
non-keyword characters (white space is preferred). Maximum line
|
||||
length is 510 bytes.
|
||||
To obtain a file to be used here, check out this ftp site:
|
||||
[Sorry this link doesn't work anymore, do you know the right one?]
|
||||
ftp://ftp.ox.ac.uk/pub/wordlists/ First get the README file.
|
||||
To include a comma in a file name precede it with a backslash. Spaces
|
||||
after a comma are ignored, otherwise spaces are included in the file
|
||||
|
@ -1,4 +1,4 @@
|
||||
*os_win32.txt* For Vim version 7.4. Last change: 2014 Sep 25
|
||||
*os_win32.txt* For Vim version 7.4. Last change: 2016 Mar 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by George Reilly
|
||||
@ -75,6 +75,31 @@ The directory of the Vim executable is appended to $PATH. This is mostly to
|
||||
make "!xxd" work, as it is in the Tools menu. And it also means that when
|
||||
executable() returns 1 the executable can actually be executed.
|
||||
|
||||
Quotes in file names *win32-quotes*
|
||||
|
||||
Quotes inside a file name (or any other command line argument) can be escaped
|
||||
with a backslash. E.g. >
|
||||
vim -c "echo 'foo\"bar'"
|
||||
|
||||
Alternatively use three quotes to get one: >
|
||||
vim -c "echo 'foo"""bar'"
|
||||
|
||||
The quotation rules are:
|
||||
|
||||
1. A `"` starts quotation.
|
||||
2. Another `"` or `""` ends quotation. If the quotation ends with `""`, a `"`
|
||||
is produced at the end of the quoted string.
|
||||
|
||||
Examples, with [] around an argument:
|
||||
"foo" -> [foo]
|
||||
"foo"" -> [foo"]
|
||||
"foo"bar -> [foobar]
|
||||
"foo" bar -> [foo], [bar]
|
||||
"foo""bar -> [foo"bar]
|
||||
"foo"" bar -> [foo"], [bar]
|
||||
"foo"""bar" -> [foo"bar]
|
||||
|
||||
|
||||
==============================================================================
|
||||
3. Using the mouse *win32-mouse*
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 7.4. Last change: 2015 Mar 16
|
||||
*pattern.txt* For Vim version 7.4. Last change: 2016 Apr 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -392,8 +392,8 @@ Use of "\M" makes the pattern after it be interpreted as if 'nomagic' is used.
|
||||
Use of "\v" means that in the pattern after it all ASCII characters except
|
||||
'0'-'9', 'a'-'z', 'A'-'Z' and '_' have a special meaning. "very magic"
|
||||
|
||||
Use of "\V" means that in the pattern after it only the backslash has a
|
||||
special meaning. "very nomagic"
|
||||
Use of "\V" means that in the pattern after it only the backslash and the
|
||||
terminating character (/ or ?) has a special meaning. "very nomagic"
|
||||
|
||||
Examples:
|
||||
after: \v \m \M \V matches ~
|
||||
@ -401,6 +401,7 @@ after: \v \m \M \V matches ~
|
||||
$ $ $ \$ matches end-of-line
|
||||
. . \. \. matches any character
|
||||
* * \* \* any number of the previous atom
|
||||
~ ~ \~ \~ latest substitute string
|
||||
() \(\) \(\) \(\) grouping into an atom
|
||||
| \| \| \| separating alternatives
|
||||
\a \a \a \a alphabetic character
|
||||
@ -477,6 +478,7 @@ More explanation and examples below, follow the links.
|
||||
|/\%v| \%23v \%23v in virtual column 23 |/zero-width|
|
||||
|
||||
Character classes: */character-classes*
|
||||
magic nomagic matches ~
|
||||
|/\i| \i \i identifier character (see 'isident' option)
|
||||
|/\I| \I \I like "\i", but excluding digits
|
||||
|/\k| \k \k keyword character (see 'iskeyword' option)
|
||||
@ -507,6 +509,7 @@ Character classes: */character-classes*
|
||||
class with end-of-line included
|
||||
(end of character classes)
|
||||
|
||||
magic nomagic matches ~
|
||||
|/\e| \e \e <Esc>
|
||||
|/\t| \t \t <Tab>
|
||||
|/\r| \r \r <CR>
|
||||
@ -532,6 +535,7 @@ Character classes: */character-classes*
|
||||
|/\Z| \Z \Z ignore differences in Unicode "combining characters".
|
||||
Useful when searching voweled Hebrew or Arabic text.
|
||||
|
||||
magic nomagic matches ~
|
||||
|/\m| \m \m 'magic' on for the following chars in the pattern
|
||||
|/\M| \M \M 'magic' off for the following chars in the pattern
|
||||
|/\v| \v \v the following chars in the pattern are "very magic"
|
||||
@ -1090,7 +1094,10 @@ x A single character, with no special meaning, matches itself
|
||||
plausible pattern for a Unix filename: "[-./[:alnum:]_~]\+" That is,
|
||||
a list of at least one character, each of which is either '-', '.',
|
||||
'/', alphabetic, numeric, '_' or '~'.
|
||||
These items only work for 8-bit characters.
|
||||
These items only work for 8-bit characters, except [:lower:] and
|
||||
[:upper:] also work for multi-byte characters when using the new
|
||||
regexp engine. See |two-engines|. In the future these items may
|
||||
work for multi-byte characters.
|
||||
*/[[=* *[==]*
|
||||
- An equivalence class. This means that characters are matched that
|
||||
have almost the same meaning, e.g., when ignoring accents. This
|
||||
|
127
runtime/doc/pi_health.txt
Normal file
127
runtime/doc/pi_health.txt
Normal file
@ -0,0 +1,127 @@
|
||||
*pi_health.txt* Healthcheck framework
|
||||
|
||||
Author: TJ DeVries <devries.timothyj@gmail.com>
|
||||
|
||||
==============================================================================
|
||||
1. Introduction |health.vim-intro|
|
||||
2. Commands and functions |health.vim-manual|
|
||||
3. Create a healthcheck |health.vim-dev|
|
||||
|
||||
==============================================================================
|
||||
Introduction *healthcheck* *health.vim-intro*
|
||||
|
||||
Troubleshooting user configuration problems is a time-consuming task that
|
||||
developers want to minimize. health.vim provides a simple framework for plugin
|
||||
authors to hook into, and for users to invoke, to check and report the user's
|
||||
configuration and environment. Type this command to try it: >
|
||||
|
||||
:CheckHealth
|
||||
<
|
||||
For example, some users have broken or unusual Python setups, which breaks the
|
||||
|:python| command. |:CheckHealth| detects several common Python configuration
|
||||
problems and reports them. If the Neovim Python module is not installed, it
|
||||
shows a warning: >
|
||||
|
||||
You have not installed the Neovim Python module
|
||||
You might want to try `pip install Neovim`
|
||||
<
|
||||
Plugin authors are encouraged to add healthchecks, see |health.vim-dev|.
|
||||
|
||||
==============================================================================
|
||||
Commands and functions *health.vim-manual*
|
||||
|
||||
Commands
|
||||
------------------------------------------------------------------------------
|
||||
*:CheckHealth*
|
||||
:CheckHealth Run all healthchecks and show the output in a new
|
||||
tabpage. These healthchecks are included by default:
|
||||
- python2
|
||||
- python3
|
||||
- ruby
|
||||
- remote plugin
|
||||
|
||||
:CheckHealth {plugins}
|
||||
Run healthchecks for one or more plugins. E.g. to run
|
||||
only the standard Nvim healthcheck: >
|
||||
:CheckHealth nvim
|
||||
< To run the healthchecks for the "foo" and "bar" plugins
|
||||
(assuming these plugins are on your 'runtimepath' and
|
||||
they have implemented health#foo#check() and
|
||||
health#bar#check(), respectively): >
|
||||
:CheckHealth foo bar
|
||||
<
|
||||
Functions
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
health.vim functions are for creating new healthchecks. They mostly just do
|
||||
some layout and formatting, to give users a consistent presentation.
|
||||
|
||||
health#report_start({name}) *health#report_start*
|
||||
Starts a new report. Most plugins should call this only once, but if
|
||||
you want different sections to appear in your report, call this once
|
||||
per section.
|
||||
|
||||
health#report_info({msg}) *health#report_info*
|
||||
Displays an informational message.
|
||||
|
||||
health#report_ok({msg}) *health#report_ok*
|
||||
Displays a "success" message.
|
||||
|
||||
health#report_warn({msg}, [{suggestions}]) *health#report_warn*
|
||||
Displays a warning. {suggestions} is an optional List of suggestions.
|
||||
|
||||
health#report_error({msg}, [{suggestions}]) *health#report_error*
|
||||
Displays an error. {suggestions} is an optional List of suggestions.
|
||||
|
||||
health#{plugin}#check() *health.user_checker*
|
||||
This is the form of a healthcheck definition. Call the above functions
|
||||
from this function, then |:CheckHealth| does the rest. Example: >
|
||||
|
||||
function! health#my_plug#check() abort
|
||||
silent call s:check_environment_vars()
|
||||
silent call s:check_python_configuration()
|
||||
endfunction
|
||||
<
|
||||
The function will be found and called automatically when the user
|
||||
invokes |:CheckHealth|.
|
||||
|
||||
All output will be captured from the healthcheck. Use the
|
||||
health#report_* functions so that your healthcheck has a format
|
||||
consistent with the standard healthchecks.
|
||||
|
||||
==============================================================================
|
||||
Create a healthcheck *health.vim-dev*
|
||||
|
||||
Healthchecks are functions that check the health of the system. Neovim has
|
||||
built-in checkers, found in $VIMRUNTIME/autoload/health/.
|
||||
|
||||
To add a new checker for your own plugin, simply define a
|
||||
health#{plugin}#check() function in autoload/health/{plugin}.vim.
|
||||
|:CheckHealth| automatically finds and invokes such functions.
|
||||
|
||||
If your plugin is named "jslint", then its healthcheck function must be >
|
||||
|
||||
health#jslint#check()
|
||||
<
|
||||
defined in this file on 'runtimepath': >
|
||||
|
||||
autoload/health/jslint.vim
|
||||
<
|
||||
Here's a sample to get started: >
|
||||
|
||||
function! health#jslint#check() abort
|
||||
call health#report_start('sanity checks')
|
||||
" perform arbitrary checks
|
||||
" ...
|
||||
|
||||
if looks_good
|
||||
call health#report_ok('found required dependencies')
|
||||
else
|
||||
call health#report_error('cannot find jslint',
|
||||
\ ['npm install --save jslint'])
|
||||
endif
|
||||
endfunction
|
||||
<
|
||||
==============================================================================
|
||||
|
||||
vim:tw=78:ts=8:ft=help:fdm=marker
|
@ -1,4 +1,4 @@
|
||||
*pi_netrw.txt* For Vim version 7.4. Last change: 2015 Jan 05
|
||||
*pi_netrw.txt* For Vim version 7.4. Last change: 2016 Feb 16
|
||||
|
||||
------------------------------------------------
|
||||
NETRW REFERENCE MANUAL by Charles E. Campbell
|
||||
@ -6,7 +6,7 @@
|
||||
Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM>
|
||||
(remove NOSPAM from Campbell's email first)
|
||||
|
||||
Copyright: Copyright (C) 1999-2015 Charles E Campbell *netrw-copyright*
|
||||
Copyright: Copyright (C) 2016 Charles E Campbell *netrw-copyright*
|
||||
The VIM LICENSE applies to the files in this package, including
|
||||
netrw.vim, pi_netrw.txt, netrwFileHandlers.vim, netrwSettings.vim, and
|
||||
syntax/netrw.vim. Like anything else that's free, netrw.vim and its
|
||||
@ -48,9 +48,10 @@ Copyright: Copyright (C) 1999-2015 Charles E Campbell *netrw-copyright*
|
||||
Introduction To Browsing............................|netrw-intro-browse|
|
||||
Quick Reference: Maps...............................|netrw-browse-maps|
|
||||
Quick Reference: Commands...........................|netrw-browse-cmds|
|
||||
Banner Display......................................|netrw-I|
|
||||
Bookmarking A Directory.............................|netrw-mb|
|
||||
Browsing............................................|netrw-cr|
|
||||
Squeezing the Current Tree-Listing Directory......|:netrw-s-cr|
|
||||
Squeezing the Current Tree-Listing Directory........|netrw-s-cr|
|
||||
Browsing With A Horizontally Split Window...........|netrw-o|
|
||||
Browsing With A New Tab.............................|netrw-t|
|
||||
Browsing With A Vertically Split Window.............|netrw-v|
|
||||
@ -75,11 +76,13 @@ Copyright: Copyright (C) 1999-2015 Charles E Campbell *netrw-copyright*
|
||||
Making The Browsing Directory The Current Directory.|netrw-c|
|
||||
Marking Files.......................................|netrw-mf|
|
||||
Unmarking Files.....................................|netrw-mF|
|
||||
Marking Files By Location List......................|netrw-qL|
|
||||
Marking Files By QuickFix List......................|netrw-qF|
|
||||
Marking Files By Regular Expression.................|netrw-mr|
|
||||
Marked Files: Arbitrary Shell Command...............|netrw-mx|
|
||||
Marked Files: Arbitrary Shell Command, En Bloc......|netrw-mX|
|
||||
Marked Files: Arbitrary Vim Command.................|netrw-mv|
|
||||
Marked Files: Argument List.........................|netrw-ma| |netrw-mA|
|
||||
Marked Files: Compression And Decompression.........|netrw-mz|
|
||||
Marked Files: Copying...............................|netrw-mc|
|
||||
Marked Files: Diff..................................|netrw-md|
|
||||
@ -365,7 +368,12 @@ settings are described below, in |netrw-browser-options|, and in
|
||||
fun! MyFuncRef()
|
||||
endfun
|
||||
let g:Netrw_funcref= function("MyFuncRef")
|
||||
|
||||
<
|
||||
*g:Netrw_UserMaps* specifies a function or |List| of functions which can
|
||||
be used to set up user-specified maps and functionality.
|
||||
See |netrw-usermaps|
|
||||
|
||||
*g:netrw_ftp* if it doesn't exist, use default ftp
|
||||
=0 use default ftp (uid password)
|
||||
=1 use alternate ftp method (user uid password)
|
||||
@ -1065,6 +1073,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
|
||||
<c-h> Edit file hiding list |netrw-ctrl-h|
|
||||
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
|
||||
<c-r> Browse using a gvim server |netrw-ctrl-r|
|
||||
<c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|
|
||||
- Makes Netrw go up one directory |netrw--|
|
||||
a Toggles between normal display, |netrw-a|
|
||||
hiding (suppress display of files matching g:netrw_list_hide)
|
||||
@ -1077,6 +1086,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
|
||||
gd Force treatment as directory |netrw-gd|
|
||||
gf Force treatment as file |netrw-gf|
|
||||
gh Quick hide/unhide of dot-files |netrw-gh|
|
||||
gn Make top of tree the directory below the cursor |netrw-gn|
|
||||
i Cycle between thin, long, wide, and tree listings |netrw-i|
|
||||
mb Bookmark current directory |netrw-mb|
|
||||
mc Copy marked files to marked-file target directory |netrw-mc|
|
||||
@ -1104,8 +1114,9 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
|
||||
qb List bookmarked directories and history |netrw-qb|
|
||||
qf Display information on file |netrw-qf|
|
||||
qF Mark files using a quickfix list |netrw-qF|
|
||||
qL Mark files using a |location-list| |netrw-qL|
|
||||
r Reverse sorting order |netrw-r|
|
||||
R Rename the designed file(s)/directory(ies) |netrw-R|
|
||||
R Rename the designated file(s)/directory(ies) |netrw-R|
|
||||
s Select sorting style: by name, time, or file size |netrw-s|
|
||||
S Specify suffix priority for name-sorting |netrw-S|
|
||||
t Enter the file/directory under the cursor in a new tab|netrw-t|
|
||||
@ -1153,6 +1164,14 @@ QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
|
||||
:Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
|
||||
:Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
|
||||
|
||||
|
||||
BANNER DISPLAY *netrw-I*
|
||||
|
||||
One may toggle the banner display on and off by pressing "I".
|
||||
|
||||
Also See: |g:netrw_banner|
|
||||
|
||||
|
||||
BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
|
||||
|
||||
One may easily "bookmark" the currently browsed directory by using >
|
||||
@ -1177,7 +1196,7 @@ Addtionally, one may use :NetrwMB to bookmark files or directories. >
|
||||
if there are marked files : bookmark marked files
|
||||
otherwise : bookmark file/directory under cursor
|
||||
No argument and not in netrw buffer: bookmarks current open file
|
||||
Has arguments: globs them individually and bookmarks them
|
||||
Has arguments : |glob()|s each arg and bookmarks them
|
||||
|
||||
With bang: deletes files/directories from Netrw's bookmark system
|
||||
|
||||
@ -1194,7 +1213,7 @@ Related Topics:
|
||||
|g:netrw_home| controls where .netrwbook is kept
|
||||
|
||||
|
||||
BROWSING *netrw-cr* {{{2
|
||||
BROWSING *netrw-enter* *netrw-cr* {{{2
|
||||
|
||||
Browsing is simple: move the cursor onto a file or directory of interest.
|
||||
Hitting the <cr> (the return key) will select the file or directory.
|
||||
@ -1235,12 +1254,22 @@ The price for such re-use is that when changes are made (such as new files
|
||||
are introduced into a directory), the listing may become out-of-date. One may
|
||||
always refresh directory listing buffers by pressing ctrl-L (see
|
||||
|netrw-ctrl-l|).
|
||||
*:netrw-s-cr*
|
||||
|
||||
*netrw-s-cr*
|
||||
Squeezing the Current Tree-Listing Directory~
|
||||
|
||||
When the tree listing style is enabled (see |netrw-i|) and one is using
|
||||
gvim, then the <s-cr> mapping may be used to squeeze (close) the
|
||||
directory currently containing the cursor.
|
||||
|
||||
Otherwise, one may remap a key combination of one's own choice to get
|
||||
this effect: >
|
||||
|
||||
nmap <buffer> <silent> <nowait> YOURKEYCOMBO <Plug>NetrwTreeSqueeze
|
||||
<
|
||||
Put this line in $HOME/ftplugin/netrw/netrw.vim; it needs to be generated
|
||||
for netrw buffers only.
|
||||
|
||||
Related topics:
|
||||
|netrw-ctrl-r| |netrw-o| |netrw-p|
|
||||
|netrw-P| |netrw-t| |netrw-v|
|
||||
@ -1394,8 +1423,8 @@ list (unless |g:netrw_dirhistmax| is zero; by default, it's ten). With the
|
||||
the opposite, see |netrw-U|.
|
||||
|
||||
The "u" map also accepts counts to go back in the history several slots.
|
||||
For your convenience, |netrw-qb| lists the history number which can be
|
||||
re-used in that count.
|
||||
For your convenience, qb (see |netrw-qb|) lists the history number which may
|
||||
be used in that count.
|
||||
|
||||
*.netrwhist*
|
||||
See |g:netrw_dirhistmax| for how to control the quantity of history stack
|
||||
@ -1412,7 +1441,7 @@ CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
|
||||
|
||||
With the "U" map, one can change to a later directory (successor).
|
||||
This map is the opposite of the "u" map. (see |netrw-u|) Use the
|
||||
q map to list both the bookmarks and history. (see |netrw-qb|)
|
||||
qb map to list both the bookmarks and history. (see |netrw-qb|)
|
||||
|
||||
The "U" map also accepts counts to go forward in the history several slots.
|
||||
|
||||
@ -1420,7 +1449,7 @@ See |g:netrw_dirhistmax| for how to control the quantity of history stack
|
||||
slots.
|
||||
|
||||
|
||||
CHANGING TREE TOP *netrw-ntree* *:Ntree* {{{2
|
||||
CHANGING TREE TOP *netrw-ntree* *:Ntree* *netrw-gn* {{{2
|
||||
|
||||
One may specify a new tree top for tree listings using >
|
||||
|
||||
@ -1430,14 +1459,18 @@ Without a "dirname", the current line is used (and any leading depth
|
||||
information is elided).
|
||||
With a "dirname", the specified directory name is used.
|
||||
|
||||
The "gn" map will take the word below the cursor and use that for
|
||||
changing the top of the tree listing.
|
||||
|
||||
|
||||
NETRW CLEAN *netrw-clean* *:NetrwClean* {{{2
|
||||
|
||||
With :NetrwClean one may easily remove netrw from one's home directory;
|
||||
With NetrwClean one may easily remove netrw from one's home directory;
|
||||
more precisely, from the first directory on your |'runtimepath'|.
|
||||
|
||||
With :NetrwClean!, netrw will remove netrw from all directories on your
|
||||
|'runtimepath'|.
|
||||
With NetrwClean!, netrw will attempt to remove netrw from all directories on
|
||||
your |'runtimepath'|. Of course, you have to have write/delete permissions
|
||||
correct to do this.
|
||||
|
||||
With either form of the command, netrw will first ask for confirmation
|
||||
that the removal is in fact what you want to do. If netrw doesn't have
|
||||
@ -1454,6 +1487,7 @@ operating system). Netrw allows one to invoke such special handlers by: >
|
||||
* when Exploring, hit the "x" key
|
||||
* when editing, hit gx with the cursor atop the special filename
|
||||
< (latter not available if the |g:netrw_nogx| variable exists)
|
||||
|
||||
Netrw determines which special handler by the following method:
|
||||
|
||||
* if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
|
||||
@ -1483,7 +1517,8 @@ One may also use visual mode (see |visual-start|) to select the text that the
|
||||
special handler will use. Normally gx uses expand("<cfile>") to pick up the
|
||||
text under the cursor; one may change what |expand()| uses via the
|
||||
|g:netrw_gx| variable. Alternatively, one may select the text to be used by
|
||||
gx via first making a visual selection (see |visual-block|).
|
||||
gx via first making a visual selection (see |visual-block|) or by changing
|
||||
the |'isfname'| option (which is global, so netrw doesn't modify it).
|
||||
|
||||
Associated setting variables:
|
||||
|g:netrw_gx| control how gx picks up the text under the cursor
|
||||
@ -1629,19 +1664,23 @@ DIRECTORY EXPLORATION COMMANDS {{{2
|
||||
of the current tab. It will open a netrw window on the current
|
||||
directory if [dir] is omitted; a :Lexplore [dir] will show the
|
||||
specified directory in the left-hand side browser display no matter
|
||||
from which window the command is issued. By default, :Lexplore will
|
||||
change an uninitialized |g:netrw_chgwin| to 2; edits will thus
|
||||
preferentially be made in window#2.
|
||||
from which window the command is issued.
|
||||
|
||||
By default, :Lexplore will change an uninitialized |g:netrw_chgwin|
|
||||
to 2; edits will thus preferentially be made in window#2.
|
||||
|
||||
The [N] specifies a |g:netrw_winsize| just for the new :Lexplore
|
||||
window.
|
||||
Those who like this method often also like tree style displays;
|
||||
|
||||
Those who like this method often also often like tree style displays;
|
||||
see |g:netrw_liststyle|.
|
||||
|
||||
Also see: |netrw-C| |g:netrw_chgwin| |g:netrw_winsize|
|
||||
|netrw-p| |netrw-P| |g:netrw_browse_split|
|
||||
Also see: |netrw-C| |g:netrw_browse_split| |g:netrw_wiw|
|
||||
|netrw-p| |netrw-P| |g:netrw_chgwin|
|
||||
|netrw-c-tab| |g:netrw_winsize|
|
||||
|
||||
:[N]Lexplore! is like :Lexplore, except that the full-height Explorer window
|
||||
will open on the right hand side, and an uninitialized |g:netrw_chgwin|
|
||||
will open on the right hand side and an uninitialized |g:netrw_chgwin|
|
||||
will be set to 1.
|
||||
|
||||
*netrw-:Sexplore*
|
||||
@ -1697,8 +1736,9 @@ Also see: |g:netrw_alto| |g:netrw_altv| |g:netrw_winsize|
|
||||
EXPLORING WITH STARS AND PATTERNS {{{2
|
||||
|
||||
When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
|
||||
following four patterns Explore generates a list of files which satisfy
|
||||
the request. >
|
||||
following four patterns Explore generates a list of files which satisfy the
|
||||
request for the local file system. These exploration patterns will not work
|
||||
with remote file browsing.
|
||||
|
||||
*/filepat files in current directory which satisfy filepat
|
||||
**/filepat files in current directory or below which satisfy the
|
||||
@ -2063,15 +2103,22 @@ Netrw provides several ways to mark files:
|
||||
|
||||
:MF *.c
|
||||
<
|
||||
* Note that :MF uses |<f-args>| to break the line
|
||||
at spaces.
|
||||
(Note that :MF uses |<f-args>| to break the line
|
||||
at spaces)
|
||||
|
||||
* Mark files using the |argument-list| (|netrw-mA|)
|
||||
|
||||
* Mark files based upon a |location-list| (|netrw-qL|)
|
||||
|
||||
* Mark files based upon the quickfix list (|netrw-qF|)
|
||||
(|quickfix-error-lists|)
|
||||
|
||||
The following netrw maps make use of marked files:
|
||||
|
||||
|netrw-a| Hide marked files/directories
|
||||
|netrw-D| Delete marked files/directories
|
||||
|netrw-ma| Move marked files' names to |arglist|
|
||||
|netrw-mA| Move |arglist| filenames to marked file list
|
||||
|netrw-mb| Append marked files to bookmarks
|
||||
|netrw-mB| Delete marked files from bookmarks
|
||||
|netrw-mc| Copy marked files to target
|
||||
@ -2125,19 +2172,24 @@ is unlikely to be fixed.
|
||||
|
||||
|
||||
UNMARKING FILES *netrw-mF* {{{2
|
||||
(also see |netrw-mf|, |netrw-mu|)
|
||||
|
||||
The "mF" command will unmark all files in the current buffer. One may also use
|
||||
mf (|netrw-mf|) on a specific, already marked, file to unmark just that file.
|
||||
|
||||
MARKING FILES BY LOCATION LIST *netrw-qL* {{{2
|
||||
(also see |netrw-mf|)
|
||||
|
||||
This command will unmark all files in the current buffer. One may also use
|
||||
mf (|netrw-mf|) on a specific file to unmark just that file.
|
||||
One may convert |location-list|s into a marked file list using "qL".
|
||||
You may then proceed with commands such as me (|netrw-me|) to edit them.
|
||||
|
||||
|
||||
MARKING FILES BY QUICKFIX LIST *netrw-qF* {{{2
|
||||
(also see |netrw-mf|)
|
||||
|
||||
One may convert the |quickfix-error-lists| into a marked file list using
|
||||
"qF". You may then proceed with commands such as me (|netrw-me|) to
|
||||
edit them. Quickfix error lists are generated, for example, by calls
|
||||
to |:vimgrep|.
|
||||
One may convert |quickfix-error-lists| into a marked file list using "qF".
|
||||
You may then proceed with commands such as me (|netrw-me|) to edit them.
|
||||
Quickfix error lists are generated, for example, by calls to |:vimgrep|.
|
||||
|
||||
|
||||
MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
|
||||
@ -2155,14 +2207,17 @@ MARKED FILES, ARBITRARY VIM COMMAND *netrw-mv* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
(uses the local marked-file list)
|
||||
|
||||
The "mv" map causes netrw execute an arbitrary vim command on each file
|
||||
on the local marked file list, individually:
|
||||
The "mv" map causes netrw to execute an arbitrary vim command on each file on
|
||||
the local marked file list, individually:
|
||||
|
||||
* 1split
|
||||
* sil! keepalt e file
|
||||
* run vim command
|
||||
* sil! keepalt wq!
|
||||
|
||||
A prompt, "Enter vim command: ", will be issued to elicit the vim command
|
||||
you wish used.
|
||||
|
||||
|
||||
MARKED FILES, ARBITRARY SHELL COMMAND *netrw-mx* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
@ -2194,17 +2249,27 @@ command to be applied to all marked files on the global marked file list. The
|
||||
|
||||
command files
|
||||
|
||||
It is useful, for example, to select files and make a tarball:
|
||||
This approach is useful, for example, to select files and make a tarball: >
|
||||
|
||||
(mark files)
|
||||
mX
|
||||
Enter command: tar cf mynewtarball.tar
|
||||
|
||||
The command that will be run in this example:
|
||||
<
|
||||
The command that will be run with this example:
|
||||
|
||||
tar cf mynewtarball.tar 'file1' 'file2' ...
|
||||
|
||||
|
||||
MARKED FILES: ARGUMENT LIST *netrw-ma* *netrw-mA*
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
(uses the global marked-file list)
|
||||
|
||||
Using ma, one moves filenames from the marked file list to the argument list.
|
||||
Using mA, one moves filenames from the argument list to the marked file list.
|
||||
|
||||
See Also: |netrw-qF| |argument-list| |:args|
|
||||
|
||||
|
||||
MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
(uses the local marked file list)
|
||||
@ -2214,7 +2279,7 @@ If any marked files are decompressed, then "mz" will compress them
|
||||
using the command specified by |g:netrw_compress|; by default,
|
||||
that's "gzip".
|
||||
|
||||
For decompression, netrw provides a |Dictionary| of suffices and their
|
||||
For decompression, netrw uses a |Dictionary| of suffices and their
|
||||
associated decompressing utilities; see |g:netrw_decompress|.
|
||||
|
||||
Remember that one can mark multiple files by regular expression
|
||||
@ -2253,7 +2318,7 @@ MARKED FILES: EDITING *netrw-me* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
(uses the global marked file list)
|
||||
|
||||
This command will place the marked files on the |arglist| and commence
|
||||
The "me" command will place the marked files on the |arglist| and commence
|
||||
editing them. One may return the to explorer window with |:Rexplore|.
|
||||
(use |:n| and |:p| to edit next and previous files in the arglist)
|
||||
|
||||
@ -2261,26 +2326,33 @@ MARKED FILES: GREP *netrw-mg* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
(uses the global marked file list)
|
||||
|
||||
This command will apply |:vimgrep| to the marked files.
|
||||
The "mg" command will apply |:vimgrep| to the marked files.
|
||||
The command will ask for the requested pattern; one may then enter: >
|
||||
|
||||
/pattern/[g][j]
|
||||
! /pattern/[g][j]
|
||||
pattern
|
||||
<
|
||||
In the cases of "j" option usage as shown above, "mg" will winnow the current
|
||||
marked file list to just those possessing the specified pattern.
|
||||
Thus, one may use >
|
||||
mr ...file-pattern
|
||||
mg ..contents-pattern
|
||||
to have a marked file list satisfying the file-pattern but containing the
|
||||
desired contents-pattern.
|
||||
With /pattern/, editing will start with the first item on the |quickfix| list
|
||||
that vimgrep sets up (see |:copen|, |:cnext|, |:cprevious|, |:cclose|). The |:vimgrep|
|
||||
command is in use, so without 'g' each line is added to quickfix list only
|
||||
once; with 'g' every match is included.
|
||||
|
||||
With /pattern/j, "mg" will winnow the current marked file list to just those
|
||||
marked files also possessing the specified pattern. Thus, one may use >
|
||||
|
||||
mr ...file-pattern...
|
||||
mg /pattern/j
|
||||
<
|
||||
to have a marked file list satisfying the file-pattern but also restricted to
|
||||
files containing some desired pattern.
|
||||
|
||||
|
||||
MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
(uses the local marked file list)
|
||||
|
||||
This command extracts the suffices of the marked files and toggles their
|
||||
The "mh" command extracts the suffices of the marked files and toggles their
|
||||
presence on the hiding list. Please note that marking the same suffix
|
||||
this way multiple times will result in the suffix's presence being toggled
|
||||
for each file (so an even quantity of marked files having the same suffix
|
||||
@ -2309,16 +2381,16 @@ MARKED FILES: PRINTING *netrw-mp* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
(uses the local marked file list)
|
||||
|
||||
Netrw will apply the |:hardcopy| command to marked files. What it does
|
||||
is open each file in a one-line window, execute hardcopy, then close the
|
||||
one-line window.
|
||||
When "mp" is used, netrw will apply the |:hardcopy| command to marked files.
|
||||
What netrw does is open each file in a one-line window, execute hardcopy, then
|
||||
close the one-line window.
|
||||
|
||||
|
||||
MARKED FILES: SOURCING *netrw-ms* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
(uses the local marked file list)
|
||||
|
||||
Netrw will source the marked files (using vim's |:source| command)
|
||||
With "ms", netrw will source the marked files (using vim's |:source| command)
|
||||
|
||||
|
||||
MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2
|
||||
@ -2341,6 +2413,9 @@ Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
|
||||
This command uses |<q-args>|, so spaces in the directory name are
|
||||
permitted without escaping.
|
||||
|
||||
* With mouse-enabled vim or with gvim, one may select a target by using
|
||||
<c-leftmouse>
|
||||
|
||||
There is only one copy/move-to target at a time in a vim session; ie. the
|
||||
target is a script variable (see |s:var|) and is shared between all netrw
|
||||
windows (in an instance of vim).
|
||||
@ -2417,9 +2492,13 @@ Related topics:
|
||||
|
||||
|
||||
MARKED FILES: UNMARKING *netrw-mu* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
(See |netrw-mf|, |netrw-mF|)
|
||||
|
||||
The "mu" mapping will unmark all currently marked files. This command differs
|
||||
from "mF" as the latter only unmarks files in the current directory whereas
|
||||
"mu" will unmark global and all buffer-local marked files.
|
||||
(see |netrw-mF|)
|
||||
|
||||
The "mu" mapping will unmark all currently marked files.
|
||||
|
||||
*netrw-browser-settings*
|
||||
NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2
|
||||
@ -2724,6 +2803,21 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
evaluation will be suppressed
|
||||
(see |'ballooneval'|)
|
||||
|
||||
*g:netrw_sizestyle* not defined: actual bytes (default)
|
||||
="b" : actual bytes (default)
|
||||
="h" : human-readable (ex. 5k, 4m, 3g)
|
||||
uses 1000 base
|
||||
="H" : human-readable (ex. 5K, 4M, 3G)
|
||||
uses 1024 base
|
||||
The long listing (|netrw-i|) and query-file
|
||||
maps (|netrw-qf|) will display file size
|
||||
using the specified style.
|
||||
|
||||
*g:netrw_usetab* if this variable exists and is non-zero, then
|
||||
the <tab> map supporting shrinking/expanding a
|
||||
Lexplore or netrw window will be enabled.
|
||||
(see |netrw-c-tab|)
|
||||
|
||||
*g:netrw_remote_mkdir* command for making a remote directory
|
||||
via ftp (also see |g:netrw_mkdir_cmd|)
|
||||
default: "mkdir"
|
||||
@ -2760,7 +2854,8 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
|netrw-ctrl-r| to use for its server.
|
||||
default: "NETRWSERVER"
|
||||
|
||||
*g:netrw_sort_by* sort by "name", "time", or "size"
|
||||
*g:netrw_sort_by* sort by "name", "time", "size", or
|
||||
"exten".
|
||||
default: "name"
|
||||
|
||||
*g:netrw_sort_direction* sorting direction: "normal" or "reverse"
|
||||
@ -2872,6 +2967,10 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
take effect, for example).
|
||||
default: 50 (for 50%)
|
||||
|
||||
*g:netrw_wiw* =1 specifies the minimum window width to use
|
||||
when shrinking a netrw/Lexplore window
|
||||
(see |netrw-c-tab|).
|
||||
|
||||
*g:netrw_xstrlen* Controls how netrw computes string lengths,
|
||||
including multi-byte characters' string
|
||||
length. (thanks to N Weibull, T Mechelynck)
|
||||
@ -2917,7 +3016,7 @@ help on what each of the variables do.
|
||||
|
||||
|
||||
==============================================================================
|
||||
OBTAINING A FILE *netrw-O* {{{2
|
||||
OBTAINING A FILE *netrw-obtain* *netrw-O* {{{2
|
||||
|
||||
If there are no marked files:
|
||||
|
||||
@ -2947,7 +3046,7 @@ Related topics:
|
||||
* To automatically make the currently browsed directory the current
|
||||
directory, see |g:netrw_keepdir|.
|
||||
|
||||
*netrw-createfile*
|
||||
*netrw-newfile* *netrw-createfile*
|
||||
OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY *netrw-%* {{{2
|
||||
|
||||
To open a new file in netrw's current directory, press "%". This map
|
||||
@ -2979,14 +3078,17 @@ These will:
|
||||
will use only 30% of the columns available; the rest of the window
|
||||
is used for the preview window.
|
||||
|
||||
Also see: |g:netrw_chgwin| |netrw-P|
|
||||
Related: if you like this idea, you may also find :Lexplore
|
||||
(|netrw-:Lexplore|) or |g:netrw_chgwin| of interest
|
||||
|
||||
Also see: |g:netrw_chgwin| |netrw-P| |'previewwindow'| |CTRL-W_z| |:pclose|
|
||||
|
||||
|
||||
PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2
|
||||
|
||||
To edit a file or directory in the previously used (last accessed) window (see
|
||||
:he |CTRL-W_p|), press a "P". If there's only one window, then the one window
|
||||
will be horizontally split (by default).
|
||||
To edit a file or directory under the cursor in the previously used (last
|
||||
accessed) window (see :he |CTRL-W_p|), press a "P". If there's only one
|
||||
window, then the one window will be horizontally split (by default).
|
||||
|
||||
If there's more than one window, the previous window will be re-used on
|
||||
the selected file/directory. If the previous window's associated buffer
|
||||
@ -3004,7 +3106,7 @@ Associated setting variables:
|
||||
Also see: |g:netrw_chgwin| |netrw-p|
|
||||
|
||||
|
||||
REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l* {{{2
|
||||
REFRESHING THE LISTING *netrw-refresh* *netrw-ctrl-l* *netrw-ctrl_l* {{{2
|
||||
|
||||
To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
|
||||
hit the <cr> when atop the ./ directory entry in the listing. One may also
|
||||
@ -3024,11 +3126,12 @@ RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2
|
||||
|
||||
If there are no marked files: (see |netrw-mf|)
|
||||
|
||||
Renaming/moving files and directories involves moving the cursor to the
|
||||
Renaming files and directories involves moving the cursor to the
|
||||
file/directory to be moved (renamed) and pressing "R". You will then be
|
||||
queried for where you want the file/directory to be moved. You may select
|
||||
queried for what you want the file/directory to be renamed to You may select
|
||||
a range of lines with the "V" command (visual selection), and then
|
||||
pressing "R".
|
||||
press "R"; you will be queried for each file as to what you want it
|
||||
renamed to.
|
||||
|
||||
If there are marked files: (see |netrw-mf|)
|
||||
|
||||
@ -3046,6 +3149,14 @@ If there are marked files: (see |netrw-mf|)
|
||||
This example will mark all *.c files and then rename them to *.cpp
|
||||
files.
|
||||
|
||||
The ctrl-X character has special meaning for renaming files: >
|
||||
|
||||
<c-x> : a single ctrl-x tells netrw to ignore the portion of the response
|
||||
lying between the last '/' and the ctrl-x.
|
||||
|
||||
<c-x><c-x> : a pair of contiguous ctrl-x's tells netrw to ignore any
|
||||
portion of the string preceding the double ctrl-x's.
|
||||
<
|
||||
WARNING:~
|
||||
|
||||
Note that moving files is a dangerous operation; copies are safer. That's
|
||||
@ -3053,13 +3164,13 @@ If there are marked files: (see |netrw-mf|)
|
||||
the copy fails and the delete does not, you may lose the file.
|
||||
Use at your own risk.
|
||||
|
||||
The g:netrw_rename_cmd variable is used to implement renaming. By default its
|
||||
value is:
|
||||
The g:netrw_rename_cmd variable is used to implement remote renaming. By
|
||||
default its value is:
|
||||
|
||||
ssh HOSTNAME mv
|
||||
|
||||
One may rename a block of files and directories by selecting them with
|
||||
the V (|linewise-visual|).
|
||||
V (|linewise-visual|) when using thin style
|
||||
|
||||
|
||||
SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2
|
||||
@ -3072,18 +3183,19 @@ Related topics: |netrw-r| |netrw-S|
|
||||
Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
|
||||
|
||||
|
||||
SETTING EDITING WINDOW *netrw-C* *netrw-:NetrwC* {{{2
|
||||
SETTING EDITING WINDOW *netrw-editwindow* *netrw-C* *netrw-:NetrwC* {{{2
|
||||
|
||||
One may select a netrw window for editing with the "C" mapping, using the
|
||||
:NetrwC [win#] command, or by setting g:netrw_chgwin to the selected window
|
||||
:NetrwC [win#] command, or by setting |g:netrw_chgwin| to the selected window
|
||||
number. Subsequent selection of a file to edit (|netrw-cr|) will use that
|
||||
window.
|
||||
|
||||
* C by itself, will select the current window for editing via
|
||||
|netrw-cr|
|
||||
* C : by itself, will select the current window holding a netrw buffer
|
||||
for editing via |netrw-cr|. The C mapping is only available while in
|
||||
netrw buffers.
|
||||
|
||||
* [count]C the count will be used as the window number to be used
|
||||
for editing via |netrw-cr|.
|
||||
* [count]C : the count will be used as the window number to be used
|
||||
for subsequent editing via |netrw-cr|.
|
||||
|
||||
* :NetrwC will set |g:netrw_chgwin| to the current window
|
||||
|
||||
@ -3092,12 +3204,91 @@ window.
|
||||
|
||||
Using >
|
||||
let g:netrw_chgwin= -1
|
||||
will restore the default editing behavior (ie. use the current window).
|
||||
will restore the default editing behavior
|
||||
(ie. editing will use the current window).
|
||||
|
||||
Related topics: |netrw-cr| |g:netrw_browse_split|
|
||||
Associated setting variables: |g:netrw_chgwin|
|
||||
|
||||
|
||||
SHRINKING OR EXPANDING A NETRW OR LEXPLORE WINDOW *netrw-c-tab* {{{2
|
||||
|
||||
The <c-tab> key will toggle a netrw or |:Lexplore| window's width,
|
||||
but only if |g:netrw_usetab| exists and is non-zero (and, of course,
|
||||
only if your terminal supports differentiating <c-tab> from a plain
|
||||
<tab>).
|
||||
|
||||
* If the current window is a netrw window, toggle its width
|
||||
(between |g:netrw_wiw| and its original width)
|
||||
|
||||
* Else if there is a |:Lexplore| window in the current tab, toggle
|
||||
its width
|
||||
|
||||
* Else bring up a |:Lexplore| window
|
||||
|
||||
If |g:netrw_usetab| exists or is zero, or if there is a pre-existing mapping
|
||||
for <c-tab>, then the <c-tab> will not be mapped. One may map something other
|
||||
than a <c-tab>, too: (but you'll still need to have had g:netrw_usetab set) >
|
||||
|
||||
nmap <unique> (whatever) <Plug>NetrwShrink
|
||||
<
|
||||
Related topics: |:Lexplore|
|
||||
Associated setting variable: |g:netrw_usetab|
|
||||
|
||||
|
||||
USER SPECIFIED MAPS *netrw-usermaps* {{{1
|
||||
|
||||
One may make customized user maps. Specify a variable, |g:Netrw_UserMaps|,
|
||||
to hold a |List| of lists of keymap strings and function names: >
|
||||
|
||||
[["keymap-sequence","ExampleUserMapFunc"],...]
|
||||
<
|
||||
When netrw is setting up maps for a netrw buffer, if |g:Netrw_UserMaps|
|
||||
exists, then the internal function netrw#UserMaps(islocal) is called.
|
||||
This function goes through all the entries in the |g:Netrw_UserMaps| list:
|
||||
|
||||
* sets up maps: >
|
||||
nno <buffer> <silent> KEYMAP-SEQUENCE
|
||||
:call s:UserMaps(islocal,"ExampleUserMapFunc")
|
||||
< * refreshes if result from that function call is the string
|
||||
"refresh"
|
||||
* if the result string is not "", then that string will be
|
||||
executed (:exe result)
|
||||
* if the result is a List, then the above two actions on results
|
||||
will be taken for every string in the result List
|
||||
|
||||
The user function is passed one argument; it resembles >
|
||||
|
||||
fun! ExampleUserMapFunc(islocal)
|
||||
<
|
||||
where a:islocal is 1 if its a local-directory system call or 0 when
|
||||
remote-directory system call.
|
||||
|
||||
Use netrw#Expose("varname") to access netrw-internal (script-local)
|
||||
variables.
|
||||
Use netrw#Modify("varname",newvalue) to change netrw-internal variables.
|
||||
Use netrw#Call("funcname"[,args]) to call a netrw-internal function with
|
||||
specified arguments.
|
||||
|
||||
Example: Get a copy of netrw's marked file list: >
|
||||
|
||||
let netrwmarkfilelist= netrw#Expose("netrwmarkfilelist")
|
||||
<
|
||||
Example: Modify the value of netrw's marked file list: >
|
||||
|
||||
call netrw#Modify("netrwmarkfilelist",[])
|
||||
<
|
||||
Example: Clear netrw's marked file list via a mapping on gu >
|
||||
" ExampleUserMap: {{{2
|
||||
fun! ExampleUserMap(islocal)
|
||||
call netrw#Modify("netrwmarkfilelist",[])
|
||||
call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"")
|
||||
let retval= ["refresh"]
|
||||
return retval
|
||||
endfun
|
||||
let g:Netrw_UserMaps= [["gu","ExampleUserMap"]]
|
||||
<
|
||||
|
||||
10. Problems and Fixes *netrw-problems* {{{1
|
||||
|
||||
(This section is likely to grow as I get feedback)
|
||||
@ -3272,6 +3463,7 @@ Associated setting variables: |g:netrw_chgwin|
|
||||
The first one (|g:netrw_ssh_cmd|) is the most important; most
|
||||
of the others will use the string in g:netrw_ssh_cmd by
|
||||
default.
|
||||
|
||||
*netrw-p9* *netrw-ml_get*
|
||||
P9. I'm browsing, changing directory, and bang! ml_get errors
|
||||
appear and I have to kill vim. Any way around this?
|
||||
@ -3298,6 +3490,14 @@ Associated setting variables: |g:netrw_chgwin|
|
||||
P11. I want to have two windows; a thin one on the left and my editing
|
||||
window on the right. How may I accomplish this?
|
||||
|
||||
You probably want netrw running as in a side window. If so, you
|
||||
will likely find that ":[N]Lexplore" does what you want. The
|
||||
optional "[N]" allows you to select the quantity of columns you
|
||||
wish the |:Lexplore|r window to start with (see |g:netrw_winsize|
|
||||
for how this parameter works).
|
||||
|
||||
Previous solution:
|
||||
|
||||
* Put the following line in your <.vimrc>:
|
||||
let g:netrw_altv = 1
|
||||
* Edit the current directory: :e .
|
||||
@ -3311,6 +3511,7 @@ Associated setting variables: |g:netrw_chgwin|
|
||||
<leftmouse> in the browser window and then press the
|
||||
<middlemouse> to select the file.
|
||||
|
||||
|
||||
*netrw-p12*
|
||||
P12. My directory isn't sorting correctly, or unwanted letters are
|
||||
appearing in the listed filenames, or things aren't lining
|
||||
@ -3388,7 +3589,7 @@ Associated setting variables: |g:netrw_chgwin|
|
||||
to open a swap file.
|
||||
|
||||
(romainl) It looks like you are starting Vim from a protected
|
||||
directory. Start if from your $HOME or another writable
|
||||
directory. Start netrw from your $HOME or other writable
|
||||
directory.
|
||||
|
||||
*netrw-p17*
|
||||
@ -3412,6 +3613,58 @@ Associated setting variables: |g:netrw_chgwin|
|
||||
"Using Vim to Remotely Edit A File on ServerB Only
|
||||
Accessible From ServerA"
|
||||
|
||||
*netrw-P19*
|
||||
P19. How do I get numbering on in directory listings?
|
||||
With |g:netrw_bufsettings|, you can control netrw's buffer
|
||||
settings; try putting >
|
||||
let g:netrw_bufsettings="noma nomod nu nobl nowrap ro nornu"
|
||||
< in your .vimrc. If you'd like to have relative numbering
|
||||
instead, try >
|
||||
let g:netrw_bufsettings="noma nomod nonu nobl nowrap ro rnu"
|
||||
<
|
||||
*netrw-P20*
|
||||
P20. How may I have gvim start up showing a directory listing?
|
||||
Try putting the following code snippet into your .vimrc: >
|
||||
augroup VimStartup
|
||||
au!
|
||||
au VimEnter * if expand("%") == "" && argc() == 0 &&
|
||||
\ (v:servername =~ 'GVIM\d*' || v:servername == "")
|
||||
\ | e . | endif
|
||||
augroup END
|
||||
< You may use Lexplore instead of "e" if you're so inclined.
|
||||
This snippet assumes that you have client-server enabled
|
||||
(ie. a "huge" vim version).
|
||||
|
||||
*netrw-P21*
|
||||
P21. I've made a directory (or file) with an accented character, but
|
||||
netrw isn't letting me enter that directory/read that file:
|
||||
|
||||
Its likely that the shell or o/s is using a different encoding
|
||||
than you have vim (netrw) using. A patch to vim supporting
|
||||
"systemencoding" may address this issue in the future; for
|
||||
now, just have netrw use the proper encoding. For example: >
|
||||
|
||||
au FileType netrw set enc=latin1
|
||||
<
|
||||
*netrw-P22*
|
||||
P22. I get an error message when I try to copy or move a file:
|
||||
|
||||
**error** (netrw) tried using g:netrw_localcopycmd<cp>; it doesn't work!
|
||||
|
||||
What's wrong?
|
||||
|
||||
Netrw uses several system level commands to do things (see
|
||||
|
||||
|g:netrw_localcopycmd|, |g:netrw_localmovecmd|,
|
||||
|g:netrw_localrmdir|, |g:netrw_mkdir_cmd|).
|
||||
|
||||
You may need to adjust the default commands for one or more of
|
||||
these commands by setting them properly in your .vimrc. Another
|
||||
source of difficulty is that these commands use vim's local
|
||||
directory, which may not be the same as the browsing directory
|
||||
shown by netrw (see |g:netrw_keepdir|).
|
||||
|
||||
|
||||
==============================================================================
|
||||
11. Debugging Netrw Itself *netrw-debug* {{{1
|
||||
|
||||
@ -3441,13 +3694,13 @@ called netrw.vimrc with the following contents: >
|
||||
<
|
||||
Then run netrw as follows: >
|
||||
|
||||
vim -u netrw.vimrc --noplugins [some path here]
|
||||
vim -u netrw.vimrc --noplugins -i NONE [some path here]
|
||||
<
|
||||
Perform whatever netrw commands you need to, and check that the problem is
|
||||
still present. This procedure sidesteps any issues due to personal .vimrc
|
||||
settings and other plugins. If the problem does not appear, then you need
|
||||
to determine what setting in your .vimrc is causing the conflict with netrw
|
||||
or which plugin.
|
||||
settings, .viminfo file, and other plugins. If the problem does not appear,
|
||||
then you need to determine which setting in your .vimrc is causing the
|
||||
conflict with netrw or which plugin(s) is/are involved.
|
||||
|
||||
Step 3: If the problem still is present, then get a debugging trace from
|
||||
netrw:
|
||||
@ -3502,6 +3755,77 @@ netrw:
|
||||
==============================================================================
|
||||
12. History *netrw-history* {{{1
|
||||
|
||||
v155: Oct 29, 2015 * (Timur Fayzrakhmanov) reported that netrw's
|
||||
mapping of ctrl-l was not allowing refresh of
|
||||
other windows when it was done in a netrw
|
||||
window.
|
||||
Nov 05, 2015 * Improved s:TreeSqueezeDir() to use search()
|
||||
instead of a loop
|
||||
* NetrwBrowse() will return line to
|
||||
w:netrw_bannercnt if cursor ended up in
|
||||
banner
|
||||
Nov 16, 2015 * Added a <Plug>NetrwTreeSqueeze (|netrw-s-cr|)
|
||||
Nov 17, 2015 * Commented out imaps -- perhaps someone can
|
||||
tell me how they're useful and should be
|
||||
retained?
|
||||
Nov 20, 2015 * Added |netrw-ma| and |netrw-mA| support
|
||||
Nov 20, 2015 * gx (|netrw-gx|) on an url downloaded the
|
||||
file in addition to simply bringing up the
|
||||
url in a browser. Fixed.
|
||||
Nov 23, 2015 * Added |g:netrw_sizestyle| support
|
||||
Nov 27, 2015 * Inserted a lot of <c-u>s into various netrw
|
||||
maps.
|
||||
Jan 05, 2016 * |netrw-qL| implemented to mark files based
|
||||
upon |location-list|s; similar to |netrw-qF|.
|
||||
Jan 19, 2016 * using - call delete(directoryname,"d") -
|
||||
instead of using g:netrw_localrmdir if
|
||||
v7.4 + patch#1107 is available
|
||||
Jan 28, 2016 * changed to using |winsaveview()| and
|
||||
|winrestview()|
|
||||
Jan 28, 2016 * s:NetrwTreePath() now does a save and
|
||||
restore of view
|
||||
Feb 08, 2016 * Fixed a tree-listing problem with remote
|
||||
directories
|
||||
v154: Feb 26, 2015 * (Yuri Kanivetsky) reported a situation where
|
||||
a file was not treated properly as a file
|
||||
due to g:netrw_keepdir == 1
|
||||
Mar 25, 2015 * (requested by Ben Friz) one may now sort by
|
||||
extension
|
||||
Mar 28, 2015 * (requested by Matt Brooks) netrw has a lot
|
||||
of buffer-local mappings; however, some
|
||||
plugins (such as vim-surround) set up
|
||||
conflicting mappings that cause vim to wait.
|
||||
The "<nowait>" modifier has been included
|
||||
with most of netrw's mappings to avoid that
|
||||
delay.
|
||||
Jun 26, 2015 * |netrw-gn| mapping implemted
|
||||
* :Ntree NotADir resulted in having
|
||||
the tree listing expand in the error messages
|
||||
window. Fixed.
|
||||
Jun 29, 2015 * Attempting to delete a file remotely caused
|
||||
an error with "keepsol" mentioned; fixed.
|
||||
Jul 08, 2015 * Several changes to keep the |:jumps| table
|
||||
correct when working with
|
||||
|g:netrw_fastbrowse| set to 2
|
||||
* wide listing with accented characters fixed
|
||||
(using %-S instead of %-s with a |printf()|
|
||||
Jul 13, 2015 * (Daniel Hahler) CheckIfKde() could be true
|
||||
but kfmclient not installed. Changed order
|
||||
in netrw#BrowseX(): checks if kde and
|
||||
kfmclient, then will use xdg-open on a unix
|
||||
system (if xdg-open is executable)
|
||||
Aug 11, 2015 * (McDonnell) tree listing mode wouldn't
|
||||
select a file in a open subdirectory.
|
||||
* (McDonnell) when multiple subdirectories
|
||||
were concurrently open in tree listing
|
||||
mode, a ctrl-L wouldn't refresh properly.
|
||||
* The netrw:target menu showed duplicate
|
||||
entries
|
||||
Oct 13, 2015 * (mattn) provided an exception to handle
|
||||
windows with shellslash set but no shell
|
||||
Oct 23, 2015 * if g:netrw_usetab and <c-tab> now used
|
||||
to control whether NetrwShrink is used
|
||||
(see |netrw-c-tab|)
|
||||
v153: May 13, 2014 * added another |g:netrw_ffkeep| usage {{{2
|
||||
May 14, 2014 * changed s:PerformListing() so that it
|
||||
always sets ft=netrw for netrw buffers
|
||||
@ -3622,7 +3946,7 @@ netrw:
|
||||
handling.
|
||||
* |:Lexplore| path: will be used to update
|
||||
a left-side netrw browsing directory.
|
||||
Mar 12, 2014 * |:netrw-s-cr|: use <s-cr> to close
|
||||
Mar 12, 2014 * |netrw-s-cr|: use <s-cr> to close
|
||||
tree directory implemented
|
||||
Mar 13, 2014 * (Tony Mechylynck) reported that using
|
||||
the browser with ftp on a directory,
|
||||
|
150
runtime/doc/provider.txt
Normal file
150
runtime/doc/provider.txt
Normal file
@ -0,0 +1,150 @@
|
||||
*provider.txt* {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||
|
||||
|
||||
Providers *provider*
|
||||
|
||||
Nvim delegates some features to dynamic "providers".
|
||||
|
||||
==============================================================================
|
||||
Python integration *provider-python*
|
||||
|
||||
Nvim supports the Vim legacy |python-vim| and |python3| interfaces via
|
||||
external Python interpreters connected via |RPC|,
|
||||
|
||||
Note: Only the Vim 7.3 API is supported; bindeval (Vim 7.4) is not.
|
||||
|
||||
|
||||
PYTHON QUICKSTART ~
|
||||
|
||||
If you used a package manager to install Nvim there's a good chance that
|
||||
it also provides the `neovim` Python package. If it doesn't, follow these
|
||||
steps to install the package with Python's package manager, `pip`.
|
||||
|
||||
Note: Depending on your system, `pip` might refer to Python 2 or Python 3,
|
||||
which is why the following instructions mention `pip2` or `pip3`
|
||||
explicitly. If one of these is not available, try `pip`.
|
||||
|
||||
To use Vim Python 2/3 plugins with Nvim:
|
||||
|
||||
- For Python 2 plugins, make sure an interpreter for Python 2.6 or 2.7 is
|
||||
available in your `$PATH`, then install the `neovim` Python package systemwide: >
|
||||
$ sudo pip2 install --upgrade neovim
|
||||
<
|
||||
or for the current user: >
|
||||
$ pip2 install --user --upgrade neovim
|
||||
<
|
||||
- For Python 3 plugins, make sure an interpreter for Python 3.3 or above is
|
||||
available in your `$PATH`, then install the `neovim` Python package systemwide: >
|
||||
$ sudo pip3 install --upgrade neovim
|
||||
<
|
||||
or for the current user: >
|
||||
$ pip3 install --user --upgrade neovim
|
||||
<
|
||||
Note: The `--upgrade` flag ensures you have the latest version even if
|
||||
a previous version was already installed.
|
||||
|
||||
PYTHON PROVIDER CONFIGURATION ~
|
||||
*g:python_host_prog*
|
||||
Set `g:python_host_prog` to point Nvim to a specific Python 2 interpreter: >
|
||||
let g:python_host_prog = '/path/to/python'
|
||||
<
|
||||
*g:python3_host_prog*
|
||||
Set `g:python3_host_prog` to point Nvim to a specific Python 3 interpreter: >
|
||||
let g:python3_host_prog = '/path/to/python3'
|
||||
<
|
||||
*g:loaded_python_provider*
|
||||
To disable Python 2 support: >
|
||||
let g:loaded_python_provider = 1
|
||||
<
|
||||
*g:loaded_python3_provider*
|
||||
To disable Python 3 support: >
|
||||
let g:loaded_python3_provider = 1
|
||||
<
|
||||
*g:python_host_skip_check*
|
||||
Set `g:python_host_skip_check` to disable the Python 2 interpreter check.
|
||||
Note: This requires you to install the python-neovim module properly. >
|
||||
let g:python_host_skip_check = 1
|
||||
<
|
||||
*g:python3_host_skip_check*
|
||||
Set `g:python3_host_skip_check` to disable the Python 3 interpreter check.
|
||||
Note: This requires you to install the python3-neovim module properly. >
|
||||
let g:python3_host_skip_check = 1
|
||||
|
||||
|
||||
TROUBLESHOOTING *python-trouble*
|
||||
|
||||
If you have trouble with a plugin that uses the `neovim` Python client, use
|
||||
the |:CheckHealth| command to diagnose your setup.
|
||||
|
||||
==============================================================================
|
||||
Ruby integration *provider-ruby*
|
||||
|
||||
Nvim supports the Vim legacy |ruby-vim| interface via external Ruby
|
||||
interpreters connected via |RPC|.
|
||||
|
||||
|
||||
RUBY QUICKSTART ~
|
||||
|
||||
To use Vim Ruby plugins with Nvim, just install the latest `neovim` RubyGem: >
|
||||
$ gem install neovim
|
||||
|
||||
|
||||
RUBY PROVIDER CONFIGURATION ~
|
||||
*g:loaded_ruby_provider*
|
||||
To disable Ruby support: >
|
||||
let g:loaded_ruby_provider = 1
|
||||
|
||||
|
||||
==============================================================================
|
||||
Clipboard integration *provider-clipboard* *clipboard*
|
||||
|
||||
Nvim has no direct connection to the system clipboard. Instead it is
|
||||
accessible through a |provider| which transparently uses shell commands for
|
||||
communicating with the clipboard.
|
||||
|
||||
Clipboard access is implicitly enabled if any of the following clipboard tools
|
||||
are found in your `$PATH`.
|
||||
|
||||
- xclip
|
||||
- xsel (newer alternative to xclip)
|
||||
- pbcopy/pbpaste (Mac OS X)
|
||||
- lemonade (for SSH) https://github.com/pocke/lemonade
|
||||
- doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/
|
||||
|
||||
The presence of a suitable clipboard tool implicitly enables the '+' and '*'
|
||||
registers.
|
||||
|
||||
If you want to ALWAYS use the clipboard for ALL operations (as opposed
|
||||
to interacting with the '+' and/or '*' registers explicitly), set the
|
||||
following option:
|
||||
>
|
||||
set clipboard+=unnamedplus
|
||||
<
|
||||
See 'clipboard' for details and more options.
|
||||
|
||||
==============================================================================
|
||||
X11 selection mechanism *clipboard-x11* *x11-selection*
|
||||
|
||||
The clipboard providers for X11 store text in what is known as "selections".
|
||||
Selections are "owned" by an application, so when the application is closed,
|
||||
the selection text is lost.
|
||||
|
||||
The contents of selections are held by the originating application (e.g., upon
|
||||
a copy), and only passed on to another application when that other application
|
||||
asks for them (e.g., upon a paste).
|
||||
|
||||
*quoteplus* *quote+*
|
||||
|
||||
There are three documented X11 selections: `PRIMARY`, `SECONDARY`, and `CLIPBOARD`.
|
||||
`CLIPBOARD` is typically used in X11 applications for copy/paste operations
|
||||
(`Ctrl-c`/`v`), while `PRIMARY` is used for the last selected text, which is
|
||||
generally inserted with the middle mouse button.
|
||||
|
||||
Nvim's X11 clipboard providers only utilize the `PRIMARY` and `CLIPBOARD`
|
||||
selections, used for the '*' and '+' registers, respectively.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 7.4. Last change: 2014 Mar 27
|
||||
*quickfix.txt* For Vim version 7.4. Last change: 2016 Mar 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -49,6 +49,10 @@ The following quickfix commands can be used. The location list commands are
|
||||
similar to the quickfix commands, replacing the 'c' prefix in the quickfix
|
||||
command with 'l'.
|
||||
|
||||
*E924*
|
||||
If the current window was closed by an |autocommand| while processing a
|
||||
location list command, it will be aborted.
|
||||
|
||||
*:cc*
|
||||
:cc[!] [nr] Display error [nr]. If [nr] is omitted, the same
|
||||
error is displayed again. Without [!] this doesn't
|
||||
@ -302,16 +306,22 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
|
||||
etc.
|
||||
< When the current file can't be |abandon|ed and the [!]
|
||||
is not present, the command fails.
|
||||
When an error is detected on one buffer, further
|
||||
buffers will not be visited.
|
||||
When an error is detected excecution stops.
|
||||
The last buffer (or where an error occurred) becomes
|
||||
the current buffer.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
|
||||
Only valid entries in the quickfix list are used.
|
||||
A range can be used to select entries, e.g.: >
|
||||
:10,$cdo cmd
|
||||
< To skip entries 1 to 9.
|
||||
|
||||
Note: While this command is executing, the Syntax
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each buffer.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|
||||
|:ldo|, |:cfdo| and |:lfdo|.
|
||||
|
||||
@ -323,20 +333,9 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
|
||||
:cnfile
|
||||
:{cmd}
|
||||
etc.
|
||||
< When the current file can't be |abandon|ed and the [!]
|
||||
is not present, the command fails.
|
||||
When an error is detected on one buffer, further
|
||||
buffers will not be visited.
|
||||
The last buffer (or where an error occurred) becomes
|
||||
the current buffer.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
Only valid entries in the quickfix list are used.
|
||||
Note: While this command is executing, the Syntax
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each buffer.
|
||||
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|
||||
|:cdo|, |:ldo| and |:lfdo|.
|
||||
< Otherwise it works the same as `:cdo`.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
|
||||
*:ldo*
|
||||
:ld[o][!] {cmd} Execute {cmd} in each valid entry in the location list
|
||||
@ -347,20 +346,10 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
|
||||
:lnext
|
||||
:{cmd}
|
||||
etc.
|
||||
< When the current file can't be |abandon|ed and the [!]
|
||||
is not present, the command fails.
|
||||
When an error is detected on one buffer, further
|
||||
buffers will not be visited.
|
||||
The last buffer (or where an error occurred) becomes
|
||||
the current buffer.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
Only valid entries in the location list are used.
|
||||
Note: While this command is executing, the Syntax
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each buffer.
|
||||
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|
||||
|:cdo|, |:cfdo| and |:lfdo|.
|
||||
< Only valid entries in the location list are used.
|
||||
Otherwise it works the same as `:cdo`.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
|
||||
*:lfdo*
|
||||
:lfdo[!] {cmd} Execute {cmd} in each file in the location list for
|
||||
@ -371,20 +360,9 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
|
||||
:lnfile
|
||||
:{cmd}
|
||||
etc.
|
||||
< When the current file can't be |abandon|ed and the [!]
|
||||
is not present, the command fails.
|
||||
When an error is detected on one buffer, further
|
||||
buffers will not be visited.
|
||||
The last buffer (or where an error occurred) becomes
|
||||
the current buffer.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
Only valid entries in the location list are used.
|
||||
Note: While this command is executing, the Syntax
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each buffer.
|
||||
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|
||||
|:cdo|, |:ldo| and |:cfdo|.
|
||||
< Otherwise it works the same as `:ldo`.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
|
||||
=============================================================================
|
||||
2. The error window *quickfix-window*
|
||||
|
@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 7.4. Last change: 2014 Nov 19
|
||||
*quickref.txt* For Vim version 7.4. Last change: 2016 Mar 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -617,6 +617,7 @@ Short explanation of each option: *option-list*
|
||||
'balloondelay' 'bdlay' delay in mS before a balloon may pop up
|
||||
'ballooneval' 'beval' switch on balloon evaluation
|
||||
'balloonexpr' 'bexpr' expression to show in balloon
|
||||
'belloff' 'bo' do not ring the bell for these reasons
|
||||
'binary' 'bin' read/write/edit file in binary mode
|
||||
'bomb' prepend a Byte Order Mark to the file
|
||||
'breakat' 'brk' characters that may cause a line break
|
||||
@ -688,6 +689,7 @@ Short explanation of each option: *option-list*
|
||||
'fileignorecase' 'fic' ignore case when using file names
|
||||
'filetype' 'ft' type of file, used for autocommands
|
||||
'fillchars' 'fcs' characters to use for displaying special items
|
||||
'fixendofline' 'fixeol' make sure last line in file has <EOL>
|
||||
'fkmap' 'fk' Farsi keyboard mapping
|
||||
'foldclose' 'fcl' close a fold when the cursor leaves it
|
||||
'foldcolumn' 'fdc' width of the column used to indicate folds
|
||||
@ -702,10 +704,10 @@ Short explanation of each option: *option-list*
|
||||
'foldnestmax' 'fdn' maximum fold depth
|
||||
'foldopen' 'fdo' for which commands a fold will be opened
|
||||
'foldtext' 'fdt' expression used to display for a closed fold
|
||||
'formatexpr' 'fex' expression used with "gq" command
|
||||
'formatlistpat' 'flp' pattern used to recognize a list header
|
||||
'formatoptions' 'fo' how automatic formatting is to be done
|
||||
'formatprg' 'fp' name of external program used with "gq" command
|
||||
'formatexpr' 'fex' expression used with "gq" command
|
||||
'fsync' 'fs' whether to invoke fsync() after file write
|
||||
'gdefault' 'gd' the ":substitute" flag 'g' is default on
|
||||
'grepformat' 'gfm' format of 'grepprg' output
|
||||
@ -792,12 +794,14 @@ Short explanation of each option: *option-list*
|
||||
'omnifunc' 'ofu' function for filetype-specific completion
|
||||
'opendevice' 'odev' allow reading/writing devices on MS-Windows
|
||||
'operatorfunc' 'opfunc' function to be called for |g@| operator
|
||||
'packpath' 'pp' list of directories used for packages
|
||||
'paragraphs' 'para' nroff macros that separate paragraphs
|
||||
'paste' allow pasting text
|
||||
'pastetoggle' 'pt' key code that causes 'paste' to toggle
|
||||
'patchexpr' 'pex' expression used to patch a file
|
||||
'patchmode' 'pm' keep the oldest version of a file
|
||||
'path' 'pa' list of directories searched with "gf" et.al.
|
||||
'perldll' name of the Perl dynamic library
|
||||
'preserveindent' 'pi' preserve the indent structure when reindenting
|
||||
'previewheight' 'pvh' height of the preview window
|
||||
'previewwindow' 'pvw' identifies the preview window
|
||||
@ -810,6 +814,8 @@ Short explanation of each option: *option-list*
|
||||
'printmbfont' 'pmbfn' font names to be used for CJK output of :hardcopy
|
||||
'printoptions' 'popt' controls the format of :hardcopy output
|
||||
'pumheight' 'ph' maximum height of the popup menu
|
||||
'pythondll' name of the Python 2 dynamic library
|
||||
'pythonthreedll' name of the Python 3 dynamic library
|
||||
'quoteescape' 'qe' escape characters used in a string
|
||||
'readonly' 'ro' disallow writing the buffer
|
||||
'redrawtime' 'rdt' timeout for 'hlsearch' and |:match| highlighting
|
||||
@ -820,6 +826,7 @@ Short explanation of each option: *option-list*
|
||||
'revins' 'ri' inserting characters will work backwards
|
||||
'rightleft' 'rl' window is right-to-left oriented
|
||||
'rightleftcmd' 'rlc' commands for which editing works right-to-left
|
||||
'rubydll' name of the Ruby dynamic library
|
||||
'ruler' 'ru' show cursor line and column in the status line
|
||||
'rulerformat' 'ruf' custom format for the ruler
|
||||
'runtimepath' 'rtp' list of directories used for runtime files
|
||||
@ -873,10 +880,11 @@ Short explanation of each option: *option-list*
|
||||
'switchbuf' 'swb' sets behavior when switching to another buffer
|
||||
'synmaxcol' 'smc' maximum column to find syntax items
|
||||
'syntax' 'syn' syntax to be loaded for current buffer
|
||||
'tabstop' 'ts' number of spaces that <Tab> in file uses
|
||||
'tabline' 'tal' custom format for the console tab pages line
|
||||
'tabpagemax' 'tpm' maximum number of tab pages for |-p| and "tab all"
|
||||
'tabstop' 'ts' number of spaces that <Tab> in file uses
|
||||
'tagbsearch' 'tbs' use binary searching in tags files
|
||||
'tagcase' 'tc' how to handle case when searching in tags files
|
||||
'taglength' 'tl' number of significant characters for a tag
|
||||
'tagrelative' 'tr' file names in tag file are relative
|
||||
'tags' 'tag' list of file names used by the tag command
|
||||
|
@ -16,8 +16,8 @@ Nvim support for remote plugins *remote-plugin*
|
||||
|
||||
Extensibility is a primary goal of Nvim. Any programming language may be used
|
||||
to extend Nvim without changes to Nvim itself. This is achieved with remote
|
||||
plugins, coprocesses that have a direct communication channel (via
|
||||
|msgpack-rpc|) with the Nvim process.
|
||||
plugins, coprocesses that have a direct communication channel (via |RPC|) with
|
||||
the Nvim process.
|
||||
|
||||
Even though these plugins run in separate processes they can call, be called,
|
||||
and receive events just as if the plugin's code were executed in the main
|
||||
@ -33,9 +33,9 @@ check whether a plugin host is available for their chosen programming language.
|
||||
|
||||
Plugin hosts are programs that provide a high-level environment for plugins,
|
||||
taking care of most boilerplate involved in defining commands, autocmds, and
|
||||
functions that are implemented over |msgpack-rpc| connections. Hosts are
|
||||
loaded only when one of their registered plugins require it, keeping Nvim's
|
||||
startup as fast as possible, even if many plugins/hosts are installed.
|
||||
functions that are implemented over |RPC| connections. Hosts are loaded only
|
||||
when one of their registered plugins require it, keeping Nvim's startup as
|
||||
fast as possible, even if many plugins/hosts are installed.
|
||||
|
||||
==============================================================================
|
||||
3. Example *remote-plugin-example*
|
||||
@ -95,20 +95,20 @@ handler function are ignored.
|
||||
To test the above plugin, it must be saved in "rplugin/python" in a
|
||||
'runtimepath' directory (~/.config/nvim/rplugin/python/limit.py for example).
|
||||
Then, the remote plugin manifest must be generated with
|
||||
`:UpdateRemotePlugins`.
|
||||
|:UpdateRemotePlugins|.
|
||||
|
||||
==============================================================================
|
||||
4. Remote plugin manifest *remote-plugin-manifest*
|
||||
*:UpdateRemotePlugins*
|
||||
|
||||
Just installing remote plugins to "rplugin/{host}" isn't enough for them to be
|
||||
automatically loaded when required. You must execute `:UpdateRemotePlugins`
|
||||
automatically loaded when required. You must execute |:UpdateRemotePlugins|
|
||||
every time a remote plugin is installed, updated, or deleted.
|
||||
|
||||
`:UpdateRemotePlugins` generates the remote plugin manifest, a special
|
||||
|:UpdateRemotePlugins| generates the remote plugin manifest, a special
|
||||
Vimscript file containing declarations for all Vimscript entities
|
||||
(commands/autocommands/functions) defined by all remote plugins, with each
|
||||
entity associated with the host and plugin path. The manifest is a generated
|
||||
extension to the user's vimrc (it even has the vimrc filename prepended).
|
||||
entity associated with the host and plugin path.
|
||||
|
||||
Manifest declarations are just calls to the `remote#host#RegisterPlugin`
|
||||
function, which takes care of bootstrapping the host as soon as the declared
|
||||
@ -125,10 +125,20 @@ the example, say the Java plugin is a semantic completion engine for Java code.
|
||||
If it defines the autocommand "BufEnter *.java", then the Java host is spawned
|
||||
only when Nvim loads a buffer matching "*.java".
|
||||
|
||||
If the explicit call to `:UpdateRemotePlugins` seems incovenient, try to see it
|
||||
If the explicit call to |:UpdateRemotePlugins| seems incovenient, try to see it
|
||||
like this: It's a way to provide IDE capabilities in Nvim while still keeping
|
||||
it fast and lightweight for general use. It's also analogous to the |:helptags|
|
||||
command.
|
||||
|
||||
*$NVIM_RPLUGIN_MANIFEST*
|
||||
Unless $NVIM_RPLUGIN_MANIFEST is set the manifest will be written to a file
|
||||
named `rplugin.vim` at:
|
||||
|
||||
Unix ~
|
||||
$XDG_DATA_HOME/nvim/ or ~/.local/share/nvim/
|
||||
|
||||
Windows ~
|
||||
$LOCALAPPDATA/nvim/ or ~/AppData/Local/nvim/
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 7.4. Last change: 2015 Apr 13
|
||||
*repeat.txt* For Vim version 7.4. Last change: 2016 Apr 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -12,8 +12,10 @@ Chapter 26 of the user manual introduces repeating |usr_26.txt|.
|
||||
2. Multiple repeats |multi-repeat|
|
||||
3. Complex repeats |complex-repeat|
|
||||
4. Using Vim scripts |using-scripts|
|
||||
5. Debugging scripts |debug-scripts|
|
||||
6. Profiling |profiling|
|
||||
5. Using Vim packages |packages|
|
||||
6. Creating Vim packages |package-create|
|
||||
7. Debugging scripts |debug-scripts|
|
||||
8. Profiling |profiling|
|
||||
|
||||
==============================================================================
|
||||
1. Single repeats *single-repeat*
|
||||
@ -68,8 +70,8 @@ examples.
|
||||
The global commands work by first scanning through the [range] lines and
|
||||
marking each line where a match occurs (for a multi-line pattern, only the
|
||||
start of the match matters).
|
||||
In a second scan the [cmd] is executed for each marked line with its line
|
||||
number prepended. For ":v" and ":g!" the command is executed for each not
|
||||
In a second scan the [cmd] is executed for each marked line, as if the cursor
|
||||
was in that line. For ":v" and ":g!" the command is executed for each not
|
||||
marked line. If a line is deleted its mark disappears.
|
||||
The default for [range] is the whole buffer (1,$). Use "CTRL-C" to interrupt
|
||||
the command. If an error message is given for a line, the command for that
|
||||
@ -173,10 +175,12 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
commands.
|
||||
|
||||
*:ru* *:runtime*
|
||||
:ru[ntime][!] {file} ..
|
||||
:ru[ntime][!] [where] {file} ..
|
||||
Read Ex commands from {file} in each directory given
|
||||
by 'runtimepath'. There is no error for non-existing
|
||||
files. Example: >
|
||||
by 'runtimepath' and/or 'packpath'. There is no error
|
||||
for non-existing files.
|
||||
|
||||
Example: >
|
||||
:runtime syntax/c.vim
|
||||
|
||||
< There can be multiple {file} arguments, separated by
|
||||
@ -190,6 +194,15 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
When it is not included only the first found file is
|
||||
sourced.
|
||||
|
||||
When [where] is omitted only 'runtimepath' is used.
|
||||
Other values:
|
||||
START search under "start" in 'packpath'
|
||||
OPT search under "opt" in 'packpath'
|
||||
PACK search under "start" and "opt" in
|
||||
'packpath'
|
||||
ALL first use 'runtimepath', then search
|
||||
under "start" and "opt" in 'packpath'
|
||||
|
||||
When {file} contains wildcards it is expanded to all
|
||||
matching files. Example: >
|
||||
:runtime! plugin/*.vim
|
||||
@ -203,6 +216,57 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
When 'verbose' is two or higher, there is a message
|
||||
about each searched file.
|
||||
|
||||
*:pa* *:packadd* *E919*
|
||||
:pa[ckadd][!] {name} Search for an optional plugin directory in 'packpath'
|
||||
and source any plugin files found. The directory must
|
||||
match:
|
||||
pack/*/opt/{name} ~
|
||||
The directory is added to 'runtimepath' if it wasn't
|
||||
there yet.
|
||||
|
||||
Note that {name} is the directory name, not the name
|
||||
of the .vim file. All the files matching the pattern
|
||||
pack/*/opt/{name}/plugin/**/*.vim ~
|
||||
will be sourced. This allows for using subdirectories
|
||||
below "plugin", just like with plugins in
|
||||
'runtimepath'.
|
||||
|
||||
If the filetype detection was not enabled yet (this
|
||||
is usually done with a "syntax enable" or "filetype
|
||||
on" command in your .vimrc file), this will also look
|
||||
for "{name}/ftdetect/*.vim" files.
|
||||
|
||||
When the optional ! is added no plugin files or
|
||||
ftdetect scripts are loaded, only the matching
|
||||
directories are added to 'runtimepath'. This is
|
||||
useful in your .vimrc. The plugins will then be
|
||||
loaded during initialization, see |load-plugins|.
|
||||
|
||||
Also see |pack-add|.
|
||||
|
||||
*:packl* *:packloadall*
|
||||
:packl[oadall][!] Load all packages in the "start" directory under each
|
||||
entry in 'packpath'.
|
||||
|
||||
First all the directories found are added to
|
||||
'runtimepath', then the plugins found in the
|
||||
directories are sourced. This allows for a plugin to
|
||||
depend on something of another plugin, e.g. an
|
||||
"autoload" directory. See |packload-two-steps| for
|
||||
how this can be useful.
|
||||
|
||||
This is normally done automatically during startup,
|
||||
after loading your .vimrc file. With this command it
|
||||
can be done earlier.
|
||||
|
||||
Packages will be loaded only once. After this command
|
||||
it won't happen again. When the optional ! is added
|
||||
this command will load packages even when done before.
|
||||
|
||||
An error only causes sourcing the script where it
|
||||
happens to be aborted, further plugins will be loaded.
|
||||
See |packages|.
|
||||
|
||||
:scripte[ncoding] [encoding] *:scripte* *:scriptencoding* *E167*
|
||||
Specify the character encoding used in the script.
|
||||
The following lines will be converted from [encoding]
|
||||
@ -373,7 +437,186 @@ Rationale:
|
||||
< Therefore the unusual leading backslash is used.
|
||||
|
||||
==============================================================================
|
||||
5. Debugging scripts *debug-scripts*
|
||||
5. Using Vim packages *packages*
|
||||
|
||||
A Vim package is a directory that contains one or more plugins. The
|
||||
advantages over normal plugins:
|
||||
- A package can be downloaded as an archive and unpacked in its own directory.
|
||||
Thus the files are not mixed with files of other plugins. That makes it
|
||||
easy to update and remove.
|
||||
- A package can be a git, mercurial, etc. repository. That makes it really
|
||||
easy to update.
|
||||
- A package can contain multiple plugins that depend on each other.
|
||||
- A package can contain plugins that are automatically loaded on startup and
|
||||
ones that are only loaded when needed with `:packadd`.
|
||||
|
||||
|
||||
Using a package and loading automatically ~
|
||||
|
||||
Let's assume your Vim files are in the "~/.local/share/nvim/site" directory
|
||||
and you want to add a package from a zip archive "/tmp/foopack.zip":
|
||||
% mkdir -p ~/.local/share/nvim/site/pack/foo
|
||||
% cd ~/.local/share/nvim/site/pack/foo
|
||||
% unzip /tmp/foopack.zip
|
||||
|
||||
The directory name "foo" is arbitrary, you can pick anything you like.
|
||||
|
||||
You would now have these files under ~/.local/share/nvim/site:
|
||||
pack/foo/README.txt
|
||||
pack/foo/start/foobar/plugin/foo.vim
|
||||
pack/foo/start/foobar/syntax/some.vim
|
||||
pack/foo/opt/foodebug/plugin/debugger.vim
|
||||
|
||||
When Vim starts up, after processing your .vimrc, it scans all directories in
|
||||
'packpath' for plugins under the "pack/*/start" directory. First all those
|
||||
directories are added to 'runtimepath'. Then all the plugins are loaded.
|
||||
See |packload-two-steps| for how these two steps can be useful.
|
||||
|
||||
In the example Vim will find "pack/foo/start/foobar/plugin/foo.vim" and adds
|
||||
"~/.local/share/nvim/site/pack/foo/start/foobar" to 'runtimepath'.
|
||||
|
||||
If the "foobar" plugin kicks in and sets the 'filetype' to "some", Vim will
|
||||
find the syntax/some.vim file, because its directory is in 'runtimepath'.
|
||||
|
||||
Vim will also load ftdetect files, if there are any.
|
||||
|
||||
Note that the files under "pack/foo/opt" are not loaded automatically, only the
|
||||
ones under "pack/foo/start". See |pack-add| below for how the "opt" directory
|
||||
is used.
|
||||
|
||||
Loading packages automatically will not happen if loading plugins is disabled,
|
||||
see |load-plugins|.
|
||||
|
||||
To load packages earlier, so that 'runtimepath' gets updated: >
|
||||
:packloadall
|
||||
This also works when loading plugins is disabled. The automatic loading will
|
||||
only happen once.
|
||||
|
||||
|
||||
Using a single plugin and loading it automatically ~
|
||||
|
||||
If you don't have a package but a single plugin, you need to create the extra
|
||||
directory level:
|
||||
% mkdir -p ~/.local/share/nvim/site/pack/foo/start/foobar
|
||||
% cd ~/.local/share/nvim/site/pack/foo/start/foobar
|
||||
% unzip /tmp/someplugin.zip
|
||||
|
||||
You would now have these files:
|
||||
pack/foo/start/foobar/plugin/foo.vim
|
||||
pack/foo/start/foobar/syntax/some.vim
|
||||
|
||||
From here it works like above.
|
||||
|
||||
|
||||
Optional plugins ~
|
||||
*pack-add*
|
||||
To load an optional plugin from a pack use the `:packadd` command: >
|
||||
:packadd foodebug
|
||||
This searches for "pack/*/opt/foodebug" in 'packpath' and will find
|
||||
~/.local/share/nvim/site/pack/foo/opt/foodebug/plugin/debugger.vim and source
|
||||
it.
|
||||
|
||||
This could be done if some conditions are met. For example, depending on
|
||||
whether Vim supports a feature or a dependency is missing.
|
||||
|
||||
You can also load an optional plugin at startup, by putting this command in
|
||||
your |.vimrc|: >
|
||||
:packadd! foodebug
|
||||
The extra "!" is so that the plugin isn't loaded with Vim was started with
|
||||
|--noplugin|.
|
||||
|
||||
It is perfectly normal for a package to only have files in the "opt"
|
||||
directory. You then need to load each plugin when you want to use it.
|
||||
|
||||
|
||||
Where to put what ~
|
||||
|
||||
Since color schemes, loaded with `:colorscheme`, are found below
|
||||
"pack/*/start" and "pack/*/opt", you could put them anywhere. We recommend
|
||||
you put them below "pack/*/opt", for example
|
||||
".vim/pack/mycolors/opt/dark/colors/very_dark.vim".
|
||||
|
||||
Filetype plugins should go under "pack/*/start", so that they are always
|
||||
found. Unless you have more than one plugin for a file type and want to
|
||||
select which one to load with `:packadd`. E.g. depending on the compiler
|
||||
version: >
|
||||
if foo_compiler_version > 34
|
||||
packadd foo_new
|
||||
else
|
||||
packadd foo_old
|
||||
endif
|
||||
|
||||
The "after" directory is most likely not useful in a package. It's not
|
||||
disallowed though.
|
||||
|
||||
==============================================================================
|
||||
6. Creating Vim packages *package-create*
|
||||
|
||||
This assumes you write one or more plugins that you distribute as a package.
|
||||
|
||||
If you have two unrelated plugins you would use two packages, so that Vim
|
||||
users can chose what they include or not. Or you can decide to use one
|
||||
package with optional plugins, and tell the user to add the ones he wants with
|
||||
`:packadd`.
|
||||
|
||||
Decide how you want to distribute the package. You can create an archive or
|
||||
you could use a repository. An archive can be used by more users, but is a
|
||||
bit harder to update to a new version. A repository can usually be kept
|
||||
up-to-date easily, but it requires a program like "git" to be available.
|
||||
You can do both, github can automatically create an archive for a release.
|
||||
|
||||
Your directory layout would be like this:
|
||||
start/foobar/plugin/foo.vim " always loaded, defines commands
|
||||
start/foobar/plugin/bar.vim " always loaded, defines commands
|
||||
start/foobar/autoload/foo.vim " loaded when foo command used
|
||||
start/foobar/doc/foo.txt " help for foo.vim
|
||||
start/foobar/doc/tags " help tags
|
||||
opt/fooextra/plugin/extra.vim " optional plugin, defines commands
|
||||
opt/fooextra/autoload/extra.vim " loaded when extra command used
|
||||
opt/fooextra/doc/extra.txt " help for extra.vim
|
||||
opt/fooextra/doc/tags " help tags
|
||||
|
||||
This allows for the user to do: >
|
||||
mkdir ~/.local/share/nvim/site/pack/myfoobar
|
||||
cd ~/.local/share/nvim/site/pack/myfoobar
|
||||
git clone https://github.com/you/foobar.git
|
||||
|
||||
Here "myfoobar" is a name that the user can choose, the only condition is that
|
||||
it differs from other packages.
|
||||
|
||||
In your documentation you explain what the plugins do, and tell the user how
|
||||
to load the optional plugin: >
|
||||
:packadd! fooextra
|
||||
|
||||
You could add this packadd command in one of your plugins, to be executed when
|
||||
the optional plugin is needed.
|
||||
|
||||
Run the `:helptags` command to generate the doc/tags file. Including this
|
||||
generated file in the package means that the user can drop the package in his
|
||||
pack directory and the help command works right away. Don't forget to re-run
|
||||
the command after changing the plugin help: >
|
||||
:helptags path/start/foobar/doc
|
||||
:helptags path/opt/fooextra/doc
|
||||
|
||||
|
||||
Dependencies between plugins ~
|
||||
*packload-two-steps*
|
||||
Suppose you have a two plugins that depend on the same functionality. You can
|
||||
put the common functionality in an autoload directory, so that it will be
|
||||
found automatically. Your package would have these files:
|
||||
|
||||
pack/foo/start/one/plugin/one.vim >
|
||||
call foolib#getit()
|
||||
< pack/foo/start/two/plugin/two.vim >
|
||||
call foolib#getit()
|
||||
< pack/foo/start/lib/autoload/foolib.vim >
|
||||
func foolib#getit()
|
||||
|
||||
This works, because loading packages will first add all found directories to
|
||||
'runtimepath' before sourcing the plugins.
|
||||
|
||||
==============================================================================
|
||||
7. Debugging scripts *debug-scripts*
|
||||
|
||||
Besides the obvious messages that you can add to your scripts to find out what
|
||||
they are doing, Vim offers a debug mode. This allows you to step through a
|
||||
@ -467,16 +710,44 @@ Additionally, these commands can be used:
|
||||
finish Finish the current script or user function and come
|
||||
back to debug mode for the command after the one that
|
||||
sourced or called it.
|
||||
*>bt*
|
||||
*>backtrace*
|
||||
*>where*
|
||||
backtrace Show the call stacktrace for current debugging session.
|
||||
bt
|
||||
where
|
||||
*>frame*
|
||||
frame N Goes to N backtrace level. + and - signs make movement
|
||||
relative. E.g., ":frame +3" goes three frames up.
|
||||
*>up*
|
||||
up Goes one level up from call stacktrace.
|
||||
*>down*
|
||||
down Goes one level down from call stacktrace.
|
||||
|
||||
About the additional commands in debug mode:
|
||||
- There is no command-line completion for them, you get the completion for the
|
||||
normal Ex commands only.
|
||||
- You can shorten them, up to a single character: "c", "n", "s" and "f".
|
||||
- You can shorten them, up to a single character, unless more than one command
|
||||
starts with the same letter. "f" stands for "finish", use "fr" for "frame".
|
||||
- Hitting <CR> will repeat the previous one. When doing another command, this
|
||||
is reset (because it's not clear what you want to repeat).
|
||||
- When you want to use the Ex command with the same name, prepend a colon:
|
||||
":cont", ":next", ":finish" (or shorter).
|
||||
|
||||
The backtrace shows the hierarchy of function calls, e.g.:
|
||||
>bt ~
|
||||
3 function One[3] ~
|
||||
2 Two[3] ~
|
||||
->1 Three[3] ~
|
||||
0 Four ~
|
||||
line 1: let four = 4 ~
|
||||
|
||||
The "->" points to the current frame. Use "up", "down" and "frame N" to
|
||||
select another frame.
|
||||
|
||||
In the current frame you can evaluate the local function variables. There is
|
||||
no way to see the command at the current line yet.
|
||||
|
||||
|
||||
DEFINING BREAKPOINTS
|
||||
*:breaka* *:breakadd*
|
||||
@ -569,7 +840,7 @@ OBSCURE
|
||||
user, don't use typeahead for debug commands.
|
||||
|
||||
==============================================================================
|
||||
6. Profiling *profile* *profiling*
|
||||
8. Profiling *profile* *profiling*
|
||||
|
||||
Profiling means that Vim measures the time that is spent on executing
|
||||
functions and/or scripts. The |+profile| feature is required for this.
|
||||
|
@ -1,4 +1,4 @@
|
||||
*spell.txt* For Vim version 7.4. Last change: 2014 Sep 19
|
||||
*spell.txt*
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -11,10 +11,6 @@ Spell checking *spell*
|
||||
3. Generating a spell file |spell-mkspell|
|
||||
4. Spell file format |spell-file-format|
|
||||
|
||||
Note: There also is a vimspell plugin. If you have it you can do ":help
|
||||
vimspell" to find about it. But you will probably want to get rid of the
|
||||
plugin and use the 'spell' option instead, it works better.
|
||||
|
||||
==============================================================================
|
||||
1. Quick start *spell-quickstart* *E756*
|
||||
|
||||
@ -1373,6 +1369,14 @@ the item name. Case is always ignored.
|
||||
|
||||
The Hunspell feature to use three arguments and flags is not supported.
|
||||
|
||||
*spell-NOCOMPOUNDSUGS*
|
||||
This item indicates that using compounding to make suggestions is not a good
|
||||
idea. Use this when compounding is used with very short or one-character
|
||||
words. E.g. to make numbers out of digits. Without this flag creating
|
||||
suggestions would spend most time trying all kind of weird compound words.
|
||||
|
||||
NOCOMPOUNDSUGS ~
|
||||
|
||||
*spell-SYLLABLE*
|
||||
The SYLLABLE item defines characters or character sequences that are used to
|
||||
count the number of syllables in a word. Example:
|
||||
@ -1625,4 +1629,111 @@ WORDCHARS (Hunspell) *spell-WORDCHARS*
|
||||
is no need to separate words before checking them (using a
|
||||
trie instead of a hashtable).
|
||||
|
||||
==============================================================================
|
||||
5. Spell checker design *develop-spell*
|
||||
|
||||
When spell checking was going to be added to Vim a survey was done over the
|
||||
available spell checking libraries and programs. Unfortunately, the result
|
||||
was that none of them provided sufficient capabilities to be used as the spell
|
||||
checking engine in Vim, for various reasons:
|
||||
|
||||
- Missing support for multi-byte encodings. At least UTF-8 must be supported,
|
||||
so that more than one language can be used in the same file.
|
||||
Doing on-the-fly conversion is not always possible (would require iconv
|
||||
support).
|
||||
- For the programs and libraries: Using them as-is would require installing
|
||||
them separately from Vim. That's mostly not impossible, but a drawback.
|
||||
- Performance: A few tests showed that it's possible to check spelling on the
|
||||
fly (while redrawing), just like syntax highlighting. But the mechanisms
|
||||
used by other code are much slower. Myspell uses a hashtable, for example.
|
||||
The affix compression that most spell checkers use makes it slower too.
|
||||
- For using an external program like aspell a communication mechanism would
|
||||
have to be setup. That's complicated to do in a portable way (Unix-only
|
||||
would be relatively simple, but that's not good enough). And performance
|
||||
will become a problem (lots of process switching involved).
|
||||
- Missing support for words with non-word characters, such as "Etten-Leur" and
|
||||
"et al.", would require marking the pieces of them OK, lowering the
|
||||
reliability.
|
||||
- Missing support for regions or dialects. Makes it difficult to accept
|
||||
all English words and highlight non-Canadian words differently.
|
||||
- Missing support for rare words. Many words are correct but hardly ever used
|
||||
and could be a misspelled often-used word.
|
||||
- For making suggestions the speed is less important and requiring to install
|
||||
another program or library would be acceptable. But the word lists probably
|
||||
differ, the suggestions may be wrong words.
|
||||
|
||||
|
||||
Spelling suggestions *develop-spell-suggestions*
|
||||
|
||||
For making suggestions there are two basic mechanisms:
|
||||
1. Try changing the bad word a little bit and check for a match with a good
|
||||
word. Or go through the list of good words, change them a little bit and
|
||||
check for a match with the bad word. The changes are deleting a character,
|
||||
inserting a character, swapping two characters, etc.
|
||||
2. Perform soundfolding on both the bad word and the good words and then find
|
||||
matches, possibly with a few changes like with the first mechanism.
|
||||
|
||||
The first is good for finding typing mistakes. After experimenting with
|
||||
hashtables and looking at solutions from other spell checkers the conclusion
|
||||
was that a trie (a kind of tree structure) is ideal for this. Both for
|
||||
reducing memory use and being able to try sensible changes. For example, when
|
||||
inserting a character only characters that lead to good words need to be
|
||||
tried. Other mechanisms (with hashtables) need to try all possible letters at
|
||||
every position in the word. Also, a hashtable has the requirement that word
|
||||
boundaries are identified separately, while a trie does not require this.
|
||||
That makes the mechanism a lot simpler.
|
||||
|
||||
Soundfolding is useful when someone knows how the words sounds but doesn't
|
||||
know how it is spelled. For example, the word "dictionary" might be written
|
||||
as "daktonerie". The number of changes that the first method would need to
|
||||
try is very big, it's hard to find the good word that way. After soundfolding
|
||||
the words become "tktnr" and "tkxnry", these differ by only two letters.
|
||||
|
||||
To find words by their soundfolded equivalent (soundalike word) we need a list
|
||||
of all soundfolded words. A few experiments have been done to find out what
|
||||
the best method is. Alternatives:
|
||||
1. Do the sound folding on the fly when looking for suggestions. This means
|
||||
walking through the trie of good words, soundfolding each word and
|
||||
checking how different it is from the bad word. This is very efficient for
|
||||
memory use, but takes a long time. On a fast PC it takes a couple of
|
||||
seconds for English, which can be acceptable for interactive use. But for
|
||||
some languages it takes more than ten seconds (e.g., German, Catalan),
|
||||
which is unacceptable slow. For batch processing (automatic corrections)
|
||||
it's too slow for all languages.
|
||||
2. Use a trie for the soundfolded words, so that searching can be done just
|
||||
like how it works without soundfolding. This requires remembering a list
|
||||
of good words for each soundfolded word. This makes finding matches very
|
||||
fast but requires quite a lot of memory, in the order of 1 to 10 Mbyte.
|
||||
For some languages more than the original word list.
|
||||
3. Like the second alternative, but reduce the amount of memory by using affix
|
||||
compression and store only the soundfolded basic word. This is what Aspell
|
||||
does. Disadvantage is that affixes need to be stripped from the bad word
|
||||
before soundfolding it, which means that mistakes at the start and/or end
|
||||
of the word will cause the mechanism to fail. Also, this becomes slow when
|
||||
the bad word is quite different from the good word.
|
||||
|
||||
The choice made is to use the second mechanism and use a separate file. This
|
||||
way a user with sufficient memory can get very good suggestions while a user
|
||||
who is short of memory or just wants the spell checking and no suggestions
|
||||
doesn't use so much memory.
|
||||
|
||||
|
||||
Word frequency
|
||||
|
||||
For sorting suggestions it helps to know which words are common. In theory we
|
||||
could store a word frequency with the word in the dictionary. However, this
|
||||
requires storing a count per word. That degrades word tree compression a lot.
|
||||
And maintaining the word frequency for all languages will be a heavy task.
|
||||
Also, it would be nice to prefer words that are already in the text. This way
|
||||
the words that appear in the specific text are preferred for suggestions.
|
||||
|
||||
What has been implemented is to count words that have been seen during
|
||||
displaying. A hashtable is used to quickly find the word count. The count is
|
||||
initialized from words listed in COMMON items in the affix file, so that it
|
||||
also works when starting a new file.
|
||||
|
||||
This isn't ideal, because the longer Vim is running the higher the counts
|
||||
become. But in practice it is a noticeable improvement over not using the word
|
||||
count.
|
||||
|
||||
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
||||
|
@ -1,4 +1,4 @@
|
||||
*starting.txt* For Vim version 7.4. Last change: 2015 Jan 15
|
||||
*starting.txt* For Vim version 7.4. Last change: 2016 Apr 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -10,9 +10,11 @@ Starting Vim *starting*
|
||||
2. Initialization |initialization|
|
||||
3. $VIM and $VIMRUNTIME |$VIM|
|
||||
4. Suspending |suspend|
|
||||
5. Saving settings |save-settings|
|
||||
6. Views and Sessions |views-sessions|
|
||||
7. The ShaDa file |shada-file|
|
||||
5. Exiting |exiting|
|
||||
6. Saving settings |save-settings|
|
||||
7. Views and Sessions |views-sessions|
|
||||
8. The ShaDa file |shada-file|
|
||||
9. Base Directories |base-directories|
|
||||
|
||||
==============================================================================
|
||||
1. Vim arguments *vim-arguments*
|
||||
@ -40,6 +42,7 @@ filename One or more file names. The first one will be the current
|
||||
nvim -- -filename
|
||||
< All arguments after the "--" will be interpreted as file names,
|
||||
no other options or "+command" argument can follow.
|
||||
For behavior of quotes on MS-Windows, see |win32-quotes|.
|
||||
|
||||
*--*
|
||||
- This argument can mean two things, depending on whether Ex
|
||||
@ -349,8 +352,11 @@ argument.
|
||||
*-W*
|
||||
-W {scriptout} Like -w, but do not append, overwrite an existing file.
|
||||
|
||||
*--api-info*
|
||||
--api-info Print msgpack-encoded |api-metadata| and exit.
|
||||
|
||||
==============================================================================
|
||||
3. Initialization *initialization* *startup*
|
||||
2. Initialization *initialization* *startup*
|
||||
|
||||
At startup, Vim checks environment variables and files and sets values
|
||||
accordingly. Vim proceeds in this order:
|
||||
@ -377,7 +383,7 @@ accordingly. Vim proceeds in this order:
|
||||
name, "init.vim" is Neovim specific location for vimrc file. Also see
|
||||
|vimrc-intro|.
|
||||
|
||||
Places for your personal initializations:
|
||||
Places for your personal initializations (see |base-directories|):
|
||||
Unix $XDG_CONFIG_HOME/nvim/init.vim
|
||||
(default for $XDG_CONFIG_HOME is ~/.config)
|
||||
Windows $XDG_CONFIG_HOME/nvim/init.vim
|
||||
@ -459,6 +465,11 @@ accordingly. Vim proceeds in this order:
|
||||
commands from the command line have not been executed yet. You can
|
||||
use "--cmd 'set noloadplugins'" |--cmd|.
|
||||
|
||||
Packages are loaded. These are plugins, as above, but found in the
|
||||
"start" directory of each entry in 'packpath'. Every plugin directory
|
||||
found is added in 'runtimepath' and then the plugins are sourced. See
|
||||
|packages|.
|
||||
|
||||
7. Set 'shellpipe' and 'shellredir'
|
||||
The 'shellpipe' and 'shellredir' options are set according to the
|
||||
value of the 'shell' option, unless they have been set before.
|
||||
@ -494,8 +505,9 @@ accordingly. Vim proceeds in this order:
|
||||
14. Execute startup commands
|
||||
If a "-t" flag was given to Vim, the tag is jumped to.
|
||||
The commands given with the |-c| and |+cmd| arguments are executed.
|
||||
The starting flag is reset, has("vim_starting") will now return zero.
|
||||
If the 'insertmode' option is set, Insert mode is entered.
|
||||
The starting flag is reset, has("vim_starting") will now return zero.
|
||||
The |v:vim_did_enter| variable is set to 1.
|
||||
The |VimEnter| autocommands are executed.
|
||||
|
||||
Some hints on using initializations:
|
||||
@ -601,7 +613,7 @@ This still won't work for systems where gvim does not use stdout at all
|
||||
though.
|
||||
|
||||
==============================================================================
|
||||
4. $VIM and $VIMRUNTIME
|
||||
3. $VIM and $VIMRUNTIME
|
||||
*$VIM*
|
||||
The environment variable "$VIM" is used to locate various user files for Vim,
|
||||
such as the user startup script |init.vim|. This depends on the system, see
|
||||
@ -663,7 +675,7 @@ greps in the help files) you might be able to use this: >
|
||||
VIMRUNTIME="$(nvim -e --cmd 'echo $VIMRUNTIME|quit' 2>&1)"
|
||||
|
||||
==============================================================================
|
||||
5. Suspending *suspend*
|
||||
4. Suspending *suspend*
|
||||
|
||||
*iconize* *iconise* *CTRL-Z* *v_CTRL-Z*
|
||||
CTRL-Z Suspend Vim, like ":stop".
|
||||
@ -695,6 +707,19 @@ In X-windows the selection is disowned when Vim suspends. this means you
|
||||
can't paste it in another application (since Vim is going to sleep an attempt
|
||||
to get the selection would make the program hang).
|
||||
|
||||
==============================================================================
|
||||
5. Exiting *exiting*
|
||||
|
||||
There are several ways to exit Vim:
|
||||
- Close the last window with `:quit`. Only when there are no changes.
|
||||
- Close the last window with `:quit!`. Also when there are changes.
|
||||
- Close all windows with `:qall`. Only when there are no changes.
|
||||
- Close all windows with `:qall!`. Also when there are changes.
|
||||
- Use `:cquit`. Also when there are changes.
|
||||
|
||||
When using `:cquit` or when there was an error message Vim exits with exit
|
||||
code 1. Errors can be avoided by using `:silent!`.
|
||||
|
||||
==============================================================================
|
||||
6. Saving settings *save-settings*
|
||||
|
||||
@ -1059,7 +1084,7 @@ even if other entries (with known name/type/etc) are merged. |shada-merging|
|
||||
SHADA FILE NAME *shada-file-name*
|
||||
|
||||
- The default name of the ShaDa file is "$XDG_DATA_HOME/nvim/shada/main.shada"
|
||||
for Unix. Default for $XDG_DATA_HOME is ~/.local/share.
|
||||
for Unix. Default for $XDG_DATA_HOME is ~/.local/share. |base-directories|
|
||||
- The 'n' flag in the 'shada' option can be used to specify another ShaDa
|
||||
file name |'shada'|.
|
||||
- The "-i" Vim argument can be used to set another file name, |-i|. When the
|
||||
@ -1175,11 +1200,10 @@ running) you have additional options:
|
||||
:wv[iminfo][!] [file] Deprecated alias to |:wshada| command.
|
||||
|
||||
*:o* *:ol* *:oldfiles*
|
||||
:o[ldfiles][!] List the files that have marks stored in the ShaDa
|
||||
:o[ldfiles] List the files that have marks stored in the ShaDa
|
||||
file. This list is read on startup and only changes
|
||||
afterwards with ":rshada!". Also see |v:oldfiles|.
|
||||
The number can be used with |c_#<|.
|
||||
Use ! to get a file selection prompt.
|
||||
|
||||
:bro[wse] o[ldfiles][!]
|
||||
List file names as with |:oldfiles|, and then prompt
|
||||
@ -1346,4 +1370,40 @@ file when reading and include:
|
||||
either contains more then one MessagePack object or it does not contain
|
||||
complete MessagePack object.
|
||||
|
||||
==============================================================================
|
||||
9. Base Directories *base-directories* *xdg*
|
||||
|
||||
Nvim conforms to the XDG Base Directory Specification for application
|
||||
configuration and data file locations. This just means Nvim looks for some
|
||||
optional settings and uses them if they exist, otherwise defaults are chosen.
|
||||
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
|
||||
CONFIGURATION DIRECTORY *$XDG_CONFIG_HOME*
|
||||
|
||||
Base directory default:
|
||||
Unix: ~/.config
|
||||
Windows: ~/AppData/Local
|
||||
|
||||
Nvim directory:
|
||||
Unix: ~/.config/nvim/
|
||||
Windows: ~/AppData/Local/nvim/
|
||||
|
||||
DATA DIRECTORY *$XDG_DATA_HOME*
|
||||
|
||||
Base directory default:
|
||||
Unix: ~/.local/share
|
||||
Windows: ~/AppData/Local
|
||||
|
||||
Nvim directory:
|
||||
Unix: ~/.local/share/nvim/
|
||||
Windows: ~/AppData/Local/nvim-data/
|
||||
|
||||
Note on Windows the configuration and data directory defaults are the same
|
||||
(for lack of an alternative), but the sub-directory for data is named
|
||||
"nvim-data" to separate it from the configuration sub-directory "nvim".
|
||||
|
||||
Throughout other sections of the user manual, the defaults are used as generic
|
||||
placeholders, e.g. where "~/.config" is mentioned it should be understood to
|
||||
mean "$XDG_CONFIG_HOME or ~/.config".
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 7.4. Last change: 2015 Mar 29
|
||||
*syntax.txt* For Vim version 7.4. Last change: 2016 Apr 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -417,9 +417,10 @@ and last line to be converted. Example, using the last set Visual area: >
|
||||
*:TOhtml*
|
||||
:[range]TOhtml The ":TOhtml" command is defined in a standard plugin.
|
||||
This command will source |2html.vim| for you. When a
|
||||
range is given, set |g:html_start_line| and
|
||||
|g:html_end_line| to the start and end of the range,
|
||||
respectively. Default range is the entire buffer.
|
||||
range is given, this command sets |g:html_start_line|
|
||||
and |g:html_end_line| to the start and end of the
|
||||
range, respectively. Default range is the entire
|
||||
buffer.
|
||||
|
||||
If the current window is part of a |diff|, unless
|
||||
|g:html_diff_one_file| is set, :TOhtml will convert
|
||||
@ -742,6 +743,22 @@ and UTF-32 instead, use: >
|
||||
Note that documents encoded in either UTF-32 or UTF-16 have known
|
||||
compatibility problems with some major browsers.
|
||||
|
||||
*g:html_font*
|
||||
Default: "monospace"
|
||||
You can specify the font or fonts used in the converted document using
|
||||
g:html_font. If this option is set to a string, then the value will be
|
||||
surrounded with single quotes. If this option is set to a list then each list
|
||||
item is surrounded by single quotes and the list is joined with commas. Either
|
||||
way, "monospace" is added as the fallback generic family name and the entire
|
||||
result used as the font family (using CSS) or font face (if not using CSS).
|
||||
Examples: >
|
||||
|
||||
" font-family: 'Consolas', monospace;
|
||||
:let g:html_font = "Consolas"
|
||||
|
||||
" font-family: 'DejaVu Sans Mono', 'Consolas', monospace;
|
||||
:let g:html_font = ["DejaVu Sans Mono", "Consolas"]
|
||||
<
|
||||
*convert-to-XML* *convert-to-XHTML* *g:html_use_xhtml*
|
||||
Default: 0.
|
||||
When 0, generate standard HTML 4.01 (strict when possible).
|
||||
@ -919,26 +936,27 @@ To disable them use ":unlet". Example: >
|
||||
:unlet c_comment_strings
|
||||
|
||||
Variable Highlight ~
|
||||
c_gnu GNU gcc specific items
|
||||
c_comment_strings strings and numbers inside a comment
|
||||
c_space_errors trailing white space and spaces before a <Tab>
|
||||
c_no_trail_space_error ... but no trailing spaces
|
||||
c_no_tab_space_error ... but no spaces before a <Tab>
|
||||
c_no_bracket_error don't highlight {}; inside [] as errors
|
||||
c_no_curly_error don't highlight {}; inside [] and () as errors;
|
||||
*c_gnu* GNU gcc specific items
|
||||
*c_comment_strings* strings and numbers inside a comment
|
||||
*c_space_errors* trailing white space and spaces before a <Tab>
|
||||
*c_no_trail_space_error* ... but no trailing spaces
|
||||
*c_no_tab_space_error* ... but no spaces before a <Tab>
|
||||
*c_no_bracket_error* don't highlight {}; inside [] as errors
|
||||
*c_no_curly_error* don't highlight {}; inside [] and () as errors;
|
||||
except { and } in first column
|
||||
c_curly_error highlight a missing }; this forces syncing from the
|
||||
*c_curly_error* highlight a missing }; this forces syncing from the
|
||||
start of the file, can be slow
|
||||
c_no_ansi don't do standard ANSI types and constants
|
||||
c_ansi_typedefs ... but do standard ANSI types
|
||||
c_ansi_constants ... but do standard ANSI constants
|
||||
c_no_utf don't highlight \u and \U in strings
|
||||
c_syntax_for_h for *.h files use C syntax instead of C++ and use objc
|
||||
*c_no_ansi* don't do standard ANSI types and constants
|
||||
*c_ansi_typedefs* ... but do standard ANSI types
|
||||
*c_ansi_constants* ... but do standard ANSI constants
|
||||
*c_no_utf* don't highlight \u and \U in strings
|
||||
*c_syntax_for_h* for *.h files use C syntax instead of C++ and use objc
|
||||
syntax instead of objcpp
|
||||
c_no_if0 don't highlight "#if 0" blocks as comments
|
||||
c_no_cformat don't highlight %-formats in strings
|
||||
c_no_c99 don't highlight C99 standard items
|
||||
c_no_c11 don't highlight C11 standard items
|
||||
*c_no_if0* don't highlight "#if 0" blocks as comments
|
||||
*c_no_cformat* don't highlight %-formats in strings
|
||||
*c_no_c99* don't highlight C99 standard items
|
||||
*c_no_c11* don't highlight C11 standard items
|
||||
*c_no_bsd* don't highlight BSD specific types
|
||||
|
||||
When 'foldmethod' is set to "syntax" then /* */ comments and { } blocks will
|
||||
become a fold. If you don't want comments to become a fold use: >
|
||||
@ -1059,7 +1077,8 @@ CPP *cpp.vim* *ft-cpp-syntax*
|
||||
Most of things are same as |ft-c-syntax|.
|
||||
|
||||
Variable Highlight ~
|
||||
cpp_no_c11 don't highlight C++11 standard items
|
||||
cpp_no_cpp11 don't highlight C++11 standard items
|
||||
cpp_no_cpp14 don't highlight C++14 standard items
|
||||
|
||||
|
||||
CSH *csh.vim* *ft-csh-syntax*
|
||||
@ -1415,34 +1434,28 @@ form, then >
|
||||
:let fortran_fixed_source=1
|
||||
in your vimrc prior to the :syntax on command.
|
||||
|
||||
If the form of the source code depends upon the file extension, then it is
|
||||
most convenient to set fortran_free_source in a ftplugin file. For more
|
||||
information on ftplugin files, see |ftplugin|. For example, if all your
|
||||
fortran files with an .f90 extension are written in free source form and the
|
||||
rest in fixed source form, add the following code to your ftplugin file >
|
||||
let s:extfname = expand("%:e")
|
||||
if s:extfname ==? "f90"
|
||||
let fortran_free_source=1
|
||||
unlet! fortran_fixed_source
|
||||
else
|
||||
let fortran_fixed_source=1
|
||||
unlet! fortran_free_source
|
||||
endif
|
||||
Note that this will work only if the "filetype plugin indent on" command
|
||||
precedes the "syntax on" command in your vimrc file.
|
||||
If the form of the source code depends, in a non-standard way, upon the file
|
||||
extension, then it is most convenient to set fortran_free_source in a ftplugin
|
||||
file. For more information on ftplugin files, see |ftplugin|. Note that this
|
||||
will work only if the "filetype plugin indent on" command precedes the "syntax
|
||||
on" command in your .vimrc file.
|
||||
|
||||
|
||||
When you edit an existing fortran file, the syntax script will assume free
|
||||
source form if the fortran_free_source variable has been set, and assumes
|
||||
fixed source form if the fortran_fixed_source variable has been set. If
|
||||
neither of these variables have been set, the syntax script attempts to
|
||||
determine which source form has been used by examining the first five columns
|
||||
of the first 250 lines of your file. If no signs of free source form are
|
||||
detected, then the file is assumed to be in fixed source form. The algorithm
|
||||
should work in the vast majority of cases. In some cases, such as a file that
|
||||
begins with 250 or more full-line comments, the script may incorrectly decide
|
||||
that the fortran code is in fixed form. If that happens, just add a
|
||||
non-comment statement beginning anywhere in the first five columns of the
|
||||
first twenty five lines, save (:w) and then reload (:e!) the file.
|
||||
determine which source form has been used by examining the file extension
|
||||
using conventions common to the ifort, gfortran, Cray, NAG, and PathScale
|
||||
compilers (.f, .for, .f77 for fixed-source, .f90, .f95, .f03, .f08 for
|
||||
free-source). If none of this works, then the script examines the first five
|
||||
columns of the first 500 lines of your file. If no signs of free source form
|
||||
are detected, then the file is assumed to be in fixed source form. The
|
||||
algorithm should work in the vast majority of cases. In some cases, such as a
|
||||
file that begins with 500 or more full-line comments, the script may
|
||||
incorrectly decide that the fortran code is in fixed form. If that happens,
|
||||
just add a non-comment statement beginning anywhere in the first five columns
|
||||
of the first twenty five lines, save (:w) and then reload (:e!) the file.
|
||||
|
||||
Tabs in fortran files ~
|
||||
Tabs are not recognized by the Fortran standards. Tabs are not a good idea in
|
||||
@ -2874,7 +2887,7 @@ You may wish to embed languages into sh. I'll give an example courtesy of
|
||||
Lorance Stinson on how to do this with awk as an example. Put the following
|
||||
file into $HOME/.config/nvim/after/syntax/sh/awkembed.vim: >
|
||||
|
||||
" AWK Embedding: {{{1
|
||||
" AWK Embedding:
|
||||
" ==============
|
||||
" Shamelessly ripped from aspperl.vim by Aaron Hope.
|
||||
if exists("b:current_syntax")
|
||||
@ -3333,6 +3346,13 @@ Note that schemas are not actually limited to plain scalars, but this is the
|
||||
only difference between schemas defined in YAML specification and the only
|
||||
difference defined in the syntax file.
|
||||
|
||||
|
||||
ZSH *zsh.vim* *ft-zsh-syntax*
|
||||
|
||||
The syntax script for zsh allows for syntax-based folding: >
|
||||
|
||||
:let g:zsh_fold_enable = 1
|
||||
|
||||
==============================================================================
|
||||
5. Defining a syntax *:syn-define* *E410*
|
||||
|
||||
@ -3410,6 +3430,32 @@ SPELL CHECKING *:syn-spell*
|
||||
|
||||
To activate spell checking the 'spell' option must be set.
|
||||
|
||||
SYNTAX ISKEYWORD SETTING *:syn-iskeyword*
|
||||
|
||||
:sy[ntax] iskeyword [clear | {option}]
|
||||
This defines the keyword characters. It's like the 'iskeyword' option
|
||||
for but only applies to syntax highlighting.
|
||||
|
||||
clear: Syntax specific iskeyword setting is disabled and the
|
||||
buffer-local 'iskeyword' setting is used.
|
||||
{option} Set the syntax 'iskeyword' option to a new value.
|
||||
|
||||
Example: >
|
||||
:syntax iskeyword @,48-57,192-255,$,_
|
||||
<
|
||||
This would set the syntax specific iskeyword option to include all
|
||||
alphabetic characters, plus the numeric characters, all accented
|
||||
characters and also includes the "_" and the "$".
|
||||
|
||||
If no argument is given, the current value will be output.
|
||||
|
||||
Setting this option influences what |/\k| matches in syntax patterns
|
||||
and also determines where |:syn-keyword| will be checked for a new
|
||||
match.
|
||||
|
||||
It is recommended when writing syntax files, to use this command
|
||||
to the correct value for the specific syntax language and not change
|
||||
the 'iskeyword' option.
|
||||
|
||||
DEFINING KEYWORDS *:syn-keyword*
|
||||
|
||||
@ -3430,7 +3476,7 @@ DEFINING KEYWORDS *:syn-keyword*
|
||||
:syntax keyword Type contained int long char
|
||||
:syntax keyword Type int long contained char
|
||||
:syntax keyword Type int long char contained
|
||||
< *E789*
|
||||
< *E789* *E890*
|
||||
When you have a keyword with an optional tail, like Ex commands in
|
||||
Vim, you can put the optional characters inside [], to define all the
|
||||
variations at once: >
|
||||
@ -3441,6 +3487,7 @@ DEFINING KEYWORDS *:syn-keyword*
|
||||
isn't, the keyword will never be recognized.
|
||||
Multi-byte characters can also be used. These do not have to be in
|
||||
'iskeyword'.
|
||||
See |:syn-iskeyword| for defining syntax specific iskeyword settings.
|
||||
|
||||
A keyword always has higher priority than a match or region, the
|
||||
keyword is used if more than one item matches. Keywords do not nest
|
||||
@ -3684,6 +3731,7 @@ Whether or not it is actually concealed depends on the value of the
|
||||
'conceallevel' option. The 'concealcursor' option is used to decide whether
|
||||
concealable items in the current line are displayed unconcealed to be able to
|
||||
edit the line.
|
||||
Another way to conceal text with with |matchadd()|.
|
||||
|
||||
concealends *:syn-concealends*
|
||||
|
||||
@ -4130,7 +4178,7 @@ example, for instance, can be done like this: >
|
||||
|
||||
As can be seen here, the \z actually does double duty. In the start pattern,
|
||||
it marks the "\(\I\i*\)" sub-expression as external; in the end pattern, it
|
||||
changes the \1 back-reference into an external reference referring to the
|
||||
changes the \z1 back-reference into an external reference referring to the
|
||||
first external sub-expression in the start pattern. External references can
|
||||
also be used in skip patterns: >
|
||||
:syn region foo start="start \(\I\i*\)" skip="not end \z1" end="end \z1"
|
||||
@ -4471,9 +4519,9 @@ in their own color.
|
||||
:colo[rscheme] {name} Load color scheme {name}. This searches 'runtimepath'
|
||||
for the file "colors/{name}.vim". The first one that
|
||||
is found is loaded.
|
||||
To see the name of the currently active color scheme: >
|
||||
:colo
|
||||
< The name is also stored in the g:colors_name variable.
|
||||
Also searches all plugins in 'packpath', first below
|
||||
"start" and then under "opt".
|
||||
|
||||
Doesn't work recursively, thus you can't use
|
||||
":colorscheme" in a color scheme script.
|
||||
After the color scheme has been loaded the
|
||||
@ -4979,6 +5027,9 @@ defaults back: >
|
||||
|
||||
:syntax reset
|
||||
|
||||
It is a bit of a wrong name, since it does not reset any syntax items, it only
|
||||
affects the highlighting.
|
||||
|
||||
This doesn't change the colors for the 'highlight' option.
|
||||
|
||||
Note that the syntax colors that you set in your vimrc file will also be reset
|
||||
|
@ -84,11 +84,13 @@ changed, to avoid confusion when using ":tnext". It is changed when using
|
||||
":tag {ident}".
|
||||
|
||||
The ignore-case matches are not found for a ":tag" command when the
|
||||
'ignorecase' option is off. They are found when a pattern is used (starting
|
||||
with a "/") and for ":tselect", also when 'ignorecase' is off. Note that
|
||||
using ignore-case tag searching disables binary searching in the tags file,
|
||||
which causes a slowdown. This can be avoided by fold-case sorting the tag
|
||||
file. See the 'tagbsearch' option for an explanation.
|
||||
'ignorecase' option is off and 'tagcase' is "followic" or when 'tagcase' is
|
||||
"match". They are found when a pattern is used (starting with a "/") and for
|
||||
":tselect", also when 'ignorecase' is off and 'tagcase' is "followic" or when
|
||||
'tagcase' is "match". Note that using ignore-case tag searching disables
|
||||
binary searching in the tags file, which causes a slowdown. This can be
|
||||
avoided by fold-case sorting the tag file. See the 'tagbsearch' option for an
|
||||
explanation.
|
||||
|
||||
==============================================================================
|
||||
2. Tag stack *tag-stack* *tagstack* *E425*
|
||||
@ -418,12 +420,13 @@ file "tags". It can also be used to access a common tags file.
|
||||
The next file in the list is not used when:
|
||||
- A matching static tag for the current buffer has been found.
|
||||
- A matching global tag has been found.
|
||||
This also depends on the 'ignorecase' option. If it is off, and the tags file
|
||||
only has a match without matching case, the next tags file is searched for a
|
||||
match with matching case. If no tag with matching case is found, the first
|
||||
match without matching case is used. If 'ignorecase' is on, and a matching
|
||||
global tag with or without matching case is found, this one is used, no
|
||||
further tags files are searched.
|
||||
This also depends on whether case is ignored. Case is ignored when
|
||||
'ignorecase' is set and 'tagcase' is "followic", or when 'tagcase' is
|
||||
"ignore". If case is not ignored, and the tags file only has a match without
|
||||
matching case, the next tags file is searched for a match with matching case.
|
||||
If no tag with matching case is found, the first match without matching case
|
||||
is used. If case is ignored, and a matching global tag with or without
|
||||
matching case is found, this one is used, no further tags files are searched.
|
||||
|
||||
When a tag file name starts with "./", the '.' is replaced with the path of
|
||||
the current file. This makes it possible to use a tags file in the directory
|
||||
@ -556,8 +559,10 @@ that indicates if the file was sorted. When this line is found, Vim uses
|
||||
binary searching for the tags file:
|
||||
!_TAG_FILE_SORTED<Tab>1<Tab>{anything} ~
|
||||
|
||||
A tag file may be case-fold sorted to avoid a linear search when 'ignorecase'
|
||||
is on. See 'tagbsearch' for details. The value '2' should be used then:
|
||||
A tag file may be case-fold sorted to avoid a linear search when case is
|
||||
ignored. (Case is ignored when 'ignorecase' is set and 'tagcase' is
|
||||
"followic", or when 'tagcase' is "ignore".) See 'tagbsearch' for details.
|
||||
The value '2' should be used then:
|
||||
!_TAG_FILE_SORTED<Tab>2<Tab>{anything} ~
|
||||
|
||||
The other tag that Vim recognizes, but only when compiled with the
|
||||
|
@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 7.4. Last change: 2015 Feb 23
|
||||
*term.txt* For Vim version 7.4. Last change: 2015 Nov 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -744,7 +744,7 @@ Mouse clicks can be mapped. The codes for mouse clicks are:
|
||||
|
||||
The X1 and X2 buttons refer to the extra buttons found on some mice. The
|
||||
'Microsoft Explorer' mouse has these buttons available to the right thumb.
|
||||
Currently X1 and X2 only work on Win32 environments.
|
||||
Currently X1 and X2 only work on Win32 and X11 environments.
|
||||
|
||||
Examples: >
|
||||
:noremap <MiddleMouse> <LeftMouse><MiddleMouse>
|
||||
|
@ -250,8 +250,8 @@ ignored if its owner differs from the owner of the edited file, except when
|
||||
the owner of the undo file is the current user. Set 'verbose' to get a
|
||||
message about that when opening a file.
|
||||
|
||||
Undo files are normally saved in the same directory as the file. This can be
|
||||
changed with the 'undodir' option.
|
||||
Location of the undo files is controlled by the 'undodir' option, by default
|
||||
they are saved to the dedicated directory in the application data folder.
|
||||
|
||||
You can also save and restore undo histories by using ":wundo" and ":rundo"
|
||||
respectively:
|
||||
|
@ -1,4 +1,4 @@
|
||||
*usr_02.txt* For Vim version 7.4. Last change: 2015 Apr 12
|
||||
*usr_02.txt* For Vim version 7.4. Last change: 2016 Jan 16
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@ -397,6 +397,14 @@ original version of the file.
|
||||
|
||||
Everything you always wanted to know can be found in the Vim help files.
|
||||
Don't be afraid to ask!
|
||||
|
||||
If you know what you are looking for, it is usually easier to search for it
|
||||
using the help system, instead of using Google. Because the subjects follow
|
||||
a certain style guide.
|
||||
|
||||
Also the help has the advantage of belonging to your particular Vim version.
|
||||
You won't see help for commands added later. These would not work for you.
|
||||
|
||||
To get generic help use this command: >
|
||||
|
||||
:help
|
||||
@ -471,7 +479,7 @@ example, use the following command: >
|
||||
|
||||
:help 'number'
|
||||
|
||||
The table with all mode prefixes can be found here: |help-context|.
|
||||
The table with all mode prefixes can be found below: |help-summary|.
|
||||
|
||||
Special keys are enclosed in angle brackets. To find help on the up-arrow key
|
||||
in Insert mode, for instance, use this command: >
|
||||
@ -488,64 +496,191 @@ You can use the error ID at the start to find help about it: >
|
||||
|
||||
|
||||
Summary: *help-summary* >
|
||||
:help
|
||||
< Gives you very general help. Scroll down to see a list of all
|
||||
helpfiles, including those added locally (i.e. not distributed
|
||||
with Vim). >
|
||||
:help user-toc.txt
|
||||
< Table of contents of the User Manual. >
|
||||
:help :subject
|
||||
< Ex-command "subject", for instance the following: >
|
||||
:help :help
|
||||
< Help on getting help. >
|
||||
:help abc
|
||||
< normal-mode command "abc". >
|
||||
:help CTRL-B
|
||||
< Control key <C-B> in Normal mode. >
|
||||
:help i_abc
|
||||
:help i_CTRL-B
|
||||
< The same in Insert mode. >
|
||||
:help v_abc
|
||||
:help v_CTRL-B
|
||||
< The same in Visual mode. >
|
||||
:help c_abc
|
||||
:help c_CTRL-B
|
||||
< The same in Command-line mode. >
|
||||
:help 'subject'
|
||||
< Option 'subject'. >
|
||||
:help subject()
|
||||
< Function "subject". >
|
||||
:help -subject
|
||||
< Command-line argument "-subject". >
|
||||
:help +subject
|
||||
< Compile-time feature "+subject". >
|
||||
:help /*
|
||||
< Regular expression item "*" >
|
||||
:help EventName
|
||||
< Autocommand event "EventName". >
|
||||
:help digraphs.txt
|
||||
< The top of the helpfile "digraph.txt".
|
||||
Similarly for any other helpfile. >
|
||||
:help pattern<Tab>
|
||||
< Find a help tag starting with "pattern". Repeat <Tab> for
|
||||
others. >
|
||||
:help pattern<Ctrl-D>
|
||||
< See all possible help tag matches "pattern" at once. >
|
||||
:helpgrep pattern
|
||||
< Search the whole text of all help files for pattern "pattern".
|
||||
Jumps to the first match. Jump to other matches with: >
|
||||
:cn
|
||||
< next match >
|
||||
:cprev
|
||||
:cN
|
||||
< previous match >
|
||||
:cfirst
|
||||
:clast
|
||||
< first or last match >
|
||||
|
||||
1) Use Ctrl-D after typing a topic and let Vim show all available topics.
|
||||
Or press Tab to complete: >
|
||||
:help some<Tab>
|
||||
< More information on how to use the help: >
|
||||
:help helphelp
|
||||
|
||||
2) Follow the links in bars to related help. You can go from the detailed
|
||||
help to the user documentation, which describes certain commands more from
|
||||
a user perspective and less detailed. E.g. after: >
|
||||
:help pattern.txt
|
||||
< You can see the user guide topics |03.9| and |usr_27.txt| in the
|
||||
introduction.
|
||||
|
||||
3) Options are enclosed in single apostrophes. To go to the help topic for the
|
||||
list option: >
|
||||
:help 'list'
|
||||
< If you only know you are looking for a certain option, you can also do: >
|
||||
:help options.txt
|
||||
< to open the help page which describes all option handling and then search
|
||||
using regular expressions, e.g. textwidth.
|
||||
Certain options have their own namespace, e.g.: >
|
||||
:help cpo-<letter>
|
||||
< for the corresponding flag of the 'cpoptions' settings, substitute <letter>
|
||||
by a specific flag, e.g.: >
|
||||
:help cpo-;
|
||||
< And for the guioption flags: >
|
||||
:help go-<letter>
|
||||
|
||||
4) Normal mode commands do not have a prefix. To go to the help page for the
|
||||
"gt" command: >
|
||||
:help gt
|
||||
|
||||
5) Insert mode commands start with i_. Help for deleting a word: >
|
||||
:help i_CTRL-W
|
||||
|
||||
6) Visual mode commands start with v_. Help for jumping to the other side of
|
||||
the Visual area: >
|
||||
:help v_o
|
||||
|
||||
7) Command line editing and arguments start with c_. Help for using the
|
||||
command argument %: >
|
||||
:help c_%
|
||||
|
||||
8) Ex-commands always start with ":", so to go to the :s command help: >
|
||||
:help :s
|
||||
|
||||
9) Commands specifically for debugging start with ">". To go to to the help
|
||||
for the "cont" debug command: >
|
||||
:help >cont
|
||||
|
||||
10) Key combinations. They usually start with a single letter indicating
|
||||
the mode for which they can be used. E.g.: >
|
||||
:help i_CTRL-X
|
||||
< takes you to the family of Ctrl-X commands for insert mode which can be
|
||||
used to auto complete different things. Note, that certain keys will
|
||||
always be written the same, e.g. Control will always be CTRL.
|
||||
For normal mode commands there is no prefix and the topic is available at
|
||||
:h CTRL-<Letter>. E.g. >
|
||||
:help CTRL-W
|
||||
< In contrast >
|
||||
:help c_CTRL-R
|
||||
< will describe what the Ctrl-R does when entering commands in the Command
|
||||
line and >
|
||||
:help v_Ctrl-A
|
||||
< talks about incrementing numbers in visual mode and >
|
||||
:help g_CTRL-A
|
||||
< talks about the g<C-A> command (e.g. you have to press "g" then <Ctrl-A>).
|
||||
Here the "g" stand for the normal command "g" which always expects a second
|
||||
key before doing something similar to the commands starting with "z"
|
||||
|
||||
11) Regexp items always start with /. So to get help for the "\+" quantifier
|
||||
in Vim regexes: >
|
||||
:help /\+
|
||||
< If you need to know everything about regular expressions, start reading
|
||||
at: >
|
||||
:help pattern.txt
|
||||
|
||||
12) Registers always start with "quote". To find out about the special ":"
|
||||
register: >
|
||||
:help quote:
|
||||
|
||||
13) Vim Script (VimL) is available at >
|
||||
:help eval.txt
|
||||
< Certain aspects of the language are available at :h expr-X where "X" is a
|
||||
single letter. E.g. >
|
||||
:help expr-!
|
||||
< will take you to the topic describing the "!" (Not) operator for
|
||||
VimScript.
|
||||
Also important is >
|
||||
:help function-list
|
||||
< to find a short description of all functions available. Help topics for
|
||||
VimL functions always include the "()", so: >
|
||||
:help append()
|
||||
< talks about the append VimL function rather than how to append text in the
|
||||
current buffer.
|
||||
|
||||
14) Mappings are talked about in the help page :h |map.txt|. Use >
|
||||
:help mapmode-i
|
||||
< to find out about the |:imap| command. Also use :map-topic
|
||||
to find out about certain subtopics particular for mappings. e.g: >
|
||||
:help :map-local
|
||||
< for buffer-local mappings or >
|
||||
:help map-bar
|
||||
< for how the '|' is handled in mappings.
|
||||
|
||||
15) Command definitions are talked about :h command-topic, so use >
|
||||
:help command-bar
|
||||
< to find out about the '!' argument for custom commands.
|
||||
|
||||
16) Window management commands always start with CTRL-W, so you find the
|
||||
corresponding help at :h CTRL-W_letter. E.g. >
|
||||
:help CTRL-W_p
|
||||
< for moving the previous accessed window. You can also access >
|
||||
:help windows.txt
|
||||
< and read your way through if you are looking for window handling
|
||||
commands.
|
||||
|
||||
17) Use |:helpgrep| to search in all help pages (and also of any installed
|
||||
plugins). See |:helpgrep| for how to use it.
|
||||
To search for a topic: >
|
||||
:helpgrep topic
|
||||
< This takes you to the first match. To go to the next one: >
|
||||
:cnext
|
||||
< All matches are available in the quickfix window which can be opened
|
||||
with: >
|
||||
:copen
|
||||
:cclose
|
||||
< open/close the quickfix window; press <Enter> to jump
|
||||
to the item under the cursor
|
||||
< Move around to the match you like and press Enter to jump to that help.
|
||||
|
||||
18) The user manual. This describes help topics for beginners in a rather
|
||||
friendly way. Start at |usr_toc.txt| to find the table of content (as you
|
||||
might have guessed): >
|
||||
:help usr_toc.txt
|
||||
< Skim over the contents to find interesting topics. The "Digraphs" and
|
||||
"Entering special characters" items are in chapter 24, so to go to that
|
||||
particular help page: >
|
||||
:help usr_24.txt
|
||||
< Also if you want to access a certain chapter in the help, the chapter
|
||||
number can be accessed directly like this: >
|
||||
:help 10.1
|
||||
< goes to chapter 10.1 in |usr_10.txt| and talks about recording macros.
|
||||
|
||||
19) Highlighting groups. Always start with hl-groupname. E.g. >
|
||||
:help hl-WarningMsg
|
||||
< talks about the WarningMsg highlighting group.
|
||||
|
||||
20) Syntax highlighting is namespaced to :syn-topic e.g. >
|
||||
:help :syn-conceal
|
||||
< talks about the conceal argument for the :syn command.
|
||||
|
||||
21) Quickfix commands usually start with :c while location list commands
|
||||
usually start with :l
|
||||
|
||||
22) Autocommand events can be found by their name: >
|
||||
:help BufWinLeave
|
||||
< To see all possible events: >
|
||||
:help autocommands-events
|
||||
|
||||
23) Command-line switches always start with "-". So for the help of the -f
|
||||
command switch of Vim use: >
|
||||
:help -f
|
||||
|
||||
24) Optional features always start with "+". To find out about the
|
||||
conceal feature use: >
|
||||
:help +conceal
|
||||
|
||||
25) Documentation for included filetype specific functionality is usually
|
||||
available in the form ft-<filetype>-<functionality>. So >
|
||||
:help ft-c-syntax
|
||||
< talks about the C syntax file and the option it provides. Sometimes,
|
||||
additional sections for omni completion >
|
||||
:help ft-php-omni
|
||||
< or filetype plugins >
|
||||
:help ft-tex-plugin
|
||||
< are available.
|
||||
|
||||
26) Error and Warning codes can be looked up directly in the help. So >
|
||||
:help E297
|
||||
< takes you exactly to the description of the swap error message and >
|
||||
:help W10
|
||||
< talks about the warning "Changing a readonly file".
|
||||
Sometimes however, those error codes are not described, but rather are
|
||||
listed at the Vim command that usually causes this. So: >
|
||||
:help E128
|
||||
< takes you to the |:function| command
|
||||
|
||||
|
||||
==============================================================================
|
||||
|
@ -1,4 +1,4 @@
|
||||
*usr_03.txt* For Vim version 7.4. Last change: 2006 Jun 21
|
||||
*usr_03.txt* For Vim version 7.4. Last change: 2016 Jan 05
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@ -57,7 +57,10 @@ paragraph, much faster than using "l". "b" does the same in the other
|
||||
direction.
|
||||
|
||||
A word ends at a non-word character, such as a ".", "-" or ")". To change
|
||||
what Vim considers to be a word, see the 'iskeyword' option.
|
||||
what Vim considers to be a word, see the 'iskeyword' option. If you try this
|
||||
out in the help directly, 'iskeyword' needs to be reset for the examples to
|
||||
work: >
|
||||
:set iskeyword&
|
||||
It is also possible to move by white-space separated WORDs. This is not a
|
||||
word in the normal sense, that's why the uppercase is used. The commands for
|
||||
moving by WORDs are also uppercase, as this figure shows:
|
||||
@ -411,8 +414,8 @@ in "the" use: >
|
||||
/the\>
|
||||
|
||||
The "\>" item is a special marker that only matches at the end of a word.
|
||||
Similarly "\<" only matches at the begin of a word. Thus to search for the
|
||||
word "the" only: >
|
||||
Similarly "\<" only matches at the beginning of a word. Thus to search for
|
||||
the word "the" only: >
|
||||
|
||||
/\<the\>
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
*usr_05.txt* For Vim version 7.4. Last change: 2012 Nov 20
|
||||
*usr_05.txt* For Vim version 7.4. Last change: 2016 Mar 28
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@ -12,10 +12,11 @@ Vim's capabilities. Or define your own macros.
|
||||
|05.1| The vimrc file
|
||||
|05.2| The example vimrc file explained
|
||||
|05.3| Simple mappings
|
||||
|05.4| Adding a plugin
|
||||
|05.5| Adding a help file
|
||||
|05.6| The option window
|
||||
|05.7| Often used options
|
||||
|05.4| Adding a package
|
||||
|05.5| Adding a plugin
|
||||
|05.6| Adding a help file
|
||||
|05.7| The option window
|
||||
|05.8| Often used options
|
||||
|
||||
Next chapter: |usr_06.txt| Using syntax highlighting
|
||||
Previous chapter: |usr_04.txt| Making small changes
|
||||
@ -245,7 +246,47 @@ The ":map" command (with no arguments) lists your current mappings. At
|
||||
least the ones for Normal mode. More about mappings in section |40.1|.
|
||||
|
||||
==============================================================================
|
||||
*05.4* Adding a plugin *add-plugin* *plugin*
|
||||
*05.4* Adding a package *add-package* *vimball-install*
|
||||
|
||||
A package is a set of files that you can add to Vim. There are two kinds of
|
||||
packages: optional and automatically loaded on startup.
|
||||
|
||||
The Vim distribution comes with a few packages that you can optionally use.
|
||||
For example, the vimball plugin. This plugin supports creating and using
|
||||
vimballs (self-installing Vim plugin archives).
|
||||
|
||||
To start using the vimball plugin, add one line to your vimrc file: >
|
||||
packadd vimball
|
||||
|
||||
That's all! You can also type the command to try it out. Now you can find
|
||||
help about this plugin: >
|
||||
:help vimball
|
||||
|
||||
This works, because when `:packadd` loaded the plugin it also added the
|
||||
package directory in 'runtimepath', so that the help file can be found. The
|
||||
tags for vimball's help are already created. If you need to generate the help
|
||||
tags for a package, see the `:helptags` command.
|
||||
|
||||
You can find packages on the Internet in various places. It usually comes as
|
||||
an archive or as a repository. For an archive you can follow these steps:
|
||||
1. create the package directory: >
|
||||
mkdir -p ~/.local/share/nvim/site/pack/fancy
|
||||
< "fancy" can be any name of your liking. Use one that describes the
|
||||
package.
|
||||
2. unpack the archive in that directory. This assumes the top
|
||||
directory in the archive is "start": >
|
||||
cd ~/.local/share/nvim/site/pack/fancy
|
||||
unzip /tmp/fancy.zip
|
||||
< If the archive layout is different make sure that you end up with a
|
||||
path like this:
|
||||
~/.local/share/nvim/site/pack/fancy/start/fancytext/plugin/fancy.vim ~
|
||||
Here "fancytext" is the name of the package, it can be anything
|
||||
else.
|
||||
|
||||
More information about packages can be found here: |packages|.
|
||||
|
||||
==============================================================================
|
||||
*05.5* Adding a plugin *add-plugin* *plugin*
|
||||
|
||||
Vim's functionality can be extended by adding plugins. A plugin is nothing
|
||||
more than a Vim script file that is loaded automatically when Vim starts. You
|
||||
@ -299,10 +340,9 @@ Then copy the file to your plugin directory:
|
||||
Example for Unix (assuming you didn't have a plugin directory yet): >
|
||||
|
||||
mkdir -p ~/.local/share/nvim/site/plugin
|
||||
cp /usr/local/share/vim/vim60/macros/justify.vim ~/.local/share/nvim/site/plugin
|
||||
cp /tmp/yourplugin.vim ~/.local/share/nvim/site/plugin
|
||||
|
||||
That's all! Now you can use the commands defined in this plugin to justify
|
||||
text.
|
||||
That's all! Now you can use the commands defined in this plugin.
|
||||
|
||||
Instead of putting plugins directly into the plugin/ directory, you may
|
||||
better organize them by putting them into subdirectories under plugin/.
|
||||
@ -384,7 +424,7 @@ Further reading:
|
||||
|new-filetype| How to detect a new file type.
|
||||
|
||||
==============================================================================
|
||||
*05.5* Adding a help file *add-local-help*
|
||||
*05.6* Adding a help file *add-local-help*
|
||||
|
||||
If you are lucky, the plugin you installed also comes with a help file. We
|
||||
will explain how to install the help file, so that you can easily find help
|
||||
@ -417,7 +457,7 @@ them through the tag.
|
||||
For writing a local help file, see |write-local-help|.
|
||||
|
||||
==============================================================================
|
||||
*05.6* The option window
|
||||
*05.7* The option window
|
||||
|
||||
If you are looking for an option that does what you want, you can search in
|
||||
the help files here: |options|. Another way is by using this command: >
|
||||
@ -456,7 +496,7 @@ border. This is what the 'scrolloff' option does, it specifies an offset
|
||||
from the window border where scrolling starts.
|
||||
|
||||
==============================================================================
|
||||
*05.7* Often used options
|
||||
*05.8* Often used options
|
||||
|
||||
There are an awful lot of options. Most of them you will hardly ever use.
|
||||
Some of the more useful ones will be mentioned here. Don't forget you can
|
||||
|
@ -237,19 +237,8 @@ simple way: Move the cursor to the word you want to find help on and press >
|
||||
|
||||
K
|
||||
|
||||
Vim will run the external "man" program on the word. If the man page is
|
||||
found, it is displayed. This uses the normal pager to scroll through the text
|
||||
(mostly the "more" program). When you get to the end pressing <Enter> will
|
||||
get you back into Vim.
|
||||
|
||||
A disadvantage is that you can't see the man page and the text you are working
|
||||
on at the same time. There is a trick to make the man page appear in a Vim
|
||||
window. First, load the man filetype plugin: >
|
||||
|
||||
:runtime! ftplugin/man.vim
|
||||
|
||||
Put this command in your vimrc file if you intend to do this often. Now you
|
||||
can use the ":Man" command to open a window on a man page: >
|
||||
Nvim will run |:Man| on the word. If the man page is found, it is displayed.
|
||||
You can also use the |:Man| command to open a window on a man page: >
|
||||
|
||||
:Man csh
|
||||
|
||||
@ -267,15 +256,14 @@ window.
|
||||
|
||||
To display a man page for the word under the cursor, use this: >
|
||||
|
||||
\K
|
||||
K
|
||||
|
||||
(If you redefined the <Leader>, use it instead of the backslash).
|
||||
For example, you want to know the return value of "strstr()" while editing
|
||||
this line:
|
||||
|
||||
if ( strstr (input, "aap") == ) ~
|
||||
|
||||
Move the cursor to somewhere on "strstr" and type "\K". A window will open
|
||||
Move the cursor to somewhere on "strstr" and type "K". A window will open
|
||||
to display the man page for strstr().
|
||||
|
||||
==============================================================================
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user