mirror of
https://github.com/neovim/neovim
synced 2025-07-22 06:12:21 +00:00
Compare commits
1435 Commits
Author | SHA1 | Date | |
---|---|---|---|
0542baac28 | |||
7be113d795 | |||
ecd7beb6e4 | |||
0de6f450e4 | |||
4b95bb582d | |||
42736d6a2a | |||
cbf2a86c1d | |||
2c154216a4 | |||
e00bc61325 | |||
b1854cefea | |||
ca292c9768 | |||
38ee85d000 | |||
6d727657c8 | |||
b6a090b4fd | |||
4f8964cc00 | |||
5c06f350ce | |||
81591b146a | |||
a46fc0d754 | |||
d152e2f3fd | |||
5f0260808c | |||
6b1c8bbc18 | |||
c685879eea | |||
4fad66fbe6 | |||
42033bc5bd | |||
7a4d069bcc | |||
cf52b881d9 | |||
acbce46782 | |||
c3a7a94a12 | |||
1d4563771b | |||
927e3e32d7 | |||
44e6ee930f | |||
5e241b5f50 | |||
f1fed42ca7 | |||
108d54bbd4 | |||
c66ca17ca1 | |||
34317846d6 | |||
4e66bc99e4 | |||
2e5736e2cd | |||
830bf8665b | |||
caa33aaaf8 | |||
c0fd830be4 | |||
7231438f12 | |||
aba853a156 | |||
49f73e5275 | |||
defa86b08a | |||
458b1fc0e7 | |||
c91e9c1c7a | |||
c69cfd7d1c | |||
12ed735719 | |||
9d9d93aee3 | |||
10c72cd365 | |||
d28d108648 | |||
01ef6fc3d2 | |||
35231312d7 | |||
3f7a2d785d | |||
708617ebb6 | |||
91507c271e | |||
0c799a8f10 | |||
0b686e9b61 | |||
9d2985ecba | |||
4539d867d4 | |||
5e1dc26f74 | |||
598f5af58b | |||
84eed76b55 | |||
7e48c23a50 | |||
c5bc0ea04c | |||
05d1211424 | |||
7baa96b717 | |||
ae9a3d3b99 | |||
795f2bb9b9 | |||
2e1217da46 | |||
0213e99aaf | |||
aa0e09d251 | |||
21dfbfbb9a | |||
f3e8ca3bf5 | |||
ff6ec703d5 | |||
527ba2b12a | |||
6a3f8d48d0 | |||
1e0e301062 | |||
3ccf69c1de | |||
d0689eb0b2 | |||
e31f9007e4 | |||
e4e7b2d239 | |||
c04ffe866d | |||
bd33f1165b | |||
3089c86f4e | |||
9147331e21 | |||
4ab3fe8eaa | |||
b3ece5c81c | |||
18f56c8e90 | |||
5072ab9e5b | |||
4804001aff | |||
32d9c19e29 | |||
01f1028496 | |||
b8bb1f6729 | |||
9ef4be9aab | |||
654e92186b | |||
9b545dd3db | |||
37e64d79cc | |||
87ff2682d7 | |||
349fa0048b | |||
3a802e3c16 | |||
797d72a997 | |||
0a1b852cd1 | |||
36c0ec6dd4 | |||
d37c2e5dc2 | |||
859e9fa65f | |||
ed198737fd | |||
49cf0b6ac4 | |||
7cd204dbfa | |||
e8c0f90962 | |||
561c1e39e0 | |||
13841a56b4 | |||
6143cfdeec | |||
3d49fc1f50 | |||
93f3896300 | |||
242c3d5f0b | |||
cc1ec959f1 | |||
5b514b5988 | |||
c5f5f427c6 | |||
fb4d5b0516 | |||
f25797f869 | |||
90bf31c742 | |||
26b90e95e7 | |||
e350902b7d | |||
2a6c5bb0c4 | |||
0f32088ea2 | |||
e828a5a76b | |||
e8ddbbdf07 | |||
c853fd6fab | |||
714ec09c6d | |||
e7e2844d46 | |||
f6f77272b3 | |||
f96dfae52f | |||
fb503d73da | |||
6bc0d9b8c7 | |||
b5dfdf0669 | |||
9e5dca8490 | |||
763422b036 | |||
d6e27f90b9 | |||
43309d1993 | |||
d357a42389 | |||
9755a2ffd5 | |||
c5c8a82134 | |||
d7b942b54e | |||
fdc48cad7d | |||
459a6ff058 | |||
8b8db9e158 | |||
9ca90fdb9f | |||
500c485e36 | |||
e62f681d2d | |||
f2af6177fb | |||
d733beb0be | |||
c377c8be61 | |||
31df051ed9 | |||
f6968dc0f7 | |||
e904186277 | |||
1ff162c0d9 | |||
82f30bfeda | |||
6636e2a259 | |||
5bcb7aa8bf | |||
1ad5a970ce | |||
978c1fd11f | |||
e19234f391 | |||
13262aef7a | |||
d1070787ca | |||
2d961403ba | |||
caf85b80ae | |||
9d4fcec7c6 | |||
6a6f188d2a | |||
9706664b88 | |||
16da3a6fe0 | |||
657ba62a84 | |||
73da9fdafd | |||
6bbd4b2298 | |||
869a9078e1 | |||
fbd6b10e1b | |||
acdc0b1955 | |||
c40b3b680d | |||
6fc122e600 | |||
0fa4f98a05 | |||
97caabc49a | |||
3a2903c836 | |||
4169fc8281 | |||
b268ba353a | |||
885db120fa | |||
9477c5bb5b | |||
719dae2e01 | |||
3bb388664d | |||
c91a0dca02 | |||
f3efb724af | |||
40f853398e | |||
59aa2eb501 | |||
9d087206ab | |||
41ab095399 | |||
79d77da8a0 | |||
819b79dbc5 | |||
c9b9f052cc | |||
294c0ba014 | |||
5060ebc5d0 | |||
5a61ff188c | |||
22fe76aec4 | |||
6a2d40497a | |||
51937e1322 | |||
e9fd1244b7 | |||
8fb7972517 | |||
3a54ce5a73 | |||
68f7464eed | |||
6b7faf22f4 | |||
6bc3bcefc6 | |||
538255c228 | |||
cb351c678b | |||
f098e53e6f | |||
0190b9fb92 | |||
b182f247ec | |||
ef4676ed5b | |||
baaddf358b | |||
53eddb881c | |||
1dde512498 | |||
892f55bd20 | |||
f1bc50d7da | |||
d545c8e1ce | |||
1dd98a03aa | |||
8fd12805d7 | |||
4192c411a8 | |||
cb03517fd3 | |||
4408431086 | |||
27ced483cc | |||
26a6ed55c6 | |||
9b0b281b75 | |||
c13f72ee0a | |||
1984072822 | |||
31f6334aa8 | |||
91d13bd861 | |||
09e0c96201 | |||
1b61bd93ae | |||
61024fb4a8 | |||
50bd8297e6 | |||
d8079e5ab7 | |||
b6300742d2 | |||
a8f9d56796 | |||
153e6835f1 | |||
2ef1b68751 | |||
e83845285c | |||
d57f25e5ef | |||
1ebb75b1ec | |||
b1edc8abb7 | |||
7bc86b2bbc | |||
d4f32d0789 | |||
31a29e41b0 | |||
fdb0a5e24e | |||
c3990ba0e6 | |||
eeec0cab58 | |||
91e9c0a7ee | |||
6186df3562 | |||
db324879d2 | |||
de802fd4d2 | |||
aeebed8d61 | |||
9959113746 | |||
c8b6ec2e6a | |||
3a59b04c19 | |||
724675061c | |||
b0aa748e14 | |||
7531410169 | |||
42731a9a15 | |||
87fa495b21 | |||
7e6a8310b7 | |||
beb2e4f095 | |||
9c2f4ce20d | |||
22dfe6925d | |||
45d5b78aec | |||
36ffb6a7d8 | |||
78ea090f29 | |||
50c26017a3 | |||
6f55d1377f | |||
ddb9f02712 | |||
f610b807b4 | |||
b6f8c35cf7 | |||
9114790c4c | |||
641d424290 | |||
6e55d99f43 | |||
6ca089fd8d | |||
e74c2334f2 | |||
4ce24ff9da | |||
9e1c659666 | |||
9419a4c86c | |||
dafca1ad68 | |||
e161d6a19d | |||
1144cc6d9e | |||
45598d2e5e | |||
49735d6fae | |||
d533edf61e | |||
68bcb32ec4 | |||
e65895941c | |||
54d41ff049 | |||
b9da0bd2c5 | |||
dabf009283 | |||
e6d32c1010 | |||
3c53371b0c | |||
b94891421a | |||
e54c0ab367 | |||
7307096c5e | |||
9d170a493e | |||
e2ad3fbf27 | |||
a20a00459c | |||
66fa1538ed | |||
7063dd9d64 | |||
6cf24be295 | |||
baf91a455c | |||
bba6315580 | |||
911421d328 | |||
13e5724621 | |||
764f576d64 | |||
efe8311371 | |||
8c24592da2 | |||
7bf0cfb01f | |||
4a6b4bbf93 | |||
7b6786f6f9 | |||
c12801986c | |||
e1079c2a28 | |||
19b47b043d | |||
89a7a4f02c | |||
dc6cc4787c | |||
3a9da803cc | |||
21eee40cdb | |||
bc1a5db6cc | |||
6e9f329d05 | |||
0c536b5d8a | |||
c4199d1866 | |||
cd08e6cf72 | |||
c61bf43a90 | |||
fee961c8dd | |||
c28fb221ba | |||
df99e43ba4 | |||
5f42184873 | |||
172d099c32 | |||
ca93b4a299 | |||
df072c3b2b | |||
7eb4d2f79d | |||
a34d3a7244 | |||
d61826a85c | |||
d5aaa18316 | |||
2daf54ee8d | |||
ac819b8994 | |||
b801291bec | |||
c6f5d6b7e0 | |||
4ceacb37d5 | |||
13db9236fe | |||
c4c2969624 | |||
ca65514a24 | |||
395ef5642e | |||
8dc6c1a7ff | |||
0991041ae7 | |||
0ebd30fba7 | |||
aa6705875d | |||
4c9e5676cd | |||
bccb49bedb | |||
f8a8a56908 | |||
1c9d7270a8 | |||
fe06e2a4a0 | |||
d9d2c2fcc0 | |||
df99c6493d | |||
522b885a0d | |||
3c24704ac8 | |||
31257b450b | |||
d61a50758c | |||
6127eaef05 | |||
cd321b7d0f | |||
73b8424fad | |||
0f381f26cb | |||
e75e9c10dc | |||
9bba8ba372 | |||
626065d385 | |||
5d8d24f0c2 | |||
a9c5423263 | |||
2f6d3e599b | |||
c9e39f8227 | |||
f8fc8f51c0 | |||
94dfb6cea2 | |||
0253766b5d | |||
a371f1027e | |||
f175b281cf | |||
c6ac4f84b1 | |||
acb7c826b3 | |||
98a08c3e5a | |||
1c22cab2fd | |||
e536abc1e1 | |||
7e2348f2b1 | |||
87e054bb24 | |||
a2d25b7bf8 | |||
3bd3b3b768 | |||
de3a515123 | |||
5e59916e84 | |||
abe00d583e | |||
8fb7273ac0 | |||
0ade1bb706 | |||
9ce81f7b2b | |||
7fd771619f | |||
10a54ad12e | |||
0b5a7e4ad5 | |||
8d6e3f2b88 | |||
c41bacc67c | |||
e968d72cae | |||
999af47be8 | |||
0b3ec84840 | |||
e587b490a0 | |||
59468e3495 | |||
1995be8451 | |||
86a95c5117 | |||
97c6d80ca7 | |||
39c628d031 | |||
0089ef6b65 | |||
703cf3197f | |||
bed61041a0 | |||
9da4d0dfee | |||
eb2d547bd5 | |||
48dbb75ff6 | |||
7bc627b3c8 | |||
4af6ec746c | |||
7a589e4a9e | |||
41a64586c7 | |||
c826ebd3de | |||
c79bf4ec99 | |||
db2aa27df1 | |||
470883d705 | |||
f5d3f3da6f | |||
10b014ca7b | |||
728d582333 | |||
8a7b15cf35 | |||
6d8a509e51 | |||
4d253b4df5 | |||
46475a1021 | |||
2f2e729899 | |||
ad43480952 | |||
5b8255e251 | |||
b8e6f04e69 | |||
297677ecf4 | |||
45cc14d9a5 | |||
ed49d9d866 | |||
545e7a4163 | |||
2cc523c3af | |||
a26d52ea32 | |||
c317fc20b0 | |||
d9ab9160b8 | |||
c7e6b58012 | |||
35ddcc5bb4 | |||
71b3e20d0f | |||
2d60a15e25 | |||
215922120c | |||
1b825a9ada | |||
12b5c846ba | |||
6f0f8e7f4a | |||
ccb6af064f | |||
6b94d4d14f | |||
22e9c51b0f | |||
ae6db26b09 | |||
f9aa029a8b | |||
acaf480bdc | |||
8d8af65659 | |||
605e74327a | |||
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 | |||
a4cb500d98 | |||
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 |
@ -1,3 +0,0 @@
|
||||
# libuv queue.h pointer arithmetic is not accepted by asan
|
||||
fun:queue_node_data
|
||||
fun:dictwatcher_node_data
|
@ -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
|
||||
# Compile dependencies.
|
||||
build_deps
|
||||
fi
|
||||
|
||||
# Compile dependencies.
|
||||
build_deps
|
||||
|
||||
rm -rf "${LOG_DIR}"
|
||||
mkdir -p "${LOG_DIR}"
|
||||
|
44
.ci/build.bat
Normal file
44
.ci/build.bat
Normal file
@ -0,0 +1,44 @@
|
||||
:: 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 "%CONFIGURATION%" == "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%
|
||||
:: The default cpack in the PATH is not CMake
|
||||
set PATH=C:\Program Files (x86)\CMake\bin\cpack.exe;%PATH%
|
||||
|
||||
:: Build third-party dependencies
|
||||
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 gperf" || 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 ..
|
||||
|
||||
:: Build Neovim
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUSTED_OUTPUT_TYPE=gtest -DGPERF_PRG="C:\msys64\usr\bin\gperf.exe" .. || goto :error
|
||||
mingw32-make VERBOSE=1 || goto :error
|
||||
bin\nvim --version || goto :error
|
||||
|
||||
:: Functional tests
|
||||
mingw32-make functionaltest VERBOSE=1 || goto :error
|
||||
|
||||
:: Build artifacts
|
||||
cpack -G ZIP -C Release
|
||||
if defined APPVEYOR_REPO_TAG_NAME cpack -G NSIS -C Release
|
||||
|
||||
goto :EOF
|
||||
:error
|
||||
exit /b %errorlevel%
|
@ -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
|
||||
|
@ -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`
|
||||
|
37
.travis.yml
37
.travis.yml
@ -8,10 +8,8 @@ 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"
|
||||
# LLVM symbolizer path.
|
||||
- LLVM_SYMBOLIZER="$(which llvm-symbolizer-3.6)"
|
||||
# Update PATH for pip.
|
||||
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:/usr/lib/llvm-symbolizer-3.8/bin:$PATH"
|
||||
# Build directory for Neovim.
|
||||
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
||||
# Build directory for third-party dependencies.
|
||||
@ -34,14 +32,10 @@ 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"
|
||||
- TSAN_OPTIONS="log_path=$LOG_DIR/tsan"
|
||||
- UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
|
||||
# Environment variables for Valgrind.
|
||||
- VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
|
||||
# Cache marker for third-party dependencies cache.
|
||||
@ -62,6 +56,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 +67,18 @@ 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-3.8
|
||||
env: CLANG_SANITIZER=ASAN_UBSAN
|
||||
- os: linux
|
||||
compiler: clang-3.6
|
||||
env: CLANG_SANITIZER=MSAN
|
||||
- os: linux
|
||||
compiler: clang-3.6
|
||||
compiler: clang-3.8
|
||||
env: CLANG_SANITIZER=TSAN
|
||||
- os: osx
|
||||
compiler: clang
|
||||
osx_image: xcode7.3 # macOS 10.11
|
||||
- os: osx
|
||||
compiler: gcc-4.9
|
||||
- os: linux
|
||||
env: BUILD_MINGW=ON
|
||||
osx_image: xcode7.3 # macOS 10.11
|
||||
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 +92,13 @@ addons:
|
||||
sources:
|
||||
# TODO: Remove PPA when Travis gets Python >=3.3.
|
||||
- deadsnakes
|
||||
- llvm-toolchain-precise-3.6
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
packages:
|
||||
- autoconf
|
||||
- automake
|
||||
- build-essential
|
||||
- clang-3.6
|
||||
- clang-3.8
|
||||
- cmake
|
||||
- g++-5-multilib
|
||||
- g++-multilib
|
||||
@ -118,7 +107,7 @@ addons:
|
||||
- gdb
|
||||
- libc6-dev-i386
|
||||
- libtool
|
||||
- llvm-3.6-dev
|
||||
- llvm-3.8-dev
|
||||
- pkg-config
|
||||
- python3.3-dev
|
||||
- unzip
|
||||
|
117
CMakeLists.txt
117
CMakeLists.txt
@ -8,6 +8,9 @@ endif()
|
||||
# Point CMake at any custom modules we may ship
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
|
||||
# We don't support building in-tree.
|
||||
include(PreventInTreeBuilds)
|
||||
|
||||
# Prefer our bundled versions of dependencies.
|
||||
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
|
||||
if(CMAKE_CROSSCOMPILING AND NOT UNIX)
|
||||
@ -56,12 +59,17 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||
STRINGS "Debug" "Dev" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
|
||||
# If not in a git repo (e.g., a tarball) these tokens define the complete
|
||||
# version string, else it is combined with the result of `git describe`.
|
||||
# version string, else they are 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 7)
|
||||
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||
|
||||
# API level
|
||||
set(NVIM_API_LEVEL 1) # Bump this after any API change.
|
||||
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
||||
set(NVIM_API_PRERELEASE false)
|
||||
|
||||
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
|
||||
include(GetGitRevisionDescription)
|
||||
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
|
||||
@ -253,6 +261,10 @@ option(
|
||||
if(TRAVIS_CI_BUILD)
|
||||
message(STATUS "Travis CI build enabled.")
|
||||
add_definitions(-Werror)
|
||||
if(DEFINED ENV{BUILD_32BIT})
|
||||
# Get some test coverage for unsigned char
|
||||
add_definitions(-funsigned-char)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
@ -291,23 +303,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()
|
||||
|
||||
find_package(Unibilium REQUIRED)
|
||||
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
|
||||
if(FEAT_TUI)
|
||||
find_package(Unibilium REQUIRED)
|
||||
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
|
||||
|
||||
find_package(LibTermkey REQUIRED)
|
||||
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
|
||||
find_package(LibTermkey REQUIRED)
|
||||
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
find_package(LibVterm REQUIRED)
|
||||
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
|
||||
@ -326,7 +340,12 @@ if((CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN) AND NOT CMAKE_C_COMPILER_ID MA
|
||||
message(FATAL_ERROR "Sanitizers are only supported for Clang.")
|
||||
endif()
|
||||
|
||||
option(ENABLE_JEMALLOC "enable jemalloc" ON)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||
message(STATUS "detected OpenBSD; disabled jemalloc. #5318")
|
||||
option(ENABLE_JEMALLOC "enable jemalloc" OFF)
|
||||
else()
|
||||
option(ENABLE_JEMALLOC "enable jemalloc" ON)
|
||||
endif()
|
||||
|
||||
if (ENABLE_JEMALLOC)
|
||||
if(CLANG_ASAN_UBSAN OR CLANG_MSAN OR CLANG_TSAN)
|
||||
@ -367,9 +386,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)
|
||||
@ -393,14 +412,20 @@ endif()
|
||||
message(STATUS "Using the Lua interpreter ${LUA_PRG}.")
|
||||
|
||||
# Setup busted.
|
||||
find_program(BUSTED_PRG busted)
|
||||
find_program(BUSTED_PRG NAMES busted busted.bat)
|
||||
find_program(BUSTED_LUA_PRG busted-lua)
|
||||
if(NOT BUSTED_OUTPUT_TYPE)
|
||||
set(BUSTED_OUTPUT_TYPE "utfTerminal")
|
||||
if(WIN32)
|
||||
set(BUSTED_OUTPUT_TYPE "plainTerminal")
|
||||
else()
|
||||
set(BUSTED_OUTPUT_TYPE "utfTerminal")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_program(LUACHECK_PRG luacheck)
|
||||
|
||||
find_program(GPERF_PRG gperf)
|
||||
|
||||
include(InstallHelpers)
|
||||
|
||||
file(GLOB MANPAGES
|
||||
@ -451,12 +476,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)
|
||||
set(FUNCTIONALTEST_PREREQS nvim tty-test shell-test)
|
||||
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,55 +506,72 @@ if(BUSTED_PRG)
|
||||
add_custom_target(benchmark-prereqs
|
||||
DEPENDS ${BENCHMARK_PREREQS})
|
||||
|
||||
add_custom_target(unittest
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DBUSTED_PRG=${BUSTED_PRG}
|
||||
-DLUA_PRG=${LUA_PRG}
|
||||
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||
-DTEST_TYPE=unit
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||
DEPENDS ${UNITTEST_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}
|
||||
-DLUA_PRG=${LUA_PRG}
|
||||
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||
-DTEST_TYPE=unit
|
||||
-DSYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||
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}
|
||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||
-DTEST_TYPE=functional
|
||||
-DSYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||
-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}
|
||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||
-DTEST_TYPE=benchmark
|
||||
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||
-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}
|
||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||
-DTEST_TYPE=functional
|
||||
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||
DEPENDS ${FUNCTIONALTEST_PREREQS})
|
||||
DEPENDS ${FUNCTIONALTEST_PREREQS}
|
||||
${TEST_TARGET_ARGS})
|
||||
endif()
|
||||
|
||||
if(LUACHECK_PRG)
|
||||
@ -525,6 +579,7 @@ if(LUACHECK_PRG)
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DLUACHECK_PRG=${LUACHECK_PRG}
|
||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTestsLint.cmake)
|
||||
endif()
|
||||
|
||||
|
254
CONTRIBUTING.md
254
CONTRIBUTING.md
@ -1,162 +1,115 @@
|
||||
# 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, RDY
|
||||
|
||||
#### Testing
|
||||
Pull requests have three stages: `[WIP]` (Work In Progress), `[RFC]` (Request
|
||||
For Comment) and `[RDY]` (Ready).
|
||||
|
||||
We are unlikely to merge your PR if the Travis build fails:
|
||||
- Untagged PRs are assumed to be `[RFC]`, i.e. you are requesting a review.
|
||||
- Prepend `[WIP]` to the PR title if you are _not_ requesting feedback and the
|
||||
work is still in flux.
|
||||
- Prepend `[RDY]` to the PR title if you are _done_ with the PR and are only
|
||||
waiting on it to be merged.
|
||||
|
||||
- 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`
|
||||
For example, a typical workflow is:
|
||||
|
||||
#### Coding style
|
||||
1. You open a `[WIP]` PR where the work is _not_ ready for feedback, you just want to
|
||||
let others know what you are doing.
|
||||
2. Once the PR is ready for review, you replace `[WIP]` in the title with `[RFC]`.
|
||||
You may add fix up commits to address issues that come up during review.
|
||||
3. Once the PR is ready for merging, you rebase/squash your work appropriately and
|
||||
then replace `[RFC]` in the title with `[RDY]`.
|
||||
|
||||
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`.
|
||||
### Commit messages
|
||||
|
||||
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 +118,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 +125,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
|
||||
|
71
README.md
71
README.md
@ -1,61 +1,59 @@
|
||||

|
||||
[](https://neovim.io)
|
||||
|
||||
[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)
|
||||
[Documentation](https://neovim.io/doc) |
|
||||
[Twitter](https://twitter.com/Neovim) |
|
||||
[Community](https://neovim.io/community/) |
|
||||
[Gitter **Chat**](https://gitter.im/neovim/neovim)
|
||||
|
||||
[](https://travis-ci.org/neovim/neovim)
|
||||
[](https://ci.appveyor.com/project/neovim/neovim/branch/master)
|
||||
[](https://waffle.io/neovim/neovim)
|
||||
[](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://neovim.io/doc/reports/clang)
|
||||
<a href="https://buildd.debian.org/neovim"><img src="https://www.debian.org/logos/openlogo-nd-25.png" width="13" height="15">Debian</a>
|
||||
|
||||
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 advanced [external 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.
|
||||
|
||||
There is a formula for OSX/homebrew, a PKGBUILD for Arch Linux, RPM, deb, and
|
||||
What's being worked on now
|
||||
--------------------------
|
||||
|
||||
See the [Roadmap].
|
||||
|
||||
How do I get it?
|
||||
----------------
|
||||
|
||||
There is a Debian package, homebrew formula, PKGBUILD for Arch Linux, RPM, 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.
|
||||
@ -81,5 +79,8 @@ See `LICENSE` for details.
|
||||
features. The money goes to Uganda anyway.
|
||||
|
||||
[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/
|
||||
[external UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui-projects
|
||||
|
||||
<!-- vim: set tw=80: -->
|
||||
|
27
appveyor.yml
27
appveyor.yml
@ -1,23 +1,10 @@
|
||||
version: '{build}'
|
||||
skip_tags: true
|
||||
os: Windows Server 2012 R2
|
||||
environment:
|
||||
GYP_MSVS_VERSION: 2015
|
||||
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
|
||||
configuration:
|
||||
- MINGW_64
|
||||
- MINGW_32
|
||||
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 ..
|
||||
- call .ci\build.bat
|
||||
artifacts:
|
||||
- path: build/Neovim.zip
|
||||
- path: build/Neovim.exe
|
||||
|
@ -42,7 +42,12 @@ if(MSGPACK_USE_STATIC)
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpack${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
|
||||
list(APPEND MSGPACK_NAMES msgpackc msgpack)
|
||||
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()
|
||||
|
23
cmake/PreventInTreeBuilds.cmake
Normal file
23
cmake/PreventInTreeBuilds.cmake
Normal file
@ -0,0 +1,23 @@
|
||||
function(PreventInTreeBuilds)
|
||||
get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
|
||||
get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)
|
||||
|
||||
if("${srcdir}" STREQUAL "${bindir}")
|
||||
message("")
|
||||
message("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
|
||||
message("Neovim doesn't support in-tree builds. It's recommended that you")
|
||||
message("use a build/ subdirectory:")
|
||||
message(" mkdir build")
|
||||
message(" cd build")
|
||||
message(" cmake <OPTIONS> ..")
|
||||
message("")
|
||||
message("Make sure to cleanup some CMake artifacts from this failed build")
|
||||
message("with:")
|
||||
message(" rm -rf CMakeFiles CMakeCache.txt")
|
||||
message("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
|
||||
message("")
|
||||
message(FATAL_ERROR "Stopping build.")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
PreventInTreeBuilds()
|
@ -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}")
|
||||
@ -25,15 +28,19 @@ if(DEFINED ENV{TEST_FILTER})
|
||||
set(TEST_TAG "--filter=$ENV{TEST_FILTER}")
|
||||
endif()
|
||||
|
||||
set(ENV{SYSTEM_NAME} ${SYSTEM_NAME})
|
||||
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
|
||||
@ -131,12 +142,16 @@ configure_file (
|
||||
find_program(WHOAMI_PROG whoami)
|
||||
find_program(HOSTNAME_PROG hostname)
|
||||
|
||||
if (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PROG})
|
||||
if (DEFINED ENV{USERNAME})
|
||||
set(USERNAME $ENV{USERNAME})
|
||||
elseif (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PROG})
|
||||
execute_process(COMMAND ${WHOAMI_PROG}
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE USERNAME)
|
||||
endif()
|
||||
if (EXISTS ${HOSTNAME_PROG})
|
||||
if (DEFINED ENV{HOSTNAME})
|
||||
set(HOSTNAME $ENV{HOSTNAME})
|
||||
elseif (EXISTS ${HOSTNAME_PROG})
|
||||
execute_process(COMMAND ${HOSTNAME_PROG}
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE HOSTNAME)
|
||||
|
@ -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
|
||||
|
@ -7,6 +7,10 @@
|
||||
#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
|
||||
#cmakedefine NVIM_VERSION_MEDIUM "@NVIM_VERSION_MEDIUM@"
|
||||
|
||||
#define NVIM_API_LEVEL @NVIM_API_LEVEL@
|
||||
#define NVIM_API_LEVEL_COMPAT @NVIM_API_LEVEL_COMPAT@
|
||||
#define NVIM_API_PRERELEASE @NVIM_API_PRERELEASE@
|
||||
|
||||
#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
|
||||
#define NVIM_VERSION_BUILD_TYPE "@NVIM_VERSION_BUILD_TYPE@"
|
||||
|
||||
|
@ -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,8 @@ 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)
|
||||
set(FUNCS_DATA ${PROJECT_BINARY_DIR}/funcs_data.mpack)
|
||||
|
||||
file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR})
|
||||
file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}/syntax)
|
||||
@ -9,15 +11,57 @@ file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}/syntax/vim)
|
||||
|
||||
add_custom_command(OUTPUT ${GENERATED_SYN_VIM}
|
||||
COMMAND ${LUA_PRG} ${SYN_VIM_GENERATOR}
|
||||
${PROJECT_SOURCE_DIR}/src/nvim ${GENERATED_SYN_VIM}
|
||||
${PROJECT_SOURCE_DIR}/src/nvim ${GENERATED_SYN_VIM} ${FUNCS_DATA}
|
||||
DEPENDS
|
||||
${SYN_VIM_GENERATOR}
|
||||
${PROJECT_SOURCE_DIR}/src/nvim/ex_cmds.lua
|
||||
${PROJECT_SOURCE_DIR}/src/nvim/auevents.lua
|
||||
${PROJECT_SOURCE_DIR}/src/nvim/options.lua
|
||||
${PROJECT_SOURCE_DIR}/src/nvim/eval.c
|
||||
${FUNCS_DATA}
|
||||
)
|
||||
|
||||
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 +70,25 @@ foreach(DF ${DOCFILES})
|
||||
list(APPEND BUILDDOCFILES ${GENERATED_RUNTIME_DIR}/doc/${F})
|
||||
endforeach()
|
||||
|
||||
add_custom_command(OUTPUT copy_docfiles
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
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 +97,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 +126,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)
|
||||
|
File diff suppressed because it is too large
Load Diff
171
runtime/autoload/health.vim
Normal file
171
runtime/autoload/health.vim
Normal file
@ -0,0 +1,171 @@
|
||||
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 ModeMsg
|
||||
|
||||
syntax keyword healthSuggestion SUGGESTIONS
|
||||
highlight link healthSuggestion String
|
||||
|
||||
syntax match healthHelp "|.\{-}|" contains=healthBar
|
||||
syntax match healthBar "|" contained conceal
|
||||
highlight link healthHelp Identifier
|
||||
|
||||
" We do not care about markdown syntax errors in :CheckHealth output.
|
||||
highlight! link markdownError Normal
|
||||
|
||||
" We don't need code blocks.
|
||||
silent! syntax clear markdownCodeBlock
|
||||
endfunction
|
||||
|
||||
" Runs the specified healthchecks.
|
||||
" Runs all discovered healthchecks if a:plugin_names is empty.
|
||||
function! health#check(plugin_names) abort
|
||||
let healthchecks = empty(a:plugin_names)
|
||||
\ ? s:discover_health_checks()
|
||||
\ : s:to_fn_names(a:plugin_names)
|
||||
|
||||
tabnew
|
||||
setlocal wrap breakindent
|
||||
setlocal filetype=markdown bufhidden=wipe
|
||||
setlocal conceallevel=2 concealcursor=nc
|
||||
setlocal keywordprg=:help
|
||||
call s:enhance_syntax()
|
||||
|
||||
if empty(healthchecks)
|
||||
call setline(1, 'ERROR: No healthchecks found.')
|
||||
else
|
||||
redraw|echo 'Running healthchecks...'
|
||||
for c in healthchecks
|
||||
let output = ''
|
||||
call append('$', split(printf("\n%s\n%s", c, repeat('=',72)), "\n"))
|
||||
try
|
||||
let output = "\n\n".execute('call '.c.'()')
|
||||
catch
|
||||
if v:exception =~# '^Vim\%((\a\+)\)\=:E117.*\V'.c
|
||||
let output = execute(
|
||||
\ 'call health#report_error(''No healthcheck found for "'
|
||||
\ .s:to_plugin_name(c)
|
||||
\ .'" plugin.'')')
|
||||
else
|
||||
let output = execute(
|
||||
\ 'call health#report_error(''Failed to run healthcheck for "'
|
||||
\ .s:to_plugin_name(c)
|
||||
\ .'" plugin. Exception:''."\n".v:throwpoint."\n".v:exception)')
|
||||
endif
|
||||
endtry
|
||||
call append('$', split(output, "\n") + [''])
|
||||
redraw
|
||||
endfor
|
||||
endif
|
||||
|
||||
setlocal nomodified
|
||||
redraw|echo ''
|
||||
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
|
||||
|
||||
" Changes ':help clipboard' to '|clipoard|'. Also removes surrounding quotes.
|
||||
function! s:help_to_link(s) abort
|
||||
return substitute(a:s, '\v[''"]?:h%[elp] ([^''"]+)[''"]?', '|\1|', 'g')
|
||||
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 s:help_to_link(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
|
158
runtime/autoload/health/nvim.vim
Normal file
158
runtime/autoload/health/nvim.vim
Normal file
@ -0,0 +1,158 @@
|
||||
let s:suggest_faq = 'See https://github.com/neovim/neovim/wiki/FAQ'
|
||||
|
||||
function! s:check_config() abort
|
||||
call health#report_start('Configuration')
|
||||
let sensible_pi = globpath(&runtimepath, '**/sensible.vim', 1, 1)
|
||||
if empty(sensible_pi)
|
||||
call health#report_ok('no issues found')
|
||||
else
|
||||
call health#report_info("found sensible.vim plugin:\n".join(sensible_pi, "\n"))
|
||||
call health#report_error("sensible.vim plugin is not needed; Nvim has the same defaults built-in."
|
||||
\ ." Also, sensible.vim sets 'ttimeoutlen' to a sub-optimal value.",
|
||||
\ ["Remove sensible.vim plugin, or wrap it in a `if !has('nvim')` check."])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Load the remote plugin manifest file and check for unregistered plugins
|
||||
function! s:check_rplugin_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_performance() abort
|
||||
call health#report_start('Performance')
|
||||
|
||||
" check buildtype
|
||||
let buildtype = matchstr(execute('version'), '\v\cbuild type:?\s*[^\n\r\t ]+')
|
||||
if empty(buildtype)
|
||||
call health#report_error('failed to get build type from :version')
|
||||
elseif buildtype =~# '\v(MinSizeRel|Release|RelWithDebInfo)'
|
||||
call health#report_ok(buildtype)
|
||||
else
|
||||
call health#report_info(buildtype)
|
||||
call health#report_warn(
|
||||
\ "Non-optimized build-type. Nvim will be slower.",
|
||||
\ ["Install a different Nvim package, or rebuild with `CMAKE_BUILD_TYPE=RelWithDebInfo`.",
|
||||
\ s:suggest_faq])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:check_tmux() abort
|
||||
if empty($TMUX) || !executable('tmux')
|
||||
return
|
||||
endif
|
||||
call health#report_start('tmux')
|
||||
|
||||
" check escape-time
|
||||
let suggestions = ["Set escape-time in ~/.tmux.conf:\nset-option -sg escape-time 10",
|
||||
\ s:suggest_faq]
|
||||
let cmd = 'tmux show-option -qvgs escape-time'
|
||||
let out = system(cmd)
|
||||
let tmux_esc_time = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
||||
if v:shell_error
|
||||
call health#report_error('command failed: '.cmd."\n".out)
|
||||
elseif empty(tmux_esc_time)
|
||||
call health#report_error('escape-time is not set', suggestions)
|
||||
elseif tmux_esc_time > 300
|
||||
call health#report_error(
|
||||
\ 'escape-time ('.tmux_esc_time.') is higher than 300ms', suggestions)
|
||||
else
|
||||
call health#report_ok('escape-time: '.tmux_esc_time.'ms')
|
||||
endif
|
||||
|
||||
" check $TERM
|
||||
call health#report_info('$TERM: '.$TERM)
|
||||
if $TERM !~# '\v(tmux-256color|screen-256color)'
|
||||
call health#report_error(
|
||||
\ '$TERM should be "screen-256color" or "tmux-256color" when running tmux.',
|
||||
\ ["Set default-terminal in ~/.tmux.conf:\nset-option -g default-terminal \"screen-256color\"",
|
||||
\ s:suggest_faq])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:check_terminfo() abort
|
||||
if !executable('infocmp')
|
||||
return
|
||||
endif
|
||||
call health#report_start('terminfo')
|
||||
let suggestions = [
|
||||
\ "Set key_backspace to \\177 (ASCII BACKSPACE). Run these commands:\n"
|
||||
\ .'infocmp $TERM | sed ''s/kbs=^[hH]/kbs=\\177/'' > $TERM.ti'
|
||||
\ ."\n"
|
||||
\ .'tic $TERM.ti',
|
||||
\ s:suggest_faq]
|
||||
let cmd = 'infocmp -L'
|
||||
let out = system(cmd)
|
||||
let kbs_entry = matchstr(out, 'key_backspace=\S*')
|
||||
|
||||
if v:shell_error
|
||||
call health#report_error('command failed: '.cmd."\n".out)
|
||||
elseif !empty(matchstr(out, '\Vkey_backspace=^H'))
|
||||
call health#report_error('key_backspace (kbs) entry is ^H (ASCII DELETE): '
|
||||
\ .kbs_entry, suggestions)
|
||||
else
|
||||
call health#report_info('key_backspace terminfo entry: '
|
||||
\ .(empty(kbs_entry) ? '? (not found)' : kbs_entry))
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! health#nvim#check() abort
|
||||
call s:check_config()
|
||||
call s:check_performance()
|
||||
call s:check_rplugin_manifest()
|
||||
call s:check_terminfo()
|
||||
call s:check_tmux()
|
||||
endfunction
|
451
runtime/autoload/health/provider.vim
Normal file
451
runtime/autoload/health/provider.vim
Normal file
@ -0,0 +1,451 @@
|
||||
let s:shell_error = 0
|
||||
|
||||
function! s:is_bad_response(s) abort
|
||||
return a:s =~? '\v(^unable)|(^error)|(^outdated)'
|
||||
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, '\.', 0)
|
||||
let b = split(a:b, '\.', 0)
|
||||
|
||||
for i in range(len(a))
|
||||
if str2nr(a[i]) > str2nr(b[i])
|
||||
return 1
|
||||
elseif str2nr(a[i]) < str2nr(b[i])
|
||||
return -1
|
||||
endif
|
||||
endfor
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
" Handler for s:system() function.
|
||||
function! s:system_handler(jobid, data, event) abort
|
||||
if a:event == 'stdout' || a:event == 'stderr'
|
||||
let self.output .= join(a:data, '')
|
||||
elseif a:event == 'exit'
|
||||
let s:shell_error = a:data
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Run a system command and timeout after 30 seconds.
|
||||
function! s:system(cmd, ...) abort
|
||||
let stdin = a:0 ? a:1 : ''
|
||||
let opts = {
|
||||
\ 'output': '',
|
||||
\ 'on_stdout': function('s:system_handler'),
|
||||
\ 'on_stderr': function('s:system_handler'),
|
||||
\ 'on_exit': function('s:system_handler'),
|
||||
\ }
|
||||
let jobid = jobstart(a:cmd, opts)
|
||||
|
||||
if jobid < 1
|
||||
call health#report_error(printf('Command error %d: %s', jobid,
|
||||
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd)))
|
||||
let s:shell_error = 1
|
||||
return opts.output
|
||||
endif
|
||||
|
||||
if !empty(stdin)
|
||||
call jobsend(jobid, stdin)
|
||||
endif
|
||||
|
||||
let res = jobwait([jobid], 30000)
|
||||
if res[0] == -1
|
||||
call health#report_error(printf('Command timed out: %s',
|
||||
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd))
|
||||
call jobstop(jobid)
|
||||
elseif s:shell_error != 0
|
||||
call health#report_error(printf("Command error (%d) %s: %s", jobid,
|
||||
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd,
|
||||
\ opts.output))
|
||||
endif
|
||||
|
||||
return opts.output
|
||||
endfunction
|
||||
|
||||
function! s:systemlist(cmd, ...) abort
|
||||
let stdout = split(s:system(a:cmd, a:0 ? a:1 : ''), "\n")
|
||||
if a:0 > 1 && !empty(a:2)
|
||||
return filter(stdout, '!empty(v:val)')
|
||||
endif
|
||||
return stdout
|
||||
endfunction
|
||||
|
||||
" Fetch the contents of a URL.
|
||||
function! s:download(url) abort
|
||||
if executable('curl')
|
||||
let rv = s:system(['curl', '-sL', a:url])
|
||||
return s:shell_error ? 'curl error: '.s:shell_error : rv
|
||||
elseif executable('python')
|
||||
let script = "
|
||||
\try:\n
|
||||
\ from urllib.request import urlopen\n
|
||||
\except ImportError:\n
|
||||
\ from urllib2 import urlopen\n
|
||||
\\n
|
||||
\response = urlopen('".a:url."')\n
|
||||
\print(response.read().decode('utf8'))\n
|
||||
\"
|
||||
let rv = s:system(['python', '-c', script])
|
||||
return empty(rv) && s:shell_error
|
||||
\ ? 'python urllib.request error: '.s:shell_error
|
||||
\ : rv
|
||||
endif
|
||||
return 'missing `curl` and `python`, cannot make pypi request'
|
||||
endfunction
|
||||
|
||||
" Check for clipboard tools.
|
||||
function! s:check_clipboard() abort
|
||||
call health#report_start('Clipboard')
|
||||
|
||||
let clipboard_tool = provider#clipboard#Executable()
|
||||
if empty(clipboard_tool)
|
||||
call health#report_warn(
|
||||
\ "No clipboard tool found. Using the system clipboard won't work.",
|
||||
\ ['See |clipboard|.'])
|
||||
else
|
||||
call health#report_ok('Clipboard tool found: '. clipboard_tool)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Get the latest Neovim Python client version from PyPI.
|
||||
function! s:latest_pypi_version() abort
|
||||
let pypi_version = 'unable to get pypi response'
|
||||
let pypi_response = s:download('https://pypi.python.org/pypi/neovim/json')
|
||||
if !empty(pypi_response)
|
||||
try
|
||||
let pypi_data = json_decode(pypi_response)
|
||||
catch /E474/
|
||||
return 'error: '.pypi_response
|
||||
endtry
|
||||
let pypi_version = get(get(pypi_data, 'info', {}), 'version', 'unable to parse')
|
||||
endif
|
||||
return pypi_version
|
||||
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(s: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(s:system([
|
||||
\ a:python,
|
||||
\ '-c',
|
||||
\ 'import neovim; print(neovim.__file__)']))
|
||||
let nvim_path = s:shell_error ? '' : nvim_path
|
||||
|
||||
if empty(nvim_path)
|
||||
return [python_version, 'unable to find nvim executable', pypi_version, 'unable to get nvim executable']
|
||||
endif
|
||||
|
||||
" Assuming that multiple versions of a package are installed, sort them
|
||||
" numerically in descending order.
|
||||
function! s:compare(metapath1, metapath2)
|
||||
let a = matchstr(fnamemodify(a:metapath1, ':p:h:t'), '[0-9.]\+')
|
||||
let b = matchstr(fnamemodify(a:metapath2, ':p:h:t'), '[0-9.]\+')
|
||||
return a == b ? 0 : a > b ? 1 : -1
|
||||
endfunction
|
||||
|
||||
let nvim_version = 'unable to find nvim version'
|
||||
let base = fnamemodify(nvim_path, ':h')
|
||||
let metas = glob(base.'-*/METADATA', 1, 1) + glob(base.'-*/PKG-INFO', 1, 1)
|
||||
let metas = sort(metas, 's:compare')
|
||||
|
||||
if !empty(metas)
|
||||
for meta_line in readfile(metas[0])
|
||||
if meta_line =~# '^Version:'
|
||||
let nvim_version = matchstr(meta_line, '^Version: \zs\S\+')
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
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
|
||||
|
||||
function! s:check_python(version) abort
|
||||
call health#report_start('Python ' . a:version . ' provider')
|
||||
|
||||
let python_bin_name = 'python'.(a:version == 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(s: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(s: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 contact PyPI.')
|
||||
call health#report_error('HTTP request failed: '.latest)
|
||||
endif
|
||||
|
||||
if s:is_bad_response(status)
|
||||
call health#report_warn(printf('Latest %s-neovim is NOT installed: %s',
|
||||
\ python_bin_name, latest))
|
||||
elseif !s:is_bad_response(latest)
|
||||
call health#report_ok(printf('Latest %s-neovim is installed: %s',
|
||||
\ python_bin_name, latest))
|
||||
endif
|
||||
endif
|
||||
|
||||
endfunction
|
||||
|
||||
function! s:check_ruby() abort
|
||||
call health#report_start('Ruby provider')
|
||||
let ruby_version = 'not found'
|
||||
if executable('ruby')
|
||||
let ruby_version = s:systemlist('ruby -v')[0]
|
||||
endif
|
||||
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 latest_gem = get(s:systemlist("gem list -ra '^neovim$' 2>/dev/null | " .
|
||||
\ "awk -F'[()]' '{print $2}' | " .
|
||||
\ 'cut -d, -f1'), 0, 'not found')
|
||||
let latest_desc = ' (latest: ' . latest_gem . ')'
|
||||
|
||||
silent let prog_vers = s:systemlist(ruby_prog . ' --version')[0]
|
||||
if s:shell_error
|
||||
let prog_vers = 'not found' . latest_desc
|
||||
call health#report_warn('Neovim RubyGem is not up-to-date.', suggestions)
|
||||
elseif s:version_cmp(prog_vers, latest_gem) == -1
|
||||
let prog_vers .= latest_desc
|
||||
call health#report_warn('Neovim RubyGem is not up-to-date.', suggestions)
|
||||
else
|
||||
call health#report_ok('Found up-to-date 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#provider#check() abort
|
||||
call s:check_clipboard()
|
||||
call s:check_python(2)
|
||||
call s:check_python(3)
|
||||
call s:check_ruby()
|
||||
endfunction
|
@ -1,137 +1,280 @@
|
||||
let s:man_tag_depth = 0
|
||||
let s:man_sect_arg = ''
|
||||
let s:man_find_arg = '-w'
|
||||
" Maintainer: Anmol Sethi <anmol@aubble.com>
|
||||
|
||||
if &shell =~# 'fish$'
|
||||
let s:man_cmd = 'man ^/dev/null'
|
||||
else
|
||||
let s:man_cmd = 'man 2>/dev/null'
|
||||
endif
|
||||
|
||||
let s:man_find_arg = "-w"
|
||||
|
||||
" TODO(nhooyr) Completion may work on SunOS; I'm not sure if `man -l` displays
|
||||
" the list of searched directories.
|
||||
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'
|
||||
function! man#open_page(count, count1, mods, ...) abort
|
||||
if a:0 > 2
|
||||
call s:error('too many arguments')
|
||||
return
|
||||
elseif a:0 > 2
|
||||
echoerr 'too many arguments'
|
||||
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 = ''
|
||||
endif
|
||||
|
||||
if s:find_page(sect, page) == 0
|
||||
echo 'No manual entry for '.page
|
||||
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
|
||||
endif
|
||||
|
||||
if &filetype !=# 'man'
|
||||
let editcmd = 'tabnew'
|
||||
elseif a:0 == 0
|
||||
let ref = &filetype ==# 'man' ? expand('<cWORD>') : expand('<cword>')
|
||||
if empty(ref)
|
||||
call s:error('no identifier under cursor')
|
||||
return
|
||||
endif
|
||||
elseif a:0 ==# 1
|
||||
let ref = a:1
|
||||
else
|
||||
" 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
|
||||
try
|
||||
let [sect, name] = man#extract_sect_and_name_ref(ref)
|
||||
if a:count ==# a:count1
|
||||
" v:count defaults to 0 which is a valid section, and v:count1 defaults to
|
||||
" 1, also a valid section. If they are equal, count explicitly set.
|
||||
let sect = string(a:count)
|
||||
endif
|
||||
let [sect, name, path] = s:verify_exists(sect, name)
|
||||
catch
|
||||
call s:error(v:exception)
|
||||
return
|
||||
endtry
|
||||
call s:push_tag()
|
||||
let bufname = 'man://'.name.(empty(sect)?'':'('.sect.')')
|
||||
if a:mods !~# 'tab' && s:find_man()
|
||||
noautocmd execute 'silent edit' fnameescape(bufname)
|
||||
else
|
||||
noautocmd execute 'silent' a:mods 'split' fnameescape(bufname)
|
||||
endif
|
||||
let b:man_sect = sect
|
||||
call s:read_page(path)
|
||||
endfunction
|
||||
|
||||
silent exec editcmd.' man://'.page.(empty(sect)?'':'('.sect.')')
|
||||
function! man#read_page(ref) abort
|
||||
try
|
||||
let [sect, name] = man#extract_sect_and_name_ref(a:ref)
|
||||
let [b:man_sect, name, path] = s:verify_exists(sect, name)
|
||||
catch
|
||||
" call to s:error() is unnecessary
|
||||
return
|
||||
endtry
|
||||
call s:read_page(path)
|
||||
endfunction
|
||||
|
||||
function! s:read_page(path) 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
|
||||
silent keepjumps %delete _
|
||||
" Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db).
|
||||
" http://comments.gmane.org/gmane.editors.vim.devel/29085
|
||||
" Respect $MANWIDTH, or default to window width.
|
||||
let cmd = 'env MANPAGER=cat'.(empty($MANWIDTH) ? ' MANWIDTH='.winwidth(0) : '')
|
||||
let cmd .= ' '.s:man_cmd.' '.shellescape(a:path)
|
||||
silent put =system(cmd)
|
||||
" Remove all backspaced characters.
|
||||
execute 'silent 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! man#extract_sect_and_name_ref(ref) abort
|
||||
if a:ref[0] ==# '-' " try ':Man -pandoc' with this disabled.
|
||||
throw 'manpage name cannot start with ''-'''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function s:set_window_local_options() abort
|
||||
setlocal colorcolumn=0 foldcolumn=0 nonumber
|
||||
setlocal nolist norelativenumber nofoldenable
|
||||
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
|
||||
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
|
||||
let ref = matchstr(a:ref, '[^()]\+([^()]\+)')
|
||||
if empty(ref)
|
||||
let name = matchstr(a:ref, '[^()]\+')
|
||||
if empty(name)
|
||||
throw 'manpage reference cannot contain only parentheses'
|
||||
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
|
||||
return [get(b:, 'man_default_sects', ''), name]
|
||||
endif
|
||||
return a:page
|
||||
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:find_page(sect, page) abort
|
||||
let where = system('/usr/bin/man '.s:man_find_arg.' '.s:cmd(a:sect, a:page))
|
||||
return (where =~# '^ */')
|
||||
function! s:get_path(sect, name) abort
|
||||
if empty(a:sect)
|
||||
let path = system(s:man_cmd.' '.s:man_find_arg.' '.shellescape(a:name))
|
||||
if path !~# '^\/'
|
||||
throw 'no manual entry for '.a:name
|
||||
endif
|
||||
return path
|
||||
endif
|
||||
" '-s' flag handles:
|
||||
" - tokens like 'printf(echo)'
|
||||
" - sections starting with '-'
|
||||
" - 3pcap section (found on macOS)
|
||||
" - commas between sections (for section priority)
|
||||
return system(s:man_cmd.' '.s:man_find_arg.' -s '.shellescape(a:sect).' '.shellescape(a:name))
|
||||
endfunction
|
||||
|
||||
function! s:verify_exists(sect, name) abort
|
||||
let path = s:get_path(a:sect, a:name)
|
||||
if path !~# '^\/'
|
||||
let path = s:get_path(get(b:, 'man_default_sects', ''), a:name)
|
||||
if path !~# '^\/'
|
||||
let path = s:get_path('', a:name)
|
||||
endif
|
||||
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.
|
||||
let path = path[:len(path)-2]
|
||||
return s:extract_sect_and_name_path(path) + [path]
|
||||
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 'silent' tag['buf'].'buffer'
|
||||
call cursor(tag['lnum'], tag['col'])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" 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! s:find_man() abort
|
||||
if &filetype ==# 'man'
|
||||
return 1
|
||||
elseif winnr('$') ==# 1
|
||||
return 0
|
||||
endif
|
||||
let thiswin = winnr()
|
||||
while 1
|
||||
wincmd w
|
||||
if &filetype ==# 'man'
|
||||
return 1
|
||||
elseif thiswin ==# winnr()
|
||||
return 0
|
||||
endif
|
||||
endwhile
|
||||
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 man#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(path, sect) abort
|
||||
if a:path =~# '\.\%(pdf\|in\)$' " invalid extensions
|
||||
return
|
||||
endif
|
||||
let [sect, name] = s:extract_sect_and_name_path(a:path)
|
||||
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
|
||||
|
||||
function! man#init_pager() abort
|
||||
" Remove all backspaced characters.
|
||||
execute 'silent keeppatterns keepjumps %substitute,.\b,,e'.(&gdefault?'':'g')
|
||||
if getline(1) =~# '^\s*$'
|
||||
silent keepjumps 1delete _
|
||||
else
|
||||
keepjumps 1
|
||||
endif
|
||||
" This is not perfect. See `man glDrawArraysInstanced`. Since the title is
|
||||
" all caps it is impossible to tell what the original capitilization was.
|
||||
let ref = tolower(matchstr(getline(1), '^\S\+'))
|
||||
try
|
||||
let b:man_sect = man#extract_sect_and_name_ref(ref)[0]
|
||||
catch
|
||||
let b:man_sect = ''
|
||||
endtry
|
||||
execute 'silent file man://'.fnameescape(ref)
|
||||
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,43 +2175,53 @@ function! phpcomplete#GetClassContents(classlocation, class_name) " {{{
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{
|
||||
let re = 'class '.a:class_info['name']." {"
|
||||
for [name, initializer] in items(a:class_info.constants)
|
||||
let re .= "\n\tconst ".name." = ".initializer.";"
|
||||
endfor
|
||||
for [name, info] in items(a:class_info.properties)
|
||||
let re .= "\n\t// @var $".name." ".info.type
|
||||
let re .= "\n\tpublic $".name.";"
|
||||
endfor
|
||||
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
|
||||
for [name, info] in items(a:class_info.methods)
|
||||
if name =~ '^__'
|
||||
continue
|
||||
endif
|
||||
let re .= "\n\t/**"
|
||||
let re .= "\n\t * ".name
|
||||
let re .= "\n\t *"
|
||||
let re .= "\n\t * @return ".info.return_type
|
||||
let re .= "\n\t */"
|
||||
let re .= "\n\tpublic function ".name."(".info.signature."){"
|
||||
let re .= "\n\t}"
|
||||
endfor
|
||||
for [name, info] in items(a:class_info.static_methods)
|
||||
let re .= "\n\t/**"
|
||||
let re .= "\n\t * ".name
|
||||
let re .= "\n\t *"
|
||||
let re .= "\n\t * @return ".info.return_type
|
||||
let re .= "\n\t */"
|
||||
let re .= "\n\tpublic static function ".name."(".info.signature."){"
|
||||
let re .= "\n\t}"
|
||||
endfor
|
||||
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
|
||||
endif
|
||||
let re .= "\n\t/**"
|
||||
let re .= "\n\t * ".name
|
||||
let re .= "\n\t *"
|
||||
let re .= "\n\t * @return ".info.return_type
|
||||
let re .= "\n\t */"
|
||||
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
|
||||
let re .= "\n\t *"
|
||||
let re .= "\n\t * @return ".info.return_type
|
||||
let re .= "\n\t */"
|
||||
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
|
||||
|
@ -31,35 +31,61 @@ function! s:try_cmd(cmd, ...)
|
||||
endfunction
|
||||
|
||||
let s:cache_enabled = 1
|
||||
if executable('pbcopy')
|
||||
let s:copy['+'] = 'pbcopy'
|
||||
let s:paste['+'] = 'pbpaste'
|
||||
let s:copy['*'] = s:copy['+']
|
||||
let s:paste['*'] = s:paste['+']
|
||||
let s:cache_enabled = 0
|
||||
elseif exists('$DISPLAY') && executable('xsel')
|
||||
let s:copy['+'] = 'xsel --nodetach -i -b'
|
||||
let s:paste['+'] = 'xsel -o -b'
|
||||
let s:copy['*'] = 'xsel --nodetach -i -p'
|
||||
let s:paste['*'] = 'xsel -o -p'
|
||||
elseif exists('$DISPLAY') && executable('xclip')
|
||||
let s:copy['+'] = 'xclip -quiet -i -selection clipboard'
|
||||
let s:paste['+'] = 'xclip -o -selection clipboard'
|
||||
let s:copy['*'] = 'xclip -quiet -i -selection primary'
|
||||
let s:paste['*'] = 'xclip -o -selection primary'
|
||||
else
|
||||
echom 'clipboard: No clipboard tool available. See :help nvim-clipboard'
|
||||
let s:err = ''
|
||||
|
||||
function! provider#clipboard#Error() abort
|
||||
return s:err
|
||||
endfunction
|
||||
|
||||
function! provider#clipboard#Executable() abort
|
||||
if executable('pbcopy')
|
||||
let s:copy['+'] = 'pbcopy'
|
||||
let s:paste['+'] = 'pbpaste'
|
||||
let s:copy['*'] = s:copy['+']
|
||||
let s:paste['*'] = s:paste['+']
|
||||
let s:cache_enabled = 0
|
||||
return 'pbcopy'
|
||||
elseif exists('$DISPLAY') && executable('xsel')
|
||||
let s:copy['+'] = 'xsel --nodetach -i -b'
|
||||
let s:paste['+'] = 'xsel -o -b'
|
||||
let s:copy['*'] = 'xsel --nodetach -i -p'
|
||||
let s:paste['*'] = 'xsel -o -p'
|
||||
return 'xsel'
|
||||
elseif exists('$DISPLAY') && executable('xclip')
|
||||
let s:copy['+'] = 'xclip -quiet -i -selection clipboard'
|
||||
let s:paste['+'] = 'xclip -o -selection clipboard'
|
||||
let s:copy['*'] = 'xclip -quiet -i -selection primary'
|
||||
let s:paste['*'] = 'xclip -o -selection primary'
|
||||
return 'xclip'
|
||||
elseif executable('lemonade')
|
||||
let s:copy['+'] = 'lemonade copy'
|
||||
let s:paste['+'] = 'lemonade paste'
|
||||
let s:copy['*'] = 'lemonade copy'
|
||||
let s:paste['*'] = 'lemonade paste'
|
||||
return 'lemonade'
|
||||
elseif executable('doitclient')
|
||||
let s:copy['+'] = 'doitclient wclip'
|
||||
let s:paste['+'] = 'doitclient wclip -r'
|
||||
let s:copy['*'] = s:copy['+']
|
||||
let s:paste['*'] = s:paste['+']
|
||||
return 'doitclient'
|
||||
endif
|
||||
|
||||
let s:err = 'clipboard: No clipboard tool available. See :help clipboard'
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
if empty(provider#clipboard#Executable())
|
||||
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 +110,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. '
|
||||
\ . '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".']
|
||||
\ . '(' . v:shell_error . ', output: ' . prog_ver . ')'
|
||||
\ . ' Please report this at github.com/neovim/neovim.']
|
||||
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)
|
||||
|
@ -1,7 +1,7 @@
|
||||
function! remote#define#CommandOnHost(host, method, sync, name, opts)
|
||||
let prefix = ''
|
||||
|
||||
if has_key(a:opts, 'range')
|
||||
if has_key(a:opts, 'range')
|
||||
if a:opts.range == '' || a:opts.range == '%'
|
||||
" -range or -range=%, pass the line range in a list
|
||||
let prefix = '<line1>,<line2>'
|
||||
@ -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)
|
||||
@ -187,7 +190,7 @@ let s:next_gid = 1
|
||||
function! s:GetNextAutocmdGroup()
|
||||
let gid = s:next_gid
|
||||
let s:next_gid += 1
|
||||
|
||||
|
||||
let group_name = 'RPC_DEFINE_AUTOCMD_GROUP_'.gid
|
||||
" Ensure the group is defined
|
||||
exe 'augroup '.group_name.' | augroup END'
|
||||
@ -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,8 @@ 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(resolve(v:val),"\\","/")') " Normalize slashes #4795
|
||||
let paths = uniq(sort(paths))
|
||||
if empty(paths)
|
||||
return []
|
||||
endif
|
||||
@ -193,9 +245,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
|
||||
|
||||
|
||||
@ -209,12 +261,9 @@ endfunction
|
||||
|
||||
function! remote#host#LoadErrorForHost(host, log) abort
|
||||
return 'Failed to load '. a:host . ' host. '.
|
||||
\ '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.'
|
||||
\ 'You can try to see what happened by starting nvim with '.
|
||||
\ a:log . ' set and opening the generated 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")
|
||||
let [dirlist, dirchoices] = spellfile#GetDirChoices()
|
||||
endif
|
||||
call mkdir(dir_to_create, "p")
|
||||
" Now it should show up in the list.
|
||||
let [dirlist, dirchoices] = spellfile#GetDirChoices()
|
||||
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'
|
||||
@ -78,78 +77,77 @@ function! spellfile#LoadFile(lang)
|
||||
" Careful: Nread() may have opened a new window for the error message,
|
||||
" we need to go back to our own buffer and window.
|
||||
if newbufnr != winbufnr(0)
|
||||
let winnr = bufwinnr(newbufnr)
|
||||
if winnr == -1
|
||||
" Our buffer has vanished!? Open a new window.
|
||||
echomsg "download buffer disappeared, opening a new one"
|
||||
new
|
||||
setlocal bin fenc=
|
||||
else
|
||||
exe winnr . "wincmd w"
|
||||
endif
|
||||
let winnr = bufwinnr(newbufnr)
|
||||
if winnr == -1
|
||||
" Our buffer has vanished!? Open a new window.
|
||||
echomsg "download buffer disappeared, opening a new one"
|
||||
new
|
||||
setlocal bin fenc=
|
||||
else
|
||||
exe winnr . "wincmd w"
|
||||
endif
|
||||
endif
|
||||
if newbufnr == winbufnr(0)
|
||||
" We are back the old buffer, remove any (half-finished) download.
|
||||
g/^/d
|
||||
" We are back the old buffer, remove any (half-finished) download.
|
||||
g/^/d_
|
||||
else
|
||||
let newbufnr = winbufnr(0)
|
||||
let newbufnr = winbufnr(0)
|
||||
endif
|
||||
|
||||
let fname = a:lang . '.ascii.spl'
|
||||
echo 'Could not find it, trying ' . fname . '...'
|
||||
call spellfile#Nread(fname)
|
||||
if getline(2) !~ 'VIMspell'
|
||||
echo 'Sorry, downloading failed'
|
||||
exe newbufnr . "bwipe!"
|
||||
return
|
||||
echo 'Download failed'
|
||||
exe newbufnr . "bwipe!"
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
" Delete the empty first line and mark the file unmodified.
|
||||
1d
|
||||
1d_
|
||||
set nomod
|
||||
|
||||
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
|
||||
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])
|
||||
let dirname = fnameescape(dirlist[dirchoice])
|
||||
else
|
||||
let dirname = escape(dirlist[dirchoice], ' ')
|
||||
let dirname = escape(dirlist[dirchoice], ' ')
|
||||
endif
|
||||
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
|
||||
let fname = substitute(fname, '\.spl$', '.sug', '')
|
||||
echo 'Downloading ' . fname . '...'
|
||||
call spellfile#Nread(fname)
|
||||
if getline(2) =~ 'VIMsug'
|
||||
1d
|
||||
exe "write " . dirname . '/' . fname
|
||||
set nomod
|
||||
else
|
||||
echo 'Sorry, downloading failed'
|
||||
" Go back to our own buffer/window, Nread() may have taken us to
|
||||
" another window.
|
||||
if newbufnr != winbufnr(0)
|
||||
let winnr = bufwinnr(newbufnr)
|
||||
if winnr != -1
|
||||
exe winnr . "wincmd w"
|
||||
endif
|
||||
endif
|
||||
if newbufnr == winbufnr(0)
|
||||
set nomod
|
||||
endif
|
||||
endif
|
||||
" 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_
|
||||
exe "write " . dirname . '/' . fname
|
||||
set nomod
|
||||
else
|
||||
echo 'Download failed'
|
||||
" Go back to our own buffer/window, Nread() may have taken us to
|
||||
" another window.
|
||||
if newbufnr != winbufnr(0)
|
||||
let winnr = bufwinnr(newbufnr)
|
||||
if winnr != -1
|
||||
exe winnr . "wincmd w"
|
||||
endif
|
||||
endif
|
||||
if newbufnr == winbufnr(0)
|
||||
set nomod
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -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
|
||||
|
@ -2,6 +2,7 @@
|
||||
" Compiler: GNU C Compiler
|
||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2010-10-14
|
||||
" added line suggested by Anton Lindqvist 2016 Mar 31
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@ -24,6 +25,7 @@ CompilerSet errorformat=
|
||||
\%f:%l:\ %trror:\ %m,
|
||||
\%f:%l:\ %tarning:\ %m,
|
||||
\%f:%l:\ %m,
|
||||
\%f:\\(%*[^\\)]\\):\ %m,
|
||||
\\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
|
||||
\%D%*\\a[%*\\d]:\ Entering\ directory\ [`']%f',
|
||||
\%X%*\\a[%*\\d]:\ Leaving\ directory\ [`']%f',
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim compiler file
|
||||
" Compiler: HTML Tidy
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2013 Jul 7
|
||||
" Last Change: 2016 Apr 21
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@ -12,8 +12,8 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %
|
||||
CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %:S
|
||||
|
||||
" sample warning: foo.html:8:1: Warning: inserting missing 'foobar' element
|
||||
" sample error: foo.html:9:2: Error: <foobar> is not recognized!
|
||||
CompilerSet errorformat=%f:%l:%c:\ Error:%m,%f:%l:%c:\ Warning:%m,%-G%.%#
|
||||
" foo.html:8:1: Warning: inserting missing 'foobar' element
|
||||
" foo.html:9:2: Error: <foobar> is not recognized!
|
||||
CompilerSet errorformat=%f:%l:%c:\ %trror:%m,%f:%l:%c:\ %tarning:%m,%-G%.%#
|
||||
|
@ -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.
|
||||
The API is used by external processes to interact with Nvim using the
|
||||
msgpack-rpc protocol, see |msgpack-rpc|. The API is used from vimscript to
|
||||
access some new Nvim core features. See |eval-api| for how api functions are
|
||||
called from vimscript. 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,19 +47,20 @@ 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:
|
||||
|
||||
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.
|
||||
version Nvim version, API level/compatibility
|
||||
functions API function signatures
|
||||
types Custom handle types defined by Nvim
|
||||
error_types Possible error types returned by API functions
|
||||
|
||||
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
|
||||
@ -72,10 +74,10 @@ Another use case are plugins that show output in an append-only buffer, and
|
||||
want to add highlights to the outputs. Highlight data cannot be preserved
|
||||
on writing and loading a buffer to file, nor in undo/redo cycles.
|
||||
|
||||
Highlights are registered using the |buffer_add_highlight| function, see the
|
||||
Highlights are registered using the |nvim_buf_add_highlight| function, see the
|
||||
generated API documentation for details. If an external highlighter plugin is
|
||||
adding a large number of highlights in a batch, performance can be improved by
|
||||
calling |buffer_add_highlight| as an asynchronous notification, after first
|
||||
calling |nvim_buf_add_highlight| as an asynchronous notification, after first
|
||||
(synchronously) reqesting a source id. Here is an example using wrapper
|
||||
functions in the python client:
|
||||
>
|
||||
@ -90,10 +92,19 @@ functions in the python client:
|
||||
buf.clear_highlight(src)
|
||||
<
|
||||
If the highlights don't need to be deleted or updated, just pass -1 as
|
||||
src_id (this is the default in python). |buffer_clear_highlight| can be used
|
||||
to clear highligts from a specific source, in a specific line range or the
|
||||
entire buffer by passing in the line range 0, -1 (the later is the default
|
||||
src_id (this is the default in python). |nvim_buf_clear_highlight| can be used
|
||||
to clear highlights from a specific source, in a specific line range or the
|
||||
entire buffer by passing in the line range 0, -1 (the latter is the default
|
||||
in python as used above).
|
||||
|
||||
An example of calling the api from vimscript: >
|
||||
|
||||
call nvim_buf_set_lines(0, 0, 0, v:true, ["test text"])
|
||||
let src = nvim_buf_add_highlight(0, 0, "String", 1, 0, 4)
|
||||
call nvim_buf_add_highlight(0, src, "Identifier", 0, 5, -1)
|
||||
|
||||
" later
|
||||
call nvim_buf_clear_highlight(0, src, 0, -1)
|
||||
>
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||
|
@ -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
|
||||
@ -256,7 +256,6 @@ Name triggered by ~
|
||||
Options
|
||||
|FileType| when the 'filetype' option has been set
|
||||
|Syntax| when the 'syntax' option has been set
|
||||
|EncodingChanged| after the 'encoding' option has been changed
|
||||
|TermChanged| after the value of 'term' has changed
|
||||
|OptionSet| after setting any option
|
||||
|
||||
@ -557,9 +556,6 @@ CursorMoved After the cursor was moved in Normal or Visual
|
||||
CursorMovedI After the cursor was moved in Insert mode.
|
||||
Not triggered when the popup menu is visible.
|
||||
Otherwise the same as CursorMoved.
|
||||
*EncodingChanged*
|
||||
EncodingChanged Fires off after the 'encoding' option has been
|
||||
changed. Useful to set up fonts, for example.
|
||||
*FileAppendCmd*
|
||||
FileAppendCmd Before appending to a file. Should do the
|
||||
appending to the file. Use the '[ and ']
|
||||
@ -618,9 +614,6 @@ FileChangedShell When Vim notices that the modification time of
|
||||
*FileChangedShellPost*
|
||||
FileChangedShellPost After handling a file that was changed outside
|
||||
of Vim. Can be used to update the statusline.
|
||||
*FileEncoding*
|
||||
FileEncoding Obsolete. It still works and is equivalent
|
||||
to |EncodingChanged|.
|
||||
*FileReadCmd*
|
||||
FileReadCmd Before reading a file with a ":read" command.
|
||||
Should do the reading of the file. |Cmd-event|
|
||||
@ -770,13 +763,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 +905,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|
|
||||
@ -946,7 +940,15 @@ VimEnter After doing all the startup stuff, including
|
||||
loading vimrc files, executing the "-c cmd"
|
||||
arguments, creating all windows and loading
|
||||
the buffers in them.
|
||||
*VimLeave*
|
||||
Just before this event is triggered the
|
||||
|v:vim_did_enter| variable is set, so that you
|
||||
can do: >
|
||||
if v:vim_did_enter
|
||||
call s:init()
|
||||
else
|
||||
au VimEnter * call s:init()
|
||||
endif
|
||||
< *VimLeave*
|
||||
VimLeave Before exiting Vim, just after writing the
|
||||
.shada file. Executed only once, like
|
||||
VimLeavePre.
|
||||
@ -1100,7 +1102,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 +1161,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>*
|
||||
@ -776,13 +783,13 @@ Note: these are typed literally, they are not special keys!
|
||||
<afile> only when the file name isn't used to match with
|
||||
(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.
|
||||
file name of the sourced file. *E498*
|
||||
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
|
||||
@ -844,7 +851,7 @@ These modifiers can be given, in this order:
|
||||
:gs?pat?sub?
|
||||
Substitute all occurrences of "pat" with "sub". Otherwise
|
||||
this works like ":s".
|
||||
:S Escape special characters for use with a shell command (see
|
||||
:S Escape special characters for use with a shell command (see
|
||||
|shellescape()|). Must be the last one. Examples: >
|
||||
:!dir <cfile>:S
|
||||
:call system('chmod +w -- ' . expand('%:S'))
|
||||
@ -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*
|
||||
|
48
runtime/doc/deprecated.txt
Normal file
48
runtime/doc/deprecated.txt
Normal file
@ -0,0 +1,48 @@
|
||||
*deprecated.txt* {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL
|
||||
|
||||
|
||||
Nvim *deprecated*
|
||||
|
||||
The items listed below are "deprecated". This means they will be removed in
|
||||
the future. They should not be used in new scripts, and old scripts should be
|
||||
updated.
|
||||
|
||||
==============================================================================
|
||||
|
||||
Normal commands ~
|
||||
*]f*
|
||||
*[f* Same as "gf".
|
||||
|
||||
|
||||
Commands ~
|
||||
*:rv*
|
||||
*:rviminfo* Deprecated alias to |:rshada| command.
|
||||
*:wv*
|
||||
*:wviminfo* Deprecated alias to |:wshada| command.
|
||||
|
||||
|
||||
Events ~
|
||||
*EncodingChanged* Never fired; 'encoding' is always "utf-8".
|
||||
*FileEncoding* Never fired; equivalent to |EncodingChanged|.
|
||||
|
||||
Highlight groups ~
|
||||
*hl-VisualNOS* Obsolete. |vim-differences| {Nvim}
|
||||
|
||||
Functions ~
|
||||
*buffer_exists()* Obsolete name for |bufexists()|.
|
||||
*buffer_name()* Obsolete name for |bufname()|.
|
||||
*buffer_number()* Obsolete name for |bufnr()|.
|
||||
*file_readable()* Obsolete name for |filereadable()|.
|
||||
*highlight_exists()* Obsolete name for |hlexists()|.
|
||||
*highlightID()* Obsolete name for |hlID()|.
|
||||
*last_buffer_nr()* Obsolete name for bufnr("$").
|
||||
|
||||
Options ~
|
||||
*'fe'* 'fenc'+'enc' before Vim 6.0; no longer used.
|
||||
*'vi'*
|
||||
*'viminfo'* Deprecated alias to 'shada' option.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
@ -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,35 @@ 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.
|
||||
API client ~
|
||||
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 Nvim lua-client is an API client:
|
||||
https://github.com/neovim/lua-client
|
||||
|
||||
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).
|
||||
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.
|
||||
|
||||
Remote plugin ~
|
||||
Arbitrary code registered via |:UpdateRemotePlugins|, that runs in a separate
|
||||
process and communicates with Nvim via the |api|.
|
||||
|
||||
Naming the window
|
||||
|
||||
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 +158,79 @@ 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*
|
||||
API *dev-api*
|
||||
|
||||
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.
|
||||
Use this pattern to name new API functions:
|
||||
nvim_{thing}_{action}_{arbitrary-qualifiers}
|
||||
|
||||
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.
|
||||
If the function acts on an object then {thing} is the name of that object
|
||||
(e.g. "buf" or "win"). If the function operates in a "global" context then
|
||||
{thing} is usually omitted (but consider "namespacing" your global operations
|
||||
with a {thing} that groups functions under a common concept).
|
||||
|
||||
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.
|
||||
Use existing common {action} names if possible:
|
||||
add Append to, or insert into, a collection
|
||||
get Get a thing (or subset of things by some query)
|
||||
set Set a thing
|
||||
del Delete a thing (or group of things)
|
||||
list Get all things
|
||||
|
||||
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.
|
||||
Use consistent names for {thing} in all API functions. E.g. a buffer is called
|
||||
"buf" everywhere, not "buffer" in some places and "buf" in others.
|
||||
|
||||
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.
|
||||
Example: `nvim_get_current_line` acts on the global editor state; the common
|
||||
{action} "get" is used but {thing} is omitted.
|
||||
|
||||
Example: `nvim_buf_add_highlight` acts on a `Buffer` object (the first
|
||||
parameter) and uses the common {action} "add".
|
||||
|
||||
Word frequency
|
||||
Example: `nvim_list_bufs` operates in a global context (first parameter is
|
||||
_not_ a Buffer). The common {action} "list" indicates that it lists all
|
||||
bufs (plural) in the global context.
|
||||
|
||||
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:ts=8:ft=help:norl:
|
||||
|
@ -1,12 +1,12 @@
|
||||
*diff.txt* For Vim version 7.4. Last change: 2015 Feb 03
|
||||
*diff.txt* For Vim version 7.4. Last change: 2016 Aug 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
*diff* *diff-mode*
|
||||
This file describes |diff-mode|, which shows the differences between two,
|
||||
three, or four versions of the same file.
|
||||
This file describes the |+diff| feature: Showing differences between two to
|
||||
eight versions of the same file.
|
||||
|
||||
The basics are explained in section |08.7| of the user manual.
|
||||
|
||||
@ -109,7 +109,7 @@ To make these commands use a vertical split, prepend |:vertical|. Examples: >
|
||||
If you always prefer a vertical split include "vertical" in 'diffopt'.
|
||||
|
||||
*E96*
|
||||
There can be up to four buffers with 'diff' set.
|
||||
There can be up to eight buffers with 'diff' set.
|
||||
|
||||
Since the option values are remembered with the buffer, you can edit another
|
||||
file for a moment and come back to the same file and be in diff mode again.
|
||||
@ -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
|
||||
@ -266,9 +267,6 @@ CTRL-^ Edit the alternate file. Mostly the alternate file is
|
||||
files.
|
||||
See |CTRL-^| above for further details.
|
||||
|
||||
[count]]f *]f* *[f*
|
||||
[count][f Same as "gf". Deprecated.
|
||||
|
||||
*gf* *E446* *E447*
|
||||
[count]gf Edit the file whose name is under or after the cursor.
|
||||
Mnemonic: "goto file".
|
||||
@ -357,7 +355,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 +365,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 +598,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 +949,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 +1045,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 +1220,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 +1256,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 +1336,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 +1348,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
|
||||
|
||||
|
1385
runtime/doc/eval.txt
1385
runtime/doc/eval.txt
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
|
||||
@ -500,7 +500,7 @@ Options:
|
||||
avoid that a Subject line with "Vim:" in it will cause an
|
||||
error message.
|
||||
'textwidth' is set to 72. This is often recommended for e-mail.
|
||||
'formatoptions' is set to break text lines and to repeat the comment leader
|
||||
'formatoptions' is set to break text lines and to repeat the comment leader
|
||||
in new lines, so that a leading ">" for quotes is repeated.
|
||||
You can also format quoted text with |gq|.
|
||||
|
||||
@ -510,32 +510,44 @@ 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.
|
||||
Man Open the manpage for the <cWORD> (man buffers)
|
||||
or <cword> (non-man buffers) under the cursor.
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
*b:man_default_sects* Comma-separated, ordered list of preferred sections.
|
||||
For example in C one usually wants section 3 or 2: >
|
||||
:let b:man_default_sections = '3,2'
|
||||
|
||||
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'
|
||||
|
||||
|
@ -128,6 +128,7 @@ The available subcommands are:
|
||||
6 or e: Find this egrep pattern
|
||||
7 or f: Find this file
|
||||
8 or i: Find files #including this file
|
||||
9 or a: Find places where this symbol is assigned a value
|
||||
|
||||
For all types, except 4 and 6, leading white space for {name} is
|
||||
removed. For 4 and 6 there is exactly one space between {querytype}
|
||||
@ -254,13 +255,13 @@ started will have no effect!
|
||||
{not available when compiled without the |+quickfix| feature}
|
||||
'cscopequickfix' specifies whether to use quickfix window to show cscope
|
||||
results. This is a list of comma-separated values. Each item consists of
|
||||
|cscope-find| command (s, g, d, c, t, e, f or i) and flag (+, - or 0).
|
||||
|cscope-find| command (s, g, d, c, t, e, f, i or a) and flag (+, - or 0).
|
||||
'+' indicates that results must be appended to quickfix window,
|
||||
'-' implies previous results clearance, '0' or command absence - don't use
|
||||
quickfix. Search is performed from start until first command occurrence.
|
||||
The default value is "" (don't use quickfix anyway). The following value
|
||||
seems to be useful: >
|
||||
:set cscopequickfix=s-,c-,d-,i-,t-,e-
|
||||
:set cscopequickfix=s-,c-,d-,i-,t-,e-,a-
|
||||
<
|
||||
*cscopetag* *cst*
|
||||
If 'cscopetag' is set, the commands ":tag" and CTRL-] as well as "vim -t"
|
||||
@ -418,6 +419,7 @@ Cscope Home Page (http://cscope.sourceforge.net/): >
|
||||
nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
|
||||
nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
|
||||
nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-_>a :cs find a <C-R>=expand("<cword>")<CR><CR>
|
||||
|
||||
" Using 'CTRL-spacebar' then a search type makes the vim window
|
||||
" split horizontally, with search result displayed in
|
||||
@ -431,6 +433,7 @@ Cscope Home Page (http://cscope.sourceforge.net/): >
|
||||
nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
|
||||
nmap <C-Space>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
|
||||
nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space>a :scs find a <C-R>=expand("<cword>")<CR><CR>
|
||||
|
||||
" Hitting CTRL-space *twice* before the search type does a vertical
|
||||
" split instead of a horizontal one
|
||||
@ -449,6 +452,8 @@ Cscope Home Page (http://cscope.sourceforge.net/): >
|
||||
\:vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
|
||||
nmap <C-Space><C-Space>d
|
||||
\:vert scs find d <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space><C-Space>a
|
||||
\:vert scs find a <C-R>=expand("<cword>")<CR><CR>
|
||||
|
||||
==============================================================================
|
||||
7. Cscope availability and information *cscope-info*
|
||||
|
@ -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
|
||||
@ -1171,7 +1171,7 @@ tag command action ~
|
||||
|:cpfile| :cpf[ile] go to last error in previous file
|
||||
|:cquit| :cq[uit] quit Vim with an error code
|
||||
|:crewind| :cr[ewind] go to the specified error, default first one
|
||||
|:cscope| :cs[cope] execute cscope command
|
||||
|:cscope| :cs[cope] execute cscope command
|
||||
|:cstag| :cst[ag] use cscope to jump to a tag
|
||||
|:cunmap| :cu[nmap] like ":unmap" but for Command-line mode
|
||||
|:cunabbrev| :cuna[bbrev] like ":unabbrev" but for Command-line mode
|
||||
@ -1290,7 +1290,7 @@ tag command action ~
|
||||
|:lcd| :lc[d] change directory locally
|
||||
|:lchdir| :lch[dir] change directory locally
|
||||
|:lclose| :lcl[ose] close location window
|
||||
|:lcscope| :lcs[cope] like ":cscope" but uses location list
|
||||
|:lcscope| :lcs[cope] like ":cscope" but uses location list
|
||||
|:ldo| :ld[o] execute command in valid location list entries
|
||||
|:lfdo| :lfd[o] execute command in each file in location list
|
||||
|:left| :le[ft] left align lines
|
||||
@ -1341,7 +1341,7 @@ tag command action ~
|
||||
|:marks| :marks list all marks
|
||||
|:match| :mat[ch] define a match to highlight
|
||||
|:menu| :me[nu] enter a new menu item
|
||||
|:menutranslate| :menut[ranslate] add a menu translation item
|
||||
|:menutranslate| :menut[ranslate] add a menu translation item
|
||||
|:messages| :mes[sages] view previously displayed messages
|
||||
|:mkexrc| :mk[exrc] write current mappings and settings to a file
|
||||
|:mksession| :mks[ession] write session info to a file
|
||||
@ -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
|
||||
@ -1494,7 +1496,7 @@ tag command action ~
|
||||
|:stop| :st[op] suspend the editor or escape to a shell
|
||||
|:stag| :sta[g] split window and jump to a tag
|
||||
|:startinsert| :star[tinsert] start Insert mode
|
||||
|:startgreplace| :startg[replace] start Virtual Replace mode
|
||||
|:startgreplace| :startg[replace] start Virtual Replace mode
|
||||
|:startreplace| :startr[eplace] start Replace mode
|
||||
|:stopinsert| :stopi[nsert] stop Insert mode
|
||||
|:stjump| :stj[ump] do ":tjump" and split window
|
||||
@ -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.
|
||||
|
||||
@ -1436,7 +1436,7 @@ original HTML files completion of tags (and only tags) isn't context aware.
|
||||
|
||||
RUBY *ft-ruby-omni* {Nvim}
|
||||
|
||||
NOTE: Completion for ruby code is not currently provided by Nvim.
|
||||
NOTE: |compl-omni| for Ruby code requires |provider-ruby| to be installed.
|
||||
|
||||
Ruby completion will parse your buffer on demand in order to provide a list of
|
||||
completions. These completions will be drawn from modules loaded by 'require'
|
||||
|
@ -450,7 +450,7 @@ notation meaning equivalent decimal value(s) ~
|
||||
<k0> - <k9> keypad 0 to 9 *keypad-0* *keypad-9*
|
||||
<S-...> shift-key *shift* *<S-*
|
||||
<C-...> control-key *control* *ctrl* *<C-*
|
||||
<M-...> alt-key or meta-key *meta* *alt* *<M-*
|
||||
<M-...> alt-key or meta-key *META* *meta* *alt* *<M-*
|
||||
<A-...> same as <M-...> *<A-*
|
||||
<D-...> command-key or "super" key *<D-*
|
||||
<t_xx> key with "xx" entry in termcap
|
||||
|
@ -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: >
|
||||
@ -1398,6 +1406,27 @@ The valid escape sequences are
|
||||
<bang> (See the '-bang' attribute) Expands to a ! if the
|
||||
command was executed with a ! modifier, otherwise
|
||||
expands to nothing.
|
||||
*<mods>*
|
||||
<mods> The command modifiers, if specified. Otherwise, expands to
|
||||
nothing. Supported modifiers are |aboveleft|, |belowright|,
|
||||
|botright|, |browse|, |confirm|, |hide|, |keepalt|,
|
||||
|keepjumps|, |keepmarks|, |keeppatterns|, |lockmarks|,
|
||||
|noswapfile|, |silent|, |tab|, |topleft|, |verbose|, and
|
||||
|vertical|.
|
||||
Examples: >
|
||||
command! -nargs=+ -complete=file MyEdit
|
||||
\ for f in expand(<q-args>, 0, 1) |
|
||||
\ exe '<mods> split ' . f |
|
||||
\ endfor
|
||||
|
||||
function! SpecialEdit(files, mods)
|
||||
for f in expand(a:files, 0, 1)
|
||||
exe a:mods . ' split ' . f
|
||||
endfor
|
||||
endfunction
|
||||
command! -nargs=+ -complete=file Sedit
|
||||
\ call SpecialEdit(<q-args>, <q-mods>)
|
||||
<
|
||||
*<reg>* *<register>*
|
||||
<reg> (See the '-register' attribute) The optional register,
|
||||
if specified. Otherwise, expands to nothing. <register>
|
||||
|
@ -70,29 +70,24 @@ See |mbyte-locale| for details.
|
||||
|
||||
ENCODING
|
||||
|
||||
If your locale works properly, Vim will try to set the 'encoding' option
|
||||
accordingly. If this doesn't work you can overrule its value: >
|
||||
Nvim always uses UTF-8 internally. Thus 'encoding' option is always set
|
||||
to "utf-8" and cannot be changed.
|
||||
|
||||
:set encoding=utf-8
|
||||
All the text that is used inside Vim will be in UTF-8. Not only the text in
|
||||
the buffers, but also in registers, variables, etc.
|
||||
|
||||
See |encoding-values| for a list of acceptable values.
|
||||
|
||||
The result is that all the text that is used inside Vim will be in this
|
||||
encoding. Not only the text in the buffers, but also in registers, variables,
|
||||
etc. 'encoding' is read-only after startup because changing it would make the
|
||||
existing text invalid.
|
||||
|
||||
You can edit files in another encoding than what 'encoding' is set to. Vim
|
||||
You can edit files in different encodings than UTF-8. Nvim
|
||||
will convert the file when you read it and convert it back when you write it.
|
||||
See 'fileencoding', 'fileencodings' and |++enc|.
|
||||
|
||||
|
||||
DISPLAY AND FONTS
|
||||
|
||||
If you are working in a terminal (emulator) you must make sure it accepts the
|
||||
same encoding as which Vim is working with.
|
||||
If you are working in a terminal (emulator) you must make sure it accepts
|
||||
UTF-8, the encoding which Vim is working with. Otherwise only ASCII can
|
||||
be displayed and edited correctly.
|
||||
|
||||
For the GUI you must select fonts that work with the current 'encoding'. This
|
||||
For the GUI you must select fonts that work with UTF-8. This
|
||||
is the difficult part. It depends on the system you are using, the locale and
|
||||
a few other things. See the chapters on fonts: |mbyte-fonts-X11| for
|
||||
X-Windows and |mbyte-fonts-MSwin| for MS-Windows.
|
||||
@ -216,10 +211,9 @@ You could make a small shell script for this.
|
||||
==============================================================================
|
||||
3. Encoding *mbyte-encoding*
|
||||
|
||||
Vim uses the 'encoding' option to specify how characters are identified and
|
||||
encoded when they are used inside Vim. This applies to all the places where
|
||||
text is used, including buffers (files loaded into memory), registers and
|
||||
variables.
|
||||
In Nvim UTF-8 is always used internally to encode characters.
|
||||
This applies to all the places where text is used, including buffers (files
|
||||
loaded into memory), registers and variables.
|
||||
|
||||
*charset* *codeset*
|
||||
Charset is another name for encoding. There are subtle differences, but these
|
||||
@ -240,7 +234,7 @@ matter what language is used. Thus you might see the right text even when the
|
||||
encoding was set wrong.
|
||||
|
||||
*encoding-names*
|
||||
Vim can use many different character encodings. There are three major groups:
|
||||
Vim can edit files in different character encodings. There are three major groups:
|
||||
|
||||
1 8bit Single-byte encodings, 256 different characters. Mostly used
|
||||
in USA and Europe. Example: ISO-8859-1 (Latin1). All
|
||||
@ -255,11 +249,10 @@ u Unicode Universal encoding, can replace all others. ISO 10646.
|
||||
Millions of different characters. Example: UTF-8. The
|
||||
relation between bytes and screen cells is complex.
|
||||
|
||||
Other encodings cannot be used by Vim internally. But files in other
|
||||
Only UTF-8 is used by Vim internally. But files in other
|
||||
encodings can be edited by using conversion, see 'fileencoding'.
|
||||
Note that all encodings must use ASCII for the characters up to 128.
|
||||
|
||||
Supported 'encoding' values are: *encoding-values*
|
||||
Recognized 'fileencoding' values include: *encoding-values*
|
||||
1 latin1 8-bit characters (ISO 8859-1, also used for cp1252)
|
||||
1 iso-8859-n ISO_8859 variant (n = 2 to 15)
|
||||
1 koi8-r Russian
|
||||
@ -311,11 +304,11 @@ u ucs-4 32 bit UCS-4 encoded Unicode (ISO/IEC 10646-1)
|
||||
u ucs-4le like ucs-4, little endian
|
||||
|
||||
The {name} can be any encoding name that your system supports. It is passed
|
||||
to iconv() to convert between the encoding of the file and the current locale.
|
||||
to iconv() to convert between UTF-8 and the encoding of the file.
|
||||
For MS-Windows "cp{number}" means using codepage {number}.
|
||||
Examples: >
|
||||
:set encoding=8bit-cp1252
|
||||
:set encoding=2byte-cp932
|
||||
:set fileencoding=8bit-cp1252
|
||||
:set fileencoding=2byte-cp932
|
||||
|
||||
The MS-Windows codepage 1252 is very similar to latin1. For practical reasons
|
||||
the same encoding is used and it's called latin1. 'isprint' can be used to
|
||||
@ -337,8 +330,7 @@ u ucs-2be same as ucs-2 (big endian)
|
||||
u ucs-4be same as ucs-4 (big endian)
|
||||
u utf-32 same as ucs-4
|
||||
u utf-32le same as ucs-4le
|
||||
default stands for the default value of 'encoding', depends on the
|
||||
environment
|
||||
default the encoding of the current locale.
|
||||
|
||||
For the UCS codes the byte order matters. This is tricky, use UTF-8 whenever
|
||||
you can. The default is to use big-endian (most significant byte comes
|
||||
@ -363,13 +355,12 @@ or when conversion is not possible:
|
||||
CONVERSION *charset-conversion*
|
||||
|
||||
Vim will automatically convert from one to another encoding in several places:
|
||||
- When reading a file and 'fileencoding' is different from 'encoding'
|
||||
- When writing a file and 'fileencoding' is different from 'encoding'
|
||||
- When reading a file and 'fileencoding' is different from "utf-8"
|
||||
- When writing a file and 'fileencoding' is different from "utf-8"
|
||||
- When displaying messages and the encoding used for LC_MESSAGES differs from
|
||||
'encoding' (requires a gettext version that supports this).
|
||||
"utf-8" (requires a gettext version that supports this).
|
||||
- When reading a Vim script where |:scriptencoding| is different from
|
||||
'encoding'.
|
||||
- When reading or writing a |shada| file.
|
||||
"utf-8".
|
||||
Most of these require the |+iconv| feature. Conversion for reading and
|
||||
writing files may also be specified with the 'charconvert' option.
|
||||
|
||||
@ -408,11 +399,11 @@ Useful utilities for converting the charset:
|
||||
|
||||
|
||||
*mbyte-conversion*
|
||||
When reading and writing files in an encoding different from 'encoding',
|
||||
When reading and writing files in an encoding different from "utf-8",
|
||||
conversion needs to be done. These conversions are supported:
|
||||
- All conversions between Latin-1 (ISO-8859-1), UTF-8, UCS-2 and UCS-4 are
|
||||
handled internally.
|
||||
- For MS-Windows, when 'encoding' is a Unicode encoding, conversion from and
|
||||
- For MS-Windows, conversion from and
|
||||
to any codepage should work.
|
||||
- Conversion specified with 'charconvert'
|
||||
- Conversion with the iconv library, if it is available.
|
||||
@ -468,8 +459,6 @@ and you will have a working UTF-8 terminal emulator. Try both >
|
||||
with the demo text that comes with ucs-fonts.tar.gz in order to see
|
||||
whether there are any problems with UTF-8 in your xterm.
|
||||
|
||||
For Vim you may need to set 'encoding' to "utf-8".
|
||||
|
||||
==============================================================================
|
||||
5. Fonts on X11 *mbyte-fonts-X11*
|
||||
|
||||
@ -864,11 +853,11 @@ between two keyboard settings.
|
||||
The value of the 'keymap' option specifies a keymap file to use. The name of
|
||||
this file is one of these two:
|
||||
|
||||
keymap/{keymap}_{encoding}.vim
|
||||
keymap/{keymap}_utf-8.vim
|
||||
keymap/{keymap}.vim
|
||||
|
||||
Here {keymap} is the value of the 'keymap' option and {encoding} of the
|
||||
'encoding' option. The file name with the {encoding} included is tried first.
|
||||
Here {keymap} is the value of the 'keymap' option.
|
||||
The file name with "utf-8" included is tried first.
|
||||
|
||||
'runtimepath' is used to find these files. To see an overview of all
|
||||
available keymap files, use this: >
|
||||
@ -950,7 +939,7 @@ this is unusual. But you can use various ways to specify the character: >
|
||||
A <char-0141> octal value
|
||||
x <Space> special key name
|
||||
|
||||
The characters are assumed to be encoded for the current value of 'encoding'.
|
||||
The characters are assumed to be encoded in UTF-8.
|
||||
It's possible to use ":scriptencoding" when all characters are given
|
||||
literally. That doesn't work when using the <char-> construct, because the
|
||||
conversion is done on the keymap file, not on the resulting character.
|
||||
@ -1170,21 +1159,13 @@ Useful commands:
|
||||
message is truncated, use ":messages").
|
||||
- "g8" shows the bytes used in a UTF-8 character, also the composing
|
||||
characters, as hex numbers.
|
||||
- ":set encoding=utf-8 fileencodings=" forces using UTF-8 for all files. The
|
||||
default is to use the current locale for 'encoding' and set 'fileencodings'
|
||||
to automatically detect the encoding of a file.
|
||||
- ":set fileencodings=" forces using UTF-8 for all files. The
|
||||
default is to automatically detect the encoding of a file.
|
||||
|
||||
|
||||
STARTING VIM
|
||||
|
||||
If your current locale is in an utf-8 encoding, Vim will automatically start
|
||||
in utf-8 mode.
|
||||
|
||||
If you are using another locale: >
|
||||
|
||||
set encoding=utf-8
|
||||
|
||||
You might also want to select the font used for the menus. Unfortunately this
|
||||
You might want to select the font used for the menus. Unfortunately this
|
||||
doesn't always work. See the system specific remarks below, and 'langmenu'.
|
||||
|
||||
|
||||
@ -1245,10 +1226,9 @@ not everybody is able to type a composing character.
|
||||
These options are relevant for editing multi-byte files. Check the help in
|
||||
options.txt for detailed information.
|
||||
|
||||
'encoding' Encoding used for the keyboard and display. It is also the
|
||||
default encoding for files.
|
||||
'encoding' Internal text encoding, always "utf-8".
|
||||
|
||||
'fileencoding' Encoding of a file. When it's different from 'encoding'
|
||||
'fileencoding' Encoding of a file. When it's different from "utf-8"
|
||||
conversion is done when reading or writing the file.
|
||||
|
||||
'fileencodings' List of possible encodings of a file. When opening a file
|
||||
|
@ -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 Jul 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -656,6 +656,12 @@ You must be using an awful lot of buffers. It's now possible that two buffers
|
||||
have the same number, which causes various problems. You might want to exit
|
||||
Vim and restart it.
|
||||
|
||||
*E931* >
|
||||
Buffer cannot be registered
|
||||
|
||||
Out of memory or a duplicate buffer number. May habben after W14. Looking up
|
||||
a buffer will not always work, better restart Vim.
|
||||
|
||||
*E296* *E297* >
|
||||
Seek error in swap file write
|
||||
Write error in swap file
|
||||
|
@ -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,4 +1,4 @@
|
||||
*motion.txt* For Vim version 7.4. Last change: 2015 Jun 06
|
||||
*motion.txt* For Vim version 7.4. Last change: 2016 Jul 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -569,7 +569,7 @@ i[ "inner [] block", select [count] '[' ']' blocks. This
|
||||
When used in Visual mode it is made characterwise.
|
||||
|
||||
a) *v_a)* *a)* *a(*
|
||||
a( *v_ab* *v_a(* *ab*
|
||||
a( *vab* *v_ab* *v_a(* *ab*
|
||||
ab "a block", select [count] blocks, from "[count] [(" to
|
||||
the matching ')', including the '(' and ')' (see
|
||||
|[(|). Does not include white space outside of the
|
||||
@ -577,7 +577,7 @@ ab "a block", select [count] blocks, from "[count] [(" to
|
||||
When used in Visual mode it is made characterwise.
|
||||
|
||||
i) *v_i)* *i)* *i(*
|
||||
i( *v_ib* *v_i(* *ib*
|
||||
i( *vib* *v_ib* *v_i(* *ib*
|
||||
ib "inner block", select [count] blocks, from "[count] [("
|
||||
to the matching ')', excluding the '(' and ')' (see
|
||||
|[(|).
|
||||
|
@ -1,97 +1,93 @@
|
||||
*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|
|
||||
6. Remote UIs |rpc-remote-ui|
|
||||
|
||||
==============================================================================
|
||||
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 API function
|
||||
- Listen for events
|
||||
- Receive remote calls from Nvim
|
||||
|
||||
- Call any Nvim API function
|
||||
- Listen for Nvim 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 `nvim_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:
|
||||
>
|
||||
4. Through a TCP/IP socket. To make Nvim listen on a TCP/IP socket, set the
|
||||
|$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
|
||||
@ -109,7 +105,7 @@ world!' in the current Nvim instance:
|
||||
require 'msgpack/rpc/transport/unix'
|
||||
|
||||
nvim = MessagePack::RPC::Client.new(MessagePack::RPC::UNIXTransport.new, ENV['NVIM_LISTEN_ADDRESS'])
|
||||
result = nvim.call(:vim_command, 'echo "hello world!"')
|
||||
result = nvim.call(:nvim_command, 'echo "hello world!"')
|
||||
<
|
||||
A better way is to use the Python REPL with the `neovim` package, where API
|
||||
functions can be called interactively:
|
||||
@ -118,72 +114,110 @@ 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'])
|
||||
echo rpcrequest(vim, 'vim_eval', '"Hello " . "world!"')
|
||||
call rpcstop(vim)
|
||||
let nvim = jobstart(['nvim', '--embed'], {'rpc': v:true})
|
||||
echo rpcrequest(nvim, 'nvim_eval', '"Hello " . "world!"')
|
||||
call jobstop(nvim)
|
||||
<
|
||||
==============================================================================
|
||||
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:
|
||||
"API clients" wrap the Nvim API to provide idiomatic "SDKs" for their
|
||||
respective platforms (see |dev-jargon|). You can build a new API client for
|
||||
your favorite platform or programming language.
|
||||
|
||||
- Separate the transport layer from the rest of the library. See
|
||||
|msgpack-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.
|
||||
- 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).
|
||||
Existing API clients are listed here:
|
||||
https://github.com/neovim/neovim/wiki/Related-projects#api-clients
|
||||
|
||||
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:
|
||||
The Python client is the reference implementation for API clients. It is
|
||||
always up-to-date with the Nvim API, so its source code and test suite are
|
||||
authoritative references.
|
||||
https://github.com/neovim/python-client
|
||||
|
||||
API client implementation guidelines ~
|
||||
|
||||
- Separate the transport layer from the rest of the library. See
|
||||
|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.
|
||||
- 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).
|
||||
|
||||
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
|
||||
|
||||
API metadata object ~
|
||||
|
||||
API clients exist to hide msgpack-rpc details. The API metadata object
|
||||
contains information that makes this task easier (see also |rpc-types|):
|
||||
|
||||
- The "version" key contains the Nvim version, API level, and API
|
||||
backwards-compatibility level.
|
||||
- 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.
|
||||
- Functions that are considered to be methods that operate on instances of
|
||||
Nvim special types (msgpack EXT) will have the `"method"` attribute set to
|
||||
`true`. The reciever type is the type of the first argument. The method
|
||||
names are prefixed with `nvim_` plus a shortened type name, e.g.
|
||||
`nvim_buf_get_lines` represents the `get_lines` method of a Buffer instance.
|
||||
- Global functions have `"method"` set to `false` and are prefixed with just
|
||||
`nvim_`, e.g. `nvim_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 stripping the prefix for the type as defined in the `types` metadata
|
||||
(this will always be the first two "_"-separated parts of the function name).
|
||||
There could also be a singleton Vim class with methods where the `nvim_`
|
||||
prefix is stripped off.
|
||||
|
||||
==============================================================================
|
||||
5. Types *msgpack-rpc-types*
|
||||
5. Types *rpc-types*
|
||||
|
||||
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:
|
||||
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 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
|
||||
Integer (signed 64-bit integer) -> msgpack integer
|
||||
Float (IEEE 754 double precision) -> msgpack float
|
||||
String -> msgpack string
|
||||
Array -> msgpack array
|
||||
Dictionary -> msgpack map
|
||||
Nil -> msgpack nil
|
||||
Boolean -> msgpack boolean
|
||||
Integer (signed 64-bit integer) -> msgpack integer
|
||||
Float (IEEE 754 double precision) -> msgpack float
|
||||
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
|
||||
Tabpage -> enum value kObjectTypeTabpage
|
||||
Buffer -> enum value kObjectTypeBuffer
|
||||
Window -> enum value kObjectTypeWindow
|
||||
Tabpage -> enum value kObjectTypeTabpage
|
||||
|
||||
An API method expecting one of these types may be passed an integer instead,
|
||||
although they are not interchangeable. For example, a Buffer may be passed as
|
||||
@ -191,70 +225,192 @@ 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
|
||||
`nvim_get_api_info` method at runtime. Here's a sample JSON representation of
|
||||
the `types` object:
|
||||
>
|
||||
"types": {
|
||||
"Buffer": {
|
||||
"id": 0
|
||||
"id": 0,
|
||||
"prefix": "nvim_buf_"
|
||||
},
|
||||
"Window": {
|
||||
"id": 1
|
||||
"id": 1,
|
||||
"prefix": "nvim_win_"
|
||||
},
|
||||
"Tabpage": {
|
||||
"id": 2
|
||||
"id": 2,
|
||||
"prefix": "nvim_tabpage_"
|
||||
}
|
||||
}
|
||||
<
|
||||
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.
|
||||
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.
|
||||
|
||||
==============================================================================
|
||||
6. Wrapping methods *msgpack-rpc-wrap-methods*
|
||||
6. Remote UIs *rpc-remote-ui*
|
||||
|
||||
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:
|
||||
Nvim allows Graphical user interfaces to be implemented by separate processes
|
||||
communicating with Nvim over the RPC API. Currently the ui model conists of a
|
||||
terminal-like grid with one single, monospace font size, with a few elements
|
||||
that could be drawn separately from the grid (for the momemnt only the popup
|
||||
menu)
|
||||
|
||||
- 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`.
|
||||
After connecting to a nvim instance (typically a spawned, embedded instance)
|
||||
use the |nvim_ui_attach|(width, height, options) API method to tell nvim that your
|
||||
program wants to draw the nvim screen on a grid with "width" times
|
||||
"height" cells. "options" should be a dictionary with the following (all
|
||||
optional) keys:
|
||||
`rgb`: Controls what color format to use.
|
||||
Set to true (default) to use 24-bit rgb
|
||||
colors.
|
||||
Set to false to use terminal color codes (at
|
||||
most 256 different colors).
|
||||
`popupmenu_external`: Instead of drawing the completion popupmenu on
|
||||
the grid, Nvim will send higher-level events to
|
||||
the ui and let it draw the popupmenu.
|
||||
Defaults to false.
|
||||
|
||||
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_`
|
||||
Nvim will then send msgpack-rpc notifications, with the method name "redraw"
|
||||
and a single argument, an array of screen updates (described below).
|
||||
These should be processed in order. Preferably the user should only be able to
|
||||
see the screen state after all updates are processed (not any intermediate
|
||||
state after processing only a part of the array).
|
||||
|
||||
==============================================================================
|
||||
7. Vimscript functions *msgpack-rpc-vim-functions*
|
||||
Screen updates are arrays. The first element a string describing the kind
|
||||
of update.
|
||||
|
||||
Four msgpack-rpc functions are available in Vimscript:
|
||||
["resize", width, height]
|
||||
The grid is resized to `width` and `height` cells.
|
||||
|
||||
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.
|
||||
["clear"]
|
||||
Clear the screen.
|
||||
|
||||
2. |rpcstop()|: Same as |jobstop()|, but operates on handles returned by
|
||||
|rpcstart()|.
|
||||
["eol_clear"]
|
||||
Clear from the cursor position to the end of the current line.
|
||||
|
||||
3. |rpcrequest()|: Sends a msgpack-rpc request to the process.
|
||||
["cursor_goto", row, col]
|
||||
Move the cursor to position (row, col). Currently, the same cursor is
|
||||
used to define the position for text insertion and the visible cursor.
|
||||
However, only the last cursor position, after processing the entire
|
||||
array in the "redraw" event, is intended to be a visible cursor
|
||||
position.
|
||||
|
||||
4. |rpcnotify()|: Sends a msgpack-rpc notification to the process.
|
||||
["update_fg", color]
|
||||
["update_bg", color]
|
||||
["update_sp", color]
|
||||
Set the default foreground, background and special colors
|
||||
respectively.
|
||||
|
||||
The last two functions may also be used with channels created from
|
||||
connections to |$NVIM_LISTEN_ADDRESS|.
|
||||
["highlight_set", attrs]
|
||||
Set the attributes that the next text put on the screen will have.
|
||||
`attrs` is a dict with the keys below. Any absent key is reset
|
||||
to its default value. Color defaults are set by the `update_fg` etc
|
||||
updates. All boolean keys default to false.
|
||||
|
||||
`foreground`: foreground color.
|
||||
`background`: backround color.
|
||||
`special`: color to use for underline and undercurl, when present.
|
||||
`reverse`: reverse video. Foreground and background colors are
|
||||
switched.
|
||||
`italic`: italic text.
|
||||
`bold`: bold text.
|
||||
`underline`: underlined text. The line has `special` color.
|
||||
`undercurl`: undercurled text. The curl has `special` color.
|
||||
|
||||
["put", text]
|
||||
The (utf-8 encoded) string `text` is put at the cursor position
|
||||
(and the cursor is advanced), with the highlights as set by the
|
||||
last `highlight_set` update.
|
||||
|
||||
["set_scroll_region", top, bot, left, right]
|
||||
Define the scroll region used by `scroll` below.
|
||||
|
||||
["scroll", count]
|
||||
Scroll the text in the scroll region. The diagrams below illustrate
|
||||
what will happen, depending on the scroll direction. "=" is used to
|
||||
represent the SR(scroll region) boundaries and "-" the moved rectangles.
|
||||
Note that dst and src share a common region.
|
||||
|
||||
If count is bigger than 0, move a rectangle in the SR up, this can
|
||||
happen while scrolling down.
|
||||
>
|
||||
+-------------------------+
|
||||
| (clipped above SR) | ^
|
||||
|=========================| dst_top |
|
||||
| dst (still in SR) | |
|
||||
+-------------------------+ src_top |
|
||||
| src (moved up) and dst | |
|
||||
|-------------------------| dst_bot |
|
||||
| src (cleared) | |
|
||||
+=========================+ src_bot
|
||||
<
|
||||
If count is less than zero, move a rectangle in the SR down, this can
|
||||
happen while scrolling up.
|
||||
>
|
||||
+=========================+ src_top
|
||||
| src (cleared) | |
|
||||
|------------------------ | dst_top |
|
||||
| src (moved down) and dst| |
|
||||
+-------------------------+ src_bot |
|
||||
| dst (still in SR) | |
|
||||
|=========================| dst_bot |
|
||||
| (clipped below SR) | v
|
||||
+-------------------------+
|
||||
<
|
||||
["set_title", title]
|
||||
["set_icon", icon]
|
||||
Set the window title, and icon (minimized) window title, respectively.
|
||||
In windowing systems not distinguishing between the two, "set_icon"
|
||||
can be ignored.
|
||||
|
||||
["mouse_on"]
|
||||
["mouse_off"]
|
||||
Tells the client whether mouse support, as determined by |'mouse'|
|
||||
option, is considered to be active in the current mode. This is mostly
|
||||
useful for a terminal frontend, or other situations where nvim mouse
|
||||
would conflict with other usages of the mouse. It is safe for a client
|
||||
to ignore this and always send mouse events.
|
||||
|
||||
["busy_on"]
|
||||
["busy_off"]
|
||||
Nvim started or stopped being busy, and possibly not responsible to user
|
||||
input. This could be indicated to the user by hiding the cursor.
|
||||
|
||||
["suspend"]
|
||||
|:suspend| command or |Ctrl-Z| mapping is used. A terminal client (or other
|
||||
client where it makes sense) could suspend itself. Other clients can
|
||||
safely ignore it.
|
||||
|
||||
["bell"]
|
||||
["visual_bell"]
|
||||
Notify the user with an audible or visual bell, respectively.
|
||||
|
||||
["update_menu"]
|
||||
The menu mappings changed.
|
||||
|
||||
["mode_change", mode]
|
||||
The mode changed. Currently sent when "insert", "replace" and "normal"
|
||||
modes are entered. A client could for instance change the cursor shape.
|
||||
|
||||
["popupmenu_show", items, selected, row, col]
|
||||
When `popupmenu_external` is set to true, nvim will not draw the
|
||||
popupmenu on the grid, instead when the popupmenu is to be displayed
|
||||
this update is sent. `items` is an array of the items to show, the
|
||||
items are themselves arrays of the form [word, kind, menu, info]
|
||||
as defined at |complete-items|, except that `word` is replaced by
|
||||
`abbr` if present. `selected` is the initially selected item, either a
|
||||
zero-based index into the array of items, or -1 if no item is
|
||||
selected. `row` and `col` is the anchor position, where the first
|
||||
character of the completed word will be.
|
||||
|
||||
["popupmenu_select", selected]
|
||||
An item in the currently displayed popupmenu is selected. `selected`
|
||||
is either a zero-based index into the array of items from the last
|
||||
`popupmenu_show` event, or -1 if no item is selected.
|
||||
|
||||
["popupmenu_hide"]
|
||||
The popupmenu is hidden.
|
||||
|
||||
==============================================================================
|
||||
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 Jul 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -49,9 +49,11 @@ 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'
|
||||
'lines'
|
||||
Warning: This may have a lot of side effects.
|
||||
|
||||
*:set-args* *E487* *E521*
|
||||
:se[t] {option}={value} or
|
||||
@ -494,6 +496,7 @@ For example, to use a modeline only for Vim 7.0:
|
||||
To use a modeline for Vim after version 7.2:
|
||||
/* vim>702: set cole=2: */ ~
|
||||
There can be no blanks between "vim" and the ":".
|
||||
The modeline is ignored if {vers} does not fit in an integer. {Nvim}
|
||||
|
||||
|
||||
The number of lines that are checked can be set with the 'modelines' option.
|
||||
@ -611,7 +614,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
{only available when compiled with the |+multi_byte|
|
||||
feature}
|
||||
Only effective when 'encoding' is "utf-8" or another Unicode encoding.
|
||||
Tells Vim what to do with characters with East Asian Width Class
|
||||
Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek
|
||||
letters, Cyrillic letters).
|
||||
@ -664,7 +666,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
- Set the 'keymap' option to "arabic"; in Insert mode CTRL-^ toggles
|
||||
between typing English and Arabic key mapping.
|
||||
- Set the 'delcombine' option
|
||||
Note that 'encoding' must be "utf-8" for working with Arabic text.
|
||||
|
||||
Resetting this option will:
|
||||
- Reset the 'rightleft' option.
|
||||
@ -704,7 +705,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}.
|
||||
@ -895,7 +897,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
- The backup file will be created in the first directory in the list
|
||||
where this is possible. The directory must exist, Vim will not
|
||||
create it for you.
|
||||
- Empty means that no backup file will be created ( 'patchmode' is
|
||||
- Empty means that no backup file will be created ('patchmode' is
|
||||
impossible!). Writing may fail because of this.
|
||||
- A directory "." means to put the backup file in the same directory
|
||||
as the edited file.
|
||||
@ -1073,8 +1075,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{not available when compiled without the |+linebreak|
|
||||
feature}
|
||||
This option lets you choose which characters might cause a line
|
||||
break if 'linebreak' is on. Only works for ASCII and also for 8-bit
|
||||
characters when 'encoding' is an 8-bit encoding.
|
||||
break if 'linebreak' is on. Only works for ASCII characters.
|
||||
|
||||
*'breakindent'* *'bri'*
|
||||
'breakindent' 'bri' boolean (default off)
|
||||
@ -1154,22 +1155,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'buftype'* *'bt'* *E382*
|
||||
'buftype' 'bt' string (default: "")
|
||||
local to buffer
|
||||
{not available when compiled without the |+quickfix|
|
||||
feature}
|
||||
The value of this option specifies the type of a buffer:
|
||||
<empty> normal buffer
|
||||
nofile buffer which is not related to a file and will not be
|
||||
written
|
||||
nowrite buffer which will not be written
|
||||
acwrite buffer which will always be written with BufWriteCmd
|
||||
autocommands.
|
||||
quickfix quickfix buffer, contains list of errors |:cwindow|
|
||||
or list of locations |:lwindow|
|
||||
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.
|
||||
acwrite buffer will always be written with |BufWriteCmd|s
|
||||
help help buffer (do not set this manually)
|
||||
nofile buffer is not related to a file, will not be written
|
||||
nowrite buffer will not be written
|
||||
quickfix list of errors |:cwindow| or locations |:lwindow|
|
||||
terminal |terminal-emulator| buffer
|
||||
|
||||
This option is used together with 'bufhidden' and 'swapfile' to
|
||||
specify special kinds of buffers. See |special-buffers|.
|
||||
@ -1210,11 +1203,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Specifies details about changing the case of letters. It may contain
|
||||
these words, separated by a comma:
|
||||
internal Use internal case mapping functions, the current
|
||||
locale does not change the case mapping. This only
|
||||
matters when 'encoding' is a Unicode encoding,
|
||||
"latin1" or "iso-8859-15". When "internal" is
|
||||
omitted, the towupper() and towlower() system library
|
||||
functions are used when available.
|
||||
locale does not change the case mapping. When
|
||||
"internal" is omitted, the towupper() and towlower()
|
||||
system library functions are used when available.
|
||||
keepascii For the ASCII characters (0x00 to 0x7f) use the US
|
||||
case mapping, the current locale is not effective.
|
||||
This probably only matters for Turkish.
|
||||
@ -1267,13 +1258,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
file to convert from. You will have to save the text in a file first.
|
||||
The expression must return zero or an empty string for success,
|
||||
non-zero for failure.
|
||||
The possible encoding names encountered are in 'encoding'.
|
||||
See |encoding-names| for possible encoding names.
|
||||
Additionally, names given in 'fileencodings' and 'fileencoding' are
|
||||
used.
|
||||
Conversion between "latin1", "unicode", "ucs-2", "ucs-4" and "utf-8"
|
||||
is done internally by Vim, 'charconvert' is not used for this.
|
||||
'charconvert' is also used to convert the shada file, if 'encoding' is
|
||||
not "utf-8". Also used for Unicode conversion.
|
||||
Also used for Unicode conversion.
|
||||
Example: >
|
||||
set charconvert=CharConvert()
|
||||
fun CharConvert()
|
||||
@ -1288,8 +1278,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
v:fname_in name of the input file
|
||||
v:fname_out name of the output file
|
||||
Note that v:fname_in and v:fname_out will never be the same.
|
||||
Note that v:charconvert_from and v:charconvert_to may be different
|
||||
from 'encoding'. Vim internally uses UTF-8 instead of UCS-2 or UCS-4.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
@ -1349,7 +1337,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 +1347,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,
|
||||
@ -1446,9 +1434,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
comment text. Currently only used to add markers for folding, see
|
||||
|fold-marker|.
|
||||
|
||||
*'compatible'* *'cp'* *'nocompatible'* *'nocp'*
|
||||
'compatible' 'cp' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'complete'* *'cpt'* *E535*
|
||||
'complete' 'cpt' string (default: ".,w,b,u,t")
|
||||
local to buffer
|
||||
@ -1456,7 +1441,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
when CTRL-P or CTRL-N are used. It is also used for whole-line
|
||||
completion |i_CTRL-X_CTRL-L|. It indicates the type of completion
|
||||
and the places to scan. It is a comma separated list of flags:
|
||||
. scan the current buffer ( 'wrapscan' is ignored)
|
||||
. scan the current buffer ('wrapscan' is ignored)
|
||||
w scan buffers from other windows
|
||||
b scan other loaded buffers that are in the buffer list
|
||||
u scan the unloaded buffers that are in the buffer list
|
||||
@ -1598,7 +1583,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
|
||||
@ -1845,9 +1830,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
the cursor would skip over it and jump to the
|
||||
following occurrence.
|
||||
|
||||
*'cryptmethod'* *'cm'*
|
||||
'cryptmethod' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'cscopepathcomp'* *'cspc'*
|
||||
'cscopepathcomp' 'cspc' number (default 0)
|
||||
global
|
||||
@ -2113,11 +2095,17 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Change the way text is displayed. This is comma separated list of
|
||||
flags:
|
||||
lastline When included, as much as possible of the last line
|
||||
in a window will be displayed. When not included, a
|
||||
last line that doesn't fit is replaced with "@" lines.
|
||||
in a window will be displayed. "@@@" is put in the
|
||||
last columns of the last screen line to indicate the
|
||||
rest of the line is not displayed.
|
||||
truncate Like "lastline", but "@@@" is displayed in the first
|
||||
column of the last screen line. Overrules "lastline".
|
||||
uhex Show unprintable characters hexadecimal as <xx>
|
||||
instead of using ^C and ~C.
|
||||
|
||||
When neither "lastline" or "truncate" is included, a last line that
|
||||
doesn't fit is replaced with "@" lines.
|
||||
|
||||
*'eadirection'* *'ead'*
|
||||
'eadirection' 'ead' string (default "both")
|
||||
global
|
||||
@ -2126,48 +2114,24 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
hor horizontally, height of windows is not affected
|
||||
both width and height of windows is affected
|
||||
|
||||
*'ed'* *'edcompatible'* *'noed'* *'noedcompatible'*
|
||||
'edcompatible' 'ed' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'encoding'* *'enc'* *E543*
|
||||
'encoding' 'enc' string (default: "utf-8")
|
||||
*'emoji'* *'emo'*
|
||||
'emoji' 'emo' boolean (default: on)
|
||||
global
|
||||
{not in Vi}
|
||||
{only available when compiled with the |+multi_byte|
|
||||
feature}
|
||||
Sets the character encoding used inside Vim. It applies to text in
|
||||
the buffers, registers, Strings in expressions, text stored in the
|
||||
shada file, etc. It sets the kind of characters which Vim can work
|
||||
with. See |encoding-names| for the possible values.
|
||||
When on all Unicode emoji characters are considered to be full width.
|
||||
|
||||
'encoding' cannot be changed after startup, because (1) it causes
|
||||
non-ASCII text inside Vim to become invalid, and (2) it complicates
|
||||
runtime logic. The recommended 'encoding' is "utf-8". Remote plugins
|
||||
and GUIs only support utf-8. See |multibyte|.
|
||||
|
||||
The character encoding of files can be different from 'encoding'.
|
||||
*'encoding'* *'enc'* *E543*
|
||||
'encoding' 'enc' Removed. |vim-differences| {Nvim}
|
||||
Nvim always uses UTF-8 internally. RPC communication
|
||||
(remote plugins/GUIs) must use UTF-8 strings.
|
||||
|
||||
The character encoding of files can be different than UTF-8.
|
||||
This is specified with 'fileencoding'. The conversion is done with
|
||||
iconv() or as specified with 'charconvert'.
|
||||
|
||||
If you need to know whether 'encoding' is a multi-byte encoding, you
|
||||
can use: >
|
||||
if has("multi_byte_encoding")
|
||||
<
|
||||
When you set this option, it fires the |EncodingChanged| autocommand
|
||||
event so that you can set up fonts if necessary.
|
||||
|
||||
When the option is set, the value is converted to lowercase. Thus
|
||||
you can set it with uppercase values too. Underscores are translated
|
||||
to '-' signs.
|
||||
When the encoding is recognized, it is changed to the standard name.
|
||||
For example "Latin-1" becomes "latin1", "ISO_88592" becomes
|
||||
"iso-8859-2" and "utf8" becomes "utf-8".
|
||||
|
||||
When "unicode", "ucs-2" or "ucs-4" is used, Vim internally uses utf-8.
|
||||
You don't notice this while editing, but it does matter for the
|
||||
|shada-file|. And Vim expects the terminal to use utf-8 too. Thus
|
||||
setting 'encoding' to one of these values instead of utf-8 only has
|
||||
effect for encoding used for files when 'fileencoding' is empty.
|
||||
|
||||
*'endofline'* *'eol'* *'noendofline'* *'noeol'*
|
||||
'endofline' 'eol' boolean (default on)
|
||||
local to buffer
|
||||
@ -2273,6 +2237,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)
|
||||
@ -2292,20 +2258,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
feature}
|
||||
Sets the character encoding for the file of this buffer.
|
||||
|
||||
When 'fileencoding' is different from 'encoding', conversion will be
|
||||
When 'fileencoding' is different from "utf-8", conversion will be
|
||||
done when writing the file. For reading see below.
|
||||
When 'fileencoding' is empty, the same value as 'encoding' will be
|
||||
used (no conversion when reading or writing a file).
|
||||
Conversion will also be done when 'encoding' and 'fileencoding' are
|
||||
both a Unicode encoding and 'fileencoding' is not utf-8. That's
|
||||
because internally Unicode is always stored as utf-8.
|
||||
WARNING: Conversion can cause loss of information! When
|
||||
'encoding' is "utf-8" or another Unicode encoding, conversion
|
||||
is most likely done in a way that the reverse conversion
|
||||
results in the same text. When 'encoding' is not "utf-8" some
|
||||
characters may be lost!
|
||||
When 'fileencoding' is empty, the file will be saved with utf-8
|
||||
encoding. (no conversion when reading or writing a file).
|
||||
WARNING: Conversion to a non-Unicode encoding can cause loss of
|
||||
information!
|
||||
|
||||
See 'encoding' for the possible values. Additionally, values may be
|
||||
See |encoding-names| for the possible values. Additionally, values may be
|
||||
specified that can be handled by the converter, see
|
||||
|mbyte-conversion|.
|
||||
|
||||
@ -2318,8 +2278,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Prepending "8bit-" and "2byte-" has no meaning here, they are ignored.
|
||||
When the option is set, the value is converted to lowercase. Thus
|
||||
you can set it with uppercase values too. '_' characters are
|
||||
replaced with '-'. If a name is recognized from the list for
|
||||
'encoding', it is replaced by the standard name. For example
|
||||
replaced with '-'. If a name is recognized from the list at
|
||||
|encoding-names|, it is replaced by the standard name. For example
|
||||
"ISO8859-2" becomes "iso-8859-2".
|
||||
|
||||
When this option is set, after starting to edit a file, the 'modified'
|
||||
@ -2332,11 +2292,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
This option can not be changed when 'modifiable' is off.
|
||||
|
||||
*'fe'*
|
||||
NOTE: Before version 6.0 this option specified the encoding for the
|
||||
whole of Vim, this was a mistake. Now use 'encoding' instead. The
|
||||
old short name was 'fe', which is no longer used.
|
||||
|
||||
*'fileencodings'* *'fencs'*
|
||||
'fileencodings' 'fencs' string (default: "ucs-bom,utf-8,default,latin1")
|
||||
global
|
||||
@ -2347,12 +2302,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
mentioned character encoding. If an error is detected, the next one
|
||||
in the list is tried. When an encoding is found that works,
|
||||
'fileencoding' is set to it. If all fail, 'fileencoding' is set to
|
||||
an empty string, which means the value of 'encoding' is used.
|
||||
WARNING: Conversion can cause loss of information! When
|
||||
'encoding' is "utf-8" (or one of the other Unicode variants)
|
||||
conversion is most likely done in a way that the reverse
|
||||
conversion results in the same text. When 'encoding' is not
|
||||
"utf-8" some non-ASCII characters may be lost! You can use
|
||||
an empty string, which means that UTF-8 is used.
|
||||
WARNING: Conversion can cause loss of information! You can use
|
||||
the |++bad| argument to specify what is done with characters
|
||||
that can't be converted.
|
||||
For an empty file or a file with only ASCII characters most encodings
|
||||
@ -2378,11 +2329,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
because Vim cannot detect an error, thus the encoding is always
|
||||
accepted.
|
||||
The special value "default" can be used for the encoding from the
|
||||
environment. It is useful when 'encoding' is set to "utf-8" and
|
||||
your environment uses a non-latin1 encoding, such as Russian.
|
||||
When 'encoding' is "utf-8" and a file contains an illegal byte
|
||||
sequence it won't be recognized as UTF-8. You can use the |8g8|
|
||||
command to find the illegal byte sequence.
|
||||
environment. It is useful when your environment uses a non-latin1
|
||||
encoding, such as Russian.
|
||||
When a file contains an illegal UTF-8 byte sequence it won't be
|
||||
recognized as "utf-8". You can use the |8g8| command to find the
|
||||
illegal byte sequence.
|
||||
WRONG VALUES: WHAT'S WRONG:
|
||||
latin1,utf-8 "latin1" will always be used
|
||||
utf-8,ucs-bom,latin1 BOM won't be recognized in an utf-8
|
||||
@ -2453,8 +2404,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 +2460,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.
|
||||
|
||||
@ -3041,8 +2992,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Note: The size of these fonts must be exactly twice as wide as the one
|
||||
specified with 'guifont' and the same height.
|
||||
|
||||
'guifontwide' is only used when 'encoding' is set to "utf-8" and
|
||||
'guifontset' is empty or invalid.
|
||||
'guifontwide' is only used when 'guifontset' is empty or invalid.
|
||||
When 'guifont' is set and a valid font is found in it and
|
||||
'guifontwide' is empty Vim will attempt to find a matching
|
||||
double-width font and set 'guifontwide' to it.
|
||||
@ -3091,7 +3041,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The same applies to the modeless selection.
|
||||
*'go-P'*
|
||||
'P' Like autoselect but using the "+ register instead of the "*
|
||||
register.
|
||||
register.
|
||||
*'go-A'*
|
||||
'A' Autoselect for the modeless selection. Like 'a', but only
|
||||
applies to the modeless selection.
|
||||
@ -3159,9 +3109,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
removing it after the GUI has started has no effect.
|
||||
|
||||
|
||||
*'guipty'* *'noguipty'*
|
||||
'guipty' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'guitablabel'* *'gtl'*
|
||||
'guitablabel' 'gtl' string (default empty)
|
||||
global
|
||||
@ -3322,8 +3269,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,16 +3349,10 @@ 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|.
|
||||
|
||||
*'imactivatefunc'* *'imaf'*
|
||||
'imactivatefunc' 'imaf' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'imactivatekey'* *'imak'*
|
||||
'imactivatekey' 'imak' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'imcmdline'* *'imc'* *'noimcmdline'* *'noimc'*
|
||||
'imcmdline' 'imc' boolean (default off)
|
||||
global
|
||||
@ -3470,8 +3409,17 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The value is set to 1 when it is not -1 and setting the 'keymap'
|
||||
option to a valid keymap name.
|
||||
|
||||
*'imstatusfunc'* *'imsf'*
|
||||
'imstatusfunc' 'imsf' Removed. |vim-differences| {Nvim}
|
||||
*'inccommand'* *'icm'*
|
||||
'inccommand' 'icm' string (default "")
|
||||
global
|
||||
|
||||
"nosplit": Shows the effects of a command incrementally, as you type.
|
||||
"split" : Also shows partial off-screen results in a preview window.
|
||||
|
||||
Works for |:substitute|, |:smagic|, |:snomagic|. |hl-Substitute|
|
||||
|
||||
If the preview is too slow (exceeds 'redrawtime') then 'inccommand' is
|
||||
automatically disabled until |Command-line-mode| is done.
|
||||
|
||||
*'include'* *'inc'*
|
||||
'include' 'inc' string (default "^\s*#\s*include")
|
||||
@ -3690,6 +3638,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")
|
||||
@ -3707,7 +3657,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
128 - 159 "~@" - "~_"
|
||||
160 - 254 "| " - "|~"
|
||||
255 "~?"
|
||||
When 'encoding' is a Unicode one, illegal bytes from 128 to 255 are
|
||||
Illegal bytes from 128 to 255 (invalid UTF-8) are
|
||||
displayed as <xx>, with the hexadecimal value of the byte.
|
||||
When 'display' contains "uhex" all unprintable characters are
|
||||
displayed as <xx>.
|
||||
@ -3727,9 +3677,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Insert two spaces after a '.', '?' and '!' with a join command.
|
||||
Otherwise only one space is inserted.
|
||||
|
||||
*'key'*
|
||||
'key' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'keymap'* *'kmp'* *E544*
|
||||
'keymap' 'kmp' string (default "")
|
||||
local to buffer
|
||||
@ -3779,7 +3726,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.
|
||||
@ -3954,6 +3901,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
Strings to use in 'list' mode and for the |:list| command. It is a
|
||||
comma separated list of string settings.
|
||||
|
||||
*lcs-eol*
|
||||
eol:c Character to show at the end of each line. When
|
||||
omitted, there is no extra character at the end of the
|
||||
@ -3988,8 +3936,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
omitted.
|
||||
|
||||
The characters ':' and ',' should not be used. UTF-8 characters can
|
||||
be used when 'encoding' is "utf-8", otherwise only printable
|
||||
characters are allowed. All characters must be single width.
|
||||
be used. All characters must be single width.
|
||||
|
||||
Examples: >
|
||||
:set lcs=tab:>-,trail:-
|
||||
@ -4008,9 +3955,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Note that using the "-u NONE" and "--noplugin" command line arguments
|
||||
reset this option. |-u| |--noplugin|
|
||||
|
||||
*'macatsui'* *'nomacatsui'*
|
||||
'macatsui' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'magic'* *'nomagic'*
|
||||
'magic' boolean (default on)
|
||||
global
|
||||
@ -4089,7 +4033,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{only available when compiled with the |+multi_byte|
|
||||
feature}
|
||||
The maximum number of combining characters supported for displaying.
|
||||
Only used when 'encoding' is "utf-8".
|
||||
The default is OK for most languages. Hebrew may require 4.
|
||||
Maximum value is 6.
|
||||
Even when this option is set to 2 you can still edit text with more
|
||||
@ -4146,8 +4089,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 +4176,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 +4337,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")
|
||||
@ -4402,7 +4348,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
respectively; see |CTRL-A| for more info on these commands.
|
||||
alpha If included, single alphabetical characters will be
|
||||
incremented or decremented. This is useful for a list with a
|
||||
letter index a), b), etc. *octal-nrformats*
|
||||
letter index a), b), etc. *octal-nrformats*
|
||||
octal If included, numbers that start with a zero will be considered
|
||||
to be octal. Example: Using CTRL-A on "007" results in "010".
|
||||
hex If included, numbers starting with "0x" or "0X" will be
|
||||
@ -4432,7 +4378,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
relative to the cursor. Together with 'number' there are these
|
||||
four combinations (cursor in line 3):
|
||||
|
||||
'nonu' 'nu' 'nonu' 'nu'
|
||||
'nonu' 'nu' 'nonu' 'nu'
|
||||
'nornu' 'nornu' 'rnu' 'rnu'
|
||||
|
||||
|apple | 1 apple | 2 apple | 2 apple
|
||||
@ -4491,6 +4437,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 +4469,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
|
||||
@ -4782,8 +4736,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
{only available when compiled with the |+reltime|
|
||||
feature}
|
||||
The time in milliseconds for redrawing the display. This applies to
|
||||
searching for patterns for 'hlsearch' and |:match| highlighting.
|
||||
Time in milliseconds for redrawing the display. Applies to
|
||||
'hlsearch', 'inccommand' and |:match| highlighting.
|
||||
When redrawing takes more than this many milliseconds no further
|
||||
matches will be highlighted. This is used to avoid that Vim hangs
|
||||
when using a very complicated pattern.
|
||||
@ -4843,16 +4797,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
For the ":substitute" command the number of substitutions is used
|
||||
instead of the number of lines.
|
||||
|
||||
*'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
|
||||
'restorescreen' 'rs' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'revins'* *'ri'* *'norevins'* *'nori'*
|
||||
'revins' 'ri' boolean (default off)
|
||||
global
|
||||
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 +4853,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 +4877,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 +4885,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,
|
||||
@ -4951,6 +4904,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
keymap/ key mapping files |mbyte-keymap|
|
||||
lang/ menu translations |:menutrans|
|
||||
menu.vim GUI menus |menu.vim|
|
||||
pack/ packages |:packadd|
|
||||
plugin/ plugin scripts |write-plugin|
|
||||
print/ files for printing |postscript-print-encoding|
|
||||
spell/ spell checking files |spell|
|
||||
@ -4977,6 +4931,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
ordering. This is for preferences to overrule or add to the
|
||||
distributed defaults or system-wide settings (rarely needed).
|
||||
|
||||
More entries are added when using |packages|.
|
||||
|
||||
Note that, unlike 'path', no wildcards like "**" are allowed. Normal
|
||||
wildcards are allowed, but can significantly slow down searching for
|
||||
runtime files. For speed, use as few items as possible and avoid
|
||||
@ -5453,6 +5409,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The |FilterReadPre|, |FilterReadPost| and |FilterWritePre|,
|
||||
|FilterWritePost| autocommands event are not triggered when
|
||||
'shelltemp' is off.
|
||||
The `system()` function does not respect this option and always uses
|
||||
temp files.
|
||||
|
||||
*'shellxescape'* *'sxe'*
|
||||
'shellxescape' 'sxe' string (default: "";
|
||||
@ -5551,9 +5509,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
shm=a Abbreviation, but no loss of information.
|
||||
shm=at Abbreviation, and truncate message when necessary.
|
||||
|
||||
*'shortname'* *'sn'* *'noshortname'* *'nosn'*
|
||||
'shortname' 'sn' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'showbreak'* *'sbr'* *E595*
|
||||
'showbreak' 'sbr' string (default "")
|
||||
global
|
||||
@ -5609,7 +5564,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 +5665,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 +5681,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 +5695,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 +5768,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.
|
||||
@ -5817,9 +5779,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
(_xx is an underscore, two letters and followed by a non-letter).
|
||||
This is mainly for testing purposes. You must make sure the correct
|
||||
encoding is used, Vim doesn't check it.
|
||||
When 'encoding' is set the word lists are reloaded. Thus it's a good
|
||||
idea to set 'spelllang' after setting 'encoding' to avoid loading the
|
||||
files twice.
|
||||
How the related spell files are found is explained here: |spell-load|.
|
||||
|
||||
If the |spellfile.vim| plugin is active and you use a language name
|
||||
@ -5935,7 +5894,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 +6007,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 +6029,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
|
||||
@ -6159,9 +6119,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
This option is used together with 'bufhidden' and 'buftype' to
|
||||
specify special kinds of buffers. See |special-buffers|.
|
||||
|
||||
*'swapsync'* *'sws'*
|
||||
'swapsync' 'sws' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'switchbuf'* *'swb'*
|
||||
'switchbuf' 'swb' string (default "")
|
||||
global
|
||||
@ -6305,19 +6262,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 +6288,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
|
||||
@ -6372,9 +6342,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Resetting this option is useful when using a ":tag" command in a
|
||||
mapping which should not change the tagstack.
|
||||
|
||||
*'term'* *E529* *E530* *E531*
|
||||
'term' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'termbidi'* *'tbidi'*
|
||||
*'notermbidi'* *'notbidi'*
|
||||
'termbidi' 'tbidi' boolean (default off)
|
||||
@ -6388,8 +6355,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'arabicshape' is ignored, but 'rightleft' isn't changed automatically.
|
||||
For further details see |arabic.txt|.
|
||||
|
||||
*'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)
|
||||
@ -6404,8 +6376,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 +6392,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
|
||||
@ -6534,28 +6509,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
to be garbled (e.g., when it contains a CR or NL character).
|
||||
{not available when compiled without the |+statusline| feature}
|
||||
|
||||
*'toolbar'* *'tb'*
|
||||
'toolbar' 'tb' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'toolbariconsize'* *'tbis'*
|
||||
'toolbariconsize' 'tbis' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'*
|
||||
'ttybuiltin' 'tbi' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'ttyfast'* *'tf'* *'nottyfast'* *'notf'*
|
||||
'ttyfast' 'tf' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'ttymouse'* *'ttym'*
|
||||
'ttymouse' 'ttym' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'ttyscroll'* *'tsl'*
|
||||
'ttyscroll' 'tsl' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'ttytype'* *'tty'*
|
||||
'ttytype' 'tty' Alias for 'term'. Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'undodir'* *'udir'* *E926*
|
||||
*'undodir'* *'udir'* *E5003*
|
||||
'undodir' 'udir' string (default "$XDG_DATA_HOME/nvim/undo")
|
||||
global
|
||||
{only when compiled with the |+persistent_undo| feature}
|
||||
@ -6709,12 +6666,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
with Unix. The Unix version of Vim cannot source dos format scripts,
|
||||
but the Windows version of Vim can source unix format scripts.
|
||||
|
||||
*'viminfo'* *'vi'*
|
||||
'viminfo' 'vi' string
|
||||
global
|
||||
Deprecated alias for 'shada' option. Is kept for compatibility
|
||||
reasons.
|
||||
|
||||
*'virtualedit'* *'ve'*
|
||||
'virtualedit' 've' string (default "")
|
||||
global
|
||||
@ -6760,9 +6711,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Give a warning message when a shell command is used while the buffer
|
||||
has been changed.
|
||||
|
||||
*'weirdinvert'* *'wiv'* *'noweirdinvert'* *'nowiv'*
|
||||
'weirdinvert' 'wiv' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'whichwrap'* *'ww'*
|
||||
'whichwrap' 'ww' string (Vim default: "b,s", Vi default: "")
|
||||
global
|
||||
|
@ -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 26
|
||||
|
||||
|
||||
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"
|
||||
@ -1067,8 +1071,8 @@ x A single character, with no special meaning, matches itself
|
||||
belonging to that character class. The following character classes
|
||||
are supported:
|
||||
Name Contents ~
|
||||
*[:alnum:]* [:alnum:] letters and digits
|
||||
*[:alpha:]* [:alpha:] letters
|
||||
*[:alnum:]* [:alnum:] ASCII letters and digits
|
||||
*[:alpha:]* [:alpha:] ASCII letters
|
||||
*[:blank:]* [:blank:] space and tab characters
|
||||
*[:cntrl:]* [:cntrl:] control characters
|
||||
*[:digit:]* [:digit:] decimal digits
|
||||
@ -1076,7 +1080,7 @@ x A single character, with no special meaning, matches itself
|
||||
*[:lower:]* [:lower:] lowercase letters (all letters when
|
||||
'ignorecase' is used)
|
||||
*[:print:]* [:print:] printable characters including space
|
||||
*[:punct:]* [:punct:] punctuation characters
|
||||
*[:punct:]* [:punct:] ASCII punctuation characters
|
||||
*[:space:]* [:space:] whitespace characters
|
||||
*[:upper:]* [:upper:] uppercase letters (all letters when
|
||||
'ignorecase' is used)
|
||||
@ -1090,7 +1094,11 @@ 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. For now, to get all "alpha"
|
||||
characters you can use: [[:lower:][:upper:]].
|
||||
*/[[=* *[==]*
|
||||
- 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)
|
||||
@ -1062,9 +1070,10 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
|
||||
< <F1> Causes Netrw to issue help
|
||||
<cr> Netrw will enter the directory or read the file |netrw-cr|
|
||||
<del> Netrw will attempt to remove the file/directory |netrw-del|
|
||||
<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-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 >
|
||||
@ -1174,10 +1193,10 @@ Addtionally, one may use :NetrwMB to bookmark files or directories. >
|
||||
< No bang: enters files/directories into Netrw's bookmark system
|
||||
|
||||
No argument and in netrw buffer:
|
||||
if there are marked files: bookmark marked files
|
||||
otherwise : bookmark file/directory under cursor
|
||||
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,11 +1254,21 @@ 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*
|
||||
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.
|
||||
|
||||
*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|
|
||||
@ -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.
|
||||
The [N] specifies a |g:netrw_winsize| just for the new :Lexplore
|
||||
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
|
||||
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
|
||||
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,
|
||||
|
145
runtime/doc/provider.txt
Normal file
145
runtime/doc/provider.txt
Normal file
@ -0,0 +1,145 @@
|
||||
*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, you might already have the
|
||||
required `neovim` Python package. Run |:CheckHealth| to see if your system is
|
||||
up-to-date.
|
||||
|
||||
Following are steps to install the package with Python's `pip` tool.
|
||||
|
||||
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
|
||||
|
||||
|
||||
==============================================================================
|
||||
Ruby integration *provider-ruby*
|
||||
|
||||
Nvim supports the Vim legacy |ruby-vim| interface via external Ruby
|
||||
interpreters connected via |RPC|.
|
||||
|
||||
Run |:CheckHealth| to see if your system is up-to-date.
|
||||
|
||||
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 Jul 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -49,6 +49,14 @@ 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.
|
||||
|
||||
*E925* *E926*
|
||||
If the current quickfix or location list was changed by an |autocommand| while
|
||||
processing a quickfix or 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
|
||||
@ -255,9 +263,23 @@ command with 'l'.
|
||||
The 'switchbuf' settings are respected when jumping
|
||||
to a buffer.
|
||||
|
||||
:cl[ist] +{count} List the current and next {count} valid errors. This
|
||||
is similar to ":clist from from+count", where "from"
|
||||
is the current error position.
|
||||
|
||||
:cl[ist]! [from] [, [to]]
|
||||
List all errors.
|
||||
|
||||
:cl[ist]! +{count} List the current and next {count} error lines. This
|
||||
is useful to see unrecognized lines after the current
|
||||
one. For example, if ":clist" shows:
|
||||
8384 testje.java:252: error: cannot find symbol ~
|
||||
Then using ":cl! +3" shows the reason:
|
||||
8384 testje.java:252: error: cannot find symbol ~
|
||||
8385: ZexitCode = Fmainx(); ~
|
||||
8386: ^ ~
|
||||
8387: symbol: method Fmainx() ~
|
||||
|
||||
*:lli* *:llist*
|
||||
:lli[st] [from] [, [to]]
|
||||
Same as ":clist", except the location list for the
|
||||
@ -302,16 +324,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 execution 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 +351,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 +364,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 +378,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*
|
||||
@ -1515,12 +1511,6 @@ However, to properly parse such a complex file, an external filter should
|
||||
be used. See the description further above how to make such a filter known
|
||||
by Vim.
|
||||
|
||||
*errorformat-Perl*
|
||||
In $VIMRUNTIME/tools you can find the efm_perl.pl script, which filters Perl
|
||||
error messages into a format that quickfix mode will understand. See the
|
||||
start of the file about how to use it. (This script is deprecated, see
|
||||
|compiler-perl|.)
|
||||
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
@ -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
|
||||
|
@ -1,275 +0,0 @@
|
||||
*quotes.txt* For Vim version 7.4. Last change: 2010 Nov 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
*quotes*
|
||||
Here are some nice quotes about Vim that I collected from news and mail.
|
||||
|
||||
|
||||
vim (vim) noun - Ebullient vitality and energy. [Latin, accusative of vis,
|
||||
strength] (Dictionary)
|
||||
|
||||
Vim is so much better than vi that a great many of my old vi :map's became
|
||||
immediately obsolete! (Tony Nugent, Australia)
|
||||
|
||||
Coming with a very GUI mindset from Windows, I always thought of people using
|
||||
Vi as some kind of outer space alien in human clothes. Once I tried I really
|
||||
got addicted by its power and now I found myself typing Vim keypresses in the
|
||||
oddest places! That's why I would like to see Vim embedded in every
|
||||
application which deals with text editing. (Jos<6F> Fonseca)
|
||||
|
||||
I was a 12-year emacs user who switched to Vim about a year ago after finally
|
||||
giving up on the multiple incompatible versions, flaky contributed packages,
|
||||
disorganized keystrokes, etc. And it was one of the best moves I ever made.
|
||||
(Joel Burton)
|
||||
|
||||
Although all of the programs were used during the preparation of the new and
|
||||
revised material, most of the editing was done with Vim versions 4.5 and 5.0
|
||||
under GNU-Linux (Redhat 4.2). (Arnold Robbins, Israel, author of "Learning
|
||||
the Vi editor")
|
||||
|
||||
Out of all the open software i've ever seen and used, and i've seen a lot, Vim
|
||||
is the best, most useful and highest quality to work with, second only to the
|
||||
linux kernel itself. (Peter Jay Salzman)
|
||||
|
||||
It's well worth noting that the _entirety_ of SourceForge was written using
|
||||
Vim and its nifty PHP syntax highlighting. I think the entire SF.net tech
|
||||
staff uses Vim and we're all excited to have you aboard! (Tim Perdue)
|
||||
|
||||
Vim is one of a select bunch of tools for which I have no substitute. It is
|
||||
a brilliant piece of work! (Biju Chacko)
|
||||
|
||||
A previous girlfriend of mine switched to emacs. Needless to say, the
|
||||
relationship went nowhere. (Geoffrey Mann)
|
||||
|
||||
I rarely think about Vim, in the same way that I guess a fish rarely thinks
|
||||
about water. It's the environment in which everything else happens. I'm a
|
||||
fairly busy system administrator working on a lot of different platforms. Vim
|
||||
is the only thing that's consistent across all my systems, and it's just about
|
||||
the only thing that doesn't break from time to time. When a new system comes
|
||||
in the door without Vim, I install it right away. Great to have a tool that's
|
||||
the same everywhere, that's completely reliable, so I can ignore it and think
|
||||
about other things. (Pete Schaeffer)
|
||||
|
||||
Having recently succeeded in running Vim via telnet through a Nokia
|
||||
Communicator, I can now report that it works nicely on a Palm Pilot too.
|
||||
(Allan Kelly, Scotland)
|
||||
|
||||
You've done a tremendous job with 'VIM', Bram! The more I use it, the more
|
||||
impressed I get (I am an old 'vi' die hard who once started out with early
|
||||
versions of 'emacs' in the late 1970's and was relieved by finding 'vi' in the
|
||||
first UNIX I came across in 1983). In my opinion, it's about time 'VIM'
|
||||
replace 'emacs' as the standard for top editors. (Bo Thide', Sweden)
|
||||
|
||||
I love and use VIM heavily too. (Larry Wall)
|
||||
|
||||
Vi is like a Ferrari, if you're a beginner, it handles like a bitch, but once
|
||||
you get the hang of it, it's small, powerful and FAST! (Unknown)
|
||||
VIM is like a new model Ferrari, and sounds like one too - "VIIIIIIMMM!"
|
||||
(Stephen Riehm, Germany)
|
||||
|
||||
Schon bei Nutzung eines Bruchteils der VIM-Funktionen wird der Benutzer recht
|
||||
schnell die Vorzuege dieses Editors kennen- und schaetzenlernen.
|
||||
Translated: Even when only using a fraction of VIM-functions, the user will
|
||||
quickly get used to and appreciate the advantages of this editor. (Garry
|
||||
Glendown, conclusion of an article on VIM in iX magazine 9/1998)
|
||||
|
||||
I've recently acquired the O'Reilly book on VI (it also discusses VIM
|
||||
in-depth), and I'm amazed at just how powerful this application is. (Jeffrey
|
||||
Rankin)
|
||||
|
||||
This guide was written using the Windows 9.x distribution of GVIM, which is
|
||||
quite possibly the greatest thing to come along since God created the naked
|
||||
girl. (Michael DiBernardo)
|
||||
|
||||
Boy, I thought I knew almost everything about VIM, but every time I browse the
|
||||
online documentation, I hit upon a minor but cool aspect of a VIM feature that
|
||||
I didn't know before! I must say the documentation is one the finest I've
|
||||
ever seen in a product -- even better than most commercial products.
|
||||
(Gautam Mudunuri)
|
||||
|
||||
VIM 4.5 is really a fantastic editor. It has sooooo many features and more
|
||||
importantly, the defaults are so well thought out that you really don't have
|
||||
to change anything!! Words cannot express my amazement and gratitude to the
|
||||
creators of VIM. Keep it up. (Vikas, USA)
|
||||
|
||||
I wonder how long it will be before people will refer to other Vi editors as
|
||||
VIM clones? (Darren Hiebert)
|
||||
|
||||
I read about [auto-positioning-in-file-based-on-the-errors-from-make] in one
|
||||
of those "Perfect Programmer's Editor" threads and was delighted to discover
|
||||
that VIM already supports it. (Brendan Macmillan, Australia)
|
||||
|
||||
I just discovered VIM (5.0) and I'm telling everyone I know about it!
|
||||
I tell them VIM stands for VI for the new (M)illenium. Thanks so much!
|
||||
(Matt F. Valentine)
|
||||
|
||||
I think from now on "vi" should be called "Vim Imitation", not the other way
|
||||
around. (Rungun Ramanathan)
|
||||
|
||||
The Law of VIM:
|
||||
For each member b of the possible behaviour space B of program P, there exists
|
||||
a finite time t before which at least one user u in the total user space U of
|
||||
program P will request b becomes a member of the allowed behaviour space B'
|
||||
(B' <= B).
|
||||
In other words: Sooner or later everyone wants everything as an option.
|
||||
(Negri)
|
||||
|
||||
Whenever I move to a new computing platform, the first thing I do is to port
|
||||
VIM. Lately, I am simply stunned by its ease of compilation using the
|
||||
configure facility. (A.M. Sabuncu, Turkey)
|
||||
|
||||
The options are really excellent and very powerful. (Anish Maharaj)
|
||||
|
||||
The Spring user-interface designs are in, and word from the boutiques is that
|
||||
80x24 text-only mode is back with a *vengeance! Vi editor clone VIM burst onto
|
||||
March desk-tops with a dazzling show of pastel syntax highlights for its 5.0
|
||||
look. Strident and customizable, VIM raises eyebrows with its interpretation
|
||||
of the classic Vi single-key macro collection.
|
||||
http://www.ntk.net/index.cgi?back=archive98/now0327.txt&line=179#l
|
||||
|
||||
I just wanted to take this opportunity to let you know that VIM 5 ROCKS!
|
||||
Syntax highlighting: how did I survive without it?! Thank you for creating
|
||||
mankind's best editor! (Mun Johl, USA)
|
||||
|
||||
Thanks again for VIM. I use it every day on Linux. (Eric Foster-Johnson,
|
||||
author of the book "UNIX Programming Tools")
|
||||
|
||||
The BEST EDITOR EVER (Stuart Woolford)
|
||||
|
||||
I have used most of VIM's fancy features at least once, many frequently, and I
|
||||
can honestly say that I couldn't live with anything less anymore. My
|
||||
productivity has easily doubled compared to what it was when I used vi.
|
||||
(Sitaram Chamarty)
|
||||
|
||||
I luv VIM. It is incredible. I'm naming my first-born Vimberly. (Jose
|
||||
Unpingco, USA)
|
||||
|
||||
Hint: "VIM" is "vi improved" - much better! (Sven Guckes, Germany)
|
||||
|
||||
I use VIM every day. I spend more time in VIM than in any other program...
|
||||
It's the best vi clone there is. I think it's great. (Craig Sanders,
|
||||
Australia)
|
||||
|
||||
I strongly advise using VIM--its infinite undo/redo saved me much grief.
|
||||
(Terry Brown)
|
||||
|
||||
Thanks very much for writing what in my opinion is the finest text editor on
|
||||
the planet. If I were to get another cat, I would name it "Vim".
|
||||
(Bob Sheehan, USA)
|
||||
|
||||
I typed :set all and the screen FILLED up with options. A whole screen of
|
||||
things to be set and unset. I saw some of my old friends like wrapmargin,
|
||||
modelines and showmode, but the screen was FILLED with new friends! I love
|
||||
them all! I love VIM! I'm so happy that I've found this editor! I feel
|
||||
like how I once felt when I started using vi after a couple of years of using
|
||||
ed. I never thought I'd forsake my beloved ed, but vi ... oh god, vi was
|
||||
great. And now, VIM. (Peter Jay Salzman, USA)
|
||||
|
||||
I am really happy with such a wonderful software package. Much better than
|
||||
almost any expensive, off the shelf program. (Jeff Walker)
|
||||
|
||||
Whenever I reread the VIM documentation I'm overcome with excitement at the
|
||||
power of the editor. (William Edward Webber, Australia)
|
||||
|
||||
Hurrah for VIM!! It is "at your fingertips" like vi, and has the extensions
|
||||
that vi sorely needs: highlighting for executing commands on blocks, an easily
|
||||
navigable and digestible help screen, and more. (Paul Pax)
|
||||
|
||||
The reason WHY I don't have this amazingly useful macro anymore, is that I
|
||||
now use VIM - and this is built in!! (Stephen Riehm, Germany)
|
||||
|
||||
I am a user of VIM and I love it. I use it to do all my programming, C,
|
||||
C++, HTML what ever. (Tim Allwine)
|
||||
|
||||
I discovered VIM after years of struggling with the original vi, and I just
|
||||
can't live without it anymore. (Emmanuel Mogenet, USA)
|
||||
|
||||
Emacs has not a bit of chance to survive so long as VIM is around. Besides,
|
||||
it also has the most detailed software documentation I have ever seen---much
|
||||
better than most commercial software! (Leiming Qian)
|
||||
|
||||
This version of VIM will just blow people apart when they discover just how
|
||||
fantastic it is! (Tony Nugent, Australia)
|
||||
|
||||
I took your advice & finally got VIM & I'm really impressed. Instant convert.
|
||||
(Patrick Killelea, USA)
|
||||
|
||||
VIM is by far my favorite piece of shareware and I have been particularly
|
||||
pleased with version 3.0. This is really a solid piece of work. (Robert
|
||||
Colon, USA)
|
||||
|
||||
VIM is a joy to use, it is so well thought and practical that I wonder why
|
||||
anybody would use visual development tools. VIM is powerful and elegant, it
|
||||
looks deceptively simple but is almost as complex as a 747 (especially when I
|
||||
look at my growing vimrc), keep up that wonderful job, VIM is a centerpiece
|
||||
of the free software world. (Louis-David Mitterand, USA)
|
||||
|
||||
I cannot believe how great it is to use VIM. I think the guys at work are
|
||||
getting tired of hearing me bragging about it. Others eyes are lighting up.
|
||||
(Rick Croote)
|
||||
|
||||
Emacs takes way too much time to start up and run, it is too big and bulky for
|
||||
effective use and the interface is more confusing than it is of any help. VIM
|
||||
however is short, it is fast, it is powerful, it has a good interface and it
|
||||
is all purpose. (Paal Ditlefsen Ekran)
|
||||
|
||||
From the first time I got VIM3.0, I was very enthusiastic. It has almost no
|
||||
problems. The swapfile handling and the backup possibilities are robust, also
|
||||
the protection against editing one file twice. It is very compatible to the
|
||||
real VI (and that is a MUST, because my brain is trained over years in using
|
||||
it). (Gert van Antwerpen, Holland)
|
||||
|
||||
Visual mode in VIM is a very powerful thing! (Tony Nugent, Australia)
|
||||
|
||||
I have to say that VIM is =THE= single greatest piece of source code to ever
|
||||
come across the net (Jim Battle, USA).
|
||||
|
||||
In fact, if you do want to get a new vi I'd suggest VIM-3.0. This is, by
|
||||
far, the best version of vi I've ever seen (Albert W. Schueller).
|
||||
|
||||
I should mention that VIM is a very good editor and can compete with anything
|
||||
(Ilya Beloozerov).
|
||||
|
||||
To tell the truth sometimes I used elvis, vile, xvi, calvin, etc. And this is
|
||||
the reason that I can state that VIM is the best! (Ferenc Deak, Hungary)
|
||||
|
||||
VIM is by far the best editor that I have used in a long time, and I have
|
||||
looked at just about every thing that is available for every platform that I
|
||||
use. VIM is the best on all of them. (Guy L. Oliver)
|
||||
|
||||
VIM is the greatest editor since the stone chisel. (Jose Unpingco, USA)
|
||||
|
||||
I would like to say that with VIM I am finally making the 'emacs to vi'
|
||||
transition - as an Editor it is so much better in many ways: keyboard layout,
|
||||
memory usage, text alteration to name 3. (Mark Adam)
|
||||
|
||||
In fact, now if I want to know what a particular setting does in vi, I fire up
|
||||
VIM and check out its help! (Nikhil Patel, USA)
|
||||
|
||||
As a vi user, VIM has made working with text a far more pleasant task than
|
||||
before I encountered this program. (Steinar Knutsen, Norway)
|
||||
|
||||
I use VIM since version 3.0. Since that time, it is the ONLY editor I use,
|
||||
with Solaris, Linux and OS/2 Warp. I suggest all my friends to use VIM, they
|
||||
try, and they continue using it. VIM is really the best software I have ever
|
||||
downloaded from the Internet, and the best editor I know of. (Marco
|
||||
Eccettuato, Italy)
|
||||
|
||||
|
||||
In summary:
|
||||
__ ___ _ _ _ ___ _____ `
|
||||
\ \ / (_)_ __ ___ (_)___ | | | |/ _ \_ _| `
|
||||
\ \ / /| | '_ ` _ \ | / __| | |_| | | | || | `
|
||||
\ V / | | | | | | | | \__ \ | _ | |_| || | `
|
||||
\_/ |_|_| |_| |_| |_|___/ |_| |_|\___/ |_| `
|
||||
____ _____ _ _ _____ _____ _ _ `
|
||||
/ ___|_ _| | | | ___| ___| | | `
|
||||
\___ \ | | | | | | |_ | |_ | | | `
|
||||
___) || | | |_| | _| | _| |_|_| `
|
||||
|____/ |_| \___/|_| |_| (_|_) (Tony Nugent, Australia) `
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
@ -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*
|
||||
@ -93,22 +93,22 @@ approach with |rpcnotify()|, meaning return values or exceptions raised in the
|
||||
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`.
|
||||
'runtimepath' directory (~/.config/nvim/rplugin/python/limit.py for example).
|
||||
Then, the remote plugin manifest must be generated with
|
||||
|: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:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user