mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
Compare commits
1034 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f4f80a238b | ||
![]() |
90e8bdc898 | ||
![]() |
666714f74f | ||
![]() |
52a830fec6 | ||
![]() |
47d44e00a2 | ||
![]() |
c54ccfbb52 | ||
![]() |
55844eee10 | ||
![]() |
c8d830e896 | ||
![]() |
1a9be28c75 | ||
![]() |
28d3def5b0 | ||
![]() |
6eda7c0e5f | ||
![]() |
8eb8ebf905 | ||
![]() |
f3645e422f | ||
![]() |
51c7818d42 | ||
![]() |
b8643f69c1 | ||
![]() |
4b8f27338f | ||
![]() |
14c9b30f2e | ||
![]() |
6e8757255e | ||
![]() |
7558f42f7d | ||
![]() |
62c0d99474 | ||
![]() |
e4d1bf7177 | ||
![]() |
5f0c76b243 | ||
![]() |
a9e0d734d7 | ||
![]() |
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 | ||
![]() |
0409cfded5 | ||
![]() |
a16d4a2b62 | ||
![]() |
712f057ed9 | ||
![]() |
92d4dfdca5 | ||
![]() |
c6eeefa339 | ||
![]() |
b32396170f | ||
![]() |
a1493215a2 | ||
![]() |
b01db02de4 | ||
![]() |
62321e5132 | ||
![]() |
ba1348edc5 | ||
![]() |
0f604e1da2 | ||
![]() |
8d5e60d8af | ||
![]() |
2ab9e96742 | ||
![]() |
a6d0e3696c | ||
![]() |
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 | ||
![]() |
4a1c36e953 | ||
![]() |
e29f0bbf64 | ||
![]() |
12b23070d4 | ||
![]() |
655f1b7513 | ||
![]() |
07eaff7c26 | ||
![]() |
0ee33981e8 | ||
![]() |
78e7c4066e | ||
![]() |
483d4abee7 | ||
![]() |
330794fb05 | ||
![]() |
f4656498a8 | ||
![]() |
826f474ef0 | ||
![]() |
84da3e6bbb | ||
![]() |
64a9972e7c | ||
![]() |
41523c28e7 | ||
![]() |
798fe6cfa3 | ||
![]() |
da9cf043a6 | ||
![]() |
f22dfeb00d | ||
![]() |
7d42e9b7e8 | ||
![]() |
982f3c26fa | ||
![]() |
1968f4898a | ||
![]() |
cff1e9e0b6 | ||
![]() |
a03af86cc2 | ||
![]() |
4af822fa09 | ||
![]() |
7353e1d62b | ||
![]() |
8c00c34b91 | ||
![]() |
597547e797 | ||
![]() |
972b43459b | ||
![]() |
538a57cfd8 | ||
![]() |
0af56a0ec7 | ||
![]() |
cf673f60c6 | ||
![]() |
d9c0293824 | ||
![]() |
21956adb6e | ||
![]() |
fe9d91ceb6 | ||
![]() |
09f6066bb4 | ||
![]() |
789041c282 | ||
![]() |
119545190c | ||
![]() |
54b0c09685 | ||
![]() |
b9139e009f | ||
![]() |
53ee6425c8 | ||
![]() |
951714ede6 | ||
![]() |
8496b71dc1 | ||
![]() |
eea072690b | ||
![]() |
d3dbaa321b | ||
![]() |
d873084581 | ||
![]() |
5bc6e0dc74 | ||
![]() |
28e59cb223 | ||
![]() |
d54338f1e0 | ||
![]() |
091b6e216c | ||
![]() |
8dea8a036f | ||
![]() |
4f24b9e06f | ||
![]() |
5361dedc77 | ||
![]() |
f7c4770572 | ||
![]() |
9a349f9f3e | ||
![]() |
12cd633ad2 | ||
![]() |
835d2c132d | ||
![]() |
ced7ee5b00 | ||
![]() |
3618240480 | ||
![]() |
5da7ea98ca | ||
![]() |
69770c6cc6 | ||
![]() |
d9e7a5a4cf | ||
![]() |
36f6863969 | ||
![]() |
4f569333db | ||
![]() |
af5483089e | ||
![]() |
57a5745c95 | ||
![]() |
fdfdd6e155 | ||
![]() |
84a5709a86 | ||
![]() |
80cf03602e | ||
![]() |
53f44310d7 | ||
![]() |
acadfc20c4 | ||
![]() |
02478686f1 | ||
![]() |
87e2a1ee40 | ||
![]() |
b98cea909f | ||
![]() |
369c1fdb25 | ||
![]() |
d9fbc1865b | ||
![]() |
4a69e55f39 | ||
![]() |
32ecd75a16 | ||
![]() |
4afd386276 | ||
![]() |
818f926eb0 | ||
![]() |
4680b4f3b1 | ||
![]() |
97cee2c2e3 | ||
![]() |
6329fd420e | ||
![]() |
442cd0672b | ||
![]() |
ec8e60a055 | ||
![]() |
321db59ca1 | ||
![]() |
98f9ff730b | ||
![]() |
8d07058097 | ||
![]() |
b1d7b5294a | ||
![]() |
a86d4b323e | ||
![]() |
cfa2107e33 | ||
![]() |
1fbb56795d | ||
![]() |
959f2601f9 | ||
![]() |
f480b38a2f | ||
![]() |
33eb33bb62 | ||
![]() |
ed06071f1f | ||
![]() |
d4f3d819d8 | ||
![]() |
86ce65ebe9 | ||
![]() |
3f7a465535 | ||
![]() |
91c5135f71 | ||
![]() |
9b8ac827b4 | ||
![]() |
660f12f5b3 | ||
![]() |
ec847af48d | ||
![]() |
9fcd444036 | ||
![]() |
ac4db4b814 | ||
![]() |
be72048a8e | ||
![]() |
46cb0ffc91 | ||
![]() |
2975e66af4 | ||
![]() |
4cfda1ff7d | ||
![]() |
1c43452afc | ||
![]() |
1d9ae27e38 | ||
![]() |
08a1eb7ae1 | ||
![]() |
3f7f14c0c7 | ||
![]() |
846fe25111 | ||
![]() |
eed4df33f9 | ||
![]() |
81f32bd153 | ||
![]() |
6cfb81eaa7 | ||
![]() |
70f6b0f338 | ||
![]() |
a9dfcb7e02 | ||
![]() |
d12f328b60 | ||
![]() |
7c32d86f7d | ||
![]() |
12e53ca95c | ||
![]() |
9e5a7d3751 | ||
![]() |
cde2259a6b | ||
![]() |
bf8038702d | ||
![]() |
5434a05457 | ||
![]() |
85b1052c3c | ||
![]() |
bb43d9b9a2 | ||
![]() |
632408af4a | ||
![]() |
150d08801c | ||
![]() |
1ee6a6e7d4 | ||
![]() |
947e356cda | ||
![]() |
2fbcc9ab76 | ||
![]() |
3b615980c8 | ||
![]() |
421da79d30 | ||
![]() |
97bb24d4e5 | ||
![]() |
68255df9b9 | ||
![]() |
3b12bb225a | ||
![]() |
dc65c8a893 | ||
![]() |
971e5c22bf | ||
![]() |
1902ee52ef | ||
![]() |
588bf76650 | ||
![]() |
69085113b3 | ||
![]() |
e4d9176e4d | ||
![]() |
94015cd13a | ||
![]() |
df37aa6115 | ||
![]() |
ba1f327200 | ||
![]() |
80a44c0525 | ||
![]() |
f65e7bf30c | ||
![]() |
cbb7044878 | ||
![]() |
6936061580 | ||
![]() |
333bd8cde3 | ||
![]() |
975a610233 | ||
![]() |
7521fb5655 | ||
![]() |
8eac930eac | ||
![]() |
d8d631a266 | ||
![]() |
c40dff6453 | ||
![]() |
2bc97b2099 | ||
![]() |
89b35cff90 | ||
![]() |
120797cf87 | ||
![]() |
9499432d7f | ||
![]() |
a6c45d15fd | ||
![]() |
32a9022db1 | ||
![]() |
95fbfee201 | ||
![]() |
dd087ea9c9 | ||
![]() |
96dc38b3c8 | ||
![]() |
e19f1c5491 | ||
![]() |
690df9333a | ||
![]() |
4196d0b983 | ||
![]() |
dcc71094d1 | ||
![]() |
ea4b8f9c8f | ||
![]() |
d0401b04a4 | ||
![]() |
e773ffe809 | ||
![]() |
320ad2a4fe | ||
![]() |
ae0576a472 | ||
![]() |
9037a180de | ||
![]() |
8d9063bb2a | ||
![]() |
136c560023 | ||
![]() |
00a638179d | ||
![]() |
36af4af27a |
@@ -1,2 +1,3 @@
|
||||
# libuv queue.h pointer arithmetic is not accepted by asan
|
||||
fun:queue_node_data
|
||||
fun:dictwatcher_node_data
|
||||
|
@@ -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
|
5
.gitignore
vendored
5
.gitignore
vendored
@@ -38,6 +38,9 @@ tags
|
||||
# Folder generated by the unit tests
|
||||
/test/includes/post/
|
||||
|
||||
# generated by luacheck during `make testlint'
|
||||
/test/.luacheckcache
|
||||
|
||||
# luarocks, not added as a subtree because of the large number of blobs
|
||||
/third-party/luarocks
|
||||
|
||||
@@ -64,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
|
||||
|
@@ -104,7 +104,7 @@ Thank you to everyone who backed our [Bountysource fundraiser](https://www.bount
|
||||
- Michael Ulm www.mulm.at
|
||||
- Mikael Jansson http://mikaelj.se
|
||||
- Mikkel Høgh http://mikkel.hoegh.org/
|
||||
- Ming Liu http://www.codingupfengshui.io
|
||||
- Ming Liu http://ming.codes
|
||||
- Holger Peters http://www.holger-peters.de
|
||||
- Alexander Myshov http://myshov.com/
|
||||
- Darren Cheng http://sanguinerane.com/
|
||||
|
139
CMakeLists.txt
139
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,36 +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
|
||||
# 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 0)
|
||||
set(NVIM_VERSION_PATCH 3)
|
||||
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||
|
||||
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
|
||||
include(GetGitRevisionDescription)
|
||||
if(NVIM_VERSION_PRERELEASE)
|
||||
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
|
||||
|
||||
# TODO(justinmk): UTC time would be nice here #1071
|
||||
git_timestamp(GIT_TIMESTAMP)
|
||||
if(GIT_TIMESTAMP)
|
||||
set(NVIM_VERSION_BUILD "+${GIT_TIMESTAMP}")
|
||||
endif()
|
||||
else()
|
||||
# If possible, get the Git tag for the current revision.
|
||||
git_get_exact_tag(NVIM_VERSION_COMMIT)
|
||||
set(NVIM_VERSION_BUILD "")
|
||||
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
|
||||
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}")
|
||||
@@ -149,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
|
||||
@@ -198,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
|
||||
@@ -211,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)
|
||||
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)
|
||||
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)
|
||||
@@ -245,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")
|
||||
@@ -270,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)
|
||||
@@ -327,9 +354,16 @@ 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)
|
||||
@@ -360,10 +394,13 @@ 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()
|
||||
|
||||
find_program(LUACHECK_PRG luacheck)
|
||||
|
||||
include(InstallHelpers)
|
||||
|
||||
file(GLOB MANPAGES
|
||||
@@ -374,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)
|
||||
@@ -398,7 +445,11 @@ if(BUSTED_PRG)
|
||||
if(POLICY CMP0026)
|
||||
cmake_policy(SET CMP0026 OLD)
|
||||
endif()
|
||||
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
|
||||
@@ -454,3 +505,37 @@ if(BUSTED_PRG)
|
||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||
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}
|
||||
-DLUACHECK_PRG=${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 to reproduce your it using
|
||||
`nvim` with the smallest possible `nvimrc` (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
|
||||
|
15
ISSUE_TEMPLATE.md
Normal file
15
ISSUE_TEMPLATE.md
Normal file
@@ -0,0 +1,15 @@
|
||||
- Neovim version:
|
||||
- [ ] Vim behaves differently?
|
||||
- Vim version:
|
||||
- Operating system/version:
|
||||
- Terminal name/version:
|
||||
- `$TERM`:
|
||||
|
||||
### Actual behaviour
|
||||
|
||||
### Expected behaviour
|
||||
|
||||
### Steps to reproduce using `nvim -u NONE`
|
||||
|
||||
1. `nvim -u NONE`
|
||||
2.
|
17
Makefile
17
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,7 +91,11 @@ oldtest: | nvim
|
||||
functionaltest: | nvim
|
||||
+$(BUILD_CMD) -C build functionaltest
|
||||
|
||||
test: functionaltest
|
||||
functionaltest-lua: | nvim
|
||||
+$(BUILD_CMD) -C build functionaltest-lua
|
||||
|
||||
testlint: | nvim
|
||||
$(BUILD_CMD) -C build testlint
|
||||
|
||||
unittest: | nvim
|
||||
+$(BUILD_CMD) -C build unittest
|
||||
@@ -94,6 +103,8 @@ unittest: | nvim
|
||||
benchmark: | nvim
|
||||
+$(BUILD_CMD) -C build benchmark
|
||||
|
||||
test: functionaltest unittest
|
||||
|
||||
clean:
|
||||
+test -d build && $(BUILD_CMD) -C build clean || true
|
||||
$(MAKE) -C src/nvim/testdir clean
|
||||
@@ -110,4 +121,4 @@ lint:
|
||||
-DLINT_SUPPRESS_URL="$(DOC_DOWNLOAD_URL_BASE)$(CLINT_ERRORS_FILE_PATH)" \
|
||||
-P cmake/RunLint.cmake
|
||||
|
||||
.PHONY: test functionaltest unittest lint clean distclean nvim libnvim cmake deps install
|
||||
.PHONY: test testlint functionaltest unittest lint clean distclean nvim libnvim cmake deps install
|
||||
|
259
clint.py
259
clint.py
@@ -198,6 +198,8 @@ _ERROR_CATEGORIES = [
|
||||
'runtime/printf',
|
||||
'runtime/printf_format',
|
||||
'runtime/threadsafe_fn',
|
||||
'syntax/parenthesis',
|
||||
'whitespace/alignment',
|
||||
'whitespace/blank_line',
|
||||
'whitespace/braces',
|
||||
'whitespace/comma',
|
||||
@@ -213,7 +215,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 +828,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 +925,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 +975,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 +1069,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 +1088,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 +1367,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 +2052,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 +2145,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.
|
||||
@@ -2236,6 +2407,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 +2467,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 +2474,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 +2540,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!
|
||||
@@ -3026,12 +3221,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 +3269,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 +3286,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 +3316,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
|
||||
|
@@ -59,11 +59,6 @@ if(HAVE_LIBDL)
|
||||
list(APPEND LIBUV_LIBRARIES dl)
|
||||
endif()
|
||||
|
||||
check_library_exists(iphlpapi GetAdaptersAddresses "iphlpapi.h" HAVE_LIBIPHLPAPI)
|
||||
if(HAVE_LIBIPHLPAPI)
|
||||
list(APPEND LIBUV_LIBRARIES iphlpapi)
|
||||
endif()
|
||||
|
||||
check_library_exists(kstat kstat_lookup "kstat.h" HAVE_LIBKSTAT)
|
||||
if(HAVE_LIBKSTAT)
|
||||
list(APPEND LIBUV_LIBRARIES kstat)
|
||||
@@ -84,11 +79,6 @@ if(HAVE_LIBPERFSTAT)
|
||||
list(APPEND LIBUV_LIBRARIES perfstat)
|
||||
endif()
|
||||
|
||||
check_library_exists(psapi GetProcessMemoryInfo "psapi.h" HAVE_LIBPSAPI)
|
||||
if(HAVE_LIBPSAPI)
|
||||
list(APPEND LIBUV_LIBRARIES psapi)
|
||||
endif()
|
||||
|
||||
check_library_exists(rt clock_gettime "time.h" HAVE_LIBRT)
|
||||
if(HAVE_LIBRT)
|
||||
list(APPEND LIBUV_LIBRARIES rt)
|
||||
@@ -99,13 +89,12 @@ if(HAVE_LIBSENDFILE)
|
||||
list(APPEND LIBUV_LIBRARIES sendfile)
|
||||
endif()
|
||||
|
||||
check_library_exists(userenv GetUserProfileDirectoryW "userenv.h" HAVE_LIBUSERENV)
|
||||
if(HAVE_LIBUSERENV)
|
||||
if(WIN32)
|
||||
# check_library_exists() does not work for Win32 API calls in X86 due to name
|
||||
# mangling calling conventions
|
||||
list(APPEND LIBUV_LIBRARIES iphlpapi)
|
||||
list(APPEND LIBUV_LIBRARIES psapi)
|
||||
list(APPEND LIBUV_LIBRARIES userenv)
|
||||
endif()
|
||||
|
||||
check_library_exists(ws2_32 WSAStartup "winsock2.h" HAVE_LIBWS232)
|
||||
if(HAVE_LIBWS232)
|
||||
list(APPEND LIBUV_LIBRARIES ws2_32)
|
||||
endif()
|
||||
|
||||
|
@@ -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)
|
||||
|
||||
|
@@ -25,7 +25,7 @@ file(WRITE ${EMPTY_FILE} "")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/nvim
|
||||
-u NONE
|
||||
-esX
|
||||
-es
|
||||
-c "helptags ++t ."
|
||||
-c quit
|
||||
WORKING_DIRECTORY ${HELPTAGS_WORKING_DIRECTORY}
|
||||
|
@@ -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)
|
||||
|
||||
|
11
cmake/RunTestsLint.cmake
Normal file
11
cmake/RunTestsLint.cmake
Normal file
@@ -0,0 +1,11 @@
|
||||
execute_process(
|
||||
COMMAND ${LUACHECK_PRG} -q ${TEST_DIR}
|
||||
WORKING_DIRECTORY ${TEST_DIR}
|
||||
ERROR_VARIABLE err
|
||||
RESULT_VARIABLE res
|
||||
${EXTRA_ARGS})
|
||||
|
||||
if(NOT res EQUAL 0)
|
||||
message(STATUS "Output to stderr:\n${err}")
|
||||
message(FATAL_ERROR "Linting tests failed with error: ${res}.")
|
||||
endif()
|
@@ -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)
|
||||
|
@@ -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,8 +5,8 @@
|
||||
#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
|
||||
#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
|
||||
#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
|
||||
#define NVIM_VERSION_BUILD "@NVIM_VERSION_BUILD@"
|
||||
#cmakedefine NVIM_VERSION_COMMIT "@NVIM_VERSION_COMMIT@"
|
||||
#cmakedefine NVIM_VERSION_MEDIUM "@NVIM_VERSION_MEDIUM@"
|
||||
|
||||
#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
|
||||
#define NVIM_VERSION_BUILD_TYPE "@NVIM_VERSION_BUILD_TYPE@"
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
## What is this?
|
||||
|
||||
This provides the code necessary to configure vim's YCM plugin to provide C semantic support (completion, go-to-definition, etc) for the Neovim project.
|
||||
This provides the code necessary to configure vim's YCM plugin to provide C semantic support (completion, go-to-definition, etc) for developers working on the Neovim project.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -17,6 +17,6 @@ cp contrib/YouCompleteMe/ycm_extra_conf.py src/.ycm_extra_conf.py
|
||||
echo .ycm_extra_conf.py >> .git/info/exclude
|
||||
make
|
||||
|
||||
(Add the following somewhere in your .nvimrc files)
|
||||
(Add the following somewhere in your vimrc)
|
||||
autocmd FileType c nnoremap <buffer> <silent> <C-]> :YcmCompleter GoTo<cr>
|
||||
```
|
||||
|
@@ -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
|
||||
|
36
man/nvim.1
36
man/nvim.1
@@ -1,4 +1,4 @@
|
||||
.Dd October 27, 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
|
||||
@@ -173,19 +173,19 @@ See
|
||||
.It Fl L Op Ar file
|
||||
Alias for
|
||||
.Fl r .
|
||||
.It Fl u Ar nvimrc
|
||||
.It Fl u Ar vimrc
|
||||
Use
|
||||
.Ar nvimrc
|
||||
.Ar vimrc
|
||||
instead of the default of
|
||||
.Pa ~/.config/nvim/init.vim .
|
||||
If
|
||||
.Ar nvimrc
|
||||
.Ar vimrc
|
||||
is
|
||||
.Cm NORC ,
|
||||
do not load any initialization files (excluding plugins),
|
||||
and do not attempt to parse environment variables.
|
||||
If
|
||||
.Ar nvimrc
|
||||
.Ar vimrc
|
||||
is
|
||||
.Cm NONE ,
|
||||
loading plugins is also skipped.
|
||||
@@ -278,7 +278,7 @@ Like
|
||||
.Fl c ,
|
||||
but execute
|
||||
.Ar command
|
||||
before processing any nvimrc.
|
||||
before processing any vimrc.
|
||||
Up to 10 instances of these can be used independently from instances of
|
||||
.Fl c .
|
||||
.It Fl S Op Ar session
|
||||
@@ -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.
|
||||
@@ -395,11 +411,11 @@ configuration directory.
|
||||
See
|
||||
.Ev XDG_CONFIG_HOME
|
||||
above.
|
||||
.It Pa /etc/nvim/nvimrc
|
||||
.It Pa $VIM/sysinit.vim
|
||||
The system-global
|
||||
.Nm
|
||||
configuration file.
|
||||
.It Pa /usr/share/nvim
|
||||
.It Pa /usr/local/share/nvim
|
||||
The system-global
|
||||
.Nm
|
||||
runtime directory.
|
||||
|
@@ -26,24 +26,21 @@ foreach(DF ${DOCFILES})
|
||||
list(APPEND BUILDDOCFILES ${GENERATED_RUNTIME_DIR}/doc/${F})
|
||||
endforeach()
|
||||
|
||||
add_custom_command(OUTPUT ${BUILDDOCFILES}
|
||||
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
|
||||
-esX
|
||||
-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
|
||||
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
|
||||
|
821
runtime/autoload/msgpack.vim
Normal file
821
runtime/autoload/msgpack.vim
Normal file
@@ -0,0 +1,821 @@
|
||||
if exists('g:loaded_msgpack_autoload')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_msgpack_autoload = 1
|
||||
|
||||
""
|
||||
" Check that given value is an integer. Respects |msgpack-special-dict|.
|
||||
function msgpack#is_int(v) abort
|
||||
return type(a:v) == type(0) || (
|
||||
\type(a:v) == type({}) && get(a:v, '_TYPE') is# v:msgpack_types.integer)
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Check that given value is an unsigned integer. Respects
|
||||
" |msgpack-special-dict|.
|
||||
function msgpack#is_uint(v) abort
|
||||
return msgpack#is_int(a:v) && (type(a:v) == type(0)
|
||||
\? a:v >= 0
|
||||
\: a:v._VAL[0] > 0)
|
||||
endfunction
|
||||
|
||||
""
|
||||
" True if s:msgpack_init_python() function was already run.
|
||||
let s:msgpack_python_initialized = 0
|
||||
|
||||
""
|
||||
" Cached return of s:msgpack_init_python() used when
|
||||
" s:msgpack_python_initialized is true.
|
||||
let s:msgpack_python_type = 0
|
||||
|
||||
""
|
||||
" Create Python functions that are necessary for work. Also defines functions
|
||||
" s:msgpack_dict_strftime(format, timestamp) and s:msgpack_dict_strptime(format,
|
||||
" string).
|
||||
"
|
||||
" @return Zero in case no Python is available, empty string if Python-2 is
|
||||
" available and string `"3"` if Python-3 is available.
|
||||
function s:msgpack_init_python() abort
|
||||
if s:msgpack_python_initialized
|
||||
return s:msgpack_python_type
|
||||
endif
|
||||
let s:msgpack_python_initialized = 1
|
||||
for suf in ['', '3']
|
||||
try
|
||||
execute 'python' . suf
|
||||
\. "def shada_dict_strftime():\n"
|
||||
\. " import datetime\n"
|
||||
\. " import vim\n"
|
||||
\. " fmt = vim.eval('a:format')\n"
|
||||
\. " timestamp = vim.eval('a:timestamp')\n"
|
||||
\. " timestamp = [int(v) for v in timestamp['_VAL']]\n"
|
||||
\. " timestamp = timestamp[0] * (timestamp[1] << 62\n"
|
||||
\. " | timestamp[2] << 31\n"
|
||||
\. " | timestamp[3])\n"
|
||||
\. " time = datetime.datetime.fromtimestamp(timestamp)\n"
|
||||
\. " return time.strftime(fmt)\n"
|
||||
\. "def shada_dict_strptime():\n"
|
||||
\. " import datetime\n"
|
||||
\. " import vim\n"
|
||||
\. " fmt = vim.eval('a:format')\n"
|
||||
\. " timestr = vim.eval('a:string')\n"
|
||||
\. " timestamp = datetime.datetime.strptime(timestr, fmt)\n"
|
||||
\. " timestamp = int(timestamp.timestamp())\n"
|
||||
\. " if timestamp > 2 ** 31:\n"
|
||||
\. " tsabs = abs(timestamp)"
|
||||
\. " return ('{\"_TYPE\": v:msgpack_types.integer,'\n"
|
||||
\. " + '\"_VAL\": [{sign},{v1},{v2},{v3}]}').format(\n"
|
||||
\. " sign=1 if timestamp >= 0 else -1,\n"
|
||||
\. " v1=((tsabs >> 62) & 0x3),\n"
|
||||
\. " v2=((tsabs >> 31) & (2 ** 31 - 1)),\n"
|
||||
\. " v3=(tsabs & (2 ** 31 - 1)))\n"
|
||||
\. " else:\n"
|
||||
\. " return str(timestamp)\n"
|
||||
execute "function s:msgpack_dict_strftime(format, timestamp) abort\n"
|
||||
\. " return py" . suf . "eval('shada_dict_strftime()')\n"
|
||||
\. "endfunction\n"
|
||||
\. "function s:msgpack_dict_strptime(format, string)\n"
|
||||
\. " return eval(py" . suf . "eval('shada_dict_strptime()'))\n"
|
||||
\. "endfunction\n"
|
||||
let s:msgpack_python_type = suf
|
||||
return suf
|
||||
catch
|
||||
continue
|
||||
endtry
|
||||
endfor
|
||||
|
||||
""
|
||||
" strftime() function for |msgpack-special-dict| values.
|
||||
"
|
||||
" @param[in] format String according to which time should be formatted.
|
||||
" @param[in] timestamp Timestamp (seconds since epoch) to format.
|
||||
"
|
||||
" @return Formatted timestamp.
|
||||
"
|
||||
" @warning Without +python or +python3 this function does not work correctly.
|
||||
" The VimL code contains “reference” implementation which does not
|
||||
" really work because of precision loss.
|
||||
function s:msgpack_dict_strftime(format, timestamp)
|
||||
return msgpack#strftime(a:format, +msgpack#int_dict_to_str(a:timestamp))
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Function that parses given string according to given format.
|
||||
"
|
||||
" @param[in] format String according to which string was formatted.
|
||||
" @param[in] string Time formatted according to format.
|
||||
"
|
||||
" @return Timestamp.
|
||||
"
|
||||
" @warning Without +python or +python3 this function is able to work only with
|
||||
" 31-bit (32-bit signed) timestamps that have format
|
||||
" `%Y-%m-%dT%H:%M:%S`.
|
||||
function s:msgpack_dict_strptime(format, string)
|
||||
let fmt = '%Y-%m-%dT%H:%M:%S'
|
||||
if a:format isnot# fmt
|
||||
throw 'notimplemented-format:Only ' . fmt . ' format is supported'
|
||||
endif
|
||||
let match = matchlist(a:string,
|
||||
\'\v\C^(\d+)\-(\d+)\-(\d+)T(\d+)\:(\d+)\:(\d+)$')
|
||||
if empty(match)
|
||||
throw 'invalid-string:Given string does not match format ' . a:format
|
||||
endif
|
||||
call map(match, 'str2nr(v:val, 10)')
|
||||
let [year, month, day, hour, minute, second] = match[1:6]
|
||||
" Bisection start and end:
|
||||
"
|
||||
" Start: 365 days in year, 28 days in month, -12 hours tz offset.
|
||||
let bisect_ts_start = (((((year - 1970) * 365
|
||||
\+ (month - 1) * 28
|
||||
\+ (day - 1)) * 24
|
||||
\+ hour - 12) * 60
|
||||
\+ minute) * 60
|
||||
\+ second)
|
||||
if bisect_ts_start < 0
|
||||
let bisect_ts_start = 0
|
||||
endif
|
||||
let start_string = strftime(fmt, bisect_ts_start)
|
||||
if start_string is# a:string
|
||||
return bisect_ts_start
|
||||
endif
|
||||
" End: 366 days in year, 31 day in month, +14 hours tz offset.
|
||||
let bisect_ts_end = (((((year - 1970) * 366
|
||||
\+ (month - 1) * 31
|
||||
\+ (day - 1)) * 24
|
||||
\+ hour + 14) * 60
|
||||
\+ minute) * 60
|
||||
\+ second)
|
||||
let end_string = strftime(fmt, bisect_ts_end)
|
||||
if end_string is# a:string
|
||||
return bisect_ts_end
|
||||
endif
|
||||
if start_string ># end_string
|
||||
throw 'internal-start-gt:Internal error: start > end'
|
||||
endif
|
||||
if start_string is# end_string
|
||||
throw printf('internal-start-eq:Internal error: '
|
||||
\. 'start(%u)==end(%u), but start(%s)!=string(%s)',
|
||||
\bisect_ts_start, bisect_ts_end,
|
||||
\string(start_string), string(a:string))
|
||||
endif
|
||||
if start_string ># a:string
|
||||
throw 'internal-start-string:Internal error: start > string'
|
||||
endif
|
||||
if end_string <# a:string
|
||||
throw 'internal-end-string:Internal error: end < string'
|
||||
endif
|
||||
while 1
|
||||
let bisect_ts_middle = (bisect_ts_start/2) + (bisect_ts_end/2)
|
||||
let middle_string = strftime(fmt, bisect_ts_middle)
|
||||
if a:string is# middle_string
|
||||
return bisect_ts_middle
|
||||
elseif a:string ># middle_string
|
||||
if bisect_ts_middle == bisect_ts_start
|
||||
let bisect_ts_start += 1
|
||||
else
|
||||
let bisect_ts_start = bisect_ts_middle
|
||||
endif
|
||||
else
|
||||
if bisect_ts_middle == bisect_ts_end
|
||||
let bisect_ts_end -= 1
|
||||
else
|
||||
let bisect_ts_end = bisect_ts_middle
|
||||
endif
|
||||
endif
|
||||
if bisect_ts_start >= bisect_ts_end
|
||||
throw 'not-found:Unable to find timestamp'
|
||||
endif
|
||||
endwhile
|
||||
endfunction
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Wrapper for strftime() that respects |msgpack-special-dict|. May actually use
|
||||
" non-standard strftime() implementations for |msgpack-special-dict| values.
|
||||
"
|
||||
" @param[in] format Format string.
|
||||
" @param[in] timestamp Formatted timestamp.
|
||||
function msgpack#strftime(format, timestamp) abort
|
||||
if type(a:timestamp) == type({})
|
||||
call s:msgpack_init_python()
|
||||
return s:msgpack_dict_strftime(a:format, a:timestamp)
|
||||
else
|
||||
return strftime(a:format, a:timestamp)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Parse string according to the format.
|
||||
"
|
||||
" Requires +python available. If it is not then only supported format is
|
||||
" `%Y-%m-%dT%H:%M:%S` because this is the format used by ShaDa plugin. Also in
|
||||
" this case bisection will be used (timestamps tried with strftime() up until
|
||||
" result matches the string) and only 31-bit (signed 32-bit: with negative
|
||||
" timestamps being useless this leaves 31 bits) timestamps will be supported.
|
||||
"
|
||||
" @param[in] format Time format.
|
||||
" @param[in] string Parsed time string. Must match given format.
|
||||
"
|
||||
" @return Timestamp. Possibly as |msgpack-special-dict|.
|
||||
function msgpack#strptime(format, string) abort
|
||||
call s:msgpack_init_python()
|
||||
return s:msgpack_dict_strptime(a:format, a:string)
|
||||
endfunction
|
||||
|
||||
let s:MSGPACK_HIGHEST_BIT = 1
|
||||
let s:MSGPACK_HIGHEST_BIT_NR = 0
|
||||
while s:MSGPACK_HIGHEST_BIT * 2 > 0
|
||||
let s:MSGPACK_HIGHEST_BIT = s:MSGPACK_HIGHEST_BIT * 2
|
||||
let s:MSGPACK_HIGHEST_BIT_NR += 1
|
||||
endwhile
|
||||
|
||||
""
|
||||
" Shift given number by given amount of bits
|
||||
function s:shift(n, s) abort
|
||||
if a:s == 0
|
||||
return a:n
|
||||
elseif a:s < 0
|
||||
let ret = a:n
|
||||
for _ in range(-a:s)
|
||||
let ret = ret / 2
|
||||
endfor
|
||||
return ret
|
||||
else
|
||||
let ret = a:n
|
||||
for i in range(a:s)
|
||||
let new_ret = ret * 2
|
||||
if new_ret < ret
|
||||
" Overflow: remove highest bit
|
||||
let ret = xor(s:MSGPACK_HIGHEST_BIT, ret) * 2
|
||||
endif
|
||||
let ret = new_ret
|
||||
endfor
|
||||
return ret
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:msgpack_mask_cache = {
|
||||
\s:MSGPACK_HIGHEST_BIT_NR : s:MSGPACK_HIGHEST_BIT - 1}
|
||||
|
||||
""
|
||||
" Apply a mask where first m bits are ones and other are zeroes to a given
|
||||
" number
|
||||
function s:mask1(n, m) abort
|
||||
if a:m > s:MSGPACK_HIGHEST_BIT_NR + 1
|
||||
let m = s:MSGPACK_HIGHEST_BIT_NR + 1
|
||||
else
|
||||
let m = a:m
|
||||
endif
|
||||
if !has_key(s:msgpack_mask_cache, m)
|
||||
let p = 0
|
||||
for _ in range(m)
|
||||
let p = p * 2 + 1
|
||||
endfor
|
||||
let s:msgpack_mask_cache[m] = p
|
||||
endif
|
||||
return and(a:n, s:msgpack_mask_cache[m])
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Convert |msgpack-special-dict| that represents integer value to a string. Uses
|
||||
" hexadecimal representation starting with 0x because it is the easiest to
|
||||
" convert to.
|
||||
function msgpack#int_dict_to_str(v) abort
|
||||
let v = a:v._VAL
|
||||
" 64-bit number:
|
||||
" 0000000001111111111222222222233333333334444444444555555555566666
|
||||
" 1234567890123456789012345678901234567890123456789012345678901234
|
||||
" Split in _VAL:
|
||||
" 0000000001111111111222222222233 3333333344444444445555555555666 66
|
||||
" 1234567890123456789012345678901 2345678901234567890123456789012 34
|
||||
" Split by hex digits:
|
||||
" 0000 0000 0111 1111 1112 2222 2222 2333 3333 3334 4444 4444 4555 5555 5556 6666
|
||||
" 1234 5678 9012 3456 7890 1234 5678 9012 3456 7890 1234 5678 9012 3456 7890 1234
|
||||
"
|
||||
" Total split:
|
||||
" _VAL[3] _VAL[2] _VAL[1]
|
||||
" ______________________________________ _______________________________________ __
|
||||
" 0000 0000 0111 1111 1112 2222 2222 233 3 3333 3334 4444 4444 4555 5555 5556 66 66
|
||||
" 1234 5678 9012 3456 7890 1234 5678 901 2 3456 7890 1234 5678 9012 3456 7890 12 34
|
||||
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^
|
||||
" g4 g3 g2 g1
|
||||
" ********************************** *** * ********************************** ** **
|
||||
" 1 2 3 4 5 6
|
||||
" 1: s:mask1(v[3], 28): first 28 bits of _VAL[3]
|
||||
" 2: s:shift(v[3], -28): last 3 bits of _VAL[3]
|
||||
" 3: s:mask1(v[2], 1): first bit of _VAL[2]
|
||||
" 4: s:mask1(s:shift(v[2], -1), 28): bits 2 .. 29 of _VAL[2]
|
||||
" 5: s:shift(v[2], -29): last 2 bits of _VAL[2]
|
||||
" 6: s:shift(v[1], 2): _VAL[1]
|
||||
let g4 = printf('%07x', s:mask1(v[3], 28))
|
||||
let g3 = printf('%01x', or(s:shift(v[3], -28), s:shift(s:mask1(v[2], 1), 3)))
|
||||
let g2 = printf('%07x', s:mask1(s:shift(v[2], -1), 28))
|
||||
let g1 = printf('%01x', or(s:shift(v[2], -29), s:shift(v[1], 2)))
|
||||
return ((v[0] < 0 ? '-' : '') . '0x' . g1 . g2 . g3 . g4)
|
||||
endfunction
|
||||
|
||||
""
|
||||
" True boolean value.
|
||||
let g:msgpack#true = {'_TYPE': v:msgpack_types.boolean, '_VAL': 1}
|
||||
lockvar! g:msgpack#true
|
||||
|
||||
""
|
||||
" False boolean value.
|
||||
let g:msgpack#false = {'_TYPE': v:msgpack_types.boolean, '_VAL': 0}
|
||||
lockvar! g:msgpack#false
|
||||
|
||||
""
|
||||
" NIL value.
|
||||
let g:msgpack#nil = {'_TYPE': v:msgpack_types.nil, '_VAL': 0}
|
||||
lockvar! g:msgpack#nil
|
||||
|
||||
""
|
||||
" Deduce type of |msgpack-special-dict|.
|
||||
"
|
||||
" @return zero if given dictionary is not special or name of the key in
|
||||
" v:msgpack_types dictionary.
|
||||
function msgpack#special_type(v) abort
|
||||
if type(a:v) != type({}) || !has_key(a:v, '_TYPE')
|
||||
return 0
|
||||
endif
|
||||
for [k, v] in items(v:msgpack_types)
|
||||
if a:v._TYPE is v
|
||||
return k
|
||||
endif
|
||||
endfor
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Mapping that maps type() output to type names.
|
||||
let s:MSGPACK_STANDARD_TYPES = {
|
||||
\type(0): 'integer',
|
||||
\type(0.0): 'float',
|
||||
\type(''): 'binary',
|
||||
\type([]): 'array',
|
||||
\type({}): 'map',
|
||||
\}
|
||||
|
||||
""
|
||||
" Deduce type of one of items returned by msgpackparse().
|
||||
"
|
||||
" @return Name of a key in v:msgpack_types.
|
||||
function msgpack#type(v) abort
|
||||
let special_type = msgpack#special_type(a:v)
|
||||
if special_type is 0
|
||||
return s:MSGPACK_STANDARD_TYPES[type(a:v)]
|
||||
endif
|
||||
return special_type
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Dump nil value.
|
||||
function s:msgpack_dump_nil(v) abort
|
||||
return 'NIL'
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Dump boolean value.
|
||||
function s:msgpack_dump_boolean(v) abort
|
||||
return a:v._VAL ? 'TRUE' : 'FALSE'
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Dump integer msgpack value.
|
||||
function s:msgpack_dump_integer(v) abort
|
||||
if type(a:v) == type({})
|
||||
return msgpack#int_dict_to_str(a:v)
|
||||
else
|
||||
return string(a:v)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Dump floating-point value.
|
||||
function s:msgpack_dump_float(v) abort
|
||||
return substitute(string(type(a:v) == type({}) ? a:v._VAL : a:v),
|
||||
\'\V\^\(-\)\?str2float(''\(inf\|nan\)'')\$', '\1\2', '')
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Dump |msgpack-special-dict| that represents a string. If any additional
|
||||
" parameter is given then it dumps binary string.
|
||||
function s:msgpack_dump_string(v, ...) abort
|
||||
let ret = [a:0 ? '"' : '="']
|
||||
for v in a:v._VAL
|
||||
call add(
|
||||
\ret,
|
||||
\substitute(
|
||||
\substitute(v, '["\\]', '\\\0', 'g'),
|
||||
\'\n', '\\0', 'g'))
|
||||
call add(ret, '\n')
|
||||
endfor
|
||||
let ret[-1] = '"'
|
||||
return join(ret, '')
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Dump binary string.
|
||||
function s:msgpack_dump_binary(v) abort
|
||||
if type(a:v) == type({})
|
||||
return s:msgpack_dump_string(a:v, 1)
|
||||
else
|
||||
return s:msgpack_dump_string({'_VAL': split(a:v, "\n", 1)}, 1)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Dump array value.
|
||||
function s:msgpack_dump_array(v) abort
|
||||
let val = type(a:v) == type({}) ? a:v._VAL : a:v
|
||||
return '[' . join(map(val[:], 'msgpack#string(v:val)'), ', ') . ']'
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Dump dictionary value.
|
||||
function s:msgpack_dump_map(v) abort
|
||||
let ret = ['{']
|
||||
if msgpack#special_type(a:v) is 0
|
||||
for [k, v] in items(a:v)
|
||||
let ret += [s:msgpack_dump_string({'_VAL': split(k, "\n", 1)}),
|
||||
\': ',
|
||||
\msgpack#string(v),
|
||||
\', ']
|
||||
unlet v
|
||||
endfor
|
||||
if !empty(a:v)
|
||||
call remove(ret, -1)
|
||||
endif
|
||||
else
|
||||
for [k, v] in sort(copy(a:v._VAL))
|
||||
let ret += [msgpack#string(k),
|
||||
\': ',
|
||||
\msgpack#string(v),
|
||||
\', ']
|
||||
unlet k
|
||||
unlet v
|
||||
endfor
|
||||
if !empty(a:v._VAL)
|
||||
call remove(ret, -1)
|
||||
endif
|
||||
endif
|
||||
let ret += ['}']
|
||||
return join(ret, '')
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Dump extension value.
|
||||
function s:msgpack_dump_ext(v) abort
|
||||
return printf('+(%i)%s', a:v._VAL[0],
|
||||
\s:msgpack_dump_string({'_VAL': a:v._VAL[1]}, 1))
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Convert msgpack object to a string, like string() function does. Result of the
|
||||
" conversion may be passed to msgpack#eval().
|
||||
function msgpack#string(v) abort
|
||||
if type(a:v) == type({})
|
||||
let type = msgpack#special_type(a:v)
|
||||
if type is 0
|
||||
let type = 'map'
|
||||
endif
|
||||
else
|
||||
let type = get(s:MSGPACK_STANDARD_TYPES, type(a:v), 0)
|
||||
if type is 0
|
||||
throw printf('msgpack:invtype: Unable to convert value %s', string(a:v))
|
||||
endif
|
||||
endif
|
||||
return s:msgpack_dump_{type}(a:v)
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Copy msgpack object like deepcopy() does, but leave types intact
|
||||
function msgpack#deepcopy(obj) abort
|
||||
if type(a:obj) == type([])
|
||||
return map(copy(a:obj), 'msgpack#deepcopy(v:val)')
|
||||
elseif type(a:obj) == type({})
|
||||
let special_type = msgpack#special_type(a:obj)
|
||||
if special_type is 0
|
||||
return map(copy(a:obj), 'msgpack#deepcopy(v:val)')
|
||||
else
|
||||
return {
|
||||
\'_TYPE': v:msgpack_types[special_type],
|
||||
\'_VAL': msgpack#deepcopy(a:obj._VAL)
|
||||
\}
|
||||
endif
|
||||
else
|
||||
return copy(a:obj)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Convert an escaped character to needed value
|
||||
function s:msgpack_eval_str_sub(ch) abort
|
||||
if a:ch is# 'n'
|
||||
return '", "'
|
||||
elseif a:ch is# '0'
|
||||
return '\n'
|
||||
else
|
||||
return '\' . a:ch
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:MSGPACK_SPECIAL_OBJECTS = {
|
||||
\'NIL': '{''_TYPE'': v:msgpack_types.nil, ''_VAL'': 0}',
|
||||
\'TRUE': '{''_TYPE'': v:msgpack_types.boolean, ''_VAL'': 1}',
|
||||
\'FALSE': '{''_TYPE'': v:msgpack_types.boolean, ''_VAL'': 0}',
|
||||
\'nan': '(-(1.0/0.0-1.0/0.0))',
|
||||
\'inf': '(1.0/0.0)',
|
||||
\}
|
||||
|
||||
""
|
||||
" Convert msgpack object dumped by msgpack#string() to a VimL object suitable
|
||||
" for msgpackdump().
|
||||
"
|
||||
" @param[in] s String to evaluate.
|
||||
" @param[in] special_objs Additional special objects, in the same format as
|
||||
" s:MSGPACK_SPECIAL_OBJECTS.
|
||||
"
|
||||
" @return Any value that msgpackparse() may return.
|
||||
function msgpack#eval(s, special_objs) abort
|
||||
let s = a:s
|
||||
let expr = []
|
||||
let context = []
|
||||
while !empty(s)
|
||||
let s = substitute(s, '^\s*', '', '')
|
||||
if s[0] =~# '\v^\h$'
|
||||
let name = matchstr(s, '\v\C^\w+')
|
||||
if has_key(s:MSGPACK_SPECIAL_OBJECTS, name)
|
||||
call add(expr, s:MSGPACK_SPECIAL_OBJECTS[name])
|
||||
elseif has_key(a:special_objs, name)
|
||||
call add(expr, a:special_objs[name])
|
||||
else
|
||||
throw 'name-unknown:Unknown name ' . name . ': ' . s
|
||||
endif
|
||||
let s = s[len(name):]
|
||||
elseif (s[0] is# '-' && s[1] =~# '\v^\d$') || s[0] =~# '\v^\d$'
|
||||
let sign = 1
|
||||
if s[0] is# '-'
|
||||
let s = s[1:]
|
||||
let sign = -1
|
||||
endif
|
||||
if s[0:1] is# '0x'
|
||||
" See comment in msgpack#int_dict_to_str().
|
||||
let s = s[2:]
|
||||
let hexnum = matchstr(s, '\v\C^\x+')
|
||||
if empty(hexnum)
|
||||
throw '0x-empty:Must have number after 0x: ' . s
|
||||
elseif len(hexnum) > 16
|
||||
throw '0x-long:Must have at most 16 hex digits: ' . s
|
||||
endif
|
||||
let s = s[len(hexnum):]
|
||||
let hexnum = repeat('0', 16 - len(hexnum)) . hexnum
|
||||
let g1 = str2nr(hexnum[0], 16)
|
||||
let g2 = str2nr(hexnum[1:7], 16)
|
||||
let g3 = str2nr(hexnum[8], 16)
|
||||
let g4 = str2nr(hexnum[9:15], 16)
|
||||
let v1 = s:shift(g1, -2)
|
||||
let v2 = or(or(s:shift(s:mask1(g1, 2), 29), s:shift(g2, 1)),
|
||||
\s:mask1(s:shift(g3, -3), 1))
|
||||
let v3 = or(s:shift(s:mask1(g3, 3), 28), g4)
|
||||
call add(expr, printf('{''_TYPE'': v:msgpack_types.integer, '.
|
||||
\'''_VAL'': [%i, %u, %u, %u]}',
|
||||
\sign, v1, v2, v3))
|
||||
else
|
||||
let num = matchstr(s, '\v\C^\d+')
|
||||
let s = s[len(num):]
|
||||
if sign == -1
|
||||
call add(expr, '-')
|
||||
endif
|
||||
call add(expr, num)
|
||||
if s[0] is# '.'
|
||||
let dec = matchstr(s, '\v\C^\.\d+%(e[+-]?\d+)?')
|
||||
if empty(dec)
|
||||
throw '0.-nodigits:Decimal dot must be followed by digit(s): ' . s
|
||||
endif
|
||||
let s = s[len(dec):]
|
||||
call add(expr, dec)
|
||||
endif
|
||||
endif
|
||||
elseif s =~# '-\?\%(inf\|nan\)'
|
||||
if s[0] is# '-'
|
||||
call add(expr, '-')
|
||||
let s = s[1:]
|
||||
endif
|
||||
call add(expr, s:MSGPACK_SPECIAL_OBJECTS[s[0:2]])
|
||||
let s = s[3:]
|
||||
elseif stridx('="+', s[0]) != -1
|
||||
let match = matchlist(s, '\v\C^(\=|\+\((\-?\d+)\)|)(\"%(\\.|[^\\"]+)*\")')
|
||||
if empty(match)
|
||||
throw '"-invalid:Invalid string: ' . s
|
||||
endif
|
||||
call add(expr, '{''_TYPE'': v:msgpack_types.')
|
||||
if empty(match[1])
|
||||
call add(expr, 'binary')
|
||||
elseif match[1] is# '='
|
||||
call add(expr, 'string')
|
||||
else
|
||||
call add(expr, 'ext')
|
||||
endif
|
||||
call add(expr, ', ''_VAL'': [')
|
||||
if match[1][0] is# '+'
|
||||
call add(expr, match[2] . ', [')
|
||||
endif
|
||||
call add(expr, substitute(match[3], '\v\C\\(.)',
|
||||
\'\=s:msgpack_eval_str_sub(submatch(1))', 'g'))
|
||||
if match[1][0] is# '+'
|
||||
call add(expr, ']')
|
||||
endif
|
||||
call add(expr, ']}')
|
||||
let s = s[len(match[0]):]
|
||||
elseif s[0] is# '{'
|
||||
call add(context, 'map')
|
||||
call add(expr, '{''_TYPE'': v:msgpack_types.map, ''_VAL'': [')
|
||||
call add(expr, '[')
|
||||
let s = s[1:]
|
||||
elseif s[0] is# '['
|
||||
call add(context, 'array')
|
||||
call add(expr, '[')
|
||||
let s = s[1:]
|
||||
elseif s[0] is# ':'
|
||||
call add(expr, ',')
|
||||
let s = s[1:]
|
||||
elseif s[0] is# ','
|
||||
if context[-1] is# 'array'
|
||||
call add(expr, ',')
|
||||
else
|
||||
call add(expr, '], [')
|
||||
endif
|
||||
let s = s[1:]
|
||||
elseif s[0] is# ']'
|
||||
call remove(context, -1)
|
||||
call add(expr, ']')
|
||||
let s = s[1:]
|
||||
elseif s[0] is# '}'
|
||||
call remove(context, -1)
|
||||
if expr[-1] is# "\x5B"
|
||||
call remove(expr, -1)
|
||||
else
|
||||
call add(expr, ']')
|
||||
endif
|
||||
call add(expr, ']}')
|
||||
let s = s[1:]
|
||||
elseif s[0] is# ''''
|
||||
let char = matchstr(s, '\m\C^''\zs.\ze''')
|
||||
if empty(char)
|
||||
throw 'char-invalid:Invalid integer character literal format: ' . s
|
||||
endif
|
||||
call add(expr, char2nr(char))
|
||||
let s = s[len(char) + 2:]
|
||||
else
|
||||
throw 'unknown:Invalid non-space character: ' . s
|
||||
endif
|
||||
endwhile
|
||||
if empty(expr)
|
||||
throw 'empty:Parsed string is empty'
|
||||
endif
|
||||
return eval(join(expr, ''))
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Check whether two msgpack values are equal
|
||||
function msgpack#equal(a, b)
|
||||
let atype = msgpack#type(a:a)
|
||||
let btype = msgpack#type(a:b)
|
||||
if atype isnot# btype
|
||||
return 0
|
||||
endif
|
||||
let aspecial = msgpack#special_type(a:a)
|
||||
let bspecial = msgpack#special_type(a:b)
|
||||
if aspecial is# bspecial
|
||||
if aspecial is# 0
|
||||
if type(a:a) == type({})
|
||||
if len(a:a) != len(a:b)
|
||||
return 0
|
||||
endif
|
||||
if !empty(filter(keys(a:a), '!has_key(a:b, v:val)'))
|
||||
return 0
|
||||
endif
|
||||
for [k, v] in items(a:a)
|
||||
if !msgpack#equal(v, a:b[k])
|
||||
return 0
|
||||
endif
|
||||
unlet v
|
||||
endfor
|
||||
return 1
|
||||
elseif type(a:a) == type([])
|
||||
if len(a:a) != len(a:b)
|
||||
return 0
|
||||
endif
|
||||
let i = 0
|
||||
for asubval in a:a
|
||||
if !msgpack#equal(asubval, a:b[i])
|
||||
return 0
|
||||
endif
|
||||
let i += 1
|
||||
unlet asubval
|
||||
endfor
|
||||
return 1
|
||||
elseif type(a:a) == type(0.0)
|
||||
return (a:a == a:a ? a:a == a:b : string(a:a) ==# string(a:b))
|
||||
else
|
||||
return a:a ==# a:b
|
||||
endif
|
||||
elseif aspecial is# 'map' || aspecial is# 'array'
|
||||
if len(a:a._VAL) != len(a:b._VAL)
|
||||
return 0
|
||||
endif
|
||||
let alist = aspecial is# 'map' ? sort(copy(a:a._VAL)) : a:a._VAL
|
||||
let blist = bspecial is# 'map' ? sort(copy(a:b._VAL)) : a:b._VAL
|
||||
let i = 0
|
||||
for asubval in alist
|
||||
let bsubval = blist[i]
|
||||
if aspecial is# 'map'
|
||||
if !(msgpack#equal(asubval[0], bsubval[0])
|
||||
\&& msgpack#equal(asubval[1], bsubval[1]))
|
||||
return 0
|
||||
endif
|
||||
else
|
||||
if !msgpack#equal(asubval, bsubval)
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
let i += 1
|
||||
unlet asubval
|
||||
unlet bsubval
|
||||
endfor
|
||||
return 1
|
||||
elseif aspecial is# 'nil'
|
||||
return 1
|
||||
elseif aspecial is# 'float'
|
||||
return (a:a._VAL == a:a._VAL
|
||||
\? (a:a._VAL == a:b._VAL)
|
||||
\: (string(a:a._VAL) ==# string(a:b._VAL)))
|
||||
else
|
||||
return a:a._VAL ==# a:b._VAL
|
||||
endif
|
||||
else
|
||||
if atype is# 'array'
|
||||
let a = aspecial is 0 ? a:a : a:a._VAL
|
||||
let b = bspecial is 0 ? a:b : a:b._VAL
|
||||
return msgpack#equal(a, b)
|
||||
elseif atype is# 'binary'
|
||||
let a = (aspecial is 0 ? split(a:a, "\n", 1) : a:a._VAL)
|
||||
let b = (bspecial is 0 ? split(a:b, "\n", 1) : a:b._VAL)
|
||||
return a ==# b
|
||||
elseif atype is# 'map'
|
||||
if aspecial is 0
|
||||
let akeys = copy(a:a)
|
||||
if len(a:b._VAL) != len(akeys)
|
||||
return 0
|
||||
endif
|
||||
for [k, v] in a:b._VAL
|
||||
if msgpack#type(k) isnot# 'string'
|
||||
" Non-special mapping cannot have non-string keys
|
||||
return 0
|
||||
endif
|
||||
if (empty(k._VAL)
|
||||
\|| k._VAL ==# [""]
|
||||
\|| !empty(filter(copy(k._VAL), 'stridx(v:val, "\n") != -1')))
|
||||
" Non-special mapping cannot have zero byte in key or an empty key
|
||||
return 0
|
||||
endif
|
||||
let kstr = join(k._VAL, "\n")
|
||||
if !has_key(akeys, kstr)
|
||||
" Protects from both missing and duplicate keys
|
||||
return 0
|
||||
endif
|
||||
if !msgpack#equal(akeys[kstr], v)
|
||||
return 0
|
||||
endif
|
||||
call remove(akeys, kstr)
|
||||
unlet k
|
||||
unlet v
|
||||
endfor
|
||||
return 1
|
||||
else
|
||||
return msgpack#equal(a:b, a:a)
|
||||
endif
|
||||
elseif atype is# 'float'
|
||||
let a = aspecial is 0 ? a:a : a:a._VAL
|
||||
let b = bspecial is 0 ? a:b : a:b._VAL
|
||||
return (a == a ? a == b : string(a) ==# string(b))
|
||||
elseif atype is# 'integer'
|
||||
if aspecial is 0
|
||||
let sign = a:a >= 0 ? 1 : -1
|
||||
let a = sign * a:a
|
||||
let v1 = s:mask1(s:shift(a, -62), 2)
|
||||
let v2 = s:mask1(s:shift(a, -31), 31)
|
||||
let v3 = s:mask1(a, 31)
|
||||
return [sign, v1, v2, v3] == a:b._VAL
|
||||
else
|
||||
return msgpack#equal(a:b, a:a)
|
||||
endif
|
||||
else
|
||||
throw printf('internal-invalid-type: %s == %s, but special %s /= %s',
|
||||
\atype, btype, aspecial, bspecial)
|
||||
endif
|
||||
endif
|
||||
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 Apr 02
|
||||
"
|
||||
" OPTIONS:
|
||||
"
|
||||
@@ -141,11 +141,17 @@ 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
|
||||
|
||||
try
|
||||
let winheight = winheight(0)
|
||||
let winnr = winnr()
|
||||
|
||||
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.')))
|
||||
|
||||
if context =~? '^use\s'
|
||||
if context =~? '^use\s' || context ==? 'use'
|
||||
return phpcomplete#CompleteUse(a:base)
|
||||
endif
|
||||
|
||||
@@ -189,7 +195,7 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
|
||||
" }}}
|
||||
elseif context =~? 'implements'
|
||||
return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports)
|
||||
elseif context =~? 'extends\s\+.\+$'
|
||||
elseif context =~? 'extends\s\+.\+$' && a:base == ''
|
||||
return ['implements']
|
||||
elseif context =~? 'extends'
|
||||
let kinds = context =~? 'class\s' ? ['c'] : ['i']
|
||||
@@ -206,6 +212,9 @@ function! phpcomplete#CompletePHP(findstart, 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
|
||||
" }}}
|
||||
@@ -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}]
|
||||
@@ -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
|
||||
@@ -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
|
||||
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
|
||||
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,11 +1657,12 @@ 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)')
|
||||
" function declaration line
|
||||
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*('
|
||||
let function_lines = join(reverse(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.'\(,\|$\)'
|
||||
@@ -1620,8 +1676,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
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,14 @@ 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 start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s\+\(clone\)\?\s*'.variable_name_pattern)
|
||||
let filelines = reverse(lines)
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
|
||||
let chars_read = 1
|
||||
let last_pos = pos
|
||||
" read while end of the file
|
||||
while char != 'EOF' && chars_read < 1000
|
||||
let last_pos = pos
|
||||
@@ -1689,6 +1745,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let filelines = reverse(lines)
|
||||
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
|
||||
let chars_read = 1
|
||||
let last_pos = pos
|
||||
" read while end of the file
|
||||
while char != 'EOF' && chars_read < 1000
|
||||
let last_pos = pos
|
||||
@@ -1819,7 +1876,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 +1888,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 +2040,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('.')
|
||||
@@ -1994,8 +2053,48 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
let extends_class = ''
|
||||
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 +2107,27 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
\ 'mtime': getftime(full_file_path),
|
||||
\ })
|
||||
|
||||
let all_extends = used_traits
|
||||
if extends_class != ''
|
||||
let [extends_class, namespace] = phpcomplete#ExpandClassName(extends_class, current_namespace, imports)
|
||||
call add(all_extends, extends_class)
|
||||
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(extends_class, namespace)
|
||||
let classlocation = phpcomplete#GetClassLocation(class, namespace)
|
||||
if classlocation == "VIMPHP_BUILTINOBJECT"
|
||||
let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(extends_class)])]
|
||||
let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(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)
|
||||
let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), 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)
|
||||
let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, class)
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
return result
|
||||
@@ -2270,19 +2375,40 @@ 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"')
|
||||
silent! exec block_start_pos[0].','.block_end_pos[0].'d'
|
||||
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')
|
||||
let current_namespace = matchstr(line, '\c^\s*namespace\s*\zs'.namespace_name_pattern.'\ze')
|
||||
break
|
||||
endif
|
||||
|
||||
@@ -2303,11 +2429,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 +2469,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 +2512,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
|
||||
|
@@ -37,16 +37,16 @@ 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'
|
||||
else
|
||||
echom 'clipboard: No clipboard tool available. See :help nvim-clipboard'
|
||||
finish
|
||||
@@ -83,6 +83,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 != ''
|
||||
@@ -46,7 +44,7 @@ function! provider#python#Call(method, args)
|
||||
echohl WarningMsg
|
||||
echomsg v:exception
|
||||
echohl None
|
||||
finish
|
||||
return
|
||||
endtry
|
||||
endif
|
||||
return call(s:rpcrequest, insert(insert(a:args, 'python_'.a:method), s:host))
|
||||
|
@@ -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 != ''
|
||||
@@ -46,7 +44,7 @@ function! provider#python3#Call(method, args)
|
||||
echohl WarningMsg
|
||||
echomsg v:exception
|
||||
echohl None
|
||||
finish
|
||||
return
|
||||
endtry
|
||||
endif
|
||||
return call(s:rpcrequest, insert(insert(a:args, 'python_'.a:method), s:host))
|
||||
|
@@ -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
|
@@ -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' 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']
|
||||
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'))
|
||||
|
696
runtime/autoload/shada.vim
Normal file
696
runtime/autoload/shada.vim
Normal file
@@ -0,0 +1,696 @@
|
||||
if exists('g:loaded_shada_autoload')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_shada_autoload = 1
|
||||
|
||||
""
|
||||
" If true keep the old header entry when editing existing ShaDa file.
|
||||
"
|
||||
" Old header entry will be kept only if it is listed in the opened file. To
|
||||
" remove old header entry despite of the setting just remove it from the
|
||||
" listing. Setting it to false makes plugin ignore all header entries. Defaults
|
||||
" to 1.
|
||||
let g:shada#keep_old_header = get(g:, 'shada#keep_old_header', 1)
|
||||
|
||||
""
|
||||
" If true then first entry will be plugin’s own header entry.
|
||||
let g:shada#add_own_header = get(g:, 'shada#add_own_header', 1)
|
||||
|
||||
""
|
||||
" Dictionary that maps ShaDa types to their names.
|
||||
let s:SHADA_ENTRY_NAMES = {
|
||||
\1: 'header',
|
||||
\2: 'search_pattern',
|
||||
\3: 'replacement_string',
|
||||
\4: 'history_entry',
|
||||
\5: 'register',
|
||||
\6: 'variable',
|
||||
\7: 'global_mark',
|
||||
\8: 'jump',
|
||||
\9: 'buffer_list',
|
||||
\10: 'local_mark',
|
||||
\11: 'change',
|
||||
\}
|
||||
|
||||
""
|
||||
" Dictionary that maps ShaDa names to corresponding types
|
||||
let s:SHADA_ENTRY_TYPES = {}
|
||||
call map(copy(s:SHADA_ENTRY_NAMES),
|
||||
\'extend(s:SHADA_ENTRY_TYPES, {v:val : +v:key})')
|
||||
|
||||
""
|
||||
" Map that maps entry names to lists of keys that can be used by this entry.
|
||||
" Only contains data for entries which are represented as mappings, except for
|
||||
" the header.
|
||||
let s:SHADA_MAP_ENTRIES = {
|
||||
\'search_pattern': ['sp', 'sh', 'ss', 'sb', 'sm', 'sc', 'sl', 'se', 'so',
|
||||
\ 'su'],
|
||||
\'register': ['n', 'rc', 'rw', 'rt'],
|
||||
\'global_mark': ['n', 'f', 'l', 'c'],
|
||||
\'local_mark': ['f', 'n', 'l', 'c'],
|
||||
\'jump': ['f', 'l', 'c'],
|
||||
\'change': ['f', 'l', 'c'],
|
||||
\'header': [],
|
||||
\}
|
||||
|
||||
""
|
||||
" Like one of the values from s:SHADA_MAP_ENTRIES, but for a single buffer in
|
||||
" buffer list entry.
|
||||
let s:SHADA_BUFFER_LIST_KEYS = ['f', 'l', 'c']
|
||||
|
||||
""
|
||||
" List of possible history types. Maps integer values that represent history
|
||||
" types to human-readable names.
|
||||
let s:SHADA_HISTORY_TYPES = ['command', 'search', 'expression', 'input', 'debug']
|
||||
|
||||
""
|
||||
" Map that maps entry names to their descriptions. Only for entries which have
|
||||
" list as a data type. Description is a list of lists where each entry has item
|
||||
" description and item type.
|
||||
let s:SHADA_FIXED_ARRAY_ENTRIES = {
|
||||
\'replacement_string': [[':s replacement string', 'bin']],
|
||||
\'history_entry': [
|
||||
\['history type', 'histtype'],
|
||||
\['contents', 'bin'],
|
||||
\['separator', 'intchar'],
|
||||
\],
|
||||
\'variable': [['name', 'bin'], ['value', 'any']],
|
||||
\}
|
||||
|
||||
""
|
||||
" Dictionary that maps enum names to dictionary with enum values. Dictionary
|
||||
" with enum values maps enum human-readable names to corresponding values. Enums
|
||||
" are used as type names in s:SHADA_FIXED_ARRAY_ENTRIES and
|
||||
" s:SHADA_STANDARD_KEYS.
|
||||
let s:SHADA_ENUMS = {
|
||||
\'histtype': {
|
||||
\'CMD': 0,
|
||||
\'SEARCH': 1,
|
||||
\'EXPR': 2,
|
||||
\'INPUT': 3,
|
||||
\'DEBUG': 4,
|
||||
\},
|
||||
\'regtype': {
|
||||
\'CHARACTERWISE': 0,
|
||||
\'LINEWISE': 1,
|
||||
\'BLOCKWISE': 2,
|
||||
\}
|
||||
\}
|
||||
|
||||
""
|
||||
" Second argument to msgpack#eval.
|
||||
let s:SHADA_SPECIAL_OBJS = {}
|
||||
call map(values(s:SHADA_ENUMS),
|
||||
\'extend(s:SHADA_SPECIAL_OBJS, map(copy(v:val), "string(v:val)"))')
|
||||
|
||||
""
|
||||
" Like s:SHADA_ENUMS, but inner dictionary maps values to names and not names to
|
||||
" values.
|
||||
let s:SHADA_REV_ENUMS = map(copy(s:SHADA_ENUMS), '{}')
|
||||
call map(copy(s:SHADA_ENUMS),
|
||||
\'map(copy(v:val), '
|
||||
\. '"extend(s:SHADA_REV_ENUMS[" . string(v:key) . "], '
|
||||
\. '{v:val : v:key})")')
|
||||
|
||||
""
|
||||
" Maximum length of ShaDa entry name. Used to arrange entries to the table.
|
||||
let s:SHADA_MAX_ENTRY_LENGTH = max(
|
||||
\map(values(s:SHADA_ENTRY_NAMES), 'len(v:val)')
|
||||
\+ [len('unknown (0x)') + 16])
|
||||
|
||||
""
|
||||
" Object that marks required value.
|
||||
let s:SHADA_REQUIRED = []
|
||||
|
||||
""
|
||||
" Dictionary that maps default key names to their description. Description is
|
||||
" a list that contains human-readable hint, key type and default value.
|
||||
let s:SHADA_STANDARD_KEYS = {
|
||||
\'sm': ['magic value', 'boolean', g:msgpack#true],
|
||||
\'sc': ['smartcase value', 'boolean', g:msgpack#false],
|
||||
\'sl': ['has line offset', 'boolean', g:msgpack#false],
|
||||
\'se': ['place cursor at end', 'boolean', g:msgpack#false],
|
||||
\'so': ['offset value', 'integer', 0],
|
||||
\'su': ['is last used', 'boolean', g:msgpack#true],
|
||||
\'ss': ['is :s pattern', 'boolean', g:msgpack#false],
|
||||
\'sh': ['v:hlsearch value', 'boolean', g:msgpack#false],
|
||||
\'sp': ['pattern', 'bin', s:SHADA_REQUIRED],
|
||||
\'sb': ['search backward', 'boolean', g:msgpack#false],
|
||||
\'rt': ['type', 'regtype', s:SHADA_ENUMS.regtype.CHARACTERWISE],
|
||||
\'rw': ['block width', 'uint', 0],
|
||||
\'rc': ['contents', 'binarray', s:SHADA_REQUIRED],
|
||||
\'n': ['name', 'intchar', char2nr('"')],
|
||||
\'l': ['line number', 'uint', 1],
|
||||
\'c': ['column', 'uint', 0],
|
||||
\'f': ['file name', 'bin', s:SHADA_REQUIRED],
|
||||
\}
|
||||
|
||||
""
|
||||
" Set of entry types containing entries which require `n` key.
|
||||
let s:SHADA_REQUIRES_NAME = {'local_mark': 1, 'global_mark': 1, 'register': 1}
|
||||
|
||||
""
|
||||
" Maximum width of human-readable hint. Used to arrange data in table.
|
||||
let s:SHADA_MAX_HINT_WIDTH = max(map(values(s:SHADA_STANDARD_KEYS),
|
||||
\'len(v:val[0])'))
|
||||
|
||||
""
|
||||
" Default mark name for the cases when it makes sense (i.e. for local marks).
|
||||
let s:SHADA_DEFAULT_MARK_NAME = '"'
|
||||
|
||||
""
|
||||
" Mapping that maps timestamps represented using msgpack#string to strftime
|
||||
" output. Used by s:shada_strftime.
|
||||
let s:shada_strftime_cache = {}
|
||||
|
||||
""
|
||||
" Mapping that maps strftime output from s:shada_strftime to timestamps.
|
||||
let s:shada_strptime_cache = {}
|
||||
|
||||
""
|
||||
" Time format used for displaying ShaDa files.
|
||||
let s:SHADA_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S'
|
||||
|
||||
""
|
||||
" Wrapper around msgpack#strftime that caches its output.
|
||||
"
|
||||
" Format is hardcoded to s:SHADA_TIME_FORMAT.
|
||||
function s:shada_strftime(timestamp) abort
|
||||
let key = msgpack#string(a:timestamp)
|
||||
if has_key(s:shada_strftime_cache, key)
|
||||
return s:shada_strftime_cache[key]
|
||||
endif
|
||||
let val = msgpack#strftime(s:SHADA_TIME_FORMAT, a:timestamp)
|
||||
let s:shada_strftime_cache[key] = val
|
||||
let s:shada_strptime_cache[val] = a:timestamp
|
||||
return val
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Wrapper around msgpack#strftime that uses cache created by s:shada_strftime().
|
||||
"
|
||||
" Also caches its own results. Format is hardcoded to s:SHADA_TIME_FORMAT.
|
||||
function s:shada_strptime(string) abort
|
||||
if has_key(s:shada_strptime_cache, a:string)
|
||||
return s:shada_strptime_cache[a:string]
|
||||
endif
|
||||
let ts = msgpack#strptime(s:SHADA_TIME_FORMAT, a:string)
|
||||
let s:shada_strptime_cache[a:string] = ts
|
||||
return ts
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Check whether given value matches given type.
|
||||
"
|
||||
" @return Zero if value matches, error message string if it does not.
|
||||
function s:shada_check_type(type, val) abort
|
||||
let type = msgpack#type(a:val)
|
||||
if type is# a:type
|
||||
return 0
|
||||
endif
|
||||
if has_key(s:SHADA_ENUMS, a:type)
|
||||
let msg = s:shada_check_type('uint', a:val)
|
||||
if msg isnot 0
|
||||
return msg
|
||||
endif
|
||||
if !has_key(s:SHADA_REV_ENUMS[a:type], a:val)
|
||||
let evals_msg = join(map(sort(items(s:SHADA_REV_ENUMS[a:type])),
|
||||
\'v:val[0] . " (" . v:val[1] . ")"'), ', ')
|
||||
return 'Unexpected enum value: expected one of ' . evals_msg
|
||||
endif
|
||||
return 0
|
||||
elseif a:type is# 'uint'
|
||||
if type isnot# 'integer'
|
||||
return 'Expected integer'
|
||||
endif
|
||||
if !(type(a:val) == type({}) ? a:val._VAL[0] == 1 : a:val >= 0)
|
||||
return 'Value is negative'
|
||||
endif
|
||||
return 0
|
||||
elseif a:type is# 'bin'
|
||||
" Binary string without zero bytes
|
||||
if type isnot# 'binary'
|
||||
return 'Expected binary string'
|
||||
elseif (type(a:val) == type({})
|
||||
\&& !empty(filter(copy(a:val._VAL), 'stridx(v:val, "\n") != -1')))
|
||||
return 'Expected no NUL bytes'
|
||||
endif
|
||||
return 0
|
||||
elseif a:type is# 'intchar'
|
||||
let msg = s:shada_check_type('uint', a:val)
|
||||
if msg isnot# 0
|
||||
return msg
|
||||
endif
|
||||
if a:val > 0 || a:val < 1
|
||||
endif
|
||||
return 0
|
||||
elseif a:type is# 'binarray'
|
||||
if type isnot# 'array'
|
||||
return 'Expected array value'
|
||||
elseif !empty(filter(copy(type(a:val) == type({}) ? a:val._VAL : a:val),
|
||||
\'msgpack#type(v:val) isnot# "binary"'))
|
||||
return 'Expected array of binary strings'
|
||||
else
|
||||
for element in (type(a:val) == type({}) ? a:val._VAL : a:val)
|
||||
if (type(element) == type({})
|
||||
\&& !empty(filter(copy(element._VAL), 'stridx(v:val, "\n") != -1')))
|
||||
return 'Expected no NUL bytes'
|
||||
endif
|
||||
unlet element
|
||||
endfor
|
||||
endif
|
||||
return 0
|
||||
elseif a:type is# 'boolean'
|
||||
return 'Expected boolean'
|
||||
elseif a:type is# 'integer'
|
||||
return 'Expected integer'
|
||||
elseif a:type is# 'any'
|
||||
return 0
|
||||
endif
|
||||
return 'Internal error: unknown type ' . a:type
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Convert msgpack mapping object to a list of strings for
|
||||
" s:shada_convert_entry().
|
||||
"
|
||||
" @param[in] map Mapping to convert.
|
||||
" @param[in] default_keys List of keys which have default value in this
|
||||
" mapping.
|
||||
" @param[in] name Name of the converted entry.
|
||||
function s:shada_convert_map(map, default_keys, name) abort
|
||||
let ret = []
|
||||
let keys = copy(a:default_keys)
|
||||
call map(sort(keys(a:map)), 'index(keys, v:val) == -1 ? add(keys, v:val) : 0')
|
||||
let descriptions = map(copy(keys),
|
||||
\'get(s:SHADA_STANDARD_KEYS, v:val, ["", 0, 0])')
|
||||
let max_key_len = max(map(copy(keys), 'len(v:val)'))
|
||||
let max_desc_len = max(map(copy(descriptions),
|
||||
\'v:val[0] is 0 ? 0 : len(v:val[0])'))
|
||||
if max_key_len < len('Key')
|
||||
let max_key_len = len('Key')
|
||||
endif
|
||||
let key_header = 'Key' . repeat('_', max_key_len - len('Key'))
|
||||
if max_desc_len == 0
|
||||
call add(ret, printf(' %% %s %s', key_header, 'Value'))
|
||||
else
|
||||
if max_desc_len < len('Description')
|
||||
let max_desc_len = len('Description')
|
||||
endif
|
||||
let desc_header = ('Description'
|
||||
\. repeat('_', max_desc_len - len('Description')))
|
||||
call add(ret, printf(' %% %s %s %s', key_header, desc_header, 'Value'))
|
||||
endif
|
||||
let i = 0
|
||||
for key in keys
|
||||
let [description, type, default] = descriptions[i]
|
||||
if a:name isnot# 'local_mark' && key is# 'n'
|
||||
unlet default
|
||||
let default = s:SHADA_REQUIRED
|
||||
endif
|
||||
let value = get(a:map, key, default)
|
||||
if (key is# 'n' && !has_key(s:SHADA_REQUIRES_NAME, a:name)
|
||||
\&& value is# s:SHADA_REQUIRED)
|
||||
" Do nothing
|
||||
elseif value is s:SHADA_REQUIRED
|
||||
call add(ret, ' # Required key missing: ' . key)
|
||||
elseif max_desc_len == 0
|
||||
call add(ret, printf(' + %-*s %s',
|
||||
\max_key_len, key,
|
||||
\msgpack#string(value)))
|
||||
else
|
||||
if type isnot 0 && value isnot# default
|
||||
let msg = s:shada_check_type(type, value)
|
||||
if msg isnot 0
|
||||
call add(ret, ' # ' . msg)
|
||||
endif
|
||||
endif
|
||||
let strval = s:shada_string(type, value)
|
||||
if msgpack#type(value) is# 'array' && msg is 0
|
||||
let shift = 2 + 2 + max_key_len + 2 + max_desc_len + 2
|
||||
" Value: 1 2 3 4 5 6:
|
||||
" " + Key Description Value"
|
||||
" 1122333445555555555566
|
||||
if shift + strdisplaywidth(strval, shift) > 80
|
||||
let strval = '@'
|
||||
endif
|
||||
endif
|
||||
call add(ret, printf(' + %-*s %-*s %s',
|
||||
\max_key_len, key,
|
||||
\max_desc_len, description,
|
||||
\strval))
|
||||
if strval is '@'
|
||||
for v in value
|
||||
call add(ret, printf(' | - %s', msgpack#string(v)))
|
||||
unlet v
|
||||
endfor
|
||||
endif
|
||||
endif
|
||||
let i += 1
|
||||
unlet value
|
||||
unlet default
|
||||
endfor
|
||||
return ret
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Wrapper around msgpack#string() which may return string from s:SHADA_REV_ENUMS
|
||||
function s:shada_string(type, v) abort
|
||||
if (has_key(s:SHADA_ENUMS, a:type) && type(a:v) == type(0)
|
||||
\&& has_key(s:SHADA_REV_ENUMS[a:type], a:v))
|
||||
return s:SHADA_REV_ENUMS[a:type][a:v]
|
||||
elseif (a:type is# 'intchar' && type(a:v) == type(0)
|
||||
\&& strtrans(nr2char(a:v)) is# nr2char(a:v))
|
||||
return "'" . nr2char(a:v) . "'"
|
||||
else
|
||||
return msgpack#string(a:v)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Evaluate string obtained by s:shada_string().
|
||||
function s:shada_eval(s) abort
|
||||
return msgpack#eval(a:s, s:SHADA_SPECIAL_OBJS)
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Convert one ShaDa entry to a list of strings suitable for setline().
|
||||
"
|
||||
" Returned format looks like this:
|
||||
"
|
||||
" TODO
|
||||
function s:shada_convert_entry(entry) abort
|
||||
if type(a:entry.type) == type({})
|
||||
" |msgpack-special-dict| may only be used if value does not fit into the
|
||||
" default integer type. All known entry types do fit, so it is definitely
|
||||
" unknown entry.
|
||||
let name = 'unknown_(' . msgpack#int_dict_to_str(a:entry.type) . ')'
|
||||
else
|
||||
let name = get(s:SHADA_ENTRY_NAMES, a:entry.type, 0)
|
||||
if name is 0
|
||||
let name = printf('unknown_(0x%x)', a:entry.type)
|
||||
endif
|
||||
endif
|
||||
let title = toupper(name[0]) . tr(name[1:], '_', ' ')
|
||||
let header = printf('%s with timestamp %s:', title,
|
||||
\s:shada_strftime(a:entry.timestamp))
|
||||
let ret = [header]
|
||||
if name[:8] is# 'unknown_(' && name[-1:] is# ')'
|
||||
call add(ret, ' = ' . msgpack#string(a:entry.data))
|
||||
elseif has_key(s:SHADA_FIXED_ARRAY_ENTRIES, name)
|
||||
if type(a:entry.data) != type([])
|
||||
call add(ret, printf(' # Unexpected type: %s instead of array',
|
||||
\msgpack#type(a:entry.data)))
|
||||
call add(ret, ' = ' . msgpack#string(a:entry.data))
|
||||
return ret
|
||||
endif
|
||||
let i = 0
|
||||
let max_desc_len = max(map(copy(s:SHADA_FIXED_ARRAY_ENTRIES[name]),
|
||||
\'len(v:val[0])'))
|
||||
if max_desc_len < len('Description')
|
||||
let max_desc_len = len('Description')
|
||||
endif
|
||||
let desc_header = ('Description'
|
||||
\. repeat('_', max_desc_len - len('Description')))
|
||||
call add(ret, printf(' @ %s %s', desc_header, 'Value'))
|
||||
for value in a:entry.data
|
||||
let [desc, type] = get(s:SHADA_FIXED_ARRAY_ENTRIES[name], i, ['', 0])
|
||||
if (i == 2 && name is# 'history_entry'
|
||||
\&& a:entry.data[0] isnot# s:SHADA_ENUMS.histtype.SEARCH)
|
||||
let [desc, type] = ['', 0]
|
||||
endif
|
||||
if type isnot 0
|
||||
let msg = s:shada_check_type(type, value)
|
||||
if msg isnot 0
|
||||
call add(ret, ' # ' . msg)
|
||||
endif
|
||||
endif
|
||||
call add(ret, printf(' - %-*s %s', max_desc_len, desc,
|
||||
\s:shada_string(type, value)))
|
||||
let i += 1
|
||||
unlet value
|
||||
endfor
|
||||
if (len(a:entry.data) < len(s:SHADA_FIXED_ARRAY_ENTRIES[name])
|
||||
\&& !(name is# 'history_entry'
|
||||
\&& len(a:entry.data) == 2
|
||||
\&& a:entry.data[0] isnot# s:SHADA_ENUMS.histtype.SEARCH))
|
||||
call add(ret, ' # Expected more elements in list')
|
||||
endif
|
||||
elseif has_key(s:SHADA_MAP_ENTRIES, name)
|
||||
if type(a:entry.data) != type({})
|
||||
call add(ret, printf(' # Unexpected type: %s instead of map',
|
||||
\msgpack#type(a:entry.data)))
|
||||
call add(ret, ' = ' . msgpack#string(a:entry.data))
|
||||
return ret
|
||||
endif
|
||||
if msgpack#special_type(a:entry.data) isnot 0
|
||||
call add(ret, ' # Entry is a special dict which is unexpected')
|
||||
call add(ret, ' = ' . msgpack#string(a:entry.data))
|
||||
return ret
|
||||
endif
|
||||
let ret += s:shada_convert_map(a:entry.data, s:SHADA_MAP_ENTRIES[name],
|
||||
\name)
|
||||
elseif name is# 'buffer_list'
|
||||
if type(a:entry.data) != type([])
|
||||
call add(ret, printf(' # Unexpected type: %s instead of array',
|
||||
\msgpack#type(a:entry.data)))
|
||||
call add(ret, ' = ' . msgpack#string(a:entry.data))
|
||||
return ret
|
||||
elseif !empty(filter(copy(a:entry.data),
|
||||
\'type(v:val) != type({}) '
|
||||
\. '|| msgpack#special_type(v:val) isnot 0'))
|
||||
call add(ret, ' # Expected array of maps')
|
||||
call add(ret, ' = ' . msgpack#string(a:entry.data))
|
||||
return ret
|
||||
endif
|
||||
for bufdef in a:entry.data
|
||||
if bufdef isnot a:entry.data[0]
|
||||
call add(ret, '')
|
||||
endif
|
||||
let ret += s:shada_convert_map(bufdef, s:SHADA_BUFFER_LIST_KEYS, name)
|
||||
endfor
|
||||
else
|
||||
throw 'internal-unknown-type:Internal error: unknown type name: ' . name
|
||||
endif
|
||||
return ret
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Order of msgpack objects in one ShaDa entry. Each item in the list is name of
|
||||
" the key in dictionaries returned by shada#read().
|
||||
let s:SHADA_ENTRY_OBJECT_SEQUENCE = ['type', 'timestamp', 'length', 'data']
|
||||
|
||||
""
|
||||
" Convert list returned by msgpackparse() to a list of ShaDa objects
|
||||
"
|
||||
" @param[in] mpack List of VimL objects returned by msgpackparse().
|
||||
"
|
||||
" @return List of dictionaries with keys type, timestamp, length and data. Each
|
||||
" dictionary describes one ShaDa entry.
|
||||
function shada#mpack_to_sd(mpack) abort
|
||||
let ret = []
|
||||
let i = 0
|
||||
for element in a:mpack
|
||||
let key = s:SHADA_ENTRY_OBJECT_SEQUENCE[
|
||||
\i % len(s:SHADA_ENTRY_OBJECT_SEQUENCE)]
|
||||
if key is# 'type'
|
||||
call add(ret, {})
|
||||
endif
|
||||
let ret[-1][key] = element
|
||||
if key isnot# 'data'
|
||||
if !msgpack#is_uint(element)
|
||||
throw printf('not-uint:Entry %i has %s element '.
|
||||
\'which is not an unsigned integer',
|
||||
\len(ret), key)
|
||||
endif
|
||||
if key is# 'type' && msgpack#equal(element, 0)
|
||||
throw printf('zero-uint:Entry %i has %s element '.
|
||||
\'which is zero',
|
||||
\len(ret), key)
|
||||
endif
|
||||
endif
|
||||
let i += 1
|
||||
unlet element
|
||||
endfor
|
||||
return ret
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Convert read ShaDa file to a list of lines suitable for setline()
|
||||
"
|
||||
" @param[in] shada List of ShaDa entries like returned by shada#mpack_to_sd().
|
||||
"
|
||||
" @return List of strings suitable for setline()-like functions.
|
||||
function shada#sd_to_strings(shada) abort
|
||||
let ret = []
|
||||
for entry in a:shada
|
||||
let ret += s:shada_convert_entry(entry)
|
||||
endfor
|
||||
return ret
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Convert a readfile()-like list of strings to a list of lines suitable for
|
||||
" setline().
|
||||
"
|
||||
" @param[in] binstrings List of strings to convert.
|
||||
"
|
||||
" @return List of lines.
|
||||
function shada#get_strings(binstrings) abort
|
||||
return shada#sd_to_strings(shada#mpack_to_sd(msgpackparse(a:binstrings)))
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Convert s:shada_convert_entry() output to original entry.
|
||||
function s:shada_convert_strings(strings) abort
|
||||
let strings = copy(a:strings)
|
||||
let match = matchlist(
|
||||
\strings[0],
|
||||
\'\v\C^(.{-})\m with timestamp \(\d\{4}-\d\d-\d\dT\d\d:\d\d:\d\d\):$')
|
||||
if empty(match)
|
||||
throw 'invalid-header:Header has invalid format: ' . strings[0]
|
||||
endif
|
||||
call remove(strings, 0)
|
||||
let title = match[1]
|
||||
let name = tolower(title[0]) . tr(title[1:], ' ', '_')
|
||||
let ret = {}
|
||||
let empty_default = g:msgpack#nil
|
||||
if name[:8] is# 'unknown_(' && name[-1:] is# ')'
|
||||
let ret.type = +name[9:-2]
|
||||
elseif has_key(s:SHADA_ENTRY_TYPES, name)
|
||||
let ret.type = s:SHADA_ENTRY_TYPES[name]
|
||||
if has_key(s:SHADA_MAP_ENTRIES, name)
|
||||
unlet empty_default
|
||||
let empty_default = {}
|
||||
elseif has_key(s:SHADA_FIXED_ARRAY_ENTRIES, name) || name is# 'buffer_list'
|
||||
unlet empty_default
|
||||
let empty_default = []
|
||||
endif
|
||||
else
|
||||
throw 'invalid-type:Unknown type ' . name
|
||||
endif
|
||||
let ret.timestamp = s:shada_strptime(match[2])
|
||||
if empty(strings)
|
||||
let ret.data = empty_default
|
||||
else
|
||||
while !empty(strings)
|
||||
if strings[0][2] is# '='
|
||||
let data = s:shada_eval(strings[0][4:])
|
||||
call remove(strings, 0)
|
||||
elseif strings[0][2] is# '%'
|
||||
if name is# 'buffer_list' && !has_key(ret, 'data')
|
||||
let ret.data = []
|
||||
endif
|
||||
let match = matchlist(
|
||||
\strings[0],
|
||||
\'\m\C^ % \(Key_*\)\( Description_*\)\? Value')
|
||||
if empty(match)
|
||||
throw 'invalid-map-header:Invalid mapping header: ' . strings[0]
|
||||
endif
|
||||
call remove(strings, 0)
|
||||
let key_len = len(match[1])
|
||||
let desc_skip_len = len(match[2])
|
||||
let data = {'_TYPE': v:msgpack_types.map, '_VAL': []}
|
||||
while !empty(strings) && strings[0][2] is# '+'
|
||||
let line = remove(strings, 0)[4:]
|
||||
let key = substitute(line[:key_len - 1], '\v\C\ *$', '', '')
|
||||
let strval = line[key_len + desc_skip_len + 2:]
|
||||
if strval is# '@'
|
||||
let val = []
|
||||
while !empty(strings) && strings[0][2] is# '|'
|
||||
if strings[0][4] isnot# '-'
|
||||
throw ('invalid-array:Expected hyphen-minus at column 5: '
|
||||
\. strings)
|
||||
endif
|
||||
call add(val, s:shada_eval(remove(strings, 0)[5:]))
|
||||
endwhile
|
||||
else
|
||||
let val = s:shada_eval(strval)
|
||||
endif
|
||||
if (has_key(s:SHADA_STANDARD_KEYS, key)
|
||||
\&& s:SHADA_STANDARD_KEYS[key][2] isnot# s:SHADA_REQUIRED
|
||||
\&& msgpack#equal(s:SHADA_STANDARD_KEYS[key][2], val))
|
||||
unlet val
|
||||
continue
|
||||
endif
|
||||
call add(data._VAL, [{'_TYPE': v:msgpack_types.string, '_VAL': [key]},
|
||||
\val])
|
||||
unlet val
|
||||
endwhile
|
||||
elseif strings[0][2] is# '@'
|
||||
let match = matchlist(
|
||||
\strings[0],
|
||||
\'\m\C^ @ \(Description_* \)\?Value')
|
||||
if empty(match)
|
||||
throw 'invalid-array-header:Invalid array header: ' . strings[0]
|
||||
endif
|
||||
call remove(strings, 0)
|
||||
let desc_skip_len = len(match[1])
|
||||
let data = []
|
||||
while !empty(strings) && strings[0][2] is# '-'
|
||||
let val = remove(strings, 0)[4 + desc_skip_len :]
|
||||
call add(data, s:shada_eval(val))
|
||||
endwhile
|
||||
else
|
||||
throw 'invalid-line:Unrecognized line: ' . strings[0]
|
||||
endif
|
||||
if !has_key(ret, 'data')
|
||||
let ret.data = data
|
||||
elseif type(ret.data) == type([])
|
||||
call add(ret.data, data)
|
||||
else
|
||||
let ret.data = [ret.data, data]
|
||||
endif
|
||||
unlet data
|
||||
endwhile
|
||||
endif
|
||||
let ret._data = msgpackdump([ret.data])
|
||||
let ret.length = len(ret._data) - 1
|
||||
for s in ret._data
|
||||
let ret.length += len(s)
|
||||
endfor
|
||||
return ret
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Convert s:shada_sd_to_strings() output to a list of original entries.
|
||||
function shada#strings_to_sd(strings) abort
|
||||
let strings = filter(copy(a:strings), 'v:val !~# ''\v^\s*%(\#|$)''')
|
||||
let stringss = []
|
||||
for string in strings
|
||||
if string[0] isnot# ' '
|
||||
call add(stringss, [])
|
||||
endif
|
||||
call add(stringss[-1], string)
|
||||
endfor
|
||||
return map(copy(stringss), 's:shada_convert_strings(v:val)')
|
||||
endfunction
|
||||
|
||||
""
|
||||
" Convert a list of strings to list of strings suitable for writefile().
|
||||
function shada#get_binstrings(strings) abort
|
||||
let entries = shada#strings_to_sd(a:strings)
|
||||
if !g:shada#keep_old_header
|
||||
call filter(entries, 'v:val.type != ' . s:SHADA_ENTRY_TYPES.header)
|
||||
endif
|
||||
if g:shada#add_own_header
|
||||
let data = {'version': v:version, 'generator': 'shada.vim'}
|
||||
let dumped_data = msgpackdump([data])
|
||||
let length = len(dumped_data) - 1
|
||||
for s in dumped_data
|
||||
let length += len(s)
|
||||
endfor
|
||||
call insert(entries, {
|
||||
\'type': s:SHADA_ENTRY_TYPES.header,
|
||||
\'timestamp': localtime(),
|
||||
\'length': length,
|
||||
\'data': data,
|
||||
\'_data': dumped_data,
|
||||
\})
|
||||
endif
|
||||
let mpack = []
|
||||
for entry in entries
|
||||
let mpack += map(copy(s:SHADA_ENTRY_OBJECT_SEQUENCE), 'entry[v:val]')
|
||||
endfor
|
||||
return msgpackdump(mpack)
|
||||
endfunction
|
@@ -2,6 +2,12 @@
|
||||
|
||||
" Setup: {{{1
|
||||
function! tutor#SetupVim()
|
||||
if &columns < 90
|
||||
set columns=90
|
||||
endif
|
||||
if !exists('g:did_load_ftplugin') || g:did_load_ftplugin != 1
|
||||
filetype plugin on
|
||||
endif
|
||||
if has('syntax')
|
||||
if !exists('g:syntax_on') || g:syntax_on == 0
|
||||
syntax on
|
||||
@@ -245,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
|
||||
@@ -336,6 +343,7 @@ function! tutor#TutorCmd(tutor_name)
|
||||
let l:to_open = l:tutors[l:tutor_to_open-1]
|
||||
endif
|
||||
|
||||
call tutor#SetupVim()
|
||||
exe "edit ".l:to_open
|
||||
endfunction
|
||||
|
||||
|
@@ -20,7 +20,7 @@ all: tags html
|
||||
# Use Vim to generate the tags file. Can only be used when Vim has been
|
||||
# compiled and installed. Supports multiple languages.
|
||||
vimtags: $(DOCS)
|
||||
$(VIMEXE) -u NONE -esX -c "helptags ++t ." -c quit
|
||||
$(VIMEXE) -u NONE -es -c "helptags ++t ." -c quit
|
||||
|
||||
# Use "doctags" to generate the tags file. Only works for English!
|
||||
tags: doctags $(DOCS)
|
||||
|
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 Mar 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -251,12 +251,14 @@ Name triggered by ~
|
||||
|
||||
|SwapExists| detected an existing swap file
|
||||
|TermOpen| when a terminal buffer is starting
|
||||
|TermClose| when a terminal buffer ends
|
||||
|
||||
Options
|
||||
|FileType| when the 'filetype' option has been set
|
||||
|Syntax| when the 'syntax' option has been set
|
||||
|EncodingChanged| after the 'encoding' option has been changed
|
||||
|TermChanged| after the value of 'term' has changed
|
||||
|OptionSet| after setting any option
|
||||
|
||||
Startup and exit
|
||||
|VimEnter| after doing all the startup stuff
|
||||
@@ -306,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
|
||||
|
||||
@@ -720,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
|
||||
@@ -744,6 +760,24 @@ 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.
|
||||
|
||||
Note: It's a bad idea, to reset an option
|
||||
during this autocommand, since this will
|
||||
probably break plugins. You can always use
|
||||
|:noa| to prevent triggering this autocommand.
|
||||
Could be used, to check for existence of the
|
||||
'backupdir' and 'undodir' options and create
|
||||
directories, if they don't exist yet.
|
||||
|
||||
*QuickFixCmdPre*
|
||||
QuickFixCmdPre Before a quickfix command is run (|:make|,
|
||||
|:lmake|, |:grep|, |:lgrep|, |:grepadd|,
|
||||
@@ -871,6 +905,8 @@ TermChanged After the value of 'term' has changed. Useful
|
||||
for re-loading the syntax file to update the
|
||||
colors, fonts and other terminal-dependent
|
||||
settings. Executed for all loaded buffers.
|
||||
{Nvim} *TermClose*
|
||||
TermClose When a terminal buffer ends.
|
||||
{Nvim} *TermOpen*
|
||||
TermOpen When a terminal buffer is starting. This can
|
||||
be used to configure the terminal emulator by
|
||||
@@ -951,6 +987,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
|
||||
@@ -1019,7 +1062,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*
|
||||
|
@@ -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 Jun 25
|
||||
|
||||
|
||||
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.
|
||||
|
||||
@@ -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*
|
||||
@@ -1063,11 +1107,12 @@ There are nine types of registers: *registers* *E354*
|
||||
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
|
||||
|
@@ -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
|
||||
@@ -816,7 +819,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
|
||||
@@ -915,8 +918,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
|
||||
|
@@ -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:
|
@@ -10,11 +10,9 @@ This text is important for those who want to be involved in further developing
|
||||
Vim.
|
||||
|
||||
1. Design goals |design-goals|
|
||||
2. Coding style |coding-style|
|
||||
3. Design decisions |design-decisions|
|
||||
4. Assumptions |design-assumptions|
|
||||
2. Design decisions |design-decisions|
|
||||
|
||||
See the file README.txt in the "src" directory for an overview of the source
|
||||
See the file "src/nvim/README.md" for a high-level overview of the source
|
||||
code.
|
||||
|
||||
Vim is open source software. Everybody is encouraged to contribute to help
|
||||
@@ -30,28 +28,6 @@ Note that quite a few items are contradicting. This is intentional. A
|
||||
balance must be found between them.
|
||||
|
||||
|
||||
VIM IS... VI COMPATIBLE *design-compatible*
|
||||
|
||||
First of all, it should be possible to use Vim as a drop-in replacement for
|
||||
Vi. When the user wants to, he can use Vim in compatible mode and hardly
|
||||
notice any difference with the original Vi.
|
||||
|
||||
Exceptions:
|
||||
- We don't reproduce obvious Vi bugs in Vim.
|
||||
- There are different versions of Vi. I am using Version 3.7 (6/7/85) as a
|
||||
reference. But support for other versions is also included when possible.
|
||||
The Vi part of POSIX is not considered a definitive source.
|
||||
- Vim adds new commands, you cannot rely on some command to fail because it
|
||||
didn't exist in Vi.
|
||||
- Vim will have a lot of features that Vi doesn't have. Going back from Vim
|
||||
to Vi will be a problem, this cannot be avoided.
|
||||
- Some things are hardly ever used (open mode, sending an e-mail when
|
||||
crashing, etc.). Those will only be included when someone has a good reason
|
||||
why it should be included and it's not too much work.
|
||||
- For some items it is debatable whether Vi compatibility should be
|
||||
maintained. There will be an option flag for these.
|
||||
|
||||
|
||||
VIM IS... IMPROVED *design-improved*
|
||||
|
||||
The IMproved bits of Vim should make it a better Vi, without becoming a
|
||||
@@ -122,7 +98,6 @@ fast.
|
||||
VIM IS... MAINTAINABLE *design-maintain*
|
||||
|
||||
- The source code should not become a mess. It should be reliable code.
|
||||
- Use the same layout in all files to make it easy to read |coding-style|.
|
||||
- Use comments in a useful way! Quoting the function name and argument names
|
||||
is NOT useful. Do explain what they are for.
|
||||
- Porting to another platform should be made easy, without having to change
|
||||
@@ -140,216 +115,16 @@ such that most users will enjoy using Vim as it is. Commands and options can
|
||||
be used to adjust Vim to the desire of the user and its environment.
|
||||
|
||||
|
||||
VIM IS... NOT *design-not*
|
||||
NVIM IS... NOT *design-not*
|
||||
|
||||
Nvim is not an Operating System; instead it should be composed with other
|
||||
tools, or hosted as a component. Marvim once said: "Unlike Emacs, Nvim does
|
||||
not attempt to include everything but the kitchen sink, but some people use it
|
||||
for plumbing."
|
||||
|
||||
- Vim is not a shell or an Operating System. You will not be able to run a
|
||||
shell inside Vim or use it to control a debugger. This should work the
|
||||
other way around: Use Vim as a component from a shell or in an IDE.
|
||||
A satirical way to say this: "Unlike Emacs, Vim does not attempt to include
|
||||
everything but the kitchen sink, but some people say that you can clean one
|
||||
with it. ;-)"
|
||||
To use Vim with gdb see: http://www.agide.org and http://clewn.sf.net.
|
||||
- Vim is not a fancy GUI editor that tries to look nice at the cost of
|
||||
being less consistent over all platforms. But functional GUI features are
|
||||
welcomed.
|
||||
|
||||
==============================================================================
|
||||
2. Coding style *coding-style*
|
||||
|
||||
These are the rules to use when making changes to the Vim source code. Please
|
||||
stick to these rules, to keep the sources readable and maintainable.
|
||||
|
||||
This list is not complete. Look in the source code for more examples.
|
||||
|
||||
|
||||
MAKING CHANGES *style-changes*
|
||||
|
||||
The basic steps to make changes to the code:
|
||||
1. Adjust the documentation. Doing this first gives you an impression of how
|
||||
your changes affect the user.
|
||||
2. Make the source code changes.
|
||||
3. Check ../doc/todo.txt if the change affects any listed item.
|
||||
4. Make a patch with "diff -c" against the unmodified code and docs.
|
||||
5. Make a note about what changed and include it with the patch.
|
||||
|
||||
|
||||
USE OF COMMON FUNCTIONS *style-functions*
|
||||
|
||||
Some functions that are common to use, have a special Vim version. Always
|
||||
consider using the Vim version, because they were introduced with a reason.
|
||||
|
||||
NORMAL NAME VIM NAME DIFFERENCE OF VIM VERSION
|
||||
free() vim_free() Checks for freeing NULL
|
||||
malloc() alloc() Checks for out of memory situation
|
||||
malloc() lalloc() Like alloc(), but has long argument
|
||||
strcpy() STRCPY() Includes cast to (char *), for char_u * args
|
||||
strchr() vim_strchr() Accepts special characters
|
||||
strrchr() vim_strrchr() Accepts special characters
|
||||
isspace() ascii_isspace() Can handle characters > 128
|
||||
iswhite() ascii_iswhite() Only true for tab and space
|
||||
memcpy() mch_memmove() Handles overlapped copies
|
||||
bcopy() mch_memmove() Handles overlapped copies
|
||||
memset() vim_memset() Uniform for all systems
|
||||
|
||||
|
||||
NAMES *style-names*
|
||||
|
||||
Function names can not be more than 31 characters long (because of VMS).
|
||||
|
||||
Don't use "delete" as a variable name, C++ doesn't like it.
|
||||
|
||||
Because of the requirement that Vim runs on as many systems as possible, we
|
||||
need to avoid using names that are already defined by the system. This is a
|
||||
list of names that are known to cause trouble. The name is given as a regexp
|
||||
pattern.
|
||||
|
||||
is.*() POSIX, ctype.h
|
||||
to.*() POSIX, ctype.h
|
||||
|
||||
d_.* POSIX, dirent.h
|
||||
l_.* POSIX, fcntl.h
|
||||
gr_.* POSIX, grp.h
|
||||
pw_.* POSIX, pwd.h
|
||||
sa_.* POSIX, signal.h
|
||||
mem.* POSIX, string.h
|
||||
str.* POSIX, string.h
|
||||
wcs.* POSIX, string.h
|
||||
st_.* POSIX, stat.h
|
||||
tms_.* POSIX, times.h
|
||||
tm_.* POSIX, time.h
|
||||
c_.* POSIX, termios.h
|
||||
MAX.* POSIX, limits.h
|
||||
__.* POSIX, system
|
||||
_[A-Z].* POSIX, system
|
||||
E[A-Z0-9]* POSIX, errno.h
|
||||
|
||||
.*_t POSIX, for typedefs. Use .*_T instead.
|
||||
|
||||
wait don't use as argument to a function, conflicts with types.h
|
||||
index shadows global declaration
|
||||
time shadows global declaration
|
||||
new C++ reserved keyword
|
||||
try Borland C++ doesn't like it to be used as a variable.
|
||||
|
||||
clear Mac curses.h
|
||||
echo Mac curses.h
|
||||
instr Mac curses.h
|
||||
meta Mac curses.h
|
||||
newwin Mac curses.h
|
||||
nl Mac curses.h
|
||||
overwrite Mac curses.h
|
||||
refresh Mac curses.h
|
||||
scroll Mac curses.h
|
||||
typeahead Mac curses.h
|
||||
|
||||
basename() GNU string function
|
||||
dirname() GNU string function
|
||||
get_env_value() Linux system function
|
||||
|
||||
|
||||
VARIOUS *style-various*
|
||||
|
||||
Typedef'ed names should end in "_T": >
|
||||
typedef int some_T;
|
||||
Define'ed names should be uppercase: >
|
||||
#define SOME_THING
|
||||
Features always start with "FEAT_": >
|
||||
#define FEAT_FOO
|
||||
|
||||
Don't use '\"', some compilers can't handle it. '"' works fine.
|
||||
|
||||
Don't use:
|
||||
#if HAVE_SOME
|
||||
Some compilers can't handle that and complain that "HAVE_SOME" is not defined.
|
||||
Use
|
||||
#ifdef HAVE_SOME
|
||||
or
|
||||
#if defined(HAVE_SOME)
|
||||
|
||||
|
||||
STYLE *style-examples*
|
||||
|
||||
General rule: One statement per line.
|
||||
|
||||
Wrong: if (cond) a = 1;
|
||||
|
||||
OK: if (cond)
|
||||
a = 1;
|
||||
|
||||
Wrong: while (cond);
|
||||
|
||||
OK: while (cond)
|
||||
;
|
||||
|
||||
Wrong: do a = 1; while (cond);
|
||||
|
||||
OK: do
|
||||
a = 1;
|
||||
while (cond);
|
||||
|
||||
|
||||
Functions start with:
|
||||
|
||||
Wrong: int function_name(int arg1, int arg2)
|
||||
|
||||
OK: /*
|
||||
* Explanation of what this function is used for.
|
||||
*
|
||||
* Return value explanation.
|
||||
*/
|
||||
int
|
||||
function_name(arg1, arg2)
|
||||
int arg1; /* short comment about arg1 */
|
||||
int arg2; /* short comment about arg2 */
|
||||
{
|
||||
int local; /* comment about local */
|
||||
|
||||
local = arg1 * arg2;
|
||||
|
||||
NOTE: Don't use ANSI style function declarations. A few people still have to
|
||||
use a compiler that doesn't support it.
|
||||
|
||||
|
||||
SPACES AND PUNCTUATION *style-spaces*
|
||||
|
||||
No space between a function name and the bracket:
|
||||
|
||||
Wrong: func (arg);
|
||||
OK: func(arg);
|
||||
|
||||
Do use a space after if, while, switch, etc.
|
||||
|
||||
Wrong: if(arg) for(;;)
|
||||
OK: if (arg) for (;;)
|
||||
|
||||
Use a space after a comma and semicolon:
|
||||
|
||||
Wrong: func(arg1,arg2); for (i = 0;i < 2;++i)
|
||||
OK: func(arg1, arg2); for (i = 0; i < 2; ++i)
|
||||
|
||||
Use a space before and after '=', '+', '/', etc.
|
||||
|
||||
Wrong: var=a*5;
|
||||
OK: var = a * 5;
|
||||
|
||||
In general: Use empty lines to group lines of code together. Put a comment
|
||||
just above the group of lines. This makes it easier to quickly see what is
|
||||
being done.
|
||||
|
||||
OK: /* Prepare for building the table. */
|
||||
get_first_item();
|
||||
table_idx = 0;
|
||||
|
||||
/* Build the table */
|
||||
while (has_item())
|
||||
table[table_idx++] = next_item();
|
||||
|
||||
/* Finish up. */
|
||||
cleanup_items();
|
||||
generate_hash(table);
|
||||
|
||||
==============================================================================
|
||||
3. Design decisions *design-decisions*
|
||||
2. Design decisions *design-decisions*
|
||||
|
||||
Folding
|
||||
|
||||
@@ -484,17 +259,4 @@ This isn't ideal, because the longer Vim is running the higher the counts
|
||||
become. But in practice it is a noticeable improvement over not using the word
|
||||
count.
|
||||
|
||||
==============================================================================
|
||||
4. Assumptions *design-assumptions*
|
||||
|
||||
Size of variables:
|
||||
char 8 bit signed
|
||||
char_u 8 bit unsigned
|
||||
int 32 or 64 bit signed (16 might be possible with limited features)
|
||||
unsigned 32 or 64 bit unsigned (16 as with ints)
|
||||
long 32 or 64 bit signed, can hold a pointer
|
||||
|
||||
Note that some compilers cannot handle long lines or strings. The C89
|
||||
standard specifies a limit of 509 characters.
|
||||
|
||||
vim:tw=78: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 Feb 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -306,6 +306,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*
|
||||
|
||||
|
@@ -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.
|
||||
@@ -470,9 +469,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 +492,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 +794,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 +964,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 +997,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
|
||||
@@ -1141,10 +1141,10 @@ If you want to always use ":confirm", set the 'confirm' option.
|
||||
|:mkvimrc|, |:mksession|, |:mkview|, |:split|,
|
||||
|:vsplit|, |:tabe|, |:tabnew|, |:cfile|, |:cgetfile|,
|
||||
|:caddfile|, |:lfile|, |:lgetfile|, |:laddfile|,
|
||||
|:diffsplit|, |:diffpatch|, |:open|, |:pedit|,
|
||||
|:redir|, |:source|, |:update|, |:visual|, |:vsplit|,
|
||||
|: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 +1172,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: >
|
||||
@@ -1225,7 +1222,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
|
||||
<
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 7.4. Last change: 2014 Nov 27
|
||||
*eval.txt* For Vim version 7.4. Last change: 2015 Jun 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -65,14 +65,16 @@ the Number. Examples:
|
||||
Number 0 --> String "0" ~
|
||||
Number -1 --> String "-1" ~
|
||||
*octal*
|
||||
Conversion from a String to a Number is done by converting the first digits
|
||||
to a number. Hexadecimal "0xf9" and Octal "017" numbers are recognized. If
|
||||
the String doesn't start with digits, the result is zero. Examples:
|
||||
Conversion from a String to a Number is done by converting the first digits to
|
||||
a number. Hexadecimal "0xf9", Octal "017", and Binary "0b10" numbers are
|
||||
recognized. If the String doesn't start with digits, the result is zero.
|
||||
Examples:
|
||||
String "456" --> Number 456 ~
|
||||
String "6bar" --> Number 6 ~
|
||||
String "foo" --> Number 0 ~
|
||||
String "0xf1" --> Number 241 ~
|
||||
String "0100" --> Number 64 ~
|
||||
String "0b101" --> Number 5 ~
|
||||
String "-8" --> Number -8 ~
|
||||
String "+8" --> Number 0 ~
|
||||
|
||||
@@ -522,7 +524,7 @@ Funcref to a Dictionary, but the "self" variable is not available then.
|
||||
To avoid the extra name for the function it can be defined and directly
|
||||
assigned to a Dictionary in this way: >
|
||||
:let mydict = {'data': [0, 1, 2, 3]}
|
||||
:function mydict.len() dict
|
||||
:function mydict.len()
|
||||
: return len(self.data)
|
||||
:endfunction
|
||||
:echo mydict.len()
|
||||
@@ -953,7 +955,7 @@ Decimal, Hexadecimal (starting with 0x or 0X), or Octal (starting with 0).
|
||||
Floating point numbers can be written in two forms:
|
||||
|
||||
[-+]{N}.{M}
|
||||
[-+]{N}.{M}e[-+]{exp}
|
||||
[-+]{N}.{M}[eE][-+]{exp}
|
||||
|
||||
{N} and {M} are numbers. Both {N} and {M} must be present and can only
|
||||
contain digits.
|
||||
@@ -1001,7 +1003,7 @@ function. Example: >
|
||||
|
||||
|
||||
|
||||
string *string* *expr-string* *E114*
|
||||
string *string* *String* *expr-string* *E114*
|
||||
------
|
||||
"string" string constant *expr-quote*
|
||||
|
||||
@@ -1017,7 +1019,7 @@ A string constant accepts these special characters:
|
||||
\X. same as \x.
|
||||
\u.... character specified with up to 4 hex numbers, stored according to the
|
||||
current value of 'encoding' (e.g., "\u02a4")
|
||||
\U.... same as \u....
|
||||
\U.... same as \u but allows up to 8 hex numbers.
|
||||
\b backspace <BS>
|
||||
\e escape <Esc>
|
||||
\f formfeed <FF>
|
||||
@@ -1375,6 +1377,31 @@ v:errmsg Last given error message. It's allowed to set this variable.
|
||||
: ... handle error
|
||||
< "errmsg" also works, for backwards compatibility.
|
||||
|
||||
*v:errors* *errors-variable*
|
||||
v:errors Errors found by assert functions, such as |assert_true()|.
|
||||
This is a list of strings.
|
||||
The assert functions append an item when an assert fails.
|
||||
To remove old results make it empty: >
|
||||
:let v:errors = []
|
||||
< If v:errors is set to anything but a list it is made an empty
|
||||
list by the assert function.
|
||||
|
||||
*v:event* *event-variable*
|
||||
v:event Dictionary of event data for the current |autocommand|. The
|
||||
available keys differ per event type and are specified at the
|
||||
documentation for each |event|. The possible keys are:
|
||||
operator The operation performed. Unlike
|
||||
|v:operator|, it is set also for an Ex
|
||||
mode command. For instance, |:yank| is
|
||||
translated to "|y|".
|
||||
regcontents Text stored in the register as a
|
||||
|readfile()|-style list of lines.
|
||||
regname Requested register (e.g "x" for "xyy)
|
||||
or the empty string for an unnamed
|
||||
operation.
|
||||
regtype Type of register as returned by
|
||||
|getregtype()|.
|
||||
|
||||
*v:exception* *exception-variable*
|
||||
v:exception The value of the exception most recently caught and not
|
||||
finished. See also |v:throwpoint| and |throw-variables|.
|
||||
@@ -1535,6 +1562,15 @@ v:oldfiles List of file names that is loaded from the |shada| file on
|
||||
than String this will cause trouble.
|
||||
{only when compiled with the |+shada| feature}
|
||||
|
||||
*v:option_new*
|
||||
v:option_new New value of the option. Valid while executing an |OptionSet|
|
||||
autocommand.
|
||||
*v:option_old*
|
||||
v:option_old Old value of the option. Valid while executing an |OptionSet|
|
||||
autocommand.
|
||||
*v:option_type*
|
||||
v:option_type Scope of the set command. Valid while executing an
|
||||
|OptionSet| autocommand. Can be either "global" or "local"
|
||||
*v:operator* *operator-variable*
|
||||
v:operator The last operator given in Normal mode. This is a single
|
||||
character except for commands starting with <g> or <z>,
|
||||
@@ -1719,10 +1755,13 @@ append( {lnum}, {string}) Number append {string} below line {lnum}
|
||||
append( {lnum}, {list}) Number append lines {list} below line {lnum}
|
||||
argc() Number number of files in the argument list
|
||||
argidx() Number current index in the argument list
|
||||
arglistid( [{winnr}, [ {tabnr}]])
|
||||
arglistid( [{winnr} [, {tabnr}]])
|
||||
Number argument list id
|
||||
argv( {nr}) String {nr} entry of the argument list
|
||||
argv( ) List the argument list
|
||||
assert_equal( {exp}, {act} [, {msg}]) none assert that {exp} equals {act}
|
||||
assert_false( {actual} [, {msg}]) none assert that {actual} is false
|
||||
assert_true( {actual} [, {msg}]) none assert that {actual} is true
|
||||
asin( {expr}) Float arc sine of {expr}
|
||||
atan( {expr}) Float arc tangent of {expr}
|
||||
atan2( {expr}, {expr}) Float arc tangent of {expr1} / {expr2}
|
||||
@@ -1763,6 +1802,10 @@ cursor( {lnum}, {col} [, {off}])
|
||||
cursor( {list}) Number move cursor to position in {list}
|
||||
deepcopy( {expr} [, {noref}]) any make a full copy of {expr}
|
||||
delete( {fname}) Number delete file {fname}
|
||||
dictwatcheradd( {dict}, {pattern}, {callback})
|
||||
Start watching a dictionary
|
||||
dictwatcherdel( {dict}, {pattern}, {callback})
|
||||
Stop watching a dictionary
|
||||
did_filetype() Number TRUE if FileType autocommand event used
|
||||
diff_filler( {lnum}) Number diff filler lines about {lnum}
|
||||
diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col}
|
||||
@@ -1837,10 +1880,10 @@ getwinposx() Number X coord in pixels of GUI Vim window
|
||||
getwinposy() Number Y coord in pixels of GUI Vim window
|
||||
getwinvar( {nr}, {varname} [, {def}])
|
||||
any variable {varname} in window {nr}
|
||||
glob( {expr} [, {nosuf} [, {list}]])
|
||||
glob( {expr} [, {nosuf} [, {list} [, {alllinks}]]])
|
||||
any expand file wildcards in {expr}
|
||||
glob2regpat( {expr}) String convert a glob pat into a search pat
|
||||
globpath( {path}, {expr} [, {nosuf} [, {list}]])
|
||||
globpath( {path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
|
||||
String do glob({expr}) for all dirs in {path}
|
||||
has( {feature}) Number TRUE if feature {feature} supported
|
||||
has_key( {dict}, {key}) Number TRUE if {dict} has entry {key}
|
||||
@@ -1864,16 +1907,22 @@ inputdialog( {p} [, {t} [, {c}]]) String like input() but in a GUI dialog
|
||||
inputlist( {textlist}) Number let the user pick from a choice list
|
||||
inputrestore() Number restore typeahead
|
||||
inputsave() Number save and clear typeahead
|
||||
inputsecret( {prompt} [, {text}]) String like input() but hiding the text
|
||||
insert( {list}, {item} [, {idx}]) List insert {item} in {list} [before {idx}]
|
||||
inputsecret( {prompt} [, {text}])
|
||||
String like input() but hiding the text
|
||||
insert( {list}, {item} [, {idx}])
|
||||
List insert {item} in {list} [before {idx}]
|
||||
invert( {expr}) Number bitwise invert
|
||||
isdirectory( {directory}) Number TRUE if {directory} is a directory
|
||||
islocked( {expr}) Number TRUE if {expr} is locked
|
||||
items( {dict}) List key-value pairs in {dict}
|
||||
job_close({job}) Closes a job with id {job}
|
||||
job_send({job}, {data}) Writes {data} to {job}'s stdin
|
||||
job_spawn({name}, {prog}[, {argv}])
|
||||
Spawns {prog} as a job associated with {name}
|
||||
jobclose( {job}[, {stream}]) Number Closes a job stream(s)
|
||||
jobpid( {job}) Number Returns pid of a job.
|
||||
jobresize( {job}, {width}, {height})
|
||||
Number Resize {job}'s pseudo terminal window
|
||||
jobsend( {job}, {data}) Number Writes {data} to {job}'s stdin
|
||||
jobstart( {cmd}[, {opts}]) Number Spawns {cmd} as a job
|
||||
jobstop( {job}) Number Stops a job
|
||||
jobwait( {ids}[, {timeout}]) Number Wait for a set of jobs
|
||||
join( {list} [, {sep}]) String join {list} items into one String
|
||||
keys( {dict}) List keys in {dict}
|
||||
len( {expr}) Number the length of {expr}
|
||||
@@ -1943,12 +1992,12 @@ repeat( {expr}, {count}) String repeat {expr} {count} times
|
||||
resolve( {filename}) String get filename a shortcut points to
|
||||
reverse( {list}) List reverse {list} in-place
|
||||
round( {expr}) Float round off {expr}
|
||||
rpcnotify({channel}, {event}[, {args}...])
|
||||
rpcnotify( {channel}, {event}[, {args}...])
|
||||
Sends a |msgpack-rpc| notification to {channel}
|
||||
rpcrequest({channel}, {method}[, {args}...])
|
||||
rpcrequest( {channel}, {method}[, {args}...])
|
||||
Sends a |msgpack-rpc| request to {channel}
|
||||
rpcstart({prog}[, {argv}]) Spawns {prog} and opens a |msgpack-rpc| channel
|
||||
rpcstop({channel}) Closes a |msgpack-rpc| {channel}
|
||||
rpcstart( {prog}[, {argv}]) Spawns {prog} and opens a |msgpack-rpc| channel
|
||||
rpcstop( {channel}) Closes a |msgpack-rpc| {channel}
|
||||
screenattr( {row}, {col}) Number attribute at screen position
|
||||
screenchar( {row}, {col}) Number character at screen position
|
||||
screencol() Number current cursor column
|
||||
@@ -1970,11 +2019,12 @@ setbufvar( {expr}, {varname}, {val}) set {varname} in buffer {expr} to {val}
|
||||
setcharsearch( {dict}) Dict set character search from {dict}
|
||||
setcmdpos( {pos}) Number set cursor position in command-line
|
||||
setline( {lnum}, {line}) Number set line {lnum} to {line}
|
||||
setloclist( {nr}, {list}[, {action}])
|
||||
setloclist( {nr}, {list}[, {action}[, {title}]])
|
||||
Number modify location list using {list}
|
||||
setmatches( {list}) Number restore a list of matches
|
||||
setpos( {expr}, {list}) Number set the {expr} position to {list}
|
||||
setqflist( {list}[, {action}]) Number modify quickfix list using {list}
|
||||
setqflist( {list}[, {action}[, {title}]]
|
||||
Number modify quickfix list using {list}
|
||||
setreg( {n}, {v}[, {opt}]) Number set register to value and type
|
||||
settabvar( {nr}, {varname}, {val}) set {varname} in tab page {nr} to {val}
|
||||
settabwinvar( {tabnr}, {winnr}, {varname}, {val}) set {varname} in window
|
||||
@@ -1999,7 +2049,7 @@ split( {expr} [, {pat} [, {keepempty}]])
|
||||
sqrt( {expr}) Float square root of {expr}
|
||||
str2float( {expr}) Float convert String to Float
|
||||
str2nr( {expr} [, {base}]) Number convert String to Number
|
||||
strchars( {expr}) Number character length of the String {expr}
|
||||
strchars( {expr} [, {skipcc}]) Number character length of the String {expr}
|
||||
strdisplaywidth( {expr} [, {col}]) Number display length of the String {expr}
|
||||
strftime( {format}[, {time}]) String time in specified format
|
||||
stridx( {haystack}, {needle}[, {start}])
|
||||
@@ -2147,6 +2197,37 @@ argv([{nr}]) The result is the {nr}th file in the argument list of the
|
||||
< Without the {nr} argument a |List| with the whole |arglist| is
|
||||
returned.
|
||||
|
||||
*assert_equal()*
|
||||
assert_equal({expected}, {actual}, [, {msg}])
|
||||
When {expected} and {actual} are not equal an error message is
|
||||
added to |v:errors|.
|
||||
There is no automatic conversion, the String "4" is different
|
||||
from the Number 4. And the number 4 is different from the
|
||||
Float 4.0. The value of 'ignorecase' is not used here, case
|
||||
always matters.
|
||||
When {msg} is omitted an error in the form "Expected
|
||||
{expected} but got {actual}" is produced.
|
||||
Example: >
|
||||
assert_equal('foo', 'bar')
|
||||
< Will result in a string to be added to |v:errors|:
|
||||
test.vim line 12: Expected 'foo' but got 'bar' ~
|
||||
|
||||
assert_false({actual}, [, {msg}]) *assert_false()*
|
||||
When {actual} is not false an error message is added to
|
||||
|v:errors|, like with |assert_equal()|..
|
||||
A value is false when it is zero. When "{actual}" is not a
|
||||
number the assert fails.
|
||||
When {msg} is omitted an error in the form "Expected False but
|
||||
got {actual}" is produced.
|
||||
|
||||
assert_true({actual}, [, {msg}]) *assert_true()*
|
||||
When {actual} is not true an error message is added to
|
||||
|v:errors|, like with |assert_equal()|..
|
||||
A value is true when it is a non-zeron number. When {actual}
|
||||
is not a number the assert fails.
|
||||
When {msg} is omitted an error in the form "Expected True but
|
||||
got {actual}" is produced.
|
||||
|
||||
asin({expr}) *asin()*
|
||||
Return the arc sine of {expr} measured in radians, as a |Float|
|
||||
in the range of [-pi/2, pi/2].
|
||||
@@ -2401,6 +2482,10 @@ col({expr}) The result is a Number, which is the byte index of the column
|
||||
number of bytes in the cursor line plus one)
|
||||
'x position of mark x (if the mark is not set, 0 is
|
||||
returned)
|
||||
v In Visual mode: the start of the Visual area (the
|
||||
cursor is the end). When not in Visual mode
|
||||
returns the cursor position. Differs from |'<| in
|
||||
that it's updated right away.
|
||||
Additionally {expr} can be [lnum, col]: a |List| with the line
|
||||
and column number. Most useful when the column is "$", to get
|
||||
the last column of a specific line. When "lnum" or "col" is
|
||||
@@ -2502,10 +2587,10 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
|
||||
{default} is omitted, 1 is used.
|
||||
|
||||
The optional {type} argument gives the type of dialog. This
|
||||
is only used for the icon of the GTK, Mac, Motif and Win32
|
||||
GUI. It can be one of these values: "Error", "Question",
|
||||
"Info", "Warning" or "Generic". Only the first character is
|
||||
relevant. When {type} is omitted, "Generic" is used.
|
||||
is only used for the icon of the Win32 GUI. It can be one of
|
||||
these values: "Error", "Question", "Info", "Warning" or
|
||||
"Generic". Only the first character is relevant.
|
||||
When {type} is omitted, "Generic" is used.
|
||||
|
||||
If the user aborts the dialog by pressing <Esc>, CTRL-C,
|
||||
or another valid interrupt key, confirm() returns 0.
|
||||
@@ -2661,6 +2746,44 @@ delete({fname}) *delete()*
|
||||
To delete a line from the buffer use |:delete|. Use |:exe|
|
||||
when the line number is in a variable.
|
||||
|
||||
dictwatcheradd({dict}, {pattern}, {callback}) *dictwatcheradd()*
|
||||
Adds a watcher to a dictionary. A dictionary watcher is
|
||||
identified by three components:
|
||||
|
||||
- A dictionary({dict});
|
||||
- A key pattern({pattern}).
|
||||
- A function({callback}).
|
||||
|
||||
After this is called, every change on {dict} and on keys
|
||||
matching {pattern} will result in {callback} being invoked.
|
||||
|
||||
For now {pattern} only accepts very simple patterns that can
|
||||
contain a '*' at the end of the string, in which case it will
|
||||
match every key that begins with the substring before the '*'.
|
||||
That means if '*' is not the last character of {pattern}, only
|
||||
keys that are exactly equal as {pattern} will be matched.
|
||||
|
||||
The {callback} receives three arguments:
|
||||
|
||||
- The dictionary being watched.
|
||||
- The key which changed.
|
||||
- A dictionary containg the new and old values for the key.
|
||||
|
||||
The type of change can be determined by examining the keys
|
||||
present on the third argument:
|
||||
|
||||
- If contains both `old` and `new`, the key was updated.
|
||||
- If it contains only `new`, the key was added.
|
||||
- If it contains only `old`, the key was deleted.
|
||||
|
||||
This function can be used by plugins to implement options with
|
||||
validation and parsing logic.
|
||||
|
||||
dictwatcherdel({dict}, {pattern}, {callback}) *dictwatcherdel()*
|
||||
Removes a watcher added with |dictwatcheradd()|. All three
|
||||
arguments must match the ones passed to |dictwatcheradd()| in
|
||||
order for the watcher to be successfully deleted.
|
||||
|
||||
*did_filetype()*
|
||||
did_filetype() Returns non-zero when autocommands are being executed and the
|
||||
FileType event has been triggered at least once. Can be used
|
||||
@@ -2726,7 +2849,7 @@ executable({expr}) *executable()*
|
||||
arguments.
|
||||
executable() uses the value of $PATH and/or the normal
|
||||
searchpath for programs. *PATHEXT*
|
||||
On MS-DOS and MS-Windows the ".exe", ".bat", etc. can
|
||||
On Windows the ".exe", ".bat", etc. can
|
||||
optionally be included. Then the extensions in $PATHEXT are
|
||||
tried. Thus if "foo.exe" does not exist, "foo.exe.bat" can be
|
||||
found. If $PATHEXT is not set then ".exe;.com;.bat;.cmd" is
|
||||
@@ -2734,9 +2857,9 @@ executable({expr}) *executable()*
|
||||
the name without an extension. When 'shell' looks like a
|
||||
Unix shell, then the name is also tried without adding an
|
||||
extension.
|
||||
On MS-DOS and MS-Windows it only checks if the file exists and
|
||||
On Windows it only checks if the file exists and
|
||||
is not a directory, not if it's really executable.
|
||||
On MS-Windows an executable in the same directory as Vim is
|
||||
On Windows an executable in the same directory as Vim is
|
||||
always found. Since this directory is added to $PATH it
|
||||
should also work to execute it |win32-PATH|.
|
||||
The result is a Number:
|
||||
@@ -2959,6 +3082,8 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
|
||||
{expr1} is changed when {expr2} is not empty. If necessary
|
||||
make a copy of {expr1} first.
|
||||
{expr2} remains unchanged.
|
||||
When {expr1} is locked and {expr2} is not empty the operation
|
||||
fails.
|
||||
Returns {expr1}.
|
||||
|
||||
|
||||
@@ -3178,8 +3303,7 @@ foreground() Move the Vim window to the foreground. Useful when sent from
|
||||
On Win32 systems this might not work, the OS does not always
|
||||
allow a window to bring itself to the foreground. Use
|
||||
|remote_foreground()| instead.
|
||||
{only in the Win32, Athena, Motif and GTK GUI versions and the
|
||||
Win32 console version}
|
||||
{only in the Win32 GUI and console version}
|
||||
|
||||
|
||||
function({name}) *function()* *E700*
|
||||
@@ -3310,7 +3434,7 @@ getchar([expr]) *getchar()*
|
||||
: endwhile
|
||||
:endfunction
|
||||
<
|
||||
You may also receive syntetic characters, such as
|
||||
You may also receive synthetic characters, such as
|
||||
|<CursorHold>|. Often you will want to ignore this and get
|
||||
another character: >
|
||||
:function GetKey()
|
||||
@@ -3427,8 +3551,6 @@ getfontname([{name}]) *getfontname()*
|
||||
Only works when the GUI is running, thus not in your vimrc or
|
||||
gvimrc file. Use the |GUIEnter| autocommand to use this
|
||||
function just after the GUI has started.
|
||||
Note that the GTK 2 GUI accepts any font name, thus checking
|
||||
for a valid name does not work.
|
||||
|
||||
getfperm({fname}) *getfperm()*
|
||||
The result is a String, which is the read, write, and execute
|
||||
@@ -3527,8 +3649,7 @@ getmatches() *getmatches()*
|
||||
<
|
||||
*getpid()*
|
||||
getpid() Return a Number which is the process ID of the Vim process.
|
||||
On Unix and MS-Windows this is a unique number, until Vim
|
||||
exits. On MS-DOS it's always zero.
|
||||
This is a unique number, until Vim exits.
|
||||
|
||||
*getpos()*
|
||||
getpos({expr}) Get the position for {expr}. For possible values of {expr}
|
||||
@@ -3654,7 +3775,7 @@ getwinvar({winnr}, {varname} [, {def}]) *getwinvar()*
|
||||
:let list_is_on = getwinvar(2, '&list')
|
||||
:echo "myvar = " . getwinvar(1, 'myvar')
|
||||
<
|
||||
glob({expr} [, {nosuf} [, {list}]]) *glob()*
|
||||
glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()*
|
||||
Expand the file wildcards in {expr}. See |wildcards| for the
|
||||
use of special characters.
|
||||
|
||||
@@ -3671,8 +3792,11 @@ glob({expr} [, {nosuf} [, {list}]]) *glob()*
|
||||
matches, they are separated by <NL> characters.
|
||||
|
||||
If the expansion fails, the result is an empty String or List.
|
||||
|
||||
A name for a non-existing file is not included. A symbolic
|
||||
link is only included if it points to an existing file.
|
||||
However, when the {alllinks} argument is present and it is
|
||||
non-zero then all symbolic links are included.
|
||||
|
||||
For most systems backticks can be used to get files names from
|
||||
any external command. Example: >
|
||||
@@ -3691,8 +3815,11 @@ glob2regpat({expr}) *glob2regpat()*
|
||||
if filename =~ glob2regpat('Make*.mak')
|
||||
< This is equivalent to: >
|
||||
if filename =~ '^Make.*\.mak$'
|
||||
<
|
||||
globpath({path}, {expr} [, {nosuf} [, {list}]]) *globpath()*
|
||||
< When {expr} is an empty string the result is "^$", match an
|
||||
empty string.
|
||||
|
||||
*globpath()*
|
||||
globpath({path}, {expr} [, {nosuf} [, {list} [, {allinks}]]])
|
||||
Perform glob() on all directories in {path} and concatenate
|
||||
the results. Example: >
|
||||
:echo globpath(&rtp, "syntax/c.vim")
|
||||
@@ -3718,6 +3845,8 @@ globpath({path}, {expr} [, {nosuf} [, {list}]]) *globpath()*
|
||||
they are separated by <NL> characters. Example: >
|
||||
:echo globpath(&rtp, "syntax/c.vim", 0, 1)
|
||||
<
|
||||
{allinks} is used as with |glob()|.
|
||||
|
||||
The "**" item can be used to search in a directory tree.
|
||||
For example, to find all "README.txt" files in the directories
|
||||
in 'runtimepath' and below: >
|
||||
@@ -4060,6 +4189,9 @@ jobclose({job}[, {stream}]) {Nvim} *jobclose()*
|
||||
Close {job}'s {stream}, which can be one "stdin", "stdout" or
|
||||
"stderr". If {stream} is omitted, all streams are closed.
|
||||
|
||||
jobpid({job}) {Nvim} *jobpid()*
|
||||
Return the pid (process id) of {job}.
|
||||
|
||||
jobresize({job}, {width}, {height}) {Nvim} *jobresize()*
|
||||
Resize {job}'s pseudo terminal window to {width} and {height}.
|
||||
This function will fail if used on jobs started without the
|
||||
@@ -4079,9 +4211,14 @@ jobsend({job}, {data}) {Nvim} *jobsend()*
|
||||
|
||||
jobstart({cmd}[, {opts}]) {Nvim} *jobstart()*
|
||||
Spawns {cmd} as a job. If {cmd} is a |List|, it will be run
|
||||
directly. If {cmd} is a |string|, it will be equivalent to >
|
||||
:call jobstart([&shell, &shellcmdflag, '{cmd}'])
|
||||
< If passed, {opts} must be a dictionary with any of the
|
||||
directly. If {cmd} is a |string|, it will be roughly
|
||||
equivalent to >
|
||||
:call jobstart(split(&shell) + split(&shellcmdflag) + ['{cmd}'])
|
||||
< NOTE: read |shell-unquoting| before constructing any lists
|
||||
with 'shell' or 'shellcmdflag' options. The above call is
|
||||
only written to show the idea, one needs to perform unquoting
|
||||
and do split taking quotes into account.
|
||||
If passed, {opts} must be a dictionary with any of the
|
||||
following keys:
|
||||
- on_stdout: stdout event handler
|
||||
- on_stderr: stderr event handler
|
||||
@@ -4092,6 +4229,10 @@ jobstart({cmd}[, {opts}]) {Nvim} *jobstart()*
|
||||
- width: Width of the terminal screen(only if pty is set)
|
||||
- height: Height of the terminal screen(only if pty is set)
|
||||
- TERM: $TERM environment variable(only if pty is set)
|
||||
- detach: Detach the job process from the nvim process. The
|
||||
process won't get killed when nvim exists. If the process
|
||||
dies before nvim exits, on_exit will still be invoked.
|
||||
This option is only allowed for non-pty jobs.
|
||||
Either funcrefs or function names can be passed as event
|
||||
handlers. The {opts} object is also used as the "self"
|
||||
argument for the callback, so the caller may pass arbitrary
|
||||
@@ -4478,9 +4619,18 @@ matchadd({group}, {pattern}[, {priority}[, {id}]])
|
||||
message will appear and the match will not be added. An ID
|
||||
is specified as a positive integer (zero excluded). IDs 1, 2
|
||||
and 3 are reserved for |:match|, |:2match| and |:3match|,
|
||||
respectively. If the {id} argument is not specified,
|
||||
respectively. If the {id} argument is not specified or -1,
|
||||
|matchadd()| automatically chooses a free ID.
|
||||
|
||||
The optional {dict} argmument allows for further custom
|
||||
values. Currently this is used to specify a match specifc
|
||||
conceal character that will be shown for |hl-Conceal|
|
||||
highlighted matches. The dict can have the following members:
|
||||
|
||||
conceal Special character to show instead of the
|
||||
match (only for |hl-Conceal| highlighed
|
||||
matches, see |:syn-cchar|)
|
||||
|
||||
The number of matches is not limited, as it is the case with
|
||||
the |:match| commands.
|
||||
|
||||
@@ -4494,7 +4644,7 @@ matchadd({group}, {pattern}[, {priority}[, {id}]])
|
||||
available from |getmatches()|. All matches can be deleted in
|
||||
one operation by |clearmatches()|.
|
||||
|
||||
matchaddpos({group}, {pos}[, {priority}[, {id}]]) *matchaddpos()*
|
||||
matchaddpos({group}, {pos}[, {priority}[, {id}[, {dict}]]]) *matchaddpos()*
|
||||
Same as |matchadd()|, but requires a list of positions {pos}
|
||||
instead of a pattern. This command is faster than |matchadd()|
|
||||
because it does not require to handle regular expressions and
|
||||
@@ -4658,7 +4808,7 @@ msgpackdump({list}) {Nvim} *msgpackdump()*
|
||||
(dictionary with zero items is represented by 0x80 byte in
|
||||
messagepack).
|
||||
|
||||
Limitations:
|
||||
Limitations: *E951* *E952*
|
||||
1. |Funcref|s cannot be dumped.
|
||||
2. Containers that reference themselves cannot be dumped.
|
||||
3. Dictionary keys are always dumped as STR strings.
|
||||
@@ -4809,6 +4959,9 @@ printf({fmt}, {expr1} ...) *printf()*
|
||||
%c single byte
|
||||
%d decimal number
|
||||
%5d decimal number padded with spaces to 5 characters
|
||||
%b binary number
|
||||
%08b binary number padded with zeros to at least 8 characters
|
||||
%B binary number using upper case letters
|
||||
%x hex number
|
||||
%04x hex number padded with zeros to at least 4 characters
|
||||
%X hex number using upper case letters
|
||||
@@ -4895,20 +5048,19 @@ printf({fmt}, {expr1} ...) *printf()*
|
||||
|
||||
The conversion specifiers and their meanings are:
|
||||
|
||||
*printf-d* *printf-o* *printf-x* *printf-X*
|
||||
doxX The Number argument is converted to signed decimal
|
||||
(d), unsigned octal (o), or unsigned hexadecimal (x
|
||||
and X) notation. The letters "abcdef" are used for
|
||||
x conversions; the letters "ABCDEF" are used for X
|
||||
conversions.
|
||||
The precision, if any, gives the minimum number of
|
||||
digits that must appear; if the converted value
|
||||
requires fewer digits, it is padded on the left with
|
||||
zeros.
|
||||
In no case does a non-existent or small field width
|
||||
cause truncation of a numeric field; if the result of
|
||||
a conversion is wider than the field width, the field
|
||||
is expanded to contain the conversion result.
|
||||
*printf-d* *printf-b* *printf-B* *printf-o* *printf-x* *printf-X*
|
||||
dbBoxX The Number argument is converted to signed decimal (d),
|
||||
unsigned binary (b and B), unsigned octal (o), or
|
||||
unsigned hexadecimal (x and X) notation. The letters
|
||||
"abcdef" are used for x conversions; the letters
|
||||
"ABCDEF" are used for X conversions. The precision, if
|
||||
any, gives the minimum number of digits that must
|
||||
appear; if the converted value requires fewer digits, it
|
||||
is padded on the left with zeros. In no case does a
|
||||
non-existent or small field width cause truncation of a
|
||||
numeric field; if the result of a conversion is wider
|
||||
than the field width, the field is expanded to contain
|
||||
the conversion result.
|
||||
|
||||
*printf-c*
|
||||
c The Number argument is converted to a byte, and the
|
||||
@@ -4918,6 +5070,7 @@ printf({fmt}, {expr1} ...) *printf()*
|
||||
s The text of the String argument is used. If a
|
||||
precision is specified, no more bytes than the number
|
||||
specified are used.
|
||||
*printf-S*
|
||||
S The text of the String argument is used. If a
|
||||
precision is specified, no more display cells than the
|
||||
number specified are used. Without the |+multi_byte|
|
||||
@@ -4979,7 +5132,7 @@ py3eval({expr}) *py3eval()*
|
||||
Evaluate Python expression {expr} and return its result
|
||||
converted to Vim data structures.
|
||||
Numbers and strings are returned as they are (strings are
|
||||
copied though, unicode strings are additionally converted to
|
||||
copied though, Unicode strings are additionally converted to
|
||||
'encoding').
|
||||
Lists are represented as Vim |List| type.
|
||||
Dictionaries are represented as Vim |Dictionary| type with
|
||||
@@ -5106,8 +5259,7 @@ remote_foreground({server}) *remote_foreground()*
|
||||
Note: This does not restore the window if it was minimized,
|
||||
like foreground() does.
|
||||
This function is not available in the |sandbox|.
|
||||
{only in the Win32, Athena, Motif and GTK GUI versions and the
|
||||
Win32 console version}
|
||||
{only in the Win32 GUI and the Win32 console version}
|
||||
|
||||
|
||||
remote_peek({serverid} [, {retvar}]) *remote_peek()*
|
||||
@@ -5601,11 +5753,13 @@ setline({lnum}, {text}) *setline()*
|
||||
:endfor
|
||||
< Note: The '[ and '] marks are not set.
|
||||
|
||||
setloclist({nr}, {list} [, {action}]) *setloclist()*
|
||||
setloclist({nr}, {list} [, {action}[, {title}]]) *setloclist()*
|
||||
Create or replace or add to the location list for window {nr}.
|
||||
When {nr} is zero the current window is used. For a location
|
||||
list window, the displayed location list is modified. For an
|
||||
invalid window number {nr}, -1 is returned.
|
||||
invalid window number {nr}, -1 is returned. If {title} is
|
||||
given, it will be used to set |w:quickfix_title| after opening
|
||||
the location window.
|
||||
Otherwise, same as |setqflist()|.
|
||||
Also see |location-list|.
|
||||
|
||||
@@ -5662,7 +5816,7 @@ setpos({expr}, {list})
|
||||
|winrestview()|.
|
||||
|
||||
|
||||
setqflist({list} [, {action}]) *setqflist()*
|
||||
setqflist({list} [, {action}[, {title}]]) *setqflist()*
|
||||
Create or replace or add to the quickfix list using the items
|
||||
in {list}. Each item in {list} is a dictionary.
|
||||
Non-dictionary items in {list} are ignored. Each dictionary
|
||||
@@ -5701,6 +5855,9 @@ setqflist({list} [, {action}]) *setqflist()*
|
||||
with the items from {list}. If {action} is not present or is
|
||||
set to ' ', then a new list is created.
|
||||
|
||||
If {title} is given, it will be used to set |w:quickfix_title|
|
||||
after opening the quickfix window.
|
||||
|
||||
Returns zero for success, -1 for failure.
|
||||
|
||||
This function can be used to create a quickfix list
|
||||
@@ -5783,12 +5940,12 @@ setwinvar({nr}, {varname}, {val}) *setwinvar()*
|
||||
:call setwinvar(2, "myvar", "foobar")
|
||||
|
||||
sha256({string}) *sha256()*
|
||||
Returns a String with 64 hex charactes, which is the SHA256
|
||||
Returns a String with 64 hex characters, which is the SHA256
|
||||
checksum of {string}.
|
||||
|
||||
shellescape({string} [, {special}]) *shellescape()*
|
||||
Escape {string} for use as a shell command argument.
|
||||
On MS-Windows and MS-DOS, when 'shellslash' is not set, it
|
||||
On Windows when 'shellslash' is not set, it
|
||||
will enclose {string} in double quotes and double all double
|
||||
quotes within {string}.
|
||||
For other systems, it will enclose {string} in single quotes
|
||||
@@ -6024,24 +6181,28 @@ str2float( {expr}) *str2float()*
|
||||
|
||||
str2nr( {expr} [, {base}]) *str2nr()*
|
||||
Convert string {expr} to a number.
|
||||
{base} is the conversion base, it can be 8, 10 or 16.
|
||||
{base} is the conversion base, it can be 2, 8, 10 or 16.
|
||||
When {base} is omitted base 10 is used. This also means that
|
||||
a leading zero doesn't cause octal conversion to be used, as
|
||||
with the default String to Number conversion.
|
||||
When {base} is 16 a leading "0x" or "0X" is ignored. With a
|
||||
different base the result will be zero.
|
||||
different base the result will be zero. Similarly, when {base}
|
||||
is 8 a leading "0" is ignored, and when {base} is 2 a leading
|
||||
"0b" or "0B" is ignored.
|
||||
Text after the number is silently ignored.
|
||||
|
||||
|
||||
strchars({expr}) *strchars()*
|
||||
strchars({expr} [, {skipcc}]) *strchars()*
|
||||
The result is a Number, which is the number of characters
|
||||
String {expr} occupies. Composing characters are counted
|
||||
separately.
|
||||
in String {expr}.
|
||||
When {skipcc} is omitted or zero, composing characters are
|
||||
counted separately.
|
||||
When {skipcc} set to 1, Composing characters are ignored.
|
||||
Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
|
||||
|
||||
strdisplaywidth({expr}[, {col}]) *strdisplaywidth()*
|
||||
The result is a Number, which is the number of display cells
|
||||
String {expr} occupies on the screen when it starts a {col}.
|
||||
String {expr} occupies on the screen when it starts at {col}.
|
||||
When {col} is omitted zero is used. Otherwise it is the
|
||||
screen column where to start. This matters for Tab
|
||||
characters.
|
||||
@@ -6097,25 +6258,31 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number,
|
||||
{expr} type result ~
|
||||
String 'string'
|
||||
Number 123
|
||||
Float 123.123456 or 1.123456e8
|
||||
Funcref function('name')
|
||||
Float 123.123456 or 1.123456e8 or
|
||||
`str2float('inf')`
|
||||
Funcref `function('name')`
|
||||
List [item, item]
|
||||
Dictionary {key: value, key: value}
|
||||
Note that in String values the ' character is doubled.
|
||||
Also see |strtrans()|.
|
||||
Note 2: Output format is mostly compatible with YAML, except
|
||||
for infinite and NaN floating-point values representations
|
||||
which use |str2float()|. Strings are also dumped literally,
|
||||
only single quote is escaped, which does not allow using YAML
|
||||
for parsing back binary strings (including text when
|
||||
'encoding' is not UTF-8). |eval()| should always work for
|
||||
strings and floats though and this is the only official
|
||||
method, use |msgpackdump()| or |json_encode()| if you need to
|
||||
share data with other application.
|
||||
|
||||
*strlen()*
|
||||
strlen({expr}) The result is a Number, which is the length of the String
|
||||
{expr} in bytes.
|
||||
If you want to count the number of multi-byte characters (not
|
||||
counting composing characters) use something like this: >
|
||||
|
||||
:let len = strlen(substitute(str, ".", "x", "g"))
|
||||
<
|
||||
If the argument is a Number it is first converted to a String.
|
||||
For other types an error is given.
|
||||
Also see |len()|, |strchars()|, |strdisplaywidth()| and
|
||||
|strwidth()|.
|
||||
If you want to count the number of multi-byte characters use
|
||||
|strchars()|.
|
||||
Also see |len()|, |strdisplaywidth()| and |strwidth()|.
|
||||
|
||||
strpart({src}, {start}[, {len}]) *strpart()*
|
||||
The result is a String, which is part of {src}, starting from
|
||||
@@ -6640,6 +6807,10 @@ virtcol({expr}) *virtcol()*
|
||||
plus one)
|
||||
'x position of mark x (if the mark is not set, 0 is
|
||||
returned)
|
||||
v In Visual mode: the start of the Visual area (the
|
||||
cursor is the end). When not in Visual mode
|
||||
returns the cursor position. Differs from |'<| in
|
||||
that it's updated right away.
|
||||
Note that only marks in the current file can be used.
|
||||
Examples: >
|
||||
virtcol(".") with text "foo^Lbar", with cursor on the "^L", returns 5
|
||||
@@ -6852,8 +7023,6 @@ There are four types of features:
|
||||
acl Compiled with |ACL| support.
|
||||
arabic Compiled with Arabic support |Arabic|.
|
||||
autocmd Compiled with autocommand support. |autocommand|
|
||||
balloon_eval Compiled with |balloon-eval| support.
|
||||
balloon_multiline GUI supports multiline balloons.
|
||||
browse Compiled with |:browse| support, and browse() will
|
||||
work.
|
||||
browsefilter Compiled with support for |browsefilter|.
|
||||
@@ -6871,7 +7040,6 @@ debug Compiled with "DEBUG" defined.
|
||||
dialog_con Compiled with console dialog support.
|
||||
dialog_gui Compiled with GUI dialog support.
|
||||
digraphs Compiled with support for digraphs.
|
||||
dnd Compiled with support for the "~ register |quote_~|.
|
||||
eval Compiled with expression evaluation support. Always
|
||||
true, of course!
|
||||
ex_extra Compiled with extra Ex commands |+ex_extra|.
|
||||
@@ -6884,21 +7052,13 @@ filterpipe When 'shelltemp' is off pipes are used for shell
|
||||
find_in_path Compiled with support for include file searches
|
||||
|+find_in_path|.
|
||||
float Compiled with support for |Float|.
|
||||
fname_case Case in file names matters (for MS-DOS and Windows
|
||||
this is not present).
|
||||
fname_case Case in file names matters (for Windows this is not
|
||||
present).
|
||||
folding Compiled with |folding| support.
|
||||
footer Compiled with GUI footer support. |gui-footer|
|
||||
gettext Compiled with message translation |multi-lang|
|
||||
gui Compiled with GUI enabled.
|
||||
gui_athena Compiled with Athena GUI.
|
||||
gui_gnome Compiled with Gnome support (gui_gtk is also defined).
|
||||
gui_gtk Compiled with GTK+ GUI (any version).
|
||||
gui_gtk2 Compiled with GTK+ 2 GUI (gui_gtk is also defined).
|
||||
gui_mac Compiled with Macintosh GUI.
|
||||
gui_motif Compiled with Motif GUI.
|
||||
gui_running Vim is running in the GUI, or it will start soon.
|
||||
gui_win32 Compiled with MS Windows Win32 GUI.
|
||||
gui_win32s idem, and Win32s system being used (Windows 3.1)
|
||||
iconv Can use iconv() for conversion.
|
||||
insert_expand Compiled with support for CTRL-X expansion commands in
|
||||
Insert mode.
|
||||
@@ -6946,6 +7106,7 @@ statusline Compiled with support for 'statusline', 'rulerformat'
|
||||
syntax Compiled with syntax highlighting support |syntax|.
|
||||
syntax_items There are active syntax highlighting items for the
|
||||
current buffer.
|
||||
tablineat 'tabline' option accepts %@Func@ items.
|
||||
tag_binary Compiled with binary searching in tags files
|
||||
|tag-binary-search|.
|
||||
tag_old_static Compiled with support for old static tags
|
||||
@@ -6970,10 +7131,9 @@ visualextra Compiled with extra Visual mode commands.
|
||||
vreplace Compiled with |gR| and |gr| commands.
|
||||
wildignore Compiled with 'wildignore' option.
|
||||
wildmenu Compiled with 'wildmenu' option.
|
||||
win32 Win32 version of Vim (MS-Windows 95 and later, 32 or
|
||||
64 bits)
|
||||
win32unix Win32 version of Vim, using Unix files (Cygwin)
|
||||
win64 Win64 version of Vim (MS-Windows 64 bit).
|
||||
win32 Windows version of Vim (32 or 64 bit).
|
||||
win32unix Windows version of Vim, using Unix files (Cygwin).
|
||||
win64 Windows version of Vim (64 bit).
|
||||
winaltkeys Compiled with 'winaltkeys' option.
|
||||
windows Compiled with support for more than one window.
|
||||
writebackup Compiled with 'writebackup' default on.
|
||||
@@ -7542,7 +7702,7 @@ This does NOT work: >
|
||||
:unlet v
|
||||
< *E741*
|
||||
If you try to change a locked variable you get an
|
||||
error message: "E741: Value of {name} is locked"
|
||||
error message: "E741: Value is locked: {name}"
|
||||
|
||||
[depth] is relevant when locking a |List| or
|
||||
|Dictionary|. It specifies how deep the locking goes:
|
||||
@@ -8459,7 +8619,7 @@ You can catch all Vim errors by the pattern >
|
||||
*catch-text*
|
||||
NOTE: You should never catch the error message text itself: >
|
||||
:catch /No such variable/
|
||||
only works in the english locale, but not when the user has selected
|
||||
only works in the English locale, but not when the user has selected
|
||||
a different language by the |:language| command. It is however helpful to
|
||||
cite the message text in a comment: >
|
||||
:catch /^Vim(\a\+):E108:/ " No such variable
|
||||
|
@@ -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
|
||||
------------
|
||||
|
@@ -557,6 +557,149 @@ Since the text for this plugin is rather long it has been put in a separate
|
||||
file: |pi_spec.txt|.
|
||||
|
||||
|
||||
SHADA *ft-shada*
|
||||
|
||||
Allows editing binary |shada-file|s in a nice way. Opened binary files are
|
||||
displayed in the following format: >
|
||||
|
||||
Type with timestamp YYYY-mm-ddTHH:MM:SS:
|
||||
% Key__ Description___ Value
|
||||
+ fooba foo bar baz fo {msgpack-value}
|
||||
+ abcde abc def ghi jk {msgpack-value}
|
||||
Other type with timestamp YYYY-mm-ddTHH:MM:SS:
|
||||
@ Description__ Value
|
||||
- foo bar baz t {msgpack-value}
|
||||
# Expected more elements in list
|
||||
Some other type with timestamp YYYY-mm-ddTHH:MM:SS:
|
||||
# Unexpected type: type instead of map
|
||||
= {msgpack-value}
|
||||
|
||||
Filetype plugin defines all |Cmd-event|s. Defined |SourceCmd| event makes
|
||||
"source file.shada" be equivalent to "|:rshada| file.shada". |BufWriteCmd|,
|
||||
|FileWriteCmd| and |FileAppendCmd| events are affected by the following
|
||||
settings:
|
||||
|
||||
*g:shada#keep_old_header* Boolean, if set to false all header entries
|
||||
are ignored when writing. Defaults to 1.
|
||||
*g:shada#add_own_header* Boolean, if set to true first written entry
|
||||
will always be header entry with two values in
|
||||
a map with attached data: |v:version| attached
|
||||
to "version" key and "shada.vim" attached to
|
||||
"generator" key. Defaults to 1.
|
||||
|
||||
Format description:
|
||||
|
||||
1. `#` starts a comment. Lines starting with space characters and then `#`
|
||||
are ignored. Plugin may only add comment lines to indicate some errors in
|
||||
ShaDa format. Lines containing no non-whitespace characters are also
|
||||
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
|
||||
`%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
|
||||
timestamp). {type} is one of
|
||||
1 - Header
|
||||
2 - Search pattern
|
||||
3 - Replacement string
|
||||
4 - History entry
|
||||
5 - Register
|
||||
6 - Variable
|
||||
7 - Global mark
|
||||
8 - Jump
|
||||
9 - Buffer list
|
||||
10 - Local mark
|
||||
11 - Change
|
||||
* - Unknown (0x{type-hex})
|
||||
|
||||
Each type may be represented using Unknown entry: "Jump with timestamp ..."
|
||||
is the same as "Unknown (0x8) with timestamp ....".
|
||||
3. After header there is one of the following lines:
|
||||
1. " % Key__ Description__ Value": map header. After mapping header
|
||||
follows a table which may contain comments and lines consisting of
|
||||
" +", key, description and |{msgpack-value}|. Key is separated by at
|
||||
least two spaces with description, description is separated by at least
|
||||
two spaces with the value. Each key in the map must be at most as wide
|
||||
as "Key__" header: "Key" allows at most 3-byte keys, "Key__" allows at
|
||||
most 5-byte keys. If keys actually occupy less bytes then the rest is
|
||||
filled with spaces. Keys cannot be empty, end with spaces, contain two
|
||||
consequent spaces inside of them or contain multibyte characters (use
|
||||
"=" format if you need this). Descriptions have the same restrictions
|
||||
on width and contents, except that empty descriptions are allowed.
|
||||
Description column may be omitted.
|
||||
|
||||
When writing description is ignored. Keys with values |msgpack#equal|
|
||||
to default ones are ignored. Order of keys is preserved. All keys are
|
||||
treated as strings (not binary strings).
|
||||
|
||||
Note: specifically for buffer list entries it is allowed to have more
|
||||
then one map header. Each map header starts a new map entry inside
|
||||
buffer list because ShaDa buffer list entry is an array of maps. I.e. >
|
||||
|
||||
Buffer list with timestamp 1970-01-01T00:00:00:
|
||||
% Key Description Value
|
||||
+ f file name "/foo"
|
||||
+ l line number 1
|
||||
+ c column 10
|
||||
<
|
||||
is equivalent to >
|
||||
|
||||
Buffer list with timestamp 1970-01-01T00:00:00:
|
||||
= [{="f": "/foo", ="c": 10}]
|
||||
<
|
||||
and >
|
||||
|
||||
Buffer list with timestamp 1970-01-01T00:00:00:
|
||||
% Key Description Value
|
||||
+ f file name "/foo"
|
||||
|
||||
% Key Description Value
|
||||
+ f file name "/bar"
|
||||
<
|
||||
is equivalent to >
|
||||
|
||||
Buffer list with timestamp 1970-01-01T00:00:00:
|
||||
= [{="f": "/foo"}, {="f": "/bar"}]
|
||||
<
|
||||
Note 2: specifically for register entries special syntax for arrays was
|
||||
designed: >
|
||||
|
||||
Register with timestamp 1970-01-01T00:00:00:
|
||||
% Key Description Value
|
||||
+ rc contents @
|
||||
| - "line1"
|
||||
| - "line2"
|
||||
<
|
||||
This is equivalent to >
|
||||
|
||||
Register with timestamp 1970-01-01T00:00:00:
|
||||
% Key Description Value
|
||||
+ rc contents ["line1", "line2"]
|
||||
<
|
||||
Such syntax is automatically used if array representation appears to be
|
||||
too lengthy.
|
||||
2. " @ Description__ Value": array header. Same as map, but key is
|
||||
omitted and description cannot be omitted. Array entries start with
|
||||
" -". Example: >
|
||||
|
||||
History entry with timestamp 1970-01-01T00:00:00:
|
||||
@ Description_ Value
|
||||
- history type SEARCH
|
||||
- contents "foo"
|
||||
- separator '/'
|
||||
<
|
||||
is equivalent to >
|
||||
|
||||
History entry with timestamp 1970-01-01T00:00:00:
|
||||
= [SEARCH, "foo", '/']
|
||||
<
|
||||
Note: special array syntax for register entries is not recognized here.
|
||||
3. " = {msgpack-value}": raw values. |{msgpack-value}| in this case may
|
||||
have absolutely any type. Special array syntax for register entries is
|
||||
not recognized here as well.
|
||||
|
||||
|
||||
SQL *ft-sql*
|
||||
|
||||
Since the text for this plugin is rather long it has been put in a separate
|
||||
|
@@ -362,7 +362,7 @@ zX Undo manually opened and closed folds: re-apply 'foldlevel'.
|
||||
Also forces recomputing folds, like |zx|.
|
||||
|
||||
*zm*
|
||||
zm Fold more: Subtract one from 'foldlevel'. If 'foldlevel' was
|
||||
zm Fold more: Subtract |v:count1| from 'foldlevel'. If 'foldlevel' was
|
||||
already zero nothing happens.
|
||||
'foldenable' will be set.
|
||||
|
||||
@@ -371,7 +371,7 @@ zM Close all folds: set 'foldlevel' to 0.
|
||||
'foldenable' will be set.
|
||||
|
||||
*zr*
|
||||
zr Reduce folding: Add one to 'foldlevel'.
|
||||
zr Reduce folding: Add |v:count1| to 'foldlevel'.
|
||||
|
||||
*zR*
|
||||
zR Open all folds. This sets 'foldlevel' to highest fold level.
|
||||
|
@@ -61,10 +61,6 @@ When the GUI starts up initializations are carried out, in this order:
|
||||
~/.config).
|
||||
The name of the first file found is stored in $MYGVIMRC, unless it was
|
||||
already set.
|
||||
- If the 'exrc' option is set (which is NOT the default) the file ./.ngvimrc
|
||||
is sourced, if it exists and isn't the same file as the system or user
|
||||
gvimrc file. If this file is not owned by you, some security restrictions
|
||||
apply. When ".ngvimrc" is not found, "_ngvimrc" is tried too.
|
||||
|
||||
NOTE: All but the first one are not carried out if Vim was started with
|
||||
"-u NONE" and no "-U" argument was given, or when started with "-U NONE".
|
||||
@@ -212,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*
|
||||
|
||||
@@ -609,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.
|
||||
@@ -681,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
|
||||
@@ -733,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
|
||||
@@ -887,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.
|
||||
@@ -898,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
|
||||
@@ -243,7 +238,7 @@ selection. You can use CTRL-Q instead. You can also use CTRL-Q in Insert
|
||||
mode and Command-line mode to get the old meaning of CTRL-V. But CTRL-Q
|
||||
doesn't work for terminals when it's used for control flow.
|
||||
|
||||
NOTE: The clipboard support still has a number of bugs. See |todo|.
|
||||
NOTE: The clipboard support still has a number of bugs.
|
||||
|
||||
==============================================================================
|
||||
4. Shell Commands *gui-shell-win32*
|
||||
@@ -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|
|
||||
@@ -94,7 +95,6 @@ General subjects ~
|
||||
|tips.txt| various tips on using Vim
|
||||
|message.txt| (error) messages and explanations
|
||||
|quotes.txt| remarks from users of Vim
|
||||
|todo.txt| known problems and desired extensions
|
||||
|develop.txt| development of Vim
|
||||
|debug.txt| debugging Vim itself
|
||||
|uganda.txt| Vim distribution conditions and what to do with your money
|
||||
@@ -160,11 +160,9 @@ Versions ~
|
||||
|vi_diff.txt| Main differences between Vim and Vi
|
||||
*sys-file-list*
|
||||
Remarks about specific systems ~
|
||||
|os_mac.txt| Macintosh
|
||||
|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 Feb 12
|
||||
|
||||
|
||||
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
|
||||
@@ -1359,8 +1367,7 @@ tag command action ~
|
||||
|:number| :nu[mber] print lines with line number
|
||||
|:nunmap| :nun[map] like ":unmap" but for Normal mode
|
||||
|:nunmenu| :nunme[nu] remove menu for Normal mode
|
||||
|:oldfiles| :ol[dfiles] list files that have marks in the ShaDa file
|
||||
|:open| :o[pen] start open mode (not implemented)
|
||||
|:oldfiles| :o[ldfiles] list files that have marks in the ShaDa file
|
||||
|:omap| :om[ap] like ":map" but for Operator-pending mode
|
||||
|:omapclear| :omapc[lear] remove all mappings for Operator-pending mode
|
||||
|:omenu| :ome[nu] add menu for Operator-pending mode
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 7.4. Last change: 2014 Aug 04
|
||||
*insert.txt* For Vim version 7.4. Last change: 2015 Jun 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -77,9 +77,11 @@ CTRL-W Delete the word before the cursor (see |i_backspacing| about
|
||||
joining lines). See the section "word motions",
|
||||
|word-motions|, for the definition of a word.
|
||||
*i_CTRL-U*
|
||||
CTRL-U Delete all entered characters in the current line (see
|
||||
|i_backspacing| about joining lines).
|
||||
|
||||
CTRL-U Delete all entered characters before the cursor in the current
|
||||
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*
|
||||
<Tab> or CTRL-I Insert a tab. If the 'expandtab' option is on, the
|
||||
equivalent number of spaces is inserted (use CTRL-V <Tab> to
|
||||
@@ -1939,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
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
*motion.txt* For Vim version 7.4. Last change: 2014 Feb 11
|
||||
*motion.txt* For Vim version 7.4. Last change: 2015 Jun 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -171,6 +171,8 @@ CTRL-H or *CTRL-H* *<BS>*
|
||||
l or *l*
|
||||
<Right> or *<Right>* *<Space>*
|
||||
<Space> [count] characters to the right. |exclusive| motion.
|
||||
See the 'whichwrap' option for adjusting the behavior
|
||||
at end of line
|
||||
|
||||
*0*
|
||||
0 To the first character of the line. |exclusive|
|
||||
|
@@ -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)
|
||||
|
@@ -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*
|
||||
|
||||
|
@@ -105,6 +105,8 @@ The configuration variables are only processed when the terminal starts, which
|
||||
is why it needs to be done with the |TermOpen| autocmd or setting global
|
||||
variables before the terminal is started.
|
||||
|
||||
There is also a corresponding |TermClose| event.
|
||||
|
||||
The terminal cursor can be highlighted via |hl-TermCursor| and
|
||||
|hl-TermCursorNC|.
|
||||
|
||||
|
@@ -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
|
||||
@@ -50,8 +50,8 @@ achieve special effects. These options come in three forms:
|
||||
: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.
|
||||
default value. The values of 'lines' and 'columns'
|
||||
are not changed.
|
||||
|
||||
*:set-args* *E487* *E521*
|
||||
:se[t] {option}={value} or
|
||||
@@ -183,7 +183,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 +488,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,25 +635,14 @@ 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
|
||||
escape sequence to request cursor position report.
|
||||
|
||||
*'antialias'* *'anti'* *'noantialias'* *'noanti'*
|
||||
'antialias' 'anti' boolean (default: off)
|
||||
global
|
||||
{only available when compiled with GUI enabled
|
||||
on Mac OS X}
|
||||
This option only has an effect in the GUI version of Vim on Mac OS X
|
||||
v10.2 or later. When on, Vim will use smooth ("antialiased") fonts,
|
||||
which can be easier to read at certain sizes on certain displays.
|
||||
Setting this option can sometimes cause problems if 'guifont' is set
|
||||
to its default (empty string).
|
||||
|
||||
*'autochdir'* *'acd'* *'noautochdir'* *'noacd'*
|
||||
'autochdir' 'acd' boolean (default off)
|
||||
global
|
||||
@@ -783,14 +772,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
|
||||
@@ -911,7 +899,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).
|
||||
@@ -980,65 +968,17 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
the newly created file). Also see 'backupcopy' and |crontab|.
|
||||
|
||||
*'balloondelay'* *'bdlay'*
|
||||
'balloondelay' 'bdlay' number (default: 600)
|
||||
global
|
||||
{only available when compiled with the |+balloon_eval|
|
||||
feature}
|
||||
Delay in milliseconds before a balloon may pop up. See |balloon-eval|.
|
||||
'balloondelay' 'bdlay' Removed. {Nvim}
|
||||
|
||||
*'ballooneval'* *'beval'* *'noballooneval'* *'nobeval'*
|
||||
'ballooneval' 'beval' boolean (default off)
|
||||
global
|
||||
{only available when compiled with the |+balloon_eval|
|
||||
feature}
|
||||
Switch on the |balloon-eval| functionality.
|
||||
'ballooneval' 'beval' Removed. {Nvim}
|
||||
|
||||
*'balloonexpr'* *'bexpr'*
|
||||
'balloonexpr' 'bexpr' string (default "")
|
||||
global or local to buffer |global-local|
|
||||
{only available when compiled with the |+balloon_eval|
|
||||
feature}
|
||||
Expression for text to show in evaluation balloon. It is only used
|
||||
when 'ballooneval' is on. These variables can be used:
|
||||
|
||||
v:beval_bufnr number of the buffer in which balloon is going to show
|
||||
v:beval_winnr number of the window
|
||||
v:beval_lnum line number
|
||||
v:beval_col column number (byte index)
|
||||
v:beval_text word under or after the mouse pointer
|
||||
|
||||
The evaluation of the expression must not have side effects!
|
||||
Example: >
|
||||
function! MyBalloonExpr()
|
||||
return 'Cursor is at line ' . v:beval_lnum .
|
||||
\', column ' . v:beval_col .
|
||||
\ ' of file ' . bufname(v:beval_bufnr) .
|
||||
\ ' on word "' . v:beval_text . '"'
|
||||
endfunction
|
||||
set bexpr=MyBalloonExpr()
|
||||
set ballooneval
|
||||
<
|
||||
NOTE: The balloon is displayed only if the cursor is on a text
|
||||
character. If the result of evaluating 'balloonexpr' is not empty,
|
||||
Vim does not try to send a message to an external debugger (Netbeans
|
||||
or Sun Workshop).
|
||||
|
||||
The expression will be evaluated in the |sandbox| when set from a
|
||||
modeline, see |sandbox-option|.
|
||||
|
||||
It is not allowed to change text or jump to another window while
|
||||
evaluating 'balloonexpr' |textlock|.
|
||||
|
||||
To check whether line breaks in the balloon text work use this check: >
|
||||
if has("balloon_multiline")
|
||||
< When they are supported "\n" characters will start a new line. If the
|
||||
expression evaluates to a |List| this is equal to using each List item
|
||||
as a string and putting "\n" in between them.
|
||||
'balloonexpr' 'bexpr' Removed. {Nvim}
|
||||
|
||||
*'belloff'* *'bo'*
|
||||
'belloff' 'bo' string (default "")
|
||||
global
|
||||
{not in Vi}
|
||||
Specifies for which events the bell will not be rung. It is a comma
|
||||
separated list of items. For each item that is present, the bell
|
||||
will be silenced. This is most useful to specify specific events in
|
||||
@@ -1169,8 +1109,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.
|
||||
@@ -1253,6 +1192,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
|
||||
@@ -1418,7 +1360,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
|
||||
@@ -1538,14 +1480,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
(gzipped files for example). Unloaded buffers are not scanned for
|
||||
whole-line completion.
|
||||
|
||||
The default is ".,w,b,u,t,i", which means to scan:
|
||||
1. the current buffer
|
||||
2. buffers in other windows
|
||||
3. other loaded buffers
|
||||
4. unloaded buffers
|
||||
5. tags
|
||||
6. included files
|
||||
|
||||
As you can see, CTRL-N and CTRL-P can be used to do any 'iskeyword'-
|
||||
based expansion (e.g., dictionary |i_CTRL-X_CTRL-K|, included patterns
|
||||
|i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions).
|
||||
@@ -1628,8 +1562,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
1 Each block of concealed text is replaced with one
|
||||
character. If the syntax item does not have a custom
|
||||
replacement character defined (see |:syn-cchar|) the
|
||||
character defined in 'listchars' is used (default is a
|
||||
space).
|
||||
character defined in 'listchars' is used.
|
||||
It is highlighted with the "Conceal" highlight group.
|
||||
2 Concealed text is completely hidden unless it has a
|
||||
custom replacement character defined (see
|
||||
@@ -2141,7 +2074,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 "//"
|
||||
@@ -2197,7 +2130,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}
|
||||
@@ -2219,10 +2152,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.
|
||||
|
||||
@@ -2239,22 +2168,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)
|
||||
@@ -2350,13 +2277,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'exrc'* *'ex'* *'noexrc'* *'noex'*
|
||||
'exrc' 'ex' boolean (default off)
|
||||
global
|
||||
Enables the reading of .nvimrc, .exrc and .ngvimrc in the current
|
||||
directory. If you switch this option on you should also consider
|
||||
setting the 'secure' option (see |initialization|). Using a local
|
||||
.exrc, .nvimrc or .ngvimrc is a potential security leak, use with care!
|
||||
also see |init.vim| and |gui-init|.
|
||||
Enables the reading of .nvimrc and .exrc in the current directory.
|
||||
If you switch this option on you should also consider setting the
|
||||
'secure' option (see |initialization|). Using this option comes
|
||||
with a potential security risk, use with care!
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
Also see |init.vim| and |gui-init|.
|
||||
|
||||
*'fileencoding'* *'fenc'* *E213*
|
||||
'fileencoding' 'fenc' string (default: "")
|
||||
@@ -2411,9 +2338,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}
|
||||
@@ -2453,9 +2378,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.
|
||||
@@ -2470,7 +2394,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
|
||||
@@ -2514,8 +2438,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.
|
||||
@@ -2609,6 +2533,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
|
||||
@@ -2876,10 +2811,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)
|
||||
@@ -2932,14 +2864,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.
|
||||
@@ -3038,28 +2970,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.
|
||||
@@ -3092,7 +3014,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|.
|
||||
@@ -3120,24 +3041,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'.
|
||||
@@ -3145,7 +3054,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
|
||||
@@ -3155,8 +3064,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
|
||||
@@ -3202,10 +3110,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'*
|
||||
@@ -3217,10 +3124,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'*
|
||||
@@ -3252,8 +3157,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'*
|
||||
@@ -3506,54 +3409,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)
|
||||
@@ -3595,8 +3454,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)
|
||||
@@ -3612,25 +3469,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")
|
||||
@@ -3772,7 +3613,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
|
||||
@@ -3823,7 +3664,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
|
||||
@@ -3838,9 +3679,7 @@ 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
|
||||
'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:
|
||||
@@ -3853,8 +3692,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
|
||||
@@ -4143,10 +3981,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
visible in the first column.
|
||||
*lcs-conceal*
|
||||
conceal:c Character to show in place of concealed text, when
|
||||
'conceallevel' is set to 1.
|
||||
'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
|
||||
@@ -4449,7 +4288,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:
|
||||
@@ -4551,12 +4390,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
|
||||
@@ -4569,6 +4408,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.
|
||||
@@ -4632,11 +4474,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.
|
||||
|
||||
|
||||
@@ -5002,18 +4844,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)
|
||||
@@ -5342,8 +5173,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
|
||||
*'shada'* *'sd'* *E526* *E527* *E528*
|
||||
'shada' 'sd' string (Vim default for
|
||||
Win32: '!,100,<50,s10,h,rA:,rB:
|
||||
others: '!,100,<50,s10,h
|
||||
Win32: !,'100,<50,s10,h,rA:,rB:
|
||||
others: !,'100,<50,s10,h
|
||||
Vi default: "")
|
||||
global
|
||||
When non-empty, the shada file is read upon startup and written
|
||||
@@ -5370,9 +5201,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
% When included, save and restore the buffer list. If Vim is
|
||||
started with a file name argument, the buffer list is not
|
||||
restored. If Vim is started without a file name argument, the
|
||||
buffer list is restored from the shada file. Buffers
|
||||
without a file name and buffers for help files are not written
|
||||
to the shada file.
|
||||
buffer list is restored from the shada file. Quickfix
|
||||
('buftype'), unlisted ('buflisted'), unnamed and buffers on
|
||||
removable media (|shada-r|) are not saved.
|
||||
When followed by a number, the number specifies the maximum
|
||||
number of buffers that are stored. Without a number all
|
||||
buffers are stored.
|
||||
@@ -5421,7 +5252,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*
|
||||
@@ -5459,8 +5290,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'
|
||||
@@ -5472,26 +5302,49 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
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.
|
||||
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.
|
||||
|
||||
@@ -5506,7 +5359,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
|
||||
@@ -5530,7 +5383,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
|
||||
@@ -5538,7 +5391,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|.
|
||||
@@ -5603,7 +5456,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
|
||||
@@ -5685,6 +5538,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
|
||||
@@ -5772,8 +5628,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)
|
||||
@@ -6158,11 +6013,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.
|
||||
@@ -6269,7 +6152,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.
|
||||
|
||||
@@ -6277,18 +6160,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 "")
|
||||
@@ -6307,6 +6179,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.
|
||||
|
||||
@@ -6500,18 +6373,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'*
|
||||
@@ -6691,9 +6553,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")
|
||||
@@ -6775,7 +6635,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".
|
||||
|
||||
@@ -7079,7 +6938,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
|
||||
@@ -7094,8 +6953,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)
|
||||
@@ -7263,6 +7121,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:
|
@@ -1,116 +0,0 @@
|
||||
*os_mac.txt* For Vim version 7.4. Last change: 2006 Apr 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar et al.
|
||||
|
||||
|
||||
*mac* *Mac* *macintosh* *Macintosh*
|
||||
|
||||
This file documents the particularities of the Macintosh version of Vim.
|
||||
|
||||
NOTE: This file is a bit outdated. You might find more useful info here:
|
||||
http://macvim.org/
|
||||
|
||||
1. Filename Convention |mac-filename|
|
||||
2. .vimrc an .vim files |mac-vimfile|
|
||||
3. FAQ |mac-faq|
|
||||
4. Known Lack |mac-lack|
|
||||
5. Mac Bug Report |mac-bug|
|
||||
6. Compiling Vim |mac-compile|
|
||||
|
||||
There was a Mac port for version 3.0 of Vim. Here are the first few lines
|
||||
from the old file:
|
||||
|
||||
VIM Release Notes
|
||||
Initial Macintosh release, VIM version 3.0
|
||||
19 October 1994
|
||||
|
||||
Eric Fischer
|
||||
<enf1@midway.uchicago.edu>, <eric@jcp.uchicago.edu>, <etaoin@uchicago.edu>
|
||||
5759 N. Guilford Ave
|
||||
Indianapolis IN 46220 USA
|
||||
|
||||
==============================================================================
|
||||
1. Filename Convention *mac-filename*
|
||||
|
||||
Starting with Vim version 7 you can just use the unix path separators with
|
||||
Vim. In order to determine if the specified filename is relative to the
|
||||
current folder or absolute (i.e. relative to the "Desktop"), the following
|
||||
algorithm is used:
|
||||
|
||||
If the path start by a "/", the path is absolute
|
||||
If the path start by a ":", the path is relative
|
||||
If the path doesn't start by neither a "/" nor ":",
|
||||
and a ":" is found before a "/" then the path is absolute
|
||||
>
|
||||
:e /HD/text
|
||||
:e HD:text
|
||||
< Edit the file "text" of the disk "HD" >
|
||||
:e :src:main.c
|
||||
:e src/main.c
|
||||
< Edit the file "main.c" in the folder "src" in the current folder >
|
||||
:e os_mac.c
|
||||
< Edit the file "os_mac.c" in the current folder.
|
||||
|
||||
You can use the |$VIM| and |$VIMRUNTIME| variable. >
|
||||
|
||||
:so $VIMRUNTIME/syntax/syntax.vim
|
||||
|
||||
==============================================================================
|
||||
2. .vimrc and .vim files *mac-vimfile*
|
||||
|
||||
It is recommended to use Unix style line separators for Vim scripts, thus a
|
||||
single newline character.
|
||||
|
||||
When starting up Vim will load the $VIMRUNTIME/macmap.vim script to define
|
||||
default command-key mappings.
|
||||
|
||||
On older systems files starting with a dot "." are discouraged, thus the rc
|
||||
files are named "vimrc" or "_vimrc" and "gvimrc" or "_gvimrc". These files
|
||||
can be in any format (mac, dos or unix).
|
||||
|
||||
==============================================================================
|
||||
3. Mac FAQ *mac-faq*
|
||||
|
||||
On the internet: http://macvim.org/OSX/index.php#FAQ
|
||||
|
||||
Q: I can't enter non-ASCII character in Apple Terminal.
|
||||
A: Under Window Settings, Emulation, make sure that "Escape non-ASCII
|
||||
characters" is not checked.
|
||||
|
||||
Q: How do I start the GUI from the command line?
|
||||
A: Assuming that Vim.app is located in /Applications:
|
||||
open /Applications/Vim.app
|
||||
Or:
|
||||
/Applications/Vim.app/Contents/MacOS/Vim -g {arguments}
|
||||
|
||||
Q: How can I set $PATH to something reasonable when I start Vim.app from the
|
||||
GUI or with open?
|
||||
A: The following trick works with most shells. Put it in your vimrc file.
|
||||
This is included in the system vimrc file included with the binaries
|
||||
distributed at macvim.org . >
|
||||
let s:path = system("echo echo VIMPATH'${PATH}' | $SHELL -l")
|
||||
let $PATH = matchstr(s:path, 'VIMPATH\zs.\{-}\ze\n')
|
||||
|
||||
==============================================================================
|
||||
4. Mac Lack *mac-lack*
|
||||
|
||||
In a terminal CTRL-^ needs to be entered as Shift-Control-6. CTRL-@ as
|
||||
Shift-Control-2.
|
||||
|
||||
==============================================================================
|
||||
5. Mac Bug Report *mac-bug*
|
||||
|
||||
When reporting any Mac specific bug or feature change, please use the vim-mac
|
||||
maillist |vim-mac|. However, you need to be subscribed. An alternative is to
|
||||
send a message to the current MacVim maintainers:
|
||||
|
||||
mac@vim.org
|
||||
|
||||
==============================================================================
|
||||
6. Compiling Vim *mac-compile*
|
||||
|
||||
See the file "src/INSTALLmac.txt" that comes with the source files.
|
||||
|
||||
|
||||
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
|
139
runtime/doc/pi_msgpack.txt
Normal file
139
runtime/doc/pi_msgpack.txt
Normal file
@@ -0,0 +1,139 @@
|
||||
*pi_msgpack.txt* For NeoVim version 0.1.
|
||||
|
||||
Author: Nikolay Pavlov <kp-pav@yandex.ru>
|
||||
Copyright: (c) 2015 by Nikolay Pavlov
|
||||
|
||||
The Apache license applies to the files in this package, including
|
||||
runtime/autoload/msgpack.vim, runtime/doc/pi_msgpack.txt and
|
||||
test/functional/plugin/msgpack_spec.lua. Like anything else that's free,
|
||||
msgpack.vim 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!
|
||||
|
||||
==============================================================================
|
||||
1. Contents *msgpack.vim-contents*
|
||||
|
||||
1. Contents..............................: |msgpack.vim-contents|
|
||||
2. Msgpack.vim introduction..............: |msgpack.vim-intro|
|
||||
3. Msgpack.vim manual....................: |msgpack.vim-manual|
|
||||
Function arguments....................: |msgpack.vim-arguments|
|
||||
msgpack#is_int function...............: |msgpack#is_int()|
|
||||
msgpack#is_uint function..............: |msgpack#is_uint()|
|
||||
msgpack#strftime function.............: |msgpack#strftime()|
|
||||
msgpack#strptime function.............: |msgpack#strptime()|
|
||||
msgpack#int_dict_to_str function......: |msgpack#int_dict_to_str()|
|
||||
msgpack#special_type function.........: |msgpack#special_type()|
|
||||
msgpack#type function.................: |msgpack#type()|
|
||||
msgpack#deepcopy function.............: |msgpack#deepcopy()|
|
||||
msgpack#string function...............: |msgpack#string()|
|
||||
msgpack#eval function.................: |msgpack#eval()|
|
||||
msgpack#equal function................: |msgpack#equal()|
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. Msgpack.vim introduction *msgpack.vim-intro*
|
||||
|
||||
This plugin contains utility functions to be used in conjunction with
|
||||
|msgpackdump()| and |msgpackparse()| functions.
|
||||
|
||||
==============================================================================
|
||||
3. Msgpack.vim manual *msgpack.vim-manual*
|
||||
|
||||
FUNCTION ARGUMENTS *msgpack.vim-arguments*
|
||||
|
||||
Disambiguation of arguments described below. Note: if e.g. function is listed
|
||||
as accepting |{msgpack-integer}| (or anything else) it means that function
|
||||
does not check whether argument matches its description.
|
||||
|
||||
*{msgpack-value}* Either |msgpack-special-dict| or a regular value, but
|
||||
not function reference.
|
||||
*{msgpack-integer}* Any value for which |msgpack#type| will return
|
||||
"integer".
|
||||
*{msgpack-special-int}* |msgpack-special-dict| representing integer.
|
||||
|
||||
msgpack#is_int({msgpack-value}) *msgpack#is_int()*
|
||||
Returns 1 if given {msgpack-value} is integer value, 0 otherwise.
|
||||
|
||||
msgpack#is_uint({msgpack-value}) *msgpack#is_uint()*
|
||||
Returns 1 if given {msgpack-value} is integer value greater or equal
|
||||
to zero, 0 otherwise.
|
||||
|
||||
*msgpack#strftime*
|
||||
msgpack#strftime({format}, {msgpack-integer}) *msgpack#strftime()*
|
||||
Same as |strftime()|, but second argument may be
|
||||
|msgpack-special-dict|. Requires |+python| or |+python3| to really
|
||||
work with |msgpack-special-dict|s.
|
||||
|
||||
*msgpack#strptime*
|
||||
msgpack#strptime({format}, {time}) *msgpack#strptime()*
|
||||
Reverse of |msgpack#strptime()|: for any time and format
|
||||
|msgpack#equal|( |msgpack#strptime|(format, |msgpack#strftime|(format,
|
||||
time)), time) be true. Requires |+python| or |+python3|, without it
|
||||
only supports non-|msgpack-special-dict| nonnegative times and format
|
||||
equal to `%Y-%m-%dT%H:%M:%S`.
|
||||
|
||||
msgpack#int_dict_to_str({msgpack-special-int}) *msgpack#int_dict_to_str()*
|
||||
Function which converts |msgpack-special-dict| integer value to
|
||||
a hexadecimal value like 0x1234567890ABCDEF (always returns exactly 16
|
||||
hexadecimal digits).
|
||||
|
||||
msgpack#special_type({msgpack-value}) *msgpack#special_type()*
|
||||
Returns zero if {msgpack-value} is not |msgpack-special-dict|. If it
|
||||
is it returns name of the key in |v:msgpack_types| which represents
|
||||
{msgpack-value} type.
|
||||
|
||||
msgpack#type({msgpack-value}) *msgpack#type()*
|
||||
Returns name of the key in |v:msgpack_types| that represents
|
||||
{msgpack-value} type. Never returns zero: this function returns
|
||||
msgpack type which will be dumped by |msgpackdump()| should it receive
|
||||
a list with singe {msgpack-value} as input.
|
||||
|
||||
msgpack#deepcopy({msgpack-value}) *msgpack#deepcopy()*
|
||||
Like |deepcopy()|, but works correctly with |msgpack-special-dict|
|
||||
values. Plain |deepcopy()| will destroy all types in
|
||||
|msgpack-special-dict| values because it will copy _TYPE key values,
|
||||
while they should be preserved.
|
||||
|
||||
msgpack#string({msgpack-value}) *msgpack#string()*
|
||||
Like |string()|, but saves information about msgpack types. Values
|
||||
dumped by msgpack#string may be read back by |msgpack#eval()|.
|
||||
Returns is the following:
|
||||
|
||||
- Dictionaries are dumped as "{key1: value1, key2: value2}". Note:
|
||||
msgpack allows any values in keys, so with some
|
||||
|msgpack-special-dict| values |msgpack#string()| may produce even
|
||||
"{{1: 2}: 3, [4]: 5}".
|
||||
- Lists are dumped as "[value1, value2]".
|
||||
- Strings are dumped as
|
||||
1. `"abc"`: binary string.
|
||||
2. `="abc"`: string.
|
||||
3. `+(10)"ext"`: extension strings (10 may be replaced with any
|
||||
8-bit signed integer).
|
||||
Inside strings the following escape sequences may be present: "\0"
|
||||
(represents NUL byte), "\n" (represents line feed) and "\""
|
||||
(represents double quote).
|
||||
- Floating-point and integer values are dumped using |string()| or
|
||||
|msgpack#int_dict_to_str()|.
|
||||
- Booleans are dumped as "TRUE" or "FALSE".
|
||||
- Nil values are dumped as "NIL".
|
||||
|
||||
msgpack#eval({string}, {dict}) *msgpack#eval()*
|
||||
Transforms string created by |msgpack#string()| into a value suitable
|
||||
for |msgpackdump()|. Second argument allows adding special values
|
||||
that start with head characters (|/\h|) and contain only word
|
||||
characters (|/\w|). Built-in special values are "TRUE", "FALSE",
|
||||
"NIL", "nan" and "inf" and they cannot be overridden. Map values are
|
||||
always evaluated to |msgpack-special-dict| values, as well as
|
||||
hexadecimal digits. When evaluating maps order of keys is preserved.
|
||||
|
||||
*msgpack#equal*
|
||||
msgpack#equal({msgpack-value}, {msgpack-value}) *msgpack#equal()*
|
||||
Returns 1 if given values are equal, 0 otherwise. When comparing
|
||||
msgpack map values order of keys is ignored. Comparing
|
||||
|msgpack-special-dict| with equivalent non-special-dict value
|
||||
evaluates to 1.
|
||||
|
||||
==============================================================================
|
||||
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
|
||||
|
@@ -291,6 +291,100 @@ 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 on one buffer, further
|
||||
buffers will not be visited.
|
||||
The last buffer (or where an error occurred) becomes
|
||||
the current buffer.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
Only valid entries in the quickfix list are used.
|
||||
Note: While this command is executing, the Syntax
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each buffer.
|
||||
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|
||||
|: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.
|
||||
< When the current file can't be |abandon|ed and the [!]
|
||||
is not present, the command fails.
|
||||
When an error is detected on one buffer, further
|
||||
buffers will not be visited.
|
||||
The last buffer (or where an error occurred) becomes
|
||||
the current buffer.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
Only valid entries in the quickfix list are used.
|
||||
Note: While this command is executing, the Syntax
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each buffer.
|
||||
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|
||||
|:cdo|, |:ldo| and |:lfdo|.
|
||||
|
||||
*: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.
|
||||
< When the current file can't be |abandon|ed and the [!]
|
||||
is not present, the command fails.
|
||||
When an error is detected on one buffer, further
|
||||
buffers will not be visited.
|
||||
The last buffer (or where an error occurred) becomes
|
||||
the current buffer.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
Only valid entries in the location list are used.
|
||||
Note: While this command is executing, the Syntax
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each buffer.
|
||||
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|
||||
|:cdo|, |:cfdo| and |:lfdo|.
|
||||
|
||||
*: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.
|
||||
< When the current file can't be |abandon|ed and the [!]
|
||||
is not present, the command fails.
|
||||
When an error is detected on one buffer, further
|
||||
buffers will not be visited.
|
||||
The last buffer (or where an error occurred) becomes
|
||||
the current buffer.
|
||||
{cmd} can contain '|' to concatenate several commands.
|
||||
Only valid entries in the location list are used.
|
||||
Note: While this command is executing, the Syntax
|
||||
autocommand event is disabled by adding it to
|
||||
'eventignore'. This considerably speeds up editing
|
||||
each buffer.
|
||||
Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|,
|
||||
|:cdo|, |:ldo| and |:cfdo|.
|
||||
|
||||
=============================================================================
|
||||
2. The error window *quickfix-window*
|
||||
@@ -493,11 +587,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 +999,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: >
|
||||
|
@@ -600,7 +600,6 @@ Short explanation of each option: *option-list*
|
||||
'allowrevins' 'ari' allow CTRL-_ in Insert and Command-line mode
|
||||
'altkeymap' 'akm' for default second language (Farsi/Hebrew)
|
||||
'ambiwidth' 'ambw' what to do with Unicode chars of ambiguous width
|
||||
'antialias' 'anti' Mac OS X: use smooth, antialiased fonts
|
||||
'autochdir' 'acd' change directory to the file in the current window
|
||||
'arabic' 'arab' for Arabic as a default second language
|
||||
'arabicshape' 'arshape' do shaping for Arabic characters
|
||||
@@ -731,13 +730,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
|
||||
@@ -821,7 +817,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
|
||||
@@ -875,7 +870,6 @@ 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
|
||||
@@ -986,11 +980,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,9 +589,13 @@ 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.
|
||||
|
||||
:prof[ile] stop
|
||||
Write the logfile and stop profiling.
|
||||
|
||||
:prof[ile] pause
|
||||
Don't profile until the following ":profile continue". Can be
|
||||
used when doing something that should not be counted (e.g., an
|
||||
@@ -609,6 +619,9 @@ For example, to profile the one_script.vim script file: >
|
||||
after this command. A :profile command in the script itself
|
||||
won't work.
|
||||
|
||||
:prof[ile] dump
|
||||
Don't wait until exiting Vim and write the current state of
|
||||
profiling to the log immediately.
|
||||
|
||||
:profd[el] ... *:profd* *:profdel*
|
||||
Stop profiling for the arguments specified. See |:breakdel|
|
||||
@@ -652,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:
|
||||
|
||||
|
@@ -28,8 +28,6 @@ More generally, Vim is started with:
|
||||
Option arguments and file name arguments can be mixed, and any number of them
|
||||
can be given. However, watch out for options that take an argument.
|
||||
|
||||
For compatibility with various Vi versions, see |cmdline-arguments|.
|
||||
|
||||
Exactly one out of the following five items may be used to choose how to
|
||||
start editing:
|
||||
|
||||
@@ -219,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.
|
||||
@@ -317,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
|
||||
@@ -356,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
|
||||
@@ -384,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.
|
||||
@@ -396,16 +394,16 @@ 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
|
||||
interpreted.
|
||||
*system-vimrc*
|
||||
a. For Unix, MS-DOS, MS-Windows, and Macintosh, the system vimrc file is
|
||||
read for initializations. The path of this file is shown with the
|
||||
a. For Unix, MS-Windows, and Macintosh, the system vimrc file is read for
|
||||
initializations. The path of this file is shown with the
|
||||
":version" command. Mostly it's "$VIM/vimrc".
|
||||
For the Macintosh the $VIMRUNTIME/macmap.vim is read.
|
||||
|
||||
*VIMINIT* *EXINIT* *$MYVIMRC*
|
||||
b. Four places are searched for initializations. The first that exists
|
||||
@@ -430,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
|
||||
@@ -446,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
|
||||
@@ -479,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.
|
||||
@@ -497,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:
|
||||
@@ -519,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.
|
||||
@@ -709,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.
|
||||
|
||||
@@ -950,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.
|
||||
@@ -1163,13 +1174,14 @@ running) you have additional options:
|
||||
*:wv* *:wviminfo*
|
||||
:wv[iminfo][!] [file] Deprecated alias to |:wshada| command.
|
||||
|
||||
*:ol* *:oldfiles*
|
||||
:ol[dfiles] List the files that have marks stored in the ShaDa
|
||||
*:o* *:ol* *:oldfiles*
|
||||
:o[ldfiles][!] List the files that have marks stored in the ShaDa
|
||||
file. This list is read on startup and only changes
|
||||
afterwards with ":rshada!". Also see |v:oldfiles|.
|
||||
The number can be used with |c_#<|.
|
||||
Use ! to get a file selection prompt.
|
||||
|
||||
:bro[wse] ol[dfiles][!]
|
||||
:bro[wse] o[ldfiles][!]
|
||||
List file names as with |:oldfiles|, and then prompt
|
||||
for a number. When the number is valid that file from
|
||||
the list is edited.
|
||||
@@ -1232,6 +1244,8 @@ exactly four MessagePack objects:
|
||||
With |shada-h| or 'nohlsearch'
|
||||
this key is always false.
|
||||
sp Binary N/A Actual pattern. Required.
|
||||
sb Boolean false True if search direction is
|
||||
backward.
|
||||
* any none Other keys are allowed for
|
||||
compatibility reasons, see
|
||||
|shada-compatibility|.
|
||||
|
@@ -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 Mar 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.
|
||||
@@ -1130,6 +1131,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 +3307,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*
|
||||
|
||||
@@ -4236,7 +4265,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 +4533,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 +4658,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 +4681,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 +4707,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 +4895,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 +4904,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>*
|
||||
|
4903
runtime/doc/todo.txt
4903
runtime/doc/todo.txt
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
@@ -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.
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user