mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
Compare commits
1076 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4dcd19d9bc | ||
![]() |
4f5a18237b | ||
![]() |
ab63f5d934 | ||
![]() |
a9f97226ae | ||
![]() |
1cc869ffb9 | ||
![]() |
3c4544c532 | ||
![]() |
3098b18a2b | ||
![]() |
3d7a6e4d54 | ||
![]() |
c4de9c7cc9 | ||
![]() |
5ebffaae4e | ||
![]() |
cef624ee9e | ||
![]() |
ce17d03180 | ||
![]() |
89e6973fe2 | ||
![]() |
ec71d87b81 | ||
![]() |
9e1cacecbe | ||
![]() |
5734e21873 | ||
![]() |
2dfc8de1cf | ||
![]() |
425fcdb5b4 | ||
![]() |
29b737e92b | ||
![]() |
a252fca38e | ||
![]() |
9e385404b3 | ||
![]() |
88a735166b | ||
![]() |
50a7517a6d | ||
![]() |
a7a0bf54e3 | ||
![]() |
cd10cdd1b4 | ||
![]() |
7029dec0ae | ||
![]() |
02fa6b18d6 | ||
![]() |
5c6592fdab | ||
![]() |
ba9bdb3e70 | ||
![]() |
1cb8afed78 | ||
![]() |
43fe335eda | ||
![]() |
0ba12c6691 | ||
![]() |
0d264abdd0 | ||
![]() |
f3d6c443d9 | ||
![]() |
bf63510228 | ||
![]() |
ef92cca7cc | ||
![]() |
376ba4e734 | ||
![]() |
49dde999c0 | ||
![]() |
2ebc58d25a | ||
![]() |
ba97f73560 | ||
![]() |
1b1b920ba8 | ||
![]() |
a347b29aa3 | ||
![]() |
c4117d4b2f | ||
![]() |
4a200ceafa | ||
![]() |
d835c030f2 | ||
![]() |
8d12e28d94 | ||
![]() |
05baf936c0 | ||
![]() |
8a14750dd3 | ||
![]() |
28b9a2864a | ||
![]() |
e5147ce6a0 | ||
![]() |
40cc5ba0e2 | ||
![]() |
946807898b | ||
![]() |
ca280c28b4 | ||
![]() |
007d573147 | ||
![]() |
896f548eee | ||
![]() |
a3dfd1627e | ||
![]() |
a64114eba0 | ||
![]() |
28275fe5c3 | ||
![]() |
45304b482c | ||
![]() |
bda0165514 | ||
![]() |
c4f1b5a938 | ||
![]() |
3e435df42c | ||
![]() |
fd92e648ac | ||
![]() |
494b1c9bee | ||
![]() |
9af400f979 | ||
![]() |
af7ff808c7 | ||
![]() |
9709cf2cdb | ||
![]() |
25bb08dad9 | ||
![]() |
4f8b686435 | ||
![]() |
c129f6cfaf | ||
![]() |
d06c2a1b18 | ||
![]() |
2b0d46195b | ||
![]() |
0c598774d8 | ||
![]() |
515fea1ef0 | ||
![]() |
69ce17878e | ||
![]() |
1bada1fde0 | ||
![]() |
82f249f829 | ||
![]() |
9a56fcb2e8 | ||
![]() |
9c543f2e24 | ||
![]() |
032ac502ff | ||
![]() |
eb806c9620 | ||
![]() |
52c6cc2189 | ||
![]() |
224d7df630 | ||
![]() |
394830631f | ||
![]() |
b725f6b428 | ||
![]() |
4eb5d05f01 | ||
![]() |
4a29995fe7 | ||
![]() |
1fc84ae2cd | ||
![]() |
4ff5d6e41c | ||
![]() |
54cc6d8025 | ||
![]() |
6a35f2ac8b | ||
![]() |
942e0b338c | ||
![]() |
406562ac6d | ||
![]() |
7cdd01983a | ||
![]() |
2f67786796 | ||
![]() |
f1ced96c28 | ||
![]() |
af6603a6b4 | ||
![]() |
4913a25dec | ||
![]() |
209427e972 | ||
![]() |
f0bd4a1494 | ||
![]() |
77776b09c6 | ||
![]() |
c27395ddc8 | ||
![]() |
fa26eee85b | ||
![]() |
569e404622 | ||
![]() |
7124329bd9 | ||
![]() |
d4106f6df3 | ||
![]() |
0aa3e7b7ce | ||
![]() |
b7cb8f0597 | ||
![]() |
c91c0171dd | ||
![]() |
6cdf45e298 | ||
![]() |
f4ea114c67 | ||
![]() |
33778c36cc | ||
![]() |
6167ce6df2 | ||
![]() |
a3b87fc19b | ||
![]() |
e303ea8a19 | ||
![]() |
2c378fdfaf | ||
![]() |
634e51d12b | ||
![]() |
57700def79 | ||
![]() |
5814e29cdb | ||
![]() |
ea82270d30 | ||
![]() |
cddd7d47c3 | ||
![]() |
ed6756563c | ||
![]() |
700b32a2b3 | ||
![]() |
3c39219550 | ||
![]() |
85244e68e3 | ||
![]() |
41b44d114c | ||
![]() |
704accfbfa | ||
![]() |
e213ba1506 | ||
![]() |
0f0e2bdfd4 | ||
![]() |
f5c35ba109 | ||
![]() |
6e5498c3e3 | ||
![]() |
d70a322c40 | ||
![]() |
18903bd9b8 | ||
![]() |
256a5d2522 | ||
![]() |
68e58444b4 | ||
![]() |
c3efad5398 | ||
![]() |
f21cb425fb | ||
![]() |
44cbf45d26 | ||
![]() |
83c683f5e1 | ||
![]() |
aae7e8b7dd | ||
![]() |
cc1beecf81 | ||
![]() |
164bcaf5c9 | ||
![]() |
4043725991 | ||
![]() |
e90f52f7ac | ||
![]() |
cd00aa6ae4 | ||
![]() |
a8fec15899 | ||
![]() |
4b097c85d8 | ||
![]() |
2eb5d73438 | ||
![]() |
2895883154 | ||
![]() |
b50afb4651 | ||
![]() |
a7a3605c0f | ||
![]() |
e6e843ebc0 | ||
![]() |
cfe4352897 | ||
![]() |
2c827cea12 | ||
![]() |
1b1960ab90 | ||
![]() |
f09f6ba2e4 | ||
![]() |
8a2cf943f7 | ||
![]() |
e34cdf6e79 | ||
![]() |
a0fec5d3db | ||
![]() |
622164d403 | ||
![]() |
824a6877ea | ||
![]() |
11e8ec0cac | ||
![]() |
4eb58273cd | ||
![]() |
523ff9c55c | ||
![]() |
54188cddde | ||
![]() |
cf7d6a7a0b | ||
![]() |
01eafc0c17 | ||
![]() |
69d74f588a | ||
![]() |
982198143d | ||
![]() |
c18d5917e3 | ||
![]() |
4a6328a8eb | ||
![]() |
0cb2c39ec4 | ||
![]() |
10a8bb02ac | ||
![]() |
4ae7acd152 | ||
![]() |
584b8eddb4 | ||
![]() |
f5f11b9e2f | ||
![]() |
3f698b8106 | ||
![]() |
704f3dd855 | ||
![]() |
906271b53d | ||
![]() |
f47a20a266 | ||
![]() |
cf32ca5137 | ||
![]() |
fe4d814c0f | ||
![]() |
b25b6048ca | ||
![]() |
c56aceff88 | ||
![]() |
80471df208 | ||
![]() |
91c5005da8 | ||
![]() |
8d37201ed2 | ||
![]() |
3462f46cb8 | ||
![]() |
1bf1ffc734 | ||
![]() |
bf2c2b34cf | ||
![]() |
d227c843bf | ||
![]() |
5330aa104b | ||
![]() |
2df8f88b3c | ||
![]() |
d44b2c9483 | ||
![]() |
e605faaa2f | ||
![]() |
7cdbf3f97a | ||
![]() |
f4f80a238b | ||
![]() |
90e8bdc898 | ||
![]() |
666714f74f | ||
![]() |
52a830fec6 | ||
![]() |
47d44e00a2 | ||
![]() |
c54ccfbb52 | ||
![]() |
55844eee10 | ||
![]() |
c8d830e896 | ||
![]() |
1a9be28c75 | ||
![]() |
28d3def5b0 | ||
![]() |
6eda7c0e5f | ||
![]() |
8eb8ebf905 | ||
![]() |
f3645e422f | ||
![]() |
51c7818d42 | ||
![]() |
b8643f69c1 | ||
![]() |
4b8f27338f | ||
![]() |
14c9b30f2e | ||
![]() |
6e8757255e | ||
![]() |
7558f42f7d | ||
![]() |
62c0d99474 | ||
![]() |
e4d1bf7177 | ||
![]() |
5f0c76b243 | ||
![]() |
a9e0d734d7 | ||
![]() |
beccc3e3a1 | ||
![]() |
15b5bb038b | ||
![]() |
ce832238c8 | ||
![]() |
06b40d31c1 | ||
![]() |
ae686092f8 | ||
![]() |
2e2b5759cf | ||
![]() |
075f84cbea | ||
![]() |
5730ad9376 | ||
![]() |
cfcc6be73e | ||
![]() |
d61b576940 | ||
![]() |
df15f97889 | ||
![]() |
5aa0159f01 | ||
![]() |
6b22a742c7 | ||
![]() |
d7511f5cde | ||
![]() |
5a9d3be54c | ||
![]() |
77a7ca458b | ||
![]() |
3e85aee48c | ||
![]() |
f3ac99b72d | ||
![]() |
c94575fded | ||
![]() |
89bb5a8ab8 | ||
![]() |
e7a9c006e1 | ||
![]() |
b030c90506 | ||
![]() |
ffaaf5df31 | ||
![]() |
66a75fb835 | ||
![]() |
26d189e9a1 | ||
![]() |
6c4d3362c5 | ||
![]() |
1c066e671d | ||
![]() |
3cb9970acf | ||
![]() |
662eea8287 | ||
![]() |
bb020df0f5 | ||
![]() |
e7485ab1c9 | ||
![]() |
316d38d98c | ||
![]() |
925c020a1b | ||
![]() |
87c208a43f | ||
![]() |
d9ecd06627 | ||
![]() |
de33c9f005 | ||
![]() |
0b468fd0cf | ||
![]() |
a40a4e2431 | ||
![]() |
7bd570cd9a | ||
![]() |
890ce792af | ||
![]() |
0e15d1cefa | ||
![]() |
37b3a4c607 | ||
![]() |
6674930d7c | ||
![]() |
646ab30858 | ||
![]() |
96af115c71 | ||
![]() |
34a1bc1a46 | ||
![]() |
c6ec148f2d | ||
![]() |
35d8d10a6a | ||
![]() |
bd81239f2f | ||
![]() |
1895f6ffab | ||
![]() |
2ea02ff635 | ||
![]() |
3d9e9a92cf | ||
![]() |
43456e43de | ||
![]() |
091ef2fbe4 | ||
![]() |
42e710eacb | ||
![]() |
9fb9d2929f | ||
![]() |
0e9f7a7b36 | ||
![]() |
4e39eee13c | ||
![]() |
8991b4b095 | ||
![]() |
c2c180fbb3 | ||
![]() |
03fe4ad9b1 | ||
![]() |
ed1925e0d1 | ||
![]() |
c3b6cd300f | ||
![]() |
fb4655beb1 | ||
![]() |
4bfac00aa3 | ||
![]() |
75fbc23ead | ||
![]() |
c6df1b387c | ||
![]() |
32238018e4 | ||
![]() |
67eeb8a798 | ||
![]() |
53aa569918 | ||
![]() |
5ef3e40b37 | ||
![]() |
9d1e076056 | ||
![]() |
a528d56ba0 | ||
![]() |
d9e631f1b5 | ||
![]() |
55c0621ff3 | ||
![]() |
576c5f7b74 | ||
![]() |
badf227e6f | ||
![]() |
56bfdd7934 | ||
![]() |
36cb847d09 | ||
![]() |
be7d6ba6c1 | ||
![]() |
c00da817c4 | ||
![]() |
6bfd88dec1 | ||
![]() |
e76bc505e9 | ||
![]() |
2ee37cc285 | ||
![]() |
888b8abeb0 | ||
![]() |
1dd986562f | ||
![]() |
e17e5547d7 | ||
![]() |
c1487b9685 | ||
![]() |
2359f6f144 | ||
![]() |
7ab9ff88e6 | ||
![]() |
88da85a3cd | ||
![]() |
f2ae5a9cc0 | ||
![]() |
9c4b34be28 | ||
![]() |
0c5f74ae4d | ||
![]() |
0c2ba7554f | ||
![]() |
8ade191b7a | ||
![]() |
9d41060c32 | ||
![]() |
de7165d351 | ||
![]() |
0409cfded5 | ||
![]() |
a16d4a2b62 | ||
![]() |
712f057ed9 | ||
![]() |
92d4dfdca5 | ||
![]() |
c6eeefa339 | ||
![]() |
b32396170f | ||
![]() |
a1493215a2 | ||
![]() |
b01db02de4 | ||
![]() |
62321e5132 | ||
![]() |
ba1348edc5 | ||
![]() |
0f604e1da2 | ||
![]() |
2af36df86d | ||
![]() |
8d5e60d8af | ||
![]() |
2ab9e96742 | ||
![]() |
a6d0e3696c | ||
![]() |
11cf3680e4 | ||
![]() |
3e0fab6b7c | ||
![]() |
b6170db1a1 | ||
![]() |
23f8696317 | ||
![]() |
bb56564900 | ||
![]() |
1abad9978f | ||
![]() |
79d30bab54 | ||
![]() |
3402d07abe | ||
![]() |
97324c96a4 | ||
![]() |
39c3842621 | ||
![]() |
281a9b2cea | ||
![]() |
5c1597cad1 | ||
![]() |
8160e875a0 | ||
![]() |
78ded07954 | ||
![]() |
9a3b7fa906 | ||
![]() |
72d9d5e917 | ||
![]() |
b10c9b4f5b | ||
![]() |
2a4ea9a546 | ||
![]() |
3b1800be94 | ||
![]() |
06b9d2a6f2 | ||
![]() |
44b2cef83a | ||
![]() |
18605d6785 | ||
![]() |
b25dfecb18 | ||
![]() |
5993a38ba3 | ||
![]() |
7feef42e8a | ||
![]() |
564f57d1e5 | ||
![]() |
f57b9c57df | ||
![]() |
47b5294b0f | ||
![]() |
ac1f941edb | ||
![]() |
5c09d5c3de | ||
![]() |
6f833c7881 | ||
![]() |
1a15cf84c2 | ||
![]() |
62cf44b8ab | ||
![]() |
9b99cf4a6e | ||
![]() |
37d6004251 | ||
![]() |
63606bb409 | ||
![]() |
c8b574f749 | ||
![]() |
faf828b476 | ||
![]() |
f0add77de5 | ||
![]() |
94b1403ad5 | ||
![]() |
e71de26aba | ||
![]() |
99d4c8c29c | ||
![]() |
9403ce82bc | ||
![]() |
bfe9ebcbe1 | ||
![]() |
95230ec702 | ||
![]() |
44179d7444 | ||
![]() |
73676ad37b | ||
![]() |
2eb09c826d | ||
![]() |
2f98888db6 | ||
![]() |
f08fd41282 | ||
![]() |
9e00724c38 | ||
![]() |
609dad3799 | ||
![]() |
d9291954b9 | ||
![]() |
6395dd64a4 | ||
![]() |
dd4b661dbd | ||
![]() |
d92db14241 | ||
![]() |
d4778104b5 | ||
![]() |
44166a150c | ||
![]() |
81b68b0af3 | ||
![]() |
4bd848f24f | ||
![]() |
90cbd70d1a | ||
![]() |
09e4c244ee | ||
![]() |
1132b67b5b | ||
![]() |
693bf1dafb | ||
![]() |
d6c894efaf | ||
![]() |
6bbd149e98 | ||
![]() |
6ea1047585 | ||
![]() |
c8561ecf26 | ||
![]() |
82293b94c3 | ||
![]() |
29b393e43a | ||
![]() |
fc51f86b72 | ||
![]() |
6732f0193a | ||
![]() |
fe8b2fabe7 | ||
![]() |
51055c14a6 | ||
![]() |
5b263ac6ad | ||
![]() |
44024f2c65 | ||
![]() |
1b8caf3d75 | ||
![]() |
4a02dc0828 | ||
![]() |
76c9bd00d0 | ||
![]() |
3e3db580fd | ||
![]() |
af67f022ca | ||
![]() |
e87c7fcb39 | ||
![]() |
00347ec781 | ||
![]() |
87a49405b0 | ||
![]() |
12938b82fb | ||
![]() |
156df2c81b | ||
![]() |
06e53aa487 | ||
![]() |
91254bd9d8 | ||
![]() |
a6a6f70128 | ||
![]() |
f887037a8f | ||
![]() |
0d6cd2b808 | ||
![]() |
5b63488c25 | ||
![]() |
0b67bb8c25 | ||
![]() |
4612821946 | ||
![]() |
498eb02049 | ||
![]() |
bd7de9dac9 | ||
![]() |
e4e5815242 | ||
![]() |
b2b3768bb4 | ||
![]() |
af1745a763 | ||
![]() |
9198b06ea6 | ||
![]() |
560a346d57 | ||
![]() |
5f54519b4f | ||
![]() |
6dc39d84cf | ||
![]() |
e65fce8ed3 | ||
![]() |
cc6299ecbc | ||
![]() |
775a16b0b7 | ||
![]() |
07eabc062e | ||
![]() |
b768d8a09c | ||
![]() |
db20edef69 | ||
![]() |
c9f4f828d5 | ||
![]() |
9036f1644f | ||
![]() |
9648bf795a | ||
![]() |
30b452b470 | ||
![]() |
3b34c992bc | ||
![]() |
5af9ae9e60 | ||
![]() |
089368c15f | ||
![]() |
b3bdf9f356 | ||
![]() |
4f3ea0379e | ||
![]() |
3680332325 | ||
![]() |
d4bb84367f | ||
![]() |
4a4c3fdfcd | ||
![]() |
ade2298735 | ||
![]() |
72d5a88af5 | ||
![]() |
1eeadd7098 | ||
![]() |
9bd8fcde1e | ||
![]() |
b535df1554 | ||
![]() |
de23395fa7 | ||
![]() |
2d5cba630c | ||
![]() |
7609a96a35 | ||
![]() |
ec6fcf3b1c | ||
![]() |
baee9fe286 | ||
![]() |
ceccaf7a5e | ||
![]() |
109d53b7b9 | ||
![]() |
0581ec396c | ||
![]() |
291715286b | ||
![]() |
e0727ced13 | ||
![]() |
5b1a536d50 | ||
![]() |
1e995ea2fd | ||
![]() |
69234f4a76 | ||
![]() |
e0ca30553b | ||
![]() |
02612a3fc9 | ||
![]() |
e3bf1385e6 | ||
![]() |
cc2dce45d0 | ||
![]() |
6c9c08c370 | ||
![]() |
da6299445a | ||
![]() |
9c2c24ec48 | ||
![]() |
cae0904160 | ||
![]() |
50e129f5a7 | ||
![]() |
75f6817a51 | ||
![]() |
8d7ab23b49 | ||
![]() |
d19af41db4 | ||
![]() |
41794f6b58 | ||
![]() |
0b21956edb | ||
![]() |
364d764889 | ||
![]() |
7567afbbe5 | ||
![]() |
6c99667b6e | ||
![]() |
b6fdc3eb47 | ||
![]() |
f03ab69a35 | ||
![]() |
d12460123e | ||
![]() |
a21becf7ee | ||
![]() |
edbc97225d | ||
![]() |
8ba32e219f | ||
![]() |
d115b58cdc | ||
![]() |
adb73b6025 | ||
![]() |
63d750f310 | ||
![]() |
eab6ed778d | ||
![]() |
8eb0d43c12 | ||
![]() |
66571f64a4 | ||
![]() |
bfab33ef79 | ||
![]() |
51c3e0aa80 | ||
![]() |
663e1ed158 | ||
![]() |
4a0e10fb2c | ||
![]() |
b137ebdd17 | ||
![]() |
133ef7e465 | ||
![]() |
162d4bb3c6 | ||
![]() |
14c543231c | ||
![]() |
84281bf675 | ||
![]() |
953e140a18 | ||
![]() |
11f43360d1 | ||
![]() |
9b9695ab8e | ||
![]() |
c74dc9dd6c | ||
![]() |
81f54f909e | ||
![]() |
222a1655f5 | ||
![]() |
c2384597ef | ||
![]() |
c5c53ed8b4 | ||
![]() |
0690c3358d | ||
![]() |
6d57b48a53 | ||
![]() |
e7615ddc22 | ||
![]() |
313c24a31b | ||
![]() |
37288e522a | ||
![]() |
b86553c7ad | ||
![]() |
c9898e0ec3 | ||
![]() |
ab8a771dbd | ||
![]() |
e8dd996703 | ||
![]() |
586daa6b4c | ||
![]() |
cdd2bdabee | ||
![]() |
35d50ab5b9 | ||
![]() |
dcdb50b64b | ||
![]() |
f19e4dd1df | ||
![]() |
3be74ac634 | ||
![]() |
35b6a020b9 | ||
![]() |
8b5cc1230a | ||
![]() |
25a70469f4 | ||
![]() |
6fbb9ceb5e | ||
![]() |
7c2b2ea9c9 | ||
![]() |
b9701c2a2b | ||
![]() |
17ae27190d | ||
![]() |
18be6e0b30 | ||
![]() |
0429b7714f | ||
![]() |
b0cfb6905a | ||
![]() |
a9a25fda42 | ||
![]() |
31aa060bca | ||
![]() |
39e5d9287e | ||
![]() |
81ccfc576f | ||
![]() |
32e33aabdf | ||
![]() |
69e5427be1 | ||
![]() |
c90c47072f | ||
![]() |
cb5ee26540 | ||
![]() |
d402841b54 | ||
![]() |
b33c777493 | ||
![]() |
392964617a | ||
![]() |
bf6c5bc225 | ||
![]() |
f8f92a2360 | ||
![]() |
ba8ec7e963 | ||
![]() |
827e267800 | ||
![]() |
cc52060245 | ||
![]() |
bd3ea7227e | ||
![]() |
0ef0c17837 | ||
![]() |
5e876388e5 | ||
![]() |
1ecbfd19db | ||
![]() |
b12e5fa8bd | ||
![]() |
9b19335c6e | ||
![]() |
8b2b9b83b7 | ||
![]() |
1ce80d8676 | ||
![]() |
1d1574e0ac | ||
![]() |
79e7c03f91 | ||
![]() |
2be51f5e85 | ||
![]() |
70ab198221 | ||
![]() |
fef753fa6d | ||
![]() |
d9cada146f | ||
![]() |
7b955802b3 | ||
![]() |
46bd3c0f77 | ||
![]() |
3cf8ad6f48 | ||
![]() |
86c5696c27 | ||
![]() |
69e448d1d8 | ||
![]() |
ec663d8069 | ||
![]() |
ad83cd82e1 | ||
![]() |
c1b0c45bee | ||
![]() |
153fe65c01 | ||
![]() |
add02b675d | ||
![]() |
863e1c91a6 | ||
![]() |
f5c112c949 | ||
![]() |
4cbe52b3a3 | ||
![]() |
7aaffb7001 | ||
![]() |
924cacd2fc | ||
![]() |
4f4b8ea448 | ||
![]() |
79a6983c0c | ||
![]() |
8e92b7f9fc | ||
![]() |
a4ea4dac45 | ||
![]() |
ac88c35d32 | ||
![]() |
f104ce2d15 | ||
![]() |
52692d3cd3 | ||
![]() |
8d5cfe4ffc | ||
![]() |
3d15cab29d | ||
![]() |
5feff1c415 | ||
![]() |
3c0a082894 | ||
![]() |
105f98fbf8 | ||
![]() |
ce2ff1ac01 | ||
![]() |
f20818de31 | ||
![]() |
2b2f9ccf8c | ||
![]() |
cfce719c66 | ||
![]() |
cdc7250cd8 | ||
![]() |
ffd143be82 | ||
![]() |
5308585adf | ||
![]() |
18d1ba3422 | ||
![]() |
610b48c5b0 | ||
![]() |
b2ea083eeb | ||
![]() |
2873a17c55 | ||
![]() |
ad5cb87d7a | ||
![]() |
1a356e6439 | ||
![]() |
3f314d40be | ||
![]() |
64038bf4e2 | ||
![]() |
ef662498b1 | ||
![]() |
3e3d2d783c | ||
![]() |
830678d5f9 | ||
![]() |
815ba27f75 | ||
![]() |
208f9dd09d | ||
![]() |
63a12e1e2d | ||
![]() |
696adeb0f6 | ||
![]() |
76086b36b7 | ||
![]() |
be1d5a61be | ||
![]() |
cabf079ae4 | ||
![]() |
02cf813eff | ||
![]() |
1ac6601841 | ||
![]() |
59ef994f8f | ||
![]() |
99067b7e56 | ||
![]() |
fe1ba0487a | ||
![]() |
e2231bc372 | ||
![]() |
1d995bb357 | ||
![]() |
948361760c | ||
![]() |
5ee87c68b7 | ||
![]() |
ee5c4f8a2b | ||
![]() |
228d236bdf | ||
![]() |
fa924f4604 | ||
![]() |
2016365ffe | ||
![]() |
cb724182ff | ||
![]() |
8f212568aa | ||
![]() |
3a94e06abb | ||
![]() |
40149a9dbf | ||
![]() |
2f52ae18e7 | ||
![]() |
594e3a64de | ||
![]() |
63560c9c89 | ||
![]() |
ddba89c9b6 | ||
![]() |
a6e4271c15 | ||
![]() |
a5f361e470 | ||
![]() |
7fc996abf6 | ||
![]() |
1e94262efe | ||
![]() |
61a3b14726 | ||
![]() |
9664f513f4 | ||
![]() |
d21aaef456 | ||
![]() |
43fd126298 | ||
![]() |
b20b8f9f04 | ||
![]() |
d050d6390d | ||
![]() |
b3dbc9d90b | ||
![]() |
5ef1cb5c2e | ||
![]() |
6d1b948b6b | ||
![]() |
4d074e39ea | ||
![]() |
7d2d4b1918 | ||
![]() |
da4bf813da | ||
![]() |
515b7e3eff | ||
![]() |
a984203bd6 | ||
![]() |
7179f43666 | ||
![]() |
73234bfec6 | ||
![]() |
f8ad215d25 | ||
![]() |
8f22031708 | ||
![]() |
5ffe1425c9 | ||
![]() |
0e546d8b38 | ||
![]() |
fd14f64e26 | ||
![]() |
edb5fb88aa | ||
![]() |
b55726b350 | ||
![]() |
4c960c3d78 | ||
![]() |
41f6a10a9b | ||
![]() |
d671dae58c | ||
![]() |
aa17b4b4bc | ||
![]() |
aa8b3b60ee | ||
![]() |
73e83e8566 | ||
![]() |
1574c4a115 | ||
![]() |
a31f9161b0 | ||
![]() |
33bc33274a | ||
![]() |
92f889dada | ||
![]() |
487609c075 | ||
![]() |
2e000a1acd | ||
![]() |
db51ff10f4 | ||
![]() |
8721e1fe08 | ||
![]() |
8771e84db7 | ||
![]() |
d25a59f4d0 | ||
![]() |
db77b7bc9e | ||
![]() |
50393ef178 | ||
![]() |
52f160f352 | ||
![]() |
069a220f32 | ||
![]() |
164fb2a688 | ||
![]() |
d459a0891c | ||
![]() |
894fcb778e | ||
![]() |
ccab78046c | ||
![]() |
71980676f0 | ||
![]() |
6c77ea1cb6 | ||
![]() |
e78fc534dd | ||
![]() |
4b13cbc76d | ||
![]() |
fb3a6b925b | ||
![]() |
c13dc2b762 | ||
![]() |
8cfef01193 | ||
![]() |
3571fdac6f | ||
![]() |
765d394f18 | ||
![]() |
c15e796211 | ||
![]() |
130611fca3 | ||
![]() |
18ca2035fe | ||
![]() |
9b0b3a0883 | ||
![]() |
1937c6e480 | ||
![]() |
299044d4ef | ||
![]() |
45b378259e | ||
![]() |
ce0e66260f | ||
![]() |
e74fa00c38 | ||
![]() |
1715b79d39 | ||
![]() |
2772144cbf | ||
![]() |
91a1680205 | ||
![]() |
66f89ae321 | ||
![]() |
63d0f6e94a | ||
![]() |
41434e6881 | ||
![]() |
b5f6f43095 | ||
![]() |
291495a7b0 | ||
![]() |
e1d81178cc | ||
![]() |
31047607f8 | ||
![]() |
a15cfb4d52 | ||
![]() |
c5f37c0fc0 | ||
![]() |
7c94b2c343 | ||
![]() |
3915ac2409 | ||
![]() |
4d0c511354 | ||
![]() |
d22a821ce3 | ||
![]() |
ee56470157 | ||
![]() |
4172ce4eb0 | ||
![]() |
d4430dc3eb | ||
![]() |
c8b487ae40 | ||
![]() |
50c4c56967 | ||
![]() |
f583e51209 | ||
![]() |
0ccd1ef725 | ||
![]() |
feb70192a8 | ||
![]() |
ce17037e3e | ||
![]() |
8048699f7d | ||
![]() |
34904efd9d | ||
![]() |
b8ed507e3b | ||
![]() |
8b86f1103a | ||
![]() |
22230196cb | ||
![]() |
f1aec23c09 | ||
![]() |
15cd8916df | ||
![]() |
dd0b358af5 | ||
![]() |
a649299e76 | ||
![]() |
f2558890f5 | ||
![]() |
7a8e41e8ee | ||
![]() |
bcbcf235f6 | ||
![]() |
5bfbf968dd | ||
![]() |
8887ccffa6 | ||
![]() |
542c79f20d | ||
![]() |
9eb6a44564 | ||
![]() |
5fa082fa85 | ||
![]() |
03d8adda8e | ||
![]() |
a2ec5a569b | ||
![]() |
d70b57264b | ||
![]() |
23a83d24a6 | ||
![]() |
297075bf47 | ||
![]() |
f6ecd127b9 | ||
![]() |
4618307a6c | ||
![]() |
f338ea7835 | ||
![]() |
49f0417988 | ||
![]() |
d0d5d17b69 | ||
![]() |
ac0f979501 | ||
![]() |
a480614cb0 | ||
![]() |
a118abca77 | ||
![]() |
1c91dc8a5e | ||
![]() |
21afabb9e8 | ||
![]() |
c90784836b | ||
![]() |
33321f2c85 | ||
![]() |
ee0e214427 | ||
![]() |
74d450aa7b | ||
![]() |
38435e8a05 | ||
![]() |
9c811c6ba6 | ||
![]() |
51d95d1438 | ||
![]() |
1eaa2227e9 | ||
![]() |
f5ae5fa799 | ||
![]() |
3875d0bdf6 | ||
![]() |
1a958345e2 | ||
![]() |
a119db78d7 | ||
![]() |
5f33f581a7 | ||
![]() |
92f7dc1c4b | ||
![]() |
9c2a156faa | ||
![]() |
d1aa549735 | ||
![]() |
9b550a8760 | ||
![]() |
a29b08ca5a | ||
![]() |
d858315e59 | ||
![]() |
8099275082 | ||
![]() |
55a345c3e7 | ||
![]() |
a3a7afded6 | ||
![]() |
4f18e0f678 | ||
![]() |
3b4d1ab180 | ||
![]() |
a7ade5c832 | ||
![]() |
0735b05c82 | ||
![]() |
e4fb777252 | ||
![]() |
ba3123c88f | ||
![]() |
704882e8dc | ||
![]() |
3920e7680d | ||
![]() |
5dfbe6685d | ||
![]() |
d38d6486f2 | ||
![]() |
f82e982bda | ||
![]() |
7ad3f077dc | ||
![]() |
dddbf9c5fa | ||
![]() |
fec466c72e | ||
![]() |
6f88dca92d | ||
![]() |
4eba134a55 | ||
![]() |
9d18492793 | ||
![]() |
1231f0b001 | ||
![]() |
85d06fef16 | ||
![]() |
8b173a1de5 | ||
![]() |
f433f569a3 | ||
![]() |
d4fb5920d3 | ||
![]() |
0b23dec35e | ||
![]() |
07265d221f | ||
![]() |
729064af5f | ||
![]() |
24fbb2c866 | ||
![]() |
4034670568 | ||
![]() |
65394777d5 | ||
![]() |
755e56ba66 | ||
![]() |
964e52e81f | ||
![]() |
68550b0d63 | ||
![]() |
7a7a758786 | ||
![]() |
62d137ce09 | ||
![]() |
cf0ff1dd0f | ||
![]() |
bf7bc4dcf0 | ||
![]() |
54a1fb77e7 | ||
![]() |
269f3ac779 | ||
![]() |
c2ab844133 | ||
![]() |
b1b8759fc3 | ||
![]() |
62f1aaedb1 | ||
![]() |
2c76651438 | ||
![]() |
59e1f8996d | ||
![]() |
da9e519ba1 | ||
![]() |
39ef219535 | ||
![]() |
573d65c738 | ||
![]() |
852aaa5d42 | ||
![]() |
7f3999ac80 | ||
![]() |
5c87d40acd | ||
![]() |
8bfb521417 | ||
![]() |
8eeda7169a | ||
![]() |
3dfbeabf35 | ||
![]() |
420fe1fe73 | ||
![]() |
7c79ea70ef | ||
![]() |
e8fab975f8 | ||
![]() |
5db511b6f1 | ||
![]() |
ddf3e27959 | ||
![]() |
f65d58907d | ||
![]() |
a1c770ca27 | ||
![]() |
970b5f2752 | ||
![]() |
7497dbee16 | ||
![]() |
7c0f6d2380 | ||
![]() |
879c668d14 | ||
![]() |
3b94756feb | ||
![]() |
317d5ca7b0 | ||
![]() |
223aafb1a7 | ||
![]() |
3b7c4093e2 | ||
![]() |
095320a67d | ||
![]() |
1ce329e7dd | ||
![]() |
4fc85e5c87 | ||
![]() |
dd8812c7cb | ||
![]() |
a641b74140 | ||
![]() |
73b8c89518 | ||
![]() |
72d03cc961 | ||
![]() |
5999749e07 | ||
![]() |
97ed0e8dd3 | ||
![]() |
fd10729bc8 | ||
![]() |
6bed244488 | ||
![]() |
57cfb95758 | ||
![]() |
c6e481cba5 | ||
![]() |
9bf694ff0b | ||
![]() |
f350655ddd | ||
![]() |
59b04d856b | ||
![]() |
feed81f45f | ||
![]() |
d37dc0b314 | ||
![]() |
9c5ab23ef2 | ||
![]() |
d8e07deff6 | ||
![]() |
6c8e572d09 | ||
![]() |
3a6cef9ee6 | ||
![]() |
2586459118 | ||
![]() |
47fac915f3 | ||
![]() |
588b09277b | ||
![]() |
008c014cbe | ||
![]() |
593df501b3 | ||
![]() |
50db0312f9 | ||
![]() |
c15446222b | ||
![]() |
665bd8de59 | ||
![]() |
36f17ce87e | ||
![]() |
3706701d9b | ||
![]() |
a42800ba45 | ||
![]() |
94fabe4d59 | ||
![]() |
4bc3bcab22 | ||
![]() |
d51a27b7e5 | ||
![]() |
3b23d733dd | ||
![]() |
af5c34f8a5 | ||
![]() |
b4b4536339 | ||
![]() |
7643245470 | ||
![]() |
fec35dc976 | ||
![]() |
e57e303c6b | ||
![]() |
23669bd7df | ||
![]() |
2d39eea9f0 | ||
![]() |
c6aa71605f | ||
![]() |
c6f6033482 | ||
![]() |
bd4ca22cf0 | ||
![]() |
efaf76e623 | ||
![]() |
ec580da5f4 | ||
![]() |
0298b004f8 | ||
![]() |
bd529ea3f3 | ||
![]() |
d26b01d4bd | ||
![]() |
074d3dc1f3 | ||
![]() |
3ce8de7c8f | ||
![]() |
59eaba2894 | ||
![]() |
70f6e2ce52 | ||
![]() |
5a6633bc34 | ||
![]() |
04bdeeb8b2 | ||
![]() |
49b06a8f2a | ||
![]() |
cb62594042 | ||
![]() |
c9df429887 | ||
![]() |
22a928aeac | ||
![]() |
6f25ba0550 | ||
![]() |
b2f9bfbff0 | ||
![]() |
4d27bd6bfe | ||
![]() |
adf11f3478 | ||
![]() |
f1344bc219 | ||
![]() |
3fd62f9612 | ||
![]() |
ff0253127e | ||
![]() |
df4ac79761 | ||
![]() |
a79ebeeea4 | ||
![]() |
303ac3f283 | ||
![]() |
648aebb8b6 | ||
![]() |
a48508de0d | ||
![]() |
04cd3eef24 | ||
![]() |
6d5a5b02f6 | ||
![]() |
568ee1e3c2 | ||
![]() |
091e885d44 | ||
![]() |
68fb815bf1 | ||
![]() |
8b3c399b6d | ||
![]() |
bd39e2354f | ||
![]() |
6a7535cd84 | ||
![]() |
76bf21de26 | ||
![]() |
d8a2007d47 | ||
![]() |
930ee40ad3 | ||
![]() |
541ba61ac9 | ||
![]() |
6ee58e67cb | ||
![]() |
9040d7aed7 | ||
![]() |
f4e3c13bcc | ||
![]() |
f0538639c0 | ||
![]() |
39555dc8c4 | ||
![]() |
7f99d210fd | ||
![]() |
25eaacd10f | ||
![]() |
91b8ab3d21 | ||
![]() |
b654a2b324 | ||
![]() |
9649537f4c | ||
![]() |
47b9ac9013 | ||
![]() |
b9d1a7f810 | ||
![]() |
944658e2e1 | ||
![]() |
fbfe564b3c | ||
![]() |
aa0af927da | ||
![]() |
5403924f7c | ||
![]() |
efb30a0068 | ||
![]() |
c5d0c280d3 | ||
![]() |
ee1f8eab0c | ||
![]() |
53a1db1a10 | ||
![]() |
eb53ec5ba2 | ||
![]() |
8373aaf44e | ||
![]() |
376b973a0a | ||
![]() |
e9161799bf | ||
![]() |
90537ae970 | ||
![]() |
884c124130 | ||
![]() |
e123675bcc | ||
![]() |
5c112c0cb9 | ||
![]() |
ea67bf808b | ||
![]() |
f638572164 | ||
![]() |
65f11d0a00 | ||
![]() |
1e7a553ed7 | ||
![]() |
ecdf18edbb | ||
![]() |
cb0b89f8ba | ||
![]() |
5b30ba7b99 | ||
![]() |
7581046b60 | ||
![]() |
1f27ccb77f | ||
![]() |
aa4cc17bb0 | ||
![]() |
9d64d75031 | ||
![]() |
b051f33814 | ||
![]() |
67f03f33a7 | ||
![]() |
f9647d99b4 | ||
![]() |
c42cb49a96 | ||
![]() |
aa36af214a | ||
![]() |
75cfd3c0ca | ||
![]() |
5cb01bafa8 | ||
![]() |
243b492c0d | ||
![]() |
e1abbe6b67 | ||
![]() |
4cc38e04c7 | ||
![]() |
8be2ab11de | ||
![]() |
1946f96a16 | ||
![]() |
e117544d72 | ||
![]() |
77c0f9a62b | ||
![]() |
ad34a376eb | ||
![]() |
c3ac16cfeb | ||
![]() |
3b472e55b3 | ||
![]() |
b079622716 | ||
![]() |
238a8d33fa | ||
![]() |
123361f187 | ||
![]() |
8a34d21b0d | ||
![]() |
7387816dcb | ||
![]() |
f406ae412e | ||
![]() |
c3e4e0e383 | ||
![]() |
cd1be8350d | ||
![]() |
0488fea0de | ||
![]() |
3c9d8ac99e | ||
![]() |
014d692013 | ||
![]() |
28821397f6 | ||
![]() |
1b6e7f9e39 | ||
![]() |
aca51f3d93 | ||
![]() |
a9b4cedb08 | ||
![]() |
815fe24604 | ||
![]() |
d1ec3f661a | ||
![]() |
ebdb802bf5 | ||
![]() |
f1b9a59ed6 | ||
![]() |
810d31a430 | ||
![]() |
f183cc14de | ||
![]() |
5c4a5d0677 | ||
![]() |
5b96d370df | ||
![]() |
1cf7de074b | ||
![]() |
cc203e4b93 | ||
![]() |
f37ad6af36 | ||
![]() |
a35c45732c | ||
![]() |
2b12406f2e | ||
![]() |
3b74ee1ce9 | ||
![]() |
158dc2b7a7 | ||
![]() |
5262cf2f19 | ||
![]() |
7f8365e302 | ||
![]() |
fe143ac439 | ||
![]() |
1b56425662 | ||
![]() |
74341ca5ca | ||
![]() |
8c684b2fdb | ||
![]() |
a3a8df8359 | ||
![]() |
e796632240 | ||
![]() |
81960df9f5 | ||
![]() |
fcf829963e | ||
![]() |
bf65b3ab45 | ||
![]() |
87abe073d9 | ||
![]() |
74c960007f | ||
![]() |
4c0ac1ca26 | ||
![]() |
f338fee482 | ||
![]() |
f40c8c4c23 | ||
![]() |
3abbdb2f41 | ||
![]() |
86c0bd14ec | ||
![]() |
77836ff01b | ||
![]() |
67a7b1785c | ||
![]() |
0ab4f2f18f | ||
![]() |
6d583f8587 | ||
![]() |
f838755fc0 | ||
![]() |
618c8d0e82 | ||
![]() |
b6b84cb94f | ||
![]() |
3a60f927b8 | ||
![]() |
7be12edd38 | ||
![]() |
655f1b7513 | ||
![]() |
07eaff7c26 | ||
![]() |
8c00c34b91 | ||
![]() |
597547e797 | ||
![]() |
972b43459b | ||
![]() |
cf673f60c6 | ||
![]() |
d9c0293824 | ||
![]() |
21956adb6e | ||
![]() |
fe9d91ceb6 | ||
![]() |
09f6066bb4 | ||
![]() |
789041c282 | ||
![]() |
119545190c | ||
![]() |
98f9ff730b | ||
![]() |
8d07058097 | ||
![]() |
b1d7b5294a | ||
![]() |
a86d4b323e | ||
![]() |
cfa2107e33 | ||
![]() |
36af4af27a |
@@ -7,4 +7,4 @@ if [[ -n "${CI_TARGET}" ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
coveralls --gcov "$(which "${GCOV}")" --encoding iso-8859-1 || echo 'coveralls upload failed.'
|
||||
[ "$USE_GCOV" = on ] && { coveralls --gcov "$(which "${GCOV}")" --encoding iso-8859-1 || echo 'coveralls upload failed.' ; }
|
||||
|
@@ -19,6 +19,10 @@ if [[ -n "${LLVM_SYMBOLIZER}" ]] && [[ ! $(type -P "${LLVM_SYMBOLIZER}") ]]; the
|
||||
echo "\$LLVM_SYMBOLIZER: '${LLVM_SYMBOLIZER}' is not executable."
|
||||
exit 1
|
||||
fi
|
||||
if [ "${BUILD_32BIT}" = ON ] && [ "${BUILD_MINGW}" = ON ]; then
|
||||
>&2 echo "32-bit MinGW builds not supported."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
# Adds user to a dummy group.
|
||||
|
@@ -1,15 +1,13 @@
|
||||
build_deps() {
|
||||
if [[ "${BUILD_32BIT}" == ON ]]; then
|
||||
if [[ "${BUILD_MINGW}" == ON ]]; then
|
||||
>&2 echo "32-bit MinGW builds not supported."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||
fi
|
||||
if [[ "${BUILD_MINGW}" == ON ]]; then
|
||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_MINGW}"
|
||||
fi
|
||||
if [[ "${FUNCTIONALTEST}" == "functionaltest-lua" ]]; then
|
||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
|
||||
fi
|
||||
|
||||
rm -rf "${DEPS_BUILD_DIR}"
|
||||
|
||||
@@ -42,11 +40,6 @@ build_nvim() {
|
||||
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
|
||||
fi
|
||||
if [[ "${BUILD_32BIT}" == ON ]]; then
|
||||
if [[ "${BUILD_MINGW}" == ON ]]; then
|
||||
>&2 echo "32-bit MinGW builds not supported."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||
fi
|
||||
if [[ "${BUILD_MINGW}" == ON ]]; then
|
||||
|
@@ -53,7 +53,7 @@ run_unittests() {
|
||||
}
|
||||
|
||||
run_functionaltests() {
|
||||
if ! ${MAKE_CMD} -C "${BUILD_DIR}" functionaltest; then
|
||||
if ! ${MAKE_CMD} -C "${BUILD_DIR}" ${FUNCTIONALTEST}; then
|
||||
asan_check "${LOG_DIR}"
|
||||
valgrind_check "${LOG_DIR}"
|
||||
exit 1
|
||||
|
@@ -14,7 +14,9 @@ elif [[ "${BUILD_MINGW}" == ON ]]; then
|
||||
# binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-dev mingw-w64-tools
|
||||
|
||||
echo "Downloading MinGW..."
|
||||
curl -sSL "http://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/gcc-4.8-release/i686-w64-mingw32-gcc-4.8.0-linux64_rubenvb.tar.xz" | tar xJf - -C "${HOME}/.local"
|
||||
curl -sSL "https://github.com/neovim/deps/raw/master/opt/i686-w64-mingw32-gcc-4.8.0-linux64_rubenvb.tar.xz" \
|
||||
| tar xJf - -C "${HOME}/.local"
|
||||
|
||||
fi
|
||||
|
||||
# Set CC to default to avoid compilation problems
|
||||
|
@@ -4,7 +4,7 @@ set -e
|
||||
set -o pipefail
|
||||
|
||||
if [[ -n "${CI_TARGET}" ]]; then
|
||||
make lint
|
||||
make "${CI_TARGET}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
12
.editorconfig
Normal file
12
.editorconfig
Normal file
@@ -0,0 +1,12 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf_8
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
tab_width = 4
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -67,3 +67,5 @@ local.mk
|
||||
/runtime/doc/doctags
|
||||
/runtime/doc/errors.log
|
||||
|
||||
# clint errors, generated by `make lint`
|
||||
/errors.json
|
||||
|
24
.travis.yml
24
.travis.yml
@@ -12,8 +12,6 @@ env:
|
||||
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$HOME/.local/mingw32/bin:$PATH"
|
||||
# LLVM symbolizer path.
|
||||
- LLVM_SYMBOLIZER="$(which llvm-symbolizer-3.6)"
|
||||
# Force verification of DLOG macros.
|
||||
- CFLAGS="-DMIN_LOG_LEVEL=0"
|
||||
# Build directory for Neovim.
|
||||
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
||||
# Build directory for third-party dependencies.
|
||||
@@ -28,9 +26,9 @@ env:
|
||||
- CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
|
||||
-DUSE_GCOV=ON
|
||||
-DBUSTED_OUTPUT_TYPE=gtest
|
||||
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr"
|
||||
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
|
||||
-DMIN_LOG_LEVEL=0"
|
||||
- DEPS_CMAKE_FLAGS="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR"
|
||||
# Additional CMake flags for 32-bit builds.
|
||||
- CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
|
||||
@@ -55,41 +53,43 @@ env:
|
||||
# if the tests were successful, but don't have this information
|
||||
# available in before_cache (which is run before after_success).
|
||||
- SUCCESS_MARKER="$BUILD_DIR/.tests_successful"
|
||||
# default target name for functional tests
|
||||
- FUNCTIONALTEST=functionaltest
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
env: CI_TARGET=clint
|
||||
env: CI_TARGET=lint
|
||||
- os: linux
|
||||
compiler: gcc-5
|
||||
env: GCOV=gcov-5
|
||||
- os: linux
|
||||
compiler: gcc-5
|
||||
env: FUNCTIONALTEST=functionaltest-lua
|
||||
- os: linux
|
||||
# Travis creates a cache per compiler.
|
||||
# Set a different value here to store 32-bit
|
||||
# dependencies in a separate cache.
|
||||
compiler: gcc-5 -m32
|
||||
env: GCOV=gcov-5 BUILD_32BIT=ON
|
||||
env: BUILD_32BIT=ON
|
||||
- os: linux
|
||||
compiler: clang-3.6
|
||||
env: GCOV=llvm-cov-3.6 CLANG_SANITIZER=ASAN_UBSAN
|
||||
env: GCOV=llvm-cov-3.6 CLANG_SANITIZER=ASAN_UBSAN CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||
- os: linux
|
||||
compiler: clang-3.6
|
||||
env: GCOV=llvm-cov-3.6 CLANG_SANITIZER=MSAN
|
||||
env: CLANG_SANITIZER=MSAN
|
||||
- os: linux
|
||||
compiler: clang-3.6
|
||||
env: CLANG_SANITIZER=TSAN
|
||||
- os: osx
|
||||
compiler: clang
|
||||
env: GCOV=gcov
|
||||
- os: osx
|
||||
compiler: gcc-4.9
|
||||
env: GCOV=gcov-4.9
|
||||
- os: linux
|
||||
env: BUILD_MINGW=ON
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
# TODO: Remove when all MSan errors have been fixed.
|
||||
- env: GCOV=llvm-cov-3.6 CLANG_SANITIZER=MSAN
|
||||
- env: CLANG_SANITIZER=MSAN
|
||||
|
||||
before_install: .ci/before_install.sh
|
||||
install: .ci/install.sh
|
||||
|
136
CMakeLists.txt
136
CMakeLists.txt
@@ -1,13 +1,22 @@
|
||||
cmake_minimum_required(VERSION 2.8.7)
|
||||
project(NEOVIM)
|
||||
project(nvim)
|
||||
|
||||
if(POLICY CMP0059)
|
||||
cmake_policy(SET CMP0059 OLD) # Needed until cmake 2.8.12. #4389
|
||||
endif()
|
||||
|
||||
# Point CMake at any custom modules we may ship
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
|
||||
# Prefer our bundled versions of dependencies.
|
||||
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
|
||||
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
|
||||
if(CMAKE_CROSSCOMPILING AND NOT UNIX)
|
||||
list(INSERT CMAKE_FIND_ROOT_PATH 0 ${DEPS_PREFIX})
|
||||
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX}/../host/bin)
|
||||
else()
|
||||
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
|
||||
endif()
|
||||
|
||||
# used for check_c_compiler_flag
|
||||
include(CheckCCompilerFlag)
|
||||
@@ -35,37 +44,35 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
set(USE_FNAME_CASE TRUE)
|
||||
endif()
|
||||
|
||||
# Set available build types for CMake GUIs.
|
||||
# A different build type can still be set by -DCMAKE_BUILD_TYPE=...
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||
STRINGS "Debug" "Dev" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
|
||||
# Set default build type.
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Dev'.")
|
||||
set(CMAKE_BUILD_TYPE "Dev" CACHE STRING "Choose the type of build." FORCE)
|
||||
endif()
|
||||
|
||||
# Version tokens
|
||||
# - In a git repo, these tokens are _ignored_.
|
||||
# - If the current HEAD is tagged, the tag name is used.
|
||||
# - Otherwise the result of `git describe` is used.
|
||||
# - If not in a git repo (e.g. a tarball) these tokens set the version string.
|
||||
# Set available build types for CMake GUIs.
|
||||
# A different build type can still be set by -DCMAKE_BUILD_TYPE=...
|
||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||
STRINGS "Debug" "Dev" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||
|
||||
# If not in a git repo (e.g., a tarball) these tokens define the complete
|
||||
# version string, else it is combined with the result of `git describe`.
|
||||
set(NVIM_VERSION_MAJOR 0)
|
||||
set(NVIM_VERSION_MINOR 1)
|
||||
set(NVIM_VERSION_PATCH 1)
|
||||
set(NVIM_VERSION_PATCH 4)
|
||||
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||
|
||||
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
|
||||
include(GetGitRevisionDescription)
|
||||
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
|
||||
if(NVIM_VERSION_COMMIT) # is a git repo
|
||||
git_get_exact_tag(NVIM_VERSION_MEDIUM)
|
||||
if(NVIM_VERSION_MEDIUM) # is a tagged release
|
||||
unset(NVIM_VERSION_COMMIT)
|
||||
else() # is a dev build
|
||||
git_describe(NVIM_VERSION_MEDIUM)
|
||||
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
|
||||
endif()
|
||||
if(NVIM_VERSION_COMMIT) # is a git repo
|
||||
git_describe(NVIM_VERSION_MEDIUM)
|
||||
# `git describe` annotates the most recent tagged release; for pre-release
|
||||
# builds we must replace that with the unreleased version.
|
||||
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+"
|
||||
"v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}"
|
||||
NVIM_VERSION_MEDIUM
|
||||
${NVIM_VERSION_MEDIUM})
|
||||
endif()
|
||||
|
||||
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
|
||||
@@ -150,7 +157,11 @@ if(${INIT_FLAGS_NAME})
|
||||
set(CMAKE_REQUIRED_FLAGS "${${INIT_FLAGS_NAME}}")
|
||||
endif()
|
||||
|
||||
# Include <string.h> because some toolchains define _FORTIFY_SOURCE=2 in
|
||||
# internal header files, which should in turn be #included by <string.h>.
|
||||
check_c_source_compiles("
|
||||
#include <string.h>
|
||||
|
||||
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 1
|
||||
#error \"_FORTIFY_SOURCE > 1\"
|
||||
#endif
|
||||
@@ -199,11 +210,18 @@ if(MSVC)
|
||||
else()
|
||||
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||
-Wstrict-prototypes -std=gnu99)
|
||||
|
||||
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
|
||||
# 3.4.1 used there.
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||
add_definitions(-Wno-c11-extensions)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MINGW)
|
||||
# Use POSIX compatible stdio in Mingw
|
||||
add_definitions(-D__USE_MINGW_ANSI_STDIO)
|
||||
add_definitions(-D_WIN32_WINNT=0x0600)
|
||||
endif()
|
||||
|
||||
# OpenBSD's GCC (4.2.1) doesn't have -Wvla
|
||||
@@ -212,12 +230,16 @@ if(HAS_WVLA_FLAG)
|
||||
add_definitions(-Wvla)
|
||||
endif()
|
||||
|
||||
check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
||||
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
|
||||
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
||||
add_definitions(-fstack-protector-strong)
|
||||
elseif(HAS_FSTACK_PROTECTOR_FLAG)
|
||||
add_definitions(-fstack-protector --param ssp-buffer-size=4)
|
||||
if(UNIX)
|
||||
# -fstack-protector breaks non Unix builds even in Mingw-w64
|
||||
check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
||||
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
|
||||
|
||||
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
||||
add_definitions(-fstack-protector-strong)
|
||||
elseif(HAS_FSTACK_PROTECTOR_FLAG)
|
||||
add_definitions(-fstack-protector --param ssp-buffer-size=4)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
|
||||
@@ -246,6 +268,10 @@ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
|
||||
|
||||
# For O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW flags on older systems
|
||||
# (pre POSIX.1-2008: glibc 2.11 and earlier). #4042
|
||||
add_definitions(-D_GNU_SOURCE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||
@@ -271,7 +297,7 @@ include(CheckLibraryExists)
|
||||
find_package(LibUV REQUIRED)
|
||||
include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
|
||||
|
||||
find_package(Msgpack REQUIRED)
|
||||
find_package(Msgpack 1.0.0 REQUIRED)
|
||||
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
||||
|
||||
find_package(LuaJit REQUIRED)
|
||||
@@ -328,13 +354,20 @@ endif()
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
# Place targets in bin/ or lib/ for all build configurations
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
foreach(CFGNAME ${CMAKE_CONFIGURATION_TYPES})
|
||||
string(TOUPPER ${CFGNAME} CFGNAME)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/bin)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFGNAME} ${CMAKE_BINARY_DIR}/lib)
|
||||
endforeach()
|
||||
|
||||
# Find Lua interpreter
|
||||
include(LuaHelpers)
|
||||
set(LUA_DEPENDENCIES lpeg MessagePack bit)
|
||||
set(LUA_DEPENDENCIES lpeg mpack bit)
|
||||
if(NOT LUA_PRG)
|
||||
foreach(CURRENT_LUA_PRG luajit lua)
|
||||
# If LUA_PRG is set find_program() will not search
|
||||
@@ -361,6 +394,7 @@ message(STATUS "Using the Lua interpreter ${LUA_PRG}.")
|
||||
|
||||
# Setup busted.
|
||||
find_program(BUSTED_PRG busted)
|
||||
find_program(BUSTED_LUA_PRG busted-lua)
|
||||
if(NOT BUSTED_OUTPUT_TYPE)
|
||||
set(BUSTED_OUTPUT_TYPE "utfTerminal")
|
||||
endif()
|
||||
@@ -377,6 +411,16 @@ install_helper(
|
||||
FILES ${MANPAGES}
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||
|
||||
# MIN_LOG_LEVEL for log.h
|
||||
if(DEFINED MIN_LOG_LEVEL)
|
||||
if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
|
||||
message(FATAL_ERROR "MIN_LOG_LEVEL must be a number DEBUG (0), INFO (1), WARNING (2) or ERROR (3)")
|
||||
endif()
|
||||
message(STATUS "Log level set to ${MIN_LOG_LEVEL}")
|
||||
else()
|
||||
message(STATUS "Log level not specified, defaulting to INFO(1)")
|
||||
endif()
|
||||
|
||||
# Go down the tree.
|
||||
|
||||
add_subdirectory(src/nvim)
|
||||
@@ -401,7 +445,11 @@ if(BUSTED_PRG)
|
||||
if(POLICY CMP0026)
|
||||
cmake_policy(SET CMP0026 OLD)
|
||||
endif()
|
||||
get_target_property(TEST_LIBNVIM_PATH nvim-test LOCATION)
|
||||
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
set(TEST_LIBNVIM_PATH ${CMAKE_BINARY_DIR}/lib/nvim-test.dll)
|
||||
else()
|
||||
get_target_property(TEST_LIBNVIM_PATH nvim-test LOCATION)
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
test/config/paths.lua.in
|
||||
@@ -458,6 +506,20 @@ if(BUSTED_PRG)
|
||||
DEPENDS ${BENCHMARK_PREREQS})
|
||||
endif()
|
||||
|
||||
if(BUSTED_LUA_PRG)
|
||||
add_custom_target(functionaltest-lua
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DBUSTED_PRG=${BUSTED_LUA_PRG}
|
||||
-DNVIM_PRG=$<TARGET_FILE:nvim>
|
||||
-DWORKING_DIR=${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-DBUSTED_OUTPUT_TYPE=${BUSTED_OUTPUT_TYPE}
|
||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||
-DBUILD_DIR=${CMAKE_BINARY_DIR}
|
||||
-DTEST_TYPE=functional
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||
DEPENDS ${FUNCTIONALTEST_PREREQS})
|
||||
endif()
|
||||
|
||||
if(LUACHECK_PRG)
|
||||
add_custom_target(testlint
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
@@ -465,3 +527,15 @@ if(LUACHECK_PRG)
|
||||
-DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTestsLint.cmake)
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_NAME "Neovim")
|
||||
set(CPACK_PACKAGE_VENDOR "neovim.io")
|
||||
set(CPACK_PACKAGE_VERSION ${NVIM_VERSION_MEDIUM})
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Neovim")
|
||||
# Set toplevel directory/installer name as Neovim
|
||||
set(CPACK_PACKAGE_FILE_NAME "Neovim")
|
||||
set(CPACK_TOPLEVEL_TAG "Neovim")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||
set(CPACK_NSIS_MODIFY_PATH ON)
|
||||
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||
include(CPack)
|
||||
|
@@ -23,15 +23,10 @@ If your issue isn't mentioned there:
|
||||
your problem persists.
|
||||
- If you're experiencing compile or runtime warnings/failures, try searching for
|
||||
the error message(s) you received (if any) on [Neovim's issue tracker][github-issues].
|
||||
- For build issues, see
|
||||
[Troubleshooting#build-issues][wiki-troubleshooting-build-issues].
|
||||
- For runtime issues, see
|
||||
[Troubleshooting#runtime-issues][wiki-troubleshooting-runtime-issues].
|
||||
If your issue isn't mentioned there, try reproducing it using `nvim`
|
||||
with the smallest possible `vimrc` (or none at all via `nvim -u NONE`),
|
||||
to rule out bugs in plugins you're using.
|
||||
If you're using a plugin manager, comment out your plugins, then add
|
||||
them back in one by one.
|
||||
- For runtime issues, try reproducing it using `nvim` with the smallest
|
||||
possible `vimrc` (or none at all via `nvim -u NONE`), to rule out bugs in
|
||||
plugins you're using. If you're using a plugin manager, comment out your
|
||||
plugins, then add them back in one by one.
|
||||
|
||||
Include as much detail as possible; we generally need to know:
|
||||
|
||||
@@ -112,10 +107,9 @@ happen to be modifying anyway. Fix anything that looks outright
|
||||
otherwise prefer to leave things as they are.
|
||||
|
||||
For new code, run `make lint` (which runs [clint.py][clint]) to detect style
|
||||
errors. Make sure that the file(s) you intend to be linted are not in
|
||||
`clint-ignored-files.txt`. It's not perfect, so some warnings may be false
|
||||
positives/negatives. To have `clint.py` ignore certain cases, put `// NOLINT`
|
||||
at the end of the line.
|
||||
errors. It's not perfect, so some warnings may be false positives/negatives.
|
||||
To have `clint.py` ignore certain cases, put `// NOLINT` at the end of the
|
||||
line.
|
||||
|
||||
We also provide a configuration file for [`clang-format`][clang-format], which
|
||||
can be used to format code according to the style guidelines. Be aware that
|
||||
@@ -196,6 +190,4 @@ such as [`tig`][tig].
|
||||
[wiki-contributing]: https://github.com/neovim/neovim/wiki/Contributing
|
||||
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
|
||||
[wiki-review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
|
||||
[wiki-troubleshooting-build-issues]: https://github.com/neovim/neovim/wiki/Troubleshooting#build-issues
|
||||
[wiki-troubleshooting-runtime-issues]: https://github.com/neovim/neovim/wiki/Troubleshooting#runtime-issues
|
||||
[wiki-troubleshooting]: https://github.com/neovim/neovim/wiki/Troubleshooting
|
||||
|
16
ISSUE_TEMPLATE.md
Normal file
16
ISSUE_TEMPLATE.md
Normal file
@@ -0,0 +1,16 @@
|
||||
- Neovim version:
|
||||
- [ ] Vim behaves differently? Vim version:
|
||||
- Operating system/version:
|
||||
- Terminal name/version:
|
||||
- `$TERM`:
|
||||
|
||||
### Actual behaviour
|
||||
|
||||
### Expected behaviour
|
||||
|
||||
### Steps to reproduce using `nvim -u NORC`
|
||||
|
||||
```
|
||||
nvim -u NORC
|
||||
|
||||
```
|
10
Makefile
10
Makefile
@@ -45,6 +45,11 @@ ifneq (,$(USE_BUNDLED_DEPS))
|
||||
BUNDLED_CMAKE_FLAG := -DUSE_BUNDLED=$(USE_BUNDLED_DEPS)
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring functionaltest-lua,$(MAKECMDGOALS)))
|
||||
BUNDLED_LUA_CMAKE_FLAG := -DUSE_BUNDLED_LUA=ON
|
||||
$(shell [ -x .deps/usr/bin/lua ] || rm build/.ran-*)
|
||||
endif
|
||||
|
||||
# For use where we want to make sure only a single job is run. This does issue
|
||||
# a warning, but we need to keep SCRIPTS argument.
|
||||
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
|
||||
@@ -74,7 +79,7 @@ build/.ran-third-party-cmake:
|
||||
ifeq ($(call filter-true,$(USE_BUNDLED_DEPS)),)
|
||||
mkdir -p .deps
|
||||
cd .deps && \
|
||||
cmake -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) \
|
||||
cmake -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
|
||||
$(DEPS_CMAKE_FLAGS) ../third-party
|
||||
endif
|
||||
mkdir -p build
|
||||
@@ -86,6 +91,9 @@ oldtest: | nvim
|
||||
functionaltest: | nvim
|
||||
+$(BUILD_CMD) -C build functionaltest
|
||||
|
||||
functionaltest-lua: | nvim
|
||||
+$(BUILD_CMD) -C build functionaltest-lua
|
||||
|
||||
testlint: | nvim
|
||||
$(BUILD_CMD) -C build testlint
|
||||
|
||||
|
283
clint.py
283
clint.py
@@ -191,6 +191,7 @@ _ERROR_CATEGORIES = [
|
||||
'readability/nul',
|
||||
'readability/todo',
|
||||
'readability/utf8',
|
||||
'readability/increment',
|
||||
'runtime/arrays',
|
||||
'runtime/int',
|
||||
'runtime/invalid_increment',
|
||||
@@ -198,6 +199,8 @@ _ERROR_CATEGORIES = [
|
||||
'runtime/printf',
|
||||
'runtime/printf_format',
|
||||
'runtime/threadsafe_fn',
|
||||
'syntax/parenthesis',
|
||||
'whitespace/alignment',
|
||||
'whitespace/blank_line',
|
||||
'whitespace/braces',
|
||||
'whitespace/comma',
|
||||
@@ -213,7 +216,7 @@ _ERROR_CATEGORIES = [
|
||||
'whitespace/parens',
|
||||
'whitespace/semicolon',
|
||||
'whitespace/tab',
|
||||
'whitespace/todo'
|
||||
'whitespace/todo',
|
||||
]
|
||||
|
||||
# The default state of the category filter. This is overrided by the --filter=
|
||||
@@ -826,9 +829,9 @@ def Error(filename, linenum, category, confidence, message):
|
||||
_RE_PATTERN_CLEANSE_LINE_ESCAPES = re.compile(
|
||||
r'\\([abfnrtv?"\\\']|\d+|x[0-9a-fA-F]+)')
|
||||
# Matches strings. Escape codes should already be removed by ESCAPES.
|
||||
_RE_PATTERN_CLEANSE_LINE_DOUBLE_QUOTES = re.compile(r'"[^"]*"')
|
||||
_RE_PATTERN_CLEANSE_LINE_DOUBLE_QUOTES = re.compile(r'"([^"]*)"')
|
||||
# Matches characters. Escape codes should already be removed by ESCAPES.
|
||||
_RE_PATTERN_CLEANSE_LINE_SINGLE_QUOTES = re.compile(r"'.'")
|
||||
_RE_PATTERN_CLEANSE_LINE_SINGLE_QUOTES = re.compile(r"'(.)'")
|
||||
# Matches multi-line C++ comments.
|
||||
# This RE is a little bit more complicated than one might expect, because we
|
||||
# have to take care of space removals tools so we can handle comments inside
|
||||
@@ -923,39 +926,48 @@ def CleanseComments(line):
|
||||
|
||||
class CleansedLines(object):
|
||||
|
||||
"""Holds 3 copies of all lines with different preprocessing applied to them.
|
||||
"""Holds 5 copies of all lines with different preprocessing applied to them.
|
||||
|
||||
1) elided member contains lines without strings and comments,
|
||||
2) lines member contains lines without comments, and
|
||||
3) raw_lines member contains all the lines without processing.
|
||||
3) raw_lines member contains all the lines with multiline comments replaced.
|
||||
4) init_lines member contains all the lines without processing.
|
||||
5) elided_with_space_strings is like elided, but with string literals
|
||||
looking like `" "`.
|
||||
All these three members are of <type 'list'>, and of the same length.
|
||||
"""
|
||||
|
||||
def __init__(self, lines):
|
||||
def __init__(self, lines, init_lines):
|
||||
self.elided = []
|
||||
self.lines = []
|
||||
self.raw_lines = lines
|
||||
self.num_lines = len(lines)
|
||||
self.init_lines = init_lines
|
||||
self.lines_without_raw_strings = lines
|
||||
self.elided_with_space_strings = []
|
||||
for linenum in range(len(self.lines_without_raw_strings)):
|
||||
self.lines.append(CleanseComments(
|
||||
self.lines_without_raw_strings[linenum]))
|
||||
elided = self._CollapseStrings(
|
||||
self.lines_without_raw_strings[linenum])
|
||||
self.elided.append(CleanseComments(elided))
|
||||
elided = CleanseComments(self._CollapseStrings(
|
||||
self.lines_without_raw_strings[linenum], True))
|
||||
self.elided_with_space_strings.append(elided)
|
||||
|
||||
def NumLines(self):
|
||||
"""Returns the number of lines represented."""
|
||||
return self.num_lines
|
||||
|
||||
@staticmethod
|
||||
def _CollapseStrings(elided):
|
||||
def _CollapseStrings(elided, keep_spaces=False):
|
||||
"""Collapses strings and chars on a line to simple "" or '' blocks.
|
||||
|
||||
We nix strings first so we're not fooled by text like '"http://"'
|
||||
|
||||
Args:
|
||||
elided: The line being processed.
|
||||
keep_spaces: If true, collapse to
|
||||
|
||||
Returns:
|
||||
The line with collapsed strings.
|
||||
@@ -964,12 +976,75 @@ class CleansedLines(object):
|
||||
# Remove escaped characters first to make quote/single quote
|
||||
# collapsing basic. Things that look like escaped characters
|
||||
# shouldn't occur outside of strings and chars.
|
||||
elided = _RE_PATTERN_CLEANSE_LINE_ESCAPES.sub('', elided)
|
||||
elided = _RE_PATTERN_CLEANSE_LINE_SINGLE_QUOTES.sub("''", elided)
|
||||
elided = _RE_PATTERN_CLEANSE_LINE_DOUBLE_QUOTES.sub('""', elided)
|
||||
elided = _RE_PATTERN_CLEANSE_LINE_ESCAPES.sub(
|
||||
'' if not keep_spaces else lambda m: ' ' * len(m.group(0)),
|
||||
elided)
|
||||
elided = _RE_PATTERN_CLEANSE_LINE_SINGLE_QUOTES.sub(
|
||||
"''" if not keep_spaces
|
||||
else lambda m: "'" + (' ' * len(m.group(1))) + "'",
|
||||
elided)
|
||||
elided = _RE_PATTERN_CLEANSE_LINE_DOUBLE_QUOTES.sub(
|
||||
'""' if not keep_spaces
|
||||
else lambda m: '"' + (' ' * len(m.group(1))) + '"',
|
||||
elided)
|
||||
return elided
|
||||
|
||||
|
||||
BRACES = {
|
||||
'(': ')',
|
||||
'{': '}',
|
||||
'[': ']',
|
||||
# '<': '>', C++-specific pair removed
|
||||
}
|
||||
|
||||
|
||||
CLOSING_BRACES = dict(((v, k) for k, v in BRACES.items()))
|
||||
|
||||
|
||||
def GetExprBracesPosition(clean_lines, linenum, pos):
|
||||
"""List positions of all kinds of braces
|
||||
|
||||
If input points to ( or { or [ then function proceeds until finding the
|
||||
position which closes it.
|
||||
|
||||
Args:
|
||||
clean_lines: A CleansedLines instance containing the file.
|
||||
linenum: Current line number.
|
||||
pos: A position on the line.
|
||||
|
||||
Yields:
|
||||
A tuple (linenum, pos, brace, depth) that points to each brace.
|
||||
Additionally each new line (linenum, pos, 's', depth) is yielded, for each
|
||||
line end (linenum, pos, 'e', depth) is yielded and at the very end it
|
||||
yields (linenum, pos, None, None).
|
||||
"""
|
||||
depth = 0
|
||||
yielded_line_start = True
|
||||
startpos = pos
|
||||
while linenum < clean_lines.NumLines() - 1:
|
||||
line = clean_lines.elided_with_space_strings[linenum]
|
||||
if not line.startswith('#') or yielded_line_start:
|
||||
# Ignore #ifdefs, but not if it is macros that are checked
|
||||
for i, brace in enumerate(line[startpos:]):
|
||||
pos = i + startpos
|
||||
if brace != ' ' and not yielded_line_start:
|
||||
yield (linenum, pos, 's', depth)
|
||||
yielded_line_start = True
|
||||
if brace in BRACES:
|
||||
depth += 1
|
||||
yield (linenum, pos, brace, depth)
|
||||
elif brace in CLOSING_BRACES:
|
||||
yield (linenum, pos, brace, depth)
|
||||
depth -= 1
|
||||
if depth == 0:
|
||||
yield (linenum, pos, None, None)
|
||||
return
|
||||
yield (linenum, len(line) - 1, 'e', depth)
|
||||
yielded_line_start = False
|
||||
startpos = 0
|
||||
linenum += 1
|
||||
|
||||
|
||||
def FindEndOfExpressionInLine(line, startpos, depth, startchar, endchar):
|
||||
"""Find the position just after the matching endchar.
|
||||
|
||||
@@ -995,9 +1070,9 @@ def FindEndOfExpressionInLine(line, startpos, depth, startchar, endchar):
|
||||
|
||||
|
||||
def CloseExpression(clean_lines, linenum, pos):
|
||||
"""If input points to ( or { or [ or <, finds the position that closes it.
|
||||
"""If input points to ( or { or [, finds the position that closes it.
|
||||
|
||||
If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
|
||||
If lines[linenum][pos] points to a '(' or '{' or '[', finds the
|
||||
linenum/pos that correspond to the closing of the expression.
|
||||
|
||||
Args:
|
||||
@@ -1014,16 +1089,9 @@ def CloseExpression(clean_lines, linenum, pos):
|
||||
|
||||
line = clean_lines.elided[linenum]
|
||||
startchar = line[pos]
|
||||
if startchar not in '({[<':
|
||||
if startchar not in BRACES:
|
||||
return (line, clean_lines.NumLines(), -1)
|
||||
if startchar == '(':
|
||||
endchar = ')'
|
||||
if startchar == '[':
|
||||
endchar = ']'
|
||||
if startchar == '{':
|
||||
endchar = '}'
|
||||
if startchar == '<':
|
||||
endchar = '>'
|
||||
endchar = BRACES[startchar]
|
||||
|
||||
# Check first line
|
||||
(end_pos, num_open) = FindEndOfExpressionInLine(
|
||||
@@ -1300,6 +1368,23 @@ def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error):
|
||||
'Use C++11 raw strings or concatenation instead.')
|
||||
|
||||
|
||||
def CheckForOldStyleComments(filename, line, linenum, error):
|
||||
"""Logs an error if we see /*-style comment
|
||||
|
||||
Args:
|
||||
filename: The name of the current file.
|
||||
line: The text of the line to check.
|
||||
linenum: The number of the line to check.
|
||||
error: The function to call with any errors found.
|
||||
"""
|
||||
if line.find('/*') >= 0 and line[-1] != '\\':
|
||||
error(filename, linenum, 'readability/old_style_comment', 5,
|
||||
'/*-style comment found, it should be replaced with //-style. '
|
||||
'/*-style comments are only allowed inside macros. '
|
||||
'Note that you should not use /*-style comments to document '
|
||||
'macros itself, use doxygen-style comments for this.')
|
||||
|
||||
|
||||
threading_list = (
|
||||
('asctime(', 'os_asctime_r('),
|
||||
('ctime(', 'os_ctime_r('),
|
||||
@@ -1968,6 +2053,92 @@ def FindPreviousMatchingAngleBracket(clean_lines, linenum, init_prefix):
|
||||
return False
|
||||
|
||||
|
||||
def CheckExpressionAlignment(filename, clean_lines, linenum, error, startpos=0):
|
||||
"""Checks for the correctness of alignment inside expressions
|
||||
|
||||
Args:
|
||||
filename: The name of the current file.
|
||||
clean_lines: A CleansedLines instance containing the file.
|
||||
linenum: The number of the line to check.
|
||||
error: The function to call with any errors found.
|
||||
startpos: Position where to start searching for expression start.
|
||||
"""
|
||||
level_starts = {}
|
||||
line = clean_lines.elided_with_space_strings[linenum]
|
||||
prev_line_start = Search(r'\S', line).start()
|
||||
depth_line_starts = {}
|
||||
pos = min([
|
||||
idx
|
||||
for idx in (
|
||||
line.find(k, startpos)
|
||||
for k in BRACES
|
||||
if k != '{'
|
||||
)
|
||||
if idx >= 0
|
||||
] + [len(line) + 1])
|
||||
if pos == len(line) + 1:
|
||||
return
|
||||
ignore_error_levels = set()
|
||||
firstlinenum = linenum
|
||||
for linenum, pos, brace, depth in GetExprBracesPosition(
|
||||
clean_lines, linenum, pos
|
||||
):
|
||||
line = clean_lines.elided_with_space_strings[linenum]
|
||||
if depth is None:
|
||||
if pos < len(line) - 1:
|
||||
CheckExpressionAlignment(filename, clean_lines, linenum, error,
|
||||
pos + 1)
|
||||
return
|
||||
elif depth <= 0:
|
||||
error(filename, linenum, 'syntax/parenthesis', 4,
|
||||
'Unbalanced parenthesis')
|
||||
return
|
||||
if brace == 's':
|
||||
assert firstlinenum != linenum
|
||||
if level_starts[depth][1]:
|
||||
if line[pos] == BRACES[depth_line_starts[depth][1]]:
|
||||
if pos != depth_line_starts[depth][0]:
|
||||
if depth not in ignore_error_levels:
|
||||
error(filename, linenum, 'whitespace/indent', 2,
|
||||
'End of the inner expression should have '
|
||||
'the same indent as start')
|
||||
else:
|
||||
if (pos != depth_line_starts[depth][0] + 4
|
||||
and not (depth_line_starts[depth][1] == '{'
|
||||
and pos == depth_line_starts[depth][0] + 2)):
|
||||
if depth not in ignore_error_levels:
|
||||
error(filename, linenum, 'whitespace/indent', 2,
|
||||
'Inner expression indentation should be 4')
|
||||
else:
|
||||
if (pos != level_starts[depth][0] + 1
|
||||
+ (level_starts[depth][2] == '{')):
|
||||
if depth not in ignore_error_levels:
|
||||
error(filename, linenum, 'whitespace/alignment', 2,
|
||||
'Inner expression should be aligned '
|
||||
'as opening brace + 1 (+ 2 in case of {)')
|
||||
prev_line_start = pos
|
||||
elif brace == 'e':
|
||||
pass
|
||||
else:
|
||||
opening = brace in BRACES
|
||||
if opening:
|
||||
# Only treat {} as part of the expression if it is preceded by
|
||||
# "=" (brace initializer) or "(type)" (construct like (struct
|
||||
# foo) { ... }).
|
||||
if brace == '{' and not (Search(
|
||||
r'(?:= *|\((?:struct )?\w+(\s*\[\w*\])?\)) *$',
|
||||
line[:pos])
|
||||
):
|
||||
ignore_error_levels.add(depth)
|
||||
line_ended_with_opening = (
|
||||
pos == len(line) - 2 * (line.endswith(' \\')) - 1)
|
||||
level_starts[depth] = (pos, line_ended_with_opening, brace)
|
||||
if line_ended_with_opening:
|
||||
depth_line_starts[depth] = (prev_line_start, brace)
|
||||
else:
|
||||
del level_starts[depth]
|
||||
|
||||
|
||||
def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
|
||||
"""Checks for the correctness of various spacing issues in the code.
|
||||
|
||||
@@ -1975,7 +2146,8 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
|
||||
if/for/while/switch, no spaces around parens in function calls, two
|
||||
spaces between code and comment, don't start a block with a blank
|
||||
line, don't end a function with a blank line, don't add a blank line
|
||||
after public/protected/private, don't have too many blank lines in a row.
|
||||
after public/protected/private, don't have too many blank lines in a row,
|
||||
spaces after {, spaces before }.
|
||||
|
||||
Args:
|
||||
filename: The name of the current file.
|
||||
@@ -2120,6 +2292,11 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
|
||||
# there's too little whitespace, we get concerned. It's hard to tell,
|
||||
# though, so we punt on this one for now. TODO.
|
||||
|
||||
match = Search(r'(?:[^ (*/![])+(?<!\+\+|--)\*', line)
|
||||
if match:
|
||||
error(filename, linenum, 'whitespace/operators', 2,
|
||||
'Missing space before asterisk in %s' % match.group(0))
|
||||
|
||||
# You should always have whitespace around binary operators.
|
||||
#
|
||||
# Check <= and >= first to avoid false positives with < and >, then
|
||||
@@ -2236,6 +2413,10 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
|
||||
# Next we will look for issues with function calls.
|
||||
CheckSpacingForFunctionCall(filename, line, linenum, error)
|
||||
|
||||
# Check whether everything inside expressions is aligned correctly
|
||||
if any((line.find(k) >= 0 for k in BRACES if k != '{')):
|
||||
CheckExpressionAlignment(filename, clean_lines, linenum, error)
|
||||
|
||||
# Except after an opening paren, or after another opening brace (in case of
|
||||
# an initializer list, for instance), you should have spaces before your
|
||||
# braces. And since you should never have braces at the beginning of a line,
|
||||
@@ -2292,8 +2473,6 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
|
||||
'Extra space before [')
|
||||
|
||||
# You shouldn't have a space before a semicolon at the end of the line.
|
||||
# There's a special case for "for" since the style guide allows space before
|
||||
# the semicolon there.
|
||||
if Search(r':\s*;\s*$', line):
|
||||
error(filename, linenum, 'whitespace/semicolon', 5,
|
||||
'Semicolon defining empty statement. Use {} instead.')
|
||||
@@ -2301,12 +2480,18 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
|
||||
error(filename, linenum, 'whitespace/semicolon', 5,
|
||||
'Line contains only semicolon. If this should be an empty'
|
||||
' statement, use {} instead.')
|
||||
elif (Search(r'\s+;\s*$', line) and
|
||||
not Search(r'\bfor\b', line)):
|
||||
elif Search(r'\s+;\s*$', line):
|
||||
error(filename, linenum, 'whitespace/semicolon', 5,
|
||||
'Extra space before last semicolon. If this should be an empty '
|
||||
'statement, use {} instead.')
|
||||
|
||||
if Search(r'\{(?!\})\S', line):
|
||||
error(filename, linenum, 'whitespace/braces', 5,
|
||||
'Missing space after {')
|
||||
if Search(r'\S(?<!\{)\}', line):
|
||||
error(filename, linenum, 'whitespace/braces', 5,
|
||||
'Missing space before }')
|
||||
|
||||
|
||||
def GetPreviousNonBlankLine(clean_lines, linenum):
|
||||
"""Return the most recent non-blank line and its line number.
|
||||
@@ -2361,11 +2546,27 @@ def CheckBraces(filename, clean_lines, linenum, error):
|
||||
' of the previous line')
|
||||
|
||||
# An else clause should be on the same line as the preceding closing brace.
|
||||
# If there is no preceding closing brace, there should be one.
|
||||
if Match(r'\s*else\s*', line):
|
||||
prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
|
||||
if Match(r'\s*}\s*$', prevline):
|
||||
error(filename, linenum, 'whitespace/newline', 4,
|
||||
'An else should appear on the same line as the preceding }')
|
||||
else:
|
||||
error(filename, linenum, 'readability/braces', 5,
|
||||
'An else should always have braces before it')
|
||||
|
||||
# If should always have a brace
|
||||
for blockstart in ('if', 'while', 'for'):
|
||||
if Match(r'\s*{0}(?!\w)[^{{]*$'.format(blockstart), line):
|
||||
pos = line.find(blockstart)
|
||||
pos = line.find('(', pos)
|
||||
if pos > 0:
|
||||
(endline, _, endpos) = CloseExpression(
|
||||
clean_lines, linenum, pos)
|
||||
if endline[endpos:].find('{') == -1:
|
||||
error(filename, linenum, 'readability/braces', 5,
|
||||
'{0} should always use braces'.format(blockstart))
|
||||
|
||||
# If braces come on one side of an else, they should be on both.
|
||||
# However, we have to worry about "else if" that spans multiple lines!
|
||||
@@ -2999,6 +3200,23 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension,
|
||||
error(filename, linenum, 'readability/bool', 4,
|
||||
'Use %s instead of %s.' % (token.lower(), token))
|
||||
|
||||
# Detect preincrement/predecrement
|
||||
match = Match(r'^\s*(?:\+\+|--)', line)
|
||||
if match:
|
||||
error(filename, linenum, 'readability/increment', 5,
|
||||
'Do not use preincrement in statements, '
|
||||
'use postincrement instead')
|
||||
# Detect preincrement/predecrement in for(;; preincrement)
|
||||
match = Search(r';\s*(\+\+|--)', line)
|
||||
if match:
|
||||
end_pos, end_depth = FindEndOfExpressionInLine(line, match.start(1), 1,
|
||||
'(', ')')
|
||||
expr = line[match.start(1):end_pos]
|
||||
if end_depth == 0 and ';' not in expr and ' = ' not in expr:
|
||||
error(filename, linenum, 'readability/increment', 4,
|
||||
'Do not use preincrement in statements, including '
|
||||
'for(;; action)')
|
||||
|
||||
|
||||
def ProcessLine(filename, file_extension, clean_lines, line,
|
||||
include_state, function_state, nesting_state, error,
|
||||
@@ -3026,12 +3244,14 @@ def ProcessLine(filename, file_extension, clean_lines, line,
|
||||
arguments : filename, clean_lines, line, error
|
||||
"""
|
||||
raw_lines = clean_lines.raw_lines
|
||||
init_lines = clean_lines.init_lines
|
||||
ParseNolintSuppressions(filename, raw_lines[line], line, error)
|
||||
nesting_state.Update(filename, clean_lines, line, error)
|
||||
if nesting_state.stack and nesting_state.stack[-1].inline_asm != _NO_ASM:
|
||||
return
|
||||
CheckForFunctionLengths(filename, clean_lines, line, function_state, error)
|
||||
CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error)
|
||||
CheckForOldStyleComments(filename, init_lines[line], line, error)
|
||||
CheckStyle(
|
||||
filename, clean_lines, line, file_extension, nesting_state, error)
|
||||
CheckLanguage(filename, clean_lines, line, file_extension, include_state,
|
||||
@@ -3072,12 +3292,12 @@ def ProcessFileData(filename, file_extension, lines, error,
|
||||
for line in range(1, len(lines)):
|
||||
ParseKnownErrorSuppressions(filename, lines, line)
|
||||
|
||||
if _cpplint_state.record_errors_file:
|
||||
raw_lines = lines[:]
|
||||
init_lines = lines[:]
|
||||
|
||||
if _cpplint_state.record_errors_file:
|
||||
def RecordedError(filename, linenum, category, confidence, message):
|
||||
if not IsErrorSuppressedByNolint(category, linenum):
|
||||
key = raw_lines[linenum - 1 if linenum else 0:linenum + 2]
|
||||
key = init_lines[linenum - 1 if linenum else 0:linenum + 2]
|
||||
err = [filename, key, category]
|
||||
json.dump(err, _cpplint_state.record_errors_file)
|
||||
_cpplint_state.record_errors_file.write('\n')
|
||||
@@ -3089,7 +3309,7 @@ def ProcessFileData(filename, file_extension, lines, error,
|
||||
CheckForHeaderGuard(filename, lines, error)
|
||||
|
||||
RemoveMultiLineComments(filename, lines, error)
|
||||
clean_lines = CleansedLines(lines)
|
||||
clean_lines = CleansedLines(lines, init_lines)
|
||||
for line in range(clean_lines.NumLines()):
|
||||
ProcessLine(filename, file_extension, clean_lines, line,
|
||||
include_state, function_state, nesting_state, error,
|
||||
@@ -3119,7 +3339,7 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]):
|
||||
_SetVerboseLevel(vlevel)
|
||||
|
||||
try:
|
||||
# Support the UNIX convention of using "-" for stdin. Note that
|
||||
# Support the Unix convention of using "-" for stdin. Note that
|
||||
# we are not opening the file with universal newline support
|
||||
# (which codecs doesn't support anyway), so the resulting lines do
|
||||
# contain trailing '\r' characters if we are reading a file that
|
||||
@@ -3287,6 +3507,7 @@ def main():
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
# vim: ts=4 sts=4 sw=4
|
||||
|
||||
# Ignore "too complex" warnings when using pymode.
|
||||
# pylama:ignore=C901
|
||||
|
@@ -34,7 +34,7 @@ endif()
|
||||
if(MSVC)
|
||||
list(APPEND LUAJIT_NAMES lua51)
|
||||
elseif(MINGW)
|
||||
list(APPEND LUAJIT_NAMES libluajit)
|
||||
list(APPEND LUAJIT_NAMES libluajit libluajit-5.1)
|
||||
else()
|
||||
list(APPEND LUAJIT_NAMES luajit-5.1)
|
||||
endif()
|
||||
|
@@ -7,7 +7,9 @@
|
||||
if(NOT MSGPACK_USE_BUNDLED)
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_MSGPACK QUIET msgpack)
|
||||
pkg_search_module(PC_MSGPACK QUIET
|
||||
msgpackc>=${Msgpack_FIND_VERSION}
|
||||
msgpack>=${Msgpack_FIND_VERSION})
|
||||
endif()
|
||||
else()
|
||||
set(PC_MSGPACK_INCLUDEDIR)
|
||||
@@ -19,19 +21,33 @@ endif()
|
||||
|
||||
set(MSGPACK_DEFINITIONS ${PC_MSGPACK_CFLAGS_OTHER})
|
||||
|
||||
find_path(MSGPACK_INCLUDE_DIR msgpack.h
|
||||
find_path(MSGPACK_INCLUDE_DIR msgpack/version_master.h
|
||||
HINTS ${PC_MSGPACK_INCLUDEDIR} ${PC_MSGPACK_INCLUDE_DIRS}
|
||||
${LIMIT_SEARCH})
|
||||
|
||||
# If we're asked to use static linkage, add libmsgpack.a as a preferred library name.
|
||||
if(MSGPACK_INCLUDE_DIR)
|
||||
file(READ ${MSGPACK_INCLUDE_DIR}/msgpack/version_master.h msgpack_version_h)
|
||||
string(REGEX REPLACE ".*MSGPACK_VERSION_MAJOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MAJOR "${msgpack_version_h}")
|
||||
string(REGEX REPLACE ".*MSGPACK_VERSION_MINOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MINOR "${msgpack_version_h}")
|
||||
string(REGEX REPLACE ".*MSGPACK_VERSION_REVISION +([0-9]+).*" "\\1" MSGPACK_VERSION_REVISION "${msgpack_version_h}")
|
||||
set(MSGPACK_VERSION_STRING "${MSGPACK_VERSION_MAJOR}.${MSGPACK_VERSION_MINOR}.${MSGPACK_VERSION_REVISION}")
|
||||
else()
|
||||
set(MSGPACK_VERSION_STRING)
|
||||
endif()
|
||||
|
||||
# If we're asked to use static linkage, add libmsgpack{,c}.a as a preferred library name.
|
||||
if(MSGPACK_USE_STATIC)
|
||||
list(APPEND MSGPACK_NAMES
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpackc${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpack${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||
endif()
|
||||
|
||||
list(APPEND MSGPACK_NAMES msgpack)
|
||||
list(APPEND MSGPACK_NAMES msgpackc msgpack)
|
||||
|
||||
find_library(MSGPACK_LIBRARY NAMES ${MSGPACK_NAMES}
|
||||
# Check each directory for all names to avoid using headers/libraries from
|
||||
# different places.
|
||||
NAMES_PER_DIR
|
||||
HINTS ${PC_MSGPACK_LIBDIR} ${PC_MSGPACK_LIBRARY_DIRS}
|
||||
${LIMIT_SEARCH})
|
||||
|
||||
@@ -43,6 +59,7 @@ set(MSGPACK_INCLUDE_DIRS ${MSGPACK_INCLUDE_DIR})
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set MSGPACK_FOUND to TRUE
|
||||
# if all listed variables are TRUE
|
||||
find_package_handle_standard_args(Msgpack DEFAULT_MSG
|
||||
MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR)
|
||||
find_package_handle_standard_args(Msgpack
|
||||
REQUIRED_VARS MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR
|
||||
VERSION_VAR MSGPACK_VERSION_STRING)
|
||||
|
||||
|
@@ -2,7 +2,11 @@ get_filename_component(LINT_DIR ${LINT_DIR} ABSOLUTE)
|
||||
get_filename_component(LINT_PREFIX ${LINT_DIR} PATH)
|
||||
set(LINT_SUPPRESS_FILE "${LINT_PREFIX}/errors.json")
|
||||
|
||||
file(GLOB_RECURSE LINT_FILES ${LINT_DIR}/*.c ${LINT_DIR}/*.h)
|
||||
if(DEFINED ENV{LINT_FILE})
|
||||
file(GLOB_RECURSE LINT_FILES "$ENV{LINT_FILE}")
|
||||
else()
|
||||
file(GLOB_RECURSE LINT_FILES ${LINT_DIR}/*.c ${LINT_DIR}/*.h)
|
||||
endif()
|
||||
|
||||
set(LINT_ARGS)
|
||||
|
||||
|
@@ -8,7 +8,6 @@ include(CheckCSourceCompiles)
|
||||
check_type_size("int" SIZEOF_INT)
|
||||
check_type_size("long" SIZEOF_LONG)
|
||||
check_type_size("intmax_t" SIZEOF_INTMAX_T)
|
||||
check_type_size("off_t" SIZEOF_OFF_T)
|
||||
check_type_size("size_t" SIZEOF_SIZE_T)
|
||||
check_type_size("long long" SIZEOF_LONG_LONG)
|
||||
check_type_size("void *" SIZEOF_VOID_PTR)
|
||||
@@ -16,29 +15,21 @@ check_type_size("void *" SIZEOF_VOID_PTR)
|
||||
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
|
||||
|
||||
# Headers
|
||||
check_include_files(dirent.h HAVE_DIRENT_H)
|
||||
check_include_files(fcntl.h HAVE_FCNTL_H)
|
||||
check_include_files(iconv.h HAVE_ICONV_H)
|
||||
check_include_files(langinfo.h HAVE_LANGINFO_H)
|
||||
check_include_files(libgen.h HAVE_LIBGEN_H)
|
||||
check_include_files(locale.h HAVE_LOCALE_H)
|
||||
check_include_files(pwd.h HAVE_PWD_H)
|
||||
check_include_files(strings.h HAVE_STRINGS_H)
|
||||
check_include_files(stropts.h HAVE_STROPTS_H)
|
||||
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
|
||||
check_include_files(sys/wait.h HAVE_SYS_WAIT_H)
|
||||
if(NOT HAVE_SYS_WAIT_H AND UNIX)
|
||||
# See if_cscope.c
|
||||
message(SEND_ERROR "header sys/wait.h is required for UNIX")
|
||||
message(SEND_ERROR "header sys/wait.h is required for Unix")
|
||||
endif()
|
||||
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
|
||||
check_include_files(utime.h HAVE_UTIME_H)
|
||||
check_include_files(unistd.h HAVE_UNISTD_H)
|
||||
check_include_files(utime.h HAVE_UTIME_H)
|
||||
|
||||
# Functions
|
||||
check_function_exists(fseeko HAVE_FSEEKO)
|
||||
check_function_exists(fsync HAVE_FSYNC)
|
||||
check_function_exists(getpwent HAVE_GETPWENT)
|
||||
check_function_exists(getpwnam HAVE_GETPWNAM)
|
||||
check_function_exists(getpwuid HAVE_GETPWUID)
|
||||
@@ -51,7 +42,10 @@ if(JEMALLOC_FOUND)
|
||||
set(HAVE_JEMALLOC 1)
|
||||
endif()
|
||||
|
||||
check_function_exists(putenv HAVE_PUTENV)
|
||||
check_function_exists(_putenv_s HAVE_PUTENV_S)
|
||||
if(WIN32 AND NOT HAVE_PUTENV_S)
|
||||
message(SEND_ERROR "_putenv_s() function not found on your system.")
|
||||
endif()
|
||||
check_function_exists(opendir HAVE_OPENDIR)
|
||||
check_function_exists(readlink HAVE_READLINK)
|
||||
check_function_exists(setenv HAVE_SETENV)
|
||||
@@ -98,10 +92,10 @@ endif()
|
||||
if (NOT "${HAVE_BE64TOH}")
|
||||
if (NOT "${CMAKE_CROSSCOMPILING}")
|
||||
# It is safe to make ORDER_BIG_ENDIAN not defined if
|
||||
# - HAVE_BE64TOH is true. In this case be64toh will be used unconditionally in
|
||||
# - HAVE_BE64TOH is true. In this case be64toh will be used unconditionally in
|
||||
# any case and ORDER_BIG_ENDIAN will not be examined.
|
||||
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
|
||||
# be64toh function which uses cycle and arithmetic operations is used which
|
||||
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
|
||||
# be64toh function which uses cycle and arithmetic operations is used which
|
||||
# will work regardless of endianess. Function is sub-optimal though.
|
||||
check_c_source_runs("
|
||||
${SI}
|
||||
|
@@ -5,7 +5,6 @@
|
||||
|
||||
#define SIZEOF_INT @SIZEOF_INT@
|
||||
#define SIZEOF_LONG @SIZEOF_LONG@
|
||||
#define SIZEOF_OFF_T @SIZEOF_OFF_T@
|
||||
|
||||
#if @SIZEOF_VOID_PTR@ == 8
|
||||
#define ARCH_64
|
||||
@@ -13,23 +12,22 @@
|
||||
#define ARCH_32
|
||||
#endif
|
||||
|
||||
#define PROJECT_NAME "@PROJECT_NAME@"
|
||||
#define LOCALE_INSTALL_DIR "@CMAKE_INSTALL_FULL_LOCALEDIR@"
|
||||
|
||||
#cmakedefine HAVE__NSGETENVIRON
|
||||
#cmakedefine HAVE_CRT_EXTERNS_H
|
||||
#cmakedefine HAVE_FCNTL_H
|
||||
#cmakedefine HAVE_FD_CLOEXEC
|
||||
#cmakedefine HAVE_FSEEKO
|
||||
#cmakedefine HAVE_FSYNC
|
||||
#cmakedefine HAVE_GETPWENT
|
||||
#cmakedefine HAVE_GETPWNAM
|
||||
#cmakedefine HAVE_GETPWUID
|
||||
#cmakedefine HAVE_ICONV
|
||||
#cmakedefine HAVE_ICONV_H
|
||||
#cmakedefine HAVE_LANGINFO_H
|
||||
#cmakedefine HAVE_LIBGEN_H
|
||||
#cmakedefine HAVE_LOCALE_H
|
||||
#cmakedefine HAVE_NL_LANGINFO_CODESET
|
||||
#cmakedefine HAVE_NL_MSG_CAT_CNTR
|
||||
#cmakedefine HAVE_PUTENV
|
||||
#cmakedefine HAVE_PUTENV_S
|
||||
#cmakedefine HAVE_PWD_H
|
||||
#cmakedefine HAVE_READLINK
|
||||
// TODO: add proper cmake check
|
||||
@@ -42,11 +40,8 @@
|
||||
#cmakedefine HAVE_STRCASECMP
|
||||
#cmakedefine HAVE_STRINGS_H
|
||||
#cmakedefine HAVE_STRNCASECMP
|
||||
#cmakedefine HAVE_STROPTS_H
|
||||
#cmakedefine HAVE_SYS_PARAM_H
|
||||
#cmakedefine HAVE_SYS_UTSNAME_H
|
||||
#cmakedefine HAVE_SYS_WAIT_H
|
||||
#cmakedefine HAVE_UNISTD_H
|
||||
#cmakedefine HAVE_UTIME
|
||||
#cmakedefine HAVE_UTIME_H
|
||||
#cmakedefine HAVE_UTIMES
|
||||
|
@@ -5,7 +5,6 @@
|
||||
#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
|
||||
#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
|
||||
#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
|
||||
#cmakedefine NVIM_VERSION_COMMIT "@NVIM_VERSION_COMMIT@"
|
||||
#cmakedefine NVIM_VERSION_MEDIUM "@NVIM_VERSION_MEDIUM@"
|
||||
|
||||
#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
|
||||
|
@@ -9,7 +9,7 @@ def DirectoryOfThisScript():
|
||||
|
||||
def GetDatabase():
|
||||
compilation_database_folder = os.path.join(DirectoryOfThisScript(),
|
||||
'..', '..', 'build')
|
||||
'..', 'build')
|
||||
if os.path.exists(compilation_database_folder):
|
||||
return ycm_core.CompilationDatabase(compilation_database_folder)
|
||||
return None
|
||||
|
@@ -31,6 +31,11 @@
|
||||
#
|
||||
# CMAKE_BUILD_TYPE := Debug
|
||||
|
||||
# By default, nvim's log level is INFO (1) (unless CMAKE_BUILD_TYPE is
|
||||
# "Release", in which case logging is disabled).
|
||||
# The log level must be a number DEBUG (0), INFO (1), WARNING (2) or ERROR (3).
|
||||
# CMAKE_EXTRA_FLAGS += -DMIN_LOG_LEVEL=1
|
||||
|
||||
# By default, nvim uses bundled versions of its required third-party
|
||||
# dependencies.
|
||||
# Uncomment these entries to instead use system-wide installations of
|
||||
|
22
man/nvim.1
22
man/nvim.1
@@ -1,4 +1,4 @@
|
||||
.Dd November 11, 2015
|
||||
.Dd January 28, 2016
|
||||
.Dt NVIM 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -75,7 +75,7 @@ Can be used to edit files starting with a hyphen
|
||||
.Pq Sq - .
|
||||
.It Fl -literal
|
||||
Interpret filenames literally, that is, do not expand wildcards.
|
||||
Has no effect on UNIX-like systems, where the shell expands wildcards.
|
||||
Has no effect on Unix-like systems, where the shell expands wildcards.
|
||||
.It Fl e
|
||||
Ex mode.
|
||||
See
|
||||
@@ -373,8 +373,24 @@ Used to set the 'shell' option, which determines the shell used by the
|
||||
command.
|
||||
.It Ev NVIM_TUI_ENABLE_CURSOR_SHAPE
|
||||
If defined, change the cursor shape to a vertical bar while in insert mode.
|
||||
Requires that the host terminal support the DECSCUSR CSI escape sequence.
|
||||
Requires that the host terminal supports the DECSCUSR CSI escape sequence.
|
||||
Has no effect in GUIs.
|
||||
.Pp
|
||||
Depending on the terminal emulator, using this option with
|
||||
.Nm
|
||||
under
|
||||
.Xr tmux 1
|
||||
might require adding the following to
|
||||
.Pa ~/.tmux.conf :
|
||||
.Bd -literal -offset indent
|
||||
set -ga terminal-overrides ',*:Ss=\eE[%p1%d q:Se=\eE[2 q'
|
||||
.Ed
|
||||
.Pp
|
||||
See
|
||||
.Ic terminal-overrides
|
||||
in the
|
||||
.Xr tmux 1
|
||||
manual page for more information.
|
||||
.It Ev NVIM_TUI_ENABLE_TRUE_COLOR
|
||||
If defined, assume the host terminal supports 24 bit colors.
|
||||
Has no effect in GUIs.
|
||||
|
@@ -26,24 +26,21 @@ foreach(DF ${DOCFILES})
|
||||
list(APPEND BUILDDOCFILES ${GENERATED_RUNTIME_DIR}/doc/${F})
|
||||
endforeach()
|
||||
|
||||
add_custom_command(OUTPUT ${BUILDDOCFILES}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
add_custom_command(OUTPUT copy_docfiles
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
|
||||
DEPENDS
|
||||
${DOCFILES})
|
||||
)
|
||||
|
||||
add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
|
||||
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
|
||||
-u NONE
|
||||
-i NONE
|
||||
-es
|
||||
-e
|
||||
--headless
|
||||
-c "helptags ++t ."
|
||||
-c quit
|
||||
DEPENDS
|
||||
${BUILDDOCFILES}
|
||||
copy_docfiles
|
||||
nvim
|
||||
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
|
||||
)
|
||||
|
@@ -1,667 +0,0 @@
|
||||
" ---------------------------------------------------------------------
|
||||
" getscript.vim
|
||||
" Author: Charles E. Campbell
|
||||
" Date: Jan 21, 2014
|
||||
" Version: 36
|
||||
" Installing: :help glvs-install
|
||||
" Usage: :help glvs
|
||||
"
|
||||
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
|
||||
"redraw!|call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
" ---------------------------------------------------------------------
|
||||
" Initialization: {{{1
|
||||
" if you're sourcing this file, surely you can't be
|
||||
" expecting vim to be in its vi-compatible mode!
|
||||
if exists("g:loaded_getscript")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_getscript= "v36"
|
||||
if &cp
|
||||
echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
|
||||
finish
|
||||
endif
|
||||
if v:version < 702
|
||||
echohl WarningMsg
|
||||
echo "***warning*** this version of getscript needs vim 7.2"
|
||||
echohl Normal
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
"DechoTabOn
|
||||
|
||||
" ---------------------------
|
||||
" Global Variables: {{{1
|
||||
" ---------------------------
|
||||
" Cygwin Detection ------- {{{2
|
||||
if !exists("g:getscript_cygwin")
|
||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||
if &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$'
|
||||
let g:getscript_cygwin= 1
|
||||
else
|
||||
let g:getscript_cygwin= 0
|
||||
endif
|
||||
else
|
||||
let g:getscript_cygwin= 0
|
||||
endif
|
||||
endif
|
||||
|
||||
" wget vs curl {{{2
|
||||
if !exists("g:GetLatestVimScripts_wget")
|
||||
if executable("wget")
|
||||
let g:GetLatestVimScripts_wget= "wget"
|
||||
elseif executable("curl")
|
||||
let g:GetLatestVimScripts_wget= "curl"
|
||||
else
|
||||
let g:GetLatestVimScripts_wget = 'echo "GetLatestVimScripts needs wget or curl"'
|
||||
let g:GetLatestVimScripts_options = ""
|
||||
endif
|
||||
endif
|
||||
|
||||
" options that wget and curl require:
|
||||
if !exists("g:GetLatestVimScripts_options")
|
||||
if g:GetLatestVimScripts_wget == "wget"
|
||||
let g:GetLatestVimScripts_options= "-q -O"
|
||||
elseif g:GetLatestVimScripts_wget == "curl"
|
||||
let g:GetLatestVimScripts_options= "-s -O"
|
||||
else
|
||||
let g:GetLatestVimScripts_options= ""
|
||||
endif
|
||||
endif
|
||||
|
||||
" by default, allow autoinstall lines to work
|
||||
if !exists("g:GetLatestVimScripts_allowautoinstall")
|
||||
let g:GetLatestVimScripts_allowautoinstall= 1
|
||||
endif
|
||||
|
||||
" set up default scriptaddr address
|
||||
if !exists("g:GetLatestVimScripts_scriptaddr")
|
||||
let g:GetLatestVimScripts_scriptaddr = 'http://vim.sourceforge.net/script.php?script_id='
|
||||
endif
|
||||
|
||||
"" For debugging:
|
||||
"let g:GetLatestVimScripts_wget = "echo"
|
||||
"let g:GetLatestVimScripts_options = "options"
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Check If AutoInstall Capable: {{{1
|
||||
let s:autoinstall= ""
|
||||
if g:GetLatestVimScripts_allowautoinstall
|
||||
|
||||
if (has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95")) && &shell != "bash"
|
||||
" windows (but not cygwin/bash)
|
||||
let s:dotvim= "vimfiles"
|
||||
if !exists("g:GetLatestVimScripts_mv")
|
||||
let g:GetLatestVimScripts_mv= "ren"
|
||||
endif
|
||||
|
||||
else
|
||||
" unix
|
||||
let s:dotvim= ".vim"
|
||||
if !exists("g:GetLatestVimScripts_mv")
|
||||
let g:GetLatestVimScripts_mv= "mv"
|
||||
endif
|
||||
endif
|
||||
|
||||
if exists("g:GetLatestVimScripts_autoinstalldir") && isdirectory(g:GetLatestVimScripts_autoinstalldir)
|
||||
let s:autoinstall= g:GetLatestVimScripts_autoinstalldir"
|
||||
elseif exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim)
|
||||
let s:autoinstall= $HOME."/".s:dotvim
|
||||
endif
|
||||
" call Decho("s:autoinstall<".s:autoinstall.">")
|
||||
"else "Decho
|
||||
" call Decho("g:GetLatestVimScripts_allowautoinstall=".g:GetLatestVimScripts_allowautoinstall.": :AutoInstall: disabled")
|
||||
endif
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Public Interface: {{{1
|
||||
com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts()
|
||||
com! -nargs=0 GetScript call getscript#GetLatestVimScripts()
|
||||
silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts()
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" GetLatestVimScripts: this function gets the latest versions of {{{1
|
||||
" scripts based on the list in
|
||||
" (first dir in runtimepath)/GetLatest/GetLatestVimScripts.dat
|
||||
fun! getscript#GetLatestVimScripts()
|
||||
" call Dfunc("GetLatestVimScripts() autoinstall<".s:autoinstall.">")
|
||||
|
||||
" insure that wget is executable
|
||||
if executable(g:GetLatestVimScripts_wget) != 1
|
||||
echoerr "GetLatestVimScripts needs ".g:GetLatestVimScripts_wget." which apparently is not available on your system"
|
||||
" call Dret("GetLatestVimScripts : wget not executable/availble")
|
||||
return
|
||||
endif
|
||||
|
||||
" insure that fnameescape() is available
|
||||
if !exists("*fnameescape")
|
||||
echoerr "GetLatestVimScripts needs fnameescape() (provided by 7.1.299 or later)"
|
||||
return
|
||||
endif
|
||||
|
||||
" Find the .../GetLatest subdirectory under the runtimepath
|
||||
for datadir in split(&rtp,',') + ['']
|
||||
if isdirectory(datadir."/GetLatest")
|
||||
" call Decho("found directory<".datadir.">")
|
||||
let datadir= datadir . "/GetLatest"
|
||||
break
|
||||
endif
|
||||
if filereadable(datadir."GetLatestVimScripts.dat")
|
||||
" call Decho("found ".datadir."/GetLatestVimScripts.dat")
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
|
||||
" Sanity checks: readability and writability
|
||||
if datadir == ""
|
||||
echoerr 'Missing "GetLatest/" on your runtimepath - see :help glvs-dist-install'
|
||||
" call Dret("GetLatestVimScripts : unable to find a GetLatest subdirectory")
|
||||
return
|
||||
endif
|
||||
if filewritable(datadir) != 2
|
||||
echoerr "(getLatestVimScripts) Your ".datadir." isn't writable"
|
||||
" call Dret("GetLatestVimScripts : non-writable directory<".datadir.">")
|
||||
return
|
||||
endif
|
||||
let datafile= datadir."/GetLatestVimScripts.dat"
|
||||
if !filereadable(datafile)
|
||||
echoerr "Your data file<".datafile."> isn't readable"
|
||||
" call Dret("GetLatestVimScripts : non-readable datafile<".datafile.">")
|
||||
return
|
||||
endif
|
||||
if !filewritable(datafile)
|
||||
echoerr "Your data file<".datafile."> isn't writable"
|
||||
" call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">")
|
||||
return
|
||||
endif
|
||||
" --------------------
|
||||
" Passed sanity checks
|
||||
" --------------------
|
||||
|
||||
" call Decho("datadir <".datadir.">")
|
||||
" call Decho("datafile <".datafile.">")
|
||||
|
||||
" don't let any event handlers interfere (like winmanager's, taglist's, etc)
|
||||
let eikeep = &ei
|
||||
let hlskeep = &hls
|
||||
let acdkeep = &acd
|
||||
set ei=all hls&vim noacd
|
||||
|
||||
" Edit the datafile (ie. GetLatestVimScripts.dat):
|
||||
" 1. record current directory (origdir),
|
||||
" 2. change directory to datadir,
|
||||
" 3. split window
|
||||
" 4. edit datafile
|
||||
let origdir= getcwd()
|
||||
" call Decho("exe cd ".fnameescape(substitute(datadir,'\','/','ge')))
|
||||
exe "cd ".fnameescape(substitute(datadir,'\','/','ge'))
|
||||
split
|
||||
" call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge')))
|
||||
exe "e ".fnameescape(substitute(datafile,'\','/','ge'))
|
||||
res 1000
|
||||
let s:downloads = 0
|
||||
let s:downerrors= 0
|
||||
|
||||
" Check on dependencies mentioned in plugins
|
||||
" call Decho(" ")
|
||||
" call Decho("searching plugins for GetLatestVimScripts dependencies")
|
||||
let lastline = line("$")
|
||||
" call Decho("lastline#".lastline)
|
||||
let firstdir = substitute(&rtp,',.*$','','')
|
||||
let plugins = split(globpath(firstdir,"plugin/**/*.vim"),'\n')
|
||||
let plugins = plugins + split(globpath(firstdir,"AsNeeded/**/*.vim"),'\n')
|
||||
let foundscript = 0
|
||||
|
||||
" this loop updates the GetLatestVimScripts.dat file
|
||||
" with dependencies explicitly mentioned in the plugins
|
||||
" via GetLatestVimScripts: ... lines
|
||||
" It reads the plugin script at the end of the GetLatestVimScripts.dat
|
||||
" file, examines it, and then removes it.
|
||||
for plugin in plugins
|
||||
" call Decho(" ")
|
||||
" call Decho("plugin<".plugin.">")
|
||||
|
||||
" read plugin in
|
||||
" evidently a :r creates a new buffer (the "#" buffer) that is subsequently unused -- bwiping it
|
||||
$
|
||||
" call Decho(".dependency checking<".plugin."> line$=".line("$"))
|
||||
" call Decho("..exe silent r ".fnameescape(plugin))
|
||||
exe "silent r ".fnameescape(plugin)
|
||||
exe "silent bwipe ".bufnr("#")
|
||||
|
||||
while search('^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+','W') != 0
|
||||
let depscript = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e')
|
||||
let depscriptid = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\(\d\+\)\s\+.*$','\1','')
|
||||
let llp1 = lastline+1
|
||||
" call Decho("..depscript<".depscript.">")
|
||||
|
||||
" found a "GetLatestVimScripts: # #" line in the script;
|
||||
" check if its already in the datafile by searching backwards from llp1,
|
||||
" the (prior to reading in the plugin script) last line plus one of the GetLatestVimScripts.dat file,
|
||||
" for the script-id with no wrapping allowed.
|
||||
let curline = line(".")
|
||||
let noai_script = substitute(depscript,'\s*:AutoInstall:\s*','','e')
|
||||
exe llp1
|
||||
let srchline = search('^\s*'.depscriptid.'\s\+\d\+\s\+.*$','bW')
|
||||
if srchline == 0
|
||||
" this second search is taken when, for example, a 0 0 scriptname is to be skipped over
|
||||
let srchline= search('\<'.noai_script.'\>','bW')
|
||||
endif
|
||||
" call Decho("..noai_script<".noai_script."> depscriptid#".depscriptid." srchline#".srchline." curline#".line(".")." lastline#".lastline)
|
||||
|
||||
if srchline == 0
|
||||
" found a new script to permanently include in the datafile
|
||||
let keep_rega = @a
|
||||
let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','')
|
||||
echomsg "Appending <".@a."> to ".datafile." for ".depscript
|
||||
" call Decho("..Appending <".@a."> to ".datafile." for ".depscript)
|
||||
exe lastline."put a"
|
||||
let @a = keep_rega
|
||||
let lastline = llp1
|
||||
let curline = curline + 1
|
||||
let foundscript = foundscript + 1
|
||||
" else " Decho
|
||||
" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")")
|
||||
endif
|
||||
|
||||
let curline = curline + 1
|
||||
exe curline
|
||||
endwhile
|
||||
|
||||
" llp1: last line plus one
|
||||
let llp1= lastline + 1
|
||||
" call Decho(".deleting lines: ".llp1.",$d")
|
||||
exe "silent! ".llp1.",$d"
|
||||
endfor
|
||||
" call Decho("--- end dependency checking loop --- foundscript=".foundscript)
|
||||
" call Decho(" ")
|
||||
" call Dredir("BUFFER TEST (GetLatestVimScripts 1)","ls!")
|
||||
|
||||
if foundscript == 0
|
||||
setlocal nomod
|
||||
endif
|
||||
|
||||
" --------------------------------------------------------------------
|
||||
" Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat
|
||||
" --------------------------------------------------------------------
|
||||
" call Decho("begin: checking out-of-date scripts using datafile<".datafile.">")
|
||||
setlocal lz
|
||||
1
|
||||
" /^-----/,$g/^\s*\d/call Decho(getline("."))
|
||||
1
|
||||
/^-----/,$g/^\s*\d/call s:GetOneScript()
|
||||
" call Decho("--- end out-of-date checking --- ")
|
||||
|
||||
" Final report (an echomsg)
|
||||
try
|
||||
silent! ?^-------?
|
||||
catch /^Vim\%((\a\+)\)\=:E114/
|
||||
" call Dret("GetLatestVimScripts : nothing done!")
|
||||
return
|
||||
endtry
|
||||
exe "norm! kz\<CR>"
|
||||
redraw!
|
||||
let s:msg = ""
|
||||
if s:downloads == 1
|
||||
let s:msg = "Downloaded one updated script to <".datadir.">"
|
||||
elseif s:downloads == 2
|
||||
let s:msg= "Downloaded two updated scripts to <".datadir.">"
|
||||
elseif s:downloads > 1
|
||||
let s:msg= "Downloaded ".s:downloads." updated scripts to <".datadir.">"
|
||||
else
|
||||
let s:msg= "Everything was already current"
|
||||
endif
|
||||
if s:downerrors > 0
|
||||
let s:msg= s:msg." (".s:downerrors." downloading errors)"
|
||||
endif
|
||||
echomsg s:msg
|
||||
" save the file
|
||||
if &mod
|
||||
silent! w!
|
||||
endif
|
||||
q!
|
||||
|
||||
" restore events and current directory
|
||||
exe "cd ".fnameescape(substitute(origdir,'\','/','ge'))
|
||||
let &ei = eikeep
|
||||
let &hls = hlskeep
|
||||
let &acd = acdkeep
|
||||
setlocal nolz
|
||||
" call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!")
|
||||
" call Dret("GetLatestVimScripts : did ".s:downloads." downloads")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" GetOneScript: (Get Latest Vim Script) this function operates {{{1
|
||||
" on the current line, interpreting two numbers and text as
|
||||
" ScriptID, SourceID, and Filename.
|
||||
" It downloads any scripts that have newer versions from vim.sourceforge.net.
|
||||
fun! s:GetOneScript(...)
|
||||
" call Dfunc("GetOneScript()")
|
||||
|
||||
" set options to allow progress to be shown on screen
|
||||
let rega= @a
|
||||
let t_ti= &t_ti
|
||||
let t_te= &t_te
|
||||
let rs = &rs
|
||||
set t_ti= t_te= nors
|
||||
|
||||
" put current line on top-of-screen and interpret it into
|
||||
" a script identifer : used to obtain webpage
|
||||
" source identifier : used to identify current version
|
||||
" and an associated comment: used to report on what's being considered
|
||||
if a:0 >= 3
|
||||
let scriptid = a:1
|
||||
let srcid = a:2
|
||||
let fname = a:3
|
||||
let cmmnt = ""
|
||||
" call Decho("scriptid<".scriptid.">")
|
||||
" call Decho("srcid <".srcid.">")
|
||||
" call Decho("fname <".fname.">")
|
||||
else
|
||||
let curline = getline(".")
|
||||
if curline =~ '^\s*#'
|
||||
let @a= rega
|
||||
" call Dret("GetOneScript : skipping a pure comment line")
|
||||
return
|
||||
endif
|
||||
let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)\(\s*#.*\)\=$'
|
||||
try
|
||||
let scriptid = substitute(curline,parsepat,'\1','e')
|
||||
catch /^Vim\%((\a\+)\)\=:E486/
|
||||
let scriptid= 0
|
||||
endtry
|
||||
try
|
||||
let srcid = substitute(curline,parsepat,'\2','e')
|
||||
catch /^Vim\%((\a\+)\)\=:E486/
|
||||
let srcid= 0
|
||||
endtry
|
||||
try
|
||||
let fname= substitute(curline,parsepat,'\3','e')
|
||||
catch /^Vim\%((\a\+)\)\=:E486/
|
||||
let fname= ""
|
||||
endtry
|
||||
try
|
||||
let cmmnt= substitute(curline,parsepat,'\4','e')
|
||||
catch /^Vim\%((\a\+)\)\=:E486/
|
||||
let cmmnt= ""
|
||||
endtry
|
||||
" call Decho("curline <".curline.">")
|
||||
" call Decho("parsepat<".parsepat.">")
|
||||
" call Decho("scriptid<".scriptid.">")
|
||||
" call Decho("srcid <".srcid.">")
|
||||
" call Decho("fname <".fname.">")
|
||||
endif
|
||||
|
||||
" plugin author protection from downloading his/her own scripts atop their latest work
|
||||
if scriptid == 0 || srcid == 0
|
||||
" When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname
|
||||
let @a= rega
|
||||
" call Dret("GetOneScript : skipping a scriptid==srcid==0 line")
|
||||
return
|
||||
endif
|
||||
|
||||
let doautoinstall= 0
|
||||
if fname =~ ":AutoInstall:"
|
||||
" call Decho("case AutoInstall: fname<".fname.">")
|
||||
let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','')
|
||||
" call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall)
|
||||
if s:autoinstall != ""
|
||||
let doautoinstall = g:GetLatestVimScripts_allowautoinstall
|
||||
endif
|
||||
else
|
||||
let aicmmnt= fname
|
||||
endif
|
||||
" call Decho("aicmmnt<".aicmmnt.">: doautoinstall=".doautoinstall)
|
||||
|
||||
exe "norm z\<CR>"
|
||||
redraw!
|
||||
" call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid)
|
||||
echo 'considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid
|
||||
|
||||
" grab a copy of the plugin's vim.sourceforge.net webpage
|
||||
let scriptaddr = g:GetLatestVimScripts_scriptaddr.scriptid
|
||||
let tmpfile = tempname()
|
||||
let v:errmsg = ""
|
||||
|
||||
" make up to three tries at downloading the description
|
||||
let itry= 1
|
||||
while itry <= 3
|
||||
" call Decho(".try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr)
|
||||
if has("win32") || has("win16") || has("win95")
|
||||
" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)."|bw!")
|
||||
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)|bw!
|
||||
else
|
||||
" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr))
|
||||
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr)
|
||||
endif
|
||||
if itry == 1
|
||||
exe "silent vsplit ".fnameescape(tmpfile)
|
||||
else
|
||||
silent! e %
|
||||
endif
|
||||
setlocal bh=wipe
|
||||
|
||||
" find the latest source-id in the plugin's webpage
|
||||
silent! 1
|
||||
let findpkg= search('Click on the package to download','W')
|
||||
if findpkg > 0
|
||||
break
|
||||
endif
|
||||
let itry= itry + 1
|
||||
endwhile
|
||||
" call Decho(" --- end downloading tries while loop --- itry=".itry)
|
||||
|
||||
" testing: did finding "Click on the package..." fail?
|
||||
if findpkg == 0 || itry >= 4
|
||||
silent q!
|
||||
call delete(tmpfile)
|
||||
" restore options
|
||||
let &t_ti = t_ti
|
||||
let &t_te = t_te
|
||||
let &rs = rs
|
||||
let s:downerrors = s:downerrors + 1
|
||||
" call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">")
|
||||
echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">"
|
||||
" call Dret("GetOneScript : srch for /Click on the package/ failed")
|
||||
let @a= rega
|
||||
return
|
||||
endif
|
||||
" call Decho('found "Click on the package to download"')
|
||||
|
||||
let findsrcid= search('src_id=','W')
|
||||
if findsrcid == 0
|
||||
silent q!
|
||||
call delete(tmpfile)
|
||||
" restore options
|
||||
let &t_ti = t_ti
|
||||
let &t_te = t_te
|
||||
let &rs = rs
|
||||
let s:downerrors = s:downerrors + 1
|
||||
" call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">")
|
||||
echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">"
|
||||
let @a= rega
|
||||
" call Dret("GetOneScript : srch for /src_id/ failed")
|
||||
return
|
||||
endif
|
||||
" call Decho('found "src_id=" in description page')
|
||||
|
||||
let srcidpat = '^\s*<td class.*src_id=\(\d\+\)">\([^<]\+\)<.*$'
|
||||
let latestsrcid= substitute(getline("."),srcidpat,'\1','')
|
||||
let sname = substitute(getline("."),srcidpat,'\2','') " script name actually downloaded
|
||||
" call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> sname<".sname.">")
|
||||
silent q!
|
||||
call delete(tmpfile)
|
||||
|
||||
" convert the strings-of-numbers into numbers
|
||||
let srcid = srcid + 0
|
||||
let latestsrcid = latestsrcid + 0
|
||||
" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." sname<".sname.">")
|
||||
|
||||
" has the plugin's most-recent srcid increased, which indicates that it has been updated
|
||||
if latestsrcid > srcid
|
||||
" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."]: need to update <".sname.">")
|
||||
|
||||
let s:downloads= s:downloads + 1
|
||||
if sname == bufname("%")
|
||||
" GetLatestVimScript has to be careful about downloading itself
|
||||
let sname= "NEW_".sname
|
||||
endif
|
||||
|
||||
" -----------------------------------------------------------------------------
|
||||
" the plugin has been updated since we last obtained it, so download a new copy
|
||||
" -----------------------------------------------------------------------------
|
||||
" call Decho(".downloading new <".sname.">")
|
||||
echomsg ".downloading new <".sname.">"
|
||||
if has("win32") || has("win16") || has("win95")
|
||||
" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)."|q")
|
||||
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)|q
|
||||
else
|
||||
" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='))
|
||||
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id=').latestsrcid
|
||||
endif
|
||||
|
||||
" --------------------------------------------------------------------------
|
||||
" AutoInstall: only if doautoinstall has been requested by the plugin itself
|
||||
" --------------------------------------------------------------------------
|
||||
" call Decho("checking if plugin requested autoinstall: doautoinstall=".doautoinstall)
|
||||
if doautoinstall
|
||||
" call Decho(" ")
|
||||
" call Decho("Autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname))
|
||||
if filereadable(sname)
|
||||
" call Decho("<".sname."> is readable")
|
||||
" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall))
|
||||
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall)
|
||||
let curdir = fnameescape(substitute(getcwd(),'\','/','ge'))
|
||||
let installdir= curdir."/Installed"
|
||||
if !isdirectory(installdir)
|
||||
call mkdir(installdir)
|
||||
endif
|
||||
" call Decho("curdir<".curdir."> installdir<".installdir.">")
|
||||
" call Decho("exe cd ".fnameescape(s:autoinstall))
|
||||
exe "cd ".fnameescape(s:autoinstall)
|
||||
|
||||
" determine target directory for moves
|
||||
let firstdir= substitute(&rtp,',.*$','','')
|
||||
let pname = substitute(sname,'\..*','.vim','')
|
||||
" call Decho("determine tgtdir: is <".firstdir.'/AsNeeded/'.pname." readable?")
|
||||
if filereadable(firstdir.'/AsNeeded/'.pname)
|
||||
let tgtdir= "AsNeeded"
|
||||
else
|
||||
let tgtdir= "plugin"
|
||||
endif
|
||||
" call Decho("tgtdir<".tgtdir."> pname<".pname.">")
|
||||
|
||||
" decompress
|
||||
if sname =~ '\.bz2$'
|
||||
" call Decho("decompress: attempt to bunzip2 ".sname)
|
||||
exe "sil !bunzip2 ".shellescape(sname)
|
||||
let sname= substitute(sname,'\.bz2$','','')
|
||||
" call Decho("decompress: new sname<".sname."> after bunzip2")
|
||||
elseif sname =~ '\.gz$'
|
||||
" call Decho("decompress: attempt to gunzip ".sname)
|
||||
exe "sil !gunzip ".shellescape(sname)
|
||||
let sname= substitute(sname,'\.gz$','','')
|
||||
" call Decho("decompress: new sname<".sname."> after gunzip")
|
||||
elseif sname =~ '\.xz$'
|
||||
" call Decho("decompress: attempt to unxz ".sname)
|
||||
exe "sil !unxz ".shellescape(sname)
|
||||
let sname= substitute(sname,'\.xz$','','')
|
||||
" call Decho("decompress: new sname<".sname."> after unxz")
|
||||
else
|
||||
" call Decho("no decompression needed")
|
||||
endif
|
||||
|
||||
" distribute archive(.zip, .tar, .vba, ...) contents
|
||||
if sname =~ '\.zip$'
|
||||
" call Decho("dearchive: attempt to unzip ".sname)
|
||||
exe "silent !unzip -o ".shellescape(sname)
|
||||
elseif sname =~ '\.tar$'
|
||||
" call Decho("dearchive: attempt to untar ".sname)
|
||||
exe "silent !tar -xvf ".shellescape(sname)
|
||||
elseif sname =~ '\.tgz$'
|
||||
" call Decho("dearchive: attempt to untar+gunzip ".sname)
|
||||
exe "silent !tar -zxvf ".shellescape(sname)
|
||||
elseif sname =~ '\.taz$'
|
||||
" call Decho("dearchive: attempt to untar+uncompress ".sname)
|
||||
exe "silent !tar -Zxvf ".shellescape(sname)
|
||||
elseif sname =~ '\.tbz$'
|
||||
" call Decho("dearchive: attempt to untar+bunzip2 ".sname)
|
||||
exe "silent !tar -jxvf ".shellescape(sname)
|
||||
elseif sname =~ '\.txz$'
|
||||
" call Decho("dearchive: attempt to untar+xz ".sname)
|
||||
exe "silent !tar -Jxvf ".shellescape(sname)
|
||||
elseif sname =~ '\.vba$'
|
||||
" call Decho("dearchive: attempt to handle a vimball: ".sname)
|
||||
silent 1split
|
||||
if exists("g:vimball_home")
|
||||
let oldvimballhome= g:vimball_home
|
||||
endif
|
||||
let g:vimball_home= s:autoinstall
|
||||
exe "silent e ".fnameescape(sname)
|
||||
silent so %
|
||||
silent q
|
||||
if exists("oldvimballhome")
|
||||
let g:vimball_home= oldvimballhome
|
||||
else
|
||||
unlet g:vimball_home
|
||||
endif
|
||||
else
|
||||
" call Decho("no dearchiving needed")
|
||||
endif
|
||||
|
||||
" ---------------------------------------------
|
||||
" move plugin to plugin/ or AsNeeded/ directory
|
||||
" ---------------------------------------------
|
||||
if sname =~ '.vim$'
|
||||
" call Decho("dearchive: attempt to simply move ".sname." to ".tgtdir)
|
||||
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".tgtdir
|
||||
else
|
||||
" call Decho("dearchive: move <".sname."> to installdir<".installdir.">")
|
||||
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".installdir
|
||||
endif
|
||||
if tgtdir != "plugin"
|
||||
" call Decho("exe silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir)
|
||||
exe "silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir
|
||||
endif
|
||||
|
||||
" helptags step
|
||||
let docdir= substitute(&rtp,',.*','','e')."/doc"
|
||||
" call Decho("helptags: docdir<".docdir.">")
|
||||
exe "helptags ".fnameescape(docdir)
|
||||
exe "cd ".fnameescape(curdir)
|
||||
endif
|
||||
if fname !~ ':AutoInstall:'
|
||||
let modline=scriptid." ".latestsrcid." :AutoInstall: ".fname.cmmnt
|
||||
else
|
||||
let modline=scriptid." ".latestsrcid." ".fname.cmmnt
|
||||
endif
|
||||
else
|
||||
let modline=scriptid." ".latestsrcid." ".fname.cmmnt
|
||||
endif
|
||||
|
||||
" update the data in the <GetLatestVimScripts.dat> file
|
||||
call setline(line("."),modline)
|
||||
" call Decho("update data in ".expand("%")."#".line(".").": modline<".modline.">")
|
||||
" else " Decho
|
||||
" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."], no need to update")
|
||||
endif
|
||||
|
||||
" restore options
|
||||
let &t_ti = t_ti
|
||||
let &t_te = t_te
|
||||
let &rs = rs
|
||||
let @a = rega
|
||||
" call Dredir("BUFFER TEST (GetOneScript)","ls!")
|
||||
|
||||
" call Dret("GetOneScript")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Restore Options: {{{1
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Modelines: {{{1
|
||||
" vim: ts=8 sts=2 fdm=marker nowrap
|
@@ -11,6 +11,8 @@ catch /E145:/
|
||||
" Ignore the error in restricted mode
|
||||
endtry
|
||||
|
||||
" Load man page {page} from {section}
|
||||
" call man#get_page([{section}, ]{page})
|
||||
function man#get_page(...) abort
|
||||
let invoked_from_man = (&filetype ==# 'man')
|
||||
|
||||
@@ -20,21 +22,14 @@ function man#get_page(...) abort
|
||||
elseif a:0 > 2
|
||||
echoerr 'too many arguments'
|
||||
return
|
||||
elseif a:0 == 2
|
||||
let [page, sect] = [a:2, 0 + a:1]
|
||||
elseif type(1) == type(a:1)
|
||||
let [page, sect] = ['<cword>', a:1]
|
||||
else
|
||||
let [page, sect] = [a:1, '']
|
||||
endif
|
||||
|
||||
if page == '<cword>'
|
||||
let page = expand('<cword>')
|
||||
endif
|
||||
let sect = get(a:000, 0)
|
||||
let page = get(a:000, 1, sect)
|
||||
|
||||
let [page, sect] = s:parse_page_and_section(sect, page)
|
||||
|
||||
if 0 + sect > 0 && s:find_page(sect, page) == 0
|
||||
if !empty(sect) && s:find_page(sect, page) == 0
|
||||
let sect = ''
|
||||
endif
|
||||
|
||||
@@ -54,9 +49,9 @@ function man#get_page(...) abort
|
||||
let thiswin = winnr()
|
||||
wincmd b
|
||||
if winnr() > 1
|
||||
exe "norm! " . thiswin . "\<C-W>w"
|
||||
exec thiswin . 'wincmd w'
|
||||
while 1
|
||||
if &filetype == 'man'
|
||||
if &filetype ==# 'man'
|
||||
break
|
||||
endif
|
||||
wincmd w
|
||||
@@ -75,14 +70,16 @@ function man#get_page(...) abort
|
||||
|
||||
setlocal modifiable
|
||||
silent keepjumps norm! 1G"_dG
|
||||
let $MANWIDTH = winwidth(0)
|
||||
if empty($MANWIDTH)
|
||||
let $MANWIDTH = winwidth(0)
|
||||
endif
|
||||
silent exec 'r!/usr/bin/man '.s:cmd(sect, page).' | col -b'
|
||||
" Remove blank lines from top and bottom.
|
||||
while getline(1) =~ '^\s*$'
|
||||
silent keepjumps norm! gg"_dd
|
||||
while getline(1) =~# '^\s*$'
|
||||
silent keepjumps 1delete _
|
||||
endwhile
|
||||
while getline('$') =~ '^\s*$'
|
||||
silent keepjumps norm! G"_dd
|
||||
while getline('$') =~# '^\s*$'
|
||||
silent keepjumps $delete _
|
||||
endwhile
|
||||
setlocal nomodified
|
||||
setlocal filetype=man
|
||||
@@ -116,15 +113,11 @@ endfunction
|
||||
" Expects a string like 'access' or 'access(2)'.
|
||||
function s:parse_page_and_section(sect, str) abort
|
||||
try
|
||||
let save_isk = &iskeyword
|
||||
setlocal iskeyword-=(,)
|
||||
let page = substitute(a:str, '(*\(\k\+\).*', '\1', '')
|
||||
let sect = substitute(a:str, '\(\k\+\)(\([^()]*\)).*', '\2', '')
|
||||
if sect == page || -1 == match(sect, '^[0-9 ]\+$')
|
||||
let [page, sect] = matchlist(a:str, '\v\C([-.[:alnum:]_]+)%(\(([-.[:alnum:]_]+)\))?')[1:2]
|
||||
if empty(sect)
|
||||
let sect = a:sect
|
||||
endif
|
||||
catch
|
||||
let &l:iskeyword = save_isk
|
||||
echoerr 'man.vim: failed to parse: "'.a:str.'"'
|
||||
endtry
|
||||
|
||||
@@ -132,7 +125,7 @@ function s:parse_page_and_section(sect, str) abort
|
||||
endfunction
|
||||
|
||||
function s:cmd(sect, page) abort
|
||||
if 0 + a:sect > 0
|
||||
if !empty(a:sect)
|
||||
return s:man_sect_arg.' '.a:sect.' '.a:page
|
||||
endif
|
||||
return a:page
|
||||
@@ -140,10 +133,5 @@ endfunction
|
||||
|
||||
function s:find_page(sect, page) abort
|
||||
let where = system('/usr/bin/man '.s:man_find_arg.' '.s:cmd(a:sect, a:page))
|
||||
if where !~ "^/"
|
||||
if matchstr(where, " [^ ]*$") !~ "^ /"
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
return 1
|
||||
return (where =~# '^ */')
|
||||
endfunction
|
||||
|
@@ -356,6 +356,8 @@ let s:MSGPACK_STANDARD_TYPES = {
|
||||
\type(''): 'binary',
|
||||
\type([]): 'array',
|
||||
\type({}): 'map',
|
||||
\type(v:true): 'boolean',
|
||||
\type(v:null): 'nil',
|
||||
\}
|
||||
|
||||
""
|
||||
@@ -379,7 +381,7 @@ endfunction
|
||||
""
|
||||
" Dump boolean value.
|
||||
function s:msgpack_dump_boolean(v) abort
|
||||
return a:v._VAL ? 'TRUE' : 'FALSE'
|
||||
return (a:v is v:true || (a:v isnot v:false && a:v._VAL)) ? 'TRUE' : 'FALSE'
|
||||
endfunction
|
||||
|
||||
""
|
||||
@@ -395,7 +397,8 @@ endfunction
|
||||
""
|
||||
" Dump floating-point value.
|
||||
function s:msgpack_dump_float(v) abort
|
||||
return string(type(a:v) == type({}) ? a:v._VAL : a:v)
|
||||
return substitute(string(type(a:v) == type({}) ? a:v._VAL : a:v),
|
||||
\'\V\^\(-\)\?str2float(''\(inf\|nan\)'')\$', '\1\2', '')
|
||||
endfunction
|
||||
|
||||
""
|
||||
|
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
|
||||
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" URL: https://github.com/shawncplus/phpcomplete.vim
|
||||
" Last Change: 2014 Dec 01
|
||||
" Last Change: 2015 Jul 13
|
||||
"
|
||||
" OPTIONS:
|
||||
"
|
||||
@@ -141,71 +141,80 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
|
||||
if a:base != ""
|
||||
let context = substitute(context, '\s*[$a-zA-Z_0-9\x7f-\xff]*$', '', '')
|
||||
end
|
||||
else
|
||||
let context = ''
|
||||
end
|
||||
|
||||
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.')))
|
||||
try
|
||||
let winheight = winheight(0)
|
||||
let winnr = winnr()
|
||||
|
||||
if context =~? '^use\s'
|
||||
return phpcomplete#CompleteUse(a:base)
|
||||
endif
|
||||
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.')))
|
||||
|
||||
if context =~ '\(->\|::\)$'
|
||||
" {{{
|
||||
" Get name of the class
|
||||
let classname = phpcomplete#GetClassName(line('.'), context, current_namespace, imports)
|
||||
if context =~? '^use\s' || context ==? 'use'
|
||||
return phpcomplete#CompleteUse(a:base)
|
||||
endif
|
||||
|
||||
" Get location of class definition, we have to iterate through all
|
||||
if classname != ''
|
||||
if classname =~ '\'
|
||||
" split the last \ segment as a classname, everything else is the namespace
|
||||
let classname_parts = split(classname, '\')
|
||||
let namespace = join(classname_parts[0:-2], '\')
|
||||
let classname = classname_parts[-1]
|
||||
if context =~ '\(->\|::\)$'
|
||||
" {{{
|
||||
" Get name of the class
|
||||
let classname = phpcomplete#GetClassName(line('.'), context, current_namespace, imports)
|
||||
|
||||
" Get location of class definition, we have to iterate through all
|
||||
if classname != ''
|
||||
if classname =~ '\'
|
||||
" split the last \ segment as a classname, everything else is the namespace
|
||||
let classname_parts = split(classname, '\')
|
||||
let namespace = join(classname_parts[0:-2], '\')
|
||||
let classname = classname_parts[-1]
|
||||
else
|
||||
let namespace = '\'
|
||||
endif
|
||||
let classlocation = phpcomplete#GetClassLocation(classname, namespace)
|
||||
else
|
||||
let namespace = '\'
|
||||
let classlocation = ''
|
||||
endif
|
||||
let classlocation = phpcomplete#GetClassLocation(classname, namespace)
|
||||
|
||||
if classlocation != ''
|
||||
if classlocation == 'VIMPHP_BUILTINOBJECT' && has_key(g:php_builtin_classes, tolower(classname))
|
||||
return phpcomplete#CompleteBuiltInClass(context, classname, a:base)
|
||||
endif
|
||||
|
||||
if filereadable(classlocation)
|
||||
let classfile = readfile(classlocation)
|
||||
let classcontent = ''
|
||||
let classcontent .= "\n".phpcomplete#GetClassContents(classlocation, classname)
|
||||
let sccontent = split(classcontent, "\n")
|
||||
let visibility = expand('%:p') == fnamemodify(classlocation, ':p') ? 'private' : 'public'
|
||||
|
||||
return phpcomplete#CompleteUserClass(context, a:base, sccontent, visibility)
|
||||
endif
|
||||
endif
|
||||
|
||||
return phpcomplete#CompleteUnknownClass(a:base, context)
|
||||
" }}}
|
||||
elseif context =~? 'implements'
|
||||
return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports)
|
||||
elseif context =~? 'extends\s\+.\+$' && a:base == ''
|
||||
return ['implements']
|
||||
elseif context =~? 'extends'
|
||||
let kinds = context =~? 'class\s' ? ['c'] : ['i']
|
||||
return phpcomplete#CompleteClassName(a:base, kinds, current_namespace, imports)
|
||||
elseif context =~? 'class [a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
|
||||
" special case when you've typed the class keyword and the name too, only extends and implements allowed there
|
||||
return filter(['extends', 'implements'], 'stridx(v:val, a:base) == 0')
|
||||
elseif context =~? 'new'
|
||||
return phpcomplete#CompleteClassName(a:base, ['c'], current_namespace, imports)
|
||||
endif
|
||||
|
||||
if a:base =~ '^\$'
|
||||
return phpcomplete#CompleteVariable(a:base)
|
||||
else
|
||||
let classlocation = ''
|
||||
return phpcomplete#CompleteGeneral(a:base, current_namespace, imports)
|
||||
endif
|
||||
|
||||
if classlocation != ''
|
||||
if classlocation == 'VIMPHP_BUILTINOBJECT' && has_key(g:php_builtin_classes, tolower(classname))
|
||||
return phpcomplete#CompleteBuiltInClass(context, classname, a:base)
|
||||
endif
|
||||
|
||||
if filereadable(classlocation)
|
||||
let classfile = readfile(classlocation)
|
||||
let classcontent = ''
|
||||
let classcontent .= "\n".phpcomplete#GetClassContents(classlocation, classname)
|
||||
let sccontent = split(classcontent, "\n")
|
||||
let visibility = expand('%:p') == fnamemodify(classlocation, ':p') ? 'private' : 'public'
|
||||
|
||||
return phpcomplete#CompleteUserClass(context, a:base, sccontent, visibility)
|
||||
endif
|
||||
endif
|
||||
|
||||
return phpcomplete#CompleteUnknownClass(a:base, context)
|
||||
" }}}
|
||||
elseif context =~? 'implements'
|
||||
return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports)
|
||||
elseif context =~? 'extends\s\+.\+$'
|
||||
return ['implements']
|
||||
elseif context =~? 'extends'
|
||||
let kinds = context =~? 'class\s' ? ['c'] : ['i']
|
||||
return phpcomplete#CompleteClassName(a:base, kinds, current_namespace, imports)
|
||||
elseif context =~? 'class [a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
|
||||
" special case when you've typed the class keyword and the name too, only extends and implements allowed there
|
||||
return filter(['extends', 'implements'], 'stridx(v:val, a:base) == 0')
|
||||
elseif context =~? 'new'
|
||||
return phpcomplete#CompleteClassName(a:base, ['c'], current_namespace, imports)
|
||||
endif
|
||||
|
||||
if a:base =~ '^\$'
|
||||
return phpcomplete#CompleteVariable(a:base)
|
||||
else
|
||||
return phpcomplete#CompleteGeneral(a:base, current_namespace, imports)
|
||||
endif
|
||||
finally
|
||||
silent! exec winnr.'resize '.winheight
|
||||
endtry
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
@@ -244,12 +253,13 @@ function! phpcomplete#CompleteUse(base) " {{{
|
||||
if has_key(tag, 'namespace')
|
||||
let patched_ctags_detected = 1
|
||||
endif
|
||||
|
||||
if tag.kind ==? 'n' && tag.name =~? '^'.namespace_match_pattern
|
||||
let patched_ctags_detected = 1
|
||||
call add(namespaced_matches, {'word': tag.name, 'kind': 'n', 'menu': tag.filename, 'info': tag.filename })
|
||||
elseif has_key(tag, 'namespace') && (tag.kind ==? 'c' || tag.kind ==? 'i') && tag.namespace ==? namespace_for_class
|
||||
elseif has_key(tag, 'namespace') && (tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't') && tag.namespace ==? namespace_for_class
|
||||
call add(namespaced_matches, {'word': namespace_for_class.'\'.tag.name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename })
|
||||
elseif (tag.kind ==? 'c' || tag.kind ==? 'i')
|
||||
elseif (tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't')
|
||||
call add(no_namespace_matches, {'word': namespace_for_class.'\'.tag.name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename })
|
||||
endif
|
||||
endfor
|
||||
@@ -272,6 +282,10 @@ function! phpcomplete#CompleteUse(base) " {{{
|
||||
endfor
|
||||
endif
|
||||
|
||||
for comp in res
|
||||
let comp.word = substitute(comp.word, '^\\', '', '')
|
||||
endfor
|
||||
|
||||
return res
|
||||
endfunction
|
||||
" }}}
|
||||
@@ -304,7 +318,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
||||
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
|
||||
if f_name =~? '^'.substitute(a:base, '\\', '\\\\', 'g')
|
||||
let f_args = matchstr(i,
|
||||
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|$\)')
|
||||
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|$\)')
|
||||
let int_functions[f_name.'('] = f_args.')'
|
||||
endif
|
||||
endfor
|
||||
@@ -326,6 +340,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
||||
let ext_functions = {}
|
||||
let ext_constants = {}
|
||||
let ext_classes = {}
|
||||
let ext_traits = {}
|
||||
let ext_interfaces = {}
|
||||
let ext_namespaces = {}
|
||||
|
||||
@@ -420,7 +435,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
elseif tag.kind ==? 'c' || tag.kind ==? 'i'
|
||||
elseif tag.kind ==? 'c' || tag.kind ==? 'i' || tag.kind ==? 't'
|
||||
let info = ' - '.tag.filename
|
||||
|
||||
let key = ''
|
||||
@@ -441,6 +456,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
||||
let ext_classes[key] = info
|
||||
elseif tag.kind ==? 'i'
|
||||
let ext_interfaces[key] = info
|
||||
elseif tag.kind ==? 't'
|
||||
let ext_traits[key] = info
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -463,7 +480,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
||||
endfor
|
||||
for [interfacename, info] in items(g:php_builtin_interfacenames)
|
||||
if interfacename =~? '^'.base
|
||||
let builtin_interfaces[leading_slash.interfacename] = info
|
||||
let builtin_interfaces[leading_slash.g:php_builtin_interfaces[tolower(interfacename)].name] = info
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
@@ -511,6 +528,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
||||
else
|
||||
let ext_interfaces[imported_name] = ' '.import.name.' - '.import.filename
|
||||
endif
|
||||
elseif import.kind ==? 't'
|
||||
let ext_traits[imported_name] = ' '.import.name.' - '.import.filename
|
||||
endif
|
||||
|
||||
" no builtin interfaces
|
||||
@@ -540,6 +559,9 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
||||
" Add external interfaces
|
||||
call extend(all_values, ext_interfaces)
|
||||
|
||||
" Add external traits
|
||||
call extend(all_values, ext_traits)
|
||||
|
||||
" Add built-in classes
|
||||
call extend(all_values, builtin_classnames)
|
||||
|
||||
@@ -566,6 +588,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
||||
elseif has_key(ext_interfaces, i) || has_key(builtin_interfaces, i)
|
||||
let info = has_key(ext_interfaces, i) ? ext_interfaces[i] : builtin_interfaces[i].' - builtin'
|
||||
let final_list += [{'word':i, 'kind': 'i', 'menu': info, 'info': i.info}]
|
||||
elseif has_key(ext_traits, i)
|
||||
let final_list += [{'word':i, 'kind': 't', 'menu': ext_traits[i], 'info': ext_traits[i]}]
|
||||
elseif has_key(int_constants, i) || has_key(builtin_constants, i)
|
||||
let info = has_key(int_constants, i) ? int_constants[i] : ' - builtin'
|
||||
let final_list += [{'word':i, 'kind': 'd', 'menu': info, 'info': i.info}]
|
||||
@@ -622,7 +646,7 @@ function! phpcomplete#CompleteUnknownClass(base, context) " {{{
|
||||
let f_name = matchstr(i,
|
||||
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
|
||||
let f_args = matchstr(i,
|
||||
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|$\)')
|
||||
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|$\)')
|
||||
|
||||
let int_functions[f_name.'('] = f_args.')'
|
||||
endfor
|
||||
@@ -784,7 +808,7 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports)
|
||||
|
||||
let tags = []
|
||||
if len(tag_match_pattern) >= g:phpcomplete_min_num_of_chars_for_namespace_completion
|
||||
let tags = phpcomplete#GetTaglist('^'.tag_match_pattern)
|
||||
let tags = phpcomplete#GetTaglist('^\c'.tag_match_pattern)
|
||||
endif
|
||||
|
||||
if len(tags)
|
||||
@@ -861,6 +885,39 @@ function! phpcomplete#CompareCompletionRow(i1, i2) " {{{
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
function! s:getNextCharWithPos(filelines, current_pos) " {{{
|
||||
let line_no = a:current_pos[0]
|
||||
let col_no = a:current_pos[1]
|
||||
let last_line = a:filelines[len(a:filelines) - 1]
|
||||
let end_pos = [len(a:filelines) - 1, strlen(last_line) - 1]
|
||||
if line_no > end_pos[0] || line_no == end_pos[0] && col_no > end_pos[1]
|
||||
return ['EOF', 'EOF']
|
||||
endif
|
||||
|
||||
" we've not reached the end of the current line break
|
||||
if col_no + 1 < strlen(a:filelines[line_no])
|
||||
let col_no += 1
|
||||
else
|
||||
" we've reached the end of the current line, jump to the next
|
||||
" non-blank line (blank lines have no position where we can read from,
|
||||
" not even a whitespace. The newline char does not positionable by vim
|
||||
let line_no += 1
|
||||
while strlen(a:filelines[line_no]) == 0
|
||||
let line_no += 1
|
||||
endwhile
|
||||
|
||||
let col_no = 0
|
||||
endif
|
||||
|
||||
" return 'EOF' string to signal end of file, normal results only one char
|
||||
" in length
|
||||
if line_no == end_pos[0] && col_no > end_pos[1]
|
||||
return ['EOF', 'EOF']
|
||||
endif
|
||||
|
||||
return [[line_no, col_no], a:filelines[line_no][col_no]]
|
||||
endfunction " }}}
|
||||
|
||||
function! phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibited_modifiers) " {{{
|
||||
" if theres no modifier, and no modifier is allowed and no modifier is required
|
||||
if len(a:modifiers) == 0 && len(a:required_modifiers) == 0
|
||||
@@ -924,7 +981,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
|
||||
let f_name = matchstr(i,
|
||||
\ 'function\s*&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
|
||||
let f_args = matchstr(i,
|
||||
\ 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\({\|\_$\)')
|
||||
\ 'function\s*&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*\(;\|{\|\_$\)')
|
||||
if f_name != '' && stridx(f_name, '__') != 0
|
||||
let c_functions[f_name.'('] = f_args
|
||||
if g:phpcomplete_parse_docblock_comments
|
||||
@@ -1322,8 +1379,8 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
|
||||
" Get Structured information of all classes and subclasses including namespace and includes
|
||||
" try to find the method's return type in docblock comment
|
||||
for classstructure in classcontents
|
||||
let doclock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method
|
||||
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), doclock_target_pattern)
|
||||
let docblock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method
|
||||
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern)
|
||||
if doc_str != ''
|
||||
break
|
||||
endif
|
||||
@@ -1475,21 +1532,19 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
return ''
|
||||
endif
|
||||
|
||||
if line =~? '\v^\s*(abstract\s+|final\s+)*\s*class'
|
||||
let class_name = matchstr(line, '\c\s*class\s*\zs'.class_name_pattern.'\ze')
|
||||
if line =~? '\v^\s*(abstract\s+|final\s+)*\s*class\s'
|
||||
let class_name = matchstr(line, '\cclass\s\+\zs'.class_name_pattern.'\ze')
|
||||
let extended_class = matchstr(line, '\cclass\s\+'.class_name_pattern.'\s\+extends\s\+\zs'.class_name_pattern.'\ze')
|
||||
|
||||
let classname_candidate = a:context =~? 'parent::' ? extended_class : class_name
|
||||
else
|
||||
let i += 1
|
||||
continue
|
||||
if classname_candidate != ''
|
||||
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
|
||||
" return absolute classname, without leading \
|
||||
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
|
||||
endif
|
||||
endif
|
||||
|
||||
if classname_candidate != ''
|
||||
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
|
||||
" return absolute classname, without leading \
|
||||
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
|
||||
endif
|
||||
let i += 1
|
||||
endwhile
|
||||
elseif a:context =~? '(\s*new\s\+'.class_name_pattern.'\s*)->'
|
||||
let classname_candidate = matchstr(a:context, '\cnew\s\+\zs'.class_name_pattern.'\ze')
|
||||
@@ -1602,26 +1657,26 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
endif
|
||||
endif
|
||||
|
||||
" in-file lookup for typehinted function arguments
|
||||
" - the function can have a name or be anonymous (e.g., function qux() { ... } vs. function () { ... })
|
||||
" - the type-hinted argument can be anywhere in the arguments list.
|
||||
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array
|
||||
let f_args = matchstr(line, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)')
|
||||
let args = split(f_args, '\s*\zs,\ze\s*')
|
||||
for arg in args
|
||||
if arg =~# object.'\(,\|$\)'
|
||||
let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object)
|
||||
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
|
||||
" function declaration line
|
||||
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*('
|
||||
let function_lines = join(reverse(copy(lines)), " ")
|
||||
" search for type hinted arguments
|
||||
if function_lines =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array
|
||||
let f_args = matchstr(function_lines, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)')
|
||||
let args = split(f_args, '\s*\zs,\ze\s*')
|
||||
for arg in args
|
||||
if arg =~# object.'\(,\|$\)'
|
||||
let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object)
|
||||
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if classname_candidate != ''
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if classname_candidate != ''
|
||||
break
|
||||
endif
|
||||
endif
|
||||
|
||||
" if we see a function declaration, try loading the docblock for it and look for matching @params
|
||||
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.object
|
||||
" search for docblock for the function
|
||||
let match_line = substitute(line, '\\', '\\\\', 'g')
|
||||
let sccontent = getline(0, a:start_line - i)
|
||||
let doc_str = phpcomplete#GetDocBlock(sccontent, match_line)
|
||||
@@ -1641,13 +1696,16 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
endif
|
||||
|
||||
" assignment for the variable in question with a variable on the right hand side
|
||||
if line =~# '^\s*'.object.'\s*=&\?\s*'.variable_name_pattern
|
||||
if line =~# '^\s*'.object.'\s*=&\?\s\+\(clone\)\?\s*'.variable_name_pattern
|
||||
|
||||
" try to find the next non-comment or string ";" char
|
||||
let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s*'.variable_name_pattern)
|
||||
let filelines = reverse(lines)
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
|
||||
let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s\+\(clone\)\?\s*'.variable_name_pattern)
|
||||
let filelines = reverse(copy(lines))
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [len(filelines) - i, start_col])
|
||||
let chars_read = 1
|
||||
let last_pos = pos
|
||||
" function_boundary == 0 if we are not in a function
|
||||
let real_lines_offset = len(function_boundary) == 1 ? 1 : function_boundary[0][0]
|
||||
" read while end of the file
|
||||
while char != 'EOF' && chars_read < 1000
|
||||
let last_pos = pos
|
||||
@@ -1655,7 +1713,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let chars_read += 1
|
||||
" we got a candidate
|
||||
if char == ';'
|
||||
let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name')
|
||||
" pos values is relative to the function's lines,
|
||||
" line 0 need to be offsetted with the line number
|
||||
" where te function was started to get the line number
|
||||
" in real buffer terms
|
||||
let synIDName = synIDattr(synID(real_lines_offset + pos[0], pos[1] + 1, 0), 'name')
|
||||
" it's not a comment or string, end search
|
||||
if synIDName !~? 'comment\|string'
|
||||
break
|
||||
@@ -1663,7 +1725,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
endif
|
||||
endwhile
|
||||
|
||||
let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin)
|
||||
let prev_context = phpcomplete#GetCurrentInstruction(real_lines_offset + last_pos[0], last_pos[1], b:phpbegin)
|
||||
if prev_context == ''
|
||||
" cannot get previous context give up
|
||||
return
|
||||
@@ -1683,12 +1745,14 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
|
||||
" assignment for the variable in question with a function on the right hand side
|
||||
if line =~# '^\s*'.object.'\s*=&\?\s*'.function_invocation_pattern
|
||||
|
||||
" try to find the next non-comment or string ";" char
|
||||
let start_col = match(line, '\C^\s*'.object.'\s*=\zs&\?\s*'.function_invocation_pattern)
|
||||
let filelines = reverse(lines)
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
|
||||
let filelines = reverse(copy(lines))
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [len(filelines) - i, start_col])
|
||||
let chars_read = 1
|
||||
let last_pos = pos
|
||||
" function_boundary == 0 if we are not in a function
|
||||
let real_lines_offset = len(function_boundary) == 1 ? 1 : function_boundary[0][0]
|
||||
" read while end of the file
|
||||
while char != 'EOF' && chars_read < 1000
|
||||
let last_pos = pos
|
||||
@@ -1696,7 +1760,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let chars_read += 1
|
||||
" we got a candidate
|
||||
if char == ';'
|
||||
let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name')
|
||||
" pos values is relative to the function's lines,
|
||||
" line 0 need to be offsetted with the line number
|
||||
" where te function was started to get the line number
|
||||
" in real buffer terms
|
||||
let synIDName = synIDattr(synID(real_lines_offset + pos[0], pos[1] + 1, 0), 'name')
|
||||
" it's not a comment or string, end search
|
||||
if synIDName !~? 'comment\|string'
|
||||
break
|
||||
@@ -1704,7 +1772,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
endif
|
||||
endwhile
|
||||
|
||||
let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin)
|
||||
let prev_context = phpcomplete#GetCurrentInstruction(real_lines_offset + last_pos[0], last_pos[1], b:phpbegin)
|
||||
if prev_context == ''
|
||||
" cannot get previous context give up
|
||||
return
|
||||
@@ -1807,6 +1875,9 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{
|
||||
if has_key(g:php_builtin_classes, tolower(a:classname)) && (a:namespace == '' || a:namespace == '\')
|
||||
return 'VIMPHP_BUILTINOBJECT'
|
||||
endif
|
||||
if has_key(g:php_builtin_interfaces, tolower(a:classname)) && (a:namespace == '' || a:namespace == '\')
|
||||
return 'VIMPHP_BUILTINOBJECT'
|
||||
endif
|
||||
|
||||
if a:namespace == '' || a:namespace == '\'
|
||||
let search_namespace = '\'
|
||||
@@ -1819,7 +1890,7 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{
|
||||
let i = 1
|
||||
while i < line('.')
|
||||
let line = getline(line('.')-i)
|
||||
if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*class\s*'.a:classname.'\(\s\+\|$\)' && tolower(current_namespace) == search_namespace
|
||||
if line =~? '^\s*\(abstract\s\+\|final\s\+\)*\s*\(class\|interface\|trait\)\s*'.a:classname.'\(\s\+\|$\|{\)' && tolower(current_namespace) == search_namespace
|
||||
return expand('%:p')
|
||||
else
|
||||
let i += 1
|
||||
@@ -1831,7 +1902,9 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{
|
||||
let no_namespace_candidate = ''
|
||||
let tags = phpcomplete#GetTaglist('^'.a:classname.'$')
|
||||
for tag in tags
|
||||
if tag.kind == 'c' || tag.kind == 'i'
|
||||
" We'll allow interfaces and traits to be handled classes since you
|
||||
" can't have colliding names with different kinds anyway
|
||||
if tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't'
|
||||
if !has_key(tag, 'namespace')
|
||||
let no_namespace_candidate = tag.filename
|
||||
else
|
||||
@@ -1981,7 +2054,7 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
|
||||
silent! below 1new
|
||||
silent! 0put =cfile
|
||||
call search('\(class\|interface\)\_s\+'.a:class_name.'\(\>\|$\)')
|
||||
call search('\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)')
|
||||
let cfline = line('.')
|
||||
call search('{')
|
||||
let endline = line('.')
|
||||
@@ -1989,13 +2062,62 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
let content = join(getline(cfline, endline), "\n")
|
||||
" Catch extends
|
||||
if content =~? 'extends'
|
||||
let extends_class = matchstr(content, 'class\_s\+'.a:class_name.'\_s\+extends\_s\+\zs'.class_name_pattern.'\ze')
|
||||
let extends_string = matchstr(content, '\(class\|interface\)\_s\+'.a:class_name.'\_.\+extends\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze\(extends\|{\)')
|
||||
let extended_classes = map(split(extends_string, '\(,\|\_s\)\+'), 'substitute(v:val, "\\_s\\+", "", "g")')
|
||||
else
|
||||
let extends_class = ''
|
||||
let extended_classes = ''
|
||||
endif
|
||||
|
||||
" Catch implements
|
||||
if content =~? 'implements'
|
||||
let implements_string = matchstr(content, 'class\_s\+'.a:class_name.'\_.\+implements\_s\+\zs\('.class_name_pattern.'\(,\|\_s\)*\)\+\ze')
|
||||
let implemented_interfaces = map(split(implements_string, '\(,\|\_s\)\+'), 'substitute(v:val, "\\_s\\+", "", "g")')
|
||||
else
|
||||
let implemented_interfaces = []
|
||||
endif
|
||||
call searchpair('{', '', '}', 'W')
|
||||
let classcontent = join(getline(cfline, line('.')), "\n")
|
||||
let class_closing_bracket_line = line('.')
|
||||
let classcontent = join(getline(cfline, class_closing_bracket_line), "\n")
|
||||
|
||||
let used_traits = []
|
||||
" move back to the line next to the class's definition
|
||||
call cursor(endline + 1, 1)
|
||||
let keep_searching = 1
|
||||
while keep_searching != 0
|
||||
" try to grab "use..." keywords
|
||||
let [lnum, col] = searchpos('\c^\s\+use\s\+'.class_name_pattern, 'cW', class_closing_bracket_line)
|
||||
let syn_name = synIDattr(synID(lnum, col, 0), "name")
|
||||
if syn_name =~? 'string\|comment'
|
||||
call cursor(lnum + 1, 1)
|
||||
continue
|
||||
endif
|
||||
|
||||
let trait_line = getline(lnum)
|
||||
if trait_line !~? ';'
|
||||
" try to find the next line containing ';'
|
||||
let l = lnum
|
||||
let search_line = trait_line
|
||||
|
||||
" add lines from the file until theres no ';' in them
|
||||
while search_line !~? ';' && l > 0
|
||||
" file lines are reversed so we need to go backwards
|
||||
let l += 1
|
||||
let search_line = getline(l)
|
||||
let trait_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g')
|
||||
endwhile
|
||||
endif
|
||||
let use_expression = matchstr(trait_line, '^\s*use\s\+\zs.\{-}\ze;')
|
||||
let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")')
|
||||
let used_traits += map(use_parts, 'substitute(v:val, "\\s", "", "g")')
|
||||
call cursor(lnum + 1, 1)
|
||||
|
||||
if [lnum, col] == [0, 0]
|
||||
let keep_searching = 0
|
||||
endif
|
||||
endwhile
|
||||
|
||||
silent! bw! %
|
||||
|
||||
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(a:file_lines[0:cfline])
|
||||
" go back to original window
|
||||
exe phpcomplete_original_window.'wincmd w'
|
||||
@@ -2008,21 +2130,35 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
\ 'mtime': getftime(full_file_path),
|
||||
\ })
|
||||
|
||||
if extends_class != ''
|
||||
let [extends_class, namespace] = phpcomplete#ExpandClassName(extends_class, current_namespace, imports)
|
||||
if namespace == ''
|
||||
let namespace = '\'
|
||||
endif
|
||||
let classlocation = phpcomplete#GetClassLocation(extends_class, namespace)
|
||||
if classlocation == "VIMPHP_BUILTINOBJECT"
|
||||
let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(extends_class)])]
|
||||
elseif classlocation != '' && filereadable(classlocation)
|
||||
let full_file_path = fnamemodify(classlocation, ':p')
|
||||
let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), extends_class)
|
||||
elseif tolower(current_namespace) == tolower(namespace)
|
||||
" try to find the declaration in the same file.
|
||||
let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, extends_class)
|
||||
endif
|
||||
let all_extends = used_traits
|
||||
if len(extended_classes) > 0
|
||||
call extend(all_extends, extended_classes)
|
||||
endif
|
||||
if len(implemented_interfaces) > 0
|
||||
call extend(all_extends, implemented_interfaces)
|
||||
endif
|
||||
if len(all_extends) > 0
|
||||
for class in all_extends
|
||||
let [class, namespace] = phpcomplete#ExpandClassName(class, current_namespace, imports)
|
||||
if namespace == ''
|
||||
let namespace = '\'
|
||||
endif
|
||||
let classlocation = phpcomplete#GetClassLocation(class, namespace)
|
||||
if classlocation == "VIMPHP_BUILTINOBJECT"
|
||||
if has_key(g:php_builtin_classes, tolower(class))
|
||||
let result += [phpcomplete#GenerateBuiltinClassStub('class', g:php_builtin_classes[tolower(class)])]
|
||||
endif
|
||||
if has_key(g:php_builtin_interfaces, tolower(class))
|
||||
let result += [phpcomplete#GenerateBuiltinClassStub('interface', g:php_builtin_interfaces[tolower(class)])]
|
||||
endif
|
||||
elseif classlocation != '' && filereadable(classlocation)
|
||||
let full_file_path = fnamemodify(classlocation, ':p')
|
||||
let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), class)
|
||||
elseif tolower(current_namespace) == tolower(namespace) && match(join(a:file_lines, "\n"), '\c\(class\|interface\|trait\)\_s\+'.class.'\(\>\|$\)') != -1
|
||||
" try to find the declaration in the same file.
|
||||
let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, class)
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
return result
|
||||
@@ -2039,43 +2175,53 @@ function! phpcomplete#GetClassContents(classlocation, class_name) " {{{
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{
|
||||
let re = 'class '.a:class_info['name']." {"
|
||||
for [name, initializer] in items(a:class_info.constants)
|
||||
let re .= "\n\tconst ".name." = ".initializer.";"
|
||||
endfor
|
||||
for [name, info] in items(a:class_info.properties)
|
||||
let re .= "\n\t// @var $".name." ".info.type
|
||||
let re .= "\n\tpublic $".name.";"
|
||||
endfor
|
||||
for [name, info] in items(a:class_info.static_properties)
|
||||
let re .= "\n\t// @var ".name." ".info.type
|
||||
let re .= "\n\tpublic static ".name." = ".info.initializer.";"
|
||||
endfor
|
||||
for [name, info] in items(a:class_info.methods)
|
||||
if name =~ '^__'
|
||||
continue
|
||||
endif
|
||||
let re .= "\n\t/**"
|
||||
let re .= "\n\t * ".name
|
||||
let re .= "\n\t *"
|
||||
let re .= "\n\t * @return ".info.return_type
|
||||
let re .= "\n\t */"
|
||||
let re .= "\n\tpublic function ".name."(".info.signature."){"
|
||||
let re .= "\n\t}"
|
||||
endfor
|
||||
for [name, info] in items(a:class_info.static_methods)
|
||||
let re .= "\n\t/**"
|
||||
let re .= "\n\t * ".name
|
||||
let re .= "\n\t *"
|
||||
let re .= "\n\t * @return ".info.return_type
|
||||
let re .= "\n\t */"
|
||||
let re .= "\n\tpublic static function ".name."(".info.signature."){"
|
||||
let re .= "\n\t}"
|
||||
endfor
|
||||
function! phpcomplete#GenerateBuiltinClassStub(type, class_info) " {{{
|
||||
let re = a:type.' '.a:class_info['name']." {"
|
||||
if has_key(a:class_info, 'constants')
|
||||
for [name, initializer] in items(a:class_info.constants)
|
||||
let re .= "\n\tconst ".name." = ".initializer.";"
|
||||
endfor
|
||||
endif
|
||||
if has_key(a:class_info, 'properties')
|
||||
for [name, info] in items(a:class_info.properties)
|
||||
let re .= "\n\t// @var $".name." ".info.type
|
||||
let re .= "\n\tpublic $".name.";"
|
||||
endfor
|
||||
endif
|
||||
if has_key(a:class_info, 'static_properties')
|
||||
for [name, info] in items(a:class_info.static_properties)
|
||||
let re .= "\n\t// @var ".name." ".info.type
|
||||
let re .= "\n\tpublic static ".name." = ".info.initializer.";"
|
||||
endfor
|
||||
endif
|
||||
if has_key(a:class_info, 'methods')
|
||||
for [name, info] in items(a:class_info.methods)
|
||||
if name =~ '^__'
|
||||
continue
|
||||
endif
|
||||
let re .= "\n\t/**"
|
||||
let re .= "\n\t * ".name
|
||||
let re .= "\n\t *"
|
||||
let re .= "\n\t * @return ".info.return_type
|
||||
let re .= "\n\t */"
|
||||
let re .= "\n\tpublic function ".name."(".info.signature."){"
|
||||
let re .= "\n\t}"
|
||||
endfor
|
||||
endif
|
||||
if has_key(a:class_info, 'static_methods')
|
||||
for [name, info] in items(a:class_info.static_methods)
|
||||
let re .= "\n\t/**"
|
||||
let re .= "\n\t * ".name
|
||||
let re .= "\n\t *"
|
||||
let re .= "\n\t * @return ".info.return_type
|
||||
let re .= "\n\t */"
|
||||
let re .= "\n\tpublic static function ".name."(".info.signature."){"
|
||||
let re .= "\n\t}"
|
||||
endfor
|
||||
endif
|
||||
let re .= "\n}"
|
||||
|
||||
return { 'class': a:class_info['name'],
|
||||
return { a:type : a:class_info['name'],
|
||||
\ 'content': re,
|
||||
\ 'namespace': '',
|
||||
\ 'imports': {},
|
||||
@@ -2099,8 +2245,11 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
|
||||
" start backward serch for the comment block
|
||||
while l != 0
|
||||
let line = a:sccontent[l]
|
||||
" if comment end found save line position and end search
|
||||
if line =~? '^\s*\*/'
|
||||
" if it's a one line docblock like comment and we can just return it right away
|
||||
if line =~? '^\s*\/\*\*.\+\*\/\s*$'
|
||||
return substitute(line, '\v^\s*(\/\*\*\s*)|(\s*\*\/)\s*$', '', 'g')
|
||||
"... or if comment end found save line position and end search
|
||||
elseif line =~? '^\s*\*/'
|
||||
let comment_end = l
|
||||
break
|
||||
" ... or the line doesn't blank (only whitespace or nothing) end search
|
||||
@@ -2122,6 +2271,7 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
|
||||
endif
|
||||
let l -= 1
|
||||
endwhile
|
||||
|
||||
" no docblock comment start found
|
||||
if comment_start == -1
|
||||
return ''
|
||||
@@ -2270,19 +2420,48 @@ endfunction!
|
||||
" }}}
|
||||
|
||||
function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
let original_window = winnr()
|
||||
|
||||
silent! below 1new
|
||||
silent! 0put =a:file_lines
|
||||
normal! G
|
||||
|
||||
" clear out classes, functions and other blocks
|
||||
while 1
|
||||
let block_start_pos = searchpos('\c\(class\|trait\|function\|interface\)\s\+\_.\{-}\zs{', 'Web')
|
||||
if block_start_pos == [0, 0]
|
||||
break
|
||||
endif
|
||||
let block_end_pos = searchpairpos('{', '', '}\|\%$', 'W', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
|
||||
|
||||
if block_end_pos != [0, 0]
|
||||
" end of the block found, just delete it
|
||||
silent! exec block_start_pos[0].','.block_end_pos[0].'d _'
|
||||
else
|
||||
" block pair not found, use block start as beginning and the end
|
||||
" of the buffer instead
|
||||
silent! exec block_start_pos[0].',$d _'
|
||||
endif
|
||||
endwhile
|
||||
normal! G
|
||||
|
||||
" grab the remains
|
||||
let file_lines = reverse(getline(1, line('.') - 1))
|
||||
|
||||
silent! bw! %
|
||||
exe original_window.'wincmd w'
|
||||
|
||||
let namespace_name_pattern = '[a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
|
||||
let file_lines = reverse(copy(a:file_lines))
|
||||
let i = 0
|
||||
let file_length = len(file_lines)
|
||||
let imports = {}
|
||||
|
||||
let current_namespace = '\'
|
||||
|
||||
while i < file_length
|
||||
let line = file_lines[i]
|
||||
|
||||
if line =~? '^\s*namespace\s*'.namespace_name_pattern
|
||||
let current_namespace = matchstr(line, '^\s*namespace\s*\zs'.namespace_name_pattern.'\ze')
|
||||
if line =~? '^\(<?php\)\?\s*namespace\s*'.namespace_name_pattern
|
||||
let current_namespace = matchstr(line, '\c^\(<?php\)\?\s*namespace\s*\zs'.namespace_name_pattern.'\ze')
|
||||
break
|
||||
endif
|
||||
|
||||
@@ -2303,11 +2482,11 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
let use_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g')
|
||||
endwhile
|
||||
endif
|
||||
let use_expression = matchstr(use_line, '^\s*use\s\+\zs.\{-}\ze;')
|
||||
let use_expression = matchstr(use_line, '^\c\s*use\s\+\zs.\{-}\ze;')
|
||||
let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")')
|
||||
for part in use_parts
|
||||
if part =~? '\s\+as\s\+'
|
||||
let [object, name] = split(part, '\s\+as\s\+')
|
||||
let [object, name] = split(part, '\s\+as\s\+\c')
|
||||
let object = substitute(object, '^\\', '', '')
|
||||
let name = substitute(name, '^\\', '', '')
|
||||
else
|
||||
@@ -2343,7 +2522,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
break
|
||||
endif
|
||||
" if the name matches with the extracted classname and namespace
|
||||
if (tag.kind == 'c' || tag.kind == 'i') && tag.name == classname
|
||||
if (tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't') && tag.name == classname
|
||||
if has_key(tag, 'namespace')
|
||||
let patched_ctags_detected = 1
|
||||
if tag.namespace == namespace_for_classes
|
||||
@@ -2386,7 +2565,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
let tags = phpcomplete#GetTaglist('^'.import['name'].'$')
|
||||
for tag in tags
|
||||
" search for the first matchin namespace, class, interface with no namespace
|
||||
if !has_key(tag, 'namespace') && (tag.kind == 'n' || tag.kind == 'c' || tag.kind == 'i')
|
||||
if !has_key(tag, 'namespace') && (tag.kind == 'n' || tag.kind == 'c' || tag.kind == 'i' || tag.kind == 't')
|
||||
call extend(import, tag)
|
||||
let import['builtin'] = 0
|
||||
break
|
||||
@@ -2445,7 +2624,7 @@ endfunction
|
||||
|
||||
function! phpcomplete#ExpandClassName(classname, current_namespace, imports) " {{{
|
||||
" if there's an imported class, just use that class's information
|
||||
if has_key(a:imports, a:classname) && (a:imports[a:classname].kind == 'c' || a:imports[a:classname].kind == 'i')
|
||||
if has_key(a:imports, a:classname) && (a:imports[a:classname].kind == 'c' || a:imports[a:classname].kind == 'i' || a:imports[a:classname].kind == 't')
|
||||
let namespace = has_key(a:imports[a:classname], 'namespace') ? a:imports[a:classname].namespace : ''
|
||||
return [a:imports[a:classname].name, namespace]
|
||||
endif
|
||||
|
@@ -37,16 +37,21 @@ if executable('pbcopy')
|
||||
let s:copy['*'] = s:copy['+']
|
||||
let s:paste['*'] = s:paste['+']
|
||||
let s:cache_enabled = 0
|
||||
elseif executable('xclip')
|
||||
let s:copy['+'] = 'xclip -quiet -i -selection clipboard'
|
||||
let s:paste['+'] = 'xclip -o -selection clipboard'
|
||||
let s:copy['*'] = 'xclip -quiet -i -selection primary'
|
||||
let s:paste['*'] = 'xclip -o -selection primary'
|
||||
elseif executable('xsel')
|
||||
elseif exists('$DISPLAY') && executable('xsel')
|
||||
let s:copy['+'] = 'xsel --nodetach -i -b'
|
||||
let s:paste['+'] = 'xsel -o -b'
|
||||
let s:copy['*'] = 'xsel --nodetach -i -p'
|
||||
let s:paste['*'] = 'xsel -o -p'
|
||||
elseif exists('$DISPLAY') && executable('xclip')
|
||||
let s:copy['+'] = 'xclip -quiet -i -selection clipboard'
|
||||
let s:paste['+'] = 'xclip -o -selection clipboard'
|
||||
let s:copy['*'] = 'xclip -quiet -i -selection primary'
|
||||
let s:paste['*'] = 'xclip -o -selection primary'
|
||||
elseif executable('lemonade')
|
||||
let s:copy['+'] = 'lemonade copy'
|
||||
let s:paste['+'] = 'lemonade paste'
|
||||
let s:copy['*'] = 'lemonade copy'
|
||||
let s:paste['*'] = 'lemonade paste'
|
||||
else
|
||||
echom 'clipboard: No clipboard tool available. See :help nvim-clipboard'
|
||||
finish
|
||||
@@ -83,6 +88,7 @@ function! s:clipboard.set(lines, regtype, reg)
|
||||
end
|
||||
let selection.data = [a:lines, a:regtype]
|
||||
let argv = split(s:copy[a:reg], " ")
|
||||
let selection.detach = s:cache_enabled
|
||||
let jobid = jobstart(argv, selection)
|
||||
if jobid <= 0
|
||||
echohl WarningMsg
|
||||
|
@@ -24,12 +24,10 @@ if s:prog == ''
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:plugin_path = expand('<sfile>:p:h').'/script_host.py'
|
||||
|
||||
" The Python provider plugin will run in a separate instance of the Python
|
||||
" host.
|
||||
call remote#host#RegisterClone('legacy-python-provider', 'python')
|
||||
call remote#host#RegisterPlugin('legacy-python-provider', s:plugin_path, [])
|
||||
call remote#host#RegisterPlugin('legacy-python-provider', 'script_host.py', [])
|
||||
|
||||
function! provider#python#Call(method, args)
|
||||
if s:err != ''
|
||||
|
@@ -24,12 +24,10 @@ if s:prog == ''
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:plugin_path = expand('<sfile>:p:h').'/script_host.py'
|
||||
|
||||
" The Python3 provider plugin will run in a separate instance of the Python3
|
||||
" host.
|
||||
call remote#host#RegisterClone('legacy-python3-provider', 'python3')
|
||||
call remote#host#RegisterPlugin('legacy-python3-provider', s:plugin_path, [])
|
||||
call remote#host#RegisterPlugin('legacy-python3-provider', 'script_host.py', [])
|
||||
|
||||
function! provider#python3#Call(method, args)
|
||||
if s:err != ''
|
||||
|
@@ -5,6 +5,32 @@ endif
|
||||
|
||||
let s:loaded_pythonx_provider = 1
|
||||
|
||||
function! provider#pythonx#Require(host) abort
|
||||
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
|
||||
|
||||
" Python host arguments
|
||||
let args = ['-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
|
||||
|
||||
" Collect registered Python plugins into args
|
||||
let python_plugins = remote#host#PluginsForHost(a:host.name)
|
||||
for plugin in python_plugins
|
||||
call add(args, plugin.path)
|
||||
endfor
|
||||
|
||||
try
|
||||
let channel_id = rpcstart((ver == '2' ?
|
||||
\ provider#python#Prog() : provider#python3#Prog()), args)
|
||||
if rpcrequest(channel_id, 'poll') == 'ok'
|
||||
return channel_id
|
||||
endif
|
||||
catch
|
||||
echomsg v:throwpoint
|
||||
echomsg v:exception
|
||||
endtry
|
||||
throw remote#host#LoadErrorForHost(a:host.orig_name,
|
||||
\ '$NVIM_PYTHON_LOG_FILE')
|
||||
endfunction
|
||||
|
||||
function! provider#pythonx#Detect(major_ver) abort
|
||||
let host_var = (a:major_ver == 2) ?
|
||||
\ 'g:python_host_prog' : 'g:python3_host_prog'
|
||||
|
34
runtime/autoload/provider/ruby.vim
Normal file
34
runtime/autoload/provider/ruby.vim
Normal file
@@ -0,0 +1,34 @@
|
||||
" The Ruby provider helper
|
||||
if exists('s:loaded_ruby_provider')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:loaded_ruby_provider = 1
|
||||
|
||||
function! provider#ruby#Require(host) abort
|
||||
" Collect registered Ruby plugins into args
|
||||
let args = []
|
||||
let ruby_plugins = remote#host#PluginsForHost(a:host.name)
|
||||
|
||||
for plugin in ruby_plugins
|
||||
call add(args, plugin.path)
|
||||
endfor
|
||||
|
||||
try
|
||||
let channel_id = rpcstart(provider#ruby#Prog(), args)
|
||||
|
||||
if rpcrequest(channel_id, 'poll') == 'ok'
|
||||
return channel_id
|
||||
endif
|
||||
catch
|
||||
echomsg v:throwpoint
|
||||
echomsg v:exception
|
||||
endtry
|
||||
|
||||
throw remote#host#LoadErrorForHost(a:host.orig_name,
|
||||
\ '$NVIM_RUBY_LOG_FILE')
|
||||
endfunction
|
||||
|
||||
function! provider#ruby#Prog() abort
|
||||
return 'neovim-ruby-host'
|
||||
endfunction
|
@@ -1,249 +0,0 @@
|
||||
"""Legacy python/python3-vim emulation."""
|
||||
import imp
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
import neovim
|
||||
|
||||
__all__ = ('ScriptHost',)
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
debug, info, warn = (logger.debug, logger.info, logger.warn,)
|
||||
|
||||
IS_PYTHON3 = sys.version_info >= (3, 0)
|
||||
|
||||
if IS_PYTHON3:
|
||||
basestring = str
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
from importlib.machinery import PathFinder
|
||||
|
||||
|
||||
@neovim.plugin
|
||||
class ScriptHost(object):
|
||||
|
||||
"""Provides an environment for running python plugins created for Vim."""
|
||||
|
||||
def __init__(self, nvim):
|
||||
"""Initialize the legacy python-vim environment."""
|
||||
self.setup(nvim)
|
||||
# context where all code will run
|
||||
self.module = imp.new_module('__main__')
|
||||
nvim.script_context = self.module
|
||||
# it seems some plugins assume 'sys' is already imported, so do it now
|
||||
exec('import sys', self.module.__dict__)
|
||||
self.legacy_vim = nvim.with_hook(LegacyEvalHook())
|
||||
sys.modules['vim'] = self.legacy_vim
|
||||
|
||||
def setup(self, nvim):
|
||||
"""Setup import hooks and global streams.
|
||||
|
||||
This will add import hooks for importing modules from runtime
|
||||
directories and patch the sys module so 'print' calls will be
|
||||
forwarded to Nvim.
|
||||
"""
|
||||
self.nvim = nvim
|
||||
info('install import hook/path')
|
||||
self.hook = path_hook(nvim)
|
||||
sys.path_hooks.append(self.hook)
|
||||
nvim.VIM_SPECIAL_PATH = '_vim_path_'
|
||||
sys.path.append(nvim.VIM_SPECIAL_PATH)
|
||||
info('redirect sys.stdout and sys.stderr')
|
||||
self.saved_stdout = sys.stdout
|
||||
self.saved_stderr = sys.stderr
|
||||
sys.stdout = RedirectStream(lambda data: nvim.out_write(data))
|
||||
sys.stderr = RedirectStream(lambda data: nvim.err_write(data))
|
||||
|
||||
def teardown(self):
|
||||
"""Restore state modified from the `setup` call."""
|
||||
for plugin in self.installed_plugins:
|
||||
if hasattr(plugin, 'on_teardown'):
|
||||
plugin.teardown()
|
||||
nvim = self.nvim
|
||||
info('uninstall import hook/path')
|
||||
sys.path.remove(nvim.VIM_SPECIAL_PATH)
|
||||
sys.path_hooks.remove(self.hook)
|
||||
info('restore sys.stdout and sys.stderr')
|
||||
sys.stdout = self.saved_stdout
|
||||
sys.stderr = self.saved_stderr
|
||||
|
||||
@neovim.rpc_export('python_execute', sync=True)
|
||||
def python_execute(self, script, range_start, range_stop):
|
||||
"""Handle the `python` ex command."""
|
||||
self._set_current_range(range_start, range_stop)
|
||||
exec(script, self.module.__dict__)
|
||||
|
||||
@neovim.rpc_export('python_execute_file', sync=True)
|
||||
def python_execute_file(self, file_path, range_start, range_stop):
|
||||
"""Handle the `pyfile` ex command."""
|
||||
self._set_current_range(range_start, range_stop)
|
||||
with open(file_path) as f:
|
||||
script = compile(f.read(), file_path, 'exec')
|
||||
exec(script, self.module.__dict__)
|
||||
|
||||
@neovim.rpc_export('python_do_range', sync=True)
|
||||
def python_do_range(self, start, stop, code):
|
||||
"""Handle the `pydo` ex command."""
|
||||
self._set_current_range(start, stop)
|
||||
nvim = self.nvim
|
||||
start -= 1
|
||||
stop -= 1
|
||||
fname = '_vim_pydo'
|
||||
|
||||
# define the function
|
||||
function_def = 'def %s(line, linenr):\n %s' % (fname, code,)
|
||||
exec(function_def, self.module.__dict__)
|
||||
# get the function
|
||||
function = self.module.__dict__[fname]
|
||||
while start <= stop:
|
||||
# Process batches of 5000 to avoid the overhead of making multiple
|
||||
# API calls for every line. Assuming an average line length of 100
|
||||
# bytes, approximately 488 kilobytes will be transferred per batch,
|
||||
# which can be done very quickly in a single API call.
|
||||
sstart = start
|
||||
sstop = min(start + 5000, stop)
|
||||
lines = nvim.current.buffer.get_line_slice(sstart, sstop, True,
|
||||
True)
|
||||
|
||||
exception = None
|
||||
newlines = []
|
||||
linenr = sstart + 1
|
||||
for i, line in enumerate(lines):
|
||||
result = function(line, linenr)
|
||||
if result is None:
|
||||
# Update earlier lines, and skip to the next
|
||||
if newlines:
|
||||
end = sstart + len(newlines) - 1
|
||||
nvim.current.buffer.set_line_slice(sstart, end,
|
||||
True, True,
|
||||
newlines)
|
||||
sstart += len(newlines) + 1
|
||||
newlines = []
|
||||
pass
|
||||
elif isinstance(result, basestring):
|
||||
newlines.append(result)
|
||||
else:
|
||||
exception = TypeError('pydo should return a string ' +
|
||||
'or None, found %s instead'
|
||||
% result.__class__.__name__)
|
||||
break
|
||||
linenr += 1
|
||||
|
||||
start = sstop + 1
|
||||
if newlines:
|
||||
end = sstart + len(newlines) - 1
|
||||
nvim.current.buffer.set_line_slice(sstart, end, True, True,
|
||||
newlines)
|
||||
if exception:
|
||||
raise exception
|
||||
# delete the function
|
||||
del self.module.__dict__[fname]
|
||||
|
||||
@neovim.rpc_export('python_eval', sync=True)
|
||||
def python_eval(self, expr):
|
||||
"""Handle the `pyeval` vim function."""
|
||||
return eval(expr, self.module.__dict__)
|
||||
|
||||
def _set_current_range(self, start, stop):
|
||||
current = self.legacy_vim.current
|
||||
current.range = current.buffer.range(start, stop)
|
||||
|
||||
|
||||
class RedirectStream(object):
|
||||
def __init__(self, redirect_handler):
|
||||
self.redirect_handler = redirect_handler
|
||||
|
||||
def write(self, data):
|
||||
self.redirect_handler(data)
|
||||
|
||||
def writelines(self, seq):
|
||||
self.redirect_handler('\n'.join(seq))
|
||||
|
||||
def flush(self):
|
||||
pass
|
||||
|
||||
|
||||
class LegacyEvalHook(neovim.SessionHook):
|
||||
|
||||
"""Injects legacy `vim.eval` behavior to a Nvim instance."""
|
||||
|
||||
def __init__(self):
|
||||
super(LegacyEvalHook, self).__init__(from_nvim=self._string_eval)
|
||||
|
||||
def _string_eval(self, obj, session, method, kind):
|
||||
if method == 'vim_eval':
|
||||
if IS_PYTHON3:
|
||||
if isinstance(obj, (int, float)):
|
||||
return str(obj)
|
||||
elif isinstance(obj, (int, long, float)):
|
||||
return str(obj)
|
||||
return obj
|
||||
|
||||
|
||||
# This was copied/adapted from nvim-python help
|
||||
def path_hook(nvim):
|
||||
def _get_paths():
|
||||
return discover_runtime_directories(nvim)
|
||||
|
||||
def _find_module(fullname, oldtail, path):
|
||||
idx = oldtail.find('.')
|
||||
if idx > 0:
|
||||
name = oldtail[:idx]
|
||||
tail = oldtail[idx+1:]
|
||||
fmr = imp.find_module(name, path)
|
||||
module = imp.find_module(fullname[:-len(oldtail)] + name, *fmr)
|
||||
return _find_module(fullname, tail, module.__path__)
|
||||
else:
|
||||
return imp.find_module(fullname, path)
|
||||
|
||||
class VimModuleLoader(object):
|
||||
def __init__(self, module):
|
||||
self.module = module
|
||||
|
||||
def load_module(self, fullname, path=None):
|
||||
# Check sys.modules, required for reload (see PEP302).
|
||||
if fullname in sys.modules:
|
||||
return sys.modules[fullname]
|
||||
return imp.load_module(fullname, *self.module)
|
||||
|
||||
class VimPathFinder(object):
|
||||
@staticmethod
|
||||
def find_module(fullname, path=None):
|
||||
"Method for Python 2.7 and 3.3."
|
||||
try:
|
||||
return VimModuleLoader(
|
||||
_find_module(fullname, fullname, path or _get_paths()))
|
||||
except ImportError:
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def find_spec(fullname, path=None, target=None):
|
||||
"Method for Python 3.4+."
|
||||
return PathFinder.find_spec(fullname, path or _get_paths(), target)
|
||||
|
||||
def hook(path):
|
||||
if path == nvim.VIM_SPECIAL_PATH:
|
||||
return VimPathFinder
|
||||
else:
|
||||
raise ImportError
|
||||
|
||||
return hook
|
||||
|
||||
|
||||
def discover_runtime_directories(nvim):
|
||||
rv = []
|
||||
for path in nvim.list_runtime_paths():
|
||||
if not os.path.exists(path):
|
||||
continue
|
||||
path1 = os.path.join(path, 'pythonx')
|
||||
if IS_PYTHON3:
|
||||
path2 = os.path.join(path, 'python3')
|
||||
else:
|
||||
path2 = os.path.join(path, 'python2')
|
||||
if os.path.exists(path1):
|
||||
rv.append(path1)
|
||||
if os.path.exists(path2):
|
||||
rv.append(path2)
|
||||
return rv
|
@@ -1,7 +1,7 @@
|
||||
"python3complete.vim - Omni Completion for python
|
||||
" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
|
||||
" Version: 0.9
|
||||
" Last Updated: 18 Jun 2009
|
||||
" Last Updated: 18 Jun 2009 (small fix 2015 Sep 14 from Debian)
|
||||
"
|
||||
" Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim
|
||||
"
|
||||
@@ -359,6 +359,7 @@ class PyParser:
|
||||
def __init__(self):
|
||||
self.top = Scope('global',0)
|
||||
self.scope = self.top
|
||||
self.parserline = 0
|
||||
|
||||
def _parsedotname(self,pre=None):
|
||||
#returns (dottedname, nexttoken)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
function! remote#define#CommandOnHost(host, method, sync, name, opts)
|
||||
let prefix = ''
|
||||
|
||||
if has_key(a:opts, 'range')
|
||||
if has_key(a:opts, 'range')
|
||||
if a:opts.range == '' || a:opts.range == '%'
|
||||
" -range or -range=%, pass the line range in a list
|
||||
let prefix = '<line1>,<line2>'
|
||||
@@ -30,7 +30,7 @@ function! remote#define#CommandOnHost(host, method, sync, name, opts)
|
||||
exe s:GetCommandPrefix(a:name, a:opts)
|
||||
\ .' call remote#define#CommandBootstrap("'.a:host.'"'
|
||||
\ . ', "'.a:method.'"'
|
||||
\ . ', "'.a:sync.'"'
|
||||
\ . ', '.string(a:sync)
|
||||
\ . ', "'.a:name.'"'
|
||||
\ . ', '.string(a:opts).''
|
||||
\ . ', "'.join(forward_args, '').'"'
|
||||
@@ -94,7 +94,7 @@ function! remote#define#AutocmdOnHost(host, method, sync, name, opts)
|
||||
let bootstrap_def = s:GetAutocmdPrefix(a:name, a:opts)
|
||||
\ .' call remote#define#AutocmdBootstrap("'.a:host.'"'
|
||||
\ . ', "'.a:method.'"'
|
||||
\ . ', "'.a:sync.'"'
|
||||
\ . ', '.string(a:sync)
|
||||
\ . ', "'.a:name.'"'
|
||||
\ . ', '.string(a:opts).''
|
||||
\ . ', "'.escape(forward, '"').'"'
|
||||
@@ -133,7 +133,7 @@ function! remote#define#FunctionOnHost(host, method, sync, name, opts)
|
||||
exe 'autocmd! '.group.' FuncUndefined '.a:name
|
||||
\ .' call remote#define#FunctionBootstrap("'.a:host.'"'
|
||||
\ . ', "'.a:method.'"'
|
||||
\ . ', "'.a:sync.'"'
|
||||
\ . ', '.string(a:sync)
|
||||
\ . ', "'.a:name.'"'
|
||||
\ . ', '.string(a:opts)
|
||||
\ . ', "'.group.'"'
|
||||
@@ -157,6 +157,9 @@ endfunction
|
||||
|
||||
function! remote#define#FunctionOnChannel(channel, method, sync, name, opts)
|
||||
let rpcargs = [a:channel, '"'.a:method.'"', 'a:000']
|
||||
if has_key(a:opts, 'range')
|
||||
call add(rpcargs, '[a:firstline, a:lastline]')
|
||||
endif
|
||||
call s:AddEval(rpcargs, a:opts)
|
||||
|
||||
let function_def = s:GetFunctionPrefix(a:name, a:opts)
|
||||
@@ -187,7 +190,7 @@ let s:next_gid = 1
|
||||
function! s:GetNextAutocmdGroup()
|
||||
let gid = s:next_gid
|
||||
let s:next_gid += 1
|
||||
|
||||
|
||||
let group_name = 'RPC_DEFINE_AUTOCMD_GROUP_'.gid
|
||||
" Ensure the group is defined
|
||||
exe 'augroup '.group_name.' | augroup END'
|
||||
@@ -218,7 +221,11 @@ endfunction
|
||||
|
||||
|
||||
function! s:GetFunctionPrefix(name, opts)
|
||||
return "function! ".a:name."(...)\n"
|
||||
let res = "function! ".a:name."(...)"
|
||||
if has_key(a:opts, 'range')
|
||||
let res = res." range"
|
||||
endif
|
||||
return res."\n"
|
||||
endfunction
|
||||
|
||||
|
||||
|
@@ -2,10 +2,11 @@ let s:hosts = {}
|
||||
let s:plugin_patterns = {}
|
||||
let s:remote_plugins_manifest = fnamemodify(expand($MYVIMRC, 1), ':h')
|
||||
\.'/.'.fnamemodify($MYVIMRC, ':t').'-rplugin~'
|
||||
let s:plugins_for_host = {}
|
||||
|
||||
|
||||
" Register a host by associating it with a factory(funcref)
|
||||
function! remote#host#Register(name, pattern, factory)
|
||||
function! remote#host#Register(name, pattern, factory) abort
|
||||
let s:hosts[a:name] = {'factory': a:factory, 'channel': 0, 'initialized': 0}
|
||||
let s:plugin_patterns[a:name] = a:pattern
|
||||
if type(a:factory) == type(1) && a:factory
|
||||
@@ -19,7 +20,7 @@ endfunction
|
||||
" as `source`, but it will run as a different process. This can be used by
|
||||
" plugins that should run isolated from other plugins created for the same host
|
||||
" type
|
||||
function! remote#host#RegisterClone(name, orig_name)
|
||||
function! remote#host#RegisterClone(name, orig_name) abort
|
||||
if !has_key(s:hosts, a:orig_name)
|
||||
throw 'No host named "'.a:orig_name.'" is registered'
|
||||
endif
|
||||
@@ -34,7 +35,10 @@ endfunction
|
||||
|
||||
|
||||
" Get a host channel, bootstrapping it if necessary
|
||||
function! remote#host#Require(name)
|
||||
function! remote#host#Require(name) abort
|
||||
if empty(s:plugins_for_host)
|
||||
call remote#host#LoadRemotePlugins()
|
||||
endif
|
||||
if !has_key(s:hosts, a:name)
|
||||
throw 'No host named "'.a:name.'" is registered'
|
||||
endif
|
||||
@@ -51,7 +55,7 @@ function! remote#host#Require(name)
|
||||
endfunction
|
||||
|
||||
|
||||
function! remote#host#IsRunning(name)
|
||||
function! remote#host#IsRunning(name) abort
|
||||
if !has_key(s:hosts, a:name)
|
||||
throw 'No host named "'.a:name.'" is registered'
|
||||
endif
|
||||
@@ -72,7 +76,7 @@ endfunction
|
||||
"
|
||||
" The third item in a declaration is a boolean: non zero means the command,
|
||||
" autocommand or function will be executed synchronously with rpcrequest.
|
||||
function! remote#host#RegisterPlugin(host, path, specs)
|
||||
function! remote#host#RegisterPlugin(host, path, specs) abort
|
||||
let plugins = remote#host#PluginsForHost(a:host)
|
||||
|
||||
for plugin in plugins
|
||||
@@ -116,14 +120,21 @@ function! remote#host#RegisterPlugin(host, path, specs)
|
||||
endfunction
|
||||
|
||||
|
||||
function! remote#host#LoadRemotePlugins()
|
||||
function! remote#host#LoadRemotePlugins() abort
|
||||
if filereadable(s:remote_plugins_manifest)
|
||||
exe 'source '.s:remote_plugins_manifest
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:RegistrationCommands(host)
|
||||
function! remote#host#LoadRemotePluginsEvent(event, pattern) abort
|
||||
autocmd! nvim-rplugin
|
||||
call remote#host#LoadRemotePlugins()
|
||||
execute 'silent doautocmd <nomodeline>' a:event a:pattern
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:RegistrationCommands(host) abort
|
||||
" Register a temporary host clone for discovering specs
|
||||
let host_id = a:host.'-registration-clone'
|
||||
call remote#host#RegisterClone(host_id, a:host)
|
||||
@@ -138,7 +149,9 @@ function! s:RegistrationCommands(host)
|
||||
endfor
|
||||
let channel = remote#host#Require(host_id)
|
||||
let lines = []
|
||||
let registered = []
|
||||
for path in paths
|
||||
unlet! specs
|
||||
let specs = rpcrequest(channel, 'specs', path)
|
||||
if type(specs) != type([])
|
||||
" host didn't return a spec list, indicates a failure while loading a
|
||||
@@ -151,9 +164,10 @@ function! s:RegistrationCommands(host)
|
||||
call add(lines, " \\ ".string(spec).",")
|
||||
endfor
|
||||
call add(lines, " \\ ])")
|
||||
call add(registered, path)
|
||||
endfor
|
||||
echomsg printf("remote/host: %s host registered plugins %s",
|
||||
\ a:host, string(map(copy(paths), "fnamemodify(v:val, ':t')")))
|
||||
\ a:host, string(map(registered, "fnamemodify(v:val, ':t')")))
|
||||
|
||||
" Delete the temporary host clone
|
||||
call rpcstop(s:hosts[host_id].channel)
|
||||
@@ -163,26 +177,29 @@ function! s:RegistrationCommands(host)
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:UpdateRemotePlugins()
|
||||
function! remote#host#UpdateRemotePlugins() abort
|
||||
let commands = []
|
||||
let hosts = keys(s:hosts)
|
||||
for host in hosts
|
||||
if has_key(s:plugin_patterns, host)
|
||||
let commands = commands
|
||||
\ + ['" '.host.' plugins']
|
||||
\ + s:RegistrationCommands(host)
|
||||
\ + ['', '']
|
||||
try
|
||||
let commands +=
|
||||
\ ['" '.host.' plugins']
|
||||
\ + s:RegistrationCommands(host)
|
||||
\ + ['', '']
|
||||
catch
|
||||
echomsg v:throwpoint
|
||||
echomsg v:exception
|
||||
endtry
|
||||
endif
|
||||
endfor
|
||||
call writefile(commands, s:remote_plugins_manifest)
|
||||
echomsg printf('remote/host: generated the manifest file in "%s"',
|
||||
\ s:remote_plugins_manifest)
|
||||
endfunction
|
||||
|
||||
|
||||
command! UpdateRemotePlugins call s:UpdateRemotePlugins()
|
||||
|
||||
|
||||
let s:plugins_for_host = {}
|
||||
function! remote#host#PluginsForHost(host)
|
||||
function! remote#host#PluginsForHost(host) abort
|
||||
if !has_key(s:plugins_for_host, a:host)
|
||||
let s:plugins_for_host[a:host] = []
|
||||
end
|
||||
@@ -190,38 +207,25 @@ function! remote#host#PluginsForHost(host)
|
||||
endfunction
|
||||
|
||||
|
||||
" Registration of standard hosts
|
||||
|
||||
" Python/Python3 {{{
|
||||
function! s:RequirePythonHost(host)
|
||||
let ver = (a:host.orig_name ==# 'python') ? 2 : 3
|
||||
|
||||
" Python host arguments
|
||||
let args = ['-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
|
||||
|
||||
" Collect registered Python plugins into args
|
||||
let python_plugins = remote#host#PluginsForHost(a:host.name)
|
||||
for plugin in python_plugins
|
||||
call add(args, plugin.path)
|
||||
endfor
|
||||
|
||||
try
|
||||
let channel_id = rpcstart((ver == '2' ?
|
||||
\ provider#python#Prog() : provider#python3#Prog()), args)
|
||||
if rpcrequest(channel_id, 'poll') == 'ok'
|
||||
return channel_id
|
||||
endif
|
||||
catch
|
||||
echomsg v:exception
|
||||
endtry
|
||||
throw 'Failed to load Python host. You can try to see what happened '.
|
||||
function! remote#host#LoadErrorForHost(host, log) abort
|
||||
return 'Failed to load '. a:host . ' host. '.
|
||||
\ 'You can try to see what happened '.
|
||||
\ 'by starting Neovim with the environment variable '.
|
||||
\ '$NVIM_PYTHON_LOG_FILE set to a file and opening '.
|
||||
\ 'the generated log file. Also, the host stderr will be available '.
|
||||
\ a:log . ' set to a file and opening the generated '.
|
||||
\ 'log file. Also, the host stderr will be available '.
|
||||
\ 'in Neovim log, so it may contain useful information. '.
|
||||
\ 'See also ~/.nvimlog.'
|
||||
endfunction
|
||||
|
||||
call remote#host#Register('python', '*.py', function('s:RequirePythonHost'))
|
||||
call remote#host#Register('python3', '*.py', function('s:RequirePythonHost'))
|
||||
" }}}
|
||||
|
||||
" Registration of standard hosts
|
||||
|
||||
" Python/Python3
|
||||
call remote#host#Register('python', '*',
|
||||
\ function('provider#pythonx#Require'))
|
||||
call remote#host#Register('python3', '*',
|
||||
\ function('provider#pythonx#Require'))
|
||||
|
||||
" Ruby
|
||||
call remote#host#Register('ruby', '*.rb',
|
||||
\ function('provider#ruby#Require'))
|
||||
|
@@ -1,6 +1,4 @@
|
||||
" Vim script to download a missing spell file
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2012 Jan 08
|
||||
|
||||
if !exists('g:spellfile_URL')
|
||||
" Prefer using http:// when netrw should be able to use it, since
|
||||
@@ -43,22 +41,23 @@ function! spellfile#LoadFile(lang)
|
||||
if len(dirlist) == 0
|
||||
let dir_to_create = spellfile#WritableSpellDir()
|
||||
if &verbose || dir_to_create != ''
|
||||
echomsg 'spellfile#LoadFile(): There is no writable spell directory.'
|
||||
echomsg 'spellfile#LoadFile(): No (writable) spell directory found.'
|
||||
endif
|
||||
if dir_to_create != ''
|
||||
if confirm("Shall I create " . dir_to_create, "&Yes\n&No", 2) == 1
|
||||
" After creating the directory it should show up in the list.
|
||||
call mkdir(dir_to_create, "p")
|
||||
let [dirlist, dirchoices] = spellfile#GetDirChoices()
|
||||
endif
|
||||
call mkdir(dir_to_create, "p")
|
||||
" Now it should show up in the list.
|
||||
let [dirlist, dirchoices] = spellfile#GetDirChoices()
|
||||
endif
|
||||
if len(dirlist) == 0
|
||||
echomsg 'Failed to create: '.dir_to_create
|
||||
return
|
||||
else
|
||||
echomsg 'Created '.dir_to_create
|
||||
endif
|
||||
endif
|
||||
|
||||
let msg = 'Cannot find spell file for "' . a:lang . '" in ' . &enc
|
||||
let msg .= "\nDo you want me to try downloading it?"
|
||||
let msg = 'No spell file for "' . a:lang . '" in ' . &enc
|
||||
let msg .= "\nDownload it?"
|
||||
if confirm(msg, "&Yes\n&No", 2) == 1
|
||||
let enc = &encoding
|
||||
if enc == 'iso-8859-15'
|
||||
@@ -78,78 +77,77 @@ function! spellfile#LoadFile(lang)
|
||||
" Careful: Nread() may have opened a new window for the error message,
|
||||
" we need to go back to our own buffer and window.
|
||||
if newbufnr != winbufnr(0)
|
||||
let winnr = bufwinnr(newbufnr)
|
||||
if winnr == -1
|
||||
" Our buffer has vanished!? Open a new window.
|
||||
echomsg "download buffer disappeared, opening a new one"
|
||||
new
|
||||
setlocal bin fenc=
|
||||
else
|
||||
exe winnr . "wincmd w"
|
||||
endif
|
||||
let winnr = bufwinnr(newbufnr)
|
||||
if winnr == -1
|
||||
" Our buffer has vanished!? Open a new window.
|
||||
echomsg "download buffer disappeared, opening a new one"
|
||||
new
|
||||
setlocal bin fenc=
|
||||
else
|
||||
exe winnr . "wincmd w"
|
||||
endif
|
||||
endif
|
||||
if newbufnr == winbufnr(0)
|
||||
" We are back the old buffer, remove any (half-finished) download.
|
||||
g/^/d
|
||||
" We are back the old buffer, remove any (half-finished) download.
|
||||
g/^/d_
|
||||
else
|
||||
let newbufnr = winbufnr(0)
|
||||
let newbufnr = winbufnr(0)
|
||||
endif
|
||||
|
||||
let fname = a:lang . '.ascii.spl'
|
||||
echo 'Could not find it, trying ' . fname . '...'
|
||||
call spellfile#Nread(fname)
|
||||
if getline(2) !~ 'VIMspell'
|
||||
echo 'Sorry, downloading failed'
|
||||
exe newbufnr . "bwipe!"
|
||||
return
|
||||
echo 'Download failed'
|
||||
exe newbufnr . "bwipe!"
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
" Delete the empty first line and mark the file unmodified.
|
||||
1d
|
||||
1d_
|
||||
set nomod
|
||||
|
||||
let msg = "In which directory do you want to write the file:"
|
||||
for i in range(len(dirlist))
|
||||
let msg .= "\n" . (i + 1) . '. ' . dirlist[i]
|
||||
endfor
|
||||
let dirchoice = confirm(msg, dirchoices) - 2
|
||||
if len(dirlist) == 1
|
||||
let dirchoice = 0
|
||||
else
|
||||
let msg = "In which directory do you want to write the file:"
|
||||
for i in range(len(dirlist))
|
||||
let msg .= "\n" . (i + 1) . '. ' . dirlist[i]
|
||||
endfor
|
||||
let dirchoice = confirm(msg, dirchoices) - 2
|
||||
endif
|
||||
if dirchoice >= 0
|
||||
if exists('*fnameescape')
|
||||
let dirname = fnameescape(dirlist[dirchoice])
|
||||
let dirname = fnameescape(dirlist[dirchoice])
|
||||
else
|
||||
let dirname = escape(dirlist[dirchoice], ' ')
|
||||
let dirname = escape(dirlist[dirchoice], ' ')
|
||||
endif
|
||||
setlocal fenc=
|
||||
exe "write " . dirname . '/' . fname
|
||||
|
||||
" Also download the .sug file, if the user wants to.
|
||||
let msg = "Do you want me to try getting the .sug file?\n"
|
||||
let msg .= "This will improve making suggestions for spelling mistakes,\n"
|
||||
let msg .= "but it uses quite a bit of memory."
|
||||
if confirm(msg, "&No\n&Yes") == 2
|
||||
g/^/d
|
||||
let fname = substitute(fname, '\.spl$', '.sug', '')
|
||||
echo 'Downloading ' . fname . '...'
|
||||
call spellfile#Nread(fname)
|
||||
if getline(2) =~ 'VIMsug'
|
||||
1d
|
||||
exe "write " . dirname . '/' . fname
|
||||
set nomod
|
||||
else
|
||||
echo 'Sorry, downloading failed'
|
||||
" Go back to our own buffer/window, Nread() may have taken us to
|
||||
" another window.
|
||||
if newbufnr != winbufnr(0)
|
||||
let winnr = bufwinnr(newbufnr)
|
||||
if winnr != -1
|
||||
exe winnr . "wincmd w"
|
||||
endif
|
||||
endif
|
||||
if newbufnr == winbufnr(0)
|
||||
set nomod
|
||||
endif
|
||||
endif
|
||||
" Also download the .sug file.
|
||||
g/^/d_
|
||||
let fname = substitute(fname, '\.spl$', '.sug', '')
|
||||
echo 'Downloading ' . fname . '...'
|
||||
call spellfile#Nread(fname)
|
||||
if getline(2) =~ 'VIMsug'
|
||||
1d_
|
||||
exe "write " . dirname . '/' . fname
|
||||
set nomod
|
||||
else
|
||||
echo 'Download failed'
|
||||
" Go back to our own buffer/window, Nread() may have taken us to
|
||||
" another window.
|
||||
if newbufnr != winbufnr(0)
|
||||
let winnr = bufwinnr(newbufnr)
|
||||
if winnr != -1
|
||||
exe winnr . "wincmd w"
|
||||
endif
|
||||
endif
|
||||
if newbufnr == winbufnr(0)
|
||||
set nomod
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
" Vim autoload file for the tohtml plugin.
|
||||
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
|
||||
" Last Change: 2013 Jun 19
|
||||
" Last Change: 2013 Sep 03
|
||||
"
|
||||
" Additional contributors:
|
||||
"
|
||||
@@ -302,7 +302,7 @@ func! tohtml#Convert2HTML(line1, line2) "{{{
|
||||
else "{{{
|
||||
let win_list = []
|
||||
let buf_list = []
|
||||
windo | if &diff | call add(win_list, winbufnr(0)) | endif
|
||||
windo if &diff | call add(win_list, winbufnr(0)) | endif
|
||||
let s:settings.whole_filler = 1
|
||||
let g:html_diff_win_num = 0
|
||||
for window in win_list
|
||||
|
@@ -251,13 +251,14 @@ endfunction
|
||||
" Tutor Cmd: {{{1
|
||||
|
||||
function! s:Locale()
|
||||
let l:lang = ""
|
||||
if exists('v:lang') && v:lang =~ '\a\a'
|
||||
let l:lang = v:lang
|
||||
elseif $LC_ALL =~ '\a\a'
|
||||
let l:lang = $LC_ALL
|
||||
elseif $LANG =~ '\a\a'
|
||||
let l:lang = $LANG
|
||||
else
|
||||
let l:lang = 'en_US'
|
||||
endif
|
||||
return split(l:lang, '_')
|
||||
endfunction
|
||||
|
99
runtime/doc/api.txt
Normal file
99
runtime/doc/api.txt
Normal file
@@ -0,0 +1,99 @@
|
||||
*api.txt* For Nvim. {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||
|
||||
The C API of Nvim *nvim-api*
|
||||
|
||||
1. Introduction |nvim-api-intro|
|
||||
2. API Types |nvim-api-types|
|
||||
3. API metadata |nvim-api-metadata|
|
||||
4. Buffer highlighting |nvim-api-highlights|
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *nvim-api-intro*
|
||||
|
||||
Nvim defines a C API as the primary way for external code to interact with
|
||||
the NVim core. In the present version of Nvim the API is primarily used by
|
||||
external processes to interact with Nvim using the msgpack-rpc protocol, see
|
||||
|msgpack-rpc|. The API will also be used from vimscript to access new Nvim core
|
||||
features, but this is not implemented yet. Later on, Nvim might be embeddable
|
||||
in C applications as libnvim, and the application will then control the
|
||||
embedded instance by calling the C API directly.
|
||||
|
||||
==============================================================================
|
||||
2. API Types *nvim-api-types*
|
||||
|
||||
Nvim's C API uses custom types for all functions. Some are just typedefs
|
||||
around C99 standard types, and some are Nvim defined data structures.
|
||||
|
||||
Boolean -> bool
|
||||
Integer (signed 64-bit integer) -> int64_t
|
||||
Float (IEEE 754 double precision) -> double
|
||||
String -> {char* data, size_t size} struct
|
||||
|
||||
Additionally, the following data structures are defined:
|
||||
|
||||
Array
|
||||
Dictionary
|
||||
Object
|
||||
|
||||
The following handle types are defined as integer typedefs, but are
|
||||
discriminated as separate types in an Object:
|
||||
|
||||
Buffer -> enum value kObjectTypeBuffer
|
||||
Window -> enum value kObjectTypeWindow
|
||||
Tabpage -> enum value kObjectTypeTabpage
|
||||
|
||||
==============================================================================
|
||||
3. API metadata *nvim-api-metadata*
|
||||
|
||||
Nvim exposes metadata about the API as a Dictionary with the following keys:
|
||||
|
||||
functions calling signature of the API functions
|
||||
types The custom handle types defined by Nvim
|
||||
error_types The possible kinds of errors an API function can exit with.
|
||||
|
||||
This metadata is mostly useful for external programs accessing the api over
|
||||
msgpack-api, see |msgpack-rpc-api|.
|
||||
|
||||
==============================================================================
|
||||
4. Buffer highlighting *nvim-api-highlights*
|
||||
|
||||
Nvim allows plugins to add position-based highlights to buffers. This is
|
||||
similar to |matchaddpos()| but with some key differences. The added highlights
|
||||
are associated with a buffer and adapts to line insertions and deletions,
|
||||
similar to signs. It is also possible to manage a set of highlights as a group
|
||||
and delete or replace all at once.
|
||||
|
||||
The intended use case are linter or semantic highlighter plugins that monitor
|
||||
a buffer for changes, and in the background compute highlights to the buffer.
|
||||
Another use case are plugins that show output in an append-only buffer, and
|
||||
want to add highlights to the outputs. Highlight data cannot be preserved
|
||||
on writing and loading a buffer to file, nor in undo/redo cycles.
|
||||
|
||||
Highlights are registered using the |buffer_add_highlight| function, see the
|
||||
generated API documentation for details. If an external highlighter plugin is
|
||||
adding a large number of highlights in a batch, performance can be improved by
|
||||
calling |buffer_add_highlight| as an asynchronous notification, after first
|
||||
(synchronously) reqesting a source id. Here is an example using wrapper
|
||||
functions in the python client:
|
||||
>
|
||||
src = vim.new_highlight_source()
|
||||
|
||||
buf = vim.current.buffer
|
||||
for i in range(5):
|
||||
buf.add_highlight("String",i,0,-1,src_id=src)
|
||||
|
||||
# some time later
|
||||
|
||||
buf.clear_highlight(src)
|
||||
<
|
||||
If the highlights don't need to be deleted or updated, just pass -1 as
|
||||
src_id (this is the default in python). |buffer_clear_highlight| can be used
|
||||
to clear highligts from a specific source, in a specific line range or the
|
||||
entire buffer by passing in the line range 0, -1 (the later is the default
|
||||
in python as used above).
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 7.4. Last change: 2014 Sep 23
|
||||
*autocmd.txt* For Vim version 7.4. Last change: 2015 Aug 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -258,6 +258,7 @@ Name triggered by ~
|
||||
|Syntax| when the 'syntax' option has been set
|
||||
|EncodingChanged| after the 'encoding' option has been changed
|
||||
|TermChanged| after the value of 'term' has changed
|
||||
|OptionSet| after setting any option
|
||||
|
||||
Startup and exit
|
||||
|VimEnter| after doing all the startup stuff
|
||||
@@ -307,6 +308,8 @@ Name triggered by ~
|
||||
|InsertCharPre| when a character was typed in Insert mode, before
|
||||
inserting it
|
||||
|
||||
|TextYankPost| when some text is yanked or deleted
|
||||
|
||||
|TextChanged| after a change was made to the text in Normal mode
|
||||
|TextChangedI| after a change was made to the text in Insert mode
|
||||
|
||||
@@ -721,6 +724,18 @@ InsertCharPre When a character is typed in Insert mode,
|
||||
It is not allowed to change the text |textlock|.
|
||||
The event is not triggered when 'paste' is
|
||||
set.
|
||||
*TextYankPost*
|
||||
TextYankPost Just after a |yank| or |deleting| command, but not
|
||||
if the black hole register |quote_| is used nor
|
||||
for |setreg()|. Pattern must be * because its
|
||||
meaning may change in the future.
|
||||
Sets these |v:event| keys:
|
||||
operator
|
||||
regcontents
|
||||
regname
|
||||
regtype
|
||||
Recursion is ignored.
|
||||
It is not allowed to change the text |textlock|.
|
||||
*InsertEnter*
|
||||
InsertEnter Just before starting Insert mode. Also for
|
||||
Replace mode and Virtual Replace mode. The
|
||||
@@ -745,6 +760,26 @@ MenuPopup Just before showing the popup menu (under the
|
||||
o Operator-pending
|
||||
i Insert
|
||||
c Command line
|
||||
*OptionSet*
|
||||
OptionSet After setting an option. The pattern is
|
||||
matched against the long option name.
|
||||
The |v:option_old| variable indicates the
|
||||
old option value, |v:option_new| variable
|
||||
indicates the newly set value, the
|
||||
|v:option_type| variable indicates whether
|
||||
it's global or local scoped and |<amatch>|
|
||||
indicates what option has been set.
|
||||
|
||||
Usage example: Check for the existence of the
|
||||
directory in the 'backupdir' and 'undodir'
|
||||
options, create the directory if it doesn't
|
||||
exist yet.
|
||||
|
||||
Note: It's a bad idea to reset an option
|
||||
during this autocommand, this may break a
|
||||
plugin. You can always use `:noa` to prevent
|
||||
triggering this autocommand.
|
||||
|
||||
*QuickFixCmdPre*
|
||||
QuickFixCmdPre Before a quickfix command is run (|:make|,
|
||||
|:lmake|, |:grep|, |:lgrep|, |:grepadd|,
|
||||
@@ -954,6 +989,13 @@ WinLeave Before leaving a window. If the window to be
|
||||
==============================================================================
|
||||
6. Patterns *autocmd-patterns* *{pat}*
|
||||
|
||||
The {pat} argument can be a comma separated list. This works as if the
|
||||
command was given with each pattern separately. Thus this command: >
|
||||
:autocmd BufRead *.txt,*.info set et
|
||||
Is equivalent to: >
|
||||
:autocmd BufRead *.txt set et
|
||||
:autocmd BufRead *.info set et
|
||||
|
||||
The file pattern {pat} is tested for a match against the file name in one of
|
||||
two ways:
|
||||
1. When there is no '/' in the pattern, Vim checks for a match against only
|
||||
@@ -1022,7 +1064,7 @@ The pattern is interpreted like mostly used in file names:
|
||||
[^ch] match any character but 'c' and 'h'
|
||||
|
||||
Note that for all systems the '/' character is used for path separator (even
|
||||
MS-DOS). This was done because the backslash is difficult to use in a pattern
|
||||
Windows). This was done because the backslash is difficult to use in a pattern
|
||||
and to make the autocommands portable across different systems.
|
||||
|
||||
*autocmd-changes*
|
||||
@@ -1060,7 +1102,7 @@ Instead of a pattern buffer-local autocommands use one of these forms:
|
||||
Examples: >
|
||||
:au CursorHold <buffer> echo 'hold'
|
||||
:au CursorHold <buffer=33> echo 'hold'
|
||||
:au CursorHold <buffer=abuf> echo 'hold'
|
||||
:au BufNewFile * au CursorHold <buffer=abuf> echo 'hold'
|
||||
|
||||
All the commands for autocommands also work with buffer-local autocommands,
|
||||
simply use the special string instead of the pattern. Examples: >
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 7.4. Last change: 2014 Jun 26
|
||||
*change.txt* For Vim version 7.4. Last change: 2015 Sep 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -366,13 +366,49 @@ Adding and subtracting ~
|
||||
CTRL-A Add [count] to the number or alphabetic character at
|
||||
or after the cursor.
|
||||
|
||||
*v_CTRL-A*
|
||||
{Visual}CTRL-A Add [count] to the number or alphabetic character in
|
||||
the highlighted text. {not in Vi}
|
||||
|
||||
*v_g_CTRL-A*
|
||||
{Visual}g CTRL-A Add [count] to the number or alphabetic character in
|
||||
the highlighted text. If several lines are
|
||||
highlighted, each one will be incremented by an
|
||||
additional [count] (so effectively creating a
|
||||
[count] incrementing sequence). {not in Vi}
|
||||
For Example, if you have this list of numbers:
|
||||
1. ~
|
||||
1. ~
|
||||
1. ~
|
||||
1. ~
|
||||
Move to the second "1." and Visually select three
|
||||
lines, pressing g CTRL-A results in:
|
||||
1. ~
|
||||
2. ~
|
||||
3. ~
|
||||
4. ~
|
||||
|
||||
*CTRL-X*
|
||||
CTRL-X Subtract [count] from the number or alphabetic
|
||||
character at or after the cursor.
|
||||
|
||||
*v_CTRL-X*
|
||||
{Visual}CTRL-X Subtract [count] from the number or alphabetic
|
||||
character in the highlighted text. {not in Vi}
|
||||
|
||||
*v_g_CTRL-X*
|
||||
{Visual}g CTRL-X Subtract [count] from the number or alphabetic
|
||||
character in the highlighted text. If several lines
|
||||
are highlighted, each value will be decremented by an
|
||||
additional [count] (so effectively creating a [count]
|
||||
decrementing sequence). {not in Vi}
|
||||
|
||||
The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned
|
||||
octal and hexadecimal numbers and alphabetic characters. This depends on the
|
||||
'nrformats' option.
|
||||
binary/octal/hexadecimal numbers and alphabetic characters.
|
||||
|
||||
This depends on the 'nrformats' option:
|
||||
- When 'nrformats' includes "bin", Vim assumes numbers starting with '0b' or
|
||||
'0B' are binary.
|
||||
- When 'nrformats' includes "octal", Vim considers numbers starting with a '0'
|
||||
to be octal, unless the number includes a '8' or '9'. Other numbers are
|
||||
decimal and may have a preceding minus sign.
|
||||
@@ -386,6 +422,10 @@ octal and hexadecimal numbers and alphabetic characters. This depends on the
|
||||
under or after the cursor. This is useful to make lists with an alphabetic
|
||||
index.
|
||||
|
||||
For decimals a leading negative sign is considered for incrementing or
|
||||
decrementing, for binary and octal and hex values, it won't be considered. To
|
||||
ignore the sign Visually select the number before using CTRL-A or CTRL-X.
|
||||
|
||||
For numbers with leading zeros (including all octal and hexadecimal numbers),
|
||||
Vim preserves the number of characters in the number when possible. CTRL-A on
|
||||
"0077" results in "0100", CTRL-X on "0x100" results in "0x0ff".
|
||||
@@ -397,6 +437,10 @@ octal number.
|
||||
Note that when 'nrformats' includes "octal", decimal numbers with leading
|
||||
zeros cause mistakes, because they can be confused with octal numbers.
|
||||
|
||||
Note similarly, when 'nrformats' includes "bin", binary numbers with a leading
|
||||
'0x' or '0X' can be interpreted as hexadecimal rather than binary since '0b'
|
||||
are valid hexadecimal digits.
|
||||
|
||||
The CTRL-A command is very useful in a macro. Example: Use the following
|
||||
steps to make a numbered list.
|
||||
|
||||
@@ -578,9 +622,9 @@ For MS-Windows: $TMP, $TEMP, $USERPROFILE, current-dir.
|
||||
may add [flags], see |:s_flags|.
|
||||
Note that after `:substitute` the '&' flag can't be
|
||||
used, it's recognized as a pattern separator.
|
||||
The space between `:substitute` and the 'c', 'g' and
|
||||
'r' flags isn't required, but in scripts it's a good
|
||||
idea to keep it to avoid confusion.
|
||||
The space between `:substitute` and the 'c', 'g',
|
||||
'i', 'I' and 'r' flags isn't required, but in scripts
|
||||
it's a good idea to keep it to avoid confusion.
|
||||
|
||||
:[range]~[&][flags] [count] *:~*
|
||||
Repeat last substitute with same substitute string
|
||||
@@ -832,13 +876,13 @@ This replaces each 'E' character with a euro sign. Read more in |<Char->|.
|
||||
:promptf[ind] [string]
|
||||
Put up a Search dialog. When [string] is given, it is
|
||||
used as the initial search string.
|
||||
{only for Win32, Motif and GTK GUI}
|
||||
{only for Win32 GUI}
|
||||
|
||||
*:promptr* *:promptrepl*
|
||||
:promptr[epl] [string]
|
||||
Put up a Search/Replace dialog. When [string] is
|
||||
given, it is used as the initial search string.
|
||||
{only for Win32, Motif and GTK GUI}
|
||||
{only for Win32 GUI}
|
||||
|
||||
|
||||
4.4 Changing tabs *change-tabs*
|
||||
@@ -1058,16 +1102,17 @@ Rationale: In Vi the "y" command followed by a backwards motion would
|
||||
With a linewise yank command the cursor is put in the first line, but the
|
||||
column is unmodified, thus it may not be on the first yanked character.
|
||||
|
||||
There are nine types of registers: *registers* *E354*
|
||||
There are ten types of registers: *registers* *E354*
|
||||
1. The unnamed register ""
|
||||
2. 10 numbered registers "0 to "9
|
||||
3. The small delete register "-
|
||||
4. 26 named registers "a to "z or "A to "Z
|
||||
5. four read-only registers ":, "., "% and "#
|
||||
6. the expression register "=
|
||||
7. The selection and drop registers "*, "+ and "~
|
||||
8. The black hole register "_
|
||||
9. Last search pattern register "/
|
||||
5. three read-only registers ":, "., "%
|
||||
6. alternate buffer register "#
|
||||
7. the expression register "=
|
||||
8. The selection and drop registers "*, "+ and "~
|
||||
9. The black hole register "_
|
||||
10. Last search pattern register "/
|
||||
|
||||
1. Unnamed register "" *quote_quote* *quotequote*
|
||||
Vim fills this register with text deleted with the "d", "c", "s", "x" commands
|
||||
@@ -1109,7 +1154,7 @@ letters to replace their previous contents or as uppercase letters to append
|
||||
to their previous contents. When the '>' flag is present in 'cpoptions' then
|
||||
a line break is inserted before the appended text.
|
||||
|
||||
5. Read-only registers ":, "., "% and "#
|
||||
5. Read-only registers ":, ". and "%
|
||||
These are '%', '#', ':' and '.'. You can use them only with the "p", "P",
|
||||
and ":put" commands and with CTRL-R.
|
||||
*quote_.* *quote.* *E29*
|
||||
@@ -1120,8 +1165,6 @@ and ":put" commands and with CTRL-R.
|
||||
('textwidth' and other options affect what is inserted).
|
||||
*quote_%* *quote%*
|
||||
"% Contains the name of the current file.
|
||||
*quote_#* *quote#*
|
||||
"# Contains the name of the alternate file.
|
||||
*quote_:* *quote:* *E30*
|
||||
": Contains the most recent executed command-line. Example: Use
|
||||
"@:" to repeat the previous command-line command.
|
||||
@@ -1129,15 +1172,33 @@ and ":put" commands and with CTRL-R.
|
||||
one character of it was typed. Thus it remains unchanged if
|
||||
the command was completely from a mapping.
|
||||
|
||||
6. Expression register "= *quote_=* *quote=* *@=*
|
||||
*quote_#* *quote#*
|
||||
6. Alternate file register "#
|
||||
Contains the name of the alternate file for the current window. It will
|
||||
change how the |CTRL-^| command works.
|
||||
This register is writable, mainly to allow for restoring it after a plugin has
|
||||
changed it. It accepts buffer number: >
|
||||
let altbuf = bufnr(@#)
|
||||
...
|
||||
let @# = altbuf
|
||||
It will give error |E86| if you pass buffer number and this buffer does not
|
||||
exist.
|
||||
It can also accept a match with an existing buffer name: >
|
||||
let @# = 'buffer_name'
|
||||
Error |E93| if there is more than one buffer matching the given name or |E94|
|
||||
if none of buffers matches the given name.
|
||||
|
||||
7. Expression register "= *quote_=* *quote=* *@=*
|
||||
This is not really a register that stores text, but is a way to use an
|
||||
expression in commands which use a register. The expression register is
|
||||
read-only; you cannot put text into it. After the '=', the cursor moves to
|
||||
the command-line, where you can enter any expression (see |expression|). All
|
||||
normal command-line editing commands are available, including a special
|
||||
history for expressions. When you end the command-line by typing <CR>, Vim
|
||||
computes the result of the expression. If you end it with <Esc>, Vim abandons
|
||||
the expression. If you do not enter an expression, Vim uses the previous
|
||||
read-write.
|
||||
|
||||
When typing the '=' after " or CTRL-R the cursor moves to the command-line,
|
||||
where you can enter any expression (see |expression|). All normal
|
||||
command-line editing commands are available, including a special history for
|
||||
expressions. When you end the command-line by typing <CR>, Vim computes the
|
||||
result of the expression. If you end it with <Esc>, Vim abandons the
|
||||
expression. If you do not enter an expression, Vim uses the previous
|
||||
expression (like with the "/" command).
|
||||
|
||||
The expression must evaluate to a String. A Number is always automatically
|
||||
@@ -1150,35 +1211,23 @@ If the "= register is used for the "p" command, the String is split up at <NL>
|
||||
characters. If the String ends in a <NL>, it is regarded as a linewise
|
||||
register.
|
||||
|
||||
7. Selection and drop registers "*, "+ and "~
|
||||
8. Selection and drop registers "*, "+ and "~
|
||||
Use these registers for storing and retrieving the selected text for the GUI.
|
||||
See |quotestar| and |quoteplus|. When the clipboard is not available or not
|
||||
working, the unnamed register is used instead. For Unix systems and Mac OS X,
|
||||
see |nvim-clipboard|.
|
||||
|
||||
*quote_~* *quote~* *<Drop>*
|
||||
The read-only "~ register stores the dropped text from the last drag'n'drop
|
||||
operation. When something has been dropped onto Vim, the "~ register is
|
||||
filled in and the <Drop> pseudo key is sent for notification. You can remap
|
||||
this key if you want; the default action (for all modes) is to insert the
|
||||
contents of the "~ register at the cursor position.
|
||||
{only available when compiled with the |+dnd| feature, currently only with the
|
||||
GTK GUI}
|
||||
|
||||
Note: The "~ register is only used when dropping plain text onto Vim.
|
||||
Drag'n'drop of URI lists is handled internally.
|
||||
|
||||
8. Black hole register "_ *quote_*
|
||||
9. Black hole register "_ *quote_*
|
||||
When writing to this register, nothing happens. This can be used to delete
|
||||
text without affecting the normal registers. When reading from this register,
|
||||
nothing is returned.
|
||||
|
||||
9. Last search pattern register "/ *quote_/* *quote/*
|
||||
10. Last search pattern register "/ *quote_/* *quote/*
|
||||
Contains the most recent search-pattern. This is used for "n" and 'hlsearch'.
|
||||
It is writable with `:let`, you can change it to have 'hlsearch' highlight
|
||||
other matches without actually searching. You can't yank or delete into this
|
||||
register. The search direction is available in |v:searchforward|.
|
||||
Note that the valued is restored when returning from a function
|
||||
Note that the value is restored when returning from a function
|
||||
|function-search-undo|.
|
||||
|
||||
*@/*
|
||||
@@ -1390,10 +1439,10 @@ When you hit Return in a C-comment, Vim will insert the middle comment leader
|
||||
for the new line: " * ". To close this comment you just have to type "/"
|
||||
before typing anything else on the new line. This will replace the
|
||||
middle-comment leader with the end-comment leader and apply any specified
|
||||
alignment, leaving just " */". There is no need to hit BackSpace first.
|
||||
alignment, leaving just " */". There is no need to hit Backspace first.
|
||||
|
||||
When there is a match with a middle part, but there also is a maching end part
|
||||
which is longer, the end part is used. This makes a C style comment work
|
||||
When there is a match with a middle part, but there also is a matching end
|
||||
part which is longer, the end part is used. This makes a C style comment work
|
||||
without requiring the middle part to end with a space.
|
||||
|
||||
Here is an example of alignment flags at work to make a comment stand out
|
||||
@@ -1597,7 +1646,7 @@ Vim has a sorting function and a sorting command. The sorting function can be
|
||||
found here: |sort()|, |uniq()|.
|
||||
|
||||
*:sor* *:sort*
|
||||
:[range]sor[t][!] [i][u][r][n][x][o] [/{pattern}/]
|
||||
:[range]sor[t][!] [i][u][r][n][x][o][b] [/{pattern}/]
|
||||
Sort lines in [range]. When no range is given all
|
||||
lines are sorted.
|
||||
|
||||
@@ -1617,6 +1666,9 @@ found here: |sort()|, |uniq()|.
|
||||
With [o] sorting is done on the first octal number in
|
||||
the line (after or inside a {pattern} match).
|
||||
|
||||
With [b] sorting is done on the first binary number in
|
||||
the line (after or inside a {pattern} match).
|
||||
|
||||
With [u] only keep the first of a sequence of
|
||||
identical lines (ignoring case when [i] is used).
|
||||
Without this flag, a sequence of identical lines
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 7.4. Last change: 2014 Sep 06
|
||||
*cmdline.txt* For Vim version 7.4. Last change: 2015 Sep 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -379,7 +379,7 @@ CTRL-N After using 'wildchar' which got multiple matches, go to next
|
||||
<S-Tab> *c_CTRL-P* *c_<S-Tab>*
|
||||
CTRL-P After using 'wildchar' which got multiple matches, go to
|
||||
previous match. Otherwise recall older command-line from
|
||||
history. <S-Tab> only works with the GUI and with MS-DOS.
|
||||
history. <S-Tab> only works with the GUI.
|
||||
*c_CTRL-A*
|
||||
CTRL-A All names that match the pattern in front of the cursor are
|
||||
inserted.
|
||||
@@ -482,6 +482,8 @@ followed by another Vim command:
|
||||
:argdo
|
||||
:autocmd
|
||||
:bufdo
|
||||
:cdo
|
||||
:cfdo
|
||||
:command
|
||||
:cscope
|
||||
:debug
|
||||
@@ -490,8 +492,9 @@ followed by another Vim command:
|
||||
:function
|
||||
:global
|
||||
:help
|
||||
:helpfind
|
||||
:lcscope
|
||||
:ldo
|
||||
:lfdo
|
||||
:make
|
||||
:normal
|
||||
:promptfind
|
||||
@@ -562,6 +565,7 @@ starts editing the three files "foo bar", "goes to" and "school ".
|
||||
When you want to use the special characters '"' or '|' in a command, or want
|
||||
to use '%' or '#' in a file name, precede them with a backslash. The
|
||||
backslash is not required in a range and in the ":substitute" command.
|
||||
See also |`=|.
|
||||
|
||||
*:_!*
|
||||
The '!' (bang) character after an Ex command makes the command behave in a
|
||||
@@ -711,13 +715,13 @@ to insert special things while typing you can use the CTRL-R command. For
|
||||
example, "%" stands for the current file name, while CTRL-R % inserts the
|
||||
current file name right away. See |c_CTRL-R|.
|
||||
|
||||
Note: If you want to avoid the special characters in a Vim script you may want
|
||||
to use |fnameescape()|.
|
||||
Note: If you want to avoid the effects of special characters in a Vim script
|
||||
you may want to use |fnameescape()|. Also see |`=|.
|
||||
|
||||
|
||||
In Ex commands, at places where a file name can be used, the following
|
||||
characters have a special meaning. These can also be used in the expression
|
||||
function expand() |expand()|.
|
||||
function |expand()|.
|
||||
% Is replaced with the current file name. *:_%* *c_%*
|
||||
# Is replaced with the alternate file name. *:_#* *c_#*
|
||||
This is remembered for every window.
|
||||
@@ -752,6 +756,7 @@ it, no matter how many backslashes.
|
||||
# alternate.file
|
||||
\# #
|
||||
\\# \#
|
||||
Also see |`=|.
|
||||
|
||||
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
|
||||
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
|
||||
@@ -773,13 +778,13 @@ Note: these are typed literally, they are not special keys!
|
||||
<afile> only when the file name isn't used to match with
|
||||
(for FileType, Syntax and SpellFileMissing events).
|
||||
<sfile> When executing a ":source" command, is replaced with the
|
||||
file name of the sourced file. *E498*
|
||||
When executing a function, is replaced with
|
||||
"function {function-name}"; function call nesting is
|
||||
indicated like this:
|
||||
"function {function-name1}..{function-name2}". Note that
|
||||
filename-modifiers are useless when <sfile> is used inside
|
||||
a function.
|
||||
file name of the sourced file. *E498*
|
||||
When executing a function, is replaced with:
|
||||
"function {function-name}[{lnum}]"
|
||||
function call nesting is indicated like this:
|
||||
"function {function-name1}[{lnum}]..{function-name2}[{lnum}]"
|
||||
Note that filename-modifiers are useless when <sfile> is
|
||||
used inside a function.
|
||||
<slnum> When executing a ":source" command, is replaced with the
|
||||
line number. *E842*
|
||||
When executing a function it's the line number relative to
|
||||
@@ -816,7 +821,7 @@ These modifiers can be given, in this order:
|
||||
separator is removed. Thus ":p:h" on a directory name results
|
||||
on the directory name itself (without trailing slash).
|
||||
When the file name is an absolute path (starts with "/" for
|
||||
Unix; "x:\" for MS-DOS and WIN32), that part is not removed.
|
||||
Unix; "x:\" for Windows), that part is not removed.
|
||||
When there is no head (path is relative to current directory)
|
||||
the result is empty.
|
||||
:t Tail of the file name (last component of the name). Must
|
||||
@@ -841,7 +846,7 @@ These modifiers can be given, in this order:
|
||||
:gs?pat?sub?
|
||||
Substitute all occurrences of "pat" with "sub". Otherwise
|
||||
this works like ":s".
|
||||
:S Escape special characters for use with a shell command (see
|
||||
:S Escape special characters for use with a shell command (see
|
||||
|shellescape()|). Must be the last one. Examples: >
|
||||
:!dir <cfile>:S
|
||||
:call system('chmod +w -- ' . expand('%:S'))
|
||||
@@ -894,9 +899,8 @@ name). This is included for backwards compatibility with version 3.0, the
|
||||
|
||||
Note: Where a file name is expected wildcards expansion is done. On Unix the
|
||||
shell is used for this, unless it can be done internally (for speed).
|
||||
Backticks also work, like in >
|
||||
Unless in |restricted-mode|, backticks work also, like in >
|
||||
:n `echo *.c`
|
||||
(backtick expansion is not possible in |restricted-mode|)
|
||||
But expansion is only done if there are any wildcards before expanding the
|
||||
'%', '#', etc.. This avoids expanding wildcards inside a file name. If you
|
||||
want to expand the result of <cfile>, add a wildcard character to it.
|
||||
@@ -907,6 +911,7 @@ Examples: (alternate file name is "?readme?")
|
||||
:e #.* :e {files matching "?readme?.*"}
|
||||
:cd <cfile> :cd {file name under cursor}
|
||||
:cd <cfile>* :cd {file name under cursor plus "*" and then expanded}
|
||||
Also see |`=|.
|
||||
|
||||
When the expanded argument contains a "!" and it is used for a shell command
|
||||
(":!cmd", ":r !cmd" or ":w !cmd"), the "!" is escaped with a backslash to
|
||||
@@ -915,8 +920,8 @@ option contains "sh", this is done twice, to avoid the shell trying to expand
|
||||
the "!".
|
||||
|
||||
*filename-backslash*
|
||||
For filesystems that use a backslash as directory separator (MS-DOS and
|
||||
Windows), it's a bit difficult to recognize a backslash that is used
|
||||
For filesystems that use a backslash as directory separator (Windows
|
||||
filesystems), it's a bit difficult to recognize a backslash that is used
|
||||
to escape the special meaning of the next character. The general rule is: If
|
||||
the backslash is followed by a normal file name character, it does not have a
|
||||
special meaning. Therefore "\file\foo" is a valid file name, you don't have
|
||||
@@ -933,6 +938,8 @@ for the file "$home" in the root directory. A few examples:
|
||||
/\$home file "$home" in root directory
|
||||
\\$home file "\\", followed by expanded $home
|
||||
|
||||
Also see |`=|.
|
||||
|
||||
==============================================================================
|
||||
7. Command-line window *cmdline-window* *cmdwin*
|
||||
*command-line-window*
|
||||
|
@@ -1,107 +0,0 @@
|
||||
*debugger.txt* For Vim version 7.4. Last change: 2005 Mar 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Gordon Prieur
|
||||
|
||||
|
||||
Debugger Support Features *debugger-support*
|
||||
|
||||
1. Debugger Features |debugger-features|
|
||||
|
||||
==============================================================================
|
||||
1. Debugger Features *debugger-features*
|
||||
|
||||
The following features are available for an integration with a debugger or
|
||||
an Integrated Programming Environment (IPE) or Integrated Development
|
||||
Environment (IDE):
|
||||
|
||||
Alternate Command Input |alt-input|
|
||||
Debug Signs |debug-signs|
|
||||
Debug Source Highlight |debug-highlight|
|
||||
Message Footer |gui-footer|
|
||||
Balloon Evaluation |balloon-eval|
|
||||
|
||||
These features were added specifically for use in the Motif version of gvim.
|
||||
However, the |alt-input| and |debug-highlight| were written to be usable in
|
||||
both vim and gvim. Some of the other features could be used in the non-GUI
|
||||
vim with slight modifications. However, I did not do this nor did I test the
|
||||
reliability of building for vim or non Motif GUI versions.
|
||||
|
||||
|
||||
1.1 Alternate Command Input *alt-input*
|
||||
|
||||
For Vim to work with a debugger there must be at least an input connection
|
||||
with a debugger or external tool. In many cases there will also be an output
|
||||
connection but this isn't absolutely necessary.
|
||||
|
||||
The purpose of the input connection is to let the external debugger send
|
||||
commands to Vim. The commands sent by the debugger should give the debugger
|
||||
enough control to display the current debug environment and state.
|
||||
|
||||
The current implementation is based on the X Toolkit dispatch loop and the
|
||||
XtAddInput() function call.
|
||||
|
||||
|
||||
1.2 Debug Signs *debug-signs*
|
||||
|
||||
Many debuggers mark specific lines by placing a small sign or color highlight
|
||||
on the line. The |:sign| command lets the debugger set this graphic mark. Some
|
||||
examples where this feature would be used would be a debugger showing an arrow
|
||||
representing the Program Counter (PC) of the program being debugged. Another
|
||||
example would be a small stop sign for a line with a breakpoint. These visible
|
||||
highlights let the user keep track of certain parts of the state of the
|
||||
debugger.
|
||||
|
||||
This feature can be used with more than debuggers, too. An IPE can use a sign
|
||||
to highlight build errors, searched text, or other things. The sign feature
|
||||
can also work together with the |debug-highlight| to ensure the mark is
|
||||
highly visible.
|
||||
|
||||
Debug signs are defined and placed using the |:sign| command.
|
||||
|
||||
|
||||
1.3 Debug Source Highlight *debug-highlight*
|
||||
|
||||
This feature allows a line to have a predominant highlight. The highlight is
|
||||
intended to make a specific line stand out. The highlight could be made to
|
||||
work for both vim and gvim, whereas the debug sign is, in most cases, limited
|
||||
to gvim. The one exception to this is Sun Microsystem's dtterm. The dtterm
|
||||
from Sun has a "sign gutter" for showing signs.
|
||||
|
||||
|
||||
1.4 Message Footer *gui-footer*
|
||||
|
||||
The message footer can be used to display messages from a debugger or IPE. It
|
||||
can also be used to display menu and toolbar tips. The footer area is at the
|
||||
bottom of the GUI window, below the line used to display colon commands.
|
||||
|
||||
The display of the footer is controlled by the 'guioptions' letter 'F'.
|
||||
|
||||
|
||||
1.5 Balloon Evaluation *balloon-eval*
|
||||
|
||||
This feature allows a debugger, or other external tool, to display dynamic
|
||||
information based on where the mouse is pointing. The purpose of this feature
|
||||
was to allow Sun's Visual WorkShop debugger to display expression evaluations.
|
||||
However, the feature was implemented in as general a manner as possible and
|
||||
could be used for displaying other information as well.
|
||||
|
||||
The Balloon Evaluation has some settable parameters too. For Motif the font
|
||||
list and colors can be set via X resources (XmNballoonEvalFontList,
|
||||
XmNballoonEvalBackground, and XmNballoonEvalForeground).
|
||||
The 'balloondelay' option sets the delay before an attempt is made to show a
|
||||
balloon.
|
||||
The 'ballooneval' option needs to be set to switch it on.
|
||||
|
||||
Balloon evaluation is only available when compiled with the |+balloon_eval|
|
||||
feature.
|
||||
|
||||
The Balloon evaluation functions are also used to show a tooltip for the
|
||||
toolbar. The 'ballooneval' option does not need to be set for this. But the
|
||||
other settings apply.
|
||||
|
||||
Another way to use the balloon is with the 'balloonexpr' option. This is
|
||||
completely user definable.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
@@ -1,4 +1,4 @@
|
||||
*diff.txt* For Vim version 7.4. Last change: 2015 Jan 19
|
||||
*diff.txt* For Vim version 7.4. Last change: 2015 Jul 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -124,8 +124,9 @@ file for a moment and come back to the same file and be in diff mode again.
|
||||
if the current window does not have 'diff' set then no options
|
||||
in it are changed.
|
||||
|
||||
The ":diffoff" command resets the relevant options to the values they had when
|
||||
using |:diffsplit|, |:diffpatch| , |:diffthis|. or starting Vim in diff mode.
|
||||
The `:diffoff` command resets the relevant options to the values they had when
|
||||
using `:diffsplit`, `:diffpatch` , `:diffthis`. or starting Vim in diff mode.
|
||||
When using `:diffoff` twice the last saved values are restored.
|
||||
Otherwise they are set to their default value:
|
||||
|
||||
'diff' off
|
||||
@@ -306,6 +307,19 @@ name or a part of a buffer name. Examples:
|
||||
|
||||
Also see |'diffopt'| and the "diff" item of |'fillchars'|.
|
||||
|
||||
*diff-slow* *diff_translations*
|
||||
For very long lines, the diff syntax highlighting might be slow, especially
|
||||
since it tries to match all different kind of localisations. To disable
|
||||
localisations and speed up the syntax highlighting, set the global variable
|
||||
g:diff_translations to zero: >
|
||||
|
||||
let g:diff_translations = 0
|
||||
<
|
||||
After setting this variable, Reload the syntax script: >
|
||||
|
||||
set syntax=diff
|
||||
<
|
||||
|
||||
|
||||
FINDING THE DIFFERENCES *diff-diffexpr*
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 7.4. Last change: 2015 Apr 18
|
||||
*editing.txt* For Vim version 7.4. Last change: 2015 Aug 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -130,9 +130,7 @@ You can use this file if you discover that you need the original file. See
|
||||
also the 'patchmode' option. The name of the backup file is normally the same
|
||||
as the original file with 'backupext' appended. The default "~" is a bit
|
||||
strange to avoid accidentally overwriting existing files. If you prefer ".bak"
|
||||
change the 'backupext' option. Extra dots are replaced with '_' on MS-DOS
|
||||
machines, when Vim has detected that an MS-DOS-like filesystem is being used
|
||||
(e.g., messydos or crossdos). The backup file can be placed in another
|
||||
change the 'backupext' option. The backup file can be placed in another
|
||||
directory by setting 'backupdir'.
|
||||
|
||||
When you started editing without giving a file name, "No File" is displayed in
|
||||
@@ -276,7 +274,8 @@ CTRL-^ Edit the alternate file. Mostly the alternate file is
|
||||
Mnemonic: "goto file".
|
||||
Uses the 'isfname' option to find out which characters
|
||||
are supposed to be in a file name. Trailing
|
||||
punctuation characters ".,:;!" are ignored.
|
||||
punctuation characters ".,:;!" are ignored. Escaped
|
||||
spaces "\ " are reduced to a single space.
|
||||
Uses the 'path' option as a list of directory names to
|
||||
look for the file. See the 'path' option for details
|
||||
about relative directories and wildcards.
|
||||
@@ -379,25 +378,38 @@ Finds files:
|
||||
/usr/include/sys/types.h
|
||||
/usr/inc_old/types.h
|
||||
*backtick-expansion* *`-expansion*
|
||||
On Unix and a few other systems you can also use backticks in the file name,
|
||||
for example: >
|
||||
:e `find . -name ver\\*.c -print`
|
||||
The backslashes before the star are required to prevent "ver*.c" to be
|
||||
expanded by the shell before executing the find program.
|
||||
On Unix and a few other systems you can also use backticks for the file name
|
||||
argument, for example: >
|
||||
:next `find . -name ver\\*.c -print`
|
||||
:view `ls -t *.patch \| head -n1`
|
||||
The backslashes before the star are required to prevent the shell from
|
||||
expanding "ver*.c" prior to execution of the find program. The backslash
|
||||
before the shell pipe symbol "|" prevents Vim from parsing it as command
|
||||
termination.
|
||||
This also works for most other systems, with the restriction that the
|
||||
backticks must be around the whole item. It is not possible to have text
|
||||
directly before the first or just after the last backtick.
|
||||
|
||||
*`=*
|
||||
You can have the backticks expanded as a Vim expression, instead of an
|
||||
external command, by using the syntax `={expr}` e.g.: >
|
||||
You can have the backticks expanded as a Vim expression, instead of as an
|
||||
external command, by putting an equal sign right after the first backtick,
|
||||
e.g.: >
|
||||
:e `=tempname()`
|
||||
The expression can contain just about anything, thus this can also be used to
|
||||
avoid the special meaning of '"', '|', '%' and '#'. However, 'wildignore'
|
||||
does apply like to other wildcards.
|
||||
|
||||
Environment variables in the expression are expanded when evaluating the
|
||||
expression, thus this works: >
|
||||
:e `=$HOME . '/.vimrc'`
|
||||
This does not work, $HOME is inside a string and used literally: >
|
||||
:e `='$HOME' . '/.vimrc'`
|
||||
|
||||
If the expression returns a string then names are to be separated with line
|
||||
breaks. When the result is a |List| then each item is used as a name. Line
|
||||
breaks also separate names.
|
||||
Note that such expressions are only supported in places where a filename is
|
||||
expected as an argument to an Ex-command.
|
||||
|
||||
*++opt* *[++opt]*
|
||||
The [++opt] argument can be used to force the value of 'fileformat',
|
||||
@@ -470,9 +482,9 @@ The 'fileformat' option sets the <EOL> style for a file:
|
||||
"mac" <CR> Mac format *Mac-format*
|
||||
|
||||
When reading a file, the mentioned characters are interpreted as the <EOL>.
|
||||
In DOS format (default for MS-DOS and Win32), <CR><NL> and <NL> are both
|
||||
interpreted as the <EOL>. Note that when writing the file in DOS format,
|
||||
<CR> characters will be added for each single <NL>. Also see |file-read|.
|
||||
In DOS format (default for Windows), <CR><NL> and <NL> are both interpreted as
|
||||
the <EOL>. Note that when writing the file in DOS format, <CR> characters will
|
||||
be added for each single <NL>. Also see |file-read|.
|
||||
|
||||
When writing a file, the mentioned characters are used for <EOL>. For DOS
|
||||
format <CR><NL> is used. Also see |DOS-format-write|.
|
||||
@@ -493,13 +505,13 @@ If you start editing a new file and the 'fileformats' option is not empty
|
||||
(which is the default), Vim will try to detect whether the lines in the file
|
||||
are separated by the specified formats. When set to "unix,dos", Vim will
|
||||
check for lines with a single <NL> (as used on Unix) or by a <CR><NL> pair
|
||||
(MS-DOS). Only when ALL lines end in <CR><NL>, 'fileformat' is set to "dos",
|
||||
(Windows). Only when ALL lines end in <CR><NL>, 'fileformat' is set to "dos",
|
||||
otherwise it is set to "unix". When 'fileformats' includes "mac", and no <NL>
|
||||
characters are found in the file, 'fileformat' is set to "mac".
|
||||
|
||||
If the 'fileformat' option is set to "dos" on non-MS-DOS systems the message
|
||||
If the 'fileformat' option is set to "dos" on non-Windows systems the message
|
||||
"[dos format]" is shown to remind you that something unusual is happening. On
|
||||
MS-DOS systems you get the message "[unix format]" if 'fileformat' is set to
|
||||
Windows systems you get the message "[unix format]" if 'fileformat' is set to
|
||||
"unix". On all systems but the Macintosh you get the message "[mac format]"
|
||||
if 'fileformat' is set to "mac".
|
||||
|
||||
@@ -795,7 +807,8 @@ USING THE ARGUMENT LIST
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each file.
|
||||
Also see |:windo|, |:tabdo| and |:bufdo|.
|
||||
Also see |:windo|, |:tabdo|, |:bufdo|, |:cdo|, |:ldo|,
|
||||
|:cfdo| and |:lfdo|.
|
||||
|
||||
Example: >
|
||||
:args *.c
|
||||
@@ -964,10 +977,10 @@ lost the original file.
|
||||
|
||||
*DOS-format-write*
|
||||
If the 'fileformat' is "dos", <CR> <NL> is used for <EOL>. This is default
|
||||
for MS-DOS and Win32. On other systems the message "[dos format]" is shown to
|
||||
for Windows. On other systems the message "[dos format]" is shown to
|
||||
remind you that an unusual <EOL> was used.
|
||||
*Unix-format-write*
|
||||
If the 'fileformat' is "unix", <NL> is used for <EOL>. On MS-DOS and Win32
|
||||
If the 'fileformat' is "unix", <NL> is used for <EOL>. On Windows
|
||||
the message "[unix format]" is shown.
|
||||
*Mac-format-write*
|
||||
If the 'fileformat' is "mac", <CR> is used for <EOL>. On non-Mac systems the
|
||||
@@ -997,11 +1010,11 @@ When the file name is actually a device name, Vim will not make a backup (that
|
||||
would be impossible). You need to use "!", since the device already exists.
|
||||
Example for Unix: >
|
||||
:w! /dev/lpt0
|
||||
and for MS-DOS or MS-Windows: >
|
||||
and Windows: >
|
||||
:w! lpt0
|
||||
For Unix a device is detected when the name doesn't refer to a normal file or
|
||||
a directory. A fifo or named pipe also looks like a device to Vim.
|
||||
For MS-DOS and MS-Windows the device is detected by its name:
|
||||
For Windows the device is detected by its name:
|
||||
CON
|
||||
CLOCK$
|
||||
NUL
|
||||
@@ -1144,7 +1157,7 @@ If you want to always use ":confirm", set the 'confirm' option.
|
||||
|:diffsplit|, |:diffpatch|, |:pedit|, |:redir|,
|
||||
|:source|, |:update|, |:visual|, |:vsplit|,
|
||||
and |:qall| if 'confirm' is set.
|
||||
{only in Win32, Athena, Motif, GTK and Mac GUI}
|
||||
{only in Win32 GUI}
|
||||
When ":browse" is not possible you get an error
|
||||
message. If the |+browse| feature is missing or the
|
||||
{command} doesn't support browsing, the {command} is
|
||||
@@ -1172,16 +1185,13 @@ For versions of Vim where browsing is not supported, the command is executed
|
||||
unmodified.
|
||||
|
||||
*browsefilter*
|
||||
For MS Windows and GTK, you can modify the filters that are used in the browse
|
||||
dialog. By setting the g:browsefilter or b:browsefilter variables, you can
|
||||
change the filters globally or locally to the buffer. The variable is set to
|
||||
a string in the format "{filter label}\t{pattern};{pattern}\n" where {filter
|
||||
label} is the text that appears in the "Files of Type" comboBox, and {pattern}
|
||||
is the pattern which filters the filenames. Several patterns can be given,
|
||||
separated by ';'.
|
||||
|
||||
For Motif the same format is used, but only the very first pattern is actually
|
||||
used (Motif only offers one pattern, but you can edit it).
|
||||
For Windows you can modify the filters that are used in the browse dialog. By
|
||||
setting the g:browsefilter or b:browsefilter variables, you can change the
|
||||
filters globally or locally to the buffer. The variable is set to a string in
|
||||
the format "{filter label}\t{pattern};{pattern}\n" where {filter label} is the
|
||||
text that appears in the "Files of Type" comboBox, and {pattern} is the
|
||||
pattern which filters the filenames. Several patterns can be given, separated
|
||||
by ';'.
|
||||
|
||||
For example, to have only Vim files in the dialog, you could use the following
|
||||
command: >
|
||||
@@ -1206,12 +1216,18 @@ use has("browsefilter"): >
|
||||
==============================================================================
|
||||
7. The current directory *current-directory*
|
||||
|
||||
You may use the |:cd| and |:lcd| commands to change to another directory, so
|
||||
you will not have to type that directory name in front of the file names. It
|
||||
also makes a difference for executing external commands, e.g. ":!ls".
|
||||
You can use |:cd|, |:tcd| and |:lcd| to change to another directory, so you
|
||||
will not have to type that directory name in front of the file names. It also
|
||||
makes a difference for executing external commands, e.g. ":!ls" or ":te ls".
|
||||
|
||||
Changing directory fails when the current buffer is modified, the '.' flag is
|
||||
present in 'cpoptions' and "!" is not used in the command.
|
||||
There are three current-directory "scopes": global, tab and window. The
|
||||
window-local working directory takes precedence over the tab-local
|
||||
working directory, which in turn takes precedence over the global
|
||||
working directory. If a local working directory (tab or window) does not
|
||||
exist, the next-higher scope in the hierarchy applies.
|
||||
|
||||
Commands for changing the working directory can be suffixed with a bang "!"
|
||||
(e.g. |:cd!|) which is ignored, for compatibility with Vim.
|
||||
|
||||
*:cd* *E747* *E472*
|
||||
:cd[!] On non-Unix systems: Print the current directory
|
||||
@@ -1225,7 +1241,7 @@ present in 'cpoptions' and "!" is not used in the command.
|
||||
Does not change the meaning of an already opened file,
|
||||
because its full path name is remembered. Files from
|
||||
the |arglist| may change though!
|
||||
On MS-DOS this also changes the active drive.
|
||||
On Windows this also changes the active drive.
|
||||
To change to the directory of the current file: >
|
||||
:cd %:h
|
||||
<
|
||||
@@ -1236,29 +1252,50 @@ present in 'cpoptions' and "!" is not used in the command.
|
||||
*:chd* *:chdir*
|
||||
:chd[ir][!] [path] Same as |:cd|.
|
||||
|
||||
*:tc* *:tcd* *E5000* *E5001* *E5002*
|
||||
:tc[d][!] {path} Like |:cd|, but set the current directory for the
|
||||
current tab and window. The current directory for
|
||||
other tabs and windows is not changed.
|
||||
|
||||
*:tcd-*
|
||||
:tcd[!] - Change to the previous current directory (before the
|
||||
previous ":tcd {path}" command).
|
||||
|
||||
*:tch* *:tchdir*
|
||||
:tch[dir][!] Same as |:tcd|.
|
||||
|
||||
*:lc* *:lcd*
|
||||
:lc[d][!] {path} Like |:cd|, but only set the current directory for the
|
||||
current window. The current directory for other
|
||||
windows is not changed.
|
||||
windows or any tabs is not changed.
|
||||
|
||||
*:lch* *:lchdir*
|
||||
:lch[dir][!] Same as |:lcd|.
|
||||
|
||||
*:lcd-*
|
||||
:lcd[!] - Change to the previous current directory (before the
|
||||
previous ":tcd {path}" command).
|
||||
|
||||
*:pw* *:pwd* *E187*
|
||||
:pw[d] Print the current directory name.
|
||||
Also see |getcwd()|.
|
||||
|
||||
So long as no |:lcd| command has been used, all windows share the same current
|
||||
directory. Using a command to jump to another window doesn't change anything
|
||||
for the current directory.
|
||||
When a |:lcd| command has been used for a window, the specified directory
|
||||
becomes the current directory for that window. Windows where the |:lcd|
|
||||
command has not been used stick to the global current directory. When jumping
|
||||
to another window the current directory will become the last specified local
|
||||
current directory. If none was specified, the global current directory is
|
||||
used.
|
||||
When a |:cd| command is used, the current window will lose his local current
|
||||
directory and will use the global current directory from now on.
|
||||
So long as no |:tcd| or |:lcd| command has been used, all windows share the
|
||||
same "current directory". Using a command to jump to another window doesn't
|
||||
change anything for the current directory.
|
||||
|
||||
When |:lcd| has been used for a window, the specified directory becomes the
|
||||
current directory for that window. Windows where the |:lcd| command has not
|
||||
been used stick to the global or tab-local directory. When jumping to another
|
||||
window the current directory will become the last specified local current
|
||||
directory. If none was specified, the global or tab-local directory is used.
|
||||
|
||||
When changing tabs the same behaviour applies. If the current tab has no
|
||||
local working directory the global working directory is used. When a |:cd|
|
||||
command is used, the current window and tab will lose their local current
|
||||
directories and will use the global current directory from now on. When
|
||||
a |:tcd| command is used, only the current window will lose its local working
|
||||
directory.
|
||||
|
||||
After using |:cd| the full path name will be used for reading and writing
|
||||
files. On some networked file systems this may cause problems. The result of
|
||||
@@ -1295,7 +1332,7 @@ There are a few things to remember when editing binary files:
|
||||
and when the file is written the <NL> will be replaced with <CR> <NL>.
|
||||
- <Nul> characters are shown on the screen as ^@. You can enter them with
|
||||
"CTRL-V CTRL-@" or "CTRL-V 000".
|
||||
- To insert a <NL> character in the file split up a line. When writing the
|
||||
- To insert a <NL> character in the file split a line. When writing the
|
||||
buffer to a file a <NL> will be written for the <EOL>.
|
||||
- Vim normally appends an <EOL> at the end of the file if there is none.
|
||||
Setting the 'binary' option prevents this. If you want to add the final
|
||||
@@ -1307,9 +1344,7 @@ There are a few things to remember when editing binary files:
|
||||
9. Encryption *encryption*
|
||||
|
||||
*:X* *E817* *E818* *E819* *E820*
|
||||
Support for editing encrypted files has been removed, but may be added back in
|
||||
the future. See the following discussions for more information:
|
||||
|
||||
Support for editing encrypted files has been removed.
|
||||
https://github.com/neovim/neovim/issues/694
|
||||
https://github.com/neovim/neovim/issues/701
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -53,60 +53,6 @@ o Toggling between Farsi ISIR-3342 standard encoding and Vim Farsi via F9
|
||||
right-to-left mode, this function is also supported only in right-to-left
|
||||
mode.
|
||||
|
||||
Farsi Fonts *farsi fonts*
|
||||
-----------
|
||||
|
||||
The following files are found in the subdirectories of the '$VIM/farsi/fonts'
|
||||
directory:
|
||||
|
||||
+ far-a01.pcf X Windows fonts for Unix including Linux systems
|
||||
+ far-a01.bf X Windows fonts for SunOS
|
||||
+ far-a01.f16 a screen fonts for Unix including Linux systems
|
||||
+ far-a01.fon a monospaced fonts for Windows NT/95/98
|
||||
+ far-a01.com a screen fonts for DOS
|
||||
|
||||
|
||||
Font Installation
|
||||
-----------------
|
||||
|
||||
o Installation of fonts for MS Window systems (NT/95/98)
|
||||
|
||||
From 'Control Panel' folder, start the 'Fonts' program. Then from 'file'
|
||||
menu item select 'Install New Fonts ...'. Browse and select the
|
||||
'far-a01.fon', then follow the installation guide.
|
||||
NOTE: several people have reported that this does not work. The solution
|
||||
is unknown.
|
||||
|
||||
o Installation of fonts for X Window systems (Unix/Linux)
|
||||
|
||||
Depending on your system, copy far-a01.pcf.Z or far-a01.pcf.gz into a
|
||||
directory of your choice. Change to the directory containing the Farsi
|
||||
fonts and execute the following commands:
|
||||
|
||||
> mkfontdir
|
||||
> xset +fp path_name_of_farsi_fonts_directory
|
||||
|
||||
o Installation of fonts for X Window systems (SunOS)
|
||||
|
||||
Copy far-a01.bf font into a directory of your choice.
|
||||
Change to the directory containing the far-a01.fb fonts and
|
||||
execute the following commands:
|
||||
|
||||
> fldfamily
|
||||
> xset +fp path_name_of_fonts_directory
|
||||
|
||||
o Installation of ASCII screen fonts (Unix/Linux)
|
||||
|
||||
For Linux system, copy the far-a01.f16 fonts into /usr/lib/kbd/consolefonts
|
||||
directory and execute the setfont program as "setfont far-a01.f16". For
|
||||
other systems (e.g. SCO Unix), please refer to the fonts installation
|
||||
section of your system administration manuals.
|
||||
|
||||
o Installation of ASCII screen fonts (DOS)
|
||||
|
||||
After system power on, prior to the first use of Vim, upload the Farsi
|
||||
fonts by executing the far-a01.com font uploading program.
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
@@ -165,7 +111,7 @@ The letter encoding used is the Vim extended ISIR-3342 standard with a built
|
||||
in function to convert between Vim extended ISIR-3342 and ISIR-3342 standard.
|
||||
|
||||
For document portability reasons, the letter encoding is kept the same across
|
||||
different platforms (i.e. UNIX's, NT/95/98, MS DOS, ...).
|
||||
different platforms (i.e. Unix, Windows, ...).
|
||||
|
||||
|
||||
o Keyboard
|
||||
@@ -215,7 +161,7 @@ o Keyboard
|
||||
Note:
|
||||
<09> stands for Farsi PSP (break without space)
|
||||
|
||||
<09> stands for Farsi PCN (for HAMZE attribute )
|
||||
<09> stands for Farsi PCN (for HAMZE attribute)
|
||||
|
||||
Restrictions
|
||||
------------
|
||||
|
@@ -595,7 +595,7 @@ Format description:
|
||||
ignored.
|
||||
2. Each entry starts with line that has format "{type} with timestamp
|
||||
{timestamp}:". {timestamp} is |strftime()|-formatted string representing
|
||||
actual UNIX timestamp value. First strftime() argument is equal to
|
||||
actual Unix timestamp value. First strftime() argument is equal to
|
||||
`%Y-%m-%dT%H:%M:%S`. When writing this timestamp is parsed using
|
||||
|msgpack#strptime()|, with caching (it remembers which timestamp produced
|
||||
particular strftime() output and uses this value if you did not change
|
||||
|
@@ -208,18 +208,6 @@ takes too much time or you don't like the cursor jumping to another line,
|
||||
include the 'h' flag in 'guioptions'. Then the scrolling is limited by the
|
||||
text of the current cursor line.
|
||||
|
||||
*athena-intellimouse*
|
||||
If you have an Intellimouse and an X server that supports using the wheel,
|
||||
then you can use the wheel to scroll the text up and down in gvim. This works
|
||||
with XFree86 4.0 and later, and with some older versions when you add patches.
|
||||
See |scroll-mouse-wheel|.
|
||||
|
||||
For older versions of XFree86 you must patch your X server. The following
|
||||
page has a bit of information about using the Intellimouse on Linux as well as
|
||||
links to the patches and X server binaries (may not have the one you need
|
||||
though):
|
||||
http://www.inria.fr/koala/colas/mouse-wheel-scroll/
|
||||
|
||||
==============================================================================
|
||||
3. Mouse Control *gui-mouse*
|
||||
|
||||
@@ -605,10 +593,6 @@ The default menus have these priorities:
|
||||
When no or zero priority is given, 500 is used.
|
||||
The priority for the PopUp menu is not used.
|
||||
|
||||
The Help menu will be placed on the far right side of the menu bar on systems
|
||||
which support this (Motif and GTK+). For GTK+ 2, this is not done anymore
|
||||
because right-aligning the Help menu is now discouraged UI design.
|
||||
|
||||
You can use a priority higher than 9999, to make it go after the Help menu,
|
||||
but that is non-standard and is discouraged. The highest possible priority is
|
||||
about 32000. The lowest is 1.
|
||||
@@ -677,10 +661,8 @@ level. Vim interprets the items in this menu as follows:
|
||||
toolbar button image. Note that the exact filename is OS-specific: For
|
||||
example, under Win32 the command >
|
||||
:amenu ToolBar.Hello :echo "hello"<CR>
|
||||
< would find the file 'hello.bmp'. Under GTK+/X11 it is 'Hello.xpm'. With
|
||||
GTK+ 2 the files 'Hello.png', 'Hello.xpm' and 'Hello.bmp' are checked for
|
||||
existence, and the first one found would be used.
|
||||
For MS-Windows and GTK+ 2 the bitmap is scaled to fit the button. For
|
||||
< would find the file 'hello.bmp'. Under X11 it is 'Hello.xpm'.
|
||||
For MS-Windows and the bitmap is scaled to fit the button. For
|
||||
MS-Windows a size of 18 by 18 pixels works best.
|
||||
For MS-Windows the bitmap should have 16 colors with the standard palette.
|
||||
The light grey pixels will be changed to the Window frame color and the
|
||||
@@ -729,8 +711,8 @@ nr Name Normal action ~
|
||||
30 WinMinWidth make current window use few columns
|
||||
|
||||
*hidden-menus* *win32-hidden-menus*
|
||||
In the Win32 and GTK+ GUI, starting a menu name with ']' excludes that menu
|
||||
from the main menu bar. You must then use the |:popup| command to display it.
|
||||
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.
|
||||
|
||||
*popup-menu*
|
||||
You can define the special menu "PopUp". This is the menu that is displayed
|
||||
@@ -883,9 +865,8 @@ a menu item - you don't need to do a :tunmenu as well.
|
||||
|
||||
5.9 Popup Menus
|
||||
|
||||
In the Win32 and GTK+ GUI, you can cause a menu to popup at the cursor.
|
||||
This behaves similarly to the PopUp menus except that any menu tree can
|
||||
be popped up.
|
||||
In the Win32 GUI, you can cause a menu to popup at the cursor. This behaves
|
||||
similarly to the PopUp menus except that any menu tree can be popped up.
|
||||
|
||||
This command is for backwards compatibility, using it is discouraged, because
|
||||
it behaves in a strange way.
|
||||
@@ -894,7 +875,7 @@ it behaves in a strange way.
|
||||
:popu[p] {name} Popup the menu {name}. The menu named must
|
||||
have at least one subentry, but need not
|
||||
appear on the menu-bar (see |hidden-menus|).
|
||||
{only available for Win32 and GTK GUI}
|
||||
{only available for Win32 GUI}
|
||||
|
||||
:popu[p]! {name} Like above, but use the position of the mouse
|
||||
pointer instead of the cursor.
|
||||
|
@@ -47,10 +47,6 @@ If you want Vim to start with a maximized window, add this command to your
|
||||
vimrc or gvimrc file: >
|
||||
au GUIEnter * simalt ~x
|
||||
<
|
||||
*gui-w32s*
|
||||
There is a specific version of gvim.exe that runs under the Win32s subsystem
|
||||
of Windows 3.1 or 3.11. See |win32s|.
|
||||
|
||||
==============================================================================
|
||||
2. Vim as default editor *vim-default-editor*
|
||||
|
||||
@@ -88,7 +84,6 @@ when you have got a new version):
|
||||
You can also install Vim in the "Send To" menu:
|
||||
1. Start a Windows Explorer
|
||||
2. Navigate to your sendto directory:
|
||||
Windows 95: %windir%\sendto (e.g. "c:\windows\sendto")
|
||||
Windows NT: %windir%\profiles\%user%\sendto (e.g.
|
||||
"c:\winnt\profiles\mattha\sendto").
|
||||
3. Right-click in the file pane and select New->Shortcut
|
||||
@@ -262,17 +257,6 @@ WARNING: If you close this window with the "X" button, and confirm the
|
||||
question if you really want to kill the application, Vim may be killed too!
|
||||
(This does not apply to commands run asynchronously with ":!start".)
|
||||
|
||||
*msdos-mode*
|
||||
If you get a dialog that says "This program is set to run in MS-DOS mode..."
|
||||
when you run an external program, you can solve this by changing the
|
||||
properties of the associated shortcut:
|
||||
- Use a Windows Explorer to find the command.com that is used. It can be
|
||||
c:\command.com, c:\dos\command.com, c:\windows\command.com, etc.
|
||||
- With the right mouse button, select properties of this command.com.
|
||||
- In the Program tab select "Advanced".
|
||||
- Unselect "MS-DOS mode".
|
||||
- Click "OK" twice.
|
||||
|
||||
*win32-!start*
|
||||
Normally, Vim waits for a command to complete before continuing (this makes
|
||||
sense for most shell commands which produce output for Vim to use). If you
|
||||
@@ -281,10 +265,6 @@ syntax on W95 & NT: >
|
||||
:!start [/min] {command}
|
||||
The optional "/min" causes the window to be minimized.
|
||||
|
||||
On Win32s, you will have to go to another window instead. Don't forget that
|
||||
you must tell Windows 3.1x to keep executing a DOS command in the background
|
||||
while you switch back to Vim.
|
||||
|
||||
==============================================================================
|
||||
5. Special colors *win32-colors*
|
||||
|
||||
@@ -293,7 +273,7 @@ On Win32, the normal DOS colors can be used. See |dos-colors|.
|
||||
Additionally the system configured colors can also be used. These are known
|
||||
by the names Sys_XXX, where XXX is the appropriate system color name, from the
|
||||
following list (see the Win32 documentation for full descriptions). Case is
|
||||
ignored. Note: On Win32s not all of these colors are supported.
|
||||
ignored.
|
||||
|
||||
Sys_3DDKShadow Sys_3DFace Sys_BTNFace
|
||||
Sys_3DHilight Sys_3DHighlight Sys_BTNHilight
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*help.txt* For Vim version 7.4. Last change: 2012 Dec 06
|
||||
*help.txt* For Vim version 7.4. Last change: 2015 Apr 15
|
||||
|
||||
VIM - main help file
|
||||
k
|
||||
@@ -23,6 +23,7 @@ Get specific help: It is possible to go directly to whatever you want help
|
||||
Command-line editing c_ :help c_<Del>
|
||||
Vim command argument - :help -r
|
||||
Option ' :help 'textwidth'
|
||||
Regular expression / :help /[
|
||||
Search for help: Type ":help word", then hit CTRL-D to see matching
|
||||
help entries for "word".
|
||||
Or use ":helpgrep word". |:helpgrep|
|
||||
@@ -162,7 +163,6 @@ Remarks about specific systems ~
|
||||
|os_win32.txt| MS-Windows
|
||||
*standard-plugin-list*
|
||||
Standard plugins ~
|
||||
|pi_getscript.txt| Downloading latest version of Vim scripts
|
||||
|pi_gzip.txt| Reading and writing compressed files
|
||||
|pi_netrw.txt| Reading and writing files over a network
|
||||
|pi_paren.txt| Highlight matching parens
|
||||
|
@@ -184,12 +184,6 @@ command: >
|
||||
:!xterm -e vim +help &
|
||||
<
|
||||
|
||||
*:helpfind* *:helpf*
|
||||
:helpf[ind] Like |:help|, but use a dialog to enter the argument.
|
||||
Only for backwards compatibility. It now executes the
|
||||
ToolBar.FindHelp menu entry instead of using a builtin
|
||||
dialog. {only when compiled with |+GUI_GTK|}
|
||||
|
||||
*:helpt* *:helptags*
|
||||
*E154* *E150* *E151* *E152* *E153* *E670*
|
||||
:helpt[ags] [++t] {dir}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 7.4. Last change: 2015 Jan 07
|
||||
*index.txt* For Vim version 7.4. Last change: 2015 Sep 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -700,12 +700,16 @@ tag char note action in Normal mode ~
|
||||
|g'| g'{mark} 1 like |'| but without changing the jumplist
|
||||
|g`| g`{mark} 1 like |`| but without changing the jumplist
|
||||
|gstar| g* 1 like "*", but without using "\<" and "\>"
|
||||
|g+| g+ go to newer text state N times
|
||||
|g,| g, 1 go to N newer position in change list
|
||||
|g-| g- go to older text state N times
|
||||
|g0| g0 1 when 'wrap' off go to leftmost character of
|
||||
the current line that is on the screen;
|
||||
when 'wrap' on go to the leftmost character
|
||||
of the current screen line
|
||||
|g8| g8 print hex value of bytes used in UTF-8
|
||||
character under the cursor
|
||||
|g;| g; 1 go to N older position in change list
|
||||
|g<| g< display previous command output
|
||||
|g?| g? 2 Rot13 encoding operator
|
||||
|g?g?| g?? 2 Rot13 encode current line
|
||||
@@ -734,6 +738,7 @@ tag char note action in Normal mode ~
|
||||
the screen; when 'wrap' on go to the
|
||||
leftmost non-white character of the current
|
||||
screen line
|
||||
|g_| g_ 1 cursor to the last CHAR N - 1 lines lower
|
||||
|ga| ga print ascii value of character under the
|
||||
cursor
|
||||
|gd| gd 1 go to definition of word under the cursor
|
||||
@@ -1128,6 +1133,8 @@ tag command action ~
|
||||
|:cc| :cc go to specific error
|
||||
|:cclose| :ccl[ose] close quickfix window
|
||||
|:cd| :cd change directory
|
||||
|:cdo| :cdo execute command in each valid error list entry
|
||||
|:cfdo| :cfdo execute command in each file in error list
|
||||
|:center| :ce[nter] format lines at the center
|
||||
|:cexpr| :cex[pr] read errors from expr and jump to first
|
||||
|:cfile| :cf[ile] read file with error messages and jump to first
|
||||
@@ -1239,7 +1246,6 @@ tag command action ~
|
||||
|:hardcopy| :ha[rdcopy] send text to the printer
|
||||
|:help| :h[elp] open a help window
|
||||
|:helpclose| :helpc[lose] close one help window
|
||||
|:helpfind| :helpf[ind] dialog to open a help window
|
||||
|:helpgrep| :helpg[rep] like ":grep" but searches help files
|
||||
|:helptags| :helpt[ags] generate help tags for a directory
|
||||
|:highlight| :hi[ghlight] specify highlighting methods
|
||||
@@ -1285,6 +1291,8 @@ tag command action ~
|
||||
|:lchdir| :lch[dir] change directory locally
|
||||
|:lclose| :lcl[ose] close location window
|
||||
|:lcscope| :lcs[cope] like ":cscope" but uses location list
|
||||
|:ldo| :ld[o] execute command in valid location list entries
|
||||
|:lfdo| :lfd[o] execute command in each file in location list
|
||||
|:left| :le[ft] left align lines
|
||||
|:leftabove| :lefta[bove] make split window appear left or above
|
||||
|:let| :let assign a value to a variable or option
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 7.4. Last change: 2015 May 22
|
||||
*insert.txt* For Vim version 7.4. Last change: 2015 Sep 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -78,8 +78,8 @@ CTRL-W Delete the word before the cursor (see |i_backspacing| about
|
||||
|word-motions|, for the definition of a word.
|
||||
*i_CTRL-U*
|
||||
CTRL-U Delete all entered characters before the cursor in the current
|
||||
line. If there are no newly entereed characters and
|
||||
'backspace'is not empty, delete all characters before the
|
||||
line. If there are no newly entered characters and
|
||||
'backspace' is not empty, delete all characters before the
|
||||
cursor in the current line.
|
||||
See |i_backspacing| about joining lines.
|
||||
*i_CTRL-I* *i_<Tab>* *i_Tab*
|
||||
@@ -148,7 +148,7 @@ CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
|
||||
CTRL-R a results in "ac".
|
||||
CTRL-R CTRL-R a results in "ab^Hc".
|
||||
< Options 'textwidth', 'formatoptions', etc. still apply. If
|
||||
you also want to avoid these, use "<C-R><C-O>r", see below.
|
||||
you also want to avoid these, use CTRL-R CTRL-O, see below.
|
||||
The '.' register (last inserted text) is still inserted as
|
||||
typed.
|
||||
|
||||
@@ -1941,9 +1941,9 @@ If the 'fileformats' option is not empty Vim tries to recognize the type of
|
||||
changed, the detected format is only used while reading the file.
|
||||
A similar thing happens with 'fileencodings'.
|
||||
|
||||
On non-MS-DOS and Win32 systems the message "[dos format]" is shown if
|
||||
On non-Windows systems the message "[dos format]" is shown if
|
||||
a file is read in DOS format, to remind you that something unusual is done.
|
||||
On Macintosh, MS-DOS, and Win32 the message "[unix format]" is shown if
|
||||
On Macintosh and Windows the message "[unix format]" is shown if
|
||||
a file is read in Unix format.
|
||||
On non-Macintosh systems, the message "[Mac format]" is shown if a file is
|
||||
read in Mac format.
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*intro.txt* For Vim version 7.4. Last change: 2014 May 24
|
||||
*intro.txt* For Vim version 7.4. Last change: 2015 Jan 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -131,7 +131,7 @@ http://www.vim.org/maillist.php
|
||||
|
||||
Bug reports: *bugs* *bug-reports* *bugreport.vim*
|
||||
|
||||
Send bug reports to: Vim Developers <vim_dev@vim.org>
|
||||
Send bug reports to: Vim Developers <vim-dev@vim.org>
|
||||
This is a maillist, you need to become a member first and many people will see
|
||||
the message. If you don't want that, e.g. because it is a security issue,
|
||||
send it to <bugs@vim.org>, this only goes to the Vim maintainer (that's Bram).
|
||||
@@ -251,7 +251,7 @@ Vim would never have become what it is now, without the help of these people!
|
||||
lots of patches
|
||||
Ingo Wilken Tcl interface
|
||||
Mike Williams PostScript printing
|
||||
Juergen Weigert Lattice version, AUX improvements, UNIX and
|
||||
Juergen Weigert Lattice version, AUX improvements, Unix and
|
||||
MS-DOS ports, autoconf
|
||||
Stefan 'Sec' Zehl Maintainer of vim.org
|
||||
|
||||
@@ -452,7 +452,7 @@ notation meaning equivalent decimal value(s) ~
|
||||
<C-...> control-key *control* *ctrl* *<C-*
|
||||
<M-...> alt-key or meta-key *meta* *alt* *<M-*
|
||||
<A-...> same as <M-...> *<A-*
|
||||
<D-...> command-key (Macintosh only) *<D-*
|
||||
<D-...> command-key or "super" key *<D-*
|
||||
<t_xx> key with "xx" entry in termcap
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 7.4. Last change: 2014 Oct 03
|
||||
*map.txt* For Vim version 7.4. Last change: 2014 Dec 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
@@ -43,16 +43,6 @@ features. Unfortunately, every system has its own way to deal with multibyte
|
||||
languages and it is quite complicated.
|
||||
|
||||
|
||||
COMPILING
|
||||
|
||||
If you already have a compiled Vim program, check if the |+multi_byte| feature
|
||||
is included. The |:version| command can be used for this.
|
||||
|
||||
If +multi_byte is not included, you should compile Vim with "normal", "big" or
|
||||
"huge" features. You can further tune what features are included. See the
|
||||
INSTALL files in the source directory.
|
||||
|
||||
|
||||
LOCALE
|
||||
|
||||
First of all, you must make sure your current locale is set correctly. If
|
||||
@@ -107,14 +97,6 @@ is the difficult part. It depends on the system you are using, the locale and
|
||||
a few other things. See the chapters on fonts: |mbyte-fonts-X11| for
|
||||
X-Windows and |mbyte-fonts-MSwin| for MS-Windows.
|
||||
|
||||
For GTK+ 2, you can skip most of this section. The option 'guifontset' does
|
||||
no longer exist. You only need to set 'guifont' and everything should "just
|
||||
work". If your system comes with Xft2 and fontconfig and the current font
|
||||
does not contain a certain glyph, a different font will be used automatically
|
||||
if available. The 'guifontwide' option is still supported but usually you do
|
||||
not need to set it. It is only necessary if the automatic font selection does
|
||||
not suit your needs.
|
||||
|
||||
For X11 you can set the 'guifontset' option to a list of fonts that together
|
||||
cover the characters that are used. Example for Korean: >
|
||||
|
||||
@@ -494,11 +476,6 @@ For Vim you may need to set 'encoding' to "utf-8".
|
||||
Unfortunately, using fonts in X11 is complicated. The name of a single-byte
|
||||
font is a long string. For multi-byte fonts we need several of these...
|
||||
|
||||
Note: Most of this is no longer relevant for GTK+ 2. Selecting a font via
|
||||
its XLFD is not supported; see 'guifont' for an example of how to
|
||||
set the font. Do yourself a favor and ignore the |XLFD| and |xfontset|
|
||||
sections below.
|
||||
|
||||
First of all, Vim only accepts fixed-width fonts for displaying text. You
|
||||
cannot use proportionally spaced fonts. This excludes many of the available
|
||||
(and nicer looking) fonts. However, for menus and tooltips any font can be
|
||||
@@ -629,52 +606,6 @@ If you use a wrong "font" argument you will get an error message.
|
||||
Also make sure that you set 'guifontset' before setting fonts for highlight
|
||||
groups.
|
||||
|
||||
|
||||
USING RESOURCE FILES
|
||||
|
||||
Instead of specifying 'guifontset', you can set X11 resources and Vim will
|
||||
pick them up. This is only for people who know how X resource files work.
|
||||
|
||||
For Motif and Athena insert these three lines in your $HOME/.Xdefaults file:
|
||||
|
||||
Vim.font: |base_font_name_list|
|
||||
Vim*fontSet: |base_font_name_list|
|
||||
Vim*fontList: your_language_font
|
||||
|
||||
Note: Vim.font is for text area.
|
||||
Vim*fontSet is for menu.
|
||||
Vim*fontList is for menu (for Motif GUI)
|
||||
|
||||
For example, when you are using Japanese and a 14 dots font, >
|
||||
|
||||
Vim.font: -misc-fixed-medium-r-normal--14-*
|
||||
Vim*fontSet: -misc-fixed-medium-r-normal--14-*
|
||||
Vim*fontList: -misc-fixed-medium-r-normal--14-*
|
||||
<
|
||||
or: >
|
||||
|
||||
Vim*font: k14,r14
|
||||
Vim*fontSet: k14,r14
|
||||
Vim*fontList: k14,r14
|
||||
<
|
||||
To have them take effect immediately you will have to do >
|
||||
|
||||
xrdb -merge ~/.Xdefaults
|
||||
|
||||
Otherwise you will have to stop and restart the X server before the changes
|
||||
take effect.
|
||||
|
||||
|
||||
The GTK+ version of GUI Vim does not use .Xdefaults, use ~/.gtkrc instead.
|
||||
The default mostly works OK. But for the menus you might have to change
|
||||
it. Example: >
|
||||
|
||||
style "default"
|
||||
{
|
||||
fontset="-*-*-medium-r-normal--14-*-*-*-c-*-*-*"
|
||||
}
|
||||
widget_class "*" style "default"
|
||||
|
||||
==============================================================================
|
||||
6. Fonts on MS-Windows *mbyte-fonts-MSwin*
|
||||
|
||||
@@ -847,20 +778,6 @@ For example, when you are using kinput2 as |IM-server| and sh, >
|
||||
export XMODIFIERS="@im=kinput2"
|
||||
<
|
||||
|
||||
FULLY CONTROLLED XIM
|
||||
|
||||
You can fully control XIM, like with IME of MS-Windows (see |multibyte-ime|).
|
||||
This is currently only available for the GTK GUI.
|
||||
|
||||
Before using fully controlled XIM, one setting is required. Set the
|
||||
'imactivatekey' option to the key that is used for the activation of the input
|
||||
method. For example, when you are using kinput2 + canna as IM Server, the
|
||||
activation key is probably Shift+Space: >
|
||||
|
||||
:set imactivatekey=S-space
|
||||
|
||||
See 'imactivatekey' for the format.
|
||||
|
||||
==============================================================================
|
||||
8. Input on MS-Windows *mbyte-IME*
|
||||
|
||||
@@ -893,14 +810,11 @@ WHAT IS IME
|
||||
URL.
|
||||
|
||||
WHAT IS GLOBAL IME *global-ime*
|
||||
Global IME makes capability to input Chinese, Japanese, and Korean text
|
||||
into Vim buffer on any language version of Windows 98, Windows 95, and
|
||||
Windows NT 4.0.
|
||||
On Windows 2000 and XP it should work as well (without downloading). On
|
||||
Windows 2000 Professional, Global IME is built in, and the Input Locales
|
||||
can be added through Control Panel/Regional Options/Input Locales.
|
||||
Please see below URL for detail of Global IME. You can also find various
|
||||
language version of Global IME at same place.
|
||||
Global IME enables input of Chinese, Japanese, and Korean text into Vim
|
||||
buffer on any language version of Windows. Global IME is built in, and
|
||||
the Input Locales can be added through Control Panel/Regional
|
||||
Options/Input Locales. Please see below URL for detail of Global IME.
|
||||
You can also find various language version of Global IME at same place.
|
||||
|
||||
- Global IME detailed information.
|
||||
http://search.microsoft.com/results.aspx?q=global+ime
|
||||
@@ -1201,14 +1115,12 @@ internally.
|
||||
|
||||
Vim has comprehensive UTF-8 support. It works well in:
|
||||
- xterm with utf-8 support enabled
|
||||
- Athena, Motif and GTK GUI
|
||||
- MS-Windows GUI
|
||||
- several other platforms
|
||||
|
||||
Double-width characters are supported. This works best with 'guifontwide' or
|
||||
'guifontset'. When using only 'guifont' the wide characters are drawn in the
|
||||
normal width and a space to fill the gap. Note that the 'guifontset' option
|
||||
is no longer relevant in the GTK+ 2 GUI.
|
||||
normal width and a space to fill the gap.
|
||||
|
||||
*bom-bytes*
|
||||
When reading a file a BOM (Byte Order Mark) can be used to recognize the
|
||||
@@ -1278,8 +1190,6 @@ doesn't always work. See the system specific remarks below, and 'langmenu'.
|
||||
|
||||
USING UTF-8 IN X-Windows *utf-8-in-xwindows*
|
||||
|
||||
Note: This section does not apply to the GTK+ 2 GUI.
|
||||
|
||||
You need to specify a font to be used. For double-wide characters another
|
||||
font is required, which is exactly twice as wide. There are three ways to do
|
||||
this:
|
||||
|
@@ -401,12 +401,6 @@ You have used an ":unabbreviate" command with an argument which is not an
|
||||
existing abbreviation. All variations of this command give the same message:
|
||||
":cunabbrev", ":iunabbrev", etc. Check for trailing white space.
|
||||
|
||||
>
|
||||
/dev/dsp: No such file or directory
|
||||
|
||||
Only given for GTK GUI with Gnome support. Gnome tries to use the audio
|
||||
device and it isn't present. You can ignore this error.
|
||||
|
||||
*E31* >
|
||||
No such mapping
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
The Msgpack-RPC Interface to Nvim *msgpack-rpc*
|
||||
|
||||
1. Introduction |msgpack-rpc-intro|
|
||||
2. API |msgpack-rpc-api|
|
||||
2. API mapping |msgpack-rpc-api|
|
||||
3. Connecting |msgpack-rpc-connecting|
|
||||
4. Clients |msgpack-rpc-clients|
|
||||
5. Types |msgpack-rpc-types|
|
||||
@@ -36,13 +36,13 @@ Nvim's msgpack-rpc interface is like a more powerful version of Vim's
|
||||
`clientserver` feature.
|
||||
|
||||
==============================================================================
|
||||
2. API *msgpack-rpc-api*
|
||||
2. API mapping *msgpack-rpc-api*
|
||||
|
||||
The Nvim C API is automatically exposed to the msgpack-rpc interface by the
|
||||
build system, which parses headers at src/nvim/api from the project root. A
|
||||
dispatch function is generated, which matches msgpack-rpc method names with
|
||||
non-static API functions, converting/validating arguments and return values
|
||||
back to msgpack.
|
||||
The Nvim C API, see |nvim-api|, is automatically exposed to the msgpack-rpc
|
||||
interface by the build system, which parses headers at src/nvim/api from the
|
||||
project root. A dispatch function is generated, which matches msgpack-rpc method
|
||||
names with non-static API functions, converting/validating arguments and return
|
||||
values back to msgpack.
|
||||
|
||||
Client libraries will normally provide wrappers that hide msgpack-rpc details
|
||||
from programmers. The wrappers can be automatically generated by reading
|
||||
@@ -63,7 +63,7 @@ Here's a simple way to get human-readable description of the API (requires
|
||||
Python and the `pyyaml`/`msgpack-python` pip packages):
|
||||
>
|
||||
nvim --api-info | python -c 'import msgpack, sys, yaml; print yaml.dump(msgpack.unpackb(sys.stdin.read()))' > api.yaml
|
||||
|
||||
<
|
||||
==============================================================================
|
||||
3. Connecting *msgpack-rpc-connecting*
|
||||
|
||||
@@ -162,8 +162,8 @@ https://github.com/msgpack-rpc/msgpack-rpc-ruby/blob/master/lib/msgpack/rpc/tran
|
||||
==============================================================================
|
||||
5. Types *msgpack-rpc-types*
|
||||
|
||||
Nvim's C API uses custom types for all functions (some are just typedefs
|
||||
around C99 standard types). The types can be split into two groups:
|
||||
Nvim's C API uses custom types for all functions, se |nvim-api-types|.
|
||||
For the purpose of mapping to msgpack, he types can be split into two groups:
|
||||
|
||||
- Basic types that map natively to msgpack (and probably have a default
|
||||
representation in msgpack-supported programming languages)
|
||||
|
@@ -22,6 +22,8 @@ is found in your `$PATH`.
|
||||
- xclip
|
||||
- xsel (newer alternative to xclip)
|
||||
- pbcopy/pbpaste (only for Mac OS X)
|
||||
- lemonade (useful for SSH machine)
|
||||
https://github.com/pocke/lemonade
|
||||
|
||||
The presence of a suitable clipboard tool implicitly enables the '+' and '*'
|
||||
registers.
|
||||
|
@@ -26,7 +26,7 @@ are now decoupled from Nvim core as providers:
|
||||
|
||||
The first example is clipboard integration: in the original Vim source code,
|
||||
clipboard functions account for more than 1k lines of C source code (and that
|
||||
is just on ui.c), all to peform two tasks that are now accomplished with
|
||||
is just on ui.c), all to perform two tasks that are now accomplished with
|
||||
simple shell commands such as xclip or pbcopy/pbpaste.
|
||||
|
||||
The other example is Python scripting support: Vim has three files dedicated to
|
||||
|
@@ -49,6 +49,9 @@ To use Vim Python 2/3 plugins with Nvim, do the following:
|
||||
>
|
||||
$ pip3 install --user neovim
|
||||
<
|
||||
Note: If you previously installed the package, get the latest version by
|
||||
appending the `--upgrade` flag to the commands above.
|
||||
|
||||
==============================================================================
|
||||
*g:python_host_prog*
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 7.4. Last change: 2014 Dec 17
|
||||
*options.txt* For Vim version 7.4. Last change: 2015 Oct 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -49,9 +49,12 @@ achieve special effects. These options come in three forms:
|
||||
:se[t] {option}&vi Reset option to its Vi default value.
|
||||
:se[t] {option}&vim Reset option to its Vim default value.
|
||||
|
||||
:se[t] all& Set all options, except terminal options, to their
|
||||
default value. The values of 'term', 'lines' and
|
||||
'columns' are not changed.
|
||||
:se[t] all& Set all options to their default value. The values of
|
||||
these options are not changed:
|
||||
'columns'
|
||||
'encoding'
|
||||
'lines'
|
||||
Warning: This may have a lot of side effects.
|
||||
|
||||
*:set-args* *E487* *E521*
|
||||
:se[t] {option}={value} or
|
||||
@@ -183,7 +186,7 @@ the option value, use '\"' instead. This example sets the 'titlestring'
|
||||
option to 'hi "there"': >
|
||||
:set titlestring=hi\ \"there\"
|
||||
|
||||
For MS-DOS and WIN32 backslashes in file names are mostly not removed. More
|
||||
For Windows backslashes in file names are mostly not removed. More
|
||||
precise: For options that expect a file name (those where environment
|
||||
variables are expanded) a backslash before a normal file name character is not
|
||||
removed. But a backslash before a special character (space, backslash, comma,
|
||||
@@ -488,11 +491,11 @@ number can be specified where "vim:" or "Vim:" is used:
|
||||
vim<{vers}: version before {vers}
|
||||
vim={vers}: version {vers}
|
||||
vim>{vers}: version after {vers}
|
||||
{vers} is 600 for Vim 6.0 (hundred times the major version plus minor).
|
||||
For example, to use a modeline only for Vim 6.0 and later:
|
||||
/* vim600: set foldmethod=marker: */ ~
|
||||
To use a modeline for Vim before version 5.7:
|
||||
/* vim<570: set sw=4: */ ~
|
||||
{vers} is 700 for Vim 7.0 (hundred times the major version plus minor).
|
||||
For example, to use a modeline only for Vim 7.0:
|
||||
/* vim700: set foldmethod=marker */ ~
|
||||
To use a modeline for Vim after version 7.2:
|
||||
/* vim>702: set cole=2: */ ~
|
||||
There can be no blanks between "vim" and the ":".
|
||||
|
||||
|
||||
@@ -635,9 +638,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
(or Vim is run inside an xterm invoked with "-cjkwidth" option.),
|
||||
this option should be set to "double" to match the width perceived
|
||||
by Vim with the width of glyphs in the font. Perhaps it also has
|
||||
to be set to "double" under CJK Windows 9x/ME or Windows 2k/XP
|
||||
when the system locale is set to one of CJK locales. See Unicode
|
||||
Standard Annex #11 (http://www.unicode.org/reports/tr11).
|
||||
to be set to "double" under CJK Windows XP when the system locale is
|
||||
set to one of CJK locales.
|
||||
See Unicode Standard Annex #11 (http://www.unicode.org/reports/tr11).
|
||||
|
||||
Vim may set this option automatically at startup time when Vim is
|
||||
compiled with the |+termresponse| feature and if |t_u7| is set to the
|
||||
@@ -704,7 +707,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
line.
|
||||
When 'smartindent' or 'cindent' is on the indent is changed in
|
||||
a different way.
|
||||
The 'autoindent' option is reset when the 'paste' option is set.
|
||||
The 'autoindent' option is reset when the 'paste' option is set and
|
||||
restored when 'paste' is reset.
|
||||
{small difference from Vi: After the indent is deleted when typing
|
||||
<Esc> or <CR>, the cursor position when moving up or down is after the
|
||||
deleted indent; Vi puts the cursor somewhere in the deleted indent}.
|
||||
@@ -772,14 +776,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
putting a ":gui" command in the gvimrc file, before where the value
|
||||
of 'background' is used (e.g., before ":syntax on").
|
||||
|
||||
For MS-DOS and Windows the default is "dark".
|
||||
For other systems "dark" is used when 'term' is "linux",
|
||||
"screen.linux", "cygwin" or "putty", or $COLORFGBG suggests a dark
|
||||
background. Otherwise the default is "light".
|
||||
For Windows the default is "dark". "dark" should be used if $COLORFGBG
|
||||
suggests a dark background (not yet implemented). Otherwise the default
|
||||
is "light".
|
||||
|
||||
Normally this option would be set in the vimrc file. Possibly
|
||||
depending on the terminal name. Example: >
|
||||
:if &term == "pcterm"
|
||||
:if $TERM == "xterm"
|
||||
: set background=dark
|
||||
:endif
|
||||
< When this option is set, the default settings for the highlight groups
|
||||
@@ -900,7 +903,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
impossible!). Writing may fail because of this.
|
||||
- A directory "." means to put the backup file in the same directory
|
||||
as the edited file.
|
||||
- A directory starting with "./" (or ".\" for MS-DOS et al.) means to
|
||||
- A directory starting with "./" (or ".\" for Windows) means to
|
||||
put the backup file relative to where the edited file is. The
|
||||
leading "." is replaced with the path name of the edited file.
|
||||
("." inside a directory name has no special meaning).
|
||||
@@ -1110,8 +1113,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'browsedir'* *'bsdir'*
|
||||
'browsedir' 'bsdir' string (default: "last")
|
||||
global
|
||||
{only for Motif, Athena, GTK, Mac and
|
||||
Win32 GUI}
|
||||
{only for Mac and Win32 GUI}
|
||||
Which directory to use for the file browser:
|
||||
last Use same directory as with last file browser, where a
|
||||
file was opened or saved.
|
||||
@@ -1194,6 +1196,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
nofile only: The buffer name is fixed, it is not handled like a
|
||||
file name. It is not modified in response to a |:cd|
|
||||
command.
|
||||
both: When using ":e bufname" and already editing "bufname"
|
||||
the buffer is made empty and autocommands are
|
||||
triggered as usual for |:edit|.
|
||||
*E676*
|
||||
"acwrite" implies that the buffer name is not related to a file, like
|
||||
"nofile", but it will be written. Thus, in contrast to "nofile" and
|
||||
@@ -1359,7 +1364,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
option, yank and delete operations (but not put)
|
||||
will additionally copy the text into register
|
||||
'*'. See |nvim-clipboard|.
|
||||
<
|
||||
|
||||
*clipboard-autoselect*
|
||||
autoselect Works like the 'a' flag in 'guioptions': If present,
|
||||
then whenever Visual mode is started, or the Visual
|
||||
@@ -2073,7 +2078,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
the edited file. On Unix, a dot is prepended to the file name, so
|
||||
it doesn't show in a directory listing. On MS-Windows the "hidden"
|
||||
attribute is set and a dot prepended if possible.
|
||||
- A directory starting with "./" (or ".\" for MS-DOS et al.) means to
|
||||
- A directory starting with "./" (or ".\" for Windows) means to
|
||||
put the swap file relative to where the edited file is. The leading
|
||||
"." is replaced with the path name of the edited file.
|
||||
- For Unix and Win32, if a directory ends in two path separators "//"
|
||||
@@ -2129,7 +2134,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'edcompatible' 'ed' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'encoding'* *'enc'* *E543*
|
||||
'encoding' 'enc' string (default: "utf-8" or value from $LANG)
|
||||
'encoding' 'enc' string (default: "utf-8")
|
||||
global
|
||||
{only available when compiled with the |+multi_byte|
|
||||
feature}
|
||||
@@ -2151,10 +2156,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
can use: >
|
||||
if has("multi_byte_encoding")
|
||||
<
|
||||
Normally 'encoding' will be equal to your current locale. This will
|
||||
be the default if Vim recognizes your environment settings, otherwise
|
||||
"utf-8" is used.
|
||||
|
||||
When you set this option, it fires the |EncodingChanged| autocommand
|
||||
event so that you can set up fonts if necessary.
|
||||
|
||||
@@ -2171,22 +2172,20 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
setting 'encoding' to one of these values instead of utf-8 only has
|
||||
effect for encoding used for files when 'fileencoding' is empty.
|
||||
|
||||
When 'encoding' is set to a Unicode encoding, and 'fileencodings' was
|
||||
not set yet, the default for 'fileencodings' is changed.
|
||||
|
||||
*'endofline'* *'eol'* *'noendofline'* *'noeol'*
|
||||
'endofline' 'eol' boolean (default on)
|
||||
local to buffer
|
||||
When writing a file and this option is off and the 'binary' option
|
||||
is on, no <EOL> will be written for the last line in the file. This
|
||||
option is automatically set when starting to edit a new file, unless
|
||||
the file does not have an <EOL> for the last line in the file, in
|
||||
which case it is reset. Normally you don't have to set or reset this
|
||||
option. When 'binary' is off the value is not used when writing the
|
||||
file. When 'binary' is on it is used to remember the presence of a
|
||||
<EOL> for the last line in the file, so that when you write the file
|
||||
the situation from the original file can be kept. But you can change
|
||||
it if you want to.
|
||||
is on, or 'fixeol' option is off, no <EOL> will be written for the
|
||||
last line in the file. This option is automatically set or reset when
|
||||
starting to edit a new file, depending on whether file has an <EOL>
|
||||
for the last line in the file. Normally you don't have to set or
|
||||
reset this option.
|
||||
When 'binary' is off and 'fixeol' is on the value is not used when
|
||||
writing the file. When 'binary' is on or 'fixeol' is off it is used
|
||||
to remember the presence of a <EOL> for the last line in the file, so
|
||||
that when you write the file the situation from the original file can
|
||||
be kept. But you can change it if you want to.
|
||||
|
||||
*'equalalways'* *'ea'* *'noequalalways'* *'noea'*
|
||||
'equalalways' 'ea' boolean (default on)
|
||||
@@ -2278,6 +2277,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
<Tab>. Spaces are used in indents with the '>' and '<' commands and
|
||||
when 'autoindent' is on. To insert a real tab when 'expandtab' is
|
||||
on, use CTRL-V<Tab>. See also |:retab| and |ins-expandtab|.
|
||||
This option is reset when the 'paste' option is set and restored when
|
||||
the 'paste' option is reset.
|
||||
|
||||
*'exrc'* *'ex'* *'noexrc'* *'noex'*
|
||||
'exrc' 'ex' boolean (default off)
|
||||
@@ -2343,9 +2344,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
old short name was 'fe', which is no longer used.
|
||||
|
||||
*'fileencodings'* *'fencs'*
|
||||
'fileencodings' 'fencs' string (default: "ucs-bom",
|
||||
"ucs-bom,utf-8,default,latin1" when
|
||||
'encoding' is set to a Unicode value)
|
||||
'fileencodings' 'fencs' string (default: "ucs-bom,utf-8,default,latin1")
|
||||
global
|
||||
{only available when compiled with the |+multi_byte|
|
||||
feature}
|
||||
@@ -2385,9 +2384,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
because Vim cannot detect an error, thus the encoding is always
|
||||
accepted.
|
||||
The special value "default" can be used for the encoding from the
|
||||
environment. This is the default value for 'encoding'. It is useful
|
||||
when 'encoding' is set to "utf-8" and your environment uses a
|
||||
non-latin1 encoding, such as Russian.
|
||||
environment. It is useful when 'encoding' is set to "utf-8" and
|
||||
your environment uses a non-latin1 encoding, such as Russian.
|
||||
When 'encoding' is "utf-8" and a file contains an illegal byte
|
||||
sequence it won't be recognized as UTF-8. You can use the |8g8|
|
||||
command to find the illegal byte sequence.
|
||||
@@ -2402,7 +2400,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
is read.
|
||||
|
||||
*'fileformat'* *'ff'*
|
||||
'fileformat' 'ff' string (MS-DOS and MS-Windows default: "dos",
|
||||
'fileformat' 'ff' string (Windows default: "dos",
|
||||
Unix default: "unix",
|
||||
Macintosh default: "mac")
|
||||
local to buffer
|
||||
@@ -2446,8 +2444,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
2. If a <NL> is found and 'fileformats' includes "unix", 'fileformat'
|
||||
is set to "unix". Note that when a <NL> is found without a
|
||||
preceding <CR>, "unix" is preferred over "dos".
|
||||
3. If 'fileformat' has not yet been set, and if 'fileformats'
|
||||
includes "mac", 'fileformat' is set to "mac".
|
||||
3. If 'fileformat' has not yet been set, and if a <CR> is found, and
|
||||
if 'fileformats' includes "mac", 'fileformat' is set to "mac".
|
||||
This means that "mac" is only chosen when:
|
||||
"unix" is not present or no <NL> is found in the file, and
|
||||
"dos" is not present or no <CR><NL> is found in the file.
|
||||
@@ -2541,6 +2539,17 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
fold:c Folded |hl-Folded|
|
||||
diff:c DiffDelete |hl-DiffDelete|
|
||||
|
||||
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
|
||||
'fixendofline' 'fixeol' boolean (default on)
|
||||
local to buffer
|
||||
{not in Vi}
|
||||
When writing a file and this option is on, <EOL> at the end of file
|
||||
will be restored if missing. Turn this option off if you want to
|
||||
preserve the situation from the original file.
|
||||
When the 'binary' option is set the value of this option doesn't
|
||||
matter.
|
||||
See the 'endofline' option.
|
||||
|
||||
*'fkmap'* *'fk'* *'nofkmap'* *'nofk'*
|
||||
'fkmap' 'fk' boolean (default off) *E198*
|
||||
global
|
||||
@@ -2808,10 +2817,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
written even on filesystems which do metadata-only journaling. This
|
||||
will force the harddrive to spin up on Linux systems running in laptop
|
||||
mode, so it may be undesirable in some situations. Be warned that
|
||||
turning this off increases the chances of data loss after a crash. On
|
||||
systems without an fsync() implementation, this variable is always
|
||||
off.
|
||||
Also see 'swapsync' for controlling fsync() on swap files.
|
||||
turning this off increases the chances of data loss after a crash.
|
||||
|
||||
*'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
|
||||
'gdefault' 'gd' boolean (default off)
|
||||
@@ -2864,14 +2870,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
r-cr:hor20-Cursor/lCursor,
|
||||
sm:block-Cursor
|
||||
-blinkwait175-blinkoff150-blinkon175",
|
||||
for MS-DOS and Win32 console:
|
||||
for Windows console:
|
||||
"n-v-c:block,o:hor50,i-ci:hor15,
|
||||
r-cr:hor30,sm:block")
|
||||
global
|
||||
{only available when compiled with GUI enabled, and
|
||||
for MS-DOS and Win32 console}
|
||||
for Windows console}
|
||||
This option tells Vim what the cursor should look like in different
|
||||
modes. It fully works in the GUI. In an MSDOS or Win32 console, only
|
||||
modes. It fully works in the GUI. In a Windows console, only
|
||||
the height of the cursor can be changed. This can be done by
|
||||
specifying a block cursor, or a percentage for a vertical or
|
||||
horizontal cursor.
|
||||
@@ -2970,28 +2976,18 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
the case of X). The font names given should be "normal" fonts. Vim
|
||||
will try to find the related bold and italic fonts.
|
||||
|
||||
For Win32, GTK, Motif, and Mac OS: >
|
||||
For Win32 and Mac OS: >
|
||||
:set guifont=*
|
||||
< will bring up a font requester, where you can pick the font you want.
|
||||
|
||||
The font name depends on the GUI used. See |setting-guifont| for a
|
||||
way to set 'guifont' for various systems.
|
||||
|
||||
For the GTK+ 2 GUI the font name looks like this: >
|
||||
:set guifont=Andale\ Mono\ 11
|
||||
< That's all. XLFDs are not used. For Chinese this is reported to work
|
||||
well: >
|
||||
if has("gui_gtk2")
|
||||
set guifont=Bitstream\ Vera\ Sans\ Mono\ 12,Fixed\ 12
|
||||
set guifontwide=Microsoft\ Yahei\ 12,WenQuanYi\ Zen\ Hei\ 12
|
||||
endif
|
||||
<
|
||||
For Mac OSX you can use something like this: >
|
||||
:set guifont=Monaco:h10
|
||||
< *E236*
|
||||
Note that the fonts must be mono-spaced (all characters have the same
|
||||
width). An exception is GTK 2: all fonts are accepted, but
|
||||
mono-spaced fonts look best.
|
||||
width).
|
||||
|
||||
To preview a font on X11, you might be able to use the "xfontsel"
|
||||
program. The "xlsfonts" program gives a list of all available fonts.
|
||||
@@ -3024,7 +3020,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
{only available when compiled with GUI enabled and
|
||||
with the |+xfontset| feature}
|
||||
{not available in the GTK+ 2 GUI}
|
||||
When not empty, specifies two (or more) fonts to be used. The first
|
||||
one for normal English, the second one for your special language. See
|
||||
|xfontset|.
|
||||
@@ -3052,24 +3047,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Note: The size of these fonts must be exactly twice as wide as the one
|
||||
specified with 'guifont' and the same height.
|
||||
|
||||
All GUI versions but GTK+ 2:
|
||||
|
||||
'guifontwide' is only used when 'encoding' is set to "utf-8" and
|
||||
'guifontset' is empty or invalid.
|
||||
When 'guifont' is set and a valid font is found in it and
|
||||
'guifontwide' is empty Vim will attempt to find a matching
|
||||
double-width font and set 'guifontwide' to it.
|
||||
|
||||
GTK+ 2 GUI only: *guifontwide_gtk2*
|
||||
|
||||
If set and valid, 'guifontwide' is always used for double width
|
||||
characters, even if 'encoding' is not set to "utf-8".
|
||||
Vim does not attempt to find an appropriate value for 'guifontwide'
|
||||
automatically. If 'guifontwide' is empty Pango/Xft will choose the
|
||||
font for characters not available in 'guifont'. Thus you do not need
|
||||
to set 'guifontwide' at all unless you want to override the choice
|
||||
made by Pango/Xft.
|
||||
|
||||
Windows +multibyte only: *guifontwide_win_mbyte*
|
||||
|
||||
If set and valid, 'guifontwide' is used for IME instead of 'guifont'.
|
||||
@@ -3077,7 +3060,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'guiheadroom'* *'ghr'*
|
||||
'guiheadroom' 'ghr' number (default 50)
|
||||
global
|
||||
{only for GTK and X11 GUI}
|
||||
{only for X11 GUI}
|
||||
The number of pixels subtracted from the screen height when fitting
|
||||
the GUI window on the screen. Set this before the GUI is started,
|
||||
e.g., in your |gvimrc| file. When zero, the whole screen height will
|
||||
@@ -3087,8 +3070,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
screen.
|
||||
|
||||
*'guioptions'* *'go'*
|
||||
'guioptions' 'go' string (default "egmrLT" (MS-Windows),
|
||||
"aegimrLT" (GTK, Motif and Athena))
|
||||
'guioptions' 'go' string (default "egmrLT" (MS-Windows))
|
||||
global
|
||||
{only available when compiled with GUI enabled}
|
||||
This option only has an effect in the GUI version of Vim. It is a
|
||||
@@ -3134,10 +3116,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'guitablabel' can be used to change the text in the labels.
|
||||
When 'e' is missing a non-GUI tab pages line may be used.
|
||||
The GUI tabs are only supported on some systems, currently
|
||||
GTK, Motif, Mac OS/X and MS-Windows.
|
||||
Mac OS/X and MS-Windows.
|
||||
*'go-i'*
|
||||
'i' Use a Vim icon. For GTK with KDE it is used in the left-upper
|
||||
corner of the window.
|
||||
'i' Use a Vim icon.
|
||||
*'go-m'*
|
||||
'm' Menu bar is present.
|
||||
*'go-M'*
|
||||
@@ -3149,10 +3130,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'go-g'*
|
||||
'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.
|
||||
Exception: Athena will always use grey menu items.
|
||||
*'go-T'*
|
||||
'T' Include Toolbar. Currently only in Win32, GTK+, Motif,
|
||||
and Athena GUIs.
|
||||
'T' Include Toolbar. Currently only in Win32 GUI.
|
||||
*'go-r'*
|
||||
'r' Right-hand scrollbar is always present.
|
||||
*'go-R'*
|
||||
@@ -3184,8 +3163,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
the right moment, try adding this flag. This must be done
|
||||
before starting the GUI. Set it in your |gvimrc|. Adding or
|
||||
removing it after the GUI has started has no effect.
|
||||
*'go-F'*
|
||||
'F' Add a footer. Only for Motif. See |gui-footer|.
|
||||
|
||||
|
||||
*'guipty'* *'noguipty'*
|
||||
@@ -3438,54 +3415,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|/ignorecase|.
|
||||
|
||||
*'imactivatefunc'* *'imaf'*
|
||||
'imactivatefunc' 'imaf' string (default "")
|
||||
global
|
||||
{only available when compiled with |+xim| and
|
||||
|+GUI_GTK|}
|
||||
This option specifies a function that will be called to
|
||||
activate/inactivate Input Method.
|
||||
'imactivatefunc' 'imaf' Removed. |vim-differences| {Nvim}
|
||||
|
||||
Example: >
|
||||
function ImActivateFunc(active)
|
||||
if a:active
|
||||
... do something
|
||||
else
|
||||
... do something
|
||||
endif
|
||||
" return value is not used
|
||||
endfunction
|
||||
set imactivatefunc=ImActivateFunc
|
||||
<
|
||||
*'imactivatekey'* *'imak'*
|
||||
'imactivatekey' 'imak' string (default "")
|
||||
global
|
||||
{only available when compiled with |+xim| and
|
||||
|+GUI_GTK|} *E599*
|
||||
Specifies the key that your Input Method in X-Windows uses for
|
||||
activation. When this is specified correctly, vim can fully control
|
||||
IM with 'imcmdline', 'iminsert' and 'imsearch'.
|
||||
You can't use this option to change the activation key, the option
|
||||
tells Vim what the key is.
|
||||
Format:
|
||||
[MODIFIER_FLAG-]KEY_STRING
|
||||
|
||||
These characters can be used for MODIFIER_FLAG (case is ignored):
|
||||
S Shift key
|
||||
L Lock key
|
||||
C Control key
|
||||
1 Mod1 key
|
||||
2 Mod2 key
|
||||
3 Mod3 key
|
||||
4 Mod4 key
|
||||
5 Mod5 key
|
||||
Combinations are allowed, for example "S-C-space" or "SC-space" are
|
||||
both shift+ctrl+space.
|
||||
See <X11/keysymdef.h> and XStringToKeysym for KEY_STRING.
|
||||
|
||||
Example: >
|
||||
:set imactivatekey=S-space
|
||||
< "S-space" means shift+space. This is the activation key for kinput2 +
|
||||
canna (Japanese), and ami (Korean).
|
||||
'imactivatekey' 'imak' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'imcmdline'* *'imc'* *'noimcmdline'* *'noimc'*
|
||||
'imcmdline' 'imc' boolean (default off)
|
||||
@@ -3527,8 +3460,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|i_CTRL-^|.
|
||||
The value is set to 1 when setting 'keymap' to a valid keymap name.
|
||||
It is also used for the argument of commands like "r" and "f".
|
||||
The value 0 may not work correctly with Athena and Motif with some XIM
|
||||
methods. Use 'imdisable' to disable XIM then.
|
||||
|
||||
*'imsearch'* *'ims'*
|
||||
'imsearch' 'ims' number (default 0, 2 when an input method is supported)
|
||||
@@ -3544,25 +3475,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|c_CTRL-^|.
|
||||
The value is set to 1 when it is not -1 and setting the 'keymap'
|
||||
option to a valid keymap name.
|
||||
The value 0 may not work correctly with Athena and Motif with some XIM
|
||||
methods. Use 'imdisable' to disable XIM then.
|
||||
|
||||
*'imstatusfunc'* *'imsf'*
|
||||
'imstatusfunc' 'imsf' string (default "")
|
||||
global
|
||||
{only available when compiled with |+xim| and
|
||||
|+GUI_GTK|}
|
||||
This option specifies a function that is called to obtain the status
|
||||
of Input Method. It must return a positive number when IME is active.
|
||||
|
||||
Example: >
|
||||
function ImStatusFunc()
|
||||
let is_active = ...do something
|
||||
return is_active ? 1 : 0
|
||||
endfunction
|
||||
set imstatusfunc=ImStatusFunc
|
||||
<
|
||||
NOTE: This function is invoked very often. Keep it fast.
|
||||
'imstatusfunc' 'imsf' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'include'* *'inc'*
|
||||
'include' 'inc' string (default "^\s*#\s*include")
|
||||
@@ -3704,7 +3619,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When executing commands with |:normal| 'insertmode' is not used.
|
||||
|
||||
*'isfname'* *'isf'*
|
||||
'isfname' 'isf' string (default for MS-DOS and Win32:
|
||||
'isfname' 'isf' string (default for Windows:
|
||||
"@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,="
|
||||
otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,=")
|
||||
global
|
||||
@@ -3755,7 +3670,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
See |option-backslash| about including spaces and backslashes.
|
||||
|
||||
*'isident'* *'isi'*
|
||||
'isident' 'isi' string (default for MS-DOS and Win32:
|
||||
'isident' 'isi' string (default for Windows:
|
||||
"@,48-57,_,128-167,224-235"
|
||||
otherwise: "@,48-57,_,192-255")
|
||||
global
|
||||
@@ -3770,10 +3685,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
change 'iskeyword' instead.
|
||||
|
||||
*'iskeyword'* *'isk'*
|
||||
'iskeyword' 'isk' string (Vim default for
|
||||
Win32: @,48-57,_,128-167,224-235
|
||||
otherwise: @,48-57,_,192-255
|
||||
Vi default: @,48-57,_)
|
||||
'iskeyword' 'isk' string (default: @,48-57,_,192-255
|
||||
Vi default: @,48-57,_)
|
||||
local to buffer
|
||||
Keywords are used in searching and recognizing with many commands:
|
||||
"w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See
|
||||
@@ -3785,8 +3698,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When the 'lisp' option is on the '-' character is always included.
|
||||
|
||||
*'isprint'* *'isp'*
|
||||
'isprint' 'isp' string (default for MS-DOS, Win32, and Macintosh:
|
||||
"@,~-255"; otherwise: "@,161-255")
|
||||
'isprint' 'isp' string (default: "@,161-255")
|
||||
global
|
||||
The characters given by this option are displayed directly on the
|
||||
screen. It is also used for "\p" in a |pattern|. The characters from
|
||||
@@ -4077,8 +3989,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
conceal:c Character to show in place of concealed text, when
|
||||
'conceallevel' is set to 1. A space when omitted.
|
||||
*lcs-nbsp*
|
||||
nbsp:c Character to show for a non-breakable space (character
|
||||
0xA0, 160). Left blank when omitted.
|
||||
nbsp:c Character to show for a non-breakable space character
|
||||
(0xA0 (160 decimal) and U+202F). Left blank when
|
||||
omitted.
|
||||
|
||||
The characters ':' and ',' should not be used. UTF-8 characters can
|
||||
be used when 'encoding' is "utf-8", otherwise only printable
|
||||
@@ -4381,7 +4294,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The mouse pointer is restored when the mouse is moved.
|
||||
|
||||
*'mousemodel'* *'mousem'*
|
||||
'mousemodel' 'mousem' string (default "extend", "popup" for MS-DOS and Win32)
|
||||
'mousemodel' 'mousem' string (default "extend", "popup" for Windows)
|
||||
global
|
||||
Sets the model to use for the mouse. The name mostly specifies what
|
||||
the right mouse button is used for:
|
||||
@@ -4483,12 +4396,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'mousetime'* *'mouset'*
|
||||
'mousetime' 'mouset' number (default 500)
|
||||
global
|
||||
Only for GUI, MS-DOS, Win32 and Unix with xterm. Defines the maximum
|
||||
Only for GUI, Windows and Unix with xterm. Defines the maximum
|
||||
time in msec between two mouse clicks for the second click to be
|
||||
recognized as a multi click.
|
||||
|
||||
*'nrformats'* *'nf'*
|
||||
'nrformats' 'nf' string (default "hex")
|
||||
'nrformats' 'nf' string (default "bin,hex")
|
||||
local to buffer
|
||||
This defines what bases Vim will consider for numbers when using the
|
||||
CTRL-A and CTRL-X commands for adding to and subtracting from a number
|
||||
@@ -4501,6 +4414,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
hex If included, numbers starting with "0x" or "0X" will be
|
||||
considered to be hexadecimal. Example: Using CTRL-X on
|
||||
"0x100" results in "0x0ff".
|
||||
bin If included, numbers starting with "0b" or "0B" will be
|
||||
considered to be binary. Example: Using CTRL-X on
|
||||
"0b1000" subtracts one, resulting in "0b0111".
|
||||
Numbers which simply begin with a digit in the range 1-9 are always
|
||||
considered decimal. This also happens for numbers that are not
|
||||
recognized as octal or hex.
|
||||
@@ -4564,11 +4480,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'opendevice'* *'odev'* *'noopendevice'* *'noodev'*
|
||||
'opendevice' 'odev' boolean (default off)
|
||||
global
|
||||
{only for MS-DOS and MS-Windows}
|
||||
{only for Windows}
|
||||
Enable reading and writing from devices. This may get Vim stuck on a
|
||||
device that can be opened but doesn't actually do the I/O. Therefore
|
||||
it is off by default.
|
||||
Note that on MS-Windows editing "aux.h", "lpt1.txt" and the like also
|
||||
Note that on Windows editing "aux.h", "lpt1.txt" and the like also
|
||||
result in editing a device.
|
||||
|
||||
|
||||
@@ -4607,19 +4523,21 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When the 'paste' option is switched on (also when it was already on):
|
||||
- mapping in Insert mode and Command-line mode is disabled
|
||||
- abbreviations are disabled
|
||||
- 'textwidth' is set to 0
|
||||
- 'wrapmargin' is set to 0
|
||||
- 'autoindent' is reset
|
||||
- 'smartindent' is reset
|
||||
- 'softtabstop' is set to 0
|
||||
- 'expandtab' is reset
|
||||
- 'formatoptions' is used like it is empty
|
||||
- 'revins' is reset
|
||||
- 'ruler' is reset
|
||||
- 'showmatch' is reset
|
||||
- 'formatoptions' is used like it is empty
|
||||
- 'smartindent' is reset
|
||||
- 'smarttab' is reset
|
||||
- 'softtabstop' is set to 0
|
||||
- 'textwidth' is set to 0
|
||||
- 'wrapmargin' is set to 0
|
||||
These options keep their value, but their effect is disabled:
|
||||
- 'lisp'
|
||||
- 'indentexpr'
|
||||
- 'cindent'
|
||||
- 'indentexpr'
|
||||
- 'lisp'
|
||||
NOTE: When you start editing another file while the 'paste' option is
|
||||
on, settings from the modelines or autocommands may change the
|
||||
settings again, causing trouble when pasting text. You might want to
|
||||
@@ -4934,18 +4852,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
instead of the number of lines.
|
||||
|
||||
*'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
|
||||
'restorescreen' 'rs' boolean (default on)
|
||||
global
|
||||
{only in Windows 95/NT console version}
|
||||
When set, the screen contents is restored when exiting Vim. This also
|
||||
happens when executing external commands.
|
||||
|
||||
For non-Windows Vim: You can set or reset the 't_ti' and 't_te'
|
||||
options in your vimrc. To disable restoring:
|
||||
set t_ti= t_te=
|
||||
To enable restoring (for an xterm):
|
||||
set t_ti=^[7^[[r^[[?47h t_te=^[[?47l^[8
|
||||
(Where ^[ is an <Esc>, type CTRL-V <Esc> to insert it)
|
||||
'restorescreen' 'rs' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'revins'* *'ri'* *'norevins'* *'nori'*
|
||||
'revins' 'ri' boolean (default off)
|
||||
@@ -4953,7 +4860,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Inserting characters in Insert mode will work backwards. See "typing
|
||||
backwards" |ins-reverse|. This option can be toggled with the CTRL-_
|
||||
command in Insert mode, when 'allowrevins' is set.
|
||||
NOTE: This option is reset when 'paste' is set.
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
|
||||
*'rightleft'* *'rl'* *'norightleft'* *'norl'*
|
||||
'rightleft' 'rl' boolean (default off)
|
||||
@@ -5002,7 +4910,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
separated with a dash.
|
||||
For an empty line "0-1" is shown.
|
||||
For an empty buffer the line number will also be zero: "0,0-1".
|
||||
This option is reset when the 'paste' option is set.
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
If you don't want to see the ruler all the time but want to know where
|
||||
you are, use "g CTRL-G" |g_CTRL-G|.
|
||||
|
||||
@@ -5353,7 +5262,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
r Removable media. The argument is a string (up to the next
|
||||
','). This parameter can be given several times. Each
|
||||
specifies the start of a path for which no marks will be
|
||||
stored. This is to avoid removable media. For MS-DOS you
|
||||
stored. This is to avoid removable media. For Windows you
|
||||
could use "ra:,rb:". You can also use it for temp files,
|
||||
e.g., for Unix: "r/tmp". Case is ignored.
|
||||
*shada-s*
|
||||
@@ -5391,8 +5300,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
*'shell'* *'sh'* *E91*
|
||||
'shell' 'sh' string (default $SHELL or "sh",
|
||||
MS-DOS and Win32: "command.com" or
|
||||
"cmd.exe")
|
||||
Windows: "cmd.exe")
|
||||
global
|
||||
Name of the shell to use for ! and :! commands. When changing the
|
||||
value also check these options: 'shellpipe', 'shellslash'
|
||||
@@ -5403,27 +5311,50 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
If the name of the shell contains a space, you might need to enclose
|
||||
it in quotes. Example: >
|
||||
:set shell=\"c:\program\ files\unix\sh.exe\"\ -f
|
||||
< Note the backslash before each quote (to avoid starting a comment) and
|
||||
each space (to avoid ending the option value). Also note that the
|
||||
"-f" is not inside the quotes, because it is not part of the command
|
||||
name. And Vim automagically recognizes the backslashes that are path
|
||||
separators.
|
||||
< Note the backslash before each quote (to avoid starting a comment) and
|
||||
each space (to avoid ending the option value), so better use |:let-&|
|
||||
like this: >
|
||||
:let &shell='"C:\Program Files\unix\sh.exe" -f'
|
||||
< Also note that the "-f" is not inside the quotes, because it is not
|
||||
part of the command name.
|
||||
*shell-unquoting*
|
||||
Rules regarding quotes:
|
||||
1. Option is split on space and tab characters that are not inside
|
||||
quotes: "abc def" runs shell named "abc" with additional argument
|
||||
"def", '"abc def"' runs shell named "abc def" with no additional
|
||||
arguments (here and below: additional means “additional to
|
||||
'shellcmdflag'”).
|
||||
2. Quotes in option may be present in any position and any number:
|
||||
'"abc"', '"a"bc', 'a"b"c', 'ab"c"' and '"a"b"c"' are all equivalent
|
||||
to just "abc".
|
||||
3. Inside quotes backslash preceding backslash means one backslash.
|
||||
Backslash preceding quote means one quote. Backslash preceding
|
||||
anything else means backslash and next character literally:
|
||||
'"a\\b"' is the same as "a\b", '"a\\"b"' runs shell named literally
|
||||
'a"b', '"a\b"' is the same as "a\b" again.
|
||||
4. Outside of quotes backslash always means itself, it cannot be used
|
||||
to escape quote: 'a\"b"' is the same as "a\b".
|
||||
Note that such processing is done after |:set| did its own round of
|
||||
unescaping, so to keep yourself sane use |:let-&| like shown above.
|
||||
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'shellcmdflag'* *'shcf'*
|
||||
'shellcmdflag' 'shcf' string (default: "-c";
|
||||
MS-DOS and Win32, when 'shell' does not
|
||||
Windows, when 'shell' does not
|
||||
contain "sh" somewhere: "/c")
|
||||
global
|
||||
Flag passed to the shell to execute "!" and ":!" commands; e.g.,
|
||||
"bash.exe -c ls" or "command.com /c dir". For the MS-DOS-like
|
||||
"bash.exe -c ls" or "cmd.exe /c dir". For Windows
|
||||
systems, the default is set according to the value of 'shell', to
|
||||
reduce the need to set this option by the user.
|
||||
On Unix it can have more than one flag. Each white space separated
|
||||
part is passed as an argument to the shell command.
|
||||
See |option-backslash| about including spaces and backslashes.
|
||||
Also see |dos-shell| for MS-DOS and MS-Windows.
|
||||
See |shell-unquoting| which talks about separating this option into
|
||||
multiple arguments.
|
||||
Also see |dos-shell| for Windows.
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
@@ -5438,7 +5369,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
The name of the temporary file can be represented by "%s" if necessary
|
||||
(the file name is appended automatically if no %s appears in the value
|
||||
of this option).
|
||||
For MS-DOS the default is ">". The output is directly saved in a file
|
||||
For Windows the default is ">". The output is directly saved in a file
|
||||
and not echoed to the screen.
|
||||
For Unix the default it "| tee". The stdout of the compiler is saved
|
||||
in a file and echoed to the screen. If the 'shell' option is "csh" or
|
||||
@@ -5462,7 +5393,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
security reasons.
|
||||
|
||||
*'shellquote'* *'shq'*
|
||||
'shellquote' 'shq' string (default: ""; MS-DOS and Win32, when 'shell'
|
||||
'shellquote' 'shq' string (default: ""; Windows, when 'shell'
|
||||
contains "sh" somewhere: "\"")
|
||||
global
|
||||
Quoting character(s), put around the command passed to the shell, for
|
||||
@@ -5470,7 +5401,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
quoting. See 'shellxquote' to include the redirection. It's
|
||||
probably not useful to set both options.
|
||||
This is an empty string by default. Only known to be useful for
|
||||
third-party shells on MS-DOS-like systems, such as the MKS Korn Shell
|
||||
third-party shells on Windows systems, such as the MKS Korn Shell
|
||||
or bash, where it should be "\"". The default is adjusted according
|
||||
the value of 'shell', to reduce the need to set this option by the
|
||||
user. See |dos-shell|.
|
||||
@@ -5535,7 +5466,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
*'shellxescape'* *'sxe'*
|
||||
'shellxescape' 'sxe' string (default: "";
|
||||
for MS-DOS and MS-Windows: "\"&|<>()@^")
|
||||
for Windows: "\"&|<>()@^")
|
||||
global
|
||||
When 'shellxquote' is set to "(" then the characters listed in this
|
||||
option will be escaped with a '^' character. This makes it possible
|
||||
@@ -5617,6 +5548,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
c don't give |ins-completion-menu| messages. For example,
|
||||
"-- XXX completion (YYY)", "match 1 of 2", "The only match",
|
||||
"Pattern not found", "Back at original", etc.
|
||||
q use "recording" instead of "recording @a"
|
||||
F don't give the file info when editing a file, like `:silent`
|
||||
was used for the command
|
||||
|
||||
This gives you the opportunity to avoid that a change between buffers
|
||||
requires you to hit <Enter>, but still gives as useful a message as
|
||||
@@ -5685,7 +5619,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
jump is only done if the match can be seen on the screen. The time to
|
||||
show the match can be set with 'matchtime'.
|
||||
A Beep is given if there is no match (no matter if the match can be
|
||||
seen or not). This option is reset when the 'paste' option is set.
|
||||
seen or not).
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
When the 'm' flag is not included in 'cpoptions', typing a character
|
||||
will immediately move the cursor back to where it belongs.
|
||||
See the "sm" field in 'guicursor' for setting the cursor shape and
|
||||
@@ -5704,8 +5640,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Use the 'M' flag in 'highlight' to set the type of highlighting for
|
||||
this message.
|
||||
When |XIM| may be used the message will include "XIM". But this
|
||||
doesn't mean XIM is really active, especially when 'imactivatekey' is
|
||||
not set.
|
||||
doesn't mean XIM is really active.
|
||||
|
||||
*'showtabline'* *'stal'*
|
||||
'showtabline' 'stal' number (default 1)
|
||||
@@ -5785,7 +5720,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H.
|
||||
When using the ">>" command, lines starting with '#' are not shifted
|
||||
right.
|
||||
NOTE: When 'paste' is set smart indenting is disabled.
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
|
||||
*'smarttab'* *'sta'* *'nosmarttab'* *'nosta'*
|
||||
'smarttab' 'sta' boolean (default on)
|
||||
@@ -5800,6 +5736,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
What gets inserted (a <Tab> or spaces) depends on the 'expandtab'
|
||||
option. Also see |ins-expandtab|. When 'expandtab' is not set, the
|
||||
number of spaces is minimized by using <Tab>s.
|
||||
This option is reset when 'paste' is set and restored when 'paste' is
|
||||
reset.
|
||||
|
||||
*'softtabstop'* *'sts'*
|
||||
'softtabstop' 'sts' number (default 0)
|
||||
@@ -5812,7 +5750,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
commands like "x" still work on the actual characters.
|
||||
When 'sts' is zero, this feature is off.
|
||||
When 'sts' is negative, the value of 'shiftwidth' is used.
|
||||
'softtabstop' is set to 0 when the 'paste' option is set.
|
||||
'softtabstop' is set to 0 when the 'paste' option is set and restored
|
||||
when 'paste' is reset.
|
||||
See also |ins-expandtab|. When 'expandtab' is not set, the number of
|
||||
spaces is minimized by using <Tab>s.
|
||||
The 'L' flag in 'cpoptions' changes how tabs are used when 'list' is
|
||||
@@ -6090,11 +6029,39 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
( - Start of item group. Can be used for setting the width and
|
||||
alignment of a section. Must be followed by %) somewhere.
|
||||
) - End of item group. No width fields allowed.
|
||||
T N For 'tabline': start of tab page N label. Use %T after the last
|
||||
label. This information is used for mouse clicks.
|
||||
X N For 'tabline': start of close tab N label. Use %X after the
|
||||
label, e.g.: %3Xclose%X. Use %999X for a "close current tab"
|
||||
mark. This information is used for mouse clicks.
|
||||
T N For 'tabline': start of tab page N label. Use %T or %X to end
|
||||
the label. Clicking this label with left mouse button switches
|
||||
to the specified tab page.
|
||||
X N For 'tabline': start of close tab N label. Use %X or %T to end
|
||||
the label, e.g.: %3Xclose%X. Use %999X for a "close current
|
||||
tab" label. Clicking this label with left mouse button closes
|
||||
specified tab page.
|
||||
@ N For 'tabline': start of execute function label. Use %X or %T to
|
||||
end the label, e.g.: %10@SwitchBuffer@foo.c%X. Clicking this
|
||||
label runs specified function: in the example when clicking once
|
||||
using left mouse button on "foo.c" "SwitchBuffer(10, 1, 'l',
|
||||
' ')" expression will be run. Function receives the
|
||||
following arguments in order:
|
||||
1. minwid field value or zero if no N was specified
|
||||
2. number of mouse clicks to detect multiple clicks
|
||||
3. mouse button used: "l", "r" or "m" for left, right or middle
|
||||
button respectively; one should not rely on third argument
|
||||
being only "l", "r" or "m": any other non-empty string value
|
||||
that contains only ASCII lower case letters may be expected
|
||||
for other mouse buttons
|
||||
4. modifiers pressed: string which contains "s" if shift
|
||||
modifier was pressed, "c" for control, "a" for alt and "m"
|
||||
for meta; currently if modifier is not pressed string
|
||||
contains space instead, but one should not rely on presence
|
||||
of spaces or specific order of modifiers: use |stridx()| to
|
||||
test whether some modifier is present; string is guaranteed
|
||||
to contain only ASCII letters and spaces, one letter per
|
||||
modifier; "?" modifier may also be present, but its presence
|
||||
is a bug that denotes that new mouse button recognition was
|
||||
added without modifying code that reacts on mouse clicks on
|
||||
this label.
|
||||
Note: to test whether your version of Neovim contains this
|
||||
feature use `has('tablineat')`.
|
||||
< - Where to truncate line if too long. Default is at the start.
|
||||
No width fields allowed.
|
||||
= - Separation point between left and right aligned items.
|
||||
@@ -6201,7 +6168,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When 'swapfile' is reset, the swap file for the current buffer is
|
||||
immediately deleted. When 'swapfile' is set, and 'updatecount' is
|
||||
non-zero, a swap file is immediately created.
|
||||
Also see |swap-file| and |'swapsync'|.
|
||||
Also see |swap-file|.
|
||||
If you want to open a new buffer without creating a swap file for it,
|
||||
use the |:noswapfile| modifier.
|
||||
|
||||
@@ -6209,18 +6176,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
specify special kinds of buffers. See |special-buffers|.
|
||||
|
||||
*'swapsync'* *'sws'*
|
||||
'swapsync' 'sws' string (default "fsync")
|
||||
global
|
||||
When this option is not empty a swap file is synced to disk after
|
||||
writing to it. This takes some time, especially on busy unix systems.
|
||||
When this option is empty parts of the swap file may be in memory and
|
||||
not written to disk. When the system crashes you may lose more work.
|
||||
On Unix the system does a sync now and then without Vim asking for it,
|
||||
so the disadvantage of setting this option off is small. On some
|
||||
systems the swap file will not be written at all. For a unix system
|
||||
setting it to "sync" will use the sync() call instead of the default
|
||||
fsync(), which may work better on some systems.
|
||||
The 'fsync' option is used for the actual file.
|
||||
'swapsync' 'sws' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'switchbuf'* *'swb'*
|
||||
'switchbuf' 'swb' string (default "")
|
||||
@@ -6239,6 +6195,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
split If included, split the current window before loading
|
||||
a buffer for a |quickfix| command that display errors.
|
||||
Otherwise: do not split, use current window.
|
||||
vsplit Just like "split" but split vertically.
|
||||
newtab Like "split", but open a new tab page. Overrules
|
||||
"split" when both are present.
|
||||
|
||||
@@ -6432,18 +6389,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
mapping which should not change the tagstack.
|
||||
|
||||
*'term'* *E529* *E530* *E531*
|
||||
'term' string (default is $TERM, if that fails:
|
||||
in the GUI: "builtin_gui"
|
||||
on Mac: "mac-ansi"
|
||||
on MS-DOS: "pcterm"
|
||||
on Unix: "ansi"
|
||||
on Win 32: "win32")
|
||||
global
|
||||
Name of the terminal. Used for choosing the terminal control
|
||||
characters. Environment variables are expanded |:set_env|.
|
||||
For example: >
|
||||
:set term=$TERM
|
||||
< See |termcap|.
|
||||
'term' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'termbidi'* *'tbidi'*
|
||||
*'notermbidi'* *'notbidi'*
|
||||
@@ -6474,8 +6420,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
local to buffer
|
||||
Maximum width of text that is being inserted. A longer line will be
|
||||
broken after white space to get this width. A zero value disables
|
||||
this. 'textwidth' is set to 0 when the 'paste' option is set. When
|
||||
'textwidth' is zero, 'wrapmargin' may be used. See also
|
||||
this.
|
||||
'textwidth' is set to 0 when the 'paste' option is set and restored
|
||||
when 'paste' is reset.
|
||||
When 'textwidth' is zero, 'wrapmargin' may be used. See also
|
||||
'formatoptions' and |ins-textwidth|.
|
||||
When 'formatexpr' is set it will be used to break the line.
|
||||
|
||||
@@ -6623,9 +6571,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'ttyscroll' 'tsl' Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'ttytype'* *'tty'*
|
||||
'ttytype' 'tty' string (default from $TERM)
|
||||
global
|
||||
Alias for 'term', see above.
|
||||
'ttytype' 'tty' Alias for 'term'. Removed. |vim-differences| {Nvim}
|
||||
|
||||
*'undodir'* *'udir'* *E926*
|
||||
'undodir' 'udir' string (default "$XDG_DATA_HOME/nvim/undo")
|
||||
@@ -6707,7 +6653,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
When 'updatecount' is set from zero to non-zero, swap files are
|
||||
created for all buffers that have 'swapfile' set. When 'updatecount'
|
||||
is set to zero, existing swap files are not deleted.
|
||||
Also see |'swapsync'|.
|
||||
This option has no meaning in buffers where |'buftype'| is "nofile"
|
||||
or "nowrite".
|
||||
|
||||
@@ -7011,7 +6956,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'winaltkeys'* *'wak'*
|
||||
'winaltkeys' 'wak' string (default "menu")
|
||||
global
|
||||
{only used in Win32, Motif, and GTK}
|
||||
{only used in Win32}
|
||||
Some GUI versions allow the access to menu entries by using the ALT
|
||||
key in combination with a character that appears underlined in the
|
||||
menu. This conflicts with the use of the ALT key for mappings and
|
||||
@@ -7026,8 +6971,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
keys can be mapped.
|
||||
If the menu is disabled by excluding 'm' from 'guioptions', the ALT
|
||||
key is never used for the menu.
|
||||
This option is not used for <F10>; on Win32 and with GTK <F10> will
|
||||
select the menu, unless it has been mapped.
|
||||
This option is not used for <F10>; on Win32.
|
||||
|
||||
*'window'* *'wi'*
|
||||
'window' 'wi' number (default screen height - 1)
|
||||
@@ -7195,6 +7139,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
The number of microseconds to wait for each character sent to the
|
||||
screen. When non-zero, characters are sent to the terminal one by
|
||||
one. For MS-DOS pcterm this does not work. For debugging purposes.
|
||||
one. For debugging purposes.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:noet:norl:
|
||||
|
@@ -1,292 +0,0 @@
|
||||
*os_dos.txt* For Vim version 7.4. Last change: 2006 Mar 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
*dos* *DOS*
|
||||
This file documents some particularities of the Win32
|
||||
version of Vim. Also see |os_win32.txt|.
|
||||
|
||||
1. File locations |dos-locations|
|
||||
2. Using backslashes |dos-backslash|
|
||||
3. Standard mappings |dos-standard-mappings|
|
||||
4. Screen output and colors |dos-colors|
|
||||
5. File formats |dos-file-formats|
|
||||
6. :cd command |dos-:cd|
|
||||
7. Interrupting |dos-CTRL-Break|
|
||||
8. Temp files |dos-temp-files|
|
||||
9. Shell option default |dos-shell|
|
||||
|
||||
==============================================================================
|
||||
1. File locations *dos-locations*
|
||||
|
||||
If you keep the Vim executable in the directory that contains the help and
|
||||
syntax subdirectories, there is no need to do anything special for Vim to
|
||||
work. No registry entries or environment variables need to be set. Just make
|
||||
sure that the directory is in your search path, or use a shortcut on the
|
||||
desktop.
|
||||
|
||||
Your vimrc files ("_vimrc" and "_gvimrc") are normally located one directory
|
||||
up from the runtime files. If you want to put them somewhere else, set the
|
||||
environment variable $VIM to the directory where you keep them. Example: >
|
||||
set VIM=C:\user\piet
|
||||
Will find "c:\user\piet\_vimrc".
|
||||
Note: This would only be needed when the computer is used by several people.
|
||||
Otherwise it's simpler to keep your _vimrc file in the default place.
|
||||
|
||||
If you move the executable to another location, you also need to set the $VIM
|
||||
environment variable. The runtime files will be found in "$VIM/vim{version}".
|
||||
Example: >
|
||||
set VIM=E:\vim
|
||||
Will find the version 5.4 runtime files in "e:\vim\vim54".
|
||||
Note: This is _not_ recommended. The preferred way is to keep the executable
|
||||
in the runtime directory.
|
||||
|
||||
If you move your executable AND want to put your "_vimrc" and "_gvimrc" files
|
||||
somewhere else, you must set $VIM to where you vimrc files are, and set
|
||||
$VIMRUNTIME to the runtime files. Example: >
|
||||
set VIM=C:\usr\piet
|
||||
set VIMRUNTIME=E:\vim\vim54
|
||||
Will find "c:\user\piet\_vimrc" and the runtime files in "e:\vim\vim54".
|
||||
|
||||
See |$VIM| and |$VIMRUNTIME| for more information.
|
||||
|
||||
Under Windows 95, you can set $VIM in your C:\autoexec.bat file. For
|
||||
example: >
|
||||
set VIM=D:\vim
|
||||
Under Windows NT, you can set environment variables for each user separately
|
||||
under "Start/Settings/Control Panel->System", or through the properties in the
|
||||
menu of "My Computer", under the Environment Tab.
|
||||
|
||||
==============================================================================
|
||||
2. Using backslashes *dos-backslash*
|
||||
|
||||
Using backslashes in file names can be a problem. Vi halves the number of
|
||||
backslashes for some commands. Vim is a bit more tolerant and does not remove
|
||||
backslashes from a file name, so ":e c:\foo\bar" works as expected. But when
|
||||
a backslash occurs before a special character (space, comma, backslash, etc.),
|
||||
Vim removes the backslash. Use slashes to avoid problems: ":e c:/foo/bar"
|
||||
works fine. Vim replaces the slashes with backslashes internally to avoid
|
||||
problems with some MS-DOS programs and Win32 programs.
|
||||
|
||||
When you prefer to use forward slashes, set the 'shellslash' option. Vim will
|
||||
then replace backslashes with forward slashes when expanding file names. This
|
||||
is especially useful when using a Unix-like 'shell'.
|
||||
|
||||
==============================================================================
|
||||
3. Standard mappings *dos-standard-mappings*
|
||||
|
||||
The mappings for CTRL-PageUp and CTRL-PageDown have been removed, they now
|
||||
jump to the next or previous tab page |<C-PageUp>| |<C-PageDown>|
|
||||
|
||||
If you want them to move to the first and last screen line you can use these
|
||||
mappings:
|
||||
|
||||
key key code Normal/Visual mode Insert mode ~
|
||||
CTRL-PageUp <M-N><M-C-D> H <C-O>H
|
||||
CTRL-PageDown <M-N>v L$ <C-O>L<C-O>$
|
||||
|
||||
Additionally, these keys are available for copy/cut/paste.
|
||||
In the Win32 version, they also use the clipboard.
|
||||
|
||||
Shift-Insert paste text (from clipboard) *<S-Insert>*
|
||||
CTRL-Insert copy Visual text (to clipboard) *<C-Insert>*
|
||||
CTRL-Del cut Visual text (to clipboard) *<C-Del>*
|
||||
Shift-Del cut Visual text (to clipboard) *<S-Del>*
|
||||
|
||||
These mappings accomplish this (Win32 version of Vim):
|
||||
|
||||
key key code Normal Visual Insert ~
|
||||
Shift-Insert <M-N><M-T> "*P "-d"*P <C-R><C-O>*
|
||||
CTRL-Insert <M-N><M-U> "*y
|
||||
Shift-Del <M-N><M-W> "*d
|
||||
CTRL-Del <M-N><M-X> "*d
|
||||
|
||||
Or these mappings (non-Win32 version of Vim):
|
||||
|
||||
key key code Normal Visual Insert ~
|
||||
Shift-Insert <M-N><M-T> P "-dP <C-R><C-O>"
|
||||
CTRL-Insert <M-N><M-U> y
|
||||
Shift-Del <M-N><M-W> d
|
||||
CTRL-Del <M-N><M-X> d
|
||||
|
||||
When the clipboard is supported, the "* register is used.
|
||||
|
||||
==============================================================================
|
||||
4. Screen output and colors *dos-colors*
|
||||
|
||||
The default output method for the screen is to use bios calls. This works
|
||||
right away on most systems. You do not need ansi.sys. You can use ":mode" to
|
||||
set the current screen mode. See |:mode|.
|
||||
|
||||
To change the screen colors that Vim uses, you can use the |:highlight|
|
||||
command. The Normal highlight group specifies the colors Vim uses for normal
|
||||
text. For example, to get grey text on a blue background: >
|
||||
:hi Normal ctermbg=Blue ctermfg=grey
|
||||
See |highlight-groups| for other groups that are available.
|
||||
|
||||
A DOS console does not support attributes like bold and underlining. You can
|
||||
set the color used in five modes with nine terminal options. Note that this
|
||||
is not necessary since you can set the color directly with the ":highlight"
|
||||
command; these options are for backward compatibility with older Vim versions.
|
||||
The |'highlight'| option specifies which of the five modes is used for which
|
||||
action. >
|
||||
|
||||
:set t_mr=^V^[\|xxm start of invert mode
|
||||
:set t_md=^V^[\|xxm start of bold mode
|
||||
:set t_me=^V^[\|xxm back to normal text
|
||||
|
||||
:set t_so=^V^[\|xxm start of standout mode
|
||||
:set t_se=^V^[\|xxm back to normal text
|
||||
|
||||
:set t_us=^V^[\|xxm start of underline mode
|
||||
:set t_ue=^V^[\|xxm back to normal text
|
||||
|
||||
:set t_ZH=^V^[\|xxm start of italics mode
|
||||
:set t_ZR=^V^[\|xxm back to normal text
|
||||
|
||||
^V is CTRL-V
|
||||
^[ is <Esc>
|
||||
You must replace xx with a decimal code, which is the foreground color number
|
||||
and background color number added together:
|
||||
|
||||
COLOR FOREGROUND BACKGROUND ~
|
||||
Black 0 0
|
||||
DarkBlue 1 16
|
||||
DarkGreen 2 32
|
||||
DarkCyan 3 48
|
||||
DarkRed 4 64
|
||||
DarkMagenta 5 80
|
||||
Brown, DarkYellow 6 96
|
||||
LightGray 7 112
|
||||
DarkGray 8 128 *
|
||||
Blue, LightBlue 9 144 *
|
||||
Green, LightGreen 10 160 *
|
||||
Cyan, LightCyan 11 176 *
|
||||
Red, LightRed 12 192 *
|
||||
Magenta, LightMagenta 13 208 *
|
||||
Yellow, LightYellow 14 224 *
|
||||
White 15 240 *
|
||||
|
||||
* Depending on the display mode, the color codes above 128 may not be
|
||||
available, and code 128 will make the text blink.
|
||||
|
||||
When you use 0, the color is reset to the one used when you started Vim
|
||||
(usually 7, lightgray on black, but you can override this. If you have
|
||||
overridden the default colors in a command prompt, you may need to adjust
|
||||
some of the highlight colors in your vimrc---see below).
|
||||
This is the default for t_me.
|
||||
|
||||
The defaults for the various highlight modes are:
|
||||
t_mr 112 reverse mode: Black text (0) on LightGray (112)
|
||||
t_md 15 bold mode: White text (15) on Black (0)
|
||||
t_me 0 normal mode (revert to default)
|
||||
|
||||
t_so 31 standout mode: White (15) text on DarkBlue (16)
|
||||
t_se 0 standout mode end (revert to default)
|
||||
|
||||
t_czh 225 italic mode: DarkBlue text (1) on Yellow (224)
|
||||
t_czr 0 italic mode end (revert to default)
|
||||
|
||||
t_us 67 underline mode: DarkCyan text (3) on DarkRed (64)
|
||||
t_ue 0 underline mode end (revert to default)
|
||||
|
||||
These colors were chosen because they also look good when using an inverted
|
||||
display, but you can change them to your liking.
|
||||
|
||||
Example: >
|
||||
:set t_mr=^V^[\|97m " start of invert mode: DarkBlue (1) on Brown (96)
|
||||
:set t_md=^V^[\|67m " start of bold mode: DarkCyan (3) on DarkRed (64)
|
||||
:set t_me=^V^[\|112m " back to normal mode: Black (0) on LightGray (112)
|
||||
|
||||
:set t_so=^V^[\|37m " start of standout mode: DarkMagenta (5) on DarkGreen
|
||||
(32)
|
||||
:set t_se=^V^[\|112m " back to normal mode: Black (0) on LightGray (112)
|
||||
|
||||
==============================================================================
|
||||
5. File formats *dos-file-formats*
|
||||
|
||||
If the 'fileformat' option is set to "dos" (which is the default), Vim accepts
|
||||
a single <NL> or a <CR><NL> pair for end-of-line (<EOL>). When writing a
|
||||
file, Vim uses <CR><NL>. Thus, if you edit a file and write it, Vim replaces
|
||||
<NL> with <CR><NL>.
|
||||
|
||||
If the 'fileformat' option is set to "unix", Vim uses a single <NL> for <EOL>
|
||||
and shows <CR> as ^M.
|
||||
|
||||
You can use Vim to replace <NL> with <CR><NL> by reading in any mode and
|
||||
writing in Dos mode (":se ff=dos").
|
||||
You can use Vim to replace <CR><NL> with <NL> by reading in Dos mode and
|
||||
writing in Unix mode (":se ff=unix").
|
||||
|
||||
Vim sets 'fileformat' automatically when 'fileformats' is not empty (which is
|
||||
the default), so you don't really have to worry about what you are doing.
|
||||
|'fileformat'| |'fileformats'|
|
||||
|
||||
If you want to edit a script file or a binary file, you should set the
|
||||
'binary' option before loading the file. Script files and binary files may
|
||||
contain single <NL> characters which Vim would replace with <CR><NL>. You can
|
||||
set 'binary' automatically by starting Vim with the "-b" (binary) option.
|
||||
|
||||
==============================================================================
|
||||
6. :cd command *dos-:cd*
|
||||
|
||||
The ":cd" command recognizes the drive specifier and changes the current
|
||||
drive. Use ":cd c:" to make drive C the active drive. Use ":cd d:\foo" to go
|
||||
to the directory "foo" in the root of drive D. Vim also recognizes UNC names
|
||||
if the system supports them; e.g., ":cd \\server\share\dir". |:cd|
|
||||
|
||||
==============================================================================
|
||||
7. Interrupting *dos-CTRL-Break*
|
||||
|
||||
Use CTRL-Break instead of CTRL-C to interrupt searches. Vim does not detect
|
||||
the CTRL-C until it tries to read a key.
|
||||
|
||||
==============================================================================
|
||||
8. Temp files *dos-temp-files*
|
||||
|
||||
Only for the 16 bit and 32 bit DOS version:
|
||||
Vim puts temporary files (for filtering) in the first of these directories
|
||||
that exists and in which Vim can create a file:
|
||||
$TMP
|
||||
$TEMP
|
||||
C:\TMP
|
||||
C:\TEMP
|
||||
current directory
|
||||
|
||||
For the Win32 version (both console and GUI):
|
||||
Vim uses standard Windows functions to obtain a temporary file name (for
|
||||
filtering). The first of these directories that exists and in which Vim can
|
||||
create a file is used:
|
||||
$TMP
|
||||
$TEMP
|
||||
current directory
|
||||
|
||||
==============================================================================
|
||||
9. Shell option default *dos-shell*
|
||||
|
||||
The default for the 'sh' ('shell') option is "command.com" on Windows 95 and
|
||||
"cmd.exe" on Windows NT. If SHELL is defined, Vim uses SHELL instead, and if
|
||||
SHELL is not defined but COMSPEC is, Vim uses COMSPEC. Vim starts external
|
||||
commands with "<shell> /c <command_name>". Typing CTRL-Z starts a new command
|
||||
subshell. Return to Vim with "exit". |'shell'| |CTRL-Z|
|
||||
|
||||
If you are running a third-party shell, you may need to set the
|
||||
|'shellcmdflag'| ('shcf') and |'shellquote'| ('shq') or |'shellxquote'|
|
||||
('sxq') options. Unfortunately, this also depends on the version of Vim used.
|
||||
For example, with the MKS Korn shell or with bash, the values of the options
|
||||
on Win32 should be:
|
||||
|
||||
'shellcmdflag' -c
|
||||
'shellquote' (empty)
|
||||
'shellxquote' "
|
||||
|
||||
For Win32, this starts the shell as:
|
||||
<shell> -c "command name >file"
|
||||
|
||||
When starting up, Vim checks for the presence of "sh" anywhere in the 'shell'
|
||||
option. If it is present, Vim sets the 'shellcmdflag' and 'shellquote' or
|
||||
'shellxquote' options will be set as described above.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
@@ -7,17 +7,15 @@
|
||||
*win32* *Win32* *MS-Windows*
|
||||
This file documents the idiosyncrasies of the Win32 version of Vim.
|
||||
|
||||
The Win32 version of Vim works on Windows NT, XP, Vista and Windows 7.
|
||||
The Win32 version of Vim works on Windows XP, Vista and Windows 7.
|
||||
There are both console and GUI versions.
|
||||
|
||||
The 32 bit version also runs on 64 bit MS-Windows systems.
|
||||
|
||||
1. Known problems |win32-problems|
|
||||
2. Startup |win32-startup|
|
||||
3. Restore screen contents |win32-restore|
|
||||
4. Using the mouse |win32-mouse|
|
||||
5. Running under Windows 3.1 |win32-win3.1|
|
||||
6. Win32 mini FAQ |win32-faq|
|
||||
3. Using the mouse |win32-mouse|
|
||||
4. Win32 mini FAQ |win32-faq|
|
||||
|
||||
Additionally, there are a number of common Win32 and DOS items:
|
||||
File locations |dos-locations|
|
||||
@@ -34,7 +32,6 @@ Win32 GUI |gui-w32|
|
||||
|
||||
Credits:
|
||||
The Win32 version was written by George V. Reilly <george@reilly.org>.
|
||||
The original Windows NT port was done by Roger Knobbe <RogerK@wonderware.com>.
|
||||
The GUI version was made by George V. Reilly and Robert Webb.
|
||||
|
||||
==============================================================================
|
||||
@@ -79,14 +76,7 @@ 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.
|
||||
|
||||
==============================================================================
|
||||
3. Restore screen contents *win32-restore*
|
||||
|
||||
When 'restorescreen' is set (which is the default), Vim will restore the
|
||||
original contents of the console when exiting or when executing external
|
||||
commands. If you don't want this, use ":set nors". |'restorescreen'|
|
||||
|
||||
==============================================================================
|
||||
4. Using the mouse *win32-mouse*
|
||||
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
|
||||
@@ -98,35 +88,7 @@ When the mouse doesn't work, try disabling the "Quick Edit Mode" feature of
|
||||
the console.
|
||||
|
||||
==============================================================================
|
||||
5. Running under Windows 3.1 *win32-win3.1*
|
||||
|
||||
*win32s* *windows-3.1*
|
||||
There is a special version of Gvim that runs under Windows 3.1 and 3.11. You
|
||||
need the gvim.exe that was compiled with Visual C++ 4.1.
|
||||
|
||||
To run the Win32 version under Windows 3.1, you need to install Win32s. You
|
||||
might have it already from another Win32 application which you have installed.
|
||||
If Vim doesn't seem to be running properly, get the latest version: 1.30c.
|
||||
You can find it at:
|
||||
|
||||
http://support.microsoft.com/download/support/mslfiles/pw1118.exe
|
||||
|
||||
(Microsoft moved it again, we don't know where it is now :-( ).
|
||||
|
||||
The reason for having two versions of gvim.exe is that the Win32s version was
|
||||
compiled with VC++ 4.1. This is the last version of VC++ that supports Win32s
|
||||
programs. VC++ 5.0 is better, so that one was used for the Win32 version.
|
||||
Apart from that, there is no difference between the programs. If you are in a
|
||||
mixed environment, you can use the gvim.exe for Win32s on both.
|
||||
|
||||
The Win32s version works the same way as the Win32 version under 95/NT. When
|
||||
running under Win32s the following differences apply:
|
||||
- You cannot use long file names, because Windows 3.1 doesn't support them!
|
||||
- When executing an external command, it doesn't return an exit code. After
|
||||
doing ":make" you have to do ":cn" yourself.
|
||||
|
||||
==============================================================================
|
||||
6. Win32 mini FAQ *win32-faq*
|
||||
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: >
|
||||
@@ -134,14 +96,6 @@ A. In the GUI version, you can use the 'guifont' option. Example: >
|
||||
< In the console version, you need to set the font of the console itself.
|
||||
You cannot do this from within Vim.
|
||||
|
||||
Q. How do I type dead keys on Windows NT?
|
||||
A. Dead keys work on NT 3.51. Just type them as you would in any other
|
||||
application.
|
||||
On NT 4.0, you need to make sure that the default locale (set in the
|
||||
Keyboard part of the Control Panel) is the same as the currently active
|
||||
locale. Otherwise the NT code will get confused and crash! This is a NT
|
||||
4.0 problem, not really a Vim problem.
|
||||
|
||||
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?
|
||||
@@ -176,28 +130,6 @@ A. Basically what you need is to put a tee program that will copy its input
|
||||
:set shellpipe=\|\ tee
|
||||
< to your _vimrc.
|
||||
|
||||
Q. I'm storing files on a remote machine that works with VisionFS, and files
|
||||
disappear!
|
||||
A. VisionFS can't handle certain dot (.) three letter extension file names.
|
||||
SCO declares this behavior required for backwards compatibility with 16bit
|
||||
DOS/Windows environments. The two commands below demonstrate the behavior:
|
||||
>
|
||||
echo Hello > file.bat~
|
||||
dir > file.bat
|
||||
<
|
||||
The result is that the "dir" command updates the "file.bat~" file, instead
|
||||
of creating a new "file.bat" file. This same behavior is exhibited in Vim
|
||||
when editing an existing file named "foo.bat" because the default behavior
|
||||
of Vim is to create a temporary file with a '~' character appended to the
|
||||
name. When the file is written, it winds up being deleted.
|
||||
|
||||
Solution: Add this command to your _vimrc file: >
|
||||
:set backupext=.temporary
|
||||
|
||||
Q. How do I change the blink rate of the cursor?
|
||||
A. You can't! This is a limitation of the NT console. NT 5.0 is reported to
|
||||
be able to set the blink rate for all console windows at the same time.
|
||||
|
||||
*:!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": >
|
||||
@@ -240,28 +172,6 @@ A. You have two possible solutions depending on what you want:
|
||||
< The first command runs notepad minimized and the second one runs it
|
||||
normally.
|
||||
|
||||
Q. I'm using Win32s, and when I try to run an external command like "make",
|
||||
Vim doesn't wait for it to finish! Help!
|
||||
A. The problem is that a 32-bit application (Vim) can't get notification from
|
||||
Windows that a 16-bit application (your DOS session) has finished. Vim
|
||||
includes a work-around for this, but you must set up your DOS commands to
|
||||
run in a window, not full-screen. Unfortunately the default when you
|
||||
install Windows is full-screen. To change this:
|
||||
1) Start PIF editor (in the Main program group).
|
||||
2) Open the file "_DEFAULT.PIF" in your Windows directory.
|
||||
3) Changes the display option from "Full Screen" to "Windowed".
|
||||
4) Save and exit.
|
||||
|
||||
To test, start Vim and type >
|
||||
:!dir C:\<CR>".
|
||||
< You should see a DOS box window appear briefly with the directory listing.
|
||||
|
||||
Q. I use Vim under Win32s and NT. In NT, I can define the console to default to
|
||||
50 lines, so that I get a 80x50 shell when I ':sh'. Can I do the same in
|
||||
W3.1x, or am I stuck with 80x25?
|
||||
A. Edit SYSTEM.INI and add 'ScreenLines=50' to the [NonWindowsApp] section. DOS
|
||||
prompts and external DOS commands will now run in a 50-line window.
|
||||
|
||||
*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
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 7.4. Last change: 2014 Sep 06
|
||||
*pattern.txt* For Vim version 7.4. Last change: 2015 Mar 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -59,6 +59,8 @@ explanations are in chapter 27 |usr_27.txt|.
|
||||
|
||||
*n*
|
||||
n Repeat the latest "/" or "?" [count] times.
|
||||
If the cursor doesn't move the search is repeated with
|
||||
count + 1.
|
||||
|last-pattern|
|
||||
|
||||
*N*
|
||||
@@ -129,7 +131,7 @@ gD Goto global Declaration. When the cursor is on a
|
||||
|
||||
*CTRL-C*
|
||||
CTRL-C Interrupt current (search) command. Use CTRL-Break on
|
||||
MS-DOS |dos-CTRL-Break|.
|
||||
Windows |dos-CTRL-Break|.
|
||||
In Normal mode, any pending command is aborted.
|
||||
|
||||
*:noh* *:nohlsearch*
|
||||
@@ -1050,7 +1052,10 @@ x A single character, with no special meaning, matches itself
|
||||
*E769*
|
||||
When the ']' is not there Vim will not give an error message but
|
||||
assume no collection is used. Useful to search for '['. However, you
|
||||
do get E769 for internal searching.
|
||||
do get E769 for internal searching. And be aware that in a
|
||||
`:substitute` command the whole command becomes the pattern. E.g.
|
||||
":s/[/x/" searches for "[/x" and replaces it with nothing. It does
|
||||
not search for "[" and replaces it with "x"!
|
||||
|
||||
If the sequence begins with "^", it matches any single character NOT
|
||||
in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'.
|
||||
@@ -1082,7 +1087,7 @@ x A single character, with no special meaning, matches itself
|
||||
*[:backspace:]* [:backspace:] the <BS> character
|
||||
The brackets in character class expressions are additional to the
|
||||
brackets delimiting a collection. For example, the following is a
|
||||
plausible pattern for a UNIX filename: "[-./[:alnum:]_~]\+" That is,
|
||||
plausible pattern for a Unix filename: "[-./[:alnum:]_~]\+" That is,
|
||||
a list of at least one character, each of which is either '-', '.',
|
||||
'/', alphabetic, numeric, '_' or '~'.
|
||||
These items only work for 8-bit characters.
|
||||
|
@@ -1,482 +0,0 @@
|
||||
*pi_getscript.txt* For Vim version 7.0. Last change: 2013 Nov 29
|
||||
>
|
||||
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell
|
||||
<
|
||||
Authors: Charles E. Campbell <NdrOchip@ScampbellPfamilyA.Mbiz>
|
||||
(remove NOSPAM from the email address)
|
||||
*GetLatestVimScripts-copyright*
|
||||
Copyright: (c) 2004-2012 by Charles E. Campbell *glvs-copyright*
|
||||
The VIM LICENSE (see |copyright|) applies to the files in this
|
||||
package, including getscriptPlugin.vim, getscript.vim,
|
||||
GetLatestVimScripts.dist, and pi_getscript.txt, except use "getscript"
|
||||
instead of "VIM". Like anything else that's free, getscript and its
|
||||
associated files are provided *as is* and comes with no warranty of
|
||||
any kind, either expressed or implied. No guarantees of
|
||||
merchantability. No guarantees of suitability for any purpose. By
|
||||
using this plugin, you agree that in no event will the copyright
|
||||
holder be liable for any damages resulting from the use of this
|
||||
software. Use at your own risk!
|
||||
|
||||
Getscript is a plugin that simplifies retrieval of the latest versions of the
|
||||
scripts that you yourself use! Typing |:GLVS| will invoke getscript; it will
|
||||
then use the <GetLatestVimScripts.dat> (see |GetLatestVimScripts_dat|) file to
|
||||
get the latest versions of scripts listed therein from http://vim.sf.net/.
|
||||
|
||||
==============================================================================
|
||||
1. Contents *glvs-contents* *glvs* *getscript*
|
||||
*GetLatestVimScripts*
|
||||
|
||||
1. Contents........................................: |glvs-contents|
|
||||
2. GetLatestVimScripts -- Getting Started..........: |glvs-install|
|
||||
3. GetLatestVimScripts Usage.......................: |glvs-usage|
|
||||
4. GetLatestVimScripts Data File...................: |glvs-data|
|
||||
5. GetLatestVimScripts Friendly Plugins............: |glvs-plugins|
|
||||
6. GetLatestVimScripts AutoInstall.................: |glvs-autoinstall|
|
||||
7. GetLatestViMScripts Options.....................: |glvs-options|
|
||||
8. GetLatestVimScripts Algorithm...................: |glvs-alg|
|
||||
9. GetLatestVimScripts History.....................: |glvs-hist|
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. GetLatestVimScripts -- Getting Started *getscript-start*
|
||||
*getlatestvimscripts-install*
|
||||
|
||||
VERSION FROM VIM DISTRIBUTION *glvs-dist-install*
|
||||
|
||||
Vim 7.0 does not include the GetLatestVimScripts.dist file which
|
||||
serves as an example and a template. So, you'll need to create
|
||||
your own! See |GetLatestVimScripts_dat|.
|
||||
|
||||
VERSION FROM VIM SF NET *glvs-install*
|
||||
|
||||
NOTE: The last step, that of renaming/moving the GetLatestVimScripts.dist
|
||||
file, is for those who have just downloaded GetLatestVimScripts.tar.bz2 for
|
||||
the first time.
|
||||
|
||||
The GetLatestVimScripts.dist file serves as an example and a template for your
|
||||
own personal list. Feel free to remove all the scripts mentioned within it;
|
||||
the "important" part of it is the first two lines.
|
||||
|
||||
Your computer needs to have wget or curl for GetLatestVimScripts to do its work.
|
||||
|
||||
1. if compressed: gunzip getscript.vba.gz
|
||||
2. Unix:
|
||||
vim getscript.vba
|
||||
:so %
|
||||
:q
|
||||
cd ~/.vim/GetLatest
|
||||
mv GetLatestVimScripts.dist GetLatestVimScripts.dat
|
||||
(edit GetLatestVimScripts.dat to install your own personal
|
||||
list of desired plugins -- see |GetLatestVimScripts_dat|)
|
||||
|
||||
3. Windows:
|
||||
vim getscript.vba
|
||||
:so %
|
||||
:q
|
||||
cd **path-to-vimfiles**/GetLatest
|
||||
mv GetLatestVimScripts.dist GetLatestVimScripts.dat
|
||||
(edit GetLatestVimScripts.dat to install your own personal
|
||||
list of desired plugins -- see |GetLatestVimScripts_dat|)
|
||||
|
||||
|
||||
==============================================================================
|
||||
3. GetLatestVimScripts Usage *glvs-usage* *:GLVS*
|
||||
|
||||
Unless it has been defined elsewhere, >
|
||||
|
||||
:GLVS
|
||||
|
||||
will invoke GetLatestVimScripts(). If some other plugin has defined that
|
||||
command, then you may type
|
||||
>
|
||||
:GetLatestVimScripts
|
||||
<
|
||||
The script will attempt to update and, if permitted, will automatically
|
||||
install scripts from http://vim.sourceforge.net/. To do so it will peruse a
|
||||
file,
|
||||
>
|
||||
.vim/GetLatest/GetLatestVimScripts.dat (unix)
|
||||
<
|
||||
or >
|
||||
..wherever..\vimfiles\GetLatest\GetLatestVimScripts.dat (windows)
|
||||
(see |glvs-data|), and examine plugins in your [.vim|vimfiles]/plugin
|
||||
directory (see |glvs-plugins|).
|
||||
|
||||
Scripts which have been downloaded will appear in the
|
||||
~/.vim/GetLatest (unix) or ..wherever..\vimfiles\GetLatest (windows)
|
||||
subdirectory. GetLatestVimScripts will attempt to automatically
|
||||
install them if you have the following line in your <.vimrc>: >
|
||||
|
||||
let g:GetLatestVimScripts_allowautoinstall=1
|
||||
|
||||
The <GetLatestVimScripts.dat> file will be automatically be updated to
|
||||
reflect the latest version of script(s) so downloaded.
|
||||
(also see |glvs-options|)
|
||||
|
||||
|
||||
==============================================================================
|
||||
4. GetLatestVimScripts Data File *getscript-data* *glvs-data*
|
||||
*:GetLatestVimScripts_dat*
|
||||
The data file <GetLatestVimScripts.dat> must have for its first two lines
|
||||
the following text:
|
||||
>
|
||||
ScriptID SourceID Filename
|
||||
--------------------------
|
||||
<
|
||||
Following those two lines are three columns; the first two are numeric
|
||||
followed by a text column. The GetLatest/GetLatestVimScripts.dist file
|
||||
contains an example of such a data file. Anything following a #... is
|
||||
ignored, so you may embed comments in the file.
|
||||
|
||||
The first number on each line gives the script's ScriptID. When you're about
|
||||
to use a web browser to look at scripts on http://vim.sf.net/, just before you
|
||||
click on the script's link, you'll see a line resembling
|
||||
|
||||
http://vim.sourceforge.net/scripts/script.php?script_id=40
|
||||
|
||||
The "40" happens to be a ScriptID that GetLatestVimScripts needs to
|
||||
download the associated page, and is assigned by vim.sf.net itself
|
||||
during initial uploading of the plugin.
|
||||
|
||||
The second number on each line gives the script's SourceID. The SourceID
|
||||
records the count of uploaded scripts as determined by vim.sf.net; hence it
|
||||
serves to indicate "when" a script was uploaded. Setting the SourceID to 1
|
||||
insures that GetLatestVimScripts will assume that the script it has is
|
||||
out-of-date.
|
||||
|
||||
The SourceID is extracted by GetLatestVimScripts from the script's page on
|
||||
vim.sf.net; whenever it is greater than the one stored in the
|
||||
GetLatestVimScripts.dat file, the script will be downloaded
|
||||
(see |GetLatestVimScripts_dat|).
|
||||
|
||||
If your script's author has included a special comment line in his/her plugin,
|
||||
the plugin itself will be used by GetLatestVimScripts to build your
|
||||
<GetLatestVimScripts.dat> file, including any dependencies on other scripts it
|
||||
may have. As an example, consider: >
|
||||
|
||||
" GetLatestVimScripts: 884 1 :AutoInstall: AutoAlign.vim
|
||||
|
||||
This comment line tells getscript.vim to check vimscript #884 and that the
|
||||
script is automatically installable. Getscript will also use this line to
|
||||
help build the GetLatestVimScripts.dat file, by including a line such as: >
|
||||
|
||||
884 1 :AutoInstall: AutoAlign.vim
|
||||
<
|
||||
assuming that such a line isn't already in GetLatestVimScripts.dat file.
|
||||
See |glvs-plugins| for more. Thus, GetLatestVimScripts thus provides a
|
||||
comprehensive ability to keep your plugins up-to-date!
|
||||
|
||||
In summary:
|
||||
|
||||
* Optionally tell getscript that it is allowed to build/append a
|
||||
GetLatestVimScripts.dat file based upon already installed plugins: >
|
||||
let g:GetLatestVimScripts_allowautoinstall=1
|
||||
<
|
||||
* A line such as >
|
||||
" GetLatestVimScripts: 884 1 :AutoInstall: AutoAlign.vim
|
||||
< in an already-downloaded plugin constitutes the concurrence of the
|
||||
plugin author that getscript may do AutoInstall. Not all plugins
|
||||
may be AutoInstall-able, and the plugin's author is best situated
|
||||
to know whether or not his/her plugin will AutoInstall properly.
|
||||
|
||||
* A line such as >
|
||||
884 1 :AutoInstall: AutoAlign.vim
|
||||
< in your GetLatestVimScripts.dat file constitutes your permission
|
||||
to getscript to do AutoInstall. AutoInstall requires both your
|
||||
and the plugin author's permission. See |GetLatestVimScripts_dat|.
|
||||
|
||||
|
||||
*GetLatestVimScripts_dat*
|
||||
As an example of a <GetLatestVimScripts.dat> file:
|
||||
>
|
||||
ScriptID SourceID Filename
|
||||
--------------------------
|
||||
294 1 :AutoInstall: Align.vim
|
||||
120 2 Decho.vim
|
||||
40 3 DrawIt.tar.gz
|
||||
451 4 EasyAccents.vim
|
||||
195 5 engspchk.vim
|
||||
642 6 GetLatestVimScripts.vim
|
||||
489 7 Manpageview.vim
|
||||
<
|
||||
Note: the first two lines are required, but essentially act as comments.
|
||||
|
||||
|
||||
==============================================================================
|
||||
5. GetLatestVimScripts Friendly Plugins *getscript-plugins* *glvs-plugins*
|
||||
|
||||
(this section is for plugin authors)~
|
||||
|
||||
If a plugin author includes the following comment anywhere in their plugin,
|
||||
GetLatestVimScripts will find it and use it to automatically build the user's
|
||||
GetLatestVimScripts.dat files:
|
||||
>
|
||||
src_id
|
||||
v
|
||||
" GetLatestVimScripts: ### ### yourscriptname
|
||||
^
|
||||
scriptid
|
||||
<
|
||||
As an author, you should include such a line in to refer to your own script
|
||||
plus any additional lines describing any plugin dependencies it may have.
|
||||
Same format, of course!
|
||||
|
||||
If your command is auto-installable (see |glvs-autoinstall|), and most scripts
|
||||
are, then you may include :AutoInstall: just before "yourscriptname":
|
||||
>
|
||||
src_id
|
||||
v
|
||||
" GetLatestVimScripts: ### ### :AutoInstall: yourscriptname
|
||||
^
|
||||
scriptid
|
||||
<
|
||||
NOTE: The :AutoInstall: feature requires both the plugin author's and~
|
||||
the user's permission to operate!~
|
||||
|
||||
GetLatestVimScripts commands for those scripts are then appended, if not
|
||||
already present, to the user's GetLatest/GetLatestVimScripts.dat file. It is
|
||||
a relatively painless way to automate the acquisition of any scripts your
|
||||
plugins depend upon.
|
||||
|
||||
Now, as an author, you probably don't want GetLatestVimScripts to download
|
||||
your own scripts atop your own copy, thereby overwriting your not-yet-released
|
||||
hard work. GetLatestVimScripts provides a solution for this: put
|
||||
>
|
||||
0 0 yourscriptname
|
||||
<
|
||||
into your <GetLatestVimScripts.dat> file and GetLatestVimScripts will skip
|
||||
examining the "yourscriptname" scripts for those GetLatestVimScripts comment
|
||||
lines. As a result, those lines won't be inadvertently installed into your
|
||||
<GetLatestVimScripts.dat> file and subsequently used to download your own
|
||||
scripts. This is especially important to do if you've included the
|
||||
:AutoInstall: option.
|
||||
|
||||
Be certain to use the same "yourscriptname" in the "0 0 yourscriptname" line
|
||||
as you've used in your GetLatestVimScripts comment!
|
||||
|
||||
|
||||
==============================================================================
|
||||
6. GetLatestVimScripts AutoInstall *getscript-autoinstall*
|
||||
*glvs-autoinstall*
|
||||
|
||||
GetLatestVimScripts now supports "AutoInstall". Not all scripts are
|
||||
supportive of auto-install, as they may have special things you need to do to
|
||||
install them (please refer to the script's "install" directions). On the
|
||||
other hand, most scripts will be auto-installable.
|
||||
|
||||
To let GetLatestVimScripts do an autoinstall, the data file's comment field
|
||||
should begin with (surrounding blanks are ignored): >
|
||||
|
||||
:AutoInstall:
|
||||
<
|
||||
Both colons are needed, and it should begin the comment (yourscriptname)
|
||||
field.
|
||||
|
||||
One may prevent any autoinstalling by putting the following line in your
|
||||
<.vimrc>: >
|
||||
|
||||
let g:GetLatestVimScripts_allowautoinstall= 0
|
||||
<
|
||||
With :AutoInstall: enabled, as it is by default, files which end with
|
||||
|
||||
---.tar.bz2 : decompressed & untarred in .vim/ directory
|
||||
---.vba.bz2 : decompressed in .vim/ directory, then vimball handles it
|
||||
---.vim.bz2 : decompressed & moved into .vim/plugin directory
|
||||
---.tar.gz : decompressed & untarred in .vim/ directory
|
||||
---.vba.gz : decompressed in .vim/ directory, then vimball handles it
|
||||
---.vim.gz : decompressed & moved into .vim/plugin directory
|
||||
---.vba : unzipped in .vim/ directory
|
||||
---.vim : moved to .vim/plugin directory
|
||||
---.zip : unzipped in .vim/ directory
|
||||
|
||||
and which merely need to have their components placed by the untar/gunzip or
|
||||
move-to-plugin-directory process should be auto-installable. Vimballs, of
|
||||
course, should always be auto-installable.
|
||||
|
||||
When is a script not auto-installable? Let me give an example:
|
||||
|
||||
.vim/after/syntax/blockhl.vim
|
||||
|
||||
The <blockhl.vim> script provides block highlighting for C/C++ programs; it is
|
||||
available at:
|
||||
|
||||
http://vim.sourceforge.net/scripts/script.php?script_id=104
|
||||
|
||||
Currently, vim's after/syntax only supports by-filetype scripts (in
|
||||
blockhl.vim's case, that's after/syntax/c.vim). Hence, auto-install would
|
||||
possibly overwrite the current user's after/syntax/c.vim file.
|
||||
|
||||
In my own case, I use <aftersyntax.vim> (renamed to after/syntax/c.vim) to
|
||||
allow a after/syntax/c/ directory:
|
||||
|
||||
http://vim.sourceforge.net/scripts/script.php?script_id=1023
|
||||
|
||||
The script allows multiple syntax files to exist separately in the
|
||||
after/syntax/c subdirectory. I can't bundle aftersyntax.vim in and build an
|
||||
appropriate tarball for auto-install because of the potential for the
|
||||
after/syntax/c.vim contained in it to overwrite a user's c.vim.
|
||||
|
||||
|
||||
==============================================================================
|
||||
7. GetLatestVimScripts Options *glvs-options*
|
||||
>
|
||||
g:GetLatestVimScripts_wget
|
||||
< default= "wget"
|
||||
This variable holds the name of the command for obtaining
|
||||
scripts.
|
||||
>
|
||||
g:GetLatestVimScripts_options
|
||||
< default= "-q -O"
|
||||
This variable holds the options to be used with the
|
||||
g:GetLatestVimScripts_wget command.
|
||||
>
|
||||
g:GetLatestVimScripts_allowautoinstall
|
||||
< default= 1
|
||||
This variable indicates whether GetLatestVimScripts is allowed
|
||||
to attempt to automatically install scripts. Furthermore, the
|
||||
plugin author has to have explicitly indicated that his/her
|
||||
plugin is automatically installable (via the :AutoInstall:
|
||||
keyword in the GetLatestVimScripts comment line).
|
||||
>
|
||||
g:GetLatestVimScripts_autoinstalldir
|
||||
< default= $HOME/.vim (linux)
|
||||
default= $HOME/vimfiles (windows)
|
||||
Override where :AutoInstall: scripts will be installed.
|
||||
Doesn't override vimball installation.
|
||||
>
|
||||
g:GetLatestVimScripts_scriptaddr
|
||||
< default='http://vim.sourceforge.net/script.php?script_id='
|
||||
Override this if your system needs
|
||||
... ='http://vim.sourceforge.net/script/script.php?script_id='
|
||||
|
||||
==============================================================================
|
||||
8. GetLatestVimScripts Algorithm *glvs-algorithm* *glvs-alg*
|
||||
|
||||
The Vim sourceforge page dynamically creates a page by keying off of the
|
||||
so-called script-id. Within the webpage of
|
||||
|
||||
http://vim.sourceforge.net/scripts/script.php?script_id=40
|
||||
|
||||
is a line specifying the latest source-id (src_id). The source identifier
|
||||
numbers are always increasing, hence if the src_id is greater than the one
|
||||
recorded for the script in GetLatestVimScripts then it's time to download a
|
||||
newer copy of that script.
|
||||
|
||||
GetLatestVimScripts will then download the script and update its internal
|
||||
database of script ids, source ids, and scriptnames.
|
||||
|
||||
The AutoInstall process will:
|
||||
|
||||
Move the file from GetLatest/ to the following directory
|
||||
Unix : $HOME/.vim
|
||||
Windows: $HOME\vimfiles
|
||||
if the downloaded file ends with ".bz2"
|
||||
bunzip2 it
|
||||
else if the downloaded file ends with ".gz"
|
||||
gunzip it
|
||||
if the resulting file ends with ".zip"
|
||||
unzip it
|
||||
else if the resulting file ends with ".tar"
|
||||
tar -oxvf it
|
||||
else if the resulting file ends with ".vim"
|
||||
move it to the plugin subdirectory
|
||||
|
||||
|
||||
==============================================================================
|
||||
9. GetLatestVimScripts History *getscript-history* *glvs-hist* {{{1
|
||||
|
||||
v36 Apr 22, 2013 : * (glts) suggested use of plugin/**/*.vim instead of
|
||||
plugin/*.vim in globpath() call.
|
||||
* (Andy Wokula) got warning message when setting
|
||||
g:loaded_getscriptPlugin
|
||||
v35 Apr 07, 2012 : * (MengHuan Yu) pointed out that the script url has
|
||||
changed (somewhat). However, it doesn't work, and
|
||||
the original one does (under Linux). I'll make it
|
||||
yet-another-option.
|
||||
v34 Jun 23, 2011 : * handles additional decompression options for tarballs
|
||||
(tgz taz tbz txz)
|
||||
v33 May 31, 2011 : * using fnameescape() instead of escape()
|
||||
* *.xz support
|
||||
v32 Jun 19, 2010 : * (Jan Steffens) added support for xz compression
|
||||
v31 Jun 29, 2008 : * (Bill McCarthy) fixed having hls enabled with getscript
|
||||
* (David Schaefer) the acd option interferes with vimballs
|
||||
Solution: bypass the acd option
|
||||
v30 Jun 13, 2008 : * GLVS now checks for existence of fnameescape() and will
|
||||
issue an error message if it is not supported
|
||||
v29 Jan 07, 2008 : * Bram M pointed out that cpo is a global option and that
|
||||
getscriptPlugin.vim was setting it but not restoring it.
|
||||
v28 Jan 02, 2008 : * improved shell quoting character handling, cygwin
|
||||
interface, register-a bypass
|
||||
Oct 29, 2007 * Bill McCarthy suggested a change to getscript that avoids
|
||||
creating pop-up windows
|
||||
v24 Apr 16, 2007 : * removed save&restore of the fo option during script
|
||||
loading
|
||||
v23 Nov 03, 2006 : * ignores comments (#...)
|
||||
* handles vimballs
|
||||
v22 Oct 13, 2006 : * supports automatic use of curl if wget is not
|
||||
available
|
||||
v21 May 01, 2006 : * now takes advantage of autoloading.
|
||||
v20 Dec 23, 2005 : * Eric Haarbauer found&fixed a bug with unzip use;
|
||||
unzip needs the -o flag to overwrite.
|
||||
v19 Nov 28, 2005 : * v18's GetLatestVimScript line accessed the wrong
|
||||
script! Fixed.
|
||||
v18 Mar 21, 2005 : * bugfix to automatic database construction
|
||||
* bugfix - nowrapscan caused an error
|
||||
(tnx to David Green for the fix)
|
||||
Apr 01, 2005 * if shell is bash, "mv" instead of "ren" used in
|
||||
:AutoInstall:s, even though its o/s is windows
|
||||
Apr 01, 2005 * when downloading errors occurred, GLVS was
|
||||
terminating early. It now just goes on to trying
|
||||
the next script (after trying three times to
|
||||
download a script description page)
|
||||
Apr 20, 2005 * bugfix - when a failure to download occurred,
|
||||
GetLatestVimScripts would stop early and claim that
|
||||
everything was current. Fixed.
|
||||
v17 Aug 25, 2004 : * g:GetLatestVimScripts_allowautoinstall, which
|
||||
defaults to 1, can be used to prevent all
|
||||
:AutoInstall:
|
||||
v16 Aug 25, 2004 : * made execution of bunzip2/gunzip/tar/zip silent
|
||||
* fixed bug with :AutoInstall: use of helptags
|
||||
v15 Aug 24, 2004 : * bugfix: the "0 0 comment" download prevention wasn't
|
||||
always preventing downloads (just usually). Fixed.
|
||||
v14 Aug 24, 2004 : * bugfix -- helptags was using dotvim, rather than
|
||||
s:dotvim. Fixed.
|
||||
v13 Aug 23, 2004 : * will skip downloading a file if its scriptid or srcid
|
||||
is zero. Useful for script authors; that way their
|
||||
own GetLatestVimScripts activity won't overwrite
|
||||
their scripts.
|
||||
v12 Aug 23, 2004 : * bugfix - a "return" got left in the distribution that
|
||||
was intended only for testing. Removed, now works.
|
||||
* :AutoInstall: implemented
|
||||
v11 Aug 20, 2004 : * GetLatestVimScripts is now a plugin:
|
||||
* :GetLatestVimScripts command
|
||||
* (runtimepath)/GetLatest/GetLatestVimScripts.dat
|
||||
now holds scripts that need updating
|
||||
v10 Apr 19, 2004 : * moved history from script to doc
|
||||
v9 Jan 23, 2004 : windows (win32/win16/win95) will use
|
||||
double quotes ("") whereas other systems will use
|
||||
single quotes ('') around the urls in calls via wget
|
||||
v8 Dec 01, 2003 : makes three tries at downloading
|
||||
v7 Sep 02, 2003 : added error messages if "Click on..." or "src_id="
|
||||
not found in downloaded webpage
|
||||
Uses t_ti, t_te, and rs to make progress visible
|
||||
v6 Aug 06, 2003 : final status messages now display summary of work
|
||||
( "Downloaded someqty scripts" or
|
||||
"Everything was current")
|
||||
Now GetLatestVimScripts is careful about downloading
|
||||
GetLatestVimScripts.vim itself!
|
||||
(goes to <NEW_GetLatestVimScripts.vim>)
|
||||
v5 Aug 04, 2003 : missing an endif near bottom
|
||||
v4 Jun 17, 2003 : redraw! just before each "considering" message
|
||||
v3 May 27, 2003 : Protects downloaded files from errant shell
|
||||
expansions with single quotes: '...'
|
||||
v2 May 14, 2003 : extracts name of item to be obtained from the
|
||||
script file. Uses it instead of comment field
|
||||
for output filename; comment is used in the
|
||||
"considering..." line and is now just a comment!
|
||||
* Fixed a bug: a string-of-numbers is not the
|
||||
same as a number, so I added zero to them
|
||||
and they became numbers. Fixes comparison.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:fdm=marker
|
@@ -677,7 +677,7 @@ It is possible to achieve a poor man's version of duplex printing using the PS
|
||||
utility psselect. This utility has options -e and -o for printing just the
|
||||
even or odd pages of a PS file respectively.
|
||||
|
||||
First generate a PS file with the 'hardcopy' command, then generate a new
|
||||
First generate a PS file with the 'hardcopy' command, then generate new
|
||||
files with all the odd and even numbered pages with: >
|
||||
|
||||
psselect -o test.ps odd.ps
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 7.4. Last change: 2014 Mar 27
|
||||
*quickfix.txt* For Vim version 7.4. Last change: 2015 Sep 08
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -291,6 +291,74 @@ use this code: >
|
||||
|
||||
au QuickfixCmdPost make call QfMakeConv()
|
||||
|
||||
EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
|
||||
*:cdo*
|
||||
:cdo[!] {cmd} Execute {cmd} in each valid entry in the quickfix list.
|
||||
It works like doing this: >
|
||||
:cfirst
|
||||
:{cmd}
|
||||
:cnext
|
||||
:{cmd}
|
||||
etc.
|
||||
< When the current file can't be |abandon|ed and the [!]
|
||||
is not present, the command fails.
|
||||
When an error is detected excecution stops.
|
||||
The last buffer (or where an error occurred) becomes
|
||||
the current buffer.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
|
||||
Only valid entries in the quickfix list are used.
|
||||
A range can be used to select entries, e.g.: >
|
||||
:10,$cdo cmd
|
||||
< To skip entries 1 to 9.
|
||||
|
||||
Note: While this command is executing, the Syntax
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each buffer.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|
||||
|:ldo|, |:cfdo| and |:lfdo|.
|
||||
|
||||
*:cfdo*
|
||||
:cfdo[!] {cmd} Execute {cmd} in each file in the quickfix list.
|
||||
It works like doing this: >
|
||||
:cfirst
|
||||
:{cmd}
|
||||
:cnfile
|
||||
:{cmd}
|
||||
etc.
|
||||
< Otherwise it works the same as `:cdo`.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
|
||||
*:ldo*
|
||||
:ld[o][!] {cmd} Execute {cmd} in each valid entry in the location list
|
||||
for the current window.
|
||||
It works like doing this: >
|
||||
:lfirst
|
||||
:{cmd}
|
||||
:lnext
|
||||
:{cmd}
|
||||
etc.
|
||||
< Only valid entries in the location list are used.
|
||||
Otherwise it works the same as `:cdo`.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
|
||||
*:lfdo*
|
||||
:lfdo[!] {cmd} Execute {cmd} in each file in the location list for
|
||||
the current window.
|
||||
It works like doing this: >
|
||||
:lfirst
|
||||
:{cmd}
|
||||
:lnfile
|
||||
:{cmd}
|
||||
etc.
|
||||
< Otherwise it works the same as `:ldo`.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
|
||||
=============================================================================
|
||||
2. The error window *quickfix-window*
|
||||
@@ -493,11 +561,11 @@ or simpler >
|
||||
"$*" can be given multiple times, for example: >
|
||||
:set makeprg=gcc\ -o\ $*\ $*
|
||||
|
||||
The 'shellpipe' option defaults to ">" for MS-DOS and Win32. This means that
|
||||
the output of the compiler is saved in a file and not shown on the screen
|
||||
directly. For Unix "| tee" is used. The compiler output is shown on the
|
||||
screen and saved in a file the same time. Depending on the shell used "|&
|
||||
tee" or "2>&1| tee" is the default, so stderr output will be included.
|
||||
The 'shellpipe' option defaults to ">" on Windows. This means that the output
|
||||
of the compiler is saved in a file and not shown on the screen directly. For
|
||||
Unix "| tee" is used. The compiler output is shown on the screen and saved in
|
||||
a file the same time. Depending on the shell used "|& tee" or "2>&1| tee" is
|
||||
the default, so stderr output will be included.
|
||||
|
||||
If 'shellpipe' is empty, the {errorfile} part will be omitted. This is useful
|
||||
for compilers that write to an errorfile themselves.
|
||||
@@ -905,9 +973,9 @@ normally happens by matching following characters and items. When nothing is
|
||||
following the rest of the line is matched. If "%f" is followed by a '%' or a
|
||||
backslash, it will look for a sequence of 'isfname' characters.
|
||||
|
||||
On MS-DOS and MS-Windows a leading "C:" will be included in "%f", even when
|
||||
using "%f:". This means that a file name which is a single alphabetical
|
||||
letter will not be detected.
|
||||
On Windows a leading "C:" will be included in "%f", even when using "%f:".
|
||||
This means that a file name which is a single alphabetical letter will not be
|
||||
detected.
|
||||
|
||||
The "%p" conversion is normally followed by a "^". It's used for compilers
|
||||
that output a line like: >
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 7.4. Last change: 2014 Nov 19
|
||||
*quickref.txt* For Vim version 7.4. Last change: 2015 Jul 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -617,6 +617,7 @@ Short explanation of each option: *option-list*
|
||||
'balloondelay' 'bdlay' delay in mS before a balloon may pop up
|
||||
'ballooneval' 'beval' switch on balloon evaluation
|
||||
'balloonexpr' 'bexpr' expression to show in balloon
|
||||
'belloff' 'bo' do not ring the bell for these reasons
|
||||
'binary' 'bin' read/write/edit file in binary mode
|
||||
'bomb' prepend a Byte Order Mark to the file
|
||||
'breakat' 'brk' characters that may cause a line break
|
||||
@@ -688,6 +689,7 @@ Short explanation of each option: *option-list*
|
||||
'fileignorecase' 'fic' ignore case when using file names
|
||||
'filetype' 'ft' type of file, used for autocommands
|
||||
'fillchars' 'fcs' characters to use for displaying special items
|
||||
'fixendofline' 'fixeol' make sure last line in file has <EOL>
|
||||
'fkmap' 'fk' Farsi keyboard mapping
|
||||
'foldclose' 'fcl' close a fold when the cursor leaves it
|
||||
'foldcolumn' 'fdc' width of the column used to indicate folds
|
||||
@@ -702,10 +704,10 @@ Short explanation of each option: *option-list*
|
||||
'foldnestmax' 'fdn' maximum fold depth
|
||||
'foldopen' 'fdo' for which commands a fold will be opened
|
||||
'foldtext' 'fdt' expression used to display for a closed fold
|
||||
'formatexpr' 'fex' expression used with "gq" command
|
||||
'formatlistpat' 'flp' pattern used to recognize a list header
|
||||
'formatoptions' 'fo' how automatic formatting is to be done
|
||||
'formatprg' 'fp' name of external program used with "gq" command
|
||||
'formatexpr' 'fex' expression used with "gq" command
|
||||
'fsync' 'fs' whether to invoke fsync() after file write
|
||||
'gdefault' 'gd' the ":substitute" flag 'g' is default on
|
||||
'grepformat' 'gfm' format of 'grepprg' output
|
||||
@@ -730,13 +732,10 @@ Short explanation of each option: *option-list*
|
||||
'icon' let Vim set the text of the window icon
|
||||
'iconstring' string to use for the Vim icon text
|
||||
'ignorecase' 'ic' ignore case in search patterns
|
||||
'imactivatekey' 'imak' key that activates the X input method
|
||||
'imactivatefunc' 'imaf' function to enable/disable the X input method
|
||||
'imcmdline' 'imc' use IM when starting to edit a command line
|
||||
'imdisable' 'imd' do not use the IM in any mode
|
||||
'iminsert' 'imi' use :lmap or IM in Insert mode
|
||||
'imsearch' 'ims' use :lmap or IM when typing a search pattern
|
||||
'imstatusfunc' 'imsf' function to obtain X input method status
|
||||
'include' 'inc' pattern to be used to find an include file
|
||||
'includeexpr' 'inex' expression used to process an include line
|
||||
'incsearch' 'is' highlight match while typing search pattern
|
||||
@@ -820,7 +819,6 @@ Short explanation of each option: *option-list*
|
||||
'relativenumber' 'rnu' show relative line number in front of each line
|
||||
'remap' allow mappings to work recursively
|
||||
'report' threshold for reporting nr. of lines changed
|
||||
'restorescreen' 'rs' Win32: restore screen when exiting
|
||||
'revins' 'ri' inserting characters will work backwards
|
||||
'rightleft' 'rl' window is right-to-left oriented
|
||||
'rightleftcmd' 'rlc' commands for which editing works right-to-left
|
||||
@@ -874,13 +872,12 @@ Short explanation of each option: *option-list*
|
||||
'suffixes' 'su' suffixes that are ignored with multiple match
|
||||
'suffixesadd' 'sua' suffixes added when searching for a file
|
||||
'swapfile' 'swf' whether to use a swapfile for a buffer
|
||||
'swapsync' 'sws' how to sync the swap file
|
||||
'switchbuf' 'swb' sets behavior when switching to another buffer
|
||||
'synmaxcol' 'smc' maximum column to find syntax items
|
||||
'syntax' 'syn' syntax to be loaded for current buffer
|
||||
'tabstop' 'ts' number of spaces that <Tab> in file uses
|
||||
'tabline' 'tal' custom format for the console tab pages line
|
||||
'tabpagemax' 'tpm' maximum number of tab pages for |-p| and "tab all"
|
||||
'tabstop' 'ts' number of spaces that <Tab> in file uses
|
||||
'tagbsearch' 'tbs' use binary searching in tags files
|
||||
'taglength' 'tl' number of significant characters for a tag
|
||||
'tagrelative' 'tr' file names in tag file are relative
|
||||
@@ -985,11 +982,9 @@ Short explanation of each option: *option-list*
|
||||
|g_CTRL-G| g CTRL-G show cursor column, line, and character
|
||||
position
|
||||
|CTRL-C| CTRL-C during searches: Interrupt the search
|
||||
|dos-CTRL-Break| CTRL-Break MS-DOS: during searches: Interrupt the search
|
||||
|dos-CTRL-Break| CTRL-Break Windows: during searches: Interrupt the search
|
||||
|<Del>| <Del> while entering a count: delete last character
|
||||
|:version| :ve[rsion] show version information
|
||||
|:mode| :mode N MS-DOS: set screen mode to N (number, C80,
|
||||
C4350, etc.)
|
||||
|:normal| :norm[al][!] {commands}
|
||||
execute Normal mode commands
|
||||
|Q| Q switch to "Ex" mode
|
||||
|
@@ -178,14 +178,14 @@ Hurrah for VIM!! It is "at your fingertips" like vi, and has the extensions
|
||||
that vi sorely needs: highlighting for executing commands on blocks, an easily
|
||||
navigable and digestible help screen, and more. (Paul Pax)
|
||||
|
||||
The reason WHY I don't have this amazingly useful macro any more, is that I
|
||||
The reason WHY I don't have this amazingly useful macro anymore, is that I
|
||||
now use VIM - and this is built in!! (Stephen Riehm, Germany)
|
||||
|
||||
I am a user of VIM and I love it. I use it to do all my programming, C,
|
||||
C++, HTML what ever. (Tim Allwine)
|
||||
|
||||
I discovered VIM after years of struggling with the original vi, and I just
|
||||
can't live without it any more. (Emmanuel Mogenet, USA)
|
||||
can't live without it anymore. (Emmanuel Mogenet, USA)
|
||||
|
||||
Emacs has not a bit of chance to survive so long as VIM is around. Besides,
|
||||
it also has the most detailed software documentation I have ever seen---much
|
||||
|
@@ -60,7 +60,7 @@ Disadvantages:
|
||||
If you want to put swap files in a fixed place, put a command resembling the
|
||||
following ones in your vimrc:
|
||||
:set dir=~/tmp (for Unix)
|
||||
:set dir=c:\\tmp (for MS-DOS and Win32)
|
||||
:set dir=c:\\tmp (for Windows)
|
||||
This is also very handy when editing files on floppy. Of course you will have
|
||||
to create that "tmp" directory for this to work!
|
||||
|
||||
@@ -92,10 +92,7 @@ changed, not when you only moved around. The reason why it is not kept up to
|
||||
date all the time is that this would slow down normal work too much. You can
|
||||
change the 200 character count with the 'updatecount' option. You can set
|
||||
the time with the 'updatetime' option. The time is given in milliseconds.
|
||||
After writing to the swap file Vim syncs the file to disk. This takes some
|
||||
time, especially on busy Unix systems. If you don't want this you can set the
|
||||
'swapsync' option to an empty string. The risk of losing work becomes bigger
|
||||
though.
|
||||
After writing to the swap file Vim syncs the file to disk.
|
||||
|
||||
If the writing to the swap file is not wanted, it can be switched off by
|
||||
setting the 'updatecount' option to 0. The same is done when starting Vim
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*remote.txt* For Vim version 7.4. Last change: 2008 May 24
|
||||
*remote.txt* For Vim version 7.4. Last change: 2015 Mar 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -34,7 +34,8 @@ The following command line arguments are available:
|
||||
The remote Vim is raised. If you don't want
|
||||
this use >
|
||||
vim --remote-send "<C-\><C-N>:n filename<CR>"
|
||||
< --remote-silent [+{cmd}] {file} ... *--remote-silent*
|
||||
<
|
||||
--remote-silent [+{cmd}] {file} ... *--remote-silent*
|
||||
As above, but don't complain if there is no
|
||||
server and the file is edited locally.
|
||||
--remote-wait [+{cmd}] {file} ... *--remote-wait*
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 7.4. Last change: 2015 Jan 07
|
||||
*repeat.txt* For Vim version 7.4. Last change: 2015 Apr 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -109,6 +109,12 @@ q{0-9a-zA-Z"} Record typed characters into register {0-9a-zA-Z"}
|
||||
while executing a register, and it doesn't work inside
|
||||
a mapping and |:normal|.
|
||||
|
||||
Note: If the register being used for recording is also
|
||||
used for |y| and |p| the result is most likely not
|
||||
what is expected, because the put will paste the
|
||||
recorded macro and the yank will overwrite the
|
||||
recorded macro.
|
||||
|
||||
q Stops recording.
|
||||
Implementation note: The 'q' that stops recording is
|
||||
not stored in the register, unless it was the result
|
||||
@@ -287,13 +293,13 @@ with CTRL-V followed by the three digit decimal code. This does NOT work for
|
||||
the <t_xx> termcap codes, these can only be used in mappings.
|
||||
|
||||
*:source_crnl* *W15*
|
||||
MS-DOS and Win32: Files that are read with ":source" normally have
|
||||
<CR><NL> <EOL>s. These always work. If you are using a file with <NL> <EOL>s
|
||||
(for example, a file made on Unix), this will be recognized if 'fileformats'
|
||||
is not empty and the first line does not end in a <CR>. This fails if the
|
||||
first line has something like ":map <F1> :help^M", where "^M" is a <CR>. If
|
||||
the first line ends in a <CR>, but following ones don't, you will get an error
|
||||
message, because the <CR> from the first lines will be lost.
|
||||
Windows: Files that are read with ":source" normally have <CR><NL> <EOL>s.
|
||||
These always work. If you are using a file with <NL> <EOL>s (for example, a
|
||||
file made on Unix), this will be recognized if 'fileformats' is not empty and
|
||||
the first line does not end in a <CR>. This fails if the first line has
|
||||
something like ":map <F1> :help^M", where "^M" is a <CR>. If the first line
|
||||
ends in a <CR>, but following ones don't, you will get an error message,
|
||||
because the <CR> from the first lines will be lost.
|
||||
|
||||
Mac Classic: Files that are read with ":source" normally have <CR> <EOL>s.
|
||||
These always work. If you are using a file with <NL> <EOL>s (for example, a
|
||||
@@ -303,7 +309,7 @@ linebreaks which has a <CR> in first line.
|
||||
|
||||
On other systems, Vim expects ":source"ed files to end in a <NL>. These
|
||||
always work. If you are using a file with <CR><NL> <EOL>s (for example, a
|
||||
file made on MS-DOS), all lines will have a trailing <CR>. This may cause
|
||||
file made on Windows), all lines will have a trailing <CR>. This may cause
|
||||
problems for some commands (e.g., mappings). There is no automatic <EOL>
|
||||
detection, because it's common to start with a line that defines a mapping
|
||||
that ends in a <CR>, which will confuse the automaton.
|
||||
@@ -390,7 +396,7 @@ To enter debugging mode use one of these methods:
|
||||
useful to find out what is happening when Vim is starting up. A side
|
||||
effect is that Vim will switch the terminal mode before initialisations
|
||||
have finished, with unpredictable results.
|
||||
For a GUI-only version (Windows, Macintosh) the debugging will start as
|
||||
For a GUI-only version (Windows) the debugging will start as
|
||||
soon as the GUI window has been opened. To make this happen early, add a
|
||||
":gui" command in the vimrc file.
|
||||
*:debug*
|
||||
@@ -583,6 +589,7 @@ For example, to profile the one_script.vim script file: >
|
||||
|
||||
:prof[ile] start {fname} *:prof* *:profile* *E750*
|
||||
Start profiling, write the output in {fname} upon exit.
|
||||
"~/" and environment variables in {fname} will be expanded.
|
||||
If {fname} already exists it will be silently overwritten.
|
||||
The variable |v:profiling| is set to one.
|
||||
|
||||
@@ -658,10 +665,6 @@ long you take to respond to the input() prompt is irrelevant.
|
||||
Profiling should give a good indication of where time is spent, but keep in
|
||||
mind there are various things that may clobber the results:
|
||||
|
||||
- The accuracy of the time measured depends on the gettimeofday() system
|
||||
function. It may only be as accurate as 1/100 second, even though the times
|
||||
are displayed in micro seconds.
|
||||
|
||||
- Real elapsed time is measured, if other processes are busy they may cause
|
||||
delays at unpredictable moments. You may want to run the profiling several
|
||||
times and use the lowest results.
|
||||
|
@@ -106,9 +106,6 @@ o Does not support reverse insert and rightleft modes on the command-line.
|
||||
o Somewhat slower in right-to-left mode, because right-to-left motion is
|
||||
emulated inside Vim, not by the controlling terminal.
|
||||
|
||||
o When the Athena GUI is used, the bottom scrollbar works in the wrong
|
||||
direction. This is difficult to fix.
|
||||
|
||||
o When both 'rightleft' and 'revins' are on: 'textwidth' does not work.
|
||||
Lines do not wrap at all; you just get a single, long line.
|
||||
|
||||
|
@@ -245,26 +245,6 @@ dragging the scrollbar of the current window. How many lines are scrolled
|
||||
depends on your mouse driver. If the scroll action causes input focus
|
||||
problems, see |intellimouse-wheel-problems|.
|
||||
|
||||
For the X11 GUIs (Motif, Athena and GTK) scrolling the wheel generates key
|
||||
presses <ScrollWheelUp>, <ScrollWheelDown>, <ScrollWheelLeft> and
|
||||
<ScrollWheelRight>. For example, if you push the scroll wheel upwards a
|
||||
<ScrollWheelUp> key press is generated causing the window to scroll upwards
|
||||
(while the text is actually moving downwards). The default action for these
|
||||
keys are:
|
||||
<ScrollWheelUp> scroll three lines up *<ScrollWheelUp>*
|
||||
<S-ScrollWheelUp> scroll one page up *<S-ScrollWheelUp>*
|
||||
<C-ScrollWheelUp> scroll one page up *<C-ScrollWheelUp>*
|
||||
<ScrollWheelDown> scroll three lines down *<ScrollWheelDown>*
|
||||
<S-ScrollWheelDown> scroll one page down *<S-ScrollWheelDown>*
|
||||
<C-ScrollWheelDown> scroll one page down *<C-ScrollWheelDown>*
|
||||
<ScrollWheelLeft> scroll six columns left *<ScrollWheelLeft>*
|
||||
<S-ScrollWheelLeft> scroll one page left *<S-ScrollWheelLeft>*
|
||||
<C-ScrollWheelLeft> scroll one page left *<C-ScrollWheelLeft>*
|
||||
<ScrollWheelRight> scroll six columns right *<ScrollWheelRight>*
|
||||
<S-ScrollWheelRight> scroll one page right *<S-ScrollWheelRight>*
|
||||
<C-ScrollWheelRight> scroll one page right *<C-ScrollWheelRight>*
|
||||
This should work in all modes, except when editing the command line.
|
||||
|
||||
Note that horizontal scrolling only works if 'nowrap' is set. Also, unless
|
||||
the "h" flag in 'guioptions' is set, the cursor moves to the longest visible
|
||||
line if the cursor line is about to be scrolled off the screen (similarly to
|
||||
@@ -281,13 +261,6 @@ You can also use Alt and Ctrl modifiers.
|
||||
This only works when Vim gets the scroll wheel events, of course. You can
|
||||
check if this works with the "xev" program.
|
||||
|
||||
When using XFree86, the /etc/XF86Config file should have the correct entry for
|
||||
your mouse. For FreeBSD, this entry works for a Logitech scrollmouse: >
|
||||
Protocol "MouseMan"
|
||||
Device "/dev/psm0"
|
||||
ZAxisMapping 4 5
|
||||
See the XFree86 documentation for information.
|
||||
|
||||
*<MouseDown>* *<MouseUp>*
|
||||
The keys <MouseDown> and <MouseUp> have been deprecated. Use <ScrollWheelUp>
|
||||
instead of <MouseDown> and use <ScrollWheelDown> instead of <MouseUp>.
|
||||
|
@@ -75,12 +75,8 @@ DEFINING A SIGN. *:sign-define* *E255* *E160* *E612*
|
||||
Define the file name where the bitmap can be found. Should be
|
||||
a full path. The bitmap should fit in the place of two
|
||||
characters. This is not checked. If the bitmap is too big it
|
||||
will cause redraw problems. Only GTK 2 can scale the bitmap
|
||||
to fit the space available.
|
||||
will cause redraw problems.
|
||||
toolkit supports ~
|
||||
GTK 1 pixmap (.xpm)
|
||||
GTK 2 many
|
||||
Motif pixmap (.xpm)
|
||||
Win32 .bmp, .ico, .cur
|
||||
pixmap (.xpm) |+xpm_w32|
|
||||
|
||||
|
@@ -35,9 +35,7 @@ Vim only checks words for spelling, there is no grammar check.
|
||||
If the 'mousemodel' option is set to "popup" and the cursor is on a badly
|
||||
spelled word or it is "popup_setpos" and the mouse pointer is on a badly
|
||||
spelled word, then the popup menu will contain a submenu to replace the bad
|
||||
word. Note: this slows down the appearance of the popup menu. Note for GTK:
|
||||
don't release the right mouse button until the menu appears, otherwise it
|
||||
won't work.
|
||||
word. Note: this slows down the appearance of the popup menu.
|
||||
|
||||
To search for the next misspelled word:
|
||||
|
||||
|
@@ -217,7 +217,7 @@ argument.
|
||||
:set to display option values.
|
||||
When 'verbose' is non-zero messages are printed (for
|
||||
debugging, to stderr).
|
||||
'term' and $TERM are not used.
|
||||
$TERM is not used.
|
||||
If Vim appears to be stuck try typing "qa!<Enter>". You don't
|
||||
get a prompt thus you can't see Vim is waiting for you to type
|
||||
something.
|
||||
@@ -315,9 +315,10 @@ argument.
|
||||
When {vimrc} is equal to "NONE" (all uppercase), all
|
||||
initializations from files and environment variables are
|
||||
skipped, including reading the |ginit.vim| file when the GUI
|
||||
starts. Loading plugins is also skipped.
|
||||
starts. Plugins and syntax highlighting are also skipped.
|
||||
When {vimrc} is equal to "NORC" (all uppercase), this has the
|
||||
same effect as "NONE", but loading plugins is not skipped.
|
||||
same effect as "NONE", but plugins and syntax highlighting are
|
||||
not skipped.
|
||||
|
||||
*-i*
|
||||
-i {shada} The file {shada} is used instead of the default ShaDa
|
||||
@@ -354,13 +355,10 @@ argument.
|
||||
At startup, Vim checks environment variables and files and sets values
|
||||
accordingly. Vim proceeds in this order:
|
||||
|
||||
1. Set the 'shell' and 'term' option *SHELL* *COMSPEC* *TERM*
|
||||
1. Set the 'shell' option *SHELL* *COMSPEC* *TERM*
|
||||
The environment variable SHELL, if it exists, is used to set the
|
||||
'shell' option. On MS-DOS and Win32, the COMSPEC variable is used
|
||||
'shell' option. On Windows, the COMSPEC variable is used
|
||||
if SHELL is not set.
|
||||
The environment variable TERM, if it exists, is used to set the 'term'
|
||||
option. However, 'term' will change later when starting the GUI (step
|
||||
8 below).
|
||||
|
||||
2. Process the arguments
|
||||
The options and file names from the command that start Vim are
|
||||
@@ -382,6 +380,8 @@ accordingly. Vim proceeds in this order:
|
||||
Places for your personal initializations:
|
||||
Unix $XDG_CONFIG_HOME/nvim/init.vim
|
||||
(default for $XDG_CONFIG_HOME is ~/.config)
|
||||
Windows $XDG_CONFIG_HOME/nvim/init.vim
|
||||
(default for $XDG_CONFIG_HOME is ~/AppData/Local)
|
||||
|
||||
The files are searched in the order specified above and only the first
|
||||
one that is found is read.
|
||||
@@ -394,7 +394,8 @@ accordingly. Vim proceeds in this order:
|
||||
All following initializations until 4. are skipped. $MYVIMRC is not
|
||||
set.
|
||||
"vim -u NORC" can be used to skip these initializations without
|
||||
reading a file. "vim -u NONE" also skips loading plugins. |-u|
|
||||
reading a file. "vim -u NONE" also skips plugins and syntax
|
||||
highlighting. |-u|
|
||||
|
||||
If Vim was started in Ex mode with the "-s" argument, all following
|
||||
initializations until 4. are skipped. Only the "-u" option is
|
||||
@@ -427,7 +428,22 @@ accordingly. Vim proceeds in this order:
|
||||
- The file ".exrc" (for Unix)
|
||||
"_exrc" (for Win32)
|
||||
|
||||
4. Load the plugin scripts. *load-plugins*
|
||||
4. Enable filetype and indent plugins.
|
||||
This does the same as the commands: >
|
||||
:runtime! filetype.vim
|
||||
:runtime! ftplugin.vim
|
||||
:runtime! indent.vim
|
||||
< This step is skipped if ":filetype ..." was called before now or if
|
||||
the "-u NONE" command line argument was given.
|
||||
|
||||
5. Enable syntax highlighting.
|
||||
This does the same as the command: >
|
||||
:runtime! syntax/syntax.vim
|
||||
< Note: This enables filetype detection even if ":filetype off" was
|
||||
called before now.
|
||||
This step is skipped if the "-u NONE" command line argument was given.
|
||||
|
||||
6. Load the plugin scripts. *load-plugins*
|
||||
This does the same as the command: >
|
||||
:runtime! plugin/**/*.vim
|
||||
< The result is that all directories in the 'runtimepath' option will be
|
||||
@@ -443,31 +459,30 @@ accordingly. Vim proceeds in this order:
|
||||
commands from the command line have not been executed yet. You can
|
||||
use "--cmd 'set noloadplugins'" |--cmd|.
|
||||
|
||||
5. Set 'shellpipe' and 'shellredir'
|
||||
7. Set 'shellpipe' and 'shellredir'
|
||||
The 'shellpipe' and 'shellredir' options are set according to the
|
||||
value of the 'shell' option, unless they have been set before.
|
||||
This means that Vim will figure out the values of 'shellpipe' and
|
||||
'shellredir' for you, unless you have set them yourself.
|
||||
|
||||
6. Set 'updatecount' to zero, if "-n" command argument used
|
||||
8. Set 'updatecount' to zero, if "-n" command argument used
|
||||
|
||||
7. Set binary options
|
||||
9. Set binary options
|
||||
If the "-b" flag was given to Vim, the options for binary editing will
|
||||
be set now. See |-b|.
|
||||
|
||||
8. Perform GUI initializations
|
||||
10. Perform GUI initializations
|
||||
Only when starting "gvim", the GUI initializations will be done. See
|
||||
|gui-init|.
|
||||
|
||||
9. Read the ShaDa file
|
||||
If the 'shada' option is not empty, the ShaDa file is read. See
|
||||
|shada-file|.
|
||||
11. Read the ShaDa file
|
||||
See |shada-file|.
|
||||
|
||||
10. Read the quickfix file
|
||||
12. Read the quickfix file
|
||||
If the "-q" flag was given to Vim, the quickfix file is read. If this
|
||||
fails, Vim exits.
|
||||
|
||||
11. Open all windows
|
||||
13. Open all windows
|
||||
When the |-o| flag was given, windows will be opened (but not
|
||||
displayed yet).
|
||||
When the |-p| flag was given, tab pages will be created (but not
|
||||
@@ -476,7 +491,7 @@ accordingly. Vim proceeds in this order:
|
||||
If the "-q" flag was given to Vim, the first error is jumped to.
|
||||
Buffers for all windows will be loaded.
|
||||
|
||||
12. Execute startup commands
|
||||
14. Execute startup commands
|
||||
If a "-t" flag was given to Vim, the tag is jumped to.
|
||||
The commands given with the |-c| and |+cmd| arguments are executed.
|
||||
The starting flag is reset, has("vim_starting") will now return zero.
|
||||
@@ -494,7 +509,7 @@ sessions. Put it in a place so that it will be found by 3b:
|
||||
Local setup:
|
||||
Put all commands that you need for editing a specific directory only into a
|
||||
vimrc file and place it in that directory under the name ".nvimrc" ("_nvimrc"
|
||||
for MS-DOS and Win32). NOTE: To make Vim look for these special files you
|
||||
for Windows). NOTE: To make Vim look for these special files you
|
||||
have to turn on the option 'exrc'. See |trojan-horse| too.
|
||||
|
||||
System setup:
|
||||
@@ -516,10 +531,9 @@ interfere with Vi, then use the variable VIMINIT and the file init.vim
|
||||
instead.
|
||||
|
||||
MS-DOS line separators:
|
||||
On MS-DOS-like systems (MS-DOS itself and Win32), Vim assumes that all
|
||||
the vimrc files have <CR> <NL> pairs as line separators. This will give
|
||||
problems if you have a file with only <NL>s and have a line like
|
||||
":map xx yy^M". The trailing ^M will be ignored.
|
||||
On Windows systems Vim assumes that all the vimrc files have <CR> <NL> pairs
|
||||
as line separators. This will give problems if you have a file with only
|
||||
<NL>s and have a line like ":map xx yy^M". The trailing ^M will be ignored.
|
||||
|
||||
The $MYVIMRC or $MYGVIMRC file will be set to the first found vimrc and/or
|
||||
gvimrc file.
|
||||
@@ -706,8 +720,8 @@ vimrc file.
|
||||
These commands will write ":map" and ":set" commands to a file, in such a way
|
||||
that when these commands are executed, the current key mappings and options
|
||||
will be set to the same values. The options 'columns', 'endofline',
|
||||
'fileformat', 'lines', 'modified', 'scroll', and 'term' are not included,
|
||||
because these are terminal or file dependent.
|
||||
'fileformat', 'lines', 'modified', and 'scroll' are not included, because
|
||||
these are terminal or file dependent.
|
||||
Note that the options 'binary', 'paste' and 'readonly' are included, this
|
||||
might not always be what you want.
|
||||
|
||||
@@ -947,7 +961,7 @@ about to abandon with ":bdel", use ":wsh". The '[' and ']' marks are not
|
||||
stored, but the '"' mark is. The '"' mark is very useful for jumping to the
|
||||
cursor position when the file was last exited. No marks are saved for files
|
||||
that start with any string given with the "r" flag in 'shada'. This can be
|
||||
used to avoid saving marks for files on removable media (for MS-DOS you would
|
||||
used to avoid saving marks for files on removable media (for Windows you would
|
||||
use "ra:,rb:".
|
||||
The |v:oldfiles| variable is filled with the file names that the ShaDa file
|
||||
has marks for.
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 7.4. Last change: 2015 Jan 07
|
||||
*syntax.txt* For Vim version 7.4. Last change: 2015 Sep 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -71,10 +71,10 @@ with: >
|
||||
For a color terminal see |:hi-normal-cterm|.
|
||||
For setting up your own colors syntax highlighting see |syncolor|.
|
||||
|
||||
NOTE: The syntax files on MS-DOS and Windows have lines that end in <CR><NL>.
|
||||
The files for Unix end in <NL>. This means you should use the right type of
|
||||
file for your system. Although on MS-DOS and Windows the right format is
|
||||
automatically selected if the 'fileformats' option is not empty.
|
||||
NOTE: The syntax files on Windows have lines that end in <CR><NL>. The files
|
||||
for Unix end in <NL>. This means you should use the right type of file for
|
||||
your system. Although on Windows the right format is automatically selected
|
||||
if the 'fileformats' option is not empty.
|
||||
|
||||
NOTE: When using reverse video ("gvim -fg white -bg black"), the default value
|
||||
of 'background' will not be set until the GUI window is opened, which is after
|
||||
@@ -206,7 +206,8 @@ thing. These are then linked to a highlight group that specifies the color.
|
||||
A syntax group name doesn't specify any color or attributes itself.
|
||||
|
||||
The name for a highlight or syntax group must consist of ASCII letters, digits
|
||||
and the underscore. As a regexp: "[a-zA-Z0-9_]*"
|
||||
and the underscore. As a regexp: "[a-zA-Z0-9_]*". However, Vim does not give
|
||||
an error when using other characters.
|
||||
|
||||
To be able to allow each user to pick his favorite set of colors, there must
|
||||
be preferred names for highlight groups that are common for many languages.
|
||||
@@ -416,18 +417,19 @@ and last line to be converted. Example, using the last set Visual area: >
|
||||
*:TOhtml*
|
||||
:[range]TOhtml The ":TOhtml" command is defined in a standard plugin.
|
||||
This command will source |2html.vim| for you. When a
|
||||
range is given, set |g:html_start_line| and
|
||||
|g:html_end_line| to the start and end of the range,
|
||||
respectively. Default range is the entire buffer.
|
||||
range is given, this command sets |g:html_start_line|
|
||||
and |g:html_end_line| to the start and end of the
|
||||
range, respectively. Default range is the entire
|
||||
buffer.
|
||||
|
||||
If the current window is part of a |diff|, unless
|
||||
|g:html_diff_one_file| is set, :TOhtml will convert
|
||||
all windows which are part of the diff in the current
|
||||
tab and place them side-by-side in a <table> element
|
||||
in the generated HTML. With |g:html_line_ids| you can
|
||||
jump to lines in specific windows with (for example)
|
||||
#W1L42 for line 42 in the first diffed window, or
|
||||
#W3L87 for line 87 in the third.
|
||||
If the current window is part of a |diff|, unless
|
||||
|g:html_diff_one_file| is set, :TOhtml will convert
|
||||
all windows which are part of the diff in the current
|
||||
tab and place them side-by-side in a <table> element
|
||||
in the generated HTML. With |g:html_line_ids| you can
|
||||
jump to lines in specific windows with (for example)
|
||||
#W1L42 for line 42 in the first diffed window, or
|
||||
#W3L87 for line 87 in the third.
|
||||
|
||||
Examples: >
|
||||
|
||||
@@ -741,6 +743,22 @@ and UTF-32 instead, use: >
|
||||
Note that documents encoded in either UTF-32 or UTF-16 have known
|
||||
compatibility problems with some major browsers.
|
||||
|
||||
*g:html_font*
|
||||
Default: "monospace"
|
||||
You can specify the font or fonts used in the converted document using
|
||||
g:html_font. If this option is set to a string, then the value will be
|
||||
surrounded with single quotes. If this option is set to a list then each list
|
||||
item is surrounded by single quotes and the list is joined with commas. Either
|
||||
way, "monospace" is added as the fallback generic family name and the entire
|
||||
result used as the font family (using CSS) or font face (if not using CSS).
|
||||
Examples: >
|
||||
|
||||
" font-family: 'Consolas', monospace;
|
||||
:let g:html_font = "Consolas"
|
||||
|
||||
" font-family: 'DejaVu Sans Mono', 'Consolas', monospace;
|
||||
:let g:html_font = ["DejaVu Sans Mono", "Consolas"]
|
||||
<
|
||||
*convert-to-XML* *convert-to-XHTML* *g:html_use_xhtml*
|
||||
Default: 0.
|
||||
When 0, generate standard HTML 4.01 (strict when possible).
|
||||
@@ -1130,6 +1148,8 @@ there are very long lines in the file. To disable translations: >
|
||||
|
||||
:let diff_translations = 0
|
||||
|
||||
Also see |diff-slow|.
|
||||
|
||||
|
||||
DIRCOLORS *dircolors.vim* *ft-dircolors-syntax*
|
||||
|
||||
@@ -3304,6 +3324,32 @@ must not click outside of the pixel strings, but feel free to improve it.
|
||||
It will look much better with a font in a quadratic cell size, e.g. for X: >
|
||||
:set guifont=-*-clean-medium-r-*-*-8-*-*-*-*-80-*
|
||||
|
||||
|
||||
YAML *yaml.vim* *ft-yaml-syntax*
|
||||
|
||||
*g:yaml_schema* *b:yaml_schema*
|
||||
A YAML schema is a combination of a set of tags and a mechanism for resolving
|
||||
non-specific tags. For user this means that YAML parser may, depending on
|
||||
plain scalar contents, treat plain scalar (which can actually be only string
|
||||
and nothing else) as a value of the other type: null, boolean, floating-point,
|
||||
integer. `g:yaml_schema` option determines according to which schema values
|
||||
will be highlighted specially. Supported schemas are
|
||||
|
||||
Schema Description ~
|
||||
failsafe No additional highlighting.
|
||||
json Supports JSON-style numbers, booleans and null.
|
||||
core Supports more number, boolean and null styles.
|
||||
pyyaml In addition to core schema supports highlighting timestamps,
|
||||
but there are some differences in what is recognized as
|
||||
numbers and many additional boolean values not present in core
|
||||
schema.
|
||||
|
||||
Default schema is `core`.
|
||||
|
||||
Note that schemas are not actually limited to plain scalars, but this is the
|
||||
only difference between schemas defined in YAML specification and the only
|
||||
difference defined in the syntax file.
|
||||
|
||||
==============================================================================
|
||||
5. Defining a syntax *:syn-define* *E410*
|
||||
|
||||
@@ -3401,7 +3447,7 @@ DEFINING KEYWORDS *:syn-keyword*
|
||||
:syntax keyword Type contained int long char
|
||||
:syntax keyword Type int long contained char
|
||||
:syntax keyword Type int long char contained
|
||||
< *E789*
|
||||
< *E789* *E890*
|
||||
When you have a keyword with an optional tail, like Ex commands in
|
||||
Vim, you can put the optional characters inside [], to define all the
|
||||
variations at once: >
|
||||
@@ -3655,6 +3701,7 @@ Whether or not it is actually concealed depends on the value of the
|
||||
'conceallevel' option. The 'concealcursor' option is used to decide whether
|
||||
concealable items in the current line are displayed unconcealed to be able to
|
||||
edit the line.
|
||||
Another way to conceal text with with |matchadd()|.
|
||||
|
||||
concealends *:syn-concealends*
|
||||
|
||||
@@ -4236,7 +4283,7 @@ If the "maxlines={N}" argument is given, the number of lines that are searched
|
||||
for a comment or syncing pattern is restricted to N lines backwards (after
|
||||
adding "minlines"). This is useful if you have few things to sync on and a
|
||||
slow machine. Example: >
|
||||
:syntax sync ccomment maxlines=500
|
||||
:syntax sync maxlines=500 ccomment
|
||||
<
|
||||
*:syn-sync-linebreaks*
|
||||
When using a pattern that matches multiple lines, a change in one line may
|
||||
@@ -4504,7 +4551,7 @@ mentioned for the default values. See |:verbose-cmd| for more information.
|
||||
*highlight-args* *E416* *E417* *E423*
|
||||
There are three types of terminals for highlighting:
|
||||
term a normal terminal (vt100, xterm)
|
||||
cterm a color terminal (MS-DOS console, color-xterm, these have the "Co"
|
||||
cterm a color terminal (Windows console, color-xterm, these have the "Co"
|
||||
termcap entry)
|
||||
gui the GUI
|
||||
|
||||
@@ -4629,6 +4676,8 @@ ctermbg={color-nr} *highlight-ctermbg*
|
||||
Note that for some color terminals these names may result in the wrong
|
||||
colors!
|
||||
|
||||
You can also use "NONE" to remove the color.
|
||||
|
||||
*:hi-normal-cterm*
|
||||
When setting the "ctermfg" or "ctermbg" colors for the Normal group,
|
||||
these will become the colors used for the non-highlighted text.
|
||||
@@ -4650,7 +4699,7 @@ ctermbg={color-nr} *highlight-ctermbg*
|
||||
*E419* *E420*
|
||||
When Vim knows the normal foreground and background colors, "fg" and
|
||||
"bg" can be used as color names. This only works after setting the
|
||||
colors for the Normal group and for the MS-DOS console. Example, for
|
||||
colors for the Normal group and for the Windows console. Example, for
|
||||
reverse video: >
|
||||
:highlight Visual ctermfg=bg ctermbg=fg
|
||||
< Note that the colors are used that are valid at the moment this
|
||||
@@ -4676,7 +4725,7 @@ font={font-name} *highlight-font*
|
||||
When setting the font for the "Normal" group, this becomes the default
|
||||
font (until the 'guifont' option is changed; the last one set is
|
||||
used).
|
||||
The following only works with Motif and Athena, not with other GUIs:
|
||||
The following only works with Motif not with other GUIs:
|
||||
When setting the font for the "Menu" group, the menus will be changed.
|
||||
When setting the font for the "Tooltip" group, the tooltips will be
|
||||
changed.
|
||||
@@ -4864,11 +4913,6 @@ Menu Current font, background and foreground colors of the menus.
|
||||
Also used for the toolbar.
|
||||
Applicable highlight arguments: font, guibg, guifg.
|
||||
|
||||
NOTE: For Motif and Athena the font argument actually
|
||||
specifies a fontset at all times, no matter if 'guifontset' is
|
||||
empty, and as such it is tied to the current |:language| when
|
||||
set.
|
||||
|
||||
*hl-Scrollbar*
|
||||
Scrollbar Current background and foreground of the main window's
|
||||
scrollbars.
|
||||
@@ -4878,11 +4922,6 @@ Scrollbar Current background and foreground of the main window's
|
||||
Tooltip Current font, background and foreground of the tooltips.
|
||||
Applicable highlight arguments: font, guibg, guifg.
|
||||
|
||||
NOTE: For Motif and Athena the font argument actually
|
||||
specifies a fontset at all times, no matter if 'guifontset' is
|
||||
empty, and as such it is tied to the current |:language| when
|
||||
set.
|
||||
|
||||
==============================================================================
|
||||
13. Linking groups *:hi-link* *:highlight-link* *E412* *E413*
|
||||
|
||||
|
@@ -48,8 +48,8 @@ A double click with the mouse in the non-GUI tab pages line opens a new, empty
|
||||
tab page. It is placed left of the position of the click. The first click
|
||||
may select another tab page first, causing an extra screen update.
|
||||
|
||||
This also works in a few GUI versions, esp. Win32 and Motif. But only when
|
||||
clicking right of the labels.
|
||||
This also works in a few GUI versions, esp. Win32. But only when clicking
|
||||
right of the labels.
|
||||
|
||||
In the GUI tab pages line you can use the right mouse button to open menu.
|
||||
|tabline-menu|.
|
||||
@@ -197,22 +197,29 @@ REORDERING TAB PAGES:
|
||||
Move the current tab page to after tab page N. Use zero to
|
||||
make the current tab page the first one. Without N the tab
|
||||
page is made the last one. >
|
||||
:.tabmove " do nothing
|
||||
:-tabmove " move the tab page to the left
|
||||
:tabmove " move the tab page to the right
|
||||
:.tabmove " as above
|
||||
:+tabmove " as above
|
||||
:+tabmove " move the tab page to the right
|
||||
:0tabmove " move the tab page to the beginning of the tab
|
||||
" list
|
||||
:$tabmove " move the tab page to the end of the tab list
|
||||
<
|
||||
:tabmove 0 " as above
|
||||
:tabmove " move the tab page to the last
|
||||
:$tabmove " as above
|
||||
:tabmove $ " as above
|
||||
|
||||
:tabm[ove] +[N]
|
||||
:tabm[ove] -[N]
|
||||
Move the current tab page N places to the right (with +) or to
|
||||
the left (with -).
|
||||
the left (with -). >
|
||||
:tabmove - " move the tab page to the left
|
||||
:tabmove -1 " as above
|
||||
:tabmove + " move the tab page to the right
|
||||
:tabmove +1 " as above
|
||||
|
||||
|
||||
Note that although it is possible to move a tab behind the N-th one by using
|
||||
:Ntabmove, it is impossible to move it by N places by using :+Ntabmove. For
|
||||
clarification what +N means in this context see |[range]|.
|
||||
:Ntabmove. And move it by N places by using :+Ntabmove. For clarification what
|
||||
+N means in this context see |[range]|.
|
||||
|
||||
|
||||
LOOPING OVER TAB PAGES:
|
||||
@@ -234,7 +241,8 @@ LOOPING OVER TAB PAGES:
|
||||
current tab page.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
{cmd} must not open or close tab pages or reorder them.
|
||||
Also see |:windo|, |:argdo| and |:bufdo|.
|
||||
Also see |:windo|, |:argdo|, |:bufdo|, |:cdo|, |:ldo|, |:cfdo|
|
||||
and |:lfdo|.
|
||||
|
||||
==============================================================================
|
||||
3. Other items *tab-page-other*
|
||||
@@ -265,8 +273,8 @@ window on the same buffer and then edit another buffer. Thus ":tabnew"
|
||||
triggers:
|
||||
WinLeave leave current window
|
||||
TabLeave leave current tab page
|
||||
TabEnter enter new tab page
|
||||
WinEnter enter window in new tab page
|
||||
TabEnter enter new tab page
|
||||
BufLeave leave current buffer
|
||||
BufEnter enter new empty buffer
|
||||
|
||||
@@ -274,8 +282,8 @@ When switching to another tab page the order is:
|
||||
BufLeave
|
||||
WinLeave
|
||||
TabLeave
|
||||
TabEnter
|
||||
WinEnter
|
||||
TabEnter
|
||||
BufEnter
|
||||
|
||||
When entering a new tab page (|:tabnew|), TabNew is triggered before TabEnter
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 7.4. Last change: 2014 May 13
|
||||
*term.txt* For Vim version 7.4. Last change: 2015 Feb 23
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -357,7 +357,7 @@ adjust the various t_ codes. This avoids the problem that the xterm can
|
||||
produce different codes, depending on the mode it is in (8-bit, VT102,
|
||||
VT220, etc.). The result is that codes like <xF1> are no longer needed.
|
||||
Note: This is only done on startup. If the xterm options are changed after
|
||||
Vim has started, the escape sequences may not be recognized any more.
|
||||
Vim has started, the escape sequences may not be recognized anymore.
|
||||
|
||||
*xterm-resize*
|
||||
Window resizing with xterm only works if the allowWindowOps resource is
|
||||
@@ -425,11 +425,9 @@ cleared when scrolling).
|
||||
Unfortunately it is not possible to deduce from the termcap how cursor
|
||||
positioning should be done when using a scrolling region: Relative to the
|
||||
beginning of the screen or relative to the beginning of the scrolling region.
|
||||
Most terminals use the first method. A known exception is the MS-DOS console
|
||||
(pcterm). The 't_CS' option should be set to any string when cursor
|
||||
positioning is relative to the start of the scrolling region. It should be
|
||||
set to an empty string otherwise. It defaults to "yes" when 'term' is
|
||||
"pcterm".
|
||||
Most terminals use the first method. The 't_CS' option should be set to any
|
||||
string when cursor positioning is relative to the start of the scrolling
|
||||
region. It should be set to an empty string otherwise.
|
||||
|
||||
Note for xterm users: The shifted cursor keys normally don't work. You can
|
||||
make them work with the xmodmap command and some mappings in Vim.
|
||||
@@ -672,10 +670,9 @@ border, the text is scrolled.
|
||||
A selection can be started by pressing the left mouse button on the first
|
||||
character, moving the mouse to the last character, then releasing the mouse
|
||||
button. You will not always see the selection until you release the button,
|
||||
only in some versions (GUI, MS-DOS, WIN32) will the dragging be shown
|
||||
immediately. Note that you can make the text scroll by moving the mouse at
|
||||
least one character in the first/last line in the window when 'scrolloff' is
|
||||
non-zero.
|
||||
only in some versions (GUI, Windows) will the dragging be shown immediately.
|
||||
Note that you can make the text scroll by moving the mouse at least one
|
||||
character in the first/last line in the window when 'scrolloff' is non-zero.
|
||||
|
||||
In Normal, Visual and Select mode clicking the right mouse button causes the
|
||||
Visual area to be extended. When 'mousemodel' is "popup", the left button has
|
||||
@@ -689,9 +686,9 @@ work on systems where the window manager consumes the mouse events when the
|
||||
alt key is pressed (it may move the window).
|
||||
|
||||
*double-click*
|
||||
Double, triple and quadruple clicks are supported when the GUI is active,
|
||||
for MS-DOS and Win32, and for an xterm (if the gettimeofday() function is
|
||||
available). For selecting text, extra clicks extend the selection:
|
||||
Double, triple and quadruple clicks are supported when the GUI is active, for
|
||||
Windows and for an xterm. For selecting text, extra clicks extend the
|
||||
selection:
|
||||
click select ~
|
||||
double word or % match *<2-LeftMouse>*
|
||||
triple line *<3-LeftMouse>*
|
||||
|
@@ -190,7 +190,7 @@ child, you should have the intention to do this for at least one year.
|
||||
|
||||
How do you know that the money will be spent right? First of all you have my
|
||||
personal guarantee as the author of Vim. I trust the people that are working
|
||||
at the centre, I know them personally. Further more, the centre has been
|
||||
at the centre, I know them personally. Furthermore, the centre has been
|
||||
co-sponsored and inspected by World Vision, Save the Children Fund and is now
|
||||
under the supervision of Pacific Academy Outreach Society. The centre is
|
||||
visited about once a year to check the progress (at our own cost). I have
|
||||
|
@@ -250,8 +250,8 @@ ignored if its owner differs from the owner of the edited file, except when
|
||||
the owner of the undo file is the current user. Set 'verbose' to get a
|
||||
message about that when opening a file.
|
||||
|
||||
Undo files are normally saved in the same directory as the file. This can be
|
||||
changed with the 'undodir' option.
|
||||
Location of the undo files is controlled by the 'undodir' option, by default
|
||||
they are saved to the dedicated directory in the application data folder.
|
||||
|
||||
You can also save and restore undo histories by using ":wundo" and ":rundo"
|
||||
respectively:
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*usr_02.txt* For Vim version 7.4. Last change: 2010 Jul 20
|
||||
*usr_02.txt* For Vim version 7.4. Last change: 2015 Apr 12
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -29,11 +29,10 @@ To start Vim, enter this command: >
|
||||
|
||||
gvim file.txt
|
||||
|
||||
In UNIX you can type this at any command prompt. If you are running Microsoft
|
||||
Windows, open an MS-DOS prompt window and enter the command.
|
||||
In either case, Vim starts editing a file called file.txt. Because this
|
||||
is a new file, you get a blank window. This is what your screen will look
|
||||
like:
|
||||
On Unix you can type this at any command prompt. If you are running Windows,
|
||||
open a command prompt window and enter the command. In either case, Vim
|
||||
starts editing a file called file.txt. Because this is a new file, you get a
|
||||
blank window. This is what your screen will look like:
|
||||
|
||||
+---------------------------------------+
|
||||
|# |
|
||||
@@ -61,10 +60,9 @@ use this command: >
|
||||
|
||||
the editing occurs inside your command window. In other words, if you are
|
||||
running inside an xterm, the editor uses your xterm window. If you are using
|
||||
an MS-DOS command prompt window under Microsoft Windows, the editing occurs
|
||||
inside this window. The text in the window will look the same for both
|
||||
versions, but with gvim you have extra features, like a menu bar. More about
|
||||
that later.
|
||||
the command prompt under Microsoft Windows, the editing occurs inside this
|
||||
window. The text in the window will look the same for both versions, but with
|
||||
gvim you have extra features, like a menu bar. More about that later.
|
||||
|
||||
==============================================================================
|
||||
*02.2* Inserting text
|
||||
@@ -80,7 +78,7 @@ mistakes; you can correct them later. To enter the following programmer's
|
||||
limerick, this is what you type: >
|
||||
|
||||
iA very intelligent turtle
|
||||
Found programming UNIX a hurdle
|
||||
Found programming Unix a hurdle
|
||||
|
||||
After typing "turtle" you press the <Enter> key to start a new line. Finally
|
||||
you press the <Esc> key to stop Insert mode and go back to Normal mode. You
|
||||
@@ -88,7 +86,7 @@ now have two lines of text in your Vim window:
|
||||
|
||||
+---------------------------------------+
|
||||
|A very intelligent turtle |
|
||||
|Found programming UNIX a hurdle |
|
||||
|Found programming Unix a hurdle |
|
||||
|~ |
|
||||
|~ |
|
||||
| |
|
||||
@@ -110,7 +108,7 @@ of the window. This indicates you are in Insert mode.
|
||||
|
||||
+---------------------------------------+
|
||||
|A very intelligent turtle |
|
||||
|Found programming UNIX a hurdle |
|
||||
|Found programming Unix a hurdle |
|
||||
|~ |
|
||||
|~ |
|
||||
|-- INSERT -- |
|
||||
@@ -187,7 +185,7 @@ look like this:
|
||||
|
||||
+---------------------------------------+
|
||||
|intelligent turtle |
|
||||
|Found programming UNIX a hurdle |
|
||||
|Found programming Unix a hurdle |
|
||||
|~ |
|
||||
|~ |
|
||||
| |
|
||||
@@ -202,7 +200,7 @@ insert mode (the final <Esc>). The result:
|
||||
|
||||
+---------------------------------------+
|
||||
|A young intelligent turtle |
|
||||
|Found programming UNIX a hurdle |
|
||||
|Found programming Unix a hurdle |
|
||||
|~ |
|
||||
|~ |
|
||||
| |
|
||||
@@ -215,7 +213,7 @@ To delete a whole line use the "dd" command. The following line will
|
||||
then move up to fill the gap:
|
||||
|
||||
+---------------------------------------+
|
||||
|Found programming UNIX a hurdle |
|
||||
|Found programming Unix a hurdle |
|
||||
|~ |
|
||||
|~ |
|
||||
|~ |
|
||||
@@ -332,7 +330,7 @@ Insert mode. Then you can type the text for the new line.
|
||||
Suppose the cursor is somewhere in the first of these two lines:
|
||||
|
||||
A very intelligent turtle ~
|
||||
Found programming UNIX a hurdle ~
|
||||
Found programming Unix a hurdle ~
|
||||
|
||||
If you now use the "o" command and type new text: >
|
||||
|
||||
@@ -342,7 +340,7 @@ The result is:
|
||||
|
||||
A very intelligent turtle ~
|
||||
That liked using Vim ~
|
||||
Found programming UNIX a hurdle ~
|
||||
Found programming Unix a hurdle ~
|
||||
|
||||
The "O" command (uppercase) opens a line above the cursor.
|
||||
|
||||
@@ -518,9 +516,11 @@ Summary: *help-summary* >
|
||||
:help subject()
|
||||
< Function "subject". >
|
||||
:help -subject
|
||||
< Command-line option "-subject". >
|
||||
< Command-line argument "-subject". >
|
||||
:help +subject
|
||||
< Compile-time feature "+subject". >
|
||||
:help /*
|
||||
< Regular expression item "*" >
|
||||
:help EventName
|
||||
< Autocommand event "EventName". >
|
||||
:help digraphs.txt
|
||||
|
@@ -528,7 +528,7 @@ MATCHING ANY SINGLE CHARACTER
|
||||
|
||||
The . (dot) character matches any existing character. For example, the
|
||||
pattern "c.m" matches a string whose first character is a c, whose second
|
||||
character is anything, and whose the third character is m. Example:
|
||||
character is anything, and whose third character is m. Example:
|
||||
|
||||
We use a computer that became the cummin winter. ~
|
||||
xxx xxx xxx
|
||||
|
@@ -37,9 +37,10 @@ for you), you can edit it this way: >
|
||||
If you don't have a vimrc file yet, see |init.vim| to find out where you can
|
||||
create a vimrc file.
|
||||
|
||||
For Unix and Macintosh this file is always used and is recommended:
|
||||
This file is always used and is recommended:
|
||||
|
||||
~/.config/nvim/init.vim ~
|
||||
~/.config/nvim/init.vim (Unix and OSX) ~
|
||||
~/AppData/Local/nvim/init.vim (Windows) ~
|
||||
|
||||
The vimrc file can contain all the commands that you type after a colon. The
|
||||
most simple ones are for setting options. For example, if you want Vim to
|
||||
@@ -285,7 +286,6 @@ Where can you find plugins?
|
||||
- You could write one yourself, see |write-plugin|.
|
||||
|
||||
Some plugins come as a vimball archive, see |vimball|.
|
||||
Some plugins can be updated automatically, see |getscript|.
|
||||
|
||||
|
||||
USING A GLOBAL PLUGIN
|
||||
|
@@ -152,7 +152,7 @@ You could also write your own color scheme. This is how you do it:
|
||||
directory. For Unix, this should work: >
|
||||
|
||||
!mkdir -p ~/.config/nvim/colors
|
||||
!cp $VIMRUNTIME/colors/morning.vim ~/.vim/colors/mine.vim
|
||||
!cp $VIMRUNTIME/colors/morning.vim ~/.config/nvim/colors/mine.vim
|
||||
<
|
||||
This is done from Vim, because it knows the value of $VIMRUNTIME.
|
||||
|
||||
|
@@ -134,10 +134,10 @@ The following command makes the mouse work like a Microsoft Windows mouse: >
|
||||
|
||||
:behave mswin
|
||||
|
||||
The default behavior of the mouse on UNIX systems is xterm. The default
|
||||
behavior on a Microsoft Windows system is selected during the installation
|
||||
process. For details about what the two behaviors are, see |:behave|. Here
|
||||
follows a summary.
|
||||
The default behavior of the mouse on Unix systems is xterm. The default
|
||||
behavior on Windows systems is selected during the installation process. For
|
||||
details about what the two behaviors are, see |:behave|. Here follows a
|
||||
summary.
|
||||
|
||||
|
||||
XTERM MOUSE BEHAVIOR
|
||||
|
@@ -698,10 +698,10 @@ still be something that an external command can do better or faster.
|
||||
through an external program. In other words, it runs the system command
|
||||
represented by {program}, giving it the block of text represented by {motion}
|
||||
as input. The output of this command then replaces the selected block.
|
||||
Because this summarizes badly if you are unfamiliar with UNIX filters, take
|
||||
Because this summarizes badly if you are unfamiliar with Unix filters, take
|
||||
a look at an example. The sort command sorts a file. If you execute the
|
||||
following command, the unsorted file input.txt will be sorted and written to
|
||||
output.txt. (This works on both UNIX and Microsoft Windows.) >
|
||||
output.txt. This works on both Unix and Windows. >
|
||||
|
||||
sort <input.txt >output.txt
|
||||
|
||||
|
@@ -293,7 +293,6 @@ If you really don't want to see this message, you can add the 'A' flag to the
|
||||
'updatecount' Number of key strokes after which the swap file is flushed to
|
||||
disk.
|
||||
'updatetime' Timeout after which the swap file is flushed to disk.
|
||||
'swapsync' Whether the disk is synced when the swap file is flushed.
|
||||
'directory' List of directory names where to store the swap file.
|
||||
'maxmem' Limit for memory usage before writing text to the swap file.
|
||||
'maxmemtot' Same, but for all files in total.
|
||||
|
@@ -309,7 +309,7 @@ matches can be found.
|
||||
==============================================================================
|
||||
*12.8* Find where a word is used
|
||||
|
||||
If you are a UNIX user, you can use a combination of Vim and the grep command
|
||||
If you are a Unix user, you can use a combination of Vim and the grep command
|
||||
to edit all the files that contain a given word. This is extremely useful if
|
||||
you are working on a program and want to view or edit all the files that
|
||||
contain a specific variable.
|
||||
@@ -324,7 +324,7 @@ will only list the files containing the word and not print the matching lines.
|
||||
The word it is searching for is "frame_counter". Actually, this can be any
|
||||
regular expression. (Note: What grep uses for regular expressions is not
|
||||
exactly the same as what Vim uses.)
|
||||
The entire command is enclosed in backticks (`). This tells the UNIX shell
|
||||
The entire command is enclosed in backticks (`). This tells the Unix shell
|
||||
to run this command and pretend that the results were typed on the command
|
||||
line. So what happens is that the grep command is run and produces a list of
|
||||
files, these files are put on the Vim command line. This results in Vim
|
||||
|
@@ -70,9 +70,7 @@ difference. Without it executes the program normally, with the range a number
|
||||
of text lines is filtered through the program.
|
||||
|
||||
Executing a whole row of programs this way is possible. But a shell is much
|
||||
better at it. You can start a new shell this way: >
|
||||
|
||||
:shell
|
||||
better at it. You can start a new shell with |:terminal|.
|
||||
|
||||
This is similar to using CTRL-Z to suspend Vim. The difference is that a new
|
||||
shell is started.
|
||||
|
@@ -25,7 +25,7 @@ Back in the early days, the old Teletype machines used two characters to
|
||||
start a new line. One to move the carriage back to the first position
|
||||
(carriage return, <CR>), another to move the paper up (line feed, <LF>).
|
||||
When computers came out, storage was expensive. Some people decided that
|
||||
they did not need two characters for end-of-line. The UNIX people decided
|
||||
they did not need two characters for end-of-line. The Unix people decided
|
||||
they could use <Line Feed> only for end-of-line. The Apple people
|
||||
standardized on <CR>. The MS-DOS (and Microsoft Windows) folks decided to
|
||||
keep the old <CR><LF>.
|
||||
@@ -34,7 +34,7 @@ have line-break problems. The Vim editor automatically recognizes the
|
||||
different file formats and handles things properly behind your back.
|
||||
The option 'fileformats' contains the various formats that will be tried
|
||||
when a new file is edited. The following command, for example, tells Vim to
|
||||
try UNIX format first and MS-DOS format second: >
|
||||
try Unix format first and MS-DOS format second: >
|
||||
|
||||
:set fileformats=unix,dos
|
||||
|
||||
@@ -97,12 +97,12 @@ CONVERSION
|
||||
|
||||
You can use the 'fileformat' option to convert from one file format to
|
||||
another. Suppose, for example, that you have an MS-DOS file named README.TXT
|
||||
that you want to convert to UNIX format. Start by editing the MS-DOS format
|
||||
that you want to convert to Unix format. Start by editing the MS-DOS format
|
||||
file: >
|
||||
vim README.TXT
|
||||
|
||||
Vim will recognize this as a dos format file. Now change the file format to
|
||||
UNIX: >
|
||||
Unix: >
|
||||
|
||||
:set fileformat=unix
|
||||
:write
|
||||
|
@@ -563,9 +563,9 @@ that combination. Thus CTRL-K dP also works. Since there is no digraph for
|
||||
"dP" Vim will also search for a "Pd" digraph.
|
||||
|
||||
Note:
|
||||
The digraphs depend on the character set that Vim assumes you are
|
||||
using. On MS-DOS they are different from MS-Windows. Always use
|
||||
":digraphs" to find out which digraphs are currently available.
|
||||
The digraphs depend on the character set that Vim assumes you
|
||||
are using. Always use ":digraphs" to find out which digraphs are
|
||||
currently available.
|
||||
|
||||
You can define your own digraphs. Example: >
|
||||
|
||||
|
@@ -83,7 +83,7 @@ matter if 'ignorecase' or 'smartcase' was changed.
|
||||
|
||||
Note:
|
||||
If your search takes much longer than you expected, you can interrupt
|
||||
it with CTRL-C on Unix and CTRL-Break on MS-DOS and MS-Windows.
|
||||
it with CTRL-C on Unix and CTRL-Break on Windows.
|
||||
|
||||
==============================================================================
|
||||
*27.2* Wrapping around the file end
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 7.4. Last change: 2014 Aug 16
|
||||
*usr_41.txt* For Vim version 7.4. Last change: 2015 Nov 30
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -888,6 +888,11 @@ Mappings: *mapping-functions*
|
||||
maparg() get rhs of a mapping
|
||||
wildmenumode() check if the wildmode is active
|
||||
|
||||
Testing: *test-functions*
|
||||
assert_equal() assert that two expressions values are equal
|
||||
assert_false() assert that an expression is false
|
||||
assert_true() assert that an expression is true
|
||||
|
||||
Various: *various-functions*
|
||||
mode() get current editing mode
|
||||
visualmode() last visual mode used
|
||||
@@ -1494,8 +1499,8 @@ Here is a summary of items that apply to Vim scripts. They are also mentioned
|
||||
elsewhere, but form a nice checklist.
|
||||
|
||||
The end-of-line character depends on the system. For Unix a single <NL>
|
||||
character is used. For MS-DOS, Windows and the like, <CR><LF> is used.
|
||||
This is important when using mappings that end in a <CR>. See |:source_crnl|.
|
||||
character is used. For Windows <CR><LF> is used. This is important when
|
||||
using mappings that end in a <CR>. See |:source_crnl|.
|
||||
|
||||
|
||||
WHITE SPACE
|
||||
@@ -2465,8 +2470,6 @@ utility is recommended.
|
||||
For utmost portability use Vim itself to pack scripts together. This can be
|
||||
done with the Vimball utility. See |vimball|.
|
||||
|
||||
It's good if you add a line to allow automatic updating. See |glvs-plugins|.
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_42.txt| Add new menus
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user