mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
Compare commits
1221 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6d2c30daf3 | ||
![]() |
f19e5d6530 | ||
![]() |
a6de144c3e | ||
![]() |
f185c739bc | ||
![]() |
e8af34dc63 | ||
![]() |
bf3f0efb3a | ||
![]() |
d135ba99b2 | ||
![]() |
07931ed1c8 | ||
![]() |
ee031eb525 | ||
![]() |
eacd788cf5 | ||
![]() |
59b0d9f62d | ||
![]() |
f8d40e7d53 | ||
![]() |
c5f001a46a | ||
![]() |
67e4529292 | ||
![]() |
30a21830d0 | ||
![]() |
8fff2ef74a | ||
![]() |
8d8212d384 | ||
![]() |
d5b7f28b44 | ||
![]() |
a43a573ad5 | ||
![]() |
e6beb60da5 | ||
![]() |
20c672a460 | ||
![]() |
6b8c34137c | ||
![]() |
b63cde97f4 | ||
![]() |
0407ddb364 | ||
![]() |
cf75de710c | ||
![]() |
69e3308771 | ||
![]() |
881f9e42d1 | ||
![]() |
ea020f2e26 | ||
![]() |
b6a603fe51 | ||
![]() |
a2fdd0a72f | ||
![]() |
4fa0970519 | ||
![]() |
faa15c5b83 | ||
![]() |
f5d4da0144 | ||
![]() |
67a2207c4a | ||
![]() |
7e8212c459 | ||
![]() |
314ff440f7 | ||
![]() |
d0b05e3c36 | ||
![]() |
9baa7ca37f | ||
![]() |
9837a9c401 | ||
![]() |
55d8967147 | ||
![]() |
a48e078c0d | ||
![]() |
e98bcf0523 | ||
![]() |
c46d6f8da2 | ||
![]() |
c67dd5acd0 | ||
![]() |
bbf730aa31 | ||
![]() |
2ca59638ba | ||
![]() |
4175dfac9a | ||
![]() |
ea51f08276 | ||
![]() |
3a7feb6989 | ||
![]() |
10e5040b61 | ||
![]() |
4be0379602 | ||
![]() |
8c6168565c | ||
![]() |
ae569ea57b | ||
![]() |
06fd32b8ff | ||
![]() |
8c3377ee76 | ||
![]() |
1a3e54231a | ||
![]() |
39fa278216 | ||
![]() |
415927e4ed | ||
![]() |
208dee4585 | ||
![]() |
52748d266d | ||
![]() |
b9b2fb7d5d | ||
![]() |
bd17fa487d | ||
![]() |
ad527392ab | ||
![]() |
20e317e22a | ||
![]() |
b7f1885fab | ||
![]() |
85cfc4c4f9 | ||
![]() |
a39bf01958 | ||
![]() |
599170de83 | ||
![]() |
78223bc97f | ||
![]() |
60179b8a3b | ||
![]() |
49a627dbd9 | ||
![]() |
ef7af078ef | ||
![]() |
8c6a92c6e2 | ||
![]() |
0312fc2ddb | ||
![]() |
dc92901094 | ||
![]() |
7bcbf5d456 | ||
![]() |
c598c3ac77 | ||
![]() |
946c2a8ee8 | ||
![]() |
c348f84f21 | ||
![]() |
93fb7383a3 | ||
![]() |
8f03014e88 | ||
![]() |
d31b94ac20 | ||
![]() |
280943d9b9 | ||
![]() |
7e59b897c1 | ||
![]() |
7984959ef5 | ||
![]() |
fb3c21e090 | ||
![]() |
5d2af7e452 | ||
![]() |
8cb77acb44 | ||
![]() |
73fabf4f15 | ||
![]() |
842a54a1bb | ||
![]() |
04b3c32772 | ||
![]() |
54cac3033f | ||
![]() |
68bef0a57d | ||
![]() |
860ecd7055 | ||
![]() |
739bc5124a | ||
![]() |
a39c8b7ce3 | ||
![]() |
eed10f7e23 | ||
![]() |
54b79f19d7 | ||
![]() |
b67f58b284 | ||
![]() |
60b1e8ad12 | ||
![]() |
241fe704a5 | ||
![]() |
efa9152852 | ||
![]() |
cc7285823c | ||
![]() |
7890157931 | ||
![]() |
8b199cb2fe | ||
![]() |
4daf63871a | ||
![]() |
7b4baad674 | ||
![]() |
369ac900f9 | ||
![]() |
0c358725b1 | ||
![]() |
ab942b7ffb | ||
![]() |
353c81af1e | ||
![]() |
be20b20cf3 | ||
![]() |
d8bb1dabb6 | ||
![]() |
3e5ecd9538 | ||
![]() |
a4e4f2bd02 | ||
![]() |
35b867d786 | ||
![]() |
1fcd838942 | ||
![]() |
8d929f558c | ||
![]() |
1e2ae942f3 | ||
![]() |
45296b331f | ||
![]() |
6c43fccb27 | ||
![]() |
59f5eb0065 | ||
![]() |
39e83fa7cb | ||
![]() |
2a3bcd1ff8 | ||
![]() |
3a938fff09 | ||
![]() |
7b0ceb3726 | ||
![]() |
1a93f58831 | ||
![]() |
8526902790 | ||
![]() |
122f52bf89 | ||
![]() |
8c732f7274 | ||
![]() |
da13d9a30c | ||
![]() |
bcf266de46 | ||
![]() |
b8a67551d8 | ||
![]() |
1de5b041a7 | ||
![]() |
20f1bf325c | ||
![]() |
45a95a8a5b | ||
![]() |
2bd424c1c5 | ||
![]() |
aab16e6939 | ||
![]() |
f640ae0d6e | ||
![]() |
445f25998c | ||
![]() |
91d8e26bc7 | ||
![]() |
bed0a3a842 | ||
![]() |
2050e66046 | ||
![]() |
91f94bfef8 | ||
![]() |
87a723963e | ||
![]() |
f2aaa4ae8b | ||
![]() |
a68817f565 | ||
![]() |
ddfc077da4 | ||
![]() |
22402fb99d | ||
![]() |
5ad591ef2d | ||
![]() |
fb389a6b4b | ||
![]() |
461ae69824 | ||
![]() |
866dadaf75 | ||
![]() |
ab85999eb7 | ||
![]() |
e164ba41c8 | ||
![]() |
daec81ab51 | ||
![]() |
550651c130 | ||
![]() |
b7a8a76f6e | ||
![]() |
26fd70bd18 | ||
![]() |
6e90bc7200 | ||
![]() |
439c39a2cf | ||
![]() |
f0c2f82e90 | ||
![]() |
f1f7f3b512 | ||
![]() |
fdd9b1982b | ||
![]() |
e35a66d396 | ||
![]() |
42b80c3acf | ||
![]() |
a3134bc480 | ||
![]() |
e4a974c7cc | ||
![]() |
9db42d4ce9 | ||
![]() |
bead15f10d | ||
![]() |
d7594f9c33 | ||
![]() |
a3a9ef9ad4 | ||
![]() |
3ce97879d0 | ||
![]() |
7068370560 | ||
![]() |
37420ef942 | ||
![]() |
b5b8966760 | ||
![]() |
82b8382abe | ||
![]() |
6338199b76 | ||
![]() |
dfe806ea8b | ||
![]() |
dde3ece10e | ||
![]() |
0f74b7afeb | ||
![]() |
14e63271cc | ||
![]() |
4b0a086d16 | ||
![]() |
69199958b7 | ||
![]() |
295c90989d | ||
![]() |
91586d1ad4 | ||
![]() |
0cba3da26e | ||
![]() |
70b574dab3 | ||
![]() |
9467c8e16e | ||
![]() |
0f0fcce1ab | ||
![]() |
3bcee71cc8 | ||
![]() |
014bd59957 | ||
![]() |
d5d7a9928d | ||
![]() |
d214df4e9b | ||
![]() |
5baeb4a49c | ||
![]() |
2f4647e77b | ||
![]() |
a792c1f6db | ||
![]() |
56eda2aa17 | ||
![]() |
3e502fd7d6 | ||
![]() |
2ecff0814e | ||
![]() |
4b3e51d4ee | ||
![]() |
68f3da5f61 | ||
![]() |
2a5a6a0541 | ||
![]() |
c4ab110e04 | ||
![]() |
7ca1f43f68 | ||
![]() |
02c2b1d1b3 | ||
![]() |
dc513f7618 | ||
![]() |
97dc1350f0 | ||
![]() |
7d3f302ef9 | ||
![]() |
d2b0c5838a | ||
![]() |
77f1392f07 | ||
![]() |
2abd939dae | ||
![]() |
ceb40c0411 | ||
![]() |
db999821d4 | ||
![]() |
52517321d1 | ||
![]() |
04187a1c74 | ||
![]() |
1663599beb | ||
![]() |
e565fc2294 | ||
![]() |
76606b6bc5 | ||
![]() |
4b2592d7b6 | ||
![]() |
032b088c84 | ||
![]() |
d916ea107a | ||
![]() |
e3ca1e6046 | ||
![]() |
c0e45d97b0 | ||
![]() |
d1874ab282 | ||
![]() |
7a832c312f | ||
![]() |
9ad7529f70 | ||
![]() |
a4019bc9f6 | ||
![]() |
f2b9ccec10 | ||
![]() |
01487d4385 | ||
![]() |
73b50de925 | ||
![]() |
70e84a7c4c | ||
![]() |
5f4d2edeee | ||
![]() |
b7fe15d8f9 | ||
![]() |
07a0685b48 | ||
![]() |
235fda5f86 | ||
![]() |
1f6138702c | ||
![]() |
41f624a85b | ||
![]() |
01e53a5cbe | ||
![]() |
6f7754dfa0 | ||
![]() |
e9dba214ea | ||
![]() |
2b133101cf | ||
![]() |
981387b7c8 | ||
![]() |
9fb8b47ad8 | ||
![]() |
4543fc1612 | ||
![]() |
fae55937ac | ||
![]() |
95458609ab | ||
![]() |
481e40cc8c | ||
![]() |
3a00648639 | ||
![]() |
e3a2cca387 | ||
![]() |
ba7277cfb4 | ||
![]() |
c580ef68e8 | ||
![]() |
f97ca6b333 | ||
![]() |
f1242c2a26 | ||
![]() |
e6d4b7686c | ||
![]() |
65c97961ec | ||
![]() |
36f13ceb0a | ||
![]() |
c3de878ab1 | ||
![]() |
5d369ad384 | ||
![]() |
dde62900c8 | ||
![]() |
542ed5f5d3 | ||
![]() |
e085a50c59 | ||
![]() |
5c25d65f45 | ||
![]() |
f66307475d | ||
![]() |
e0197a4d76 | ||
![]() |
25d4cd7e28 | ||
![]() |
43da7ea27b | ||
![]() |
5bb2a19417 | ||
![]() |
1c7f396f0c | ||
![]() |
b3905c44d1 | ||
![]() |
126b2ca077 | ||
![]() |
2b4a52f901 | ||
![]() |
3a1c33a6c3 | ||
![]() |
25a3f77f61 | ||
![]() |
1a73ac7698 | ||
![]() |
172722ec51 | ||
![]() |
e2bdfb573e | ||
![]() |
cd13c24427 | ||
![]() |
d2eba872fb | ||
![]() |
583b68f5a9 | ||
![]() |
2b53a565b9 | ||
![]() |
006425b8b6 | ||
![]() |
3ab6a519fc | ||
![]() |
90fc9039dd | ||
![]() |
4bb0e95abb | ||
![]() |
094bc39d01 | ||
![]() |
6d471636ee | ||
![]() |
f8dcd319d9 | ||
![]() |
2e9a345b3e | ||
![]() |
68bc73b107 | ||
![]() |
460aab3950 | ||
![]() |
37609db6d0 | ||
![]() |
43d32762e3 | ||
![]() |
705739a162 | ||
![]() |
1f1728e9bf | ||
![]() |
20a79706e2 | ||
![]() |
12efbf897d | ||
![]() |
cf59d617bc | ||
![]() |
009c695f0a | ||
![]() |
e53af2b1f5 | ||
![]() |
0b1904d835 | ||
![]() |
6258e33b11 | ||
![]() |
b9cba41106 | ||
![]() |
9d6bac3219 | ||
![]() |
47019bb167 | ||
![]() |
1cebf17fbe | ||
![]() |
1551f71321 | ||
![]() |
bf80a68d0d | ||
![]() |
2736f0cb56 | ||
![]() |
6d0f87a0bd | ||
![]() |
d2cbc31185 | ||
![]() |
5ad5bb0c0c | ||
![]() |
f51a397010 | ||
![]() |
ceade2fe53 | ||
![]() |
713a957e9c | ||
![]() |
af2dd68272 | ||
![]() |
d173d48177 | ||
![]() |
6389bde0bc | ||
![]() |
23cc41df55 | ||
![]() |
b927e50c53 | ||
![]() |
7c00b10d8d | ||
![]() |
26d08dfd0d | ||
![]() |
06f8ad5b2a | ||
![]() |
618cfe03fc | ||
![]() |
cb912a3eda | ||
![]() |
51808a244e | ||
![]() |
82795c2c3a | ||
![]() |
b9d6bda531 | ||
![]() |
5696991c6d | ||
![]() |
cdd9e868ef | ||
![]() |
c00a33ed19 | ||
![]() |
ff32bacb2e | ||
![]() |
8716994cf0 | ||
![]() |
63c6470505 | ||
![]() |
6c53c3ee55 | ||
![]() |
d47b538f39 | ||
![]() |
4bf953cca4 | ||
![]() |
f9af824832 | ||
![]() |
d30abd8857 | ||
![]() |
46fdacc5b5 | ||
![]() |
b6b6e4a96f | ||
![]() |
ce852bab04 | ||
![]() |
f050aaabbb | ||
![]() |
3922237b14 | ||
![]() |
541dde36e3 | ||
![]() |
fec6ca7511 | ||
![]() |
69a201d6c5 | ||
![]() |
11429f9429 | ||
![]() |
70c62d58d5 | ||
![]() |
7bfa4406c1 | ||
![]() |
0e13b15fde | ||
![]() |
9ae353ab44 | ||
![]() |
5566f30006 | ||
![]() |
ffdddcd93d | ||
![]() |
f612e99db5 | ||
![]() |
e1628fab00 | ||
![]() |
6e7a8c3fe2 | ||
![]() |
46a4099dfb | ||
![]() |
0f2873ce99 | ||
![]() |
da84f7dcf9 | ||
![]() |
02e5eafa86 | ||
![]() |
71df5dde6d | ||
![]() |
e5565891af | ||
![]() |
85f3084e21 | ||
![]() |
7f7698649f | ||
![]() |
1d175f3448 | ||
![]() |
5f6ad863c6 | ||
![]() |
4d91369fd7 | ||
![]() |
41d180abb4 | ||
![]() |
622c3454df | ||
![]() |
fc7bf1c71d | ||
![]() |
651c6f9b6e | ||
![]() |
24a5564196 | ||
![]() |
a66eca78c2 | ||
![]() |
9ff0cc7085 | ||
![]() |
d2595ba1c4 | ||
![]() |
73286a81cf | ||
![]() |
ac52947838 | ||
![]() |
642e14d9e7 | ||
![]() |
5a214a9ed0 | ||
![]() |
7d183e89f7 | ||
![]() |
0b6fa3a553 | ||
![]() |
0f442c328e | ||
![]() |
af993da435 | ||
![]() |
e006b1d98d | ||
![]() |
8d1ccb606d | ||
![]() |
88165a798e | ||
![]() |
cc7e344f83 | ||
![]() |
9882e25dc4 | ||
![]() |
b3da396804 | ||
![]() |
b13070ec01 | ||
![]() |
af046a3a81 | ||
![]() |
6ca6a8134d | ||
![]() |
b2967a0320 | ||
![]() |
d7bc55c72d | ||
![]() |
f465bf0cfa | ||
![]() |
3acbb490de | ||
![]() |
673fc74823 | ||
![]() |
5b32bce73c | ||
![]() |
cea1248f7d | ||
![]() |
6844ff7561 | ||
![]() |
370602a8f5 | ||
![]() |
8dddf55907 | ||
![]() |
8e2096c3df | ||
![]() |
1fb3339844 | ||
![]() |
9a9d9a187f | ||
![]() |
f0a9b7ff63 | ||
![]() |
9a6eb71eba | ||
![]() |
dbb404542b | ||
![]() |
91c85a6378 | ||
![]() |
d2d76882f7 | ||
![]() |
e0763e94ad | ||
![]() |
6a90f53862 | ||
![]() |
8642f05fd9 | ||
![]() |
8c1782b840 | ||
![]() |
d3a8c4f992 | ||
![]() |
84fb794da6 | ||
![]() |
1614e805b3 | ||
![]() |
3b992f1688 | ||
![]() |
e635754e8e | ||
![]() |
4b1f21de75 | ||
![]() |
a797856755 | ||
![]() |
7f22a27a10 | ||
![]() |
30cb66e8ba | ||
![]() |
dd1943a3a7 | ||
![]() |
bb70eec177 | ||
![]() |
1f4090011e | ||
![]() |
ab72063a52 | ||
![]() |
ca4b3f3fda | ||
![]() |
b1a8dcefee | ||
![]() |
93ef823f5e | ||
![]() |
96b1600bc8 | ||
![]() |
ef6641ba69 | ||
![]() |
44dc8bbb13 | ||
![]() |
bdc72c7c44 | ||
![]() |
a8ae8ae770 | ||
![]() |
e88fc35429 | ||
![]() |
e463cb6fa0 | ||
![]() |
c349083155 | ||
![]() |
f5938d9bcf | ||
![]() |
34e5654f21 | ||
![]() |
5d332084e1 | ||
![]() |
c4e214a99c | ||
![]() |
d0cb175cab | ||
![]() |
e6c528d9fc | ||
![]() |
809420233c | ||
![]() |
cd5f9d638e | ||
![]() |
e214cc2cdc | ||
![]() |
5ed2ab6d53 | ||
![]() |
9b4cbd5cdc | ||
![]() |
a7b98246b3 | ||
![]() |
f5e55e93aa | ||
![]() |
247c338517 | ||
![]() |
dfd45f26f1 | ||
![]() |
5e66c429e3 | ||
![]() |
19a28352a9 | ||
![]() |
5c60cd2abb | ||
![]() |
0571b8cb0e | ||
![]() |
f1ef94b871 | ||
![]() |
a5449f79ac | ||
![]() |
d258ac8ed2 | ||
![]() |
3c8d063786 | ||
![]() |
bf1b1ea6ee | ||
![]() |
a2947a46a1 | ||
![]() |
1f9c139fd3 | ||
![]() |
d42547f322 | ||
![]() |
c87dbadc44 | ||
![]() |
7dc5e8fb8b | ||
![]() |
a0c7e35eee | ||
![]() |
cddd4e613e | ||
![]() |
49b671f8f1 | ||
![]() |
c747b53f84 | ||
![]() |
b7320471de | ||
![]() |
1bcb3ed0e2 | ||
![]() |
df02f9cc37 | ||
![]() |
d59e9a2c25 | ||
![]() |
f2fd5afb48 | ||
![]() |
9edf00bddf | ||
![]() |
320b57311f | ||
![]() |
b7e84de7d2 | ||
![]() |
de1084f3c4 | ||
![]() |
7ae744b93d | ||
![]() |
4cd2749b10 | ||
![]() |
9a5d309b57 | ||
![]() |
ac055d677a | ||
![]() |
085102fadf | ||
![]() |
dac216cf8e | ||
![]() |
17eb20b22e | ||
![]() |
f7e99fd8b0 | ||
![]() |
9854fc4657 | ||
![]() |
9506ee0370 | ||
![]() |
e13b4a21ca | ||
![]() |
8b4dc955b7 | ||
![]() |
2753d61e4c | ||
![]() |
120d1b80c9 | ||
![]() |
644fa6537c | ||
![]() |
d1f0b5aa5d | ||
![]() |
36ceb9397c | ||
![]() |
474aa823dc | ||
![]() |
36acfce4ea | ||
![]() |
efb03903eb | ||
![]() |
4d8ff5ec01 | ||
![]() |
5bec94652c | ||
![]() |
3827d5bc71 | ||
![]() |
d801ce70c1 | ||
![]() |
50c8f19d61 | ||
![]() |
30996359ef | ||
![]() |
efb0aca0ee | ||
![]() |
a31482db4d | ||
![]() |
c695443727 | ||
![]() |
c972efc9d1 | ||
![]() |
55c0401dfd | ||
![]() |
0743684199 | ||
![]() |
37dd5ded7c | ||
![]() |
678e87b90a | ||
![]() |
92101947fe | ||
![]() |
348229b1d3 | ||
![]() |
36a91c790e | ||
![]() |
0c3f4f3921 | ||
![]() |
99aeb607f4 | ||
![]() |
5cc4ea38c0 | ||
![]() |
8160a0e042 | ||
![]() |
9b3ed62b5a | ||
![]() |
29f44aab5a | ||
![]() |
8aa0dfd684 | ||
![]() |
eb40b7ec40 | ||
![]() |
b16a4ad49a | ||
![]() |
a356d3c895 | ||
![]() |
27356de269 | ||
![]() |
10399165e5 | ||
![]() |
347dd9476a | ||
![]() |
b5e713e70d | ||
![]() |
fbe60af538 | ||
![]() |
13e8356f52 | ||
![]() |
0795dd3c90 | ||
![]() |
a7538371fe | ||
![]() |
360ca18f55 | ||
![]() |
cb13ef3596 | ||
![]() |
5cd68b3900 | ||
![]() |
7c7039767a | ||
![]() |
743993eb55 | ||
![]() |
b3ca7112c6 | ||
![]() |
a4d1505435 | ||
![]() |
a118134af1 | ||
![]() |
cca6d40ed6 | ||
![]() |
fe0bcc0800 | ||
![]() |
dc3c06e73d | ||
![]() |
8ae16aa92c | ||
![]() |
5c08c8c009 | ||
![]() |
3c2640cce4 | ||
![]() |
5acda12419 | ||
![]() |
973bc2b7e0 | ||
![]() |
707bb37494 | ||
![]() |
3e0536eb29 | ||
![]() |
3b45f676c0 | ||
![]() |
dc685387a3 | ||
![]() |
e6d54407ba | ||
![]() |
1011462b40 | ||
![]() |
3abf4c72b4 | ||
![]() |
8eb54c5dec | ||
![]() |
861ba1ddd4 | ||
![]() |
c5857e3f38 | ||
![]() |
a2dc33ba19 | ||
![]() |
e129607988 | ||
![]() |
2952a00d2e | ||
![]() |
0d24af8112 | ||
![]() |
86f0cd7902 | ||
![]() |
6e83db479c | ||
![]() |
1ba21b4a31 | ||
![]() |
d23c0de0c1 | ||
![]() |
55c821184d | ||
![]() |
d94e39a517 | ||
![]() |
09470eb673 | ||
![]() |
811c45163c | ||
![]() |
722806a115 | ||
![]() |
58d8d91ec1 | ||
![]() |
5a0acd09c1 | ||
![]() |
2b473a9df8 | ||
![]() |
86f2c473dc | ||
![]() |
d011facf45 | ||
![]() |
eb2473e9ea | ||
![]() |
5fc775e2ef | ||
![]() |
ca32eb31b8 | ||
![]() |
4b390fafc9 | ||
![]() |
bc6a3fe784 | ||
![]() |
b656159fcf | ||
![]() |
ad07e9c7fc | ||
![]() |
31c018244d | ||
![]() |
502af39f62 | ||
![]() |
13f5bc9586 | ||
![]() |
253f6f3bbf | ||
![]() |
8fb599029f | ||
![]() |
962e8cc1dd | ||
![]() |
2c89195afd | ||
![]() |
4bcc70b2b5 | ||
![]() |
710546c5e9 | ||
![]() |
c40093f47a | ||
![]() |
b98ea04226 | ||
![]() |
0a46ae3c0a | ||
![]() |
740dcaef0d | ||
![]() |
25c6ac1af6 | ||
![]() |
25f669049c | ||
![]() |
759f71d50e | ||
![]() |
8a581b918b | ||
![]() |
cfb1d937a6 | ||
![]() |
26124b4800 | ||
![]() |
d0537961c1 | ||
![]() |
24a0d4e122 | ||
![]() |
3a923ad2db | ||
![]() |
cb3c71eac9 | ||
![]() |
dc0a496d41 | ||
![]() |
f4744e1821 | ||
![]() |
9cf0415761 | ||
![]() |
9ffa22b7ef | ||
![]() |
2a6423eba7 | ||
![]() |
3660535f02 | ||
![]() |
a76da96e86 | ||
![]() |
3241bce611 | ||
![]() |
e29ec131d6 | ||
![]() |
875c356a83 | ||
![]() |
ffa2e43549 | ||
![]() |
c00300ecdd | ||
![]() |
33efad7dbc | ||
![]() |
cb95f71f71 | ||
![]() |
4dee942e73 | ||
![]() |
d8fe63199f | ||
![]() |
d72db1ac8f | ||
![]() |
69719e658c | ||
![]() |
37af859930 | ||
![]() |
8e48d7c19e | ||
![]() |
cb0282ad98 | ||
![]() |
c235ee3f05 | ||
![]() |
ec67d07065 | ||
![]() |
2dc5b141da | ||
![]() |
8898793ade | ||
![]() |
d15317ece4 | ||
![]() |
72c38b5cd5 | ||
![]() |
e2216724ce | ||
![]() |
307605e115 | ||
![]() |
e3a2b7220f | ||
![]() |
ad34f15ef2 | ||
![]() |
da99ded25b | ||
![]() |
08e4b6b4f3 | ||
![]() |
d67e48379f | ||
![]() |
06ec15121a | ||
![]() |
dabd9ef44b | ||
![]() |
c4ac3ffbef | ||
![]() |
06f4b96322 | ||
![]() |
c805f2cf54 | ||
![]() |
462a6148a6 | ||
![]() |
2999d7c0e8 | ||
![]() |
04de6a64e2 | ||
![]() |
f746e38955 | ||
![]() |
d40ca32095 | ||
![]() |
8370373839 | ||
![]() |
b4ccf5c20a | ||
![]() |
8cc49f9f1a | ||
![]() |
5f8f46ba8e | ||
![]() |
465bbee520 | ||
![]() |
6725667d31 | ||
![]() |
0a7e7e0ecf | ||
![]() |
68d2fb7570 | ||
![]() |
5bdad50307 | ||
![]() |
702c94aacf | ||
![]() |
619838f85d | ||
![]() |
0fb4d173f8 | ||
![]() |
2555bd3ab0 | ||
![]() |
829e1f2c43 | ||
![]() |
0b88bf256d | ||
![]() |
0ea7e45bc1 | ||
![]() |
78c5201234 | ||
![]() |
6720fe253e | ||
![]() |
06f798cc38 | ||
![]() |
69e9cda5ac | ||
![]() |
17298a7912 | ||
![]() |
226603a8d8 | ||
![]() |
35fad15c89 | ||
![]() |
773ea9dbdc | ||
![]() |
5f5f2ce0de | ||
![]() |
f31c26f1af | ||
![]() |
105d680aea | ||
![]() |
1ae7744f42 | ||
![]() |
852f21ed05 | ||
![]() |
5701165f06 | ||
![]() |
de8a9f6c33 | ||
![]() |
c07e144c82 | ||
![]() |
e4dc878f89 | ||
![]() |
69f0847ccc | ||
![]() |
1b70a1da04 | ||
![]() |
ce30998221 | ||
![]() |
7109f63e3c | ||
![]() |
957a6506ef | ||
![]() |
aa3e3b4ca6 | ||
![]() |
28f6bd822b | ||
![]() |
af1f17f1dc | ||
![]() |
aaab5e3900 | ||
![]() |
4cb6317900 | ||
![]() |
f81d1ce003 | ||
![]() |
6552768c4f | ||
![]() |
605c8fb49c | ||
![]() |
f0b3029ad3 | ||
![]() |
72b3fd9664 | ||
![]() |
5ab9e9f617 | ||
![]() |
94bd0f9915 | ||
![]() |
63f72ac27c | ||
![]() |
1f05ec95c0 | ||
![]() |
c930f32ab9 | ||
![]() |
5214798cfc | ||
![]() |
2e89aaf3bd | ||
![]() |
91b9ad7d82 | ||
![]() |
2208b64891 | ||
![]() |
480598dcda | ||
![]() |
d113d3d737 | ||
![]() |
e07e46f539 | ||
![]() |
b199194a2c | ||
![]() |
008b604bac | ||
![]() |
e333957a1a | ||
![]() |
82907ab5fe | ||
![]() |
35898cff5d | ||
![]() |
d5916a823a | ||
![]() |
4d01725699 | ||
![]() |
b97df0bdad | ||
![]() |
5fe5d712aa | ||
![]() |
24f0056ca5 | ||
![]() |
a1fee487ba | ||
![]() |
4b8bdd953e | ||
![]() |
936c070059 | ||
![]() |
85a6329a2b | ||
![]() |
df040e55fb | ||
![]() |
6140396d97 | ||
![]() |
832c158a66 | ||
![]() |
e9e1668ca6 | ||
![]() |
ac086d8ce2 | ||
![]() |
1514cdc7d8 | ||
![]() |
ca4633bfe4 | ||
![]() |
57d691e81a | ||
![]() |
7ab152aaa5 | ||
![]() |
b96f43f2b8 | ||
![]() |
3965449d05 | ||
![]() |
fcbc7a8db4 | ||
![]() |
39b431b3ed | ||
![]() |
03fc0e3f41 | ||
![]() |
ddea5038e4 | ||
![]() |
25eced62b6 | ||
![]() |
42d892913d | ||
![]() |
ea75966e42 | ||
![]() |
564d5f921c | ||
![]() |
99079a164d | ||
![]() |
3da49cd68e | ||
![]() |
9ccb3abbb5 | ||
![]() |
5e4976559a | ||
![]() |
0ed95423de | ||
![]() |
493d250446 | ||
![]() |
36a84d8f4a | ||
![]() |
f0dafa89c2 | ||
![]() |
6016ac270f | ||
![]() |
91749c06dc | ||
![]() |
6a842132bc | ||
![]() |
54d5e90a2b | ||
![]() |
3679752dbd | ||
![]() |
0dd6455659 | ||
![]() |
518b42db91 | ||
![]() |
f34befe74c | ||
![]() |
1ef2d768e7 | ||
![]() |
edc2a7ee46 | ||
![]() |
8e5134784c | ||
![]() |
71616fce0b | ||
![]() |
072a853fa2 | ||
![]() |
95fe5614a0 | ||
![]() |
407abb3a6c | ||
![]() |
d82741f8c0 | ||
![]() |
3d25200127 | ||
![]() |
c1d21e9dd6 | ||
![]() |
7db2f658e8 | ||
![]() |
90f62cc749 | ||
![]() |
7955cf3515 | ||
![]() |
2b377d89db | ||
![]() |
4b08b5d194 | ||
![]() |
a469704495 | ||
![]() |
ca385db4d0 | ||
![]() |
8b375cf471 | ||
![]() |
7873660e1e | ||
![]() |
28a549d597 | ||
![]() |
14e19b8aaf | ||
![]() |
53cf88c27b | ||
![]() |
6712e08bba | ||
![]() |
1eff241ec6 | ||
![]() |
0b6b03c472 | ||
![]() |
144f584948 | ||
![]() |
476c28f433 | ||
![]() |
ae457ff64a | ||
![]() |
607dc3e0f9 | ||
![]() |
60c0252672 | ||
![]() |
d5839770ee | ||
![]() |
e57d4eef88 | ||
![]() |
bad5b2f8cf | ||
![]() |
cb8e47c4f8 | ||
![]() |
dcbeefcd23 | ||
![]() |
76ea97c809 | ||
![]() |
26235bc050 | ||
![]() |
694eb18e03 | ||
![]() |
3a86dd54f3 | ||
![]() |
b160a8b5ba | ||
![]() |
45df8f77df | ||
![]() |
9b98b959d1 | ||
![]() |
f400c6f05f | ||
![]() |
826210a465 | ||
![]() |
e8aa58934e | ||
![]() |
f8e3bc63ef | ||
![]() |
8b976c413e | ||
![]() |
6efe84af68 | ||
![]() |
a4825ebd5c | ||
![]() |
cb75db4c18 | ||
![]() |
7918845215 | ||
![]() |
ad73a70e5a | ||
![]() |
16ae369474 | ||
![]() |
6650588c4a | ||
![]() |
6eb2bcd1a0 | ||
![]() |
9f534f338a | ||
![]() |
d0ff2000b2 | ||
![]() |
2c236fc67b | ||
![]() |
90f20bd7b1 | ||
![]() |
cdfaecb25f | ||
![]() |
6d35c5c7ec | ||
![]() |
1a093c08d0 | ||
![]() |
edced212db | ||
![]() |
16cce1ac17 | ||
![]() |
d3d0c9a7b1 | ||
![]() |
2b35f40fc1 | ||
![]() |
ca1ba1085a | ||
![]() |
af59a290d8 | ||
![]() |
bf4de3f6f7 | ||
![]() |
d69286c065 | ||
![]() |
601bf9642f | ||
![]() |
bc025ab117 | ||
![]() |
b4b09afabd | ||
![]() |
d07661b9a3 | ||
![]() |
a49c92fc5b | ||
![]() |
bb96b8219d | ||
![]() |
05cdbbc18b | ||
![]() |
eb6dd3e42d | ||
![]() |
fe1af9c2bc | ||
![]() |
698ec9eb6e | ||
![]() |
f83d733318 | ||
![]() |
2109fb18e6 | ||
![]() |
6757c503bd | ||
![]() |
9281653233 | ||
![]() |
cb0abce5be | ||
![]() |
75c32b549b | ||
![]() |
9a21d89b17 | ||
![]() |
5f8411b7bf | ||
![]() |
d707b2a171 | ||
![]() |
dafc14b969 | ||
![]() |
cb8efa4fef | ||
![]() |
0088ed0f1a | ||
![]() |
17d616037d | ||
![]() |
b1d4ef2b42 | ||
![]() |
09eefbe92c | ||
![]() |
45d92e2563 | ||
![]() |
b22a61cdbb | ||
![]() |
054b03e07a | ||
![]() |
b3129b3791 | ||
![]() |
eb5e4a2476 | ||
![]() |
fb2b3f98bb | ||
![]() |
43534cab02 | ||
![]() |
2fb0a62553 | ||
![]() |
55c93ea164 | ||
![]() |
c3efb2804a | ||
![]() |
9c01efd6fb | ||
![]() |
03f5f78792 | ||
![]() |
0164a5fea3 | ||
![]() |
481654a88b | ||
![]() |
81be7358be | ||
![]() |
953f26bace | ||
![]() |
018383096c | ||
![]() |
239b0aaf2e | ||
![]() |
997411b635 | ||
![]() |
1b2acb8d95 | ||
![]() |
15500dbd8f | ||
![]() |
86d796656c | ||
![]() |
f6116eeaa3 | ||
![]() |
b604e3a086 | ||
![]() |
ae7bb47b4f | ||
![]() |
6fe839a688 | ||
![]() |
9475cf2cc6 | ||
![]() |
98907c57ae | ||
![]() |
b672035ff5 | ||
![]() |
7cbf52db1b | ||
![]() |
94d00d9473 | ||
![]() |
a2aba3f2f1 | ||
![]() |
1903fb5de0 | ||
![]() |
63fd561815 | ||
![]() |
1aba6c607b | ||
![]() |
c201518674 | ||
![]() |
4408bd28cb | ||
![]() |
1b008be1e6 | ||
![]() |
c2a0fd349e | ||
![]() |
533f5c38c4 | ||
![]() |
1c1231bf13 | ||
![]() |
32396b5879 | ||
![]() |
41403c6d25 | ||
![]() |
5265ac5000 | ||
![]() |
5377de33ac | ||
![]() |
3f8dedd7ae | ||
![]() |
24db94b1a6 | ||
![]() |
0d53767274 | ||
![]() |
8f60395dd1 | ||
![]() |
6910bfee0f | ||
![]() |
1f3b5e1a82 | ||
![]() |
8768b7f4a0 | ||
![]() |
e6cbb01b55 | ||
![]() |
a2434aeddb | ||
![]() |
16300d02c7 | ||
![]() |
67e2120459 | ||
![]() |
9e9ffeb5eb | ||
![]() |
503a5c458b | ||
![]() |
74472f7b2b | ||
![]() |
756a17a848 | ||
![]() |
76a6509c59 | ||
![]() |
03683c375c | ||
![]() |
3d8e0594e4 | ||
![]() |
d65cff9de8 | ||
![]() |
6be921b71c | ||
![]() |
ede4d620de | ||
![]() |
d077a161ee | ||
![]() |
e826ec0b0e | ||
![]() |
5b07ca1dfd | ||
![]() |
dbc25f5a87 | ||
![]() |
d711bb84e6 | ||
![]() |
5e5914655b | ||
![]() |
7821eef258 | ||
![]() |
d5468d3cde | ||
![]() |
3f553ac0b9 | ||
![]() |
f3d8502115 | ||
![]() |
fd07250e6c | ||
![]() |
838277e28a | ||
![]() |
133f8bc628 | ||
![]() |
c1026ff4b3 | ||
![]() |
2f2eeb19ba | ||
![]() |
745bac562d | ||
![]() |
5908f562df | ||
![]() |
0c3dea5c4d | ||
![]() |
336412e1db | ||
![]() |
beca4dc16c | ||
![]() |
9a91ce4fa6 | ||
![]() |
a00b03d03f | ||
![]() |
fcc9d99967 | ||
![]() |
033b1cb7d9 | ||
![]() |
43f40b8e1a | ||
![]() |
1b7a9bf4d2 | ||
![]() |
5a151555c8 | ||
![]() |
6a75938758 | ||
![]() |
cab3a248b2 | ||
![]() |
a409fa2b3f | ||
![]() |
9cc185dc6d | ||
![]() |
62d020aba1 | ||
![]() |
6c135b89ee | ||
![]() |
eb71bbb1da | ||
![]() |
1cf377f23a | ||
![]() |
3f85c2e43a | ||
![]() |
a84926763f | ||
![]() |
023f67cad8 | ||
![]() |
967e892cb6 | ||
![]() |
58f6ef50a8 | ||
![]() |
5b84c21182 | ||
![]() |
643d620164 | ||
![]() |
97602371e6 | ||
![]() |
7a1a3a1258 | ||
![]() |
45626de63f | ||
![]() |
2dc27a8a78 | ||
![]() |
f4fddbfb77 | ||
![]() |
133ae5eeef | ||
![]() |
0de7b17d03 | ||
![]() |
593af64943 | ||
![]() |
36d1fd0602 | ||
![]() |
c4a8950281 | ||
![]() |
41fd278317 | ||
![]() |
41f27ae3f3 | ||
![]() |
620df53860 | ||
![]() |
156e6f274f | ||
![]() |
fd5e4e2e4c | ||
![]() |
a5a5c83608 | ||
![]() |
7b55d50bbd | ||
![]() |
170d8af397 | ||
![]() |
db0159be26 | ||
![]() |
afa781f420 | ||
![]() |
f913ba6e06 | ||
![]() |
3efc82cbb2 | ||
![]() |
17a46dc5e0 | ||
![]() |
6255c4e053 | ||
![]() |
9cc10c69f2 | ||
![]() |
872465cf1d | ||
![]() |
bdd73fc07f | ||
![]() |
bfb9cf1fc3 | ||
![]() |
6a7514feaa | ||
![]() |
bde46fdece | ||
![]() |
7dc7d2f83f | ||
![]() |
c585a72cdc | ||
![]() |
e14f678689 | ||
![]() |
a052040430 | ||
![]() |
1dafe1e002 | ||
![]() |
a494bf847d | ||
![]() |
d9398982ea | ||
![]() |
c7c4aad387 | ||
![]() |
b2265a0977 | ||
![]() |
8bd903cd51 | ||
![]() |
5bea4906a2 | ||
![]() |
7d895ee053 | ||
![]() |
40444e9186 | ||
![]() |
9ec2bf26ce | ||
![]() |
37a77506b0 | ||
![]() |
d9239181af | ||
![]() |
98baea63ff | ||
![]() |
1db29cb5e5 | ||
![]() |
7f24736ebc | ||
![]() |
d72df05b93 | ||
![]() |
a914029278 | ||
![]() |
956ef785f5 | ||
![]() |
df67785886 | ||
![]() |
2411b6f137 | ||
![]() |
3280765f2d | ||
![]() |
060ce0e0bc | ||
![]() |
96ede7c567 | ||
![]() |
4a08320007 | ||
![]() |
597d65b4b7 | ||
![]() |
cc5a42a774 | ||
![]() |
5bda5c5bf2 | ||
![]() |
4c5398bc40 | ||
![]() |
8e052f677e | ||
![]() |
8d8b6224d9 | ||
![]() |
6e4e70f51b | ||
![]() |
17531ed082 | ||
![]() |
d01f140bb3 | ||
![]() |
7383274f66 | ||
![]() |
a59ddde721 | ||
![]() |
9906db985d | ||
![]() |
d66ef56739 | ||
![]() |
244a1f97db | ||
![]() |
c77c54f1bc | ||
![]() |
8d98780932 | ||
![]() |
9e5d55e2b0 | ||
![]() |
f424189093 | ||
![]() |
5886eaed7d | ||
![]() |
ac47f8a506 | ||
![]() |
ae3d5e5ecc | ||
![]() |
19d38c4d0f | ||
![]() |
50398e10fe | ||
![]() |
8b171b8c50 | ||
![]() |
f3a508b4a3 | ||
![]() |
ad80a83a1a | ||
![]() |
901c8fbcdb | ||
![]() |
5ec72aadbf | ||
![]() |
b43a3dbff8 | ||
![]() |
0ff959329b | ||
![]() |
d840ff7b70 | ||
![]() |
63ad4caab5 | ||
![]() |
77f8aebf41 | ||
![]() |
12fb634fe6 | ||
![]() |
edfe0980f1 | ||
![]() |
f57149d2f4 | ||
![]() |
147b4b63af | ||
![]() |
3eaf4a0d5b | ||
![]() |
73c6bf3879 | ||
![]() |
bc4fd8b10d | ||
![]() |
b6d73fb740 | ||
![]() |
32b422cf90 | ||
![]() |
33ca9f711e | ||
![]() |
88d4a260e1 | ||
![]() |
4c4f741aec | ||
![]() |
031756c5e6 | ||
![]() |
2d5920ae1a | ||
![]() |
3adcc0c50b | ||
![]() |
e82cb5de4a | ||
![]() |
7d6af9985c | ||
![]() |
c778311505 | ||
![]() |
4eb781ce1d | ||
![]() |
489d10c57c | ||
![]() |
5e6f7e1d55 | ||
![]() |
475cd8f075 | ||
![]() |
f4d5d5250a | ||
![]() |
d9023b84e6 | ||
![]() |
c66fd37603 | ||
![]() |
d76a95824d | ||
![]() |
823b35e341 | ||
![]() |
04e7eb1e29 | ||
![]() |
0e873a30f3 | ||
![]() |
a9981e0e7e | ||
![]() |
b4f0586596 | ||
![]() |
5b6d598ca8 | ||
![]() |
85bf64da0a | ||
![]() |
577befef97 | ||
![]() |
e7a4d95a9e | ||
![]() |
db1155f713 | ||
![]() |
8c8ea1f8f3 | ||
![]() |
b23aa1cf09 | ||
![]() |
4c3d7b29ec | ||
![]() |
aace622ca5 | ||
![]() |
09f849b600 | ||
![]() |
7c1a5d1d40 | ||
![]() |
a6f74debc0 | ||
![]() |
a9605bb4af | ||
![]() |
188bae586f | ||
![]() |
ab48a3e9fd | ||
![]() |
bfcaf36404 | ||
![]() |
443399c27d | ||
![]() |
631d55ada0 | ||
![]() |
34c3f03013 | ||
![]() |
052c2d0a0f | ||
![]() |
3c0cc028b7 | ||
![]() |
2e3b78d10b | ||
![]() |
b9dba14fa3 | ||
![]() |
4f75e2f95c | ||
![]() |
2b3cb2c448 | ||
![]() |
53b38251bb | ||
![]() |
0502ac47fb | ||
![]() |
5fd1d09aa5 | ||
![]() |
685ca180f7 | ||
![]() |
31e5053253 | ||
![]() |
de50c003d5 | ||
![]() |
08b23d0806 | ||
![]() |
4f4d21693b | ||
![]() |
249b37e2fb | ||
![]() |
0c6e0460b6 | ||
![]() |
3638d28f68 | ||
![]() |
97806ee6d6 | ||
![]() |
68945ead63 | ||
![]() |
4cb61aa742 | ||
![]() |
13ec521414 | ||
![]() |
9b1cad7cb6 | ||
![]() |
1d4f8f6b6a | ||
![]() |
15d39022ab | ||
![]() |
7fc3cccfaa | ||
![]() |
bcc97afbd2 | ||
![]() |
1b0d573a65 | ||
![]() |
1d7fde39a6 | ||
![]() |
1bd39fb8d0 | ||
![]() |
7d0fc179e6 | ||
![]() |
78082e8d3e | ||
![]() |
a8ade2441d | ||
![]() |
9bf15ca3fa | ||
![]() |
acd9ed8d83 | ||
![]() |
add76592d9 | ||
![]() |
0c5e359cb5 | ||
![]() |
9cad5155e3 | ||
![]() |
f98a3d85ed | ||
![]() |
1751ec192d | ||
![]() |
57308c4f82 | ||
![]() |
3ea2063e07 | ||
![]() |
f3093bc508 | ||
![]() |
ab4d13e2fa | ||
![]() |
22fb9d8d25 | ||
![]() |
a40a969e9a | ||
![]() |
7b6b629e1a | ||
![]() |
acc52a953b | ||
![]() |
043d8ff9f2 | ||
![]() |
caeff6e1af | ||
![]() |
ac1cb1c72f | ||
![]() |
171baaee93 | ||
![]() |
19044a15f9 | ||
![]() |
5992cdf3c2 | ||
![]() |
a24e94215e | ||
![]() |
d13fdfd446 | ||
![]() |
73d37f8b6e | ||
![]() |
9fd2bf67aa | ||
![]() |
ebad046220 | ||
![]() |
279e3410cf | ||
![]() |
90e2a043e3 | ||
![]() |
f2ad6201d9 | ||
![]() |
1801d44f53 | ||
![]() |
09fe6185b7 | ||
![]() |
dcb992ab37 | ||
![]() |
295e7607c4 | ||
![]() |
e1bbaca7ac | ||
![]() |
9114d9be77 | ||
![]() |
b4e2860c69 | ||
![]() |
7a5646d594 | ||
![]() |
3d48c35d6b | ||
![]() |
3531d8c8ea | ||
![]() |
872a909150 | ||
![]() |
62fde31936 | ||
![]() |
140cd0da1d | ||
![]() |
d836464cd2 | ||
![]() |
ae4adcc707 | ||
![]() |
52c7066f4b | ||
![]() |
c470fc32a8 | ||
![]() |
f74322b9a5 | ||
![]() |
9c743df2d5 | ||
![]() |
d60302d517 | ||
![]() |
d5228787ce | ||
![]() |
d33b13dd6b | ||
![]() |
c5a2124e81 | ||
![]() |
22d3ce9c29 | ||
![]() |
927e6efc3d | ||
![]() |
ca4c8b7f8a | ||
![]() |
6b4a51f7ea | ||
![]() |
8fec4d53d0 | ||
![]() |
1646a28173 | ||
![]() |
666d85d3ce | ||
![]() |
53b89c1dcf | ||
![]() |
bca9c2f3c4 | ||
![]() |
f8d55266e4 | ||
![]() |
600bee9d4f | ||
![]() |
45feaa73d0 | ||
![]() |
a3ea05c1e5 | ||
![]() |
8679feb3cb | ||
![]() |
5c1b9a0d2a | ||
![]() |
d932693d51 | ||
![]() |
ba2f615cd4 | ||
![]() |
7a013e93e0 | ||
![]() |
425d348f0f | ||
![]() |
9297d941e2 | ||
![]() |
3fa4ca8188 | ||
![]() |
ed3115bd26 | ||
![]() |
a4dc8de073 | ||
![]() |
f551df17f3 | ||
![]() |
e7bbd8256b | ||
![]() |
a1d545f8e5 | ||
![]() |
5ffa01c8b7 | ||
![]() |
4fd4f66514 | ||
![]() |
d23403a1df | ||
![]() |
ade51c1d89 |
@@ -7,6 +7,10 @@ end_of_line = lf
|
|||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
charset = utf_8
|
charset = utf_8
|
||||||
|
|
||||||
|
[runtime/doc/*.txt]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 8
|
||||||
|
|
||||||
[Makefile]
|
[Makefile]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
tab_width = 4
|
tab_width = 4
|
||||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,10 +1,10 @@
|
|||||||
# Build/deps dir
|
# Build/deps dir
|
||||||
/build/
|
/build/
|
||||||
|
/cmake-build-debug/
|
||||||
/dist/
|
/dist/
|
||||||
/.deps/
|
/.deps/
|
||||||
/tmp/
|
/tmp/
|
||||||
|
|
||||||
*.orig
|
|
||||||
*.mo
|
*.mo
|
||||||
.*.sw?
|
.*.sw?
|
||||||
*~
|
*~
|
||||||
@@ -17,6 +17,9 @@ tags
|
|||||||
/src/nvim/po/vim.pot
|
/src/nvim/po/vim.pot
|
||||||
/src/nvim/po/*.ck
|
/src/nvim/po/*.ck
|
||||||
|
|
||||||
|
# generated by tests with $NVIM_LOG_FILE set.
|
||||||
|
/.nvimlog
|
||||||
|
|
||||||
# Files generated by scripts/vim-patch.sh
|
# Files generated by scripts/vim-patch.sh
|
||||||
/.vim-src/
|
/.vim-src/
|
||||||
|
|
||||||
|
45
.travis.yml
45
.travis.yml
@@ -10,7 +10,7 @@ env:
|
|||||||
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
|
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
|
||||||
- MAKE_CMD="make -j2"
|
- MAKE_CMD="make -j2"
|
||||||
# Update PATH for pip.
|
# Update PATH for pip.
|
||||||
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:/usr/lib/llvm-symbolizer-3.9/bin:$PATH"
|
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:/usr/lib/llvm-symbolizer-4.0/bin:$PATH"
|
||||||
# Build directory for Neovim.
|
# Build directory for Neovim.
|
||||||
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
||||||
# Build directory for third-party dependencies.
|
# Build directory for third-party dependencies.
|
||||||
@@ -21,13 +21,15 @@ env:
|
|||||||
- INSTALL_PREFIX="$HOME/nvim-install"
|
- INSTALL_PREFIX="$HOME/nvim-install"
|
||||||
# Log directory for Clang sanitizers and Valgrind.
|
# Log directory for Clang sanitizers and Valgrind.
|
||||||
- LOG_DIR="$BUILD_DIR/log"
|
- LOG_DIR="$BUILD_DIR/log"
|
||||||
|
# Nvim log file.
|
||||||
|
- NVIM_LOG_FILE="$BUILD_DIR/.nvimlog"
|
||||||
# Default CMake flags.
|
# Default CMake flags.
|
||||||
- CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON
|
- CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON
|
||||||
-DCMAKE_BUILD_TYPE=Debug
|
-DCMAKE_BUILD_TYPE=Debug
|
||||||
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
|
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
|
||||||
-DBUSTED_OUTPUT_TYPE=nvim
|
-DBUSTED_OUTPUT_TYPE=nvim
|
||||||
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
|
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
|
||||||
-DMIN_LOG_LEVEL=2"
|
-DMIN_LOG_LEVEL=3"
|
||||||
- DEPS_CMAKE_FLAGS="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR"
|
- DEPS_CMAKE_FLAGS="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR"
|
||||||
# Additional CMake flags for 32-bit builds.
|
# Additional CMake flags for 32-bit builds.
|
||||||
- CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
|
- CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
|
||||||
@@ -47,14 +49,16 @@ env:
|
|||||||
- FUNCTIONALTEST=functionaltest
|
- FUNCTIONALTEST=functionaltest
|
||||||
- CI_TARGET=tests
|
- CI_TARGET=tests
|
||||||
|
|
||||||
matrix:
|
jobs:
|
||||||
include:
|
include:
|
||||||
- os: linux
|
- stage: sanitizers
|
||||||
env: CI_TARGET=lint
|
os: linux
|
||||||
- os: linux
|
compiler: clang-4.0
|
||||||
compiler: gcc-5
|
env: >
|
||||||
env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
CLANG_SANITIZER=ASAN_UBSAN
|
||||||
- os: linux
|
CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
|
||||||
|
- stage: normal builds
|
||||||
|
os: linux
|
||||||
compiler: gcc-5
|
compiler: gcc-5
|
||||||
env: FUNCTIONALTEST=functionaltest-lua
|
env: FUNCTIONALTEST=functionaltest-lua
|
||||||
- os: linux
|
- os: linux
|
||||||
@@ -63,20 +67,25 @@ matrix:
|
|||||||
# dependencies in a separate cache.
|
# dependencies in a separate cache.
|
||||||
compiler: gcc-5 -m32
|
compiler: gcc-5 -m32
|
||||||
env: BUILD_32BIT=ON
|
env: BUILD_32BIT=ON
|
||||||
- os: linux
|
|
||||||
compiler: clang-3.9
|
|
||||||
env: CLANG_SANITIZER=ASAN_UBSAN
|
|
||||||
- os: linux
|
|
||||||
compiler: clang-3.9
|
|
||||||
env: CLANG_SANITIZER=TSAN
|
|
||||||
- os: osx
|
- os: osx
|
||||||
compiler: clang
|
compiler: clang
|
||||||
osx_image: xcode7.3 # macOS 10.11
|
osx_image: xcode7.3 # macOS 10.11
|
||||||
- os: osx
|
- os: osx
|
||||||
compiler: gcc-4.9
|
compiler: gcc-4.9
|
||||||
osx_image: xcode7.3 # macOS 10.11
|
osx_image: xcode7.3 # macOS 10.11
|
||||||
|
- stage: lint
|
||||||
|
os: linux
|
||||||
|
env: CI_TARGET=lint
|
||||||
|
- stage: Flaky builds
|
||||||
|
os: linux
|
||||||
|
compiler: gcc-5
|
||||||
|
env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||||
|
- os: linux
|
||||||
|
compiler: clang-4.0
|
||||||
|
env: CLANG_SANITIZER=TSAN
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
- env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||||
|
- env: CLANG_SANITIZER=TSAN
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
|
||||||
before_install: ci/before_install.sh
|
before_install: ci/before_install.sh
|
||||||
@@ -90,13 +99,13 @@ addons:
|
|||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
- llvm-toolchain-trusty-3.9
|
- llvm-toolchain-trusty-4.0
|
||||||
packages:
|
packages:
|
||||||
- autoconf
|
- autoconf
|
||||||
- automake
|
- automake
|
||||||
- apport
|
- apport
|
||||||
- build-essential
|
- build-essential
|
||||||
- clang-3.9
|
- clang-4.0
|
||||||
- cmake
|
- cmake
|
||||||
- cscope
|
- cscope
|
||||||
- g++-5-multilib
|
- g++-5-multilib
|
||||||
@@ -107,7 +116,7 @@ addons:
|
|||||||
- language-pack-tr
|
- language-pack-tr
|
||||||
- libc6-dev-i386
|
- libc6-dev-i386
|
||||||
- libtool
|
- libtool
|
||||||
- llvm-3.9-dev
|
- llvm-4.0-dev
|
||||||
- locales
|
- locales
|
||||||
- pkg-config
|
- pkg-config
|
||||||
- unzip
|
- unzip
|
||||||
|
4
BSDmakefile
Normal file
4
BSDmakefile
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
.DONE:
|
||||||
|
@echo "Please use GNU Make (gmake) to build neovim"
|
||||||
|
.DEFAULT:
|
||||||
|
@echo "Please use GNU Make (gmake) to build neovim"
|
181
CMakeLists.txt
181
CMakeLists.txt
@@ -51,24 +51,24 @@ endif()
|
|||||||
|
|
||||||
# Set default build type.
|
# Set default build type.
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Dev'.")
|
message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Debug'.")
|
||||||
set(CMAKE_BUILD_TYPE "Dev" CACHE STRING "Choose the type of build." FORCE)
|
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set available build types for CMake GUIs.
|
# Set available build types for CMake GUIs.
|
||||||
# A different build type can still be set by -DCMAKE_BUILD_TYPE=...
|
# A different build type can still be set by -DCMAKE_BUILD_TYPE=...
|
||||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||||
STRINGS "Debug" "Dev" "Release" "MinSizeRel" "RelWithDebInfo")
|
STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||||
|
|
||||||
# If not in a git repo (e.g., a tarball) these tokens define the complete
|
# If not in a git repo (e.g., a tarball) these tokens define the complete
|
||||||
# version string, else they are 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_MAJOR 0)
|
||||||
set(NVIM_VERSION_MINOR 2)
|
set(NVIM_VERSION_MINOR 2)
|
||||||
set(NVIM_VERSION_PATCH 0)
|
set(NVIM_VERSION_PATCH 2)
|
||||||
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||||
|
|
||||||
# API level
|
# API level
|
||||||
set(NVIM_API_LEVEL 2) # Bump this after any API change.
|
set(NVIM_API_LEVEL 3) # Bump this after any API change.
|
||||||
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
||||||
set(NVIM_API_PRERELEASE false)
|
set(NVIM_API_PRERELEASE false)
|
||||||
|
|
||||||
@@ -96,57 +96,34 @@ if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
|
|||||||
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Disable logging for release-type builds.
|
# Minimize logging for release-type builds.
|
||||||
if(NOT CMAKE_C_FLAGS_RELEASE MATCHES DDISABLE_LOG)
|
if(NOT CMAKE_C_FLAGS_RELEASE MATCHES DMIN_LOG_LEVEL)
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDISABLE_LOG")
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DMIN_LOG_LEVEL=3")
|
||||||
endif()
|
endif()
|
||||||
if(NOT CMAKE_C_FLAGS_MINSIZEREL MATCHES DDISABLE_LOG)
|
if(NOT CMAKE_C_FLAGS_MINSIZEREL MATCHES DMIN_LOG_LEVEL)
|
||||||
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DDISABLE_LOG")
|
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DMIN_LOG_LEVEL=3")
|
||||||
endif()
|
endif()
|
||||||
if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DDISABLE_LOG)
|
if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DMIN_LOG_LEVEL)
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDISABLE_LOG")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DMIN_LOG_LEVEL=3")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Enable assertions for RelWithDebInfo.
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
check_c_compiler_flag(-Og HAS_OG_FLAG)
|
||||||
|
else()
|
||||||
|
set(HAS_OG_FLAG 0)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Build-type: RelWithDebInfo
|
||||||
|
#
|
||||||
|
if(HAS_OG_FLAG)
|
||||||
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -Og -g")
|
||||||
|
endif()
|
||||||
|
# We _want_ assertions in RelWithDebInfo build-type.
|
||||||
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG)
|
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG)
|
||||||
string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set build flags for custom Dev build type.
|
|
||||||
# -DNDEBUG purposely omitted because we want assertions.
|
|
||||||
if(MSVC)
|
|
||||||
SET(CMAKE_C_FLAGS_DEV ""
|
|
||||||
CACHE STRING "Flags used by the compiler during development (optimized, but with debug info and logging) builds."
|
|
||||||
FORCE)
|
|
||||||
else()
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCC)
|
|
||||||
check_c_compiler_flag(-Og HAS_OG_FLAG)
|
|
||||||
else()
|
|
||||||
set(HAS_OG_FLAG 0)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(HAS_OG_FLAG)
|
|
||||||
set(CMAKE_C_FLAGS_DEV "-Og -g"
|
|
||||||
CACHE STRING "Flags used by the compiler during development (optimized, but with debug info and logging) builds."
|
|
||||||
FORCE)
|
|
||||||
else()
|
|
||||||
set(CMAKE_C_FLAGS_DEV "-O2 -g"
|
|
||||||
CACHE STRING "Flags used by the compiler during development (optimized, but with debug info and logging) builds."
|
|
||||||
FORCE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS_DEV ""
|
|
||||||
CACHE STRING "Flags used for linking binaries during development (optimized, but with debug info and logging) builds."
|
|
||||||
FORCE)
|
|
||||||
SET(CMAKE_SHARED_LINKER_FLAGS_DEV ""
|
|
||||||
CACHE STRING "Flags used by the shared libraries linker during development (optimized, but with debug info and logging) builds."
|
|
||||||
FORCE)
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
|
||||||
CMAKE_C_FLAGS_DEV
|
|
||||||
CMAKE_EXE_LINKER_FLAGS_DEV
|
|
||||||
CMAKE_SHARED_LINKER_FLAGS_DEV)
|
|
||||||
|
|
||||||
# Enable -Wconversion.
|
# Enable -Wconversion.
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion")
|
||||||
@@ -214,6 +191,16 @@ if(CMAKE_EXE_LINKER_FLAGS MATCHES "--sort-common" OR
|
|||||||
string(REGEX REPLACE "-Wl($| )" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
string(REGEX REPLACE "-Wl($| )" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <execinfo.h>
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
void *trace[1];
|
||||||
|
int trace_size = backtrace(trace, 1);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" HAVE_EXECINFO_BACKTRACE)
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# XXX: /W4 gives too many warnings. #3241
|
# XXX: /W4 gives too many warnings. #3241
|
||||||
add_definitions(/W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
add_definitions(/W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
@@ -221,9 +208,14 @@ else()
|
|||||||
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
|
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||||
-Wstrict-prototypes -std=gnu99)
|
-Wstrict-prototypes -std=gnu99)
|
||||||
|
|
||||||
|
check_c_compiler_flag(-Wimplicit-fallthrough HAS_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||||
|
if(HAS_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||||
|
add_definitions(-Wimplicit-fallthrough)
|
||||||
|
endif()
|
||||||
|
|
||||||
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
|
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
|
||||||
# 3.4.1 used there.
|
# 3.4.1 used there.
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
add_definitions(-Wno-c11-extensions)
|
add_definitions(-Wno-c11-extensions)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -257,6 +249,17 @@ if(HAS_DIAG_COLOR_FLAG)
|
|||||||
add_definitions(-fdiagnostics-color=auto)
|
add_definitions(-fdiagnostics-color=auto)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.5")
|
||||||
|
# Array-bounds testing is broken in some GCC versions before 4.8.5.
|
||||||
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
|
||||||
|
check_c_compiler_flag(-Wno-array-bounds HAS_NO_ARRAY_BOUNDS_FLAG)
|
||||||
|
if(HAS_NO_ARRAY_BOUNDS_FLAG)
|
||||||
|
add_definitions(-Wno-array-bounds)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
option(TRAVIS_CI_BUILD "Travis/QuickBuild CI. Extra flags will be set." OFF)
|
option(TRAVIS_CI_BUILD "Travis/QuickBuild CI. Extra flags will be set." OFF)
|
||||||
|
|
||||||
if(TRAVIS_CI_BUILD)
|
if(TRAVIS_CI_BUILD)
|
||||||
@@ -309,6 +312,20 @@ include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
|
|||||||
find_package(Msgpack 1.0.0 REQUIRED)
|
find_package(Msgpack 1.0.0 REQUIRED)
|
||||||
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
|
||||||
|
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
|
||||||
|
|
||||||
|
if(PREFER_LUA)
|
||||||
|
find_package(Lua REQUIRED)
|
||||||
|
set(LUA_PREFERRED_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
|
||||||
|
set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES})
|
||||||
|
find_package(LuaJit)
|
||||||
|
else()
|
||||||
|
find_package(LuaJit REQUIRED)
|
||||||
|
set(LUA_PREFERRED_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIRS})
|
||||||
|
set(LUA_PREFERRED_LIBRARIES ${LUAJIT_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}")
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
#include <msgpack.h>
|
#include <msgpack.h>
|
||||||
@@ -319,21 +336,31 @@ main(void)
|
|||||||
return MSGPACK_OBJECT_FLOAT32;
|
return MSGPACK_OBJECT_FLOAT32;
|
||||||
}
|
}
|
||||||
" MSGPACK_HAS_FLOAT32)
|
" MSGPACK_HAS_FLOAT32)
|
||||||
|
|
||||||
if(MSGPACK_HAS_FLOAT32)
|
if(MSGPACK_HAS_FLOAT32)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_MSGPACK_HAS_FLOAT32")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_MSGPACK_HAS_FLOAT32")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
option(FEAT_TUI "Enable the Terminal UI" ON)
|
||||||
option(FEAT_TUI "Enable the Terminal UI" ON)
|
|
||||||
else()
|
|
||||||
option(FEAT_TUI "Enable the Terminal UI" OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(FEAT_TUI)
|
if(FEAT_TUI)
|
||||||
find_package(Unibilium REQUIRED)
|
find_package(Unibilium REQUIRED)
|
||||||
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
|
include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}")
|
||||||
|
list(APPEND CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}")
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <unibilium.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main(void)
|
||||||
|
{
|
||||||
|
return unibi_num_from_var(unibi_var_from_num(0));
|
||||||
|
}
|
||||||
|
" UNIBI_HAS_VAR_FROM)
|
||||||
|
if(UNIBI_HAS_VAR_FROM)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_UNIBI_HAS_VAR_FROM")
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(LibTermkey REQUIRED)
|
find_package(LibTermkey REQUIRED)
|
||||||
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
|
include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS})
|
||||||
endif()
|
endif()
|
||||||
@@ -341,6 +368,11 @@ endif()
|
|||||||
find_package(LibVterm REQUIRED)
|
find_package(LibVterm REQUIRED)
|
||||||
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
|
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
find_package(Winpty REQUIRED)
|
||||||
|
include_directories(SYSTEM ${WINPTY_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
|
||||||
option(CLANG_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
|
option(CLANG_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF)
|
||||||
option(CLANG_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
|
option(CLANG_MSAN "Enable Clang memory sanitizer for nvim binary." OFF)
|
||||||
option(CLANG_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
|
option(CLANG_TSAN "Enable Clang thread sanitizer for nvim binary." OFF)
|
||||||
@@ -430,11 +462,7 @@ message(STATUS "Using the Lua interpreter ${LUA_PRG}.")
|
|||||||
find_program(BUSTED_PRG NAMES busted busted.bat)
|
find_program(BUSTED_PRG NAMES busted busted.bat)
|
||||||
find_program(BUSTED_LUA_PRG busted-lua)
|
find_program(BUSTED_LUA_PRG busted-lua)
|
||||||
if(NOT BUSTED_OUTPUT_TYPE)
|
if(NOT BUSTED_OUTPUT_TYPE)
|
||||||
if(WIN32)
|
set(BUSTED_OUTPUT_TYPE "nvim")
|
||||||
set(BUSTED_OUTPUT_TYPE "plainTerminal")
|
|
||||||
else()
|
|
||||||
set(BUSTED_OUTPUT_TYPE "utfTerminal")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_program(LUACHECK_PRG luacheck)
|
find_program(LUACHECK_PRG luacheck)
|
||||||
@@ -445,26 +473,24 @@ include(InstallHelpers)
|
|||||||
file(GLOB MANPAGES
|
file(GLOB MANPAGES
|
||||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
man/nvim.1)
|
man/nvim.1)
|
||||||
|
|
||||||
install_helper(
|
install_helper(
|
||||||
FILES ${MANPAGES}
|
FILES ${MANPAGES}
|
||||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||||
|
|
||||||
# MIN_LOG_LEVEL for log.h
|
# MIN_LOG_LEVEL for log.h
|
||||||
if(DEFINED MIN_LOG_LEVEL)
|
if("${MIN_LOG_LEVEL}" MATCHES "^$")
|
||||||
|
message(STATUS "MIN_LOG_LEVEL not specified")
|
||||||
|
else()
|
||||||
if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
|
if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
|
||||||
message(FATAL_ERROR "MIN_LOG_LEVEL must be a number 0-3")
|
message(FATAL_ERROR "invalid MIN_LOG_LEVEL: " ${MIN_LOG_LEVEL})
|
||||||
endif()
|
endif()
|
||||||
message(STATUS "MIN_LOG_LEVEL set to ${MIN_LOG_LEVEL}")
|
message(STATUS "MIN_LOG_LEVEL set to ${MIN_LOG_LEVEL}")
|
||||||
else()
|
|
||||||
message(STATUS "MIN_LOG_LEVEL not specified, defaulting to INFO(1)")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Go down the tree.
|
# Go down the tree.
|
||||||
|
|
||||||
add_subdirectory(src/nvim)
|
add_subdirectory(src/nvim)
|
||||||
# Read compilation flags from src/nvim,
|
# Read compilation flags from src/nvim, used in config subdirectory below.
|
||||||
# used in config subdirectory below.
|
|
||||||
include(GetCompileFlags)
|
include(GetCompileFlags)
|
||||||
get_compile_flags(NVIM_VERSION_CFLAGS)
|
get_compile_flags(NVIM_VERSION_CFLAGS)
|
||||||
|
|
||||||
@@ -590,9 +616,26 @@ if(LUACHECK_PRG)
|
|||||||
add_custom_target(testlint
|
add_custom_target(testlint
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
-DLUACHECK_PRG=${LUACHECK_PRG}
|
-DLUACHECK_PRG=${LUACHECK_PRG}
|
||||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
-DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||||
|
-DIGNORE_PATTERN="*/preload.lua"
|
||||||
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTestsLint.cmake)
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake)
|
||||||
|
|
||||||
|
add_custom_target(
|
||||||
|
blobcodelint
|
||||||
|
COMMAND
|
||||||
|
${CMAKE_COMMAND}
|
||||||
|
-DLUACHECK_PRG=${LUACHECK_PRG}
|
||||||
|
-DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/src/nvim/lua
|
||||||
|
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
|
||||||
|
-DREAD_GLOBALS=vim
|
||||||
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake
|
||||||
|
)
|
||||||
|
# TODO(ZyX-I): Run linter for all lua code in src
|
||||||
|
add_custom_target(
|
||||||
|
lualint
|
||||||
|
DEPENDS blobcodelint
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CPACK_PACKAGE_NAME "Neovim")
|
set(CPACK_PACKAGE_NAME "Neovim")
|
||||||
|
@@ -6,9 +6,10 @@ Getting started
|
|||||||
If you want to help but don't know where to start, here are some
|
If you want to help but don't know where to start, here are some
|
||||||
low-risk/isolated tasks:
|
low-risk/isolated tasks:
|
||||||
|
|
||||||
- Merge a [Vim patch].
|
- [Merge a Vim patch].
|
||||||
- Try a [complexity:low] issue.
|
- Try a [complexity:low] issue.
|
||||||
- Fix [clang-scan], [coverity](#coverity), and [PVS](#pvs-studio) warnings.
|
- Fix bugs found by [clang scan-build](#clang-scan-build),
|
||||||
|
[coverity](#coverity), and [PVS](#pvs-studio).
|
||||||
|
|
||||||
Developer guidelines
|
Developer guidelines
|
||||||
--------------------
|
--------------------
|
||||||
@@ -22,18 +23,17 @@ Reporting problems
|
|||||||
- Check the [**FAQ**][wiki-faq].
|
- Check the [**FAQ**][wiki-faq].
|
||||||
- Search [existing issues][github-issues] (including closed!)
|
- Search [existing issues][github-issues] (including closed!)
|
||||||
- Update Neovim to the latest version to see if your problem persists.
|
- 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
|
- Disable plugins incrementally, to narrow down the cause of the issue.
|
||||||
in one by one, to narrow down the cause of the issue.
|
- When reporting a crash, include a stacktrace.
|
||||||
- Crash reports which include a stacktrace are 10x more valuable.
|
- [Bisect][git-bisect] to the cause of a regression, if you are able. This is _extremely_ helpful.
|
||||||
- [Bisecting][git-bisect] to the cause of a regression often leads to an
|
- Check `$NVIM_LOG_FILE`, if it exists.
|
||||||
immediate fix.
|
- Include `cmake --system-information` for **build** issues.
|
||||||
|
|
||||||
Pull requests ("PRs")
|
Pull requests ("PRs")
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
- To avoid duplicate work, create a `[WIP]` pull request as soon as possible.
|
- To avoid duplicate work, create a `[WIP]` pull request as soon as possible.
|
||||||
- Avoid cosmetic changes to unrelated files in the same commit: noise makes
|
- Avoid cosmetic changes to unrelated files in the same commit.
|
||||||
reviews take longer.
|
|
||||||
- Use a [feature branch][git-feature-branch] instead of the master branch.
|
- Use a [feature branch][git-feature-branch] instead of the master branch.
|
||||||
- Use a **rebase workflow** for small PRs.
|
- Use a **rebase workflow** for small PRs.
|
||||||
- After addressing review comments, it's fine to rebase and force-push.
|
- After addressing review comments, it's fine to rebase and force-push.
|
||||||
@@ -43,7 +43,7 @@ Pull requests ("PRs")
|
|||||||
- Use the `ri` git alias:
|
- Use the `ri` git alias:
|
||||||
```
|
```
|
||||||
[alias]
|
[alias]
|
||||||
ri = "!sh -c 't=\"${1:-master}\" ; s=\"${2:-HEAD}\" ; if git merge-base --is-ancestor \"$t\" \"$s\" ; then o=\"$t\" ; else mb=\"$(git merge-base \"$t\" \"$s\")\" ; if test \"x$mb\" = x ; then o=\"$t\" ; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\" ; if test \"x$lm\" = x ; then o=\"$mb\" ; else o=\"$lm\" ; fi ; fi ; fi ; [ $# -gt 0 ] && shift ; [ $# -gt 0 ] && shift ; git rebase --interactive \"$o\" \"$@\"' -"
|
ri = "!sh -c 't=\"${1:-master}\"; s=\"${2:-HEAD}\"; mb=\"$(git merge-base \"$t\" \"$s\")\"; if test \"x$mb\" = x ; then o=\"$t\"; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\"; if test \"x$lm\" = x ; then o=\"$mb\"; else o=\"$lm\"; fi; fi; test $# -gt 0 && shift; test $# -gt 0 && shift; git rebase --interactive \"$o\" \"$@\"'"
|
||||||
```
|
```
|
||||||
This avoids unnecessary rebases yet still allows you to combine related
|
This avoids unnecessary rebases yet still allows you to combine related
|
||||||
commits, separate monolithic commits, etc.
|
commits, separate monolithic commits, etc.
|
||||||
@@ -86,16 +86,18 @@ the VCS/git logs more valuable.
|
|||||||
|
|
||||||
### Automated builds (CI)
|
### Automated builds (CI)
|
||||||
|
|
||||||
Each pull request must pass the automated builds ([travis CI] and [quickbuild]).
|
Each pull request must pass the automated builds on [travis CI], [quickbuild]
|
||||||
|
and [AppVeyor].
|
||||||
|
|
||||||
- CI builds are compiled with [`-Werror`][gcc-warnings], so if your PR
|
- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
|
||||||
introduces any compiler warnings, the build will fail.
|
will fail the build.
|
||||||
- If any tests fail, the build will fail.
|
- If any tests fail, the build will fail.
|
||||||
See [Building Neovim#running-tests][wiki-run-tests] to run tests locally.
|
See [Building Neovim#running-tests][wiki-run-tests] to run tests locally.
|
||||||
Passing locally doesn't guarantee passing the CI build, because of the
|
Passing locally doesn't guarantee passing the CI build, because of the
|
||||||
different compilers and platforms tested against.
|
different compilers and platforms tested against.
|
||||||
- CI runs [ASan] and other analyzers. To run valgrind locally:
|
- CI runs [ASan] and other analyzers.
|
||||||
`VALGRIND=1 make test`
|
- To run valgrind locally: `VALGRIND=1 make test`
|
||||||
|
- To run Clang ASan/UBSan locally: `CC=clang make CMAKE_FLAGS="-DCLANG_ASAN_UBSAN=ON"`
|
||||||
- The `lint` build ([#3174][3174]) checks modified lines _and their immediate
|
- The `lint` build ([#3174][3174]) checks modified lines _and their immediate
|
||||||
neighbors_. This is to encourage incrementally updating the legacy style to
|
neighbors_. This is to encourage incrementally updating the legacy style to
|
||||||
meet our style guidelines.
|
meet our style guidelines.
|
||||||
@@ -112,11 +114,19 @@ QuickBuild uses this invocation:
|
|||||||
VERBOSE=1 nvim unittest-prereqs functionaltest-prereqs
|
VERBOSE=1 nvim unittest-prereqs functionaltest-prereqs
|
||||||
|
|
||||||
|
|
||||||
|
### Clang scan-build
|
||||||
|
|
||||||
|
The auto-generated [clang-scan] report presents walk-throughs of bugs found by
|
||||||
|
Clang's [scan-build](https://clang-analyzer.llvm.org/scan-build.html) static
|
||||||
|
analyzer. To verify a fix locally, run `scan-build` like this:
|
||||||
|
|
||||||
|
rm -rf build/
|
||||||
|
scan-build --use-analyzer=/usr/bin/clang make
|
||||||
|
|
||||||
### Coverity
|
### Coverity
|
||||||
|
|
||||||
[Coverity](https://scan.coverity.com/projects/neovim-neovim) runs against the
|
[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
|
master build. To view the defects, just request access; you will be approved.
|
||||||
_Contributor_ level. An Admin will grant you permission.
|
|
||||||
|
|
||||||
Use this commit-message format for coverity fixes:
|
Use this commit-message format for coverity fixes:
|
||||||
|
|
||||||
@@ -126,8 +136,9 @@ where `<id>` is the Coverity ID (CID). For example see [#804](https://github.com
|
|||||||
|
|
||||||
### PVS-Studio
|
### PVS-Studio
|
||||||
|
|
||||||
Run `scripts/pvscheck.sh` to check the codebase with [PVS
|
View the [PVS analysis report](https://neovim.io/doc/reports/pvs/) to see bugs
|
||||||
Studio](https://www.viva64.com/en/pvs-studio/).
|
found by [PVS Studio](https://www.viva64.com/en/pvs-studio/).
|
||||||
|
You can run `scripts/pvscheck.sh` locally to run PVS on your machine.
|
||||||
|
|
||||||
Reviewing
|
Reviewing
|
||||||
---------
|
---------
|
||||||
@@ -163,6 +174,7 @@ as context, use the `-W` argument as well.
|
|||||||
[3174]: https://github.com/neovim/neovim/issues/3174
|
[3174]: https://github.com/neovim/neovim/issues/3174
|
||||||
[travis CI]: https://travis-ci.org/neovim/neovim
|
[travis CI]: https://travis-ci.org/neovim/neovim
|
||||||
[quickbuild]: http://neovim-qb.szakmeister.net/dashboard
|
[quickbuild]: http://neovim-qb.szakmeister.net/dashboard
|
||||||
[Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
|
[AppVeyor]: https://ci.appveyor.com/project/neovim/neovim
|
||||||
|
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
|
||||||
[clang-scan]: https://neovim.io/doc/reports/clang/
|
[clang-scan]: https://neovim.io/doc/reports/clang/
|
||||||
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
|
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
|
||||||
|
@@ -1,16 +1,19 @@
|
|||||||
|
<!-- Before reporting: search existing issues and check the FAQ. -->
|
||||||
|
|
||||||
- `nvim --version`:
|
- `nvim --version`:
|
||||||
- Vim (version: ) behaves differently?
|
- Vim (version: ) behaves differently?
|
||||||
- Operating system/version:
|
- Operating system/version:
|
||||||
- Terminal name/version:
|
- Terminal name/version:
|
||||||
- `$TERM`:
|
- `$TERM`:
|
||||||
|
|
||||||
### Actual behaviour
|
|
||||||
|
|
||||||
### Expected behaviour
|
|
||||||
|
|
||||||
### Steps to reproduce using `nvim -u NORC`
|
### Steps to reproduce using `nvim -u NORC`
|
||||||
|
|
||||||
```
|
```
|
||||||
nvim -u NORC
|
nvim -u NORC
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Actual behaviour
|
||||||
|
|
||||||
|
### Expected behaviour
|
||||||
|
|
||||||
|
10
Makefile
10
Makefile
@@ -107,6 +107,9 @@ functionaltest-lua: | nvim
|
|||||||
testlint: | build/.ran-cmake deps
|
testlint: | build/.ran-cmake deps
|
||||||
$(BUILD_CMD) -C build testlint
|
$(BUILD_CMD) -C build testlint
|
||||||
|
|
||||||
|
lualint: | build/.ran-cmake deps
|
||||||
|
$(BUILD_CMD) -C build lualint
|
||||||
|
|
||||||
unittest: | nvim
|
unittest: | nvim
|
||||||
+$(BUILD_CMD) -C build unittest
|
+$(BUILD_CMD) -C build unittest
|
||||||
|
|
||||||
@@ -135,6 +138,9 @@ clint-full: build/.ran-cmake
|
|||||||
check-single-includes: build/.ran-cmake
|
check-single-includes: build/.ran-cmake
|
||||||
+$(BUILD_CMD) -C build check-single-includes
|
+$(BUILD_CMD) -C build check-single-includes
|
||||||
|
|
||||||
lint: check-single-includes clint testlint
|
appimage:
|
||||||
|
bash scripts/genappimage.sh
|
||||||
|
|
||||||
.PHONY: test testlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install
|
lint: check-single-includes clint testlint lualint
|
||||||
|
|
||||||
|
.PHONY: test testlint lualint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage
|
||||||
|
66
README.md
66
README.md
@@ -8,11 +8,13 @@
|
|||||||
|
|
||||||
[](https://travis-ci.org/neovim/neovim)
|
[](https://travis-ci.org/neovim/neovim)
|
||||||
[](https://ci.appveyor.com/project/neovim/neovim/branch/master)
|
[](https://ci.appveyor.com/project/neovim/neovim/branch/master)
|
||||||
[](https://waffle.io/neovim/neovim)
|
[](https://codecov.io/gh/neovim/neovim)
|
||||||
[](https://coveralls.io/r/neovim/neovim)
|
|
||||||
[](https://scan.coverity.com/projects/2227)
|
[](https://scan.coverity.com/projects/2227)
|
||||||
[](https://neovim.io/doc/reports/clang)
|
[](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>
|
[](https://neovim.io/doc/reports/pvs)
|
||||||
|
|
||||||
|
[](https://buildd.debian.org/neovim)
|
||||||
|
[](https://github.com/neovim/neovim/releases/)
|
||||||
|
|
||||||
Neovim is a project that seeks to aggressively refactor Vim in order to:
|
Neovim is a project that seeks to aggressively refactor Vim in order to:
|
||||||
|
|
||||||
@@ -32,39 +34,58 @@ Install from source
|
|||||||
make CMAKE_BUILD_TYPE=RelWithDebInfo
|
make CMAKE_BUILD_TYPE=RelWithDebInfo
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
|
To install to a non-default location, specify `CMAKE_INSTALL_PREFIX`:
|
||||||
|
|
||||||
|
make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=/full/path/"
|
||||||
|
make install
|
||||||
|
|
||||||
See [the wiki](https://github.com/neovim/neovim/wiki/Building-Neovim) for details.
|
See [the wiki](https://github.com/neovim/neovim/wiki/Building-Neovim) for details.
|
||||||
|
|
||||||
Install from package
|
Install from package
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
Packages are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], and
|
Pre-built packages for Windows, macOS, and Linux are found at the
|
||||||
[more](https://github.com/neovim/neovim/wiki/Installing-Neovim).
|
[Releases](https://github.com/neovim/neovim/releases/) page.
|
||||||
|
|
||||||
|
Managed packages are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], [Gentoo],
|
||||||
|
and [more](https://github.com/neovim/neovim/wiki/Installing-Neovim)!
|
||||||
|
|
||||||
Project layout
|
Project layout
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
- `ci/`: Build server scripts
|
├─ ci/ build automation
|
||||||
- `cmake/`: Build scripts
|
├─ cmake/ build scripts
|
||||||
- `runtime/`: Application files
|
├─ runtime/ user plugins/docs
|
||||||
- [`src/`](src/nvim/README.md): Application source code
|
├─ src/ application source code (see src/nvim/README.md)
|
||||||
- `third-party/`: CMake sub-project to build third-party dependencies (if the
|
│ ├─ api/ API subsystem
|
||||||
`USE_BUNDLED_DEPS` flag is undefined or `USE_BUNDLED` CMake option is false).
|
│ ├─ eval/ VimL subsystem
|
||||||
- [`test/`](test/README.md): Test files
|
│ ├─ event/ event-loop subsystem
|
||||||
|
│ ├─ generators/ code generation (pre-compilation)
|
||||||
|
│ ├─ lib/ generic data structures
|
||||||
|
│ ├─ lua/ lua subsystem
|
||||||
|
│ ├─ msgpack_rpc/ RPC subsystem
|
||||||
|
│ ├─ os/ low-level platform code
|
||||||
|
│ └─ tui/ built-in UI
|
||||||
|
├─ third-party/ cmake subproject to build dependencies
|
||||||
|
└─ test/ tests (see test/README.md)
|
||||||
|
|
||||||
What's been done so far
|
- To disable `third-party/` specify `USE_BUNDLED_DEPS=NO` or `USE_BUNDLED=NO`
|
||||||
-----------------------
|
(CMake option).
|
||||||
|
|
||||||
- RPC API based on [MessagePack](https://msgpack.org)
|
Features
|
||||||
- Embedded [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
|
--------
|
||||||
|
|
||||||
|
- Modern [GUIs](https://github.com/neovim/neovim/wiki/Related-projects#gui)
|
||||||
|
- [API](https://github.com/neovim/neovim/wiki/Related-projects#api-clients)
|
||||||
|
access from any language including clojure, lisp, go, haskell, lua,
|
||||||
|
javascript, perl, python, ruby, rust.
|
||||||
|
- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
|
||||||
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
|
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
|
||||||
- [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances
|
- [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
|
- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support
|
||||||
- [libuv](https://github.com/libuv/libuv/)-based platform/OS layer
|
- Compatible with most Vim plugins, including Ruby and Python plugins.
|
||||||
- [Pushdown automaton](https://github.com/neovim/neovim/pull/3413) input model
|
|
||||||
- 1000s of new tests
|
|
||||||
- Legacy tests converted to Lua tests
|
|
||||||
|
|
||||||
See [`:help nvim-features`][nvim-features] for a comprehensive list.
|
See [`:help nvim-features`][nvim-features] for the full list!
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
@@ -95,11 +116,12 @@ See `LICENSE` for details.
|
|||||||
[license-commit]: https://github.com/neovim/neovim/commit/b17d9691a24099c9210289f16afb1a498a89d803
|
[license-commit]: https://github.com/neovim/neovim/commit/b17d9691a24099c9210289f16afb1a498a89d803
|
||||||
[nvim-features]: https://neovim.io/doc/user/vim_diff.html#nvim-features
|
[nvim-features]: https://neovim.io/doc/user/vim_diff.html#nvim-features
|
||||||
[Roadmap]: https://neovim.io/roadmap/
|
[Roadmap]: https://neovim.io/roadmap/
|
||||||
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui-projects
|
[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui
|
||||||
[Homebrew]: https://github.com/neovim/homebrew-neovim#installation
|
[Homebrew]: https://github.com/neovim/homebrew-neovim#installation
|
||||||
[Debian]: https://packages.debian.org/testing/neovim
|
[Debian]: https://packages.debian.org/testing/neovim
|
||||||
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
|
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
|
||||||
[Fedora]: https://admin.fedoraproject.org/pkgdb/package/rpms/neovim
|
[Fedora]: https://admin.fedoraproject.org/pkgdb/package/rpms/neovim
|
||||||
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
|
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
|
||||||
|
[Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim
|
||||||
|
|
||||||
<!-- vim: set tw=80: -->
|
<!-- vim: set tw=80: -->
|
||||||
|
@@ -1,7 +1,13 @@
|
|||||||
version: '{build}'
|
version: '{build}'
|
||||||
|
environment:
|
||||||
|
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma -mx=9"
|
||||||
configuration:
|
configuration:
|
||||||
- MINGW_64
|
- MINGW_64
|
||||||
- MINGW_32
|
- MINGW_32
|
||||||
|
- MINGW_64-gcov
|
||||||
|
matrix:
|
||||||
|
allow_failures:
|
||||||
|
- configuration: MINGW_64-gcov
|
||||||
install: []
|
install: []
|
||||||
build_script:
|
build_script:
|
||||||
- call ci\build.bat
|
- call ci\build.bat
|
||||||
|
92
busted/outputHandlers/TAP.lua
Normal file
92
busted/outputHandlers/TAP.lua
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
-- TODO(jkeyes): remove this and use the upstream version as soon as it is
|
||||||
|
-- available in a release of busted.
|
||||||
|
|
||||||
|
local pretty = require 'pl.pretty'
|
||||||
|
|
||||||
|
return function(options)
|
||||||
|
local busted = require 'busted'
|
||||||
|
local handler = require 'busted.outputHandlers.base'()
|
||||||
|
|
||||||
|
local success = 'ok %u - %s'
|
||||||
|
local failure = 'not ' .. success
|
||||||
|
local skip = 'ok %u - # SKIP %s'
|
||||||
|
local counter = 0
|
||||||
|
|
||||||
|
handler.suiteReset = function()
|
||||||
|
counter = 0
|
||||||
|
return nil, true
|
||||||
|
end
|
||||||
|
|
||||||
|
handler.suiteEnd = function()
|
||||||
|
print('1..' .. counter)
|
||||||
|
io.flush()
|
||||||
|
return nil, true
|
||||||
|
end
|
||||||
|
|
||||||
|
local function showFailure(t)
|
||||||
|
local message = t.message
|
||||||
|
local trace = t.trace or {}
|
||||||
|
|
||||||
|
if message == nil then
|
||||||
|
message = 'Nil error'
|
||||||
|
elseif type(message) ~= 'string' then
|
||||||
|
message = pretty.write(message)
|
||||||
|
end
|
||||||
|
|
||||||
|
print(failure:format(counter, t.name))
|
||||||
|
print('# ' .. t.element.trace.short_src .. ' @ ' .. t.element.trace.currentline)
|
||||||
|
if t.randomseed then print('# Random seed: ' .. t.randomseed) end
|
||||||
|
print('# Failure message: ' .. message:gsub('\n', '\n# '))
|
||||||
|
if options.verbose and trace.traceback then
|
||||||
|
print('# ' .. trace.traceback:gsub('^\n', '', 1):gsub('\n', '\n# '))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
handler.testStart = function(element, parent)
|
||||||
|
local trace = element.trace
|
||||||
|
if options.verbose and trace and trace.short_src then
|
||||||
|
local fileline = trace.short_src .. ' @ ' .. trace.currentline .. ': '
|
||||||
|
local testName = fileline .. handler.getFullName(element)
|
||||||
|
print('# ' .. testName)
|
||||||
|
end
|
||||||
|
io.flush()
|
||||||
|
|
||||||
|
return nil, true
|
||||||
|
end
|
||||||
|
|
||||||
|
handler.testEnd = function(element, parent, status, trace)
|
||||||
|
counter = counter + 1
|
||||||
|
if status == 'success' then
|
||||||
|
local t = handler.successes[#handler.successes]
|
||||||
|
print(success:format(counter, t.name))
|
||||||
|
elseif status == 'pending' then
|
||||||
|
local t = handler.pendings[#handler.pendings]
|
||||||
|
print(skip:format(counter, (t.message or t.name)))
|
||||||
|
elseif status == 'failure' then
|
||||||
|
showFailure(handler.failures[#handler.failures])
|
||||||
|
elseif status == 'error' then
|
||||||
|
showFailure(handler.errors[#handler.errors])
|
||||||
|
end
|
||||||
|
io.flush()
|
||||||
|
|
||||||
|
return nil, true
|
||||||
|
end
|
||||||
|
|
||||||
|
handler.error = function(element, parent, message, debug)
|
||||||
|
if element.descriptor ~= 'it' then
|
||||||
|
counter = counter + 1
|
||||||
|
showFailure(handler.errors[#handler.errors])
|
||||||
|
end
|
||||||
|
io.flush()
|
||||||
|
|
||||||
|
return nil, true
|
||||||
|
end
|
||||||
|
|
||||||
|
busted.subscribe({ 'suite', 'reset' }, handler.suiteReset)
|
||||||
|
busted.subscribe({ 'suite', 'end' }, handler.suiteEnd)
|
||||||
|
busted.subscribe({ 'test', 'start' }, handler.testStart, { predicate = handler.cancelOnPending })
|
||||||
|
busted.subscribe({ 'test', 'end' }, handler.testEnd, { predicate = handler.cancelOnPending })
|
||||||
|
busted.subscribe({ 'error' }, handler.error)
|
||||||
|
|
||||||
|
return handler
|
||||||
|
end
|
@@ -5,4 +5,5 @@ set -o pipefail
|
|||||||
|
|
||||||
if [[ -n "${GCOV}" ]]; then
|
if [[ -n "${GCOV}" ]]; then
|
||||||
coveralls --gcov "$(which "${GCOV}")" --encoding iso-8859-1 || echo 'coveralls upload failed.'
|
coveralls --gcov "$(which "${GCOV}")" --encoding iso-8859-1 || echo 'coveralls upload failed.'
|
||||||
|
bash <(curl -s https://codecov.io/bash) || echo 'codecov upload failed.'
|
||||||
fi
|
fi
|
||||||
|
@@ -11,6 +11,18 @@ if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
|||||||
brew update
|
brew update
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo 'python info:'
|
||||||
|
(
|
||||||
|
2>&1 python --version || true
|
||||||
|
2>&1 python2 --version || true
|
||||||
|
2>&1 python3 --version || true
|
||||||
|
2>&1 pip --version || true
|
||||||
|
2>&1 pip2 --version || true
|
||||||
|
2>&1 pip3 --version || true
|
||||||
|
echo 'pyenv versions:'
|
||||||
|
2>&1 pyenv versions || true
|
||||||
|
) | sed 's/^/ /'
|
||||||
|
|
||||||
echo "Upgrade Python 2 pip."
|
echo "Upgrade Python 2 pip."
|
||||||
pip2.7 -q install --user --upgrade pip
|
pip2.7 -q install --user --upgrade pip
|
||||||
|
|
||||||
@@ -21,5 +33,7 @@ if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
|||||||
pip3 -q install --user --upgrade pip
|
pip3 -q install --user --upgrade pip
|
||||||
else
|
else
|
||||||
echo "Upgrade Python 3 pip."
|
echo "Upgrade Python 3 pip."
|
||||||
pip3 -q install --user --upgrade pip
|
# Allow failure. pyenv pip3 on travis is broken:
|
||||||
|
# https://github.com/travis-ci/travis-ci/issues/8363
|
||||||
|
pip3 -q install --user --upgrade pip || true
|
||||||
fi
|
fi
|
||||||
|
18
ci/build.bat
18
ci/build.bat
@@ -9,6 +9,10 @@ if "%CONFIGURATION%" == "MINGW_32" (
|
|||||||
set ARCH=x86_64
|
set ARCH=x86_64
|
||||||
set BITS=64
|
set BITS=64
|
||||||
)
|
)
|
||||||
|
if "%CONFIGURATION%" == "MINGW_64-gcov" (
|
||||||
|
set USE_GCOV="-DUSE_GCOV=ON"
|
||||||
|
)
|
||||||
|
|
||||||
:: We cannot have sh.exe in the PATH (MinGW)
|
:: We cannot have sh.exe in the PATH (MinGW)
|
||||||
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
|
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
|
||||||
set PATH=C:\msys64\mingw%BITS%\bin;C:\Windows\System32;C:\Windows;%PATH%
|
set PATH=C:\msys64\mingw%BITS%\bin;C:\Windows\System32;C:\Windows;%PATH%
|
||||||
@@ -17,7 +21,7 @@ set PATH=C:\Program Files (x86)\CMake\bin\cpack.exe;%PATH%
|
|||||||
|
|
||||||
:: Build third-party dependencies
|
:: 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 -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%-diffutils gperf" || goto :error
|
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-perl mingw-w64-%ARCH%-diffutils mingw-w64-%ARCH%-unibilium gperf" || goto :error
|
||||||
|
|
||||||
:: Setup python (use AppVeyor system python)
|
:: Setup python (use AppVeyor system python)
|
||||||
C:\Python27\python.exe -m pip install neovim || goto :error
|
C:\Python27\python.exe -m pip install neovim || goto :error
|
||||||
@@ -31,23 +35,27 @@ python3 -c "import neovim; print(str(neovim))" || goto :error
|
|||||||
|
|
||||||
mkdir .deps
|
mkdir .deps
|
||||||
cd .deps
|
cd .deps
|
||||||
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..\third-party\ || goto :error
|
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo ..\third-party\ || goto :error
|
||||||
mingw32-make VERBOSE=1 || goto :error
|
mingw32-make VERBOSE=1 || goto :error
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
:: Build Neovim
|
:: Build Neovim
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUSTED_OUTPUT_TYPE=nvim -DGPERF_PRG="C:\msys64\usr\bin\gperf.exe" .. || goto :error
|
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUSTED_OUTPUT_TYPE=nvim %USE_GCOV% -DGPERF_PRG="C:\msys64\usr\bin\gperf.exe" .. || goto :error
|
||||||
mingw32-make VERBOSE=1 || goto :error
|
mingw32-make VERBOSE=1 || goto :error
|
||||||
bin\nvim --version || goto :error
|
bin\nvim --version || goto :error
|
||||||
|
|
||||||
:: Functional tests
|
:: Functional tests
|
||||||
mingw32-make functionaltest VERBOSE=1 || goto :error
|
mingw32-make functionaltest VERBOSE=1 || goto :error
|
||||||
|
|
||||||
|
if defined USE_GCOV (
|
||||||
|
C:\msys64\usr\bin\bash -lc "cd /c/projects/neovim; bash <(curl -s https://codecov.io/bash) || echo 'codecov upload failed.'"
|
||||||
|
)
|
||||||
|
|
||||||
:: Build artifacts
|
:: Build artifacts
|
||||||
cpack -G ZIP -C Release
|
cpack -G ZIP -C RelWithDebInfo
|
||||||
if defined APPVEYOR_REPO_TAG_NAME cpack -G NSIS -C Release
|
if defined APPVEYOR_REPO_TAG_NAME cpack -G NSIS -C RelWithDebInfo
|
||||||
|
|
||||||
goto :EOF
|
goto :EOF
|
||||||
:error
|
:error
|
||||||
|
@@ -10,7 +10,8 @@ build_deps() {
|
|||||||
if test "${BUILD_32BIT}" = ON ; then
|
if test "${BUILD_32BIT}" = ON ; then
|
||||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||||
fi
|
fi
|
||||||
if test "${FUNCTIONALTEST}" = "functionaltest-lua" ; then
|
if test "${FUNCTIONALTEST}" = "functionaltest-lua" \
|
||||||
|
|| test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
|
||||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
|
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -39,6 +39,13 @@ enter_suite() {
|
|||||||
|
|
||||||
exit_suite() {
|
exit_suite() {
|
||||||
set +x
|
set +x
|
||||||
|
if test -f "$NVIM_LOG_FILE" ; then
|
||||||
|
printf "===============================================================================\n"
|
||||||
|
printf "NVIM_LOG_FILE: $NVIM_LOG_FILE\n"
|
||||||
|
cat "$NVIM_LOG_FILE" 2>/dev/null || printf '(empty)'
|
||||||
|
printf "\n"
|
||||||
|
rm -rf "$NVIM_LOG_FILE"
|
||||||
|
fi
|
||||||
travis_fold end "${NVIM_TEST_CURRENT_SUITE}"
|
travis_fold end "${NVIM_TEST_CURRENT_SUITE}"
|
||||||
if test $FAILED -ne 0 ; then
|
if test $FAILED -ne 0 ; then
|
||||||
echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:"
|
echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:"
|
||||||
|
@@ -17,7 +17,9 @@ echo "Install neovim module and coveralls for Python 2."
|
|||||||
CC=cc pip2.7 -q install --user --upgrade neovim cpp-coveralls
|
CC=cc pip2.7 -q install --user --upgrade neovim cpp-coveralls
|
||||||
|
|
||||||
echo "Install neovim module for Python 3."
|
echo "Install neovim module for Python 3."
|
||||||
CC=cc pip3 -q install --user --upgrade neovim
|
# Allow failure. pyenv pip3 on travis is broken:
|
||||||
|
# https://github.com/travis-ci/travis-ci/issues/8363
|
||||||
|
CC=cc pip3 -q install --user --upgrade neovim || true
|
||||||
|
|
||||||
echo "Install neovim RubyGem."
|
echo "Install neovim RubyGem."
|
||||||
gem install --no-document --version ">= 0.2.0" neovim
|
gem install --no-document --version ">= 0.2.0" neovim
|
||||||
|
@@ -20,6 +20,12 @@ run_test 'top_make testlint' testlint
|
|||||||
|
|
||||||
exit_suite --continue
|
exit_suite --continue
|
||||||
|
|
||||||
|
enter_suite 'lualint'
|
||||||
|
|
||||||
|
run_test 'top_make lualint' lualint
|
||||||
|
|
||||||
|
exit_suite --continue
|
||||||
|
|
||||||
enter_suite single-includes
|
enter_suite single-includes
|
||||||
|
|
||||||
CLICOLOR_FORCE=1 run_test_wd \
|
CLICOLOR_FORCE=1 run_test_wd \
|
||||||
|
@@ -27,6 +27,9 @@ find_path(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h
|
|||||||
if(JEMALLOC_USE_STATIC)
|
if(JEMALLOC_USE_STATIC)
|
||||||
list(APPEND JEMALLOC_NAMES
|
list(APPEND JEMALLOC_NAMES
|
||||||
"${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
"${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
|
list(INSERT JEMALLOC_NAMES 0
|
||||||
|
"${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND JEMALLOC_NAMES jemalloc)
|
list(APPEND JEMALLOC_NAMES jemalloc)
|
||||||
|
@@ -46,6 +46,7 @@ check_c_source_compiles("
|
|||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
gettext(\"foo\");
|
gettext(\"foo\");
|
||||||
|
ngettext(\"foo\", \"bar\", 1);
|
||||||
bindtextdomain(\"foo\", \"bar\");
|
bindtextdomain(\"foo\", \"bar\");
|
||||||
bind_textdomain_codeset(\"foo\", \"bar\");
|
bind_textdomain_codeset(\"foo\", \"bar\");
|
||||||
textdomain(\"foo\");
|
textdomain(\"foo\");
|
||||||
|
@@ -65,7 +65,7 @@ if(HAVE_LIBKSTAT)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
check_library_exists(kvm kvm_open "kvm.h" HAVE_LIBKVM)
|
check_library_exists(kvm kvm_open "kvm.h" HAVE_LIBKVM)
|
||||||
if(HAVE_LIBKVM)
|
if(HAVE_LIBKVM AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||||
list(APPEND LIBUV_LIBRARIES kvm)
|
list(APPEND LIBUV_LIBRARIES kvm)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
197
cmake/FindLua.cmake
Normal file
197
cmake/FindLua.cmake
Normal file
@@ -0,0 +1,197 @@
|
|||||||
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||||
|
|
||||||
|
#.rst:
|
||||||
|
# FindLua
|
||||||
|
# -------
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Locate Lua library This module defines
|
||||||
|
#
|
||||||
|
# ::
|
||||||
|
#
|
||||||
|
# LUA_FOUND - if false, do not try to link to Lua
|
||||||
|
# LUA_LIBRARIES - both lua and lualib
|
||||||
|
# LUA_INCLUDE_DIR - where to find lua.h
|
||||||
|
# LUA_VERSION_STRING - the version of Lua found
|
||||||
|
# LUA_VERSION_MAJOR - the major version of Lua
|
||||||
|
# LUA_VERSION_MINOR - the minor version of Lua
|
||||||
|
# LUA_VERSION_PATCH - the patch version of Lua
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Note that the expected include convention is
|
||||||
|
#
|
||||||
|
# ::
|
||||||
|
#
|
||||||
|
# #include "lua.h"
|
||||||
|
#
|
||||||
|
# and not
|
||||||
|
#
|
||||||
|
# ::
|
||||||
|
#
|
||||||
|
# #include <lua/lua.h>
|
||||||
|
#
|
||||||
|
# This is because, the lua location is not standardized and may exist in
|
||||||
|
# locations other than lua/
|
||||||
|
|
||||||
|
unset(_lua_include_subdirs)
|
||||||
|
unset(_lua_library_names)
|
||||||
|
unset(_lua_append_versions)
|
||||||
|
|
||||||
|
# this is a function only to have all the variables inside go away automatically
|
||||||
|
function(_lua_set_version_vars)
|
||||||
|
set(LUA_VERSIONS5 5.3 5.2 5.1 5.0)
|
||||||
|
|
||||||
|
if (Lua_FIND_VERSION_EXACT)
|
||||||
|
if (Lua_FIND_VERSION_COUNT GREATER 1)
|
||||||
|
set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR})
|
||||||
|
endif ()
|
||||||
|
elseif (Lua_FIND_VERSION)
|
||||||
|
# once there is a different major version supported this should become a loop
|
||||||
|
if (NOT Lua_FIND_VERSION_MAJOR GREATER 5)
|
||||||
|
if (Lua_FIND_VERSION_COUNT EQUAL 1)
|
||||||
|
set(_lua_append_versions ${LUA_VERSIONS5})
|
||||||
|
else ()
|
||||||
|
foreach (subver IN LISTS LUA_VERSIONS5)
|
||||||
|
if (NOT subver VERSION_LESS ${Lua_FIND_VERSION})
|
||||||
|
list(APPEND _lua_append_versions ${subver})
|
||||||
|
endif ()
|
||||||
|
endforeach ()
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
else ()
|
||||||
|
# once there is a different major version supported this should become a loop
|
||||||
|
set(_lua_append_versions ${LUA_VERSIONS5})
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
list(APPEND _lua_include_subdirs "include/lua" "include")
|
||||||
|
|
||||||
|
foreach (ver IN LISTS _lua_append_versions)
|
||||||
|
string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}")
|
||||||
|
list(APPEND _lua_include_subdirs
|
||||||
|
include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
|
||||||
|
include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
||||||
|
include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
|
||||||
|
)
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
|
set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
|
||||||
|
set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE)
|
||||||
|
endfunction(_lua_set_version_vars)
|
||||||
|
|
||||||
|
function(_lua_check_header_version _hdr_file)
|
||||||
|
# At least 5.[012] have different ways to express the version
|
||||||
|
# so all of them need to be tested. Lua 5.2 defines LUA_VERSION
|
||||||
|
# and LUA_RELEASE as joined by the C preprocessor, so avoid those.
|
||||||
|
file(STRINGS "${_hdr_file}" lua_version_strings
|
||||||
|
REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
|
||||||
|
|
||||||
|
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
|
||||||
|
if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
|
||||||
|
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
|
||||||
|
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
|
||||||
|
set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
|
||||||
|
else ()
|
||||||
|
string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
|
||||||
|
if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$")
|
||||||
|
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")
|
||||||
|
endif ()
|
||||||
|
string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}")
|
||||||
|
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}")
|
||||||
|
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}")
|
||||||
|
endif ()
|
||||||
|
foreach (ver IN LISTS _lua_append_versions)
|
||||||
|
if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
|
||||||
|
set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE)
|
||||||
|
set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE)
|
||||||
|
set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE)
|
||||||
|
set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif ()
|
||||||
|
endforeach ()
|
||||||
|
endfunction(_lua_check_header_version)
|
||||||
|
|
||||||
|
_lua_set_version_vars()
|
||||||
|
|
||||||
|
if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
|
||||||
|
_lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (NOT LUA_VERSION_STRING)
|
||||||
|
foreach (subdir IN LISTS _lua_include_subdirs)
|
||||||
|
unset(LUA_INCLUDE_PREFIX CACHE)
|
||||||
|
find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h
|
||||||
|
HINTS
|
||||||
|
ENV LUA_DIR
|
||||||
|
PATHS
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/sw # Fink
|
||||||
|
/opt/local # DarwinPorts
|
||||||
|
/opt/csw # Blastwave
|
||||||
|
/opt
|
||||||
|
)
|
||||||
|
if (LUA_INCLUDE_PREFIX)
|
||||||
|
_lua_check_header_version("${LUA_INCLUDE_PREFIX}/${subdir}/lua.h")
|
||||||
|
if (LUA_VERSION_STRING)
|
||||||
|
set(LUA_INCLUDE_DIR "${LUA_INCLUDE_PREFIX}/${subdir}")
|
||||||
|
break()
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
endforeach ()
|
||||||
|
endif ()
|
||||||
|
unset(_lua_include_subdirs)
|
||||||
|
unset(_lua_append_versions)
|
||||||
|
|
||||||
|
if (LUA_VERSION_STRING)
|
||||||
|
set(_lua_library_names
|
||||||
|
lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}
|
||||||
|
lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
|
||||||
|
lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
|
||||||
|
lua.${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
find_library(LUA_LIBRARY
|
||||||
|
NAMES ${_lua_library_names} lua
|
||||||
|
HINTS
|
||||||
|
ENV LUA_DIR
|
||||||
|
PATH_SUFFIXES lib
|
||||||
|
PATHS
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/sw
|
||||||
|
/opt/local
|
||||||
|
/opt/csw
|
||||||
|
/opt
|
||||||
|
)
|
||||||
|
unset(_lua_library_names)
|
||||||
|
|
||||||
|
if (LUA_LIBRARY)
|
||||||
|
# include the math library for Unix
|
||||||
|
if (UNIX AND NOT APPLE AND NOT BEOS)
|
||||||
|
find_library(LUA_MATH_LIBRARY m)
|
||||||
|
set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}")
|
||||||
|
|
||||||
|
# include dl library for statically-linked Lua library
|
||||||
|
get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT)
|
||||||
|
if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX)
|
||||||
|
list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# For Windows and Mac, don't need to explicitly include the math library
|
||||||
|
else ()
|
||||||
|
set(LUA_LIBRARIES "${LUA_LIBRARY}")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
||||||
|
# all listed variables are TRUE
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua
|
||||||
|
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
|
||||||
|
VERSION_VAR LUA_VERSION_STRING)
|
||||||
|
|
||||||
|
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY)
|
10
cmake/FindWinpty.cmake
Normal file
10
cmake/FindWinpty.cmake
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
include(LibFindMacros)
|
||||||
|
|
||||||
|
find_path(WINPTY_INCLUDE_DIR winpty.h)
|
||||||
|
set(WINPTY_INCLUDE_DIRS ${WINPTY_INCLUDE_DIR})
|
||||||
|
|
||||||
|
find_library(WINPTY_LIBRARY winpty)
|
||||||
|
find_program(WINPTY_AGENT_EXE winpty-agent.exe)
|
||||||
|
set(WINPTY_LIBRARIES ${WINPTY_LIBRARY})
|
||||||
|
|
||||||
|
find_package_handle_standard_args(Winpty DEFAULT_MSG WINPTY_LIBRARY WINPTY_INCLUDE_DIR)
|
@@ -1,3 +1,12 @@
|
|||||||
|
# Fix CMAKE_INSTALL_MANDIR on BSD before including GNUInstallDirs. #6771
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "BSD" AND NOT DEFINED CMAKE_INSTALL_MANDIR)
|
||||||
|
if(DEFINED ENV{MANPREFIX})
|
||||||
|
set(CMAKE_INSTALL_MANDIR "$ENV{MANPREFIX}/man")
|
||||||
|
elseif(CMAKE_INSTALL_PREFIX MATCHES "^/usr/local$")
|
||||||
|
set(CMAKE_INSTALL_MANDIR "man")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# For $CMAKE_INSTALL_{DATAROOT,MAN, ...}DIR
|
# For $CMAKE_INSTALL_{DATAROOT,MAN, ...}DIR
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
22
cmake/RunLuacheck.cmake
Normal file
22
cmake/RunLuacheck.cmake
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
set(LUACHECK_ARGS -q "${LUAFILES_DIR}")
|
||||||
|
if(DEFINED IGNORE_PATTERN)
|
||||||
|
list(APPEND LUACHECK_ARGS --exclude-files "${LUAFILES_DIR}/${IGNORE_PATTERN}")
|
||||||
|
endif()
|
||||||
|
if(DEFINED CHECK_PATTERN)
|
||||||
|
list(APPEND LUACHECK_ARGS --include-files "${LUAFILES_DIR}/${CHECK_PATTERN}")
|
||||||
|
endif()
|
||||||
|
if(DEFINED READ_GLOBALS)
|
||||||
|
list(APPEND LUACHECK_ARGS --read-globals "${READ_GLOBALS}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${LUACHECK_PRG}" ${LUACHECK_ARGS}
|
||||||
|
WORKING_DIRECTORY "${LUAFILES_DIR}"
|
||||||
|
ERROR_VARIABLE err
|
||||||
|
RESULT_VARIABLE res
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT res EQUAL 0)
|
||||||
|
message(STATUS "Output to stderr:\n${err}")
|
||||||
|
message(FATAL_ERROR "Linting tests failed with error: ${res}.")
|
||||||
|
endif()
|
@@ -1,8 +1,15 @@
|
|||||||
|
# Set LC_ALL to meet expectations of some locale-sensitive tests.
|
||||||
|
set(ENV{LC_ALL} "en_US.UTF-8")
|
||||||
|
|
||||||
set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime)
|
set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime)
|
||||||
set(ENV{NVIM_RPLUGIN_MANIFEST} ${WORKING_DIR}/Xtest_rplugin_manifest)
|
set(ENV{NVIM_RPLUGIN_MANIFEST} ${WORKING_DIR}/Xtest_rplugin_manifest)
|
||||||
set(ENV{XDG_CONFIG_HOME} ${WORKING_DIR}/Xtest_xdg/config)
|
set(ENV{XDG_CONFIG_HOME} ${WORKING_DIR}/Xtest_xdg/config)
|
||||||
set(ENV{XDG_DATA_HOME} ${WORKING_DIR}/Xtest_xdg/share)
|
set(ENV{XDG_DATA_HOME} ${WORKING_DIR}/Xtest_xdg/share)
|
||||||
|
|
||||||
|
if(NOT DEFINED ENV{NVIM_LOG_FILE})
|
||||||
|
set(ENV{NVIM_LOG_FILE} ${WORKING_DIR}/.nvimlog)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NVIM_PRG)
|
if(NVIM_PRG)
|
||||||
set(ENV{NVIM_PRG} "${NVIM_PRG}")
|
set(ENV{NVIM_PRG} "${NVIM_PRG}")
|
||||||
endif()
|
endif()
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
set(IGNORE_FILES "${TEST_DIR}/*/preload.lua")
|
|
||||||
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${LUACHECK_PRG} -q ${TEST_DIR} --exclude-files ${IGNORE_FILES}
|
|
||||||
WORKING_DIRECTORY ${TEST_DIR}
|
|
||||||
ERROR_VARIABLE err
|
|
||||||
RESULT_VARIABLE res
|
|
||||||
${EXTRA_ARGS})
|
|
||||||
|
|
||||||
if(NOT res EQUAL 0)
|
|
||||||
message(STATUS "Output to stderr:\n${err}")
|
|
||||||
message(FATAL_ERROR "Linting tests failed with error: ${res}.")
|
|
||||||
endif()
|
|
27
codecov.yml
Normal file
27
codecov.yml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
codecov:
|
||||||
|
notify:
|
||||||
|
require_ci_to_pass: yes
|
||||||
|
ci:
|
||||||
|
- appveyor
|
||||||
|
- travis
|
||||||
|
- !neovim-qb.szakmeister.net
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
precision: 2
|
||||||
|
round: down
|
||||||
|
range: "70...100"
|
||||||
|
|
||||||
|
status:
|
||||||
|
project: yes
|
||||||
|
patch: yes
|
||||||
|
changes: no
|
||||||
|
|
||||||
|
parsers:
|
||||||
|
gcov:
|
||||||
|
branch_detection:
|
||||||
|
conditional: yes
|
||||||
|
loop: yes
|
||||||
|
method: no
|
||||||
|
macro: no
|
||||||
|
|
||||||
|
comment: off
|
@@ -68,4 +68,6 @@
|
|||||||
#cmakedefine ORDER_BIG_ENDIAN
|
#cmakedefine ORDER_BIG_ENDIAN
|
||||||
#define ENDIAN_INCLUDE_FILE <@ENDIAN_INCLUDE_FILE@>
|
#define ENDIAN_INCLUDE_FILE <@ENDIAN_INCLUDE_FILE@>
|
||||||
|
|
||||||
|
#cmakedefine HAVE_EXECINFO_BACKTRACE
|
||||||
|
|
||||||
#endif // AUTO_CONFIG_H
|
#endif // AUTO_CONFIG_H
|
||||||
|
@@ -13,27 +13,21 @@
|
|||||||
|
|
||||||
# Sets the build type; defaults to Debug. Valid values:
|
# Sets the build type; defaults to Debug. Valid values:
|
||||||
#
|
#
|
||||||
# - Debug: Disables optimizations (-O0), enables debug information and logging.
|
# - Debug: Disables optimizations (-O0), enables debug information.
|
||||||
#
|
#
|
||||||
# - Dev: Enables all optimizations that do not interfere with
|
# - RelWithDebInfo: Enables optimizations (-Og or -O2) with debug information.
|
||||||
# debugging (-Og if available, -O2 and -g if not).
|
|
||||||
# Enables debug information and logging.
|
|
||||||
#
|
|
||||||
# - RelWithDebInfo: Enables optimizations (-O2) and debug information.
|
|
||||||
# Disables logging.
|
|
||||||
#
|
#
|
||||||
# - MinSizeRel: Enables all -O2 optimization that do not typically
|
# - MinSizeRel: Enables all -O2 optimization that do not typically
|
||||||
# increase code size, and performs further optimizations
|
# increase code size, and performs further optimizations
|
||||||
# designed to reduce code size (-Os).
|
# designed to reduce code size (-Os).
|
||||||
# Disables debug information and logging.
|
# Disables debug information.
|
||||||
#
|
#
|
||||||
# - Release: Same as RelWithDebInfo, but disables debug information.
|
# - Release: Same as RelWithDebInfo, but disables debug information.
|
||||||
#
|
#
|
||||||
# CMAKE_BUILD_TYPE := Debug
|
# CMAKE_BUILD_TYPE := Debug
|
||||||
|
|
||||||
# By default, nvim's log level is INFO (1) (unless CMAKE_BUILD_TYPE is
|
# Log levels: 0 (DEBUG), 1 (INFO), 2 (WARNING), 3 (ERROR)
|
||||||
# "Release", in which case logging is disabled).
|
# Default is 1 (INFO) unless CMAKE_BUILD_TYPE is Release or RelWithDebInfo.
|
||||||
# The log level must be a number DEBUG (0), INFO (1), WARNING (2) or ERROR (3).
|
|
||||||
# CMAKE_EXTRA_FLAGS += -DMIN_LOG_LEVEL=1
|
# CMAKE_EXTRA_FLAGS += -DMIN_LOG_LEVEL=1
|
||||||
|
|
||||||
# By default, nvim uses bundled versions of its required third-party
|
# By default, nvim uses bundled versions of its required third-party
|
||||||
|
@@ -71,6 +71,7 @@ foreach(DF ${DOCFILES})
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_custom_target(helptags
|
add_custom_target(helptags
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E remove_directory ${GENERATED_RUNTIME_DIR}/doc
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
|
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
|
||||||
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
|
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
|
||||||
@@ -100,20 +101,6 @@ add_custom_target(
|
|||||||
${GENERATED_PACKAGE_TAGS}
|
${GENERATED_PACKAGE_TAGS}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Optional targets for nvim.desktop file and icon.
|
|
||||||
find_program(XDG_MENU_PRG xdg-desktop-menu)
|
|
||||||
find_program(XDG_ICON_PRG xdg-icon-resource)
|
|
||||||
if(XDG_MENU_PRG)
|
|
||||||
add_custom_target(desktop-file
|
|
||||||
COMMAND xdg-desktop-menu install --novendor ${PROJECT_SOURCE_DIR}/runtime/nvim.desktop)
|
|
||||||
# add_dependencies(runtime desktop-file)
|
|
||||||
endif()
|
|
||||||
if(XDG_ICON_PRG)
|
|
||||||
add_custom_target(desktop-icon
|
|
||||||
COMMAND xdg-icon-resource install --novendor --size 128 ${PROJECT_SOURCE_DIR}/runtime/nvim.png)
|
|
||||||
# add_dependencies(runtime desktop-icon)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# CMake is painful here. It will create the destination using the user's
|
# CMake is painful here. It will create the destination using the user's
|
||||||
# current umask, and we don't want that. And we don't just want to install
|
# current umask, and we don't want that. And we don't just want to install
|
||||||
# the target directory, as it will mess with existing permissions. So this
|
# the target directory, as it will mess with existing permissions. So this
|
||||||
@@ -128,6 +115,16 @@ install_helper(
|
|||||||
FILES ${GENERATED_SYN_VIM}
|
FILES ${GENERATED_SYN_VIM}
|
||||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/syntax/vim)
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/syntax/vim)
|
||||||
|
|
||||||
|
if(NOT APPLE)
|
||||||
|
install_helper(
|
||||||
|
FILES ${CMAKE_CURRENT_SOURCE_DIR}/nvim.desktop
|
||||||
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
||||||
|
|
||||||
|
install_helper(
|
||||||
|
FILES ${CMAKE_CURRENT_SOURCE_DIR}/nvim.png
|
||||||
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
|
||||||
|
endif()
|
||||||
|
|
||||||
file(GLOB_RECURSE RUNTIME_PROGRAMS
|
file(GLOB_RECURSE RUNTIME_PROGRAMS
|
||||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
*.awk *.sh *.bat)
|
*.awk *.sh *.bat)
|
||||||
@@ -140,6 +137,7 @@ endforeach()
|
|||||||
|
|
||||||
file(GLOB_RECURSE RUNTIME_FILES
|
file(GLOB_RECURSE RUNTIME_FILES
|
||||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
rgb.txt
|
||||||
*.vim *.dict *.py *.rb *.ps *.tutor)
|
*.vim *.dict *.py *.rb *.ps *.tutor)
|
||||||
|
|
||||||
foreach(F ${RUNTIME_FILES})
|
foreach(F ${RUNTIME_FILES})
|
||||||
|
@@ -591,7 +591,7 @@ function ada#Map_Menu (Text, Keys, Command)
|
|||||||
\" :" . a:Command
|
\" :" . a:Command
|
||||||
execute
|
execute
|
||||||
\ "inoremap <buffer>" .
|
\ "inoremap <buffer>" .
|
||||||
\ " <Learder>a" . a:Keys .
|
\ " <Leader>a" . a:Keys .
|
||||||
\" <C-O>:" . a:Command
|
\" <C-O>:" . a:Command
|
||||||
endif
|
endif
|
||||||
return
|
return
|
||||||
|
@@ -1,24 +1,24 @@
|
|||||||
function! s:enhance_syntax() abort
|
function! s:enhance_syntax() abort
|
||||||
syntax case match
|
syntax case match
|
||||||
|
|
||||||
syntax keyword healthError ERROR
|
syntax keyword healthError ERROR[:]
|
||||||
\ containedin=markdownCodeBlock,mkdListItemLine
|
\ containedin=markdownCodeBlock,mkdListItemLine
|
||||||
highlight link healthError Error
|
highlight default link healthError Error
|
||||||
|
|
||||||
syntax keyword healthWarning WARNING
|
syntax keyword healthWarning WARNING[:]
|
||||||
\ containedin=markdownCodeBlock,mkdListItemLine
|
\ containedin=markdownCodeBlock,mkdListItemLine
|
||||||
highlight link healthWarning WarningMsg
|
highlight default link healthWarning WarningMsg
|
||||||
|
|
||||||
syntax keyword healthSuccess SUCCESS
|
syntax keyword healthSuccess OK[:]
|
||||||
\ containedin=markdownCodeBlock,mkdListItemLine
|
\ containedin=markdownCodeBlock,mkdListItemLine
|
||||||
highlight healthSuccess guibg=#5fff00 guifg=#080808 ctermbg=82 ctermfg=232
|
highlight default healthSuccess guibg=#5fff00 guifg=#080808 ctermbg=82 ctermfg=232
|
||||||
|
|
||||||
syntax match healthHelp "|.\{-}|" contains=healthBar
|
syntax match healthHelp "|.\{-}|" contains=healthBar
|
||||||
\ containedin=markdownCodeBlock,mkdListItemLine
|
\ containedin=markdownCodeBlock,mkdListItemLine
|
||||||
syntax match healthBar "|" contained conceal
|
syntax match healthBar "|" contained conceal
|
||||||
highlight link healthHelp Identifier
|
highlight default link healthHelp Identifier
|
||||||
|
|
||||||
" We do not care about markdown syntax errors in :CheckHealth output.
|
" We do not care about markdown syntax errors in :checkhealth output.
|
||||||
highlight! link markdownError Normal
|
highlight! link markdownError Normal
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -33,7 +33,8 @@ function! health#check(plugin_names) abort
|
|||||||
setlocal wrap breakindent
|
setlocal wrap breakindent
|
||||||
setlocal filetype=markdown
|
setlocal filetype=markdown
|
||||||
setlocal conceallevel=2 concealcursor=nc
|
setlocal conceallevel=2 concealcursor=nc
|
||||||
setlocal keywordprg=:help iskeyword=@,48-57,_,192-255,-,#
|
setlocal keywordprg=:help
|
||||||
|
let &l:iskeyword='!-~,^*,^|,^",192-255'
|
||||||
call s:enhance_syntax()
|
call s:enhance_syntax()
|
||||||
|
|
||||||
if empty(healthchecks)
|
if empty(healthchecks)
|
||||||
@@ -66,6 +67,7 @@ function! health#check(plugin_names) abort
|
|||||||
" needed for plasticboy/vim-markdown, because it uses fdm=expr
|
" needed for plasticboy/vim-markdown, because it uses fdm=expr
|
||||||
normal! zR
|
normal! zR
|
||||||
setlocal nomodified
|
setlocal nomodified
|
||||||
|
setlocal bufhidden=hide
|
||||||
redraw|echo ''
|
redraw|echo ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -88,27 +90,27 @@ endfunction
|
|||||||
|
|
||||||
" Changes ':h clipboard' to ':help |clipboard|'.
|
" Changes ':h clipboard' to ':help |clipboard|'.
|
||||||
function! s:help_to_link(s) abort
|
function! s:help_to_link(s) abort
|
||||||
return substitute(a:s, '\v:h%[elp] ([^|][^"\r\n]+)', ':help |\1|', 'g')
|
return substitute(a:s, '\v:h%[elp] ([^|][^"\r\n ]+)', ':help |\1|', 'g')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Format a message for a specific report item
|
" Format a message for a specific report item
|
||||||
function! s:format_report_message(status, msg, ...) abort " {{{
|
function! s:format_report_message(status, msg, ...) abort " {{{
|
||||||
let output = ' - ' . a:status . ': ' . s:indent_after_line1(a:msg, 4)
|
let output = ' - ' . a:status . ': ' . s:indent_after_line1(a:msg, 4)
|
||||||
let suggestions = []
|
let advice = []
|
||||||
|
|
||||||
" Optional parameters
|
" Optional parameters
|
||||||
if a:0 > 0
|
if a:0 > 0
|
||||||
let suggestions = type(a:1) == type("") ? [a:1] : a:1
|
let advice = type(a:1) == type("") ? [a:1] : a:1
|
||||||
if type(suggestions) != type([])
|
if type(advice) != type([])
|
||||||
echoerr "Expected String or List"
|
throw "Expected String or List"
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Report each suggestion
|
" Report each suggestion
|
||||||
if len(suggestions) > 0
|
if len(advice) > 0
|
||||||
let output .= "\n - SUGGESTIONS:"
|
let output .= "\n - ADVICE:"
|
||||||
endif
|
endif
|
||||||
for suggestion in suggestions
|
for suggestion in advice
|
||||||
let output .= "\n - " . s:indent_after_line1(suggestion, 10)
|
let output .= "\n - " . s:indent_after_line1(suggestion, 10)
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
@@ -122,7 +124,7 @@ endfunction " }}}
|
|||||||
|
|
||||||
" Reports a successful healthcheck.
|
" Reports a successful healthcheck.
|
||||||
function! health#report_ok(msg) abort " {{{
|
function! health#report_ok(msg) abort " {{{
|
||||||
echo s:format_report_message('SUCCESS', a:msg)
|
echo s:format_report_message('OK', a:msg)
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
|
|
||||||
" Reports a health warning.
|
" Reports a health warning.
|
||||||
@@ -157,7 +159,10 @@ endfunction
|
|||||||
" Translates a list of plugin names to healthcheck function names.
|
" Translates a list of plugin names to healthcheck function names.
|
||||||
function! s:to_fn_names(plugin_names) abort
|
function! s:to_fn_names(plugin_names) abort
|
||||||
let healthchecks = []
|
let healthchecks = []
|
||||||
for p in a:plugin_names
|
let plugin_names = type('') ==# type(a:plugin_names)
|
||||||
|
\ ? split(a:plugin_names, '', v:false)
|
||||||
|
\ : a:plugin_names
|
||||||
|
for p in plugin_names
|
||||||
call add(healthchecks, 'health#'.p.'#check')
|
call add(healthchecks, 'health#'.p.'#check')
|
||||||
endfor
|
endfor
|
||||||
return healthchecks
|
return healthchecks
|
||||||
|
@@ -4,13 +4,10 @@ function! s:check_config() abort
|
|||||||
let ok = v:true
|
let ok = v:true
|
||||||
call health#report_start('Configuration')
|
call health#report_start('Configuration')
|
||||||
|
|
||||||
if get(g:, 'loaded_sensible', 0)
|
" If $VIM is empty we don't care. Else make sure it is valid.
|
||||||
|
if !empty($VIM) && !filereadable($VIM.'/runtime/doc/nvim.txt')
|
||||||
let ok = v:false
|
let ok = v:false
|
||||||
let sensible_pi = globpath(&runtimepath, '**/sensible.vim', 1, 1)
|
call health#report_error("$VIM is invalid: ".$VIM)
|
||||||
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
|
endif
|
||||||
|
|
||||||
if exists('$NVIM_TUI_ENABLE_CURSOR_SHAPE')
|
if exists('$NVIM_TUI_ENABLE_CURSOR_SHAPE')
|
||||||
@@ -20,6 +17,13 @@ function! s:check_config() abort
|
|||||||
\ 'https://github.com/neovim/neovim/wiki/Following-HEAD#20170402' ])
|
\ 'https://github.com/neovim/neovim/wiki/Following-HEAD#20170402' ])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if &paste
|
||||||
|
let ok = v:false
|
||||||
|
call health#report_error("'paste' is enabled. This option is only for pasting text.\nIt should not be set in your config.",
|
||||||
|
\ [ 'Remove `set paste` from your init.vim, if applicable.',
|
||||||
|
\ 'Check `:verbose set paste?` to see if a plugin or script set the option.', ])
|
||||||
|
endif
|
||||||
|
|
||||||
if ok
|
if ok
|
||||||
call health#report_ok('no issues found')
|
call health#report_ok('no issues found')
|
||||||
endif
|
endif
|
||||||
@@ -54,7 +58,7 @@ function! s:check_rplugin_manifest() abort
|
|||||||
let contents = join(readfile(script))
|
let contents = join(readfile(script))
|
||||||
if contents =~# '\<\%(from\|import\)\s\+neovim\>'
|
if contents =~# '\<\%(from\|import\)\s\+neovim\>'
|
||||||
if script =~# '[\/]__init__\.py$'
|
if script =~# '[\/]__init__\.py$'
|
||||||
let script = fnamemodify(script, ':h')
|
let script = tr(fnamemodify(script, ':h'), '\', '/')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !has_key(existing_rplugins, script)
|
if !has_key(existing_rplugins, script)
|
||||||
@@ -169,6 +173,11 @@ function! s:check_terminal() abort
|
|||||||
call health#report_info('key_dc (kdch1) terminfo entry: '
|
call health#report_info('key_dc (kdch1) terminfo entry: '
|
||||||
\ .(empty(kbs_entry) ? '? (not found)' : kdch1_entry))
|
\ .(empty(kbs_entry) ? '? (not found)' : kdch1_entry))
|
||||||
endif
|
endif
|
||||||
|
for env_var in ['XTERM_VERSION', 'VTE_VERSION', 'TERM_PROGRAM', 'COLORTERM', 'SSH_TTY']
|
||||||
|
if !exists('$'.env_var)
|
||||||
|
call health#report_info(printf("$%s='%s'", env_var, eval('$'.env_var)))
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! health#nvim#check() abort
|
function! health#nvim#check() abort
|
||||||
|
@@ -38,6 +38,16 @@ function! s:system_handler(jobid, data, event) dict abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Attempts to construct a shell command from an args list.
|
||||||
|
" Only for display, to help users debug a failed command.
|
||||||
|
function! s:shellify(cmd) abort
|
||||||
|
if type(a:cmd) != type([])
|
||||||
|
return a:cmd
|
||||||
|
endif
|
||||||
|
return join(map(copy(a:cmd),
|
||||||
|
\'v:val =~# ''\m[\-.a-zA-Z_/]'' ? shellescape(v:val) : v:val'), ' ')
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Run a system command and timeout after 30 seconds.
|
" Run a system command and timeout after 30 seconds.
|
||||||
function! s:system(cmd, ...) abort
|
function! s:system(cmd, ...) abort
|
||||||
let stdin = a:0 ? a:1 : ''
|
let stdin = a:0 ? a:1 : ''
|
||||||
@@ -54,8 +64,7 @@ function! s:system(cmd, ...) abort
|
|||||||
let jobid = jobstart(a:cmd, opts)
|
let jobid = jobstart(a:cmd, opts)
|
||||||
|
|
||||||
if jobid < 1
|
if jobid < 1
|
||||||
call health#report_error(printf('Command error %d: %s', jobid,
|
call health#report_error(printf('Command error (job=%d): %s', jobid, s:shellify(a:cmd)))
|
||||||
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd))
|
|
||||||
let s:shell_error = 1
|
let s:shell_error = 1
|
||||||
return opts.output
|
return opts.output
|
||||||
endif
|
endif
|
||||||
@@ -66,13 +75,11 @@ function! s:system(cmd, ...) abort
|
|||||||
|
|
||||||
let res = jobwait([jobid], 30000)
|
let res = jobwait([jobid], 30000)
|
||||||
if res[0] == -1
|
if res[0] == -1
|
||||||
call health#report_error(printf('Command timed out: %s',
|
call health#report_error(printf('Command timed out: %s', s:shellify(a:cmd)))
|
||||||
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd))
|
|
||||||
call jobstop(jobid)
|
call jobstop(jobid)
|
||||||
elseif s:shell_error != 0 && !ignore_error
|
elseif s:shell_error != 0 && !ignore_error
|
||||||
call health#report_error(printf('Command error (%d) %s: %s', jobid,
|
call health#report_error(printf("Command error (job=%d): %s\nOutput: %s", jobid,
|
||||||
\ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd,
|
\ s:shellify(a:cmd), opts.output))
|
||||||
\ opts.output))
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return opts.output
|
return opts.output
|
||||||
@@ -114,9 +121,13 @@ function! s:check_clipboard() abort
|
|||||||
call health#report_start('Clipboard (optional)')
|
call health#report_start('Clipboard (optional)')
|
||||||
|
|
||||||
let clipboard_tool = provider#clipboard#Executable()
|
let clipboard_tool = provider#clipboard#Executable()
|
||||||
if empty(clipboard_tool)
|
if exists('g:clipboard') && empty(clipboard_tool)
|
||||||
|
call health#report_error(
|
||||||
|
\ provider#clipboard#Error(),
|
||||||
|
\ ["Use the example in :help g:clipboard as a template, or don't set g:clipboard at all."])
|
||||||
|
elseif empty(clipboard_tool)
|
||||||
call health#report_warn(
|
call health#report_warn(
|
||||||
\ 'No clipboard tool found. Clipboard registers will not work.',
|
\ 'No clipboard tool found. Clipboard registers (`"+` and `"*`) will not work.',
|
||||||
\ [':help clipboard'])
|
\ [':help clipboard'])
|
||||||
else
|
else
|
||||||
call health#report_ok('Clipboard tool found: '. clipboard_tool)
|
call health#report_ok('Clipboard tool found: '. clipboard_tool)
|
||||||
@@ -157,7 +168,7 @@ function! s:version_info(python) abort
|
|||||||
\ ]))
|
\ ]))
|
||||||
|
|
||||||
if empty(python_version)
|
if empty(python_version)
|
||||||
let python_version = 'unable to parse python response'
|
let python_version = 'unable to parse '.a:python.' response'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let nvim_path = s:trim(s:system([
|
let nvim_path = s:trim(s:system([
|
||||||
@@ -176,7 +187,7 @@ function! s:version_info(python) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Try to get neovim.VERSION (added in 0.1.11dev).
|
" Try to get neovim.VERSION (added in 0.1.11dev).
|
||||||
let nvim_version = s:system(['python', '-c',
|
let nvim_version = s:system([a:python, '-c',
|
||||||
\ 'from neovim import VERSION as v; '.
|
\ 'from neovim import VERSION as v; '.
|
||||||
\ 'print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))'],
|
\ 'print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))'],
|
||||||
\ '', 1, 1)
|
\ '', 1, 1)
|
||||||
@@ -228,7 +239,7 @@ function! s:check_python(version) abort
|
|||||||
|
|
||||||
let pyname = 'python'.(a:version == 2 ? '' : '3')
|
let pyname = 'python'.(a:version == 2 ? '' : '3')
|
||||||
let pyenv = resolve(exepath('pyenv'))
|
let pyenv = resolve(exepath('pyenv'))
|
||||||
let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : 'n'
|
let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : ''
|
||||||
let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : ''
|
let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : ''
|
||||||
let host_prog_var = pyname.'_host_prog'
|
let host_prog_var = pyname.'_host_prog'
|
||||||
let loaded_var = 'g:loaded_'.pyname.'_provider'
|
let loaded_var = 'g:loaded_'.pyname.'_provider'
|
||||||
@@ -240,6 +251,19 @@ function! s:check_python(version) abort
|
|||||||
return
|
return
|
||||||
endif
|
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?',
|
||||||
|
\ 'If you use a shell "framework" like Prezto or Oh My Zsh, try without.',
|
||||||
|
\ 'Try a different shell (bash).']
|
||||||
|
\ )
|
||||||
|
else
|
||||||
|
call health#report_ok(printf('pyenv found: "%s"', pyenv))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
if exists('g:'.host_prog_var)
|
if exists('g:'.host_prog_var)
|
||||||
call health#report_info(printf('Using: g:%s = "%s"', host_prog_var, get(g:, host_prog_var)))
|
call health#report_info(printf('Using: g:%s = "%s"', host_prog_var, get(g:, host_prog_var)))
|
||||||
endif
|
endif
|
||||||
@@ -271,15 +295,6 @@ function! s:check_python(version) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if !empty(pyenv)
|
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([pyenv, 'which', pyname], '', 1))
|
let python_bin = s:trim(s:system([pyenv, 'which', pyname], '', 1))
|
||||||
|
|
||||||
if empty(python_bin)
|
if empty(python_bin)
|
||||||
@@ -309,9 +324,8 @@ function! s:check_python(version) abort
|
|||||||
|
|
||||||
if python_bin =~# '\<shims\>'
|
if python_bin =~# '\<shims\>'
|
||||||
call health#report_warn(printf('`%s` appears to be a pyenv shim.', python_bin), [
|
call health#report_warn(printf('`%s` appears to be a pyenv shim.', python_bin), [
|
||||||
\ 'The `pyenv` executable is not in $PATH,',
|
\ '`pyenv` is not in $PATH, your pyenv installation is broken. '
|
||||||
\ 'Your pyenv installation is broken. You should set '
|
\ .'Set `g:'.host_prog_var.'` to avoid surprises.',
|
||||||
\ . '`g:'.host_prog_var.'` to avoid surprises.',
|
|
||||||
\ ])
|
\ ])
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -324,7 +338,7 @@ function! s:check_python(version) abort
|
|||||||
call health#report_warn('pyenv is not set up optimally.', [
|
call health#report_warn('pyenv is not set up optimally.', [
|
||||||
\ printf('Create a virtualenv specifically '
|
\ printf('Create a virtualenv specifically '
|
||||||
\ . 'for Neovim using pyenv, and set `g:%s`. This will avoid '
|
\ . 'for Neovim using pyenv, and set `g:%s`. This will avoid '
|
||||||
\ . 'the need to install Neovim''s Python module in each '
|
\ . 'the need to install the Neovim Python module in each '
|
||||||
\ . 'version/virtualenv.', host_prog_var)
|
\ . 'version/virtualenv.', host_prog_var)
|
||||||
\ ])
|
\ ])
|
||||||
elseif !empty(venv) && exists('g:'.host_prog_var)
|
elseif !empty(venv) && exists('g:'.host_prog_var)
|
||||||
@@ -453,7 +467,7 @@ function! s:check_ruby() abort
|
|||||||
\ 'Are you behind a firewall or proxy?'])
|
\ 'Are you behind a firewall or proxy?'])
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let latest_gem = get(split(latest_gem, ' (\|, \|)$' ), 1, 'not found')
|
let latest_gem = get(split(latest_gem, 'neovim (\|, \|)$' ), 1, 'not found')
|
||||||
|
|
||||||
let current_gem_cmd = host .' --version'
|
let current_gem_cmd = host .' --version'
|
||||||
let current_gem = s:system(current_gem_cmd)
|
let current_gem = s:system(current_gem_cmd)
|
||||||
@@ -473,9 +487,71 @@ function! s:check_ruby() abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:check_node() abort
|
||||||
|
call health#report_start('Node provider (optional)')
|
||||||
|
|
||||||
|
let loaded_var = 'g:loaded_node_provider'
|
||||||
|
if exists(loaded_var) && !exists('*provider#node#Call')
|
||||||
|
call health#report_info('Disabled. '.loaded_var.'='.eval(loaded_var))
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !executable('node') || !executable('npm')
|
||||||
|
call health#report_warn(
|
||||||
|
\ '`node` and `npm` must be in $PATH.',
|
||||||
|
\ ['Install Node.js and verify that `node` and `npm` commands work.'])
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
call health#report_info('Node: '. s:system('node -v'))
|
||||||
|
|
||||||
|
let host = provider#node#Detect()
|
||||||
|
if empty(host)
|
||||||
|
call health#report_warn('Missing "neovim" npm package.',
|
||||||
|
\ ['Run in shell: npm install -g neovim',
|
||||||
|
\ 'Is the npm bin directory in $PATH?'])
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
call health#report_info('Host: '. host)
|
||||||
|
|
||||||
|
let latest_npm_cmd = has('win32') ? 'cmd /c npm info neovim --json' : 'npm info neovim --json'
|
||||||
|
let latest_npm = s:system(split(latest_npm_cmd))
|
||||||
|
if s:shell_error || empty(latest_npm)
|
||||||
|
call health#report_error('Failed to run: '. latest_npm_cmd,
|
||||||
|
\ ["Make sure you're connected to the internet.",
|
||||||
|
\ 'Are you behind a firewall or proxy?'])
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
if !empty(latest_npm)
|
||||||
|
try
|
||||||
|
let pkg_data = json_decode(latest_npm)
|
||||||
|
catch /E474/
|
||||||
|
return 'error: '.latest_npm
|
||||||
|
endtry
|
||||||
|
let latest_npm = get(get(pkg_data, 'dist-tags', {}), 'latest', 'unable to parse')
|
||||||
|
endif
|
||||||
|
|
||||||
|
let current_npm_cmd = host .' --version'
|
||||||
|
let current_npm = s:system(current_npm_cmd)
|
||||||
|
if s:shell_error
|
||||||
|
call health#report_error('Failed to run: '. current_npm_cmd,
|
||||||
|
\ ['Report this issue with the output of: ', current_npm_cmd])
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
if s:version_cmp(current_npm, latest_npm) == -1
|
||||||
|
call health#report_warn(
|
||||||
|
\ printf('Package "neovim" is out-of-date. Installed: %s, latest: %s',
|
||||||
|
\ current_npm, latest_npm),
|
||||||
|
\ ['Run in shell: npm update neovim'])
|
||||||
|
else
|
||||||
|
call health#report_ok('Latest "neovim" npm is installed: '. current_npm)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! health#provider#check() abort
|
function! health#provider#check() abort
|
||||||
call s:check_clipboard()
|
call s:check_clipboard()
|
||||||
call s:check_python(2)
|
call s:check_python(2)
|
||||||
call s:check_python(3)
|
call s:check_python(3)
|
||||||
call s:check_ruby()
|
call s:check_ruby()
|
||||||
|
call s:check_node()
|
||||||
endfunction
|
endfunction
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
" Vim completion script
|
" Vim completion script
|
||||||
" Language: Java Script
|
" Language: Java Script
|
||||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||||
" Last Change: 2006 Apr 30
|
" Last Change: 2017 Mar 04
|
||||||
|
|
||||||
function! javascriptcomplete#CompleteJS(findstart, base)
|
function! javascriptcomplete#CompleteJS(findstart, base)
|
||||||
if a:findstart
|
if a:findstart
|
||||||
@@ -563,7 +563,7 @@ function! javascriptcomplete#CompleteJS(findstart, base)
|
|||||||
for i in arguments
|
for i in arguments
|
||||||
let g:ia = i
|
let g:ia = i
|
||||||
let f_elements = matchlist(i, 'function\s\+\(\k\+\)\s*(\(.\{-}\))')
|
let f_elements = matchlist(i, 'function\s\+\(\k\+\)\s*(\(.\{-}\))')
|
||||||
if len(f_elements) == 3
|
if len(f_elements) >= 3
|
||||||
let b:js_menuinfo[f_elements[1].'('] = f_elements[2]
|
let b:js_menuinfo[f_elements[1].'('] = f_elements[2]
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
@@ -1,16 +1,31 @@
|
|||||||
" Maintainer: Anmol Sethi <anmol@aubble.com>
|
" Maintainer: Anmol Sethi <anmol@aubble.com>
|
||||||
|
|
||||||
let s:man_find_arg = "-w"
|
let s:find_arg = '-w'
|
||||||
|
let s:localfile_arg = v:true " Always use -l if possible. #6683
|
||||||
|
let s:section_arg = '-s'
|
||||||
|
|
||||||
" TODO(nhooyr) Completion may work on SunOS; I'm not sure if `man -l` displays
|
function! s:init_section_flag()
|
||||||
" the list of searched directories.
|
call system(['env', 'MANPAGER=cat', 'man', s:section_arg, '1', 'man'])
|
||||||
try
|
if v:shell_error
|
||||||
if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5'
|
let s:section_arg = '-S'
|
||||||
let s:man_find_arg = '-l'
|
|
||||||
endif
|
endif
|
||||||
catch /E145:/
|
endfunction
|
||||||
|
|
||||||
|
function! s:init() abort
|
||||||
|
call s:init_section_flag()
|
||||||
|
" TODO(nhooyr): Does `man -l` on SunOS list searched directories?
|
||||||
|
try
|
||||||
|
if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5'
|
||||||
|
let s:find_arg = '-l'
|
||||||
|
endif
|
||||||
|
" Check for -l support.
|
||||||
|
call s:get_page(s:get_path('', 'man')[0:-2])
|
||||||
|
catch /E145:/
|
||||||
" Ignore the error in restricted mode
|
" Ignore the error in restricted mode
|
||||||
endtry
|
catch /command error .*/
|
||||||
|
let s:localfile_arg = v:false
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! man#open_page(count, count1, mods, ...) abort
|
function! man#open_page(count, count1, mods, ...) abort
|
||||||
if a:0 > 2
|
if a:0 > 2
|
||||||
@@ -88,10 +103,8 @@ endfunction
|
|||||||
|
|
||||||
" Handler for s:system() function.
|
" Handler for s:system() function.
|
||||||
function! s:system_handler(jobid, data, event) dict abort
|
function! s:system_handler(jobid, data, event) dict abort
|
||||||
if a:event == 'stdout'
|
if a:event is# 'stdout' || a:event is# 'stderr'
|
||||||
let self.stdout .= join(a:data, "\n")
|
let self[a:event] .= join(a:data, "\n")
|
||||||
elseif a:event == 'stderr'
|
|
||||||
let self.stderr .= join(a:data, "\n")
|
|
||||||
else
|
else
|
||||||
let self.exit_code = a:data
|
let self.exit_code = a:data
|
||||||
endif
|
endif
|
||||||
@@ -118,7 +131,7 @@ function! s:system(cmd, ...) abort
|
|||||||
try
|
try
|
||||||
call jobstop(jobid)
|
call jobstop(jobid)
|
||||||
throw printf('command timed out: %s', join(a:cmd))
|
throw printf('command timed out: %s', join(a:cmd))
|
||||||
catch /^Vim\%((\a\+)\)\=:E900/
|
catch /^Vim(call):E900:/
|
||||||
endtry
|
endtry
|
||||||
elseif res[0] == -2
|
elseif res[0] == -2
|
||||||
throw printf('command interrupted: %s', join(a:cmd))
|
throw printf('command interrupted: %s', join(a:cmd))
|
||||||
@@ -135,7 +148,8 @@ function! s:get_page(path) abort
|
|||||||
let manwidth = empty($MANWIDTH) ? winwidth(0) : $MANWIDTH
|
let manwidth = empty($MANWIDTH) ? winwidth(0) : $MANWIDTH
|
||||||
" Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db).
|
" Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db).
|
||||||
" http://comments.gmane.org/gmane.editors.vim.devel/29085
|
" http://comments.gmane.org/gmane.editors.vim.devel/29085
|
||||||
return s:system(['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'man', a:path])
|
let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'man']
|
||||||
|
return s:system(cmd + (s:localfile_arg ? ['-l', a:path] : [a:path]))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:put_page(page) abort
|
function! s:put_page(page) abort
|
||||||
@@ -199,14 +213,14 @@ endfunction
|
|||||||
|
|
||||||
function! s:get_path(sect, name) abort
|
function! s:get_path(sect, name) abort
|
||||||
if empty(a:sect)
|
if empty(a:sect)
|
||||||
return s:system(['man', s:man_find_arg, a:name])
|
return s:system(['man', s:find_arg, a:name])
|
||||||
endif
|
endif
|
||||||
" '-s' flag handles:
|
" '-s' flag handles:
|
||||||
" - tokens like 'printf(echo)'
|
" - tokens like 'printf(echo)'
|
||||||
" - sections starting with '-'
|
" - sections starting with '-'
|
||||||
" - 3pcap section (found on macOS)
|
" - 3pcap section (found on macOS)
|
||||||
" - commas between sections (for section priority)
|
" - commas between sections (for section priority)
|
||||||
return s:system(['man', s:man_find_arg, '-s', a:sect, a:name])
|
return s:system(['man', s:find_arg, s:section_arg, a:sect, a:name])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:verify_exists(sect, name) abort
|
function! s:verify_exists(sect, name) abort
|
||||||
@@ -331,7 +345,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:complete(sect, psect, name) abort
|
function! s:complete(sect, psect, name) abort
|
||||||
try
|
try
|
||||||
let mandirs = join(split(s:system(['man', s:man_find_arg]), ':\|\n'), ',')
|
let mandirs = join(split(s:system(['man', s:find_arg]), ':\|\n'), ',')
|
||||||
catch
|
catch
|
||||||
call s:error(v:exception)
|
call s:error(v:exception)
|
||||||
return
|
return
|
||||||
@@ -373,3 +387,5 @@ function! man#init_pager() abort
|
|||||||
endtry
|
endtry
|
||||||
execute 'silent file man://'.fnameescape(ref)
|
execute 'silent file man://'.fnameescape(ref)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
call s:init()
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
" Vim support file to help with paste mappings and menus
|
" Vim support file to help with paste mappings and menus
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
" Last Change: 2006 Jun 23
|
" Last Change: 2017 Aug 30
|
||||||
|
|
||||||
" Define the string to use for items that are present both in Edit, Popup and
|
" Define the string to use for items that are present both in Edit, Popup and
|
||||||
" Toolbar menu. Also used in mswin.vim and macmap.vim.
|
" Toolbar menu. Also used in mswin.vim and macmap.vim.
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
if has("virtualedit")
|
if has("virtualedit")
|
||||||
let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"}
|
let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"}
|
||||||
let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
|
let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
|
||||||
let paste#paste_cmd['i'] = 'x<BS><Esc>' . paste#paste_cmd['n'] . 'gi'
|
let paste#paste_cmd['i'] = "\<c-\>\<c-o>\"+gP"
|
||||||
|
|
||||||
func! paste#Paste()
|
func! paste#Paste()
|
||||||
let ove = &ve
|
let ove = &ve
|
||||||
|
20
runtime/autoload/provider.vim
Normal file
20
runtime/autoload/provider.vim
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
" Common functionality for providers
|
||||||
|
|
||||||
|
let s:stderr = {}
|
||||||
|
|
||||||
|
function! provider#stderr_collector(chan_id, data, event)
|
||||||
|
let stderr = get(s:stderr, a:chan_id, [''])
|
||||||
|
let stderr[-1] .= a:data[0]
|
||||||
|
call extend(stderr, a:data[1:])
|
||||||
|
let s:stderr[a:chan_id] = stderr
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! provider#clear_stderr(chan_id)
|
||||||
|
if has_key(s:stderr, a:chan_id)
|
||||||
|
call remove(s:stderr, a:chan_id)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! provider#get_stderr(chan_id)
|
||||||
|
return get(s:stderr, a:chan_id, [])
|
||||||
|
endfunction
|
@@ -3,28 +3,36 @@
|
|||||||
" available.
|
" available.
|
||||||
let s:copy = {}
|
let s:copy = {}
|
||||||
let s:paste = {}
|
let s:paste = {}
|
||||||
|
let s:clipboard = {}
|
||||||
|
|
||||||
" When caching is enabled, store the jobid of the xclip/xsel process keeping
|
" When caching is enabled, store the jobid of the xclip/xsel process keeping
|
||||||
" ownership of the selection, so we know how long the cache is valid.
|
" ownership of the selection, so we know how long the cache is valid.
|
||||||
let s:selection = { 'owner': 0, 'data': [] }
|
let s:selection = { 'owner': 0, 'data': [], 'on_stderr': function('provider#stderr_collector') }
|
||||||
|
|
||||||
function! s:selection.on_exit(jobid, data, event)
|
function! s:selection.on_exit(jobid, data, event) abort
|
||||||
" At this point this nvim instance might already have launched
|
" At this point this nvim instance might already have launched
|
||||||
" a new provider instance. Don't drop ownership in this case.
|
" a new provider instance. Don't drop ownership in this case.
|
||||||
if self.owner == a:jobid
|
if self.owner == a:jobid
|
||||||
let self.owner = 0
|
let self.owner = 0
|
||||||
endif
|
endif
|
||||||
|
if a:data != 0
|
||||||
|
let stderr = provider#get_stderr(a:jobid)
|
||||||
|
echohl WarningMsg
|
||||||
|
echomsg 'clipboard: error invoking '.get(self.argv, 0, '?').': '.join(stderr)
|
||||||
|
echohl None
|
||||||
|
endif
|
||||||
|
call provider#clear_stderr(a:jobid)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let s:selections = { '*': s:selection, '+': copy(s:selection)}
|
let s:selections = { '*': s:selection, '+': copy(s:selection) }
|
||||||
|
|
||||||
function! s:try_cmd(cmd, ...)
|
function! s:try_cmd(cmd, ...) abort
|
||||||
let argv = split(a:cmd, " ")
|
let argv = split(a:cmd, " ")
|
||||||
let out = a:0 ? systemlist(argv, a:1, 1) : systemlist(argv, [''], 1)
|
let out = a:0 ? systemlist(argv, a:1, 1) : systemlist(argv, [''], 1)
|
||||||
if v:shell_error
|
if v:shell_error
|
||||||
if !exists('s:did_error_try_cmd')
|
if !exists('s:did_error_try_cmd')
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echomsg "clipboard: error: ".(len(out) ? out[0] : '')
|
echomsg "clipboard: error: ".(len(out) ? out[0] : v:shell_error)
|
||||||
echohl None
|
echohl None
|
||||||
let s:did_error_try_cmd = 1
|
let s:did_error_try_cmd = 1
|
||||||
endif
|
endif
|
||||||
@@ -34,7 +42,7 @@ function! s:try_cmd(cmd, ...)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Returns TRUE if `cmd` exits with success, else FALSE.
|
" Returns TRUE if `cmd` exits with success, else FALSE.
|
||||||
function! s:cmd_ok(cmd)
|
function! s:cmd_ok(cmd) abort
|
||||||
call system(a:cmd)
|
call system(a:cmd)
|
||||||
return v:shell_error == 0
|
return v:shell_error == 0
|
||||||
endfunction
|
endfunction
|
||||||
@@ -47,7 +55,18 @@ function! provider#clipboard#Error() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! provider#clipboard#Executable() abort
|
function! provider#clipboard#Executable() abort
|
||||||
if has('mac') && executable('pbcopy')
|
if exists('g:clipboard')
|
||||||
|
if type({}) isnot# type(g:clipboard)
|
||||||
|
\ || type({}) isnot# type(get(g:clipboard, 'copy', v:null))
|
||||||
|
\ || type({}) isnot# type(get(g:clipboard, 'paste', v:null))
|
||||||
|
let s:err = 'clipboard: invalid g:clipboard'
|
||||||
|
return ''
|
||||||
|
endif
|
||||||
|
let s:copy = get(g:clipboard, 'copy', { '+': v:null, '*': v:null })
|
||||||
|
let s:paste = get(g:clipboard, 'paste', { '+': v:null, '*': v:null })
|
||||||
|
let s:cache_enabled = get(g:clipboard, 'cache_enabled', 0)
|
||||||
|
return get(g:clipboard, 'name', 'g:clipboard')
|
||||||
|
elseif has('mac') && executable('pbcopy')
|
||||||
let s:copy['+'] = 'pbcopy'
|
let s:copy['+'] = 'pbcopy'
|
||||||
let s:paste['+'] = 'pbpaste'
|
let s:paste['+'] = 'pbpaste'
|
||||||
let s:copy['*'] = s:copy['+']
|
let s:copy['*'] = s:copy['+']
|
||||||
@@ -84,26 +103,33 @@ function! provider#clipboard#Executable() abort
|
|||||||
let s:copy['*'] = s:copy['+']
|
let s:copy['*'] = s:copy['+']
|
||||||
let s:paste['*'] = s:paste['+']
|
let s:paste['*'] = s:paste['+']
|
||||||
return 'win32yank'
|
return 'win32yank'
|
||||||
|
elseif exists('$TMUX') && executable('tmux')
|
||||||
|
let s:copy['+'] = 'tmux load-buffer -'
|
||||||
|
let s:paste['+'] = 'tmux save-buffer -'
|
||||||
|
let s:copy['*'] = s:copy['+']
|
||||||
|
let s:paste['*'] = s:paste['+']
|
||||||
|
return 'tmux'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:err = 'clipboard: No clipboard tool available. :help clipboard'
|
let s:err = 'clipboard: No clipboard tool. :help clipboard'
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
if empty(provider#clipboard#Executable())
|
if empty(provider#clipboard#Executable())
|
||||||
|
" provider#clipboard#Call() *must not* be defined if the provider is broken.
|
||||||
|
" Otherwise eval_has_provider() thinks the clipboard provider is
|
||||||
|
" functioning, and eval_call_provider() will happily call it.
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:clipboard = {}
|
function! s:clipboard.get(reg) abort
|
||||||
|
|
||||||
function! s:clipboard.get(reg)
|
|
||||||
if s:selections[a:reg].owner > 0
|
if s:selections[a:reg].owner > 0
|
||||||
return s:selections[a:reg].data
|
return s:selections[a:reg].data
|
||||||
end
|
end
|
||||||
return s:try_cmd(s:paste[a:reg])
|
return s:try_cmd(s:paste[a:reg])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:clipboard.set(lines, regtype, reg)
|
function! s:clipboard.set(lines, regtype, reg) abort
|
||||||
if a:reg == '"'
|
if a:reg == '"'
|
||||||
call s:clipboard.set(a:lines,a:regtype,'+')
|
call s:clipboard.set(a:lines,a:regtype,'+')
|
||||||
if s:copy['*'] != s:copy['+']
|
if s:copy['*'] != s:copy['+']
|
||||||
@@ -124,20 +150,31 @@ function! s:clipboard.set(lines, regtype, reg)
|
|||||||
end
|
end
|
||||||
let selection.data = [a:lines, a:regtype]
|
let selection.data = [a:lines, a:regtype]
|
||||||
let argv = split(s:copy[a:reg], " ")
|
let argv = split(s:copy[a:reg], " ")
|
||||||
|
let selection.argv = argv
|
||||||
let selection.detach = s:cache_enabled
|
let selection.detach = s:cache_enabled
|
||||||
let selection.cwd = "/"
|
let selection.cwd = "/"
|
||||||
let jobid = jobstart(argv, selection)
|
let jobid = jobstart(argv, selection)
|
||||||
if jobid <= 0
|
if jobid > 0
|
||||||
echohl WarningMsg
|
|
||||||
echo "clipboard: error when invoking provider"
|
|
||||||
echohl None
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
call jobsend(jobid, a:lines)
|
call jobsend(jobid, a:lines)
|
||||||
call jobclose(jobid, 'stdin')
|
call jobclose(jobid, 'stdin')
|
||||||
let selection.owner = jobid
|
let selection.owner = jobid
|
||||||
|
else
|
||||||
|
echohl WarningMsg
|
||||||
|
echomsg 'clipboard: failed to execute: '.(s:copy[a:reg])
|
||||||
|
echohl None
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
return 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! provider#clipboard#Call(method, args)
|
function! provider#clipboard#Call(method, args) abort
|
||||||
|
if get(s:, 'here', v:false) " Clipboard provider must not recurse. #7184
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
let s:here = v:true
|
||||||
|
try
|
||||||
return call(s:clipboard[a:method],a:args,s:clipboard)
|
return call(s:clipboard[a:method],a:args,s:clipboard)
|
||||||
|
finally
|
||||||
|
let s:here = v:false
|
||||||
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
80
runtime/autoload/provider/node.vim
Normal file
80
runtime/autoload/provider/node.vim
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
if exists('g:loaded_node_provider')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:loaded_node_provider = 1
|
||||||
|
|
||||||
|
let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')}
|
||||||
|
|
||||||
|
function! provider#node#Detect() abort
|
||||||
|
return has('win32') ? exepath('neovim-node-host.cmd') : exepath('neovim-node-host')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! provider#node#Prog()
|
||||||
|
return s:prog
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! provider#node#Require(host) abort
|
||||||
|
if s:err != ''
|
||||||
|
echoerr s:err
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
if has('win32')
|
||||||
|
let args = provider#node#Prog()
|
||||||
|
else
|
||||||
|
let args = ['node']
|
||||||
|
|
||||||
|
if !empty($NVIM_NODE_HOST_DEBUG)
|
||||||
|
call add(args, '--inspect-brk')
|
||||||
|
endif
|
||||||
|
|
||||||
|
call add(args , provider#node#Prog())
|
||||||
|
endif
|
||||||
|
|
||||||
|
try
|
||||||
|
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 provider#get_stderr(channel_id)
|
||||||
|
echomsg row
|
||||||
|
endfor
|
||||||
|
endtry
|
||||||
|
finally
|
||||||
|
call provider#clear_stderr(channel_id)
|
||||||
|
endtry
|
||||||
|
throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_NODE_LOG_FILE')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! provider#node#Call(method, args)
|
||||||
|
if s:err != ''
|
||||||
|
echoerr s:err
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists('s:host')
|
||||||
|
try
|
||||||
|
let s:host = remote#host#Require('node')
|
||||||
|
catch
|
||||||
|
let s:err = v:exception
|
||||||
|
echohl WarningMsg
|
||||||
|
echomsg v:exception
|
||||||
|
echohl None
|
||||||
|
return
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
return call('rpcrequest', insert(insert(a:args, 'node_'.a:method), s:host))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
let s:err = ''
|
||||||
|
let s:prog = provider#node#Detect()
|
||||||
|
|
||||||
|
if empty(s:prog)
|
||||||
|
let s:err = 'Cannot find the "neovim" node package. Try :CheckHealth'
|
||||||
|
endif
|
||||||
|
|
||||||
|
call remote#host#RegisterPlugin('node-provider', 'node', [])
|
@@ -5,17 +5,7 @@ endif
|
|||||||
|
|
||||||
let s:loaded_pythonx_provider = 1
|
let s:loaded_pythonx_provider = 1
|
||||||
|
|
||||||
let s:stderr = {}
|
let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')}
|
||||||
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
|
function! provider#pythonx#Require(host) abort
|
||||||
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
|
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
|
||||||
@@ -38,9 +28,11 @@ function! provider#pythonx#Require(host) abort
|
|||||||
catch
|
catch
|
||||||
echomsg v:throwpoint
|
echomsg v:throwpoint
|
||||||
echomsg v:exception
|
echomsg v:exception
|
||||||
for row in get(s:stderr, channel_id, [])
|
for row in provider#get_stderr(channel_id)
|
||||||
echomsg row
|
echomsg row
|
||||||
endfor
|
endfor
|
||||||
|
finally
|
||||||
|
call provider#clear_stderr(channel_id)
|
||||||
endtry
|
endtry
|
||||||
throw remote#host#LoadErrorForHost(a:host.orig_name,
|
throw remote#host#LoadErrorForHost(a:host.orig_name,
|
||||||
\ '$NVIM_PYTHON_LOG_FILE')
|
\ '$NVIM_PYTHON_LOG_FILE')
|
||||||
|
@@ -16,7 +16,11 @@ function! s:job_opts.on_stderr(chan_id, data, event)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! provider#ruby#Detect() abort
|
function! provider#ruby#Detect() abort
|
||||||
return exepath('neovim-ruby-host')
|
if exists("g:ruby_host_prog")
|
||||||
|
return g:ruby_host_prog
|
||||||
|
else
|
||||||
|
return has('win32') ? exepath('neovim-ruby-host.cmd') : exepath('neovim-ruby-host')
|
||||||
|
end
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! provider#ruby#Prog()
|
function! provider#ruby#Prog()
|
||||||
@@ -24,15 +28,15 @@ function! provider#ruby#Prog()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! provider#ruby#Require(host) abort
|
function! provider#ruby#Require(host) abort
|
||||||
let args = [provider#ruby#Prog()]
|
let prog = provider#ruby#Prog()
|
||||||
let ruby_plugins = remote#host#PluginsForHost(a:host.name)
|
let ruby_plugins = remote#host#PluginsForHost(a:host.name)
|
||||||
|
|
||||||
for plugin in ruby_plugins
|
for plugin in ruby_plugins
|
||||||
call add(args, plugin.path)
|
let prog .= " " . shellescape(plugin.path)
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
try
|
try
|
||||||
let channel_id = jobstart(args, s:job_opts)
|
let channel_id = jobstart(prog, s:job_opts)
|
||||||
if rpcrequest(channel_id, 'poll') ==# 'ok'
|
if rpcrequest(channel_id, 'poll') ==# 'ok'
|
||||||
return channel_id
|
return channel_id
|
||||||
endif
|
endif
|
||||||
@@ -71,7 +75,7 @@ let s:prog = provider#ruby#Detect()
|
|||||||
let s:plugin_path = expand('<sfile>:p:h') . '/script_host.rb'
|
let s:plugin_path = expand('<sfile>:p:h') . '/script_host.rb'
|
||||||
|
|
||||||
if empty(s:prog)
|
if empty(s:prog)
|
||||||
let s:err = 'Cannot find the neovim RubyGem. Try :CheckHealth'
|
let s:err = 'Cannot find the neovim RubyGem. Try :checkhealth'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call remote#host#RegisterClone('legacy-ruby-provider', 'ruby')
|
call remote#host#RegisterClone('legacy-ruby-provider', 'ruby')
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
begin
|
begin
|
||||||
require "neovim/ruby_provider"
|
require 'neovim/ruby_provider'
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
warn(
|
warn('Your neovim RubyGem is missing or out of date.',
|
||||||
"Your neovim RubyGem is missing or out of date. " +
|
'Install the latest version using `gem install neovim`.')
|
||||||
"Install the latest version using `gem install neovim`."
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
@@ -89,7 +89,8 @@ endfunction
|
|||||||
|
|
||||||
function! remote#define#AutocmdOnHost(host, method, sync, name, opts)
|
function! remote#define#AutocmdOnHost(host, method, sync, name, opts)
|
||||||
let group = s:GetNextAutocmdGroup()
|
let group = s:GetNextAutocmdGroup()
|
||||||
let forward = '"doau '.group.' '.a:name.' ".'.'expand("<amatch>")'
|
let forward = '"doau '.group.' '.a:name.' ".'
|
||||||
|
\ . 'fnameescape(expand("<amatch>"))'
|
||||||
let a:opts.group = group
|
let a:opts.group = group
|
||||||
let bootstrap_def = s:GetAutocmdPrefix(a:name, a:opts)
|
let bootstrap_def = s:GetAutocmdPrefix(a:name, a:opts)
|
||||||
\ .' call remote#define#AutocmdBootstrap("'.a:host.'"'
|
\ .' call remote#define#AutocmdBootstrap("'.a:host.'"'
|
||||||
@@ -168,14 +169,40 @@ function! remote#define#FunctionOnChannel(channel, method, sync, name, opts)
|
|||||||
exe function_def
|
exe function_def
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
let s:busy = {}
|
||||||
|
let s:pending_notifications = {}
|
||||||
|
|
||||||
function! s:GetRpcFunction(sync)
|
function! s:GetRpcFunction(sync)
|
||||||
if a:sync
|
if a:sync ==# 'urgent'
|
||||||
return 'rpcrequest'
|
|
||||||
endif
|
|
||||||
return 'rpcnotify'
|
return 'rpcnotify'
|
||||||
|
elseif a:sync
|
||||||
|
return 'remote#define#request'
|
||||||
|
endif
|
||||||
|
return 'remote#define#notify'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! remote#define#notify(chan, ...)
|
||||||
|
if get(s:busy, a:chan, 0) > 0
|
||||||
|
let pending = get(s:pending_notifications, a:chan, [])
|
||||||
|
call add(pending, deepcopy(a:000))
|
||||||
|
let s:pending_notifications[a:chan] = pending
|
||||||
|
else
|
||||||
|
call call('rpcnotify', [a:chan] + a:000)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! remote#define#request(chan, ...)
|
||||||
|
let s:busy[a:chan] = get(s:busy, a:chan, 0)+1
|
||||||
|
let val = call('rpcrequest', [a:chan]+a:000)
|
||||||
|
let s:busy[a:chan] -= 1
|
||||||
|
if s:busy[a:chan] == 0
|
||||||
|
for msg in get(s:pending_notifications, a:chan, [])
|
||||||
|
call call('rpcnotify', [a:chan] + msg)
|
||||||
|
endfor
|
||||||
|
let s:pending_notifications[a:chan] = []
|
||||||
|
endif
|
||||||
|
return val
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:GetCommandPrefix(name, opts)
|
function! s:GetCommandPrefix(name, opts)
|
||||||
return 'command!'.s:StringifyOpts(a:opts, ['nargs', 'complete', 'range',
|
return 'command!'.s:StringifyOpts(a:opts, ['nargs', 'complete', 'range',
|
||||||
|
@@ -199,3 +199,7 @@ call remote#host#Register('python3', '*',
|
|||||||
" Ruby
|
" Ruby
|
||||||
call remote#host#Register('ruby', '*.rb',
|
call remote#host#Register('ruby', '*.rb',
|
||||||
\ function('provider#ruby#Require'))
|
\ function('provider#ruby#Require'))
|
||||||
|
|
||||||
|
" nodejs
|
||||||
|
call remote#host#Register('node', '*',
|
||||||
|
\ function('provider#node#Require'))
|
||||||
|
415
runtime/autoload/rust.vim
Normal file
415
runtime/autoload/rust.vim
Normal file
@@ -0,0 +1,415 @@
|
|||||||
|
" Author: Kevin Ballard
|
||||||
|
" Description: Helper functions for Rust commands/mappings
|
||||||
|
" Last Modified: May 27, 2014
|
||||||
|
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||||
|
|
||||||
|
" Jump {{{1
|
||||||
|
|
||||||
|
function! rust#Jump(mode, function) range
|
||||||
|
let cnt = v:count1
|
||||||
|
normal! m'
|
||||||
|
if a:mode ==# 'v'
|
||||||
|
norm! gv
|
||||||
|
endif
|
||||||
|
let foldenable = &foldenable
|
||||||
|
set nofoldenable
|
||||||
|
while cnt > 0
|
||||||
|
execute "call <SID>Jump_" . a:function . "()"
|
||||||
|
let cnt = cnt - 1
|
||||||
|
endwhile
|
||||||
|
let &foldenable = foldenable
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:Jump_Back()
|
||||||
|
call search('{', 'b')
|
||||||
|
keepjumps normal! w99[{
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:Jump_Forward()
|
||||||
|
normal! j0
|
||||||
|
call search('{', 'b')
|
||||||
|
keepjumps normal! w99[{%
|
||||||
|
call search('{')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Run {{{1
|
||||||
|
|
||||||
|
function! rust#Run(bang, args)
|
||||||
|
let args = s:ShellTokenize(a:args)
|
||||||
|
if a:bang
|
||||||
|
let idx = index(l:args, '--')
|
||||||
|
if idx != -1
|
||||||
|
let rustc_args = idx == 0 ? [] : l:args[:idx-1]
|
||||||
|
let args = l:args[idx+1:]
|
||||||
|
else
|
||||||
|
let rustc_args = l:args
|
||||||
|
let args = []
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let rustc_args = []
|
||||||
|
endif
|
||||||
|
|
||||||
|
let b:rust_last_rustc_args = l:rustc_args
|
||||||
|
let b:rust_last_args = l:args
|
||||||
|
|
||||||
|
call s:WithPath(function("s:Run"), rustc_args, args)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:Run(dict, rustc_args, args)
|
||||||
|
let exepath = a:dict.tmpdir.'/'.fnamemodify(a:dict.path, ':t:r')
|
||||||
|
if has('win32')
|
||||||
|
let exepath .= '.exe'
|
||||||
|
endif
|
||||||
|
|
||||||
|
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||||
|
let rustc_args = [relpath, '-o', exepath] + a:rustc_args
|
||||||
|
|
||||||
|
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||||
|
|
||||||
|
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||||
|
let output = s:system(pwd, shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)')))
|
||||||
|
if output != ''
|
||||||
|
echohl WarningMsg
|
||||||
|
echo output
|
||||||
|
echohl None
|
||||||
|
endif
|
||||||
|
if !v:shell_error
|
||||||
|
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Expand {{{1
|
||||||
|
|
||||||
|
function! rust#Expand(bang, args)
|
||||||
|
let args = s:ShellTokenize(a:args)
|
||||||
|
if a:bang && !empty(l:args)
|
||||||
|
let pretty = remove(l:args, 0)
|
||||||
|
else
|
||||||
|
let pretty = "expanded"
|
||||||
|
endif
|
||||||
|
call s:WithPath(function("s:Expand"), pretty, args)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:Expand(dict, pretty, args)
|
||||||
|
try
|
||||||
|
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||||
|
|
||||||
|
if a:pretty =~? '^\%(everybody_loops$\|flowgraph=\)'
|
||||||
|
let flag = '--xpretty'
|
||||||
|
else
|
||||||
|
let flag = '--pretty'
|
||||||
|
endif
|
||||||
|
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||||
|
let args = [relpath, '-Z', 'unstable-options', l:flag, a:pretty] + a:args
|
||||||
|
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||||
|
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
|
||||||
|
if v:shell_error
|
||||||
|
echohl WarningMsg
|
||||||
|
echo output
|
||||||
|
echohl None
|
||||||
|
else
|
||||||
|
new
|
||||||
|
silent put =output
|
||||||
|
1
|
||||||
|
d
|
||||||
|
setl filetype=rust
|
||||||
|
setl buftype=nofile
|
||||||
|
setl bufhidden=hide
|
||||||
|
setl noswapfile
|
||||||
|
" give the buffer a nice name
|
||||||
|
let suffix = 1
|
||||||
|
let basename = fnamemodify(a:dict.path, ':t:r')
|
||||||
|
while 1
|
||||||
|
let bufname = basename
|
||||||
|
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
|
||||||
|
let bufname .= '.pretty.rs'
|
||||||
|
if bufexists(bufname)
|
||||||
|
let suffix += 1
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
exe 'silent noautocmd keepalt file' fnameescape(bufname)
|
||||||
|
break
|
||||||
|
endwhile
|
||||||
|
endif
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! rust#CompleteExpand(lead, line, pos)
|
||||||
|
if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$'
|
||||||
|
" first argument and it has a !
|
||||||
|
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph=", "everybody_loops"]
|
||||||
|
if !empty(a:lead)
|
||||||
|
call filter(list, "v:val[:len(a:lead)-1] == a:lead")
|
||||||
|
endif
|
||||||
|
return list
|
||||||
|
endif
|
||||||
|
|
||||||
|
return glob(escape(a:lead, "*?[") . '*', 0, 1)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Emit {{{1
|
||||||
|
|
||||||
|
function! rust#Emit(type, args)
|
||||||
|
let args = s:ShellTokenize(a:args)
|
||||||
|
call s:WithPath(function("s:Emit"), a:type, args)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:Emit(dict, type, args)
|
||||||
|
try
|
||||||
|
let output_path = a:dict.tmpdir.'/output'
|
||||||
|
|
||||||
|
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||||
|
|
||||||
|
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||||
|
let args = [relpath, '--emit', a:type, '-o', output_path] + a:args
|
||||||
|
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||||
|
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
|
||||||
|
if output != ''
|
||||||
|
echohl WarningMsg
|
||||||
|
echo output
|
||||||
|
echohl None
|
||||||
|
endif
|
||||||
|
if !v:shell_error
|
||||||
|
new
|
||||||
|
exe 'silent keepalt read' fnameescape(output_path)
|
||||||
|
1
|
||||||
|
d
|
||||||
|
if a:type == "llvm-ir"
|
||||||
|
setl filetype=llvm
|
||||||
|
let extension = 'll'
|
||||||
|
elseif a:type == "asm"
|
||||||
|
setl filetype=asm
|
||||||
|
let extension = 's'
|
||||||
|
endif
|
||||||
|
setl buftype=nofile
|
||||||
|
setl bufhidden=hide
|
||||||
|
setl noswapfile
|
||||||
|
if exists('l:extension')
|
||||||
|
" give the buffer a nice name
|
||||||
|
let suffix = 1
|
||||||
|
let basename = fnamemodify(a:dict.path, ':t:r')
|
||||||
|
while 1
|
||||||
|
let bufname = basename
|
||||||
|
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
|
||||||
|
let bufname .= '.'.extension
|
||||||
|
if bufexists(bufname)
|
||||||
|
let suffix += 1
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
exe 'silent noautocmd keepalt file' fnameescape(bufname)
|
||||||
|
break
|
||||||
|
endwhile
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Utility functions {{{1
|
||||||
|
|
||||||
|
" Invokes func(dict, ...)
|
||||||
|
" Where {dict} is a dictionary with the following keys:
|
||||||
|
" 'path' - The path to the file
|
||||||
|
" 'tmpdir' - The path to a temporary directory that will be deleted when the
|
||||||
|
" function returns.
|
||||||
|
" 'istemp' - 1 if the path is a file inside of {dict.tmpdir} or 0 otherwise.
|
||||||
|
" If {istemp} is 1 then an additional key is provided:
|
||||||
|
" 'tmpdir_relpath' - The {path} relative to the {tmpdir}.
|
||||||
|
"
|
||||||
|
" {dict.path} may be a path to a file inside of {dict.tmpdir} or it may be the
|
||||||
|
" existing path of the current buffer. If the path is inside of {dict.tmpdir}
|
||||||
|
" then it is guaranteed to have a '.rs' extension.
|
||||||
|
function! s:WithPath(func, ...)
|
||||||
|
let buf = bufnr('')
|
||||||
|
let saved = {}
|
||||||
|
let dict = {}
|
||||||
|
try
|
||||||
|
let saved.write = &write
|
||||||
|
set write
|
||||||
|
let dict.path = expand('%')
|
||||||
|
let pathisempty = empty(dict.path)
|
||||||
|
|
||||||
|
" Always create a tmpdir in case the wrapped command wants it
|
||||||
|
let dict.tmpdir = tempname()
|
||||||
|
call mkdir(dict.tmpdir)
|
||||||
|
|
||||||
|
if pathisempty || !saved.write
|
||||||
|
let dict.istemp = 1
|
||||||
|
" if we're doing this because of nowrite, preserve the filename
|
||||||
|
if !pathisempty
|
||||||
|
let filename = expand('%:t:r').".rs"
|
||||||
|
else
|
||||||
|
let filename = 'unnamed.rs'
|
||||||
|
endif
|
||||||
|
let dict.tmpdir_relpath = filename
|
||||||
|
let dict.path = dict.tmpdir.'/'.filename
|
||||||
|
|
||||||
|
let saved.mod = &mod
|
||||||
|
set nomod
|
||||||
|
|
||||||
|
silent exe 'keepalt write! ' . fnameescape(dict.path)
|
||||||
|
if pathisempty
|
||||||
|
silent keepalt 0file
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
let dict.istemp = 0
|
||||||
|
update
|
||||||
|
endif
|
||||||
|
|
||||||
|
call call(a:func, [dict] + a:000)
|
||||||
|
finally
|
||||||
|
if bufexists(buf)
|
||||||
|
for [opt, value] in items(saved)
|
||||||
|
silent call setbufvar(buf, '&'.opt, value)
|
||||||
|
unlet value " avoid variable type mismatches
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
if has_key(dict, 'tmpdir') | silent call s:RmDir(dict.tmpdir) | endif
|
||||||
|
endtry
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! rust#AppendCmdLine(text)
|
||||||
|
call setcmdpos(getcmdpos())
|
||||||
|
let cmd = getcmdline() . a:text
|
||||||
|
return cmd
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Tokenize the string according to sh parsing rules
|
||||||
|
function! s:ShellTokenize(text)
|
||||||
|
" states:
|
||||||
|
" 0: start of word
|
||||||
|
" 1: unquoted
|
||||||
|
" 2: unquoted backslash
|
||||||
|
" 3: double-quote
|
||||||
|
" 4: double-quoted backslash
|
||||||
|
" 5: single-quote
|
||||||
|
let l:state = 0
|
||||||
|
let l:current = ''
|
||||||
|
let l:args = []
|
||||||
|
for c in split(a:text, '\zs')
|
||||||
|
if l:state == 0 || l:state == 1 " unquoted
|
||||||
|
if l:c ==# ' '
|
||||||
|
if l:state == 0 | continue | endif
|
||||||
|
call add(l:args, l:current)
|
||||||
|
let l:current = ''
|
||||||
|
let l:state = 0
|
||||||
|
elseif l:c ==# '\'
|
||||||
|
let l:state = 2
|
||||||
|
elseif l:c ==# '"'
|
||||||
|
let l:state = 3
|
||||||
|
elseif l:c ==# "'"
|
||||||
|
let l:state = 5
|
||||||
|
else
|
||||||
|
let l:current .= l:c
|
||||||
|
let l:state = 1
|
||||||
|
endif
|
||||||
|
elseif l:state == 2 " unquoted backslash
|
||||||
|
if l:c !=# "\n" " can it even be \n?
|
||||||
|
let l:current .= l:c
|
||||||
|
endif
|
||||||
|
let l:state = 1
|
||||||
|
elseif l:state == 3 " double-quote
|
||||||
|
if l:c ==# '\'
|
||||||
|
let l:state = 4
|
||||||
|
elseif l:c ==# '"'
|
||||||
|
let l:state = 1
|
||||||
|
else
|
||||||
|
let l:current .= l:c
|
||||||
|
endif
|
||||||
|
elseif l:state == 4 " double-quoted backslash
|
||||||
|
if stridx('$`"\', l:c) >= 0
|
||||||
|
let l:current .= l:c
|
||||||
|
elseif l:c ==# "\n" " is this even possible?
|
||||||
|
" skip it
|
||||||
|
else
|
||||||
|
let l:current .= '\'.l:c
|
||||||
|
endif
|
||||||
|
let l:state = 3
|
||||||
|
elseif l:state == 5 " single-quoted
|
||||||
|
if l:c == "'"
|
||||||
|
let l:state = 1
|
||||||
|
else
|
||||||
|
let l:current .= l:c
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
if l:state != 0
|
||||||
|
call add(l:args, l:current)
|
||||||
|
endif
|
||||||
|
return l:args
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:RmDir(path)
|
||||||
|
" sanity check; make sure it's not empty, /, or $HOME
|
||||||
|
if empty(a:path)
|
||||||
|
echoerr 'Attempted to delete empty path'
|
||||||
|
return 0
|
||||||
|
elseif a:path == '/' || a:path == $HOME
|
||||||
|
echoerr 'Attempted to delete protected path: ' . a:path
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
return system("rm -rf " . shellescape(a:path))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
|
||||||
|
" If {pwd} is the empty string then it doesn't change the cwd.
|
||||||
|
function! s:system(pwd, cmd)
|
||||||
|
let cmd = a:cmd
|
||||||
|
if !empty(a:pwd)
|
||||||
|
let cmd = 'cd ' . shellescape(a:pwd) . ' && ' . cmd
|
||||||
|
endif
|
||||||
|
return system(cmd)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Playpen Support {{{1
|
||||||
|
" Parts of gist.vim by Yasuhiro Matsumoto <mattn.jp@gmail.com> reused
|
||||||
|
" gist.vim available under the BSD license, available at
|
||||||
|
" http://github.com/mattn/gist-vim
|
||||||
|
function! s:has_webapi()
|
||||||
|
if !exists("*webapi#http#post")
|
||||||
|
try
|
||||||
|
call webapi#http#post()
|
||||||
|
catch
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
return exists("*webapi#http#post")
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! rust#Play(count, line1, line2, ...) abort
|
||||||
|
redraw
|
||||||
|
|
||||||
|
let l:rust_playpen_url = get(g:, 'rust_playpen_url', 'https://play.rust-lang.org/')
|
||||||
|
let l:rust_shortener_url = get(g:, 'rust_shortener_url', 'https://is.gd/')
|
||||||
|
|
||||||
|
if !s:has_webapi()
|
||||||
|
echohl ErrorMsg | echomsg ':RustPlay depends on webapi.vim (https://github.com/mattn/webapi-vim)' | echohl None
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
let bufname = bufname('%')
|
||||||
|
if a:count < 1
|
||||||
|
let content = join(getline(a:line1, a:line2), "\n")
|
||||||
|
else
|
||||||
|
let save_regcont = @"
|
||||||
|
let save_regtype = getregtype('"')
|
||||||
|
silent! normal! gvy
|
||||||
|
let content = @"
|
||||||
|
call setreg('"', save_regcont, save_regtype)
|
||||||
|
endif
|
||||||
|
|
||||||
|
let body = l:rust_playpen_url."?code=".webapi#http#encodeURI(content)
|
||||||
|
|
||||||
|
if strlen(body) > 5000
|
||||||
|
echohl ErrorMsg | echomsg 'Buffer too large, max 5000 encoded characters ('.strlen(body).')' | echohl None
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
let payload = "format=simple&url=".webapi#http#encodeURI(body)
|
||||||
|
let res = webapi#http#post(l:rust_shortener_url.'create.php', payload, {})
|
||||||
|
let url = res.content
|
||||||
|
|
||||||
|
redraw | echomsg 'Done: '.url
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" }}}1
|
||||||
|
|
||||||
|
" vim: set noet sw=8 ts=8:
|
107
runtime/autoload/rustfmt.vim
Normal file
107
runtime/autoload/rustfmt.vim
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
" Author: Stephen Sugden <stephen@stephensugden.com>
|
||||||
|
"
|
||||||
|
" Adapted from https://github.com/fatih/vim-go
|
||||||
|
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||||
|
|
||||||
|
if !exists("g:rustfmt_autosave")
|
||||||
|
let g:rustfmt_autosave = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("g:rustfmt_command")
|
||||||
|
let g:rustfmt_command = "rustfmt"
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("g:rustfmt_options")
|
||||||
|
let g:rustfmt_options = ""
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("g:rustfmt_fail_silently")
|
||||||
|
let g:rustfmt_fail_silently = 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:got_fmt_error = 0
|
||||||
|
|
||||||
|
function! s:RustfmtCommandRange(filename, line1, line2)
|
||||||
|
let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]}
|
||||||
|
return printf("%s %s --write-mode=overwrite --file-lines '[%s]'", g:rustfmt_command, g:rustfmt_options, json_encode(l:arg))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:RustfmtCommand(filename)
|
||||||
|
return g:rustfmt_command . " --write-mode=overwrite " . g:rustfmt_options . " " . shellescape(a:filename)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:RunRustfmt(command, curw, tmpname)
|
||||||
|
if exists("*systemlist")
|
||||||
|
let out = systemlist(a:command)
|
||||||
|
else
|
||||||
|
let out = split(system(a:command), '\r\?\n')
|
||||||
|
endif
|
||||||
|
|
||||||
|
if v:shell_error == 0 || v:shell_error == 3
|
||||||
|
" remove undo point caused via BufWritePre
|
||||||
|
try | silent undojoin | catch | endtry
|
||||||
|
|
||||||
|
" Replace current file with temp file, then reload buffer
|
||||||
|
call rename(a:tmpname, expand('%'))
|
||||||
|
silent edit!
|
||||||
|
let &syntax = &syntax
|
||||||
|
|
||||||
|
" only clear location list if it was previously filled to prevent
|
||||||
|
" clobbering other additions
|
||||||
|
if s:got_fmt_error
|
||||||
|
let s:got_fmt_error = 0
|
||||||
|
call setloclist(0, [])
|
||||||
|
lwindow
|
||||||
|
endif
|
||||||
|
elseif g:rustfmt_fail_silently == 0
|
||||||
|
" otherwise get the errors and put them in the location list
|
||||||
|
let errors = []
|
||||||
|
|
||||||
|
for line in out
|
||||||
|
" src/lib.rs:13:5: 13:10 error: expected `,`, or `}`, found `value`
|
||||||
|
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\):\s*\(\d\+:\d\+\s*\)\?\s*error: \(.*\)')
|
||||||
|
if !empty(tokens)
|
||||||
|
call add(errors, {"filename": @%,
|
||||||
|
\"lnum": tokens[2],
|
||||||
|
\"col": tokens[3],
|
||||||
|
\"text": tokens[5]})
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
if empty(errors)
|
||||||
|
% | " Couldn't detect rustfmt error format, output errors
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !empty(errors)
|
||||||
|
call setloclist(0, errors, 'r')
|
||||||
|
echohl Error | echomsg "rustfmt returned error" | echohl None
|
||||||
|
endif
|
||||||
|
|
||||||
|
let s:got_fmt_error = 1
|
||||||
|
lwindow
|
||||||
|
" We didn't use the temp file, so clean up
|
||||||
|
call delete(a:tmpname)
|
||||||
|
endif
|
||||||
|
|
||||||
|
call winrestview(a:curw)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! rustfmt#FormatRange(line1, line2)
|
||||||
|
let l:curw = winsaveview()
|
||||||
|
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
|
||||||
|
call writefile(getline(1, '$'), l:tmpname)
|
||||||
|
|
||||||
|
let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2)
|
||||||
|
|
||||||
|
call s:RunRustfmt(command, l:curw, l:tmpname)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! rustfmt#Format()
|
||||||
|
let l:curw = winsaveview()
|
||||||
|
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
|
||||||
|
call writefile(getline(1, '$'), l:tmpname)
|
||||||
|
|
||||||
|
let command = s:RustfmtCommand(l:tmpname)
|
||||||
|
|
||||||
|
call s:RunRustfmt(command, l:curw, l:tmpname)
|
||||||
|
endfunction
|
@@ -45,7 +45,7 @@ call map(copy(s:SHADA_ENTRY_NAMES),
|
|||||||
let s:SHADA_MAP_ENTRIES = {
|
let s:SHADA_MAP_ENTRIES = {
|
||||||
\'search_pattern': ['sp', 'sh', 'ss', 'sb', 'sm', 'sc', 'sl', 'se', 'so',
|
\'search_pattern': ['sp', 'sh', 'ss', 'sb', 'sm', 'sc', 'sl', 'se', 'so',
|
||||||
\ 'su'],
|
\ 'su'],
|
||||||
\'register': ['n', 'rc', 'rw', 'rt'],
|
\'register': ['n', 'rc', 'rw', 'rt', 'ru'],
|
||||||
\'global_mark': ['n', 'f', 'l', 'c'],
|
\'global_mark': ['n', 'f', 'l', 'c'],
|
||||||
\'local_mark': ['f', 'n', 'l', 'c'],
|
\'local_mark': ['f', 'n', 'l', 'c'],
|
||||||
\'jump': ['f', 'l', 'c'],
|
\'jump': ['f', 'l', 'c'],
|
||||||
@@ -139,6 +139,7 @@ let s:SHADA_STANDARD_KEYS = {
|
|||||||
\'rt': ['type', 'regtype', s:SHADA_ENUMS.regtype.CHARACTERWISE],
|
\'rt': ['type', 'regtype', s:SHADA_ENUMS.regtype.CHARACTERWISE],
|
||||||
\'rw': ['block width', 'uint', 0],
|
\'rw': ['block width', 'uint', 0],
|
||||||
\'rc': ['contents', 'binarray', s:SHADA_REQUIRED],
|
\'rc': ['contents', 'binarray', s:SHADA_REQUIRED],
|
||||||
|
\'ru': ['is_unnamed', 'boolean', g:msgpack#false],
|
||||||
\'n': ['name', 'intchar', char2nr('"')],
|
\'n': ['name', 'intchar', char2nr('"')],
|
||||||
\'l': ['line number', 'uint', 1],
|
\'l': ['line number', 'uint', 1],
|
||||||
\'c': ['column', 'uint', 0],
|
\'c': ['column', 'uint', 0],
|
||||||
|
@@ -88,8 +88,8 @@ function! spellfile#LoadFile(lang)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if newbufnr == winbufnr(0)
|
if newbufnr == winbufnr(0)
|
||||||
" We are back the old buffer, remove any (half-finished) download.
|
" We are back to the old buffer, remove any (half-finished) download.
|
||||||
g/^/d_
|
keeppatterns g/^/d_
|
||||||
else
|
else
|
||||||
let newbufnr = winbufnr(0)
|
let newbufnr = winbufnr(0)
|
||||||
endif
|
endif
|
||||||
@@ -127,7 +127,7 @@ function! spellfile#LoadFile(lang)
|
|||||||
exe "write " . dirname . '/' . fname
|
exe "write " . dirname . '/' . fname
|
||||||
|
|
||||||
" Also download the .sug file.
|
" Also download the .sug file.
|
||||||
g/^/d_
|
keeppatterns g/^/d_
|
||||||
let fname = substitute(fname, '\.spl$', '.sug', '')
|
let fname = substitute(fname, '\.spl$', '.sug', '')
|
||||||
echo 'Downloading ' . fname . '...'
|
echo 'Downloading ' . fname . '...'
|
||||||
call spellfile#Nread(fname)
|
call spellfile#Nread(fname)
|
||||||
@@ -197,7 +197,7 @@ function! spellfile#WritableSpellDir()
|
|||||||
" Always use the $XDG_DATA_HOME/nvim/site directory
|
" Always use the $XDG_DATA_HOME/nvim/site directory
|
||||||
if exists('$XDG_DATA_HOME')
|
if exists('$XDG_DATA_HOME')
|
||||||
return $XDG_DATA_HOME . "/nvim/site/spell"
|
return $XDG_DATA_HOME . "/nvim/site/spell"
|
||||||
else
|
elseif !(has('win32') || has('win64'))
|
||||||
return $HOME . "/.local/share/nvim/site/spell"
|
return $HOME . "/.local/share/nvim/site/spell"
|
||||||
endif
|
endif
|
||||||
for dir in split(&rtp, ',')
|
for dir in split(&rtp, ',')
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
" Language: SQL
|
" Language: SQL
|
||||||
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||||
" Version: 16.0
|
" Version: 16.0
|
||||||
" Last Change: 2015 Dec 29
|
" Last Change: 2017 Oct 15
|
||||||
" Homepage: http://www.vim.org/scripts/script.php?script_id=1572
|
" Homepage: http://www.vim.org/scripts/script.php?script_id=1572
|
||||||
" Usage: For detailed help
|
" Usage: For detailed help
|
||||||
" ":help sql.txt"
|
" ":help sql.txt"
|
||||||
|
@@ -15,30 +15,17 @@ function! tutor#SetupVim()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Mappings: {{{1
|
" Loads metadata file, if available
|
||||||
|
function! tutor#LoadMetadata()
|
||||||
function! s:CheckMaps()
|
let b:tutor_metadata = json_decode(join(readfile(expand('%').'.json'), "\n"))
|
||||||
nmap
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:MapKeyWithRedirect(key, cmd)
|
" Mappings: {{{1
|
||||||
if maparg(a:key) !=# ''
|
|
||||||
redir => l:keys
|
|
||||||
silent call s:CheckMaps()
|
|
||||||
redir END
|
|
||||||
let l:key_list = split(l:keys, '\n')
|
|
||||||
|
|
||||||
let l:raw_map = filter(copy(l:key_list), "v:val =~# '\\* ".a:key."'")
|
function! tutor#SetNormalMappings()
|
||||||
if len(l:raw_map) == 0
|
nnoremap <silent> <buffer> <CR> :call tutor#FollowLink(0)<cr>
|
||||||
exe "nnoremap <buffer> <expr> ".a:key." ".a:cmd
|
nnoremap <silent> <buffer> <2-LeftMouse> :call tutor#MouseDoubleClick()<cr>
|
||||||
return
|
nnoremap <buffer> >> :call tutor#InjectCommand()<cr>
|
||||||
endif
|
|
||||||
let l:map_data = split(l:raw_map[0], '\s*')
|
|
||||||
|
|
||||||
exe "nnoremap <buffer> <expr> ".l:map_data[0]." ".a:cmd
|
|
||||||
else
|
|
||||||
exe "nnoremap <buffer> <expr> ".a:key." ".a:cmd
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! tutor#MouseDoubleClick()
|
function! tutor#MouseDoubleClick()
|
||||||
@@ -46,7 +33,7 @@ function! tutor#MouseDoubleClick()
|
|||||||
normal! zo
|
normal! zo
|
||||||
else
|
else
|
||||||
if match(getline('.'), '^#\{1,} ') > -1
|
if match(getline('.'), '^#\{1,} ') > -1
|
||||||
normal! zc
|
silent normal! zc
|
||||||
else
|
else
|
||||||
call tutor#FollowLink(0)
|
call tutor#FollowLink(0)
|
||||||
endif
|
endif
|
||||||
@@ -59,114 +46,6 @@ function! tutor#InjectCommand()
|
|||||||
redraw | echohl WarningMsg | echon "tutor: ran" | echohl None | echon " " | echohl Statement | echon l:cmd
|
redraw | echohl WarningMsg | echon "tutor: ran" | echohl None | echon " " | echohl Statement | echon l:cmd
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! tutor#SetNormalMappings()
|
|
||||||
call s:MapKeyWithRedirect('l', 'tutor#ForwardSkipConceal(v:count1)')
|
|
||||||
call s:MapKeyWithRedirect('h', 'tutor#BackwardSkipConceal(v:count1)')
|
|
||||||
call s:MapKeyWithRedirect('<right>', 'tutor#ForwardSkipConceal(v:count1)')
|
|
||||||
call s:MapKeyWithRedirect('<left>', 'tutor#BackwardSkipConceal(v:count1)')
|
|
||||||
|
|
||||||
nnoremap <silent> <buffer> <CR> :call tutor#FollowLink(0)<cr>
|
|
||||||
nnoremap <silent> <buffer> <2-LeftMouse> :call tutor#MouseDoubleClick()<cr>
|
|
||||||
nnoremap <buffer> >> :call tutor#InjectCommand()<cr>
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! tutor#SetSampleTextMappings()
|
|
||||||
noremap <silent> <buffer> A :if match(getline('.'), '^--->') > -1 \| call search('\s{\@=', 'Wc') \| startinsert \| else \| startinsert! \| endif<cr>
|
|
||||||
noremap <silent> <buffer> $ :if match(getline('.'), '^--->') > -1 \| call search('.\s{\@=', 'Wc') \| else \| call search('$', 'Wc') \| endif<cr>
|
|
||||||
onoremap <silent> <buffer> $ :if match(getline('.'), '^--->') > -1 \| call search('.\s{\@=', 'Wc') \| else \| call search('$', 'Wc') \| endif<cr>
|
|
||||||
noremap <silent> <buffer> ^ :if match(getline('.'), '^--->') > -1 \| call search('\(--->\s\)\@<=.', 'bcW') \| else \| call search('^', 'bcW') \|endif<cr>
|
|
||||||
onoremap <silent> <buffer> ^ :if match(getline('.'), '^--->') > -1 \| call search('\(--->\s\)\@<=.', 'bcW') \| else \| call search('^', 'bcW') \|endif<cr>
|
|
||||||
nmap <silent> <buffer> 0 ^<esc>
|
|
||||||
nmap <silent> <buffer> <Home> ^<esc>
|
|
||||||
nmap <silent> <buffer> <End> $
|
|
||||||
imap <silent> <buffer> <Home> <esc>^<esc>:startinsert<cr>
|
|
||||||
imap <silent> <buffer> <End> <esc>$:startinsert<cr>
|
|
||||||
noremap <silent> <buffer> I :exe "normal! 0" \| startinsert<cr>
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Navigation: {{{1
|
|
||||||
|
|
||||||
" taken from http://stackoverflow.com/a/24224578
|
|
||||||
|
|
||||||
function! tutor#ForwardSkipConceal(count)
|
|
||||||
let cnt=a:count
|
|
||||||
let mvcnt=0
|
|
||||||
let c=col('.')
|
|
||||||
let l=line('.')
|
|
||||||
let lc=col('$')
|
|
||||||
let line=getline('.')
|
|
||||||
while cnt
|
|
||||||
if c>=lc
|
|
||||||
let mvcnt+=cnt
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
if stridx(&concealcursor, 'n')==-1
|
|
||||||
let isconcealed=0
|
|
||||||
else
|
|
||||||
let [isconcealed, cchar, group] = synconcealed(l, c)
|
|
||||||
endif
|
|
||||||
if isconcealed
|
|
||||||
let cnt-=strchars(cchar)
|
|
||||||
let oldc=c
|
|
||||||
let c+=1
|
|
||||||
while c < lc
|
|
||||||
let [isconcealed2, cchar2, group2] = synconcealed(l, c)
|
|
||||||
if !isconcealed2 || cchar2 != cchar
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
let c+= 1
|
|
||||||
endwhile
|
|
||||||
let mvcnt+=strchars(line[oldc-1:c-2])
|
|
||||||
else
|
|
||||||
let cnt-=1
|
|
||||||
let mvcnt+=1
|
|
||||||
let c+=len(matchstr(line[c-1:], '.'))
|
|
||||||
endif
|
|
||||||
endwhile
|
|
||||||
return mvcnt.'l'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! tutor#BackwardSkipConceal(count)
|
|
||||||
let cnt=a:count
|
|
||||||
let mvcnt=0
|
|
||||||
let c=col('.')
|
|
||||||
let l=line('.')
|
|
||||||
let lc=0
|
|
||||||
let line=getline('.')
|
|
||||||
while cnt
|
|
||||||
if c<=1
|
|
||||||
let mvcnt+=cnt
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
if stridx(&concealcursor, 'n')==-1 || c == 0
|
|
||||||
let isconcealed=0
|
|
||||||
else
|
|
||||||
let [isconcealed, cchar, group]=synconcealed(l, c-1)
|
|
||||||
endif
|
|
||||||
if isconcealed
|
|
||||||
let cnt-=strchars(cchar)
|
|
||||||
let oldc=c
|
|
||||||
let c-=1
|
|
||||||
while c>1
|
|
||||||
let [isconcealed2, cchar2, group2] = synconcealed(l, c-1)
|
|
||||||
if !isconcealed2 || cchar2 != cchar
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
let c-=1
|
|
||||||
endwhile
|
|
||||||
let c = max([c, 1])
|
|
||||||
let mvcnt+=strchars(line[c-1:oldc-2])
|
|
||||||
else
|
|
||||||
let cnt-=1
|
|
||||||
let mvcnt+=1
|
|
||||||
let c-=len(matchstr(line[:c-2], '.$'))
|
|
||||||
endif
|
|
||||||
endwhile
|
|
||||||
return mvcnt.'h'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Hypertext: {{{1
|
|
||||||
|
|
||||||
function! tutor#FollowLink(force)
|
function! tutor#FollowLink(force)
|
||||||
let l:stack_s = join(map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")'), '')
|
let l:stack_s = join(map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")'), '')
|
||||||
if l:stack_s =~# 'tutorLink'
|
if l:stack_s =~# 'tutorLink'
|
||||||
@@ -209,42 +88,40 @@ function! tutor#InfoText()
|
|||||||
return join(l:info_parts, " ")
|
return join(l:info_parts, " ")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Marks {{{1
|
|
||||||
function! tutor#PlaceXMarks()
|
" Marks: {{{1
|
||||||
call cursor(1, 1)
|
|
||||||
|
function! tutor#ApplyMarks()
|
||||||
|
hi! link tutorExpect Special
|
||||||
|
if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect')
|
||||||
let b:tutor_sign_id = 1
|
let b:tutor_sign_id = 1
|
||||||
while search('^--->', 'W') > 0
|
for expct in keys(b:tutor_metadata['expect'])
|
||||||
call tutor#CheckText(getline('.'))
|
let lnum = eval(expct)
|
||||||
|
call matchaddpos('tutorExpect', [lnum])
|
||||||
|
call tutor#CheckLine(lnum)
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! tutor#ApplyMarksOnChanged()
|
||||||
|
if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect')
|
||||||
|
let lnum = line('.')
|
||||||
|
if index(keys(b:tutor_metadata['expect']), string(lnum)) > -1
|
||||||
|
call tutor#CheckLine(lnum)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! tutor#CheckLine(line)
|
||||||
|
if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect')
|
||||||
|
let bufn = bufnr('%')
|
||||||
|
let ctext = getline(a:line)
|
||||||
|
if b:tutor_metadata['expect'][string(a:line)] == -1 || ctext ==# b:tutor_metadata['expect'][string(a:line)]
|
||||||
|
exe "sign place ".b:tutor_sign_id." line=".a:line." name=tutorok buffer=".bufn
|
||||||
|
else
|
||||||
|
exe "sign place ".b:tutor_sign_id." line=".a:line." name=tutorbad buffer=".bufn
|
||||||
|
endif
|
||||||
let b:tutor_sign_id+=1
|
let b:tutor_sign_id+=1
|
||||||
endwhile
|
|
||||||
call cursor(1, 1)
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! tutor#CheckText(text)
|
|
||||||
if match(a:text, '{expect:ANYTHING}\s*$') == -1
|
|
||||||
if match(getline('.'), '^--->\s*$') > -1
|
|
||||||
exe "sign place ".b:tutor_sign_id." line=".line('.')." name=tutorbad buffer=".bufnr('%')
|
|
||||||
else
|
|
||||||
if match(getline('.'), '|expect:.\+|') == -1
|
|
||||||
let l:cur_text = matchstr(a:text, '---> \zs.\{-}\ze {expect:')
|
|
||||||
let l:expected_text = matchstr(a:text, '{expect:\zs.*\ze}\s*$')
|
|
||||||
else
|
|
||||||
let l:cur_text = matchstr(a:text, '---> \zs.\{-}\ze |expect:')
|
|
||||||
let l:expected_text = matchstr(a:text, '|expect:\zs.*\ze|\s*$')
|
|
||||||
endif
|
|
||||||
if l:cur_text ==# l:expected_text
|
|
||||||
exe "sign place ".b:tutor_sign_id." line=".line('.')." name=tutorok buffer=".bufnr('%')
|
|
||||||
else
|
|
||||||
exe "sign place ".b:tutor_sign_id." line=".line('.')." name=tutorbad buffer=".bufnr('%')
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
function! tutor#OnTextChanged()
|
|
||||||
let l:text = getline('.')
|
|
||||||
if match(l:text, '^--->') > -1
|
|
||||||
call tutor#CheckText(l:text)
|
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@@ -53,7 +53,6 @@
|
|||||||
: scriptnames
|
: scriptnames
|
||||||
:endif
|
:endif
|
||||||
:set all
|
:set all
|
||||||
:set termcap
|
|
||||||
:if has("autocmd")
|
:if has("autocmd")
|
||||||
: au
|
: au
|
||||||
:endif
|
:endif
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
" Vim compiler file
|
" Vim compiler file
|
||||||
" Compiler: BDF to PCF Conversion
|
" Compiler: BDF to PCF Conversion
|
||||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||||
" Latest Revision: 2006-04-19
|
" Latest Revision: 2006-04-19
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
|
35
runtime/compiler/cargo.vim
Normal file
35
runtime/compiler/cargo.vim
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
" Vim compiler file
|
||||||
|
" Compiler: Cargo Compiler
|
||||||
|
" Maintainer: Damien Radtke <damienradtke@gmail.com>
|
||||||
|
" Latest Revision: 2014 Sep 24
|
||||||
|
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||||
|
|
||||||
|
if exists('current_compiler')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
runtime compiler/rustc.vim
|
||||||
|
let current_compiler = "cargo"
|
||||||
|
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
if exists(':CompilerSet') != 2
|
||||||
|
command -nargs=* CompilerSet setlocal <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists('g:cargo_makeprg_params')
|
||||||
|
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
|
||||||
|
else
|
||||||
|
CompilerSet makeprg=cargo\ $*
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Ignore general cargo progress messages
|
||||||
|
CompilerSet errorformat+=
|
||||||
|
\%-G%\\s%#Downloading%.%#,
|
||||||
|
\%-G%\\s%#Compiling%.%#,
|
||||||
|
\%-G%\\s%#Finished%.%#,
|
||||||
|
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
|
||||||
|
\%-G%\\s%#To\ learn\ more\\,%.%#
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
@@ -1,6 +1,6 @@
|
|||||||
" Vim compiler file
|
" Vim compiler file
|
||||||
" Compiler: GNU C Compiler
|
" Compiler: GNU C Compiler
|
||||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||||
" Latest Revision: 2010-10-14
|
" Latest Revision: 2010-10-14
|
||||||
" added line suggested by Anton Lindqvist 2016 Mar 31
|
" added line suggested by Anton Lindqvist 2016 Mar 31
|
||||||
|
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
" Vim compiler file
|
" Vim compiler file
|
||||||
" Compiler: reStructuredText Documentation Format
|
" Compiler: sphinx >= 1.0.8, http://www.sphinx-doc.org
|
||||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
" Description: reStructuredText Documentation Format
|
||||||
" Latest Revision: 2006-04-19
|
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||||
|
" Latest Revision: 2017-03-31
|
||||||
|
|
||||||
if exists("current_compiler")
|
if exists("current_compiler")
|
||||||
finish
|
finish
|
||||||
@@ -11,12 +12,18 @@ let current_compiler = "rst"
|
|||||||
let s:cpo_save = &cpo
|
let s:cpo_save = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
setlocal errorformat=
|
if exists(":CompilerSet") != 2
|
||||||
\%f:%l:\ (%tEBUG/0)\ %m,
|
command -nargs=* CompilerSet setlocal <args>
|
||||||
\%f:%l:\ (%tNFO/1)\ %m,
|
endif
|
||||||
\%f:%l:\ (%tARNING/2)\ %m,
|
|
||||||
\%f:%l:\ (%tRROR/3)\ %m,
|
CompilerSet errorformat=
|
||||||
\%f:%l:\ (%tEVERE/3)\ %m,
|
\%f\\:%l:\ %tEBUG:\ %m,
|
||||||
|
\%f\\:%l:\ %tNFO:\ %m,
|
||||||
|
\%f\\:%l:\ %tARNING:\ %m,
|
||||||
|
\%f\\:%l:\ %tRROR:\ %m,
|
||||||
|
\%f\\:%l:\ %tEVERE:\ %m,
|
||||||
|
\%f\\:%s:\ %tARNING:\ %m,
|
||||||
|
\%f\\:%s:\ %tRROR:\ %m,
|
||||||
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
|
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
|
||||||
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
|
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
|
||||||
\%DMaking\ %*\\a\ in\ %f
|
\%DMaking\ %*\\a\ in\ %f
|
||||||
|
46
runtime/compiler/rustc.vim
Normal file
46
runtime/compiler/rustc.vim
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
" Vim compiler file
|
||||||
|
" Compiler: Rust Compiler
|
||||||
|
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||||
|
" Latest Revision: 2013 Jul 12
|
||||||
|
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||||
|
|
||||||
|
if exists("current_compiler")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let current_compiler = "rustc"
|
||||||
|
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
if exists(":CompilerSet") != 2
|
||||||
|
command -nargs=* CompilerSet setlocal <args>
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
|
||||||
|
CompilerSet makeprg=rustc
|
||||||
|
else
|
||||||
|
CompilerSet makeprg=rustc\ \%
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Old errorformat (before nightly 2016/08/10)
|
||||||
|
CompilerSet errorformat=
|
||||||
|
\%f:%l:%c:\ %t%*[^:]:\ %m,
|
||||||
|
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
|
||||||
|
\%-G%f:%l\ %s,
|
||||||
|
\%-G%*[\ ]^,
|
||||||
|
\%-G%*[\ ]^%*[~],
|
||||||
|
\%-G%*[\ ]...
|
||||||
|
|
||||||
|
" New errorformat (after nightly 2016/08/10)
|
||||||
|
CompilerSet errorformat+=
|
||||||
|
\%-G,
|
||||||
|
\%-Gerror:\ aborting\ %.%#,
|
||||||
|
\%-Gerror:\ Could\ not\ compile\ %.%#,
|
||||||
|
\%Eerror:\ %m,
|
||||||
|
\%Eerror[E%n]:\ %m,
|
||||||
|
\%Wwarning:\ %m,
|
||||||
|
\%Inote:\ %m,
|
||||||
|
\%C\ %#-->\ %f:%l:%c
|
||||||
|
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
@@ -7,11 +7,11 @@
|
|||||||
Nvim API *API* *api*
|
Nvim API *API* *api*
|
||||||
|
|
||||||
Nvim exposes a powerful API that can be used by plugins and external processes
|
Nvim exposes a powerful API that can be used by plugins and external processes
|
||||||
via |msgpack-rpc|, Lua and VimL (|eval-api|).
|
via |RPC|, |Lua| and VimL (|eval-api|).
|
||||||
|
|
||||||
Applications can also embed libnvim to work with the C API directly.
|
Applications can also embed libnvim to work with the C API directly.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
API Types *api-types*
|
API Types *api-types*
|
||||||
@@ -48,6 +48,7 @@ version.api_compatible API is backwards-compatible with this level
|
|||||||
version.api_prerelease Declares the current API level as unstable >
|
version.api_prerelease Declares the current API level as unstable >
|
||||||
(version.api_prerelease && fn.since == version.api_level)
|
(version.api_prerelease && fn.since == version.api_level)
|
||||||
functions API function signatures
|
functions API function signatures
|
||||||
|
ui_events UI event signatures |ui|
|
||||||
{fn}.since API level where function {fn} was introduced
|
{fn}.since API level where function {fn} was introduced
|
||||||
{fn}.deprecated_since API level where function {fn} was deprecated
|
{fn}.deprecated_since API level where function {fn} was deprecated
|
||||||
types Custom handle types defined by Nvim
|
types Custom handle types defined by Nvim
|
||||||
@@ -134,6 +135,26 @@ nvim_command({command}) *nvim_command()*
|
|||||||
Parameters:~
|
Parameters:~
|
||||||
{command} Ex-command string
|
{command} Ex-command string
|
||||||
|
|
||||||
|
nvim_get_hl_by_name({name}, {rgb}) *nvim_get_hl_by_name()*
|
||||||
|
Gets a highlight definition by name.
|
||||||
|
|
||||||
|
Parameters:~
|
||||||
|
{name} Highlight group name
|
||||||
|
{rgb} Export RGB colors
|
||||||
|
|
||||||
|
Return:~
|
||||||
|
Highlight definition map
|
||||||
|
|
||||||
|
nvim_get_hl_by_id({hl_id}, {rgb}) *nvim_get_hl_by_id()*
|
||||||
|
Gets a highlight definition by id. |hlID()|
|
||||||
|
|
||||||
|
Parameters:~
|
||||||
|
{hl_id} Highlight id as returned by |hlID()|
|
||||||
|
{rgb} Export RGB colors
|
||||||
|
|
||||||
|
Return:~
|
||||||
|
Highlight definition map
|
||||||
|
|
||||||
nvim_feedkeys({keys}, {mode}, {escape_csi}) *nvim_feedkeys()*
|
nvim_feedkeys({keys}, {mode}, {escape_csi}) *nvim_feedkeys()*
|
||||||
Passes input keys to Nvim. On VimL error: Does not fail, but
|
Passes input keys to Nvim. On VimL error: Does not fail, but
|
||||||
updates v:errmsg.
|
updates v:errmsg.
|
||||||
@@ -150,7 +171,11 @@ nvim_input({keys}) *nvim_input()*
|
|||||||
|
|
||||||
Unlike `nvim_feedkeys`, this uses a lower-level input buffer
|
Unlike `nvim_feedkeys`, this uses a lower-level input buffer
|
||||||
and the call is not deferred. This is the most reliable way to
|
and the call is not deferred. This is the most reliable way to
|
||||||
emulate real user input.
|
send real user input.
|
||||||
|
|
||||||
|
Note:
|
||||||
|
|keycodes| like <CR> are translated, so "<" is special. To
|
||||||
|
input a literal "<", send <LT>.
|
||||||
|
|
||||||
Attributes:~
|
Attributes:~
|
||||||
{async}
|
{async}
|
||||||
@@ -164,7 +189,16 @@ nvim_input({keys}) *nvim_input()*
|
|||||||
|
|
||||||
*nvim_replace_termcodes()*
|
*nvim_replace_termcodes()*
|
||||||
nvim_replace_termcodes({str}, {from_part}, {do_lt}, {special})
|
nvim_replace_termcodes({str}, {from_part}, {do_lt}, {special})
|
||||||
Replaces any terminal codes with the internal representation
|
Replaces terminal codes and |keycodes| (<CR>, <Esc>, ...) in a
|
||||||
|
string with the internal representation.
|
||||||
|
|
||||||
|
Parameters:~
|
||||||
|
{str} String to be converted.
|
||||||
|
{from_part} Legacy Vim parameter. Usually true.
|
||||||
|
{do_lt} Also translate <lt>. Ignored if `special` is
|
||||||
|
false.
|
||||||
|
{special} Replace |keycodes|, e.g. <CR> becomes a "\n"
|
||||||
|
char.
|
||||||
|
|
||||||
nvim_command_output({str}) *nvim_command_output()*
|
nvim_command_output({str}) *nvim_command_output()*
|
||||||
TODO: Documentation
|
TODO: Documentation
|
||||||
@@ -181,8 +215,10 @@ nvim_eval({expr}) *nvim_eval()*
|
|||||||
Evaluation result or expanded object
|
Evaluation result or expanded object
|
||||||
|
|
||||||
nvim_call_function({fname}, {args}) *nvim_call_function()*
|
nvim_call_function({fname}, {args}) *nvim_call_function()*
|
||||||
Calls a VimL function with the given arguments. On VimL error:
|
Calls a VimL function with the given arguments
|
||||||
Returns a generic error; v:errmsg is not updated.
|
|
||||||
|
On VimL error: Returns a generic error; v:errmsg is not
|
||||||
|
updated.
|
||||||
|
|
||||||
Parameters:~
|
Parameters:~
|
||||||
{fname} Function to call
|
{fname} Function to call
|
||||||
@@ -191,7 +227,21 @@ nvim_call_function({fname}, {args}) *nvim_call_function()*
|
|||||||
Return:~
|
Return:~
|
||||||
Result of the function call
|
Result of the function call
|
||||||
|
|
||||||
nvim_strwidth({str}) *nvim_strwidth()*
|
nvim_execute_lua({code}, {args}) *nvim_execute_lua()*
|
||||||
|
Execute lua code. Parameters (if any) are available as `...`
|
||||||
|
inside the chunk. The chunk can return a value.
|
||||||
|
|
||||||
|
Only statements are executed. To evaluate an expression,
|
||||||
|
prefix it with `return`: return my_function(...)
|
||||||
|
|
||||||
|
Parameters:~
|
||||||
|
{code} lua code to execute
|
||||||
|
{args} Arguments to the code
|
||||||
|
|
||||||
|
Return:~
|
||||||
|
Return value of lua code if present or NIL.
|
||||||
|
|
||||||
|
nvim_strwidth({text}) *nvim_strwidth()*
|
||||||
Calculates the number of display cells occupied by `text`.
|
Calculates the number of display cells occupied by `text`.
|
||||||
<Tab> counts as one cell.
|
<Tab> counts as one cell.
|
||||||
|
|
||||||
@@ -280,20 +330,24 @@ nvim_set_option({name}, {value}) *nvim_set_option()*
|
|||||||
{value} New option value
|
{value} New option value
|
||||||
|
|
||||||
nvim_out_write({str}) *nvim_out_write()*
|
nvim_out_write({str}) *nvim_out_write()*
|
||||||
Writes a message to vim output buffer
|
Writes a message to the Vim output buffer. Does not append
|
||||||
|
"\n", the message is buffered (won't display) until a linefeed
|
||||||
|
is written.
|
||||||
|
|
||||||
Parameters:~
|
Parameters:~
|
||||||
{str} Message
|
{str} Message
|
||||||
|
|
||||||
nvim_err_write({str}) *nvim_err_write()*
|
nvim_err_write({str}) *nvim_err_write()*
|
||||||
Writes a message to vim error buffer
|
Writes a message to the Vim error buffer. Does not append
|
||||||
|
"\n", the message is buffered (won't display) until a linefeed
|
||||||
|
is written.
|
||||||
|
|
||||||
Parameters:~
|
Parameters:~
|
||||||
{str} Message
|
{str} Message
|
||||||
|
|
||||||
nvim_err_writeln({str}) *nvim_err_writeln()*
|
nvim_err_writeln({str}) *nvim_err_writeln()*
|
||||||
Writes a message to vim error buffer. Appends a linefeed to
|
Writes a message to the Vim error buffer. Appends "\n", so the
|
||||||
ensure all contents are written.
|
buffer is flushed (and displayed).
|
||||||
|
|
||||||
Parameters:~
|
Parameters:~
|
||||||
{str} Message
|
{str} Message
|
||||||
@@ -314,7 +368,7 @@ nvim_set_current_buf({buffer}) *nvim_set_current_buf()*
|
|||||||
Sets the current buffer
|
Sets the current buffer
|
||||||
|
|
||||||
Parameters:~
|
Parameters:~
|
||||||
{id} Buffer handle
|
{buffer} Buffer handle
|
||||||
|
|
||||||
nvim_list_wins() *nvim_list_wins()*
|
nvim_list_wins() *nvim_list_wins()*
|
||||||
Gets the current list of window handles
|
Gets the current list of window handles
|
||||||
@@ -332,7 +386,7 @@ nvim_set_current_win({window}) *nvim_set_current_win()*
|
|||||||
Sets the current window
|
Sets the current window
|
||||||
|
|
||||||
Parameters:~
|
Parameters:~
|
||||||
{handle} Window handle
|
{window} Window handle
|
||||||
|
|
||||||
nvim_list_tabpages() *nvim_list_tabpages()*
|
nvim_list_tabpages() *nvim_list_tabpages()*
|
||||||
Gets the current list of tabpage handles
|
Gets the current list of tabpage handles
|
||||||
@@ -350,7 +404,7 @@ nvim_set_current_tabpage({tabpage}) *nvim_set_current_tabpage()*
|
|||||||
Sets the current tabpage
|
Sets the current tabpage
|
||||||
|
|
||||||
Parameters:~
|
Parameters:~
|
||||||
{handle} Tabpage handle
|
{tabpage} Tabpage handle
|
||||||
|
|
||||||
nvim_subscribe({event}) *nvim_subscribe()*
|
nvim_subscribe({event}) *nvim_subscribe()*
|
||||||
Subscribes to event broadcasts
|
Subscribes to event broadcasts
|
||||||
@@ -371,15 +425,25 @@ nvim_get_color_map() *nvim_get_color_map()*
|
|||||||
TODO: Documentation
|
TODO: Documentation
|
||||||
|
|
||||||
nvim_get_mode() *nvim_get_mode()*
|
nvim_get_mode() *nvim_get_mode()*
|
||||||
Gets the current mode.
|
Gets the current mode. |mode()| "blocking" is true if Nvim is
|
||||||
mode: Mode string. |mode()|
|
waiting for input.
|
||||||
blocking: true if Nvim is waiting for input.
|
|
||||||
|
Return:~
|
||||||
|
Dictionary { "mode": String, "blocking": Boolean }
|
||||||
|
|
||||||
Attributes:~
|
Attributes:~
|
||||||
{async}
|
{async}
|
||||||
|
|
||||||
|
nvim_get_keymap({mode}) *nvim_get_keymap()*
|
||||||
|
Gets a list of dictionaries describing global (non-buffer)
|
||||||
|
mappings. The "buffer" key in the returned dictionary is
|
||||||
|
always zero.
|
||||||
|
|
||||||
|
Parameters:~
|
||||||
|
{mode} Mode short-name ("n", "i", "v", ...)
|
||||||
|
|
||||||
Return:~
|
Return:~
|
||||||
Dictionary { "mode": String, "blocking": Boolean }
|
Array of maparg()-like dictionaries describing mappings
|
||||||
|
|
||||||
nvim_get_api_info() *nvim_get_api_info()*
|
nvim_get_api_info() *nvim_get_api_info()*
|
||||||
TODO: Documentation
|
TODO: Documentation
|
||||||
@@ -413,6 +477,54 @@ nvim_call_atomic({calls}) *nvim_call_atomic()*
|
|||||||
error ocurred, the values from all preceding calls will
|
error ocurred, the values from all preceding calls will
|
||||||
still be returned.
|
still be returned.
|
||||||
|
|
||||||
|
nvim__id({obj}) *nvim__id()*
|
||||||
|
Returns object given as argument
|
||||||
|
|
||||||
|
This API function is used for testing. One should not rely on
|
||||||
|
its presence in plugins.
|
||||||
|
|
||||||
|
Parameters:~
|
||||||
|
{obj} Object to return.
|
||||||
|
|
||||||
|
Return:~
|
||||||
|
its argument.
|
||||||
|
|
||||||
|
nvim__id_array({arr}) *nvim__id_array()*
|
||||||
|
Returns array given as argument
|
||||||
|
|
||||||
|
This API function is used for testing. One should not rely on
|
||||||
|
its presence in plugins.
|
||||||
|
|
||||||
|
Parameters:~
|
||||||
|
{arr} Array to return.
|
||||||
|
|
||||||
|
Return:~
|
||||||
|
its argument.
|
||||||
|
|
||||||
|
nvim__id_dictionary({dct}) *nvim__id_dictionary()*
|
||||||
|
Returns dictionary given as argument
|
||||||
|
|
||||||
|
This API function is used for testing. One should not rely on
|
||||||
|
its presence in plugins.
|
||||||
|
|
||||||
|
Parameters:~
|
||||||
|
{dct} Dictionary to return.
|
||||||
|
|
||||||
|
Return:~
|
||||||
|
its argument.
|
||||||
|
|
||||||
|
nvim__id_float({flt}) *nvim__id_float()*
|
||||||
|
Returns floating-point value given as argument
|
||||||
|
|
||||||
|
This API function is used for testing. One should not rely on
|
||||||
|
its presence in plugins.
|
||||||
|
|
||||||
|
Parameters:~
|
||||||
|
{flt} Value to return.
|
||||||
|
|
||||||
|
Return:~
|
||||||
|
its argument.
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Buffer Functions *api-buffer*
|
Buffer Functions *api-buffer*
|
||||||
@@ -491,6 +603,18 @@ nvim_buf_get_changedtick({buffer}) *nvim_buf_get_changedtick()*
|
|||||||
Return:~
|
Return:~
|
||||||
b:changedtickvalue.
|
b:changedtickvalue.
|
||||||
|
|
||||||
|
nvim_buf_get_keymap({buffer}, {mode}) *nvim_buf_get_keymap()*
|
||||||
|
Gets a list of dictionaries describing buffer-local mappings.
|
||||||
|
The "buffer" key in the returned dictionary reflects the
|
||||||
|
buffer handle where the mapping is present.
|
||||||
|
|
||||||
|
Parameters:~
|
||||||
|
{mode} Mode short-name ("n", "i", "v", ...)
|
||||||
|
{buffer} Buffer handle
|
||||||
|
|
||||||
|
Return:~
|
||||||
|
Array of maparg()-like dictionaries describing mappings
|
||||||
|
|
||||||
nvim_buf_set_var({buffer}, {name}, {value}) *nvim_buf_set_var()*
|
nvim_buf_set_var({buffer}, {name}, {value}) *nvim_buf_set_var()*
|
||||||
Sets a buffer-scoped (b:) variable
|
Sets a buffer-scoped (b:) variable
|
||||||
|
|
||||||
@@ -566,24 +690,24 @@ nvim_buf_add_highlight({buffer}, {src_id}, {hl_group}, {line},
|
|||||||
{col_start}, {col_end})
|
{col_start}, {col_end})
|
||||||
Adds a highlight to buffer.
|
Adds a highlight to buffer.
|
||||||
|
|
||||||
This can be used for plugins which dynamically generate
|
Useful for plugins that dynamically generate highlights to a
|
||||||
highlights to a buffer (like a semantic highlighter or
|
buffer (like a semantic highlighter or linter). The function
|
||||||
linter). The function adds a single highlight to a buffer.
|
adds a single highlight to a buffer. Unlike matchaddpos()
|
||||||
Unlike matchaddpos() highlights follow changes to line
|
highlights follow changes to line numbering (as lines are
|
||||||
numbering (as lines are inserted/removed above the highlighted
|
inserted/removed above the highlighted line), like signs and
|
||||||
line), like signs and marks do.
|
marks do.
|
||||||
|
|
||||||
"src_id" is useful for batch deletion/updating of a set of
|
`src_id` is useful for batch deletion/updating of a set of
|
||||||
highlights. When called with src_id = 0, an unique source id
|
highlights. When called with `src_id = 0`, an unique source id
|
||||||
is generated and returned. Succesive calls can pass in it as
|
is generated and returned. Successive calls can pass that
|
||||||
"src_id" to add new highlights to the same source group. All
|
`src_id` to associate new highlights with the same source
|
||||||
highlights in the same group can then be cleared with
|
group. All highlights in the same group can be cleared with
|
||||||
nvim_buf_clear_highlight. If the highlight never will be
|
`nvim_buf_clear_highlight`. If the highlight never will be
|
||||||
manually deleted pass in -1 for "src_id".
|
manually deleted, pass `src_id = -1`.
|
||||||
|
|
||||||
If "hl_group" is the empty string no highlight is added, but a
|
If `hl_group` is the empty string no highlight is added, but a
|
||||||
new src_id is still returned. This is useful for an external
|
new `src_id` is still returned. This is useful for an external
|
||||||
plugin to synchrounously request an unique src_id at
|
plugin to synchrounously request an unique `src_id` at
|
||||||
initialization, and later asynchronously add and clear
|
initialization, and later asynchronously add and clear
|
||||||
highlights in response to buffer changes.
|
highlights in response to buffer changes.
|
||||||
|
|
||||||
@@ -592,7 +716,7 @@ nvim_buf_add_highlight({buffer}, {src_id}, {hl_group}, {line},
|
|||||||
{src_id} Source group to use or 0 to use a new group,
|
{src_id} Source group to use or 0 to use a new group,
|
||||||
or -1 for ungrouped highlight
|
or -1 for ungrouped highlight
|
||||||
{hl_group} Name of the highlight group to use
|
{hl_group} Name of the highlight group to use
|
||||||
{line} Line to highlight
|
{line} Line to highlight (zero-indexed)
|
||||||
{col_start} Start of range of columns to highlight
|
{col_start} Start of range of columns to highlight
|
||||||
{col_end} End of range of columns to highlight, or -1
|
{col_end} End of range of columns to highlight, or -1
|
||||||
to highlight to end of line
|
to highlight to end of line
|
||||||
|
@@ -36,7 +36,7 @@ the user interface remains the standard Vi interface.
|
|||||||
|
|
||||||
Highlights
|
Highlights
|
||||||
----------
|
----------
|
||||||
o Editing left-to-right files as in the original VIM hasn't changed.
|
o Editing left-to-right files as in the original Vim hasn't changed.
|
||||||
|
|
||||||
o Viewing and editing files in right-to-left windows. File
|
o Viewing and editing files in right-to-left windows. File
|
||||||
orientation is per window, so it is possible to view the same
|
orientation is per window, so it is possible to view the same
|
||||||
@@ -46,7 +46,7 @@ o No special terminal with right-to-left capabilities is required.
|
|||||||
The right-to-left changes are completely hardware independent.
|
The right-to-left changes are completely hardware independent.
|
||||||
Only Arabic fonts are necessary.
|
Only Arabic fonts are necessary.
|
||||||
|
|
||||||
o Compatible with the original VIM. Almost all features work in
|
o Compatible with the original Vim. Almost all features work in
|
||||||
right-to-left mode (there are liable to be bugs).
|
right-to-left mode (there are liable to be bugs).
|
||||||
|
|
||||||
o Changing keyboard mapping and reverse insert modes using a single
|
o Changing keyboard mapping and reverse insert modes using a single
|
||||||
@@ -60,14 +60,14 @@ o While in Arabic mode, numbers are entered from left to right. Upon
|
|||||||
|
|
||||||
o Arabic keymapping on the command line in reverse insert mode.
|
o Arabic keymapping on the command line in reverse insert mode.
|
||||||
|
|
||||||
o Proper Bidirectional functionality is possible given VIM is
|
o Proper Bidirectional functionality is possible given Vim is
|
||||||
started within a Bidi capable terminal emulator.
|
started within a Bidi capable terminal emulator.
|
||||||
|
|
||||||
|
|
||||||
Arabic Fonts *arabicfonts*
|
Arabic Fonts *arabicfonts*
|
||||||
------------
|
------------
|
||||||
|
|
||||||
VIM requires monospaced fonts of which there are many out there.
|
Vim requires monospaced fonts of which there are many out there.
|
||||||
Arabic requires ISO-8859-6 as well as Presentation Form-B fonts
|
Arabic requires ISO-8859-6 as well as Presentation Form-B fonts
|
||||||
(without Form-B, Arabic will _NOT_ be usable). It is highly
|
(without Form-B, Arabic will _NOT_ be usable). It is highly
|
||||||
recommended that users search for so-called 'ISO-10646-1' fonts.
|
recommended that users search for so-called 'ISO-10646-1' fonts.
|
||||||
@@ -90,13 +90,13 @@ o Installation of fonts for X Window systems (Unix/Linux)
|
|||||||
|
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
Prior to the actual usage of Arabic within VIM, a number of settings
|
Prior to the actual usage of Arabic within Vim, a number of settings
|
||||||
need to be accounted for and invoked.
|
need to be accounted for and invoked.
|
||||||
|
|
||||||
o Setting the Arabic fonts
|
o Setting the Arabic fonts
|
||||||
|
|
||||||
+ For VIM GUI set the 'guifont' to your_ARABIC_FONT. This is done
|
+ For Vim GUI set the 'guifont' to your_ARABIC_FONT. This is done
|
||||||
by entering the following command in the VIM window.
|
by entering the following command in the Vim window.
|
||||||
>
|
>
|
||||||
:set guifont=your_ARABIC_FONT
|
:set guifont=your_ARABIC_FONT
|
||||||
<
|
<
|
||||||
@@ -109,7 +109,7 @@ o Setting the Arabic fonts
|
|||||||
you can include ':set guifont=your_ARABIC_FONT' to your vimrc
|
you can include ':set guifont=your_ARABIC_FONT' to your vimrc
|
||||||
file.
|
file.
|
||||||
|
|
||||||
+ Under the X Window environment, you can also start VIM with
|
+ Under the X Window environment, you can also start Vim with
|
||||||
'-fn your_ARABIC_FONT' option.
|
'-fn your_ARABIC_FONT' option.
|
||||||
|
|
||||||
o Setting the appropriate character Encoding
|
o Setting the appropriate character Encoding
|
||||||
@@ -131,11 +131,11 @@ o Setting the appropriate character Encoding
|
|||||||
o Enable Arabic settings [short-cut]
|
o Enable Arabic settings [short-cut]
|
||||||
|
|
||||||
In order to simplify and streamline things, you can either invoke
|
In order to simplify and streamline things, you can either invoke
|
||||||
VIM with the command-line option,
|
Vim with the command-line option,
|
||||||
|
|
||||||
% vim -A my_utf8_arabic_file ...
|
% vim -A my_utf8_arabic_file ...
|
||||||
|
|
||||||
or enable 'arabic' via the following command within VIM
|
or enable 'arabic' via the following command within Vim
|
||||||
>
|
>
|
||||||
:set arabic
|
:set arabic
|
||||||
<
|
<
|
||||||
@@ -196,7 +196,7 @@ o Enable Arabic settings [short-cut]
|
|||||||
|
|
||||||
+ Arabic deletion of a combined pair character
|
+ Arabic deletion of a combined pair character
|
||||||
|
|
||||||
By default VIM has the 'delcombine' option disabled. This option
|
By default Vim has the 'delcombine' option disabled. This option
|
||||||
allows the deletion of ALEF in a LAM_ALEF (LAA) combined character
|
allows the deletion of ALEF in a LAM_ALEF (LAA) combined character
|
||||||
and still retain the LAM (i.e. it reverts to treating the combined
|
and still retain the LAM (i.e. it reverts to treating the combined
|
||||||
character as its natural two characters form -- this also pertains
|
character as its natural two characters form -- this also pertains
|
||||||
@@ -255,7 +255,7 @@ o Enable Arabic settings [short-cut]
|
|||||||
Keymap/Keyboard *arabickeymap*
|
Keymap/Keyboard *arabickeymap*
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
The character/letter encoding used in VIM is the standard UTF-8.
|
The character/letter encoding used in Vim is the standard UTF-8.
|
||||||
It is widely discouraged that any other encoding be used or even
|
It is widely discouraged that any other encoding be used or even
|
||||||
attempted.
|
attempted.
|
||||||
|
|
||||||
@@ -288,7 +288,7 @@ o Keyboard
|
|||||||
Restrictions
|
Restrictions
|
||||||
------------
|
------------
|
||||||
|
|
||||||
o VIM in its GUI form does not currently support Bi-directionality
|
o Vim in its GUI form does not currently support Bi-directionality
|
||||||
(i.e. the ability to see both Arabic and Latin intermixed within
|
(i.e. the ability to see both Arabic and Latin intermixed within
|
||||||
the same line).
|
the same line).
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@ Automatic commands *autocommand*
|
|||||||
|
|
||||||
For a basic explanation, see section |40.3| in the user manual.
|
For a basic explanation, see section |40.3| in the user manual.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Introduction *autocmd-intro*
|
1. Introduction *autocmd-intro*
|
||||||
@@ -55,7 +55,14 @@ Note: The ":autocmd" command can only be followed by another command when the
|
|||||||
'|' appears before {cmd}. This works: >
|
'|' appears before {cmd}. This works: >
|
||||||
:augroup mine | au! BufRead | augroup END
|
:augroup mine | au! BufRead | augroup END
|
||||||
But this sees "augroup" as part of the defined command: >
|
But this sees "augroup" as part of the defined command: >
|
||||||
|
:augroup mine | au! BufRead * | augroup END
|
||||||
:augroup mine | au BufRead * set tw=70 | augroup END
|
:augroup mine | au BufRead * set tw=70 | augroup END
|
||||||
|
Instead you can put the group name into the command: >
|
||||||
|
:au! mine BufRead *
|
||||||
|
:au mine BufRead * set tw=70
|
||||||
|
Or use `:execute`: >
|
||||||
|
:augroup mine | exe "au! BufRead *" | augroup END
|
||||||
|
:augroup mine | exe "au BufRead * set tw=70" | augroup END
|
||||||
|
|
||||||
Note that special characters (e.g., "%", "<cword>") in the ":autocmd"
|
Note that special characters (e.g., "%", "<cword>") in the ":autocmd"
|
||||||
arguments are not expanded when the autocommand is defined. These will be
|
arguments are not expanded when the autocommand is defined. These will be
|
||||||
@@ -605,7 +612,7 @@ FileChangedShell When Vim notices that the modification time of
|
|||||||
|timestamp|
|
|timestamp|
|
||||||
Mostly triggered after executing a shell
|
Mostly triggered after executing a shell
|
||||||
command, but also with a |:checktime| command
|
command, but also with a |:checktime| command
|
||||||
or when Gvim regains input focus.
|
or when gvim regains input focus.
|
||||||
This autocommand is triggered for each changed
|
This autocommand is triggered for each changed
|
||||||
file. It is not used when 'autoread' is set
|
file. It is not used when 'autoread' is set
|
||||||
and the buffer was not changed. If a
|
and the buffer was not changed. If a
|
||||||
@@ -616,7 +623,7 @@ FileChangedShell When Vim notices that the modification time of
|
|||||||
to tell Vim what to do next.
|
to tell Vim what to do next.
|
||||||
NOTE: When this autocommand is executed, the
|
NOTE: When this autocommand is executed, the
|
||||||
current buffer "%" may be different from the
|
current buffer "%" may be different from the
|
||||||
buffer that was changed "<afile>".
|
buffer that was changed, which is in "<afile>".
|
||||||
NOTE: The commands must not change the current
|
NOTE: The commands must not change the current
|
||||||
buffer, jump to another buffer or delete a
|
buffer, jump to another buffer or delete a
|
||||||
buffer. *E246* *E811*
|
buffer. *E246* *E811*
|
||||||
@@ -643,7 +650,8 @@ FileType When the 'filetype' option has been set. The
|
|||||||
pattern is matched against the filetype.
|
pattern is matched against the filetype.
|
||||||
<afile> can be used for the name of the file
|
<afile> can be used for the name of the file
|
||||||
where this option was set, and <amatch> for
|
where this option was set, and <amatch> for
|
||||||
the new value of 'filetype'.
|
the new value of 'filetype'. Navigating to
|
||||||
|
another window or buffer is not allowed.
|
||||||
See |filetypes|.
|
See |filetypes|.
|
||||||
*FileWriteCmd*
|
*FileWriteCmd*
|
||||||
FileWriteCmd Before writing to a file, when not writing the
|
FileWriteCmd Before writing to a file, when not writing the
|
||||||
@@ -920,7 +928,7 @@ TermClose When a terminal buffer ends.
|
|||||||
{Nvim} *TermOpen*
|
{Nvim} *TermOpen*
|
||||||
TermOpen When a terminal buffer is starting. This can
|
TermOpen When a terminal buffer is starting. This can
|
||||||
be used to configure the terminal emulator by
|
be used to configure the terminal emulator by
|
||||||
setting buffer variables. |terminal-emulator|
|
setting buffer variables. |terminal|
|
||||||
*TermResponse*
|
*TermResponse*
|
||||||
TermResponse After the response to |t_RV| is received from
|
TermResponse After the response to |t_RV| is received from
|
||||||
the terminal. The value of |v:termresponse|
|
the terminal. The value of |v:termresponse|
|
||||||
@@ -967,9 +975,9 @@ VimEnter After doing all the startup stuff, including
|
|||||||
VimLeave Before exiting Vim, just after writing the
|
VimLeave Before exiting Vim, just after writing the
|
||||||
.shada file. Executed only once, like
|
.shada file. Executed only once, like
|
||||||
VimLeavePre.
|
VimLeavePre.
|
||||||
To detect an abnormal exit use |v:dying|.
|
< Use |v:dying| to detect an abnormal exit.
|
||||||
When v:dying is 2 or more this event is not
|
Use |v:exiting| to get the exit code.
|
||||||
triggered.
|
Not triggered if |v:dying| is 2 or more.
|
||||||
*VimLeavePre*
|
*VimLeavePre*
|
||||||
VimLeavePre Before exiting Vim, just before writing the
|
VimLeavePre Before exiting Vim, just before writing the
|
||||||
.shada file. This is executed only once,
|
.shada file. This is executed only once,
|
||||||
@@ -977,9 +985,9 @@ VimLeavePre Before exiting Vim, just before writing the
|
|||||||
happens to be the current buffer when exiting.
|
happens to be the current buffer when exiting.
|
||||||
Mostly useful with a "*" pattern. >
|
Mostly useful with a "*" pattern. >
|
||||||
:autocmd VimLeavePre * call CleanupStuff()
|
:autocmd VimLeavePre * call CleanupStuff()
|
||||||
< To detect an abnormal exit use |v:dying|.
|
< Use |v:dying| to detect an abnormal exit.
|
||||||
When v:dying is 2 or more this event is not
|
Use |v:exiting| to get the exit code.
|
||||||
triggered.
|
Not triggered if |v:dying| is 2 or more.
|
||||||
*VimResized*
|
*VimResized*
|
||||||
VimResized After the Vim window was resized, thus 'lines'
|
VimResized After the Vim window was resized, thus 'lines'
|
||||||
and/or 'columns' changed. Not when starting
|
and/or 'columns' changed. Not when starting
|
||||||
|
@@ -11,7 +11,7 @@ commands with the "." command.
|
|||||||
|
|
||||||
For inserting text see |insert.txt|.
|
For inserting text see |insert.txt|.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Deleting text *deleting* *E470*
|
1. Deleting text *deleting* *E470*
|
||||||
@@ -648,6 +648,7 @@ g& Synonym for `:%s//~/&` (repeat last substitute with
|
|||||||
*:s_flags*
|
*:s_flags*
|
||||||
The flags that you can use for the substitute commands:
|
The flags that you can use for the substitute commands:
|
||||||
|
|
||||||
|
*:&&*
|
||||||
[&] Must be the first one: Keep the flags from the previous substitute
|
[&] Must be the first one: Keep the flags from the previous substitute
|
||||||
command. Examples: >
|
command. Examples: >
|
||||||
:&&
|
:&&
|
||||||
@@ -861,8 +862,7 @@ Exceptions:
|
|||||||
Substitute with an expression *sub-replace-expression*
|
Substitute with an expression *sub-replace-expression*
|
||||||
*sub-replace-\=* *s/\=*
|
*sub-replace-\=* *s/\=*
|
||||||
When the substitute string starts with "\=" the remainder is interpreted as an
|
When the substitute string starts with "\=" the remainder is interpreted as an
|
||||||
expression. This does not work recursively: a |substitute()| function inside
|
expression.
|
||||||
the expression cannot use "\=" for the substitute string.
|
|
||||||
|
|
||||||
The special meaning for characters as mentioned at |sub-replace-special| does
|
The special meaning for characters as mentioned at |sub-replace-special| does
|
||||||
not apply except for "<CR>". A <NL> character is used as a line break, you
|
not apply except for "<CR>". A <NL> character is used as a line break, you
|
||||||
|
@@ -13,7 +13,7 @@ Command-line mode is used to enter Ex commands (":"), search patterns
|
|||||||
Basic command line editing is explained in chapter 20 of the user manual
|
Basic command line editing is explained in chapter 20 of the user manual
|
||||||
|usr_20.txt|.
|
|usr_20.txt|.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Command-line editing *cmdline-editing*
|
1. Command-line editing *cmdline-editing*
|
||||||
@@ -327,8 +327,11 @@ terminals)
|
|||||||
List entries 6 to 12 from the search history: >
|
List entries 6 to 12 from the search history: >
|
||||||
:history / 6,12
|
:history / 6,12
|
||||||
<
|
<
|
||||||
List the recent five entries from all histories: >
|
List the penultimate entry from all histories: >
|
||||||
:history all -5,
|
:history all -2
|
||||||
|
<
|
||||||
|
List the most recent two entries from all histories: >
|
||||||
|
:history all -2,
|
||||||
|
|
||||||
:keepp[atterns] {command} *:keepp* *:keeppatterns*
|
:keepp[atterns] {command} *:keepp* *:keeppatterns*
|
||||||
Execute {command}, without adding anything to the search
|
Execute {command}, without adding anything to the search
|
||||||
@@ -358,7 +361,7 @@ These are the commands that can be used:
|
|||||||
*c_CTRL-D*
|
*c_CTRL-D*
|
||||||
CTRL-D List names that match the pattern in front of the cursor.
|
CTRL-D List names that match the pattern in front of the cursor.
|
||||||
When showing file names, directories are highlighted (see
|
When showing file names, directories are highlighted (see
|
||||||
'highlight' option). Names where 'suffixes' matches are moved
|
|highlight-groups|). Names where 'suffixes' matches are moved
|
||||||
to the end.
|
to the end.
|
||||||
The 'wildoptions' option can be set to "tagfile" to list the
|
The 'wildoptions' option can be set to "tagfile" to list the
|
||||||
file of matching tags.
|
file of matching tags.
|
||||||
@@ -389,12 +392,26 @@ CTRL-L A match is done on the pattern in front of the cursor. If
|
|||||||
If there are multiple matches the longest common part is
|
If there are multiple matches the longest common part is
|
||||||
inserted in place of the pattern. If the result is shorter
|
inserted in place of the pattern. If the result is shorter
|
||||||
than the pattern, no completion is done.
|
than the pattern, no completion is done.
|
||||||
|
*/_CTRL-L*
|
||||||
When 'incsearch' is set, entering a search pattern for "/" or
|
When 'incsearch' is set, entering a search pattern for "/" or
|
||||||
"?" and the current match is displayed then CTRL-L will add
|
"?" and the current match is displayed then CTRL-L will add
|
||||||
one character from the end of the current match. If
|
one character from the end of the current match. If
|
||||||
'ignorecase' and 'smartcase' are set and the command line has
|
'ignorecase' and 'smartcase' are set and the command line has
|
||||||
no uppercase characters, the added character is converted to
|
no uppercase characters, the added character is converted to
|
||||||
lowercase.
|
lowercase.
|
||||||
|
*c_CTRL-G* */_CTRL-G*
|
||||||
|
CTRL-G When 'incsearch' is set, entering a search pattern for "/" or
|
||||||
|
"?" and the current match is displayed then CTRL-G will move
|
||||||
|
to the next match (does not take |search-offset| into account)
|
||||||
|
Use CTRL-T to move to the previous match. Hint: on a regular
|
||||||
|
keyboard T is above G.
|
||||||
|
*c_CTRL-T* */_CTRL-T*
|
||||||
|
CTRL-T When 'incsearch' is set, entering a search pattern for "/" or
|
||||||
|
"?" and the current match is displayed then CTRL-T will move
|
||||||
|
to the previous match (does not take |search-offset| into
|
||||||
|
account).
|
||||||
|
Use CTRL-G to move to the next match. Hint: on a regular
|
||||||
|
keyboard T is above G.
|
||||||
|
|
||||||
The 'wildchar' option defaults to <Tab> (CTRL-E when in Vi compatible mode; in
|
The 'wildchar' option defaults to <Tab> (CTRL-E when in Vi compatible mode; in
|
||||||
a previous version <Esc> was used). In the pattern standard wildcards '*' and
|
a previous version <Esc> was used). In the pattern standard wildcards '*' and
|
||||||
@@ -403,6 +420,9 @@ matches exactly one character.
|
|||||||
|
|
||||||
The 'wildignorecase' option can be set to ignore case in filenames.
|
The 'wildignorecase' option can be set to ignore case in filenames.
|
||||||
|
|
||||||
|
The 'wildmenu' option can be set to show the matches just above the command
|
||||||
|
line.
|
||||||
|
|
||||||
If you like tcsh's autolist completion, you can use this mapping:
|
If you like tcsh's autolist completion, you can use this mapping:
|
||||||
:cnoremap X <C-L><C-D>
|
:cnoremap X <C-L><C-D>
|
||||||
(Where X is the command key to use, <C-L> is CTRL-L and <C-D> is CTRL-D)
|
(Where X is the command key to use, <C-L> is CTRL-L and <C-D> is CTRL-D)
|
||||||
@@ -761,6 +781,7 @@ Also see |`=|.
|
|||||||
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
|
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
|
||||||
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
|
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
|
||||||
*:<abuf>* *<abuf>* *:<amatch>* *<amatch>*
|
*:<abuf>* *<abuf>* *:<amatch>* *<amatch>*
|
||||||
|
*:<cexpr>* *<cexpr>*
|
||||||
*<slnum>* *E495* *E496* *E497* *E499* *E500*
|
*<slnum>* *E495* *E496* *E497* *E499* *E500*
|
||||||
Note: these are typed literally, they are not special keys!
|
Note: these are typed literally, they are not special keys!
|
||||||
<cword> is replaced with the word under the cursor (like |star|)
|
<cword> is replaced with the word under the cursor (like |star|)
|
||||||
@@ -768,7 +789,8 @@ Note: these are typed literally, they are not special keys!
|
|||||||
<cfile> is replaced with the path name under the cursor (like what
|
<cfile> is replaced with the path name under the cursor (like what
|
||||||
|gf| uses)
|
|gf| uses)
|
||||||
<afile> When executing autocommands, is replaced with the file name
|
<afile> When executing autocommands, is replaced with the file name
|
||||||
for a file read or write.
|
of the buffer being manipulated, or the file for a read or
|
||||||
|
write.
|
||||||
<abuf> When executing autocommands, is replaced with the currently
|
<abuf> When executing autocommands, is replaced with the currently
|
||||||
effective buffer number (for ":r file" and ":so file" it is
|
effective buffer number (for ":r file" and ":so file" it is
|
||||||
the current buffer, the file being read/sourced is not in a
|
the current buffer, the file being read/sourced is not in a
|
||||||
|
@@ -9,7 +9,7 @@ Debugging Vim *debug-vim*
|
|||||||
This is for debugging Vim itself, when it doesn't work properly.
|
This is for debugging Vim itself, when it doesn't work properly.
|
||||||
For debugging Vim scripts, functions, etc. see |debug-scripts|
|
For debugging Vim scripts, functions, etc. see |debug-scripts|
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
|
@@ -26,9 +26,6 @@ Events ~
|
|||||||
*EncodingChanged* Never fired; 'encoding' is always "utf-8".
|
*EncodingChanged* Never fired; 'encoding' is always "utf-8".
|
||||||
*FileEncoding* Never fired; equivalent to |EncodingChanged|.
|
*FileEncoding* Never fired; equivalent to |EncodingChanged|.
|
||||||
|
|
||||||
Highlight groups ~
|
|
||||||
*hl-VisualNOS* Obsolete. |vim-differences| {Nvim}
|
|
||||||
|
|
||||||
Keycodes ~
|
Keycodes ~
|
||||||
*<MouseDown>* Use <ScrollWheelUp> instead.
|
*<MouseDown>* Use <ScrollWheelUp> instead.
|
||||||
*<MouseUp>* Use <ScrollWheelDown> instead.
|
*<MouseUp>* Use <ScrollWheelDown> instead.
|
||||||
@@ -42,10 +39,17 @@ Functions ~
|
|||||||
*highlightID()* Obsolete name for |hlID()|.
|
*highlightID()* Obsolete name for |hlID()|.
|
||||||
*last_buffer_nr()* Obsolete name for bufnr("$").
|
*last_buffer_nr()* Obsolete name for bufnr("$").
|
||||||
|
|
||||||
|
Modifiers ~
|
||||||
|
*:menu-<special>*
|
||||||
|
*:menu-special* <> notation is always enabled. |cpo-<|
|
||||||
|
*:map-<special>*
|
||||||
|
*:map-special* <> notation is always enabled. |cpo-<|
|
||||||
|
|
||||||
Options ~
|
Options ~
|
||||||
*'fe'* 'fenc'+'enc' before Vim 6.0; no longer used.
|
*'fe'* 'fenc'+'enc' before Vim 6.0; no longer used.
|
||||||
|
*'highlight'* *'hl'* Names of builtin |highlight-groups| cannot be changed.
|
||||||
*'langnoremap'* Deprecated alias to 'nolangremap'.
|
*'langnoremap'* Deprecated alias to 'nolangremap'.
|
||||||
*'vi'*
|
*'vi'*
|
||||||
*'viminfo'* Deprecated alias to 'shada' option.
|
*'viminfo'* Deprecated alias to 'shada' option.
|
||||||
|
|
||||||
vim:tw=78:ts=8:ft=help:norl:
|
vim:noet:tw=78:ts=8:ft=help:norl:
|
||||||
|
@@ -11,7 +11,7 @@ Nvim is open source software. Everybody is encouraged to contribute.
|
|||||||
|
|
||||||
See src/nvim/README.md for an overview of the source code.
|
See src/nvim/README.md for an overview of the source code.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Design goals *design-goals*
|
Design goals *design-goals*
|
||||||
@@ -63,12 +63,6 @@ NVIM IS... WELL DOCUMENTED *design-documented*
|
|||||||
- Documentation should be comprehensive and understandable. Use examples.
|
- Documentation should be comprehensive and understandable. Use examples.
|
||||||
- Don't make the text unnecessarily long. Less documentation means that an
|
- Don't make the text unnecessarily long. Less documentation means that an
|
||||||
item is easier to find.
|
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|.
|
|
||||||
- Move deprecated features to |deprecated.txt|.
|
|
||||||
|
|
||||||
|
|
||||||
NVIM IS... HIGH SPEED AND SMALL IN SIZE *design-speed-size*
|
NVIM IS... HIGH SPEED AND SMALL IN SIZE *design-speed-size*
|
||||||
@@ -113,7 +107,7 @@ include the kitchen sink... but it's good for plumbing."
|
|||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Developer guidelines *dev-help*
|
Developer guidelines *dev*
|
||||||
|
|
||||||
|
|
||||||
JARGON *dev-jargon*
|
JARGON *dev-jargon*
|
||||||
@@ -148,6 +142,8 @@ shell The Vim application. This can cover the whole screen (e.g.,
|
|||||||
window View on a buffer. There can be several windows in Vim,
|
window View on a buffer. There can be several windows in Vim,
|
||||||
together with the command line, menubar, toolbar, etc. they
|
together with the command line, menubar, toolbar, etc. they
|
||||||
fit in the shell.
|
fit in the shell.
|
||||||
|
frame Windows are kept in a tree of frames. Each frame contains
|
||||||
|
a column, row, or window ("leaf" frame).
|
||||||
|
|
||||||
PROVIDERS *dev-provider*
|
PROVIDERS *dev-provider*
|
||||||
|
|
||||||
@@ -192,6 +188,18 @@ defined if a valid external Python host is found. That works well with the
|
|||||||
Python host isn't installed then the plugin will "think" it is running in
|
Python host isn't installed then the plugin will "think" it is running in
|
||||||
a Vim compiled without the |+python| feature.
|
a Vim compiled without the |+python| feature.
|
||||||
|
|
||||||
|
DOCUMENTATION *dev-doc*
|
||||||
|
|
||||||
|
- Do not prefix help tags with "nvim-". Use |vim_diff.txt| to document
|
||||||
|
differences from Vim; no other distinction is necessary.
|
||||||
|
- If a Vim feature is removed, delete its help section and move its tag to
|
||||||
|
|vim_diff.txt|.
|
||||||
|
- Move deprecated features to |deprecated.txt|.
|
||||||
|
- Use consistent language.
|
||||||
|
- "terminal" in a help tag always means "the embedded terminal emulator", not
|
||||||
|
"the user host terminal".
|
||||||
|
- Use "tui-" to prefix help tags related to the host terminal, and "TUI"
|
||||||
|
in prose if possible.
|
||||||
|
|
||||||
API *dev-api*
|
API *dev-api*
|
||||||
|
|
||||||
@@ -224,23 +232,47 @@ _not_ a Buffer). The common {action} "list" indicates that it lists all
|
|||||||
bufs (plural) in the global context.
|
bufs (plural) in the global context.
|
||||||
|
|
||||||
|
|
||||||
|
API-CLIENT *dev-api-client*
|
||||||
|
|
||||||
|
Package Naming ~
|
||||||
|
API client packages should NOT be named something ambiguous like "neovim" or
|
||||||
|
"python-client". Use "nvim" as a prefix/suffix to some other identifier
|
||||||
|
following ecosystem conventions.
|
||||||
|
|
||||||
|
For example, Python packages tend to have "py" in the name, so "pynvim" is
|
||||||
|
a good name: it's idiomatic and unambiguous. If the package is named "neovim",
|
||||||
|
it confuses users, and complicates documentation and discussions.
|
||||||
|
|
||||||
|
Examples of API-client package names:
|
||||||
|
GOOD: nvim-racket
|
||||||
|
GOOD: pynvim
|
||||||
|
BAD: python-client
|
||||||
|
BAD: neovim
|
||||||
|
|
||||||
|
Implementation ~
|
||||||
|
Consider using libmpack instead of the msgpack.org C/C++ library. libmpack is
|
||||||
|
small, efficient, and C89-compatible. It can be easily inlined in your
|
||||||
|
C project source, too. https://github.com/libmpack/libmpack/
|
||||||
|
|
||||||
|
|
||||||
EXTERNAL UI *dev-ui*
|
EXTERNAL UI *dev-ui*
|
||||||
|
|
||||||
|
Compatibility ~
|
||||||
External UIs should be aware of the |api-contract|. In particular, future
|
External UIs should be aware of the |api-contract|. In particular, future
|
||||||
versions of Nvim may add optional, new items to existing events. The API is
|
versions of Nvim may add new items to existing events. The API is strongly
|
||||||
strongly backwards-compatible, but clients must not break if new fields are
|
backwards-compatible, but clients must not break if new fields are added to
|
||||||
added to existing events.
|
existing events.
|
||||||
|
|
||||||
External UIs are expected to implement some common features.
|
Common Features ~
|
||||||
|
External UIs are expected to implement these common features:
|
||||||
|
- Cursor style (shape, color) should respond to the 'guicursor' properties
|
||||||
|
delivered with the mode_info_set UI event.
|
||||||
|
- Send the "super" key (Windows key, Apple key) as a |<D-| chord.
|
||||||
|
|
||||||
- Users may want to configure UI-specific options. The UI should publish the
|
Implementation ~
|
||||||
|GUIEnter| autocmd after attaching to Nvim: >
|
|
||||||
doautocmd GUIEnter
|
|
||||||
- Options can be monitored for changes by the |OptionSet| autocmd. E.g. if the
|
- Options can be monitored for changes by the |OptionSet| autocmd. E.g. if the
|
||||||
user sets the 'guifont' option, this autocmd notifies channel 42: >
|
user sets the 'guifont' option, this autocmd notifies channel 42: >
|
||||||
autocmd OptionSet guifont call rpcnotify(42, 'option-changed', 'guifont', &guifont)
|
autocmd OptionSet guifont call rpcnotify(42, 'option-changed', 'guifont', &guifont)
|
||||||
- cursor-shape change: 'guicursor' properties are sent in the mode_info_set UI
|
|
||||||
event.
|
|
||||||
|
|
||||||
|
|
||||||
vim:tw=78:ts=8:ft=help:norl:
|
vim:tw=78:ts=8:ft=help:norl:
|
||||||
|
@@ -10,10 +10,10 @@ eight versions of the same file.
|
|||||||
|
|
||||||
The basics are explained in section |08.7| of the user manual.
|
The basics are explained in section |08.7| of the user manual.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Starting diff mode
|
1. Starting diff mode *start-vimdiff*
|
||||||
|
|
||||||
To start editing in diff mode, run "nvim -d". This starts Nvim as usual, and
|
To start editing in diff mode, run "nvim -d". This starts Nvim as usual, and
|
||||||
additionally sets up for viewing the differences between the arguments. >
|
additionally sets up for viewing the differences between the arguments. >
|
||||||
@@ -214,8 +214,8 @@ The diffs are highlighted with these groups:
|
|||||||
(searching from the end of the line). The
|
(searching from the end of the line). The
|
||||||
text in between is highlighted. This means
|
text in between is highlighted. This means
|
||||||
that parts in the middle that are still the
|
that parts in the middle that are still the
|
||||||
same are highlighted anyway. Only "iwhite" of
|
same are highlighted anyway. The 'diffopt'
|
||||||
'diffopt' is used here.
|
flags "iwhite" and "icase" are used here.
|
||||||
|hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines,
|
|hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines,
|
||||||
because they don't really exist in this
|
because they don't really exist in this
|
||||||
buffer.
|
buffer.
|
||||||
@@ -314,7 +314,7 @@ g:diff_translations to zero: >
|
|||||||
|
|
||||||
let g:diff_translations = 0
|
let g:diff_translations = 0
|
||||||
<
|
<
|
||||||
After setting this variable, Reload the syntax script: >
|
After setting this variable, reload the syntax script: >
|
||||||
|
|
||||||
set syntax=diff
|
set syntax=diff
|
||||||
<
|
<
|
||||||
|
@@ -14,7 +14,7 @@ with CTRL-V (see |i_CTRL-V|).
|
|||||||
There is a brief introduction on digraphs in the user manual: |24.9|
|
There is a brief introduction on digraphs in the user manual: |24.9|
|
||||||
An alternative is using the 'keymap' option.
|
An alternative is using the 'keymap' option.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Defining digraphs *digraphs-define*
|
1. Defining digraphs *digraphs-define*
|
||||||
@@ -922,6 +922,7 @@ char digraph hex dec official name ~
|
|||||||
† /- 2020 8224 DAGGER
|
† /- 2020 8224 DAGGER
|
||||||
‡ /= 2021 8225 DOUBLE DAGGER
|
‡ /= 2021 8225 DOUBLE DAGGER
|
||||||
‥ .. 2025 8229 TWO DOT LEADER
|
‥ .. 2025 8229 TWO DOT LEADER
|
||||||
|
… ,. 2026 8230 HORIZONTAL ELLIPSIS
|
||||||
‰ %0 2030 8240 PER MILLE SIGN
|
‰ %0 2030 8240 PER MILLE SIGN
|
||||||
′ 1' 2032 8242 PRIME
|
′ 1' 2032 8242 PRIME
|
||||||
″ 2' 2033 8243 DOUBLE PRIME
|
″ 2' 2033 8243 DOUBLE PRIME
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Editing files *edit-files*
|
Editing files *edit-files*
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Introduction *edit-intro*
|
1. Introduction *edit-intro*
|
||||||
@@ -236,7 +236,7 @@ If you want to keep the changed buffer without saving it, switch on the
|
|||||||
|
|
||||||
*:vie* *:view*
|
*:vie* *:view*
|
||||||
:vie[w][!] [++opt] [+cmd] file
|
:vie[w][!] [++opt] [+cmd] file
|
||||||
When used in Ex mode: Leave |Ex mode|, go back to
|
When used in Ex mode: Leave |Ex-mode|, go back to
|
||||||
Normal mode. Otherwise same as |:edit|, but set
|
Normal mode. Otherwise same as |:edit|, but set
|
||||||
'readonly' option for this buffer.
|
'readonly' option for this buffer.
|
||||||
|
|
||||||
@@ -901,11 +901,12 @@ WRITING WITH MULTIPLE BUFFERS *buffer-write*
|
|||||||
|
|
||||||
*:wa* *:wall*
|
*:wa* *:wall*
|
||||||
:wa[ll] Write all changed buffers. Buffers without a file
|
:wa[ll] Write all changed buffers. Buffers without a file
|
||||||
name or which are readonly are not written.
|
name cause an error message. Buffers which are
|
||||||
|
readonly are not written.
|
||||||
|
|
||||||
:wa[ll]! Write all changed buffers, even the ones that are
|
:wa[ll]! Write all changed buffers, even the ones that are
|
||||||
readonly. Buffers without a file name are not
|
readonly. Buffers without a file name are not
|
||||||
written.
|
written and cause an error message.
|
||||||
|
|
||||||
|
|
||||||
Vim will warn you if you try to overwrite a file that has been changed
|
Vim will warn you if you try to overwrite a file that has been changed
|
||||||
@@ -1031,6 +1032,7 @@ The names can be in upper- or lowercase.
|
|||||||
window in the current tab page the current tab page is
|
window in the current tab page the current tab page is
|
||||||
closed |tab-page|.
|
closed |tab-page|.
|
||||||
Triggers the |QuitPre| autocommand event.
|
Triggers the |QuitPre| autocommand event.
|
||||||
|
See |CTRL-W_q| for quitting another window.
|
||||||
|
|
||||||
:conf[irm] q[uit] Quit, but give prompt when changes have been made, or
|
:conf[irm] q[uit] Quit, but give prompt when changes have been made, or
|
||||||
the last file in the argument list has not been
|
the last file in the argument list has not been
|
||||||
@@ -1264,14 +1266,14 @@ Commands for changing the working directory can be suffixed with a bang "!"
|
|||||||
*:lc* *:lcd*
|
*:lc* *:lcd*
|
||||||
:lc[d][!] {path} Like |:cd|, but only set the current directory for the
|
:lc[d][!] {path} Like |:cd|, but only set the current directory for the
|
||||||
current window. The current directory for other
|
current window. The current directory for other
|
||||||
windows or any tabs is not changed.
|
windows or tabs is not changed.
|
||||||
|
|
||||||
*:lch* *:lchdir*
|
*:lch* *:lchdir*
|
||||||
:lch[dir][!] Same as |:lcd|.
|
:lch[dir][!] Same as |:lcd|.
|
||||||
|
|
||||||
*:lcd-*
|
*:lcd-*
|
||||||
:lcd[!] - Change to the previous current directory (before the
|
:lcd[!] - Change to the previous current directory (before the
|
||||||
previous ":tcd {path}" command).
|
previous ":lcd {path}" command).
|
||||||
|
|
||||||
*:pw* *:pwd* *E187*
|
*:pw* *:pwd* *E187*
|
||||||
:pw[d] Print the current directory name.
|
:pw[d] Print the current directory name.
|
||||||
@@ -1363,6 +1365,13 @@ If you want to automatically reload a file when it has been changed outside of
|
|||||||
Vim, set the 'autoread' option. This doesn't work at the moment you write the
|
Vim, set the 'autoread' option. This doesn't work at the moment you write the
|
||||||
file though, only when the file wasn't changed inside of Vim.
|
file though, only when the file wasn't changed inside of Vim.
|
||||||
|
|
||||||
|
If you do not want to be asked or automatically reload the file, you can use
|
||||||
|
this: >
|
||||||
|
set buftype=nofile
|
||||||
|
|
||||||
|
Or, when starting gvim from a shell: >
|
||||||
|
gvim file.log -c "set buftype=nofile"
|
||||||
|
|
||||||
Note that if a FileChangedShell autocommand is defined you will not get a
|
Note that if a FileChangedShell autocommand is defined you will not get a
|
||||||
warning message or prompt. The autocommand is expected to handle this.
|
warning message or prompt. The autocommand is expected to handle this.
|
||||||
|
|
||||||
@@ -1533,7 +1542,7 @@ There are three different types of searching:
|
|||||||
This searches the same directories, but in a different order.
|
This searches the same directories, but in a different order.
|
||||||
|
|
||||||
Note that completion for ":find", ":sfind", and ":tabfind" commands do not
|
Note that completion for ":find", ":sfind", and ":tabfind" commands do not
|
||||||
currently work with 'path' items that contain a url or use the double star
|
currently work with 'path' items that contain a URL or use the double star
|
||||||
with depth limiter (/usr/**2) or upward search (;) notations.
|
with depth limiter (/usr/**2) or upward search (;) notations.
|
||||||
|
|
||||||
vim:tw=78:ts=8:ft=help:norl:
|
vim:tw=78:ts=8:ft=help:norl:
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@ Filetypes *filetype* *file-type*
|
|||||||
|
|
||||||
Also see |autocmd.txt|.
|
Also see |autocmd.txt|.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Filetypes *filetypes* *file-types*
|
1. Filetypes *filetypes* *file-types*
|
||||||
@@ -32,7 +32,7 @@ Detail: The ":filetype on" command will load one of these files:
|
|||||||
BufNewFile and BufRead events. If the file type is not found by the
|
BufNewFile and BufRead events. If the file type is not found by the
|
||||||
name, the file $VIMRUNTIME/scripts.vim is used to detect it from the
|
name, the file $VIMRUNTIME/scripts.vim is used to detect it from the
|
||||||
contents of the file.
|
contents of the file.
|
||||||
When the GUI is running or will start soon, the menu.vim script is
|
When the GUI is running or will start soon, the |menu.vim| script is
|
||||||
also sourced. See |'go-M'| about avoiding that.
|
also sourced. See |'go-M'| about avoiding that.
|
||||||
|
|
||||||
To add your own file types, see |new-filetype| below. To search for help on a
|
To add your own file types, see |new-filetype| below. To search for help on a
|
||||||
@@ -309,12 +309,12 @@ define yourself. There are a few ways to avoid this:
|
|||||||
You need to define your own mapping before the plugin is loaded (before
|
You need to define your own mapping before the plugin is loaded (before
|
||||||
editing a file of that type). The plugin will then skip installing the
|
editing a file of that type). The plugin will then skip installing the
|
||||||
default mapping.
|
default mapping.
|
||||||
|
*no_mail_maps*
|
||||||
3. Disable defining mappings for a specific filetype by setting a variable,
|
3. Disable defining mappings for a specific filetype by setting a variable,
|
||||||
which contains the name of the filetype. For the "mail" filetype this
|
which contains the name of the filetype. For the "mail" filetype this
|
||||||
would be: >
|
would be: >
|
||||||
:let no_mail_maps = 1
|
:let no_mail_maps = 1
|
||||||
|
< *no_plugin_maps*
|
||||||
4. Disable defining mappings for all filetypes by setting a variable: >
|
4. Disable defining mappings for all filetypes by setting a variable: >
|
||||||
:let no_plugin_maps = 1
|
:let no_plugin_maps = 1
|
||||||
<
|
<
|
||||||
@@ -540,7 +540,7 @@ K or CTRL-] Jump to the manpage for the <cWORD> under the
|
|||||||
cursor. Takes a count for the section.
|
cursor. Takes a count for the section.
|
||||||
CTRL-T Jump back to the location that the manpage was
|
CTRL-T Jump back to the location that the manpage was
|
||||||
opened from.
|
opened from.
|
||||||
META-] Show the manpage outline in the |location-list|.
|
gO Show the manpage outline. |gO|
|
||||||
q :quit if invoked as $MANPAGER, otherwise :close.
|
q :quit if invoked as $MANPAGER, otherwise :close.
|
||||||
|
|
||||||
Variables:
|
Variables:
|
||||||
@@ -724,6 +724,12 @@ Format description:
|
|||||||
not recognized here as well.
|
not recognized here as well.
|
||||||
|
|
||||||
|
|
||||||
|
RUST *ft-rust*
|
||||||
|
|
||||||
|
Since the text for this plugin is rather long it has been put in a separate
|
||||||
|
file: |ft_rust.txt|.
|
||||||
|
|
||||||
|
|
||||||
SQL *ft-sql*
|
SQL *ft-sql*
|
||||||
|
|
||||||
Since the text for this plugin is rather long it has been put in a separate
|
Since the text for this plugin is rather long it has been put in a separate
|
||||||
|
@@ -9,7 +9,7 @@ Folding *Folding* *folding* *folds*
|
|||||||
You can find an introduction on folding in chapter 28 of the user manual.
|
You can find an introduction on folding in chapter 28 of the user manual.
|
||||||
|usr_28.txt|
|
|usr_28.txt|
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Fold methods *fold-methods*
|
1. Fold methods *fold-methods*
|
||||||
@@ -58,7 +58,7 @@ whichever is lower. These are empty or white lines and lines starting
|
|||||||
with a character in 'foldignore'. White space is skipped before checking for
|
with a character in 'foldignore'. White space is skipped before checking for
|
||||||
characters in 'foldignore'. For C use "#" to ignore preprocessor lines.
|
characters in 'foldignore'. For C use "#" to ignore preprocessor lines.
|
||||||
|
|
||||||
When you want to ignore lines in another way, use the 'expr' method. The
|
When you want to ignore lines in another way, use the "expr" method. The
|
||||||
|indent()| function can be used in 'foldexpr' to get the indent of a line.
|
|indent()| function can be used in 'foldexpr' to get the indent of a line.
|
||||||
|
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ This will call a function to compute the fold level: >
|
|||||||
:set foldexpr=MyFoldLevel(v:lnum)
|
:set foldexpr=MyFoldLevel(v:lnum)
|
||||||
This will make a fold out of paragraphs separated by blank lines: >
|
This will make a fold out of paragraphs separated by blank lines: >
|
||||||
:set foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1
|
:set foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1
|
||||||
this does the same: >
|
This does the same: >
|
||||||
:set foldexpr=getline(v:lnum-1)=~'^\\s*$'&&getline(v:lnum)=~'\\S'?'>1':1
|
:set foldexpr=getline(v:lnum-1)=~'^\\s*$'&&getline(v:lnum)=~'\\S'?'>1':1
|
||||||
|
|
||||||
Note that backslashes must be used to escape characters that ":set" handles
|
Note that backslashes must be used to escape characters that ":set" handles
|
||||||
@@ -133,7 +133,7 @@ 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
|
yet. And it returns the level at the start of the line, while a fold might
|
||||||
end in that line.
|
end in that line.
|
||||||
|
|
||||||
It may happened that folds are not updated properly. You can use |zx| or |zX|
|
It may happen that folds are not updated properly. You can use |zx| or |zX|
|
||||||
to force updating folds.
|
to force updating folds.
|
||||||
|
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ and the level given by the marker:
|
|||||||
1. If a marker with the same fold level is encountered, the previous fold
|
1. If a marker with the same fold level is encountered, the previous fold
|
||||||
ends and another fold with the same level starts.
|
ends and another fold with the same level starts.
|
||||||
2. If a marker with a higher fold level is found, a nested fold is started.
|
2. If a marker with a higher fold level is found, a nested fold is started.
|
||||||
3. if a marker with a lower fold level is found, all folds up to and including
|
3. If a marker with a lower fold level is found, all folds up to and including
|
||||||
this level end and a fold with the specified level starts.
|
this level end and a fold with the specified level starts.
|
||||||
|
|
||||||
The number indicates the fold level. A zero cannot be used (a marker with
|
The number indicates the fold level. A zero cannot be used (a marker with
|
||||||
|
@@ -116,7 +116,7 @@ NOTE: "gnat xref -v" is very tricky to use as it has almost no diagnostic
|
|||||||
then "gnat xref -v *.ad?"
|
then "gnat xref -v *.ad?"
|
||||||
4) Project manager support is completely broken - don't even try "gnat xref
|
4) Project manager support is completely broken - don't even try "gnat xref
|
||||||
-Padacl.gpr".
|
-Padacl.gpr".
|
||||||
5) VIM is faster when the tags file is sorted - use "sort --unique
|
5) Vim is faster when the tags file is sorted - use "sort --unique
|
||||||
--ignore-case --output=tags tags" .
|
--ignore-case --output=tags tags" .
|
||||||
6) Remember to insert "!_TAG_FILE_SORTED 2 %sort ui" as first line to mark
|
6) Remember to insert "!_TAG_FILE_SORTED 2 %sort ui" as first line to mark
|
||||||
the file assorted.
|
the file assorted.
|
||||||
|
237
runtime/doc/ft_rust.txt
Normal file
237
runtime/doc/ft_rust.txt
Normal file
@@ -0,0 +1,237 @@
|
|||||||
|
*ft_rust.txt* Filetype plugin for Rust
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
CONTENTS *rust*
|
||||||
|
|
||||||
|
1. Introduction |rust-intro|
|
||||||
|
2. Settings |rust-settings|
|
||||||
|
3. Commands |rust-commands|
|
||||||
|
4. Mappings |rust-mappings|
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
INTRODUCTION *rust-intro*
|
||||||
|
|
||||||
|
This plugin provides syntax and supporting functionality for the Rust
|
||||||
|
filetype.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
SETTINGS *rust-settings*
|
||||||
|
|
||||||
|
This plugin has a few variables you can define in your vimrc that change the
|
||||||
|
behavior of the plugin.
|
||||||
|
|
||||||
|
*g:rustc_path*
|
||||||
|
g:rustc_path~
|
||||||
|
Set this option to the path to rustc for use in the |:RustRun| and
|
||||||
|
|:RustExpand| commands. If unset, "rustc" will be located in $PATH: >
|
||||||
|
let g:rustc_path = $HOME."/bin/rustc"
|
||||||
|
<
|
||||||
|
|
||||||
|
*g:rustc_makeprg_no_percent*
|
||||||
|
g:rustc_makeprg_no_percent~
|
||||||
|
Set this option to 1 to have 'makeprg' default to "rustc" instead of
|
||||||
|
"rustc %": >
|
||||||
|
let g:rustc_makeprg_no_percent = 1
|
||||||
|
<
|
||||||
|
|
||||||
|
*g:rust_conceal*
|
||||||
|
g:rust_conceal~
|
||||||
|
Set this option to turn on the basic |conceal| support: >
|
||||||
|
let g:rust_conceal = 1
|
||||||
|
<
|
||||||
|
|
||||||
|
*g:rust_conceal_mod_path*
|
||||||
|
g:rust_conceal_mod_path~
|
||||||
|
Set this option to turn on |conceal| for the path connecting token
|
||||||
|
"::": >
|
||||||
|
let g:rust_conceal_mod_path = 1
|
||||||
|
<
|
||||||
|
|
||||||
|
*g:rust_conceal_pub*
|
||||||
|
g:rust_conceal_pub~
|
||||||
|
Set this option to turn on |conceal| for the "pub" token: >
|
||||||
|
let g:rust_conceal_pub = 1
|
||||||
|
<
|
||||||
|
|
||||||
|
*g:rust_recommended_style*
|
||||||
|
g:rust_recommended_style~
|
||||||
|
Set this option to enable vim indentation and textwidth settings to
|
||||||
|
conform to style conventions of the rust standard library (i.e. use 4
|
||||||
|
spaces for indents and sets 'textwidth' to 99). This option is enabled
|
||||||
|
by default. To disable it: >
|
||||||
|
let g:rust_recommended_style = 0
|
||||||
|
<
|
||||||
|
|
||||||
|
*g:rust_fold*
|
||||||
|
g:rust_fold~
|
||||||
|
Set this option to turn on |folding|: >
|
||||||
|
let g:rust_fold = 1
|
||||||
|
<
|
||||||
|
Value Effect ~
|
||||||
|
0 No folding
|
||||||
|
1 Braced blocks are folded. All folds are open by
|
||||||
|
default.
|
||||||
|
2 Braced blocks are folded. 'foldlevel' is left at the
|
||||||
|
global value (all folds are closed by default).
|
||||||
|
|
||||||
|
*g:rust_bang_comment_leader*
|
||||||
|
g:rust_bang_comment_leader~
|
||||||
|
Set this option to 1 to preserve the leader on multi-line doc comments
|
||||||
|
using the /*! syntax: >
|
||||||
|
let g:rust_bang_comment_leader = 1
|
||||||
|
<
|
||||||
|
|
||||||
|
*g:ftplugin_rust_source_path*
|
||||||
|
g:ftplugin_rust_source_path~
|
||||||
|
Set this option to a path that should be prepended to 'path' for Rust
|
||||||
|
source files: >
|
||||||
|
let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
|
||||||
|
<
|
||||||
|
|
||||||
|
*g:rustfmt_command*
|
||||||
|
g:rustfmt_command~
|
||||||
|
Set this option to the name of the 'rustfmt' executable in your $PATH. If
|
||||||
|
not specified it defaults to 'rustfmt' : >
|
||||||
|
let g:rustfmt_command = 'rustfmt'
|
||||||
|
<
|
||||||
|
*g:rustfmt_autosave*
|
||||||
|
g:rustfmt_autosave~
|
||||||
|
Set this option to 1 to run |:RustFmt| automatically when saving a
|
||||||
|
buffer. If not specified it defaults to 0 : >
|
||||||
|
let g:rustfmt_autosave = 0
|
||||||
|
<
|
||||||
|
*g:rustfmt_fail_silently*
|
||||||
|
g:rustfmt_fail_silently~
|
||||||
|
Set this option to 1 to prevent 'rustfmt' from populating the
|
||||||
|
|location-list| with errors. If not specified it defaults to 0: >
|
||||||
|
let g:rustfmt_fail_silently = 0
|
||||||
|
<
|
||||||
|
*g:rustfmt_options*
|
||||||
|
g:rustfmt_options~
|
||||||
|
Set this option to a string of options to pass to 'rustfmt'. The
|
||||||
|
write-mode is already set to 'overwrite'. If not specified it
|
||||||
|
defaults to '' : >
|
||||||
|
let g:rustfmt_options = ''
|
||||||
|
<
|
||||||
|
|
||||||
|
*g:rust_playpen_url*
|
||||||
|
g:rust_playpen_url~
|
||||||
|
Set this option to override the URL for the playpen to use: >
|
||||||
|
let g:rust_playpen_url = 'https://play.rust-lang.org/'
|
||||||
|
<
|
||||||
|
|
||||||
|
*g:rust_shortener_url*
|
||||||
|
g:rust_shortener_url~
|
||||||
|
Set this option to override the URL for the URL shortener: >
|
||||||
|
let g:rust_shortener_url = 'https://is.gd/'
|
||||||
|
<
|
||||||
|
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
COMMANDS *rust-commands*
|
||||||
|
|
||||||
|
:RustRun [args] *:RustRun*
|
||||||
|
:RustRun! [rustc-args] [--] [args]
|
||||||
|
Compiles and runs the current file. If it has unsaved changes,
|
||||||
|
it will be saved first using |:update|. If the current file is
|
||||||
|
an unnamed buffer, it will be written to a temporary file
|
||||||
|
first. The compiled binary is always placed in a temporary
|
||||||
|
directory, but is run from the current directory.
|
||||||
|
|
||||||
|
The arguments given to |:RustRun| will be passed to the
|
||||||
|
compiled binary.
|
||||||
|
|
||||||
|
If ! is specified, the arguments are passed to rustc instead.
|
||||||
|
A "--" argument will separate the rustc arguments from the
|
||||||
|
arguments passed to the binary.
|
||||||
|
|
||||||
|
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||||
|
Otherwise it is assumed rustc can be found in $PATH.
|
||||||
|
|
||||||
|
:RustExpand [args] *:RustExpand*
|
||||||
|
:RustExpand! [TYPE] [args]
|
||||||
|
Expands the current file using --pretty and displays the
|
||||||
|
results in a new split. If the current file has unsaved
|
||||||
|
changes, it will be saved first using |:update|. If the
|
||||||
|
current file is an unnamed buffer, it will be written to a
|
||||||
|
temporary file first.
|
||||||
|
|
||||||
|
The arguments given to |:RustExpand| will be passed to rustc.
|
||||||
|
This is largely intended for specifying various --cfg
|
||||||
|
configurations.
|
||||||
|
|
||||||
|
If ! is specified, the first argument is the expansion type to
|
||||||
|
pass to rustc --pretty. Otherwise it will default to
|
||||||
|
"expanded".
|
||||||
|
|
||||||
|
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||||
|
Otherwise it is assumed rustc can be found in $PATH.
|
||||||
|
|
||||||
|
:RustEmitIr [args] *:RustEmitIr*
|
||||||
|
Compiles the current file to LLVM IR and displays the results
|
||||||
|
in a new split. If the current file has unsaved changes, it
|
||||||
|
will be saved first using |:update|. If the current file is an
|
||||||
|
unnamed buffer, it will be written to a temporary file first.
|
||||||
|
|
||||||
|
The arguments given to |:RustEmitIr| will be passed to rustc.
|
||||||
|
|
||||||
|
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||||
|
Otherwise it is assumed rustc can be found in $PATH.
|
||||||
|
|
||||||
|
:RustEmitAsm [args] *:RustEmitAsm*
|
||||||
|
Compiles the current file to assembly and displays the results
|
||||||
|
in a new split. If the current file has unsaved changes, it
|
||||||
|
will be saved first using |:update|. If the current file is an
|
||||||
|
unnamed buffer, it will be written to a temporary file first.
|
||||||
|
|
||||||
|
The arguments given to |:RustEmitAsm| will be passed to rustc.
|
||||||
|
|
||||||
|
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||||
|
Otherwise it is assumed rustc can be found in $PATH.
|
||||||
|
|
||||||
|
:RustPlay *:RustPlay*
|
||||||
|
This command will only work if you have web-api.vim installed
|
||||||
|
(available at https://github.com/mattn/webapi-vim). It sends the
|
||||||
|
current selection, or if nothing is selected, the entirety of the
|
||||||
|
current buffer to the Rust playpen, and emits a message with the
|
||||||
|
shortened URL to the playpen.
|
||||||
|
|
||||||
|
|g:rust_playpen_url| is the base URL to the playpen, by default
|
||||||
|
"https://play.rust-lang.org/".
|
||||||
|
|
||||||
|
|g:rust_shortener_url| is the base URL for the shortener, by
|
||||||
|
default "https://is.gd/"
|
||||||
|
|
||||||
|
:RustFmt *:RustFmt*
|
||||||
|
Runs |g:rustfmt_command| on the current buffer. If
|
||||||
|
|g:rustfmt_options| is set then those will be passed to the
|
||||||
|
executable.
|
||||||
|
|
||||||
|
If |g:rustfmt_fail_silently| is 0 (the default) then it
|
||||||
|
will populate the |location-list| with the errors from
|
||||||
|
|g:rustfmt_command|. If |g:rustfmt_fail_silently| is set to 1
|
||||||
|
then it will not populate the |location-list|.
|
||||||
|
|
||||||
|
:RustFmtRange *:RustFmtRange*
|
||||||
|
Runs |g:rustfmt_command| with selected range. See
|
||||||
|
|:RustFmt| for any other information.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
MAPPINGS *rust-mappings*
|
||||||
|
|
||||||
|
This plugin defines mappings for |[[| and |]]| to support hanging indents.
|
||||||
|
|
||||||
|
It also has a few other mappings:
|
||||||
|
|
||||||
|
*rust_<D-r>*
|
||||||
|
<D-r> Executes |:RustRun| with no arguments.
|
||||||
|
Note: This binding is only available in MacVim.
|
||||||
|
|
||||||
|
*rust_<D-R>*
|
||||||
|
<D-R> Populates the command line with |:RustRun|! using the
|
||||||
|
arguments given to the last invocation, but does not
|
||||||
|
execute it.
|
||||||
|
Note: This binding is only available in MacVim.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
vim:tw=78:sw=4:noet:ts=8:ft=help:norl:
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Vim's Graphical User Interface *gui* *GUI*
|
Vim's Graphical User Interface *gui* *GUI*
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Starting the GUI *gui-start* *E229* *E233*
|
1. Starting the GUI *gui-start* *E229* *E233*
|
||||||
@@ -46,7 +46,8 @@ When the GUI starts up initializations are carried out, in this order:
|
|||||||
already set.
|
already set.
|
||||||
|
|
||||||
NOTE: All but the first one are not carried out if Vim was started with
|
NOTE: All but the first one are not carried out if Vim was started with
|
||||||
"-u NONE" and no "-U" argument was given, or when started with "-U NONE".
|
"-u NONE" or "-u DEFAULTS" and no "-U" argument was given, or when started
|
||||||
|
with "-U NONE".
|
||||||
|
|
||||||
All this happens AFTER the normal Vim initializations, like reading your
|
All this happens AFTER the normal Vim initializations, like reading your
|
||||||
vimrc file. See |initialization|.
|
vimrc file. See |initialization|.
|
||||||
@@ -382,6 +383,7 @@ menus and menu items. They are most useful for things that you can't remember
|
|||||||
what the key sequence was.
|
what the key sequence was.
|
||||||
|
|
||||||
For creating menus in a different language, see |:menutrans|.
|
For creating menus in a different language, see |:menutrans|.
|
||||||
|
If you don't want to use menus at all, see |'go-M'|.
|
||||||
|
|
||||||
*menu.vim*
|
*menu.vim*
|
||||||
The default menus are read from the file "$VIMRUNTIME/menu.vim". See
|
The default menus are read from the file "$VIMRUNTIME/menu.vim". See
|
||||||
@@ -398,7 +400,11 @@ in the menu (which can take a bit of time to load). If you want to have all
|
|||||||
filetypes already present at startup, add: >
|
filetypes already present at startup, add: >
|
||||||
:let do_syntax_sel_menu = 1
|
:let do_syntax_sel_menu = 1
|
||||||
|
|
||||||
<
|
Note that the menu.vim is sourced when `:syntax on` or `:filetype on` is
|
||||||
|
executed or after your .vimrc file is sourced. This means that the 'encoding'
|
||||||
|
option and the language of messages (`:language messages`) must be set before
|
||||||
|
that (if you want to change them).
|
||||||
|
|
||||||
*console-menus*
|
*console-menus*
|
||||||
Although this documentation is in the GUI section, you can actually use menus
|
Although this documentation is in the GUI section, you can actually use menus
|
||||||
in console mode too. You will have to load |menu.vim| explicitly then, it is
|
in console mode too. You will have to load |menu.vim| explicitly then, it is
|
||||||
@@ -490,9 +496,6 @@ expression register: >
|
|||||||
|
|
||||||
:amenu Insert.foobar "='foobar'<CR>P
|
:amenu Insert.foobar "='foobar'<CR>P
|
||||||
|
|
||||||
Note that the '<' and 'k' flags in 'cpoptions' also apply here (when
|
|
||||||
included they make the <> form and raw key codes not being recognized).
|
|
||||||
|
|
||||||
Note that <Esc> in Cmdline mode executes the command, like in a mapping. This
|
Note that <Esc> in Cmdline mode executes the command, like in a mapping. This
|
||||||
is Vi compatible. Use CTRL-C to quit Cmdline mode.
|
is Vi compatible. Use CTRL-C to quit Cmdline mode.
|
||||||
|
|
||||||
@@ -504,21 +507,13 @@ The ":set ic" will not be echoed when using this menu. Messages from the
|
|||||||
executed command are still given though. To shut them up too, add a ":silent"
|
executed command are still given though. To shut them up too, add a ":silent"
|
||||||
in the executed command: >
|
in the executed command: >
|
||||||
:menu <silent> Search.Header :exe ":silent normal /Header\r"<CR>
|
:menu <silent> Search.Header :exe ":silent normal /Header\r"<CR>
|
||||||
"<silent>" may also appear just after "<special>" or "<script>".
|
"<silent>" may also appear just after "<script>".
|
||||||
|
|
||||||
*:menu-<special>* *:menu-special*
|
|
||||||
Define a menu with <> notation for special keys, even though the "<" flag
|
|
||||||
may appear in 'cpoptions'. This is useful if the side effect of setting
|
|
||||||
'cpoptions' is not desired. Example: >
|
|
||||||
:menu <special> Search.Header /Header<CR>
|
|
||||||
"<special>" must appear as the very first argument to the ":menu" command or
|
|
||||||
just after "<silent>" or "<script>".
|
|
||||||
|
|
||||||
*:menu-<script>* *:menu-script*
|
*:menu-<script>* *:menu-script*
|
||||||
The "to" part of the menu will be inspected for mappings. If you don't want
|
The "to" part of the menu will be inspected for mappings. If you don't want
|
||||||
this, use the ":noremenu" command (or the similar one for a specific mode).
|
this, use the ":noremenu" command (or the similar one for a specific mode).
|
||||||
If you do want to use script-local mappings, add "<script>" as the very first
|
If you do want to use script-local mappings, add "<script>" as the very first
|
||||||
argument to the ":menu" command or just after "<silent>" or "<special>".
|
argument to the ":menu" command or just after "<silent>".
|
||||||
|
|
||||||
*menu-priority*
|
*menu-priority*
|
||||||
You can give a priority to a menu. Menus with a higher priority go more to
|
You can give a priority to a menu. Menus with a higher priority go more to
|
||||||
@@ -659,6 +654,8 @@ nr Name Normal action ~
|
|||||||
In the Win32 GUI, starting a menu name with ']' excludes that menu from the
|
In the Win32 GUI, starting a menu name with ']' excludes that menu from the
|
||||||
main menu bar. You must then use the |:popup| command to display it.
|
main menu bar. You must then use the |:popup| command to display it.
|
||||||
|
|
||||||
|
When splitting the window the window toolbar is not copied to the new window.
|
||||||
|
|
||||||
*popup-menu*
|
*popup-menu*
|
||||||
You can define the special menu "PopUp". This is the menu that is displayed
|
You can define the special menu "PopUp". This is the menu that is displayed
|
||||||
when the right mouse button is pressed, if 'mousemodel' is set to popup or
|
when the right mouse button is pressed, if 'mousemodel' is set to popup or
|
||||||
@@ -854,30 +851,4 @@ This section describes other features which are related to the GUI.
|
|||||||
- In the GUI, several normal keys may have modifiers in mappings etc, these
|
- In the GUI, several normal keys may have modifiers in mappings etc, these
|
||||||
are <Space>, <Tab>, <NL>, <CR>, <Esc>.
|
are <Space>, <Tab>, <NL>, <CR>, <Esc>.
|
||||||
|
|
||||||
- To check in a Vim script if the GUI is being used, you can use something
|
|
||||||
like this: >
|
|
||||||
|
|
||||||
if has("gui_running")
|
|
||||||
echo "yes, we have a GUI"
|
|
||||||
else
|
|
||||||
echo "Boring old console"
|
|
||||||
endif
|
|
||||||
< *setting-guifont*
|
|
||||||
- When you use the same vimrc file on various systems, you can use something
|
|
||||||
like this to set options specifically for each type of GUI: >
|
|
||||||
|
|
||||||
if has("gui_running")
|
|
||||||
if has("gui_gtk2")
|
|
||||||
:set guifont=Luxi\ Mono\ 12
|
|
||||||
elseif has("x11")
|
|
||||||
" Also for GTK 1
|
|
||||||
:set guifont=*-lucidatypewriter-medium-r-normal-*-*-180-*-*-m-*-*
|
|
||||||
elseif has("gui_win32")
|
|
||||||
:set guifont=Luxi_Mono:h12:cANSI
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
A recommended Japanese font is MS Mincho. You can find info here:
|
|
||||||
http://www.lexikan.com/mincho.htm
|
|
||||||
|
|
||||||
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
||||||
|
@@ -30,7 +30,7 @@ Get specific help: It is possible to go directly to whatever you want help
|
|||||||
help entries for "word".
|
help entries for "word".
|
||||||
Or use ":helpgrep word". |:helpgrep|
|
Or use ":helpgrep word". |:helpgrep|
|
||||||
|
|
||||||
VIM stands for Vi IMproved. Most of VIM was made by Bram Moolenaar, but only
|
Vim stands for Vi IMproved. Most of Vim was made by Bram Moolenaar, but only
|
||||||
through the help of many others. See |credits|.
|
through the help of many others. See |credits|.
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*doc-file-list* *Q_ct*
|
*doc-file-list* *Q_ct*
|
||||||
@@ -93,10 +93,9 @@ General subjects ~
|
|||||||
|helphelp.txt| about using the help files
|
|helphelp.txt| about using the help files
|
||||||
|index.txt| alphabetical index of all commands
|
|index.txt| alphabetical index of all commands
|
||||||
|help-tags| all the tags you can jump to (index of tags)
|
|help-tags| all the tags you can jump to (index of tags)
|
||||||
|howto.txt| how to do the most common editing tasks
|
|
||||||
|tips.txt| various tips on using Vim
|
|tips.txt| various tips on using Vim
|
||||||
|message.txt| (error) messages and explanations
|
|message.txt| (error) messages and explanations
|
||||||
|develop.txt| development of Vim
|
|develop.txt| development of Nvim
|
||||||
|debug.txt| debugging Vim itself
|
|debug.txt| debugging Vim itself
|
||||||
|uganda.txt| Vim distribution conditions and what to do with your money
|
|uganda.txt| Vim distribution conditions and what to do with your money
|
||||||
|
|
||||||
@@ -134,7 +133,6 @@ Advanced editing ~
|
|||||||
Special issues ~
|
Special issues ~
|
||||||
|print.txt| printing
|
|print.txt| printing
|
||||||
|remote.txt| using Vim as a server or client
|
|remote.txt| using Vim as a server or client
|
||||||
|term.txt| using different terminals and mice
|
|
||||||
|digraph.txt| list of available digraphs
|
|digraph.txt| list of available digraphs
|
||||||
|mbyte.txt| multi-byte text support
|
|mbyte.txt| multi-byte text support
|
||||||
|mlang.txt| non-English language support
|
|mlang.txt| non-English language support
|
||||||
@@ -143,6 +141,7 @@ Special issues ~
|
|||||||
|hebrew.txt| Hebrew language support and editing
|
|hebrew.txt| Hebrew language support and editing
|
||||||
|russian.txt| Russian language support and editing
|
|russian.txt| Russian language support and editing
|
||||||
|ft_ada.txt| Ada (the programming language) support
|
|ft_ada.txt| Ada (the programming language) support
|
||||||
|
|ft_rust.txt| Filetype plugin for Rust
|
||||||
|ft_sql.txt| about the SQL filetype plugin
|
|ft_sql.txt| about the SQL filetype plugin
|
||||||
|rileft.txt| right-to-left editing mode
|
|rileft.txt| right-to-left editing mode
|
||||||
|
|
||||||
@@ -163,6 +162,7 @@ Standard plugins ~
|
|||||||
|pi_gzip.txt| Reading and writing compressed files
|
|pi_gzip.txt| Reading and writing compressed files
|
||||||
|pi_netrw.txt| Reading and writing files over a network
|
|pi_netrw.txt| Reading and writing files over a network
|
||||||
|pi_paren.txt| Highlight matching parens
|
|pi_paren.txt| Highlight matching parens
|
||||||
|
|pi_spec.txt| Filetype plugin to work with rpm spec files
|
||||||
|pi_tar.txt| Tar file explorer
|
|pi_tar.txt| Tar file explorer
|
||||||
|pi_zip.txt| Zip archive explorer
|
|pi_zip.txt| Zip archive explorer
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Help on help files *helphelp*
|
Help on help files *helphelp*
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Help commands *online-help*
|
1. Help commands *online-help*
|
||||||
@@ -23,7 +23,7 @@ Help on help files *helphelp*
|
|||||||
The 'helplang' option is used to select a language, if
|
The 'helplang' option is used to select a language, if
|
||||||
the main help file is available in several languages.
|
the main help file is available in several languages.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
*{subject}* *E149* *E661*
|
*{subject}* *E149* *E661*
|
||||||
:h[elp] {subject} Like ":help", additionally jump to the tag {subject}.
|
:h[elp] {subject} Like ":help", additionally jump to the tag {subject}.
|
||||||
@@ -140,7 +140,8 @@ Help on help files *helphelp*
|
|||||||
already opened, then the location list for that window
|
already opened, then the location list for that window
|
||||||
is used. Otherwise, a new help window is opened and
|
is used. Otherwise, a new help window is opened and
|
||||||
the location list for that window is set. The
|
the location list for that window is set. The
|
||||||
location list for the current window is not changed.
|
location list for the current window is not changed
|
||||||
|
then.
|
||||||
|
|
||||||
*:exu* *:exusage*
|
*:exu* *:exusage*
|
||||||
:exu[sage] Show help on Ex commands. Added to simulate the Nvi
|
:exu[sage] Show help on Ex commands. Added to simulate the Nvi
|
||||||
@@ -305,7 +306,7 @@ the applicable Vim version. The last field specifies the last modification
|
|||||||
date of the file. Each field is separated by a tab.
|
date of the file. Each field is separated by a tab.
|
||||||
|
|
||||||
At the bottom of the help file, place a Vim modeline to set the 'textwidth'
|
At the bottom of the help file, place a Vim modeline to set the 'textwidth'
|
||||||
and 'tabstop' options and the 'filetype' to 'help'. Never set a global option
|
and 'tabstop' options and the 'filetype' to "help". Never set a global option
|
||||||
in such a modeline, that can have consequences undesired by whoever reads that
|
in such a modeline, that can have consequences undesired by whoever reads that
|
||||||
help.
|
help.
|
||||||
|
|
||||||
|
@@ -1,96 +0,0 @@
|
|||||||
*howto.txt* Nvim
|
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
|
||||||
|
|
||||||
|
|
||||||
How to ... *howdoi* *how-do-i* *howto* *how-to*
|
|
||||||
|
|
||||||
|tutor| get started
|
|
||||||
|:quit| exit? I'm trapped, help me!
|
|
||||||
|initialization| initialize Vim
|
|
||||||
|vimrc-intro| write a Vim script file (vimrc)
|
|
||||||
|suspend| suspend Vim
|
|
||||||
|usr_11.txt| recover after a crash
|
|
||||||
|07.4| keep a backup of my file when writing over it
|
|
||||||
|
|
||||||
|usr_07.txt| edit files
|
|
||||||
|23.4| edit binary files
|
|
||||||
|usr_24.txt| insert text
|
|
||||||
|deleting| delete text
|
|
||||||
|usr_04.txt| change text
|
|
||||||
|04.5| copy and move text
|
|
||||||
|usr_25.txt| format text
|
|
||||||
|30.6| format comments
|
|
||||||
|30.2| indent C programs
|
|
||||||
|25.3| automatically set indent
|
|
||||||
|
|
||||||
|usr_26.txt| repeat commands
|
|
||||||
|02.5| undo and redo
|
|
||||||
|
|
||||||
|usr_03.txt| move around
|
|
||||||
|word-motions| word motions
|
|
||||||
|left-right-motions| left-right motions
|
|
||||||
|up-down-motions| up-down motions
|
|
||||||
|object-motions| text-object motions
|
|
||||||
|various-motions| various motions
|
|
||||||
|object-select| text-object selection
|
|
||||||
|'whichwrap'| move over line breaks
|
|
||||||
|'virtualedit'| move to where there is no text
|
|
||||||
|usr_27.txt| specify pattern for searches
|
|
||||||
|tags-and-searches| do tags and special searches
|
|
||||||
|29.4| search in include'd files used to find
|
|
||||||
variables, functions, or macros
|
|
||||||
|K| look up manual for the keyword under cursor
|
|
||||||
|
|
||||||
|03.7| scroll
|
|
||||||
|'sidescroll'| scroll horizontally/sideways
|
|
||||||
|'scrolloff'| set visible context lines
|
|
||||||
|
|
||||||
|mode-switching| change modes
|
|
||||||
|04.4| use Visual mode
|
|
||||||
|'insertmode'| start Vim in Insert mode
|
|
||||||
|
|
||||||
|40.1| map keys
|
|
||||||
|24.7| create abbreviations
|
|
||||||
|
|
||||||
|ins-expandtab| expand a tab to spaces in Insert mode
|
|
||||||
|i_CTRL-R| insert contents of a register in Insert mode
|
|
||||||
|24.3| complete words in Insert mode
|
|
||||||
|25.1| break a line before it gets too long
|
|
||||||
|
|
||||||
|20.1| do command-line editing
|
|
||||||
|20.3| do command-line completion
|
|
||||||
|'cmdheight'| increase the height of command-line
|
|
||||||
|10.3| specify command-line ranges
|
|
||||||
|40.3| specify commands to be executed automatically
|
|
||||||
before/after reading/writing entering/leaving a
|
|
||||||
buffer/window
|
|
||||||
|
|
||||||
|'autowrite'| write automatically
|
|
||||||
|30.1| speedup edit-compile-edit cycle or compile and fix
|
|
||||||
errors within Vim
|
|
||||||
|
|
||||||
|options| set options
|
|
||||||
|auto-setting| set options automatically
|
|
||||||
|term-dependent-settings| set options depending on terminal name
|
|
||||||
|save-settings| save settings
|
|
||||||
|:quote| comment my .vim files
|
|
||||||
|'helpheight'| change the default help height
|
|
||||||
|'highlight'| set various highlighting modes
|
|
||||||
|'title'| set the window title
|
|
||||||
|'icon'| set window icon title
|
|
||||||
|'report'| avoid seeing the change messages on every line
|
|
||||||
|'shortmess'| avoid |hit-enter| prompts
|
|
||||||
|
|
||||||
|mouse-using| use mouse with Vim
|
|
||||||
|usr_08.txt| manage multiple windows and buffers
|
|
||||||
|gui.txt| use the gui
|
|
||||||
|
|
||||||
|You can't! (yet)| do dishes using Vim
|
|
||||||
|
|
||||||
|usr_06.txt| switch on syntax highlighting
|
|
||||||
|2html.vim| convert a colored file to HTML
|
|
||||||
|less| use Vim like less or more with syntax highlighting
|
|
||||||
|
|
||||||
vim:tw=78:ts=8:ft=help:norl:
|
|
@@ -12,7 +12,7 @@ a cscope query is just like jumping to any tag; it is saved on the tag stack
|
|||||||
so that with the right keyboard mappings, you can jump back and forth between
|
so that with the right keyboard mappings, you can jump back and forth between
|
||||||
functions as you normally would with |tags|.
|
functions as you normally would with |tags|.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Cscope introduction *cscope-intro*
|
1. Cscope introduction *cscope-intro*
|
||||||
@@ -82,9 +82,10 @@ suggested use.)
|
|||||||
2. Cscope related commands *cscope-commands*
|
2. Cscope related commands *cscope-commands*
|
||||||
|
|
||||||
*:cscope* *:cs* *:scs* *:scscope* *E259* *E262* *E561* *E560*
|
*:cscope* *:cs* *:scs* *:scscope* *E259* *E262* *E561* *E560*
|
||||||
All cscope commands are accessed through suboptions to the main cscope
|
All cscope commands are accessed through suboptions to the cscope commands.
|
||||||
command ":cscope". The shortest abbreviation is ":cs". The ":scscope"
|
`:cscope` or `:cs` is the main command
|
||||||
command does the same and also splits the window (short: "scs").
|
`:scscope` or `:scs` does the same and splits the window
|
||||||
|
`:lcscope` or `:lcs` uses the location list, see |:lcscope|
|
||||||
|
|
||||||
The available subcommands are:
|
The available subcommands are:
|
||||||
|
|
||||||
|
361
runtime/doc/if_lua.txt
Normal file
361
runtime/doc/if_lua.txt
Normal file
@@ -0,0 +1,361 @@
|
|||||||
|
*if_lua.txt* Nvim
|
||||||
|
|
||||||
|
|
||||||
|
NVIM REFERENCE MANUAL
|
||||||
|
|
||||||
|
|
||||||
|
Lua Interface to Nvim *lua* *Lua*
|
||||||
|
|
||||||
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
Importing modules *lua-require*
|
||||||
|
|
||||||
|
Nvim automatically adjusts `package.path` and `package.cpath` according to
|
||||||
|
effective 'runtimepath' value. Adjustment happens whenever 'runtimepath' is
|
||||||
|
changed. `package.path` is adjusted by simply appending `/lua/?.lua` and
|
||||||
|
`/lua/?/init.lua` to each directory from 'runtimepath' (`/` is actually the
|
||||||
|
first character of `package.config`).
|
||||||
|
|
||||||
|
Similarly to `package.path`, modified directories from 'runtimepath' are also
|
||||||
|
added to `package.cpath`. In this case, instead of appending `/lua/?.lua` and
|
||||||
|
`/lua/?/init.lua` to each runtimepath, all unique `?`-containing suffixes of
|
||||||
|
the existing `package.cpath` are used. Example:
|
||||||
|
|
||||||
|
1. Given that
|
||||||
|
- 'runtimepath' contains `/foo/bar,/xxx;yyy/baz,/abc`;
|
||||||
|
- initial (defined at compile-time or derived from
|
||||||
|
`$LUA_CPATH`/`$LUA_INIT`) `package.cpath` contains
|
||||||
|
`./?.so;/def/ghi/a?d/j/g.elf;/def/?.so`.
|
||||||
|
2. It finds `?`-containing suffixes `/?.so`, `/a?d/j/g.elf` and `/?.so`, in
|
||||||
|
order: parts of the path starting from the first path component containing
|
||||||
|
question mark and preceding path separator.
|
||||||
|
3. The suffix of `/def/?.so`, namely `/?.so` is not unique, as it’s the same
|
||||||
|
as the suffix of the first path from `package.path` (i.e. `./?.so`). Which
|
||||||
|
leaves `/?.so` and `/a?d/j/g.elf`, in this order.
|
||||||
|
4. 'runtimepath' has three paths: `/foo/bar`, `/xxx;yyy/baz` and `/abc`. The
|
||||||
|
second one contains semicolon which is a paths separator so it is out,
|
||||||
|
leaving only `/foo/bar` and `/abc`, in order.
|
||||||
|
5. The cartesian product of paths from 4. and suffixes from 3. is taken,
|
||||||
|
giving four variants. In each variant `/lua` path segment is inserted
|
||||||
|
between path and suffix, leaving
|
||||||
|
|
||||||
|
- `/foo/bar/lua/?.so`
|
||||||
|
- `/foo/bar/lua/a?d/j/g.elf`
|
||||||
|
- `/abc/lua/?.so`
|
||||||
|
- `/abc/lua/a?d/j/g.elf`
|
||||||
|
|
||||||
|
6. New paths are prepended to the original `package.cpath`.
|
||||||
|
|
||||||
|
The result will look like this:
|
||||||
|
|
||||||
|
`/foo/bar,/xxx;yyy/baz,/abc` ('runtimepath')
|
||||||
|
× `./?.so;/def/ghi/a?d/j/g.elf;/def/?.so` (`package.cpath`)
|
||||||
|
|
||||||
|
= `/foo/bar/lua/?.so;/foo/bar/lua/a?d/j/g.elf;/abc/lua/?.so;/abc/lua/a?d/j/g.elf;./?.so;/def/ghi/a?d/j/g.elf;/def/?.so`
|
||||||
|
|
||||||
|
Note: to keep up with 'runtimepath' updates paths added at previous update are
|
||||||
|
remembered and removed at the next update, while all paths derived from the
|
||||||
|
new 'runtimepath' are prepended as described above. This allows removing
|
||||||
|
paths when path is removed from 'runtimepath', adding paths when they are
|
||||||
|
added and reordering `package.path`/`package.cpath` content if 'runtimepath'
|
||||||
|
was reordered.
|
||||||
|
|
||||||
|
Note 2: even though adjustments happens automatically Nvim does not track
|
||||||
|
current values of `package.path` or `package.cpath`. If you happened to
|
||||||
|
delete some paths from there you need to reset 'runtimepath' to make them
|
||||||
|
readded. Just running `let &runtimepath = &runtimepath` should work.
|
||||||
|
|
||||||
|
Note 3: skipping paths from 'runtimepath' which contain semicolons applies
|
||||||
|
both to `package.path` and `package.cpath`. Given that there is a number of
|
||||||
|
badly written plugins using shell which will not work with paths containing
|
||||||
|
semicolons it is better to not have them in 'runtimepath' at all.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
Example of a plugin that uses lua modules *lua-require-example*
|
||||||
|
|
||||||
|
The following example plugin adds a command `:MakeCharBlob` which transforms
|
||||||
|
current buffer into a long `unsigned char` array. Lua contains transformation
|
||||||
|
function in a module `lua/charblob.lua` which is imported in
|
||||||
|
`autoload/charblob.vim` (`require("charblob")`). Example plugin is supposed
|
||||||
|
to be put into any directory from 'runtimepath', e.g. `~/.config/nvim` (in
|
||||||
|
this case `lua/charblob.lua` means `~/.config/nvim/lua/charblob.lua`).
|
||||||
|
|
||||||
|
autoload/charblob.vim: >
|
||||||
|
|
||||||
|
function charblob#encode_buffer()
|
||||||
|
call setline(1, luaeval(
|
||||||
|
\ 'require("charblob").encode(unpack(_A))',
|
||||||
|
\ [getline(1, '$'), &textwidth, ' ']))
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
plugin/charblob.vim: >
|
||||||
|
|
||||||
|
if exists('g:charblob_loaded')
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:charblob_loaded = 1
|
||||||
|
|
||||||
|
command MakeCharBlob :call charblob#encode_buffer()
|
||||||
|
|
||||||
|
lua/charblob.lua: >
|
||||||
|
|
||||||
|
local function charblob_bytes_iter(lines)
|
||||||
|
local init_s = {
|
||||||
|
next_line_idx = 1,
|
||||||
|
next_byte_idx = 1,
|
||||||
|
lines = lines,
|
||||||
|
}
|
||||||
|
local function next(s, _)
|
||||||
|
if lines[s.next_line_idx] == nil then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
if s.next_byte_idx > #(lines[s.next_line_idx]) then
|
||||||
|
s.next_line_idx = s.next_line_idx + 1
|
||||||
|
s.next_byte_idx = 1
|
||||||
|
return ('\n'):byte()
|
||||||
|
end
|
||||||
|
local ret = lines[s.next_line_idx]:byte(s.next_byte_idx)
|
||||||
|
if ret == ('\n'):byte() then
|
||||||
|
ret = 0 -- See :h NL-used-for-NUL.
|
||||||
|
end
|
||||||
|
s.next_byte_idx = s.next_byte_idx + 1
|
||||||
|
return ret
|
||||||
|
end
|
||||||
|
return next, init_s, nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local function charblob_encode(lines, textwidth, indent)
|
||||||
|
local ret = {
|
||||||
|
'const unsigned char blob[] = {',
|
||||||
|
indent,
|
||||||
|
}
|
||||||
|
for byte in charblob_bytes_iter(lines) do
|
||||||
|
-- .- space + number (width 3) + comma
|
||||||
|
if #(ret[#ret]) + 5 > textwidth then
|
||||||
|
ret[#ret + 1] = indent
|
||||||
|
else
|
||||||
|
ret[#ret] = ret[#ret] .. ' '
|
||||||
|
end
|
||||||
|
ret[#ret] = ret[#ret] .. (('%3u,'):format(byte))
|
||||||
|
end
|
||||||
|
ret[#ret + 1] = '};'
|
||||||
|
return ret
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
bytes_iter = charblob_bytes_iter,
|
||||||
|
encode = charblob_encode,
|
||||||
|
}
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
Commands *lua-commands*
|
||||||
|
|
||||||
|
*:lua*
|
||||||
|
:[range]lua {chunk}
|
||||||
|
Execute Lua chunk {chunk}.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
>
|
||||||
|
:lua vim.api.nvim_command('echo "Hello, Nvim!"')
|
||||||
|
<
|
||||||
|
To see the Lua version: >
|
||||||
|
:lua print(_VERSION)
|
||||||
|
|
||||||
|
To see the LuaJIT version: >
|
||||||
|
:lua print(jit.version)
|
||||||
|
<
|
||||||
|
|
||||||
|
:[range]lua << {endmarker}
|
||||||
|
{script}
|
||||||
|
{endmarker}
|
||||||
|
Execute Lua script {script}.
|
||||||
|
|
||||||
|
{endmarker} must NOT be preceded by any white space. If {endmarker} is
|
||||||
|
omitted from after the "<<", a dot '.' must be used after {script}, like
|
||||||
|
for the |:append| and |:insert| commands.
|
||||||
|
This form of the |:lua| command is mainly useful for including Lua code
|
||||||
|
in Vim scripts.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
>
|
||||||
|
function! CurrentLineInfo()
|
||||||
|
lua << EOF
|
||||||
|
local linenr = vim.api.nvim_win_get_cursor(0)[1]
|
||||||
|
local curline = vim.api.nvim_buf_get_lines(
|
||||||
|
0, linenr, linenr + 1, false)[1]
|
||||||
|
print(string.format("Current line [%d] has %d bytes",
|
||||||
|
linenr, #curline))
|
||||||
|
EOF
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
Note that the `local` variables will disappear when block finishes. This is
|
||||||
|
not the case for globals.
|
||||||
|
|
||||||
|
*:luado*
|
||||||
|
:[range]luado {body} Execute Lua function "function (line, linenr) {body}
|
||||||
|
end" for each line in the [range], with the function
|
||||||
|
argument being set to the text of each line in turn,
|
||||||
|
without a trailing <EOL>, and the current line number.
|
||||||
|
If the value returned by the function is a string it
|
||||||
|
becomes the text of the line in the current turn. The
|
||||||
|
default for [range] is the whole file: "1,$".
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
>
|
||||||
|
:luado return string.format("%s\t%d", line:reverse(), #line)
|
||||||
|
|
||||||
|
:lua require"lpeg"
|
||||||
|
:lua -- balanced parenthesis grammar:
|
||||||
|
:lua bp = lpeg.P{ "(" * ((1 - lpeg.S"()") + lpeg.V(1))^0 * ")" }
|
||||||
|
:luado if bp:match(line) then return "-->\t" .. line end
|
||||||
|
<
|
||||||
|
|
||||||
|
*:luafile*
|
||||||
|
:[range]luafile {file}
|
||||||
|
Execute Lua script in {file}.
|
||||||
|
The whole argument is used as a single file name.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
>
|
||||||
|
:luafile script.lua
|
||||||
|
:luafile %
|
||||||
|
<
|
||||||
|
|
||||||
|
All these commands execute a Lua chunk from either the command line (:lua and
|
||||||
|
:luado) or a file (:luafile) with the given line [range]. Similarly to the Lua
|
||||||
|
interpreter, each chunk has its own scope and so only global variables are
|
||||||
|
shared between command calls. All Lua default libraries are available. In
|
||||||
|
addition, Lua "print" function has its output redirected to the Nvim message
|
||||||
|
area, with arguments separated by a white space instead of a tab.
|
||||||
|
|
||||||
|
Lua uses the "vim" module (see |lua-vim|) to issue commands to Nvim
|
||||||
|
and manage buffers (|lua-buffer|) and windows (|lua-window|). However,
|
||||||
|
procedures that alter buffer content, open new buffers, and change cursor
|
||||||
|
position are restricted when the command is executed in the |sandbox|.
|
||||||
|
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
The vim module *lua-vim*
|
||||||
|
|
||||||
|
Lua interfaces Nvim through the "vim" module. Currently it has the `api`
|
||||||
|
submodule and some Nvim-specific utilities.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
vim.api.* functions
|
||||||
|
|
||||||
|
`vim.api` exposes the Nvim |API| as a table of Lua functions. All functions
|
||||||
|
are available.
|
||||||
|
|
||||||
|
For example, to use the "nvim_get_current_line()" API function, call
|
||||||
|
"vim.api.nvim_get_current_line()": >
|
||||||
|
|
||||||
|
print(tostring(vim.api.nvim_get_current_line()))
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
vim.* utility functions
|
||||||
|
|
||||||
|
vim.stricmp(a, b) *lua-vim.stricmp*
|
||||||
|
Function used for case-insensitive string comparison. Takes two
|
||||||
|
string arguments and returns 0, 1 or -1 if strings are equal, a is
|
||||||
|
greater then b or a is lesser then b respectively.
|
||||||
|
|
||||||
|
vim.type_idx *lua-vim.type_idx*
|
||||||
|
Type index for use in |lua-special-tables|. Specifying one of the
|
||||||
|
values from |lua-vim.types| allows typing the empty table (it is
|
||||||
|
unclear whether empty lua table represents empty list or empty array)
|
||||||
|
and forcing integral numbers to be |Float|. See |lua-special-tbl| for
|
||||||
|
more details.
|
||||||
|
|
||||||
|
vim.val_idx *lua-vim.val_idx*
|
||||||
|
Value index for tables representing |Float|s. A table representing
|
||||||
|
floating-point value 1.0 looks like this: >
|
||||||
|
{
|
||||||
|
[vim.type_idx] = vim.types.float,
|
||||||
|
[vim.val_idx] = 1.0,
|
||||||
|
}
|
||||||
|
< See also |lua-vim.type_idx| and |lua-special-tbl|.
|
||||||
|
|
||||||
|
vim.types *lua-vim.types*
|
||||||
|
Table with possible values for |lua-vim.type_idx|. Contains two sets
|
||||||
|
of key-value pairs: first maps possible values for |lua-vim.type_idx|
|
||||||
|
to human-readable strings, second maps human-readable type names to
|
||||||
|
values for |lua-vim.type_idx|. Currently contains pairs for `float`,
|
||||||
|
`array` and `dictionary` types.
|
||||||
|
|
||||||
|
Note: one must expect that values corresponding to `vim.types.float`,
|
||||||
|
`vim.types.array` and `vim.types.dictionary` fall under only two
|
||||||
|
following assumptions:
|
||||||
|
1. Value may serve both as a key and as a value in a table. Given the
|
||||||
|
properties of lua tables this basically means “value is not `nil`”.
|
||||||
|
2. For each value in `vim.types` table `vim.types[vim.types[value]]`
|
||||||
|
is the same as `value`.
|
||||||
|
No other restrictions are put on types, and it is not guaranteed that
|
||||||
|
values corresponding to `vim.types.float`, `vim.types.array` and
|
||||||
|
`vim.types.dictionary` will not change or that `vim.types` table will
|
||||||
|
only contain values for these three types.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
The luaeval function *lua-luaeval* *lua-eval*
|
||||||
|
*luaeval()*
|
||||||
|
|
||||||
|
The (dual) equivalent of "vim.eval" for passing Lua values to Nvim is
|
||||||
|
"luaeval". "luaeval" takes an expression string and an optional argument used
|
||||||
|
for _A inside expression and returns the result of the expression. It is
|
||||||
|
semantically equivalent in Lua to:
|
||||||
|
>
|
||||||
|
local chunkheader = "local _A = select(1, ...) return "
|
||||||
|
function luaeval (expstr, arg)
|
||||||
|
local chunk = assert(loadstring(chunkheader .. expstr, "luaeval"))
|
||||||
|
return chunk(arg) -- return typval
|
||||||
|
end
|
||||||
|
|
||||||
|
Note that "_A" receives the argument to "luaeval". Lua nils, numbers, strings,
|
||||||
|
tables and booleans are converted to their respective VimL types. An error is
|
||||||
|
thrown if conversion of any of the remaining Lua types is attempted.
|
||||||
|
|
||||||
|
Note 2: lua tables are used as both dictionaries and lists, thus making it
|
||||||
|
impossible to determine whether empty table is meant to be empty list or empty
|
||||||
|
dictionary. Additionally lua does not have integer numbers. To distinguish
|
||||||
|
between these cases there is the following agreement:
|
||||||
|
|
||||||
|
0. Empty table is empty list.
|
||||||
|
1. Table with N incrementally growing integral numbers, starting from 1 and
|
||||||
|
ending with N is considered to be a list.
|
||||||
|
2. Table with string keys, none of which contains NUL byte, is considered to
|
||||||
|
be a dictionary.
|
||||||
|
3. Table with string keys, at least one of which contains NUL byte, is also
|
||||||
|
considered to be a dictionary, but this time it is converted to
|
||||||
|
a |msgpack-special-map|.
|
||||||
|
*lua-special-tbl*
|
||||||
|
4. Table with `vim.type_idx` key may be a dictionary, a list or floating-point
|
||||||
|
value:
|
||||||
|
- `{[vim.type_idx]=vim.types.float, [vim.val_idx]=1}` is converted to
|
||||||
|
a floating-point 1.0. Note that by default integral lua numbers are
|
||||||
|
converted to |Number|s, non-integral are converted to |Float|s. This
|
||||||
|
variant allows integral |Float|s.
|
||||||
|
- `{[vim.type_idx]=vim.types.dictionary}` is converted to an empty
|
||||||
|
dictionary, `{[vim.type_idx]=vim.types.dictionary, [42]=1, a=2}` is
|
||||||
|
converted to a dictionary `{'a': 42}`: non-string keys are ignored.
|
||||||
|
Without `vim.type_idx` key tables with keys not fitting in 1., 2. or 3.
|
||||||
|
are errors.
|
||||||
|
- `{[vim.type_idx]=vim.types.list}` is converted to an empty list. As well
|
||||||
|
as `{[vim.type_idx]=vim.types.list, [42]=1}`: integral keys that do not
|
||||||
|
form a 1-step sequence from 1 to N are ignored, as well as all
|
||||||
|
non-integral keys.
|
||||||
|
|
||||||
|
Examples: >
|
||||||
|
|
||||||
|
:echo luaeval('math.pi')
|
||||||
|
:function Rand(x,y) " random uniform between x and y
|
||||||
|
: return luaeval('(_A.y-_A.x)*math.random()+_A.x', {'x':a:x,'y':a:y})
|
||||||
|
: endfunction
|
||||||
|
:echo Rand(1,10)
|
||||||
|
|
||||||
|
Note that currently second argument to `luaeval` undergoes VimL to lua
|
||||||
|
conversion, so changing containers in lua do not affect values in VimL. Return
|
||||||
|
value is also always converted. When converting, |msgpack-special-dict|s are
|
||||||
|
treated specially.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
vim:tw=78:ts=8:noet:ft=help:norl:
|
@@ -8,7 +8,7 @@ The Python Interface to Vim *python* *Python*
|
|||||||
|
|
||||||
See |provider-python| for more information. {Nvim}
|
See |provider-python| for more information. {Nvim}
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Commands *python-commands*
|
1. Commands *python-commands*
|
||||||
@@ -679,7 +679,7 @@ vim.Function object *python-Function*
|
|||||||
8. pyeval() and py3eval() Vim functions *python-pyeval*
|
8. pyeval() and py3eval() Vim functions *python-pyeval*
|
||||||
|
|
||||||
To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()|
|
To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()|
|
||||||
functions to evaluate Python expressions and pass their values to VimL.
|
functions to evaluate Python expressions and pass their values to Vim script.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
9. Python 3 *python3*
|
9. Python 3 *python3*
|
||||||
|
@@ -10,7 +10,7 @@ The Ruby Interface to Vim *ruby* *Ruby*
|
|||||||
The home page for ruby is http://www.ruby-lang.org/. You can find links for
|
The home page for ruby is http://www.ruby-lang.org/. You can find links for
|
||||||
downloading Ruby there.
|
downloading Ruby there.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Commands *ruby-commands*
|
1. Commands *ruby-commands*
|
||||||
@@ -63,7 +63,7 @@ To see what version of Ruby you have: >
|
|||||||
|
|
||||||
*:rubyfile* *:rubyf*
|
*:rubyfile* *:rubyf*
|
||||||
:rubyf[ile] {file} Execute the Ruby script in {file}. This is the same as
|
:rubyf[ile] {file} Execute the Ruby script in {file}. This is the same as
|
||||||
":ruby load 'file'", but allows file name completion.
|
`:ruby load 'file'`, but allows file name completion.
|
||||||
|
|
||||||
Executing Ruby commands is not possible in the |sandbox|.
|
Executing Ruby commands is not possible in the |sandbox|.
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
This file is about indenting C programs and other files.
|
This file is about indenting C programs and other files.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Indenting C style programs *C-indenting*
|
1. Indenting C style programs *C-indenting*
|
||||||
|
@@ -15,7 +15,7 @@ For an overview of built-in functions see |functions|.
|
|||||||
For a list of Vim variables see |vim-variable|.
|
For a list of Vim variables see |vim-variable|.
|
||||||
For a complete listing of all help items see |help-tags|.
|
For a complete listing of all help items see |help-tags|.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Insert mode *insert-index*
|
1. Insert mode *insert-index*
|
||||||
@@ -298,10 +298,10 @@ tag char note action in Normal mode ~
|
|||||||
|B| B 1 cursor N WORDS backward
|
|B| B 1 cursor N WORDS backward
|
||||||
|C| ["x]C 2 change from the cursor position to the end
|
|C| ["x]C 2 change from the cursor position to the end
|
||||||
of the line, and N-1 more lines [into
|
of the line, and N-1 more lines [into
|
||||||
buffer x]; synonym for "c$"
|
register x]; synonym for "c$"
|
||||||
|D| ["x]D 2 delete the characters under the cursor
|
|D| ["x]D 2 delete the characters under the cursor
|
||||||
until the end of the line and N-1 more
|
until the end of the line and N-1 more
|
||||||
lines [into buffer x]; synonym for "d$"
|
lines [into register x]; synonym for "d$"
|
||||||
|E| E 1 cursor forward to the end of WORD N
|
|E| E 1 cursor forward to the end of WORD N
|
||||||
|F| F{char} 1 cursor to the Nth occurrence of {char} to
|
|F| F{char} 1 cursor to the Nth occurrence of {char} to
|
||||||
the left
|
the left
|
||||||
@@ -318,13 +318,13 @@ tag char note action in Normal mode ~
|
|||||||
opposite direction
|
opposite direction
|
||||||
|O| O 2 begin a new line above the cursor and
|
|O| O 2 begin a new line above the cursor and
|
||||||
insert text, repeat N times
|
insert text, repeat N times
|
||||||
|P| ["x]P 2 put the text [from buffer x] before the
|
|P| ["x]P 2 put the text [from register x] before the
|
||||||
cursor N times
|
cursor N times
|
||||||
|Q| Q switch to "Ex" mode
|
|Q| Q switch to "Ex" mode
|
||||||
|R| R 2 enter replace mode: overtype existing
|
|R| R 2 enter replace mode: overtype existing
|
||||||
characters, repeat the entered text N-1
|
characters, repeat the entered text N-1
|
||||||
times
|
times
|
||||||
|S| ["x]S 2 delete N lines [into buffer x] and start
|
|S| ["x]S 2 delete N lines [into register x] and start
|
||||||
insert; synonym for "cc".
|
insert; synonym for "cc".
|
||||||
|T| T{char} 1 cursor till after Nth occurrence of {char}
|
|T| T{char} 1 cursor till after Nth occurrence of {char}
|
||||||
to the left
|
to the left
|
||||||
@@ -332,8 +332,8 @@ tag char note action in Normal mode ~
|
|||||||
|V| V start linewise Visual mode
|
|V| V start linewise Visual mode
|
||||||
|W| W 1 cursor N WORDS forward
|
|W| W 1 cursor N WORDS forward
|
||||||
|X| ["x]X 2 delete N characters before the cursor [into
|
|X| ["x]X 2 delete N characters before the cursor [into
|
||||||
buffer x]
|
register x]
|
||||||
|Y| ["x]Y yank N lines [into buffer x]; synonym for
|
|Y| ["x]Y yank N lines [into register x]; synonym for
|
||||||
"yy"
|
"yy"
|
||||||
|ZZ| ZZ store current file if modified, and exit
|
|ZZ| ZZ store current file if modified, and exit
|
||||||
|ZQ| ZQ exit current file always
|
|ZQ| ZQ exit current file always
|
||||||
@@ -356,12 +356,12 @@ tag char note action in Normal mode ~
|
|||||||
|`}| `} 1 cursor to the end of the current paragraph
|
|`}| `} 1 cursor to the end of the current paragraph
|
||||||
|a| a 2 append text after the cursor N times
|
|a| a 2 append text after the cursor N times
|
||||||
|b| b 1 cursor N words backward
|
|b| b 1 cursor N words backward
|
||||||
|c| ["x]c{motion} 2 delete Nmove text [into buffer x] and start
|
|c| ["x]c{motion} 2 delete Nmove text [into register x] and
|
||||||
|
start insert
|
||||||
|
|cc| ["x]cc 2 delete N lines [into register x] and start
|
||||||
insert
|
insert
|
||||||
|cc| ["x]cc 2 delete N lines [into buffer x] and start
|
|d| ["x]d{motion} 2 delete Nmove text [into register x]
|
||||||
insert
|
|dd| ["x]dd 2 delete N lines [into register x]
|
||||||
|d| ["x]d{motion} 2 delete Nmove text [into buffer x]
|
|
||||||
|dd| ["x]dd 2 delete N lines [into buffer x]
|
|
||||||
|do| do 2 same as ":diffget"
|
|do| do 2 same as ":diffget"
|
||||||
|dp| dp 2 same as ":diffput"
|
|dp| dp 2 same as ":diffput"
|
||||||
|e| e 1 cursor forward to the end of word N
|
|e| e 1 cursor forward to the end of word N
|
||||||
@@ -387,16 +387,16 @@ tag char note action in Normal mode ~
|
|||||||
|q?| q? edit ? command-line in command-line window
|
|q?| q? edit ? command-line in command-line window
|
||||||
|r| r{char} 2 replace N chars with {char}
|
|r| r{char} 2 replace N chars with {char}
|
||||||
|s| ["x]s 2 (substitute) delete N characters [into
|
|s| ["x]s 2 (substitute) delete N characters [into
|
||||||
buffer x] and start insert
|
register x] and start insert
|
||||||
|t| t{char} 1 cursor till before Nth occurrence of {char}
|
|t| t{char} 1 cursor till before Nth occurrence of {char}
|
||||||
to the right
|
to the right
|
||||||
|u| u 2 undo changes
|
|u| u 2 undo changes
|
||||||
|v| v start characterwise Visual mode
|
|v| v start characterwise Visual mode
|
||||||
|w| w 1 cursor N words forward
|
|w| w 1 cursor N words forward
|
||||||
|x| ["x]x 2 delete N characters under and after the
|
|x| ["x]x 2 delete N characters under and after the
|
||||||
cursor [into buffer x]
|
cursor [into register x]
|
||||||
|y| ["x]y{motion} yank Nmove text [into buffer x]
|
|y| ["x]y{motion} yank Nmove text [into register x]
|
||||||
|yy| ["x]yy yank N lines [into buffer x]
|
|yy| ["x]yy yank N lines [into register x]
|
||||||
|z| z{char} commands starting with 'z', see |z| below
|
|z| z{char} commands starting with 'z', see |z| below
|
||||||
|{| { 1 cursor N paragraphs backward
|
|{| { 1 cursor N paragraphs backward
|
||||||
|bar| | 1 cursor to column N
|
|bar| | 1 cursor to column N
|
||||||
@@ -993,10 +993,12 @@ tag command action in Command-line editing mode ~
|
|||||||
|c_<CR>| <CR> execute entered command
|
|c_<CR>| <CR> execute entered command
|
||||||
|c_CTRL-M| CTRL-M same as <CR>
|
|c_CTRL-M| CTRL-M same as <CR>
|
||||||
|c_CTRL-N| CTRL-N after using 'wildchar' with multiple matches:
|
|c_CTRL-N| CTRL-N after using 'wildchar' with multiple matches:
|
||||||
go to next match, otherwise: same as <Down>
|
go to next match, otherwise: recall older
|
||||||
|
command-line from history.
|
||||||
CTRL-O not used
|
CTRL-O not used
|
||||||
|c_CTRL-P| CTRL-P after using 'wildchar' with multiple matches:
|
|c_CTRL-P| CTRL-P after using 'wildchar' with multiple matches:
|
||||||
go to previous match, otherwise: same as <Up>
|
go to previous match, otherwise: recall older
|
||||||
|
command-line from history.
|
||||||
|c_CTRL-Q| CTRL-Q same as CTRL-V, unless it's used for terminal
|
|c_CTRL-Q| CTRL-Q same as CTRL-V, unless it's used for terminal
|
||||||
control flow
|
control flow
|
||||||
|c_CTRL-R| CTRL-R {0-9a-z"%#*:= CTRL-F CTRL-P CTRL-W CTRL-A}
|
|c_CTRL-R| CTRL-R {0-9a-z"%#*:= CTRL-F CTRL-P CTRL-W CTRL-A}
|
||||||
@@ -1331,6 +1333,9 @@ tag command action ~
|
|||||||
|:ltag| :lt[ag] jump to tag and add matching tags to the
|
|:ltag| :lt[ag] jump to tag and add matching tags to the
|
||||||
location list
|
location list
|
||||||
|:lunmap| :lu[nmap] like ":unmap!" but includes Lang-Arg mode
|
|:lunmap| :lu[nmap] like ":unmap!" but includes Lang-Arg mode
|
||||||
|
|:lua| :lua execute Lua command
|
||||||
|
|:luado| :luad[o] execute Lua command for each line
|
||||||
|
|:luafile| :luaf[ile] execute Lua script file
|
||||||
|:lvimgrep| :lv[imgrep] search for pattern in files
|
|:lvimgrep| :lv[imgrep] search for pattern in files
|
||||||
|:lvimgrepadd| :lvimgrepa[dd] like :vimgrep, but append to current list
|
|:lvimgrepadd| :lvimgrepa[dd] like :vimgrep, but append to current list
|
||||||
|:lwindow| :lw[indow] open or close location window
|
|:lwindow| :lw[indow] open or close location window
|
||||||
@@ -1537,13 +1542,17 @@ tag command action ~
|
|||||||
|:tjump| :tj[ump] like ":tselect", but jump directly when there
|
|:tjump| :tj[ump] like ":tselect", but jump directly when there
|
||||||
is only one match
|
is only one match
|
||||||
|:tlast| :tl[ast] jump to last matching tag
|
|:tlast| :tl[ast] jump to last matching tag
|
||||||
|
|:tmapclear| :tmapc[lear] remove all mappings for Terminal-Job mode
|
||||||
|
|:tmap| :tma[p] like ":map" but for Terminal-Job mode
|
||||||
|:tmenu| :tm[enu] define menu tooltip
|
|:tmenu| :tm[enu] define menu tooltip
|
||||||
|:tnext| :tn[ext] jump to next matching tag
|
|:tnext| :tn[ext] jump to next matching tag
|
||||||
|
|:tnoremap| :tno[remap] like ":noremap" but for Terminal-Job mode
|
||||||
|:topleft| :to[pleft] make split window appear at top or far left
|
|:topleft| :to[pleft] make split window appear at top or far left
|
||||||
|:tprevious| :tp[revious] jump to previous matching tag
|
|:tprevious| :tp[revious] jump to previous matching tag
|
||||||
|:trewind| :tr[ewind] jump to first matching tag
|
|:trewind| :tr[ewind] jump to first matching tag
|
||||||
|:try| :try execute commands, abort on error or exception
|
|:try| :try execute commands, abort on error or exception
|
||||||
|:tselect| :ts[elect] list matching tags and select one
|
|:tselect| :ts[elect] list matching tags and select one
|
||||||
|
|:tunmap| :tunma[p] like ":unmap" but for Terminal-Job mode
|
||||||
|:tunmenu| :tu[nmenu] remove menu tooltip
|
|:tunmenu| :tu[nmenu] remove menu tooltip
|
||||||
|:undo| :u[ndo] undo last change(s)
|
|:undo| :u[ndo] undo last change(s)
|
||||||
|:undojoin| :undoj[oin] join next change with previous undo block
|
|:undojoin| :undoj[oin] join next change with previous undo block
|
||||||
|
@@ -16,7 +16,7 @@ user manual |usr_24.txt|.
|
|||||||
Also see 'virtualedit', for moving the cursor to positions where there is no
|
Also see 'virtualedit', for moving the cursor to positions where there is no
|
||||||
character. Useful for editing a table.
|
character. Useful for editing a table.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Special keys *ins-special-keys*
|
1. Special keys *ins-special-keys*
|
||||||
@@ -146,7 +146,8 @@ CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
|
|||||||
CTRL-R CTRL-O {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-O*
|
CTRL-R CTRL-O {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-O*
|
||||||
Insert the contents of a register literally and don't
|
Insert the contents of a register literally and don't
|
||||||
auto-indent. Does the same as pasting with the mouse
|
auto-indent. Does the same as pasting with the mouse
|
||||||
|<MiddleMouse>|.
|
|<MiddleMouse>|. When the register is linewise this will
|
||||||
|
insert the text above the current line, like with `P`.
|
||||||
Does not replace characters!
|
Does not replace characters!
|
||||||
The '.' register (last inserted text) is still inserted as
|
The '.' register (last inserted text) is still inserted as
|
||||||
typed.
|
typed.
|
||||||
@@ -607,13 +608,13 @@ Completion can be done for:
|
|||||||
10. User defined completion |i_CTRL-X_CTRL-U|
|
10. User defined completion |i_CTRL-X_CTRL-U|
|
||||||
11. omni completion |i_CTRL-X_CTRL-O|
|
11. omni completion |i_CTRL-X_CTRL-O|
|
||||||
12. Spelling suggestions |i_CTRL-X_s|
|
12. Spelling suggestions |i_CTRL-X_s|
|
||||||
13. keywords in 'complete' |i_CTRL-N|
|
13. keywords in 'complete' |i_CTRL-N| |i_CTRL-P|
|
||||||
|
|
||||||
All these (except 2) are done in CTRL-X mode. This is a sub-mode of Insert
|
All these, except CTRL-N and CTRL-P, are done in CTRL-X mode. This is a
|
||||||
and Replace modes. You enter CTRL-X mode by typing CTRL-X and one of the
|
sub-mode of Insert and Replace modes. You enter CTRL-X mode by typing CTRL-X
|
||||||
CTRL-X commands. You exit CTRL-X mode by typing a key that is not a valid
|
and one of the CTRL-X commands. You exit CTRL-X mode by typing a key that is
|
||||||
CTRL-X mode command. Valid keys are the CTRL-X command itself, CTRL-N (next),
|
not a valid CTRL-X mode command. Valid keys are the CTRL-X command itself,
|
||||||
and CTRL-P (previous).
|
CTRL-N (next), and CTRL-P (previous).
|
||||||
|
|
||||||
Also see the 'infercase' option if you want to adjust the case of the match.
|
Also see the 'infercase' option if you want to adjust the case of the match.
|
||||||
|
|
||||||
@@ -1077,7 +1078,7 @@ items:
|
|||||||
empty when non-zero this match will be added even when it is
|
empty when non-zero this match will be added even when it is
|
||||||
an empty string
|
an empty string
|
||||||
|
|
||||||
All of these except 'icase', 'dup' and 'empty' must be a string. If an item
|
All of these except "icase", "dup" and "empty" must be a string. If an item
|
||||||
does not meet these requirements then an error message is given and further
|
does not meet these requirements then an error message is given and further
|
||||||
items in the list are not used. You can mix string and Dictionary items in
|
items in the list are not used. You can mix string and Dictionary items in
|
||||||
the returned list.
|
the returned list.
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Introduction to Vim *ref* *reference*
|
Introduction to Vim *ref* *reference*
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Introduction *intro*
|
1. Introduction *intro*
|
||||||
@@ -68,8 +68,8 @@ The Vim pages contain the most recent information about Vim. They also
|
|||||||
contain links to the most recent version of Vim. The FAQ is a list of
|
contain links to the most recent version of Vim. The FAQ is a list of
|
||||||
Frequently Asked Questions. Read this if you have problems.
|
Frequently Asked Questions. Read this if you have problems.
|
||||||
|
|
||||||
VIM home page: http://www.vim.org/
|
Vim home page: http://www.vim.org/
|
||||||
VIM FAQ: http://vimdoc.sf.net/
|
Vim FAQ: http://vimdoc.sf.net/
|
||||||
Downloading: ftp://ftp.vim.org/pub/vim/MIRRORS
|
Downloading: ftp://ftp.vim.org/pub/vim/MIRRORS
|
||||||
|
|
||||||
|
|
||||||
@@ -120,9 +120,14 @@ Report bugs on GitHub: https://github.com/neovim/neovim/issues
|
|||||||
|
|
||||||
Please be brief; all the time that is spent on answering mail is subtracted
|
Please be brief; all the time that is spent on answering mail is subtracted
|
||||||
from the time that is spent on improving Vim! Always give a reproducible
|
from the time that is spent on improving Vim! Always give a reproducible
|
||||||
example and try to find out which settings or other things influence the
|
example and try to find out which settings or other things trigger the bug.
|
||||||
appearance of the bug. Try different machines, if possible. Send me patches
|
|
||||||
if you can!
|
Preferably start Vim with: >
|
||||||
|
vim --clean -u reproduce.vim
|
||||||
|
Where reproduce.vim is a script that reproduces the problem. Try different
|
||||||
|
machines, if relevant (is this an MS-Windows specific bug perhaps?).
|
||||||
|
|
||||||
|
Send me patches if you can!
|
||||||
|
|
||||||
It will help to include information about the version of Vim you are using and
|
It will help to include information about the version of Vim you are using and
|
||||||
your setup. You can get the information with this command: >
|
your setup. You can get the information with this command: >
|
||||||
@@ -236,6 +241,10 @@ Vim would never have become what it is now, without the help of these people!
|
|||||||
Juergen Weigert Lattice version, AUX improvements, Unix and
|
Juergen Weigert Lattice version, AUX improvements, Unix and
|
||||||
MS-DOS ports, autoconf
|
MS-DOS ports, autoconf
|
||||||
Stefan 'Sec' Zehl Maintainer of vim.org
|
Stefan 'Sec' Zehl Maintainer of vim.org
|
||||||
|
Yasuhiro Matsumoto many MS-Windows improvements
|
||||||
|
Ken Takata fixes and features
|
||||||
|
Kazunobu Kuriyama GTK 3
|
||||||
|
Christian Brabandt many fixes, features, user support, etc.
|
||||||
|
|
||||||
I wish to thank all the people that sent me bug reports and suggestions. The
|
I wish to thank all the people that sent me bug reports and suggestions. The
|
||||||
list is too long to mention them all here. Vim would not be the same without
|
list is too long to mention them all here. Vim would not be the same without
|
||||||
@@ -249,8 +258,7 @@ Vi "the original". Without further remarks this is the version
|
|||||||
of Vi that appeared in Sun OS 4.x. ":version" returns
|
of Vi that appeared in Sun OS 4.x. ":version" returns
|
||||||
"Version 3.7, 6/7/85". Sometimes other versions are referred
|
"Version 3.7, 6/7/85". Sometimes other versions are referred
|
||||||
to. Only runs under Unix. Source code only available with a
|
to. Only runs under Unix. Source code only available with a
|
||||||
license. More information on Vi can be found through:
|
license.
|
||||||
http://vi-editor.org [doesn't currently work...]
|
|
||||||
*Nvi*
|
*Nvi*
|
||||||
Nvi The "New" Vi. The version of Vi that comes with BSD 4.4 and FreeBSD.
|
Nvi The "New" Vi. The version of Vi that comes with BSD 4.4 and FreeBSD.
|
||||||
Very good compatibility with the original Vi, with a few extensions.
|
Very good compatibility with the original Vi, with a few extensions.
|
||||||
@@ -374,8 +382,7 @@ CTRL-{char} {char} typed as a control character; that is, typing {char}
|
|||||||
|
|
||||||
*key-notation* *key-codes* *keycodes*
|
*key-notation* *key-codes* *keycodes*
|
||||||
These names for keys are used in the documentation. They can also be used
|
These names for keys are used in the documentation. They can also be used
|
||||||
with the ":map" command (insert the key name by pressing CTRL-K and then the
|
with the ":map" command.
|
||||||
key you want the name for).
|
|
||||||
|
|
||||||
notation meaning equivalent decimal value(s) ~
|
notation meaning equivalent decimal value(s) ~
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
@@ -442,8 +449,8 @@ available on a few terminals.
|
|||||||
|
|
||||||
Note: There are two codes for the delete key. 127 is the decimal ASCII value
|
Note: There are two codes for the delete key. 127 is the decimal ASCII value
|
||||||
for the delete key, which is always recognized. Some delete keys send another
|
for the delete key, which is always recognized. Some delete keys send another
|
||||||
value, in which case this value is obtained from the termcap entry "kD". Both
|
value, in which case this value is obtained from the |terminfo| entry "key_dc".
|
||||||
values have the same effect.
|
Both values have the same effect.
|
||||||
|
|
||||||
Note: The keypad keys are used in the same way as the corresponding "normal"
|
Note: The keypad keys are used in the same way as the corresponding "normal"
|
||||||
keys. For example, <kHome> has the same effect as <Home>. If a keypad key
|
keys. For example, <kHome> has the same effect as <Home>. If a keypad key
|
||||||
@@ -489,7 +496,7 @@ examples and use them directly. Or type them literally, including the '<' and
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
5. Modes, introduction *vim-modes-intro* *vim-modes*
|
5. Modes, introduction *vim-modes-intro* *vim-modes*
|
||||||
|
|
||||||
Vim has six BASIC modes:
|
Vim has seven BASIC modes:
|
||||||
|
|
||||||
*Normal* *Normal-mode* *command-mode*
|
*Normal* *Normal-mode* *command-mode*
|
||||||
Normal mode In Normal mode you can enter all the normal editor
|
Normal mode In Normal mode you can enter all the normal editor
|
||||||
@@ -525,6 +532,13 @@ Ex mode Like Command-line mode, but after entering a command
|
|||||||
you remain in Ex mode. Very limited editing of the
|
you remain in Ex mode. Very limited editing of the
|
||||||
command line. |Ex-mode|
|
command line. |Ex-mode|
|
||||||
|
|
||||||
|
*Terminal-mode*
|
||||||
|
Terminal mode In Terminal mode all input (except |c_CTRL-\_CTRL-N|)
|
||||||
|
is sent to the process running in the current
|
||||||
|
|terminal| buffer.
|
||||||
|
If the 'showmode' option is on "-- TERMINAL --" is shown
|
||||||
|
at the bottom of the window.
|
||||||
|
|
||||||
There are six ADDITIONAL modes. These are variants of the BASIC modes:
|
There are six ADDITIONAL modes. These are variants of the BASIC modes:
|
||||||
|
|
||||||
*Operator-pending* *Operator-pending-mode*
|
*Operator-pending* *Operator-pending-mode*
|
||||||
@@ -708,9 +722,9 @@ special situation. Vim will show only part of the line, around where the
|
|||||||
cursor is. There are no special characters shown, so that you can edit all
|
cursor is. There are no special characters shown, so that you can edit all
|
||||||
parts of this line.
|
parts of this line.
|
||||||
|
|
||||||
The '@' occasion in the 'highlight' option can be used to set special
|
The |hl-NonText| highlight group can be used to set special highlighting
|
||||||
highlighting for the '@' and '~' characters. This makes it possible to
|
for the '@' and '~' characters. This makes it possible to distinguish them
|
||||||
distinguish them from real characters in the buffer.
|
from real characters in the buffer.
|
||||||
|
|
||||||
The 'showbreak' option contains the string to put in front of wrapped lines.
|
The 'showbreak' option contains the string to put in front of wrapped lines.
|
||||||
|
|
||||||
@@ -777,10 +791,12 @@ by Vim.
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
8. Definitions *definitions*
|
8. Definitions *definitions*
|
||||||
|
|
||||||
|
buffer Contains lines of text, usually read from a file.
|
||||||
screen The whole area that Vim uses to work in. This can be
|
screen The whole area that Vim uses to work in. This can be
|
||||||
a terminal emulator window. Also called "the Vim
|
a terminal emulator window. Also called "the Vim
|
||||||
window".
|
window".
|
||||||
window A view on a buffer.
|
window A view on a buffer. There can be multiple windows for
|
||||||
|
one buffer.
|
||||||
|
|
||||||
A screen contains one or more windows, separated by status lines and with the
|
A screen contains one or more windows, separated by status lines and with the
|
||||||
command line at the bottom.
|
command line at the bottom.
|
||||||
|
@@ -4,41 +4,30 @@
|
|||||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||||
|
|
||||||
|
|
||||||
Nvim's facilities for job control *job-control*
|
Nvim job control *job-control*
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Job control is a way to perform multitasking in Nvim, so scripts can spawn and
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
1. Introduction *job-control-intro*
|
|
||||||
|
|
||||||
Job control is a simple way to perform multitasking in vimscript. Wikipedia
|
|
||||||
contains a more generic/detailed description:
|
|
||||||
|
|
||||||
"Job control in computing refers to the control of multiple tasks or Jobs on a
|
|
||||||
computer system, ensuring that they each have access to adequate resources to
|
|
||||||
perform correctly, that competition for limited resources does not cause a
|
|
||||||
deadlock where two or more jobs are unable to complete, resolving such
|
|
||||||
situations where they do occur, and terminating jobs that, for any reason, are
|
|
||||||
not performing as expected."
|
|
||||||
|
|
||||||
In a few words: It allows a vimscript programmer to concurrently spawn and
|
|
||||||
control multiple processes without blocking the current Nvim instance.
|
control multiple processes without blocking the current Nvim instance.
|
||||||
|
|
||||||
Nvim's job control was designed to be simple and familiar to vimscript
|
Type |gO| to see the table of contents.
|
||||||
programmers, instead of being very powerful but complex. Unlike Vim's
|
|
||||||
facilities for calling with external commands, job control does not depend on
|
|
||||||
available shells, instead relying on OS functionality for process management.
|
|
||||||
|
|
||||||
Internally, Nvim job control is powered by libuv, which has a nice
|
|
||||||
cross-platform API for managing processes. See https://github.com/libuv/libuv
|
|
||||||
for details.
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
2. Usage *job-control-usage*
|
Concepts
|
||||||
|
|
||||||
|
Job Id *job-id*
|
||||||
|
|
||||||
|
When a job starts it is assigned a number, unique for the life of the current
|
||||||
|
Nvim session. Functions like |jobstart()| return job ids. Functions like
|
||||||
|
|jobsend()|, |jobstop()|, |rpcnotify()|, and |rpcrequest()| take job ids.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
Usage *job-control-usage*
|
||||||
|
|
||||||
|
To control jobs, use the "job…" family of functions: |jobstart()|,
|
||||||
|
|jobsend()|, |jobstop()|.
|
||||||
|
|
||||||
|
Example: >
|
||||||
|
|
||||||
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) dict
|
function! s:JobHandler(job_id, data, event) dict
|
||||||
if a:event == 'stdout'
|
if a:event == 'stdout'
|
||||||
let str = self.shell.' stdout: '.join(a:data)
|
let str = self.shell.' stdout: '.join(a:data)
|
||||||
@@ -58,34 +47,41 @@ Job control is achieved by calling a combination of the |jobstart()|,
|
|||||||
let job1 = jobstart(['bash'], extend({'shell': 'shell 1'}, s:callbacks))
|
let job1 = jobstart(['bash'], extend({'shell': 'shell 1'}, s:callbacks))
|
||||||
let job2 = jobstart(['bash', '-c', 'for i in {1..10}; do echo hello $i!; sleep 1; done'], extend({'shell': 'shell 2'}, s:callbacks))
|
let job2 = jobstart(['bash', '-c', 'for i in {1..10}; do echo hello $i!; sleep 1; done'], extend({'shell': 'shell 2'}, s:callbacks))
|
||||||
|
|
||||||
|
To test the above script, copy it to a file ~/foo.vim and run it: >
|
||||||
|
nvim -u ~/foo.vim
|
||||||
<
|
<
|
||||||
To test the above, copy it to the file ~/jobcontrol.vim and start with a clean
|
Description of what happens:
|
||||||
nvim instance:
|
- Two bash shells are spawned by |jobstart()| with their stdin/stdout/stderr
|
||||||
>
|
streams connected to nvim.
|
||||||
nvim -u NONE -S ~/jobcontrol.vim
|
- The first shell is idle, waiting to read commands from its stdin.
|
||||||
<
|
- The second shell is started with -c which executes the command (a for-loop
|
||||||
Here's what is happening:
|
printing 0 through 9) and then exits.
|
||||||
|
- `JobHandler()` callback is passed to |jobstart()| to handle various job
|
||||||
|
events. It displays stdout/stderr data received from the shells.
|
||||||
|
|
||||||
- Two bash instances are spawned by |jobstart()| with their stdin/stdout/stderr
|
*on_stdout*
|
||||||
connected to nvim.
|
Arguments passed to on_stdout callback:
|
||||||
- The first shell is idle, waiting to read commands from its stdin.
|
0: |job-id|
|
||||||
- The second shell is started with the -c argument, causing it to execute a
|
1: List of lines read from the stream. If the last item is not "" (empty
|
||||||
command then exit. In this case, the command is a for loop that will print 0
|
string), then it is an incomplete line that might be continued at the
|
||||||
through 9 then exit.
|
next on_stdout invocation. See Note 2 below.
|
||||||
- The `JobHandler()` function is a callback passed to |jobstart()| to handle
|
2: Event type: "stdout"
|
||||||
various job events. It takes care of displaying stdout/stderr received from
|
*on_stderr*
|
||||||
the shells.
|
Arguments passed to on_stderr callback:
|
||||||
- The arguments passed to `JobHandler()` are:
|
0: |job-id|
|
||||||
|
1: List of lines read from the stream. If the last item is not "" (empty
|
||||||
0: The job id
|
string), then it is an incomplete line that might be continued at the
|
||||||
1: If the event is "stdout" or "stderr", a list with lines read from the
|
next on_stderr invocation. See Note 2 below.
|
||||||
corresponding stream. For "exit", it is the status returned by the
|
2: Event type: "stderr"
|
||||||
program.
|
*on_exit*
|
||||||
2: The event type, which is "stdout", "stderr" or "exit".
|
Arguments passed to on_exit callback:
|
||||||
|
0: |job-id|
|
||||||
|
1: Exit-code of the process.
|
||||||
|
2: Event type: "exit"
|
||||||
|
|
||||||
Note: Buffered stdout/stderr data which has not been flushed by the sender
|
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
|
will not trigger the on_stdout/on_stderr callback (but if the process
|
||||||
"exit" callback will be triggered).
|
ends, the on_exit callback will be invoked).
|
||||||
For example, "ruby -e" buffers output, so small strings will be
|
For example, "ruby -e" buffers output, so small strings will be
|
||||||
buffered unless "auto-flushing" ($stdout.sync=true) is enabled. >
|
buffered unless "auto-flushing" ($stdout.sync=true) is enabled. >
|
||||||
function! Receive(job_id, data, event)
|
function! Receive(job_id, data, event)
|
||||||
@@ -96,54 +92,58 @@ Here's what is happening:
|
|||||||
\ {'on_stdout': 'Receive'})
|
\ {'on_stdout': 'Receive'})
|
||||||
< https://github.com/neovim/neovim/issues/1592
|
< https://github.com/neovim/neovim/issues/1592
|
||||||
|
|
||||||
The options dictionary is passed as the "self" variable to the callback
|
Note 2:
|
||||||
function. Here's a more object-oriented version of the above:
|
Job event handlers may receive partial (incomplete) lines. For a given
|
||||||
>
|
invocation of on_stdout/on_stderr, `a:data` is not guaranteed to end
|
||||||
|
with a newline.
|
||||||
|
- `abcdefg` may arrive as `['abc']`, `['defg']`.
|
||||||
|
- `abc\nefg` may arrive as `['abc', '']`, `['efg']` or `['abc']`,
|
||||||
|
`['','efg']`, or even `['ab']`, `['c','efg']`.
|
||||||
|
Easy way to deal with this: initialize a list as `['']`, then append
|
||||||
|
to it as follows: >
|
||||||
|
let s:chunks = ['']
|
||||||
|
func! s:on_stdout(job_id, data, event) dict
|
||||||
|
let s:chunks[-1] .= a:data[0]
|
||||||
|
call extend(s:chunks, a:data[1:])
|
||||||
|
endf
|
||||||
|
<
|
||||||
|
|
||||||
|
The |jobstart-options| dictionary is passed as |self| to the callback.
|
||||||
|
The above example could be written in this "object-oriented" style: >
|
||||||
|
|
||||||
let Shell = {}
|
let Shell = {}
|
||||||
|
|
||||||
function Shell.on_stdout(job_id, data) dict
|
function Shell.on_stdout(_job_id, data, event)
|
||||||
call append(line('$'), self.get_name().' stdout: '.join(a:data))
|
call append(line('$'),
|
||||||
|
\ printf('[%s] %s: %s', a:event, self.name, join(a:data[:-2])))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function Shell.on_stderr(job_id, data) dict
|
let Shell.on_stderr = function(Shell.on_stdout)
|
||||||
call append(line('$'), self.get_name().' stderr: '.join(a:data))
|
|
||||||
|
function Shell.on_exit(job_id, _data, event)
|
||||||
|
let msg = printf('job %d ("%s") finished', a:job_id, self.name)
|
||||||
|
call append(line('$'), printf('[%s] BOOM!', a:event))
|
||||||
|
call append(line('$'), printf('[%s] %s!', a:event, msg))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function Shell.on_exit(job_id, data) dict
|
function Shell.new(name, cmd)
|
||||||
call append(line('$'), self.get_name().' exited')
|
let object = extend(copy(g:Shell), {'name': a:name})
|
||||||
|
let object.cmd = ['sh', '-c', a:cmd]
|
||||||
|
let object.id = jobstart(object.cmd, object)
|
||||||
|
$
|
||||||
|
return object
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function Shell.get_name() dict
|
let instance = Shell.new('bomb',
|
||||||
return 'shell '.self.name
|
\ 'for i in $(seq 9 -1 1); do echo $i 1>&$((i % 2 + 1)); sleep 1; done')
|
||||||
endfunction
|
<
|
||||||
|
To send data to the job's stdin, use |jobsend()|: >
|
||||||
function Shell.new(name, ...) dict
|
|
||||||
let instance = extend(copy(g:Shell), {'name': a:name})
|
|
||||||
let argv = ['bash']
|
|
||||||
if a:0 > 0
|
|
||||||
let argv += ['-c', a:1]
|
|
||||||
endif
|
|
||||||
let instance.id = jobstart(argv, instance)
|
|
||||||
return instance
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
let s1 = Shell.new('1')
|
|
||||||
let s2 = Shell.new('2', 'for i in {1..10}; do echo hello $i!; sleep 1; done')
|
|
||||||
|
|
||||||
|
|
||||||
To send data to the job's stdin, one can use the |jobsend()| function, like
|
|
||||||
this:
|
|
||||||
>
|
|
||||||
:call jobsend(job1, "ls\n")
|
:call jobsend(job1, "ls\n")
|
||||||
:call jobsend(job1, "invalid-command\n")
|
:call jobsend(job1, "invalid-command\n")
|
||||||
:call jobsend(job1, "exit\n")
|
:call jobsend(job1, "exit\n")
|
||||||
<
|
<
|
||||||
A job may be killed at any time with the |jobstop()| function:
|
A job may be killed with |jobstop()|: >
|
||||||
>
|
|
||||||
:call jobstop(job1)
|
:call jobstop(job1)
|
||||||
<
|
<
|
||||||
When |jobstop()| is called, `SIGTERM` will be sent to the job. If a job does
|
|
||||||
not exit after 2 seconds, `SIGKILL` will be sent.
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||||
|
@@ -9,13 +9,13 @@ Key mapping, abbreviations and user-defined commands.
|
|||||||
This subject is introduced in sections |05.3|, |24.7| and |40.1| of the user
|
This subject is introduced in sections |05.3|, |24.7| and |40.1| of the user
|
||||||
manual.
|
manual.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Key mapping *key-mapping* *mapping* *macro*
|
1. Key mapping *key-mapping* *mapping* *macro*
|
||||||
|
|
||||||
Key mapping is used to change the meaning of typed keys. The most common use
|
Key mapping is used to change the meaning of typed keys. The most common use
|
||||||
is to define a sequence commands for a function key. Example: >
|
is to define a sequence of commands for a function key. Example: >
|
||||||
|
|
||||||
:map <F2> a<C-R>=strftime("%c")<CR><Esc>
|
:map <F2> a<C-R>=strftime("%c")<CR><Esc>
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ modes.
|
|||||||
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
|
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
|
||||||
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
|
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
|
||||||
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
|
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
|
||||||
:tm[ap] {lhs} {rhs} |mapmode-t| *:tm* *:tmap*
|
:tma[p] {lhs} {rhs} |mapmode-t| *:tma* *:tmap*
|
||||||
Map the key sequence {lhs} to {rhs} for the modes
|
Map the key sequence {lhs} to {rhs} for the modes
|
||||||
where the map command applies. The result, including
|
where the map command applies. The result, including
|
||||||
{rhs}, is then further scanned for mappings. This
|
{rhs}, is then further scanned for mappings. This
|
||||||
@@ -75,7 +75,7 @@ modes.
|
|||||||
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
|
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
|
||||||
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
|
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
|
||||||
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
|
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
|
||||||
:tu[nmap] {lhs} |mapmode-t| *:tu* *:tunmap*
|
:tunma[p] {lhs} |mapmode-t| *:tunma* *:tunmap*
|
||||||
Remove the mapping of {lhs} for the modes where the
|
Remove the mapping of {lhs} for the modes where the
|
||||||
map command applies. The mapping may remain defined
|
map command applies. The mapping may remain defined
|
||||||
for other modes where it applies.
|
for other modes where it applies.
|
||||||
@@ -111,7 +111,7 @@ modes.
|
|||||||
:im[ap] |mapmode-i|
|
:im[ap] |mapmode-i|
|
||||||
:lm[ap] |mapmode-l|
|
:lm[ap] |mapmode-l|
|
||||||
:cm[ap] |mapmode-c|
|
:cm[ap] |mapmode-c|
|
||||||
:tm[ap] |mapmode-t|
|
:tma[p] |mapmode-t|
|
||||||
List all key mappings for the modes where the map
|
List all key mappings for the modes where the map
|
||||||
command applies. Note that ":map" and ":map!" are
|
command applies. Note that ":map" and ":map!" are
|
||||||
used most often, because they include the other modes.
|
used most often, because they include the other modes.
|
||||||
@@ -126,7 +126,7 @@ modes.
|
|||||||
:im[ap] {lhs} |mapmode-i| *:imap_l*
|
:im[ap] {lhs} |mapmode-i| *:imap_l*
|
||||||
:lm[ap] {lhs} |mapmode-l| *:lmap_l*
|
:lm[ap] {lhs} |mapmode-l| *:lmap_l*
|
||||||
:cm[ap] {lhs} |mapmode-c| *:cmap_l*
|
:cm[ap] {lhs} |mapmode-c| *:cmap_l*
|
||||||
:tm[ap] {lhs} |mapmode-t| *:tmap_l*
|
:tma[p] {lhs} |mapmode-t| *:tmap_l*
|
||||||
List the key mappings for the key sequences starting
|
List the key mappings for the key sequences starting
|
||||||
with {lhs} in the modes where the map command applies.
|
with {lhs} in the modes where the map command applies.
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ type "a", then "bar" will get inserted.
|
|||||||
|
|
||||||
1.2 SPECIAL ARGUMENTS *:map-arguments*
|
1.2 SPECIAL ARGUMENTS *:map-arguments*
|
||||||
|
|
||||||
"<buffer>", "<nowait>", "<silent>", "<special>", "<script>", "<expr>" and
|
"<buffer>", "<nowait>", "<silent>", "<script>", "<expr>" and
|
||||||
"<unique>" can be used in any order. They must appear right after the
|
"<unique>" can be used in any order. They must appear right after the
|
||||||
command, before any other arguments.
|
command, before any other arguments.
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ that starts with ",". Then you need to type another character for Vim to know
|
|||||||
whether to use the "," mapping or the longer one. To avoid this add the
|
whether to use the "," mapping or the longer one. To avoid this add the
|
||||||
<nowait> argument. Then the mapping will be used when it matches, Vim does
|
<nowait> argument. Then the mapping will be used when it matches, Vim does
|
||||||
not wait for more characters to be typed. However, if the characters were
|
not wait for more characters to be typed. However, if the characters were
|
||||||
already type they are used.
|
already typed they are used.
|
||||||
|
|
||||||
*:map-<silent>* *:map-silent*
|
*:map-<silent>* *:map-silent*
|
||||||
To define a mapping which will not be echoed on the command line, add
|
To define a mapping which will not be echoed on the command line, add
|
||||||
@@ -189,12 +189,6 @@ Prompts will still be given, e.g., for inputdialog().
|
|||||||
Using "<silent>" for an abbreviation is possible, but will cause redrawing of
|
Using "<silent>" for an abbreviation is possible, but will cause redrawing of
|
||||||
the command line to fail.
|
the command line to fail.
|
||||||
|
|
||||||
*:map-<special>* *:map-special*
|
|
||||||
Define a mapping with <> notation for special keys, even though the "<" flag
|
|
||||||
may appear in 'cpoptions'. This is useful if the side effect of setting
|
|
||||||
'cpoptions' is not desired. Example: >
|
|
||||||
:map <special> <F12> /Header<CR>
|
|
||||||
<
|
|
||||||
*:map-<script>* *:map-script*
|
*:map-<script>* *:map-script*
|
||||||
If the first argument to one of these commands is "<script>" and it is used to
|
If the first argument to one of these commands is "<script>" and it is used to
|
||||||
define a new mapping or abbreviation, the mapping will only remap characters
|
define a new mapping or abbreviation, the mapping will only remap characters
|
||||||
@@ -443,17 +437,15 @@ There are two ways to map a special key:
|
|||||||
1. The Vi-compatible method: Map the key code. Often this is a sequence that
|
1. The Vi-compatible method: Map the key code. Often this is a sequence that
|
||||||
starts with <Esc>. To enter a mapping like this you type ":map " and then
|
starts with <Esc>. To enter a mapping like this you type ":map " and then
|
||||||
you have to type CTRL-V before hitting the function key. Note that when
|
you have to type CTRL-V before hitting the function key. Note that when
|
||||||
the key code for the key is in the termcap, it will automatically be
|
the key code for the key is in the |terminfo| entry, it will automatically
|
||||||
translated into the internal code and become the second way of mapping
|
be translated into the internal code and become the second way of mapping.
|
||||||
(unless the 'k' flag is included in 'cpoptions').
|
|
||||||
2. The second method is to use the internal code for the function key. To
|
2. The second method is to use the internal code for the function key. To
|
||||||
enter such a mapping type CTRL-K and then hit the function key, or use
|
enter such a mapping type CTRL-K and then hit the function key, or use
|
||||||
the form "#1", "#2", .. "#9", "#0", "<Up>", "<S-Down>", "<S-F7>", etc.
|
the form "#1", "#2", .. "#9", "#0", "<Up>", "<S-Down>", "<S-F7>", etc.
|
||||||
(see table of keys |key-notation|, all keys from <Up> can be used). The
|
(see table of keys |key-notation|, all keys from <Up> can be used). The
|
||||||
first ten function keys can be defined in two ways: Just the number, like
|
first ten function keys can be defined in two ways: Just the number, like
|
||||||
"#2", and with "<F>", like "<F2>". Both stand for function key 2. "#0"
|
"#2", and with "<F>", like "<F2>". Both stand for function key 2. "#0"
|
||||||
refers to function key 10. The <> form cannot be used when 'cpoptions'
|
refers to function key 10.
|
||||||
includes the '<' flag.
|
|
||||||
|
|
||||||
DETAIL: Vim first checks if a sequence from the keyboard is mapped. If it
|
DETAIL: Vim first checks if a sequence from the keyboard is mapped. If it
|
||||||
isn't the terminal key codes are tried. If a terminal code is found it is
|
isn't the terminal key codes are tried. If a terminal code is found it is
|
||||||
@@ -564,16 +556,17 @@ Upper and lowercase differences are ignored.
|
|||||||
|
|
||||||
*map-comments*
|
*map-comments*
|
||||||
It is not possible to put a comment after these commands, because the '"'
|
It is not possible to put a comment after these commands, because the '"'
|
||||||
character is considered to be part of the {lhs} or {rhs}.
|
character is considered to be part of the {lhs} or {rhs}. However, one can
|
||||||
|
use |", since this starts a new, empty command with a comment.
|
||||||
|
|
||||||
*map_bar* *map-bar*
|
*map_bar* *map-bar*
|
||||||
Since the '|' character is used to separate a map command from the next
|
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}.
|
command, you will have to do something special to include a '|' in {rhs}.
|
||||||
There are three methods:
|
There are three methods:
|
||||||
use works when example ~
|
use works when example ~
|
||||||
<Bar> '<' is not in 'cpoptions' :map _l :!ls <Bar> more^M
|
<Bar> always :map _l :!ls <Bar> more^M
|
||||||
\| 'b' is not in 'cpoptions' :map _l :!ls \| more^M
|
\| 'b' is not in 'cpoptions' :map _l :!ls \| more^M
|
||||||
^V| always, in Vim and Vi :map _l :!ls ^V| more^M
|
^V| always :map _l :!ls ^V| more^M
|
||||||
|
|
||||||
(here ^V stands for CTRL-V; to get one CTRL-V you have to type it twice; you
|
(here ^V stands for CTRL-V; to get one CTRL-V you have to type it twice; you
|
||||||
cannot use the <> notation "<C-V>" here).
|
cannot use the <> notation "<C-V>" here).
|
||||||
@@ -628,8 +621,7 @@ out about, ^D is CTRL-D).
|
|||||||
|
|
||||||
1.8 EXAMPLES *map-examples*
|
1.8 EXAMPLES *map-examples*
|
||||||
|
|
||||||
A few examples (given as you type them, for "<CR>" you type four characters;
|
A few examples (as you type them: for "<CR>" you type four characters). >
|
||||||
the '<' flag must not be present in 'cpoptions' for this to work). >
|
|
||||||
|
|
||||||
:map <F3> o#include
|
:map <F3> o#include
|
||||||
:map <M-g> /foo<CR>cwbar<Esc>
|
:map <M-g> /foo<CR>cwbar<Esc>
|
||||||
@@ -881,7 +873,6 @@ character is mostly ignored otherwise.
|
|||||||
|
|
||||||
It is possible to move the cursor after an abbreviation: >
|
It is possible to move the cursor after an abbreviation: >
|
||||||
:iab if if ()<Left>
|
:iab if if ()<Left>
|
||||||
This does not work if 'cpoptions' includes the '<' flag. |<>|
|
|
||||||
|
|
||||||
You can even do more complicated things. For example, to consume the space
|
You can even do more complicated things. For example, to consume the space
|
||||||
typed after an abbreviation: >
|
typed after an abbreviation: >
|
||||||
@@ -1029,8 +1020,7 @@ functions used in one script use the same name as in other scripts. To avoid
|
|||||||
this, they can be made local to the script.
|
this, they can be made local to the script.
|
||||||
|
|
||||||
*<SID>* *<SNR>* *E81*
|
*<SID>* *<SNR>* *E81*
|
||||||
The string "<SID>" can be used in a mapping or menu. This requires that the
|
The string "<SID>" can be used in a mapping or menu.
|
||||||
'<' flag is not present in 'cpoptions'.
|
|
||||||
When executing the map command, Vim will replace "<SID>" with the special
|
When executing the map command, Vim will replace "<SID>" with the special
|
||||||
key code <SNR>, followed by a number that's unique for the script, and an
|
key code <SNR>, followed by a number that's unique for the script, and an
|
||||||
underscore. Example: >
|
underscore. Example: >
|
||||||
@@ -1213,6 +1203,7 @@ completion can be enabled:
|
|||||||
-complete=locale locale names (as output of locale -a)
|
-complete=locale locale names (as output of locale -a)
|
||||||
-complete=mapping mapping name
|
-complete=mapping mapping name
|
||||||
-complete=menu menus
|
-complete=menu menus
|
||||||
|
-complete=messages |:messages| suboptions
|
||||||
-complete=option options
|
-complete=option options
|
||||||
-complete=packadd optional package |pack-add| names
|
-complete=packadd optional package |pack-add| names
|
||||||
-complete=shellcmd Shell command
|
-complete=shellcmd Shell command
|
||||||
|
@@ -14,7 +14,7 @@ For an introduction to the most common features, see |usr_45.txt| in the user
|
|||||||
manual.
|
manual.
|
||||||
For changing the language of messages and menus see |mlang.txt|.
|
For changing the language of messages and menus see |mlang.txt|.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Getting started *mbyte-first*
|
Getting started *mbyte-first*
|
||||||
|
@@ -8,7 +8,7 @@ This file contains an alphabetical list of messages and error messages that
|
|||||||
Vim produces. You can use this if you don't understand what the message
|
Vim produces. You can use this if you don't understand what the message
|
||||||
means. It is not complete though.
|
means. It is not complete though.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Old messages *:messages* *:mes* *message-history*
|
1. Old messages *:messages* *:mes* *message-history*
|
||||||
@@ -449,12 +449,6 @@ changed. To avoid the message reset the 'warn' option.
|
|||||||
Something inside Vim went wrong and resulted in a NULL pointer. If you know
|
Something inside Vim went wrong and resulted in a NULL pointer. If you know
|
||||||
how to reproduce this problem, please report it. |bugs|
|
how to reproduce this problem, please report it. |bugs|
|
||||||
|
|
||||||
*E172* >
|
|
||||||
Only one file name allowed
|
|
||||||
|
|
||||||
The ":edit" command only accepts one file name. When you want to specify
|
|
||||||
several files for editing use ":next" |:next|.
|
|
||||||
|
|
||||||
*E41* *E82* *E83* *E342* >
|
*E41* *E82* *E83* *E342* >
|
||||||
Out of memory!
|
Out of memory!
|
||||||
Out of memory! (allocating {number} bytes)
|
Out of memory! (allocating {number} bytes)
|
||||||
@@ -631,6 +625,9 @@ starts. It can be fixed in one of these ways:
|
|||||||
- Just write the file again the next day. Or set your clock to the next day,
|
- Just write the file again the next day. Or set your clock to the next day,
|
||||||
write the file twice and set the clock back.
|
write the file twice and set the clock back.
|
||||||
|
|
||||||
|
If you get W11 all the time, you may need to disable "Acronis Active
|
||||||
|
Protection" or register Vim as a trusted service/application.
|
||||||
|
|
||||||
*W12* >
|
*W12* >
|
||||||
Warning: File "{filename}" has changed and the buffer was changed in Vim as well
|
Warning: File "{filename}" has changed and the buffer was changed in Vim as well
|
||||||
|
|
||||||
@@ -750,6 +747,13 @@ a user-defined command.
|
|||||||
You tried to set an option after startup that only allows changes during
|
You tried to set an option after startup that only allows changes during
|
||||||
startup.
|
startup.
|
||||||
|
|
||||||
|
*E943* >
|
||||||
|
Command table needs to be updated, run 'make cmdidxs'
|
||||||
|
|
||||||
|
This can only happen when changing the source code, when adding a command in
|
||||||
|
src/ex_cmds.h. The lookup table then needs to be updated, by running: >
|
||||||
|
make cmdidxs
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
3. Messages *messages*
|
3. Messages *messages*
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@ multi-byte text see |multibyte|.
|
|||||||
|
|
||||||
The basics are explained in the user manual: |usr_45.txt|.
|
The basics are explained in the user manual: |usr_45.txt|.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Messages *multilang-messages*
|
1. Messages *multilang-messages*
|
||||||
@@ -172,6 +172,7 @@ Send an e-mail to the Vim maintainer <maintainer@vim.org>.
|
|||||||
special characters like "&" and "<Tab>" need to be
|
special characters like "&" and "<Tab>" need to be
|
||||||
included. Spaces and dots need to be escaped with a
|
included. Spaces and dots need to be escaped with a
|
||||||
backslash, just like in other |:menu| commands.
|
backslash, just like in other |:menu| commands.
|
||||||
|
Case in {english} is ignored.
|
||||||
|
|
||||||
See the $VIMRUNTIME/lang directory for examples.
|
See the $VIMRUNTIME/lang directory for examples.
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@ The 'virtualedit' option can be set to make it possible to move the cursor to
|
|||||||
positions where there is no character or within a multi-column character (like
|
positions where there is no character or within a multi-column character (like
|
||||||
a tab).
|
a tab).
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Motions and operators *operator*
|
1. Motions and operators *operator*
|
||||||
@@ -184,7 +184,7 @@ l or *l*
|
|||||||
|
|
||||||
*$* *<End>* *<kEnd>*
|
*$* *<End>* *<kEnd>*
|
||||||
$ or <End> To the end of the line. When a count is given also go
|
$ or <End> To the end of the line. When a count is given also go
|
||||||
[count - 1] lines downward |inclusive|.
|
[count - 1] lines downward. |inclusive| motion.
|
||||||
In Visual mode the cursor goes to just after the last
|
In Visual mode the cursor goes to just after the last
|
||||||
character in the line.
|
character in the line.
|
||||||
When 'virtualedit' is active, "$" may move the cursor
|
When 'virtualedit' is active, "$" may move the cursor
|
||||||
@@ -886,6 +886,7 @@ was made yet in the current file.
|
|||||||
then the position can be near the end of what the
|
then the position can be near the end of what the
|
||||||
command changed. For example when inserting a word,
|
command changed. For example when inserting a word,
|
||||||
the position will be on the last character.
|
the position will be on the last character.
|
||||||
|
To jump to older changes use |g;|.
|
||||||
|
|
||||||
*'(* *`(*
|
*'(* *`(*
|
||||||
'( `( To the start of the current sentence, like the |(|
|
'( `( To the start of the current sentence, like the |(|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
RPC API for Nvim *RPC* *rpc* *msgpack-rpc*
|
RPC API for Nvim *RPC* *rpc* *msgpack-rpc*
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Introduction *rpc-intro*
|
1. Introduction *rpc-intro*
|
||||||
@@ -175,7 +175,7 @@ contains information that makes this task easier (see also |rpc-types|):
|
|||||||
even more strongly-typed APIs.
|
even more strongly-typed APIs.
|
||||||
- Functions that are considered to be methods that operate on instances of
|
- Functions that are considered to be methods that operate on instances of
|
||||||
Nvim special types (msgpack EXT) will have the `"method"` attribute set to
|
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
|
`true`. The receiver type is the type of the first argument. The method
|
||||||
names are prefixed with `nvim_` plus a shortened type name, e.g.
|
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.
|
`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
|
- Global functions have `"method"` set to `false` and are prefixed with just
|
||||||
@@ -243,203 +243,4 @@ 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
|
the type codes, because a client may be built against one Nvim version but
|
||||||
connect to another with different type codes.
|
connect to another with different type codes.
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
6. Remote UIs *rpc-remote-ui*
|
|
||||||
|
|
||||||
GUIs can be implemented as external processes communicating with Nvim over the
|
|
||||||
RPC API. The UI model consists of a terminal-like grid with a single,
|
|
||||||
monospace font size. Some elements (UI "widgets") can be drawn separately from
|
|
||||||
the grid ("externalized").
|
|
||||||
|
|
||||||
After connecting to Nvim (usually a spawned, embedded instance) use the
|
|
||||||
|nvim_ui_attach| API method to tell Nvim that your program wants to draw the
|
|
||||||
Nvim screen on a grid of width × height cells. `options` must be
|
|
||||||
a dictionary with these (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).
|
|
||||||
`ext_popupmenu` Externalize the popupmenu. |ui-ext-popupmenu|
|
|
||||||
`ext_tabline` Externalize the tabline. |ui-ext-tabline|
|
|
||||||
Externalized widgets will not be drawn by
|
|
||||||
Nvim; only high-level data will be published
|
|
||||||
in new UI event kinds.
|
|
||||||
|
|
||||||
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 in the same "redraw" event are processed
|
|
||||||
(not any intermediate state after processing only a part of the array).
|
|
||||||
|
|
||||||
Future versions of Nvim may add new update kinds and may append new parameters
|
|
||||||
to existing update kinds. Clients must be prepared to ignore such extensions
|
|
||||||
to be forward-compatible. |api-contract|
|
|
||||||
|
|
||||||
Screen updates are tuples whose first element is the string name of the update
|
|
||||||
kind.
|
|
||||||
|
|
||||||
["resize", width, height]
|
|
||||||
The grid is resized to `width` and `height` cells.
|
|
||||||
|
|
||||||
["clear"]
|
|
||||||
Clear the screen.
|
|
||||||
|
|
||||||
["eol_clear"]
|
|
||||||
Clear from the cursor position to the end of the current line.
|
|
||||||
|
|
||||||
["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.
|
|
||||||
|
|
||||||
["update_fg", color]
|
|
||||||
["update_bg", color]
|
|
||||||
["update_sp", color]
|
|
||||||
Set the default foreground, background and special colors
|
|
||||||
respectively.
|
|
||||||
|
|
||||||
["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_info_set", cursor_style_enabled, mode_info]
|
|
||||||
`cursor_style_enabled` is a boolean indicating if the UI should set the cursor
|
|
||||||
style. `mode_info` is a list of mode property maps. The current mode is given
|
|
||||||
by the `mode_idx` field of the `mode_change` event.
|
|
||||||
|
|
||||||
Each mode property map may contain these keys:
|
|
||||||
KEY DESCRIPTION ~
|
|
||||||
`cursor_shape`: "block", "horizontal", "vertical"
|
|
||||||
`cell_percentage`: Cell % occupied by the cursor.
|
|
||||||
`blinkwait`, `blinkon`, `blinkoff`: See |cursor-blinking|.
|
|
||||||
`hl_id`: Cursor highlight group.
|
|
||||||
`hl_lm`: Cursor highlight group if 'langmap' is active.
|
|
||||||
`short_name`: Mode code name, see 'guicursor'.
|
|
||||||
`name`: Mode descriptive name.
|
|
||||||
`mouse_shape`: (To be implemented.)
|
|
||||||
|
|
||||||
Some keys are missing in some modes.
|
|
||||||
|
|
||||||
["mode_change", mode, mode_idx]
|
|
||||||
The mode changed. The first parameter `mode` is a string representing the
|
|
||||||
current mode. `mode_idx` is an index into the array received in the
|
|
||||||
`mode_info_set` event. UIs should change the cursor style according to the
|
|
||||||
properties specified in the corresponding item. The set of modes reported will
|
|
||||||
change in new versions of Nvim, for instance more submodes and temporary
|
|
||||||
states might be represented as separate modes.
|
|
||||||
|
|
||||||
*ui-ext-popupmenu*
|
|
||||||
["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.
|
|
||||||
|
|
||||||
*ui-ext-tabline*
|
|
||||||
["tabline_update", curtab, tabs]
|
|
||||||
Tabline was updated. UIs should present this data in a custom tabline
|
|
||||||
widget.
|
|
||||||
curtab: Current Tabpage
|
|
||||||
tabs: List of Dicts [{ "tab": Tabpage, "name": String }, ...]
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
|
||||||
|
@@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
Nvim *nvim* *nvim-intro*
|
Nvim *nvim* *nvim-intro*
|
||||||
|
|
||||||
|
Nvim is based on Vim by Bram Moolenaar.
|
||||||
|
|
||||||
If you are new to Vim see |help.txt|, or type ":Tutor".
|
If you are new to Vim see |help.txt|, or type ":Tutor".
|
||||||
If you already use Vim see |nvim-from-vim| for a quickstart.
|
If you already use Vim see |nvim-from-vim| for a quickstart.
|
||||||
|
|
||||||
@@ -13,15 +15,15 @@ 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
|
maintained where possible. See |vim_diff.txt| for the complete reference of
|
||||||
differences from Vim.
|
differences from Vim.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Transitioning from Vim *nvim-from-vim*
|
Transitioning from Vim *nvim-from-vim*
|
||||||
|
|
||||||
To start the transition, create `~/.config/nvim/init.vim` with these contents:
|
To start the transition, create ~/.config/nvim/init.vim with these contents:
|
||||||
>
|
>
|
||||||
set runtimepath+=~/.vim,~/.vim/after
|
set runtimepath^=~/.vim runtimepath+=~/.vim/after
|
||||||
set packpath+=~/.vim
|
let &packpath = &runtimepath
|
||||||
source ~/.vimrc
|
source ~/.vimrc
|
||||||
<
|
<
|
||||||
Note: If your system sets `$XDG_CONFIG_HOME`, use that instead of `~/.config`
|
Note: If your system sets `$XDG_CONFIG_HOME`, use that instead of `~/.config`
|
||||||
|
@@ -4,21 +4,24 @@
|
|||||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||||
|
|
||||||
|
|
||||||
Terminal emulator *terminal-emulator*
|
Terminal emulator *terminal* *terminal-emulator*
|
||||||
|
|
||||||
Nvim embeds a VT220/xterm terminal emulator based on libvterm. The terminal is
|
Nvim embeds a VT220/xterm terminal emulator based on libvterm. The terminal is
|
||||||
presented as a special buffer type, asynchronously updated from the virtual
|
presented as a special buffer type, asynchronously updated from the virtual
|
||||||
terminal as data is received from the program connected to it.
|
terminal as data is received from the program connected to it.
|
||||||
|
|
||||||
Terminal buffers behave mostly like normal 'nomodifiable' buffers, except:
|
Terminal buffers behave like normal buffers, except:
|
||||||
- Plugins can set 'modifiable' to modify text, but lines cannot be deleted.
|
- With 'modifiable', lines can be edited but not deleted.
|
||||||
- 'scrollback' controls how many off-screen lines are kept.
|
- 'scrollback' controls how many lines are kept.
|
||||||
- Terminal output is followed if the cursor is on the last line.
|
- Output is followed if the cursor is on the last line.
|
||||||
|
- 'modified' is the default. You can set 'nomodified' to avoid a warning when
|
||||||
|
closing the terminal buffer.
|
||||||
|
- 'bufhidden' defaults to "hide".
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Spawning *terminal-emulator-spawning*
|
Start *terminal-start*
|
||||||
|
|
||||||
There are 3 ways to create a terminal buffer:
|
There are 3 ways to create a terminal buffer:
|
||||||
|
|
||||||
@@ -35,37 +38,42 @@ There are 3 ways to create a terminal buffer:
|
|||||||
autocmd VimEnter * nested split term://sh
|
autocmd VimEnter * nested split term://sh
|
||||||
< This is only mentioned for reference; use |:terminal| instead.
|
< This is only mentioned for reference; use |:terminal| instead.
|
||||||
|
|
||||||
When the terminal spawns the program, the buffer will start to mirror the
|
When the terminal starts, the buffer contents are updated and the buffer is
|
||||||
terminal display and change its name to `term://{cwd}//{pid}:{cmd}`.
|
named in the form of `term://{cwd}//{pid}:{cmd}`. This naming scheme is used
|
||||||
The "term://..." scheme enables |:mksession| to "restore" a terminal buffer by
|
by |:mksession| to restore a terminal buffer (by restarting the {cmd}).
|
||||||
restarting the {cmd} when the session is loaded.
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Input *terminal-emulator-input*
|
Input *terminal-input*
|
||||||
|
|
||||||
To send input, enter terminal mode using any command that would enter "insert
|
To send input, enter |Terminal-mode| using any command that would enter "insert
|
||||||
mode" in a normal buffer, such as |i| or |:startinsert|. In this mode all keys
|
mode" in a normal buffer, such as |i| or |:startinsert|. In this mode all keys
|
||||||
except <C-\><C-N> are sent to the underlying program. Use <C-\><C-N> to return
|
except <C-\><C-N> are sent to the underlying program. Use <C-\><C-N> to return
|
||||||
to normal mode. |CTRL-\_CTRL-N|
|
to normal-mode. |CTRL-\_CTRL-N|
|
||||||
|
|
||||||
Terminal mode has its own |:tnoremap| namespace for mappings, this can be used
|
Terminal-mode has its own |:tnoremap| namespace for mappings, this can be used
|
||||||
to automate any terminal interaction. To map <Esc> to exit terminal mode: >
|
to automate any terminal interaction.
|
||||||
|
|
||||||
|
To map <Esc> to exit terminal-mode: >
|
||||||
:tnoremap <Esc> <C-\><C-n>
|
:tnoremap <Esc> <C-\><C-n>
|
||||||
<
|
|
||||||
Navigating to other windows is only possible in normal mode. For convenience,
|
To simulate |i_CTRL-R| in terminal-mode: >
|
||||||
you could use these mappings: >
|
:tnoremap <expr> <C-R> '<C-\><C-N>"'.nr2char(getchar()).'pi'
|
||||||
:tnoremap <A-h> <C-\><C-n><C-w>h
|
|
||||||
:tnoremap <A-j> <C-\><C-n><C-w>j
|
To use `ALT+{h,j,k,l}` to navigate windows from any mode: >
|
||||||
:tnoremap <A-k> <C-\><C-n><C-w>k
|
:tnoremap <A-h> <C-\><C-N><C-w>h
|
||||||
:tnoremap <A-l> <C-\><C-n><C-w>l
|
:tnoremap <A-j> <C-\><C-N><C-w>j
|
||||||
|
:tnoremap <A-k> <C-\><C-N><C-w>k
|
||||||
|
:tnoremap <A-l> <C-\><C-N><C-w>l
|
||||||
|
:inoremap <A-h> <C-\><C-N><C-w>h
|
||||||
|
:inoremap <A-j> <C-\><C-N><C-w>j
|
||||||
|
:inoremap <A-k> <C-\><C-N><C-w>k
|
||||||
|
:inoremap <A-l> <C-\><C-N><C-w>l
|
||||||
:nnoremap <A-h> <C-w>h
|
:nnoremap <A-h> <C-w>h
|
||||||
:nnoremap <A-j> <C-w>j
|
:nnoremap <A-j> <C-w>j
|
||||||
:nnoremap <A-k> <C-w>k
|
:nnoremap <A-k> <C-w>k
|
||||||
:nnoremap <A-l> <C-w>l
|
:nnoremap <A-l> <C-w>l
|
||||||
<
|
|
||||||
Then you can use `Alt+{h,j,k,l}` to navigate between windows from any mode.
|
|
||||||
|
|
||||||
Mouse input is supported, and has the following behavior:
|
Mouse input has the following behavior:
|
||||||
|
|
||||||
- If the program has enabled mouse events, the corresponding events will be
|
- If the program has enabled mouse events, the corresponding events will be
|
||||||
forwarded to the program.
|
forwarded to the program.
|
||||||
@@ -77,23 +85,31 @@ Mouse input is supported, and has the following behavior:
|
|||||||
the terminal wont lose focus and the hovered window will be scrolled.
|
the terminal wont lose focus and the hovered window will be scrolled.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Configuration *terminal-emulator-configuration*
|
Configuration *terminal-configuration*
|
||||||
|
|
||||||
Options: 'scrollback'
|
Options: 'modified', 'scrollback'
|
||||||
Events: |TermOpen|, |TermClose|
|
Events: |TermOpen|, |TermClose|
|
||||||
Highlight groups: |hl-TermCursor|, |hl-TermCursorNC|
|
Highlight groups: |hl-TermCursor|, |hl-TermCursorNC|
|
||||||
|
|
||||||
Terminal colors can be customized with these variables:
|
Terminal sets local defaults for some options, which may differ from your
|
||||||
|
global configuration.
|
||||||
|
|
||||||
- `{g,b}:terminal_color_$NUM`: The terminal color palette, where `$NUM` is the
|
- 'list' is disabled
|
||||||
color index, between 0 and 255 inclusive. This setting only affects UIs with
|
- 'wrap' is disabled
|
||||||
RGB capabilities; for normal terminals the color index is simply forwarded.
|
- 'relativenumber' is disabled in |Terminal-mode| (and cannot be enabled)
|
||||||
|
|
||||||
The `{g,b}:terminal_color_$NUM` variables are processed only when the terminal
|
You can change the defaults with a TermOpen autocommand: >
|
||||||
starts (after |TermOpen|).
|
au TermOpen * setlocal list
|
||||||
|
|
||||||
|
TERMINAL COLORS ~
|
||||||
|
|
||||||
|
The `{g,b}:terminal_color_$NUM` variables control the terminal color palette,
|
||||||
|
where `$NUM` is the color index between 0 and 255 inclusive. This setting only
|
||||||
|
affects UIs with RGB capabilities; for normal terminals the color index is
|
||||||
|
just forwarded. The variables are read only during |TermOpen|.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Status Variables *terminal-emulator-status*
|
Status Variables *terminal-status*
|
||||||
|
|
||||||
Terminal buffers maintain some information about the terminal in buffer-local
|
Terminal buffers maintain some information about the terminal in buffer-local
|
||||||
variables:
|
variables:
|
||||||
|
@@ -14,7 +14,7 @@ achieve special effects. These options come in three forms:
|
|||||||
number has a numeric value
|
number has a numeric value
|
||||||
string has a string value
|
string has a string value
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Setting options *set-option* *E764*
|
1. Setting options *set-option* *E764*
|
||||||
@@ -22,12 +22,7 @@ achieve special effects. These options come in three forms:
|
|||||||
*:se* *:set*
|
*:se* *:set*
|
||||||
:se[t] Show all options that differ from their default value.
|
:se[t] Show all options that differ from their default value.
|
||||||
|
|
||||||
:se[t] all Show all but terminal options.
|
:se[t] all Show all options.
|
||||||
|
|
||||||
:se[t] termcap Show all terminal options. Note that in the GUI the
|
|
||||||
key codes are not shown, because they are generated
|
|
||||||
internally and can't be changed. Changing the terminal
|
|
||||||
codes in the GUI is not useful either...
|
|
||||||
|
|
||||||
*E518* *E519*
|
*E518* *E519*
|
||||||
:se[t] {option}? Show value of {option}.
|
:se[t] {option}? Show value of {option}.
|
||||||
@@ -192,7 +187,7 @@ opt+=val" the expansion is done before the adding or removing.
|
|||||||
Handling of local options *local-options*
|
Handling of local options *local-options*
|
||||||
|
|
||||||
Some of the options only apply to a window or buffer. Each window or buffer
|
Some of the options only apply to a window or buffer. Each window or buffer
|
||||||
has its own copy of this option, thus can each have their own value. This
|
has its own copy of this option, thus each can have its own value. This
|
||||||
allows you to set 'list' in one window but not in another. And set
|
allows you to set 'list' in one window but not in another. And set
|
||||||
'shiftwidth' to 3 in one buffer and 4 in another.
|
'shiftwidth' to 3 in one buffer and 4 in another.
|
||||||
|
|
||||||
@@ -316,7 +311,7 @@ Note: In the future more global options can be made global-local. Using
|
|||||||
|
|
||||||
Setting the filetype
|
Setting the filetype
|
||||||
|
|
||||||
:setf[iletype] {filetype} *:setf* *:setfiletype*
|
:setf[iletype] [FALLBACK] {filetype} *:setf* *:setfiletype*
|
||||||
Set the 'filetype' option to {filetype}, but only if
|
Set the 'filetype' option to {filetype}, but only if
|
||||||
not done yet in a sequence of (nested) autocommands.
|
not done yet in a sequence of (nested) autocommands.
|
||||||
This is short for: >
|
This is short for: >
|
||||||
@@ -327,6 +322,12 @@ Setting the filetype
|
|||||||
setting the 'filetype' option twice, causing different
|
setting the 'filetype' option twice, causing different
|
||||||
settings and syntax files to be loaded.
|
settings and syntax files to be loaded.
|
||||||
|
|
||||||
|
When the optional FALLBACK argument is present, a
|
||||||
|
later :setfiletype command will override the
|
||||||
|
'filetype'. This is to used for filetype detections
|
||||||
|
that are just a guess. |did_filetype()| will return
|
||||||
|
false after this command.
|
||||||
|
|
||||||
*option-window* *optwin*
|
*option-window* *optwin*
|
||||||
:bro[wse] se[t] *:set-browse* *:browse-set* *:opt* *:options*
|
:bro[wse] se[t] *:set-browse* *:browse-set* *:opt* *:options*
|
||||||
:opt[ions] Open a window for viewing and setting all options.
|
:opt[ions] Open a window for viewing and setting all options.
|
||||||
@@ -353,12 +354,23 @@ On Unix systems the form "${HOME}" can be used too. The name between {} can
|
|||||||
contain non-id characters then. Note that if you want to use this for the
|
contain non-id characters then. Note that if you want to use this for the
|
||||||
"gf" command, you need to add the '{' and '}' characters to 'isfname'.
|
"gf" command, you need to add the '{' and '}' characters to 'isfname'.
|
||||||
|
|
||||||
On MS-Windows, if $HOME is not defined as an environment variable, then
|
|
||||||
at runtime Vim will set it to the expansion of $HOMEDRIVE$HOMEPATH.
|
|
||||||
|
|
||||||
NOTE: expanding environment variables and "~/" is only done with the ":set"
|
NOTE: expanding environment variables and "~/" is only done with the ":set"
|
||||||
command, not when assigning a value to an option with ":let".
|
command, not when assigning a value to an option with ":let".
|
||||||
|
|
||||||
|
*$HOME-windows*
|
||||||
|
On MS-Windows, if $HOME is not defined as an environment variable, then
|
||||||
|
at runtime Vim will set it to the expansion of $HOMEDRIVE$HOMEPATH.
|
||||||
|
If $HOMEDRIVE is not set then $USERPROFILE is used.
|
||||||
|
|
||||||
|
This expanded value is not exported to the environment, this matters when
|
||||||
|
running an external command: >
|
||||||
|
:echo system('set | findstr ^HOME=')
|
||||||
|
and >
|
||||||
|
:echo luaeval('os.getenv("HOME")')
|
||||||
|
should echo nothing (an empty string) despite exists('$HOME') being true.
|
||||||
|
When setting $HOME to a non-empty string it will be exported to the
|
||||||
|
subprocesses.
|
||||||
|
|
||||||
|
|
||||||
Note the maximum length of an expanded option is limited. How much depends on
|
Note the maximum length of an expanded option is limited. How much depends on
|
||||||
the system, mostly it is something like 256 or 1024 characters.
|
the system, mostly it is something like 256 or 1024 characters.
|
||||||
@@ -716,6 +728,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
< Vim will guess the value. In the GUI this should work correctly,
|
< Vim will guess the value. In the GUI this should work correctly,
|
||||||
in other cases Vim might not be able to guess the right value.
|
in other cases Vim might not be able to guess the right value.
|
||||||
|
|
||||||
|
When the |t_RB| option is set, Vim will use it to request the background
|
||||||
|
color from the terminal. If the returned RGB value is dark/light and
|
||||||
|
'background' is not dark/light, 'background' will be set and the
|
||||||
|
screen is redrawn. This may have side effects, make t_BG empty in
|
||||||
|
your .vimrc if you suspect this problem. The response to |t_RB| can
|
||||||
|
be found in |v:termrbgresp|.
|
||||||
|
|
||||||
When starting the GUI, the default value for 'background' will be
|
When starting the GUI, the default value for 'background' will be
|
||||||
"light". When the value is not set in the gvimrc, and Vim detects
|
"light". When the value is not set in the gvimrc, and Vim detects
|
||||||
that the background is actually quite dark, 'background' is set to
|
that the background is actually quite dark, 'background' is set to
|
||||||
@@ -964,8 +983,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
wildmode More matches in |cmdline-completion| available
|
wildmode More matches in |cmdline-completion| available
|
||||||
(depends on the 'wildmode' setting).
|
(depends on the 'wildmode' setting).
|
||||||
|
|
||||||
This is most useful, to fine tune when in insert mode the bell should
|
This is most useful to fine tune when in Insert mode the bell should
|
||||||
be rung. For normal mode and ex commands, the bell is often rung to
|
be rung. For Normal mode and Ex commands, the bell is often rung to
|
||||||
indicate that an error occurred. It can be silenced by adding the
|
indicate that an error occurred. It can be silenced by adding the
|
||||||
"error" keyword.
|
"error" keyword.
|
||||||
|
|
||||||
@@ -1300,27 +1319,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
will additionally copy the text into register
|
will additionally copy the text into register
|
||||||
'*'. See |clipboard|.
|
'*'. See |clipboard|.
|
||||||
|
|
||||||
*clipboard-autoselect*
|
|
||||||
autoselect Works like the 'a' flag in 'guioptions': If present,
|
|
||||||
then whenever Visual mode is started, or the Visual
|
|
||||||
area extended, Vim tries to become the owner of the
|
|
||||||
windowing system's global selection or put the
|
|
||||||
selected text on the clipboard used by the selection
|
|
||||||
register "*. See |guioptions_a| and |quotestar| for
|
|
||||||
details. When the GUI is active, the 'a' flag in
|
|
||||||
'guioptions' is used, when the GUI is not active, this
|
|
||||||
"autoselect" flag is used.
|
|
||||||
Also applies to the modeless selection.
|
|
||||||
|
|
||||||
*clipboard-autoselectplus*
|
|
||||||
autoselectplus Like "autoselect" but using the + register instead of
|
|
||||||
the * register. Compare to the 'P' flag in
|
|
||||||
'guioptions'.
|
|
||||||
|
|
||||||
*clipboard-autoselectml*
|
|
||||||
autoselectml Like "autoselect", but for the modeless selection
|
|
||||||
only. Compare to the 'A' flag in 'guioptions'.
|
|
||||||
|
|
||||||
*'cmdheight'* *'ch'*
|
*'cmdheight'* *'ch'*
|
||||||
'cmdheight' 'ch' number (default 1)
|
'cmdheight' 'ch' number (default 1)
|
||||||
global
|
global
|
||||||
@@ -1571,7 +1569,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
results in X being mapped to:
|
results in X being mapped to:
|
||||||
'B' included: "\^[" (^[ is a real <Esc>)
|
'B' included: "\^[" (^[ is a real <Esc>)
|
||||||
'B' excluded: "<Esc>" (5 characters)
|
'B' excluded: "<Esc>" (5 characters)
|
||||||
('<' excluded in both cases)
|
|
||||||
*cpo-c*
|
*cpo-c*
|
||||||
c Searching continues at the end of any match at the
|
c Searching continues at the end of any match at the
|
||||||
cursor position, but not further than the start of the
|
cursor position, but not further than the start of the
|
||||||
@@ -1621,15 +1618,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
J A |sentence| has to be followed by two spaces after
|
J A |sentence| has to be followed by two spaces after
|
||||||
the '.', '!' or '?'. A <Tab> is not recognized as
|
the '.', '!' or '?'. A <Tab> is not recognized as
|
||||||
white space.
|
white space.
|
||||||
*cpo-k*
|
|
||||||
k Disable the recognition of raw key codes in
|
|
||||||
mappings, abbreviations, and the "to" part of menu
|
|
||||||
commands. For example, if <Key> sends ^[OA (where ^[
|
|
||||||
is <Esc>), the command ":map X ^[OA" results in X
|
|
||||||
being mapped to:
|
|
||||||
'k' included: "^[OA" (3 characters)
|
|
||||||
'k' excluded: "<Key>" (one key code)
|
|
||||||
Also see the '<' flag below.
|
|
||||||
*cpo-K*
|
*cpo-K*
|
||||||
K Don't wait for a key code to complete when it is
|
K Don't wait for a key code to complete when it is
|
||||||
halfway through a mapping. This breaks mapping
|
halfway through a mapping. This breaks mapping
|
||||||
@@ -1763,14 +1751,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
+ When included, a ":write file" command will reset the
|
+ When included, a ":write file" command will reset the
|
||||||
'modified' flag of the buffer, even though the buffer
|
'modified' flag of the buffer, even though the buffer
|
||||||
itself may still be different from its file.
|
itself may still be different from its file.
|
||||||
*cpo-<*
|
|
||||||
< Disable the recognition of special key codes in |<>|
|
|
||||||
form in mappings, abbreviations, and the "to" part of
|
|
||||||
menu commands. For example, the command
|
|
||||||
":map X <Tab>" results in X being mapped to:
|
|
||||||
'<' included: "<Tab>" (5 characters)
|
|
||||||
'<' excluded: "^I" (^I is a real <Tab>)
|
|
||||||
Also see the 'k' flag above.
|
|
||||||
*cpo->*
|
*cpo->*
|
||||||
> When appending to a register, put a line break before
|
> When appending to a register, put a line break before
|
||||||
the appended text.
|
the appended text.
|
||||||
@@ -2756,14 +2736,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'guicursor'* *'gcr'* *E545* *E546* *E548* *E549*
|
*'guicursor'* *'gcr'* *E545* *E546* *E548* *E549*
|
||||||
'guicursor' 'gcr' string (default "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20")
|
'guicursor' 'gcr' string (default "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20")
|
||||||
global
|
global
|
||||||
Configures the cursor style for each mode. Works in the GUI and some
|
Configures the cursor style for each mode. Works in the GUI and many
|
||||||
terminals.
|
terminals. See |tui-cursor-shape|.
|
||||||
|
|
||||||
With tmux you might need this in ~/.tmux.conf (see terminal-overrides
|
To disable cursor-styling, reset the option: >
|
||||||
in the tmux(1) manual page): >
|
|
||||||
set -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
|
|
||||||
|
|
||||||
< To disable cursor-styling, reset the option: >
|
|
||||||
:set guicursor=
|
:set guicursor=
|
||||||
|
|
||||||
< To enable mode shapes, "Cursor" highlight, and blinking: >
|
< To enable mode shapes, "Cursor" highlight, and blinking: >
|
||||||
@@ -2994,7 +2970,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
that this flag must be added in the vimrc file, before
|
that this flag must be added in the vimrc file, before
|
||||||
switching on syntax or filetype recognition (when the |gvimrc|
|
switching on syntax or filetype recognition (when the |gvimrc|
|
||||||
file is sourced the system menu has already been loaded; the
|
file is sourced the system menu has already been loaded; the
|
||||||
":syntax on" and ":filetype on" commands load the menu too).
|
`:syntax on` and `:filetype on` commands load the menu too).
|
||||||
*'go-g'*
|
*'go-g'*
|
||||||
'g' Grey menu items: Make menu items that are not active grey. If
|
'g' Grey menu items: Make menu items that are not active grey. If
|
||||||
'g' is not included inactive menu items are not shown at all.
|
'g' is not included inactive menu items are not shown at all.
|
||||||
@@ -3044,6 +3020,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
|
|
||||||
The format of this option is like that of 'statusline'.
|
The format of this option is like that of 'statusline'.
|
||||||
'guitabtooltip' is used for the tooltip, see below.
|
'guitabtooltip' is used for the tooltip, see below.
|
||||||
|
The expression will be evaluated in the |sandbox| when set from a
|
||||||
|
modeline, see |sandbox-option|.
|
||||||
|
|
||||||
Only used when the GUI tab pages line is displayed. 'e' must be
|
Only used when the GUI tab pages line is displayed. 'e' must be
|
||||||
present in 'guioptions'. For the non-GUI tab pages line 'tabline' is
|
present in 'guioptions'. For the non-GUI tab pages line 'tabline' is
|
||||||
@@ -3119,106 +3097,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
WARNING: It's easy to forget that you have changes in hidden buffers.
|
WARNING: It's easy to forget that you have changes in hidden buffers.
|
||||||
Think twice when using ":q!" or ":qa!".
|
Think twice when using ":q!" or ":qa!".
|
||||||
|
|
||||||
*'highlight'* *'hl'*
|
|
||||||
'highlight' 'hl' string (default: string of "c:group,..." pairs)
|
|
||||||
global
|
|
||||||
This option can be used to set highlighting mode for various
|
|
||||||
occasions. It is a comma separated list of character pairs. The
|
|
||||||
first character in a pair gives the occasion, the second the mode to
|
|
||||||
use for that occasion. The occasions are:
|
|
||||||
|hl-SpecialKey| 8 Meta and special keys listed with ":map"
|
|
||||||
|hl-Whitespace| 0
|
|
||||||
|hl-EndOfBuffer| ~ lines after the last line in the buffer
|
|
||||||
|hl-TermCursor| z Cursor in a focused terminal
|
|
||||||
|hl-TermCursorNC| Z Cursor in an unfocused terminal
|
|
||||||
|hl-NonText| @ '@' at the end of the window and
|
|
||||||
characters from 'showbreak'
|
|
||||||
|hl-Directory| d directories in CTRL-D listing and other special
|
|
||||||
things in listings
|
|
||||||
|hl-ErrorMsg| e error messages
|
|
||||||
|hl-IncSearch| i 'incsearch' highlighting
|
|
||||||
|hl-Search| l last search pattern highlighting (see 'hlsearch')
|
|
||||||
|hl-MoreMsg| m |more-prompt|
|
|
||||||
|hl-ModeMsg| M Mode (e.g., "-- INSERT --")
|
|
||||||
|hl-LineNr| n line number for ":number" and ":#" commands, and
|
|
||||||
when 'number' or 'relativenumber' option is set.
|
|
||||||
|hl-CursorLineNr| N like n for when 'cursorline' or 'relativenumber' is
|
|
||||||
set.
|
|
||||||
|hl-Question| r |hit-enter| prompt and yes/no questions
|
|
||||||
|hl-StatusLine| s status line of current window |status-line|
|
|
||||||
|hl-StatusLineNC| S status lines of not-current windows
|
|
||||||
|hl-Title| t Titles for output from ":set all", ":autocmd" etc.
|
|
||||||
|hl-VertSplit| c column used to separate vertically split windows
|
|
||||||
|hl-Visual| v Visual mode
|
|
||||||
|hl-WarningMsg| w warning messages
|
|
||||||
|hl-WildMenu| W wildcard matches displayed for 'wildmenu'
|
|
||||||
|hl-Folded| f line used for closed folds
|
|
||||||
|hl-FoldColumn| F 'foldcolumn'
|
|
||||||
|hl-DiffAdd| A added line in diff mode
|
|
||||||
|hl-DiffChange| C changed line in diff mode
|
|
||||||
|hl-DiffDelete| D deleted line in diff mode
|
|
||||||
|hl-DiffText| T inserted text in diff mode
|
|
||||||
|hl-SignColumn| > column used for |signs|
|
|
||||||
|hl-SpellBad| B misspelled word |spell|
|
|
||||||
|hl-SpellCap| P word that should start with capital |spell|
|
|
||||||
|hl-SpellRare| R rare word |spell|
|
|
||||||
|hl-SpellLocal| L word from other region |spell|
|
|
||||||
|hl-Conceal| - the placeholders used for concealed characters
|
|
||||||
(see 'conceallevel')
|
|
||||||
|hl-Pmenu| + popup menu normal line
|
|
||||||
|hl-PmenuSel| = popup menu normal line
|
|
||||||
|hl-PmenuSbar| x popup menu scrollbar
|
|
||||||
|hl-PmenuThumb| X popup menu scrollbar thumb
|
|
||||||
|
|
||||||
|hl-TabLine| *
|
|
||||||
|hl-TabLineFill| _
|
|
||||||
|hl-TabLineSel| #
|
|
||||||
|
|
||||||
|hl-ColorColumn| o
|
|
||||||
|hl-CursorColumn| !
|
|
||||||
|hl-CursorLine| .
|
|
||||||
|hl-QuickFixLine| q
|
|
||||||
|
|
||||||
The display modes are:
|
|
||||||
r reverse (termcap entry "mr" and "me")
|
|
||||||
i italic (termcap entry "ZH" and "ZR")
|
|
||||||
b bold (termcap entry "md" and "me")
|
|
||||||
s standout (termcap entry "so" and "se")
|
|
||||||
u underline (termcap entry "us" and "ue")
|
|
||||||
c undercurl (termcap entry "Cs" and "Ce")
|
|
||||||
n no highlighting
|
|
||||||
- no highlighting
|
|
||||||
: use a highlight group
|
|
||||||
The default is used for occasions that are not included.
|
|
||||||
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
|
|
||||||
define one. The default uses a different group for each occasion.
|
|
||||||
See |highlight-default| for the default highlight groups.
|
|
||||||
|
|
||||||
*'hlsearch'* *'hls'* *'nohlsearch'* *'nohls'*
|
|
||||||
'hlsearch' 'hls' boolean (default on)
|
|
||||||
global
|
|
||||||
{not available when compiled without the
|
|
||||||
|+extra_search| feature}
|
|
||||||
When there is a previous search pattern, highlight all its matches.
|
|
||||||
The type of highlighting used can be set with the 'l' occasion in the
|
|
||||||
'highlight' option. This uses the "Search" highlight group by
|
|
||||||
default. Note that only the matching text is highlighted, any offsets
|
|
||||||
are not applied.
|
|
||||||
See also: 'incsearch' and |:match|.
|
|
||||||
When you get bored looking at the highlighted matches, you can turn it
|
|
||||||
off with |:nohlsearch|. This does not change the option value, as
|
|
||||||
soon as you use a search command, the highlighting comes back.
|
|
||||||
'redrawtime' specifies the maximum time spent on finding matches.
|
|
||||||
When the search pattern can match an end-of-line, Vim will try to
|
|
||||||
highlight all of the matched text. However, this depends on where the
|
|
||||||
search starts. This will be the first line in the window or the first
|
|
||||||
line below a closed fold. A match in a previous line which is not
|
|
||||||
drawn may not continue in a newly drawn line.
|
|
||||||
You can specify whether the highlight status is restored on startup
|
|
||||||
with the 'h' flag in 'shada' |shada-h|.
|
|
||||||
|
|
||||||
*'history'* *'hi'*
|
*'history'* *'hi'*
|
||||||
'history' 'hi' number (Vim default: 10000, Vi default: 0)
|
'history' 'hi' number (Vim default: 10000, Vi default: 0)
|
||||||
global
|
global
|
||||||
@@ -3241,6 +3119,27 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
This is useful if you have a non-Hebrew keyboard.
|
This is useful if you have a non-Hebrew keyboard.
|
||||||
See |rileft.txt|.
|
See |rileft.txt|.
|
||||||
|
|
||||||
|
*'hlsearch'* *'hls'* *'nohlsearch'* *'nohls'*
|
||||||
|
'hlsearch' 'hls' boolean (default on)
|
||||||
|
global
|
||||||
|
{not available when compiled without the
|
||||||
|
|+extra_search| feature}
|
||||||
|
When there is a previous search pattern, highlight all its matches.
|
||||||
|
The |hl-Search| highlight group determines the highlighting. Note that
|
||||||
|
only the matching text is highlighted, any offsets are not applied.
|
||||||
|
See also: 'incsearch' and |:match|.
|
||||||
|
When you get bored looking at the highlighted matches, you can turn it
|
||||||
|
off with |:nohlsearch|. This does not change the option value, as
|
||||||
|
soon as you use a search command, the highlighting comes back.
|
||||||
|
'redrawtime' specifies the maximum time spent on finding matches.
|
||||||
|
When the search pattern can match an end-of-line, Vim will try to
|
||||||
|
highlight all of the matched text. However, this depends on where the
|
||||||
|
search starts. This will be the first line in the window or the first
|
||||||
|
line below a closed fold. A match in a previous line which is not
|
||||||
|
drawn may not continue in a newly drawn line.
|
||||||
|
You can specify whether the highlight status is restored on startup
|
||||||
|
with the 'h' flag in 'shada' |shada-h|.
|
||||||
|
|
||||||
*'icon'* *'noicon'*
|
*'icon'* *'noicon'*
|
||||||
'icon' boolean (default off, on when title can be restored)
|
'icon' boolean (default off, on when title can be restored)
|
||||||
global
|
global
|
||||||
@@ -3395,7 +3294,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
Vim only searches for about half a second. With a complicated
|
Vim only searches for about half a second. With a complicated
|
||||||
pattern and/or a lot of text the match may not be found. This is to
|
pattern and/or a lot of text the match may not be found. This is to
|
||||||
avoid that Vim hangs while you are typing the pattern.
|
avoid that Vim hangs while you are typing the pattern.
|
||||||
The highlighting can be set with the 'i' flag in 'highlight'.
|
The |hl-IncSearch| highlight group determines the highlighting.
|
||||||
See also: 'hlsearch'.
|
See also: 'hlsearch'.
|
||||||
CTRL-L can be used to add one character from after the current match
|
CTRL-L can be used to add one character from after the current match
|
||||||
to the command line. If 'ignorecase' and 'smartcase' are set and the
|
to the command line. If 'ignorecase' and 'smartcase' are set and the
|
||||||
@@ -3940,7 +3839,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
:au FileType c,cpp,java set mps+==:;
|
:au FileType c,cpp,java set mps+==:;
|
||||||
|
|
||||||
< For a more advanced way of using "%", see the matchit.vim plugin in
|
< For a more advanced way of using "%", see the matchit.vim plugin in
|
||||||
the $VIMRUNTIME/macros directory. |add-local-help|
|
the $VIMRUNTIME/plugin directory. |add-local-help|
|
||||||
|
|
||||||
*'matchtime'* *'mat'*
|
*'matchtime'* *'mat'*
|
||||||
'matchtime' 'mat' number (default 5)
|
'matchtime' 'mat' number (default 5)
|
||||||
@@ -4116,7 +4015,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
listing continues until finished.
|
listing continues until finished.
|
||||||
|
|
||||||
*'mouse'* *E538*
|
*'mouse'* *E538*
|
||||||
'mouse' string (default "a")
|
'mouse' string (default "")
|
||||||
global
|
global
|
||||||
|
|
||||||
Enable the use of the mouse. Only works for certain terminals.
|
Enable the use of the mouse. Only works for certain terminals.
|
||||||
@@ -4440,7 +4339,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
Note that typing <F10> in paste mode inserts "<F10>", since in paste
|
Note that typing <F10> in paste mode inserts "<F10>", since in paste
|
||||||
mode everything is inserted literally, except the 'pastetoggle' key
|
mode everything is inserted literally, except the 'pastetoggle' key
|
||||||
sequence.
|
sequence.
|
||||||
When the value has several bytes 'ttimeoutlen' applies.
|
No timeout is used, this means that a multi-key 'pastetoggle' can not
|
||||||
|
be triggered manually.
|
||||||
|
|
||||||
*'pex'* *'patchexpr'*
|
*'pex'* *'patchexpr'*
|
||||||
'patchexpr' 'pex' string (default "")
|
'patchexpr' 'pex' string (default "")
|
||||||
@@ -4580,6 +4480,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
and |+postscript| features}
|
and |+postscript| features}
|
||||||
Expression used to print the PostScript produced with |:hardcopy|.
|
Expression used to print the PostScript produced with |:hardcopy|.
|
||||||
See |pexpr-option|.
|
See |pexpr-option|.
|
||||||
|
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||||
|
security reasons.
|
||||||
|
|
||||||
*'printfont'* *'pfn'*
|
*'printfont'* *'pfn'*
|
||||||
'printfont' 'pfn' string (default "courier")
|
'printfont' 'pfn' string (default "courier")
|
||||||
@@ -4887,12 +4789,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
height with ":set scroll=0".
|
height with ":set scroll=0".
|
||||||
|
|
||||||
*'scrollback'* *'scbk'*
|
*'scrollback'* *'scbk'*
|
||||||
'scrollback' 'scbk' number (default: 1000
|
'scrollback' 'scbk' number (default: 10000
|
||||||
in normal buffers: -1)
|
in normal buffers: -1)
|
||||||
local to buffer
|
local to buffer
|
||||||
Maximum number of lines kept beyond the visible screen. Lines at the
|
Maximum number of lines kept beyond the visible screen. Lines at the
|
||||||
top are deleted if new lines exceed this limit.
|
top are deleted if new lines exceed this limit.
|
||||||
Only in |terminal-emulator| buffers. 'buftype'
|
Only in |terminal| buffers.
|
||||||
-1 means "unlimited" for normal buffers, 100000 otherwise.
|
-1 means "unlimited" for normal buffers, 100000 otherwise.
|
||||||
Minimum is 1.
|
Minimum is 1.
|
||||||
|
|
||||||
@@ -5440,8 +5342,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
< Only printable single-cell characters are allowed, excluding <Tab> and
|
< Only printable single-cell characters are allowed, excluding <Tab> and
|
||||||
comma (in a future version the comma might be used to separate the
|
comma (in a future version the comma might be used to separate the
|
||||||
part that is shown at the end and at the start of a line).
|
part that is shown at the end and at the start of a line).
|
||||||
The characters are highlighted according to the '@' flag in
|
The |hl-NonText| highlight group determines the highlighting.
|
||||||
'highlight'.
|
|
||||||
Note that tabs after the showbreak will be displayed differently.
|
Note that tabs after the showbreak will be displayed differently.
|
||||||
If you want the 'showbreak' to appear in between line numbers, add the
|
If you want the 'showbreak' to appear in between line numbers, add the
|
||||||
"n" flag to 'cpoptions'.
|
"n" flag to 'cpoptions'.
|
||||||
@@ -5496,10 +5397,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
'showmode' 'smd' boolean (Vim default: on, Vi default: off)
|
'showmode' 'smd' boolean (Vim default: on, Vi default: off)
|
||||||
global
|
global
|
||||||
If in Insert, Replace or Visual mode put a message on the last line.
|
If in Insert, Replace or Visual mode put a message on the last line.
|
||||||
Use the 'M' flag in 'highlight' to set the type of highlighting for
|
The |hl-ModeMsg| highlight group determines the highlighting.
|
||||||
this message.
|
|
||||||
When |XIM| may be used the message will include "XIM". But this
|
|
||||||
doesn't mean XIM is really active.
|
|
||||||
|
|
||||||
*'showtabline'* *'stal'*
|
*'showtabline'* *'stal'*
|
||||||
'showtabline' 'stal' number (default 1)
|
'showtabline' 'stal' number (default 1)
|
||||||
@@ -5762,7 +5660,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
word. The expression must evaluate to a List of
|
word. The expression must evaluate to a List of
|
||||||
Lists, each with a suggestion and a score.
|
Lists, each with a suggestion and a score.
|
||||||
Example:
|
Example:
|
||||||
[['the', 33], ['that', 44]]
|
[['the', 33], ['that', 44]] ~
|
||||||
Set 'verbose' and use |z=| to see the scores that the
|
Set 'verbose' and use |z=| to see the scores that the
|
||||||
internal methods use. A lower score is better.
|
internal methods use. A lower score is better.
|
||||||
This may invoke |spellsuggest()| if you temporarily
|
This may invoke |spellsuggest()| if you temporarily
|
||||||
@@ -6343,7 +6241,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
for any key that can follow <c-f> in a mapping.
|
for any key that can follow <c-f> in a mapping.
|
||||||
|
|
||||||
*'ttimeout'* *'nottimeout'*
|
*'ttimeout'* *'nottimeout'*
|
||||||
'ttimeout' boolean (default off)
|
'ttimeout' boolean (default on)
|
||||||
global
|
global
|
||||||
This option and 'ttimeoutlen' determine the behavior when part of a
|
This option and 'ttimeoutlen' determine the behavior when part of a
|
||||||
key code sequence has been received by the terminal UI. For example,
|
key code sequence has been received by the terminal UI. For example,
|
||||||
@@ -6358,18 +6256,18 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
complete.
|
complete.
|
||||||
|
|
||||||
*'ttimeoutlen'* *'ttm'*
|
*'ttimeoutlen'* *'ttm'*
|
||||||
'ttimeoutlen' 'ttm' number (default -1)
|
'ttimeoutlen' 'ttm' number (default 50)
|
||||||
global
|
global
|
||||||
The time in milliseconds that is waited for a key code
|
The time in milliseconds that is waited for a key code
|
||||||
sequence to complete. Also used for CTRL-\ CTRL-N and CTRL-\ CTRL-G
|
sequence to complete. Also used for CTRL-\ CTRL-N and CTRL-\ CTRL-G
|
||||||
when part of a command has been typed.
|
when part of a command has been typed.
|
||||||
|
|
||||||
*'title'* *'notitle'*
|
*'title'* *'notitle'*
|
||||||
'title' boolean (default off, on when title can be restored)
|
'title' boolean (default off)
|
||||||
global
|
global
|
||||||
When on, the title of the window will be set to the value of
|
When on, the title of the window will be set to the value of
|
||||||
'titlestring' (if it is not empty), or to:
|
'titlestring' (if it is not empty), or to:
|
||||||
filename [+=-] (path) - VIM
|
filename [+=-] (path) - NVIM
|
||||||
Where:
|
Where:
|
||||||
filename the name of the file being edited
|
filename the name of the file being edited
|
||||||
- indicates the file cannot be modified, 'ma' off
|
- indicates the file cannot be modified, 'ma' off
|
||||||
@@ -6377,7 +6275,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
= indicates the file is read-only
|
= indicates the file is read-only
|
||||||
=+ indicates the file is read-only and modified
|
=+ indicates the file is read-only and modified
|
||||||
(path) is the path of the file being edited
|
(path) is the path of the file being edited
|
||||||
- VIM the server name |v:servername| or "VIM"
|
- NVIM the server name |v:servername| or "NVIM"
|
||||||
|
|
||||||
*'titlelen'*
|
*'titlelen'*
|
||||||
'titlelen' number (default 85)
|
'titlelen' number (default 85)
|
||||||
@@ -6393,11 +6291,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
'titlelen' is also used for the 'titlestring' option.
|
'titlelen' is also used for the 'titlestring' option.
|
||||||
|
|
||||||
*'titleold'*
|
*'titleold'*
|
||||||
'titleold' string (default "Thanks for flying Vim")
|
'titleold' string (default "")
|
||||||
global
|
global
|
||||||
This option will be used for the window title when exiting Vim if the
|
If not empty, this option will be used to set the window title when
|
||||||
original title cannot be restored. Only happens if 'title' is on or
|
exiting. Only if 'title' is enabled.
|
||||||
'titlestring' is not empty.
|
|
||||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||||
security reasons.
|
security reasons.
|
||||||
*'titlestring'*
|
*'titlestring'*
|
||||||
@@ -6483,7 +6380,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
Save the whole buffer for undo when reloading it. This applies to the
|
Save the whole buffer for undo when reloading it. This applies to the
|
||||||
":e!" command and reloading for when the buffer changed outside of
|
":e!" command and reloading for when the buffer changed outside of
|
||||||
Vim. |FileChangedShell|
|
Vim. |FileChangedShell|
|
||||||
The save only happens when this options is negative or when the number
|
The save only happens when this option is negative or when the number
|
||||||
of lines is smaller than the value of this option.
|
of lines is smaller than the value of this option.
|
||||||
Set this option to zero to disable undo for a reload.
|
Set this option to zero to disable undo for a reload.
|
||||||
|
|
||||||
@@ -6556,7 +6453,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
security reasons.
|
security reasons.
|
||||||
|
|
||||||
*'viewoptions'* *'vop'*
|
*'viewoptions'* *'vop'*
|
||||||
'viewoptions' 'vop' string (default: "folds,options,cursor")
|
'viewoptions' 'vop' string (default: "folds,options,cursor,curdir")
|
||||||
global
|
global
|
||||||
{not available when compiled without the |+mksession|
|
{not available when compiled without the |+mksession|
|
||||||
feature}
|
feature}
|
||||||
@@ -6564,6 +6461,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
list of words. Each word enables saving and restoring something:
|
list of words. Each word enables saving and restoring something:
|
||||||
word save and restore ~
|
word save and restore ~
|
||||||
cursor cursor position in file and in window
|
cursor cursor position in file and in window
|
||||||
|
curdir local current directory, if set with |:lcd|
|
||||||
folds manually created folds, opened/closed folds and local
|
folds manually created folds, opened/closed folds and local
|
||||||
fold options
|
fold options
|
||||||
options options and mappings local to a window or buffer (not
|
options options and mappings local to a window or buffer (not
|
||||||
@@ -6843,6 +6741,24 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
'winheight' applies to the current window. Use 'winminheight' to set
|
'winheight' applies to the current window. Use 'winminheight' to set
|
||||||
the minimal height for other windows.
|
the minimal height for other windows.
|
||||||
|
|
||||||
|
*'winhighlight'* *'winhl'*
|
||||||
|
'winhighlight' 'winhl' string (default empty)
|
||||||
|
local to window
|
||||||
|
Window-local highlights. Comma-delimited list of highlight
|
||||||
|
|group-name| pairs "{hl-builtin}:{hl},..." where each {hl-builtin} is
|
||||||
|
a built-in |highlight-groups| item to be overridden by {hl} group in
|
||||||
|
the window. Only built-in |highlight-groups| are supported, not
|
||||||
|
syntax highlighting (use |:ownsyntax| for that).
|
||||||
|
|
||||||
|
Highlights of vertical separators are determined by the window to the
|
||||||
|
left of the separator. The highlight of a tabpage in |tabline| is
|
||||||
|
determined by the last-focused window of the tabpage. Highlights of
|
||||||
|
the popupmenu are determined by the current window. Highlights in the
|
||||||
|
message area cannot be overridden.
|
||||||
|
|
||||||
|
Example: show a different color for non-current windows: >
|
||||||
|
set winhighlight=Normal:MyNormal,NormalNC:MyNormalNC
|
||||||
|
<
|
||||||
*'winfixheight'* *'wfh'* *'nowinfixheight'* *'nowfh'*
|
*'winfixheight'* *'wfh'* *'nowinfixheight'* *'nowfh'*
|
||||||
'winfixheight' 'wfh' boolean (default off)
|
'winfixheight' 'wfh' boolean (default off)
|
||||||
local to window
|
local to window
|
||||||
|
@@ -1,179 +0,0 @@
|
|||||||
*os_win32.txt* Nvim
|
|
||||||
|
|
||||||
|
|
||||||
NVIM REFERENCE MANUAL
|
|
||||||
|
|
||||||
|
|
||||||
*win32* *Win32* *MS-Windows*
|
|
||||||
This file documents the Win32 version of Nvim.
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
1. Known problems *win32-problems*
|
|
||||||
|
|
||||||
When doing file name completion, Vim also finds matches for the short file
|
|
||||||
name. But Vim will still find and use the corresponding long file name. For
|
|
||||||
example, if you have the long file name "this_is_a_test" with the short file
|
|
||||||
name "this_i~1", the command ":e *1" will start editing "this_is_a_test".
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
2. Startup *win32-startup*
|
|
||||||
|
|
||||||
Current directory *win32-curdir*
|
|
||||||
|
|
||||||
If Vim is started with a single file name argument, and it has a full path
|
|
||||||
(starts with "x:\"), Vim assumes it was started from the file explorer and
|
|
||||||
will set the current directory to where that file is. To avoid this when
|
|
||||||
typing a command to start Vim, use a forward slash instead of a backslash.
|
|
||||||
Example: >
|
|
||||||
|
|
||||||
vim c:\text\files\foo.txt
|
|
||||||
|
|
||||||
Will change to the "C:\text\files" directory. >
|
|
||||||
|
|
||||||
vim c:/text\files\foo.txt
|
|
||||||
|
|
||||||
Will use the current directory.
|
|
||||||
|
|
||||||
|
|
||||||
Term option *win32-term*
|
|
||||||
|
|
||||||
The only kind of terminal type that the Win32 version of Vim understands is
|
|
||||||
"win32", which is built-in. If you set 'term' to anything else, you will
|
|
||||||
probably get very strange behavior from Vim. Therefore Vim does not obtain
|
|
||||||
the default value of 'term' from the environment variable "TERM".
|
|
||||||
|
|
||||||
$PATH *win32-PATH*
|
|
||||||
|
|
||||||
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*
|
|
||||||
|
|
||||||
The Win32 version of Vim supports using the mouse. If you have a two-button
|
|
||||||
mouse, the middle button can be emulated by pressing both left and right
|
|
||||||
buttons simultaneously - but note that in the Win32 GUI, if you have the right
|
|
||||||
mouse button pop-up menu enabled (see 'mouse'), you should err on the side of
|
|
||||||
pressing the left button first. |mouse-using|
|
|
||||||
|
|
||||||
When the mouse doesn't work, try disabling the "Quick Edit Mode" feature of
|
|
||||||
the console.
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
4. Win32 mini FAQ *win32-faq*
|
|
||||||
|
|
||||||
Q. How do I change the font?
|
|
||||||
A. In the GUI version, you can use the 'guifont' option. Example: >
|
|
||||||
:set guifont=Lucida_Console:h15:cDEFAULT
|
|
||||||
< In the console version, you need to set the font of the console itself.
|
|
||||||
You cannot do this from within Vim.
|
|
||||||
|
|
||||||
Q. I'm using Vim to edit a symbolically linked file on a Unix NFS file server.
|
|
||||||
When I write the file, Vim does not "write through" the symlink. Instead,
|
|
||||||
it deletes the symbolic link and creates a new file in its place. Why?
|
|
||||||
A. On Unix, Vim is prepared for links (symbolic or hard). A backup copy of
|
|
||||||
the original file is made and then the original file is overwritten. This
|
|
||||||
assures that all properties of the file remain the same. On non-Unix
|
|
||||||
systems, the original file is renamed and a new file is written. Only the
|
|
||||||
protection bits are set like the original file. However, this doesn't work
|
|
||||||
properly when working on an NFS-mounted file system where links and other
|
|
||||||
things exist. The only way to fix this in the current version is not
|
|
||||||
making a backup file, by ":set nobackup nowritebackup" |'writebackup'|
|
|
||||||
|
|
||||||
Q. I'm using Vim to edit a file on a Unix file server through Samba. When I
|
|
||||||
write the file, the owner of the file is changed. Why?
|
|
||||||
A. When writing a file Vim renames the original file, this is a backup (in
|
|
||||||
case writing the file fails halfway). Then the file is written as a new
|
|
||||||
file. Samba then gives it the default owner for the file system, which may
|
|
||||||
differ from the original owner.
|
|
||||||
To avoid this set the 'backupcopy' option to "yes". Vim will then make a
|
|
||||||
copy of the file for the backup, and overwrite the original file. The
|
|
||||||
owner isn't changed then.
|
|
||||||
|
|
||||||
Q. How do I get to see the output of ":make" while it's running?
|
|
||||||
A. Basically what you need is to put a tee program that will copy its input
|
|
||||||
(the output from make) to both stdout and to the errorfile. You can find a
|
|
||||||
copy of tee (and a number of other GNU tools) at
|
|
||||||
http://gnuwin32.sourceforge.net or http://unxutils.sourceforge.net
|
|
||||||
Alternatively, try the more recent Cygnus version of the GNU tools at
|
|
||||||
http://www.cygwin.com Other Unix-style tools for Win32 are listed at
|
|
||||||
http://directory.google.com/Top/Computers/Software/Operating_Systems/Unix/Win32/
|
|
||||||
When you do get a copy of tee, you'll need to add >
|
|
||||||
:set shellpipe=\|\ tee
|
|
||||||
< to your _vimrc.
|
|
||||||
|
|
||||||
*:!start*
|
|
||||||
Q. How can I run an external command or program asynchronously?
|
|
||||||
A. When using :! to run an external command, you can run it with "start": >
|
|
||||||
:!start winfile.exe<CR>
|
|
||||||
< Using "start" stops Vim switching to another screen, opening a new console,
|
|
||||||
or waiting for the program to complete; it indicates that you are running a
|
|
||||||
program that does not affect the files you are editing. Programs begun
|
|
||||||
with :!start do not get passed Vim's open file handles, which means they do
|
|
||||||
not have to be closed before Vim.
|
|
||||||
To avoid this special treatment, use ":! start".
|
|
||||||
There are two optional arguments (see the next Q):
|
|
||||||
/min the window will be minimized
|
|
||||||
/b no console window will be opened
|
|
||||||
You can use only one of these flags at a time. A second one will be
|
|
||||||
treated as the start of the command.
|
|
||||||
|
|
||||||
Q. How do I avoid getting a window for programs that I run asynchronously?
|
|
||||||
A. You have two possible solutions depending on what you want:
|
|
||||||
1) You may use the /min flag in order to run program in a minimized state
|
|
||||||
with no other changes. It will work equally for console and GUI
|
|
||||||
applications.
|
|
||||||
2) You can use the /b flag to run console applications without creating a
|
|
||||||
console window for them (GUI applications are not affected). But you
|
|
||||||
should use this flag only if the application you run doesn't require any
|
|
||||||
input. Otherwise it will get an EOF error because its input stream
|
|
||||||
(stdin) would be redirected to \\.\NUL (stdout and stderr too).
|
|
||||||
|
|
||||||
Example for a console application, run Exuberant ctags: >
|
|
||||||
:!start /min ctags -R .
|
|
||||||
< When it has finished you should see file named "tags" in your current
|
|
||||||
directory. You should notice the window title blinking on your taskbar.
|
|
||||||
This is more noticeable for commands that take longer.
|
|
||||||
Now delete the "tags" file and run this command: >
|
|
||||||
:!start /b ctags -R .
|
|
||||||
< You should have the same "tags" file, but this time there will be no
|
|
||||||
blinking on the taskbar.
|
|
||||||
Example for a GUI application: >
|
|
||||||
:!start /min notepad
|
|
||||||
:!start /b notepad
|
|
||||||
< The first command runs notepad minimized and the second one runs it
|
|
||||||
normally.
|
|
||||||
|
|
||||||
*windows-icon*
|
|
||||||
Q. I don't like the Vim icon, can I change it?
|
|
||||||
A. Yes, place your favorite icon in bitmaps/vim.ico in a directory of
|
|
||||||
'runtimepath'. For example ~/vimfiles/bitmaps/vim.ico.
|
|
||||||
|
|
||||||
|
|
||||||
vim:tw=78:fo=tcq2:ts=8:ft=help:norl:
|
|
@@ -9,7 +9,7 @@ Patterns and search commands *pattern-searches*
|
|||||||
The very basics can be found in section |03.9| of the user manual. A few more
|
The very basics can be found in section |03.9| of the user manual. A few more
|
||||||
explanations are in chapter 27 |usr_27.txt|.
|
explanations are in chapter 27 |usr_27.txt|.
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1. Search commands *search-commands*
|
1. Search commands *search-commands*
|
||||||
@@ -853,10 +853,13 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
|||||||
\%V Match inside the Visual area. When Visual mode has already been
|
\%V Match inside the Visual area. When Visual mode has already been
|
||||||
stopped match in the area that |gv| would reselect.
|
stopped match in the area that |gv| would reselect.
|
||||||
This is a |/zero-width| match. To make sure the whole pattern is
|
This is a |/zero-width| match. To make sure the whole pattern is
|
||||||
inside the Visual area put it at the start and end of the pattern,
|
inside the Visual area put it at the start and just before the end of
|
||||||
e.g.: >
|
the pattern, e.g.: >
|
||||||
|
/\%Vfoo.*ba\%Vr
|
||||||
|
< This also works if only "foo bar" was Visually selected. This: >
|
||||||
/\%Vfoo.*bar\%V
|
/\%Vfoo.*bar\%V
|
||||||
< Only works for the current buffer.
|
< would match "foo bar" if the Visual selection continues after the "r".
|
||||||
|
Only works for the current buffer.
|
||||||
|
|
||||||
*/\%#* *cursor-position*
|
*/\%#* *cursor-position*
|
||||||
\%# Matches with the cursor position. Only works when matching in a
|
\%# Matches with the cursor position. Only works when matching in a
|
||||||
@@ -1055,12 +1058,16 @@ x A single character, with no special meaning, matches itself
|
|||||||
":s/[/x/" searches for "[/x" and replaces it with nothing. It does
|
":s/[/x/" searches for "[/x" and replaces it with nothing. It does
|
||||||
not search for "[" and replaces it with "x"!
|
not search for "[" and replaces it with "x"!
|
||||||
|
|
||||||
|
*E944* *E945*
|
||||||
If the sequence begins with "^", it matches any single character NOT
|
If the sequence begins with "^", it matches any single character NOT
|
||||||
in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'.
|
in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'.
|
||||||
- If two characters in the sequence are separated by '-', this is
|
- If two characters in the sequence are separated by '-', this is
|
||||||
shorthand for the full list of ASCII characters between them. E.g.,
|
shorthand for the full list of ASCII characters between them. E.g.,
|
||||||
"[0-9]" matches any decimal digit. Non-ASCII characters can be
|
"[0-9]" matches any decimal digit. If the starting character exceeds
|
||||||
used, but the character values must not be more than 256 apart.
|
the ending character, e.g. [c-a], E944 occurs. Non-ASCII characters
|
||||||
|
can be used, but the character values must not be more than 256 apart
|
||||||
|
in the old regexp engine. For example, searching by [\u3000-\u4000]
|
||||||
|
after setting re=1 emits a E945 error. Prepending \%#=2 will fix it.
|
||||||
- A character class expression is evaluated to the set of characters
|
- A character class expression is evaluated to the set of characters
|
||||||
belonging to that character class. The following character classes
|
belonging to that character class. The following character classes
|
||||||
are supported:
|
are supported:
|
||||||
|
@@ -2,53 +2,45 @@
|
|||||||
|
|
||||||
Author: TJ DeVries <devries.timothyj@gmail.com>
|
Author: TJ DeVries <devries.timothyj@gmail.com>
|
||||||
|
|
||||||
Type <M-]> to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Introduction *healthcheck* *health.vim-intro*
|
Introduction *health*
|
||||||
|
|
||||||
Troubleshooting user configuration problems is a time-consuming task that
|
health.vim is a minimal framework to help with troubleshooting user
|
||||||
developers want to minimize. health.vim provides a simple framework for plugin
|
configuration. Nvim ships with healthchecks for configuration, performance,
|
||||||
authors to hook into, and for users to invoke, to check and report the user's
|
python support, ruby support, clipboard support, and more.
|
||||||
configuration and environment. Type this command to try it: >
|
|
||||||
|
|
||||||
:CheckHealth
|
To run the healthchecks, use this command: >
|
||||||
|
|
||||||
|
:checkhealth
|
||||||
<
|
<
|
||||||
For example, some users have broken or unusual Python setups, which breaks the
|
Plugin authors are encouraged to write new healthchecks. |health-dev|
|
||||||
|: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 *health-commands*
|
||||||
|
|
||||||
Commands
|
*:checkhealth* *:CheckHealth*
|
||||||
------------------------------------------------------------------------------
|
:checkhealth Run all healthchecks.
|
||||||
*:CheckHealth*
|
*E5009*
|
||||||
:CheckHealth Run all healthchecks and show the output in a new
|
Nvim depends on |$VIMRUNTIME| and 'runtimepath' to find
|
||||||
tabpage. These healthchecks are included by default:
|
the standard "runtime files" for syntax highlighting,
|
||||||
- python2
|
filetype-specific behavior, and standard plugins
|
||||||
- python3
|
(including :checkhealth). If the runtime files cannot
|
||||||
- ruby
|
be found then those features will not work.
|
||||||
- remote plugin
|
|
||||||
|
|
||||||
:CheckHealth {plugins}
|
:checkhealth {plugins}
|
||||||
Run healthchecks for one or more plugins. E.g. to run
|
Run healthcheck(s) for one or more plugins. E.g. to run
|
||||||
only the standard Nvim healthcheck: >
|
only the standard Nvim healthcheck: >
|
||||||
:CheckHealth nvim
|
:checkhealth nvim
|
||||||
< To run the healthchecks for the "foo" and "bar" plugins
|
< To run the healthchecks for the "foo" and "bar" plugins
|
||||||
(assuming these plugins are on your 'runtimepath' and
|
(assuming these plugins are on your 'runtimepath' and
|
||||||
they have implemented health#foo#check() and
|
they have implemented health#foo#check() and
|
||||||
health#bar#check(), respectively): >
|
health#bar#check(), respectively): >
|
||||||
:CheckHealth foo bar
|
:checkhealth foo bar
|
||||||
<
|
<
|
||||||
Functions
|
==============================================================================
|
||||||
------------------------------------------------------------------------------
|
Functions *health-functions*
|
||||||
|
|
||||||
health.vim functions are for creating new healthchecks. They mostly just do
|
health.vim functions are for creating new healthchecks. They mostly just do
|
||||||
some layout and formatting, to give users a consistent presentation.
|
some layout and formatting, to give users a consistent presentation.
|
||||||
@@ -59,51 +51,49 @@ health#report_start({name}) *health#report_start*
|
|||||||
per section.
|
per section.
|
||||||
|
|
||||||
health#report_info({msg}) *health#report_info*
|
health#report_info({msg}) *health#report_info*
|
||||||
Displays an informational message.
|
Reports an informational message.
|
||||||
|
|
||||||
health#report_ok({msg}) *health#report_ok*
|
health#report_ok({msg}) *health#report_ok*
|
||||||
Displays a "success" message.
|
Reports a "success" message.
|
||||||
|
|
||||||
health#report_warn({msg}, [{suggestions}]) *health#report_warn*
|
health#report_warn({msg}, [{advice}]) *health#report_warn*
|
||||||
Displays a warning. {suggestions} is an optional List of suggestions.
|
Reports a warning. {advice} is an optional List of suggestions.
|
||||||
|
|
||||||
health#report_error({msg}, [{suggestions}]) *health#report_error*
|
health#report_error({msg}, [{advice}]) *health#report_error*
|
||||||
Displays an error. {suggestions} is an optional List of suggestions.
|
Reports an error. {advice} is an optional List of suggestions.
|
||||||
|
|
||||||
health#{plugin}#check() *health.user_checker*
|
health#{plugin}#check() *health.user_checker*
|
||||||
This is the form of a healthcheck definition. Call the above functions
|
Healthcheck function for {plugin}. Called by |:checkhealth|
|
||||||
from this function, then |:CheckHealth| does the rest. Example: >
|
automatically. Example: >
|
||||||
|
|
||||||
function! health#my_plug#check() abort
|
function! health#my_plug#check() abort
|
||||||
silent call s:check_environment_vars()
|
silent call s:check_environment_vars()
|
||||||
silent call s:check_python_configuration()
|
silent call s:check_python_configuration()
|
||||||
endfunction
|
endfunction
|
||||||
<
|
<
|
||||||
The function will be found and called automatically when the user
|
|
||||||
invokes |:CheckHealth|.
|
|
||||||
|
|
||||||
All output will be captured from the healthcheck. Use the
|
All output will be captured from the healthcheck. Use the
|
||||||
health#report_* functions so that your healthcheck has a format
|
health#report_* functions so that your healthcheck has a format
|
||||||
consistent with the standard healthchecks.
|
consistent with the standard healthchecks.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Create a healthcheck *health.vim-dev*
|
Create a healthcheck *health-dev*
|
||||||
|
|
||||||
Healthchecks are functions that check the health of the system. Neovim has
|
Healthchecks are functions that check the user environment, configuration,
|
||||||
built-in checkers, found in $VIMRUNTIME/autoload/health/.
|
etc. Nvim has built-in healthchecks in $VIMRUNTIME/autoload/health/.
|
||||||
|
|
||||||
To add a new checker for your own plugin, simply define a
|
To add a new healthcheck for your own plugin, simply define a
|
||||||
health#{plugin}#check() function in autoload/health/{plugin}.vim.
|
health#{plugin}#check() function in autoload/health/{plugin}.vim.
|
||||||
|:CheckHealth| automatically finds and invokes such functions.
|
|:checkhealth| automatically finds and invokes such functions.
|
||||||
|
|
||||||
If your plugin is named "jslint", then its healthcheck function must be >
|
If your plugin is named "foo", then its healthcheck function must be >
|
||||||
health#jslint#check()
|
health#foo#check()
|
||||||
|
|
||||||
defined in this file on 'runtimepath': >
|
defined in this file on 'runtimepath': >
|
||||||
autoload/health/jslint.vim
|
autoload/health/foo.vim
|
||||||
|
|
||||||
Here's a sample to get started: >
|
Copy this sample code into autoload/health/foo.vim and replace "foo" with your
|
||||||
function! health#jslint#check() abort
|
plugin name: >
|
||||||
|
function! health#foo#check() abort
|
||||||
call health#report_start('sanity checks')
|
call health#report_start('sanity checks')
|
||||||
" perform arbitrary checks
|
" perform arbitrary checks
|
||||||
" ...
|
" ...
|
||||||
@@ -111,8 +101,8 @@ Here's a sample to get started: >
|
|||||||
if looks_good
|
if looks_good
|
||||||
call health#report_ok('found required dependencies')
|
call health#report_ok('found required dependencies')
|
||||||
else
|
else
|
||||||
call health#report_error('cannot find jslint',
|
call health#report_error('cannot find foo',
|
||||||
\ ['npm install --save jslint'])
|
\ ['npm install --save foo'])
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
*pi_matchit.txt* Extended "%" matching
|
*pi_matchit.txt* Extended "%" matching
|
||||||
|
|
||||||
For Vim version 6.3. Last change: 2015 May 21
|
For Vim version 6.3. Last change: 2017 May 14
|
||||||
|
|
||||||
*matchit* *matchit.vim*
|
*matchit* *matchit.vim*
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ Examples:
|
|||||||
In LaTeX, since "%" is used as the comment character, you can >
|
In LaTeX, since "%" is used as the comment character, you can >
|
||||||
:let b:match_skip = 'r:%'
|
:let b:match_skip = 'r:%'
|
||||||
< Unfortunately, this will skip anything after "\%", an escaped "%". To
|
< Unfortunately, this will skip anything after "\%", an escaped "%". To
|
||||||
allow for this, and also "\\%" (an excaped backslash followed by the
|
allow for this, and also "\\%" (an escaped backslash followed by the
|
||||||
comment character) you can >
|
comment character) you can >
|
||||||
:let b:match_skip = 'r:\(^\|[^\\]\)\(\\\\\)*%'
|
:let b:match_skip = 'r:\(^\|[^\\]\)\(\\\\\)*%'
|
||||||
<
|
<
|
||||||
@@ -356,7 +356,8 @@ The back reference '\'.d refers to the same thing as '\'.b:match_table[d] in
|
|||||||
The various |:vmap|s defined in the script (%, |g%|, |[%|, |]%|, |a%|) may
|
The various |:vmap|s defined in the script (%, |g%|, |[%|, |]%|, |a%|) may
|
||||||
have undesired effects in Select mode |Select-mode-mapping|. At least, if you
|
have undesired effects in Select mode |Select-mode-mapping|. At least, if you
|
||||||
want to replace the selection with any character in "ag%[]" there will be a
|
want to replace the selection with any character in "ag%[]" there will be a
|
||||||
pause of |'updatetime'| first.
|
pause of |'updatetime'| first. E.g., "yV%" would normally work linewise, but
|
||||||
|
the plugin mapping makes it characterwise.
|
||||||
|
|
||||||
It would be nice if "\0" were recognized as the entire pattern. That is, it
|
It would be nice if "\0" were recognized as the entire pattern. That is, it
|
||||||
would be nice if "foo:\end\0" had the same effect as "\(foo\):\end\1".
|
would be nice if "foo:\end\0" had the same effect as "\(foo\):\end\1".
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user